2 include_once("functions.php");
9 '4'=>'Portal teleport',
10 '5'=>'Teleport units',
12 '7'=>'Environmental damage',
19 '14'=>'Ritual specialize',
20 '15'=>'Ritual activate portal',
21 '16'=>'Quest complete',
22 '17'=>'Weapon damage noschool',
24 '19'=>'Add extra attacks',
32 '27'=>'Persistent area aura',
36 '31'=>'Weapon percent damage',
37 '32'=>'Trigger missile',
39 '34'=>'Summon change item',
40 '35'=>'Apply area aura party',
42 '37'=>'Spell defense',
48 '43'=>'Teleport units face caster',
56 '51'=>'Force critical hit',
57 '52'=>'Guarantee hit',
59 '54'=>'Enchant item temporary',
62 '57'=>'Learn pet spell',
63 '58'=>'Weapon damage',
64 '59'=>'Open lock item',
69 '64'=>'Trigger spell',
70 '65'=>'Apply area aura raid',
71 '66'=>'Create mana gem',
72 '67'=>'Heal max health',
73 '68'=>'Interrupt cast',
78 '73'=>'Untrain talents',
80 '75'=>'Heal mechanical',
81 '76'=>'Summon object wild',
82 '77'=>'Script effect',
85 '80'=>'Add combo points',
90 '85'=>'Summon player',
91 '86'=>'Activate object',
97 '92'=>'Enchant held item',
98 '93'=>'Summon phantasm',
99 '94'=>'Self resurrect',
102 '97'=>'Summon all totems',
107 '102'=>'Dismiss pet',
109 '104'=>'Summon object slot1',
110 '105'=>'Summon object slot2',
111 '106'=>'Summon object slot3',
112 '107'=>'Summon object slot4',
113 '108'=>'Dispel mechanic',
114 '109'=>'Summon dead pet',
115 '110'=>'Destroy all totems',
116 '111'=>'Durability damage',
117 '112'=>'SPELL_EFFECT_112',
118 '113'=>'Resurrect new',
120 '115'=>'Durability damage pct',
121 '116'=>'Skin player corpse',
122 '117'=>'Spirit heal',
124 '119'=>'Apply area aura pet',
125 '120'=>'Teleport graveyard',
126 '121'=>'Normalized weapon dmg',
127 '122'=>'SPELL_EFFECT_122',
129 '124'=>'Player pull',
130 '125'=>'Modify threat percent',
131 '126'=>'Steal beneficial buff',
132 '127'=>'Prospecting',
133 '128'=>'Apply area aura friend',
134 '129'=>'Apply area aura enemy',
135 '130'=>'Redirect threat',
138 '133'=>'Unlearn specialization',
139 '134'=>'Kill credit',
142 '137'=>'Energize pct',
144 '139'=>'Clear quest',
147 '142'=>'Trigger spell with value',
148 '143'=>'Apply area aura owner',
149 '144'=>'Knockback from position',
150 '145'=>'Gravity Pull',
151 '146'=>'Activate rune',
153 '148'=>'SPELL_EFFECT_148',
155 '150'=>'Quest offer',
156 '151'=>'Trigger spell 2',
157 '152'=>'SPELL_EFFECT_152',
161 '156'=>'Enchant item prismatic',
162 '157'=>'Create item 2',
164 '159'=>'Allow rename pet',
165 '160'=>'SPELL_EFFECT_160',
166 '161'=>'Learn a Talent Specialization',
167 '162'=>'Activate Spec',
168 '163'=>'SPELL_EFFECT_163',
172 $gSpellAuraName = array(
176 '3'=>"Periodic Damage",
181 '8'=>"Periodic Heal",
182 '9'=>"Mod Attack Speed",
186 '13'=>"Mod Damage Done",
187 '14'=>"Mod Damage Taken",
188 '15'=>"Damage shield",
190 '17'=>"Stealth Detection",
191 '18'=>"Invisibilily",
192 '19'=>"Invisibilily Detection",
193 '20'=>"Periodic Regenerate % of Total Health",
194 '21'=>"Periodic Regenerate % of Total Mana",
195 '22'=>"Mod Resistance",
196 '23'=>"Periodic Trigger Spell",
197 '24'=>"Perioic Energize",
201 '28'=>"Chance to Reflect harmful Spells",
204 '31'=>"Increase Speed",
205 '32'=>"Increase Mounted Speed",
206 '33'=>"Decrease Speed",
207 '34'=>"Mod Maximum Health",
208 '35'=>"Mod Maximum Power",
210 '37'=>"Immune Effect ",
211 '38'=>"Immune State",
212 '39'=>"Immune School",
213 '40'=>"Immune Damage",
214 '41'=>"Immune Dispel",
215 '42'=>"Proc Trigger Spell",
216 '43'=>"Proc Trigger Damage",
217 '44'=>"Track Creatures",
218 '45'=>"Track Resources",
219 '46'=>"Mod Parry Skill",
221 '48'=>"Mod Dodge Skill",
223 '50'=>"Mod Block Skill",
226 '53'=>"Periodic Leech",
227 '54'=>"Mod Melee/Ranged Hit Chance",
228 '55'=>"Mod Spell Hit Chance",
230 '57'=>"Mod Spell Crit Chance",
231 '58'=>"Increase Swim Speed",
232 '59'=>"Mod Melee/Spell Damage Versus",
233 '60'=>"Pacify and Silence",
235 '62'=>"Periodic Health Funnel",
236 '63'=>"Periodic Power Funnel",
237 '64'=>"Periodic Power Leech",
238 '65'=>"Haste - Spells",
242 '69'=>"Absorbs Damage for School",
243 '70'=>"EXTRA_ATTACKS",
244 '71'=>"Mod Spell Crit",
245 '72'=>"Mod Power Cost %",
246 '73'=>"Mod Power Cost",
247 '74'=>"Reflect Spells",
250 '77'=>"Mechanic Immunity",
252 '79'=>"Mod Damage Done %",
254 '81'=>"Split Damage %",
255 '82'=>"Underwater Breathing",
256 '83'=>"Mod Base Resistance",
257 '84'=>"Health Regen",
259 '86'=>"Create Item on Victim Death",
260 '87'=>"Mod Damage Taken %",
261 '88'=>"Mod Health Regen %",
262 '89'=>"Periodic Damage % Total Health",
263 '90'=>"Mod Resist Chance",
264 '91'=>"Mod Detect Range",
266 '93'=>"Unattackable",
267 '94'=>"INTERRUPT_REGEN",
272 '99'=>"Mod Melee Attack Power",
273 '100'=>"AURAS_VISIBLE",
274 '101'=>"Mod Resistance %",
275 '102'=>"Mod Melee Attack Power Versus",
278 '105'=>"FEATHER_FALL",
280 '107'=>"Add Flat Modifier",
281 '108'=>"Add % Modifier",
282 '109'=>"Add Cast on Target Trigger",
283 '110'=>"Mod Power Regeneration %",
284 '111'=>"Redirect % Damage to Caster",
285 '112'=>"Override Class Scripts",
286 '113'=>"Mod Ranged Damage Taken",
287 '114'=>"Mod Ranged Damage Taken %",
288 '115'=>"Mod Healing Taken",
289 '116'=>"Allow % of Health Regeneration to Continue in Combat",
290 '117'=>"Give % Chance to Resist Mechanic",
291 '118'=>"Mod Healing Taken %",
292 '119'=>"SHARE_PET_TRACKING",
293 '120'=>"UNTRACKABLE",
295 '122'=>"Mod Offhand Damage %",
296 '123'=>"Mod Target Resistance",
297 '124'=>"Mod Ranged Attack Power",
298 '125'=>"Mod Melee Damage Taken",
299 '126'=>"Mod Melee Damage Taken %",
300 '127'=>"Mod Attacker Ranged Attack Power",
301 '128'=>"MOD_POSSESS_PET",
302 '129'=>"MOD_SPEED_ALWAYS",
303 '130'=>"MOD_MOUNTED_SPEED_ALWAYS",
304 '131'=>"Mod Ranged Attack Power Versus",
305 '132'=>"Mod Maximum Energy %",
306 '133'=>"Mod Maximum Health %",
307 '134'=>"MOD_MANA_REGEN_INTERRUPT",
308 '135'=>"Mod Healing Done",
309 '136'=>"Mod Healing Done %",
310 '137'=>"Mod Total Stat %",
311 '138'=>"Haste Melee/Ranged",
312 '139'=>"Force Reaction",
313 '140'=>"Haste Ranged",
314 '141'=>"Haste Ranged (Ammo)",
315 '142'=>"MOD_BASE_RESISTANCE_PCT",
316 '143'=>"MOD_RESISTANCE_EXCLUSIVE",
320 '147'=>"ADD_CREATURE_IMMUNITY",
321 '148'=>"Retain Combo Points",
322 '149'=>"RESIST_PUSHBACK",
323 '150'=>"MOD_SHIELD_BLOCKVALUE_PCT",
324 '151'=>"TRACK_STEALTHED",
325 '152'=>"MOD_DETECTED_RANGE",
326 '153'=>"SPLIT_DAMAGE_FLAT",
327 '154'=>"MOD_STEALTH_LEVEL",
328 '155'=>"MOD_WATER_BREATHING",
329 '156'=>"Mod Reputation Gained %",
330 '157'=>"PET_DAMAGE_MULTI",
331 '158'=>"MOD_SHIELD_BLOCKVALUE",
332 '159'=>"NO_PVP_CREDIT",
333 '160'=>"MOD_AOE_AVOIDANCE",
334 '161'=>"MOD_HEALTH_REGEN_IN_COMBAT",
335 '162'=>"POWER_BURN_MANA",
336 '163'=>"MOD_CRIT_DAMAGE_BONUS_MELEE",
338 '165'=>"MELEE_ATTACK_POWER_ATTACKER_BONUS",
339 '166'=>"MOD_ATTACK_POWER_PCT",
340 '167'=>"MOD_RANGED_ATTACK_POWER_PCT",
341 '168'=>"Mod Damage Done Versus %",
342 '169'=>"Mod Crit Damage Versus %",
343 '170'=>"DETECT_AMORE",
344 '171'=>"MOD_SPEED_NOT_STACK",
345 '172'=>"MOD_MOUNTED_SPEED_NOT_STACK",
346 '173'=>"ALLOW_CHAMPION_SPELLS",
347 '174'=>"MOD_SPELL_DAMAGE_OF_STAT_PERCENT",
348 '175'=>"MOD_SPELL_HEALING_OF_STAT_PERCENT",
349 '176'=>"SPIRIT_OF_REDEMPTION",
351 '178'=>"Mod Debuff Resistance %",
352 '179'=>"Mod Attacker Crit Chance %",
353 '180'=>"Mod Spell Damage Versus",
354 '181'=>"Mod Spell Crit Damage Versus",
355 '182'=>"MOD_RESISTANCE_OF_INTELLECT_PERCENT",
356 '183'=>"MOD_CRITICAL_THREAT",
357 '184'=>"MOD_ATTACKER_MELEE_HIT_CHANCE",
358 '185'=>"MOD_ATTACKER_RANGED_HIT_CHANCE",
359 '186'=>"MOD_ATTACKER_SPELL_HIT_CHANCE",
360 '187'=>"MOD_ATTACKER_MELEE_CRIT_CHANCE",
361 '188'=>"MOD_ATTACKER_RANGED_CRIT_CHANCE",
363 '190'=>"Mod Faction Reputation Gain",
364 '191'=>"Limit Movement Speed",
365 '192'=>"Melee Haste",
367 '194'=>"MOD_DEPRICATED_1",
368 '195'=>"MOD_DEPRICATED_2",
369 '196'=>"Mod Cooldown",
370 '197'=>"MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE",
371 '198'=>"MOD_ALL_WEAPON_SKILLS",
372 '199'=>"MOD_INCREASES_SPELL_PCT_TO_HIT",
373 '200'=>"Mod Experience Earned %",
375 '202'=>"IGNORE_COMBAT_RESULT",
376 '203'=>"Mod Melee Critical Damage Taken",
377 '204'=>"Mod Ranged Critical Damage Teken",
378 '205'=>"MOD_ATTACKER_SPELL_CRIT_DAMAGE",
379 '206'=>"MOD_SPEED_MOUNTED",
380 '207'=>"MOD_INCREASE_FLIGHT_SPEED",
381 '208'=>"MOD_SPEED_FLIGHT",
382 '209'=>"MOD_FLIGHT_SPEED_ALWAYS",
383 '210'=>"MOD_FLIGHT_SPEED_NOT_STACKING",
384 '211'=>"MOD_FLIGHT_SPEED_MOUNTED_NOT_STACKING",
385 '212'=>"MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT",
386 '213'=>"Mod Rage from Damage Dealt %",
388 '215'=>"ARENA_PREPARATION",
389 '216'=>"Haste Spells",
390 '217'=>"Slow Spells ???",
391 '218'=>"Haste Ranged",
392 '219'=>"MOD_MANA_REGEN_FROM_STAT",
393 '220'=>"MOD_RATING_FROM_STAT",
399 '226'=>"Peridic Dummy",
400 '227'=>"Periodic Trigger Spell With Value",
401 '228'=>"DETECT_STEALTH",
402 '229'=>"Mod AOE Damage Taken",
404 '231'=>"PROC_TRIGGER_SPELL_WITH_VALUE",
405 '232'=>"Mod Mechanic Duration",
407 '234'=>"Mod Mechanic Duration not stack",
408 '235'=>"Mod Dispel Resist",
409 '236'=>"Control Vehicle",
410 '237'=>"Mod Spell Damage Percent From Attack Power",
411 '238'=>"Mod Spell Healing Percent From Attack Power",
413 '240'=>"Mod Expertise",
414 '241'=>"Force Move Forward",
416 '243'=>"Faction Override",
417 '244'=>"Comprehend Language",
418 '245'=>"MOD_DURATION_OF_MAGIC_EFFECTS",
419 '246'=>"MOD_DURATION_OF_EFFECTS_BY_DISPEL",
420 '247'=>"Mirror Image",
421 '248'=>"MOD_COMBAT_RESULT_CHANCE",
422 '249'=>"Convert Rune",
423 '250'=>"Mod Increase Health",
424 '251'=>"MOD_ENEMY_DODGE",
425 '252'=>"Mod Combat Speed Pct",
426 '253'=>"MOD_BLOCK_CRIT_CHANCE",
428 '255'=>"MOD_MECHANIC_DAMAGE_TAKEN_PERCENT",
429 '256'=>"No Reagent Use Aura",
430 '257'=>"MOD_TARGET_RESIST_BY_SPELL_CLASS",
431 '258'=>"MOD_SPELL_VISUAL",
432 '259'=>"MOD_PERIODIC_HEAL",
433 '260'=>"SCREEN_EFFEC",
436 '263'=>"ALLOW_ONLY_ABILITY",
441 '268'=>"Mod Attack Power Of Stat Percent",
452 '279'=>"Mirror Name",
453 '280'=>"Mod Target Armor Pct",
454 '281'=>"MOD_HONOR_GAIN",
455 '282'=>"Increase Base Health Percent",
456 '283'=>"MOD_HEALING_RECEIVED",
457 '284'=>"Trigger Linked Aura",
458 '285'=>"Mod Attack Power Of Armor",
459 '286'=>"ABILITY_PERIODIC_CRIT",
460 '287'=>"DEFLECT_SPELLS",
461 '288'=>"MOD_PARRY_FROM_BEHIND_PERCENT",
463 '290'=>"Mod All Crit Chance",
464 '291'=>"MOD_QUEST_XP_PCT",
465 '292'=>"Open Stable",
466 '293'=>"Add Mechanic Abilities",
467 '294'=>"Stop Natural Mana Regen",
469 '296'=>"Set Vehicle Id",
474 '301'=>"HEAL_ABSORB",
477 '304'=>"Fake Inebriation",
478 '305'=>"Mod Increase Speed",
483 '310'=>"MOD_PET_AOE_DAMAGE_AVOIDANCE",
487 '314'=>"Prevent Resurrection",
492 function getSpellFamilyNames()
495 return $wDB->selectCol('-- CACHE: 1h
496 SELECT `spell_family` AS ARRAY_KEY, `name` FROM `wowd_chr_classes`');
499 function getSpellFamilyName($i)
501 $l = getSpellFamilyNames();
502 return isset($l[$i]) ?
$l[$i] : 'Family_'.$i;
505 function getRatingList($mask)
507 global $gRatingNames;
508 return getListFromArray_1($gRatingNames, $mask);
511 function getSpellRange($id)
514 return $wDB->selectRow("-- CACHE: 1h
515 SELECT * FROM `wowd_spell_range` WHERE `id` = ?d", $id);
518 function getRange($index)
520 $range = getSpellRange($index);
522 return "Err index $index";
524 if ($range['minRange']==0 OR $range['minRange']==$range['maxRange'])
525 return $range['maxRange'];
526 return $range['minRange'].' - '.$range['maxRange'];
529 function getRangeText($index)
531 $range = getSpellRange($index);
533 return "Err index $index";
535 if ($range['minRange']==0 OR $range['minRange']==$range['maxRange'])
536 return $range['maxRange'].' yds ('.$range['name'].')';
537 return $range['minRange'].' - '.$range['maxRange'].' yds ('.$range['name'].')';
540 //*****************************************
542 //*****************************************
543 function getTotemCategory($i, $as_ref=1)
546 $gTotemCategory = $wDB->selectCol('-- CACHE: 1h
547 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_totem_category`');
549 $name = @$gTotemCategory[$i];
551 $name = "Category_$i";
553 return "<a href=\"?s=i&totem=$i\">".$name."</a>";
557 function getRuneName($i)
560 if (empty($gRuneName[$i]))
562 return $gRuneName[$i];
565 function getTargetsList($mask)
567 global $gTargetsList;
568 return getListFromArray_1($gTargetsList, $mask);
571 //***************************************
573 //***************************************
574 function getFormNames()
577 return $wDB->selectCol('-- CACHE: 1h
578 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_spell_shapeshift`');
581 function getForm($i, $as_ref=1)
583 $gSpellSnapeshiftForm = getFormNames();
584 $name = @$gSpellSnapeshiftForm[$i];
585 if ($name == "") $name = "Form_$i";
587 return "<a href=\"?s=s&form=$i\">".$name."</a>";
591 function getAllowableForm($mask, $as_ref=1)
593 $gSpellSnapeshiftForm = getFormNames();
595 return getListFromArray_1($gSpellSnapeshiftForm, $mask, "?s=s&form=%d");
596 return getListFromArray_1($gSpellSnapeshiftForm, $mask);
599 function getCategoryName($i, $as_ref=1)
602 return "<a href=\"?s=s&cat=$i\">".$i."</a>";
606 function getPowerTypeName($index)
608 global $gSpellPowerType;
609 if ($index >= 0 && $index < 5)
610 return $gSpellPowerType[$index];
611 return $gSpellPowerType[-1];
614 function getSpellEffectName($i)
616 global $gSpellEffect;
617 return $gSpellEffect[$i];
620 function getSpellAuraName($i)
622 global $gSpellAuraName;
623 return $gSpellAuraName[$i];
626 function getSpellModName($i)
628 global $gSpellModsType;
629 return $gSpellModsType[$i];
632 function getDispelName($i, $as_ref=1)
635 $d = $wDB->selectCol('-- CACHE: 1h
636 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_spell_dispel_type`');
637 $name = isset($d[$i]) ?
$d[$i] : 'Dispell_'.$i;
639 return "<a href=\"?s=s&dispel=$i\">$name</a>";
643 function getMechanicName($i, $as_ref=1)
645 global $gSpellMechanic;
646 $name = @$gSpellMechanic[$i];
647 if (!$name) $name = "Mechanic_$i";
649 return "<a href=\"?s=s&mech=$i\">$name</a>";
653 function getLaungageName($i)
656 $l = $wDB->selectCol('-- CACHE: 1h
657 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_languages`');
658 return isset($l[$i]) ?
$l[$i] : 'Laungage_'.$i;
661 function getSchool($i)
663 global $gSpellSchool;
664 $name = @$gSpellSchool[$i];
665 if ($name == "") $name = "School_$i";
670 function getSpellSchool($mask)
672 global $gSpellSchool;
673 return getListFromArray_0($gSpellSchool, $mask);
676 function getSpellDamageClass($i)
679 return $gDmgClass[$i];
682 function getSpell($spell_id, $fields="*")
685 return $wDB->selectRow("SELECT ".$fields." FROM `wowd_spell` WHERE `id` = ?d", $spell_id);
688 function getSpellName($spell, $as_ref=1)
692 $name = $spell['SpellName'];
694 $name = "<a href=\"?spell=$spell[id]\">".$name."</a>";
695 if ($spell['Rank']!="")
696 $name.="<br><div class=srank>".$spell['Rank']."</div>";
702 function getSpellNameFromId($spellId, $as_ref=1)
704 if ($spell = getSpell($spellId))
705 return getSpellName($spell, $as_ref);
706 return "Err spell $spellId";
709 function getSpellDurationData($durationIndex)
712 return $wDB->selectRow("-- CACHE: 1h
713 SELECT * FROM `wowd_spell_duration` WHERE `id` = ?d", $durationIndex);
716 function getSpellDuration($spell)
718 if ($spell['DurationIndex'])
719 if ($spell_duration = getSpellDurationData($spell['DurationIndex']))
720 return $spell_duration['duration_1']/1000;
724 function getSpellDurationText($spell)
726 if ($spell['DurationIndex'])
728 if ($spell_duration = getSpellDurationData($spell['DurationIndex']))
730 if ($spell_duration['duration_1'] == -1)
732 // if ($spell_duration['duration_1'] == ($spell_duration['duration_3'])
733 // return getTimeText($spell_duration['duration_1']/1000);
735 return getTimeText($spell_duration['duration_1']/1000);
738 return "Err index ".$spell['DurationIndex'];
743 function getSpellRadius($id)
746 return $wDB->selectRow("-- CACHE: 1h
747 SELECT * FROM `wowd_spell_radius` WHERE `id` = ?d", $id);
750 function getRadius($index)
752 if ($index==0) return '0';
754 $radius = getSpellRadius($index);
756 return "Err index $index";
758 if ($radius['radius_1']==0 OR $radius['radius_1']==$radius['radius_3'])
759 return $radius['radius_3'];
760 return $radius['radius_1']." - ".$radius['radius_3'];
763 function getRadiusText($index)
765 return getRadius($index).' yds';
768 function getSpellCooldown($spell)
770 if ($spell['RecoveryTime'] > $spell['CategoryRecoveryTime'])
771 return $spell['RecoveryTime'];
773 return $spell['CategoryRecoveryTime'];
776 function getSpellCastTime($id)
779 return $wDB->selectRow("-- CACHE: 1h
780 SELECT * FROM `wowd_spell_cast_time` WHERE `id` = ?d", $id);
783 function getCastTimeText($spell)
785 $cast_time = getSpellCastTime($spell['CastingTimeIndex']);
786 $time = @$cast_time['time_1']/1000;
788 return $time." sec cast";
790 return "Instant Cast";
793 function getBasePointDesc($spell, $index)
797 $s = $spell['EffectBasePoints_'.$index]+
1;
798 if ($spell['EffectDieSides_'.$index] > 1)
799 $s.=" - ".abs($spell['EffectBasePoints_'.$index]+
$spell['EffectDieSides_'.$index]);
801 if ($spell['EffectRealPointsPerLevel_'.$index])
802 $s.=" + lvl*".$spell['EffectRealPointsPerLevel_'.$index];
803 // Увеличивает только макс рандомное значение
804 // if ($spell['EffectDicePerLevel_'.$index])
805 // $s.=" + lvl*".$spell['EffectDicePerLevel_'.$index];
806 if ($spell['EffectPointsPerComboPoint_'.$index])
807 $s." + combo*".$spell['EffectPointsPerComboPoint_'.$index];
811 function getSpellData($spell)
814 $s1 = abs($spell['EffectBasePoints_1']+
1);
815 $s2 = abs($spell['EffectBasePoints_2']+
1);
816 $s3 = abs($spell['EffectBasePoints_3']+
1);
817 if ($spell['EffectDieSides_1']>1) $s1.=" - ".abs($spell['EffectBasePoints_1']+
$spell['EffectDieSides_1']);
818 if ($spell['EffectDieSides_2']>1) $s2.=" - ".abs($spell['EffectBasePoints_2']+
$spell['EffectDieSides_2']);
819 if ($spell['EffectDieSides_3']>1) $s3.=" - ".abs($spell['EffectBasePoints_3']+
$spell['EffectDieSides_3']);
822 if ($spell['DurationIndex'])
823 if ($spell_duration = getSpellDurationData($spell['DurationIndex']))
824 $d = $spell_duration['duration_1']/1000;
827 $t1 = $spell['EffectAmplitude_1'] ?
$spell['EffectAmplitude_1']/1000 : 5;
828 $t2 = $spell['EffectAmplitude_1'] ?
$spell['EffectAmplitude_2']/1000 : 5;
829 $t3 = $spell['EffectAmplitude_1'] ?
$spell['EffectAmplitude_3']/1000 : 5;
832 $o1 = @intval
($s1*$d/$t1);
833 $o2 = @intval
($s2*$d/$t2);
834 $o3 = @intval
($s3*$d/$t3);
836 $spellData['t1']=$t1;
837 $spellData['t2']=$t2;
838 $spellData['t3']=$t3;
839 $spellData['o1']=$o1;
840 $spellData['o2']=$o2;
841 $spellData['o3']=$o3;
842 $spellData['s1']=$s1;
843 $spellData['s2']=$s2;
844 $spellData['s3']=$s3;
845 $spellData['m1']=$s1;
846 $spellData['m2']=$s2;
847 $spellData['m3']=$s3;
848 $spellData['x1']= $spell['EffectChainTarget_1'];
849 $spellData['x2']= $spell['EffectChainTarget_2'];
850 $spellData['x3']= $spell['EffectChainTarget_3'];
851 // $spellData['i'] = $spell['MaxAffectedTargets'];
852 $spellData['d'] = getTimeText($d);
853 $spellData['d1']= getTimeText($d);
854 $spellData['d2']= getTimeText($d);
855 $spellData['d3']= getTimeText($d);
856 $spellData['v'] = $spell['AffectedTargetLevel'];
857 $spellData['u'] = $spell['StackAmount'];
858 $spellData['a1']= getRadius($spell['EffectRadiusIndex_1']);
859 $spellData['a2']= getRadius($spell['EffectRadiusIndex_2']);
860 $spellData['a3']= getRadius($spell['EffectRadiusIndex_3']);
861 $spellData['b1']= $spell['EffectPointsPerComboPoint_1'];
862 $spellData['b2']= $spell['EffectPointsPerComboPoint_2'];
863 $spellData['b3']= $spell['EffectPointsPerComboPoint_3'];
864 $spellData['e'] = $spell['EffectMultipleValue_1'];
865 $spellData['e1']= $spell['EffectMultipleValue_1'];
866 $spellData['e2']= $spell['EffectMultipleValue_2'];
867 $spellData['e3']= $spell['EffectMultipleValue_3'];
868 $spellData['f1']= $spell['DmgMultiplier_1'];
869 $spellData['f2']= $spell['DmgMultiplier_2'];
870 $spellData['f3']= $spell['DmgMultiplier_3'];
871 $spellData['q1']= $spell['EffectMiscValue_1'];
872 $spellData['q2']= $spell['EffectMiscValue_2'];
873 $spellData['q3']= $spell['EffectMiscValue_3'];
874 $spellData['h'] = $spell['procChance'];
875 $spellData['n'] = $spell['procCharges'];
876 $spellData['z'] = "<home>";
880 function spellReplace($spell, $text)
882 $letter = array('${','}');
883 $values = array( '[',']');
884 $text = str_replace($letter, $values, $text);
886 $signs = array('+', '-', '/', '*', '%', '^');
891 $cacheSpellData=array(); // Spell data for spell
893 while (false!==($npos=strpos($data, '$', $pos)))
896 $str .= substr($data, $pos, $npos-$pos);
898 if ('$' == substr($data, $pos, 1))
905 if (!preg_match('/^((([+\-\/*])(\d+);)?(\d*)(?:([lg].*?:.*?);|(\w\d*)))/', substr($data, $pos), $result))
907 $pos +
= strlen($result[0]);
910 $lookup = $result[5]?
$result[5]:$spell['id'];
911 $var = $result[6] ?
$result[6]:$result[7];
914 // l - размер последней величины == 1 ? 0 : 1
917 $select = explode(':', substr($var, 1));
918 $str.=@$select[$lastCount==1 ?
0:1];
921 else if ($var[0]=='g')
923 $select = explode(':', substr($var, 1));
928 $spellData = @$cacheSpellData[$lookup];
931 if ($lookup == $spell['id']) $cacheSpellData[$lookup] = getSpellData($spell);
932 else $cacheSpellData[$lookup] = getSpellData(getSpell($lookup));
933 $spellData = @$cacheSpellData[$lookup];
935 if ($spellData && $base = @$spellData[strtolower($var)])
937 if ($op && is_numeric($oparg) && is_numeric($base))
939 $equation = $base.$op.$oparg;
940 eval("\$base = $equation;");
942 if (is_numeric($base)) $lastCount = $base;
949 $str.= substr($data, $pos);
950 $str = @preg_replace_callback
("/\[.+[+\-\/*\d]\]/", 'my_relpace', $str);
951 // $letter = array('*','/','+','-');
952 // $values = array(' * ', ' / ',' + ',' - ');
953 // $str = str_replace($letter, $values, $str);
955 return($str);//."<br /><br />".$text;
958 function my_relpace($matches)
960 $text = str_replace( array('[',']'), array('', ''), $matches[0]);
961 eval("\$text = abs(".$text.");");
962 return intval($text);
965 function getSpellDesc($spell)
967 if ($spell['Description']=="") return $spell['SpellName'];
968 return spellReplace($spell, $spell['Description']);
971 function getSpellBuff($spell)
973 if ($spell['ToolTip']=="") return "";
974 return spellReplace($spell, $spell['ToolTip']);
977 function get_spell_details($spell_id)
979 $spell=getSpell($spell_id);
981 return getSpellDesc($spell);
982 return "Spell id - $spell_id";
985 function getSpellCostText($spell)
987 // Заполняем стоимость заклинания
988 $powerType = getPowerTypeName($spell['powerType']);
990 if ($spell['AttributesEx'] & 2)
991 $powerCost = "Uses 100% ".$powerType;
994 if ($spell['ManaCostPercentage'])
995 $powerCost = $spell['ManaCostPercentage']."% of base";
996 else if ($spell['manaCost'])
997 $powerCost = $spell['manaCost'];
1000 $powerCost.= " ".$powerType;
1001 if ($spell['manaPerSecond'])
1002 $powerCost.= " plus ".$spell['manaPerSecond']." per sec";