Advertisement
Guest User

bghappy command

a guest
Aug 16th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. - script bghappy_1 -1,{
  2. OnInit:
  3. bindatcmd "bghappy", strnpcinfo( 3 ) + "::OnBGHappyhour", 40, 99;
  4. end;
  5.  
  6. OnBGHappyhour:
  7.  
  8. // ---[ Bonus Rates ]-----------
  9. .@rate = atoi( .@atcmd_parameters$[ 0 ] );
  10. .minutes = atoi( .@atcmd_parameters$[ 1 ] );
  11. setbattleflag "bg_reward_rates", 100 + .@rate;
  12.  
  13. if( .@rate ) {
  14. .@ranked = 1;
  15. dispbottom "Battlegrounds Happyhour +" + .@rate + "% mode is ON for " + .minutes +" minutes.";
  16. } else {
  17. .@ranked = 0;
  18. dispbottom "Battlegrounds Happyhour mode is OFF.";
  19. }
  20.  
  21. setbattleflag "bg_ranked_mode", .@ranked;
  22.  
  23. // ---[ Bonus Minutes ]-----------
  24. if ( .minutes )
  25. {
  26. initnpctimer "" + strnpcinfo(0) + "";
  27. }
  28. end;
  29.  
  30. OnTimer60000:
  31. .minutes = .minutes - 1;
  32. if ( .minutes == 0 )
  33. {
  34. .@ranked = 0;
  35. announce "Battlegrounds Happyhour mode is OFF.",0,0x00FF00;
  36. setbattleflag "bg_reward_rates", 100;
  37. setbattleflag "bg_ranked_mode", 0;
  38. stopnpctimer;
  39. end;
  40. }
  41. announce "" + .minutes + " minutes left to end Battlegrounds Happyhour.",0x00FF00;
  42. stopnpctimer;
  43. initnpctimer;
  44. end;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement