Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Rappelz > Rappelz Private Server
You last visited: Today at 10:04

  • Please register to post and access all features, it's quick, easy and FREE!

 

[Help]How can I know what item I got.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2013
Posts: 15
Received Thanks: 1
[Help]How can I know what item I got.

I made a custom item which is like random box.
Then, I want to know what item I got from the box when I open the box. Do you know what I mean?

For example, when you open a creature random box, you may see the message ("You use creature random box." and "You gain 1 ***.") in the chat.

However, when I open my box, no message shows. Just like "You use ***." So how can I write script for adding a message like "You gain 1 ***."? Please anyone help me if you know about this.



monoedge is offline  
Old   #2
 
elite*gold: 0
Join Date: Oct 2012
Posts: 124
Received Thanks: 12
You must register and activate your account in order to view images.

use Lua Script like :


Code:
function randomboxp()
insert_item(id,1)
end
I guess that's what you want


Regards


MrStubborn is offline  
Old   #3
 
elite*gold: 0
Join Date: Oct 2010
Posts: 2,557
Received Thanks: 2,415
Code:
function randombox()
local rand = math.random(1,100)

    if rand > 1 and rand < 15 then
    insert_item(id,1)
    cprint("You have received: item_name, item_amount")
    elseif rand > 10 and rand < 25 then
    insert_item(id,1)
    cprint("You have received: item_name, item_amount")
    end
end
ismokedrow is offline  
Old   #4
 
elite*gold: 0
Join Date: Feb 2013
Posts: 15
Received Thanks: 1
Thank you very much it works!!!!!!!!!!


monoedge is offline  
Old   #5
 
elite*gold: 0
Join Date: Oct 2010
Posts: 2,557
Received Thanks: 2,415
No problem, if you want more and more random chances, just keep adding elseif clauses (REMEMBER DO NOT PUT AN END ON AN ELSEIF unless it is the VERY LAST elseif.
ismokedrow is offline  
Old   #6
 
elite*gold: 0
Join Date: Feb 2013
Posts: 15
Received Thanks: 1
Ya, I'm just adding elseif clauses now
Thank you!!
monoedge is offline  
Old   #7
 
elite*gold: 0
Join Date: Jun 2011
Posts: 304
Received Thanks: 177
Hardcore people mess with dropgroups. Just sayin'
SilentBill is offline  
Thanks
2 Users
Old   #8
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,570
Received Thanks: 1,154
Quote:
Originally Posted by monoedge View Post
I made a custom item which is like random box.
Then, I want to know what item I got from the box when I open the box. Do you know what I mean?

For example, when you open a creature random box, you may see the message ("You use creature random box." and "You gain 1 xxx.") in the chat.

However, when I open my box, no message shows. Just like "You use xxx." So how can I write script for adding a message like "You gain 1 xxx."? Please anyone help me if you know about this.
Funny ideas in this thread^^

You must register and activate your account in order to view images.

What about checking existing items like the creature random box^^

Official Way:
1. create 1 dropgroup with all items that should be in the box
2. create the item
3. add the dropgroup to the item via opt_var

Everything is done.

If you want to use .lua scripting...there is one command get_itemname_by_id

Code:
function randombox()
  
  --Array that contains the items
  local giftarray =
  {item_id1,item_id2,item_id3,item_id4,item_id5,item_id6,item_id7,item_id8,
  item_id9,item_id10,item_id11,item_id12,item_id13,item_id14,item_id15,item_id16}

  --Randompointer for the Item (16 because it's the count of the array)
  local randompointer = math.random(1,16)

  --Randomitemcount (min and max count you want to use)
  local itemcount = math.random(1,5) 

  --insert the item
  insert_item(giftarray[randompointer],itemcount,0,0,2)

  --Show a Message with Itemname and count
  whisper(gv("name"),"You gained "..itemcount.."x "
  ..get_item_name_by_code(normalgiftarray[normalpointer]).."")

end
This is doing nearly the same as a Dropgroup via .lua.
c1ph3r is offline  
Thanks
1 User
Old   #9
 
elite*gold: 0
Join Date: Feb 2013
Posts: 15
Received Thanks: 1
Quote:
Originally Posted by c1ph3r View Post
Funny ideas in this thread^^

You must register and activate your account in order to view images.

What about checking existing items like the creature random box^^

Official Way:
1. create 1 dropgroup with all items that should be in the box
2. create the item
3. add the dropgroup to the item via opt_var

Everything is done.

If you want to use .lua scripting...there is one command get_itemname_by_id

Code:
function randombox()
  
  --Array that contains the items
  local giftarray =
  {item_id1,item_id2,item_id3,item_id4,item_id5,item_id6,item_id7,item_id8,
  item_id9,item_id10,item_id11,item_id12,item_id13,item_id14,item_id15,item_id16}

  --Randompointer for the Item (16 because it's the count of the array)
  local randompointer = math.random(1,16)

  --Randomitemcount (min and max count you want to use)
  local itemcount = math.random(1,5) 

  --insert the item
  insert_item(giftarray[randompointer],itemcount,0,0,2)

  --Show a Message with Itemname and count
  whisper(gv("name"),"You gained "..itemcount.."x "
  ..get_item_name_by_code(normalgiftarray[normalpointer]).."")

end
This is doing nearly the same as a Dropgroup via .lua.
Ya this is also very helpful for me
In order to use script_text, I deleted value in opt_type and var. So I'm creating lua scrip. Also sealed creatures are including in the box so I thought it's better to create a script.

Anyway, thank you very much!!!!


monoedge is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
[HowTo]Item verkaufen -> Yang bekommen, Käufer bekommt kein Item!
Hallo, Ich weiß einer von euch kennt das bestimmt es wurde eine Item gekauft aus dem Laden ihr habt Bezahlt und ihr habt den Item nicht... ich werde...
22 Replies - Metin2 Guides & Templates
[Suche] Komplette item.eix/epk, icon.eix/epk, item proto und item list
Hey =) Wie die Überschrift schon sagt, suche ich eine komplette item.eix/epk, icon.eix/epk, item proto und item list am liebsten noch von den Waffen...
6 Replies - Metin2 PServer - Discussions / Questions



All times are GMT +1. The time now is 10:04.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.