Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
SpellAuraState.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
6#include "Battlefield.h"
7#include "BattlefieldMgr.h"
8#include "Battleground.h"
9#include "CellImpl.h"
10#include "Common.h"
11#include "Formulas.h"
12#include "GridNotifiers.h"
13#include "GridNotifiersImpl.h"
14#include "Log.h"
15#include "ObjectAccessor.h"
16#include "ObjectMgr.h"
17#include "Opcodes.h"
18#include "OutdoorPvPMgr.h"
19#include "Pet.h"
20#include "Player.h"
21#include "ReputationMgr.h"
22#include "ScriptMgr.h"
23#include "Spell.h"
24#include "SpellAuraEffects.h"
25#include "SpellAuraMetadata.h"
26#include "SpellMgr.h"
27#include "SpellValidation.h"
28#include "Unit.h"
29#include "Util.h"
30#include "Vehicle.h"
31#include "WeatherMgr.h"
32#include "WorldPacket.h"
33
34class Aura;
35
36void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
37{
41
44 spellIds[spellCount++] = Skyfire::Spells::GetShadowFocusTriggeredSpellId();
45
46 if (apply)
47 {
48 // Remove cooldown of spells triggered on stance change - they may share cooldown with stance spell
49 for (uint8 i = 0; i < spellCount; ++i)
50 {
51 uint32 spellId = spellIds[i];
52 if (!spellId)
53 continue;
54
55 if (target->GetTypeId() == TypeID::TYPEID_PLAYER)
56 target->ToPlayer()->RemoveSpellCooldown(spellId);
57 target->CastSpell(target, spellId, true, NULL, this);
58 }
59
60 if (target->GetTypeId() == TypeID::TYPEID_PLAYER)
61 {
62 Player* plrTarget = target->ToPlayer();
63
64 PlayerSpellMap const& sp_list = plrTarget->GetSpellMap();
65 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
66 {
67 if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled)
68 continue;
69
70 bool isShapeshiftBoostSpell = false;
71 for (uint8 i = 0; i < spellCount; ++i)
72 {
73 if (itr->first == spellIds[i])
74 {
75 isShapeshiftBoostSpell = true;
76 break;
77 }
78 }
79
80 if (isShapeshiftBoostSpell)
81 continue;
82
83 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
84 if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE)))
85 continue;
86
87 if ((spellInfo->AttributesEx8 & SPELL_ATTR8_MASTERY_SPECIALIZATION) && !plrTarget->IsCurrentSpecMasterySpell(spellInfo))
88 continue;
89
90 if (spellInfo->Stances & (1 << (GetMiscValue() - 1)))
91 target->CastSpell(target, itr->first, true, NULL, this);
92 }
93
94 // Also do it for Glyphs
95 for (uint32 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i)
96 {
97 if (uint32 glyphId = plrTarget->GetGlyph(plrTarget->GetActiveSpec(), i))
98 {
99 if (GlyphPropertiesEntry const* glyph = sGlyphPropertiesStore.LookupEntry(glyphId))
100 {
101 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellId);
102 if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE)))
103 continue;
104
105 if (spellInfo->Stances & (1 << (GetMiscValue() - 1)))
106 target->CastSpell(target, glyph->SpellId, true, NULL, this);
107 }
108 }
109 }
110
111 // Leader of the Pack
113 {
115 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggeredSpellId);
116 if (spellInfo && spellInfo->Stances & (1 << (GetMiscValue() - 1)))
117 target->CastSpell(target, triggeredSpellId, true, NULL, this);
118 }
119
120 switch (GetMiscValue())
121 {
122 case FORM_CAT:
123 // Nurturing Instinct
125 {
127 target->CastSpell(target, spellId, true, NULL, this);
128 }
129 default:
130 break;
131 }
132 }
133 }
134 else
135 {
136 for (uint8 i = 0; i < spellCount; ++i)
137 if (spellIds[i])
138 target->RemoveOwnedAura(spellIds[i], target->GetGUID());
139
141 AuraEffect* newAura = NULL;
142 // Iterate through all the shapeshift auras that the target has, if there is another aura with SPELL_AURA_MOD_SHAPESHIFT, then this aura is being removed due to that one being applied
143 for (Unit::AuraEffectList::const_iterator itr = shapeshifts.begin(); itr != shapeshifts.end(); ++itr)
144 {
145 if ((*itr) != this)
146 {
147 newAura = *itr;
148 break;
149 }
150 }
151
152 Unit::AuraApplicationMap& tAuras = target->GetAppliedAuras();
153 for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
154 {
155 // Use the new aura to see on what stance the target will be
156 uint32 newStance = (1 << ((newAura ? newAura->GetMiscValue() : 0) - 1));
157
158 // If the stances are not compatible with the spell, remove it
159 if (itr->second->GetBase()->IsRemovedOnShapeLost(target) && !(itr->second->GetBase()->GetSpellInfo()->Stances & newStance))
160 target->RemoveAura(itr);
161 else
162 ++itr;
163 }
164 }
165}
166
167/*********************************************************/
168/*** AURA EFFECT HANDLERS ***/
169/*********************************************************/
170
171/**************************************/
172/*** VISIBILITY & PHASES ***/
173/**************************************/
174
175void AuraEffect::HandleModInvisibilityDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const
176{
178 return;
179
180 Unit* target = aurApp->GetTarget();
182
183 if (apply)
184 {
185 target->m_invisibilityDetect.AddFlag(type);
186 target->m_invisibilityDetect.AddValue(type, GetAmount());
187 }
188 else
189 {
191 target->m_invisibilityDetect.DelFlag(type);
192
193 target->m_invisibilityDetect.AddValue(type, -GetAmount());
194 }
195
196 // call functions which may have additional effects after chainging state of unit
197 target->UpdateObjectVisibility();
198}
199
200void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode, bool apply) const
201{
203 return;
204
205 Unit* target = aurApp->GetTarget();
207
208 if (apply)
209 {
210 // apply glow vision
211 //if (target->GetTypeId() == TYPEID_PLAYER)
212 // target->SetByteFlag(PLAYER_FIELD_LIFETIME_MAX_RANK2, 3, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
213
214 target->m_invisibility.AddFlag(type);
215 target->m_invisibility.AddValue(type, GetAmount());
216 }
217 else
218 {
220 {
221 // if not have different invisibility auras.
222 // remove glow vision
223 // if (target->GetTypeId() == TYPEID_PLAYER)
224 // target->RemoveByteFlag(PLAYER_FIELD_LIFETIME_MAX_RANK2, 3, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
225
226 target->m_invisibility.DelFlag(type);
227 }
228 else
229 {
230 bool found = false;
232 for (Unit::AuraEffectList::const_iterator i = invisAuras.begin(); i != invisAuras.end(); ++i)
233 {
234 if (GetMiscValue() == (*i)->GetMiscValue())
235 {
236 found = true;
237 break;
238 }
239 }
240 if (!found)
241 target->m_invisibility.DelFlag(type);
242 }
243
244 target->m_invisibility.AddValue(type, -GetAmount());
245 }
246
247 // call functions which may have additional effects after chainging state of unit
248 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
249 {
250 // drop flag at invisibiliy in bg
252 }
253 target->UpdateObjectVisibility();
254}
255
256void AuraEffect::HandleModStealthDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const
257{
259 return;
260
261 Unit* target = aurApp->GetTarget();
263
264 if (apply)
265 {
266 target->m_stealthDetect.AddFlag(type);
267 target->m_stealthDetect.AddValue(type, GetAmount());
268 }
269 else
270 {
272 target->m_stealthDetect.DelFlag(type);
273
274 target->m_stealthDetect.AddValue(type, -GetAmount());
275 }
276
277 // call functions which may have additional effects after chainging state of unit
278 target->UpdateObjectVisibility();
279}
280
281void AuraEffect::HandleModStealth(AuraApplication const* aurApp, uint8 mode, bool apply) const
282{
284 return;
285
286 Unit* target = aurApp->GetTarget();
288
289 if (apply)
290 {
291 target->m_stealth.AddFlag(type);
292 target->m_stealth.AddValue(type, GetAmount());
293
295 //if (target->GetTypeId() == TYPEID_PLAYER)
296 // target->SetByteFlag(PLAYER_FIELD_LIFETIME_MAX_RANK2, 3, PLAYER_FIELD_BYTE2_STEALTH);
297 }
298 else
299 {
300 target->m_stealth.AddValue(type, -GetAmount());
301
302 if (!target->HasAuraType(SPELL_AURA_MOD_STEALTH)) // if last SPELL_AURA_MOD_STEALTH
303 {
304 target->m_stealth.DelFlag(type);
305
307 //if (target->GetTypeId() == TYPEID_PLAYER)
308 // target->RemoveByteFlag(PLAYER_FIELD_LIFETIME_MAX_RANK2, 3, PLAYER_FIELD_BYTE2_STEALTH);
309 }
310 }
311
312 // call functions which may have additional effects after chainging state of unit
313 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
314 {
315 // drop flag at stealth in bg
317 }
318 target->UpdateObjectVisibility();
319}
320
321void AuraEffect::HandleModStealthLevel(AuraApplication const* aurApp, uint8 mode, bool apply) const
322{
324 return;
325
326 Unit* target = aurApp->GetTarget();
328
329 if (apply)
330 target->m_stealth.AddValue(type, GetAmount());
331 else
332 target->m_stealth.AddValue(type, -GetAmount());
333
334 // call functions which may have additional effects after chainging state of unit
335 target->UpdateObjectVisibility();
336}
337
338void AuraEffect::HandleSpiritOfRedemption(AuraApplication const* aurApp, uint8 mode, bool apply) const
339{
340 if (!(mode & AURA_EFFECT_HANDLE_REAL))
341 return;
342
343 Unit* target = aurApp->GetTarget();
344
345 if (target->GetTypeId() != TypeID::TYPEID_PLAYER)
346 return;
347
348 // prepare spirit state
349 if (apply)
350 {
351 if (target->GetTypeId() == TypeID::TYPEID_PLAYER)
352 {
353 // disable breath/etc timers
354 target->ToPlayer()->StopMirrorTimers();
355
356 // set stand state (expected in this form)
357 if (!target->IsStandState())
359 }
360
361 target->SetHealth(1);
362 }
363 // die at aura end
364 else if (target->IsAlive())
365 // call functions which may have additional effects after chainging state of unit
367}
368
395
396void AuraEffect::HandlePhase(AuraApplication const* aurApp, uint8 mode, bool apply) const
397{
398 if (!(mode & AURA_EFFECT_HANDLE_REAL))
399 return;
400
401 Unit* target = aurApp->GetTarget();
402
403 target->SetPhased(GetMiscValueB(), false, apply);
404
405 // call functions which may have additional effects after chainging state of unit
406 // phase auras normally not expected at BG but anyway better check
407 if (apply)
408 {
409 // drop flag at invisibiliy in bg
411 }
412
413 if (Player* player = target->ToPlayer())
414 player->UpdatePhasing();
415 // need triggering visibility update base at phase update of not GM invisible (other GMs anyway see in any phases)
416 if (target->IsVisible())
417 target->UpdateObjectVisibility();
418}
419
420void AuraEffect::HandlePhaseGroup(AuraApplication const* aurApp, uint8 mode, bool apply) const
421{
422 if (!(mode & AURA_EFFECT_HANDLE_REAL))
423 return;
424
425 Unit* target = aurApp->GetTarget();
426
427 std::set<uint32> const& phases = GetPhasesForGroup(GetMiscValueB());
428 for (auto phase : phases)
429 target->SetPhased(phase, false, apply);
430
431 // call functions which may have additional effects after chainging state of unit
432 // phase auras normally not expected at BG but anyway better check
433 if (apply)
434 {
435 // drop flag at invisibiliy in bg
437 }
438
439 if (Player* player = target->ToPlayer())
440 player->UpdatePhasing();
441
442 // need triggering visibility update base at phase update of not GM invisible (other GMs anyway see in any phases)
443 if (target->IsVisible())
444 target->UpdateObjectVisibility();
445}
446
447/**********************/
448/*** UNIT MODEL ***/
449/**********************/
450
451void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mode, bool apply) const
452{
453 if (!(mode & AURA_EFFECT_HANDLE_REAL))
454 return;
455
456 Unit* target = aurApp->GetTarget();
457
458 uint32 modelid = 0;
461
462 switch (form)
463 {
464 case FORM_CAT: // 0x01
465 case FORM_GHOUL: // 0x07
466
467 case FORM_STURDY_OX: // 0x17
468 case FORM_FIERCE_TIGER: // 0x18
470 break;
471
472 case FORM_BEAR: // 0x05
473
474 case FORM_BATTLESTANCE: // 0x11
475 case FORM_DEFENSIVESTANCE: // 0x12
476 case FORM_BERSERKERSTANCE: // 0x13
478 break;
479
480 case FORM_TREE: // 0x02
481 case FORM_TRAVEL: // 0x03
482 case FORM_AQUA: // 0x04
483 case FORM_AMBIENT: // 0x06
484
485 case FORM_STEVES_GHOUL: // 0x09
486 case FORM_THARONJA_SKELETON: // 0x0A
487 case FORM_TEST_OF_STRENGTH: // 0x0B
488 case FORM_BLB_PLAYER: // 0x0C
489 case FORM_SHADOW_DANCE: // 0x0D
490 case FORM_CREATUREBEAR: // 0x0E
491 case FORM_CREATURECAT: // 0x0F
492 case FORM_GHOSTWOLF: // 0x10
493
494 case FORM_WISE_SERPENT: // 0x14
495 case FORM_ZOMBIE: // 0x15
496 case FORM_METAMORPHOSIS: // 0x16
497 case FORM_UNDEAD: // 0x19
498 case FORM_MASTER_ANGLER: // 0x1A
499 case FORM_FLIGHT_EPIC: // 0x1B
500 case FORM_SHADOW: // 0x1C
501 case FORM_FLIGHT: // 0x1D
502 case FORM_STEALTH: // 0x1E
503 case FORM_MOONKIN: // 0x1F
504 case FORM_SPIRITOFREDEMPTION: // 0x20
505 break;
506 default:
507 SF_LOG_ERROR("spells", "Auras: Unknown Shapeshift Type: %u", GetMiscValue());
508 }
509
510 modelid = target->GetModelForForm(form);
511
512 if (apply)
513 {
514 // remove polymorph before changing display id to keep new display id
515 switch (form)
516 {
517 case FORM_CAT:
518 case FORM_TREE:
519 case FORM_TRAVEL:
520 case FORM_AQUA:
521 case FORM_BEAR:
522 case FORM_FLIGHT_EPIC:
523 case FORM_FLIGHT:
524 case FORM_MOONKIN:
525 {
526 // remove movement affects
528
529 // and polymorphic affects
530 if (target->IsPolymorphed())
531 target->RemoveAurasDueToSpell(target->getTransForm());
532 break;
533 }
534 default:
535 break;
536 }
537
538 // remove other shapeshift before applying a new one
540
541 // stop handling the effect if it was removed by linked event
542 if (aurApp->GetRemoveMode())
543 return;
544
545 if (modelid > 0)
546 target->SetDisplayId(modelid);
547
548 if (PowerType != POWER_MANA)
549 {
550 int32 oldPower = target->GetPower(PowerType);
551 // reset power to default values only at power change
552 if (target->getPowerType() != PowerType)
553 target->setPowerType(PowerType);
554
555 if (form == FORM_CAT || form == FORM_BEAR)
556 {
557 if (form == FORM_CAT)
558 {
559 target->SetPower(POWER_ENERGY, 0);
560 }
561 else
562 {
563 target->CastSpell(target, 17057, true);
564 }
565 }
566 }
567 // stop handling the effect if it was removed by linked event
568 if (aurApp->GetRemoveMode())
569 return;
570
571 target->SetShapeshiftForm(form);
572 }
573 else
574 {
575 // reset model id if no other auras present
576 // may happen when aura is applied on linked event on aura removal
578 {
580 if (target->getClass() == CLASS_DRUID)
581 {
582 target->setPowerType(POWER_MANA);
583 // Remove movement impairing effects also when shifting out
585 }
586 }
587
588 if (modelid > 0)
589 target->RestoreDisplayId();
590
591 switch (form)
592 {
593 // Nordrassil Harness - bonus
594 case FORM_BEAR:
595 case FORM_CAT:
596 if (AuraEffect* dummy = target->GetAuraEffect(37315, 0))
597 target->CastSpell(target, 37316, true, NULL, dummy);
598 break;
599 // Nordrassil Regalia - bonus
600 case FORM_MOONKIN:
601 if (AuraEffect* dummy = target->GetAuraEffect(37324, 0))
602 target->CastSpell(target, 37325, true, NULL, dummy);
603 break;
604 default:
605 break;
606 }
607 }
608
609 // adding/removing linked auras
610 // add/remove the shapeshift aura's boosts
611 HandleShapeshiftBoosts(target, apply);
612
613 if (target->GetTypeId() == TypeID::TYPEID_PLAYER)
614 target->ToPlayer()->InitDataForForm();
615
616 if (target->getClass() == CLASS_DRUID)
617 {
618 // Disarm handling
619 // If druid shifts while being disarmed we need to deal with that since forms aren't affected by disarm
620 // and also HandleAuraModDisarm is not triggered
622 {
624 target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, pItem->GetTemplate(), NULL, apply);
625 }
626 }
627
628 // stop handling the effect if it was removed by linked event
629 if (apply && aurApp->GetRemoveMode())
630 return;
631
632 if (target->GetTypeId() == TypeID::TYPEID_PLAYER)
633 {
634 SpellShapeshiftFormEntry const* shapeInfo = sSpellShapeshiftFormStore.LookupEntry(form);
635 // Learn spells for shapeshift form - no need to send action bars or add spells to spellbook
636 for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i)
637 {
638 if (!shapeInfo->stanceSpell[i])
639 continue;
640 if (apply)
641 target->ToPlayer()->AddTemporarySpell(shapeInfo->stanceSpell[i]);
642 else
643 target->ToPlayer()->RemoveTemporarySpell(shapeInfo->stanceSpell[i]);
644 }
645 }
646}
647
648void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, bool apply) const
649{
651 return;
652
653 Unit* target = aurApp->GetTarget();
654
655 if (apply)
656 {
657 // update active transform spell only when transform or shapeshift not set or not overwriting negative by positive case
658 if (!target->GetModelForForm(target->GetShapeshiftForm()) || !GetSpellInfo()->IsPositive())
659 {
660 // special case (spell specific functionality)
661 if (GetMiscValue() == 0)
662 {
664 target->GetTypeId() != TypeID::TYPEID_PLAYER)
665 return;
666
667 uint8 race = target->GetTypeId() == TypeID::TYPEID_PLAYER ? target->getRace() : RACE_NONE;
668 if (uint32 displayId = Skyfire::Spells::GetTransformDisplayId(GetId(), race, target->getGender()))
669 target->SetDisplayId(displayId);
670 }
671 else
672 {
673 CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(GetMiscValue());
674 if (!ci)
675 {
677 SF_LOG_ERROR("spells", "Auras: unknown creature id = %d (only need its modelid) From Spell Aura Transform in Spell ID = %d", GetMiscValue(), GetId());
678 }
679 else
680 {
681 uint32 model_id = 0;
682
683 if (uint32 modelid = ci->GetRandomValidModelId())
684 model_id = modelid; // Will use the default model here
685
686 // Polymorph (sheep)
687 if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_MAGE && GetSpellInfo()->SpellIconID == 82 && GetSpellInfo()->SpellVisual[0] == 12978)
688 if (Unit* caster = GetCaster())
691
692 target->SetDisplayId(model_id);
693
694 // Dragonmaw Illusion (set mount model also)
696 target->GetMountID() &&
699 }
700 }
701 }
702
703 // update active transform spell only when transform or shapeshift not set or not overwriting negative by positive case
704 SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->getTransForm());
705 if (!transformSpellInfo || !GetSpellInfo()->IsPositive() || transformSpellInfo->IsPositive())
706 target->setTransForm(GetId());
707
708 // polymorph case
709 if ((mode & AURA_EFFECT_HANDLE_REAL) && target->GetTypeId() == TypeID::TYPEID_PLAYER && target->IsPolymorphed())
710 {
711 // for players, start regeneration after 1s (in polymorph fast regeneration case)
712 // only if caster is Player (after patch 2.4.2)
715
716 //dismount polymorphed target (after patch 2.4.2)
717 if (target->IsMounted())
719 }
720 }
721 else
722 {
723 // HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true) will reapply it if need
724 if (target->getTransForm() == GetId())
725 target->setTransForm(0);
726
727 target->RestoreDisplayId();
728
729 // Dragonmaw Illusion (restore mount model)
732 {
733 if (!target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).empty())
734 {
735 uint32 cr_id = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
736 if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(cr_id))
737 {
738 uint32 displayID = ObjectMgr::ChooseDisplayId(ci);
739 sObjectMgr->GetCreatureModelRandomGender(&displayID);
740
742 }
743 }
744 }
745 }
746}
747
748void AuraEffect::HandleAuraModScale(AuraApplication const* aurApp, uint8 mode, bool apply) const
749{
751 return;
752
753 Unit* target = aurApp->GetTarget();
754
755 float scale = target->GetObjectScale();
756 ApplyPercentModFloatVar(scale, float(GetAmount()), apply);
757 target->SetObjectScale(scale);
758}
759
760void AuraEffect::HandleAuraCloneCaster(AuraApplication const* aurApp, uint8 mode, bool apply) const
761{
763 return;
764
765 Unit* target = aurApp->GetTarget();
766
767 if (apply)
768 {
769 Unit* caster = GetCaster();
770 if (!caster || caster == target)
771 return;
772
773 // What must be cloned? at least display and scale
774 target->SetDisplayId(caster->GetDisplayId());
775 //target->SetObjectScale(caster->GetObjectScale()); // we need retail info about how scaling is handled (aura maybe?)
777 }
778 else
779 {
780 target->SetDisplayId(target->GetNativeDisplayId());
782 }
783}
784
785/************************/
786/*** FIGHT ***/
787/************************/
788
789void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, bool apply) const
790{
791 if (!(mode & AURA_EFFECT_HANDLE_REAL))
792 return;
793
794 Unit* target = aurApp->GetTarget();
795
796 if (apply)
797 {
798 /*
799 WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 0);
800 target->SendMessageToSet(&data, true);
801 */
802
803 UnitList targets;
804 Skyfire::AnyUnfriendlyUnitInObjectRangeCheck u_check(target, target, target->GetMap()->GetVisibilityRange());
806 target->VisitNearbyObject(target->GetMap()->GetVisibilityRange(), searcher);
807 for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
808 {
809 if (!(*iter)->HasUnitState(UNIT_STATE_CASTING))
810 continue;
811
813 {
814 if ((*iter)->GetCurrentSpell(i)
815 && (*iter)->GetCurrentSpell(i)->m_targets.GetUnitTargetGUID() == target->GetGUID())
816 {
817 (*iter)->InterruptSpell(CurrentSpellTypes(i), false);
818 }
819 }
820 }
821 target->CombatStop();
823
824 // prevent interrupt message
825 if (GetCasterGUID() == target->GetGUID() && target->GetCurrentSpell(CURRENT_GENERIC_SPELL))
826 target->FinishSpell(CURRENT_GENERIC_SPELL, false);
827 target->InterruptNonMeleeSpells(true);
829
830 // stop handling the effect if it was removed by linked event
831 if (aurApp->GetRemoveMode())
832 return;
833
834 target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_POWERS); // blizz like 2.0.x
835 target->SetFlag(UNIT_FIELD_FLAGS2, UNIT_FLAG2_FEIGN_DEATH); // blizz like 2.0.x
836 target->SetFlag(OBJECT_FIELD_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); // blizz like 2.0.x
838
839 if (Creature* creature = target->ToCreature())
840 creature->SetReactState(REACT_PASSIVE);
841 }
842 else
843 {
844 /*
845 WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 0);
846 target->SendMessageToSet(&data, true);
847 */
848
849 target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_POWERS); // blizz like 2.0.x
850 target->RemoveFlag(UNIT_FIELD_FLAGS2, UNIT_FLAG2_FEIGN_DEATH); // blizz like 2.0.x
851 target->RemoveFlag(OBJECT_FIELD_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); // blizz like 2.0.x
853
854 if (Creature* creature = target->ToCreature())
855 creature->InitializeReactState();
856 }
857}
858
859void AuraEffect::HandleModUnattackable(AuraApplication const* aurApp, uint8 mode, bool apply) const
860{
862 return;
863
864 Unit* target = aurApp->GetTarget();
865
866 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
867 if (!apply && target->HasAuraType(SPELL_AURA_MOD_UNATTACKABLE))
868 return;
869
871
872 // call functions which may have additional effects after chainging state of unit
873 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
874 {
875 target->CombatStop();
877 }
878}
879
880void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, bool apply) const
881{
882 if (!(mode & AURA_EFFECT_HANDLE_REAL))
883 return;
884
885 Unit* target = aurApp->GetTarget();
886
887 AuraType type = GetAuraType();
888
889 // Prevent handling aura twice
890 if (apply ? target->GetAuraEffectsByType(type).size() > 1 : target->HasAuraType(type))
891 return;
892
893 uint32 field, flag, slot;
894 WeaponAttackType attType;
895 switch (type)
896 {
898 field = UNIT_FIELD_FLAGS;
899 flag = UNIT_FLAG_DISARMED;
902 break;
904 field = UNIT_FIELD_FLAGS2;
908 break;
910 field = UNIT_FIELD_FLAGS2;
914 break;
915 default:
916 return;
917 }
918
919 // if disarm aura is to be removed, remove the flag first to reapply damage/aura mods
920 if (!apply)
921 target->RemoveFlag(field, flag);
922
923 // Handle damage modification, shapeshifted druids are not affected
924 if (target->GetTypeId() == TypeID::TYPEID_PLAYER && !target->IsInFeralForm())
925 {
926 Player* player = target->ToPlayer();
927 if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
928 {
929 WeaponAttackType attacktype = Player::GetAttackBySlot(slot);
930
931 if (attacktype < WeaponAttackType::MAX_ATTACK)
932 {
933 player->_ApplyWeaponDamage(slot, item->GetTemplate(), NULL, !apply);
934 player->_ApplyWeaponDependentAuraMods(item, attacktype, !apply);
935 }
936 }
937 }
938
939 // if disarm effects should be applied, wait to set flag until damage mods are unapplied
940 if (apply)
941 target->SetFlag(field, flag);
942
943 if (target->GetTypeId() == TypeID::TYPEID_UNIT && target->ToCreature()->GetCurrentEquipmentId())
944 target->UpdateDamagePhysical(attType);
945}
946
947void AuraEffect::HandleAuraModSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const
948{
949 if (!(mode & AURA_EFFECT_HANDLE_REAL))
950 return;
951
952 Unit* target = aurApp->GetTarget();
953
954 if (apply)
955 {
957
958 // call functions which may have additional effects after chainging state of unit
959 // Stop cast only spells vs PreventionType == SPELL_PREVENTION_TYPE_SILENCE
961 if (Spell* spell = target->GetCurrentSpell(CurrentSpellTypes(i)))
962 if (spell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
963 // Stop spells on prepare or casting state
964 target->InterruptSpell(CurrentSpellTypes(i), false);
965 }
966 else
967 {
968 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
970 return;
971
973 }
974}
975
976void AuraEffect::HandleAuraModPacify(AuraApplication const* aurApp, uint8 mode, bool apply) const
977{
979 return;
980
981 Unit* target = aurApp->GetTarget();
982
983 if (apply)
984 {
986 target->AttackStop();
987 }
988 else
989 {
990 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
992 return;
994 }
995}
996
997void AuraEffect::HandleAuraModPacifyAndSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const
998{
1000 return;
1001
1002 Unit* target = aurApp->GetTarget();
1003
1004 // Vengeance of the Blue Flight (@todo REMOVE THIS!)
1007 {
1008 if (apply)
1010 else
1012 }
1013 if (!(apply))
1014 {
1015 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
1017 return;
1018 }
1019 HandleAuraModPacify(aurApp, mode, apply);
1020 HandleAuraModSilence(aurApp, mode, apply);
1021}
1022
1023void AuraEffect::HandleAuraAllowOnlyAbility(AuraApplication const* aurApp, uint8 mode, bool apply) const
1024{
1026 return;
1027
1028 Unit* target = aurApp->GetTarget();
1029
1030 if (target->GetTypeId() == TypeID::TYPEID_PLAYER)
1031 {
1032 if (apply)
1034 else
1035 {
1036 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
1038 return;
1040 }
1041 }
1042}
1043
1044/****************************/
1045/*** TRACKING ***/
1046/****************************/
1047
1048void AuraEffect::HandleAuraTrackCreatures(AuraApplication const* aurApp, uint8 mode, bool apply) const
1049{
1051 return;
1052
1053 Unit* target = aurApp->GetTarget();
1054
1055 if (target->GetTypeId() != TypeID::TYPEID_PLAYER)
1056 return;
1057
1058 if (apply)
1060 else
1062}
1063
1064void AuraEffect::HandleAuraTrackResources(AuraApplication const* aurApp, uint8 mode, bool apply) const
1065{
1067 return;
1068
1069 Unit* target = aurApp->GetTarget();
1070
1071 if (target->GetTypeId() != TypeID::TYPEID_PLAYER)
1072 return;
1073
1074 if (apply)
1076 else
1078}
1079
1080void AuraEffect::HandleAuraTrackStealthed(AuraApplication const* aurApp, uint8 mode, bool apply) const
1081{
1083 return;
1084
1085 Unit* target = aurApp->GetTarget();
1086
1087 if (target->GetTypeId() != TypeID::TYPEID_PLAYER)
1088 return;
1089
1090 if (!(apply))
1091 {
1092 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
1093 if (target->HasAuraType(GetAuraType()))
1094 return;
1095 }
1097}
1098
1099void AuraEffect::HandleAuraModStalked(AuraApplication const* aurApp, uint8 mode, bool apply) const
1100{
1102 return;
1103
1104 Unit* target = aurApp->GetTarget();
1105
1106 // used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND
1107 if (apply)
1109 else
1110 {
1111 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
1112 if (!target->HasAuraType(GetAuraType()))
1114 }
1115
1116 // call functions which may have additional effects after chainging state of unit
1117 target->UpdateObjectVisibility();
1118}
1119
1120void AuraEffect::HandleAuraUntrackable(AuraApplication const* aurApp, uint8 mode, bool apply) const
1121{
1123 return;
1124
1125 Unit* target = aurApp->GetTarget();
1126
1127 if (apply)
1129 else
1130 {
1131 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
1132 if (target->HasAuraType(GetAuraType()))
1133 return;
1135 }
1136}
1137
1138/****************************/
1139/*** SKILLS & TALENTS ***/
1140/****************************/
1141
1142void AuraEffect::HandleAuraModPetTalentsPoints(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
1143{
1145 return;
1146
1147 Unit* target = aurApp->GetTarget();
1148
1149 if (target->GetTypeId() != TypeID::TYPEID_PLAYER)
1150 return;
1151
1152 // Recalculate pet talent points
1153 if (Pet* pet = target->ToPlayer()->GetPet())
1154 pet->InitTalentForLevel();
1155}
1156
1157void AuraEffect::HandleAuraModSkill(AuraApplication const* aurApp, uint8 mode, bool apply) const
1158{
1160 return;
1161
1162 Player* target = aurApp->GetTarget()->ToPlayer();
1163 if (!target)
1164 return;
1165
1166 uint32 prot = GetMiscValue();
1167 int32 points = GetAmount();
1168
1169 if (prot == SKILL_DEFENSE)
1170 return;
1171
1172 target->ModifySkillBonus(prot, (apply ? points : -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT);
1173}
1174
1175/****************************/
1176/*** MOVEMENT ***/
1177/****************************/
@ IN_MILLISECONDS
Definition Common.h:125
DBCStorage< SpellShapeshiftFormEntry > sSpellShapeshiftFormStore(SpellShapeshiftFormfmt)
std::set< uint32 > const & GetPhasesForGroup(uint32 group)
DBCStorage< GlyphPropertiesEntry > sGlyphPropertiesStore(GlyphPropertiesfmt)
#define MAX_SHAPESHIFT_SPELLS
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define SF_LOG_ERROR(filterType__,...)
Definition Log.h:143
@ TYPEID_PLAYER
Definition Object.h:55
@ TYPEID_UNIT
Definition Object.h:54
bool IS_PLAYER_GUID(uint64 guid)
#define sObjectMgr
Definition ObjectMgr.h:1617
UNORDERED_MAP< uint32, PlayerSpell * > PlayerSpellMap
Definition Player.h:199
@ PLAYER_FIELD_BYTE_TRACK_STEALTHED
Definition Player.h:577
@ PLAYER_FLAGS_ALLOW_ONLY_ABILITY
Definition Player.h:560
@ PLAYER_FLAGS_GHOST
Definition Player.h:541
@ EQUIPMENT_SLOT_MAINHAND
Definition Player.h:704
@ EQUIPMENT_SLOT_OFFHAND
Definition Player.h:705
#define INVENTORY_SLOT_BAG_0
Definition Player.h:684
@ PLAYERSPELL_REMOVED
Definition Player.h:95
@ SERVERSIDE_VISIBILITY_GHOST
@ EFFECT_0
@ SPELL_ATTR0_PASSIVE
@ SPELL_ATTR0_HIDDEN_CLIENTSIDE
Powers
@ POWER_RAGE
@ POWER_ENERGY
@ POWER_MANA
StealthType
@ SPELL_PREVENTION_TYPE_SILENCE
InvisibilityType
@ UNIT_DYNFLAG_DEAD
@ UNIT_DYNFLAG_TRACK_UNIT
#define MAX_GLYPH_SLOT_INDEX
@ CLASS_DRUID
@ SPELLFAMILY_MAGE
@ SPELLFAMILY_DRUID
@ GHOST_VISIBILITY_ALIVE
@ GHOST_VISIBILITY_GHOST
@ RACE_NONE
@ SPELL_ATTR8_MASTERY_SPECIALIZATION
@ SKILL_DEFENSE
@ SPELL_AURA_MOD_DISARM_RANGED
@ SPELL_AURA_MOD_SHAPESHIFT
@ SPELL_AURA_MOD_DISARM
@ SPELL_AURA_MOD_STEALTH_DETECT
@ SPELL_AURA_MOD_INVISIBILITY
@ SPELL_AURA_MOD_PACIFY
@ SPELL_AURA_MOD_SILENCE
@ SPELL_AURA_MOD_DISARM_OFFHAND
@ SPELL_AURA_GHOST
@ SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
@ SPELL_AURA_MOUNTED
@ SPELL_AURA_ALLOW_ONLY_ABILITY
@ SPELL_AURA_MOD_PACIFY_SILENCE
@ SPELL_AURA_MOD_INVISIBILITY_DETECT
@ SPELL_AURA_MOD_UNATTACKABLE
@ SPELL_AURA_MOD_STEALTH
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_MOD_SKILL_TALENT
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK
@ AURA_EFFECT_HANDLE_REAL
@ AURA_EFFECT_HANDLE_SKILL
#define sSpellMgr
Definition SpellMgr.h:744
@ AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION
Definition Unit.h:61
WeaponAttackType
Definition Unit.h:572
@ JUST_DIED
Definition Unit.h:504
#define CURRENT_FIRST_NON_MELEE_SPELL
Definition Unit.h:1114
@ UNIT_STAND_STATE_STAND
Definition Unit.h:162
@ UNIT_STAND_FLAGS_CREEP
Definition Unit.h:178
@ UNIT_STAND_FLAGS_UNTRACKABLE
Definition Unit.h:179
#define CURRENT_MAX_SPELL
Definition Unit.h:1115
ShapeshiftForm
Definition Unit.h:206
@ FORM_FIERCE_TIGER
Definition Unit.h:231
@ FORM_UNDEAD
Definition Unit.h:232
@ FORM_TRAVEL
Definition Unit.h:210
@ FORM_CREATUREBEAR
Definition Unit.h:221
@ FORM_SHADOW
Definition Unit.h:235
@ FORM_SHADOW_DANCE
Definition Unit.h:220
@ FORM_SPIRITOFREDEMPTION
Definition Unit.h:239
@ FORM_BERSERKERSTANCE
Definition Unit.h:226
@ FORM_MASTER_ANGLER
Definition Unit.h:233
@ FORM_DEFENSIVESTANCE
Definition Unit.h:225
@ FORM_THARONJA_SKELETON
Definition Unit.h:217
@ FORM_FLIGHT_EPIC
Definition Unit.h:234
@ FORM_STEVES_GHOUL
Definition Unit.h:216
@ FORM_MOONKIN
Definition Unit.h:238
@ FORM_NONE
Definition Unit.h:207
@ FORM_CREATURECAT
Definition Unit.h:222
@ FORM_CAT
Definition Unit.h:208
@ FORM_FLIGHT
Definition Unit.h:236
@ FORM_ZOMBIE
Definition Unit.h:228
@ FORM_GHOSTWOLF
Definition Unit.h:223
@ FORM_AMBIENT
Definition Unit.h:213
@ FORM_AQUA
Definition Unit.h:211
@ FORM_STEALTH
Definition Unit.h:237
@ FORM_BATTLESTANCE
Definition Unit.h:224
@ FORM_BLB_PLAYER
Definition Unit.h:219
@ FORM_METAMORPHOSIS
Definition Unit.h:229
@ FORM_GHOUL
Definition Unit.h:214
@ FORM_TREE
Definition Unit.h:209
@ FORM_TEST_OF_STRENGTH
Definition Unit.h:218
@ FORM_STURDY_OX
Definition Unit.h:230
@ FORM_WISE_SERPENT
Definition Unit.h:227
@ FORM_BEAR
Definition Unit.h:212
CurrentSpellTypes
Definition Unit.h:1107
@ CURRENT_GENERIC_SPELL
Definition Unit.h:1109
@ CURRENT_MELEE_SPELL
Definition Unit.h:1108
std::list< Unit * > UnitList
Definition Unit.h:370
@ UNIT_STATE_DIED
Definition Unit.h:512
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ REACT_PASSIVE
Definition Unit.h:1156
@ UNIT_FLAG_NON_ATTACKABLE
Definition Unit.h:626
@ UNIT_FLAG_DISABLE_POWERS
Definition Unit.h:654
@ UNIT_FLAG_DISARMED
Definition Unit.h:646
@ UNIT_FLAG_PACIFIED
Definition Unit.h:642
@ UNIT_FLAG_SILENCED
Definition Unit.h:638
@ UNIT_FLAG2_MIRROR_IMAGE
Definition Unit.h:667
@ UNIT_FLAG2_FEIGN_DEATH
Definition Unit.h:663
@ UNIT_FLAG2_DISARM_OFFHAND
Definition Unit.h:670
@ UNIT_FLAG2_DISARM_RANGED
Definition Unit.h:672
@ UNIT_FIELD_FLAGS2
@ UNIT_FIELD_MOUNT_DISPLAY_ID
@ UNIT_FIELD_ANIM_TIER
@ UNIT_FIELD_FLAGS
@ OBJECT_FIELD_DYNAMIC_FLAGS
@ PLAYER_FIELD_TRACK_RESOURCE_MASK
@ PLAYER_FIELD_LIFETIME_MAX_RANK
@ PLAYER_FIELD_TRACK_CREATURE_MASK
@ PLAYER_FIELD_PLAYER_FLAGS
void ApplyPercentModFloatVar(float &var, float val, bool apply)
Definition Util.h:94
PowerType
Unit * GetTarget() const
Definition SpellAuras.h:54
AuraRemoveMode GetRemoveMode() const
Definition SpellAuras.h:66
void HandleAuraModShapeshift(AuraApplication const *aurApp, uint8 mode, bool apply) const
SpellInfo const * GetSpellInfo() const
AuraType GetAuraType() const
void HandleAuraTrackResources(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraCloneCaster(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModPetTalentsPoints(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleSpiritOfRedemption(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModInvisibilityDetect(AuraApplication const *aurApp, uint8 mode, bool apply) const
uint32 GetId() const
void HandleShapeshiftBoosts(Unit *target, bool apply) const
void HandleAuraModSkill(AuraApplication const *aurApp, uint8 mode, bool apply) const
AuraEffect(Aura *base, uint8 effIndex, int32 *baseAmount, Unit *caster)
void HandleAuraGhost(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraAllowOnlyAbility(AuraApplication const *aurApp, uint8 mode, bool apply) const
int32 GetMiscValueB() const
void HandleAuraTransform(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModDisarm(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraTrackStealthed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModUnattackable(AuraApplication const *aurApp, uint8 mode, bool apply) const
Unit * GetCaster() const
void HandleModStealthLevel(AuraApplication const *aurApp, uint8 mode, bool apply) const
int32 GetMiscValue() const
void HandleModStealthDetect(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModScale(AuraApplication const *aurApp, uint8 mode, bool apply) const
Aura * GetBase() const
void HandleAuraModStalked(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleFeignDeath(AuraApplication const *aurApp, uint8 mode, bool apply) const
SpellInfo const *const m_spellInfo
void HandleAuraModSilence(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraUntrackable(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModPacifyAndSilence(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePhase(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModStealth(AuraApplication const *aurApp, uint8 mode, bool apply) const
uint64 GetCasterGUID() const
void HandleAuraModPacify(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraTrackCreatures(AuraApplication const *aurApp, uint8 mode, bool apply) const
int32 GetAmount() const
void HandlePhaseGroup(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModInvisibility(AuraApplication const *aurApp, uint8 mode, bool apply) const
uint8 GetCurrentEquipmentId() const
Definition Creature.h:513
void AddFlag(FLAG_TYPE flag)
Definition Object.h:575
void DelFlag(FLAG_TYPE flag)
Definition Object.h:576
void AddValue(FLAG_TYPE flag, T_VALUES value)
Definition Object.h:580
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition Object.h:579
Definition Item.h:202
float GetVisibilityRange() const
Definition Map.h:267
float GetObjectScale() const
Definition Object.h:128
uint64 GetGUID() const
Definition Object.h:119
Player * ToPlayer()
Definition Object.h:204
TypeID GetTypeId() const
Definition Object.h:131
void SetFlag(uint16 index, uint32 newFlag)
Definition Object.cpp:1261
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition Object.cpp:1280
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
Definition Object.cpp:1317
Creature * ToCreature()
Definition Object.h:207
void RemoveByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition Object.cpp:1345
virtual void SetObjectScale(float scale)
Definition Object.h:129
void SetUInt32Value(uint16 index, uint32 value)
Definition Object.cpp:1038
void SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition Object.cpp:1322
static uint32 ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=NULL)
Definition Pet.h:28
void AddTemporarySpell(uint32 spellId)
Definition Player.cpp:3971
void setRegenTimerCount(uint32 time)
Definition Player.h:1936
Pet * GetPet() const
Definition Player.cpp:15640
void RemoveTemporarySpell(uint32 spellId)
Definition Player.cpp:3985
void _ApplyWeaponDamage(uint8 slot, ItemTemplate const *proto, ScalingStatValuesEntry const *ssv, bool apply)
Definition Player.cpp:8684
Item * GetItemByPos(uint16 pos) const
void StopMirrorTimers()
Definition Player.cpp:1208
uint32 GetGlyph(uint8 spec, uint8 slot) const
Definition Player.h:2113
bool IsCurrentSpecMasterySpell(SpellInfo const *spellInfo) const
Definition Player.cpp:4013
PlayerSpellMap const & GetSpellMap() const
Definition Player.h:2141
void InitDataForForm(bool reapplyMods=false)
Definition Player.cpp:16873
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply)
Definition Player.cpp:8741
void ModifySkillBonus(uint32 skillid, int32 val, bool talent)
Definition Player.cpp:6295
uint8 GetActiveSpec() const
Definition Player.h:2077
bool HasSpell(uint32 spell) const override
Definition Player.cpp:4674
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition Player.cpp:4284
static WeaponAttackType GetAttackBySlot(uint8 slot)
Definition Spell.h:289
uint32 Stances
Definition SpellInfo.h:179
uint32 AttributesEx8
Definition SpellInfo.h:172
uint32 Attributes
Definition SpellInfo.h:164
bool IsPositive() const
Definition Unit.h:1367
void ClearUnitState(uint32 f)
Definition Unit.h:1489
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:2243
uint8 getGender() const
Definition Unit.h:1551
virtual void UpdateDamagePhysical(WeaponAttackType attType)=0
void CombatStop(bool includingCast=false)
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void UpdateObjectVisibility(bool forced=true) override
Definition Unit.cpp:7567
bool SetPhased(uint32 id, bool update, bool apply) OVERRIDE
Definition Unit.cpp:7516
uint32 GetModelForForm(ShapeshiftForm form) const
Definition Unit.cpp:7638
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0)
void SetPower(Powers power, int32 val)
Definition Unit.cpp:5255
void RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID=0, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:1376
bool IsPolymorphed() const
Definition Unit.cpp:5928
ShapeshiftForm GetShapeshiftForm() const
Definition Unit.h:2377
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:1433
uint8 getClass() const
Definition Unit.h:1543
bool IsAlive() const
Definition Unit.h:2032
void SetHealth(uint32 val)
Definition Unit.cpp:5162
bool IsStandState() const
Definition Unit.cpp:5896
bool HasAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
void AddUnitState(uint32 f)
Definition Unit.h:1481
bool CanUseAttackType(WeaponAttackType attacktype) const
Definition Unit.cpp:744
uint32 GetDisplayId() const
Definition Unit.h:2490
uint32 GetNativeDisplayId() const
Definition Unit.h:2495
void RemoveStandFlags(uint8 flags)
Definition Unit.h:1737
bool IsVisible() const
Definition Unit.cpp:4158
bool HasAuraType(AuraType auraType) const
void setTransForm(uint32 spellid)
Definition Unit.h:2504
bool IsMounted() const
Definition Unit.h:1742
HostileRefManager & getHostileRefManager()
Definition Unit.h:2466
void RemoveAurasByType(AuraType auraType, uint64 casterGUID=0, Aura *except=NULL, bool negative=true, bool positive=true)
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID=0) const
virtual void SetDisplayId(uint32 modelId)
Definition Unit.cpp:5941
int32 GetPower(Powers power) const
Definition Unit.cpp:5237
void FinishSpell(CurrentSpellTypes spellType, bool ok=true)
Definition Unit.cpp:1390
bool IsInFeralForm() const
Definition Unit.cpp:4936
uint32 GetMountID() const
Definition Unit.h:1746
void RestoreDisplayId()
Definition Unit.cpp:5946
uint32 getTransForm() const
Definition Unit.h:2508
Powers getPowerType() const
Definition Unit.h:1651
virtual void setDeathState(DeathState s)
Definition Unit.cpp:4365
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:2204
std::list< AuraEffect * > AuraEffectList
Definition Unit.h:1383
void setPowerType(Powers power)
Definition Unit.cpp:2079
void SetStandState(uint8 state)
Definition Unit.cpp:5902
bool AttackStop()
void SetShapeshiftForm(ShapeshiftForm form)
Definition Unit.cpp:4931
void SetStandFlags(uint8 flags)
Definition Unit.h:1733
void RemoveMovementImpairingAuras()
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
Definition Unit.cpp:1365
uint8 getRace() const
Definition Unit.h:1535
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition Unit.h:2363
Map * GetMap() const
Definition Object.h:740
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibility
Definition Object.h:729
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibilityDetect
Definition Object.h:730
void VisitNearbyObject(float const &radius, NOTIFIER &notifier) const
Definition Object.h:782
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealthDetect
Definition Object.h:727
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealth
Definition Object.h:726
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
Definition Object.h:733
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition Object.h:732
uint32 GetGlyphOfPenguinDisplayId()
uint32 GetLeaderOfThePackTriggeredSpellId()
bool IsNonAttackablePacifyAura(uint32 auraSpellId)
uint8 GetShapeshiftBoostSpellIds(uint32 shapeshiftForm, uint32 *spellIds, uint8 maxSpellIds)
bool TransformDisplayRequiresPlayerRace(uint32 auraSpellId)
uint32 GetShadowFocusTriggeredSpellId()
uint32 GetDragonmawIllusionAuraSpellId()
uint32 GetShadowFocusAuraSpellId()
uint32 GetGlyphOfPenguinAuraSpellId()
uint32 GetNurturingInstinctTriggeredSpellId(uint32 auraSpellId)
uint32 GetUnknownTransformFallbackDisplayId()
uint32 GetDragonmawIllusionMountDisplayId()
uint32 GetTransformDisplayId(uint32 auraSpellId, uint8 race, uint8 gender)
uint32 GetLeaderOfThePackSpellId()
uint8 const MAX_SHAPESHIFT_BOOST_SPELLS
uint32 GetRandomValidModelId() const
Definition Creature.cpp:79
uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]