Jump to content
  • 0

Castle Reward


Bringer

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  745
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

poring_w02,93,102,4	script	Castle Rewards	871,{
    if ( agitcheck() ) {
        mes "[WoE Reward]";
        mes "A war is currently in progress";
        close;
    }
    set .@menu, select(.menu$) -1;
    if ( getcastledata( .castlemap$[.@menu], 1) == getcharid(2) ) {
        if ( $castle_claimed & pow(2, .@menu) ) {
            mes "[WoE Reward]";
            mes "Your guild already received the reward for "+ .castlename$[.@menu];
            close;
        }
        else if ( getguildmasterid( getcharid(2) ) == getcharid(0) ) {
            mes "[WoE Reward]";
            mes "Receiving the reward for "+ .castlename$[.@menu];
            getitem 677, 300;
            set $castle_claimed, $castle_claimed | pow(2, .@menu);
            close;
        }
        else {
            mes "[WoE Reward]";
            mes "Ask your guild master to see me";
            close;
        }
    }
    mes "[WoE Reward]";
    mes "Your guild failed to take "+ .castlename$[.@menu];
    mes "if your guild owned a castle ask your guild master to claim reward from me";
    close;
OnInit:
    setarray .castlemap$,
	"prtg_cas01","prtg_cas02","prtg_cas03";
    for ( set .@i, 0; .@i < 3; set .@i, .@i +1 ) {
        set .castlename$[.@i], getcastlename(.castlemap$[.@i]);
        set .menu$, .menu$ + .castlename$[.@i] +":";
    }
OnClock1200:
    set $castle_claimed, 0; // everytime woe ends the variable resets
    end;    
}

Every time the server restarts and/or we reload scripts all guildmasters are still receiving castle rewards even if it was already claimed by them, therefore getting double rewards whenever we reload scripts or restart the server

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


}

end;// <-- add this

OnClock1200:

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