- script BattlegroundsKoeStarter::koe_start -1,{
OnInit:
setmapflag "guild_vs1", mf_guildlock;
setmapflag "guild_vs1", mf_nobranch;
setmapflag "guild_vs1", mf_nomemo;
setmapflag "guild_vs1", mf_nopenalty;
setmapflag "guild_vs1", mf_noreturn;
setmapflag "guild_vs1", mf_noteleport;
setmapflag "guild_vs1", mf_gvg_noparty;
setmapflag "guild_vs1", mf_nowarp;
setmapflag "guild_vs1", mf_nowarpto;
setmapflag "guild_vs1", mf_gvg;
setmapflagnosave("guild_vs1", "prontera", 180, 208);
disablenpc "koe_prize";
query_sql "CREATE TABLE IF NOT EXISTS koeranking (ID int UNIQUE, pontos tinyint)";
end;
OnMinute40: // Regular KoE Start
.dayofweek = gettime(GETTIME_WEEKDAY);
if (.dayofweek != FRIDAY && .dayofweek != SATURDAY && .dayofweek != SUNDAY) {
.hour = gettime(GETTIME_HOUR);
if (.hour == 18) {
if (.hour == 18) {
$@rankedkoe = 0;
announce "[ King of Emperium - Normal ] Jogadores com guildas podem se juntar em prontera!", 0, 0xDE9B1F;
} else {
$@rankedkoe = 1;
announce "[ King of Emperium - Ranqueado ] Jogadores com guildas podem se juntar em prontera!", 0, 0xDE9B1F;
}
disablenpc "koe_prize";
gvgon "guild_vs1";
monster "guild_vs1", 50, 50, "Emperium Neutra", 1288, 1, "koedestroy::OnEmpDestroy";
$@KoeGuild = 0;
$@KoeOpen = 1;
}
}
end;
OnMinute30: // Friday KoE Start
.dayofweek = gettime(GETTIME_WEEKDAY);
if (.dayofweek == FRIDAY) {
.hour = gettime(GETTIME_HOUR);
if (.hour == 18) {
if (.hour == 18) {
$@rankedkoe = 0;
announce "[ King of Emperium - Normal ] Jogadores com guildas podem se juntar em prontera!", 0, 0xDE9B1F;
} else {
$@rankedkoe = 1;
announce "[ King of Emperium - Ranqueado ] Jogadores com guildas podem se juntar em prontera!", 0, 0xDE9B1F;
}
disablenpc "koe_prize";
gvgon "guild_vs1";
monster "guild_vs1", 50, 50, "Emperium Neutra", 1288, 1, "koedestroy::OnEmpDestroy";
$@KoeGuild = 0;
$@KoeOpen = 1;
}
}
end;
OnMinute00:
if ($@KoeOpen == 1) {
announce "[ King of Emperium ] O King of emperium chegou ao fim." , 0, 0xDE9B1F;
killmonsterall "guild_vs1";
maprespawnguildid "guild_vs1", $@KoeGuild, 2;
gvgoff "guild_vs1";
$@KoeOpen = 0;
if ($@KoeGuild != 0) {
announce "[ King of Emperium ] Parabens ao cla " + getguildname($@KoeGuild) + "!", 0, 0xDE9B1F;
warpguild "guild_vs1", 50, 52, $@KoeGuild;
} else
announce "[ King of Emperium ] O evento terminou em empate.", 0, 0xDE9B1F;
if ($@rankedkoe) {
.dayofweek = gettime(GETTIME_WEEKDAY);
if (.dayofweek == FRIDAY) {
// Reward weekly winners.
if ($@KoeGuild)
query_sql "INSERT INTO `koeranking` (`id`, `pontos`) VALUES ("+$@KoeGuild+",1) ON DUPLICATE KEY UPDATE pontos = `pontos` +2";
query_sql "SELECT id,pontos FROM koeranking WHERE pontos = (SELECT MAX(pontos) FROM koeranking)", .@id, .@pontos;
.winnerGuild = getarraysize(.@id);
if (.winnerGuild > 1)
announce "[ King of Emperium ] O evento semanal encerrou, e as guilds vencedoras, com " + .@pontos[0] + " pontos, foram :", 0, 0xDB4E16;
else if (.winnerGuild == 1)
announce "[ King of Emperium ] O evento semanal encerrou, e a guild vencedora, com " + .@pontos[0] + " pontos, foi :", 0, 0xDB4E16;
else
announce "[ King of Emperium ] O evento semanal encerrou, e nao houveram vencedores!", 0, 0xDB4E16;
for (.j = 0; .j < .winnerGuild; .j++) {
announce "[ King of Emperium ] " + getguildname(.@id[.j]), 0, 0xDB4E16;
getguildmember .@id[.j], 1;
.size = getarraysize($@guildmembercid);
if (.size > 0) {
for (.i = 0; .i < .size; .i++) {
.cid = $@guildmembercid[.i];
query_sql "SELECT account_id FROM `char` WHERE char_id = "+.cid, .@conta;
.rid = .@conta[0];
if (isloggedin(.rid, .cid)) {
attachrid .rid;
if (callfunc("isDualOn") == 0) {
announce "Voce foi recompensado por ganhar o evento semanal da KoE. Parabens!", bc_self, 0x4383AB;
getitem 7773, 1000/.winnerGuild;
} else {
announce "Apesar de sua guild ter ganho, multiplas contas nao sao permitidas.", bc_self, 0xED5151;
}
}
}
}
}
query_sql "TRUNCATE koeranking";
} else {
if ($@KoeGuild)
query_sql "INSERT INTO `koeranking` (`id`, `pontos`) VALUES ("+$@KoeGuild+",1) ON DUPLICATE KEY UPDATE pontos = `pontos` +1";
}
}
$@rankedkoe = 0;
$@KoeGuild = 0;
sleep2 500;
enablenpc "koe_prize";
sleep2 180000;
disablenpc "koe_prize";
}
end;
}
- script BattlegroundsKoeDestroy::koedestroy -1,{
OnEmpDestroy:
$@KoeGuild = getcharid(2);
monster "guild_vs1", 50, 50, "Emperium (" + strcharinfo(2) + ")", 1288, 1, "koedestroy::OnEmpDestroy";
mapannounce "guild_vs1", "O Emperium foi destruido.", 0, 0x00CCFF;
maprespawnguildid "guild_vs1", getcharid(2), 2;
end;
}
- script BattlegroundsKoeKill::koekill -1,{
OnPCKillEvent:
if (strcharinfo(3) == "guild_vs1") {
dispbottom "VOCE MATOU : "+strcharinfo(0, 0, killedrid)+" (+2 Emblemas)", 0x347834;
getitem 7773, 2;
}
end;
}
prontera,183,215,4 script King of Emperium::koe_enter 4_M_EDEN_GUARDER,{
mes "[^DE9B1F King of Emperium ^000000]";
mes "Como deseja prosseguir?";
switch (select("Juntar-se:Ranking:Sair")) {
case 1:
if ($@KoeOpen == 1) {
mes "O evento se encontra atualmente aberto, deseja entrar?";
switch (select("Entrar:Sair")) {
case 1:
if ($@KoeOpen == 1) {
if (getcharid(2)) {
mes "[^DE9B1F King of Emperium ^000000]";
mes "Vamos la!";
.rand = rand(1, 4);
switch (.rand) {
case 1:
warp "guild_vs1", 92, 49;
break;
case 2:
warp "guild_vs1", 49, 8;
break;
case 3:
warp "guild_vs1", 8, 50;
break;
case 4:
warp "guild_vs1", 50, 91;
break;
}
} else {
mes "[^DE9B1F King of Emperium ^000000]";
mes "Apesar de o evento estar aberto, você necessita de uma guilda para seguir em frente!";
}
} else {
mes "[^DE9B1F King of Emperium ^000000]";
mes "Desculpe, mas o evento fechou!";
}
break;
case 2:
mes "[^DE9B1F King of Emperium ^000000]";
mes "Bom, fica pra proxima entao!";
break;
}
close;
} else {
mes "O evento se encontra atualmente fechado, sentimos muito!";
close;
}
break;
case 2:
query_sql "SELECT * FROM koeranking ORDER BY pontos DESC LIMIT 5", .@id, .@pontos;
if (getarraysize(.@id) > 0) {
mes "Ranking :";
.i = 0;
while (.i < getarraysize(.@id) && .@id[.i] ) {
.j = .i+1;
mes .j + ". ^DE9B1F" + getguildname(.@id[.i]) + "^000000 com " + .@pontos[.@i] + " ponto(s).";
.i = .i+1;
}
} else
mes "Parece que nao ha nada aqui por enquanto!";
close;
break;
case 3:
mes "Pelo visto houve um engano. Ate a proxima!";
close;
break;
}
}
guild_vs1,50,55,4 script Premio do Evento::koe_prize 4_CAT_ADMIRAL,{
progressbar "00FF00", 8;
warp "SavePoint", 0, 0;
if (callfunc("isDualOn") == 0) {
callfunc "IG_RecompensaKoe";
}
}
function script isDualOn {
query_sql("SELECT last_unique_id FROM `login` WHERE account_id = "+getcharid(3)+"", .@LastId$);
query_sql("SELECT account_id FROM `login` WHERE last_unique_id = '"+.@LastId$+"'", .@AccountId);
.size = getarraysize(.@AccountId);
if (.size > 1) {
.logged = 0;
for (.i = 0; .i < .size; .i++) {
if (isloggedin(.@AccountId[.i]) && checkvending(strcharinfo(0, 0, .@AccountId[.i])) != 2) {
.logged = .logged+1;
if (.logged > 1)
return 1;
}
}
}
return 0;
}
function script IG_RecompensaKoe {
getitem 7773, 180;
}