load this SQL script
ALTER TABLE `guild` ADD COLUMN `woe_def` INT(11) NOT NULL DEFAULT '0' AFTER `skill_point`;
go to this npc file
npc/guild/agit_main.txt
Find this
if (!mobcount(strnpcinfo(2),"Agit#"+strnpcinfo(2)+"::OnAgitBreak")) {
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Emperium",1288,1,"Agit#"+strnpcinfo(2)+"::OnAgitBreak";
}
end;
change to this
if (!mobcount(strnpcinfo(2),"Agit#"+strnpcinfo(2)+"::OnAgitBreak")) {
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Emperium",1288,1,"Agit#"+strnpcinfo(2)+"::OnAgitBreak";
initnpctimer;
}
end;
OnTimer300000: // 5 minutes
.@map$ = strnpcinfo( 2 );
.@guild_id = getcastledata( .@map$,1 );
if( .@guild_id ){
query_sql( "UPDATE `guild` SET `woe_def` = `woe_def` + 1 WHERE `guild_id` = "+.@guild_id );
mapannounce .@map$,"Castle Owner gained 1 points for defending 5 minutes without fail.",bc_all;
}
setnpctimer 0;
end;
then, find this
OnAgitEnd:
if (strnpcinfo(0) == "Gld_Agit_Manager") end;
GvgOff strnpcinfo(2);
// If the castle has no owner at the end of WoE, do not kill Emperium.
if (GetCastleData(strnpcinfo(2),1)) {
KillMonster strnpcinfo(2),"Agit#"+strnpcinfo(2)+"::OnAgitBreak";
}
end;
and replace with this
OnAgitEnd:
if (strnpcinfo(0) == "Gld_Agit_Manager") end;
GvgOff strnpcinfo(2);
// If the castle has no owner at the end of WoE, do not kill Emperium.
if (GetCastleData(strnpcinfo(2),1)) {
KillMonster strnpcinfo(2),"Agit#"+strnpcinfo(2)+"::OnAgitBreak";
}
query_sql( "SELECT `guild_id`,`woe_def` FROM `guild` ORDER BY `woe_def` DESC LIMIT 1",.@gid,.@point );
announce "GUILD '"+getguildname( .@gid )+"' WON WITH "+.@point+" POINT",bc_all;
setcastledata strnpcinfo(2),1,.@gid;
end;
didnt test...