From 4423ac319404dd52492e8ed0b56433046fb7fd9e Mon Sep 17 00:00:00 2001 From: krz Date: Sun, 24 May 2009 16:18:19 +0200 Subject: [PATCH 1/4] Range calculation fix. Channeled SPELL_AURA_PERIODIC_TRIGGER_SPELL will now not trigger spell if target is out of range. Channeled periodic damage auras will now not deal damage if target is out of range. --HG-- branch : trunk --- src/game/Object.h | 2 +- src/game/SpellAuras.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/game/Object.h b/src/game/Object.h index 328df30492a..9fc799ef235 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -411,7 +411,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object float GetObjectSize() const { - return ( m_valuesCount > UNIT_FIELD_BOUNDINGRADIUS ) ? m_floatValues[UNIT_FIELD_BOUNDINGRADIUS] : DEFAULT_WORLD_OBJECT_SIZE; + return ( m_valuesCount > UNIT_FIELD_COMBATREACH ) ? m_floatValues[UNIT_FIELD_COMBATREACH] : DEFAULT_WORLD_OBJECT_SIZE; } bool IsPositionValid() const; void UpdateGroundPositionZ(float x, float y, float &z) const; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 64e8887fd15..b3ee5acbe3b 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -543,7 +543,11 @@ void Aura::Update(uint32 diff) } // Channeled aura required check distance from caster except in possessed cases - if(IsChanneledSpell(m_spellProto) && m_caster_guid != m_target->GetGUID() && !m_target->isPossessed()) + Unit *pRealTarget = (GetSpellProto()->EffectApplyAuraName[GetEffIndex()] == SPELL_AURA_PERIODIC_TRIGGER_SPELL) ? GetTriggerTarget() : m_target; + if(!pRealTarget) + return; + + if(IsChanneledSpell(m_spellProto) && !pRealTarget->isPossessed() && pRealTarget->GetGUID() != GetCasterGUID()) { Unit* caster = GetCaster(); if(!caster) @@ -569,11 +573,8 @@ void Aura::Update(uint32 diff) if(Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(GetId(), mod, radius,NULL); - if(!caster->IsWithinDistInMap(m_target,radius)) - { - m_target->RemoveAura(GetId(),GetEffIndex()); + if(!caster->IsWithinDistInMap(pRealTarget, radius)) return; - } } if(m_isPeriodic && (m_duration >= 0 || m_isPassive || m_permanent)) From 19137630db6527e2c6c0bca2815eb4f59f7fa966 Mon Sep 17 00:00:00 2001 From: hunteee Date: Sun, 24 May 2009 21:33:54 +0200 Subject: [PATCH 2/4] *Remove an useless hack from Felmyst. --HG-- branch : trunk --- .../scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp index 50770b30dff..769518be38e 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp @@ -46,8 +46,8 @@ enum Spells SPELL_CORROSION = 45866, SPELL_GAS_NOVA = 45855, SPELL_ENCAPSULATE_CHANNEL = 45661, - SPELL_ENCAPSULATE_EFFECT = 45665, - SPELL_ENCAPSULATE_AOE = 45662, + // SPELL_ENCAPSULATE_EFFECT = 45665, + // SPELL_ENCAPSULATE_AOE = 45662, //Flight phase SPELL_VAPOR_SELECT = 45391, // fel to player, force cast 45392, 50000y selete target @@ -474,7 +474,6 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 150, true)) { m_creature->CastSpell(target, SPELL_ENCAPSULATE_CHANNEL, false); - target->CastSpell(target, SPELL_ENCAPSULATE_EFFECT, true);// linked aura, need core patch to remove this hack Timer[EVENT_ENCAPSULATE] = 25000 + rand()%5 * 1000; }break; case EVENT_FLIGHT: From 1d79be09e7028c91041c2d1d118dd913b8881bac Mon Sep 17 00:00:00 2001 From: raczman Date: Sun, 24 May 2009 22:22:21 +0200 Subject: [PATCH 3/4] Fix logical error in commit 1523 --HG-- branch : trunk --- src/game/SpellAuras.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index b3ee5acbe3b..6dd2930b1bd 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -5916,19 +5916,16 @@ void Aura::PeriodicDummyTick() { if ((*i)->GetId() == GetId()) { + BattleGround *bg = ((Player*)m_target)->GetBattleGround(); // Get tick number int32 tick = (m_maxduration - m_duration) / m_modifier.periodictime; // Default case (not on arenas) - if (tick == 0) + if (tick == 0 ) { (*i)->GetModifier()->m_amount = m_modifier.m_amount; - ((Player*)m_target)->UpdateManaRegen(); - // Disable continue - m_isPeriodic = false; + } - return; //********************************************** - // Code commended since arena patch not added // This feature uses only in arenas //********************************************** // Here need increase mana regen per tick (6 second rule) @@ -5936,9 +5933,13 @@ void Aura::PeriodicDummyTick() // on 1 tick - 166% (handled in 4 second) // on 2 tick - 133% (handled in 6 second) // Not need update after 3 tick - BattleGround *bg = ((Player*)m_target)->GetBattleGround(); + if(!bg || !bg->isArena()) + { + m_isPeriodic = false; + ((Player*)m_target)->UpdateManaRegen(); return; + } if (tick > 3) return; // Apply bonus for 0 - 3 tick From dd9939942413318c773ad126492e7731fe17a7b7 Mon Sep 17 00:00:00 2001 From: krz Date: Mon, 25 May 2009 23:58:40 +0200 Subject: [PATCH 4/4] GUARDIAN_PET will be now attackable for players with same faction as summoner if used in arena/duel. --HG-- branch : trunk --- src/game/SpellEffects.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index b75b388a7c7..190f9934b84 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3635,6 +3635,7 @@ void Spell::EffectSummonGuardian(uint32 i) spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP,0); spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); + spawnCreature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE); } }