Kawacito Posted April 23, 2023 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 33 Reputation: 2 Joined: 04/16/21 Last Seen: May 31, 2023 Share Posted April 23, 2023 My question is how do I get the NAME and ID of the item that this function gives me and then add it to the npc dialog? function script Omegabox { specialeffect2 39; setarray .Omega[0],42000,42005,42010; set .Random, getarraysize( .Omega); rentitem .Omega[ rand( .Random) ], 1 * 259200; mes" Congratulations, you get a "NAME ITEM" "; if ("ID ITEM" = 42000){ set #ONE, #ONE+ 1; mes "You have a total of"+ #ONE+" Points"; } if ("ID ITEM" = 42005){ set #TWO, #TWO+ 1; mes "You have a total of"+ #TWO+" Points"; } if ("ID ITEM" = 42010){ set #THREE, #THREE + 1; mes "You have a total of"+ #THREE +" Points"; } close; end; } Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted April 24, 2023 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2368 Joined: 10/28/11 Last Seen: Tuesday at 02:49 PM Share Posted April 24, 2023 (edited) function script Omegabox { specialeffect2 39; setarray .@Omega[0],42000,42005,42010; set .@Random, getarraysize( .@Omega); .@item_id = .@Omega[ rand( .@Random) ]; rentitem .@item_id, 1 * 259200; mes" Congratulations, you get a "+getitemname(.@item_id); if (.@item_id = 42000){ set #ONE, #ONE+ 1; mes "You have a total of"+ #ONE+" Points"; } if (.@item_id = 42005){ set #TWO, #TWO+ 1; mes "You have a total of"+ #TWO+" Points"; } if (.@item_id = 42010){ set #THREE, #THREE + 1; mes "You have a total of"+ #THREE +" Points"; } close; } try Edited April 24, 2023 by Emistry Quote Link to comment Share on other sites More sharing options...
0 Kawacito Posted April 25, 2023 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 33 Reputation: 2 Joined: 04/16/21 Last Seen: May 31, 2023 Author Share Posted April 25, 2023 5 hours ago, Emistry said: function script Omegabox { specialeffect2 39; setarray .@Omega[0],42000,42005,42010; set .@Random, getarraysize( .@Omega); .@item_id = .@Omega[ rand( .@Random) ]; rentitem .@item_id, 1 * 259200; mes" Congratulations, you get a "+getitemname(.@item_id); if (.@item_id = 42000){ set #ONE, #ONE+ 1; mes "You have a total of"+ #ONE+" Points"; } if (.@item_id = 42005){ set #TWO, #TWO+ 1; mes "You have a total of"+ #TWO+" Points"; } if (.@item_id = 42010){ set #THREE, #THREE + 1; mes "You have a total of"+ #THREE +" Points"; } close; } try thank you very much it worked for me! Now I have a new question, in the event that I have 100 different items, how can I summarize this part to have a (set #POINTS) without having to do 1 x 1 if (.@item_id = 42000){ set #ONE, #ONE+ 1; mes "You have a total of"+ #ONE+" Points"; } if (.@item_id = 42005){ set #TWO, #TWO+ 1; mes "You have a total of"+ #TWO+" Points"; } if (.@item_id = 42010){ set #THREE, #THREE + 1; mes "You have a total of"+ #THREE +" Points"; } This is the question. I have more than 100 items and I would like for example: When I get the item 40000 I get 1 point and I save it, so for each item that comes out of the box I would like to summarize that part without having to do 1 x 1 Quote Link to comment Share on other sites More sharing options...
Question
Kawacito
My question is how do I get the NAME and ID of the item that this function gives me and then add it to the npc dialog?
function script Omegabox {
specialeffect2 39;
setarray .Omega[0],42000,42005,42010;
set .Random, getarraysize( .Omega);
rentitem .Omega[ rand( .Random) ], 1 * 259200;
mes" Congratulations, you get a "NAME ITEM" ";
if ("ID ITEM" = 42000){ set #ONE, #ONE+ 1; mes "You have a total of"+ #ONE+" Points"; }
if ("ID ITEM" = 42005){ set #TWO, #TWO+ 1; mes "You have a total of"+ #TWO+" Points"; }
if ("ID ITEM" = 42010){ set #THREE, #THREE + 1; mes "You have a total of"+ #THREE +" Points"; }
close;
end;
}
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.