refactor(Core): Add definition file for area table entries. (#22054)

This commit is contained in:
Benjamin Jackson
2025-05-09 09:48:02 -04:00
committed by GitHub
parent db62fe8310
commit 52799d76f6
146 changed files with 866 additions and 656 deletions

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AreaDefines.h"
#include "CreatureScript.h"
#include "PetDefines.h"
#include "Player.h"
@@ -1382,7 +1383,7 @@ class spell_dk_death_grip : public SpellScript
target->InterruptNonMeleeSpells(false, 0, false);
}
if (target->GetMapId() == 618) // for Ring of Valor
if (target->GetMapId() == MAP_THE_RING_OF_VALOR)
gripPos.m_positionZ = std::max(casterZ + 0.2f, 28.5f);
target->CastSpell(gripPos.GetPositionX(), gripPos.GetPositionY(), gripPos.GetPositionZ(), 57604, true);

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AreaDefines.h"
#include "Battlefield.h"
#include "BattlefieldMgr.h"
#include "Battleground.h"
@@ -539,9 +540,9 @@ class spell_gen_rallying_cry_of_the_dragonslayer : public SpellScript
{
targets.clear();
uint32 zoneId = 1519;
if (GetCaster()->GetMapId() == 1) // Kalimdor
zoneId = 1637;
uint32 zoneId = AREA_STORMWIND_CITY;
if (GetCaster()->GetMapId() == MAP_KALIMDOR)
zoneId = AREA_ORGRIMMAR;
Map::PlayerList const& pList = GetCaster()->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
@@ -1901,8 +1902,6 @@ class spell_gen_feign_death_no_prevent_emotes : public AuraScript
enum Teleporting
{
AREA_VIOLET_CITADEL_SPIRE = 4637,
SPELL_TELEPORT_SPIRE_DOWN = 59316,
SPELL_TELEPORT_SPIRE_UP = 59314
};
@@ -1923,7 +1922,7 @@ class spell_gen_teleporting : public SpellScript
return;
// return from top
if (target->ToPlayer()->GetAreaId() == AREA_VIOLET_CITADEL_SPIRE)
if (target->ToPlayer()->GetAreaId() == AREA_VARGOTHS_RETREAT)
target->CastSpell(target, SPELL_TELEPORT_SPIRE_DOWN, true);
// teleport atop
else
@@ -4051,7 +4050,7 @@ public:
// Triggered spell id dependent on riding skill and zone
bool canFly = false;
uint32 map = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId());
if (map == 530 || (map == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING)))
if (map == MAP_OUTLAND || (map == MAP_NORTHREND && target->HasSpell(SPELL_COLD_WEATHER_FLYING)))
canFly = true;
AreaTableEntry const* area = sAreaTableStore.LookupEntry(target->GetAreaId());

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AreaDefines.h"
#include "Battleground.h"
#include "CreatureScript.h"
#include "ObjectMgr.h"
@@ -2995,7 +2996,7 @@ class spell_item_socrethars_stone : public SpellScript
bool Load() override
{
return (GetCaster()->GetAreaId() == 3900 || GetCaster()->GetAreaId() == 3742);
return (GetCaster()->GetAreaId() == AREA_INVASION_POINT_OVERLORD || GetCaster()->GetAreaId() == AREA_SOCRETHARS_SEAT);
}
bool Validate(SpellInfo const* /*spell*/) override
@@ -3008,10 +3009,10 @@ class spell_item_socrethars_stone : public SpellScript
Unit* caster = GetCaster();
switch (caster->GetAreaId())
{
case 3900:
case AREA_INVASION_POINT_OVERLORD:
caster->CastSpell(caster, SPELL_SOCRETHAR_TO_SEAT, true);
break;
case 3742:
case AREA_SOCRETHARS_SEAT:
caster->CastSpell(caster, SPELL_SOCRETHAR_FROM_SEAT, true);
break;
default:

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AreaDefines.h"
#include "CellImpl.h"
#include "CreatureScript.h"
#include "GridNotifiers.h"
@@ -364,7 +365,7 @@ class spell_rog_killing_spree : public SpellScript
SpellCastResult CheckCast()
{
// Kologarn area, Killing Spree should not work
if (GetCaster()->GetMapId() == 603 /*Ulduar*/ && GetCaster()->GetDistance2d(1766.936f, -24.748f) < 50.0f)
if (GetCaster()->GetMapId() == MAP_ULDUAR && GetCaster()->GetDistance2d(1766.936f, -24.748f) < 50.0f)
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
return SPELL_CAST_OK;
}

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AreaDefines.h"
#include "CreatureScript.h"
#include "Pet.h"
#include "Player.h"
@@ -97,7 +98,7 @@ class spell_warl_eye_of_kilrogg : public AuraScript
{
if (Unit* charm = player->GetCharm())
{
if (charm->GetMapId() == 530 || charm->GetMapId() == 571)
if (charm->GetMapId() == MAP_OUTLAND || charm->GetMapId() == MAP_NORTHREND)
{
charm->CastSpell(charm, SPELL_WARLOCK_EYE_OF_KILROGG_FLY, true);
}