*Fix the bug that .start always send dk back to start zone.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-17 23:51:08 -05:00
parent 98f58a0f0a
commit a690f5239c
5 changed files with 17 additions and 6 deletions
@@ -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;
+10 -1
View File
@@ -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
+2
View File
@@ -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;
+1
View File
@@ -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
{
+1 -2
View File
@@ -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));