mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/DataStores: Updated AreaTrigger.dbc struct
This commit is contained in:
@@ -936,10 +936,10 @@ class SmartTrigger : public AreaTriggerScript
|
||||
if (!player->IsAlive())
|
||||
return false;
|
||||
|
||||
TC_LOG_DEBUG("scripts.ai", "AreaTrigger %u is using SmartTrigger script", trigger->id);
|
||||
TC_LOG_DEBUG("scripts.ai", "AreaTrigger %u is using SmartTrigger script", trigger->ID);
|
||||
SmartScript script;
|
||||
script.OnInitialize(NULL, trigger);
|
||||
script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->id);
|
||||
script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->ID);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3405,7 +3405,7 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn
|
||||
if (obj)
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry());
|
||||
if (at)
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id);
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->ID);
|
||||
return;
|
||||
}
|
||||
for (SmartAIEventList::iterator i = e.begin(); i != e.end(); ++i)
|
||||
@@ -3431,7 +3431,7 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn
|
||||
if (mEvents.empty() && obj)
|
||||
TC_LOG_ERROR("sql.sql", "SmartScript: Entry %u has events but no events added to list because of instance flags.", obj->GetEntry());
|
||||
if (mEvents.empty() && at)
|
||||
TC_LOG_ERROR("sql.sql", "SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->id);
|
||||
TC_LOG_ERROR("sql.sql", "SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->ID);
|
||||
}
|
||||
|
||||
void SmartScript::GetScript()
|
||||
@@ -3453,7 +3453,7 @@ void SmartScript::GetScript()
|
||||
}
|
||||
else if (trigger)
|
||||
{
|
||||
e = sSmartScriptMgr->GetScript((int32)trigger->id, mScriptType);
|
||||
e = sSmartScriptMgr->GetScript((int32)trigger->ID, mScriptType);
|
||||
FillScript(e, NULL, trigger);
|
||||
}
|
||||
}
|
||||
@@ -3482,7 +3482,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at)
|
||||
{
|
||||
mScriptType = SMART_SCRIPT_TYPE_AREATRIGGER;
|
||||
trigger = at;
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->id);
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->ID);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -510,9 +510,9 @@ bool BattlegroundEY::SetupBattleground()
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
|
||||
continue;
|
||||
}
|
||||
if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->Pos[0], at->Pos[1], at->Pos[2], 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->Pos[0], at->Pos[1], at->Pos[2], 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->Pos[0], at->Pos[1], at->Pos[2], 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
)
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Cannot spawn buff");
|
||||
}
|
||||
|
||||
@@ -579,19 +579,21 @@ struct AreaGroupEntry
|
||||
|
||||
struct AreaTriggerEntry
|
||||
{
|
||||
uint32 id; // 0 m_ID
|
||||
uint32 mapid; // 1 m_ContinentID
|
||||
float x; // 2 m_x
|
||||
float y; // 3 m_y
|
||||
float z; // 4 m_z
|
||||
//uint32 // 5
|
||||
//uint32 // 6
|
||||
//uint32 // 7
|
||||
float radius; // 8 m_radius
|
||||
float box_x; // 9 m_box_length
|
||||
float box_y; // 10 m_box_width
|
||||
float box_z; // 11 m_box_heigh
|
||||
float box_orientation; // 12 m_box_yaw
|
||||
uint32 ID; // 0
|
||||
uint32 ContinentID; // 1 MapID
|
||||
float Pos[3]; // 2-4
|
||||
//uint32 PhaseUseFlags // 5
|
||||
//uint32 PhaseID // 6
|
||||
//uint32 PhaseGroupID // 7
|
||||
float Radius; // 8
|
||||
float BoxLength; // 9
|
||||
float BoxWidth; // 10
|
||||
float BoxHeight; // 11
|
||||
float BoxYaw; // 12
|
||||
//uint32 ShapeType // 13
|
||||
//uint32 ShapeID // 14
|
||||
//uint32 AreaTriggerActionSetID // 15
|
||||
//uint32 Flags // 16
|
||||
};
|
||||
|
||||
struct ArmorLocationEntry
|
||||
|
||||
@@ -28,7 +28,7 @@ const std::string CustomAchievementIndex = "ID";
|
||||
char const AchievementCriteriafmt[] = "niiiliiiisiiiiixxiiiiii";
|
||||
char const AreaTableEntryfmt[] = "iiinixxxxxisiiiiiffixxxxxx";
|
||||
char const AreaGroupEntryfmt[] = "niiiiiii";
|
||||
char const AreaTriggerEntryfmt[] = "nifffxxxfffff";
|
||||
char const AreaTriggerEntryfmt[] = "nifffxxxfffffxxxx";
|
||||
char const ArmorLocationfmt[] = "nfffff";
|
||||
char const AuctionHouseEntryfmt[] = "niiix";
|
||||
char const BankBagSlotPricesEntryfmt[] = "ni";
|
||||
|
||||
@@ -6320,7 +6320,7 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
|
||||
if ((!useParentDbValue && itr->second.target_mapId == entrance_map) || (useParentDbValue && itr->second.target_mapId == parentId))
|
||||
{
|
||||
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first);
|
||||
if (atEntry && atEntry->mapid == Map)
|
||||
if (atEntry && atEntry->ContinentID == Map)
|
||||
return &itr->second;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -867,24 +867,24 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (player->GetMapId() != atEntry->mapid)
|
||||
if (player->GetMapId() != atEntry->ContinentID)
|
||||
{
|
||||
TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u",
|
||||
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->mapid, player->GetMapId(), triggerId);
|
||||
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->ContinentID, player->GetMapId(), triggerId);
|
||||
return;
|
||||
}
|
||||
|
||||
// delta is safe radius
|
||||
const float delta = 5.0f;
|
||||
|
||||
if (atEntry->radius > 0)
|
||||
if (atEntry->Radius > 0)
|
||||
{
|
||||
// if we have radius check it
|
||||
float dist = player->GetDistance(atEntry->x, atEntry->y, atEntry->z);
|
||||
if (dist > atEntry->radius + delta)
|
||||
float dist = player->GetDistance(atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]);
|
||||
if (dist > atEntry->Radius + delta)
|
||||
{
|
||||
TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (radius: %f distance: %f), ignore Area Trigger ID: %u",
|
||||
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->radius, dist, triggerId);
|
||||
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->Radius, dist, triggerId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -896,26 +896,26 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
|
||||
// is-in-cube check and we have to calculate only one point instead of 4
|
||||
|
||||
// 2PI = 360°, keep in mind that ingame orientation is counter-clockwise
|
||||
double rotation = 2 * M_PI - atEntry->box_orientation;
|
||||
double rotation = 2 * M_PI - atEntry->BoxYaw;
|
||||
double sinVal = std::sin(rotation);
|
||||
double cosVal = std::cos(rotation);
|
||||
|
||||
float playerBoxDistX = player->GetPositionX() - atEntry->x;
|
||||
float playerBoxDistY = player->GetPositionY() - atEntry->y;
|
||||
float playerBoxDistX = player->GetPositionX() - atEntry->Pos[0];
|
||||
float playerBoxDistY = player->GetPositionY() - atEntry->Pos[1];
|
||||
|
||||
float rotPlayerX = float(atEntry->x + playerBoxDistX * cosVal - playerBoxDistY*sinVal);
|
||||
float rotPlayerY = float(atEntry->y + playerBoxDistY * cosVal + playerBoxDistX*sinVal);
|
||||
float rotPlayerX = float(atEntry->Pos[0] + playerBoxDistX * cosVal - playerBoxDistY*sinVal);
|
||||
float rotPlayerY = float(atEntry->Pos[1] + playerBoxDistY * cosVal + playerBoxDistX*sinVal);
|
||||
|
||||
// box edges are parallel to coordiante axis, so we can treat every dimension independently :D
|
||||
float dz = player->GetPositionZ() - atEntry->z;
|
||||
float dx = rotPlayerX - atEntry->x;
|
||||
float dy = rotPlayerY - atEntry->y;
|
||||
if ((std::fabs(dx) > atEntry->box_x / 2 + delta) ||
|
||||
(std::fabs(dy) > atEntry->box_y / 2 + delta) ||
|
||||
(std::fabs(dz) > atEntry->box_z / 2 + delta))
|
||||
float dz = player->GetPositionZ() - atEntry->Pos[2];
|
||||
float dx = rotPlayerX - atEntry->Pos[0];
|
||||
float dy = rotPlayerY - atEntry->Pos[1];
|
||||
if ((std::fabs(dx) > atEntry->BoxLength / 2 + delta) ||
|
||||
(std::fabs(dy) > atEntry->BoxWidth / 2 + delta) ||
|
||||
(std::fabs(dz) > atEntry->BoxHeight / 2 + delta))
|
||||
{
|
||||
TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u",
|
||||
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->box_x / 2, atEntry->box_y / 2, atEntry->box_z / 2, rotPlayerX, rotPlayerY, dz, triggerId);
|
||||
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->BoxLength / 2, atEntry->BoxWidth / 2, atEntry->BoxHeight / 2, rotPlayerX, rotPlayerY, dz, triggerId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -935,7 +935,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
|
||||
{
|
||||
// set resting flag we are in the inn
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
player->InnEnter(time(NULL), atEntry->mapid, atEntry->x, atEntry->y, atEntry->z);
|
||||
player->InnEnter(time(NULL), atEntry->ContinentID, atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]);
|
||||
player->SetRestType(REST_TYPE_IN_TAVERN);
|
||||
|
||||
if (sWorld->IsFFAPvPRealm())
|
||||
|
||||
@@ -925,7 +925,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger)
|
||||
ASSERT(player);
|
||||
ASSERT(trigger);
|
||||
|
||||
GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->id), tmpscript, false);
|
||||
GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->ID), tmpscript, false);
|
||||
return tmpscript->OnTrigger(player, trigger);
|
||||
}
|
||||
|
||||
|
||||
@@ -391,9 +391,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!MapManager::IsValidMapCoord(at->mapid, at->x, at->y, at->z))
|
||||
if (!MapManager::IsValidMapCoord(at->ContinentID, at->Pos[0], at->Pos[1], at->Pos[2]))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->x, at->y, at->mapid);
|
||||
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->Pos[0], at->Pos[1], at->ContinentID);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -408,7 +408,7 @@ public:
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
|
||||
player->TeleportTo(at->mapid, at->x, at->y, at->z, player->GetOrientation());
|
||||
player->TeleportTo(at->ContinentID, at->Pos[0], at->Pos[1], at->Pos[2], player->GetOrientation());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -928,7 +928,7 @@ class at_bring_your_orphan_to : public AreaTriggerScript
|
||||
uint32 questId = 0;
|
||||
uint32 orphanId = 0;
|
||||
|
||||
switch (trigger->id)
|
||||
switch (trigger->ID)
|
||||
{
|
||||
case AT_DOWN_AT_THE_DOCKS:
|
||||
questId = QUEST_DOWN_AT_THE_DOCKS;
|
||||
|
||||
@@ -155,7 +155,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
|
||||
if (atEntry)
|
||||
{
|
||||
// 5.0f is safe-distance
|
||||
if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius)
|
||||
if (player->GetDistance(atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]) > 5.0f + atEntry->Radius)
|
||||
{
|
||||
// he dropped it further, summon mound
|
||||
GameObject* go = new GameObject;
|
||||
@@ -192,7 +192,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
|
||||
if (atEntry)
|
||||
{
|
||||
// 5.0f is safe-distance
|
||||
if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius)
|
||||
if (player->GetDistance(atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]) > 5.0f + atEntry->Radius)
|
||||
{
|
||||
// he dropped it further, summon mound
|
||||
GameObject* go = new GameObject;
|
||||
|
||||
@@ -180,7 +180,7 @@ class AreaTrigger_at_last_rites : public AreaTriggerScript
|
||||
|
||||
WorldLocation pPosition;
|
||||
|
||||
switch (trigger->id)
|
||||
switch (trigger->ID)
|
||||
{
|
||||
case 5332:
|
||||
case 5338:
|
||||
@@ -233,7 +233,7 @@ class AreaTrigger_at_sholazar_waygate : public AreaTriggerScript
|
||||
if (!player->isDead() && (player->GetQuestStatus(QUEST_MEETING_A_GREAT_ONE) != QUEST_STATUS_NONE ||
|
||||
(player->GetQuestStatus(QUEST_THE_MAKERS_OVERLOOK) == QUEST_STATUS_REWARDED && player->GetQuestStatus(QUEST_THE_MAKERS_PERCH) == QUEST_STATUS_REWARDED)))
|
||||
{
|
||||
switch (trigger->id)
|
||||
switch (trigger->ID)
|
||||
{
|
||||
case AT_SHOLAZAR:
|
||||
player->CastSpell(player, SPELL_SHOLAZAR_TO_UNGORO_TELEPORT, true);
|
||||
@@ -312,7 +312,7 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) override
|
||||
{
|
||||
uint32 triggerId = trigger->id;
|
||||
uint32 triggerId = trigger->ID;
|
||||
// Second trigger happened too early after first, skip for now
|
||||
if (sWorld->GetGameTime() - _triggerTimes[triggerId] < AREATRIGGER_TALK_COOLDOWN)
|
||||
return false;
|
||||
@@ -370,8 +370,8 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
|
||||
if (!player->IsAlive())
|
||||
return false;
|
||||
|
||||
uint32 triggerId = trigger->id;
|
||||
if (sWorld->GetGameTime() - _triggerTimes[trigger->id] < SUMMON_COOLDOWN)
|
||||
uint32 triggerId = trigger->ID;
|
||||
if (sWorld->GetGameTime() - _triggerTimes[trigger->ID] < SUMMON_COOLDOWN)
|
||||
return false;
|
||||
|
||||
switch (triggerId)
|
||||
@@ -400,7 +400,7 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
|
||||
|
||||
player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000);
|
||||
player->AddAura(SPELL_A52_NEURALYZER, player);
|
||||
_triggerTimes[trigger->id] = sWorld->GetGameTime();
|
||||
_triggerTimes[trigger->ID] = sWorld->GetGameTime();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user