Core/Battlefield: Add missing stuff for wintergrasp
This commit is contained in:
1 parent
984493108b
commit
6891fe6248
20 files changed
+139
-106
No files matched your search
@@ -39,6 +39,11 @@ class GameObjectAI
|
||||
|
||||
virtual void Reset() {};
|
||||
|
||||
// Pass parameters between AI
|
||||
virtual void DoAction(const int32 /*param = 0 */) {}
|
||||
virtual void SetGUID(const uint64& /*guid*/, int32 /*id = 0 */) {}
|
||||
virtual uint64 GetGUID(int32 /*id = 0 */) { return 0; }
|
||||
|
||||
static int Permissible(GameObject const* go);
|
||||
|
||||
virtual bool GossipHello(Player* /*player*/) { return false; }
|
||||
|
||||
@@ -137,6 +137,11 @@ namespace FactorySelector
|
||||
|
||||
ai_factory = ai_registry.GetRegistryItem(go->GetAIName());
|
||||
|
||||
// scriptname in db
|
||||
if (!ai_factory)
|
||||
if (GameObjectAI* scriptedAI = sScriptMgr->GetGameObjectAI(go))
|
||||
return scriptedAI;
|
||||
|
||||
//future goAI types go here
|
||||
|
||||
std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key();
|
||||
|
||||
@@ -563,7 +563,7 @@ bool Battlefield::AddOrSetPlayerToCorrectBfGroup(Player* player)
|
||||
else if (group->IsMember(player->GetGUID()))
|
||||
{
|
||||
uint8 subgroup = group->GetMemberGroup(player->GetGUID());
|
||||
player->SetBattlegroundRaid(group, subgroup);
|
||||
player->SetBattlegroundOrBattlefieldRaid(group, subgroup);
|
||||
}
|
||||
else
|
||||
group->AddMember(player);
|
||||
|
||||
@@ -1213,7 +1213,7 @@ void Battleground::AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team)
|
||||
if (group->IsMember(playerGuid))
|
||||
{
|
||||
uint8 subgroup = group->GetMemberGroup(playerGuid);
|
||||
player->SetBattlegroundRaid(group, subgroup);
|
||||
player->SetBattlegroundOrBattlefieldRaid(group, subgroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -854,6 +854,13 @@ bool GameObject::IsDynTransport() const
|
||||
return gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT || (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT && !gInfo->transport.pause);
|
||||
}
|
||||
|
||||
bool GameObject::IsDestructibleBuilding() const
|
||||
{
|
||||
GameObjectTemplate const* gInfo = GetGOInfo();
|
||||
if (!gInfo) return false;
|
||||
return gInfo->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING;
|
||||
}
|
||||
|
||||
Unit* GameObject::GetOwner() const
|
||||
{
|
||||
return ObjectAccessor::GetUnit(*this, GetOwnerGUID());
|
||||
@@ -870,7 +877,7 @@ bool GameObject::IsAlwaysVisibleFor(WorldObject const* seer) const
|
||||
if (WorldObject::IsAlwaysVisibleFor(seer))
|
||||
return true;
|
||||
|
||||
if (IsTransport())
|
||||
if (IsTransport() || IsDestructibleBuilding())
|
||||
return true;
|
||||
|
||||
if (!seer)
|
||||
|
||||
@@ -632,6 +632,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
|
||||
|
||||
bool IsTransport() const;
|
||||
bool IsDynTransport() const;
|
||||
bool IsDestructibleBuilding() const;
|
||||
|
||||
uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; }
|
||||
|
||||
|
||||
@@ -2335,7 +2335,12 @@ void WorldObject::SetZoneScript()
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
|
||||
m_zoneScript = bf;
|
||||
else
|
||||
m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId());
|
||||
{
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
|
||||
m_zoneScript = bf;
|
||||
else
|
||||
m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5500,7 +5500,12 @@ void Player::RepopAtGraveyard()
|
||||
if (sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
|
||||
ClosestGrave = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())->GetClosestGraveYard(this);
|
||||
else
|
||||
ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam());
|
||||
{
|
||||
if (sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
|
||||
ClosestGrave = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())->GetClosestGraveYard(this);
|
||||
else
|
||||
ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam());
|
||||
}
|
||||
}
|
||||
|
||||
// stop countdown until repop
|
||||
@@ -7570,7 +7575,7 @@ void Player::CheckDuelDistance(time_t currTime)
|
||||
|
||||
bool Player::IsOutdoorPvPActive()
|
||||
{
|
||||
return isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (IsPvP() || sWorld->IsPvPRealm()) && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight();
|
||||
return isAlive() && !HasInvisibilityAura() && !HasStealthAura() && IsPvP() && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight();
|
||||
}
|
||||
|
||||
void Player::DuelComplete(DuelCompleteType type)
|
||||
@@ -23310,7 +23315,7 @@ bool Player::isUsingLfg()
|
||||
return sLFGMgr->GetState(guid) != LFG_STATE_NONE;
|
||||
}
|
||||
|
||||
void Player::SetBattlegroundRaid(Group* group, int8 subgroup)
|
||||
void Player::SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup)
|
||||
{
|
||||
//we must move references from m_group to m_originalGroup
|
||||
SetOriginalGroup(GetGroup(), GetSubGroup());
|
||||
@@ -23320,7 +23325,7 @@ void Player::SetBattlegroundRaid(Group* group, int8 subgroup)
|
||||
m_group.setSubGroup((uint8)subgroup);
|
||||
}
|
||||
|
||||
void Player::RemoveFromBattlegroundRaid()
|
||||
void Player::RemoveFromBattlegroundOrBattlefieldRaid()
|
||||
{
|
||||
//remove existing reference
|
||||
m_group.unlink();
|
||||
|
||||
@@ -2417,9 +2417,9 @@ class Player : public Unit, public GridObject<Player>
|
||||
Player* GetNextRandomRaidMember(float radius);
|
||||
PartyResult CanUninviteFromGroup() const;
|
||||
|
||||
// Battleground Group System
|
||||
void SetBattlegroundRaid(Group* group, int8 subgroup = -1);
|
||||
void RemoveFromBattlegroundRaid();
|
||||
// Battleground / Battlefield Group System
|
||||
void SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup = -1);
|
||||
void RemoveFromBattlegroundOrBattlefieldRaid();
|
||||
Group* GetOriginalGroup() { return m_originalGroup.getTarget(); }
|
||||
GroupReference& GetOriginalGroupRef() { return m_originalGroup; }
|
||||
uint8 GetOriginalSubGroup() const { return m_originalGroup.getSubGroup(); }
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
struct VehicleEntry;
|
||||
class Unit;
|
||||
|
||||
typedef std::set<uint64> GuidSet;
|
||||
|
||||
class Vehicle
|
||||
{
|
||||
public:
|
||||
@@ -53,6 +55,7 @@ class Vehicle
|
||||
void RelocatePassengers(float x, float y, float z, float ang);
|
||||
void RemoveAllPassengers();
|
||||
void Dismiss();
|
||||
void TeleportVehicle(float x, float y, float z, float ang);
|
||||
bool IsVehicleInUse() { return Seats.begin() != Seats.end(); }
|
||||
|
||||
SeatMap Seats;
|
||||
@@ -65,6 +68,7 @@ class Vehicle
|
||||
|
||||
Unit* _me;
|
||||
VehicleEntry const* _vehicleInfo;
|
||||
GuidSet vehiclePlayers;
|
||||
uint32 _usableSeatNum; // Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags
|
||||
uint32 _creatureEntry; // Can be different than me->GetBase()->GetEntry() in case of players
|
||||
};
|
||||
|
||||
@@ -191,6 +191,7 @@ class ObjectAccessor
|
||||
// ACCESS LIKE THAT IS NOT THREAD SAFE
|
||||
static Pet* FindPet(uint64);
|
||||
static Player* FindPlayer(uint64);
|
||||
static Creature* FindCreature(uint64);
|
||||
static Unit* FindUnit(uint64);
|
||||
static Player* FindPlayerByName(const char* name);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ bool Group::Create(Player* leader)
|
||||
m_leaderGuid = leaderGuid;
|
||||
m_leaderName = leader->GetName();
|
||||
|
||||
m_groupType = isBGGroup() ? GROUPTYPE_BGRAID : GROUPTYPE_NORMAL;
|
||||
m_groupType = (isBGGroup() || isBFGroup()) ? GROUPTYPE_BGRAID : GROUPTYPE_NORMAL;
|
||||
|
||||
if (m_groupType & GROUPTYPE_RAID)
|
||||
_initRaidSubGroupsCounter();
|
||||
@@ -116,7 +116,7 @@ bool Group::Create(Player* leader)
|
||||
m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL;
|
||||
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
|
||||
|
||||
if (!isBGGroup())
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
m_dungeonDifficulty = leader->GetDungeonDifficulty();
|
||||
m_raidDifficulty = leader->GetRaidDifficulty();
|
||||
@@ -232,7 +232,7 @@ void Group::ConvertToLFG()
|
||||
{
|
||||
m_groupType = GroupType(m_groupType | GROUPTYPE_LFG | GROUPTYPE_UNK1);
|
||||
m_lootMethod = NEED_BEFORE_GREED;
|
||||
if (!isBGGroup())
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
|
||||
@@ -251,7 +251,7 @@ void Group::ConvertToRaid()
|
||||
|
||||
_initRaidSubGroupsCounter();
|
||||
|
||||
if (!isBGGroup())
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
|
||||
|
||||
@@ -274,7 +274,7 @@ bool Group::AddInvite(Player* player)
|
||||
if (!player || player->GetGroupInvite())
|
||||
return false;
|
||||
Group* group = player->GetGroup();
|
||||
if (group && group->isBGGroup())
|
||||
if (group && (group->isBGGroup() || group->isBFGroup()))
|
||||
group = player->GetOriginalGroup();
|
||||
if (group)
|
||||
return false;
|
||||
@@ -371,8 +371,8 @@ bool Group::AddMember(Player* player)
|
||||
if (player)
|
||||
{
|
||||
player->SetGroupInvite(NULL);
|
||||
if (player->GetGroup() && isBGGroup()) //if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid()
|
||||
player->SetBattlegroundRaid(this, subGroup);
|
||||
if (player->GetGroup() && (isBGGroup() || isBFGroup())) // if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid()
|
||||
player->SetBattlegroundOrBattlefieldRaid(this, subGroup);
|
||||
else if (player->GetGroup()) //if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup()
|
||||
player->SetOriginalGroup(this, subGroup);
|
||||
else //if player is not in group, then call set group
|
||||
@@ -391,7 +391,7 @@ bool Group::AddMember(Player* player)
|
||||
}
|
||||
|
||||
// insert into the table if we're not a battleground group
|
||||
if (!isBGGroup())
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GROUP_MEMBER);
|
||||
|
||||
@@ -410,7 +410,7 @@ bool Group::AddMember(Player* player)
|
||||
|
||||
if (player)
|
||||
{
|
||||
if (!IsLeader(player->GetGUID()) && !isBGGroup())
|
||||
if (!IsLeader(player->GetGUID()) && !isBGGroup() && !isBFGroup())
|
||||
{
|
||||
// reset the new member's instances, unless he is currently in one of them
|
||||
// including raid/heroic instances that they are not permanently bound to!
|
||||
@@ -496,15 +496,15 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
if (isLFGGroup() && method == GROUP_REMOVEMETHOD_KICK)
|
||||
return m_memberSlots.size();
|
||||
|
||||
// remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG allow 1 member group)
|
||||
if (GetMembersCount() > ((isBGGroup() || isLFGGroup()) ? 1u : 2u))
|
||||
// remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG/BF allow 1 member group)
|
||||
if (GetMembersCount() > ((isBGGroup() || isLFGGroup() || isBFGroup()) ? 1u : 2u))
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
if (player)
|
||||
{
|
||||
// Battleground group handling
|
||||
if (isBGGroup())
|
||||
player->RemoveFromBattlegroundRaid();
|
||||
if (isBGGroup() || isBFGroup())
|
||||
player->RemoveFromBattlegroundOrBattlefieldRaid();
|
||||
else
|
||||
// Regular group
|
||||
{
|
||||
@@ -535,13 +535,13 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
}
|
||||
|
||||
// Remove player from group in DB
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
|
||||
|
||||
stmt->setUInt32(0, GUID_LOPART(guid));
|
||||
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
DelinkMember(guid);
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
|
||||
stmt->setUInt32(0, GUID_LOPART(guid));
|
||||
CharacterDatabase.Execute(stmt);
|
||||
DelinkMember(guid);
|
||||
}
|
||||
|
||||
// Reevaluate group enchanter if the leaving player had enchanting skill or the player is offline
|
||||
if ((player && player->GetSkillValue(SKILL_ENCHANTING)) || !player)
|
||||
@@ -632,7 +632,7 @@ void Group::ChangeLeader(uint64 guid)
|
||||
|
||||
sScriptMgr->OnGroupChangeLeader(this, m_leaderGuid, guid);
|
||||
|
||||
if (!isBGGroup())
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
// Remove the groups permanent instance bindings
|
||||
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
|
||||
@@ -692,8 +692,8 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
|
||||
//we cannot call _removeMember because it would invalidate member iterator
|
||||
//if we are removing player from battleground raid
|
||||
if (isBGGroup())
|
||||
player->RemoveFromBattlegroundRaid();
|
||||
if (isBGGroup() || isBFGroup())
|
||||
player->RemoveFromBattlegroundOrBattlefieldRaid();
|
||||
else
|
||||
{
|
||||
//we can remove player who is in battleground from his original group
|
||||
@@ -737,7 +737,7 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
|
||||
RemoveAllInvites();
|
||||
|
||||
if (!isBGGroup())
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
@@ -1507,7 +1507,7 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot)
|
||||
Player* member = ObjectAccessor::FindPlayer(citr->guid);
|
||||
|
||||
uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
|
||||
onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0);
|
||||
onlineState = onlineState | ((isBGGroup() || isBFGroup()) ? MEMBER_STATUS_PVP : 0);
|
||||
|
||||
data << citr->name;
|
||||
data << uint64(citr->guid); // guid
|
||||
@@ -1598,7 +1598,7 @@ bool Group::_setMembersGroup(uint64 guid, uint8 group)
|
||||
|
||||
SubGroupCounterIncrease(group);
|
||||
|
||||
if (!isBGGroup())
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
|
||||
|
||||
@@ -1649,7 +1649,7 @@ void Group::ChangeMembersGroup(uint64 guid, uint8 group)
|
||||
SubGroupCounterDecrease(prevSubGroup);
|
||||
|
||||
// Preserve new sub group in database for non-raid groups
|
||||
if (!isBGGroup())
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
|
||||
|
||||
@@ -1844,7 +1844,7 @@ void Roll::targetObjectBuildLink()
|
||||
void Group::SetDungeonDifficulty(Difficulty difficulty)
|
||||
{
|
||||
m_dungeonDifficulty = difficulty;
|
||||
if (!isBGGroup())
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_DIFFICULTY);
|
||||
|
||||
@@ -1868,7 +1868,7 @@ void Group::SetDungeonDifficulty(Difficulty difficulty)
|
||||
void Group::SetRaidDifficulty(Difficulty difficulty)
|
||||
{
|
||||
m_raidDifficulty = difficulty;
|
||||
if (!isBGGroup())
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_RAID_DIFFICULTY);
|
||||
|
||||
@@ -1904,7 +1904,7 @@ bool Group::InCombatToInstance(uint32 instanceId)
|
||||
|
||||
void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
|
||||
{
|
||||
if (isBGGroup())
|
||||
if (isBGGroup() || isBFGroup())
|
||||
return;
|
||||
|
||||
// method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_DISBAND
|
||||
@@ -2019,7 +2019,7 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry)
|
||||
|
||||
InstanceGroupBind* Group::BindToInstance(InstanceSave* save, bool permanent, bool load)
|
||||
{
|
||||
if (!save || isBGGroup())
|
||||
if (!save || isBGGroup() || isBFGroup())
|
||||
return NULL;
|
||||
|
||||
InstanceGroupBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()];
|
||||
|
||||
@@ -244,7 +244,7 @@ class Group
|
||||
void ConvertToRaid();
|
||||
|
||||
void SetBattlegroundGroup(Battleground* bg);
|
||||
void SetBattlefieldGroup(Battlefield *bf);
|
||||
void SetBattlefieldGroup(Battlefield* bf);
|
||||
GroupJoinBattlegroundResult CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot);
|
||||
|
||||
void ChangeMembersGroup(uint64 guid, uint8 group);
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
#include "Opcodes.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "Group.h"
|
||||
#include "Battlefield.h"
|
||||
#include "BattlefieldMgr.h"
|
||||
|
||||
void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
@@ -567,53 +565,6 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/)
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY");
|
||||
|
||||
Battleground* bg = _player->GetBattleground();
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
if (!unit->isSpiritService()) // it's not spirit service
|
||||
return;
|
||||
|
||||
if (bg)
|
||||
sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid);
|
||||
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
|
||||
bf->SendAreaSpiritHealerQueryOpcode(_player,guid);
|
||||
}
|
||||
|
||||
void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");
|
||||
|
||||
Battleground* bg = _player->GetBattleground();
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
if (!unit->isSpiritService()) // it's not spirit service
|
||||
return;
|
||||
|
||||
if (bg)
|
||||
bg->AddPlayerToResurrectQueue(guid, _player->GetGUID());
|
||||
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
|
||||
bf->AddPlayerToResurrectQueue(guid, _player->GetGUID());
|
||||
}
|
||||
|
||||
|
||||
void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BATTLEMASTER_JOIN_ARENA");
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "Group.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "Spell.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Battlefield.h"
|
||||
#include "BattlefieldMgr.h"
|
||||
|
||||
@@ -1688,6 +1689,52 @@ void WorldSession::SendSetPhaseShift(uint32 PhaseShift)
|
||||
data << uint32(PhaseShift);
|
||||
SendPacket(&data);
|
||||
}
|
||||
// Battlefield and Battleground
|
||||
void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY");
|
||||
|
||||
Battleground* bg = _player->GetBattleground();
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
if (!unit->isSpiritService()) // it's not spirit service
|
||||
return;
|
||||
|
||||
if (bg)
|
||||
sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid);
|
||||
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
|
||||
bf->SendAreaSpiritHealerQueryOpcode(_player,guid);
|
||||
}
|
||||
|
||||
void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");
|
||||
|
||||
Battleground* bg = _player->GetBattleground();
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
if (!unit->isSpiritService()) // it's not spirit service
|
||||
return;
|
||||
|
||||
if (bg)
|
||||
bg->AddPlayerToResurrectQueue(guid, _player->GetGUID());
|
||||
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
|
||||
bf->AddPlayerToResurrectQueue(guid, _player->GetGUID());
|
||||
}
|
||||
|
||||
void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recv_data*/)
|
||||
{
|
||||
|
||||
@@ -723,14 +723,6 @@ bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effInd
|
||||
return tmpscript->OnDummyEffect(caster, spellId, effIndex, target);
|
||||
}
|
||||
|
||||
GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* go)
|
||||
{
|
||||
ASSERT(go);
|
||||
|
||||
GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, NULL);
|
||||
return tmpscript->GetAI(go);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnQuestAccept(Player* player, Item* item, Quest const* quest)
|
||||
{
|
||||
ASSERT(player);
|
||||
@@ -861,6 +853,14 @@ CreatureAI* ScriptMgr::GetCreatureAI(Creature* creature)
|
||||
return tmpscript->GetAI(creature);
|
||||
}
|
||||
|
||||
GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* gameobject)
|
||||
{
|
||||
ASSERT(gameobject);
|
||||
|
||||
GET_SCRIPT_RET(GameObjectScript, gameobject->GetScriptId(), tmpscript, NULL);
|
||||
return tmpscript->GetAI(gameobject);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnCreatureUpdate(Creature* creature, uint32 diff)
|
||||
{
|
||||
ASSERT(creature);
|
||||
|
||||
@@ -1273,15 +1273,15 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
|
||||
/*0x4DC*/ { "SMSG_PVP_QUEUE_STATS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x4DD*/ { "CMSG_SET_PAID_SERVICE_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x4DE*/ { "SMSG_BATTLEFIELD_MGR_ENTRY_INVITE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x4DF*/ { "CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x4DF*/ { "CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBfEntryInviteResponse },
|
||||
/*0x4E0*/ { "SMSG_BATTLEFIELD_MGR_ENTERED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x4E1*/ { "SMSG_BATTLEFIELD_MGR_QUEUE_INVITE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x4E2*/ { "CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x4E2*/ { "CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBfQueueInviteResponse },
|
||||
/*0x4E3*/ { "CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x4E4*/ { "SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x4E5*/ { "SMSG_BATTLEFIELD_MGR_EJECT_PENDING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x4E6*/ { "SMSG_BATTLEFIELD_MGR_EJECTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x4E7*/ { "CMSG_BATTLEFIELD_MGR_EXIT_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x4E7*/ { "CMSG_BATTLEFIELD_MGR_EXIT_REQUEST", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBfExitRequest },
|
||||
/*0x4E8*/ { "SMSG_BATTLEFIELD_MGR_STATE_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x4E9*/ { "CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x4EA*/ { "CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
|
||||
@@ -5021,7 +5021,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
{
|
||||
if (Battleground* bg = target->ToPlayer()->GetBattleground())
|
||||
bg->RemovePlayerFromResurrectQueue(target->GetGUID());
|
||||
if(Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
|
||||
bf->RemovePlayerFromResurrectQueue(target->GetGUID());
|
||||
}
|
||||
break;
|
||||
@@ -5060,6 +5060,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
target->CastSpell((Unit*)NULL, GetAmount(), true, NULL, this);
|
||||
break;
|
||||
case 58600: // Restricted Flight Area
|
||||
case 58730: // Restricted Flight Area
|
||||
if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
|
||||
target->CastSpell(target, 58601, true);
|
||||
break;
|
||||
|
||||
@@ -5445,8 +5445,8 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (m_originalCaster && m_originalCaster->GetTypeId() == TYPEID_PLAYER && m_originalCaster->isAlive())
|
||||
{
|
||||
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(m_originalCaster->GetZoneId());
|
||||
if (AreaTableEntry const* pArea = GetAreaEntryByAreaID(m_originalCaster->GetAreaId()))
|
||||
if (pArea->flags & AREA_FLAG_NO_FLY_ZONE)
|
||||
if (AreaTableEntry const* area = GetAreaEntryByAreaID(m_originalCaster->GetAreaId()))
|
||||
if (area->flags & AREA_FLAG_NO_FLY_ZONE || (Bf && !Bf->CanFlyIn()))
|
||||
return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_NOT_HERE;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -6196,6 +6196,7 @@ void Spell::EffectPlayerNotification(SpellEffIndex effIndex)
|
||||
case 58730: // Restricted Flight Area
|
||||
case 58600: // Restricted Flight Area
|
||||
unitTarget->ToPlayer()->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE);
|
||||
unitTarget->PlayDirectSound(9417); // Fel Reaver sound
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user