This NPC will require players to donate zeny and reach the asking global donation target. when they reach it the server will change its rates to floating rates of EXP: 5x~8x and DROP: 1x~1.5x .. My problem here is im stuck in the initiation and timer of this script.
This event should run for about 3 hours and every 60minutes the rates will change ... Also, there will be an announcement when the event is done.
Your help will be well appreciated guys .. Thank You !!
valk_hall,97,92,6 script Global Exp Amplifier#EventFloatingRates 10308,{
mes .npc$;
mes "Current funds collected:";
mes "~ [^0000ff" + callfunc("F_InsertComma",$collected_funds) + "^000000] Zeny";
mes "Target global funds:";
mes "~ [^0000ff" + callfunc("F_InsertComma",.target_funds) + "^000000] Zeny";
mes ""+callfunc("F_InsertComma",$donation_missing)+" more Zeny to reach target the funds.";
next;
switch (select("Donate Zeny", "Cancel")) {
case 1:
mes .npc$;
mes "Please input your desired amount.";
next;
input .@donation;
if (.@donation < 1) {
mes .npc$;
mes "Input number greater than 0.";
end;
}
if (.@donation < .min_donation_zeny) {
mes .npc$;
mes "Minimum donation amount is "+callfunc("F_InsertComma",.min_donation_zeny)+".";
end;
}
switch(select("Change Amount:Confirm")) {
case 1:
.@donation = 0;
next;
goto Change_Amount;
end;
case 2:
if (Zeny < .@donation) {
mes .npc$;
mes "Sorry, but you don't have enough";
mes "zeny to donate.";
end;
}
if (.@donation > $donation_missing) {
mes .npc$;
mes "The amount you entered will exceed on remaining balance.";
mes "Remaining Balance: "+callfunc("F_InsertComma",$donation_missing)+" Zeny";
mes "^ff0000*Please input exact amount next time*.";
end;
}
mes .npc$;
mes "Zeny has been succesfully transfered.";
Zeny -= .@donation;
$collected_funds += .@donation;
$donation_missing -= .@donation;
if ($collected_funds >= .target_funds) {
$collected_funds = 0;
announce ""+.npc$+": We reached our target funds! Activating Floating Rates Event...",bc_all,0xFF6060;
donpcevent strnpcinfo(3)+"::OnStart";
}
end;
}
}
OnStart:
OnInit:
.npc$ = "[Global Exp Amplifier]";
.target_funds = 1000000;
.min_donation_zeny = 10000;
$donation_missing = .target_funds - $collected_funds;
}
Question
Eross
Hi guys, I need help for my ongoing scripting.
This NPC will require players to donate zeny and reach the asking global donation target. when they reach it the server will change its rates to floating rates of EXP: 5x~8x and DROP: 1x~1.5x .. My problem here is im stuck in the initiation and timer of this script.
This event should run for about 3 hours and every 60minutes the rates will change ... Also, there will be an announcement when the event is done.
Your help will be well appreciated guys .. Thank You !!
valk_hall,97,92,6 script Global Exp Amplifier#EventFloatingRates 10308,{ mes .npc$; mes "Current funds collected:"; mes "~ [^0000ff" + callfunc("F_InsertComma",$collected_funds) + "^000000] Zeny"; mes "Target global funds:"; mes "~ [^0000ff" + callfunc("F_InsertComma",.target_funds) + "^000000] Zeny"; mes ""+callfunc("F_InsertComma",$donation_missing)+" more Zeny to reach target the funds."; next; switch (select("Donate Zeny", "Cancel")) { case 1: mes .npc$; mes "Please input your desired amount."; next; input .@donation; if (.@donation < 1) { mes .npc$; mes "Input number greater than 0."; end; } if (.@donation < .min_donation_zeny) { mes .npc$; mes "Minimum donation amount is "+callfunc("F_InsertComma",.min_donation_zeny)+"."; end; } switch(select("Change Amount:Confirm")) { case 1: .@donation = 0; next; goto Change_Amount; end; case 2: if (Zeny < .@donation) { mes .npc$; mes "Sorry, but you don't have enough"; mes "zeny to donate."; end; } if (.@donation > $donation_missing) { mes .npc$; mes "The amount you entered will exceed on remaining balance."; mes "Remaining Balance: "+callfunc("F_InsertComma",$donation_missing)+" Zeny"; mes "^ff0000*Please input exact amount next time*."; end; } mes .npc$; mes "Zeny has been succesfully transfered."; Zeny -= .@donation; $collected_funds += .@donation; $donation_missing -= .@donation; if ($collected_funds >= .target_funds) { $collected_funds = 0; announce ""+.npc$+": We reached our target funds! Activating Floating Rates Event...",bc_all,0xFF6060; donpcevent strnpcinfo(3)+"::OnStart"; } end; } } OnStart: OnInit: .npc$ = "[Global Exp Amplifier]"; .target_funds = 1000000; .min_donation_zeny = 10000; $donation_missing = .target_funds - $collected_funds; }
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.