Advertisement
Capuche

Buff_guild_woe

May 8th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. //===== rAthena Script =======================================
  2. //= Buff Guild
  3. //===== By: ==================================================
  4. //= Capuche
  5. //===== Current Version: =====================================
  6. //= 1.0
  7. //===== Compatible With: =====================================
  8. //= rAthena SVN
  9. //===== Description: =========================================
  10. //= Buff all guild members in the same map of the guild leader
  11. //= during the woe.
  12. //= Have a cooldown of 10 mins.
  13. //= Only talk to guild leader.
  14. //============================================================
  15.  
  16. // ~~~~~ show time left in days, hours, minutes and seconds ~~~~~
  17. function script timeleft__ {
  18. if ( ( .@left = getarg(0) ) <= 0 ) return getarg(0);
  19. .@day = .@left / 86400;
  20. .@hour = .@left % 86400 / 3600;
  21. .@min = .@left % 3600 / 60;
  22. .@sec = .@left % 60;
  23. if ( .@day )
  24. return .@day +" day "+ .@hour +" hour";
  25. else if ( .@hour )
  26. return .@hour +" hour "+ .@min +" min";
  27. else if ( .@min )
  28. return .@min +" min "+ .@sec +" sec";
  29. else
  30. return .@sec +" sec";
  31. }
  32.  
  33. prontera,166,185,6 script ghjkl 56,{
  34.  
  35. if( !getcharid(2) ) {
  36. dispbottom "you are not in a guild !";
  37. end;
  38. }
  39. else if( getguildmaster( getcharid(2) ) != strcharinfo(0) ) {
  40. dispbottom "I only talk to your guildmaster, go away !";
  41. end;
  42. }
  43. else if( cooldown_g > gettimetick(2) ) {
  44. dispbottom "You must wait "+ callfunc( "timeleft__", cooldown_g - gettimetick(2) );
  45. end;
  46. }
  47. .@size = query_sql( "SELECT name FROM guild_member WHERE guild_id = "+ getcharid(2), .@name$ );
  48. .@map_leader$ = strcharinfo(3);
  49. for( .@i = 0; .@i < .@size; .@i++ )
  50. if( !getmapxy( .@map$, .@x, .@y, 0, .@name$[.@i] ) && .@map$ == .@map_leader$ ) {
  51. .@s_name$[.@count] = .@name$[.@i];
  52. .@count++;
  53. }
  54. if( Zeny < .cost * .@count ) end;
  55. Zeny = Zeny - .cost * .@count;
  56. cooldown_g = gettimetick(2) + 60 * 10;// 10min - should restricted @changegm during woe
  57. for( .@i = 0; .@i < .@count; .@i++ ) {
  58. attachrid( getcharid( 3,.@s_name$[.@i] ) );
  59. percentheal 100,100;
  60. specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,5;
  61. specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,5;
  62. }
  63. end;
  64. OnAgitstart:
  65. OnAgitstart2:
  66. enablenpc strnpcinfo(0);
  67. end;
  68. OnInit:
  69. .cost = 1000; // Zeny/member
  70. OnAgitEnd:
  71. OnAgitEnd2:
  72. disablenpc strnpcinfo(0);
  73. end;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement