2 include_once("functions.php");
8 '4'=>'Portal teleport',
11 '7'=>'Environmental damage',
18 '14'=>'Ritual specialize',
19 '15'=>'Ritual activate portal',
20 '16'=>'Quest complete',
21 '17'=>'Weapon damage noschool',
23 '19'=>'Add extra attacks',
31 '27'=>'Persistent area aura',
35 '31'=>'Weapon percent damage',
36 '32'=>'Trigger missile',
38 '34'=>'Summon change item',
39 '35'=>'Apply area aura party',
41 '37'=>'Spell defense',
47 '43'=>'Teleport units face caster',
55 '51'=>'Force critical hit',
56 '52'=>'Guarantee hit',
58 '54'=>'Enchant item temporary',
61 '57'=>'Learn pet spell',
62 '58'=>'Weapon damage',
63 '59'=>'Open lock item',
68 '64'=>'Trigger spell',
69 '65'=>'Apply area aura raid',
70 '66'=>'Create mana gem',
71 '67'=>'Heal max health',
72 '68'=>'Interrupt cast',
77 '73'=>'Untrain talents',
79 '75'=>'Heal mechanical',
80 '76'=>'Summon object wild',
81 '77'=>'Script effect',
84 '80'=>'Add combo points',
89 '85'=>'Summon player',
90 '86'=>'Activate object',
96 '92'=>'Enchant held item',
97 '93'=>'Summon phantasm',
98 '94'=>'Self resurrect',
101 '97'=>'Summon all totems',
106 '102'=>'Dismiss pet',
108 '104'=>'Summon object slot1',
109 '105'=>'Summon object slot2',
110 '106'=>'Summon object slot3',
111 '107'=>'Summon object slot4',
112 '108'=>'Dispel mechanic',
113 '109'=>'Summon dead pet',
114 '110'=>'Destroy all totems',
115 '111'=>'Durability damage',
116 '112'=>'SPELL_EFFECT_112',
117 '113'=>'Resurrect new',
119 '115'=>'Durability damage pct',
120 '116'=>'Skin player corpse',
121 '117'=>'Spirit heal',
123 '119'=>'Apply area aura pet',
124 '120'=>'Teleport graveyard',
125 '121'=>'Normalized weapon dmg',
126 '122'=>'SPELL_EFFECT_122',
128 '124'=>'Player pull',
129 '125'=>'Modify threat percent',
130 '126'=>'Steal beneficial buff',
131 '127'=>'Prospecting',
132 '128'=>'Apply area aura friend',
133 '129'=>'Apply area aura enemy',
134 '130'=>'Redirect threat',
135 '131'=>'SPELL_EFFECT_131',
137 '133'=>'Unlearn specialization',
138 '134'=>'Kill credit',
141 '137'=>'Energize pct',
143 '139'=>'Clear quest',
145 '141'=>'SPELL_EFFECT_141',
146 '142'=>'Trigger spell with value',
147 '143'=>'Apply area aura owner',
148 '144'=>'SPELL_EFFECT_144',
149 '145'=>'SPELL_EFFECT_145',
150 '146'=>'Activate rune',
152 '148'=>'SPELL_EFFECT_148',
154 '150'=>'SPELL_EFFECT_150',
155 '151'=>'Trigger spell 2',
156 '152'=>'SPELL_EFFECT_152',
160 '156'=>'Enchant item prismatic',
161 '157'=>'Create item 2',
163 '159'=>'Allow rename pet',
164 '160'=>'SPELL_EFFECT_160',
165 '161'=>'Learn a Talent Specialization',
166 '162'=>'Activate Spec',
167 '163'=>'SPELL_EFFECT_163',
170 $gSpellAuraName = array(
174 '3'=>"Periodic Damage",
179 '8'=>"Periodic Heal",
180 '9'=>"Mod Attack Speed",
184 '13'=>"Mod Damage Done",
185 '14'=>"Mod Damage Taken",
186 '15'=>"DAMAGE_SHIELD",
188 '17'=>"Stealth Detection",
189 '18'=>"Invisibilily",
190 '19'=>"Invisibilily Detection",
191 '20'=>"Periodic Regenerate % of Total Health",
192 '21'=>"Periodic Regenerate % of Total Mana",
193 '22'=>"Mod Resistance",
194 '23'=>"Periodic Trigger Spell",
195 '24'=>"Perioic Energize",
199 '28'=>"Chance to Reflect harmful Spells",
202 '31'=>"Increase Speed",
203 '32'=>"Increase Mounted Speed",
204 '33'=>"Decrease Speed",
205 '34'=>"Mod Maximum Health",
206 '35'=>"Mod Maximum Power",
208 '37'=>"Immune Effect ",
209 '38'=>"Immune State",
210 '39'=>"Immune School",
211 '40'=>"Immune Damage",
212 '41'=>"Immune Dispel",
213 '42'=>"Proc Trigger Spell",
214 '43'=>"Proc Trigger Damage",
215 '44'=>"Track Creatures",
216 '45'=>"Track Resources",
217 '46'=>"Mod Parry Skill",
219 '48'=>"Mod Dodge Skill",
221 '50'=>"Mod Block Skill",
224 '53'=>"Periodic Leech",
225 '54'=>"Mod Melee/Ranged Hit Chance",
226 '55'=>"Mod Spell Hit Chance",
228 '57'=>"Mod Spell Crit Chance",
229 '58'=>"Increase Swim Speed",
230 '59'=>"Mod Melee/Spell Damage Versus",
231 '60'=>"Pacify and Silence",
233 '62'=>"Periodic Health Funnel",
234 '63'=>"Periodic Power Funnel",
235 '64'=>"Periodic Power Leech",
236 '65'=>"Haste - Spells",
240 '69'=>"Absorbs Damage for School",
241 '70'=>"EXTRA_ATTACKS",
242 '71'=>"Mod Spell Crit",
243 '72'=>"Mod Power Cost %",
244 '73'=>"Mod Power Cost",
245 '74'=>"Reflect Spells",
248 '77'=>"Mechanic Immunity",
250 '79'=>"Mod Damage Done %",
251 '80'=>"MOD_PERCENT_STAT",
252 '81'=>"SPLIT_DAMAGE_PCT",
253 '82'=>"WATER_BREATHING",
254 '83'=>"MOD_BASE_RESISTANCE",
256 '85'=>"MOD_POWER_REGEN",
257 '86'=>"Create Item on Victim Death",
258 '87'=>"Mod Damage Taken %",
259 '88'=>"MOD_HEALTH_REGEN_PERCENT",
260 '89'=>"Periodic Damage % Total Health",
261 '90'=>"Mod Resist Chance",
262 '91'=>"Mod Detect Range",
263 '92'=>"PREVENTS_FLEEING",
264 '93'=>"MOD_UNATTACKABLE",
265 '94'=>"INTERRUPT_REGEN",
267 '96'=>"SPELL_MAGNET",
269 '98'=>"MOD_SKILL_TALENT",
270 '99'=>"Mod Melee Attack Power",
271 '100'=>"AURAS_VISIBLE",
272 '101'=>"MOD_RESISTANCE_PCT",
273 '102'=>"Mod Melee Attack Power Versus",
274 '103'=>"MOD_TOTAL_THREAT",
276 '105'=>"FEATHER_FALL",
278 '107'=>"Add Flat Modifier",
279 '108'=>"Add % Modifier",
280 '109'=>"Add Cast on Target Trigger",
281 '110'=>"Mod Power Regeneration %",
282 '111'=>"Redirect % Damage to Caster",
283 '112'=>"Override Class Scripts",
284 '113'=>"Mod Ranged Damage Taken",
285 '114'=>"Mod Ranged Damage Taken %",
286 '115'=>"Mod Healing Taken", // ???
287 '116'=>"MOD_REGEN_DURING_COMBAT",
288 '117'=>"MOD_MECHANIC_RESISTANCE",
289 '118'=>"Mod Healing Taken %",
290 '119'=>"SHARE_PET_TRACKING",
291 '120'=>"UNTRACKABLE",
293 '122'=>"Mod Offhand Damage %",
294 '123'=>"Mod Target Resistance",
295 '124'=>"Mod Ranged Attack Power",
296 '125'=>"Mod Melee Damage Taken",
297 '126'=>"Mod Melee Damage Taken %",
298 '127'=>"RANGED_ATTACK_POWER_ATTACKER_BONUS",
299 '128'=>"MOD_POSSESS_PET",
300 '129'=>"MOD_SPEED_ALWAYS",
301 '130'=>"MOD_MOUNTED_SPEED_ALWAYS",
302 '131'=>"Mod Ranged Attack Power Versus",
303 '132'=>"Mod Maximum Energy %",
304 '133'=>"Mod Maximum Health %",
305 '134'=>"MOD_MANA_REGEN_INTERRUPT",
306 '135'=>"Mod Healing Done",
307 '136'=>"Mod Healing Done %",
308 '137'=>"Mod Total Stat %",
309 '138'=>"Haste Melee/Ranged",
310 '139'=>"Force Reaction",
311 '140'=>"Haste Ranged",
312 '141'=>"Haste Ranged (Ammo)",
313 '142'=>"MOD_BASE_RESISTANCE_PCT",
314 '143'=>"MOD_RESISTANCE_EXCLUSIVE",
318 '147'=>"ADD_CREATURE_IMMUNITY",
319 '148'=>"Retain Combo Points",
320 '149'=>"RESIST_PUSHBACK",
321 '150'=>"MOD_SHIELD_BLOCKVALUE_PCT",
322 '151'=>"TRACK_STEALTHED",
323 '152'=>"MOD_DETECTED_RANGE",
324 '153'=>"SPLIT_DAMAGE_FLAT",
325 '154'=>"MOD_STEALTH_LEVEL",
326 '155'=>"MOD_WATER_BREATHING",
327 '156'=>"Mod Reputation Gained %",
328 '157'=>"PET_DAMAGE_MULTI",
329 '158'=>"MOD_SHIELD_BLOCKVALUE",
330 '159'=>"NO_PVP_CREDIT",
331 '160'=>"MOD_AOE_AVOIDANCE",
332 '161'=>"MOD_HEALTH_REGEN_IN_COMBAT",
333 '162'=>"POWER_BURN_MANA",
334 '163'=>"MOD_CRIT_DAMAGE_BONUS_MELEE",
336 '165'=>"MELEE_ATTACK_POWER_ATTACKER_BONUS",
337 '166'=>"MOD_ATTACK_POWER_PCT",
338 '167'=>"MOD_RANGED_ATTACK_POWER_PCT",
339 '168'=>"Mod Damage Done Versus %",
340 '169'=>"Mod Crit Damage Versus %",
341 '170'=>"DETECT_AMORE",
342 '171'=>"MOD_SPEED_NOT_STACK",
343 '172'=>"MOD_MOUNTED_SPEED_NOT_STACK",
344 '173'=>"ALLOW_CHAMPION_SPELLS",
345 '174'=>"MOD_SPELL_DAMAGE_OF_STAT_PERCENT",
346 '175'=>"MOD_SPELL_HEALING_OF_STAT_PERCENT",
347 '176'=>"SPIRIT_OF_REDEMPTION",
349 '178'=>"Mod Debuff Resistance %",
350 '179'=>"MOD_ATTACKER_SPELL_CRIT_CHANCE",
351 '180'=>"Mod Spell Damage Versus",
352 '181'=>"Mod Spell Crit Damage Versus",
353 '182'=>"MOD_RESISTANCE_OF_INTELLECT_PERCENT",
354 '183'=>"MOD_CRITICAL_THREAT",
355 '184'=>"MOD_ATTACKER_MELEE_HIT_CHANCE",
356 '185'=>"MOD_ATTACKER_RANGED_HIT_CHANCE",
357 '186'=>"MOD_ATTACKER_SPELL_HIT_CHANCE",
358 '187'=>"MOD_ATTACKER_MELEE_CRIT_CHANCE",
359 '188'=>"MOD_ATTACKER_RANGED_CRIT_CHANCE",
361 '190'=>"Mod Faction Reputation Gain",
362 '191'=>"Limit Movement Speed",
363 '192'=>"Melee Haste",
365 '194'=>"MOD_DEPRICATED_1",
366 '195'=>"MOD_DEPRICATED_2",
367 '196'=>"Mod Cooldown",
368 '197'=>"MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE",
369 '198'=>"MOD_ALL_WEAPON_SKILLS",
370 '199'=>"MOD_INCREASES_SPELL_PCT_TO_HIT",
371 '200'=>"Mod Experience Earned %",
373 '202'=>"IGNORE_COMBAT_RESULT",
374 '203'=>"Mod Melee Critical Damage Taken",
375 '204'=>"Mod Ranged Critical Damage Teken",
377 '206'=>"MOD_SPEED_MOUNTED",
378 '207'=>"MOD_INCREASE_FLIGHT_SPEED",
379 '208'=>"MOD_SPEED_FLIGHT",
380 '209'=>"MOD_FLIGHT_SPEED_ALWAYS",
382 '211'=>"MOD_FLIGHT_SPEED_NOT_STACK",
383 '212'=>"MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT",
384 '213'=>"Mod Rage from Damage Dealt %",
386 '215'=>"ARENA_PREPARATION",
387 '216'=>"Haste Spells",
388 '217'=>"Slow Spells ???",
389 '218'=>"Haste Ranged",
390 '219'=>"MOD_MANA_REGEN_FROM_STAT",
391 '220'=>"MOD_RATING_FROM_STAT",
397 '226'=>"Peridic Dummy",
399 '228'=>"DETECT_STEALTH",
400 '229'=>"Mod AOE Damage Taken",
403 '232'=>"Mod Mechanic Duration",
405 '234'=>"Mod Mechanic Duration not stack",
406 '235'=>"Mod Mechanic Dispel Resist",
408 '237'=>"MOD_SPELL_DAMAGE_OF_ATTACK_POWER",
409 '238'=>"MOD_SPELL_HEALING_OF_ATTACK_POWER",
410 '239'=>"MOD_SCALE_2",
411 '240'=>"Mod Expertise",
412 '241'=>"FORCE_MOVE_FORWARD",
413 '242'=>"MOD_SPELL_DAMAGE_FROM_HEALING",
415 '244'=>"COMPREHEND_LANGUAGE = 244",
416 '245'=>"MOD_DURATION_OF_MAGIC_EFFECTS",
417 '246'=>"MOD_DURATION_OF_EFFECTS_BY_DISPEL",
419 '248'=>"MOD_COMBAT_RESULT_CHANCE",
420 '249'=>"Convert Rune",
421 '250'=>"MOD_INCREASE_HEALTH_2",
422 '251'=>"MOD_ENEMY_DODGE",
424 '253'=>"MOD_BLOCK_CRIT_CHANCE",
425 '254'=>"MOD_DISARM_SHIELD",
426 '255'=>"MOD_MECHANIC_DAMAGE_TAKEN_PERCENT",
427 '256'=>"NO_REAGENT_USE",
428 '257'=>"MOD_TARGET_RESIST_BY_SPELL_CLASS",
434 '263'=>"ALLOW_ONLY_ABILITY",
439 '268'=>"MOD_ATTACK_POWER_OF_STAT_PERCENT",
449 '278'=>"MOD_DISARM_RANGED",
451 '280'=>"MOD_TARGET_ARMOR_PCT",
452 '281'=>"MOD_HONOR_GAIN",
453 '282'=>"MOD_BASE_HEALTH_PCT",
454 '283'=>"MOD_HEALING_RECEIVED"
457 function getSpellFamilyNames()
460 return $wDB->selectCol('-- CACHE: 1h
461 SELECT `spell_family` AS ARRAY_KEY, `name` FROM `wowd_chr_classes`');
464 function getSpellFamilyName($i)
466 $l = getSpellFamilyNames();
467 return isset($l[$i]) ?
$l[$i] : 'Family_'.$i;
470 function getRatingList($mask)
472 global $gRatingNames;
473 return getListFromArray_1($gRatingNames, $mask);
476 function getSpellRange($id)
479 return $wDB->selectRow("-- CACHE: 1h
480 SELECT * FROM `wowd_spell_range` WHERE `id` = ?d", $id);
483 function getRange($index)
485 $range = getSpellRange($index);
487 return "Err index $index";
489 if ($range['minRange']==0 OR $range['minRange']==$range['maxRange'])
490 return $range['maxRange'];
491 return $range['minRange'].' - '.$range['maxRange'];
494 function getRangeText($index)
496 $range = getSpellRange($index);
498 return "Err index $index";
500 if ($range['minRange']==0 OR $range['minRange']==$range['maxRange'])
501 return $range['maxRange'].' yds ('.$range['name'].')';
502 return $range['minRange'].' - '.$range['maxRange'].' yds ('.$range['name'].')';
505 //*****************************************
507 //*****************************************
508 function getTotemCategory($i, $as_ref=1)
511 $gTotemCategory = $wDB->selectCol('-- CACHE: 1h
512 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_totem_category`');
514 $name = @$gTotemCategory[$i];
516 $name = "Category_$i";
518 return "<a href=\"?s=i&totem=$i\">".$name."</a>";
522 function getRuneName($i)
525 if (empty($gRuneName[$i]))
527 return $gRuneName[$i];
530 function getTargetsList($mask)
532 global $gTargetsList;
533 return getListFromArray_1($gTargetsList, $mask);
536 //***************************************
538 //***************************************
539 function getFormNames()
542 return $wDB->selectCol('-- CACHE: 1h
543 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_spell_shapeshift`');
546 function getForm($i, $as_ref=1)
548 $gSpellSnapeshiftForm = getFormNames();
549 $name = @$gSpellSnapeshiftForm[$i];
550 if ($name == "") $name = "Form_$i";
552 return "<a href=\"?s=s&form=$i\">".$name."</a>";
556 function getAllowableForm($mask, $as_ref=1)
558 $gSpellSnapeshiftForm = getFormNames();
560 return getListFromArray_1($gSpellSnapeshiftForm, $mask, "?s=s&form=%d");
561 return getListFromArray_1($gSpellSnapeshiftForm, $mask);
564 function getCategoryName($i, $as_ref=1)
567 return "<a href=\"?s=s&cat=$i\">".$i."</a>";
571 function getPowerTypeName($index)
573 global $gSpellPowerType;
574 if ($index >= 0 && $index < 5)
575 return $gSpellPowerType[$index];
576 return $gSpellPowerType[-1];
579 function getSpellEffectName($i)
581 global $gSpellEffect;
582 return $gSpellEffect[$i];
585 function getSpellAuraName($i)
587 global $gSpellAuraName;
588 return $gSpellAuraName[$i];
591 function getSpellModName($i)
593 global $gSpellModsType;
594 return $gSpellModsType[$i];
597 function getDispelName($i, $as_ref=1)
600 $d = $wDB->selectCol('-- CACHE: 1h
601 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_spell_dispel_type`');
602 $name = isset($d[$i]) ?
$d[$i] : 'Dispell_'.$i;
604 return "<a href=\"?s=s&dispel=$i\">$name</a>";
608 function getMechanicName($i, $as_ref=1)
610 global $gSpellMechanic;
611 $name = @$gSpellMechanic[$i];
612 if (!$name) $name = "Mechanic_$i";
614 return "<a href=\"?s=s&mech=$i\">$name</a>";
618 function getLaungageName($i)
621 $l = $wDB->selectCol('-- CACHE: 1h
622 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_languages`');
623 return isset($l[$i]) ?
$l[$i] : 'Laungage_'.$i;
626 function getSchool($i)
628 global $gSpellSchool;
629 $name = @$gSpellSchool[$i];
630 if ($name == "") $name = "School_$i";
635 function getSpellSchool($mask)
637 global $gSpellSchool;
638 return getListFromArray_0($gSpellSchool, $mask);
641 function getSpellDamageClass($i)
644 return $gDmgClass[$i];
647 function getSpell($spell_id, $fields="*")
650 return $wDB->selectRow("SELECT ".$fields." FROM `wowd_spell` WHERE `id` = ?d", $spell_id);
653 function getSpellName($spell, $as_ref=1)
657 $name = $spell['SpellName'];
659 $name = "<a href=\"?spell=$spell[id]\">".$name."</a>";
660 if ($spell['Rank']!="")
661 $name.="<br><div class=srank>".$spell['Rank']."</div>";
667 function getSpellNameFromId($spellId, $as_ref=1)
669 if ($spell = getSpell($spellId))
670 return getSpellName($spell, $as_ref);
671 return "Err spell $spellId";
674 function getSpellDurationData($durationIndex)
677 return $wDB->selectRow("-- CACHE: 1h
678 SELECT * FROM `wowd_spell_duration` WHERE `id` = ?d", $durationIndex);
681 function getSpellDuration($spell)
683 if ($spell['DurationIndex'])
684 if ($spell_duration = getSpellDurationData($spell['DurationIndex']))
685 return $spell_duration['duration_1']/1000;
689 function getSpellDurationText($spell)
691 if ($spell['DurationIndex'])
693 if ($spell_duration = getSpellDurationData($spell['DurationIndex']))
695 if ($spell_duration['duration_1'] == -1)
697 // if ($spell_duration['duration_1'] == ($spell_duration['duration_3'])
698 // return getTimeText($spell_duration['duration_1']/1000);
700 return getTimeText($spell_duration['duration_1']/1000);
703 return "Err index ".$spell['DurationIndex'];
708 function getSpellRadius($id)
711 return $wDB->selectRow("-- CACHE: 1h
712 SELECT * FROM `wowd_spell_radius` WHERE `id` = ?d", $id);
715 function getRadius($index)
717 if ($index==0) return '0';
719 $radius = getSpellRadius($index);
721 return "Err index $index";
723 if ($radius['radius_1']==0 OR $radius['radius_1']==$radius['radius_3'])
724 return $radius['radius_3'];
725 return $radius['radius_1']." - ".$radius['radius_3'];
728 function getRadiusText($index)
730 return getRadius($index).' yds';
733 function getSpellCooldown($spell)
735 if ($spell['RecoveryTime'] > $spell['CategoryRecoveryTime'])
736 return $spell['RecoveryTime'];
738 return $spell['CategoryRecoveryTime'];
741 function getSpellCastTime($id)
744 return $wDB->selectRow("-- CACHE: 1h
745 SELECT * FROM `wowd_spell_cast_time` WHERE `id` = ?d", $id);
748 function getCastTimeText($spell)
750 $cast_time = getSpellCastTime($spell['CastingTimeIndex']);
751 $time = @$cast_time['time_1']/1000;
753 return $time." sec cast";
755 return "Instant Cast";
758 function getBasePointDesc($spell, $index)
762 $s = $spell['EffectBasePoints_'.$index]+
1;
763 if ($spell['EffectDieSides_'.$index] > 1)
764 $s.=" - ".abs($spell['EffectBasePoints_'.$index]+
$spell['EffectDieSides_'.$index]);
766 if ($spell['EffectRealPointsPerLevel_'.$index])
767 $s.=" + lvl*".$spell['EffectRealPointsPerLevel_'.$index];
768 // Óâåëè÷èâàåò òîëüêî ìàêñ ðàíäîìíîå çíà÷åíèå
769 // if ($spell['EffectDicePerLevel_'.$index])
770 // $s.=" + lvl*".$spell['EffectDicePerLevel_'.$index];
771 if ($spell['EffectPointsPerComboPoint_'.$index])
772 $s." + combo*".$spell['EffectPointsPerComboPoint_'.$index];
776 function getSpellData($spell)
779 $s1 = abs($spell['EffectBasePoints_1']+
1);
780 $s2 = abs($spell['EffectBasePoints_2']+
1);
781 $s3 = abs($spell['EffectBasePoints_3']+
1);
782 if ($spell['EffectDieSides_1']>1) $s1.=" - ".abs($spell['EffectBasePoints_1']+
$spell['EffectDieSides_1']);
783 if ($spell['EffectDieSides_2']>1) $s2.=" - ".abs($spell['EffectBasePoints_2']+
$spell['EffectDieSides_2']);
784 if ($spell['EffectDieSides_3']>1) $s3.=" - ".abs($spell['EffectBasePoints_3']+
$spell['EffectDieSides_3']);
787 if ($spell['DurationIndex'])
788 if ($spell_duration = getSpellDurationData($spell['DurationIndex']))
789 $d = $spell_duration['duration_1']/1000;
792 $t1 = $spell['EffectAmplitude_1'] ?
$spell['EffectAmplitude_1']/1000 : 5;
793 $t2 = $spell['EffectAmplitude_1'] ?
$spell['EffectAmplitude_2']/1000 : 5;
794 $t3 = $spell['EffectAmplitude_1'] ?
$spell['EffectAmplitude_3']/1000 : 5;
797 $o1 = @intval
($s1*$d/$t1);
798 $o2 = @intval
($s2*$d/$t2);
799 $o3 = @intval
($s3*$d/$t3);
801 $spellData['t1']=$t1;
802 $spellData['t2']=$t2;
803 $spellData['t3']=$t3;
804 $spellData['o1']=$o1;
805 $spellData['o2']=$o2;
806 $spellData['o3']=$o3;
807 $spellData['s1']=$s1;
808 $spellData['s2']=$s2;
809 $spellData['s3']=$s3;
810 $spellData['m1']=$s1;
811 $spellData['m2']=$s2;
812 $spellData['m3']=$s3;
813 $spellData['x1']= $spell['EffectChainTarget_1'];
814 $spellData['x2']= $spell['EffectChainTarget_2'];
815 $spellData['x3']= $spell['EffectChainTarget_3'];
816 // $spellData['i'] = $spell['MaxAffectedTargets'];
817 $spellData['d'] = getTimeText($d);
818 $spellData['d1']= getTimeText($d);
819 $spellData['d2']= getTimeText($d);
820 $spellData['d3']= getTimeText($d);
821 $spellData['v'] = $spell['AffectedTargetLevel'];
822 $spellData['u'] = $spell['StackAmount'];
823 $spellData['a1']= getRadius($spell['EffectRadiusIndex_1']);
824 $spellData['a2']= getRadius($spell['EffectRadiusIndex_2']);
825 $spellData['a3']= getRadius($spell['EffectRadiusIndex_3']);
826 $spellData['b1']= $spell['EffectPointsPerComboPoint_1'];
827 $spellData['b2']= $spell['EffectPointsPerComboPoint_2'];
828 $spellData['b3']= $spell['EffectPointsPerComboPoint_3'];
829 $spellData['e'] = $spell['EffectMultipleValue_1'];
830 $spellData['e1']= $spell['EffectMultipleValue_1'];
831 $spellData['e2']= $spell['EffectMultipleValue_2'];
832 $spellData['e3']= $spell['EffectMultipleValue_3'];
833 $spellData['f1']= $spell['DmgMultiplier_1'];
834 $spellData['f2']= $spell['DmgMultiplier_2'];
835 $spellData['f3']= $spell['DmgMultiplier_3'];
836 $spellData['q1']= $spell['EffectMiscValue_1'];
837 $spellData['q2']= $spell['EffectMiscValue_2'];
838 $spellData['q3']= $spell['EffectMiscValue_3'];
839 $spellData['h'] = $spell['procChance'];
840 $spellData['n'] = $spell['procCharges'];
841 $spellData['z'] = "<home>";
845 function spellReplace($spell, $text)
847 $letter = array('${','}');
848 $values = array( '[',']');
849 $text = str_replace($letter, $values, $text);
851 $signs = array('+', '-', '/', '*', '%', '^');
856 $cacheSpellData=array(); // Spell data for spell
858 while (false!==($npos=strpos($data, '$', $pos)))
861 $str .= substr($data, $pos, $npos-$pos);
863 if ('$' == substr($data, $pos, 1))
870 if (!preg_match('/^((([+\-\/*])(\d+);)?(\d*)(?:([lg].*?:.*?);|(\w\d*)))/', substr($data, $pos), $result))
872 $pos +
= strlen($result[0]);
875 $lookup = $result[5]?
$result[5]:$spell['id'];
876 $var = $result[6] ?
$result[6]:$result[7];
879 // l - ðàçìåð ïîñëåäíåé âåëè÷èíû == 1 ? 0 : 1
882 $select = explode(':', substr($var, 1));
883 $str.=@$select[$lastCount==1 ?
0:1];
886 else if ($var[0]=='g')
888 $select = explode(':', substr($var, 1));
893 $spellData = @$cacheSpellData[$lookup];
896 if ($lookup == $spell['id']) $cacheSpellData[$lookup] = getSpellData($spell);
897 else $cacheSpellData[$lookup] = getSpellData(getSpell($lookup));
898 $spellData = @$cacheSpellData[$lookup];
900 if ($spellData && $base = @$spellData[strtolower($var)])
902 if ($op && is_numeric($oparg) && is_numeric($base))
904 $equation = $base.$op.$oparg;
905 eval("\$base = $equation;");
907 if (is_numeric($base)) $lastCount = $base;
914 $str.= substr($data, $pos);
915 $str = @preg_replace_callback
("/\[.+[+\-\/*\d]\]/", 'my_relpace', $str);
916 // $letter = array('*','/','+','-');
917 // $values = array(' * ', ' / ',' + ',' - ');
918 // $str = str_replace($letter, $values, $str);
920 return($str);//."<br /><br />".$text;
923 function my_relpace($matches)
925 $text = str_replace( array('[',']'), array('', ''), $matches[0]);
926 eval("\$text = abs(".$text.");");
927 return intval($text);
930 function getSpellDesc($spell)
932 if ($spell['Description']=="") return $spell['SpellName'];
933 return spellReplace($spell, $spell['Description']);
936 function getSpellBuff($spell)
938 if ($spell['ToolTip']=="") return "";
939 return spellReplace($spell, $spell['ToolTip']);
942 function get_spell_details($spell_id)
944 $spell=getSpell($spell_id);
946 return getSpellDesc($spell);
947 return "Spell id - $spell_id";
950 function getSpellCostText($spell)
952 // Çàïîëíÿåì ñòîèìîñòü çàêëèíàíèÿ
953 $powerType = getPowerTypeName($spell['powerType']);
955 if ($spell['AttributesEx'] & 2)
956 $powerCost = "Uses 100% ".$powerType;
959 if ($spell['ManaCostPercentage'])
960 $powerCost = $spell['ManaCostPercentage']."% of base";
961 else if ($spell['manaCost'])
962 $powerCost = $spell['manaCost'];
965 $powerCost.= " ".$powerType;
966 if ($spell['manaPerSecond'])
967 $powerCost.= " plus ".$spell['manaPerSecond']." per sec";