Multi selection reward

mrlongshen

Noobies
Messages
1,126
Points
0
Age
36
Location
localhost 127.0.0.1
Emulator
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

 

Attachments

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. 

 
Last edited by a moderator:
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 
default_sob.gif


 
try this hope statisfies your need

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

}
 
Last edited by a moderator:
@@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.

Code:
[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."
 
Last edited by a moderator:
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

Code:
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;
	
}
 
Back
Top