Jump to content
  • 0
mrlongshen

Multi selection reward

Question

Hello. I plan to give multi reward to my player that are based on char account. The event is :

 

  1. Loyal Reward
  2. LoL Reward

 

I have make some simple script. The npc should give the reward. So after player redeem Loyal Reward, the reward choose will remove from the selection. And back to the second reward selection And last message will be, there is no more reward you can redeem.

 

Below the script I make, can someone help me to fix the problem?

 

eventreward.txt

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
gonryun,162,126,4	script	Event Reward	4_F_OPERATION,{

	if(#sorry == 1) {
		
		mes "Hey! you Already Get Reward From Me.";
		mes "Sorry I Cant Give You Anymore Again More Than 1 Times.";
		next;
		mes "I dont Care You Crying Or Not. Tell You Mom Also Me not Scare~wu!!";
		emotion e_bzz;
		close;
	}
	if(#sorry == 2) {
		emotion e_bzz;
		close;
	}
	mes "Please select which reward you want:";
	next;
	switch(select("Loyal Reward:LoL Reward")) {
	case 1:
	getitem 607,1;
	set #sorry, 1;
    break;
	case 2:
	getitem 607,1;
	set #sorry, 2;
}
close;
	emotion e_thx;
	close2;
	end;
}

Try this.. >.< but need to edit more.. i forgot how to link it to go the LoL Reward. 

Edited by ROWar

Share this post


Link to post
Share on other sites
  • 0

 

gonryun,162,126,4	script	Event Reward	4_F_OPERATION,{

	if(#sorry == 1) {
		
		mes "Hey! you Already Get Reward From Me.";
		mes "Sorry I Cant Give You Anymore Again More Than 1 Times.";
		next;
		mes "I dont Care You Crying Or Not. Tell You Mom Also Me not Scare~wu!!";
		emotion e_bzz;
		close;
	}
	if(#sorry == 2) {
		emotion e_bzz;
		close;
	}
	mes "Please select which reward you want:";
	next;
	switch(select("Loyal Reward:LoL Reward")) {
	case 1:
	getitem 607,1;
	set #sorry, 1;
    break;
	case 2:
	getitem 607,1;
	set #sorry, 2;
}
close;
	emotion e_thx;
	close2;
	end;
}

Try this.. >.< but need to edit more.. i forgot how to link it to go the LoL Reward. 

 

please help me masta  :sob:

Share this post


Link to post
Share on other sites
  • 0

try this hope statisfies your need

 

gonryun,162,126,4	script	Event Reward	4_F_OPERATION,{

	while(1) {
		if (!#Loyal_Reward && !#LoL_Reward)
			.@menu$ = "Loyal Reward:LoL Reward";
		else if (!#Loyal_Reward && #LoL_Reward)
			.@menu$ = "Loyal Reward:"
		else if (#Loyal_Reward && !#LoL_Reward)
			.@menu$ = ":LoL Reward";
		else if (#Loyal_Reward && #LoL_Reward) {
			mes "There is no more reward you can redeem."
			close2;
			emotion e_bzzz;
			end;
		}
		mes "Please select which reward you want to redeem";
		next;
		switch(select(.@menu$)) {
			case 1:
				getitem 607,1;
				#Loyal_Reward = 1;
				break;
			case 2:
				getitem 607,1;
				#LoL_Reward = 1;
				break;
		}
	}

}
Edited by Litro

Share this post


Link to post
Share on other sites
  • 0

@@Litro omg. I cant understand it. can u explain more. how can i add 10 case in there ? 

I have try this.

I get an error.

 

[Error]: script error in file '(DIRECT INPUT)' line 8 column 3 
    parse_line: need ';' 
     5:                         .@menu$ = "Loyal Reward:LoL Reward"; 
     6:                 else if (!#Loyal_Reward && #LoL_Reward) 
     7:                         .@menu$ = "Loyal Reward:" 
*    8:                 else if (#Loyal_Reward && !#LoL_Reward) 
        ~~~~~~~~~~~~~~~~^ 
     9:                         .@menu$ = ":LoL Reward"; 
    10:                 else if (#Loyal_Reward && #LoL_Reward) { 
    11:                         mes "There is no more reward you can redeem." 
Edited by mrlongshen

Share this post


Link to post
Share on other sites
  • 0

it missing ';' like the script parser showed you on line 7

change

.@menu$ = "Loyal Reward:"

into

.@menu$ = "Loyal Reward:";

from what i understand from your request is when player click the npc, the npc will show the list reward he can claim, after the reward claimed the menu will be hidden or removed

 

if you want to add more case on it my be some thing like this

gonryun,162,126,4	script	Event Reward	4_F_OPERATION,{

	if (.error) {
		mes "Script Configuration Error Please Fix it";
		close;
	}
	while(1) {
		.@menu$ = "";
		for (.@i = 0; .@i < getarraysize(.reward_menu$); ++.@i) {
			if (getd(.reward_var$[.@i])) .@menu$ += ":";
			else {
				.@menu$ += .reward_menu$[.@i]+":";
				.@[member=check] = 1;
			}
		}
		if (!.@[member=check]) {
			mes "There is no more reward you can redeem.";
			close2;
			emotion e_bzzz;
			end;
		}
		mes "Please select which reward you want to redeem";
		next;
		.@select = select(.@menu$);
		switch(.@select) {
			default:
				mes "Error On: "+.reward_menu$[(.@select-1)]+" did not have a case label";
				close;
			case 1:
				getitem 607,1;
				break;
			case 2:
				getitem 607,1;
				break;	
		}
		setd .reward_var$[(.@select-1)], 1;
	}

OnInit:
	setarray .reward_menu$, "Loyal Reward", "LoL Reward";
	setarray .reward_var$ , "#Loyal_Reward", "#LoL_Reward";
	if (getarraysize(.reward_menu$) != getarraysize(.reward_var$))
		.error = 1;
	end;
	
}

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.