Главная
Статьи
Новости
Форум
Реклама
Нажмите
/
для поиска
Поиск
Войти
Регистрация
Все что нужно знать о DDоS-атаках грамотному менеджеру
И как реагировать на "пожар", когда неизвестно, где хранятся "огнетушители
Курс биткоина превысил $50 тысяч
Впервые с декабря 2021 года
addidas48
Рейтинг
0
Регистрация
15.12.2012
Топики
1
Комментарии
1
Статьи
0
Ошибки в PHP
15 декабря 2012, 19:05
Всеи спасибо, с этим я рпзобрался. Теперь еще один вопрос вот код:
<?php
if(!defined("Armory"))
{
header("Location: ../error.php");
exit();
}
?>
<div class="parch-profile-banner" id="banner" style="margin-top: -7px!important;">
<h1><?php echo $lang["profile"] ?></h1>
</div>
<?php
//Professions and Defense Skill
$char_primary_prof = array();
$defense_skill = 0;
$all_primary_prof = array();
switchConnection("armory", REALM_NAME);
$get_all_primary_prof = execute_query("SELECT `id`, `name` FROM `dbc_skillline` WHERE `ref_skilllinecategory` = 11");
while($profession = mysql_fetch_assoc($get_all_primary_prof))
$all_primary_prof[$profession["id"]] = $profession;
$statistic_data = explode(" ",$data["level"]);
for($i = $defines["SKILL_DATA"][CLIENT]; $i <= $defines["SKILL_DATA"][CLIENT]+384 ; $i += 3)
{
$skill_id = ($statistic_data[$i] & 0x0000FFFF);
if(isset($all_primary_prof[$skill_id]) || $skill_id == 95)
{
$skill_points = unpack("S", pack("L", $statistic_data[$i+1]));
if($skill_id == 95)
$defense_skill = $skill_points[1];
else
$char_primary_prof[] = array($skill_id, $all_primary_prof[$skill_id]["name"], $skill_points[1]);
}
}
unset($statistic_data);
$char_primary_prof = array_slice($char_primary_prof, 0, 2);
$num_primary_prof = count($char_primary_prof);
//Items
$myinventory = array();
switchConnection("characters", REALM_NAME);
$invq = execute_query("SELECT `item_template`, `slot`, `item` FROM `character_inventory` WHERE `guid` = ".$stat["guid"]." AND `bag` = 0 AND `slot` <= 18 ORDER BY `slot` LIMIT 18");
$numresults = mysql_num_rows($invq);
switchConnection("armory", REALM_NAME);
$itemlist = array();
if($numresults)
{
$query_pls_gm = "SELECT * FROM `cache_item` WHERE `item_id` IN (";
while($invd = mysql_fetch_assoc($invq))
{
$myinventory[$invd["slot"]] = $invd;
$myinventory[$invd["slot"]]["icon"]="";
$query_pls_gm .= $invd["item_template"].",";
$itemlist[] = $invd["item_template"];
}
$query_pls_gm .= "0) AND `mangosdbkey` = ".$realms[REALM_NAME][2]." LIMIT 18";
$item_cache = array();
$item_spellstats_cache = array();
$doquery_pls_gm = execute_query($query_pls_gm);
while($result_pls_gm = mysql_fetch_assoc($doquery_pls_gm))
$item_cache[$result_pls_gm["item_id"]] = $result_pls_gm;
}
execute_query("DELETE FROM `cache_item_char` WHERE `chardbkey` = ".$realms[REALM_NAME][1]." AND `item_owner` = ".$stat["guid"]." LIMIT 18");
$setArray = array();
for($i = 0; $i <= 18; $i ++)
{
/* Get my id */
if(isset($myinventory[$i]))
{
$thisId = $myinventory[$i]["item_template"];
if(!isset($item_cache[$thisId]))
$item_cache[$thisId] = cache_item($thisId);
$char_item = cache_item_char($thisId, $stat["guid"], $i, $myinventory[$i]["item"], $itemlist);
// Item Icon //
$myinventory[$i]["icon"] = $item_cache[$thisId]["item_icon"];
}
}
// WEAPON //
$MainMin = floor($stat["meele_main_hand_min_dmg"][1]);
$MainMax = floor($stat["meele_main_hand_max_dmg"][1]);
$MainAttSpe = number_format($stat["meele_main_hand_attack_time"][1]/1000, 2, ".", "");
if($MainAttSpe)
80 $MainDPS = number_format((($MainMin+$MainMax)/2)/$MainAttSpe, 1, ".", "");
else
$MainDPS = 0;
$OffMin = floor($stat["meele_off_hand_min_dmg"][1]);
$OffMax = floor($stat["meele_off_hand_max_dmg"][1]);
$OffAttSpe = number_format($stat["meele_off_hand_attack_time"][1]/1000, 2, ".", "");
if($OffAttSpe)
87 $OffDPS = number_format((($OffMin+$OffMax)/2)/$OffAttSpe, 1, ".", "");
else
$OffDPS = 0;
$RangedMin = floor($stat["ranged_min_dmg"][1]);
$RangedMax = floor($stat["ranged_max_dmg"][1]);
$RangedAttSpe = number_format($stat["ranged_attack_time"][1]/1000, 2, ".", "");
if($RangedAttSpe)
94 $RangedDPS = number_format((($RangedMin+$RangedMax)/2)/$RangedAttSpe, 1, ".", "");
else
$RangedDPS = 0;
// END WEAPON //
// Strength
switch($stat["class"])
{
case 1: case 2: case 6: case 7: case 11: $attackpowerstr = $stat["strength_eff"]*2-20; break;
case 3: case 4: case 5: case 8: case 9: $attackpowerstr = $stat["strength_eff"]-10; break;
}
if($stat["class"] == 1 || $stat["class"] == 2 || $stat["class"] == 7)
$block_from_strength = floor($stat["strength_eff"]/20);
else
$block_from_strength = -1;
//Agility
if($stat["class"] == 3 || $stat["class"] == 4)
$attackpoweragi = $stat["agility_eff"]-10;
else
$attackpoweragi = -1;
$critConstant = 0;
switch($stat["class"])
{
case 4: case 3: $critConstant = 40; break;
case 11: case 8: case 2: case 5: case 7: $critConstant = 25; break;
case 9: $critConstant = 24.69; break;
case 1: case 6: $critConstant = 33; break;
}
$critchanceagi = round($stat["agility_eff"]/$critConstant, 2);
$armoragi = $stat["agility_eff"]*2;
//Stamina
$increasehealthsta = $stat["stamina_eff"]*10-180;
//Intelect
if($stat["class"] != 1 && $stat["class"] != 4 && $stat["class"] != 6)
{
$increasemanaint = 20+($stat["intellect_eff"]-20)*15;
$spellcritConstant = 0;
if($stat["level"] <= 60)
{
switch($stat["class"])
{
case 2: $spellcritConstant = 54; break;
case 5: $spellcritConstant = 59.2; break;
case 9: $spellcritConstant = 60.6; break;
case 11: $spellcritConstant = 60; break;
default: $spellcritConstant = 59.5;
}
$spellcritConstant = $spellcritConstant*($stat["level"]/60);
}
else if($stat["level"] <= 70)
{
switch($stat["class"])
{
case 2: $spellcritConstant = 80.05; break;
case 9: $spellcritConstant = 81.92; break;
default: $spellcritConstant = 80;
}
$spellcritConstant = $spellcritConstant*($stat["level"]/70);
}
else
{
$spellcritConstant = 166.6667;
$spellcritConstant = $spellcritConstant*($stat["level"]/80);
}
157 $critchanceint = $stat["intellect_eff"]/$spellcritConstant;
switch($stat["class"])
{
case 2: $critchanceint += 3.336; break;
case 3: $critchanceint += 3.6; break;
case 5: $critchanceint += 1.24; break;
case 7: $critchanceint += 2.2; break;
case 8: $critchanceint += 0.91; break;
case 9: $critchanceint += 1.701; break;
case 11: $critchanceint += 1.85; break;
}
$critchanceint = round($critchanceint, 2);
}
else
{
$increasemanaint = -1;
$critchanceint = -1;
}
//Spirit
$HPRegenFromSpirit = HPRegenFromSpirit($stat["level"], $stat["class"], $stat["spirit_eff"], $stat["spirit_base"]);
if($stat["class"] != 1 && $stat["class"] != 4 && $stat["class"] != 6)
$MPRegenFromSpirit = MPRegenFromSpirit($stat["level"], $stat["class"], $stat["spirit_eff"], $stat["intellect_eff"]);
else
$MPRegenFromSpirit = -1;
//Armor
$Reducedphysicaldamage = stathandler_getdamagereduction($stat["level"], $stat["armor_eff"]);
if($stat["class"] == 3 || $stat["class"] == 9)
$PetArmorBonus = floor($stat["armor_eff"]/2.857);
else
$PetArmorBonus = -1;
//Resistances 3.0.9
if(CLIENT)
{
switch($stat["race"])
{
case 4: case 6: $stat["nature_res"] += 10; break;
case 3: $stat["frost_res"] += 10; break;
case 5: case 11: $stat["shadow_res"] += 10; break;
case 7: $stat["arcane_res"] += 10; break;
case 10: $stat["fire_res"] += 5;
$stat["nature_res"] += 5;
$stat["frost_res"] += 5;
$stat["shadow_res"] += 5;
$stat["arcane_res"] += 5; break;
}
}
//Melee Attack Power
$increasedmgmeleatkpow = round($stat["melee_ap"]/14, 1);
//Ranged Attack Power
$increasedmgrngatpow = round($stat["ranged_ap"]/14, 1);
if($stat["class"] == 3) // what about the warlocks pet?
{
$increasepetatpower = ceil($stat["ranged_ap"]*0.222);
$increasepetspedmg = ceil($stat["ranged_ap"]*0.1287);
}
else
{
$increasepetatpower = -1;
$increasepetspedmg = -1;
}
$RatingBases = array(
"resilience" => 25,
"expertise" => 2.5,
"crit" => 14,
"hit" => 10,
"haste" => 10,
"spell_crit" => 14,
"spell_hit" => 8,
"spell_haste" => 10,
"dodge" => 12,
"block" => 5,
"parry" => 15,
"defense" => 1.5
);
И вот ошибки:
Warning: Division by zero in Y:\www\armoryy\trunk\armory\source\character-sheet.php on line 80
Warning: Division by zero in Y:\www\armoryy\trunk\armory\source\character-sheet.php on line 87
Warning: Division by zero in Y:\www\armoryy\trunk\armory\source\character-sheet.php on line 94
Warning: Division by zero in Y:\www\armoryy\trunk\armory\source\character-sheet.php on line 157
Unknown column 'effect_index' in 'where clause'