viewing paste Unknown #580 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
prontera,147,165,4  script  Team Wars::teamwar  899,{
 
if (getgmlevel() >= 99){
    menu "standard Menu",standard,"Reset Team Wars",lend;
}
standard:
set $@members,2; // number of party members
set @start,0;
 
    getpartymember (getcharid(1));
    set @partymembercount,$@partymembercount;
    mes " "+ @partymembercount;
    if ( @partymembercount==$@members) {
        mes "Hello "+strcharinfo(0)+" what do you want?";
        if (($@TeamID1!=0) && ($@TeamID2!=0)) 
        {
            mes "The Sign Ups are currently unavailable because a match is in progress. Don't hesitate to try again in a few minutes!";
            close;
        }
        if ( getpartyleader(getcharid(1),2) != getcharid(0) )
        {
            mes "Only party leader have the right to sign up / out from the game with me..";
            close;
        }
            mes "Choose your team to register.";
            switch(select("Red Team - [" + GetPartyName($@TeamID1) + "] :Blue Team - [" + GetPartyName($@TeamID2) + "]")) 
                {
                case 1: mes "[  Team War  ]";
                    if ($@TeamID1==getcharid(1)) 
                        {
                            mes "Do you wish to sign out your team?";   
                            next;   
                            if (select("I Give up ~.","Never Say Quit !!")==2) close;   
                                announce "Team 1 : [ " + getpartyname($@TeamID1) + " ] has sign out. We need another Party to sign up now!",bc_yellow|bc_map;   
                                set $@TeamID1, 0;   
                                close
                        }
                        if ($@TeamID1==0 || getpartyname($@TeamID1)=="null") 
                        {
                            getpartymember(getcharid(1)),1;
                            copyarray $@partymembercidt1[0],$@partymembercid[0],$@members;
                            set $@TeamID1, getcharid(1);    
                            initnpctimer;   
                            mes "Your Party is now subscribed, good luck!"; 
                            announce "Team 1 : [ " +getpartyname($@TeamID1)+ " ] has sign up For the Team War!",bc_blue|bc_map; 
                            doevent "teamwar::OnSubscriptionTeam"
                            close
                        } else {
                            mes "I'm sorry! Another Team has sign up before you...";    
                            close
                        }
                case 2: mes "[  Team War  ]";
                    if ($@TeamID2==getcharid(1)) 
                    {   
                        mes "Do you wish to sign out your team?";   
                        next;   
                        if (select("I Give up ~.","Never Say Quit !!")==2) close;
                            announce "Team 2 : [ " + getpartyname($@TeamID2) + " ] has sign out. We need another Party to sign up now!",bc_yellow|bc_map;   
                            set $@TeamID2, 0;   
                            close
                    }
                    if ($@TeamID2==0 || getpartyname($@TeamID2)=="null") 
                    {   
                        getpartymember(getcharid(1)),1;
                        copyarray $@partymembercidt2[0],$@partymembercid[0],$@members;
                        set $@TeamID2, getcharid(1);    
                        initnpctimer;   
                        mes "Your Party is now subscribed, good luck!"; 
                        announce "Team 2 : [ " +getpartyname($@TeamID2)+ " ] has sign up For the Team War!",bc_blue|bc_map;
                        doevent "teamwar::OnSubscriptionTeam"
                        close
                    }
                    else 
                    {   
                        mes "I'm sorry! Another Team has sign up before you...";    
                        close;
                    }
                }
    } else {
        mes "[Event Handler]";
        mes "Please contact your Guild Master.";
        mes "Your team must have a party consisting of 5 members.";
        close;
    }
 
OnSubscriptionTeam:
    if($@TeamID1!=0 && $@TeamID2!=0){
        announce "Team War : We have 2 Teams signed up now : "+getpartyname($@TeamID1)+" and "+getpartyname($@TeamID2)+".",bc_blue|bc_map;
        set @win1, 0;
        set @win2, 0;
        goto Onstart;
    }
    end;
 
OnTimer50000:
    if (($@TeamID1!=0) && ($@TeamID2!=0)) {
        stopnpctimer;
        end;
    }
    stopnpctimer;
    set $@TeamID1, 0;
    set $@TeamID1, 0;
    announce "Team War : we lack teams to start registration for two teams are now available",0;
    end;
    
OnStart:
    warpparty "rwc03",9,50,$@TeamID1;
    warpparty "rwc03",91,50,$@TeamID2;
    set @start,1;
    end;
 
lend:
    stopnpctimer;
    set $@TeamID1,0;
    set $@TeamID2,0;
    set @start,0;
    set @win1,0;
    set @win2,0;
    set @partymembercount,$@members;
    announce "Thanks for playing",0;
    end;
 
OnTimer250000:
    Announce "Team War : No Party won due to time limit!",0;
    mapwarp "rwc03","prontera",156,191;
    goto lend;
    end;
 
OnPCKillEvent:
/* 
    Its party Vs party kind of script, then y checking for guilds on the map?? 
 
    getmapxy(.@map$,.@x,.@y,0);
    if(.@map$=="rwc03")
    {
    set .@guser, getmapguildusers("rwc03",getcharid(1));
        if ( getcharid(1) == $@TeamID2 )
        {
            if (.@guser) end;   // Checks if 0 guild member of teamid2 left
            warpparty "prontera",150,150,$@TeamID2;
            Announce "Team War :"+GetPartyName($@TeamID2)+" won",0;
            goto lend;
        }
        if ( getcharid(1) == $@TeamID1 )
        {
            if (.@guser) end; // Checks if 0 guild member of teamid1 left
            warpparty "prontera",150,150,$@TeamID1;
            Announce "Team War :"+GetPartyName($@TeamID1)+" won",0;
            goto lend;
        }
    }
*/
    end;
    
OnPCDieEvent:
    if(strcharinfo(3) != "rwc03") end;
        for(set .@i, 0; .@i < $@members; set .@i, .@i + 1) {
            if ( $@partymembercidt1[.@i] == getcharid(0)) {
                deletearray $@partymembercidt1[.@i], 1;
                if( getarraysize($@partymembercidt1) == 0 ) {
                    Announce "Team War :"+GetPartyName($@TeamID2)+" won.",0;
                    warpparty "prontera",150,150,$@TeamID2;
                    set @win2,$@partymembercount;
                    goto onwin;
                }
            }
            if ( $@partymembercidt2[.@i] == getcharid(0) ) {
                deletearray $@partymembercidt2[.@i], 1;
                if( getarraysize($@partymembercidt2)  == 0 ) {
                    Announce "Team War :"+GetPartyName($@TeamID1)+" won.",0;
                    warpparty "prontera",150,150,$@TeamID1;
                    set @win1,$@partymembercount;
                    goto onwin;
                }
            }
        }
    end;
 
onwin:
    if (@win1==0)
    {
        warpparty "prontera",150,150,$@TeamID2;
        Announce "Team War :"+GetPartyName($@TeamID2)+" won",0;
        goto lend;
        end;
    }
    if (@win2==0)
    {
        warpparty "prontera",150,150,$@TeamID1;
        Announce "Team War :"+GetPartyName($@TeamID1)+" won",0;
        goto lend;
        end;
    }
    end;
}
 
rwc03   mapflag nosave
rwc03   mapflag nomemo
rwc03   mapflag nowarpto
rwc03   mapflag nowarp
rwc03   mapflag nobranch
rwc03   mapflag pvp_noguild
rwc03   mapflag noicewall
rwc03   mapflag pvp
}
Viewed 853 times, submitted by Guest.