mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(DB/Stratholme): add Magistrate Barthilas escape event in Stratholme (#17669)
* 1. Added Magistrate Barthilas escape event 2. Fighting the Magistrate Barthilas at the entrance will close the 2 gates leading to the plaza 3. A fight in the slaughterhouse will close the door to the side of the slaughterhouse and will not open until a fight with baron Rivendare 4. Associate some conversation text to Broad*castTextId 5. Added an action for the player to stand up - turn around - salute when the player approaches Aurius 6. Added combat AI to Aurius to prepare for the event where Aurius helps players kill baron Rivendare * Error in SQL statements is fixed * Fixed Magistrate Barthilas not turning into human form when he died. Transfiguration should be used on himself * Fix a misspelling in a note * fix error * Save the status of the escape event to the database * Remove spaces * Modify the code formatting * enum format restore * Modify the enum * Delete data/sql/updates/pending_db_world/斯坦索姆 fix.sql Delete files that were accidentally pushed * fix "Grand Crusader Dathrohan" Unable to speak when transforming and dying and the worldserver console error * 1 waypoint 1 plus 1s suspension time. 2 Transmission data plus map number. * The door to the slaughterhouse is opened when there is a player dying and all players in the party are not in combat * Remove spaces and add comments * Change as requested * Update data/sql/updates/pending_db_world/rev_1699566747105058500.sql Test if this button can be updated directly Co-authored-by: KJack <kgithub@kellerg.com> * Use the full sniffing path * fix error * edit * Moved the escape time to smartscript Delete the closed door * Remove spaces * Fixed where barthilas were not in the slaughterhouse after moving to near the slaughterhouse after the save location was restarted * Delete unused classes --------- Co-authored-by: KJack <kgithub@kellerg.com>
This commit is contained in:
@@ -50,6 +50,10 @@ static const Position aGateTrap[] =
|
||||
{3919.88f, -3547.34f, 134.269f, 2.94961f} // Undead side
|
||||
};
|
||||
|
||||
Position const MindlessUndeadPos = { 3941.75f, -3393.06f, 119.70f, 0.0f };
|
||||
Position const BarthilasPos = { 4068.74f, -3535.97f, 122.825f, 2.478367567062377929f };
|
||||
Position const SlaughterPos = { 4032.20f, -3378.06f, 119.75f, 4.67f };
|
||||
|
||||
// uint32 m_uiGateTrapTimers[2][3] = { {0,0,0}, {0,0,0} };
|
||||
|
||||
class instance_stratholme : public InstanceMapScript
|
||||
@@ -86,6 +90,8 @@ public:
|
||||
if (_baronRunTime > 0)
|
||||
if (Aura* aura = player->AddAura(SPELL_BARON_ULTIMATUM, player))
|
||||
aura->SetDuration(_baronRunTime * MINUTE * IN_MILLISECONDS);
|
||||
if (_barthilasrunProgress == DONE)
|
||||
instance->LoadGrid(3663.229980f, -3619.139893f);
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
@@ -112,6 +118,11 @@ public:
|
||||
if (_slaughterProgress == 3)
|
||||
++_slaughterNPCs;
|
||||
break;
|
||||
case NPC_BARTHILAS:
|
||||
_barthilasGUID = creature->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,8 +133,7 @@ public:
|
||||
if (Creature* baron = instance->GetCreature(_baronRivendareGUID))
|
||||
baron->AI()->Talk(SAY_BRAON_SUMMON_RAMSTEIN);
|
||||
|
||||
Position pos = {4032.20f, -3378.06f, 119.75f, 4.67f};
|
||||
instance->SummonCreature(NPC_RAMSTEIN_THE_GORGER, pos);
|
||||
instance->SummonCreature(NPC_RAMSTEIN_THE_GORGER, SlaughterPos);
|
||||
}
|
||||
if (_slaughterProgress == 2)
|
||||
{
|
||||
@@ -243,6 +253,8 @@ public:
|
||||
go->AllowSaveToDB(true);
|
||||
_trapGatesGUIDs[3] = go->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,65 +294,79 @@ public:
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_BARON_RUN:
|
||||
{
|
||||
if (_baronRunProgress == DATA_BARON_RUN_NONE)
|
||||
{
|
||||
if (_baronRunProgress == DATA_BARON_RUN_NONE)
|
||||
{
|
||||
_baronRunProgress = DATA_BARON_RUN_GATE;
|
||||
_baronRunTime = 45;
|
||||
DoCastSpellOnPlayers(SPELL_BARON_ULTIMATUM);
|
||||
events.ScheduleEvent(EVENT_BARON_TIME, 60000);
|
||||
_baronRunProgress = DATA_BARON_RUN_GATE;
|
||||
_baronRunTime = 45;
|
||||
DoCastSpellOnPlayers(SPELL_BARON_ULTIMATUM);
|
||||
events.ScheduleEvent(EVENT_BARON_TIME, 60000);
|
||||
|
||||
instance->LoadGrid(4035.83f, -3336.31f);
|
||||
if (Creature* baron = instance->GetCreature(_baronRivendareGUID))
|
||||
baron->AI()->Talk(SAY_BARON_INIT_YELL);
|
||||
}
|
||||
break;
|
||||
instance->LoadGrid(4035.83f, -3336.31f);
|
||||
if (Creature* baron = instance->GetCreature(_baronRivendareGUID))
|
||||
baron->AI()->Talk(SAY_BARON_INIT_YELL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TYPE_ZIGGURAT1:
|
||||
{
|
||||
if (data == _zigguratState1 + 1)
|
||||
++_zigguratState1;
|
||||
{
|
||||
if (data == _zigguratState1 + 1)
|
||||
++_zigguratState1;
|
||||
|
||||
if (_zigguratState1 == 1)
|
||||
if (GameObject* ziggurat = instance->GetGameObject(_zigguratDoorsGUID1))
|
||||
ziggurat->SetGoState(GO_STATE_ACTIVE);
|
||||
if (_zigguratState1 == 1)
|
||||
if (GameObject* ziggurat = instance->GetGameObject(_zigguratDoorsGUID1))
|
||||
ziggurat->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
CheckZiggurats();
|
||||
break;
|
||||
}
|
||||
CheckZiggurats();
|
||||
break;
|
||||
}
|
||||
case TYPE_ZIGGURAT2:
|
||||
{
|
||||
if (data == _zigguratState2 + 1)
|
||||
++_zigguratState2;
|
||||
{
|
||||
if (data == _zigguratState2 + 1)
|
||||
++_zigguratState2;
|
||||
|
||||
if (_zigguratState2 == 1)
|
||||
if (GameObject* ziggurat = instance->GetGameObject(_zigguratDoorsGUID2))
|
||||
ziggurat->SetGoState(GO_STATE_ACTIVE);
|
||||
if (_zigguratState2 == 1)
|
||||
if (GameObject* ziggurat = instance->GetGameObject(_zigguratDoorsGUID2))
|
||||
ziggurat->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
CheckZiggurats();
|
||||
break;
|
||||
}
|
||||
CheckZiggurats();
|
||||
break;
|
||||
}
|
||||
case TYPE_ZIGGURAT3:
|
||||
{
|
||||
if (data == _zigguratState3 + 1)
|
||||
++_zigguratState3;
|
||||
{
|
||||
if (data == _zigguratState3 + 1)
|
||||
++_zigguratState3;
|
||||
|
||||
if (_zigguratState3 == 1)
|
||||
if (GameObject* ziggurat = instance->GetGameObject(_zigguratDoorsGUID3))
|
||||
ziggurat->SetGoState(GO_STATE_ACTIVE);
|
||||
if (_zigguratState3 == 1)
|
||||
if (GameObject* ziggurat = instance->GetGameObject(_zigguratDoorsGUID3))
|
||||
ziggurat->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
CheckZiggurats();
|
||||
break;
|
||||
}
|
||||
CheckZiggurats();
|
||||
break;
|
||||
}
|
||||
case TYPE_BARON_FIGHT:
|
||||
{
|
||||
if (GameObject* gate = instance->GetGameObject(_zigguratDoorsGUID5))
|
||||
gate->SetGoState(data == IN_PROGRESS ? GO_STATE_READY : GO_STATE_ACTIVE);
|
||||
return;
|
||||
}
|
||||
{
|
||||
if (GameObject* gate = instance->GetGameObject(_zigguratDoorsGUID5))
|
||||
gate->SetGoState(data == IN_PROGRESS ? GO_STATE_READY : GO_STATE_ACTIVE);
|
||||
return;
|
||||
}
|
||||
case TYPE_MALLOW:
|
||||
++_postboxesOpened;
|
||||
break;
|
||||
case TYPE_BARTHILAS_RUN:
|
||||
if (data == DONE)
|
||||
{
|
||||
if (Creature* barthilas = instance->GetCreature(_barthilasGUID))
|
||||
{
|
||||
if (barthilas->IsAlive())
|
||||
{
|
||||
barthilas->NearTeleportTo(BarthilasPos.GetPositionX(), BarthilasPos.GetPositionY(), BarthilasPos.GetPositionZ(), BarthilasPos.GetOrientation());
|
||||
barthilas->SetHomePosition(BarthilasPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
_barthilasrunProgress = data;
|
||||
break;
|
||||
}
|
||||
|
||||
SaveToDB();
|
||||
@@ -355,7 +381,7 @@ public:
|
||||
data >> _zigguratState3;
|
||||
data >> _slaughterProgress;
|
||||
data >> _postboxesOpened;
|
||||
|
||||
data >> _barthilasrunProgress;
|
||||
if (_baronRunTime)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_BARON_TIME, 60000);
|
||||
@@ -375,7 +401,8 @@ public:
|
||||
<< _zigguratState2 << ' '
|
||||
<< _zigguratState3 << ' '
|
||||
<< _slaughterProgress << ' '
|
||||
<< _postboxesOpened;
|
||||
<< _postboxesOpened << ' '
|
||||
<< _barthilasrunProgress;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
@@ -390,6 +417,8 @@ public:
|
||||
return _zigguratState3;
|
||||
case TYPE_MALLOW:
|
||||
return _postboxesOpened;
|
||||
case TYPE_BARTHILAS_RUN:
|
||||
return _barthilasrunProgress;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -475,91 +504,92 @@ public:
|
||||
gate_critter_delay(GATE2);
|
||||
break;
|
||||
case EVENT_BARON_TIME:
|
||||
{
|
||||
--_baronRunTime;
|
||||
instance->LoadGrid(4035.83f, -3336.31f);
|
||||
Creature* baron = instance->GetCreature(_baronRivendareGUID);
|
||||
if (baron && !baron->IsInCombat())
|
||||
{
|
||||
--_baronRunTime;
|
||||
instance->LoadGrid(4035.83f, -3336.31f);
|
||||
Creature* baron = instance->GetCreature(_baronRivendareGUID);
|
||||
if (baron && !baron->IsInCombat())
|
||||
switch (_baronRunTime)
|
||||
{
|
||||
switch (_baronRunTime)
|
||||
{
|
||||
case 10:
|
||||
baron->AI()->Talk(SAY_BARON_10M);
|
||||
break;
|
||||
case 5:
|
||||
baron->AI()->Talk(SAY_BARON_5M);
|
||||
if (Creature* ysida = baron->FindNearestCreature(NPC_YSIDA, 50.0f))
|
||||
ysida->AI()->SetData(1, 1);
|
||||
break;
|
||||
case 0:
|
||||
baron->AI()->Talk(SAY_BARON_0M);
|
||||
DoRemoveAurasDueToSpellOnPlayers(SPELL_BARON_ULTIMATUM);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (_baronRunTime > 0)
|
||||
events.ScheduleEvent(EVENT_BARON_TIME, 60s);
|
||||
else
|
||||
events.ScheduleEvent(EVENT_EXECUTE_PRISONER, 0ms);
|
||||
|
||||
SaveToDB();
|
||||
break;
|
||||
}
|
||||
case EVENT_EXECUTE_PRISONER:
|
||||
{
|
||||
instance->LoadGrid(4035.83f, -3336.31f);
|
||||
Creature* baron = instance->GetCreature(_baronRivendareGUID);
|
||||
if (baron && baron->IsAlive())
|
||||
{
|
||||
if (!baron->IsInCombat())
|
||||
{
|
||||
baron->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK1H);
|
||||
case 10:
|
||||
baron->AI()->Talk(SAY_BARON_10M);
|
||||
break;
|
||||
case 5:
|
||||
baron->AI()->Talk(SAY_BARON_5M);
|
||||
if (Creature* ysida = baron->FindNearestCreature(NPC_YSIDA, 50.0f))
|
||||
Unit::Kill(baron, ysida);
|
||||
}
|
||||
else
|
||||
events.ScheduleEvent(EVENT_EXECUTE_PRISONER, 1s);
|
||||
ysida->AI()->SetData(1, 1);
|
||||
break;
|
||||
case 0:
|
||||
baron->AI()->Talk(SAY_BARON_0M);
|
||||
DoRemoveAurasDueToSpellOnPlayers(SPELL_BARON_ULTIMATUM);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (_baronRunTime > 0)
|
||||
events.ScheduleEvent(EVENT_BARON_TIME, 60s);
|
||||
else
|
||||
events.ScheduleEvent(EVENT_EXECUTE_PRISONER, 0ms);
|
||||
|
||||
SaveToDB();
|
||||
break;
|
||||
}
|
||||
case EVENT_EXECUTE_PRISONER:
|
||||
{
|
||||
instance->LoadGrid(4035.83f, -3336.31f);
|
||||
Creature* baron = instance->GetCreature(_baronRivendareGUID);
|
||||
if (baron && baron->IsAlive())
|
||||
{
|
||||
if (!baron->IsInCombat())
|
||||
{
|
||||
baron->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK1H);
|
||||
if (Creature* ysida = baron->FindNearestCreature(NPC_YSIDA, 50.0f))
|
||||
Unit::Kill(baron, ysida);
|
||||
}
|
||||
else
|
||||
events.ScheduleEvent(EVENT_EXECUTE_PRISONER, 1s);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EVENT_SPAWN_MINDLESS:
|
||||
{
|
||||
Position pos = {3941.75f, -3393.06f, 119.70f, 0.0f};
|
||||
instance->SummonCreature(NPC_MINDLESS_UNDEAD, pos);
|
||||
break;
|
||||
}
|
||||
{
|
||||
instance->SummonCreature(NPC_MINDLESS_UNDEAD, MindlessUndeadPos);
|
||||
break;
|
||||
}
|
||||
case EVENT_FORCE_SLAUGHTER_EVENT:
|
||||
{
|
||||
Map::PlayerList const& PlayerList = instance->GetPlayers();
|
||||
if (!PlayerList.IsEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
if (player->GetDistance2d(4034.97f, -3402.13f) < 50.0f)
|
||||
{
|
||||
ProcessSlaughterEvent();
|
||||
return;
|
||||
}
|
||||
{
|
||||
Map::PlayerList const& PlayerList = instance->GetPlayers();
|
||||
if (!PlayerList.IsEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
if (player->GetDistance2d(4034.97f, -3402.13f) < 50.0f)
|
||||
{
|
||||
ProcessSlaughterEvent();
|
||||
return;
|
||||
}
|
||||
|
||||
events.ScheduleEvent(EVENT_FORCE_SLAUGHTER_EVENT, 3s);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_FORCE_SLAUGHTER_EVENT, 3s);
|
||||
break;
|
||||
}
|
||||
case EVENT_SPAWN_BLACK_GUARD:
|
||||
{
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
if (Creature* guard = instance->SummonCreature(NPC_BLACK_GUARD, BlackGuardPos[i]))
|
||||
{
|
||||
guard->SetWalk(true);
|
||||
guard->GetMotionMaster()->MovePoint(0, BlackGuardPos[i + 5]);
|
||||
guard->SetHomePosition(BlackGuardPos[i + 5]);
|
||||
if (i == 0 && guard->AI())
|
||||
guard->AI()->Talk(SAY_BLACK_GUARD_INIT);
|
||||
}
|
||||
{
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
if (Creature* guard = instance->SummonCreature(NPC_BLACK_GUARD, BlackGuardPos[i]))
|
||||
{
|
||||
guard->SetWalk(true);
|
||||
guard->GetMotionMaster()->MovePoint(0, BlackGuardPos[i + 5]);
|
||||
guard->SetHomePosition(BlackGuardPos[i + 5]);
|
||||
if (i == 0 && guard->AI())
|
||||
guard->AI()->Talk(SAY_BLACK_GUARD_INIT);
|
||||
}
|
||||
|
||||
if (GameObject* gate = instance->GetGameObject(_zigguratDoorsGUID4))
|
||||
gate->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
}
|
||||
if (GameObject* gate = instance->GetGameObject(_zigguratDoorsGUID4))
|
||||
gate->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -571,6 +601,7 @@ public:
|
||||
uint32 _zigguratState3;
|
||||
uint32 _slaughterProgress;
|
||||
uint32 _slaughterNPCs;
|
||||
uint32 _barthilasrunProgress{};
|
||||
uint32 _postboxesOpened;
|
||||
EventMap events;
|
||||
|
||||
@@ -582,6 +613,7 @@ public:
|
||||
ObjectGuid _slaughterGateGUID;
|
||||
ObjectGuid _gauntletGateGUID;
|
||||
ObjectGuid _baronRivendareGUID;
|
||||
ObjectGuid _barthilasGUID;
|
||||
|
||||
bool _gateTrapsCooldown[2];
|
||||
ObjectGuid _trappedPlayerGUID;
|
||||
|
||||
@@ -31,6 +31,7 @@ enum DataTypes
|
||||
TYPE_ZIGGURAT3 = 3,
|
||||
TYPE_BARON_FIGHT = 4,
|
||||
TYPE_MALLOW = 5,
|
||||
TYPE_BARTHILAS_RUN = 6,
|
||||
|
||||
DATA_BARON_RUN_NONE = 0,
|
||||
DATA_BARON_RUN_GATE = 1,
|
||||
@@ -40,6 +41,7 @@ enum DataTypes
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_BARTHILAS = 10435,
|
||||
NPC_BARON_RIVENDARE = 10440,
|
||||
NPC_BILE_SPEWER = 10416,
|
||||
NPC_VENOM_BELCHER = 10417,
|
||||
|
||||
Reference in New Issue
Block a user