коррекция перевода
[cswow.git] / include / spell_data.php
blob1f952207a1d49bfebebc7bd360fd71cb057ae7ce
1 <?php
2 include_once("functions.php");
4 $gSpellEffect = array(
5 '1'=>'Instakill',
6 '2'=>'School damage',
7 '3'=>'Dummy',
8 '4'=>'Portal teleport',
9 '5'=>'Teleport units',
10 '6'=>'Apply aura',
11 '7'=>'Environmental damage',
12 '8'=>'Power drain',
13 '9'=>'Health leech',
14 '10'=>'Heal',
15 '11'=>'Bind',
16 '12'=>'Portal',
17 '13'=>'Ritual base',
18 '14'=>'Ritual specialize',
19 '15'=>'Ritual activate portal',
20 '16'=>'Quest complete',
21 '17'=>'Weapon damage noschool',
22 '18'=>'Resurrect',
23 '19'=>'Add extra attacks',
24 '20'=>'Dodge',
25 '21'=>'Evade',
26 '22'=>'Parry',
27 '23'=>'Block',
28 '24'=>'Create item',
29 '25'=>'Weapon',
30 '26'=>'Defense',
31 '27'=>'Persistent area aura',
32 '28'=>'Summon',
33 '29'=>'Leap',
34 '30'=>'Energize',
35 '31'=>'Weapon percent damage',
36 '32'=>'Trigger missile',
37 '33'=>'Open lock',
38 '34'=>'Summon change item',
39 '35'=>'Apply area aura party',
40 '36'=>'Learn spell',
41 '37'=>'Spell defense',
42 '38'=>'Dispel',
43 '39'=>'Language',
44 '40'=>'Dual wield',
45 '41'=>'Jump',
46 '42'=>'Jump2',
47 '43'=>'Teleport units face caster',
48 '44'=>'Skill step',
49 '45'=>'Add honor',
50 '46'=>'Spawn',
51 '47'=>'Trade skill',
52 '48'=>'Stealth',
53 '49'=>'Detect',
54 '50'=>'Trans door',
55 '51'=>'Force critical hit',
56 '52'=>'Guarantee hit',
57 '53'=>'Enchant item',
58 '54'=>'Enchant item temporary',
59 '55'=>'Tamecreature',
60 '56'=>'Summon pet',
61 '57'=>'Learn pet spell',
62 '58'=>'Weapon damage',
63 '59'=>'Open lock item',
64 '60'=>'Proficiency',
65 '61'=>'Send event',
66 '62'=>'Power burn',
67 '63'=>'Threat',
68 '64'=>'Trigger spell',
69 '65'=>'Apply area aura raid',
70 '66'=>'Create mana gem',
71 '67'=>'Heal max health',
72 '68'=>'Interrupt cast',
73 '69'=>'Distract',
74 '70'=>'Pull',
75 '71'=>'Pickpocket',
76 '72'=>'Add farsight',
77 '73'=>'Untrain talents',
78 '74'=>'Apply glyph',
79 '75'=>'Heal mechanical',
80 '76'=>'Summon object wild',
81 '77'=>'Script effect',
82 '78'=>'Attack',
83 '79'=>'Sanctuary',
84 '80'=>'Add combo points',
85 '81'=>'Create house',
86 '82'=>'Bind sight',
87 '83'=>'Duel',
88 '84'=>'Stuck',
89 '85'=>'Summon player',
90 '86'=>'Activate object',
91 '87'=>'Wmo damage',
92 '88'=>'Wmo repair',
93 '89'=>'Wmo change',
94 '90'=>'Kill credit',
95 '91'=>'Threat all',
96 '92'=>'Enchant held item',
97 '93'=>'Summon phantasm',
98 '94'=>'Self resurrect',
99 '95'=>'Skinning',
100 '96'=>'Charge',
101 '97'=>'Summon all totems',
102 '98'=>'Knock back',
103 '99'=>'Disenchant',
104 '100'=>'Inebriate',
105 '101'=>'Feed pet',
106 '102'=>'Dismiss pet',
107 '103'=>'Reputation',
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',
118 '114'=>'Attack me',
119 '115'=>'Durability damage pct',
120 '116'=>'Skin player corpse',
121 '117'=>'Spirit heal',
122 '118'=>'Skill',
123 '119'=>'Apply area aura pet',
124 '120'=>'Teleport graveyard',
125 '121'=>'Normalized weapon dmg',
126 '122'=>'SPELL_EFFECT_122',
127 '123'=>'Send taxi',
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'=>'Play sound',
136 '132'=>'Play music',
137 '133'=>'Unlearn specialization',
138 '134'=>'Kill credit',
139 '135'=>'Call pet',
140 '136'=>'Heal pct',
141 '137'=>'Energize pct',
142 '138'=>'Leap back',
143 '139'=>'Clear quest',
144 '140'=>'Force cast',
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',
151 '147'=>'Quest fail',
152 '148'=>'SPELL_EFFECT_148',
153 '149'=>'Charge 2',
154 '150'=>'SPELL_EFFECT_150',
155 '151'=>'Trigger spell 2',
156 '152'=>'SPELL_EFFECT_152',
157 '153'=>'Create pet',
158 '154'=>'Unused',
159 '155'=>'Titan grip',
160 '156'=>'Enchant item prismatic',
161 '157'=>'Create item 2',
162 '158'=>'Milling',
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',
168 '164'=>'Cancel aura'
171 $gSpellAuraName = array(
172 '0'=>"NONE",
173 '1'=>"Bind Sight",
174 '2'=>"Mod Possess",
175 '3'=>"Periodic Damage",
176 '4'=>"Dummy",
177 '5'=>"Confuse",
178 '6'=>"Charm",
179 '7'=>"Fear",
180 '8'=>"Periodic Heal",
181 '9'=>"Mod Attack Speed",
182 '10'=>"Mod Threat",
183 '11'=>"Taunt",
184 '12'=>"Stun",
185 '13'=>"Mod Damage Done",
186 '14'=>"Mod Damage Taken",
187 '15'=>"Damage shield",
188 '16'=>"Stealth",
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",
197 '25'=>"Pacify",
198 '26'=>"Root",
199 '27'=>"Silence",
200 '28'=>"Chance to Reflect harmful Spells",
201 '29'=>"Mod Stat",
202 '30'=>"Mod Skill",
203 '31'=>"Increase Speed",
204 '32'=>"Increase Mounted Speed",
205 '33'=>"Decrease Speed",
206 '34'=>"Mod Maximum Health",
207 '35'=>"Mod Maximum Power",
208 '36'=>"Snapeshift",
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",
219 '47'=>"Mod Parry %",
220 '48'=>"Mod Dodge Skill",
221 '49'=>"Mod Dodge %",
222 '50'=>"Mod Block Skill",
223 '51'=>"Mod Block %",
224 '52'=>"Mod Crit %",
225 '53'=>"Periodic Leech",
226 '54'=>"Mod Melee/Ranged Hit Chance",
227 '55'=>"Mod Spell Hit Chance",
228 '56'=>"Transform",
229 '57'=>"Mod Spell Crit Chance",
230 '58'=>"Increase Swim Speed",
231 '59'=>"Mod Melee/Spell Damage Versus",
232 '60'=>"Pacify and Silence",
233 '61'=>"Scale",
234 '62'=>"Periodic Health Funnel",
235 '63'=>"Periodic Power Funnel",
236 '64'=>"Periodic Power Leech",
237 '65'=>"Haste - Spells",
238 '66'=>"Feign Death",
239 '67'=>"Disarm",
240 '68'=>"Stalked",
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",
247 '75'=>"Laungage",
248 '76'=>"Far Sight",
249 '77'=>"Mechanic Immunity",
250 '78'=>"Mounted",
251 '79'=>"Mod Damage Done %",
252 '80'=>"Mod Stat %",
253 '81'=>"Split Damage %",
254 '82'=>"Underwater Breathing",
255 '83'=>"Mod Base Resistance",
256 '84'=>"Health Regen",
257 '85'=>"Power 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",
264 '92'=>"Cannot Flee",
265 '93'=>"Unattackable",
266 '94'=>"INTERRUPT_REGEN",
267 '95'=>"Ghost",
268 '96'=>"Magnet",
269 '97'=>"Mana Shield",
270 '98'=>"Mod Skill",
271 '99'=>"Mod Melee Attack Power",
272 '100'=>"AURAS_VISIBLE",
273 '101'=>"Mod Resistance %",
274 '102'=>"Mod Melee Attack Power Versus",
275 '103'=>"Mod Threat",
276 '104'=>"Water Walk",
277 '105'=>"FEATHER_FALL",
278 '106'=>"Hower",
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",
293 '121'=>"EMPATHY",
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",
316 '144'=>"Safe Fall",
317 '145'=>"Charisma",
318 '146'=>"Persuaded",
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",
336 '164'=>"164",
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",
349 '177'=>"AOE_CHARM",
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",
361 '189'=>"Mod Rating",
362 '190'=>"Mod Faction Reputation Gain",
363 '191'=>"Limit Movement Speed",
364 '192'=>"Melee Haste",
365 '193'=>"Melee Slow",
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 %",
373 '201'=>"Fly",
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 %",
386 '214'=>"214",
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",
393 '221'=>"221",
394 '222'=>"222",
395 '223'=>"223",
396 '224'=>"224",
397 '225'=>"DUMMY_3",
398 '226'=>"Peridic Dummy",
399 '227'=>"PERIODIC_TRIGGER_SPELL_WITH_VALUE",
400 '228'=>"DETECT_STEALTH",
401 '229'=>"Mod AOE Damage Taken",
402 '230'=>"230",
403 '231'=>"PROC_TRIGGER_SPELL_WITH_VALUE",
404 '232'=>"Mod Mechanic Duration",
405 '233'=>"233",
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",
415 '243'=>"243",
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",
424 '252'=>"SLOW_ALL",
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",
433 '261'=>"PHASE",
434 '262'=>"262",
435 '263'=>"ALLOW_ONLY_ABILITY",
436 '264'=>"264",
437 '265'=>"265",
438 '266'=>"266",
439 '267'=>"267",
440 '268'=>"MOD_ATTACK_POWER_OF_STAT_PERCENT",
441 '269'=>"269",
442 '270'=>"270",
443 '271'=>"271",
444 '272'=>"272",
445 '273'=>"273",
446 '274'=>"274",
447 '275'=>"275",
448 '276'=>"276",
449 '277'=>"277",
450 '278'=>"MOD_DISARM_RANGED",
451 '279'=>"279",
452 '280'=>"MOD_TARGET_ARMOR_PCT",
453 '281'=>"MOD_HONOR_GAIN",
454 '282'=>"MOD_BASE_HEALTH_PCT",
455 '283'=>"MOD_HEALING_RECEIVED",
456 '284'=>"284",
457 '285'=>"MOD_ATTACK_POWER_OF_ARMOR",
458 '286'=>"ABILITY_PERIODIC_CRIT",
459 '287'=>"DEFLECT_SPELLS",
460 '288'=>"MOD_PARRY_FROM_BEHIND_PERCENT",
461 '289'=>"289",
462 '290'=>"MOD_ALL_CRIT_CHANCE",
463 '291'=>"MOD_QUEST_XP_PCT",
464 '292'=>"292",
465 '293'=>"ADD_MECHANIC_ABILITIES",
466 '294'=>"STOP_NATURAL_MANA_REGEN",
467 '295'=>"295",
468 '296'=>"296",
469 '297'=>"297",
470 '298'=>"298",
471 '299'=>"299",
472 '300'=>"300",
473 '301'=>"HEAL_ABSORB",
474 '302'=>"302",
475 '303'=>"303",
476 '304'=>"FAKE_INEBRIATE",
477 '305'=>"MOD_MINIMUM_SPEED",
478 '306'=>"306",
479 '307'=>"307",
480 '308'=>"308",
481 '309'=>"309",
482 '310'=>"MOD_PET_AOE_DAMAGE_AVOIDANCE",
483 '311'=>"311",
484 '312'=>"312",
485 '313'=>"313",
486 '314'=>"314",
487 '315'=>"315",
488 '316'=>"316"
491 function getSpellFamilyNames()
493 global $wDB;
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)
512 global $wDB;
513 return $wDB->selectRow("-- CACHE: 1h
514 SELECT * FROM `wowd_spell_range` WHERE `id` = ?d", $id);
517 function getRange($index)
519 $range = getSpellRange($index);
520 if ($range == 0)
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);
531 if ($range == 0)
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 //*****************************************
540 // Totem Category
541 //*****************************************
542 function getTotemCategory($i, $as_ref=1)
544 global $wDB;
545 $gTotemCategory = $wDB->selectCol('-- CACHE: 1h
546 SELECT `id` AS ARRAY_KEY, `name` FROM `wowd_totem_category`');
548 $name = @$gTotemCategory[$i];
549 if ($name == "")
550 $name = "Category_$i";
551 if ($as_ref)
552 return "<a href=\"?s=i&totem=$i\">".$name."</a>";
553 return $name;
556 function getRuneName($i)
558 global $gRuneName;
559 if (empty($gRuneName[$i]))
560 return "Rune_".$i;
561 return $gRuneName[$i];
564 function getTargetsList($mask)
566 global $gTargetsList;
567 return getListFromArray_1($gTargetsList, $mask);
570 //***************************************
571 // Form functions
572 //***************************************
573 function getFormNames()
575 global $wDB;
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";
585 if ($as_ref)
586 return "<a href=\"?s=s&form=$i\">".$name."</a>";
587 return $name;
590 function getAllowableForm($mask, $as_ref=1)
592 $gSpellSnapeshiftForm = getFormNames();
593 if ($as_ref)
594 return getListFromArray_1($gSpellSnapeshiftForm, $mask, "?s=s&form=%d");
595 return getListFromArray_1($gSpellSnapeshiftForm, $mask);
598 function getCategoryName($i, $as_ref=1)
600 if ($as_ref)
601 return "<a href=\"?s=s&cat=$i\">".$i."</a>";
602 return "$i";
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)
633 global $wDB;
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;
637 if ($as_ref && $i)
638 return "<a href=\"?s=s&dispel=$i\">$name</a>";
639 return $name;
642 function getMechanicName($i, $as_ref=1)
644 global $gSpellMechanic;
645 $name = @$gSpellMechanic[$i];
646 if (!$name) $name = "Mechanic_$i";
647 if ($as_ref && $i)
648 return "<a href=\"?s=s&mech=$i\">$name</a>";
649 return $name;
652 function getLaungageName($i)
654 global $wDB;
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";
665 return $name;
669 function getSpellSchool($mask)
671 global $gSpellSchool;
672 return getListFromArray_0($gSpellSchool, $mask);
675 function getSpellDamageClass($i)
677 global $gDmgClass;
678 return $gDmgClass[$i];
681 function getSpell($spell_id, $fields="*")
683 global $wDB;
684 return $wDB->selectRow("SELECT ".$fields." FROM `wowd_spell` WHERE `id` = ?d", $spell_id);
687 function getSpellName($spell, $as_ref=1)
689 if ($spell)
691 $name = $spell['SpellName'];
692 if ($as_ref)
693 $name = "<a href=\"?spell=$spell[id]\">".$name."</a>";
694 if ($spell['Rank']!="")
695 $name.="<br><div class=srank>".$spell['Rank']."</div>";
696 return $name;
698 return "No spell";
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)
710 global $wDB;
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;
720 return '';
723 function getSpellDurationText($spell)
725 if ($spell['DurationIndex'])
727 if ($spell_duration = getSpellDurationData($spell['DurationIndex']))
729 if ($spell_duration['duration_1'] == -1)
730 return "Unlimited";
731 // if ($spell_duration['duration_1'] == ($spell_duration['duration_3'])
732 // return getTimeText($spell_duration['duration_1']/1000);
733 // TODO fix it
734 return getTimeText($spell_duration['duration_1']/1000);
736 else
737 return "Err index ".$spell['DurationIndex'];
739 return "";
742 function getSpellRadius($id)
744 global $wDB;
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);
754 if (!$radius)
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'];
771 else
772 return $spell['CategoryRecoveryTime'];
775 function getSpellCastTime($id)
777 global $wDB;
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;
786 if ($time)
787 return $time." sec cast";
788 else
789 return "Instant Cast";
792 function getBasePointDesc($spell, $index)
794 if (empty($spell))
795 return;
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];
807 return $s;
810 function getSpellData($spell)
812 // Basepoints
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']);
820 $d = 0;
821 if ($spell['DurationIndex'])
822 if ($spell_duration = getSpellDurationData($spell['DurationIndex']))
823 $d = $spell_duration['duration_1']/1000;
825 // Tick duration
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;
830 // Points per tick
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>";
876 return $spellData;
879 function spellReplace($spell, $text)
881 $letter = array('${','}');
882 $values = array( '[',']');
883 $text = str_replace($letter, $values, $text);
885 $signs = array('+', '-', '/', '*', '%', '^');
886 $data = $text;
887 $pos = 0;
888 $npos = 0;
889 $str = '';
890 $cacheSpellData=array(); // Spell data for spell
891 $lastCount = 1;
892 while (false!==($npos=strpos($data, '$', $pos)))
894 if ($npos!=$pos)
895 $str .= substr($data, $pos, $npos-$pos);
896 $pos = $npos+1;
897 if ('$' == substr($data, $pos, 1))
899 $str .= '$';
900 $pos++;
901 continue;
904 if (!preg_match('/^((([+\-\/*])(\d+);)?(\d*)(?:([lg].*?:.*?);|(\w\d*)))/', substr($data, $pos), $result))
905 continue;
906 $pos += strlen($result[0]);
907 $op = $result[3];
908 $oparg = $result[4];
909 $lookup = $result[5]? $result[5]:$spell['id'];
910 $var = $result[6] ? $result[6]:$result[7];
911 if (!$var)
912 continue;
913 // l - ðàçìåð ïîñëåäíåé âåëè÷èíû == 1 ? 0 : 1
914 if ($var[0]=='l')
916 $select = explode(':', substr($var, 1));
917 $str.=@$select[$lastCount==1 ? 0:1];
919 // g - ïîë ïåðñîíæà
920 else if ($var[0]=='g')
922 $select = explode(':', substr($var, 1));
923 $str.=$select[0];
925 else
927 $spellData = @$cacheSpellData[$lookup];
928 if ($spellData == 0)
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;
943 else
944 $base = $var;
945 $str.=$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);
979 if ($spell)
980 return getSpellDesc($spell);
981 return "Spell id - $spell_id";
984 function getSpellCostText($spell)
986 // Çàïîëíÿåì ñòîèìîñòü çàêëèíàíèÿ
987 $powerType = getPowerTypeName($spell['powerType']);
988 $powerCost = "";
989 if ($spell['AttributesEx'] & 2)
990 $powerCost = "Uses 100% ".$powerType;
991 else
993 if ($spell['ManaCostPercentage'])
994 $powerCost = $spell['ManaCostPercentage']."% of base";
995 else if ($spell['manaCost'])
996 $powerCost = $spell['manaCost'];
997 if ($powerCost)
999 $powerCost.= " ".$powerType;
1000 if ($spell['manaPerSecond'])
1001 $powerCost.= " plus ".$spell['manaPerSecond']." per sec";
1004 return $powerCost;