From 9de045c6d364f5f5aa6f9602101f6b5c642b9f8d Mon Sep 17 00:00:00 2001 From: Anubisss Date: Sat, 18 Apr 2009 00:52:44 +0200 Subject: *Fix the bug in friends list that does offline players show online. --HG-- branch : trunk --- src/game/SocialMgr.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/game/SocialMgr.cpp b/src/game/SocialMgr.cpp index a0338f4abb1..8f9db3e469d 100644 --- a/src/game/SocialMgr.cpp +++ b/src/game/SocialMgr.cpp @@ -194,10 +194,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(); @@ -224,13 +228,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) -- cgit v1.2.3 From 8b7fb65c366c6c745090dce5a2fcb22964f3a020 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 17 Apr 2009 18:08:52 -0500 Subject: *Fix incorrect threat calculation of taunt spells. --HG-- branch : trunk --- src/game/SpellEffects.cpp | 22 ++++++++++++++-------- src/game/Unit.cpp | 4 ++-- 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index af7d2ee8a98..2ee6c7032b3 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4042,18 +4042,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 468859726e1..218ccf1437c 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10120,7 +10120,7 @@ void Unit::TauntApply(Unit* taunter) if (((Creature*)this)->IsAIEnabled) ((Creature*)this)->AI()->AttackStart(taunter); - m_ThreatManager.tauntApply(taunter); + //m_ThreatManager.tauntApply(taunter); } //====================================================================== @@ -10146,7 +10146,7 @@ void Unit::TauntFadeOut(Unit *taunter) return; } - m_ThreatManager.tauntFadeOut(taunter); + //m_ThreatManager.tauntFadeOut(taunter); target = m_ThreatManager.getHostilTarget(); if (target && target != taunter) -- cgit v1.2.3 From 037fd6c50c11fdbaf0a27566b935ab54de7ef950 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 18 Apr 2009 02:12:06 +0200 Subject: Fix compile caused by missing includes in r1386 --HG-- branch : trunk --- src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp | 2 ++ src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp | 2 ++ src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp | 1 + 3 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp index 394db5faa04..12f7e7b46b7 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp @@ -21,5 +21,7 @@ SDComment: Placeholer SDCategory: Sunwell_Plateau EndScriptData */ +#include "precompiled.h" + void AddSC_boss_kiljaeden() {}; diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp index fe6f123ebcc..fd9a8886962 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp @@ -21,5 +21,7 @@ SDComment: Placeholer SDCategory: Sunwell_Plateau EndScriptData */ +#include "precompiled.h" + void AddSC_boss_muru() {}; diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp index 57b4cee1648..aa20c05d128 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp @@ -21,5 +21,6 @@ SDComment: Placeholer SDCategory: Sunwell_Plateau EndScriptData */ +#include "precompiled.h" void AddSC_sunwell_plateau() {}; \ No newline at end of file -- cgit v1.2.3 From ddcc80bab5b504b0c49b43fe0d4c52301d684ac4 Mon Sep 17 00:00:00 2001 From: raczman Date: Sat, 18 Apr 2009 11:55:47 +0200 Subject: Fixed a crash in GOselect. --HG-- branch : trunk --- src/bindings/scripts/ScriptMgr.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 8ab29f769f0..1e8066a5581 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -2084,6 +2084,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]; @@ -2096,6 +2098,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]; -- cgit v1.2.3 From 402a493407fda17675c218f3160889500c5fa2b8 Mon Sep 17 00:00:00 2001 From: raczman Date: Sat, 18 Apr 2009 12:08:19 +0200 Subject: Fixed a crash in UpdateVisibilityOf --HG-- branch : trunk --- src/game/Player.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 0078ed535d3..d927b162d31 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -17816,6 +17816,8 @@ inline void UpdateVisibilityOf_helper(std::set& s64, GameObject* target) template void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set& visibleNow) { + if(!target) + return; if(HaveAtClient(target)) { if(!target->isVisibleForInState(this,true)) -- cgit v1.2.3 From 4da205dbfa865c1cfbd697eb68230406a89aba58 Mon Sep 17 00:00:00 2001 From: Rat Date: Sat, 18 Apr 2009 16:14:38 +0200 Subject: *fix reliquary of souls bug where essence did not move home when defeated --HG-- branch : trunk --- .../scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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 76aa7196300..fb4d97780ed 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) -- cgit v1.2.3 From 98e9dd0647c9b09fc672fc7bc6c95af5fdeaa1ad Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 18 Apr 2009 16:52:47 +0200 Subject: Fix quest completion of 'The City of Light' --HG-- branch : trunk --- src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp index 82b4ca4e7bc..36ea4354030 100644 --- a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp +++ b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp @@ -311,9 +311,9 @@ public: case 56: DoScriptText(WHISP21, m_creature, pTemp); if( PlayerGUID ) { - Unit* player = (Unit::GetCreature((*m_creature), PlayerGUID)); - if( player && player->GetTypeId() == TYPEID_PLAYER ) - ((Player*)player)->GroupEventHappens(10211,m_creature); + Player* player = (Unit::GetPlayer(PlayerGUID)); + if( player ) + (player)->GroupEventHappens(10211,m_creature); } break; } -- cgit v1.2.3 From 60736b1f7da05e5eee5100edc3e80fbb9e228495 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 18 Apr 2009 11:03:27 -0500 Subject: *Fix visibility update bug of long-distance teleport. --HG-- branch : trunk --- src/game/Map.cpp | 14 ++++++++++++-- src/game/Unit.h | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/Map.cpp b/src/game/Map.cpp index b12c7b477c0..8a673c8937d 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -645,16 +645,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::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter) @@ -670,6 +678,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/Unit.h b/src/game/Unit.h index 795d2982c07..f63ce4c4f23 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1416,8 +1416,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; -- cgit v1.2.3