diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp | 6 | ||||
-rw-r--r-- | src/game/Player.cpp | 11 | ||||
-rw-r--r-- | src/game/Player.h | 2 | ||||
-rw-r--r-- | src/game/SharedDefines.h | 1 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 3 |
5 files changed, 17 insertions, 6 deletions
diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp index 55aaf3d0cc8..afc5a48883e 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp @@ -386,7 +386,7 @@ struct TRINITY_DLL_DECL npc_death_knight_initiateAI : public SpellAI pDoneBy->AttackStop(); me->CastSpell(pDoneBy, SPELL_DUEL_VICTORY, true); lose = true; - me->CastSpell(me, 7267, true); + me->CastSpell(me, SPELL_ID_DUEL_BEG, true); me->RestoreFaction(); } } @@ -416,14 +416,14 @@ struct TRINITY_DLL_DECL npc_death_knight_initiateAI : public SpellAI { if (lose) { - if (!me->HasAura(7267)) + if (!me->HasAura(SPELL_ID_DUEL_BEG)) EnterEvadeMode(); return; } else if (me->getVictim()->GetTypeId() == TYPEID_PLAYER && me->getVictim()->GetHealth() * 10 < me->getVictim()->GetMaxHealth()) { - me->getVictim()->CastSpell(me->getVictim(), 7267, true); // beg + me->getVictim()->CastSpell(me->getVictim(), SPELL_ID_DUEL_BEG, true); // beg me->getVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true); EnterEvadeMode(); return; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 88507ffac86..e081958cf38 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1773,7 +1773,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati else { if(getClass() == CLASS_DEATH_KNIGHT && GetMapId() == 609 && !isGameMaster() - && !IsActiveQuest(13165)) + && !HasSpell(SPELL_ID_DEATH_GATE)) return false; // far teleport to another map @@ -18828,6 +18828,15 @@ void Player::ReportedAfkBy(Player* reporter) } } +WorldLocation Player::GetStartPosition() const +{ + PlayerInfo const *info = objmgr.GetPlayerInfo(getRace(), getClass()); + uint32 mapId = info->mapId; + if(getClass() == CLASS_DEATH_KNIGHT && HasSpell(SPELL_ID_DEATH_GATE)) + mapId = 0; + return WorldLocation(mapId, info->positionX, info->positionY, info->positionZ, 0); +} + bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool is3dDistance) const { // Always can see self diff --git a/src/game/Player.h b/src/game/Player.h index c0d936067b1..95debc07b55 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2086,6 +2086,8 @@ class MANGOS_DLL_SPEC Player : public Unit float m_homebindY; float m_homebindZ; + WorldLocation GetStartPosition() const; + // currently visible objects at player client typedef std::set<uint64> ClientGUIDs; ClientGUIDs m_clientGUIDs; diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index f7305b433c2..f7085b1b5f3 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2327,6 +2327,7 @@ enum CorpseDynFlags #define SPELL_ID_LOGINEFFECT 836 // LOGINEFFECT #define SPELL_ID_HONORLESS_TARGET 2479 // Honorless target #define SPELL_ID_DUEL_BEG 7267 // Beg +#define SPELL_ID_DEATH_GATE 50977 // Death Gate enum WeatherType { diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 9c9d10ee666..1e66b29e5f6 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5727,8 +5727,7 @@ void Spell::EffectStuck(uint32 /*i*/) if(pTarget->isInFlight()) return; - PlayerInfo const *info = objmgr.GetPlayerInfo(pTarget->getRace(), pTarget->getClass()); - pTarget->TeleportTo(info->mapId, info->positionX, info->positionY, info->positionZ, pTarget->GetOrientation(), (unitTarget==m_caster ? TELE_TO_SPELL : 0)); + pTarget->TeleportTo(pTarget->GetStartPosition(), unitTarget == m_caster ? TELE_TO_SPELL : 0); // homebind location is loaded always // pTarget->TeleportTo(pTarget->m_homebindMapId,pTarget->m_homebindX,pTarget->m_homebindY,pTarget->m_homebindZ,pTarget->GetOrientation(), (unitTarget==m_caster ? TELE_TO_SPELL : 0)); |