Ejemplo n.º 1
0
 //Handle mid-combat events.
 if ($v->combat) {
     if ($is_action && $encounter->actor($parser)) {
         $encounter->last_active = $v->timestamp;
         $encounter->last_line = $v->line;
         continue;
     }
     //Somebody died!
     if ($parser->type_id == 11) {
         $encounter->kill($parser->target_id);
     } elseif ($parser->type_id == 12) {
         $encounter->kill($parser->origin_id);
     }
     //Hostile action didn't happen, check for expiration of combat.
     if ($v->timestamp - $encounter->last_active >= 6) {
         $boss_id = $encounter->get_boss();
         //We have met the condition to end combat.
         $encounter->end_combat();
         //Check if we have a boss of importance.
         if ($boss_id !== false) {
             //Is this boss even alive?
             $alive = $encounter->is_alive($boss_id);
             //Snag his name.
             $boss_name = $encounter->get_name($boss_id);
             $boss_data = array('s' => $encounter->get_line(true), 'e' => $encounter->get_line(false), 'l' => $encounter->get_length(), 'w' => $alive);
             //Add this to the killed bosses array.
             if (!$alive) {
                 $v->killed_bosses[] = $boss_id;
             }
             //Last step... see if we have the minimum length.
             if ($boss_data['l'] >= 30) {