*Alterac Valley. By Bogie and Balrok. Note: some core contents are modified. Will fix them later. Some sql are disabled because of possible conflict with offical DB. Use them at your own risk.
--HG-- branch : trunk
This commit is contained in:
@@ -362,6 +362,23 @@ void BattleGround::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGround::YellToAll(Creature* creature, const char* text, uint32 language)
|
||||
{
|
||||
for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
if(!plr)
|
||||
{
|
||||
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first);
|
||||
continue;
|
||||
}
|
||||
creature->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,creature->GetName(),itr->first);
|
||||
plr->GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BattleGround::RewardHonorToTeam(uint32 Honor, uint32 TeamID)
|
||||
{
|
||||
for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
@@ -1218,6 +1235,22 @@ void BattleGround::DoorOpen(uint32 type)
|
||||
}
|
||||
}
|
||||
|
||||
GameObject* BattleGround::GetBGObject(uint32 type)
|
||||
{
|
||||
GameObject *obj = HashMapHolder<GameObject>::Find(m_BgObjects[type]);
|
||||
if(!obj)
|
||||
sLog.outError("couldn't get gameobject %i",type);
|
||||
return obj;
|
||||
}
|
||||
|
||||
Creature* BattleGround::GetBGCreature(uint32 type)
|
||||
{
|
||||
Creature *creature = HashMapHolder<Creature>::Find(m_BgCreatures[type]);
|
||||
if(!creature)
|
||||
sLog.outError("couldn't get creature %i",type);
|
||||
return creature;
|
||||
}
|
||||
|
||||
void BattleGround::SpawnBGObject(uint32 type, uint32 respawntime)
|
||||
{
|
||||
Map * map = MapManager::Instance().FindMap(GetMapId(),GetInstanceID());
|
||||
@@ -1269,6 +1302,16 @@ Creature* BattleGround::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CreatureData &data = objmgr.NewOrExistCreatureData(pCreature->GetDBTableGUIDLow());
|
||||
|
||||
data.id = entry;
|
||||
// data.mapid = GetMapId();
|
||||
data.posX = x;
|
||||
data.posY = y;
|
||||
data.posZ = z;
|
||||
data.orientation = o;
|
||||
data.spawndist = 15;
|
||||
|
||||
pCreature->AIM_Initialize();
|
||||
|
||||
//pCreature->SetDungeonDifficulty(0);
|
||||
@@ -1287,6 +1330,7 @@ bool BattleGround::DelCreature(uint32 type)
|
||||
sLog.outError("Can't find creature guid: %u",GUID_LOPART(m_BgCreatures[type]));
|
||||
return false;
|
||||
}
|
||||
//TODO: only delete creature after not in combat
|
||||
cr->CleanupsBeforeDelete();
|
||||
cr->AddObjectToRemoveList();
|
||||
m_BgCreatures[type] = 0;
|
||||
@@ -1474,3 +1518,16 @@ void BattleGround::SetHoliday(bool is_holiday)
|
||||
else
|
||||
m_HonorMode = BG_NORMAL;
|
||||
}
|
||||
|
||||
int32 BattleGround::GetObjectType(uint64 guid)
|
||||
{
|
||||
for(uint32 i = 0;i <= m_BgObjects.size(); i++)
|
||||
if(m_BgObjects[i] == guid)
|
||||
return i;
|
||||
sLog.outError("BattleGround: cheating? a player used a gameobject which isnt supposed to be a usable object!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
void BattleGround::HandleKillUnit(Creature *creature, Player *killer)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -354,6 +354,8 @@ class BattleGround
|
||||
|
||||
void StartBattleGround();
|
||||
|
||||
GameObject* GetBGObject(uint32 type);
|
||||
Creature* GetBGCreature(uint32 type);
|
||||
/* Location */
|
||||
void SetMapId(uint32 MapID) { m_MapId = MapID; }
|
||||
uint32 GetMapId() const { return m_MapId; }
|
||||
@@ -373,6 +375,7 @@ class BattleGround
|
||||
virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
|
||||
void SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *sender = NULL, bool self = true);
|
||||
void SendPacketToAll(WorldPacket *packet);
|
||||
void YellToAll(Creature* creature, const char* text, uint32 language);
|
||||
void PlaySoundToTeam(uint32 SoundID, uint32 TeamID);
|
||||
void PlaySoundToAll(uint32 SoundID);
|
||||
void CastSpellOnTeam(uint32 SpellID, uint32 TeamID);
|
||||
@@ -423,6 +426,7 @@ class BattleGround
|
||||
virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/) {}
|
||||
// must be implemented in BG subclass if need AND call base class generic code
|
||||
virtual void HandleKillPlayer(Player *player, Player *killer);
|
||||
virtual void HandleKillUnit(Creature* /*unit*/, Player* /*killer*/);
|
||||
|
||||
/* Battleground events */
|
||||
/* these functions will return true event is possible, but false if player is bugger */
|
||||
@@ -452,6 +456,7 @@ class BattleGround
|
||||
bool DelCreature(uint32 type);
|
||||
bool DelObject(uint32 type);
|
||||
bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, uint32 team);
|
||||
int32 GetObjectType(uint64 guid);
|
||||
|
||||
void DoorOpen(uint32 type);
|
||||
void DoorClose(uint32 type);
|
||||
|
||||
+1333
-6
File diff suppressed because it is too large
Load Diff
+1523
-3
File diff suppressed because it is too large
Load Diff
@@ -577,6 +577,7 @@ bool Creature::Create (uint32 guidlow, Map *map, uint32 Entry, uint32 team, cons
|
||||
{
|
||||
SetMapId(map->GetId());
|
||||
SetInstanceId(map->GetInstanceId());
|
||||
m_DBTableGuid = guidlow;
|
||||
|
||||
//oX = x; oY = y; dX = x; dY = y; m_moveTime = 0; m_startMove = 0;
|
||||
const bool bResult = CreateFromProto(guidlow, Entry, team, data);
|
||||
@@ -603,7 +604,6 @@ bool Creature::Create (uint32 guidlow, Map *map, uint32 Entry, uint32 team, cons
|
||||
}
|
||||
LoadCreaturesAddon();
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -611,7 +611,6 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
void GetCombatStartPosition(float &x, float &y, float &z) { x = CombatStartX; y = CombatStartY; z = CombatStartZ; }
|
||||
|
||||
uint32 GetGlobalCooldown() const { return m_GlobalCooldown; }
|
||||
|
||||
protected:
|
||||
bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL);
|
||||
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);
|
||||
@@ -660,6 +659,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
float CombatStartX;
|
||||
float CombatStartY;
|
||||
float CombatStartZ;
|
||||
|
||||
private:
|
||||
GridReference<Creature> m_gridRef;
|
||||
CreatureInfo const* m_creatureInfo; // in heroic mode can different from ObjMgr::GetCreatureTemplate(GetEntry())
|
||||
|
||||
+10
-1
@@ -37,8 +37,9 @@
|
||||
#include "CellImpl.h"
|
||||
#include "InstanceData.h"
|
||||
#include "BattleGround.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "Util.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "BattleGroundAV.h"
|
||||
|
||||
GameObject::GameObject() : WorldObject()
|
||||
{
|
||||
@@ -754,7 +755,15 @@ bool GameObject::ActivateToQuest( Player *pTarget)const
|
||||
case GAMEOBJECT_TYPE_CHEST:
|
||||
{
|
||||
if(LootTemplates_Gameobject.HaveQuestLootForPlayer(GetLootId(), pTarget))
|
||||
{
|
||||
//TODO: fix this hack
|
||||
//look for battlegroundAV for some objects which are only activated after mine gots captured by own team
|
||||
if(GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S)
|
||||
if(BattleGround *bg = pTarget->GetBattleGround())
|
||||
if(bg->GetTypeID() == BATTLEGROUND_AV && !(((BattleGroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(),pTarget->GetTeam())))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GAMEOBJECT_TYPE_GOOBER:
|
||||
|
||||
+39
-1
@@ -644,7 +644,45 @@ enum TrinityStrings
|
||||
LANG_HIS_ARENA_LEVEL_REQ_ERROR = 714,
|
||||
LANG_YOUR_BG_LEVEL_REQ_ERROR = 715,
|
||||
LANG_YOUR_ARENA_TEAM_FULL = 716,
|
||||
// Room for BG/ARENA 717-799 not used
|
||||
|
||||
LANG_BG_AV_ALLY = 717,
|
||||
LANG_BG_AV_HORDE = 718,
|
||||
LANG_BG_AV_TOWER_TAKEN = 719,
|
||||
LANG_BG_AV_TOWER_ASSAULTED = 720,
|
||||
LANG_BG_AV_TOWER_DEFENDED = 721,
|
||||
LANG_BG_AV_GRAVE_TAKEN = 722,
|
||||
LANG_BG_AV_GRAVE_DEFENDED = 723,
|
||||
LANG_BG_AV_GRAVE_ASSAULTED = 724,
|
||||
|
||||
LANG_BG_AV_MINE_TAKEN = 725,
|
||||
LANG_BG_AV_MINE_NORTH = 726,
|
||||
LANG_BG_AV_MINE_SOUTH = 727,
|
||||
|
||||
LANG_BG_AV_NODE_GRAVE_STORM_AID = 728,
|
||||
LANG_BG_AV_NODE_TOWER_DUN_S = 729,
|
||||
LANG_BG_AV_NODE_TOWER_DUN_N = 730,
|
||||
LANG_BG_AV_NODE_GRAVE_STORMPIKE = 731,
|
||||
LANG_BG_AV_NODE_TOWER_ICEWING = 732,
|
||||
LANG_BG_AV_NODE_GRAVE_STONE = 733,
|
||||
LANG_BG_AV_NODE_TOWER_STONE = 734,
|
||||
LANG_BG_AV_NODE_GRAVE_SNOW = 735,
|
||||
LANG_BG_AV_NODE_TOWER_ICE = 736,
|
||||
LANG_BG_AV_NODE_GRAVE_ICE = 737,
|
||||
LANG_BG_AV_NODE_TOWER_POINT = 738,
|
||||
LANG_BG_AV_NODE_GRAVE_FROST = 739,
|
||||
LANG_BG_AV_NODE_TOWER_FROST_E = 740,
|
||||
LANG_BG_AV_NODE_TOWER_FROST_W = 741,
|
||||
LANG_BG_AV_NODE_GRAVE_FROST_HUT = 742,
|
||||
|
||||
LANG_BG_AV_ONEMINTOSTART = 743,
|
||||
LANG_BG_AV_HALFMINTOSTART = 744,
|
||||
LANG_BG_AV_STARTED = 745,
|
||||
LANG_BG_AV_A_NEAR_LOSE = 746,
|
||||
LANG_BG_AV_H_NEAR_LOSE = 747,
|
||||
LANG_BG_AV_H_CAPTAIN_DEAD = 748,
|
||||
LANG_BG_AV_A_CAPTAIN_DEAD = 749,
|
||||
|
||||
// Room for BG/ARENA 750-799 not used
|
||||
|
||||
LANG_ARENA_YOUR_TEAM_ONLY = 730,
|
||||
LANG_ARENA_NOT_ENOUGH_PLAYERS = 731,
|
||||
|
||||
@@ -70,6 +70,16 @@ void WorldSession::HandleAutostoreLootItemOpcode( WorldPacket & recv_data )
|
||||
|
||||
loot = &pItem->loot;
|
||||
}
|
||||
else if (IS_CORPSE_GUID(lguid))
|
||||
{
|
||||
Corpse *bones = ObjectAccessor::GetCorpse(*player, lguid);
|
||||
if (!bones)
|
||||
{
|
||||
player->SendLootRelease(lguid);
|
||||
return;
|
||||
}
|
||||
loot = &bones->loot;
|
||||
}
|
||||
else
|
||||
{
|
||||
Creature* pCreature =
|
||||
|
||||
+161
-141
@@ -54,6 +54,7 @@
|
||||
#include "Transports.h"
|
||||
#include "Weather.h"
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundAV.h"
|
||||
#include "BattleGroundMgr.h"
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
@@ -4160,7 +4161,7 @@ void Player::RepopAtGraveyard()
|
||||
// Special handle for battleground maps
|
||||
BattleGround *bg = sBattleGroundMgr.GetBattleGround(GetBattleGroundId());
|
||||
|
||||
if(bg && (bg->GetTypeID() == BATTLEGROUND_AB || bg->GetTypeID() == BATTLEGROUND_EY))
|
||||
if(bg && (bg->GetTypeID() == BATTLEGROUND_AB || bg->GetTypeID() == BATTLEGROUND_EY || bg->GetTypeID() == BATTLEGROUND_AV))
|
||||
ClosestGrave = bg->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetTeam());
|
||||
else
|
||||
ClosestGrave = objmgr.GetClosestGraveYard( GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam() );
|
||||
@@ -7215,6 +7216,16 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
||||
{
|
||||
uint32 lootid = go->GetLootId();
|
||||
|
||||
//TODO: fix this big hack
|
||||
if((go->GetEntry() == BG_AV_OBJECTID_MINE_N || go->GetEntry() == BG_AV_OBJECTID_MINE_S))
|
||||
if( BattleGround *bg = GetBattleGround())
|
||||
if(bg->GetTypeID() == BATTLEGROUND_AV)
|
||||
if(!(((BattleGroundAV*)bg)->PlayerCanDoMineQuest(go->GetEntry(),GetTeam())))
|
||||
{
|
||||
SendLootRelease(guid);
|
||||
return;
|
||||
}
|
||||
|
||||
if(lootid)
|
||||
{
|
||||
sLog.outDebug(" if(lootid)");
|
||||
@@ -7291,6 +7302,8 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
||||
bones->lootForBody = true;
|
||||
uint32 pLevel = bones->loot.gold;
|
||||
bones->loot.clear();
|
||||
if(GetBattleGround()->GetTypeID() == BATTLEGROUND_AV)
|
||||
loot->FillLoot(1, LootTemplates_Creature, this);
|
||||
// It may need a better formula
|
||||
// Now it works like this: lvl10: ~6copper, lvl70: ~9silver
|
||||
bones->loot.gold = (uint32)( urand(50, 150) * 0.016f * pow( ((float)pLevel)/5.76f, 2.5f) * sWorld.getRate(RATE_DROP_MONEY) );
|
||||
@@ -7664,81 +7677,86 @@ void Player::SendInitWorldStates(bool forceZone, uint32 forceZoneId)
|
||||
}
|
||||
break;
|
||||
case 2597: // AV
|
||||
data << uint32(0x7ae) << uint32(0x1); // 7
|
||||
data << uint32(0x532) << uint32(0x1); // 8
|
||||
data << uint32(0x531) << uint32(0x0); // 9
|
||||
data << uint32(0x52e) << uint32(0x0); // 10
|
||||
data << uint32(0x571) << uint32(0x0); // 11
|
||||
data << uint32(0x570) << uint32(0x0); // 12
|
||||
data << uint32(0x567) << uint32(0x1); // 13
|
||||
data << uint32(0x566) << uint32(0x1); // 14
|
||||
data << uint32(0x550) << uint32(0x1); // 15
|
||||
data << uint32(0x544) << uint32(0x0); // 16
|
||||
data << uint32(0x536) << uint32(0x0); // 17
|
||||
data << uint32(0x535) << uint32(0x1); // 18
|
||||
data << uint32(0x518) << uint32(0x0); // 19
|
||||
data << uint32(0x517) << uint32(0x0); // 20
|
||||
data << uint32(0x574) << uint32(0x0); // 21
|
||||
data << uint32(0x573) << uint32(0x0); // 22
|
||||
data << uint32(0x572) << uint32(0x0); // 23
|
||||
data << uint32(0x56f) << uint32(0x0); // 24
|
||||
data << uint32(0x56e) << uint32(0x0); // 25
|
||||
data << uint32(0x56d) << uint32(0x0); // 26
|
||||
data << uint32(0x56c) << uint32(0x0); // 27
|
||||
data << uint32(0x56b) << uint32(0x0); // 28
|
||||
data << uint32(0x56a) << uint32(0x1); // 29
|
||||
data << uint32(0x569) << uint32(0x1); // 30
|
||||
data << uint32(0x568) << uint32(0x1); // 13
|
||||
data << uint32(0x565) << uint32(0x0); // 32
|
||||
data << uint32(0x564) << uint32(0x0); // 33
|
||||
data << uint32(0x563) << uint32(0x0); // 34
|
||||
data << uint32(0x562) << uint32(0x0); // 35
|
||||
data << uint32(0x561) << uint32(0x0); // 36
|
||||
data << uint32(0x560) << uint32(0x0); // 37
|
||||
data << uint32(0x55f) << uint32(0x0); // 38
|
||||
data << uint32(0x55e) << uint32(0x0); // 39
|
||||
data << uint32(0x55d) << uint32(0x0); // 40
|
||||
data << uint32(0x3c6) << uint32(0x4); // 41
|
||||
data << uint32(0x3c4) << uint32(0x6); // 42
|
||||
data << uint32(0x3c2) << uint32(0x4); // 43
|
||||
data << uint32(0x516) << uint32(0x1); // 44
|
||||
data << uint32(0x515) << uint32(0x0); // 45
|
||||
data << uint32(0x3b6) << uint32(0x6); // 46
|
||||
data << uint32(0x55c) << uint32(0x0); // 47
|
||||
data << uint32(0x55b) << uint32(0x0); // 48
|
||||
data << uint32(0x55a) << uint32(0x0); // 49
|
||||
data << uint32(0x559) << uint32(0x0); // 50
|
||||
data << uint32(0x558) << uint32(0x0); // 51
|
||||
data << uint32(0x557) << uint32(0x0); // 52
|
||||
data << uint32(0x556) << uint32(0x0); // 53
|
||||
data << uint32(0x555) << uint32(0x0); // 54
|
||||
data << uint32(0x554) << uint32(0x1); // 55
|
||||
data << uint32(0x553) << uint32(0x1); // 56
|
||||
data << uint32(0x552) << uint32(0x1); // 57
|
||||
data << uint32(0x551) << uint32(0x1); // 58
|
||||
data << uint32(0x54f) << uint32(0x0); // 59
|
||||
data << uint32(0x54e) << uint32(0x0); // 60
|
||||
data << uint32(0x54d) << uint32(0x1); // 61
|
||||
data << uint32(0x54c) << uint32(0x0); // 62
|
||||
data << uint32(0x54b) << uint32(0x0); // 63
|
||||
data << uint32(0x545) << uint32(0x0); // 64
|
||||
data << uint32(0x543) << uint32(0x1); // 65
|
||||
data << uint32(0x542) << uint32(0x0); // 66
|
||||
data << uint32(0x540) << uint32(0x0); // 67
|
||||
data << uint32(0x53f) << uint32(0x0); // 68
|
||||
data << uint32(0x53e) << uint32(0x0); // 69
|
||||
data << uint32(0x53d) << uint32(0x0); // 70
|
||||
data << uint32(0x53c) << uint32(0x0); // 71
|
||||
data << uint32(0x53b) << uint32(0x0); // 72
|
||||
data << uint32(0x53a) << uint32(0x1); // 73
|
||||
data << uint32(0x539) << uint32(0x0); // 74
|
||||
data << uint32(0x538) << uint32(0x0); // 75
|
||||
data << uint32(0x537) << uint32(0x0); // 76
|
||||
data << uint32(0x534) << uint32(0x0); // 77
|
||||
data << uint32(0x533) << uint32(0x0); // 78
|
||||
data << uint32(0x530) << uint32(0x0); // 79
|
||||
data << uint32(0x52f) << uint32(0x0); // 80
|
||||
data << uint32(0x52d) << uint32(0x1); // 81
|
||||
if (bg && bg->GetTypeID() == BATTLEGROUND_AV)
|
||||
bg->FillInitialWorldStates(data);
|
||||
else
|
||||
{
|
||||
data << uint32(0x7ae) << uint32(0x1); // 7 snowfall n
|
||||
data << uint32(0x532) << uint32(0x1); // 8 frostwolfhut hc
|
||||
data << uint32(0x531) << uint32(0x0); // 9 frostwolfhut ac
|
||||
data << uint32(0x52e) << uint32(0x0); // 10 stormpike firstaid a_a
|
||||
data << uint32(0x571) << uint32(0x0); // 11 east frostwolf tower horde assaulted -unused
|
||||
data << uint32(0x570) << uint32(0x0); // 12 west frostwolf tower horde assaulted - unused
|
||||
data << uint32(0x567) << uint32(0x1); // 13 frostwolfe c
|
||||
data << uint32(0x566) << uint32(0x1); // 14 frostwolfw c
|
||||
data << uint32(0x550) << uint32(0x1); // 15 irondeep (N) ally
|
||||
data << uint32(0x544) << uint32(0x0); // 16 ice grave a_a
|
||||
data << uint32(0x536) << uint32(0x0); // 17 stormpike grave h_c
|
||||
data << uint32(0x535) << uint32(0x1); // 18 stormpike grave a_c
|
||||
data << uint32(0x518) << uint32(0x0); // 19 stoneheart grave a_a
|
||||
data << uint32(0x517) << uint32(0x0); // 20 stoneheart grave h_a
|
||||
data << uint32(0x574) << uint32(0x0); // 21 1396 unk
|
||||
data << uint32(0x573) << uint32(0x0); // 22 iceblood tower horde assaulted -unused
|
||||
data << uint32(0x572) << uint32(0x0); // 23 towerpoint horde assaulted - unused
|
||||
data << uint32(0x56f) << uint32(0x0); // 24 1391 unk
|
||||
data << uint32(0x56e) << uint32(0x0); // 25 iceblood a
|
||||
data << uint32(0x56d) << uint32(0x0); // 26 towerp a
|
||||
data << uint32(0x56c) << uint32(0x0); // 27 frostwolfe a
|
||||
data << uint32(0x56b) << uint32(0x0); // 28 froswolfw a
|
||||
data << uint32(0x56a) << uint32(0x1); // 29 1386 unk
|
||||
data << uint32(0x569) << uint32(0x1); // 30 iceblood c
|
||||
data << uint32(0x568) << uint32(0x1); // 31 towerp c
|
||||
data << uint32(0x565) << uint32(0x0); // 32 stoneh tower a
|
||||
data << uint32(0x564) << uint32(0x0); // 33 icewing tower a
|
||||
data << uint32(0x563) << uint32(0x0); // 34 dunn a
|
||||
data << uint32(0x562) << uint32(0x0); // 35 duns a
|
||||
data << uint32(0x561) << uint32(0x0); // 36 stoneheart bunker alliance assaulted - unused
|
||||
data << uint32(0x560) << uint32(0x0); // 37 icewing bunker alliance assaulted - unused
|
||||
data << uint32(0x55f) << uint32(0x0); // 38 dunbaldar south alliance assaulted - unused
|
||||
data << uint32(0x55e) << uint32(0x0); // 39 dunbaldar north alliance assaulted - unused
|
||||
data << uint32(0x55d) << uint32(0x0); // 40 stone tower d
|
||||
data << uint32(0x3c6) << uint32(0x0); // 41 966 unk
|
||||
data << uint32(0x3c4) << uint32(0x0); // 42 964 unk
|
||||
data << uint32(0x3c2) << uint32(0x0); // 43 962 unk
|
||||
data << uint32(0x516) << uint32(0x1); // 44 stoneheart grave a_c
|
||||
data << uint32(0x515) << uint32(0x0); // 45 stonheart grave h_c
|
||||
data << uint32(0x3b6) << uint32(0x0); // 46 950 unk
|
||||
data << uint32(0x55c) << uint32(0x0); // 47 icewing tower d
|
||||
data << uint32(0x55b) << uint32(0x0); // 48 dunn d
|
||||
data << uint32(0x55a) << uint32(0x0); // 49 duns d
|
||||
data << uint32(0x559) << uint32(0x0); // 50 1369 unk
|
||||
data << uint32(0x558) << uint32(0x0); // 51 iceblood d
|
||||
data << uint32(0x557) << uint32(0x0); // 52 towerp d
|
||||
data << uint32(0x556) << uint32(0x0); // 53 frostwolfe d
|
||||
data << uint32(0x555) << uint32(0x0); // 54 frostwolfw d
|
||||
data << uint32(0x554) << uint32(0x1); // 55 stoneh tower c
|
||||
data << uint32(0x553) << uint32(0x1); // 56 icewing tower c
|
||||
data << uint32(0x552) << uint32(0x1); // 57 dunn c
|
||||
data << uint32(0x551) << uint32(0x1); // 58 duns c
|
||||
data << uint32(0x54f) << uint32(0x0); // 59 irondeep (N) horde
|
||||
data << uint32(0x54e) << uint32(0x0); // 60 irondeep (N) ally
|
||||
data << uint32(0x54d) << uint32(0x1); // 61 mine (S) neutral
|
||||
data << uint32(0x54c) << uint32(0x0); // 62 mine (S) horde
|
||||
data << uint32(0x54b) << uint32(0x0); // 63 mine (S) ally
|
||||
data << uint32(0x545) << uint32(0x0); // 64 iceblood h_a
|
||||
data << uint32(0x543) << uint32(0x1); // 65 iceblod h_c
|
||||
data << uint32(0x542) << uint32(0x0); // 66 iceblood a_c
|
||||
data << uint32(0x540) << uint32(0x0); // 67 snowfall h_a
|
||||
data << uint32(0x53f) << uint32(0x0); // 68 snowfall a_a
|
||||
data << uint32(0x53e) << uint32(0x0); // 69 snowfall h_c
|
||||
data << uint32(0x53d) << uint32(0x0); // 70 snowfall a_c
|
||||
data << uint32(0x53c) << uint32(0x0); // 71 frostwolf g h_a
|
||||
data << uint32(0x53b) << uint32(0x0); // 72 frostwolf g a_a
|
||||
data << uint32(0x53a) << uint32(0x1); // 73 frostwolf g h_c
|
||||
data << uint32(0x539) << uint32(0x0); // 74 frostwolf g a_c
|
||||
data << uint32(0x538) << uint32(0x0); // 75 stormpike grave h_a
|
||||
data << uint32(0x537) << uint32(0x0); // 76 stormpike grave a_a
|
||||
data << uint32(0x534) << uint32(0x0); // 77 frostwolf hut h_a
|
||||
data << uint32(0x533) << uint32(0x0); // 78 frostwolf hut a_a
|
||||
data << uint32(0x530) << uint32(0x0); // 79 stormpike first aid h_a
|
||||
data << uint32(0x52f) << uint32(0x0); // 80 stormpike first aid h_c
|
||||
data << uint32(0x52d) << uint32(0x1); // 81 stormpike first aid a_c
|
||||
}
|
||||
break;
|
||||
case 3277: // WS
|
||||
if (bg && bg->GetTypeID() == BATTLEGROUND_WS)
|
||||
@@ -13350,7 +13368,8 @@ bool Player::HasQuestForItem( uint32 itemid ) const
|
||||
|
||||
// hide quest if player is in raid-group and quest is no raid quest
|
||||
if(GetGroup() && GetGroup()->isRaidGroup() && qinfo->GetType() != QUEST_TYPE_RAID)
|
||||
continue;
|
||||
if(!InBattleGround()) //there are two ways.. we can make every bg-quest a raidquest, or add this code here.. i don't know if this can be exploited by other quests, but i think all other quests depend on a specific area.. but keep this in mind, if something strange happens later
|
||||
continue;
|
||||
|
||||
// There should be no mixed ReqItem/ReqSource drop
|
||||
// This part for ReqItem drop
|
||||
@@ -18045,6 +18064,7 @@ uint32 Player::GetMaxLevelForBattleGroundQueueId(uint32 queue_id)
|
||||
return 10*(queue_id+2)-1;
|
||||
}
|
||||
|
||||
//TODO make this more generic - current implementation is wrong
|
||||
uint32 Player::GetBattleGroundQueueIdFromLevel() const
|
||||
{
|
||||
uint32 level = getLevel();
|
||||
@@ -18700,70 +18720,70 @@ bool ItemPosCount::isContainedIn(ItemPosCountVec const& vec) const
|
||||
//-------------TRINITY---------------
|
||||
//***********************************
|
||||
|
||||
void Player::HandleFallDamage(MovementInfo& movementInfo)
|
||||
{
|
||||
//Players with Feather Fall or low fall time, or physical immunity (charges used) are ignored
|
||||
if (!isInFlight() && movementInfo.fallTime > 1100 && !isDead() && !isGameMaster() &&
|
||||
!HasAuraType(SPELL_AURA_HOVER) && !HasAuraType(SPELL_AURA_FEATHER_FALL) &&
|
||||
!HasAuraType(SPELL_AURA_FLY) && !IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL,true) )
|
||||
{
|
||||
//Safe fall, fall time reduction
|
||||
int32 safe_fall = GetTotalAuraModifier(SPELL_AURA_SAFE_FALL);
|
||||
uint32 fall_time = (movementInfo.fallTime > (safe_fall*10)) ? movementInfo.fallTime - (safe_fall*10) : 0;
|
||||
|
||||
if(fall_time > 1100) //Prevent damage if fall time < 1100
|
||||
{
|
||||
//Fall Damage calculation
|
||||
float fallperc = float(fall_time)/1100;
|
||||
uint32 damage = (uint32)(((fallperc*fallperc -1) / 9 * GetMaxHealth())*sWorld.getRate(RATE_DAMAGE_FALL));
|
||||
|
||||
float height = movementInfo.z;
|
||||
UpdateGroundPositionZ(movementInfo.x,movementInfo.y,height);
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
//Prevent fall damage from being more than the player maximum health
|
||||
if (damage > GetMaxHealth())
|
||||
damage = GetMaxHealth();
|
||||
|
||||
// Gust of Wind
|
||||
if (GetDummyAura(43621))
|
||||
damage = GetMaxHealth()/2;
|
||||
|
||||
EnvironmentalDamage(GetGUID(), DAMAGE_FALL, damage);
|
||||
}
|
||||
|
||||
//Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction
|
||||
DEBUG_LOG("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.z, height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Player::HandleFallUnderMap()
|
||||
{
|
||||
if(InBattleGround() && GetBattleGround()
|
||||
&& GetBattleGround()->HandlePlayerUnderMap(this))
|
||||
{
|
||||
// do nothing, the handle already did if returned true
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTE: this is actually called many times while falling
|
||||
// even after the player has been teleported away
|
||||
// TODO: discard movement packets after the player is rooted
|
||||
if(isAlive())
|
||||
{
|
||||
EnvironmentalDamage(GetGUID(),DAMAGE_FALL_TO_VOID, GetMaxHealth());
|
||||
// change the death state to CORPSE to prevent the death timer from
|
||||
// starting in the next player update
|
||||
KillPlayer();
|
||||
BuildPlayerRepop();
|
||||
}
|
||||
|
||||
// cancel the death timer here if started
|
||||
RepopAtGraveyard();
|
||||
}
|
||||
}
|
||||
void Player::HandleFallDamage(MovementInfo& movementInfo)
|
||||
{
|
||||
//Players with Feather Fall or low fall time, or physical immunity (charges used) are ignored
|
||||
if (!isInFlight() && movementInfo.fallTime > 1100 && !isDead() && !isGameMaster() &&
|
||||
!HasAuraType(SPELL_AURA_HOVER) && !HasAuraType(SPELL_AURA_FEATHER_FALL) &&
|
||||
!HasAuraType(SPELL_AURA_FLY) && !IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL,true) )
|
||||
{
|
||||
//Safe fall, fall time reduction
|
||||
int32 safe_fall = GetTotalAuraModifier(SPELL_AURA_SAFE_FALL);
|
||||
uint32 fall_time = (movementInfo.fallTime > (safe_fall*10)) ? movementInfo.fallTime - (safe_fall*10) : 0;
|
||||
|
||||
if(fall_time > 1100) //Prevent damage if fall time < 1100
|
||||
{
|
||||
//Fall Damage calculation
|
||||
float fallperc = float(fall_time)/1100;
|
||||
uint32 damage = (uint32)(((fallperc*fallperc -1) / 9 * GetMaxHealth())*sWorld.getRate(RATE_DAMAGE_FALL));
|
||||
|
||||
float height = movementInfo.z;
|
||||
UpdateGroundPositionZ(movementInfo.x,movementInfo.y,height);
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
//Prevent fall damage from being more than the player maximum health
|
||||
if (damage > GetMaxHealth())
|
||||
damage = GetMaxHealth();
|
||||
|
||||
// Gust of Wind
|
||||
if (GetDummyAura(43621))
|
||||
damage = GetMaxHealth()/2;
|
||||
|
||||
EnvironmentalDamage(GetGUID(), DAMAGE_FALL, damage);
|
||||
}
|
||||
|
||||
//Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction
|
||||
DEBUG_LOG("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.z, height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Player::HandleFallUnderMap()
|
||||
{
|
||||
if(InBattleGround() && GetBattleGround()
|
||||
&& GetBattleGround()->HandlePlayerUnderMap(this))
|
||||
{
|
||||
// do nothing, the handle already did if returned true
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTE: this is actually called many times while falling
|
||||
// even after the player has been teleported away
|
||||
// TODO: discard movement packets after the player is rooted
|
||||
if(isAlive())
|
||||
{
|
||||
EnvironmentalDamage(GetGUID(),DAMAGE_FALL_TO_VOID, GetMaxHealth());
|
||||
// change the death state to CORPSE to prevent the death timer from
|
||||
// starting in the next player update
|
||||
KillPlayer();
|
||||
BuildPlayerRepop();
|
||||
}
|
||||
|
||||
// cancel the death timer here if started
|
||||
RepopAtGraveyard();
|
||||
}
|
||||
}
|
||||
|
||||
void Player::Possess(Unit *target)
|
||||
{
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptCalls.h"
|
||||
#include "Group.h"
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundAV.h"
|
||||
|
||||
void WorldSession::HandleQuestgiverStatusQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
@@ -401,6 +403,12 @@ void WorldSession::HandleQuestComplete(WorldPacket& recv_data)
|
||||
Quest const *pQuest = objmgr.GetQuestTemplate(quest);
|
||||
if( pQuest )
|
||||
{
|
||||
// TODO: need a virtual function
|
||||
if(GetPlayer()->InBattleGround())
|
||||
if(BattleGround* bg = GetPlayer()->GetBattleGround())
|
||||
if(bg->GetTypeID() == BATTLEGROUND_AV)
|
||||
((BattleGroundAV*)bg)->HandleQuestComplete(quest, GetPlayer());
|
||||
|
||||
if( _player->GetQuestStatus( quest ) != QUEST_STATUS_COMPLETE )
|
||||
{
|
||||
if( pQuest->IsRepeatable() )
|
||||
|
||||
+12
-12
@@ -341,17 +341,17 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
||||
return;
|
||||
break;
|
||||
}
|
||||
// gruul's shatter
|
||||
case 33671:
|
||||
{
|
||||
// don't damage self and only players
|
||||
if(unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[0]));
|
||||
if(!radius) return;
|
||||
float distance = m_caster->GetDistance2d(unitTarget);
|
||||
damage = (distance > radius ) ? 0 : (int32)(m_spellInfo->EffectBasePoints[0]*((radius - distance)/radius));
|
||||
// gruul's shatter
|
||||
case 33671:
|
||||
{
|
||||
// don't damage self and only players
|
||||
if(unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[0]));
|
||||
if(!radius) return;
|
||||
float distance = m_caster->GetDistance2d(unitTarget);
|
||||
damage = (distance > radius ) ? 0 : (int32)(m_spellInfo->EffectBasePoints[0]*((radius - distance)/radius));
|
||||
}break;
|
||||
}
|
||||
break;
|
||||
@@ -2886,7 +2886,7 @@ void Spell::EffectOpenLock(uint32 /*i*/)
|
||||
if(BattleGround *bg = player->GetBattleGround())
|
||||
{
|
||||
// check if it's correct bg
|
||||
if(bg && bg->GetTypeID() == BATTLEGROUND_AB)
|
||||
if(bg->GetTypeID() == BATTLEGROUND_AB || bg->GetTypeID() == BATTLEGROUND_AV)
|
||||
bg->EventPlayerClickedOnFlag(player, gameObjTarget);
|
||||
return;
|
||||
}
|
||||
|
||||
+6
-13
@@ -829,22 +829,15 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
}
|
||||
|
||||
// battleground things (do this at the end, so the death state flag will be properly set to handle in the bg->handlekill)
|
||||
if(pVictim->GetTypeId() == TYPEID_PLAYER && (((Player*)pVictim)->InBattleGround()))
|
||||
if(player && player->InBattleGround())
|
||||
{
|
||||
Player *killed = ((Player*)pVictim);
|
||||
Player *killer = NULL;
|
||||
if(GetTypeId() == TYPEID_PLAYER)
|
||||
killer = ((Player*)this);
|
||||
else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())
|
||||
if(BattleGround *bg = player->GetBattleGround())
|
||||
{
|
||||
Unit *owner = GetOwner();
|
||||
if(owner && owner->GetTypeId() == TYPEID_PLAYER)
|
||||
killer = ((Player*)owner);
|
||||
if(pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
bg->HandleKillPlayer((Player*)pVictim, player);
|
||||
else
|
||||
bg->HandleKillUnit((Creature*)pVictim, player);
|
||||
}
|
||||
|
||||
if(killer)
|
||||
if(BattleGround *bg = killed->GetBattleGround())
|
||||
bg->HandleKillPlayer(killed, killer); // drop flags and etc
|
||||
}
|
||||
}
|
||||
else // if (health <= damage)
|
||||
|
||||
Reference in New Issue
Block a user