function LoginDialog($message='') { parent::Dialog('login', guil('dialog_login_title'), '', 1, 1); $html = "<p>".guil('dialog_login_useforumacc')."</p> <form action='' method='POST'> <table> <tr><td>".guil('username').":</td><td><input type='text' name='username'></td></tr> <tr><td>".guil('password').":</td><td><input type='password' name='password'></td></tr> <tr><td>".guil('preferedlanguage').":</td><td> <select name='language' onChange='document.location.href=\"?op=setlanguage&language=\"+this.value'>"; foreach(array('de' => 'Deutsch', 'en' => 'English') as $short => $long) { if($_SESSION['language'] == $short) { $selected = "selected='selected'"; } else { $selected = ""; } $html .= "<option value='".$short."' ".$selected.">".$long."</option>"; } $html .= "</select> </td></tr> <tr><td colspan='2' align='center'><input type='submit' value='".guil('login')."'></td></tr> </table>"; if($login_message) { $html .= "<p style='color:red; text-align:center'>".$message."</p>"; } $html .= "<input type='hidden' name='op' value='login'> </form> <p><a href='/forum/ucp.php?mode=register'>".guil('register')."</a> <a href='?op=demo'>".guil('startdemo')."</a></p>"; $this->nobutton = 1; $this->content = $html; }
function HelpDialog() { parent::Dialog('help', guil('dialog_help_title'), '', 1, 0); $html = "<img src='http://geekandpoke.typepad.com/.a/6a00d8341d3df553ef014e8b8f1c5b970d-800wi' alt=''>"; $this->content = $html; $this->nobutton = 1; }
function Tab_Full_Fight_Graphs($name, $char, $start_id, $end_id, $eventtext=1, $class='') { $data = "<div class='accordion_ajax_ajax'> <h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=hpprogress&cond[0][]=target_name=".$char."§ion[1]=damage&cond[1][]=target_name=".$char."§ion[2]=heal&cond[2][]=target_name=".$char."'>HP Verlauf</a></h4><div></div> <h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=damage&cond[0][]=target_name=".$char."'>Damage an $char</a></h4><div></div> <h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=damage&cond[0][]=source_name=".$char."'>Damage durch $char</a></h4><div></div> <h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=allhealers'>Heilung an $char</a></h4><div></div> <h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=heal&cond[0][]=source_name=".$char."'>Heilung durch $char</a></h4><div></div> <h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=threat&cond[0][]=source_name=".$char."'>Bedrohung durch $char</a></h4><div></div> <!--h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=threat&cond[0][]=source_name=".$char."&overall[0]=1'>Summierte Bedrohung durch $char</a></h4><div></div--> </div>"; parent::Tab( $name, guil('fightprogress').' ('.guil('graphs').')', '', $data, $html, $class ); }
function MessageDialog($message, $title, $returnto='') { parent::Dialog('message', $title, '', 1, 1); if(!$returnto) { $returnto = $this->jsclose(); $backbuttontext = guil('close'); } elseif($returnto=='back') { $returnto = 'document.location.href="?op=noop"'; $backbuttontext = guil('back'); } else { $backbuttontext = guil('back'); } $html = "<p>$message</p><center><button onClick=\"".$returnto."\">".$backbuttontext."</button></center>"; $this->content = $html; $this->important = 1; $this->nobutton = 1; unset($this->width); unset($this->position); }
function Tab_Full_Fight_Stats($name, $char, $start_id, $end_id, $eventtext=1, $class='') { global $parser, $benchmark; $data = ''; $html = ''; $hitpoint_gain_overall=0; $threat_gain_overall=0; $resource_gain_overall=0; $last_fetch = $start_id; for($id=$start_id; $id <= $end_id; $id++) { if($id >= $last_fetch + PARSER_MAX_FETCH) { $last_fetch +=PARSER_MAX_FETCH; unset($parser->loglines); unset($parser->logdata); $parser->read_loglines($id, $id+PARSER_MAX_FETCH); $parser->gather_logdata(); } $logdata = $parser->logdata[$id]; if($logdata) { $damage_received=0; $heal_received=0; $damage_done=0; $heal_done=0; $threat_gain=0; $resource=''; $resource_spend = 0; $resource_restored = 0; switch($parser->logchar2userchar[$char]['class_id']) { case KNIGHT: case GUARDIAN: case SENTINEL: $resource = 'focus'; break; case WARRIOR: case JUGGERNAUT: case MARAUDER: $resource = 'rage'; break; case CONSULAR: case INQUISITOR: case SAGE: case SORCERER: case SHADOW: case ASSASSIN: $resource = 'force'; break; case TROOPER: case COMMANDO: case VANGUARD: $resource = 'ammo'; break; case BOUNTYHUNTER: case MERCENARY: case POWERTECH: $resource = 'heat'; break; case SMUGGLER: case IMPERIALAGENT: case GUNSLINGER: case SNIPER: case SCOUNDREL: case OPERATIVE: $resource = 'energy'; break; } switch($logdata['effect_type_id']) { case SPEND: switch($logdata['effect_id']) { case HITPOINT: $damage_received = $logdata['hitpoints']; break; case FORCE: case ENERGY: case RAGE: case AMMO: case FOCUS: case HEAT: $resource_spend = $logdata['hitpoints']; break; } break; case RESTORE: switch($logdata['effect_id']) { case HITPOINT: $heal_received = $logdata['hitpoints']; break; case FORCE: case ENERGY: case RAGE: case AMMO: case FOCUS: case HEAT: $resource_restored = $logdata['hitpoints']; break; } break; } $resource_gain = $resource_restored - $resource_spend; $resource_gain_overall += $resource_gain; switch($logdata['effect_id']) { case DAMAGE: if($logdata['target_name'] == $char) { $damage_received = $logdata['hitpoints']; } if(preg_match('/^'.$char.'(:.+)?/', $logdata['source_name'])) { // char + companion $damage_done = $logdata['hitpoints']; } if($logdata['source_name'] == $char) { // char only $threat_gain_overall += $logdata['threat']; } break; case HEAL: if($logdata['target_name'] == $char) { $heal_received = $logdata['hitpoints']; } if(preg_match('/^'.$char.'(:.+)?/', $logdata['source_name'])) { // char + companion $heal_done = $logdata['hitpoints']; $threat_gain += $logdata['threat']; } if($logdata['source_name'] == $char) { // char only $threat_gain_overall += $logdata['threat']; } break; } $hitpoint_gain_overall += $damage_received; $hitpoint_gain_overall -= $heal_received; // supress output of 0-values $damage_done=($damage_done==0?"":$damage_done); $heal_done=($heal_done==0?"":$heal_done); $damage_received=($damage_received==0?"":$damage_received); $heal_received=($heal_received==0?"":$heal_received); $hitpoint_gain_overall=($hitpoint_gain_overall==0?"":$hitpoint_gain_overall); $threat_gain=($threat_gain==0?"":$threat_gain); $threat_gain_overall=($threat_gain_overall==0?"":$threat_gain_overall); $resource_gain=($resource_gain==0?"":$resource_gain); $resource_gain_overall=($resource_gain_overall==0?"":$resource_gain_overall); $row_style=''; if(preg_match('/^'.$char.':.+/', $logdata['source_name'])) { // companion if($logdata['effect_id']==DAMAGE) { $row_style = 'style="background-color:#ccccff"'; } else { $row_style = 'style="background-color:#ddddff"'; } } elseif($logdata['source_name'] == $char) { // char if($logdata['effect_id']==DAMAGE) { $row_style = 'style="background-color:#ccffcc"'; } elseif($logdata['effect_id']==DEATH) { // ...kills something $row_style = 'style="background-color:#00ff00"'; } else { $row_style = 'style="background-color:#ddffdd"'; } } elseif($logdata['source_type'] == 'player') { // other player if($logdata['effect_id']==DAMAGE) { $row_style = 'style="background-color:#ffffcc"'; } else { $row_style = 'style="background-color:#ffffdd"'; } } else { // npc if($logdata['effect_id']==DAMAGE) { $row_style = 'style="background-color:#ffcccc"'; } elseif($logdata['effect_id']==DEATH) { // ...kills player $row_style = 'style="background-color:#ff0000"'; } else { $row_style = 'style="background-color:#ffdddd"'; } } $data .= "<tr ".$row_style."> <td>".$id."</td> <td>".date('H:i:s', $logdata['timestamp'])."</td> <td>".$logdata['source_name']."</td> <td>".$logdata['target_name']."</td> <td>".$logdata['ability_name']."</td> <td>".$logdata['effect_name']."</td> <td>".$logdata['damage_type']."</td>"; if($resource) { $data .= "<td>".$resource_gain."</td>"; //$data .= "<td>".$resource_gain_overall."</td>"; } $data .= "<td>".$damage_done."</td> <td>".$heal_done."</td> <td>".$threat_gain."</td> <td>".$damage_received."</td> <td>".$heal_received."</td> <td>".$hitpoint_gain_overall."</td> <td>".$threat_gain_overall."</td>"; $data .= "</tr>"; } } $html = "<p>".guil('fullfightstats_note_companion')."</p>"; $headers = array('ID', guil('time'), guil('source'), guil('target'), guil('ability'), guil('effect'), guil('damagetype')); if($resource) { $headers[] = ucfirst($resource); //$headers[] = ucfirst($resource.' '.guil('progress')); } $headers = array_merge($headers, array('DMG (out)', 'Heal(out)', 'Threat', 'DMG (in)', 'Heal (in)', '-HP '.guil('progress'), 'Threat '.guil('progress'))); parent::Tab( $name, guil('fightprogress'), $headers, $data, $html, ($class?$class:'dataTableFullFightStats') ); }
function CharmanagerDialog() { parent::Dialog('charmanager', guil('yourchars'), '', 1); }
function Tab_Char_HpsTps_per_Ability($name, $char, $start_id, $end_id, $class='', $hidexps=0) { global $parser; $data = ''; $html = ''; $used_abilities = array(); $overall = array(); $last_fetch = $start_id; for($id=$start_id; $id <= $end_id; $id++) { if($id >= $last_fetch + PARSER_MAX_FETCH) { $last_fetch +=PARSER_MAX_FETCH; unset($parser->loglines); unset($parser->logdata); $parser->read_loglines($id, $id+PARSER_MAX_FETCH); $parser->gather_logdata($id, $id+PARSER_MAX_FETCH); } $logdata = $parser->logdata[$id]; if($id == $start_id) { $start_timestamp = $logdata['timestamp']; } elseif ($id == $end_id) { $end_timestamp = $logdata['timestamp']; } if(preg_match('/^'.$char.'(:(.+))?/', $logdata['source_name'], $matches)) { $ability_name = $logdata['ability_name']; if($logdata['source_type'] == 'companion') { $ability_name = $matches[2].': '.$ability_name; } switch($logdata['effect_id']) { case HEAL: $used_abilities[$ability_name]['id'] = $logdata['ability_id']; $used_abilities[$ability_name]['heal'] += $logdata['hitpoints']; $used_abilities[$ability_name]['threat'] += $logdata['threat']; $used_abilities[$ability_name]['hit'] += $logdata['hit']; $used_abilities[$ability_name]['crit'] += $logdata['crit']; $used_abilities[$ability_name]['count']++; $overall['heal'] += $logdata['hitpoints']; $overall['threat'] += $logdata['threat']; $overall['hit'] += $logdata['hit']; $overall['crit'] += $logdata['crit']; $overall['count']++; } } } $duration = $end_timestamp - $start_timestamp; if($overall['count']>0) { $overall['overheal'] = 0; foreach($used_abilities as $ability_name => $ability) { // experimental! // see crudedragos comments on http://mmo-mechanics.com/swtor/forums/Thread-Batalyser-SWTOR-Combat-Analyser switch($ability['id']) { // Medpacs case "813312187039744" : case "2176191209406464": case "864164599824384" : case "843162209746944" : case "2176199799341056": case "813316482007040" : case "813320776974336" : case "2628395431100416": case "807518276157440" : case "1143320294195200": case "1481411529801728": case "2176212684242944": case "1481402939867136": case "1481407234834432": case "807544045961216" : case "2176216979210240": case "1481398644899840": case "2471474505973760": if($ability['threat']/$ability['heal']>0.5) { // tank $threatcoefficient = 0.75; } else { // healer, dd $threatcoefficient = 0.50; } break; // Healing Resonance case "2785827457335296": case "2882455631560704": case "2772083561988096": case "2785805982498816": $threatcoefficient = 0.50; break; default: switch($parser->logchar2userchar[$char]['class_id']) { case MERCENARY: case COMMANDO: // healer $threatcoefficient = 0.45; break; case SCOUNDREL: case OPERATIVE: // healer $threatcoefficient = 0.45; break; case SAGE: case SORCERER: // healer $threatcoefficient = 0.42; break; case GUARDIAN: case JUGGERNAUT: case SHADOW: case ASSASSIN: case VANGUARD: case POWERTECH: if($ability['threat']/$ability['heal']>0.5) { // tank $threatcoefficient = 0.75; } else { // dd $threatcoefficient = 0.5; } break; default: // class is not set, try to determine it by calculating the actual threatcoeffecientrange // overheal may be calculated wrong if this fails, and that's very likely if($ability['threat']/$ability['heal']>0.5) { // tank $threatcoefficient = 0.75; } elseif($ability['threat']/$ability['heal']>0.45) { // dd $threatcoefficient = 0.5; } else { // healer $threatcoefficient = 0.45; } } } if($ability['threat']) { $ability['overheal'] = $ability['heal'] - $ability['threat'] * pow($threatcoefficient, -1); $overall['overheal'] += $ability['overheal']; } if($ability['heal']>0) { $data .= "<tr> <td>".$ability_name."</td> <td>".$ability['count']."</td> <td>".$ability['heal']."</td>"; if(!$hidexps) { $data .= "<td>".round($ability['heal'] / $duration, 2)."</td>"; } $data .= "<td>".round($ability['heal'] / $ability['count'], 2)."</td> <td>".round($ability['overheal'], 2)."</td> <td>".round((100/$ability['heal'])*$ability['overheal'], 2)."%</td> <td>".$ability['threat']."</td>"; if(!$hidexps) { $data .= "<td>".round($ability['threat'] / $duration, 2)."</td>"; } $data .= "<td>".round($ability['threat'] / $ability['count'], 2)."</td> <td>".round($ability['threat'] / $ability['heal'], 2)."</td> <td>".$ability['hit']."</td> <td>".$ability['crit']."</td> <td>".round(100/$ability['count']*$ability['hit'], 2)."%</td> <td>".round(100/$ability['count']*$ability['crit'], 2)."%</td> </tr>"; } } $html = "<div style='border-top: 1px solid silver'>Gesamt:<table> <tr> <td rowspan='2' valign='top'> <table> <tr><td>".guil('normal').": </td><td>".$overall['hit']."</td> <td>(".round(100/$overall['count']*$overall['hit'], 2)."%)</td></tr> <tr><td>".guil('crit').": </td><td>".$overall['crit']."</td> <td>(".round(100/$overall['count']*$overall['crit'], 2)."%)</td></tr> <tr><td>Overheal: </td><td colspan='2'>".round($overall['overheal'], 2)." (".round(100/$overall['heal'] * $overall['overheal'], 2)."%)</td></tr>"; if(!$hidexps) { $html .= "<tr><td>HPS: </td><td colspan='2'>".round($overall['heal']/$duration, 2)."</td></tr> <tr><td>HPS (".guil('effective')."):</td><td colspan='2'>".round(($overall['heal']-$overall['overheal'])/$duration, 2)."</td></tr>"; } $html .= "</table> (Overheal and effective HPS are experimental estimates) </td> <td valign='top'>"; $params = guil('normal')."=".$overall['hit']; $params .= "&".guil('crit')."=".$overall['crit']; $html .= "<iframe width='450' height='250' frameborder='0' scrolling='no' src='piechart_google.php?".$params."&pietitle=".guil('healhitstatistic')."&pieheight=300&piewidth=450'></iframe> <center><button class='button_open_dialog_misc' href='piechart_google.php?".$params."&pietitle=".guil('healhitstatistic')."&pieheight=600&piewidth=800'>".guil('enlarge_grafic')."</button></center> </td> <td>"; foreach($used_abilities as $ability_name => $ability) { $piedata[] = $ability_name."=".$ability['heal']; } $params = join('&', $piedata); $html .= "<iframe width='450' height='250' frameborder='0' scrolling='no' src='piechart_google.php?".$params."&pietitle=".guil('healperability')."&pieheight=300&piewidth=450'></iframe> <center><button class='button_open_dialog_misc' href='piechart_google.php?".$params."&pietitle=".guil('healperability')."&pieheight=600&piewidth=800'>".guil('enlarge_grafic')."</button></center> </td> </tr> <tr> <td>"; $params = "Effective=".($overall['heal']-$overall['overheal'])."&Overheal=".$overall['overheal']; $html .= "<iframe width='450' height='250' frameborder='0' scrolling='no' src='piechart_google.php?".$params."&pietitle=".guil('overhealstatistic')."&pieheight=300&piewidth=450'></iframe> <center><button class='button_open_dialog_misc' href='piechart_google.php?".$params."&pietitle=".guil('overhealstatistic')."&pieheight=600&piewidth=800'>".guil('enlarge_grafic')."</button></center> </td> </tr> </table> </div>"; } if(!$hidexps) { $headers = array(guil('ability'), 'Use', 'Heal', 'HPS', 'Heal/Use', 'Overheal', 'Overheal %', 'Threat', 'TPS', 'Threat/Use', 'Threat/Heal', 'Hit', 'Crit', 'Hit %', 'Crit %'); } else { $headers = array(guil('ability'), 'Use', 'Heal', 'Heal/Use', 'Overheal', 'Overheal %', 'Threat', 'Threat/Use', 'Threat/Heal', 'Hit', 'Crit', 'Hit %', 'Crit %'); } parent::Tab( $name, guil('healperability'), $headers, $data, $html, $class ); $this->tooltips['Overheal'] = 'experimental estimate!'; $this->tooltips['Overheal %'] = 'experimental estimate!'; }
function Tab_Enemies_Damage_to_Char($name, $char, $start_id, $end_id, $class='', $hidexps=0) { global $parser; $enemies = array(); $enemies_abilities = array(); $overall = array(); $last_fetch = $start_id; for($id=$start_id; $id <= $end_id; $id++) { if($id >= $last_fetch + PARSER_MAX_FETCH) { $last_fetch +=PARSER_MAX_FETCH; unset($parser->loglines); unset($parser->logdata); $parser->read_loglines($id, $id+PARSER_MAX_FETCH); $parser->gather_logdata($id, $id+PARSER_MAX_FETCH); } $logdata = $parser->logdata[$id]; if($id == $start_id) { $start_timestamp = $logdata['timestamp']; } elseif ($id == $end_id) { $end_timestamp = $logdata['timestamp']; } if($logdata['target_name'] == $char) { $enemy_name = $logdata['source_name']; $ability_name = $logdata['ability_name']; switch($logdata['effect_id']) { case DAMAGE: $enemies[$enemy_name]['attack_count']++; $enemies[$enemy_name]['damage'] += $logdata['hitpoints']; $enemies[$enemy_name]['threat'] += $logdata['threat']; $enemies[$enemy_name]['hit'] += $logdata['hit']; $enemies[$enemy_name]['crit'] += $logdata['crit']; $enemies[$enemy_name]['miss'] += $logdata['miss']; $enemies[$enemy_name]['dodge'] += $logdata['dodge']; $enemies[$enemy_name]['parry'] += $logdata['parry']; $enemies[$enemy_name]['deflect'] += $logdata['deflect']; $enemies[$enemy_name]['immune'] += $logdata['immune']; $enemies[$enemy_name]['resist'] += $logdata['resist']; $overall['count']++; $overall['damage'] += $logdata['hitpoints']; $overall['threat'] += $logdata['threat']; $overall['hit'] += $logdata['hit']; $overall['crit'] += $logdata['crit']; $overall['miss'] += $logdata['miss']; $overall['dodge'] += $logdata['dodge']; $overall['parry'] += $logdata['parry']; $overall['deflect'] += $logdata['deflect']; $overall['immune'] += $logdata['immune']; $overall['resist'] += $logdata['resist']; $enemies_abilities[$enemy_name][$ability_name]['count']++; $enemies_abilities[$enemy_name][$ability_name]['damage'] += $logdata['hitpoints']; $enemies_abilities[$enemy_name][$ability_name]['threat'] += $logdata['threat']; $enemies_abilities[$enemy_name][$ability_name]['hit'] += $logdata['hit']; $enemies_abilities[$enemy_name][$ability_name]['crit'] += $logdata['crit']; $enemies_abilities[$enemy_name][$ability_name]['miss'] += $logdata['miss']; $enemies_abilities[$enemy_name][$ability_name]['dodge'] += $logdata['dodge']; $enemies_abilities[$enemy_name][$ability_name]['parry'] += $logdata['parry']; $enemies_abilities[$enemy_name][$ability_name]['deflect'] += $logdata['deflect']; $enemies_abilities[$enemy_name][$ability_name]['immune'] += $logdata['immune']; $enemies_abilities[$enemy_name][$ability_name]['resist'] += $logdata['resist']; break; } } } if(count($enemies) > 0) { $html = "<p>".guil('tankstats_note1'); $html .= "</p> <div class='accordion'>"; $_html = ''; $duration = $end_timestamp - $start_timestamp; foreach($enemies as $enemy_name => $enemy) { $_html .= "<h4><a href='#'>".$enemy_name." (".$enemy['damage']." ".guil('damage'); if(! $hidexps) { $_html .= ", ".round($enemy['damage'] / $duration, 2)." DPS"; } $_html .= ")</a></h4> <div> <table class='".($class?$class:'dataTable')."'> <thead> <tr> <th>".guil('ability')."</th> <th>Use</th> <th>".guil('damage')."</th> <th>Dmg/Use</th>"; if(! $hidexps) { $_html .= "<th>DPS</th>"; } // enemies generate Thread to chars, but I just don't see any sense in it //<th>Threat</th> //<th>Threat/Use</th> //<th>TPS</th> $_html .= "<th>Hit (alle)</th> <th>Hit (-crit)</th> <th>Crit</th> <th>Miss</th> <th>Dodge</th> <th>Parry</th> <th>Deflect</th> <th>Resist</th> <th>Immune</th> <th>Hit (all)%</th> <th>Hit (noncrit) %</th> <th>Crit %</th> <th>Miss %</th> <th>Dodge %</th> <th>Parry %</th> <th>Deflect %</th> <th>Resist %</th> <th>Immune %</th> </tr> </thead> <tbody>"; foreach($enemies_abilities[$enemy_name] as $ability_name => $ability) { $_html .= "<tr> <td>".$ability_name."</td> <td>".$ability['count']."</td> <td>".$ability['damage']."</td> <td>".round($ability['damage']/$ability['count'], 2)."</td>"; if(! $hidexps) { $_html .= "<td>".round($ability['damage']/$duration, 2)."</td>"; } // enemies generate Thread to chars, but I just don't see any sense in it // <td>".$ability['threat']."</td> // <td>".round($ability['threat']/$ability['count'], 2)."</td> // <td>".round($ability['threat']/$duration, 2)."</td> $_html .= "<td>".($ability['hit']+$ability['crit'])."</td> <td>".$ability['hit']."</td> <td>".$ability['crit']."</td> <td>".$ability['miss']."</td> <td>".$ability['dodge']."</td> <td>".$ability['parry']."</td> <td>".$ability['deflect']."</td> <td>".$ability['resist']."</td> <td>".$ability['immune']."</td> <td>".round(($ability['hit']+$ability['crit'])/$ability['count'], 2)."</td> <td>".round($ability['hit']/$ability['count'], 2)."</td> <td>".round($ability['crit']/$ability['count'], 2)."</td> <td>".round($ability['miss']/$ability['count'], 2)."</td> <td>".round($ability['dodge']/$ability['count'], 2)."</td> <td>".round($ability['parry']/$ability['count'], 2)."</td> <td>".round($ability['deflect']/$ability['count'], 2)."</td> <td>".round($ability['resist']/$ability['count'], 2)."</td> <td>".round($ability['immune']/$ability['count'], 2)."</td> </tr>"; } $_html .= "</tbody> <tfoot> <tr> <td>".guil('sum')."</td> <td>".$enemy['attack_count']."</td> <td>".$enemy['damage']."</td> <td>".round($enemy['damage']/$enemy['attack_count'], 2)."</td>"; if(! $hidexps) { $_html .= "<td>".round($ability['damage']/$duration, 2)."</td>"; } // enemies generate Thread to chars, but I just don't see any sense in it // <td>".$enemy['threat']."</td> // <td>".round($enemy['threat']/$enemy['attack_count'], 2)."</td> // <td>".round($enemy['threat']/$duration, 2)."</td> $_html .= "<td>".($enemy['hit']+$enemy['crit'])."</td> <td>".$enemy['hit']."</td> <td>".$enemy['crit']."</td> <td>".$enemy['miss']."</td> <td>".$enemy['dodge']."</td> <td>".$enemy['parry']."</td> <td>".$enemy['deflect']."</td> <td>".$enemy['resist']."</td> <td>".$enemy['immune']."</td> <td>".round(($enemy['hit']+$enemy['crit'])/$enemy['attack_count'], 2)."</td> <td>".round($enemy['hit']/$enemy['attack_count'], 2)."</td> <td>".round($enemy['crit']/$enemy['attack_count'], 2)."</td> <td>".round($enemy['miss']/$enemy['attack_count'], 2)."</td> <td>".round($enemy['dodge']/$enemy['attack_count'], 2)."</td> <td>".round($enemy['parry']/$enemy['attack_count'], 2)."</td> <td>".round($enemy['deflect']/$enemy['attack_count'], 2)."</td> <td>".round($enemy['resist']/$enemy['attack_count'], 2)."</td> <td>".round($enemy['immune']/$enemy['attack_count'], 2)."</td> </tr> </tfoot> </table> </div>"; } $html .= "<h4><a href='#gesamt_all_vs_".$char."'>".guil('overall')." (".$overall['damage']." ".guil('damage'); if(! $hidexps) { $html .= ", ".round($overall['damage'] / $duration, 2)." DPS"; } $html .= ")</a></h4> <div> <table> <tr> <td> <table> <tr><td>".guil('hitall').": </td><td>".($overall['hit']+$overall['crit'])."</td> <td>".round(100/$overall['count']*($overall['hit']+$overall['crit']), 2)."%</td></tr> <tr><td>".guil('hitnoncrit').": </td><td>".$overall['hit']."</td> <td>".round(100/$overall['count']*$overall['hit'], 2)."%</td></tr> <tr><td>".guil('crit').": </td><td>".$overall['crit']."</td> <td>".round(100/$overall['count']*$overall['crit'], 2)."%</td></tr> <tr><td>".guil('miss').": </td><td>".$overall['miss']."</td> <td>".round(100/$overall['count']*$overall['miss'], 2)."%</td></tr> <tr><td>".guil('dodge').": </td><td>".$overall['dodge']."</td> <td>".round(100/$overall['count']*$overall['dodge'], 2)."%</td></tr> <tr><td>".guil('parry').": </td><td>".$overall['parry']."</td> <td>".round(100/$overall['count']*$overall['parry'], 2)."%</td></tr> <tr><td>".guil('deflect').": </td><td>".$overall['deflect']."</td> <td>".round(100/$overall['count']*$overall['deflect'], 2)."%</td></tr> <tr><td>".guil('resist').": </td><td>".$overall['resist']."</td> <td>".round(100/$overall['count']*$overall['resist'], 2)."%</td></tr> <tr><td>".guil('immune').": </td><td>".$overall['immune']."</td> <td>".round(100/$overall['count']*$overall['immune'], 2)."%</td></tr> </table> </td> <td>"; $params = guil('hitnoncrit')."=".$overall['hit']; $params .= "&".guil('crit')."=".$overall['crit']; $params .= "&".guil('miss')."=".$overall['miss']; $params .= "&".guil('dodge')."=".$overall['dodge']; $params .= "&".guil('parry')."=".$overall['parry']; $params .= "&".guil('deflect')."=".$overall['deflect']; $params .= "&".guil('resist')."=".$overall['Resist']; $params .= "&".guil('immune')."=".$overall['Immune']; $html .= "<iframe width='450' height='300' frameborder='0' scrolling='no' src='piechart_google.php?".$params."&pietitle=".guil('counterhitstatistic')."&pieheight=300&piewidth=450'></iframe> <center><button class='button_open_dialog_misc' href='piechart_google.php?".$params."&pietitle=".guil('counterhitstatistic')."&pieheight=600&piewidth=800'>".guil('enlarge_grafic')."</button></center> </td> </tr> </table> </div>"; $html .= $_html."</div>"; } parent::Tab( $name, 'Tankstats / * vs '.$char, '', '', $html, $class ); }
$end_id, 1, 'dataTableFullFightStats_ajaxLoaded' ); $tabs[] = new Tab_Full_Fight_Graphs( $tabname_prefix.$_char.'-fullfight-graphs', $char, $start_id, $end_id ); } $tabs_printed=0; print "<div>"; if(!isset($fightnr) || $fightnr == '') { print guil('noxpsnote'); } print "<div class='tabs'><ul>"; foreach($tabs as $tab) { if($tab->data || $tab->html) { print $tab->nameplate(); $tabs_printed++; } } print "</ul>"; foreach($tabs as $tab) { print $tab->tabcontent(); } print '</div> </div>';
function Tab_DpsHpsTps_per_Target($name, $char, $start_id, $end_id, $class='', $hidexps=0) { global $parser; $targets = array(); $last_fetch = $start_id; for($id=$start_id; $id <= $end_id; $id++) { if($id >= $last_fetch + PARSER_MAX_FETCH) { $last_fetch +=PARSER_MAX_FETCH; unset($parser->loglines); unset($parser->logdata); $parser->read_loglines($id, $id+PARSER_MAX_FETCH); $parser->gather_logdata($id, $id+PARSER_MAX_FETCH); } $logdata = $parser->logdata[$id]; if($id == $start_id) { $start_timestamp = $logdata['timestamp']; } elseif ($id == $end_id) { $end_timestamp = $logdata['timestamp']; } if(preg_match('/^'.$char.'(:.+)?/', $logdata['source_name'])) { $target_name = $logdata['target_name']; switch($logdata['effect_id']) { case HEAL: $targets[$target_name]['healed'] += $logdata['hitpoints']; break; case DAMAGE: $targets[$target_name]['damage'] += $logdata['hitpoints']; } $targets[$target_name]['threat'] += $logdata['threat']; $targets[$target_name]['target_type'] = $logdata['target_type']; } } $data = ''; $duration = $end_timestamp - $start_timestamp; if($duration) { foreach($targets as $target_name => $target) { if($target['target_type'] == 'companion') { $target_name = preg_replace('/'.$char.':/', '', $target_name).' (Companion)'; } if($target['damage']>0 || $target['healed']>0 || $target['threat']>0) { switch($target['target_type']) { case 'player': if($target_name == $char) { // self $bgcolor = 'style="background-color:#ddffdd"'; } else { // other player $bgcolor = 'style="background-color:#ffffdd"'; } break; case 'companion': $bgcolor = 'style="background-color:#ddddff"'; break; default: $bgcolor = 'style="background-color:#ffdddd"'; break; } $data .= "<tr> <td ".$bgcolor.">".$target_name."</td> <td>".$target['damage']."</td> <td>".$target['healed']."</td> <td>".$target['threat']."</td>"; if(!$hidexps) { $data .= "<td>".round($target['damage'] / $duration, 2)."</td> <td>".round($target['healed'] / $duration, 2)."</td> <td>".round($target['threat'] / $duration, 2)."</td>"; } $data .= "</tr>"; } } } $headers = array(guil('target'), guil('damage'), guil('heal'), guil('threat')); if(!$hidexps) { $title = guil('xpspertarget'); $headers = array_merge($headers, array('DPS', 'HPS', 'TPS')); } else { $title = guil('damagehealthreatpertarget'); } parent::Tab( $name, $title, $headers, $data, $html, $class ); }
$summary_tooltip= '<big>'.guil('logsummary').'</big>' .'<br>'.guil('duration').': '.seconds_to_readable($summary_duration)." (".guil('active').")" .'<br>'.guil('at')." ".date('d.m.', $min_timestamp)." ".guil('from')." ".date('H:i:s', $min_timestamp)." ".guil('to')." ".date('H:i:s', $max_timestamp) .'<br>'; if($summary_duration) { if($summary_damage>0) { $summary_tooltip .= "<br>".$summary_damage." ".guil('damagedone')." (".round($summary_damage / $summary_duration, 2)." DPS)"; } if($summary_healed>0) { $summary_tooltip .= "<br>".$summary_healed." ".guil('healdone')." (".round($summary_healed / $summary_duration, 2)." HPS)"; } if($summary_threat>0) { $summary_tooltip .= "<br>".$summary_threat." ".guil('threatdone')." (".round($summary_threat / $summary_duration, 2)." TPS)"; } if($summary_healrec>0) { $summary_tooltip .= "<br>".$summary_healrec." ".guil('healreceived')." (".round($summary_healrec / $summary_duration, 2)." HPS)"; } } print "<h3><a title='".htmlentities($summary_tooltip, ENT_QUOTES)."' href='ajax_accordion.php?char=".$char."&log_id=".$_SESSION['log_id']."'>".$summary_title."</a></h3><div><img src='../../images/loading.gif' alt='Loading...'> Loading...</div>"; print "</div>"; // empty div that fixes accordion width bug print "</div>"; // accordion } // foreach $char print "</div>"; // accordion $sql['main']->logout(); unset($guil); unset($parser); include("footer.php");
function CharassignDialog() { global $userchars, $logfiles, $sql; parent::Dialog('charassign', guil('assignyourchars'), '', 1); $parser = new Parser(); $userchars_in_parser = 0; foreach($userchars as $userchar_id => $userchar) { $userchar_names[] = $userchar['name']; if(in_array($userchar['name'], array_keys($parser->players))) { $userchars_in_parser++; } } if($userchars_in_parser) { $html = '<p>'.guil('assignyourchars_note').'. '.guil('createchars_note').'</p> <form action="" method="POST"> <table>'; foreach(array_keys($parser->players) as $logchar) { if(in_array($logchar, $userchar_names)) { $html .= '<tr><td>'.$logchar.' ist </td><td><select name="selectchar['.$logchar.']"><option value="-1"></option>'; foreach($userchars as $userchar_id => $userchar) { if($userchar['name'] == $logchar) { $selected = 'selected="selected"'; } else { $selected = ''; } $html .= '<option '.$selected.' value="'.$userchar_id.'">'.$userchar['name'].' ('.$userchar['class'].'/'.$userchar['server'].')</option>'; } $html .= '</select></td></tr>'; } } $html .= '</table> <input type="hidden" name="op" value="charassign"> <center><input type="submit" value="'.guil('saveassignment').'"></center> </form>'; } else { $html = '<p>'.guil('noneofyourcharsfound').' '.guil('createchars_note').'</p>'; } if(count($logfiles[$_SESSION['log_id']]['chars'])>0) { $html .= '<p>Aktuell zugeordnet:</p><ul>'; foreach($logfiles[$_SESSION['log_id']]['chars'] as $logfile_char) { if(isset($userchars[$logfile_char['id']])) { // own log, own char $charname = $userchars[$logfile_char['id']]['name']; $classname = $userchars[$logfile_char['id']]['class']; $servername = $userchars[$logfile_char['id']]['server']; } else { // public log, others char $res = $sql['main']->query("select c.name, coalesce(cl.".$_SESSION['language'].", cl.de, cl.en, cl.fr, cl.other), s.name from `char` c join class cl on (cl.class_id = c.class_id) join server s on (s.id = c.server_id) where c.id='".$logfile_char['id']."'"); list($charname, $classname, $servername) = $sql['main']->fetch_row($res); } $html .= '<li>"'.$logfile_char['name'].'" ist "'.$charname.' ('.$classname.'/'.$servername.')"</li>'; } $html .= '</ul>'; } $this->content = $html; }
function OptionsDialog($message='') { global $demo, $logfiles, $languages, $openOptions, $userchars, $sql; parent::Dialog('options', guil('dialog_options_title'), '', 1, 1); $disable_ui_element=""; if($demo) { $disable_ui_element = "disabled='disabled'"; } $html = "<div id='accordion_options'> <h3><a href='#'>".guil('view')."</a></h3> <div> <form action='' method='GET'> <table width='100%'> <tr> <td nowrap='nowrap'>".guil('view_chooselogfile').":</td> <td colspan='2'><select name='logfile'>"; if($logfiles) { foreach($logfiles as $logfile_id => $logfile) { $selected = ""; if(isset($_SESSION['log_id']) && $logfile_id == $_SESSION['log_id']) { $selected = " selected='selected' "; } $html .= "<option $selected value='".$logfile_id."'>".$logfile['notes']."</option>"; } } $html .= "</select></td> </tr> <tr> <td nowrap='nowrap'>".guil('minfightduration').":</td> <td width='70%'><div id='min_fight_duration_slider'></div></td> <td><input type='text' id='min_fight_duration_slider_value' name='min_fight_duration' value='' style='width:3em' readonly='readonly'></td> </tr> <tr> <td>".guil('preferedlanguage').":</td> <td> <select name='prefered_language'>"; foreach($languages as $short => $long) { $selected = ""; if($short == $_SESSION['language']) { $selected = "selected='selected'"; } $html .= "<option $selected value='$short'>$long</option>"; } $html .= "</select> </td> <td></td> </tr> <tr> <td colspan='3' align='right'><input type='submit' value='".guil('viewlogwiththissettings')."'></td> </tr> </table> <input type='hidden' name='op' value='setopt'> </form> </div>"; if($_SESSION['user_id']) { $html .= "<h3><a href='#'>".guil('upload')."</a></h3> <div> <form action='' method='POST' enctype='multipart/form-data' name='uploadform'> <input type='hidden' name='MAX_FILE_SIZE' value='".MAX_FILE_SIZE."'> <table> <tr> <td colspan='2'>".guil('zipfilenotice')."</td> </tr> <tr> <td colspan='2'> ".guil('logfile').": (max. ".sprintf("%s", 1024 * (MAX_FILE_SIZE / pow(1024, floor((strlen(MAX_FILE_SIZE) - 1) / 3))))."kB): <input type='file' name='logfile'> </td> </tr> <tr> <td>".guil('logpublicize')."</td> <td><input type='checkbox' name='publicize' checked='checked'></td> </tr> <!--tr> <td>".guil('logmergeable')."</td> <td><input type='checkbox' name='mergeable' checked='checked'></td> </tr--> </table> <p style='text-align:right'><input type='submit' value='".guil('startupload')."' id='button_start_upload' onClick='document.uploadform.submit()' $disable_ui_element>"; if($demo) { $html .= "<div style='text-align:right'><small>".guil('upload_demonotice')."</small></div>"; } $html .= " <input type='hidden' name='op' value='logupload'> </form> </div>"; } if($logfiles && $_SESSION['user_id']) { $html .= "<h3><a href='#'>".guil('availablelogs')."</a></h3> <div> <p>".guil('yourlogs').":</p> <form action='' method='POST'> <table class='dataTableAutoWidth' id='datatable_optionsLogfiles'> <thead> <tr> <th></th> <th>".guil('date')."</th> <th>".guil('from')."</th> <th></th> <th>".guil('to')."</th> <th>".guil('chars')."</th> <th>".guil('fights')."</th> <th>".guil('enemies')."</th> <th>".guil('filename')."</th> <th>".guil('upload')."</th> <th>".guil('actions')."</th> </tr> </thead> <tbody>"; foreach($logfiles as $logfile_id => $logfile) { // exclude public logs if($logfile['uploader_id']==$_SESSION['user_id']) { $html .= "<tr> <td><input type='checkbox' name='delete_logfile[]' value='".$logfile_id."'></td>"; preg_match('/\[(\d\d\.\d\d\.) (\d\d:\d\d)-(\d\d:\d\d)\] (.*?): (\d+) Kämpfe, (\d+) Gegner/', $logfile['notes'], $matches); $html .= " <td>".$matches[1]."</td> <td>".$matches[2]."</td> <td>-</td> <td>".$matches[3]."</td> <td>".$matches[4]."</td> <td>".$matches[5]."</td> <td>".$matches[6]."</td> <td>".preg_replace('#/?upload(/'.$_SESSION['user_id'].')?/?#', '', $logfile['filename'])."</td> <td>".date('Y-m-d H:i:s', $logfile['timestamp'])."</td> <td> <table cellspacing='0' cellpadding='0'> <tr> <td><span class='ui-icon ui-icon-play' onClick='document.location.href=\"?op=setopt&logfile=".$logfile_id."\"' title='".guil('view')."'></span></td>"; if(!$logfile['public']) { $html .= "<td><span class='ui-icon ui-icon-unlocked' onClick='document.location.href=\"?op=logpublicize&logfile=".$logfile_id."\"' title='".guil('publicize')."'></span></td>"; } else { $html .= "<td><span class='ui-icon ui-icon-locked' onClick='document.location.href=\"?op=logdepublicize&logfile=".$logfile_id."\"' title='".guil('depublicize')."'></span></td>"; } $html .= "<td><span class='ui-icon ui-icon-disk' onClick='document.location.href=\"?op=logdownload&logfile=".$logfile_id."\"' title='".guil('download')."'></span></td> </tr> </table> </td> </tr>"; } } $html .= "</tbody> </table> <input type='hidden' name='op' value='logdelete'> <p style='text-align:left'><input type='submit' value='".guil('deletechosenlogs')."' $disable_ui_element></p>"; if($demo) { $html .= "<div style='text-align:left'><small>".guil('delete_demonotice')."</small></div>"; } $html .= "</form> </div>"; } if($_SESSION['user_id']) { $html .= "<h3><a href='#'>".guil('yourchars')."</a></h3> <div>"; if(count($userchars)>0) { $html .= "<table class='dataTableSimple'> <thead> <tr> <th>".guil('name')."</th> <th>".guil('class')."</th> <th>".guil('level')."</th> <th>".guil('race')."</th> <th>".guil('gender')."</th> <th>".guil('faction')."</th> <th>".guil('guild')."</th> <th>".guil('server')."</th> <th>".guil('actions')."</th> </tr> </thead> <tbody>"; foreach($userchars as $char_id => $char) { $html .= "<tr> <td>".$char['name']."</td> <td>".$char['class']."</td> <td>".$char['level']."</td> <td>".$char['race']."</td> <td>".$char['gender']."</td> <td>".$char['faction']."</td> <td>".$char['guild']."</td> <td>".$char['server']."</td> <td> <table cellspacing='0' cellpadding='0'> <tr> <td><span class='ui-icon ui-icon-pencil' onClick='fillform_editchar(\"".htmlentities($char['name'])."\",\"".$char['class_id']."\",\"".htmlentities($char['guild'])."\",\"".$char['server_id']."\",\"".$char['level']."\",\"".$char['race_id']."\",\"".$char['gender_id']."\")' title='".guil('edit')."'></span></td> <td><span class='ui-icon ui-icon-trash' onClick='document.location.href=\"?op=deletechar&charid=".$char_id."\"' title='".guil('delete')."'></span></td> </tr> </table> </td> </tr>"; } $html .= "</tbody></table>"; } $html .= "<p>".guil('createnewchar').":</p> <script type='text/javascript'> function fillform_editchar(charname, charclass, guild, server, level, race, gender) { $('#editchar input[name|=\"charname\"]').val(charname); $('#editchar input[name|=\"guild\"]').val(guild); $('#editchar input[name|=\"charlevel\"]').val(level); $('#editchar select[name|=\"charclass\"]').val(charclass); $('#editchar select[name|=\"server\"]').val(server); $('#editchar select[name|=\"charrace\"]').val(race); $('#editchar select[name|=\"chargender\"]').val(gender); } </script> <form id='editchar' action='' method='POST'> <table> <tr><td>".guil('name').":</td><td><input type='text' name='charname' size='50'></td></tr> <tr><td>".guil('class').":</td><td> <select name='charclass'>"; $res = $sql['main']->query("select class_id, parent_class_id, ".$_SESSION['language']." from class order by ".$_SESSION['language']); while(list($class_id, $parent_class_id, $class_name) = $sql['main']->fetch_row($res)) { $html .= "<option value='".$class_id."'>".$class_name."</option>"; } $html .= "</select> </td></tr> <tr><td>".guil('guild').":</td><td><input type='text' name='guild' size='50'></td></tr> <tr><td>".guil('server').":</td><td> <select name='server'>"; $res = $sql['main']->query("select id, name from server order by name"); while(list($server_id, $server_name) = $sql['main']->fetch_row($res)) { $html .= "<option value='".$server_id."'>".$server_name."</option>"; } $html .= "</select> </td></tr> <tr><td>".guil('level').":</td><td><input type='text' name='charlevel' value='50' size='3'></td></tr> <tr><td>".guil('race').":</td><td><select name='charrace'>"; $res = $sql['main']->query("select id, ".$_SESSION['language']." from race order by ".$_SESSION['language']); while(list($race_id, $race_name) = $sql['main']->fetch_row($res)) { $html .= "<option value='".$race_id."'>".$race_name."</option>"; } $html .= "</select></td></tr> <tr><td>".guil('gender').":</td><td><select name='chargender'><option value='m'>".guil('male')."</option><option value='f'>".guil('female')."</option></select></td></tr> </table> <input type='hidden' name='op' value='createchar'> <p style='text-align:left'><input type='submit' value='".guil('save')."' $disable_ui_element></p> </form> </div>"; } $html .= "<h3><a href='#'>".guil('sendbugreport')."</a></h3> <div> ".guil('bugreport_explanation')." <form action='' method='POST'> <table> <tr><td valign='top'>".guil('bugreport_shorttitle').":</td><td><input type='text' name='subject' maxlength='40' size='40'></td></tr> <tr><td valign='top'>".guil('bugreport_description').":</td><td><textarea name='bugreport' cols='70' rows='6'></textarea></td></tr> <tr><td>".guil('bugreport_yourmail').":</td><td><input type='text' name='email' size='70' value='".($_SESSION['user_email'])."'></tr> <tr><td colspan='2' align='right'>".guil('thankyou')." <input type='submit'></td></tr> </table> <input type='hidden' name='op' value='bugreport'> </form> </div> </div><!-- accordion options -->"; $this->content = $html; $this->nobutton = 1; if(! $_SESSION['min_fight_duration'] || !$_SESSION['log_id'] || $openOptions==1) { $this->autoopen = 1; $this->modal = 1; } else { $this->autoopen = 0; $this->modal = 0; } }
function InfoMessageDialog($message, $title='', $returnto='') { parent::MessageDialog($message, $title?$title:guil('dialog_message_title'), $returnto); }
function Tab_Char_DpsTps_per_Ability($name, $char, $start_id, $end_id, $class='', $hidexps=0) { global $parser; $data = ''; $html = ''; $used_abilities = array(); $overall = array(); $last_fetch = $start_id; for($id=$start_id; $id <= $end_id; $id++) { if($id >= $last_fetch + PARSER_MAX_FETCH) { $last_fetch +=PARSER_MAX_FETCH; unset($parser->loglines); unset($parser->logdata); $parser->read_loglines($id, $id+PARSER_MAX_FETCH); $parser->gather_logdata($id, $id+PARSER_MAX_FETCH); } $logdata = $parser->logdata[$id]; if($id == $start_id) { $start_timestamp = $logdata['timestamp']; } elseif ($id == $end_id) { $end_timestamp = $logdata['timestamp']; } if(preg_match('/^'.$char.'(:(.+))?/', $logdata['source_name'], $matches)) { $ability_name = $logdata['ability_name']; if($logdata['source_type'] == 'companion') { $ability_name = $matches[2].': '.$ability_name; } switch($logdata['effect_id']) { case DAMAGE: $used_abilities[$ability_name]['damage'] += $logdata['hitpoints']; $used_abilities[$ability_name]['threat'] += $logdata['threat']; $used_abilities[$ability_name]['hit'] += $logdata['hit']; $used_abilities[$ability_name]['crit'] += $logdata['crit']; $used_abilities[$ability_name]['miss'] += $logdata['miss']; $used_abilities[$ability_name]['dodge'] += $logdata['dodge']; $used_abilities[$ability_name]['parry'] += $logdata['parry']; $used_abilities[$ability_name]['deflect'] += $logdata['deflect']; $used_abilities[$ability_name]['immune'] += $logdata['immune']; $used_abilities[$ability_name]['resist'] += $logdata['resist']; $used_abilities[$ability_name]['count']++; $overall['damage'] += $logdata['hitpoints']; $overall['threat'] += $logdata['threat']; $overall['hit'] += $logdata['hit']; $overall['crit'] += $logdata['crit']; $overall['miss'] += $logdata['miss']; $overall['dodge'] += $logdata['dodge']; $overall['parry'] += $logdata['parry']; $overall['deflect'] += $logdata['deflect']; $overall['immune'] += $logdata['immune']; $overall['resist'] += $logdata['resist']; $overall['count']++; } } } $duration = $end_timestamp - $start_timestamp; if($overall['count']>0 && $duration) { foreach($used_abilities as $ability_name => $ability) { if($ability['damage']>0) { $data .= "<tr> <td>".$ability_name."</td> <td>".$ability['count']."</td> <td>".$ability['damage']."</td>"; if(!$hidexps) { $data .= "<td>".round($ability['damage'] / $duration, 2)."</td>"; } $data .= "<td>".round($ability['damage'] / $ability['count'], 2)."</td> <td>".$ability['threat']."</td>"; if(!$hidexps) { $data .= "<td>".round($ability['threat'] / $duration, 2)."</td>"; } $data .= "<td>".round($ability['threat'] / $ability['count'], 2)."</td> <td>".round($ability['threat'] / $ability['damage'], 2)."</td> <td>".($ability['hit']+$ability['crit'])."</td> <td>".$ability['hit']."</td> <td>".$ability['crit']."</td> <td>".$ability['miss']."</td> <td>".$ability['dodge']."</td> <td>".$ability['parry']."</td> <td>".$ability['deflect']."</td> <td>".$ability['resist']."</td> <td>".$ability['immune']."</td> <td>".round(100/$ability['count']*($ability['hit']+$ability['crit']), 2)."%</td> <td>".round(100/$ability['count']*$ability['hit'], 2)."%</td> <td>".round(100/$ability['count']*$ability['crit'], 2)."%</td> <td>".round(100/$ability['count']*$ability['miss'], 2)."%</td> <td>".round(100/$ability['count']*$ability['dodge'], 2)."%</td> <td>".round(100/$ability['count']*$ability['parry'], 2)."%</td> <td>".round(100/$ability['count']*$ability['deflect'], 2)."%</td> <td>".round(100/$ability['count']*$ability['resist'], 2)."%</td> <td>".round(100/$ability['count']*$ability['immune'], 2)."%</td> </tr>"; } } $html = "<div style='border-top: 1px solid silver'>Gesamt:<table> <tr> <td> <table> <tr><td>".guil('hitall').": </td><td>".($overall['hit']+$overall['crit'])."</td> <td>".round(100/$overall['count']*($overall['hit']+$overall['crit']), 2)."%</td></tr> <tr><td>".guil('hitnoncrit').": </td><td>".$overall['hit']."</td> <td>".round(100/$overall['count']*$overall['hit'], 2)."%</td></tr> <tr><td>".guil('crit').": </td><td>".$overall['crit']."</td> <td>".round(100/$overall['count']*$overall['crit'], 2)."%</td></tr> <tr><td>".guil('miss')." </td><td>".$overall['miss']."</td> <td>".round(100/$overall['count']*$overall['miss'], 2)."%</td></tr> <tr><td>".guil('dodge').": </td><td>".$overall['dodge']."</td> <td>".round(100/$overall['count']*$overall['dodge'], 2)."%</td></tr> <tr><td>".guil('parry').": </td><td>".$overall['parry']."</td> <td>".round(100/$overall['count']*$overall['parry'], 2)."%</td></tr> <tr><td>".guil('deflect').": </td><td>".$overall['deflect']."</td> <td>".round(100/$overall['count']*$overall['deflect'], 2)."%</td></tr> <tr><td>".guil('resist').": </td><td>".$overall['resist']."</td> <td>".round(100/$overall['count']*$overall['resist'], 2)."%</td></tr> <tr><td>".guil('immune').": </td><td>".$overall['immune']."</td> <td>".round(100/$overall['count']*$overall['immune'], 2)."%</td></tr> </table> </td> <td>"; $params = guil('hitnoncrit')."=".$overall['hit']; $params .= "&".guil('crit')."=".$overall['crit']; $params .= "&".guil('miss')."=".$overall['miss']; $params .= "&".guil('dodge')."=".$overall['dodge']; $params .= "&".guil('parry')."=".$overall['parry']; $params .= "&".guil('deflect')."=".$overall['deflect']; $params .= "&".guil('resist')."=".$overall['resist']; $params .= "&".guil('immune')."=".$overall['immune']; $html .= "<iframe width='450' height='300' frameborder='0' scrolling='no' src='piechart_google.php?".$params."&pietitle=".guil('hitstatistic')."&pieheight=300&piewidth=450'></iframe><br> <center><button class='button_open_dialog_misc' href='piechart_google.php?".$params."&pietitle=".guil('hitstatistic')."&pieheight=600&piewidth=800'>".guil('enlarge_grafic')."</button></center> </td> <td> "; foreach($used_abilities as $ability_name => $ability) { $piedata[] = $ability_name."=".$ability['damage']; } $params = join('&', $piedata); $html .= "<iframe width='450' height='300' frameborder='0' scrolling='no' src='piechart_google.php?".$params."&pietitle=".guil('damageperability')."&pieheight=300&piewidth=450'></iframe> <center><button class='button_open_dialog_misc' href='piechart_google.php?".$params."&pietitle=".guil('damageperability')."&pieheight=600&piewidth=800'>".guil('enlarge_grafic')."</button></center> </td> </tr> </table> </div>"; } if(!$hidexps) { $headers = array(guil('ability'), 'Use', 'Damage', 'DPS', 'Damage/Use', 'Threat', 'TPS', 'Threat/Use', 'Threat/DMG', 'Hit (alle)', 'Hit (noncrit)', 'Crit', 'Miss', 'Dodge', 'Parry', 'Deflect', 'Resist', 'Immune', 'Hit (alle) %', 'Hit (noncrit) %', 'Crit %', 'Miss %', 'Dodge %', 'Parry %', 'Deflect %', 'Resist %', 'Immune %'); } else { $headers = array(guil('ability'), 'Use', 'Damage', 'Damage/Use', 'Threat', 'Threat/Use', 'Threat/DMG', 'Hit (alle)', 'Hit (noncrit)', 'Crit', 'Miss', 'Dodge', 'Parry', 'Deflect', 'Resist', 'Immune', 'Hit (alle) %', 'Hit (noncrit) %', 'Crit %', 'Miss %', 'Dodge %', 'Parry %', 'Deflect %', 'Resist %', 'Immune %'); } parent::Tab( $name, guil('damageperability'), $headers, $data, $html, $class ); }