Jump to content
  • 0

Give Item out of Array or more - get "another item" Help Please.


trickerytrickery

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   1
  • Joined:  12/30/13
  • Last Seen:  

Scenario :

 

Array full of Items 

 

If Player has one or more Items of the Array, he will get 1 reward, if he has 2 he gets 2 rewards etc etc. // And gets the items he has deleted ofcourse.

 

I cant get it to work, could anyone help me out?

 

 


testmap_,10,191,6	script	Item Trader	494,{
	set .npcname$, "[Item Trader]";
	
	mes .npcname$;
	mes "Would you like to exchange Customs for Souls?";
	menu "Sure!",-,"Not now...", EXIT;
	next;
	mes "For each item you have on this list:";
	mes "#1 - Tier 2 Equips !REMOVE CARDS BEFOR!";
	mes "I'll reward you with one Soul!";
	mes "ARE YOU REALLY SURE?";
	mes "LIKE REALLY REALLY SURE?";
	mes "Please remove your Cards beforhand !";
	mes "Last Warning ! you can abort with @go 0 !"
	mes "Okay... Ready";	
	next;
	mes "Let's get started.";
	next;
	mes "...";

	setarray .@itemlist[0],21267,21264,22734,21261,22739,21265,21334,21330,21329,21325,21336,21324,5361,20628,20645,20619,20690,20615;
	set .@reward, 0;
	set .@count, 0;
	
	for( set .@i,0; .@i < getarraysize(.@itemlist); set .@i,.@i + 1 )
		{
			if(countitem(.@itemlist[.@i]) >= 1)
				set .@count, .@count + 1;
				set .@reward, .@reward + .@count;
		}

	if (.@count > 0)
			{
				mes "Alright! Here you go!";
				for( set .@i,0; .@i < getarraysize(.@itemlist); set .@i,.@i + 1 )
					{
							set .@countdel, countitem(.@itemlist[.@i]);
							delitem .@itemlist[.@i], .@countdel;
					}
				getitem 7701,.@reward;
				close;
			}
	else
			{
			goto NOITEM;
			}

	NOITEM:
		next;
		mes .npcname$;
		mes "Do not try to fool me! You do not have any of the items I require!";
		close;

	EXIT:
		next;
		mes .npcname$;
		mes "Please do return again!";
		close;

}
Edited by trickerytrickery
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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...