Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Rappelz > Rappelz Private Server
You last visited: Today at 06:09

  • 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 02/27/2013, 15:02   #2
 
elite*gold: 0
Join Date: Oct 2012
Posts: 124
Received Thanks: 12


use Lua Script like :


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


Regards


MrStubborn is offline  
Old 02/27/2013, 15:14   #3
 
elite*gold: 0
Join Date: Oct 2010
Posts: 2,555
Received Thanks: 2,426
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 02/27/2013, 16:13   #4
 
elite*gold: 0
Join Date: Feb 2013
Posts: 15
Received Thanks: 1
Thank you very much it works!!!!!!!!!!


monoedge is offline  
Old 02/27/2013, 16:34   #5
 
elite*gold: 0
Join Date: Oct 2010
Posts: 2,555
Received Thanks: 2,426
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 02/27/2013, 16:57   #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 02/28/2013, 05:44   #7
 
elite*gold: 0
Join Date: Jun 2011
Posts: 305
Received Thanks: 177
Hardcore people mess with dropgroups. Just sayin'
SilentBill is offline  
Thanks
2 Users
Old 02/28/2013, 08:36   #8
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,572
Received Thanks: 1,159
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^^



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 02/28/2013, 13:44   #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^^



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



« [HELP] How can i fix Decompose issue? | Help »

Similar Threads
[HowTo]Item verkaufen -> Yang bekommen, Käufer bekommt kein Item!
12/16/2012 - Metin2 Guides & Templates - 22 Replies
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 euch sagen wie das ganze Funktioniert. Ihr braucht ein "Lag Switch", dafür gibt es viele Tutorials wie ihr das macht. Um ein Lag Switch zu Bauen braucht ihr: • 1x Lan Kabel • Messer • Schalter • Brain
[Suche] Komplette item.eix/epk, icon.eix/epk, item proto und item list
12/25/2010 - Metin2 PServer - Discussions / Questions - 6 Replies
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 von .darki und den ganzen neuen Rüstungen/Schilden/Helmen, da ich überhaupt nicht weiß wie man dass zB mit der item proto macht und wenn ich sie einfach nur ersetze, wie zB durch die "Waffen" item proto von .darki sind die ganzen neuen Rüstungen weg .... Ich hoffe irgendjemand könnte das machen, weil es bestimmt nicht nur für mich hilfreich ist...



All times are GMT +1. The time now is 06:09.


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

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