diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 11 | ||||
-rw-r--r-- | src/server/game/Maps/Map.cpp | 5 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 12 | ||||
-rw-r--r-- | src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp | 12 | ||||
-rw-r--r-- | src/server/scripts/World/npcs_special.cpp | 44 |
6 files changed, 52 insertions, 34 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4454b344741..c21301c27b2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4355,13 +4355,10 @@ void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelCharges if (aura->GetSpellInfo()->GetDispelMask() & dispelMask) { - if (aura->GetSpellInfo()->Dispel == DISPEL_MAGIC) - { - // do not remove positive auras if friendly target - // negative auras if non-friendly target - if (aurApp->IsPositive() == IsFriendlyTo(caster)) - continue; - } + // do not remove positive auras if friendly target + // negative auras if non-friendly target + if (aurApp->IsPositive() == IsFriendlyTo(caster)) + continue; // The charges / stack amounts don't count towards the total number of auras that can be dispelled. // Ie: A dispel on a target with 5 stacks of Winters Chill and a Polymorph has 1 / (1 + 1) -> 50% chance to dispell diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index ca384160ad1..ccc599b6de8 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2428,7 +2428,7 @@ uint32 Map::GetAreaId(float x, float y, float z, bool *isOutdoors) const atEntry = sAreaTableStore.LookupEntry(wmoEntry->areaId); } - uint32 areaId; + uint32 areaId = 0; if (atEntry) areaId = atEntry->ID; @@ -2436,8 +2436,9 @@ uint32 Map::GetAreaId(float x, float y, float z, bool *isOutdoors) const { if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y)) areaId = gmap->getArea(x, y); + // this used while not all *.map files generated (instances) - else + if (!areaId) areaId = i_mapEntry->linked_zone; } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 1cab186b95e..207908c6d51 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3384,7 +3384,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint && !iter->second->IsPositive() //Don't remove positive spells && spell->Id != GetId()) //Don't remove self { - target->RemoveAura(iter, AURA_REMOVE_BY_ENEMY_SPELL); + target->RemoveAura(iter); } else ++iter; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 736bbfb7fa9..069c794ca8b 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1226,18 +1226,14 @@ bool SpellInfo::CanDispelAura(SpellInfo const* aura) const if (HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) && !aura->IsDeathPersistent()) return true; - // These auras (Cyclone for example) are not dispelable - if (aura->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE)) - return false; - - // Divine Shield etc can dispel auras if they don't ignore school immunity - if (HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY) && !aura->IsDeathPersistent()) - return true; - // These auras (like Divine Shield) can't be dispelled if (aura->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)) return false; + // These auras (Cyclone for example) are not dispelable + if (aura->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE)) + return false; + return true; } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index e5812390bd2..be27932e6b4 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -144,6 +144,7 @@ enum Spells // Thaladred the Darkener spells SPELL_PSYCHIC_BLOW = 10689, SPELL_SILENCE = 30225, + SPELL_REND = 36965, // Lord Sanguinar spells SPELL_BELLOWING_ROAR = 40636, // Grand Astromancer Capernian spells @@ -881,11 +882,13 @@ class boss_thaladred_the_darkener : public CreatureScript { Gaze_Timer = 100; Silence_Timer = 20000; + Rend_Timer = 4000; PsychicBlow_Timer = 10000; } uint32 Gaze_Timer; uint32 Silence_Timer; + uint32 Rend_Timer; uint32 PsychicBlow_Timer; void Reset() override @@ -939,6 +942,15 @@ class boss_thaladred_the_darkener : public CreatureScript else Silence_Timer -= diff; + //Rend_Timer + if (Rend_Timer <= diff) + { + DoCastVictim(SPELL_REND); + Rend_Timer = 4000; + } + else + Rend_Timer -= diff; + //PsychicBlow_Timer if (PsychicBlow_Timer <= diff) { diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 0fb0bd7943c..80b4fac4333 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -39,6 +39,7 @@ npc_shadowfiend 100% restore 5% of owner's mana when shadowfiend die f npc_locksmith 75% list of keys needs to be confirmed npc_firework 100% NPC's summoned by rockets and rocket clusters, for making them cast visual npc_train_wrecker 100% Wind-Up Train Wrecker that kills train set +npc_egbert 100% Egbert run's around EndContentData */ #include "ScriptMgr.h" @@ -2574,8 +2575,8 @@ class npc_train_wrecker : public CreatureScript enum EgbertMisc { - EVENT_MOVE_POS = 1, - EVENT_RETURN = 2 + SPELL_EGBERT = 40669, + EVENT_RETURN = 3 }; class npc_egbert : public CreatureScript @@ -2583,9 +2584,9 @@ class npc_egbert : public CreatureScript public: npc_egbert() : CreatureScript("npc_egbert") {} - struct npc_egbertAI : public PetAI + struct npc_egbertAI : public NullCreatureAI { - npc_egbertAI(Creature* creature) : PetAI(creature) + npc_egbertAI(Creature* creature) : NullCreatureAI(creature) { if (Unit* owner = me->GetCharmerOrOwner()) if (owner->GetMap()->GetEntry()->addon > 1) @@ -2595,29 +2596,40 @@ public: void Reset() override { _events.Reset(); - _events.ScheduleEvent(EVENT_MOVE_POS, urandms(1, 20)); + if (Unit* owner = me->GetCharmerOrOwner()) + me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); + } + + void EnterEvadeMode(EvadeReason why) override + { + if (!_EnterEvadeMode(why)) + return; + + Reset(); } void UpdateAI(uint32 diff) override { _events.Update(diff); + if (Unit* owner = me->GetCharmerOrOwner()) + { + if (!me->IsWithinDist(owner, 40.f)) + { + me->RemoveAura(SPELL_EGBERT); + me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); + } + } + + if (me->HasAura(SPELL_EGBERT)) + _events.ScheduleEvent(EVENT_RETURN, urandms(5, 20)); + while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) { - case EVENT_MOVE_POS: - if (Unit* owner = me->GetCharmerOrOwner()) - { - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(0, owner->GetPositionX() + frand(-30.0f, 30.0f), owner->GetPositionY() + frand(-30.0f, 30.0f), owner->GetPositionZ()); - } - _events.ScheduleEvent(EVENT_RETURN, urandms(3, 4)); - break; case EVENT_RETURN: - if (Unit* owner = me->GetCharmerOrOwner()) - me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); - _events.ScheduleEvent(EVENT_MOVE_POS, urandms(1, 20)); + me->RemoveAura(SPELL_EGBERT); break; default: break; |