Jump to content
  • 0

Happy Hour Exp Event Timer


Nokia

Question


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  150
  • Reputation:   5
  • Joined:  12/28/11
  • Last Seen:  

Hi there, i wanna make an event (only can start by gms), to start an exp event for all maps for 1 hour, i heard about the exp mapflag but i think the floating rates script would be the best way to do that. well i just dont know how to add the timer there, for example, thats what my npc looks like if hes finish:

mes hi

if gm lvl(xx):

menu start event

else:

mes your not a gm

start:

setbattleflag("base_exp_rate",60); //actually my server rates are 50x so 60 would be 10%more

setbattleflag("job_exp_rate",60);

announce "10% exp event has started"

timer:

after 1 hour: <--- i dont know how to do this ^^'

->

setbattleflag("base_exp_rate",50);

setbattleflag("job_exp_rate",50);

announce "10% exp event has ended"

// do i need @reloadmobdb for this? or only for drop rates?

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  218
  • Reputation:   16
  • Joined:  01/24/12
  • Last Seen:  

I made this script in like 5-10 minutes. I don't know if it'll work or not. But you can try this out! Haha. If it works please don't remove the header.


//===== eAthena Script =======================================
//= Happy Hour EXP
//===== By: ==================================================
//= Eden
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= eAthena
//===== Description: =========================================
//= I've put in a input label so you can manually put in rates
//============================================================
prontera,150,150,4 script Happy Hour EXP 714,{
mes "[Happy Hour EXP]";
if(getgmlevel()<99) goto L_reg;
mes "Hello! What would you like to do?";
menu "Start the Floating Rates",-,"Nothing",gtfo;
next;
mes "[Happy Hour EXP]";
mes "Please input how much % you'd like to increase the base exp by.";
input ##base$;
next;
mes "[Happy Hour EXP]";
mes "Please input how much % you'd like to increase the job exp by.";
input ##job$;
next;
mes "[Happy Hour EXP]";
mes "You are about to increase the base level exp by - "+##base$+" and the job level exp by - "+##base$+"";
menu "Yes.",-,"No.",gtfo;
announce "Happy Hour EXP: "+strcharinfo(0)+" has started the floating rates. The rates have been increased with the following.. Base - "+##base$+" Job - "+##job$+"",0;
setbattleflag "base_exp_rate",##base$;
setbattleflag "job_exp_rate",##job$;
set ##expevent,1;
close;

L_reg:
mes "I'm sorry but you aren't a GM. Please wait until a game-master starts this event.";
close;

gtfo:
close;
}
- script HappyHourEnd -1,{

OnInit:
if (##expevent == 1) {
setbattleflag "base_exp_rate",50; // Change the 50 back to your original base exp rate.
setbattleflag "job_exp_rate",50; // Change the 50 back to your original job exp rate.
end;
}


OnMinute60:
if (##expevent == 1) {
setbattleflag "base_exp_rate",50; // Change the 50 back to your original base exp rate.
setbattleflag "job_exp_rate",50; // Change the 50 back to your original job exp rate.
announce "Happy Hour EXP: The floating rates have been changed back to the original rates!",0;
end;
}
}

Edited by Eden
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

Eden, wrong. You use global account variables... ~.~

Nokia, look this. I made two versions.

Enjoy

1. Without %% rates increase. Link

2. With %% rates increase. Link

P.S.: sorry, if my english is bad :)

Link to comment
Share on other sites


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

OnTimer600000: // After 1 hour

LOL ? Are you sure that is 1 Hours ?? /dum

600000 = 600 Seconds = 10 Minutes

the correct 1 should be

OnTimer3600000

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

the correct 1 should be

OnTimer3600000

LOL!!!:)

Thx! Fixed.~

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  150
  • Reputation:   5
  • Joined:  12/28/11
  • Last Seen:  

Yeah i's working. What about adding drop rates event and a function to stop it any time?

example:

Start Exp Rates

Start Drop Rates

Stop Event //

Edit: I got some warnings, not sure if they are important:

newbitmapimageljj.png

Edited by Nokia
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

U can use this script:

prontera,150,180,5 script Happy Hour EXP::HHE 100,{
OnWhisperGlobal:
mes "[Happy Hour EXP]";
if(getgmlevel()>=.Access){
mes "Hello! What would you like to do?";
switch(select("Start the Floating Rates:Stop Event:Nothing")){
case 1:
mes " ";
mes "Cerrent Base Rate: "+getbattleflag("base_exp_rate")/100;
mes "How much % you'd like to increase Base Rates?";
input .@BaseExp;
next;
mes "[Happy Hour EXP]";
mes "Cerrent Job Rate: "+getbattleflag("job_exp_rate")/100;
mes "How much % you'd like to increase Job Rates?";
input .@JobExp;
next;
mes "[Happy Hour EXP]";
mes "New rates:";
mes "Base: "+((getbattleflag("base_exp_rate") / 100 *.@BaseExp + getbattleflag("base_exp_rate"))/100);
mes "Job: "+((getbattleflag("job_exp_rate") / 100 * .@JobExp + getbattleflag("job_exp_rate"))/100);
switch(select("Start:Close")){
case 1:
setbattleflag "base_exp_rate",getbattleflag("base_exp_rate") / 100 *.@BaseExp + getbattleflag("base_exp_rate");
setbattleflag "job_exp_rate",getbattleflag("job_exp_rate") / 100 * .@JobExp + getbattleflag("job_exp_rate");
set .Event,1;
initnpctimer;
mes "Event started";
announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+(getbattleflag("base_exp_rate")/100)+"x, Job - "+(getbattleflag("job_exp_rate")/100)+"x",0;
close;
break;

default:
close;
}
break;

case 2:
if(.Event == 1) goto L_STOP;
else {
mes "Event not started";
close;
}
break;

default:
close;
}
} else {
mes "You aren't a GM.";
close;
}
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;
close;

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

or whispers only script:


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

npc:HHE

Commands: Start, Stop.

Edit: I got some warnings, not sure if they are important

I forget about checking of started event. I fix it. Follow the links.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  150
  • Reputation:   5
  • Joined:  12/28/11
  • Last Seen:  

you missed the last } in the first script, but thanks i'm testing it now.

edit: how can i change the announce to show the %exp?

example, for now its:

"Happy Hour EXP: Floating rates event started. New rates: Base - "+(getbattleflag("base_exp_rate")/100)+"x, Job - "+(getbattleflag("job_exp_rate")/100)+"x",0;

but i want this: The Exp rates increased by xx% for 1 hour. // not the whole rates

edit2: nvm solved, i used +.@BaseExp+ in the announce, but the oninit part isent working, if i reloadscript the rates are not going back to normal, i must @reloadbattleconf everytime., stop event is not working for me also.

another thing, my rates are 50x and if i input 10%, it only applys 5x more, so 50x rates +10% = 55x rates.

its working now so far, only problem is this error if a player click the npc: "fatal error player not attached!"

Edited by Nokia
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  150
  • Reputation:   5
  • Joined:  12/28/11
  • Last Seen:  

is there a way to show o the npc "last time used" ?

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...