yuhsing

Untitled

May 1st, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. prontera,163,85,3 script WoE Reward 582,{
  2. .@guild_id = getcharid(2);
  3.  
  4. if( agitcheck() ){
  5. mes "A war is currently in progress";
  6. mes "If your guild owned a castle ask your guild master to see me to claim the reward";
  7. }else if( !.@guild_id ){
  8. mes "You are not inside any guild.";
  9. }else if( getguildmasterid( .@guild_id ) != getcharid(0) ){
  10. mes "only guild leader can claim items.";
  11. }else if( getcastledata( "prtg_cas03",1 ) != .@guild_id ){
  12. mes "Your guild failed to take this castle";
  13. mes "If your guild owned a castle ask your guild master to claim reward from me";
  14. }else if( $castle_claimed ){
  15. mes "Your guild already received the reward for this castle";
  16. }else{
  17. mes "All Online member will be able to gain these rewards..";
  18. mes "Are you sure everyone is here now ??";
  19. if( select( "Nope.","Confirm" ) == 1 ){
  20. $castle_claimed = 1;
  21. .@size = query_sql( "SELECT `account_id`,`char_id` FROM `guild_member` WHERE `guild_id` = '"+.@guild_id+"'",.@aid,.@cid );
  22. for( .@i = 0; .@i < .@size; .@i++ )
  23. if( isloggedin( .@aid[.@i],.@cid[.@i] ) ){
  24. // all online member get rewards.
  25. getitem 512,1,.@aid[.@i];
  26. getitem 512,2,.@aid[.@i];
  27. getitem 512,3,.@aid[.@i];
  28. }
  29. }
  30. }
  31. close;
  32.  
  33. OnAgitEnd:
  34. set $castle_claimed[1], 0; // everytime woe ends the variable resets
  35. end;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment