Jump to content
  • 0

HELP Happy Hour event


Quesooo

Question


  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.08
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

How to make this script to automated event?

- Event will run everyday 2x at 10:00 and 16:00

no need to whisper the NPC. here's the script

thank you for those who help ?

-	script	HHE	-1,{
end;

OnWhisperGlobal:
if(getgmlevel()<.Access) end;
if(@whispervar0$ == "Start"){
if(.Event == 1){
dispbottom "Event already started";
end;
} else {
dispbottom "Input New Base Rate";
input .@BaseExp;
dispbottom "Input New Job Rate";
input .@JobExp;
setbattleflag "base_exp_rate",.@BaseExp*100;
setbattleflag "job_exp_rate",.@JobExp*100;
dispbottom "Event has been started.";
initnpctimer;
set .Event,1;
announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+.@BaseExp+"x, Job - "+.@JobExp+"x",0;
}
end;
}
if(@whispervar0$ == "Stop"){
if(.Event == 1) goto L_STOP;
else dispbottom "Event not started.";
end;
}

end;

OnInit:
set .DefaultBaseRates,getbattleflag("base_exp_rate");
set .DefaultJobRates,getbattleflag("job_exp_rate");
set .Access,80; // GM access lvl
end;

OnTimer3600000: // After 1 hour
L_STOP:
set .Event,0;
stopnpctimer;
setbattleflag "base_exp_rate",.DefaultBaseRates;
setbattleflag "job_exp_rate",.DefaultJobRates;
announce "Happy Hour EXP: The floating rates event have been ended. Rates back to the normal.",0;
end;
}

 

Edited by Quesooo
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.08
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

Anyone can give me a hint how to make this automated? ? 

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

-	script	HHE	-1,{

OnInit:
	set .DefaultBaseRates,getbattleflag("base_exp_rate");
	set .DefaultJobRates,getbattleflag("job_exp_rate");
	set .Access,80; // GM access lvl
OnTimer3600000: // After 1 hour
OnStop:
	stopnpctimer;
	set .Event,0;
	callsub(L_Start, .DefaultBaseRates, .DefaultJobRates);
	end;

OnClock1000:
OnClock1600:
	callsub(L_Start, 2, 2); // 2x
	end;

OnWhisperGlobal:
	if (getgmlevel() < .Access) end;
	if (@whispervar0$ == "Start") {
		if (.Event == 1) {
			dispbottom "Event already started";
		} 
		else {
			dispbottom "Input New Base Rate";
			input .@BaseExp;
			dispbottom "Input New Job Rate";
			input .@JobExp;
			callsub(L_Start, .@BaseExp, .@JobExp);
		}
		end;
	}
	else if (@whispervar0$ == "Stop") {
		if (.Event == 1) {
			donpcevent strnpcinfo(3)+"::OnStop";
		}
		else dispbottom "Event not started.";
		end;
	}
	end;

L_Start:
	.@BaseExp = getarg(0, 1);
	.@JobExp = getarg(0, 1);
	
	if (.@BaseExp < 1) .@BaseExp = 1;
	if (.@JobExp < 1) .@JobExp = 1;
	
	setbattleflag "base_exp_rate",.@BaseExp*100;
	setbattleflag "job_exp_rate",.@JobExp*100;
	dispbottom "Event has been started.";
	initnpctimer;
	set .Event,1;
	announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+.@BaseExp+"x, Job - "+.@JobExp+"x",0;
	return;
}

try

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.08
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

10 minutes ago, Emistry said:

-	script	HHE	-1,{

OnInit:
	set .DefaultBaseRates,getbattleflag("base_exp_rate");
	set .DefaultJobRates,getbattleflag("job_exp_rate");
	set .Access,80; // GM access lvl
OnTimer3600000: // After 1 hour
OnStop:
	stopnpctimer;
	set .Event,0;
	callsub(L_Start, .DefaultBaseRates, .DefaultJobRates);
	end;

OnClock1000:
OnClock1600:
	callsub(L_Start, 2, 2); // 2x
	end;

OnWhisperGlobal:
	if (getgmlevel() < .Access) end;
	if (@whispervar0$ == "Start") {
		if (.Event == 1) {
			dispbottom "Event already started";
		} 
		else {
			dispbottom "Input New Base Rate";
			input .@BaseExp;
			dispbottom "Input New Job Rate";
			input .@JobExp;
			callsub(L_Start, .@BaseExp, .@JobExp);
		}
		end;
	}
	else if (@whispervar0$ == "Stop") {
		if (.Event == 1) {
			donpcevent strnpcinfo(3)+"::OnStop";
		}
		else dispbottom "Event not started.";
		end;
	}
	end;

L_Start:
	.@BaseExp = getarg(0, 1);
	.@JobExp = getarg(0, 1);
	
	if (.@BaseExp < 1) .@BaseExp = 1;
	if (.@JobExp < 1) .@JobExp = 1;
	
	setbattleflag "base_exp_rate",.@BaseExp*100;
	setbattleflag "job_exp_rate",.@JobExp*100;
	dispbottom "Event has been started.";
	initnpctimer;
	set .Event,1;
	announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+.@BaseExp+"x, Job - "+.@JobExp+"x",0;
	return;
}

