Guild Wars /war invite,guild name,fraglimit Send an invitation to start a war. Example: /war invite,Black Ninjas,150
/war invite,guild name,fraglimit,money,time Send an invitation to start a war.
Example: /war invite,Black Ninjas,150,10000,3 day's
/war accept,guild name Accept the invitation to start a war.
/war reject,guild name Reject the invitation to start a war.
/war end,guild name Ends an active war with another guild.
/war cancel,guild name This will cancel the invitation to the guild Black Ninjas
/balance donate 1234 Command for founder of guilds for pay money
/balance pick 1234 Command for founder of guilds for payout money

"; $count = 0; foreach($SQL->query('SELECT * FROM ' . $SQL->tableName('guild_wars') . ' WHERE ' . $SQL->fieldName('status') . ' IN (1,4) OR ((' . $SQL->fieldName('end') . ' >= (UNIX_TIMESTAMP() - 604800) OR ' . $SQL->fieldName('end') . ' = 0) AND ' . $SQL->fieldName('status') . ' IN (0,5));') as $war) { $a = new Guild(); $a->load($war['guild_id']); if(!$a->isLoaded()) continue; $e = new Guild(); $e->load($war['enemy_id']); if(!$e->isLoaded()) continue; $count++; $main_content .= ""; } if($count == 0) $main_content .= ""; $main_content .= "
Aggressor Information Enemy
getId()."\">getGuildLogoLink() . "\" width=\"64\" height=\"64\" border=\"0\"/>
".htmlspecialchars($a->getName())."
"; switch($war['status']) { case 0: { $main_content .= "Pending acceptation
Invited on " . date("M d Y, H:i:s", $war['begin']) . " for " . ($war['end'] > 0 ? (($war['end'] - $war['begin']) / 86400) :"unspecified") . " days. The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." :"without any payment.")."
Will expire in three days.
"; break; } case 3: { $main_content .= "Canceled invitation
Sent invite on " . date("M d Y, H:i:s", $war['begin']) . ", canceled on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 2: { $main_content .= "Rejected invitation
Invited on " . date("M d Y, H:i:s", $war['begin']) . ", rejected on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 1: { $main_content .= "" . $war['guild_kills'] . " : " . $war['enemy_kills'] . "

On a brutal war
Began on " . date("M d Y, H:i:s", $war['begin']) . ($war['end'] > 0 ? ", will end up at " . date("M d Y, H:i:s", $war['end']) :"") . ".
The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." :"without any payment.
"); break; } case 4: { $main_content .= "" . $war['guild_kills'] . " : " . $war['enemy_kills'] . "

Pending end
Began on " . date("M d Y, H:i:s", $war['begin']) . ", signed armstice on " . date("M d Y, H:i:s", $war['end']) . ".
Will expire after reaching " . $war['frags'] . " frags. ".($war['payment'] > 0 ? "The payment is set to " . $war['payment'] . " bronze coins." :"There's no payment set."); break; } case 5: { $main_content .= "Ended
Began on " . date("M d Y, H:i:s", $war['begin']) . ", ended on " . date("M d Y, H:i:s", $war['end']) . ". Frag statistics: " . $war['guild_kills'] . " to " . $war['enemy_kills'] . "."; break; } default: { $main_content .= "Unknown, please contact with gamemaster."; break; } } $main_content .= "

» Details «
getId()."\">getGuildLogoLink() . "\" width=\"64\" height=\"64\" border=\"0\"/>
".htmlspecialchars($e->getName())."
"; if(in_array($war['status'], array(1,4,5))) { $deaths = $SQL->query('SELECT ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('id') . ', ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('date') . ', ' . $SQL->tableName('gk') . '.' . $SQL->fieldName('guild_id') . ' AS ' . $SQL->fieldName('enemy') . ', ' . $SQL->tableName('p') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('level') . ' FROM ' . $SQL->tableName('guild_kills') . ' gk LEFT JOIN ' . $SQL->tableName('player_deaths') . ' pd ON ' . $SQL->tableName('gk') . '.' . $SQL->fieldName('death_id') . ' = ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('id') . ' LEFT JOIN ' . $SQL->tableName('players') . ' p ON ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('player_id') . ' = ' . $SQL->tableName('p') . '.' . $SQL->fieldName('id') . ' WHERE ' . $SQL->tableName('gk') . '.' . $SQL->fieldName('war_id') . ' = ' . $SQL->quote($war['id']) . ' AND ' . $SQL->tableName('p') . '.' . $SQL->fieldName('deleted') . ' = 0 ORDER BY ' . $SQL->tableName('pd') . '.' . $SQL->fieldName('date') . ' DESC')->fetchAll(); if(!empty($deaths)) { foreach($deaths as $death) { $killers = $SQL->query('SELECT ' . $SQL->tableName('p') . '.' . $SQL->fieldName('name') . ' AS ' . $SQL->fieldName('player_name') . ', ' . $SQL->tableName('p') . '.' . $SQL->fieldName('deleted') . ' AS ' . $SQL->fieldName('player_exists') . ', ' . $SQL->fieldName('k') . '.' . $SQL->fieldName('war') . ' AS ' . $SQL->fieldName('is_war') . ' FROM ' . $SQL->fieldName('killers') . ' k LEFT JOIN ' . $SQL->tableName('player_killers') . ' pk ON ' . $SQL->tableName('k') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('pk') . '.' . $SQL->fieldName('kill_id') . ' LEFT JOIN ' . $SQL->tableName('players') . ' p ON ' . $SQL->tableName('p') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('pk') . '.' . $SQL->fieldName('player_id') . ' WHERE ' . $SQL->tableName('k') . '.' . $SQL->fieldName('death_id') . ' = ' . $SQL->quote($death['id']) . ' ORDER BY ' . $SQL->tableName('k') . '.' . $SQL->fieldName('final_hit') . ' DESC, ' . $SQL->tableName('k') . '.' . $SQL->fieldName('id') . ' ASC')->fetchAll(); $count = count($killers); $i = 0; $others = false; $main_content .= date("j M Y, H:i", $death['date']) . " + ".htmlspecialchars($death['name'])." "; foreach($killers as $killer) { $i++; if($killer['is_war'] != 0) { if($i == 1) $main_content .= "killed at level ".$death['level']." by "; else if($i == $count && $others == false) $main_content .= " and by "; else $main_content .= ", "; if($killer['player_exists'] == 0) $main_content .= ""; $main_content .= htmlspecialchars($killer['player_name']); if($killer['player_exists'] == 0) $main_content .= ""; } else $others = true; if($i == $count) { if($others == true) $main_content .= " and few others"; $main_content .= ".
"; } } } } else $main_content .= "
There were no frags on this war so far.
"; } else $main_content .= "
This war did not began yet.
"; $main_content .= "
Currently there are no active wars.
";