TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Spell.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef __SPELL_H
20 #define __SPELL_H
21 
22 #include "GridDefines.h"
23 #include "SharedDefines.h"
24 #include "ObjectMgr.h"
25 #include "SpellInfo.h"
26 #include "PathGenerator.h"
27 
28 namespace WorldPackets
29 {
30  namespace Spells
31  {
32  struct SpellCastRequest;
33  struct SpellTargetData;
34  struct SpellCastData;
35  }
36 }
37 
38 class Unit;
39 class Player;
40 class GameObject;
41 class DynamicObject;
42 class WorldObject;
43 class Aura;
44 class SpellScript;
45 class ByteBuffer;
46 
47 #define SPELL_CHANNEL_UPDATE_INTERVAL (1 * IN_MILLISECONDS)
48 
50 {
51  CAST_FLAG_NONE = 0x00000000,
52  CAST_FLAG_PENDING = 0x00000001, // aoe combat log?
54  CAST_FLAG_UNKNOWN_3 = 0x00000004,
55  CAST_FLAG_UNKNOWN_4 = 0x00000008, // ignore AOE visual
56  CAST_FLAG_UNKNOWN_5 = 0x00000010,
57  CAST_FLAG_PROJECTILE = 0x00000020,
58  CAST_FLAG_UNKNOWN_7 = 0x00000040,
59  CAST_FLAG_UNKNOWN_8 = 0x00000080,
60  CAST_FLAG_UNKNOWN_9 = 0x00000100,
61  CAST_FLAG_UNKNOWN_10 = 0x00000200,
62  CAST_FLAG_UNKNOWN_11 = 0x00000400,
64  CAST_FLAG_UNKNOWN_13 = 0x00001000,
65  CAST_FLAG_UNKNOWN_14 = 0x00002000,
66  CAST_FLAG_UNKNOWN_15 = 0x00004000,
67  CAST_FLAG_UNKNOWN_16 = 0x00008000,
68  CAST_FLAG_UNKNOWN_17 = 0x00010000,
70  CAST_FLAG_NO_GCD = 0x00040000, // no GCD for spell casts from charm/summon (vehicle spells is an example)
71  CAST_FLAG_VISUAL_CHAIN = 0x00080000,
72  CAST_FLAG_UNKNOWN_21 = 0x00100000,
73  CAST_FLAG_RUNE_LIST = 0x00200000,
74  CAST_FLAG_UNKNOWN_23 = 0x00400000,
75  CAST_FLAG_UNKNOWN_24 = 0x00800000,
76  CAST_FLAG_UNKNOWN_25 = 0x01000000,
77  CAST_FLAG_UNKNOWN_26 = 0x02000000,
78  CAST_FLAG_IMMUNITY = 0x04000000,
79  CAST_FLAG_UNKNOWN_28 = 0x08000000,
80  CAST_FLAG_UNKNOWN_29 = 0x10000000,
81  CAST_FLAG_UNKNOWN_30 = 0x20000000,
83  CAST_FLAG_UNKNOWN_32 = 0x80000000
84 };
85 
87 {
88  CAST_FLAG_EX_NONE = 0x00000,
104  CAST_FLAG_EX_USE_TOY_SPELL = 0x08000, // Starts cooldown on toy
109 };
110 
112 {
114  SPELL_RANGE_MELEE = 1, //melee
115  SPELL_RANGE_RANGED = 2 //hunter range and ranged weapon
116 };
117 
119 {
121  SpellDestination(float x, float y, float z, float orientation = 0.0f, uint32 mapId = MAPID_INVALID);
122  SpellDestination(Position const& pos);
123  SpellDestination(WorldObject const& wObj);
124 
125  void Relocate(Position const& pos);
126  void RelocateOffset(Position const& offset);
127 
131 };
132 
133 
135 {
139  float Amplitude = 0;
140 };
141 
143 {
146 };
147 
149 {
153 };
154 
156 {
158 };
159 
161 {
163 };
164 
166 {
168 };
169 
171 {
172  public:
174  SpellCastTargets(Unit* caster, WorldPackets::Spells::SpellCastRequest const& spellCastRequest);
175  ~SpellCastTargets();
176 
177  void Write(WorldPackets::Spells::SpellTargetData& data);
178 
179  uint32 GetTargetMask() const { return m_targetMask; }
180  void SetTargetMask(uint32 newMask) { m_targetMask = newMask; }
181 
182  void SetTargetFlag(SpellCastTargetFlags flag) { m_targetMask |= flag; }
183 
184  ObjectGuid GetOrigUnitTargetGUID() const;
185  void SetOrigUnitTarget(Unit* target);
186 
187  ObjectGuid GetUnitTargetGUID() const;
188  Unit* GetUnitTarget() const;
189  void SetUnitTarget(Unit* target);
190 
191  ObjectGuid GetGOTargetGUID() const;
192  GameObject* GetGOTarget() const;
193  void SetGOTarget(GameObject* target);
194 
195  ObjectGuid GetCorpseTargetGUID() const;
196  Corpse* GetCorpseTarget() const;
197 
198  WorldObject* GetObjectTarget() const;
199  ObjectGuid GetObjectTargetGUID() const;
200  void RemoveObjectTarget();
201 
202  ObjectGuid GetItemTargetGUID() const { return m_itemTargetGUID; }
203  Item* GetItemTarget() const { return m_itemTarget; }
204  uint32 GetItemTargetEntry() const { return m_itemTargetEntry; }
205  void SetItemTarget(Item* item);
206  void SetTradeItemTarget(Player* caster);
207  void UpdateTradeSlotItem();
208 
209  SpellDestination const* GetSrc() const;
210  Position const* GetSrcPos() const;
211  void SetSrc(float x, float y, float z);
212  void SetSrc(Position const& pos);
213  void SetSrc(WorldObject const& wObj);
214  void ModSrc(Position const& pos);
215  void RemoveSrc();
216 
217  SpellDestination const* GetDst() const;
218  WorldLocation const* GetDstPos() const;
219  void SetDst(float x, float y, float z, float orientation, uint32 mapId = MAPID_INVALID);
220  void SetDst(Position const& pos);
221  void SetDst(WorldObject const& wObj);
222  void SetDst(SpellDestination const& spellDest);
223  void SetDst(SpellCastTargets const& spellTargets);
224  void ModDst(Position const& pos);
225  void ModDst(SpellDestination const& spellDest);
226  void RemoveDst();
227 
228  bool HasSrc() const { return (GetTargetMask() & TARGET_FLAG_SOURCE_LOCATION) != 0; }
229  bool HasDst() const { return (GetTargetMask() & TARGET_FLAG_DEST_LOCATION) != 0; }
230  bool HasTraj() const { return m_speed != 0; }
231 
232  float GetPitch() const { return m_pitch; }
233  void SetPitch(float pitch) { m_pitch = pitch; }
234  float GetSpeed() const { return m_speed; }
235  void SetSpeed(float speed) { m_speed = speed; }
236 
237  float GetDist2d() const { return m_src._position.GetExactDist2d(&m_dst._position); }
238  float GetSpeedXY() const { return m_speed * std::cos(m_pitch); }
239  float GetSpeedZ() const { return m_speed * std::sin(m_pitch); }
240 
241  void Update(Unit* caster);
242  void OutDebug() const;
243  std::string GetTargetString() const { return m_strTarget; }
244 
245  private:
247 
248  // objects (can be used at spell creating and after Update at casting)
251 
252  // object GUID/etc, can be used always
257 
260 
261  float m_pitch, m_speed;
262  std::string m_strTarget;
263 };
264 
266 {
267  explicit SpellValue(Difficulty diff, SpellInfo const* proto);
270  float RadiusMod;
272 };
273 
275 {
282 };
283 
285 {
290 };
291 
292 typedef std::list<std::pair<uint32, ObjectGuid>> DispelList;
293 
295 {
296  friend void Unit::SetCurrentCastSpell(Spell* pSpell);
297  friend class SpellScript;
298  public:
299 
300  void EffectNULL(SpellEffIndex effIndex);
301  void EffectUnused(SpellEffIndex effIndex);
302  void EffectDistract(SpellEffIndex effIndex);
303  void EffectPull(SpellEffIndex effIndex);
304  void EffectSchoolDMG(SpellEffIndex effIndex);
305  void EffectEnvironmentalDMG(SpellEffIndex effIndex);
306  void EffectInstaKill(SpellEffIndex effIndex);
307  void EffectDummy(SpellEffIndex effIndex);
308  void EffectTeleportUnits(SpellEffIndex effIndex);
309  void EffectApplyAura(SpellEffIndex effIndex);
310  void EffectSendEvent(SpellEffIndex effIndex);
311  void EffectPowerBurn(SpellEffIndex effIndex);
312  void EffectPowerDrain(SpellEffIndex effIndex);
313  void EffectHeal(SpellEffIndex effIndex);
314  void EffectBind(SpellEffIndex effIndex);
315  void EffectHealthLeech(SpellEffIndex effIndex);
316  void EffectQuestComplete(SpellEffIndex effIndex);
317  void EffectCreateItem(SpellEffIndex effIndex);
318  void EffectCreateItem2(SpellEffIndex effIndex);
319  void EffectCreateRandomItem(SpellEffIndex effIndex);
320  void EffectPersistentAA(SpellEffIndex effIndex);
321  void EffectEnergize(SpellEffIndex effIndex);
322  void EffectOpenLock(SpellEffIndex effIndex);
323  void EffectSummonChangeItem(SpellEffIndex effIndex);
324  void EffectProficiency(SpellEffIndex effIndex);
325  void EffectApplyAreaAura(SpellEffIndex effIndex);
326  void EffectSummonType(SpellEffIndex effIndex);
327  void EffectLearnSpell(SpellEffIndex effIndex);
328  void EffectDispel(SpellEffIndex effIndex);
329  void EffectDualWield(SpellEffIndex effIndex);
330  void EffectPickPocket(SpellEffIndex effIndex);
331  void EffectAddFarsight(SpellEffIndex effIndex);
332  void EffectUntrainTalents(SpellEffIndex effIndex);
333  void EffectHealMechanical(SpellEffIndex effIndex);
334  void EffectJump(SpellEffIndex effIndex);
335  void EffectJumpDest(SpellEffIndex effIndex);
336  void EffectLeapBack(SpellEffIndex effIndex);
337  void EffectQuestClear(SpellEffIndex effIndex);
338  void EffectTeleUnitsFaceCaster(SpellEffIndex effIndex);
339  void EffectLearnSkill(SpellEffIndex effIndex);
340  void EffectPlayMovie(SpellEffIndex effIndex);
341  void EffectTradeSkill(SpellEffIndex effIndex);
342  void EffectEnchantItemPerm(SpellEffIndex effIndex);
343  void EffectEnchantItemTmp(SpellEffIndex effIndex);
344  void EffectTameCreature(SpellEffIndex effIndex);
345  void EffectSummonPet(SpellEffIndex effIndex);
346  void EffectLearnPetSpell(SpellEffIndex effIndex);
347  void EffectWeaponDmg(SpellEffIndex effIndex);
348  void EffectForceCast(SpellEffIndex effIndex);
349  void EffectTriggerSpell(SpellEffIndex effIndex);
350  void EffectTriggerMissileSpell(SpellEffIndex effIndex);
351  void EffectThreat(SpellEffIndex effIndex);
352  void EffectHealMaxHealth(SpellEffIndex effIndex);
353  void EffectInterruptCast(SpellEffIndex effIndex);
354  void EffectSummonObjectWild(SpellEffIndex effIndex);
355  void EffectScriptEffect(SpellEffIndex effIndex);
356  void EffectSanctuary(SpellEffIndex effIndex);
357  void EffectAddComboPoints(SpellEffIndex effIndex);
358  void EffectDuel(SpellEffIndex effIndex);
359  void EffectStuck(SpellEffIndex effIndex);
360  void EffectSummonPlayer(SpellEffIndex effIndex);
361  void EffectActivateObject(SpellEffIndex effIndex);
362  void EffectApplyGlyph(SpellEffIndex effIndex);
363  void EffectEnchantHeldItem(SpellEffIndex effIndex);
364  void EffectSummonObject(SpellEffIndex effIndex);
365  void EffectChangeRaidMarker(SpellEffIndex effIndex);
366  void EffectResurrect(SpellEffIndex effIndex);
367  void EffectParry(SpellEffIndex effIndex);
368  void EffectBlock(SpellEffIndex effIndex);
369  void EffectLeap(SpellEffIndex effIndex);
370  void EffectTransmitted(SpellEffIndex effIndex);
371  void EffectDisEnchant(SpellEffIndex effIndex);
372  void EffectInebriate(SpellEffIndex effIndex);
373  void EffectFeedPet(SpellEffIndex effIndex);
374  void EffectDismissPet(SpellEffIndex effIndex);
375  void EffectReputation(SpellEffIndex effIndex);
376  void EffectForceDeselect(SpellEffIndex effIndex);
377  void EffectSelfResurrect(SpellEffIndex effIndex);
378  void EffectSkinning(SpellEffIndex effIndex);
379  void EffectCharge(SpellEffIndex effIndex);
380  void EffectChargeDest(SpellEffIndex effIndex);
381  void EffectProspecting(SpellEffIndex effIndex);
382  void EffectMilling(SpellEffIndex effIndex);
383  void EffectRenamePet(SpellEffIndex effIndex);
384  void EffectSendTaxi(SpellEffIndex effIndex);
385  void EffectSummonCritter(SpellEffIndex effIndex);
386  void EffectKnockBack(SpellEffIndex effIndex);
387  void EffectPullTowards(SpellEffIndex effIndex);
388  void EffectDispelMechanic(SpellEffIndex effIndex);
389  void EffectResurrectPet(SpellEffIndex effIndex);
390  void EffectDestroyAllTotems(SpellEffIndex effIndex);
391  void EffectDurabilityDamage(SpellEffIndex effIndex);
392  void EffectSkill(SpellEffIndex effIndex);
393  void EffectTaunt(SpellEffIndex effIndex);
394  void EffectDurabilityDamagePCT(SpellEffIndex effIndex);
395  void EffectModifyThreatPercent(SpellEffIndex effIndex);
396  void EffectResurrectNew(SpellEffIndex effIndex);
397  void EffectAddExtraAttacks(SpellEffIndex effIndex);
398  void EffectSpiritHeal(SpellEffIndex effIndex);
399  void EffectSkinPlayerCorpse(SpellEffIndex effIndex);
400  void EffectStealBeneficialBuff(SpellEffIndex effIndex);
401  void EffectUnlearnSpecialization(SpellEffIndex effIndex);
402  void EffectHealPct(SpellEffIndex effIndex);
403  void EffectEnergizePct(SpellEffIndex effIndex);
404  void EffectTriggerRitualOfSummoning(SpellEffIndex effIndex);
405  void EffectSummonRaFFriend(SpellEffIndex effIndex);
406  void EffectUnlockGuildVaultTab(SpellEffIndex effIndex);
407  void EffectKillCreditPersonal(SpellEffIndex effIndex);
408  void EffectKillCredit(SpellEffIndex effIndex);
409  void EffectQuestFail(SpellEffIndex effIndex);
410  void EffectQuestStart(SpellEffIndex effIndex);
411  void EffectRedirectThreat(SpellEffIndex effIndex);
412  void EffectGameObjectDamage(SpellEffIndex effIndex);
413  void EffectGameObjectRepair(SpellEffIndex effIndex);
414  void EffectGameObjectSetDestructionState(SpellEffIndex effIndex);
415  void EffectActivateRune(SpellEffIndex effIndex);
416  void EffectCreateTamedPet(SpellEffIndex effIndex);
417  void EffectDiscoverTaxi(SpellEffIndex effIndex);
418  void EffectTitanGrip(SpellEffIndex effIndex);
419  void EffectEnchantItemPrismatic(SpellEffIndex effIndex);
420  void EffectPlayMusic(SpellEffIndex effIndex);
421  void EffectSpecCount(SpellEffIndex effIndex);
422  void EffectActivateSpec(SpellEffIndex effIndex);
423  void EffectPlaySound(SpellEffIndex effIndex);
424  void EffectRemoveAura(SpellEffIndex effIndex);
425  void EffectDamageFromMaxHealthPCT(SpellEffIndex effIndex);
426  void EffectCastButtons(SpellEffIndex effIndex);
427  void EffectRechargeManaGem(SpellEffIndex effIndex);
428  void EffectGiveCurrency(SpellEffIndex effIndex);
429  void EffectResurrectWithAura(SpellEffIndex effIndex);
430  void EffectCreateAreaTrigger(SpellEffIndex effIndex);
431  void EffectRemoveTalent(SpellEffIndex effIndex);
432  void EffectDestroyItem(SpellEffIndex effIndex);
433  void EffectLearnGarrisonBuilding(SpellEffIndex effIndex);
434  void EffectCreateGarrison(SpellEffIndex effIndex);
435  void EffectAddGarrisonFollower(SpellEffIndex effIndex);
436  void EffectActivateGarrisonBuilding(SpellEffIndex effIndex);
437  void EffectHealBattlePetPct(SpellEffIndex effIndex);
438  void EffectEnableBattlePets(SpellEffIndex effIndex);
439  void EffectUncageBattlePet(SpellEffIndex effIndex);
440  void EffectCreateHeirloomItem(SpellEffIndex effIndex);
441  void EffectUpgradeHeirloom(SpellEffIndex effIndex);
442 
443  typedef std::set<Aura*> UsedSpellMods;
444 
445  Spell(Unit* caster, SpellInfo const* info, TriggerCastFlags triggerFlags, ObjectGuid originalCasterGUID = ObjectGuid::Empty, bool skipCheck = false);
446  ~Spell();
447 
448  void InitExplicitTargets(SpellCastTargets const& targets);
449  void SelectExplicitTargets();
450 
451  void SelectSpellTargets();
452  void SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32& processedEffectMask);
453  void SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
454  void SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32 effMask);
455  void SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32 effMask);
456  void SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32 effMask);
457  void SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
458  void SelectImplicitTargetDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
459  void SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
460  void SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
461  void SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
462  void SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, WorldObject* target, uint32 effMask);
463  void SelectImplicitTrajTargets(SpellEffIndex effIndex);
464 
465  void SelectEffectTypeImplicitTargets(uint32 effIndex);
466 
467  uint32 GetSearcherTypeMask(SpellTargetObjectTypes objType, ConditionContainer* condList);
468  template<class SEARCHER> void SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* referer, Position const* pos, float radius);
469 
470  WorldObject* SearchNearbyTarget(float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer* condList = NULL);
471  void SearchAreaTargets(std::list<WorldObject*>& targets, float range, Position const* position, Unit* referer, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer* condList);
472  void SearchChainTargets(std::list<WorldObject*>& targets, uint32 chainTargets, WorldObject* target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, ConditionContainer* condList, bool isChainHeal);
473 
474  GameObject* SearchSpellFocus();
475 
476  void prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura = NULL);
477  void cancel();
478  void update(uint32 difftime);
479  void cast(bool skipCheck = false);
480  void finish(bool ok = true);
481  void TakePower();
482 
483  void TakeRunePower(bool didHit);
484  void TakeReagents();
485  void TakeCastItem();
486 
487  SpellCastResult CheckCast(bool strict);
488  SpellCastResult CheckPetCast(Unit* target);
489 
490  // handlers
491  void handle_immediate();
492  uint64 handle_delayed(uint64 t_offset);
493  // handler helpers
494  void _handle_immediate_phase();
495  void _handle_finish_phase();
496 
497  SpellCastResult CheckItems();
498  SpellCastResult CheckRange(bool strict);
499  SpellCastResult CheckPower();
500  SpellCastResult CheckRuneCost(uint32 runeCostID);
501  SpellCastResult CheckCasterAuras() const;
502  SpellCastResult CheckArenaAndRatedBattlegroundCastRules();
503 
504  int32 CalculateDamage(uint8 i, Unit const* target, float* var = nullptr) const { return m_caster->CalculateSpellDamage(target, m_spellInfo, i, &m_spellValue->EffectBasePoints[i], var, m_castItemLevel); }
505 
506  bool HaveTargetsForEffect(uint8 effect) const;
507  void Delayed();
508  void DelayedChannel();
509  uint32 getState() const { return m_spellState; }
510  void setState(uint32 state) { m_spellState = state; }
511 
512  void DoCreateItem(uint32 i, uint32 itemtype, std::vector<int32> const& bonusListIDs = std::vector<int32>());
513 
514  bool CheckEffectTarget(Unit const* target, SpellEffectInfo const* effect, Position const* losPosition) const;
515  bool CheckEffectTarget(GameObject const* target, SpellEffectInfo const* effect) const;
516  bool CheckEffectTarget(Item const* target, SpellEffectInfo const* effect) const;
517  bool CanAutoCast(Unit* target);
518  void CheckSrc() { if (!m_targets.HasSrc()) m_targets.SetSrc(*m_caster); }
519  void CheckDst() { if (!m_targets.HasDst()) m_targets.SetDst(*m_caster); }
520 
521  static void SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError = SPELL_CUSTOM_ERROR_NONE, OpcodeServer opcode = SMSG_CAST_FAILED, uint32* misc = nullptr);
522  void SendCastResult(SpellCastResult result);
523  void SendPetCastResult(SpellCastResult result);
524  void SendSpellStart();
525  void SendSpellGo();
526  void SendSpellCooldown();
527  void SendSpellExecuteLog();
528  void ExecuteLogEffectTakeTargetPower(uint8 effIndex, Unit* target, uint32 powerType, uint32 points, float amplitude);
529  void ExecuteLogEffectExtraAttacks(uint8 effIndex, Unit* victim, uint32 numAttacks);
530  void ExecuteLogEffectInterruptCast(uint8 effIndex, Unit* victim, uint32 spellId);
531  void ExecuteLogEffectDurabilityDamage(uint8 effIndex, Unit* victim, int32 itemId, int32 amount);
532  void ExecuteLogEffectOpenLock(uint8 effIndex, Object* obj);
533  void ExecuteLogEffectCreateItem(uint8 effIndex, uint32 entry);
534  void ExecuteLogEffectDestroyItem(uint8 effIndex, uint32 entry);
535  void ExecuteLogEffectSummonObject(uint8 effIndex, WorldObject* obj);
536  void ExecuteLogEffectUnsummonObject(uint8 effIndex, WorldObject* obj);
537  void ExecuteLogEffectResurrect(uint8 effIndex, Unit* target);
538  void CleanupExecuteLogList();
539  void SendInterrupted(uint8 result);
540  void SendChannelUpdate(uint32 time);
541  void SendChannelStart(uint32 duration);
542  void SendResurrectRequest(Player* target);
543 
544  void HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOTarget, uint32 i, SpellEffectHandleMode mode);
545  void HandleThreatSpells();
546 
547  SpellInfo const* const m_spellInfo;
554  union
555  {
556  // Alternate names for this value
559 
560  // SPELL_EFFECT_SET_FOLLOWER_QUALITY
561  // SPELL_EFFECT_INCREASE_FOLLOWER_ITEM_LEVEL
562  // SPELL_EFFECT_INCREASE_FOLLOWER_EXPERIENCE
563  // SPELL_EFFECT_RANDOMIZE_FOLLOWER_ABILITIES
564  // SPELL_EFFECT_LEARN_FOLLOWER_ABILITY
565  struct
566  {
568  uint32 AbilityId; // only SPELL_EFFECT_LEARN_FOLLOWER_ABILITY
569  } GarrFollower;
570 
571  // SPELL_EFFECT_FINISH_GARRISON_MISSION
573 
574  // SPELL_EFFECT_UPGRADE_HEIRLOOM
576 
577  struct
578  {
580  } Raw;
581  } m_misc;
587 
588  UsedSpellMods m_appliedMods;
589 
590  int32 GetCastTime() const { return m_casttime; }
591  bool IsAutoRepeat() const { return m_autoRepeat; }
592  void SetAutoRepeat(bool rep) { m_autoRepeat = rep; }
593  void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; }
594  bool IsNextMeleeSwingSpell() const;
595  bool IsTriggered() const { return (_triggeredCastFlags & TRIGGERED_FULL_MASK) != 0; }
596  bool IsIgnoringCooldowns() const { return (_triggeredCastFlags & TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD) != 0; }
597  bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; }
598  bool IsAutoActionResetSpell() const;
599 
600  bool IsDeletable() const { return !m_referencedFromCurrentSpell && !m_executedCurrently; }
601  void SetReferencedFromCurrent(bool yes) { m_referencedFromCurrentSpell = yes; }
602  bool IsInterruptable() const { return !m_executedCurrently; }
603  void SetExecutedCurrently(bool yes) {m_executedCurrently = yes;}
604  uint64 GetDelayStart() const { return m_delayStart; }
605  void SetDelayStart(uint64 m_time) { m_delayStart = m_time; }
606  uint64 GetDelayMoment() const { return m_delayMoment; }
607 
608  bool IsNeedSendToClient() const;
609 
610  CurrentSpellTypes GetCurrentContainer() const;
611 
612  Unit* GetCaster() const { return m_caster; }
613  Unit* GetOriginalCaster() const { return m_originalCaster; }
614  SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
615  std::vector<SpellInfo::CostData> GetPowerCost() const { return m_powerCost; }
616 
617  bool UpdatePointers(); // must be used at call Spell code after time delay (non triggered spell cast/update spell call/etc)
618 
619  void CleanupTargetList();
620 
621  void SetSpellValue(SpellValueMod mod, int32 value);
622 
623  SpellEffectInfoVector const& GetEffects() const { return _effects; }
624  SpellEffectInfo const* GetEffect(uint32 index) const
625  {
626  if (index >= _effects.size())
627  return nullptr;
628 
629  return _effects[index];
630  }
631 
632  bool HasEffect(SpellEffectName effect) const;
633 
634  Spell** m_selfContainer; // pointer to our spell container (if applicable)
635 
636  SpellInfo const* GetTriggeredByAuraSpell() const { return m_triggeredByAuraSpell; }
637 
638  int32 GetTimer() const { return m_timer; }
639 
640  protected:
641  bool HasGlobalCooldown() const;
642  void TriggerGlobalCooldown();
643  void CancelGlobalCooldown();
644 
645  void SendLoot(ObjectGuid guid, LootType loottype);
646 
647  Unit* const m_caster;
648 
650 
651  ObjectGuid m_originalCasterGUID; // real source of cast (aura caster/etc), used for spell targets selection
652  // e.g. damage around area spell trigered by victim aura and damage enemies of aura caster
653  Unit* m_originalCaster; // cached pointer for m_originalCaster, updated at Spell::UpdatePointers()
654 
655  //Spell data
656  SpellSchoolMask m_spellSchoolMask; // Spell school (can be overwrite for some spells (wand shoot for example)
657  WeaponAttackType m_attackType; // For weapon based attack
658 
659  std::vector<SpellInfo::CostData> m_powerCost; // Calculated spell cost initialized only in Spell::prepare
660  int32 m_casttime; // Calculated spell cast time initialized only in Spell::prepare
661  int32 m_channeledDuration; // Calculated channeled spell duration in order to calculate correct pushback.
662  bool m_canReflect; // can reflect this spell?
664  bool m_isDelayedInstantCast; // whether this is a creature's delayed instant cast
666 
669  {
670  if (m_delayAtDamageCount >= 2)
671  return true;
672 
673  m_delayAtDamageCount++;
674  return false;
675  }
676 
677  // Delayed spells system
678  uint64 m_delayStart; // time of spell delay start, filled by event handler, zero = just started
679  uint64 m_delayMoment; // moment of next delay call, used internally
680  bool m_immediateHandled; // were immediate actions handled? (used by delayed spells only)
681 
682  // These vars are used in both delayed spell system and modified immediate spell system
683  bool m_referencedFromCurrentSpell; // mark as references to prevent deleted and access by dead pointers
684  bool m_executedCurrently; // mark as executed to prevent deleted and access by dead pointers
687  float m_damageMultipliers[3];
688 
689  // Current targets, to be used in SpellEffects (MUST BE USED ONLY IN SPELL EFFECTS)
695  float variance;
698  // used in effects handlers
700 
701  // this is set in Spell Hit, but used in Apply Aura handler
704 
705  // -------------------------------------------
707 
708  // Damage and healing in effects need just calculate
709  int32 m_damage; // Damage in effects count here
710  int32 m_healing; // Healing in effects count here
711 
712  // ******************************************
713  // Spell trigger system
714  // ******************************************
715  uint32 m_procAttacker; // Attacker trigger flags
716  uint32 m_procVictim; // Victim trigger flags
718  void prepareDataForTriggerSystem(AuraEffect const* triggeredByAura);
719 
720  // *****************************************
721  // Spell target subsystem
722  // *****************************************
723  // Targets store structures and data
724  struct TargetInfo
725  {
726  // a bug in gcc-4.7 needs a destructor to call move operator instead of copy operator in std::vector remove
730  SpellMissInfo missCondition:8;
731  SpellMissInfo reflectResult:8;
733  bool processed:1;
734  bool alive:1;
735  bool crit:1;
736  bool scaleAura:1;
738  };
739  std::vector<TargetInfo> m_UniqueTargetInfo;
740  uint32 m_channelTargetEffectMask; // Mask req. alive targets
741 
743  {
747  bool processed;
748  };
749  std::vector<GOTargetInfo> m_UniqueGOTargetInfo;
750 
752  {
755  };
756  std::vector<ItemTargetInfo> m_UniqueItemInfo;
757 
759 
760  void AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid = true, bool implicit = true, Position const* losPosition = nullptr);
761  void AddGOTarget(GameObject* target, uint32 effectMask);
762  void AddItemTarget(Item* item, uint32 effectMask);
763  void AddDestTarget(SpellDestination const& dest, uint32 effIndex);
764 
765  void DoAllEffectOnTarget(TargetInfo* target);
766  SpellMissInfo DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleAura);
767  void DoTriggersOnSpellHit(Unit* unit, uint8 effMask);
768  void DoAllEffectOnTarget(GOTargetInfo* target);
769  void DoAllEffectOnTarget(ItemTargetInfo* target);
770  bool UpdateChanneledTargetList();
771  bool IsValidDeadOrAliveTarget(Unit const* target) const;
772  void HandleLaunchPhase();
773  void DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier);
774 
775  void PrepareTargetProcessing();
776  void FinishTargetProcessing();
777 
778  // Scripting system
779  void LoadScripts();
780  void CallScriptBeforeCastHandlers();
781  void CallScriptOnCastHandlers();
782  void CallScriptAfterCastHandlers();
783  SpellCastResult CallScriptCheckCastHandlers();
784  void PrepareScriptHitHandlers();
785  bool CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMode mode);
786  void CallScriptSuccessfulDispel(SpellEffIndex effIndex);
787  void CallScriptBeforeHitHandlers();
788  void CallScriptOnHitHandlers();
789  void CallScriptAfterHitHandlers();
790  void CallScriptObjectAreaTargetSelectHandlers(std::list<WorldObject*>& targets, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
791  void CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
792  void CallScriptDestinationTargetSelectHandlers(SpellDestination& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
793  bool CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToCheck);
794  std::list<SpellScript*> m_loadedScripts;
795 
797  {
800  // uint8 triggeredByEffIdx This might be needed at a later stage - No need known for now
802  };
803 
804  bool CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura = NULL) const;
805  void PrepareTriggersExecutedOnHit();
806  typedef std::list<HitTriggerSpell> HitTriggerSpellList;
807  HitTriggerSpellList m_hitTriggerSpells;
808 
809  // effect helpers
810  void SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* properties, uint32 numSummons);
811  void CalculateJumpSpeeds(SpellEffectInfo const* effInfo, float dist, float& speedxy, float& speedz);
812 
813  void UpdateSpellCastDataTargets(WorldPackets::Spells::SpellCastData& data);
814 
815  SpellCastResult CanOpenLock(uint32 effIndex, uint32 lockid, SkillType& skillid, int32& reqSkillValue, int32& skillValue);
816  // -------------------------------------------
817 
820 
822 
823  // if need this can be replaced by Aura copy
824  // we can't store original aura link to prevent access to deleted auras
825  // and in same time need aura data and after aura deleting.
827 
831 
832  std::vector<SpellLogEffectPowerDrainParams> _powerDrainTargets[MAX_SPELL_EFFECTS];
833  std::vector<SpellLogEffectExtraAttacksParams> _extraAttacksTargets[MAX_SPELL_EFFECTS];
834  std::vector<SpellLogEffectDurabilityDamageParams> _durabilityDamageTargets[MAX_SPELL_EFFECTS];
835  std::vector<SpellLogEffectGenericVictimParams> _genericVictimTargets[MAX_SPELL_EFFECTS];
836  std::vector<SpellLogEffectTradeSkillItemParams> _tradeSkillTargets[MAX_SPELL_EFFECTS];
837  std::vector<SpellLogEffectFeedPetParams> _feedPetTargets[MAX_SPELL_EFFECTS];
838 
839 #ifdef MAP_BASED_RAND_GEN
840  int32 irand(int32 min, int32 max) { return int32 (m_caster->GetMap()->mtRand.randInt(max - min)) + min; }
841  uint32 urand(uint32 min, uint32 max) { return m_caster->GetMap()->mtRand.randInt(max - min) + min; }
842  int32 rand32() { return m_caster->GetMap()->mtRand.randInt(); }
843  double rand_norm() { return m_caster->GetMap()->mtRand.randExc(); }
844  double rand_chance() { return m_caster->GetMap()->mtRand.randExc(100.0); }
845 #endif
846 
847  Spell(Spell const& right) = delete;
848  Spell& operator=(Spell const& right) = delete;
849 
851 };
852 
853 namespace Trinity
854 {
856  {
863 
864  WorldObjectSpellTargetCheck(Unit* caster, Unit* referer, SpellInfo const* spellInfo,
865  SpellTargetCheckTypes selectionType, ConditionContainer* condList);
867  bool operator()(WorldObject* target);
868  };
869 
871  {
872  float _range;
874  WorldObjectSpellNearbyTargetCheck(float range, Unit* caster, SpellInfo const* spellInfo,
875  SpellTargetCheckTypes selectionType, ConditionContainer* condList);
876  bool operator()(WorldObject* target);
877  };
878 
880  {
881  float _range;
883  WorldObjectSpellAreaTargetCheck(float range, Position const* position, Unit* caster,
884  Unit* referer, SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer* condList);
885  bool operator()(WorldObject* target);
886  };
887 
889  {
890  float _coneAngle;
891  WorldObjectSpellConeTargetCheck(float coneAngle, float range, Unit* caster,
892  SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer* condList);
893  bool operator()(WorldObject* target);
894  };
895 
897  {
898  WorldObjectSpellTrajTargetCheck(float range, Position const* position, Unit* caster, SpellInfo const* spellInfo);
899  bool operator()(WorldObject* target);
900  };
901 }
902 
903 typedef void(Spell::*pEffect)(SpellEffIndex effIndex);
904 
906 {
907  public:
908  SpellEvent(Spell* spell);
909  virtual ~SpellEvent();
910 
911  virtual bool Execute(uint64 e_time, uint32 p_time) override;
912  virtual void Abort(uint64 e_time) override;
913  virtual bool IsDeletable() const override;
914  protected:
916 };
917 #endif
bool isDelayableNoMore()
Definition: Spell.h:668
GameObject * focusObject
Definition: Spell.h:706
Definition: Object.h:95
Definition: SpellAuraEffects.h:30
uint32 m_itemTargetEntry
Definition: Spell.h:256
Definition: Spell.h:276
Definition: Spell.h:60
uint32 NumAttacks
Definition: Spell.h:145
Definition: Spell.h:280
GameObject * gameObjTarget
Definition: Spell.h:692
SpellInfo const *const m_spellInfo
Definition: Spell.h:547
Unit *const m_caster
Definition: Spell.h:647
uint32 m_spellState
Definition: Spell.h:818
Definition: Spell.h:71
SpellInfo const * _spellInfo
Definition: Spell.h:859
Difficulty
Definition: DBCEnums.h:402
Definition: Corpse.h:49
Definition: Spell.h:160
Definition: Spell.h:281
Definition: Spell.h:99
std::vector< SpellInfo::CostData > GetPowerCost() const
Definition: Spell.h:615
uint64 timeDelay
Definition: Spell.h:729
Definition: Position.h:228
Definition: Spell.h:93
SpellEffectInfo const * effectInfo
Definition: Spell.h:697
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: ByteBuffer.h:70
float _range
Definition: Spell.h:881
int8_t int8
Definition: Define.h:148
Definition: Spell.h:114
Definition: Spell.h:108
static void var(TextOutput &t, const std::string &name, const std::string &val)
Definition: System.cpp:1582
Position _transportOffset
Definition: Spell.h:130
bool processed
Definition: Spell.h:747
Definition: Spell.h:67
SpellCastFlags
Definition: Spell.h:49
uint32 m_channelTargetEffectMask
Definition: Spell.h:740
Map * GetMap() const
Definition: Object.h:543
int32 m_casttime
Definition: Spell.h:660
Definition: Spell.h:54
DiminishingLevels m_diminishLevel
Definition: Spell.h:702
int8 m_comboPointGain
Definition: Spell.h:585
Definition: Spell.h:104
void SetCurrentCastSpell(Spell *pSpell)
Definition: Unit.cpp:2773
bool m_canReflect
Definition: Spell.h:662
Definition: Spell.h:70
CurrentSpellTypes
Definition: Unit.h:1106
Points
Definition: ScriptedEscortAI.cpp:31
SpellInfo const * GetTriggeredByAuraSpell() const
Definition: Spell.h:636
SpellSchoolMask
Definition: SharedDefines.h:285
SpellCastFlagsEx
Definition: Spell.h:86
SpellCustomErrors
Definition: SharedDefines.h:1541
Definition: SpellInfo.h:326
SpellDestination m_src
Definition: Spell.h:258
Unit * GetCaster() const
Definition: Spell.h:612
Definition: Spell.h:55
~TargetInfo()
Definition: Spell.h:727
Unit * _caster
Definition: Spell.h:857
float Amplitude
Definition: Spell.h:139
uint32 getState() const
Definition: Spell.h:509
float m_speed
Definition: Spell.h:261
uint64 m_delayStart
Definition: Spell.h:678
SpellCastTargets m_targets
Definition: Spell.h:584
UsedSpellMods m_appliedMods
Definition: Spell.h:588
WorldLocation _position
Definition: Spell.h:128
Definition: Spell.h:59
Position const * _position
Definition: Spell.h:882
Definition: Spell.h:90
Spells
Definition: BattlegroundIC.h:707
Definition: Spell.h:96
std::list< SpellScript * > m_loadedScripts
Definition: Spell.h:794
uint32 MaxAffectedTargets
Definition: Spell.h:269
Item * GetItemTarget() const
Definition: Spell.h:203
Definition: Spell.h:63
Definition: Spell.h:58
void(Spell::* pEffect)(SpellEffIndex effIndex)
Definition: Spell.h:903
Definition: SpellInfo.h:53
uint32 m_SpellVisual
Definition: Spell.h:582
SpellInfo const * m_triggeredByAuraSpell
Definition: Spell.h:826
SpellValueMod
Definition: Unit.h:127
int32 CalculateDamage(uint8 i, Unit const *target, float *var=nullptr) const
Definition: Spell.h:504
ObjectGuid Victim
Definition: Spell.h:136
Definition: Spell.h:56
Definition: SpellScript.h:152
SpellEffectName
Definition: SharedDefines.h:1009
uint32 effectMask
Definition: Spell.h:732
Position const * _position
Definition: Spell.h:873
bool IsAutoRepeat() const
Definition: Spell.h:591
SpellTargetObjectTypes
Definition: SpellInfo.h:102
DiminishingGroup
Definition: SharedDefines.h:4369
ObjectGuid m_objectTargetGUID
Definition: Spell.h:254
bool m_skipCheck
Definition: Spell.h:828
Definition: Spell.h:75
bool IsInterruptable() const
Definition: Spell.h:602
void setState(uint32 state)
Definition: Spell.h:510
SpellEffectInfo const * GetEffect(uint32 index) const
Definition: Spell.h:624
uint32 ItemId
Definition: Spell.h:575
float GetDist2d() const
Definition: Spell.h:237
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: Spell.h:69
virtual void Abort(uint64)
Definition: EventProcessor.h:46
Definition: Spell.h:265
Will ignore most target checks (mostly DBC target checks)
Definition: Unit.h:479
uint32 m_castItemEntry
Definition: Spell.h:550
WorldLocation * destTarget
Definition: Spell.h:693
ObjectGuid targetGUID
Definition: Spell.h:744
SpellEffectHandleMode
Definition: Spell.h:284
Definition: Spell.h:53
ObjectGuid Victim
Definition: Spell.h:144
Definition: Object.h:423
int32 ItemID
Definition: Spell.h:167
Definition: Spell.h:72
int32 m_timer
Definition: Spell.h:819
bool m_immediateHandled
Definition: Spell.h:680
Item * m_CastItem
Definition: Spell.h:548
bool IsChannelActive() const
Definition: Spell.h:597
SpellValue *const m_spellValue
Definition: Spell.h:649
Will ignore GCD.
Definition: Unit.h:462
ObjectGuid targetGUID
Definition: Spell.h:728
Definition: Spell.h:742
bool HasSrc() const
Definition: Spell.h:228
std::string GetTargetString() const
Definition: Spell.h:243
int32 GetTimer() const
Definition: Spell.h:638
uint32 m_auraScaleMask
Definition: Spell.h:829
Definition: Opcodes.h:872
void CheckSrc()
Definition: Spell.h:518
double rand_chance()
Definition: Random.cpp:74
T max(const T &x, const T &y)
Definition: g3dmath.h:320
ObjectGuid m_origObjectTargetGUID
Definition: Spell.h:253
uint64 GetDelayMoment() const
Definition: Spell.h:606
void SetExecutedCurrently(bool yes)
Definition: Spell.h:603
uint32 m_procVictim
Definition: Spell.h:716
SpellInfo const * triggeredSpell
Definition: Spell.h:798
bool m_autoRepeat
Definition: Spell.h:663
SpellEffectInfoVector _effects
Definition: Spell.h:850
bool HasTraj() const
Definition: Spell.h:230
Definition: SharedDefines.h:1543
float _range
Definition: Spell.h:872
Aura * m_spellAura
Definition: Spell.h:699
int32 irand(int32 min, int32 max)
Definition: Random.cpp:39
Definition: DynamicObject.h:35
void SetPitch(float pitch)
Definition: Spell.h:233
ObjectGuid Victim
Definition: Spell.h:150
Definition: Spell.h:751
Definition: Spell.h:155
std::vector< TargetInfo > m_UniqueTargetInfo
Definition: Spell.h:739
Definition: Spell.h:118
SpellDestination m_dst
Definition: Spell.h:259
T min(const T &x, const T &y)
Definition: g3dmath.h:305
SpellInfo const * triggeredByAura
Definition: Spell.h:799
Definition: Spell.h:77
uint8 AuraStackAmount
Definition: Spell.h:271
std::vector< SpellEffectInfo const * > SpellEffectInfoVector
Definition: SpellInfo.h:315
std::vector< ItemTargetInfo > m_UniqueItemInfo
Definition: Spell.h:756
Definition: Spell.h:289
int finish(const char *message, int returnValue)
Definition: PathGenerator.cpp:236
Unit * unitTarget
Definition: Spell.h:690
ObjectGuid _transportGUID
Definition: Spell.h:129
Unit * m_originalCaster
Definition: Spell.h:653
Definition: Spell.h:288
int32 damage
Definition: Spell.h:694
Item * m_itemTarget
Definition: Spell.h:250
Definition: Spell.h:78
ObjectGuid m_castItemGUID
Definition: Spell.h:549
bool HasDst() const
Definition: Spell.h:229
PathGenerator m_preGeneratedPath
Definition: Spell.h:830
Definition: Spell.h:88
LootType
Definition: LootMgr.h:86
Definition: Spell.h:113
OpcodeServer
Definition: Opcodes.h:725
Definition: Spell.h:287
ConditionSourceInfo * _condSrcInfo
Definition: Spell.h:861
G3D::int16 z
Definition: Vector3int16.h:46
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Definition: Spell.h:134
Definition: Item.h:259
HitTriggerSpellList m_hitTriggerSpells
Definition: Spell.h:807
Definition: Spell.h:92
TriggerCastFlags
Definition: Unit.h:458
Definition: Spell.h:103
int32 ItemID
Definition: Spell.h:162
Definition: Spell.h:68
Unit * GetOriginalCaster() const
Definition: Spell.h:613
uint64 m_delayMoment
Definition: Spell.h:679
uint32 GetItemTargetEntry() const
Definition: Spell.h:204
SpellEffIndex
Definition: SharedDefines.h:26
Definition: Spell.h:165
Definition: Spell.h:79
bool IsTriggered() const
Definition: Spell.h:595
Definition: SpellInfo.h:238
uint32 AbilityId
Definition: Spell.h:568
Vector2int16 & operator=(const Any &a)
int32_t int32
Definition: Define.h:146
uint32 m_targetMask
Definition: Spell.h:246
uint32_t uint32
Definition: Define.h:150
uint32 m_procAttacker
Definition: Spell.h:715
uint64_t uint64
Definition: Define.h:149
int32 Amount
Definition: Spell.h:152
Definition: Spell.h:278
std::set< Aura * > UsedSpellMods
Definition: Spell.h:443
G3D::int16 y
Definition: Vector2int16.h:38
Definition: Spell.h:106
Definition: ConditionMgr.h:181
uint64 GetDelayStart() const
Definition: Spell.h:604
Definition: Spell.h:65
SpellInfo const * GetSpellInfo() const
Definition: Spell.h:614
Item * itemTarget
Definition: Spell.h:691
Definition: GameObject.h:880
SpellMissInfo
Definition: SharedDefines.h:2019
uint32 m_preCastSpell
Definition: Spell.h:583
Definition: SpellPackets.h:223
int32 damage
Definition: Spell.h:737
Definition: Spell.h:83
int32 m_damage
Definition: Spell.h:709
Definition: Spell.h:905
Definition: PathGenerator.h:52
SpellEffectInfoVector const & GetEffects() const
Definition: Spell.h:623
int32 chance
Definition: Spell.h:801
bool m_isDelayedInstantCast
Definition: Spell.h:664
float GetSpeed() const
Definition: Spell.h:234
Definition: Spell.h:101
float variance
Definition: Spell.h:695
DiminishingLevels
Definition: SharedDefines.h:4874
Definition: SpellInfo.h:54
Definition: Spell.h:170
Definition: Spell.h:105
Definition: Spell.h:52
WeaponAttackType m_attackType
Definition: Spell.h:657
Definition: Spell.h:74
Unit * _referer
Definition: Spell.h:858
Definition: Spell.h:64
std::vector< SpellInfo::CostData > m_powerCost
Definition: Spell.h:659
int32 ItemID
Definition: Spell.h:151
uint32 m_procEx
Definition: Spell.h:717
virtual bool Execute(uint64, uint32)
Definition: EventProcessor.h:42
Definition: BattlegroundMgr.h:57
Definition: Spell.h:102
Definition: Spell.h:142
Definition: Spell.h:277
uint32 effectMask
Definition: Spell.h:746
void ReSetTimer()
Definition: Spell.h:593
Definition: Spell.h:724
Definition: Spell.h:94
std::list< HitTriggerSpell > HitTriggerSpellList
Definition: Spell.h:806
ObjectGuid m_originalCasterGUID
Definition: Spell.h:651
Definition: SpellInfo.h:207
void SetSpeed(float speed)
Definition: Spell.h:235
std::vector< GOTargetInfo > m_UniqueGOTargetInfo
Definition: Spell.h:749
Definition: Spell.h:98
Definition: EventProcessor.h:28
void SetTargetMask(uint32 newMask)
Definition: Spell.h:180
Definition: Spell.h:100
void SetDelayStart(uint64 m_time)
Definition: Spell.h:605
bool IsDeletable() const
Definition: Spell.h:600
Definition: Spell.h:107
bool m_executedCurrently
Definition: Spell.h:684
ObjectGuid Victim
Definition: Spell.h:157
double rand_norm()
Definition: Random.cpp:69
uint32 GetTargetMask() const
Definition: Spell.h:179
void SetTargetFlag(SpellCastTargetFlags flag)
Definition: Spell.h:182
Definition: Spell.h:51
void CheckDst()
Definition: Spell.h:519
std::list< std::pair< uint32, ObjectGuid > > DispelList
Definition: Spell.h:292
#define TC_GAME_API
Definition: Define.h:134
Definition: Spell.h:62
uint8 m_runesState
Definition: Spell.h:665
float GetSpeedZ() const
Definition: Spell.h:239
float RadiusMod
Definition: Spell.h:270
SpellRangeFlag
Definition: Spell.h:111
int32_t int32
Definition: g3dmath.h:167
uint8 m_applyMultiplierMask
Definition: Spell.h:686
uint32 rand32()
Definition: Random.cpp:64
ObjectGuid GetItemTargetGUID() const
Definition: Spell.h:202
ObjectGuid m_itemTargetGUID
Definition: Spell.h:255
Definition: SpellPackets.h:247
uint32 m_castFlagsEx
Definition: Spell.h:553
uint8_t uint8
Definition: Define.h:152
SpellValue(Difficulty diff, SpellInfo const *proto)
Definition: Spell.cpp:487
Definition: Position.h:27
#define MAPID_INVALID
Definition: Position.h:226
Definition: Spell.h:81
#define MAX_SPELL_EFFECTS
Definition: DBCStructure.h:1026
uint64 timeDelay
Definition: Spell.h:745
int32 EffectBasePoints[MAX_SPELL_EFFECTS]
Definition: Spell.h:268
uint8 m_delayAtDamageCount
Definition: Spell.h:667
Definition: UpdateFields.h:93
Item * item
Definition: Spell.h:753
Definition: Spell.h:76
SpellSchoolMask m_spellSchoolMask
Definition: Spell.h:656
WorldObject * m_objectTarget
Definition: Spell.h:249
Definition: Spell.h:115
Spell * m_Spell
Definition: Spell.h:915
SpellCastResult
Definition: SharedDefines.h:1265
int32 m_channeledDuration
Definition: Spell.h:661
SkillType
Definition: SharedDefines.h:3881
const FieldDescriptor value
Definition: descriptor.h:1522
DiminishingGroup m_diminishGroup
Definition: Spell.h:703
int32 m_castItemLevel
Definition: Spell.h:551
SpellTargetCheckTypes
Definition: SpellInfo.h:118
ConditionContainer * _condList
Definition: Spell.h:862
Definition: ObjectGuid.h:189
void SetReferencedFromCurrent(bool yes)
Definition: Spell.h:601
Definition: Common.h:172
Definition: Spell.h:97
SpellCustomErrors m_customError
Definition: Spell.h:586
G3D::int16 x
Definition: Vector2int16.h:37
virtual bool IsDeletable() const
Definition: EventProcessor.h:44
float GetSpeedXY() const
Definition: Spell.h:238
bool IsIgnoringCooldowns() const
Definition: Spell.h:596
uint32 effectMask
Definition: Spell.h:754
SpellState
Definition: Spell.h:274
uint32 GlyphSlot
Definition: Spell.h:558
Definition: Spell.h:80
Definition: SpellAuras.h:116
uint8 m_cast_count
Definition: Spell.h:552
uint32 TalentId
Definition: Spell.h:557
SpellTargetCheckTypes _targetSelectionType
Definition: Spell.h:860
std::vector< Condition * > ConditionContainer
Definition: ConditionMgr.h:239
TriggerCastFlags _triggeredCastFlags
Definition: Spell.h:821
WeaponAttackType
Definition: Unit.h:615
Spell ** m_selfContainer
Definition: Spell.h:634
Definition: SpellPackets.h:339
int32 GetCastTime() const
Definition: Spell.h:590
Definition: Unit.h:1305
Definition: Spell.h:66
Definition: Spell.h:796
uint32 Id
Definition: Spell.h:567
int32 m_healing
Definition: Spell.h:710
void SetAutoRepeat(bool rep)
Definition: Spell.h:592
SpellCastTargetFlags
Definition: SpellInfo.h:45
Definition: Spell.h:279
Definition: Spell.h:89
bool m_referencedFromCurrentSpell
Definition: Spell.h:683
bool m_needComboPoints
Definition: Spell.h:685
Definition: Spell.h:82
Definition: Spell.h:73
Data
Definition: molten_core.h:69
std::string m_strTarget
Definition: Spell.h:262
void Update(uint32 diff)
Definition: WeatherMgr.cpp:150
PowerType
Definition: VehicleDefines.h:28
Definition: Spell.h:91
float GetPitch() const
Definition: Spell.h:232
Definition: Spell.h:57
float _coneAngle
Definition: Spell.h:890
Definition: DBCStructure.h:1242
Definition: Spell.h:61
SpellEffectHandleMode effectHandleMode
Definition: Spell.h:696
Definition: Spell.h:286
Definition: Spell.h:95
uint32 GarrMissionId
Definition: Spell.h:572
Definition: Spell.h:294