diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp | 6 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp | 2 | ||||
| -rw-r--r-- | src/game/ChatHandler.cpp | 7 | ||||
| -rw-r--r-- | src/game/GameObject.cpp | 11 | ||||
| -rw-r--r-- | src/game/GameObject.h | 1 | ||||
| -rw-r--r-- | src/game/SpellAuras.cpp | 74 | 
6 files changed, 61 insertions, 40 deletions
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp index 8b185318b8a..b7b44da4f80 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp @@ -200,11 +200,7 @@ bool GOHello_go_najentus_spine(Player *player, GameObject* _GO)              if(CAST_AI(boss_najentusAI, Najentus->AI())->RemoveImpalingSpine())              {                  player->CastSpell(player, SPELL_CREATE_NAJENTUS_SPINE, true); -                _GO->SetLootState(GO_NOT_READY); -                if (_GO->GetOwnerGUID()) -                    if (Unit * owner = _GO->GetOwner()) -                        owner->RemoveGameObject(_GO, false); -                _GO->Delete(); +                _GO->DeleteObjectWithOwner();              }      return true;  } diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp index 05dea45ed25..47b991e8346 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp @@ -161,7 +161,7 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public BossAI              if(Player *player = Unit::GetPlayer(itr->first))                  player->RemoveAura(SPELL_ICEBOLT);              if(GameObject *go = GameObject::GetGameObject(*me, itr->second)) -                go->Delete(); +                go->DeleteObjectWithOwner();          }          iceblocks.clear();      } diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp index 0b38c3aaa0a..6fdf9f0b222 100644 --- a/src/game/ChatHandler.cpp +++ b/src/game/ChatHandler.cpp @@ -160,11 +160,8 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )          std::string msg="";          recv_data >> msg; -        if (ChatHandler(this).ParseCommands(msg.c_str()) == 0) -        { -            SendNotification(GetTrinityString(LANG_GM_SILENCE), GetPlayer()->GetName()); -            return; -        } +        SendNotification(GetTrinityString(LANG_GM_SILENCE), GetPlayer()->GetName()); +        return;      }      switch(type) diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index f934d3d1fe7..457591e63b4 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -434,7 +434,7 @@ void GameObject::Update(uint32 /*p_time*/)              if(GetOwnerGUID())              { -                if(Unit* owner = GetOwner()) +                if(Unit* owner = GetOwner(false))                  {                      owner->RemoveGameObject(this, false);                      SetRespawnTime(0); @@ -492,6 +492,15 @@ void GameObject::AddUniqueUse(Player* player)      m_unique_users.insert(player->GetGUIDLow());  } +void GameObject::DeleteObjectWithOwner() +{ +    SetLootState(GO_NOT_READY); +    if (GetOwnerGUID()) +        if (Unit * owner = GetOwner(false)) +            owner->RemoveGameObject(this, false); +    Delete(); +} +  void GameObject::Delete()  {      assert (!GetOwnerGUID()); diff --git a/src/game/GameObject.h b/src/game/GameObject.h index b96213bfad5..9a86c93389c 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -640,6 +640,7 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject          uint32 GetRespawnDelay() const { return m_respawnDelayTime; }          void Refresh();          void Delete(); +        void DeleteObjectWithOwner();          void SetSpellId(uint32 id) { m_spellId = id;}          uint32 GetSpellId() const { return m_spellId;}          void getFishLoot(Loot *loot, Player* loot_owner); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 17bfd6bcb26..cf83353f062 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -944,31 +944,47 @@ void Aura::ApplyAllModifiers(bool apply, bool Real)  void Aura::HandleAuraSpecificMods(bool apply)  { -    // Glyph of Fireball -    if ((apply) && (GetCaster()->HasAura(56368)) && (m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE && m_spellProto->SpellFamilyFlags[0] & 0x00000001 && m_spellProto->SpellFamilyFlags[2] & 0x00000008)) -            SetAuraDuration(0); - -    // Glyph of Frostbolt -    if ((apply) && (GetCaster()->HasAura(56370)) && ((m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE) && (m_spellProto->SpellFamilyFlags[0] & 0x00000020) && (m_spellProto->SpellVisual[0] == 13))) -            SetAuraDuration(0); - -    // Polymorph - Glyphs && Sound -    if (apply && m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE && m_spellProto->SpellFamilyFlags[0] & 0x01000000) +    if (apply)      { -        // Glyph of Polymorph -        if (GetCaster()->HasAura(56375)) +        if (m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE)          { -            m_target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); -            m_target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); -        } +            if (m_spellProto->SpellFamilyFlags[0] & 0x00000001 && m_spellProto->SpellFamilyFlags[2] & 0x00000008) +            { +                // Glyph of Fireball +                if (Unit * caster = GetCaster()) +                    if (caster->HasAura(56368)) +                        SetAuraDuration(0); +            } +            else if (m_spellProto->SpellFamilyFlags[0] & 0x00000020 && m_spellProto->SpellVisual[0] == 13) +            { +                // Glyph of Frostbolt +                if (Unit * caster = GetCaster()) +                    if (caster->HasAura(56370)) +                        SetAuraDuration(0); +            } +            // Todo: This should be moved to similar function in spell::hit +            else if (m_spellProto->SpellFamilyFlags[0] & 0x01000000) +            { +                // Glyph of Polymorph +                Unit * caster = GetCaster(); +                if (!caster) +                    return; +                if (caster->HasAura(56375)) +                { +                    m_target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); +                    m_target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); +                } -        // Polymorph Sound - Sheep && Penguin -        if (m_spellProto->SpellIconID == 82 && m_spellProto->SpellVisual[0] == 12978) -        { -            if (GetCaster()->HasAura(56375)) -                GetCaster()->CastSpell(m_target,61635,true); -            else -                GetCaster()->CastSpell(m_target,61634,true); +                // Polymorph Sound - Sheep && Penguin +                if (m_spellProto->SpellIconID == 82 && m_spellProto->SpellVisual[0] == 12978) +                { +                    // Glyph of the Penguin +                    if (caster->HasAura(52648)) +                        caster->CastSpell(m_target,61635,true); +                    else +                        caster->CastSpell(m_target,61634,true); +                } +            }          }      } @@ -977,10 +993,9 @@ void Aura::HandleAuraSpecificMods(bool apply)      // If remove Concentration Aura -> trigger -> remove Aura Mastery Immunity      // If remove Aura Mastery -> trigger -> remove Aura Mastery Immunity      if (m_spellProto->Id == 19746 || m_spellProto->Id == 31821) -    {        +    {          if (GetCasterGUID() != m_target->GetGUID())              return; -                  if (apply)          {              if ((m_spellProto->Id == 31821 && m_target->HasAura(19746, GetCasterGUID())) || (m_spellProto->Id == 19746 && m_target->HasAura(31821))) @@ -3565,10 +3580,13 @@ void AuraEffect::HandleAuraTransform(bool apply, bool Real, bool /*changeAmount*                  // Dragonmaw Illusion (set mount model also)                  if(GetId()==42016 && m_target->GetMountID() && !m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED).empty())                      m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314); -                 -                // Glyph of the Penguin -                if ((GetCaster()->HasAura(56375)) && (GetSpellProto()->SpellFamilyName == SPELLFAMILY_MAGE && GetSpellProto()->SpellIconID == 82 && GetSpellProto()->SpellVisual[0] == 12978)) -                     m_target->SetDisplayId(26452); + +                // Polymorph (sheep) +                if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_MAGE && GetSpellProto()->SpellIconID == 82 && GetSpellProto()->SpellVisual[0] == 12978) +                    if (Unit * caster = GetCaster()) +                        // Glyph of the Penguin +                        if (caster->HasAura(52648)) +                            m_target->SetDisplayId(26452);              }          }  | 