try

Thank you @Emistry already tried the script but it seems like the rates going to increase more for example my default rates is x8x8 and when i load the npc it becomes x3000x3000

do i need to edit some line or i edit some line incorrectly?

Base on my understanding this line should be change to what exp or job rates should be when the event starts
 

	setbattleflag "base_exp_rate",.@BaseExp*100;
	setbattleflag "job_exp_rate",.@JobExp*100;

 

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

-	script	HHE	-1,{

OnInit:
	set .DefaultBaseRates,getbattleflag("base_exp_rate");
	set .DefaultJobRates,getbattleflag("job_exp_rate");
	set .Access,80; // GM access lvl
OnTimer3600000: // After 1 hour
OnStop:
	stopnpctimer;
	set .Event,0;
	callsub(L_Start, .DefaultBaseRates, .DefaultJobRates);
	end;

OnClock1000:
OnClock1600:
	callsub(L_Start, (.DefaultBaseRates * 2), (.DefaultJobRates * 2)); // 2x
	end;

OnWhisperGlobal:
	if (getgmlevel() < .Access) end;
	if (@whispervar0$ == "Start") {
		if (.Event == 1) {
			dispbottom "Event already started";
		} 
		else {
			dispbottom "Input New Base Rate";
			input .@BaseExp;
			dispbottom "Input New Job Rate";
			input .@JobExp;
			callsub(L_Start, .@BaseExp, .@JobExp);
		}
		end;
	}
	else if (@whispervar0$ == "Stop") {
		if (.Event == 1) {
			donpcevent strnpcinfo(3)+"::OnStop";
		}
		else dispbottom "Event not started.";
		end;
	}
	end;

L_Start:
	.@BaseExp = getarg(0, 1);
	.@JobExp = getarg(0, 1);
	
	if (.@BaseExp < 1) .@BaseExp = 1;
	if (.@JobExp < 1) .@JobExp = 1;
	
	setbattleflag "base_exp_rate",.@BaseExp*100;
	setbattleflag "job_exp_rate",.@JobExp*100;
	dispbottom "Event has been started.";
	initnpctimer;
	set .Event,1;
	announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+(.@BaseExp / 100)+"x, Job - "+(.@JobExp / 100)+"x",0;
	return;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.08
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

13 hours ago, Emistry said:

-	script	HHE	-1,{

OnInit:
	set .DefaultBaseRates,getbattleflag("base_exp_rate");
	set .DefaultJobRates,getbattleflag("job_exp_rate");
	set .Access,80; // GM access lvl
OnTimer3600000: // After 1 hour
OnStop:
	stopnpctimer;
	set .Event,0;
	callsub(L_Start, .DefaultBaseRates, .DefaultJobRates);
	end;

OnClock1000:
OnClock1600:
	callsub(L_Start, (.DefaultBaseRates * 2), (.DefaultJobRates * 2)); // 2x
	end;

OnWhisperGlobal:
	if (getgmlevel() < .Access) end;
	if (@whispervar0$ == "Start") {
		if (.Event == 1) {
			dispbottom "Event already started";
		} 
		else {
			dispbottom "Input New Base Rate";
			input .@BaseExp;
			dispbottom "Input New Job Rate";
			input .@JobExp;
			callsub(L_Start, .@BaseExp, .@JobExp);
		}
		end;
	}
	else if (@whispervar0$ == "Stop") {
		if (.Event == 1) {
			donpcevent strnpcinfo(3)+"::OnStop";
		}
		else dispbottom "Event not started.";
		end;
	}
	end;

L_Start:
	.@BaseExp = getarg(0, 1);
	.@JobExp = getarg(0, 1);
	
	if (.@BaseExp < 1) .@BaseExp = 1;
	if (.@JobExp < 1) .@JobExp = 1;
	
	setbattleflag "base_exp_rate",.@BaseExp*100;
	setbattleflag "job_exp_rate",.@JobExp*100;
	dispbottom "Event has been started.";
	initnpctimer;
	set .Event,1;
	announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+(.@BaseExp / 100)+"x, Job - "+(.@JobExp / 100)+"x",0;
	return;
}

 

Still not working do i need to change some line or just use this script?

Link to comment
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.   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...