Core: Add wintergrasp-patch to wintergrasp_cleanup branch - resurrected from an old work-repository, now over as a branch to work on.
Original patch by socolin, cand a ton of contributors : mathman, joda, spp, silinoron, josh, malcrom, shauren, machiavelli, click, rat, leak, tobmaps, _manuel_, the tcfr team (via socolin), and tons of others for chiming in. NOTE: THIS IS A WORKING-BRANCH, AND _NOT_ MENT FOR PUBLIC USE OR EVEN CONSIDERED STABLE!
This commit is contained in:
@@ -831,6 +831,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());
|
||||
@@ -847,7 +854,7 @@ bool GameObject::isAlwaysVisibleFor(WorldObject const* seer) const
|
||||
if (WorldObject::isAlwaysVisibleFor(seer))
|
||||
return true;
|
||||
|
||||
if (IsTransport())
|
||||
if (IsTransport() || IsDestructibleBuilding())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -631,6 +631,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
|
||||
|
||||
bool IsTransport() const;
|
||||
bool IsDynTransport() const;
|
||||
bool IsDestructibleBuilding() const;
|
||||
|
||||
uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; }
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Totem.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
@@ -2210,7 +2210,12 @@ void WorldObject::SetZoneScript()
|
||||
if (map->IsDungeon())
|
||||
m_zoneScript = (ZoneScript*)((InstanceMap*)map)->GetInstanceScript();
|
||||
else if (!map->IsBattlegroundOrArena())
|
||||
m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId());
|
||||
{
|
||||
if (Battlefield* bf = sBattlefieldMgr.GetBattlefieldToZoneId(GetZoneId()))
|
||||
m_zoneScript = bf;
|
||||
else
|
||||
m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
#include "DisableMgr.h"
|
||||
#include "WeatherMgr.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "CharacterDatabaseCleaner.h"
|
||||
#include "InstanceScript.h"
|
||||
#include <cmath>
|
||||
@@ -2405,6 +2406,7 @@ void Player::RemoveFromWorld()
|
||||
StopCastingBindSight();
|
||||
UnsummonPetTemporaryIfAny();
|
||||
sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
||||
sBattlefieldMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
||||
}
|
||||
|
||||
///- Do not add/remove the player from the object storage
|
||||
@@ -5483,7 +5485,12 @@ void Player::RepopAtGraveyard()
|
||||
if (Battleground *bg = GetBattleground())
|
||||
ClosestGrave = bg->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
|
||||
m_deathTimer = 0;
|
||||
@@ -7379,6 +7386,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
||||
{
|
||||
sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
||||
sOutdoorPvPMgr->HandlePlayerEnterZone(this, newZone);
|
||||
sBattlefieldMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
||||
sBattlefieldMgr.HandlePlayerEnterZone(this, newZone);
|
||||
SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
|
||||
}
|
||||
|
||||
@@ -7513,7 +7522,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)
|
||||
@@ -22547,7 +22556,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());
|
||||
@@ -22557,7 +22566,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();
|
||||
|
||||
@@ -2378,8 +2378,8 @@ 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();
|
||||
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(); }
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#include "Vehicle.h"
|
||||
#include "Transport.h"
|
||||
#include "InstanceScript.h"
|
||||
|
||||
#include "BattlefieldMgr.h"
|
||||
#include <math.h>
|
||||
|
||||
float baseMoveSpeed[MAX_MOVE_TYPE] =
|
||||
@@ -15487,9 +15487,14 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
|
||||
// outdoor pvp things, do these after setting the death state, else the player activity notify won't work... doh...
|
||||
// handle player kill only if not suicide (spirit of redemption for example)
|
||||
if (player && this != victim)
|
||||
{
|
||||
if (OutdoorPvP* pvp = player->GetOutdoorPvP())
|
||||
pvp->HandleKill(player, victim);
|
||||
|
||||
if (Battlefield* bf = sBattlefieldMgr.GetBattlefieldToZoneId(player->GetZoneId()))
|
||||
bf->HandleKill(player, victim);
|
||||
}
|
||||
|
||||
//if (pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
// if (OutdoorPvP* pvp = pVictim->ToPlayer()->GetOutdoorPvP())
|
||||
// pvp->HandlePlayerActivityChangedpVictim->ToPlayer();
|
||||
|
||||
@@ -178,8 +178,13 @@ void Vehicle::ApplyAllImmunities()
|
||||
// Different immunities for vehicles goes below
|
||||
switch (GetVehicleInfo()->m_ID)
|
||||
{
|
||||
case 160:
|
||||
case 160: //Isle of conquest turret
|
||||
case 244: //Wintergrasp turret
|
||||
_me->SetControlled(true, UNIT_STAT_ROOT);
|
||||
//me->AddUnitMovementFlag(MOVEMENTFLAG_ROOT);
|
||||
//me->SetSpeed(MOVE_TURN_RATE, 0.7f);
|
||||
//me->SetSpeed(MOVE_PITCH_RATE, 0.7f);
|
||||
//me->m_movementInfo.flags2=59;
|
||||
_me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_DECREASE_SPEED, true);
|
||||
break;
|
||||
default:
|
||||
@@ -464,6 +469,20 @@ void Vehicle::Dismiss()
|
||||
_me->AddObjectToRemoveList();
|
||||
}
|
||||
|
||||
void Vehicle::TeleportVehicle(float x, float y, float z, float ang)
|
||||
{
|
||||
vehiclePlayers.clear();
|
||||
for(int8 i = 0; i < 8; i++)
|
||||
if (Unit* player = GetPassenger(i))
|
||||
vehiclePlayers.insert(player->GetGUID());
|
||||
|
||||
RemoveAllPassengers(); // this can unlink Guns from Siege Engines
|
||||
_me->NearTeleportTo(x, y, z, ang);
|
||||
for (GuidSet::const_iterator itr = vehiclePlayers.begin(); itr != vehiclePlayers.end(); ++itr)
|
||||
if(Unit* plr = sObjectAccessor->FindUnit(*itr))
|
||||
plr->NearTeleportTo(x, y, z, ang);
|
||||
}
|
||||
|
||||
void Vehicle::InitMovementInfoForBase()
|
||||
{
|
||||
uint32 vehicleFlags = GetVehicleInfo()->m_flags;
|
||||
|
||||
@@ -98,6 +98,7 @@ struct VehicleAccessory
|
||||
typedef std::vector<VehicleAccessory> VehicleAccessoryList;
|
||||
typedef std::map<uint32, VehicleAccessoryList> VehicleAccessoryMap;
|
||||
typedef std::map<int8, VehicleSeat> SeatMap;
|
||||
typedef std::set<uint64> GuidSet;
|
||||
|
||||
class Vehicle
|
||||
{
|
||||
@@ -129,6 +130,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;
|
||||
@@ -144,6 +146,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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user