|
You last visited: Today at 00:15
Advertisement
[Help]How can I know what item I got.
Discussion on [Help]How can I know what item I got. within the Rappelz Private Server forum part of the Rappelz category.
02/27/2013, 14:11
|
#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.
|
|
|
02/27/2013, 15:02
|
#2
|
elite*gold: 0
Join Date: Oct 2012
Posts: 130
Received Thanks: 13
|
use Lua Script like :
Code:
function randomboxp()
insert_item(id,1)
end
I guess that's what you want
Regards
|
|
|
02/27/2013, 15:14
|
#3
|
elite*gold: 0
Join Date: Oct 2010
Posts: 2,555
Received Thanks: 2,460
|
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
|
|
|
02/27/2013, 16:13
|
#4
|
elite*gold: 0
Join Date: Feb 2013
Posts: 15
Received Thanks: 1
|
Thank you very much it works!!!!!!!!!!
|
|
|
02/27/2013, 16:34
|
#5
|
elite*gold: 0
Join Date: Oct 2010
Posts: 2,555
Received Thanks: 2,460
|
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.
|
|
|
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!!
|
|
|
02/28/2013, 05:44
|
#7
|
elite*gold: 0
Join Date: Jun 2011
Posts: 305
Received Thanks: 178
|
Hardcore people mess with dropgroups. Just sayin'
|
|
|
02/28/2013, 08:36
|
#8
|
elite*gold: 0
Join Date: Sep 2008
Posts: 1,606
Received Thanks: 1,210
|
Quote:
Originally Posted by monoedge
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.
|
|
|
02/28/2013, 13:44
|
#9
|
elite*gold: 0
Join Date: Feb 2013
Posts: 15
Received Thanks: 1
|
Quote:
Originally Posted by c1ph3r
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!!!!
|
|
|
 |
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 Private Server - 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 00:16.
|
|