My Changes are marked with "//4v4 Team rewarder" comment lines
Not Tested. Please give me a feedback on the results. Thanks.
- script pvp4vs4#1 -1,{
OnPCDieEvent:
getmapxy (.@map$, .@x, .@y, 0);
if(.@map$ == "guild_vs3") { warp "SavePoint",0,0;}
end;
OnPCKillEvent:
getmapxy (.@map$, .@x, .@y, 0);
if( .@map$ == "guild_vs3") {
set .@tempn1$,strcharinfo(0);
set .@tempn2$,rid2name(killedrid);
mapannounce "guild_vs3",""+.@tempn1$+" has killed "+.@tempn2$+".",1,0xD6A4E6;
//4v4 Team rewarder
for (set .@x, 1; .@x <= getarraysize($pvp4nA); set .@x, .@x + 1){
if (getd("$pvp4nAchar"+.@x) == killedrid)
set $pvp4nA, $pvp4nA - 1;
else
set $pvp4nB, $pvp4nB - 1;
}
if ($pvp4nB <= 0){ // if Team Freya kills all of Team Odin
mapannounce "guild_vs3","Team Freya has dominated Team Odin!!",1,0xD6A4E6;
for (set .@x, 1; .@x <= getarraysize($pvp4nA); set .@x, .@x + 1){
atcommand "#item "+getd("$pvp4nAchar"+.@x)+" "+$4v4reward+" "+$4v4rewardqty;
}
} else if ($pvp4nA <= 0) { // if Team Odin kills all of Team Freya
mapannounce "guild_vs3","Team Odin has dominated Team Freya!!",1,0xD6A4E6;
for (set .@x, 1; .@x <= getarraysize($pvp4nB); set .@x, .@x + 1){
atcommand "#item "+getd("$pvp4nBchar"+.@x)+" "+$4v4reward+" "+$4v4rewardqty;
}
}
}
end;
OnInit:
//4v4 Team rewarder configuration
set $4v4reward, 607; // Change this for item reward
set $4v4rewardqty, 10; // Change this for item reward quantity
end;
}