@@ -0,0 +1 @@
|
||||
DELETE FROM `trinity_string` WHERE `entry`=5007;
|
||||
@@ -280,21 +280,11 @@ Player::Player(WorldSession* session) : Unit(true)
|
||||
|
||||
// Player summoning
|
||||
m_summon_expire = 0;
|
||||
m_summon_mapid = 0;
|
||||
m_summon_x = 0.0f;
|
||||
m_summon_y = 0.0f;
|
||||
m_summon_z = 0.0f;
|
||||
|
||||
m_mover = this;
|
||||
m_movedPlayer = this;
|
||||
m_seer = this;
|
||||
|
||||
m_recallMap = 0;
|
||||
m_recallX = 0;
|
||||
m_recallY = 0;
|
||||
m_recallZ = 0;
|
||||
m_recallO = 0;
|
||||
|
||||
m_homebindMapId = 0;
|
||||
m_homebindAreaId = 0;
|
||||
m_homebindX = 0;
|
||||
@@ -5816,15 +5806,6 @@ bool Player::UpdatePosition(float x, float y, float z, float orientation, bool t
|
||||
return true;
|
||||
}
|
||||
|
||||
void Player::SaveRecallPosition()
|
||||
{
|
||||
m_recallMap = GetMapId();
|
||||
m_recallX = GetPositionX();
|
||||
m_recallY = GetPositionY();
|
||||
m_recallZ = GetPositionZ();
|
||||
m_recallO = GetOrientation();
|
||||
}
|
||||
|
||||
void Player::SendMessageToSetInRange(WorldPacket const* data, float dist, bool self)
|
||||
{
|
||||
if (self)
|
||||
@@ -23129,13 +23110,32 @@ void Player::UpdateForQuestWorldObjects()
|
||||
GetSession()->SendPacket(&packet);
|
||||
}
|
||||
|
||||
void Player::SetSummonPoint(uint32 mapid, float x, float y, float z)
|
||||
bool Player::HasSummonPending() const
|
||||
{
|
||||
return m_summon_expire >= time(nullptr);
|
||||
}
|
||||
|
||||
void Player::SendSummonRequestFrom(Unit* summoner)
|
||||
{
|
||||
if (!summoner)
|
||||
return;
|
||||
|
||||
// Player already has active summon request
|
||||
if (HasSummonPending())
|
||||
return;
|
||||
|
||||
// Evil Twin (ignore player summon, but hide this for summoner)
|
||||
if (HasAura(23445))
|
||||
return;
|
||||
|
||||
m_summon_expire = time(nullptr) + MAX_PLAYER_SUMMON_DELAY;
|
||||
m_summon_mapid = mapid;
|
||||
m_summon_x = x;
|
||||
m_summon_y = y;
|
||||
m_summon_z = z;
|
||||
m_summon_location.WorldRelocate(*summoner);
|
||||
|
||||
WorldPackets::Movement::SummonRequest summonRequest;
|
||||
summonRequest.SummonerGUID = summoner->GetGUID();
|
||||
summonRequest.SummonerVirtualRealmAddress = GetVirtualRealmAddress();
|
||||
summonRequest.AreaID = summoner->GetZoneId();
|
||||
GetSession()->SendPacket(summonRequest.Write());
|
||||
}
|
||||
|
||||
void Player::SummonIfPossible(bool agree)
|
||||
@@ -23166,7 +23166,7 @@ void Player::SummonIfPossible(bool agree)
|
||||
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS, 1);
|
||||
|
||||
TeleportTo(m_summon_mapid, m_summon_x, m_summon_y, m_summon_z, GetOrientation());
|
||||
TeleportTo(m_summon_location);
|
||||
}
|
||||
|
||||
void Player::RemoveItemDurations(Item* item)
|
||||
|
||||
@@ -1210,7 +1210,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
bool TeleportTo(WorldLocation const &loc, uint32 options = 0);
|
||||
bool TeleportToBGEntryPoint();
|
||||
|
||||
void SetSummonPoint(uint32 mapid, float x, float y, float z);
|
||||
bool HasSummonPending() const;
|
||||
void SendSummonRequestFrom(Unit* summoner);
|
||||
void SummonIfPossible(bool agree);
|
||||
|
||||
bool Create(ObjectGuid::LowType guidlow, WorldPackets::Character::CharacterCreateInfo const* createInfo);
|
||||
@@ -2275,13 +2276,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
uint32 GetSaveTimer() const { return m_nextSave; }
|
||||
void SetSaveTimer(uint32 timer) { m_nextSave = timer; }
|
||||
|
||||
// Recall position
|
||||
uint32 m_recallMap;
|
||||
float m_recallX;
|
||||
float m_recallY;
|
||||
float m_recallZ;
|
||||
float m_recallO;
|
||||
void SaveRecallPosition();
|
||||
void SaveRecallPosition() { m_recall_location.WorldRelocate(*this); }
|
||||
void Recall() { TeleportTo(m_recall_location); }
|
||||
|
||||
void SetHomebind(WorldLocation const& loc, uint32 areaId);
|
||||
void SendBindPointUpdate() const;
|
||||
@@ -2749,10 +2745,10 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
|
||||
// Player summoning
|
||||
time_t m_summon_expire;
|
||||
uint32 m_summon_mapid;
|
||||
float m_summon_x;
|
||||
float m_summon_y;
|
||||
float m_summon_z;
|
||||
WorldLocation m_summon_location;
|
||||
|
||||
// Recall position
|
||||
WorldLocation m_recall_location;
|
||||
|
||||
DeclinedName *m_declinedname;
|
||||
Runes *m_runes;
|
||||
|
||||
@@ -1069,7 +1069,7 @@ enum TrinityStrings
|
||||
LANG_COMMAND_NO_FROZEN_PLAYERS = 5004,
|
||||
LANG_COMMAND_LIST_FREEZE = 5005,
|
||||
LANG_COMMAND_PERMA_FROZEN_PLAYER = 5006,
|
||||
LANG_INSTANCE_RAID_GROUP_ONLY = 5007,
|
||||
// = 5007, unused
|
||||
LANG_INSTANCE_CLOSED = 5008,
|
||||
LANG_COMMAND_PLAYED_TO_ALL = 5009,
|
||||
LANG_NPCINFO_LINKGUID = 5010,
|
||||
|
||||
@@ -704,3 +704,14 @@ void WorldPackets::Movement::MoveSplineDone::Read()
|
||||
_worldPacket >> movementInfo;
|
||||
_worldPacket >> SplineID;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Movement::SummonRequest::Write()
|
||||
{
|
||||
_worldPacket << SummonerGUID;
|
||||
_worldPacket << uint32(SummonerVirtualRealmAddress);
|
||||
_worldPacket << int32(AreaID);
|
||||
_worldPacket.WriteBit(SkipStartingArea);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
@@ -448,6 +448,19 @@ namespace WorldPackets
|
||||
MovementInfo movementInfo;
|
||||
int32 SplineID = 0;
|
||||
};
|
||||
|
||||
class SummonRequest final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
SummonRequest() : ServerPacket(SMSG_SUMMON_REQUEST, 16 + 4 + 4 + 1) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
ObjectGuid SummonerGUID;
|
||||
uint32 SummonerVirtualRealmAddress = 0;
|
||||
int32 AreaID = 0;
|
||||
bool SkipStartingArea = false;
|
||||
};
|
||||
}
|
||||
|
||||
ByteBuffer& operator<<(ByteBuffer& data, Movement::MonsterSplineFilterKey const& monsterSplineFilterKey);
|
||||
|
||||
@@ -1637,7 +1637,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_STREAMING_MOVIES, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SUMMON_RAID_MEMBER_VALIDATE_FAILED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELLS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SUPPRESS_NPC_GREETINGS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
|
||||
@@ -5441,6 +5441,9 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (!target || m_caster->ToPlayer() == target || (!target->IsInSameRaidWith(m_caster->ToPlayer()) && m_spellInfo->Id != 48955)) // refer-a-friend spell
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
if (target->HasSummonPending())
|
||||
return SPELL_FAILED_SUMMON_PENDING;
|
||||
|
||||
// check if our map is dungeon
|
||||
MapEntry const* map = sMapStore.LookupEntry(m_caster->GetMapId());
|
||||
if (map->IsDungeon())
|
||||
|
||||
@@ -3898,20 +3898,7 @@ void Spell::EffectSummonPlayer(SpellEffIndex /*effIndex*/)
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
// Evil Twin (ignore player summon, but hide this for summoner)
|
||||
if (unitTarget->HasAura(23445))
|
||||
return;
|
||||
|
||||
float x, y, z;
|
||||
m_caster->GetPosition(x, y, z);
|
||||
|
||||
unitTarget->ToPlayer()->SetSummonPoint(m_caster->GetMapId(), x, y, z);
|
||||
|
||||
WorldPacket data(SMSG_SUMMON_REQUEST, 8+4+4);
|
||||
data << m_caster->GetGUID(); // summoner guid
|
||||
data << uint32(m_caster->GetZoneId()); // summoner zone
|
||||
data << uint32(MAX_PLAYER_SUMMON_DELAY*IN_MILLISECONDS); // auto decline after msecs
|
||||
unitTarget->ToPlayer()->GetSession()->SendPacket(&data);
|
||||
unitTarget->ToPlayer()->SendSummonRequestFrom(m_caster);
|
||||
}
|
||||
|
||||
void Spell::EffectActivateObject(SpellEffIndex /*effIndex*/)
|
||||
|
||||
@@ -818,7 +818,7 @@ public:
|
||||
target->CleanupAfterTaxiFlight();
|
||||
}
|
||||
|
||||
target->TeleportTo(target->m_recallMap, target->m_recallX, target->m_recallY, target->m_recallZ, target->m_recallO);
|
||||
target->Recall();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user