hourly reward error

Petey Pablo

New member
Messages
224
Points
0
Emulator
hourly reward error

[Error]: script error in file 'npc/custom/hourly_reward.txt' line 26 column 19
parse_simpleexpr: unmatched ')'
24: {
25: OnHourCmnd:
* 26: switch(checkquest(61000,PLAYTIME)){
~~~~~~~~~~~~~~~~~~~~~~~~~^
27: case 2:
28: .@NextHour = #HReward + 1;
29: explode(.@XT$,.Rewards$[.@NextHour],",");




this is the script

Code:
//===== EinherjarRO Scripts ================================== 
//= Hourly Rewards
//===== By: ================================================== 
//= Stolao
//===== Current Version: =====================================
//= 2.00
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
//= A reward system for players for every hour of play up to
//= a limited number of hours a week, each character will have
//= a unique 
//===== Todo =================================================
//= Suggestions?
//===== Comments: ============================================
//=   quest_db.txt
//=	61000,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Hourly Rewards Cooldown"
//===== Additional Comments: =================================
//= 2.00 Remake using Quest DB
//===== Contact Info: ========================================
//= [Stolao] 
//= Email: [email protected]
//============================================================
prontera,5,5,5	script	Hourly	4_M_CRU_HEAD,{
OnHourCmnd:
	switch(checkquest(61000,PLAYTIME)){
		case 2:
			.@NextHour = #HReward + 1;
			explode(.@XT$,.Rewards$[.@NextHour],",");
			for(.@x = y = 0; .@x < .@Size; .@x++)
				.@TT[.@x] = atoi(.@XT$[.@x]);
			if(.Mode & 1 && (.@TT[4] > 0 || .@vip[4] > 0)){
				.@Size = getarraysize(.@TT);
				for(.@x = 4; .@x <= .@Size - 1 ; .@x += 2){
					.@itms[.@y] = .@TT[.@x];
					.@qnts[.@y] = .@TT[.@x + 1];
					.@y++;
				}
				if(checkweight2(.@itms,.@qnts)){
					for(.@x = 0; .@x < .@y; .@x++){
						if(.Mode & 32)
							getitembound  .@itms[.@x], .@qnts[.@x], .Bound_Mode;
						else	getitem  .@itms[.@x], .@qnts[.@x];
					}
				} else {
					message strcharinfo(0),"[Hourly Rewards]: You cannot carry the prizes, please use storage and reuse command.";
					end;
				}
			}
			if(.Mode & 2 && (.@TT[1])){
				#Hourlypoint += .@TT[1];
				message strcharinfo(0),"[Hourly Rewards]: Recieved "+ .@TT[1] +" "+.Points$;
			}
			if(.Mode & 4 && (.@TT[0])){
				zeny += .@TT[0];
				message strcharinfo(0),"[Hourly Rewards]: Recieved "+ .@TT[0] +"z";
			}
			if(.Mode & 8 && (.@TT[3] || .@TT[4]))
				getexp .@TT[3], .@TT[4];
			#HReward++;
			erasequest 61000;
		case -1:
			.@Size = getarraysize(.Rewards$);
			if(#HReward >= .@Size){
				message strcharinfo(0),"[Hourly Rewards]: No more rewards remaining this week, .";
				end;
			}
			setquest 61000;
			end;
		case 0:
		case 1:
			message strcharinfo(0),"[Hourly Rewards]: Rewards not ready again yet.";
			end;
	}

OnHour00:
	if(gettime(DT_DAYOFWEEK) == SUNDAY){
		query_sql("DELETE FROM `acc_reg_num` WHERE `key` = '#HReward'");
		addrid(0);
		#HReward = 0;
	}
	end;

OnInit:
	// Basic Settings
	//   1: Item | 2: Points | 4: Zeny | 8: Exp
	//   16: Item Rewards Bound
	//     (a bit value, e.g. 3 = Items & Points from Multi)
	.Mode = 1|2|4|16;

	// Item Binding Mode
	//	 Bound_Account : Account Bound item
	//	 Bound_Guild   : Guild Bound item
	//	 Bound_Party   : Party Bound item
	//	 Bound_Char    : Character Bound item
	.Bound_Mode = Bound_Account;

	// To disable the command '@loginreward' comment the next lines
	// * Needs extra commands for typos
	bindatcmd("hourly",strnpcinfo(3)+"::OnHourCmnd",0,99);
	bindatcmd("hourlyreward",strnpcinfo(3)+"::OnHourCmnd",0,99);

	// Point Name
	.Points$ = "Hourly Points";

	// Hourly Prize items:
	//   "<Zeny>,<Points>,<BaseExp>,<JobExp>,<itemID-1>,<amount-1>,<itemID-2>,<amount-2>...etc", // Hour 1
	//   "<Zeny>,<Points>,<BaseExp>,<JobExp>,<itemID-1>,<amount-1>,<itemID-2>,<amount-2>...etc"  // Hour 2
	//   ...;
	// Total length of any days string must be 255 or shorter
	// This is total hours collected per week, max possible is 167
	setarray .Rewards$[1],
		"1000,1",			// Hour 1: 1000 Zeny + 1 #Hourlypoint
		"0,1,0,0,501,5",		// Hour 2: 5 Red Potion
		"0,1,0,0,506,5",		// Hour 3: 5 Green Potion
		"2000,1",			// Hour 4: 2000 Zeny
		"2000,1",			// Hour 5: 2000 Zeny
		"0,1,0,0,502,5",		// Hour 6: 5 Orange Potion
		"0,1,0,0,12208,1",		// Hour 7: 1 Battle Manual
		"2500,1",			// Hour 8: 2500 Zeny
		"2500,1",			// Hour 8: 2500 Zeny
		"2500,1",			// Hour 9: 2500 Zeny
		"0,1,0,0,503,5",		// Hour 10: 5 White Potion
		"2500,1",			// Hour 11: 2500 Zeny
		"2500,1",			// Hour 12: 2500 Zeny
		"2500",				// Hour 13: 2500 Zeny
		"0,1,0,0,503,5,506,3",		// Hour 14: 5 White Potion + 3 Green Potion
		"2500,1",			// Hour 15: 2500 Zeny
		"2500,1",			// Hour 16: 2500 Zeny
		"2500,1",			// Hour 17: 2500 Zeny
		"0,1,0,0,503,5,506,3",		// Hour 18: 5 White Potion + 3 Green Potion
		"2500,1",			// Hour 19: 2500 Zeny
		"2500,1",			// Hour 20: 2500 Zeny
		"0,1,0,0,604,3",		// Hour 21: 1 Dead Branch
		"2500,1",			// Hour 22: 2500 Zeny
		"0,1,0,0,503,5,506,3",		// Hour 23: 5 White Potion + 3 Green Potion
		"2500,1";			// Hour 24: 2500 Zeny
}
 
If you are using Hercules you should use below

*questprogress(<ID>{, <type>})

If no additional argument supplied, return the state of the quest:
0 = Quest not started (not in quest log)
1 = Quest has been given
2 = Quest completed

If <type> PLAYTIME is supplied:
0 = Quest not started (not in quest log)
1 = The time limit has not yet been reached
2 = The time limit has been reached

If <type> HUNTING is supplied:
0 = Quest not started (not in quest log)
1 = Player hasn't killed all of the target monsters
2 = Player has killed all of the target monsters


if rAthena, then use below 

*checkquest(<ID>{,PLAYTIME|HUNTING{,<char_id>}})

If no additional argument supplied, return the state of the quest:
-1 = Quest not started (not in quest log)
0 = Quest has been given, but the state is "inactive"
1 = Quest has been given, and the state is "active"
2 = Quest completed

If parameter "PLAYTIME" is supplied:
-1 = Quest not started (not in quest log)
0 = the time limit has not yet been reached
1 = the time limit has not been reached but the quest is marked as complete
2 = the time limit has been reached

If parameter "HUNTING" is supplied:
-1 = Quest not started (not in quest log)
0 = you haven't killed all of the target monsters and the time limit has not been reached.
1 = you haven't killed all of the target monsters but the time limit has been reached.
2 = you've killed all of the target monsters


Tried the script and no error was given to me 

 
Back
Top