Jump to content
  • 0

retrieved item name


Kawacito

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.01
  • Content Count:  33
  • Reputation:   2
  • Joined:  04/16/21
  • Last Seen:  

 

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

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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 by Emistry
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.01
  • Content Count:  33
  • Reputation:   2
  • Joined:  04/16/21
  • Last Seen:  

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...