From 0e757d8b697cdaa6294245551ec6468d9e6dd07a Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 15 Feb 2009 13:03:28 -0600 Subject: [PATCH 1/6] *Fix knockback angle calculation. --HG-- branch : trunk --- src/game/SpellEffects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index da2471886e..61064274b8 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5950,8 +5950,8 @@ void Spell::EffectKnockBack(uint32 i) float dy = unitTarget->GetPositionY() - y; float dist = sqrt((dx*dx) + (dy*dy)); - float vsin = dx / dist; - float vcos = dy / dist; + float vcos = dx / dist; + float vsin = dy / dist; WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4)); data.append(unitTarget->GetPackGUID()); From 90313ed650d75b60475cf7f933132da090855dbe Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 15 Feb 2009 13:19:18 -0600 Subject: [PATCH 2/6] *Add DoCastAOE for script to cast AOE spells. Because AOE spells do not require any target. *Corresponding update of Kalecgos script. --HG-- branch : trunk --- src/bindings/scripts/include/sc_creature.cpp | 10 +++++++++- src/bindings/scripts/include/sc_creature.h | 1 + .../scripts/zone/sunwell_plateau/boss_kalecgos.cpp | 11 +++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index 44148d4d79..03b162268d 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -203,13 +203,21 @@ void ScriptedAI::DoStopAttack() void ScriptedAI::DoCast(Unit* victim, uint32 spellId, bool triggered) { - if (!victim || m_creature->hasUnitState(UNIT_STAT_CASTING)) + if (!victim || m_creature->hasUnitState(UNIT_STAT_CASTING) && !triggered) return; //m_creature->StopMoving(); m_creature->CastSpell(victim, spellId, triggered); } +void ScriptedAI::DoCastAOE(uint32 spellId, bool triggered) +{ + if(!triggered && m_creature->hasUnitState(UNIT_STAT_CASTING)) + return; + + m_creature->CastSpell((Unit*)NULL, spellId, triggered); +} + void ScriptedAI::DoCastSpell(Unit* who,SpellEntry const *spellInfo, bool triggered) { if (!who || m_creature->IsNonMeleeSpellCasted(false)) diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index aadfdd3d19..82283138d3 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -121,6 +121,7 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI //Cast spell by Id void DoCast(Unit* victim, uint32 spellId, bool triggered = false); + void DoCastAOE(uint32 spellId, bool triggered = false); //Cast spell by spell info void DoCastSpell(Unit* who,SpellEntry const *spellInfo, bool triggered = false); diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp index f5c1368812..a08b71751b 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp @@ -586,32 +586,31 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff) if(ArcaneBuffetTimer < diff) { - DoCast(m_creature->getVictim(), SPELL_ARCANE_BUFFET); + DoCastAOE(SPELL_ARCANE_BUFFET); ArcaneBuffetTimer = 8000; }else ArcaneBuffetTimer -= diff; if(FrostBreathTimer < diff) { - DoCast(m_creature->getVictim(), SPELL_FROST_BREATH); + DoCastAOE(SPELL_FROST_BREATH); FrostBreathTimer = 15000; }else FrostBreathTimer -= diff; if(TailLashTimer < diff) { - DoCast(m_creature->getVictim(), SPELL_TAIL_LASH); + DoCastAOE(SPELL_TAIL_LASH); TailLashTimer = 15000; }else TailLashTimer -= diff; if(WildMagicTimer < diff) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if(target && target->isAlive()) - DoCast(target, WildMagic[rand()%6]); + DoCastAOE(WildMagic[rand()%6]); WildMagicTimer = 20000; }else WildMagicTimer -= diff; if(SpectralBlastTimer < diff) { + //this is a hack. we need to find a victim without aura in core Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); if( ( target != m_creature->getVictim() ) && target->isAlive() && !(target->HasAura(AURA_SPECTRAL_EXHAUSTION, 0)) ) { From 058b7c32e40332a620d8e294b4defba81e14dfc0 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 15 Feb 2009 15:26:04 -0600 Subject: [PATCH 3/6] *Fix a crash caused by EventAI --HG-- branch : trunk --- src/bindings/scripts/scripts/creature/mob_event_ai.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp index c7605f9adc..93cb9aba37 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp @@ -1260,9 +1260,13 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI switch ((*i).Event.event_type) { case EVENT_T_RANGE: - float dist = m_creature->GetDistance(m_creature->getVictim()); - if (dist > (*i).Event.event_param1 && dist < (*i).Event.event_param2) - ProcessEvent(*i); + // in some cases this is called twice and victim may not exist in the second time + if(m_creature->getVictim()) + { + float dist = m_creature->GetDistance(m_creature->getVictim()); + if (dist > (*i).Event.event_param1 && dist < (*i).Event.event_param2) + ProcessEvent(*i); + } break; } } From bb75ff7b79e89dac82f3ee1c740eb6079c7ec43b Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 15 Feb 2009 17:33:36 -0600 Subject: [PATCH 4/6] *Cleanup of charm/farsight code. Hope this can fix some crash bugs. --HG-- branch : trunk --- src/game/Level3.cpp | 24 +++++------- src/game/MovementHandler.cpp | 4 +- src/game/PetHandler.cpp | 14 +------ src/game/Player.cpp | 72 +++++------------------------------- src/game/Player.h | 12 ++---- src/game/SpellAuras.cpp | 4 +- src/game/TemporarySummon.cpp | 4 -- src/game/Unit.cpp | 25 ++++++------- src/game/Unit.h | 4 +- src/game/WorldSession.cpp | 8 ---- 10 files changed, 41 insertions(+), 130 deletions(-) diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index a36571d20a..f1a08f0b2c 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -7290,19 +7290,19 @@ bool ChatHandler::HandlePossessCommand(const char* args) if(!pUnit) return false; - // Don't allow unlimited possession of players - if (pUnit->GetTypeId() == TYPEID_PLAYER) - return false; - - pUnit->SetCharmedOrPossessedBy(m_session->GetPlayer(), true); - + m_session->GetPlayer()->CastSpell(pUnit, 530, true); return true; } bool ChatHandler::HandleUnPossessCommand(const char* args) { - // Use this command to also unpossess ourselves - m_session->GetPlayer()->RemoveCharmedOrPossessedBy(NULL); + Unit* pUnit = getSelectedUnit(); + if(!pUnit) pUnit = m_session->GetPlayer(); + + pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM); + pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET); + pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS); + return true; } @@ -7312,11 +7312,7 @@ bool ChatHandler::HandleBindSightCommand(const char* args) if (!pUnit) return false; - if (m_session->GetPlayer()->isPossessing()) - return false; - - pUnit->AddPlayerToVision(m_session->GetPlayer()); - + m_session->GetPlayer()->CastSpell(pUnit, 6277, true); return true; } @@ -7325,6 +7321,6 @@ bool ChatHandler::HandleUnbindSightCommand(const char* args) if (m_session->GetPlayer()->isPossessing()) return false; - m_session->GetPlayer()->RemoveFarsightTarget(); + m_session->GetPlayer()->StopCastingBindSight(); return true; } diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 8c808e3a53..b8dede604d 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -350,7 +350,7 @@ void WorldSession::HandlePossessedMovement(WorldPacket& recv_data, MovementInfo& // Remove possession if possessed unit enters a transport if (MovementFlags & MOVEMENTFLAG_ONTRANSPORT) { - GetPlayer()->RemovePossess(true); + GetPlayer()->Uncharm(); return; } @@ -383,7 +383,7 @@ void WorldSession::HandlePossessedMovement(WorldPacket& recv_data, MovementInfo& if(movementInfo.z < -500.0f) { - GetPlayer()->RemovePossess(false); + GetPlayer()->Uncharm(); plr->HandleFallUnderMap(); } } diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index e4269ddafd..907b7b7a95 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -153,12 +153,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) p->setDeathState(CORPSE); } else // charmed or possessed - { - if (_player->isPossessing()) - _player->RemovePossess(true); - else - _player->Uncharm(); - } + _player->Uncharm(); break; default: sLog.outError("WORLD: unknown PET flag Action %i and spellid %i.\n", flag, spellid); @@ -495,12 +490,7 @@ void WorldSession::HandlePetAbandon( WorldPacket & recv_data ) _player->RemovePet((Pet*)pet,PET_SAVE_AS_DELETED); } else if(pet->GetGUID() == _player->GetCharmGUID()) - { - if (_player->isPossessing()) - _player->RemovePossess(true); - else - _player->Uncharm(); - } + _player->Uncharm(); } } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 02e6e94f94..0e4987c6da 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -471,9 +471,6 @@ Player::~Player () for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr) itr->second.save->RemovePlayer(this); - if (m_uint32Values && isPossessing()) - RemovePossess(false); - delete m_declinedname; } @@ -1351,12 +1348,6 @@ void Player::setDeathState(DeathState s) RemoveMiniPet(); RemoveGuardians(); - // remove possession - if(isPossessing()) - RemovePossess(false); - else - RemoveFarsightTarget(); - // save value before aura remove in Unit::setDeathState ressSpellId = GetUInt32Value(PLAYER_SELF_RES_SPELL); @@ -1619,18 +1610,6 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati SetSemaphoreTeleport(true); - // Remove any possession on the player before teleporting - if (isPossessedByPlayer()) - ((Player*)GetCharmer())->RemovePossess(); - - // Remove player's possession before teleporting - if (isPossessing()) - RemovePossess(false); - - // Empty vision list and clear farsight (if it hasn't already been cleared by RemovePossess) before teleporting - RemoveAllFromVision(); - RemoveFarsightTarget(); - // The player was ported to another map and looses the duel immediatly. // We have to perform this check before the teleport, otherwise the // ObjectAccessor won't find the flag. @@ -1857,12 +1836,13 @@ void Player::RemoveFromWorld() if(IsInWorld()) { ///- Release charmed creatures, unsummon totems and remove pets/guardians - RemovePossess(false); - Uncharm(); + StopCastingCharm(); + StopCastingBindSight(); + RemoveCharmAuras(); + RemoveBindSightAuras(); UnsummonAllTotems(); RemoveMiniPet(); RemoveGuardians(); - RemoveFarsightTarget(); } for(int i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; i++) @@ -16270,6 +16250,8 @@ void Player::Uncharm() return; charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM); + charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET); + charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS); } void Player::BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string& text, uint32 language) const @@ -19054,41 +19036,6 @@ void Player::HandleFallUnderMap() } } -void Player::RemovePossess(bool attack) -{ - if(Unit *u = GetCharm()) - u->RemoveCharmedOrPossessedBy(this); - - /*else if (target->isAlive()) - { - // If we're still hostile to our target, continue attacking otherwise reset threat and go home - if (Unit* victim = target->getVictim()) - { - FactionTemplateEntry const* t_faction = target->getFactionTemplateEntry(); - FactionTemplateEntry const* v_faction = victim->getFactionTemplateEntry(); - // Unit::IsHostileTo will always return true since the unit is always hostile to its victim - if (t_faction && v_faction && !t_faction->IsHostileTo(*v_faction)) - { - // Stop combat and remove the target from the threat lists of all its victims - target->CombatStop(); - target->getHostilRefManager().deleteReferences(); - target->DeleteThreatList(); - target->GetMotionMaster()->Clear(); - target->GetMotionMaster()->MoveTargetedHome(); - } - } - else - { - target->GetMotionMaster()->Clear(); - target->GetMotionMaster()->MoveTargetedHome(); - } - - // Add high amount of threat on the player - if(attack) - target->AddThreat(this, 1000000.0f); - }*/ -} - void Player::SetViewport(uint64 guid, bool moveable) { WorldPacket data(SMSG_CLIENT_CONTROL_UPDATE, 8+1); @@ -19106,14 +19053,13 @@ WorldObject* Player::GetFarsightTarget() const return NULL; } -void Player::RemoveFarsightTarget() +void Player::StopCastingBindSight() { if (WorldObject* fTarget = GetFarsightTarget()) { if (fTarget->isType(TYPEMASK_PLAYER | TYPEMASK_UNIT)) - ((Unit*)fTarget)->RemovePlayerFromVision(this); + ((Unit*)fTarget)->RemoveSpellsCausingAura(SPELL_AURA_BIND_SIGHT); } - ClearFarsight(); } void Player::ClearFarsight() @@ -19132,7 +19078,7 @@ void Player::SetFarsightTarget(WorldObject* obj) return; // Remove the current target if there is one - RemoveFarsightTarget(); + StopCastingBindSight(); SetUInt64Value(PLAYER_FARSIGHT, obj->GetGUID()); } diff --git a/src/game/Player.h b/src/game/Player.h index a149e559a3..7137738d20 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -899,17 +899,11 @@ class TRINITY_DLL_SPEC Player : public Unit void RemoveFromWorld(); void SetViewport(uint64 guid, bool movable); - void RemovePossess(bool attack = true); - void StopCharmOrPossess() - { - if(isPossessing()) - RemovePossess(true); - else if(GetCharm()) - Uncharm(); - } + void StopCastingCharm() { Uncharm(); } + void StopBindSight(); WorldObject* GetFarsightTarget() const; void ClearFarsight(); - void RemoveFarsightTarget(); + void StopCastingBindSight(); void SetFarsightTarget(WorldObject* target); // Controls if vision is currently on farsight object, updated in FAR_SIGHT opcode void SetFarsightVision(bool apply) { m_farsightVision = apply; } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 39954b0107..5c03f41def 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2172,11 +2172,11 @@ void Aura::HandleAuraDummy(bool apply, bool Real) { Creature *totem = ObjectAccessor::GetCreature(*caster, guid); if (totem && totem->isTotem()) - totem->AddPlayerToVision((Player*)caster); + ((Player*)caster)->CastSpell(totem, 6277, true); } } else - ((Player*)caster)->RemoveFarsightTarget(); + ((Player*)caster)->StopCastingBindSight(); return; } break; diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp index 553f7644b6..1508c6cf95 100644 --- a/src/game/TemporarySummon.cpp +++ b/src/game/TemporarySummon.cpp @@ -172,10 +172,6 @@ void TemporarySummon::Summon(TempSummonType type, uint32 lifetime) void TemporarySummon::UnSummon() { - RemoveCharmedOrPossessedBy(NULL); - - CombatStop(); - CleanupsBeforeDelete(); AddObjectToRemoveList(); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e7ff4e3ec6..6bb085eca1 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8480,22 +8480,25 @@ void Unit::RemovePlayerFromVision(Player* plr) plr->ClearFarsight(); } -void Unit::RemoveAllFromVision() +void Unit::RemoveBindSightAuras() { - while (!m_sharedVision.empty()) + /*while (!m_sharedVision.empty()) { Player* plr = *m_sharedVision.begin(); m_sharedVision.erase(m_sharedVision.begin()); plr->ClearFarsight(); - } + }*/ + RemoveSpellsCausingAura(SPELL_AURA_BIND_SIGHT); } -void Unit::UncharmSelf() +void Unit::RemoveCharmAuras() { if (!GetCharmer()) return; RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM); + RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET); + RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS); } void Unit::UnsummonAllTotems() @@ -10298,10 +10301,6 @@ void Unit::setDeathState(DeathState s) RemoveAllAurasOnDeath(); UnsummonAllTotems(); - // Possessed unit died, restore control to possessor - RemoveCharmedOrPossessedBy(NULL); - RemoveAllFromVision(); - ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); // remove aurastates allowing special moves @@ -11152,15 +11151,13 @@ void Unit::CleanupsBeforeDelete() { if(m_uint32Values) // only for fully created object { - RemoveCharmedOrPossessedBy(NULL); - RemoveAllFromVision(); + RemoveAllAuras(); InterruptNonMeleeSpells(true); m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList CombatStop(); ClearComboPointHolders(); DeleteThreatList(); getHostilRefManager().setOnlineOfflineState(false); - RemoveAllAuras(); RemoveAllGameObjects(); RemoveAllDynObjects(); GetMotionMaster()->Clear(false); // remove different non-standard movement generators. @@ -12982,14 +12979,14 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess) // Charmer stop charming if(charmer->GetTypeId() == TYPEID_PLAYER) - ((Player*)charmer)->StopCharmOrPossess(); + ((Player*)charmer)->StopCastingCharm(); // Charmed stop charming if(GetTypeId() == TYPEID_PLAYER) - ((Player*)this)->StopCharmOrPossess(); + ((Player*)this)->StopCastingCharm(); // Charmed stop being charmed - RemoveCharmedOrPossessedBy(NULL); + RemoveCharmAuras(); // Set charmed charmer->SetCharm(this); diff --git a/src/game/Unit.h b/src/game/Unit.h index 7050121c5b..e796256cfa 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1095,8 +1095,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject SharedVisionList const& GetSharedVisionList() { return m_sharedVision; } void AddPlayerToVision(Player* plr); void RemovePlayerFromVision(Player* plr); - void RemoveAllFromVision(); - void UncharmSelf(); + void RemoveBindSightAuras(); + void RemoveCharmAuras(); Pet* CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id = 0); diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index e043bbe965..7f28d3e4e9 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -249,14 +249,6 @@ void WorldSession::LogoutPlayer(bool Save) if (_player) { - // Unpossess the current possessed unit of player - _player->StopCharmOrPossess(); - - // Remove any possession of this player on logout - _player->RemoveCharmedOrPossessedBy(NULL); - - //_player->DestroyForNearbyPlayers(); - if (uint64 lguid = GetPlayer()->GetLootGUID()) DoLootRelease(lguid); From 0e282dacccac1f1dd36c3c7f01e9d63157b22b98 Mon Sep 17 00:00:00 2001 From: QAston Date: Mon, 16 Feb 2009 17:09:26 +0100 Subject: [PATCH 5/6] *Check range for channeled spells during their duration. --HG-- branch : trunk --- src/game/Spell.cpp | 7 +++++-- src/game/Spell.h | 2 +- src/game/Unit.cpp | 11 +---------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 36d0da7cae..4ebd405e16 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2108,7 +2108,7 @@ void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura) } } -void Spell::cancel(bool report) +void Spell::cancel() { if(m_spellState == SPELL_STATE_FINISHED) return; @@ -2138,7 +2138,7 @@ void Spell::cancel(bool report) m_caster->RemoveAurasDueToCasterSpell(m_spellInfo->Id, m_caster->GetGUID()); SendChannelUpdate(0); SendInterrupted(0); - SendCastResult(report ? SPELL_FAILED_INTERRUPTED : SPELL_FAILED_DONT_REPORT); + SendCastResult(SPELL_FAILED_INTERRUPTED); } break; default: @@ -5248,6 +5248,9 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time) // another non-melee non-delayed spell is casted now, abort m_Spell->cancel(); } + // Check if target of channeled spell still in range + else if (m_Spell->CheckRange(false)) + m_Spell->cancel(); else { // do the action (pass spell to channeling state) diff --git a/src/game/Spell.h b/src/game/Spell.h index 42725aa11c..a7110803ee 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -324,7 +324,7 @@ class Spell ~Spell(); void prepare(SpellCastTargets * targets, Aura* triggeredByAura = NULL); - void cancel(bool report = true); + void cancel(); void update(uint32 difftime); void cast(bool skipCheck = false); void finish(bool ok = true); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6bb085eca1..cc6d1f7aa9 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4692,8 +4692,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) && AurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()]!= SPELL_AURA_DUMMY) //don't stop channeling of scripted spells (this is actually a hack) { - caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(false); - channeled = true; + caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(); } } } @@ -4733,14 +4732,6 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) delete Aur; - if(channeled) - { - //if target is not caster remove auras also on caster - if (caster!=this) - caster->RemoveAurasAtChanneledTarget (AurSpellInfo, caster); - RemoveAurasAtChanneledTarget (AurSpellInfo, caster); - } - if(statue) statue->UnSummon(); From 5ded6c8df4920acbc14b6b21dd2d68a54e99011a Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Mon, 16 Feb 2009 18:05:53 +0100 Subject: [PATCH 6/6] *Added some spell script targets --HG-- branch : trunk --- sql/updates/1069_world_scripts.sql | 12 ++++++++++++ sql/updates/CMakeLists.txt | 1 + 2 files changed, 13 insertions(+) create mode 100644 sql/updates/1069_world_scripts.sql diff --git a/sql/updates/1069_world_scripts.sql b/sql/updates/1069_world_scripts.sql new file mode 100644 index 0000000000..0fafabf63f --- /dev/null +++ b/sql/updates/1069_world_scripts.sql @@ -0,0 +1,12 @@ +DELETE FROM `spell_script_target` WHERE `entry` IN ('44807', '32307', '32314'); +INSERT INTO `spell_script_target` (`entry`,`type`,`targetEntry`) VALUES +('44807', '1', '24850'), +('44807', '1', '24892'), +('32307', '2', '17146'), +('32307', '2', '17147'), +('32307', '2', '17148'), +('32307', '2', '18658'), +('32314', '2', '17138'), +('32314', '2', '18037'), +('32314', '2', '18064'), +('32314', '2', '18065'); \ No newline at end of file diff --git a/sql/updates/CMakeLists.txt b/sql/updates/CMakeLists.txt index 64f51f192f..6c45423e70 100644 --- a/sql/updates/CMakeLists.txt +++ b/sql/updates/CMakeLists.txt @@ -165,4 +165,5 @@ INSTALL(FILES 1018_world.sql 1026_world.sql 1028_world_scripts.sql +1069_world_scripts.sql DESTINATION share/trinity/sql/updates)