diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellAuras.cpp | 48 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 8 | ||||
-rw-r--r-- | src/game/Unit.cpp | 24 | ||||
-rw-r--r-- | src/game/Unit.h | 1 |
4 files changed, 79 insertions, 2 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index c87fc9b89fc..39c959bdc3e 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -4335,6 +4335,18 @@ void AuraEffect::HandleModMechanicImmunity(bool apply, bool Real, bool /*changeA m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,SPELL_AURA_MOD_ROOT,apply); m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,SPELL_AURA_MOD_DECREASE_SPEED,apply); } + // Demonic Circle + else if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellProto->SpellIconID == 3221) + { + if (m_target->GetTypeId() != TYPEID_PLAYER) + return; + if (apply) + { + GameObject* obj = m_target->GetGameObject(48018); + if (obj) + ((Player*)m_target)->TeleportTo(obj->GetMapId(),obj->GetPositionX(),obj->GetPositionY(),obj->GetPositionZ(),obj->GetOrientation()); + } + } } //this method is called whenever we add / remove aura which gives m_target some imunity to some spell effect @@ -4491,6 +4503,27 @@ void AuraEffect::HandleAuraPeriodicDummy(bool apply, bool Real, bool changeAmoun SpellEntry const*spell = GetSpellProto(); switch( spell->SpellFamilyName) { + case SPELLFAMILY_WARLOCK: + { + switch (spell->Id) + { + // Demonic Circle + case 48018: + if (apply) + // set to false at initial cast to enable button at next enable in periodic handler + m_target->SendAuraVisualForSelf(false,62388); + else + { + // Do not remove GO when aura is removed by stack + // to prevent remove GO added by new spell + // old one is already removed + if (GetParentAura()->GetRemoveMode()!=AURA_REMOVE_BY_STACK) + m_target->RemoveGameObject(spell->Id,true); + m_target->SendAuraVisualForSelf(false,62388); + } + break; + } + } case SPELLFAMILY_HUNTER: { // Explosive Shot @@ -6614,6 +6647,20 @@ void AuraEffect::PeriodicDummyTick() } break; } + case SPELLFAMILY_WARLOCK: + switch (spell->Id) + { + case 48018: + GameObject* obj = m_target->GetGameObject(spell->Id); + if (!obj) return; + // We must take a range of teleport spell, not summon. + const SpellEntry* goToCircleSpell = sSpellStore.LookupEntry(48020); + if (m_target->IsWithinDist(obj,GetSpellMaxRangeForFriend(sSpellRangeStore.LookupEntry(goToCircleSpell->rangeIndex)))) + m_target->SendAuraVisualForSelf(true,62388, 1); + else + m_target->SendAuraVisualForSelf(false,62388); + } + break; case SPELLFAMILY_DRUID: { switch (spell->Id) @@ -6656,6 +6703,7 @@ void AuraEffect::PeriodicDummyTick() // Killing Spree case 51690: { + // TODO: this should use effect[1] of 51690 std::list<Unit*> targets; { // eff_radius ==0 diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 661eef708ea..dd85148022b 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5669,7 +5669,13 @@ void Spell::EffectSummonObject(uint32 i) if( m_caster ) obj = m_caster->GetMap()->GetGameObject(guid); - if(obj) obj->Delete(); + if(obj) + { + // Recast case - null spell id to make auras not be removed on object remove from world + if (m_spellInfo->Id == obj->GetSpellId()) + obj->SetSpellId(0); + obj->Delete(); + } m_caster->m_ObjectSlot[slot] = 0; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1546ccdb927..c2d6f77acec 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3769,6 +3769,25 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_ return modifier; } +void Unit::SendAuraVisualForSelf(bool apply, uint32 id, uint8 effmask) +{ + WorldPacket data(SMSG_AURA_UPDATE); + data.append(GetPackGUID()); + // use always free 64+ slots + data << uint8(MAX_AURAS); + if (!apply) + { + data << uint32(0); + SendMessageToSet(&data, true); + return; + } + data << uint32(id); + data << uint8(AFLAG_CASTER | AFLAG_POSITIVE | effmask); + data << uint8(getLevel()); + data << uint8(1); + SendMessageToSet(&data, true); +} + bool Unit::AddAura(Aura *Aur, bool handleEffects) { // aura doesn't apply effects-return @@ -4285,6 +4304,9 @@ bool Unit::HasAura(uint32 spellId, uint64 caster) const //Special case for non existing spell if (spellId==61988) return HasAura(61987, caster) || HasAura(25771, caster); + // Demonic Circle - special aura for client + else if (spellId==62388) + return HasAura(48018, caster); if (Aura * aur = GetAura(spellId, caster)) return true; @@ -6088,7 +6110,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger { if (pVictim->getPowerType() == POWER_MANA) { - // 2% of maximum mana + // 2% of base mana basepoints0 = int32(pVictim->GetCreateMana() * 2 / 100); pVictim->CastCustomSpell(pVictim, 20268, &basepoints0, NULL, NULL, true, 0, triggeredByAura); } diff --git a/src/game/Unit.h b/src/game/Unit.h index fa32a235d3e..ea99f8a2424 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1536,6 +1536,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject } void SetVisibleAura(uint8 slot, Aura * aur){ m_visibleAuras[slot]=aur; } void RemoveVisibleAura(uint8 slot){ m_visibleAuras.erase(slot); } + void SendAuraVisualForSelf(bool apply, uint32 id, uint8 effmask = 0); AuraMap & GetAuras() { return m_Auras; } AuraMap const& GetAuras() const { return m_Auras; } |