*Display building location on map for wintergrasp.
--HG-- branch : trunk
This commit is contained in:
@@ -33,6 +33,7 @@ typedef std::map<uint32,uint32> AreaFlagByMapID;
|
|||||||
|
|
||||||
DBCStorage <AreaTableEntry> sAreaStore(AreaTableEntryfmt);
|
DBCStorage <AreaTableEntry> sAreaStore(AreaTableEntryfmt);
|
||||||
DBCStorage <AreaGroupEntry> sAreaGroupStore(AreaGroupEntryfmt);
|
DBCStorage <AreaGroupEntry> sAreaGroupStore(AreaGroupEntryfmt);
|
||||||
|
DBCStorage <AreaPOIEntry> sAreaPOIStore(AreaPOIEntryfmt);
|
||||||
static AreaFlagByAreaID sAreaFlagByAreaID;
|
static AreaFlagByAreaID sAreaFlagByAreaID;
|
||||||
static AreaFlagByMapID sAreaFlagByMapID; // for instances without generated *.map files
|
static AreaFlagByMapID sAreaFlagByMapID; // for instances without generated *.map files
|
||||||
|
|
||||||
@@ -233,6 +234,7 @@ void LoadDBCStores(const std::string& dataPath)
|
|||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAchievementCriteriaStore, dbcPath,"Achievement_Criteria.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAchievementCriteriaStore, dbcPath,"Achievement_Criteria.dbc");
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaTriggerStore, dbcPath,"AreaTrigger.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaTriggerStore, dbcPath,"AreaTrigger.dbc");
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaGroupStore, dbcPath,"AreaGroup.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaGroupStore, dbcPath,"AreaGroup.dbc");
|
||||||
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaPOIStore, dbcPath,"AreaPOI.dbc");
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAuctionHouseStore, dbcPath,"AuctionHouse.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAuctionHouseStore, dbcPath,"AuctionHouse.dbc");
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sBankBagSlotPricesStore, dbcPath,"BankBagSlotPrices.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sBankBagSlotPricesStore, dbcPath,"BankBagSlotPrices.dbc");
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sBattlemasterListStore, dbcPath,"BattlemasterList.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sBattlemasterListStore, dbcPath,"BattlemasterList.dbc");
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ extern DBCStorage <AchievementEntry> sAchievementStore;
|
|||||||
extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
|
extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
|
||||||
extern DBCStorage <AreaTableEntry> sAreaStore;// recommend access using functions
|
extern DBCStorage <AreaTableEntry> sAreaStore;// recommend access using functions
|
||||||
extern DBCStorage <AreaGroupEntry> sAreaGroupStore;
|
extern DBCStorage <AreaGroupEntry> sAreaGroupStore;
|
||||||
|
extern DBCStorage <AreaPOIEntry> sAreaPOIStore;
|
||||||
extern DBCStorage <AreaTriggerEntry> sAreaTriggerStore;
|
extern DBCStorage <AreaTriggerEntry> sAreaTriggerStore;
|
||||||
extern DBCStorage <AuctionHouseEntry> sAuctionHouseStore;
|
extern DBCStorage <AuctionHouseEntry> sAuctionHouseStore;
|
||||||
extern DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore;
|
extern DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore;
|
||||||
|
|||||||
@@ -516,6 +516,24 @@ struct AreaGroupEntry
|
|||||||
uint32 nextGroup; // 7 index of next group
|
uint32 nextGroup; // 7 index of next group
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct AreaPOIEntry
|
||||||
|
{
|
||||||
|
uint32 id; //0
|
||||||
|
//uint32 icon[11]; //1-11
|
||||||
|
float x; //12
|
||||||
|
float y; //13
|
||||||
|
float z; //14
|
||||||
|
uint32 mapId; //15
|
||||||
|
//uint32 val1; //16
|
||||||
|
uint32 zoneId; //17
|
||||||
|
//char* name[16]; //18-33
|
||||||
|
//uint32 name_flag; //34
|
||||||
|
//char* name2[16]; //35-50
|
||||||
|
//uint32 name_flag2; //51
|
||||||
|
uint32 worldState; //52
|
||||||
|
//uint32 val2; //53
|
||||||
|
};
|
||||||
|
|
||||||
struct AreaTriggerEntry
|
struct AreaTriggerEntry
|
||||||
{
|
{
|
||||||
uint32 id; // 0 m_ID
|
uint32 id; // 0 m_ID
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ const char Achievementfmt[]="niixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiixixxxxxxxxx
|
|||||||
const char AchievementCriteriafmt[]="niiiiiiiixxxxxxxxxxxxxxxxxiixix";
|
const char AchievementCriteriafmt[]="niiiiiiiixxxxxxxxxxxxxxxxxiixix";
|
||||||
const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxixxxxxxx";
|
const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxixxxxxxx";
|
||||||
const char AreaGroupEntryfmt[]="niiiiiii";
|
const char AreaGroupEntryfmt[]="niiiiiii";
|
||||||
|
const char AreaPOIEntryfmt[]="nxxxxxxxxxxxfffixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxix";
|
||||||
const char AreaTriggerEntryfmt[]="niffffffff";
|
const char AreaTriggerEntryfmt[]="niffffffff";
|
||||||
const char AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx";
|
const char AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx";
|
||||||
const char BankBagSlotPricesEntryfmt[]="ni";
|
const char BankBagSlotPricesEntryfmt[]="ni";
|
||||||
|
|||||||
@@ -23,6 +23,17 @@
|
|||||||
bool OPvPWintergrasp::SetupOutdoorPvP()
|
bool OPvPWintergrasp::SetupOutdoorPvP()
|
||||||
{
|
{
|
||||||
RegisterZone(ZONE_WINTERGRASP);
|
RegisterZone(ZONE_WINTERGRASP);
|
||||||
|
|
||||||
|
for(uint32 i = 0; i < sAreaPOIStore.GetNumRows(); ++i)
|
||||||
|
{
|
||||||
|
const AreaPOIEntry * poiInfo = sAreaPOIStore.LookupEntry(i);
|
||||||
|
if(poiInfo && poiInfo->zoneId == ZONE_WINTERGRASP)
|
||||||
|
areaPOIs.push_back(poiInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_defender = TeamId(rand()%2);
|
||||||
|
m_attacker = (m_defender == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,6 +42,13 @@ void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone)
|
|||||||
if(!plr->HasAura(SPELL_RECRUIT) && !plr->HasAura(SPELL_CORPORAL)
|
if(!plr->HasAura(SPELL_RECRUIT) && !plr->HasAura(SPELL_CORPORAL)
|
||||||
&& !plr->HasAura(SPELL_LIEUTENANT))
|
&& !plr->HasAura(SPELL_LIEUTENANT))
|
||||||
plr->CastSpell(plr, SPELL_RECRUIT, true);
|
plr->CastSpell(plr, SPELL_RECRUIT, true);
|
||||||
|
|
||||||
|
for(AreaPOIList::iterator itr = areaPOIs.begin(); itr != areaPOIs.end(); ++itr)
|
||||||
|
{
|
||||||
|
TeamId team = ((*itr)->x > POS_X_CENTER ? m_defender : m_attacker);
|
||||||
|
plr->SendUpdateWorldState((*itr)->worldState, AreaPOIIconId[team][DAMAGE_INTACT]);
|
||||||
|
}
|
||||||
|
|
||||||
OutdoorPvP::HandlePlayerEnterZone(plr, zone);
|
OutdoorPvP::HandlePlayerEnterZone(plr, zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#define ZONE_WINTERGRASP 4197
|
#define ZONE_WINTERGRASP 4197
|
||||||
|
|
||||||
|
#define POS_X_CENTER 4700
|
||||||
|
|
||||||
#define SPELL_RECRUIT 37795
|
#define SPELL_RECRUIT 37795
|
||||||
#define SPELL_CORPORAL 33280
|
#define SPELL_CORPORAL 33280
|
||||||
#define SPELL_LIEUTENANT 55629
|
#define SPELL_LIEUTENANT 55629
|
||||||
@@ -30,13 +32,47 @@
|
|||||||
#define SPELL_TENICITY 58549
|
#define SPELL_TENICITY 58549
|
||||||
#define SPELL_TENICITY_VEHICLE 59911
|
#define SPELL_TENICITY_VEHICLE 59911
|
||||||
|
|
||||||
|
enum TeamId
|
||||||
|
{
|
||||||
|
TEAM_ALLIANCE = 0,
|
||||||
|
TEAM_HORDE,
|
||||||
|
TEAM_NEUTRAL,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum DamageState
|
||||||
|
{
|
||||||
|
DAMAGE_INTACT,
|
||||||
|
DAMAGE_DAMAGED,
|
||||||
|
DAMAGE_DESTROYED,
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint32 AreaPOIIconId[3][3] = {{7,8,9},{4,5,6},{1,2,3}};
|
||||||
|
|
||||||
|
struct BuildingState
|
||||||
|
{
|
||||||
|
explicit BuildingState(uint32 _worldState, uint32 _health)
|
||||||
|
: worldState(_worldState), health(_health), team(TEAM_NEUTRAL), damageState(DAMAGE_INTACT)
|
||||||
|
{}
|
||||||
|
uint32 worldState;
|
||||||
|
uint32 health;
|
||||||
|
TeamId team;
|
||||||
|
DamageState damageState;
|
||||||
|
};
|
||||||
|
|
||||||
class OPvPWintergrasp : public OutdoorPvP
|
class OPvPWintergrasp : public OutdoorPvP
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
typedef std::list<const AreaPOIEntry *> AreaPOIList;
|
||||||
|
typedef std::map<uint32, BuildingState *> BuildingStateMap;
|
||||||
public:
|
public:
|
||||||
bool SetupOutdoorPvP();
|
bool SetupOutdoorPvP();
|
||||||
void HandlePlayerEnterZone(Player *plr, uint32 zone);
|
void HandlePlayerEnterZone(Player *plr, uint32 zone);
|
||||||
void HandlePlayerLeaveZone(Player *plr, uint32 zone);
|
void HandlePlayerLeaveZone(Player *plr, uint32 zone);
|
||||||
void HandleKill(Player *killer, Unit *victim);
|
void HandleKill(Player *killer, Unit *victim);
|
||||||
|
protected:
|
||||||
|
TeamId m_defender, m_attacker;
|
||||||
|
AreaPOIList areaPOIs;
|
||||||
|
BuildingStateMap buildingStates;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user