// Finden wir mal die ATA raus =) if($_POST['new_act'] == 'deff') { // Ist der Spieler gesperrt? // Wenn ja, steigen wir sofort hier aus :) if($target_global['blocked'] > 0) { echo htmlentities('Der Spieler ist gesperrt und kann deswegen nicht verteidigt werden'); break; } $ATA = 0; // Niemand hat hier eine Ally, also nachschauen, ob sie in einer Stadt sind :C if($userdata['ally'] == 0 && $target_global['ally'] == 0) { // Wenn die beiden in einer Stadt sind -> Stadtinterne ATA if($userdata['city_id'] == $target_city_id['id']) { $ATA = 18; } // Zwei verschiedene Städte, also maximale ATA else { $ATA = 24; } // Starter hat eine Ally, Ziel aber nicht... if($userdata['ally'] > 0 && $target_global['ally'] == 0) { // Aber sind in der gleichen Stadt, also stadtinterne ATA if($userdata['city_id'] == $target_city_id['id']) { $ATA = 18; } // ansonsten maximale ATA else { $ATA = 24; } } // Beide Spieler sind in einer Ally if($userdata['ally'] > 0 && $target_global['ally'] > 0) { // Und sie sind sogar in der gleichen Ally if($userdata['ally'] == $target_global['ally']) { // Und auch noch in einer Stadt, supertoll :) if($userdata['city_id'] == $target_city_id['id']) { $ATA = 18; } // Sind nicht in einer Stadt, aber in einer Ally, immer noch super :) else { $ATA = 18; } } if($userdata['ally'] != $target_global['ally']) { $sql = "SELECT COUNT(*) as count FROM ally_relations WHERE ally_id1=".$target_global["ally"]." AND ally_id2=".$userdata["ally"]." AND granted=1 AND type = 'bnd' OR ally_id2=".$target_global["ally"]." AND ally_id1=".$userdata["ally"]." AND granted=1 AND type = 'bnd'"; $diplo = mysql_fetch_row(mysql_query($sql)); // Wir haben da also ein Bündnis :) if($diplo['count'] > 0) { $ATA = 21; } // KEin Bündniss, längste Anrückzeit =/ else { $ATA = 24; } } }