Jump to content
  • 0
Sign in to follow this  
Petey Pablo

hourly reward error

Question

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

 

//===== 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:
			[email protected] = #HReward + 1;
			explode([email protected]$,.Rewards$[[email protected]],",");
			for([email protected] = y = 0; [email protected] < [email protected]; [email protected]++)
				[email protected][[email protected]] = atoi([email protected]$[[email protected]]);
			if(.Mode & 1 && ([email protected][4] > 0 || [email protected][4] > 0)){
				[email protected] = getarraysize([email protected]);
				for([email protected] = 4; [email protected] <= [email protected] - 1 ; [email protected] += 2){
					[email protected][[email protected]] = [email protected][[email protected]];
					[email protected][[email protected]] = [email protected][[email protected] + 1];
					[email protected]++;
				}
				if(checkweight2([email protected],[email protected])){
					for([email protected] = 0; [email protected] < [email protected]; [email protected]++){
						if(.Mode & 32)
							getitembound  [email protected][[email protected]], [email protected][[email protected]], .Bound_Mode;
						else	getitem  [email protected][[email protected]], [email protected][[email protected]];
					}
				} else {
					message strcharinfo(0),"[Hourly Rewards]: You cannot carry the prizes, please use storage and reuse command.";
					end;
				}
			}
			if(.Mode & 2 && ([email protected][1])){
				#Hourlypoint += [email protected][1];
				message strcharinfo(0),"[Hourly Rewards]: Recieved "+ [email protected][1] +" "+.Points$;
			}
			if(.Mode & 4 && ([email protected][0])){
				zeny += [email protected][0];
				message strcharinfo(0),"[Hourly Rewards]: Recieved "+ [email protected][0] +"z";
			}
			if(.Mode & 8 && ([email protected][3] || [email protected][4]))
				getexp [email protected][3], [email protected][4];
			#HReward++;
			erasequest 61000;
		case -1:
			[email protected] = getarraysize(.Rewards$);
			if(#HReward >= [email protected]){
				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
}

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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 

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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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