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',
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',
171 $gSpellAuraName = array(
175 '3'=>"Periodic Damage",
180 '8'=>"Periodic Heal",
181 '9'=>"Mod Attack Speed",
185 '13'=>"Mod Damage Done",
186 '14'=>"Mod Damage Taken",
187 '15'=>"Damage shield",
189 '17'=>"Stealth Detection",
190 '18'=>"Invisibilily",
191 '19'=>"Invisibilily Detection",
192 '20'=>"Periodic Regenerate % of Total Health",
193 '21'=>"Periodic Regenerate % of Total Mana",
194 '22'=>"Mod Resistance",
195 '23'=>"Periodic Trigger Spell",
196 '24'=>"Perioic Energize",
200 '28'=>"Chance to Reflect harmful Spells",
203 '31'=>"Increase Speed",
204 '32'=>"Increase Mounted Speed",
205 '33'=>"Decrease Speed",
206 '34'=>"Mod Maximum Health",
207 '35'=>"Mod Maximum Power",
209 '37'=>"Immune Effect ",
210 '38'=>"Immune State",
211 '39'=>"Immune School",
212 '40'=>"Immune Damage",
213 '41'=>"Immune Dispel",
214 '42'=>"Proc Trigger Spell",
215 '43'=>"Proc Trigger Damage",
216 '44'=>"Track Creatures",
217 '45'=>"Track Resources",
218 '46'=>"Mod Parry Skill",
220 '48'=>"Mod Dodge Skill",
222 '50'=>"Mod Block Skill",
225 '53'=>"Periodic Leech",
226 '54'=>"Mod Melee/Ranged Hit Chance",
227 '55'=>"Mod Spell Hit Chance",
229 '57'=>"Mod Spell Crit Chance",
230 '58'=>"Increase Swim Speed",
231 '59'=>"Mod Melee/Spell Damage Versus",
232 '60'=>"Pacify and Silence",
234 '62'=>"Periodic Health Funnel",
235 '63'=>"Periodic Power Funnel",
236 '64'=>"Periodic Power Leech",
237 '65'=>"Haste - Spells",
241 '69'=>"Absorbs Damage for School",
242 '70'=>"EXTRA_ATTACKS",
243 '71'=>"Mod Spell Crit",
244 '72'=>"Mod Power Cost %",
245 '73'=>"Mod Power Cost",
246 '74'=>"Reflect Spells",
249 '77'=>"Mechanic Immunity",
251 '79'=>"Mod Damage Done %",
253 '81'=>"Split Damage %",
254 '82'=>"Underwater Breathing",
255 '83'=>"Mod Base Resistance",
256 '84'=>"Health Regen",
258 '86'=>"Create Item on Victim Death",
259 '87'=>"Mod Damage Taken %",
260 '88'=>"Mod Health Regen %",
261 '89'=>"Periodic Damage % Total Health",
262 '90'=>"Mod Resist Chance",
263 '91'=>"Mod Detect Range",
265 '93'=>"Unattackable",
266 '94'=>"INTERRUPT_REGEN",
271 '99'=>"Mod Melee Attack Power",
272 '100'=>"AURAS_VISIBLE",
273 '101'=>"Mod Resistance %",
274 '102'=>"Mod Melee Attack Power Versus",
277 '105'=>"FEATHER_FALL",
279 '107'=>"Add Flat Modifier",
280 '108'=>"Add % Modifier",
281 '109'=>"Add Cast on Target Trigger",
282 '110'=>"Mod Power Regeneration %",
283 '111'=>"Redirect % Damage to Caster",
284 '112'=>"Override Class Scripts",
285 '113'=>"Mod Ranged Damage Taken",
286 '114'=>"Mod Ranged Damage Taken %",
287 '115'=>"Mod Healing Taken",
288 '116'=>"Allow % of Health Regeneration to Continue in Combat",
289 '117'=>"Give % Chance to Resist Mechanic",
290 '118'=>"Mod Healing Taken %",
291 '119'=>"SHARE_PET_TRACKING",
292 '120'=>"UNTRACKABLE",
294 '122'=>"Mod Offhand Damage %",
295 '123'=>"Mod Target Resistance",
296 '124'=>"Mod Ranged Attack Power",
297 '125'=>"Mod Melee Damage Taken",
298 '126'=>"Mod Melee Damage Taken %",
299 '127'=>"Mod Attacker Ranged Attack Power",
300 '128'=>"MOD_POSSESS_PET",
301 '129'=>"MOD_SPEED_ALWAYS",
302 '130'=>"MOD_MOUNTED_SPEED_ALWAYS",
303 '131'=>"Mod Ranged Attack Power Versus",
304 '132'=>"Mod Maximum Energy %",
305 '133'=>"Mod Maximum Health %",
306 '134'=>"MOD_MANA_REGEN_INTERRUPT",
307 '135'=>"Mod Healing Done",
308 '136'=>"Mod Healing Done %",
309 '137'=>"Mod Total Stat %",
310 '138'=>"Haste Melee/Ranged",
311 '139'=>"Force Reaction",
312 '140'=>"Haste Ranged",
313 '141'=>"Haste Ranged (Ammo)",
314 '142'=>"MOD_BASE_RESISTANCE_PCT",
315 '143'=>"MOD_RESISTANCE_EXCLUSIVE",
319 '147'=>"ADD_CREATURE_IMMUNITY",
320 '148'=>"Retain Combo Points",
321 '149'=>"RESIST_PUSHBACK",
322 '150'=>"MOD_SHIELD_BLOCKVALUE_PCT",
323 '151'=>"TRACK_STEALTHED",
324 '152'=>"MOD_DETECTED_RANGE",
325 '153'=>"SPLIT_DAMAGE_FLAT",
326 '154'=>"MOD_STEALTH_LEVEL",
327 '155'=>"MOD_WATER_BREATHING",
328 '156'=>"Mod Reputation Gained %",
329 '157'=>"PET_DAMAGE_MULTI",
330 '158'=>"MOD_SHIELD_BLOCKVALUE",
331 '159'=>"NO_PVP_CREDIT",
332 '160'=>"MOD_AOE_AVOIDANCE",
333 '161'=>"MOD_HEALTH_REGEN_IN_COMBAT",
334 '162'=>"POWER_BURN_MANA",
335 '163'=>"MOD_CRIT_DAMAGE_BONUS_MELEE",
337 '165'=>"MELEE_ATTACK_POWER_ATTACKER_BONUS",
338 '166'=>"MOD_ATTACK_POWER_PCT",
339 '167'=>"MOD_RANGED_ATTACK_POWER_PCT",
340 '168'=>"Mod Damage Done Versus %",
341 '169'=>"Mod Crit Damage Versus %",
342 '170'=>"DETECT_AMORE",
343 '171'=>"MOD_SPEED_NOT_STACK",
344 '172'=>"MOD_MOUNTED_SPEED_NOT_STACK",
345 '173'=>"ALLOW_CHAMPION_SPELLS",
346 '174'=>"MOD_SPELL_DAMAGE_OF_STAT_PERCENT",
347 '175'=>"MOD_SPELL_HEALING_OF_STAT_PERCENT",
348 '176'=>"SPIRIT_OF_REDEMPTION",
350 '178'=>"Mod Debuff Resistance %",
351 '179'=>"Mod Attacker Crit Chance %",
352 '180'=>"Mod Spell Damage Versus",
353 '181'=>"Mod Spell Crit Damage Versus",
354 '182'=>"MOD_RESISTANCE_OF_INTELLECT_PERCENT",
355 '183'=>"MOD_CRITICAL_THREAT",
356 '184'=>"MOD_ATTACKER_MELEE_HIT_CHANCE",
357 '185'=>"MOD_ATTACKER_RANGED_HIT_CHANCE",
358 '186'=>"MOD_ATTACKER_SPELL_HIT_CHANCE",
359 '187'=>"MOD_ATTACKER_MELEE_CRIT_CHANCE",
360 '188'=>"MOD_ATTACKER_RANGED_CRIT_CHANCE",
362 '190'=>"Mod Faction Reputation Gain",
363 '191'=>"Limit Movement Speed",
364 '192'=>"Melee Haste",
366 '194'=>"MOD_DEPRICATED_1",
367 '195'=>"MOD_DEPRICATED_2",
368 '196'=>"Mod Cooldown",
369 '197'=>"MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE",
370 '198'=>"MOD_ALL_WEAPON_SKILLS",
371 '199'=>"MOD_INCREASES_SPELL_PCT_TO_HIT",
372 '200'=>"Mod Experience Earned %",
374 '202'=>"IGNORE_COMBAT_RESULT",
375 '203'=>"Mod Melee Critical Damage Taken",
376 '204'=>"Mod Ranged Critical Damage Teken",
377 '205'=>"MOD_ATTACKER_SPELL_CRIT_DAMAGE",
378 '206'=>"MOD_SPEED_MOUNTED",
379 '207'=>"MOD_INCREASE_FLIGHT_SPEED",
380 '208'=>"MOD_SPEED_FLIGHT",
381 '209'=>"MOD_FLIGHT_SPEED_ALWAYS",
382 '210'=>"MOD_FLIGHT_SPEED_NOT_STACKING",
383 '211'=>"MOD_FLIGHT_SPEED_MOUNTED_NOT_STACKING",
384 '212'=>"MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT",
385 '213'=>"Mod Rage from Damage Dealt %",
387 '215'=>"ARENA_PREPARATION",
388 '216'=>"Haste Spells",
389 '217'=>"Slow Spells ???",
390 '218'=>"Haste Ranged",
391 '219'=>"MOD_MANA_REGEN_FROM_STAT",
392 '220'=>"MOD_RATING_FROM_STAT",
398 '226'=>"Peridic Dummy",
399 '227'=>"PERIODIC_TRIGGER_SPELL_WITH_VALUE",
400 '228'=>"DETECT_STEALTH",
401 '229'=>"Mod AOE Damage Taken",
403 '231'=>"PROC_TRIGGER_SPELL_WITH_VALUE",
404 '232'=>"Mod Mechanic Duration",
406 '234'=>"Mod Mechanic Duration not stack",
407 '235'=>"Mod Mechanic Dispel Resist",
408 '236'=>"CONTROL_VEHICLE",
409 '237'=>"MOD_SPELL_DAMAGE_OF_ATTACK_POWER",
410 '238'=>"MOD_SPELL_HEALING_OF_ATTACK_POWER",
411 '239'=>"MOD_SCALE_2",
412 '240'=>"Mod Expertise",
413 '241'=>"FORCE_MOVE_FORWARD",
414 '242'=>"MOD_SPELL_DAMAGE_FROM_HEALING",
416 '244'=>"COMPREHEND_LANGUAGE = 244",
417 '245'=>"MOD_DURATION_OF_MAGIC_EFFECTS",
418 '246'=>"MOD_DURATION_OF_EFFECTS_BY_DISPEL",
419 '247'=>"MIRROR_IMAGE ",
420 '248'=>"MOD_COMBAT_RESULT_CHANCE",
421 '249'=>"Convert Rune",
422 '250'=>"MOD_INCREASE_HEALTH_2",
423 '251'=>"MOD_ENEMY_DODGE",
425 '253'=>"MOD_BLOCK_CRIT_CHANCE",
426 '254'=>"MOD_DISARM_SHIELD",
427 '255'=>"MOD_MECHANIC_DAMAGE_TAKEN_PERCENT",
428 '256'=>"NO_REAGENT_USE",
429 '257'=>"MOD_TARGET_RESIST_BY_SPELL_CLASS",
430 '258'=>"MOD_SPELL_VISUAL",
431 '259'=>"MOD_PERIODIC_HEAL",
432 '260'=>"SCREEN_EFFEC",
435 '263'=>"ALLOW_ONLY_ABILITY",
440 '268'=>"MOD_ATTACK_POWER_OF_STAT_PERCENT",
450 '278'=>"MOD_DISARM_RANGED",
452 '280'=>"MOD_TARGET_ARMOR_PCT",
453 '281'=>"MOD_HONOR_GAIN",
454 '282'=>"MOD_BASE_HEALTH_PCT",
455 '283'=>"MOD_HEALING_RECEIVED",
457 '285'=>"MOD_ATTACK_POWER_OF_ARMOR",
458 '286'=>"ABILITY_PERIODIC_CRIT",
459 '287'=>"DEFLECT_SPELLS",
460 '288'=>"MOD_PARRY_FROM_BEHIND_PERCENT",
462 '290'=>"MOD_ALL_CRIT_CHANCE",
463 '291'=>"MOD_QUEST_XP_PCT",
465 '293'=>"ADD_MECHANIC_ABILITIES",
466 '294'=>"STOP_NATURAL_MANA_REGEN",
473 '301'=>"HEAL_ABSORB",
476 '304'=>"FAKE_INEBRIATE",
477 '305'=>"MOD_MINIMUM_SPEED",
482 '310'=>"MOD_PET_AOE_DAMAGE_AVOIDANCE",
491 function getSpellFamilyNames()
494 return $wDB->selectCol('-- CACHE: 1h
495 SELECT `spell_family` AS ARRAY_KEY, `name` FROM `wowd_chr_classes`');
498 function getSpellFamilyName($i)
500 $l = getSpellFamilyNames();
501 return isset($l[$i]) ?
$l[$i] : 'Family_'.$i;
504 function getRatingList($mask)
506 global $gRatingNames;
507 return getListFromArray_1($gRatingNames, $mask);
510 function getSpellRange($id)
513 return $wDB->selectRow("-- CACHE: 1h
514 SELECT * FROM `wowd_spell_range` WHERE `id` = ?d", $id);
517 function getRange($index)
519 $range = getSpellRange($index);
521 return "Err index $index";
523 if ($range['minRange']==0 OR $range['minRange']==$range['maxRange'])
524 return $range['maxRange'];
525 return $range['minRange'].' - '.$range['maxRange'];
528 function getRangeText($index)
530 $range = getSpellRange($index);
532 return "Err index $index";
534 if ($range['minRange']==0 OR $range['minRange']==$range['maxRange'])
535 return $range['maxRange'].' yds ('.$range['name'].')';
536 return $range['minRange'].' - '.$range['maxRange'].' yds ('.$range['name'].')';
539 //*****************************************
541 //*****************************************
542 function getTotemCategory($i, $as_ref=1)
545 $gTotemCategory = $wDB->selectCol('-- CACHE: 1h
546 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_totem_category`');
548 $name = @$gTotemCategory[$i];
550 $name = "Category_$i";
552 return "<a href=\"?s=i&totem=$i\">".$name."</a>";
556 function getRuneName($i)
559 if (empty($gRuneName[$i]))
561 return $gRuneName[$i];
564 function getTargetsList($mask)
566 global $gTargetsList;
567 return getListFromArray_1($gTargetsList, $mask);
570 //***************************************
572 //***************************************
573 function getFormNames()
576 return $wDB->selectCol('-- CACHE: 1h
577 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_spell_shapeshift`');
580 function getForm($i, $as_ref=1)
582 $gSpellSnapeshiftForm = getFormNames();
583 $name = @$gSpellSnapeshiftForm[$i];
584 if ($name == "") $name = "Form_$i";
586 return "<a href=\"?s=s&form=$i\">".$name."</a>";
590 function getAllowableForm($mask, $as_ref=1)
592 $gSpellSnapeshiftForm = getFormNames();
594 return getListFromArray_1($gSpellSnapeshiftForm, $mask, "?s=s&form=%d");
595 return getListFromArray_1($gSpellSnapeshiftForm, $mask);
598 function getCategoryName($i, $as_ref=1)
601 return "<a href=\"?s=s&cat=$i\">".$i."</a>";
605 function getPowerTypeName($index)
607 global $gSpellPowerType;
608 if ($index >= 0 && $index < 5)
609 return $gSpellPowerType[$index];
610 return $gSpellPowerType[-1];
613 function getSpellEffectName($i)
615 global $gSpellEffect;
616 return $gSpellEffect[$i];
619 function getSpellAuraName($i)
621 global $gSpellAuraName;
622 return $gSpellAuraName[$i];
625 function getSpellModName($i)
627 global $gSpellModsType;
628 return $gSpellModsType[$i];
631 function getDispelName($i, $as_ref=1)
634 $d = $wDB->selectCol('-- CACHE: 1h
635 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_spell_dispel_type`');
636 $name = isset($d[$i]) ?
$d[$i] : 'Dispell_'.$i;
638 return "<a href=\"?s=s&dispel=$i\">$name</a>";
642 function getMechanicName($i, $as_ref=1)
644 global $gSpellMechanic;
645 $name = @$gSpellMechanic[$i];
646 if (!$name) $name = "Mechanic_$i";
648 return "<a href=\"?s=s&mech=$i\">$name</a>";
652 function getLaungageName($i)
655 $l = $wDB->selectCol('-- CACHE: 1h
656 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_languages`');
657 return isset($l[$i]) ?
$l[$i] : 'Laungage_'.$i;
660 function getSchool($i)
662 global $gSpellSchool;
663 $name = @$gSpellSchool[$i];
664 if ($name == "") $name = "School_$i";
669 function getSpellSchool($mask)
671 global $gSpellSchool;
672 return getListFromArray_0($gSpellSchool, $mask);
675 function getSpellDamageClass($i)
678 return $gDmgClass[$i];
681 function getSpell($spell_id, $fields="*")
684 return $wDB->selectRow("SELECT ".$fields." FROM `wowd_spell` WHERE `id` = ?d", $spell_id);
687 function getSpellName($spell, $as_ref=1)
691 $name = $spell['SpellName'];
693 $name = "<a href=\"?spell=$spell[id]\">".$name."</a>";
694 if ($spell['Rank']!="")
695 $name.="<br><div class=srank>".$spell['Rank']."</div>";
701 function getSpellNameFromId($spellId, $as_ref=1)
703 if ($spell = getSpell($spellId))
704 return getSpellName($spell, $as_ref);
705 return "Err spell $spellId";
708 function getSpellDurationData($durationIndex)
711 return $wDB->selectRow("-- CACHE: 1h
712 SELECT * FROM `wowd_spell_duration` WHERE `id` = ?d", $durationIndex);
715 function getSpellDuration($spell)
717 if ($spell['DurationIndex'])
718 if ($spell_duration = getSpellDurationData($spell['DurationIndex']))
719 return $spell_duration['duration_1']/1000;
723 function getSpellDurationText($spell)
725 if ($spell['DurationIndex'])
727 if ($spell_duration = getSpellDurationData($spell['DurationIndex']))
729 if ($spell_duration['duration_1'] == -1)
731 // if ($spell_duration['duration_1'] == ($spell_duration['duration_3'])
732 // return getTimeText($spell_duration['duration_1']/1000);
734 return getTimeText($spell_duration['duration_1']/1000);
737 return "Err index ".$spell['DurationIndex'];
742 function getSpellRadius($id)
745 return $wDB->selectRow("-- CACHE: 1h
746 SELECT * FROM `wowd_spell_radius` WHERE `id` = ?d", $id);
749 function getRadius($index)
751 if ($index==0) return '0';
753 $radius = getSpellRadius($index);
755 return "Err index $index";
757 if ($radius['radius_1']==0 OR $radius['radius_1']==$radius['radius_3'])
758 return $radius['radius_3'];
759 return $radius['radius_1']." - ".$radius['radius_3'];
762 function getRadiusText($index)
764 return getRadius($index).' yds';
767 function getSpellCooldown($spell)
769 if ($spell['RecoveryTime'] > $spell['CategoryRecoveryTime'])
770 return $spell['RecoveryTime'];
772 return $spell['CategoryRecoveryTime'];
775 function getSpellCastTime($id)
778 return $wDB->selectRow("-- CACHE: 1h
779 SELECT * FROM `wowd_spell_cast_time` WHERE `id` = ?d", $id);
782 function getCastTimeText($spell)
784 $cast_time = getSpellCastTime($spell['CastingTimeIndex']);
785 $time = @$cast_time['time_1']/1000;
787 return $time." sec cast";
789 return "Instant Cast";
792 function getBasePointDesc($spell, $index)
796 $s = $spell['EffectBasePoints_'.$index]+
1;
797 if ($spell['EffectDieSides_'.$index] > 1)
798 $s.=" - ".abs($spell['EffectBasePoints_'.$index]+
$spell['EffectDieSides_'.$index]);
800 if ($spell['EffectRealPointsPerLevel_'.$index])
801 $s.=" + lvl*".$spell['EffectRealPointsPerLevel_'.$index];
802 // Óâåëè÷èâàåò òîëüêî ìàêñ ðàíäîìíîå çíà÷åíèå
803 // if ($spell['EffectDicePerLevel_'.$index])
804 // $s.=" + lvl*".$spell['EffectDicePerLevel_'.$index];
805 if ($spell['EffectPointsPerComboPoint_'.$index])
806 $s." + combo*".$spell['EffectPointsPerComboPoint_'.$index];
810 function getSpellData($spell)
813 $s1 = abs($spell['EffectBasePoints_1']+
1);
814 $s2 = abs($spell['EffectBasePoints_2']+
1);
815 $s3 = abs($spell['EffectBasePoints_3']+
1);
816 if ($spell['EffectDieSides_1']>1) $s1.=" - ".abs($spell['EffectBasePoints_1']+
$spell['EffectDieSides_1']);
817 if ($spell['EffectDieSides_2']>1) $s2.=" - ".abs($spell['EffectBasePoints_2']+
$spell['EffectDieSides_2']);
818 if ($spell['EffectDieSides_3']>1) $s3.=" - ".abs($spell['EffectBasePoints_3']+
$spell['EffectDieSides_3']);
821 if ($spell['DurationIndex'])
822 if ($spell_duration = getSpellDurationData($spell['DurationIndex']))
823 $d = $spell_duration['duration_1']/1000;
826 $t1 = $spell['EffectAmplitude_1'] ?
$spell['EffectAmplitude_1']/1000 : 5;
827 $t2 = $spell['EffectAmplitude_1'] ?
$spell['EffectAmplitude_2']/1000 : 5;
828 $t3 = $spell['EffectAmplitude_1'] ?
$spell['EffectAmplitude_3']/1000 : 5;
831 $o1 = @intval
($s1*$d/$t1);
832 $o2 = @intval
($s2*$d/$t2);
833 $o3 = @intval
($s3*$d/$t3);
835 $spellData['t1']=$t1;
836 $spellData['t2']=$t2;
837 $spellData['t3']=$t3;
838 $spellData['o1']=$o1;
839 $spellData['o2']=$o2;
840 $spellData['o3']=$o3;
841 $spellData['s1']=$s1;
842 $spellData['s2']=$s2;
843 $spellData['s3']=$s3;
844 $spellData['m1']=$s1;
845 $spellData['m2']=$s2;
846 $spellData['m3']=$s3;
847 $spellData['x1']= $spell['EffectChainTarget_1'];
848 $spellData['x2']= $spell['EffectChainTarget_2'];
849 $spellData['x3']= $spell['EffectChainTarget_3'];
850 // $spellData['i'] = $spell['MaxAffectedTargets'];
851 $spellData['d'] = getTimeText($d);
852 $spellData['d1']= getTimeText($d);
853 $spellData['d2']= getTimeText($d);
854 $spellData['d3']= getTimeText($d);
855 $spellData['v'] = $spell['AffectedTargetLevel'];
856 $spellData['u'] = $spell['StackAmount'];
857 $spellData['a1']= getRadius($spell['EffectRadiusIndex_1']);
858 $spellData['a2']= getRadius($spell['EffectRadiusIndex_2']);
859 $spellData['a3']= getRadius($spell['EffectRadiusIndex_3']);
860 $spellData['b1']= $spell['EffectPointsPerComboPoint_1'];
861 $spellData['b2']= $spell['EffectPointsPerComboPoint_2'];
862 $spellData['b3']= $spell['EffectPointsPerComboPoint_3'];
863 $spellData['e'] = $spell['EffectMultipleValue_1'];
864 $spellData['e1']= $spell['EffectMultipleValue_1'];
865 $spellData['e2']= $spell['EffectMultipleValue_2'];
866 $spellData['e3']= $spell['EffectMultipleValue_3'];
867 $spellData['f1']= $spell['DmgMultiplier_1'];
868 $spellData['f2']= $spell['DmgMultiplier_2'];
869 $spellData['f3']= $spell['DmgMultiplier_3'];
870 $spellData['q1']= $spell['EffectMiscValue_1'];
871 $spellData['q2']= $spell['EffectMiscValue_2'];
872 $spellData['q3']= $spell['EffectMiscValue_3'];
873 $spellData['h'] = $spell['procChance'];
874 $spellData['n'] = $spell['procCharges'];
875 $spellData['z'] = "<home>";
879 function spellReplace($spell, $text)
881 $letter = array('${','}');
882 $values = array( '[',']');
883 $text = str_replace($letter, $values, $text);
885 $signs = array('+', '-', '/', '*', '%', '^');
890 $cacheSpellData=array(); // Spell data for spell
892 while (false!==($npos=strpos($data, '$', $pos)))
895 $str .= substr($data, $pos, $npos-$pos);
897 if ('$' == substr($data, $pos, 1))
904 if (!preg_match('/^((([+\-\/*])(\d+);)?(\d*)(?:([lg].*?:.*?);|(\w\d*)))/', substr($data, $pos), $result))
906 $pos +
= strlen($result[0]);
909 $lookup = $result[5]?
$result[5]:$spell['id'];
910 $var = $result[6] ?
$result[6]:$result[7];
913 // l - ðàçìåð ïîñëåäíåé âåëè÷èíû == 1 ? 0 : 1
916 $select = explode(':', substr($var, 1));
917 $str.=@$select[$lastCount==1 ?
0:1];
920 else if ($var[0]=='g')
922 $select = explode(':', substr($var, 1));
927 $spellData = @$cacheSpellData[$lookup];
930 if ($lookup == $spell['id']) $cacheSpellData[$lookup] = getSpellData($spell);
931 else $cacheSpellData[$lookup] = getSpellData(getSpell($lookup));
932 $spellData = @$cacheSpellData[$lookup];
934 if ($spellData && $base = @$spellData[strtolower($var)])
936 if ($op && is_numeric($oparg) && is_numeric($base))
938 $equation = $base.$op.$oparg;
939 eval("\$base = $equation;");
941 if (is_numeric($base)) $lastCount = $base;
948 $str.= substr($data, $pos);
949 $str = @preg_replace_callback
("/\[.+[+\-\/*\d]\]/", 'my_relpace', $str);
950 // $letter = array('*','/','+','-');
951 // $values = array(' * ', ' / ',' + ',' - ');
952 // $str = str_replace($letter, $values, $str);
954 return($str);//."<br /><br />".$text;
957 function my_relpace($matches)
959 $text = str_replace( array('[',']'), array('', ''), $matches[0]);
960 eval("\$text = abs(".$text.");");
961 return intval($text);
964 function getSpellDesc($spell)
966 if ($spell['Description']=="") return $spell['SpellName'];
967 return spellReplace($spell, $spell['Description']);
970 function getSpellBuff($spell)
972 if ($spell['ToolTip']=="") return "";
973 return spellReplace($spell, $spell['ToolTip']);
976 function get_spell_details($spell_id)
978 $spell=getSpell($spell_id);
980 return getSpellDesc($spell);
981 return "Spell id - $spell_id";
984 function getSpellCostText($spell)
986 // Çàïîëíÿåì ñòîèìîñòü çàêëèíàíèÿ
987 $powerType = getPowerTypeName($spell['powerType']);
989 if ($spell['AttributesEx'] & 2)
990 $powerCost = "Uses 100% ".$powerType;
993 if ($spell['ManaCostPercentage'])
994 $powerCost = $spell['ManaCostPercentage']."% of base";
995 else if ($spell['manaCost'])
996 $powerCost = $spell['manaCost'];
999 $powerCost.= " ".$powerType;
1000 if ($spell['manaPerSecond'])
1001 $powerCost.= " plus ".$spell['manaPerSecond']." per sec";