Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
SpellEffectMetadata.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
7
8namespace Skyfire
9{
10namespace Spells
11{
12 namespace
13 {
14 struct SpellIdPair
15 {
16 uint32 SpellId;
17 uint32 RelatedSpellId;
18 };
19
20 struct UInt32Pair
21 {
22 uint32 Key;
23 uint32 Value;
24 };
25
26 struct DisplaySpellInfo
27 {
28 uint32 DisplayId;
29 uint32 SpellId;
30 };
31
32 uint32 const SPELL_STEALTH = 1784;
33 uint32 const SPELL_LESSER_INVISIBILITY = 7870;
34 uint32 const SPELL_BRITTLE_ARMOR_STACK = 24575;
35 uint32 const SPELL_MERCURIAL_SHIELD_STACK = 26464;
36 uint32 const SPELL_RESTRICTED_FLIGHT_AREA = 91604;
37 uint32 const SPELL_BURN_BODY = 42793;
38 uint32 const NPC_FALLEN_COMBATANT = 24008;
39 uint32 const SPELL_BENDING_SHINBONE_STRONG = 8854;
40 uint32 const SPELL_BENDING_SHINBONE_WEAK = 8855;
41 uint32 const SPELL_SHADOW_FLAME_PROTECTION = 22683;
42 uint32 const SPELL_SHADOW_FLAME_TRIGGER = 22682;
43 uint32 const SPELL_DECIMATE_TRIGGER = 28375;
44 uint32 const EVENT_WARMAUL_OGRE_BANNER = 18388;
45 uint32 const ITEM_MUG_TRANSFORMATION = 38587;
46 uint32 const SPELL_BREWFEST_SAMPLE = 42518;
47 uint32 const SPELL_BRUTALLUS_BURN_RANGE = 46394;
48 uint32 const COPPER_5000_GOLD = 5000;
49 uint32 const SPELL_EMBLAZON_RUNEBLADE_TRIGGER = 51771;
50 uint32 const SPELL_DEATHBOLT_WARD = 51845;
51 uint32 const SPELL_DEATHBOLT_REFLECTED = 51856;
52 uint32 const SPELL_DEATHBOLT_DIRECT = 51855;
53 uint32 const SPELL_SUMMON_GHOULS_ON_SCARLET_CRUSADE = 54522;
54 uint32 const SPELL_GIFT_OF_THE_HARVESTER_FALLBACK = 52505;
55 uint32 const WINTERGRASP_RPGG_DROP_ITEM_COUNT = 5;
56 uint32 const SPELL_BIG_BLIZZARD_BEAR_EPIC = 58999;
57 uint32 const SPELL_BIG_BLIZZARD_BEAR_NORMAL = 58997;
58 uint32 const AREA_TELEPORTING_TOP = 4637;
59 uint32 const SPELL_TELEPORTING_RETURN = 59316;
60 uint32 const SPELL_TELEPORTING_ATOP = 59314;
61 uint32 const SPELL_GRAB_CRATE_PARENT = 62496;
62 uint32 const SPELL_LIGHTWELL_CHARGES = 59907;
63 uint32 const SPELL_JUDGEMENT_FALLBACK_SEAL_TRIGGER = 54158;
64 uint32 const SPELL_PESTILENCE_BLOOD_PLAGUE = 55078;
65 uint32 const SPELL_PESTILENCE_FROST_FEVER = 55095;
66 uint32 const SPELL_CREATE_HEALTHSTONE_TRIGGER = 23517;
67
68 TriggerSpellRule const TriggerSpellRules[] =
69 {
71 { 54437, TRIGGER_SPELL_RULE_DEMONIC_EMPOWERMENT_SUCCUBUS, SPELL_LESSER_INVISIBILITY, 0 },
72 { 29284, TRIGGER_SPELL_RULE_STACK_TRIGGER, 0, SPELL_BRITTLE_ARMOR_STACK },
73 { 29286, TRIGGER_SPELL_RULE_STACK_TRIGGER, 0, SPELL_MERCURIAL_SHIELD_STACK },
75 };
76
77 ForceCastDamageRule const ForceCastDamageRules[] =
78 {
84 };
85
86 uint32 const LearnSpellFromEffectDamageSpells[] =
87 {
88 483,
89 55884
90 };
91
92 SpellIdPair const ScriptEffectStackRemovalAuras[] =
93 {
94 { 24590, SPELL_BRITTLE_ARMOR_STACK },
95 { 26465, SPELL_MERCURIAL_SHIELD_STACK }
96 };
97
98 uint32 const ShadowFlameScriptSpells[] =
99 {
100 22539,
101 22972,
102 22975,
103 22976,
104 22977,
105 22978,
106 22979,
107 22980,
108 22981,
109 22982,
110 22983,
111 22984,
112 22985
113 };
114
115 uint32 const DecimateScriptSpells[] =
116 {
117 28374,
118 54426
119 };
120
121 UInt32Pair const MirrensDrinkingHatItems[] =
122 {
123 { 1, 23584 },
124 { 2, 23584 },
125 { 3, 23584 },
126 { 4, 23585 },
127 { 5, 23585 },
128 { 6, 23586 }
129 };
130
131 UInt32Pair const GoblinWeatherMachineSpells[] =
132 {
133 { 0, 46740 },
134 { 1, 46739 },
135 { 2, 46738 },
136 { 3, 46736 }
137 };
138
139 DisplaySpellInfo const DeathKnightInitiateVisualSpells[] =
140 {
141 { 25369, 51552 },
142 { 25373, 51551 },
143 { 25363, 51542 },
144 { 25357, 51541 },
145 { 25361, 51537 },
146 { 25356, 51538 },
147 { 25372, 51550 },
148 { 25367, 51549 },
149 { 25362, 51540 },
150 { 25359, 51539 },
151 { 25355, 51534 },
152 { 25354, 51520 },
153 { 25360, 51536 },
154 { 25358, 51535 },
155 { 25368, 51544 },
156 { 25364, 51543 },
157 { 25371, 51548 },
158 { 25366, 51547 },
159 { 25370, 51545 },
160 { 25365, 51546 }
161 };
162
163 uint32 const ScriptDespawnSpells[] =
164 {
165 52173,
166 60243
167 };
168
169 SpellIdPair const LightwellHealSpells[] =
170 {
171 { 31897, 7001 },
172 { 31896, 27873 },
173 { 31895, 27874 },
174 { 31894, 28276 },
175 { 31893, 48084 },
176 { 31883, 48085 }
177 };
178
179 ProtoTypicalShorteningBlasterSpells const ProtoTypicalShorteningBlasterSpellPairs[] =
180 {
181 { 45674, 45673 },
182 { 45675, 45672 },
183 { 45678, 45677 },
184 { 45682, 45681 },
185 { 45684, 45683 }
186 };
187
188 SpellIdPair const JudgementSealTriggerSpells[] =
189 {
190 { 53407, 20184 },
191 { 20271, 20185 },
192 { 57774, 20185 },
193 { 53408, 20186 }
194 };
195
196 uint32 const JudgementFallbackSealSpells[] =
197 {
198 20165,
199 20166,
200 20164
201 };
202
203 uint32 const CreateHealthstoneSpells[] =
204 {
205 6201,
206 34130
207 };
208
209 bool ContainsSpellId(uint32 const* spellIds, uint8 spellCount, uint32 spellId)
210 {
211 for (uint8 i = 0; i < spellCount; ++i)
212 if (spellIds[i] == spellId)
213 return true;
214
215 return false;
216 }
217 }
218
220 {
221 for (TriggerSpellRule const& rule : TriggerSpellRules)
222 if (rule.TriggerSpellId == triggerSpellId)
223 return &rule;
224
225 return nullptr;
226 }
227
229 {
230 for (ForceCastDamageRule const& rule : ForceCastDamageRules)
231 if (rule.SpellId == spellId)
232 return &rule;
233
234 return nullptr;
235 }
236
238 {
239 return spellId == SPELL_RESTRICTED_FLIGHT_AREA;
240 }
241
243 {
244 return spellId == SPELL_BURN_BODY ? NPC_FALLEN_COMBATANT : 0;
245 }
246
248 {
249 for (uint32 const damageSpellId : LearnSpellFromEffectDamageSpells)
250 if (damageSpellId == spellId)
251 return true;
252
253 return false;
254 }
255
257 {
258 return strongHit ? SPELL_BENDING_SHINBONE_STRONG : SPELL_BENDING_SHINBONE_WEAK;
259 }
260
262 {
263 for (SpellIdPair const& stackRemoval : ScriptEffectStackRemovalAuras)
264 if (stackRemoval.SpellId == scriptSpellId)
265 return stackRemoval.RelatedSpellId;
266
267 return 0;
268 }
269
271 {
272 if (!ContainsSpellId(ShadowFlameScriptSpells, sizeof(ShadowFlameScriptSpells) / sizeof(uint32), scriptSpellId))
273 return nullptr;
274
275 static ShadowFlameScriptRule const rule =
276 {
277 SPELL_SHADOW_FLAME_PROTECTION,
278 SPELL_SHADOW_FLAME_TRIGGER
279 };
280 return &rule;
281 }
282
284 {
285 return ContainsSpellId(DecimateScriptSpells, sizeof(DecimateScriptSpells) / sizeof(uint32), scriptSpellId) ?
286 SPELL_DECIMATE_TRIGGER : 0;
287 }
288
290 {
291 for (UInt32Pair const& item : MirrensDrinkingHatItems)
292 if (item.Key == roll)
293 return item.Value;
294
295 return 0;
296 }
297
299 {
300 return EVENT_WARMAUL_OGRE_BANNER;
301 }
302
304 {
305 return ITEM_MUG_TRANSFORMATION;
306 }
307
309 {
310 return SPELL_BREWFEST_SAMPLE;
311 }
312
314 {
315 return SPELL_BRUTALLUS_BURN_RANGE;
316 }
317
319 {
320 for (UInt32Pair const& spell : GoblinWeatherMachineSpells)
321 if (spell.Key == roll)
322 return spell.Value;
323
324 return 0;
325 }
326
328 {
329 return COPPER_5000_GOLD;
330 }
331
333 {
334 return SPELL_EMBLAZON_RUNEBLADE_TRIGGER;
335 }
336
338 {
339 for (DisplaySpellInfo const& visualSpell : DeathKnightInitiateVisualSpells)
340 if (visualSpell.DisplayId == displayId)
341 return visualSpell.SpellId;
342
343 return 0;
344 }
345
347 {
348 return SPELL_DEATHBOLT_WARD;
349 }
350
352 {
353 return SPELL_DEATHBOLT_REFLECTED;
354 }
355
357 {
358 return SPELL_DEATHBOLT_DIRECT;
359 }
360
362 {
363 return SPELL_SUMMON_GHOULS_ON_SCARLET_CRUSADE;
364 }
365
366 bool IsScriptDespawnSpell(uint32 scriptSpellId)
367 {
368 return ContainsSpellId(ScriptDespawnSpells, sizeof(ScriptDespawnSpells) / sizeof(uint32), scriptSpellId);
369 }
370
372 {
373 return SPELL_GIFT_OF_THE_HARVESTER_FALLBACK;
374 }
375
377 {
378 return WINTERGRASP_RPGG_DROP_ITEM_COUNT;
379 }
380
382 {
383 return ridingSkill >= 150 ? SPELL_BIG_BLIZZARD_BEAR_EPIC : SPELL_BIG_BLIZZARD_BEAR_NORMAL;
384 }
385
387 {
388 return areaId == AREA_TELEPORTING_TOP ? SPELL_TELEPORTING_RETURN : SPELL_TELEPORTING_ATOP;
389 }
390
392 {
393 return SPELL_GRAB_CRATE_PARENT;
394 }
395
397 {
398 for (SpellIdPair const& healSpell : LightwellHealSpells)
399 if (healSpell.SpellId == creatureEntry)
400 return healSpell.RelatedSpellId;
401
402 return 0;
403 }
404
406 {
407 return SPELL_LIGHTWELL_CHARGES;
408 }
409
411 {
412 if (roll >= sizeof(ProtoTypicalShorteningBlasterSpellPairs) / sizeof(ProtoTypicalShorteningBlasterSpells))
413 return nullptr;
414
415 return &ProtoTypicalShorteningBlasterSpellPairs[roll];
416 }
417
419 {
420 for (SpellIdPair const& sealTrigger : JudgementSealTriggerSpells)
421 if (sealTrigger.SpellId == judgementSpellId)
422 return sealTrigger.RelatedSpellId;
423
424 return 0;
425 }
426
428 {
429 return ContainsSpellId(JudgementFallbackSealSpells, sizeof(JudgementFallbackSealSpells) / sizeof(uint32),
430 sealSpellId) ? SPELL_JUDGEMENT_FALLBACK_SEAL_TRIGGER : 0;
431 }
432
434 {
435 return SPELL_PESTILENCE_BLOOD_PLAGUE;
436 }
437
439 {
440 return SPELL_PESTILENCE_FROST_FEVER;
441 }
442
444 {
445 return ContainsSpellId(CreateHealthstoneSpells, sizeof(CreateHealthstoneSpells) / sizeof(uint32),
446 createHealthstoneSpellId) ? SPELL_CREATE_HEALTHSTONE_TRIGGER : 0;
447 }
448}
449}
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::uint16_t uint16
Definition Define.h:78
@ SPELL_STEALTH
uint32 GetSummonGhoulsOnScarletCrusadeSpellId()
uint32 GetLightwellHealSpellId(uint32 creatureEntry)
uint32 GetKillCreditFallbackCreatureEntry(uint32 spellId)
bool ShouldSendNoFlyZoneNotification(uint32 spellId)
uint32 GetEmblazonRunebladeTriggerSpellId()
uint32 GetGiftOfTheHarvesterFallbackSpellId()
uint32 GetScriptEffectStackRemovalAuraSpellId(uint32 scriptSpellId)
uint32 GetBendingShinboneTriggerSpellId(bool strongHit)
uint32 GetDecimateScriptTriggerSpellId(uint32 scriptSpellId)
uint32 GetDeathboltReflectedSpellId()
@ FORCE_CAST_DAMAGE_RULE_TRIGGERED_ORIGINAL_CASTER
uint32 GetDeathKnightInitiateVisualSpellId(uint32 displayId)
ProtoTypicalShorteningBlasterSpells const * GetProtoTypicalShorteningBlasterSpells(uint32 roll)
uint32 GetJudgementSealTriggerSpellId(uint32 judgementSpellId)
uint32 GetPestilenceBloodPlagueSpellId()
bool ShouldLearnSpellFromEffectDamage(uint32 spellId)
uint32 GetMirrensDrinkingHatItemId(uint32 roll)
uint32 GetGoblinWeatherMachineSpellId(uint32 roll)
TriggerSpellRule const * GetTriggerSpellRule(uint32 triggerSpellId)
uint32 GetJudgementFallbackSealTriggerSpellId(uint32 sealSpellId)
uint32 GetWintergraspRpggDropItemCount()
uint32 GetBrutallusBurnRangeAuraSpellId()
uint32 GetPestilenceFrostFeverSpellId()
uint32 GetLightwellChargesAuraSpellId()
ForceCastDamageRule const * GetForceCastDamageRule(uint32 spellId)
@ TRIGGER_SPELL_RULE_DEMONIC_EMPOWERMENT_SUCCUBUS
bool IsScriptDespawnSpell(uint32 scriptSpellId)
uint32 GetPlantWarmaulOgreBannerEventId()
ShadowFlameScriptRule const * GetShadowFlameScriptRule(uint32 scriptSpellId)
uint32 GetBigBlizzardBearMountSpellId(uint16 ridingSkill)
uint32 GetTeleportingScriptSpellId(uint32 areaId)
uint32 GetCreateHealthstoneTriggeredSpellId(uint32 createHealthstoneSpellId)