diff options
-rw-r--r-- | src/bindings/scripts/ScriptMgr.cpp | 4 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp | 4 | ||||
-rw-r--r-- | src/game/Map.cpp | 14 | ||||
-rw-r--r-- | src/game/Player.cpp | 2 | ||||
-rw-r--r-- | src/game/SocialMgr.cpp | 15 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 22 | ||||
-rw-r--r-- | src/game/Unit.cpp | 4 | ||||
-rw-r--r-- | src/game/Unit.h | 3 |
8 files changed, 47 insertions, 21 deletions
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 1de66cdf98d..f23fd83832d 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -1679,6 +1679,8 @@ bool GossipSelectWithCode( Player *player, Creature *_Creature, uint32 sender, u TRINITY_DLL_EXPORT bool GOSelect( Player *player, GameObject *_GO, uint32 sender, uint32 action ) { + if(!_GO) + return false; debug_log("TSCR: Gossip selection, sender: %d, action: %d",sender, action); Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId]; @@ -1691,6 +1693,8 @@ bool GOSelect( Player *player, GameObject *_GO, uint32 sender, uint32 action ) TRINITY_DLL_EXPORT bool GOSelectWithCode( Player *player, GameObject *_GO, uint32 sender, uint32 action, const char* sCode ) { + if(!_GO) + return false; debug_log("TSCR: Gossip selection, sender: %d, action: %d",sender, action); Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId]; diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp index 353a16fe0e7..7a78e767279 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp @@ -268,7 +268,11 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE); //Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE); //rotate and disappear else + { + Essence->AI()->EnterEvadeMode(); + Essence->GetMotionMaster()->MoveFollow(m_creature, 0, 0); return; + } break; case 5: if(Phase == 1) diff --git a/src/game/Map.cpp b/src/game/Map.cpp index c6c74a74493..ebd88b38c47 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -642,16 +642,24 @@ void Map::RelocationNotify() unit->m_Notified = true; unit->m_IsInNotifyList = false; + float dist = abs(unit->GetPositionX() - unit->oldX) + abs(unit->GetPositionY() - unit->oldY); + if(dist > 10.0f) + { + Trinity::VisibleChangesNotifier notifier(*unit); + VisitWorld(unit->oldX, unit->oldY, World::GetMaxVisibleDistance(), notifier); + dist = 0; + } + if(unit->GetTypeId() == TYPEID_PLAYER) { Trinity::PlayerRelocationNotifier notifier(*((Player*)unit)); - VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier); + VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance() + dist, notifier); notifier.Notify(); } else { Trinity::CreatureRelocationNotifier notifier(*((Creature*)unit)); - VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier); + VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance() + dist, notifier); } } for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter) @@ -667,6 +675,8 @@ void Map::AddUnitToNotify(Unit* u) return; u->m_IsInNotifyList = true; + u->oldX = u->GetPositionX(); + u->oldY = u->GetPositionY(); if(i_lock) i_unitsToNotifyBacklog.push_back(u->GetGUID()); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index c8317e96148..4fb75a9fdad 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -18164,6 +18164,8 @@ inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, GameObject* target) template<class T> void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<WorldObject*>& visibleNow) { + if(!target) + return; if(HaveAtClient(target)) { if(!target->isVisibleForInState(this,true)) diff --git a/src/game/SocialMgr.cpp b/src/game/SocialMgr.cpp index 529517d824a..2786618fbf8 100644 --- a/src/game/SocialMgr.cpp +++ b/src/game/SocialMgr.cpp @@ -186,10 +186,14 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri if(!player) return; - Player *pFriend = ObjectAccessor::FindPlayer(friendGUID); + friendInfo.Status = FRIEND_STATUS_OFFLINE; + friendInfo.Area = 0; + friendInfo.Level = 0; + friendInfo.Class = 0; + Player *pFriend = ObjectAccessor::FindPlayer(friendGUID); if(!pFriend) - return; + return; uint32 team = player->GetTeam(); uint32 security = player->GetSession()->GetSecurity(); @@ -216,13 +220,6 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri friendInfo.Level = pFriend->getLevel(); friendInfo.Class = pFriend->getClass(); } - else - { - friendInfo.Status = FRIEND_STATUS_OFFLINE; - friendInfo.Area = 0; - friendInfo.Level = 0; - friendInfo.Class = 0; - } } void SocialMgr::MakeFriendStatusPacket(FriendsResult result, uint32 guid, WorldPacket *data) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index c08e1bea198..604be4ba554 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4023,18 +4023,24 @@ void Spell::EffectTaunt(uint32 /*i*/) { // this effect use before aura Taunt apply for prevent taunt already attacking target // for spell as marked "non effective at already attacking target" - if(unitTarget && unitTarget->GetTypeId() != TYPEID_PLAYER) + if(!unitTarget || !unitTarget->CanHaveThreatList() + || unitTarget->getVictim() == m_caster) { - if(unitTarget->getVictim()==m_caster) - { - SendCastResult(SPELL_FAILED_DONT_REPORT); - return; - } + SendCastResult(SPELL_FAILED_DONT_REPORT); + return; } // Also use this effect to set the taunter's threat to the taunted creature's highest value - if(unitTarget->CanHaveThreatList() && unitTarget->getThreatManager().getCurrentVictim()) - unitTarget->getThreatManager().addThreat(m_caster,unitTarget->getThreatManager().getCurrentVictim()->getThreat()); + if(unitTarget->getThreatManager().getCurrentVictim()) + { + float myThreat = unitTarget->getThreatManager().getThreat(m_caster); + float itsThreat = unitTarget->getThreatManager().getCurrentVictim()->getThreat(); + if(itsThreat > myThreat) + unitTarget->getThreatManager().addThreat(m_caster, itsThreat - myThreat); + } + + if(((Creature*)unitTarget)->IsAIEnabled) + ((Creature*)unitTarget)->AI()->AttackStart(m_caster); } void Spell::EffectWeaponDmg(uint32 i) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index aa3dfc81af2..850ee996d14 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10249,7 +10249,7 @@ void Unit::TauntApply(Unit* taunter) if (((Creature*)this)->IsAIEnabled) ((Creature*)this)->AI()->AttackStart(taunter); - m_ThreatManager.tauntApply(taunter); + //m_ThreatManager.tauntApply(taunter); } //====================================================================== @@ -10275,7 +10275,7 @@ void Unit::TauntFadeOut(Unit *taunter) return; } - m_ThreatManager.tauntFadeOut(taunter); + //m_ThreatManager.tauntFadeOut(taunter); target = m_ThreatManager.getHostilTarget(); if (target && target != taunter) diff --git a/src/game/Unit.h b/src/game/Unit.h index 60f1a113175..ec400111a35 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1581,8 +1581,11 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void AddPetAura(PetAura const* petSpell); void RemovePetAura(PetAura const* petSpell); + // relocation notification void SetToNotify(); bool m_Notified, m_IsInNotifyList; + float oldX, oldY; + void SetReducedThreatPercent(uint32 pct, uint64 guid) { m_reducedThreatPercent = pct; |