Jump to content
  • 0

Question

Posted

 

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;
}

2 answers to this question

Recommended Posts

  • 0
Posted (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 by Emistry
  • 0
Posted
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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...