mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 13:46:24 +00:00
Merge branch 'master' into Playerbot
This commit is contained in:
@@ -36,7 +36,7 @@ enum BG_EY_Timers
|
||||
BG_EY_FLAG_RESPAWN_TIME = 10 * IN_MILLISECONDS,
|
||||
BG_EY_FLAG_ON_GROUND_TIME = 10 * IN_MILLISECONDS,
|
||||
BG_EY_FPOINTS_CHECK_TIME = 2 * IN_MILLISECONDS,
|
||||
BG_EY_FPOINTS_TICK_TIME = 1 * IN_MILLISECONDS
|
||||
BG_EY_FPOINTS_TICK_TIME = 2 * IN_MILLISECONDS
|
||||
};
|
||||
|
||||
enum BG_EY_WorldStates
|
||||
|
||||
@@ -3984,8 +3984,8 @@ void Player::DeleteFromDB(ObjectGuid::LowType lowGuid, uint32 accountId, bool up
|
||||
sTicketMgr->CloseTicket(ticket->GetId(), playerGuid);
|
||||
|
||||
// remove from group
|
||||
if (uint32 groupId = sCharacterCache->GetCharacterGuildIdByGuid(playerGuid))
|
||||
if (Group* group = sGroupMgr->GetGroupByGUID(groupId))
|
||||
if (ObjectGuid groupId = sCharacterCache->GetCharacterGroupGuidByGuid(playerGuid))
|
||||
if (Group* group = sGroupMgr->GetGroupByGUID(groupId.GetCounter()))
|
||||
RemoveFromGroup(group, playerGuid);
|
||||
|
||||
// Remove signs from petitions (also remove petitions if owner);
|
||||
|
||||
@@ -892,7 +892,7 @@ void Player::FailQuest(uint32 questId)
|
||||
{
|
||||
QuestStatus qStatus = GetQuestStatus(questId);
|
||||
// xinef: if quest is marked as failed, dont do it again
|
||||
if (qStatus != QUEST_STATUS_INCOMPLETE)
|
||||
if ((qStatus != QUEST_STATUS_INCOMPLETE) && (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)))
|
||||
return;
|
||||
|
||||
SetQuestStatus(questId, QUEST_STATUS_FAILED);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
|
||||
scheduler.Schedule(20s, 28s, [this](TaskContext context)
|
||||
{
|
||||
if (DoCastRandomTarget(SPELL_CARRION_SWARM, 0, 60.f) == SPELL_CAST_OK)
|
||||
if (DoCastRandomTarget(SPELL_CARRION_SWARM, 0, 60.f, false) == SPELL_CAST_OK)
|
||||
Talk(SAY_SWARM);
|
||||
context.Repeat(10s, 15s);
|
||||
}).Schedule(25s, 32s, [this](TaskContext context)
|
||||
|
||||
@@ -342,6 +342,10 @@ struct boss_archimonde : public BossAI
|
||||
DoCastRandomTarget(SPELL_FINGER_OF_DEATH);
|
||||
}
|
||||
}, 3500ms);
|
||||
ScheduleTimedEvent(10min, [&]
|
||||
{
|
||||
DoCastRandomTarget(SPELL_FINGER_OF_DEATH);
|
||||
}, 3500ms);
|
||||
|
||||
instance->SetData(DATA_SPAWN_WAVES, 1);
|
||||
}
|
||||
@@ -360,22 +364,22 @@ struct boss_archimonde : public BossAI
|
||||
{
|
||||
switch (player->getClass())
|
||||
{
|
||||
case CLASS_PRIEST:
|
||||
case CLASS_PALADIN:
|
||||
case CLASS_PRIEST:
|
||||
case CLASS_WARLOCK:
|
||||
player->CastSpell(me, SPELL_SOUL_CHARGE_RED, true);
|
||||
break;
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
case CLASS_MAGE:
|
||||
case CLASS_ROGUE:
|
||||
case CLASS_WARRIOR:
|
||||
player->CastSpell(me, SPELL_SOUL_CHARGE_YELLOW, true);
|
||||
break;
|
||||
case CLASS_DRUID:
|
||||
case CLASS_SHAMAN:
|
||||
case CLASS_HUNTER:
|
||||
case CLASS_SHAMAN:
|
||||
player->CastSpell(me, SPELL_SOUL_CHARGE_GREEN, true);
|
||||
break;
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
case CLASS_NONE:
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
context.Repeat(18s, 20s);
|
||||
}).Schedule(45s, 55s, [this](TaskContext context)
|
||||
{
|
||||
DoCastRandomTarget(SPELL_DOOM, 1, 100.f, true, false, false);
|
||||
DoCastAOE(SPELL_DOOM);
|
||||
Talk(SAY_DOOM);
|
||||
context.Repeat();
|
||||
}).Schedule(10min, [this](TaskContext context)
|
||||
@@ -118,9 +118,27 @@ private:
|
||||
bool _recentlySpoken;
|
||||
};
|
||||
|
||||
class spell_azgalor_doom : public AuraScript
|
||||
class spell_azgalor_doom : public SpellScript
|
||||
{
|
||||
PrepareAuraScript(spell_azgalor_doom);
|
||||
PrepareSpellScript(spell_azgalor_doom);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (Unit* victim = GetCaster()->GetVictim())
|
||||
{
|
||||
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true));
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_azgalor_doom::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_azgalor_doom_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_azgalor_doom_aura);
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
@@ -133,12 +151,12 @@ class spell_azgalor_doom : public AuraScript
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_azgalor_doom::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_azgalor_doom_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_azgalor()
|
||||
{
|
||||
RegisterHyjalAI(boss_azgalor);
|
||||
RegisterSpellScript(spell_azgalor_doom);
|
||||
RegisterSpellAndAuraScriptPair(spell_azgalor_doom, spell_azgalor_doom_aura);
|
||||
}
|
||||
|
||||
@@ -220,41 +220,41 @@ public:
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_NECRO:
|
||||
case NPC_ABOMI:
|
||||
case NPC_GHOUL:
|
||||
case NPC_BANSH:
|
||||
case NPC_CRYPT:
|
||||
case NPC_GARGO:
|
||||
case NPC_FROST:
|
||||
case NPC_INFER:
|
||||
case NPC_STALK:
|
||||
if (unit->ToCreature()->IsSummon())
|
||||
{
|
||||
if (_bossWave)
|
||||
case NPC_NECRO:
|
||||
case NPC_ABOMI:
|
||||
case NPC_GHOUL:
|
||||
case NPC_BANSH:
|
||||
case NPC_CRYPT:
|
||||
case NPC_GARGO:
|
||||
case NPC_FROST:
|
||||
case NPC_INFER:
|
||||
case NPC_STALK:
|
||||
if (creature->IsSummon())
|
||||
{
|
||||
DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, --trash); // Update the instance wave count on new trash death
|
||||
_encounterNPCs.erase(unit->ToCreature()->GetGUID()); // Used for despawning on wipe
|
||||
if (_bossWave)
|
||||
{
|
||||
DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, --trash); // Update the instance wave count on new trash death
|
||||
_encounterNPCs.erase(creature->GetGUID()); // Used for despawning on wipe
|
||||
|
||||
if (trash == 0) // It can reach negatives if trash spawned after a retreat are killed, it shouldn't affect anything. Also happens on retail
|
||||
SetData(DATA_SPAWN_WAVES, 1);
|
||||
if (trash == 0) // It can reach negatives if trash spawned after a retreat are killed, it shouldn't affect anything. Also happens on retail
|
||||
SetData(DATA_SPAWN_WAVES, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NPC_TOWERING_INFERNAL:
|
||||
case NPC_LESSER_DOOMGUARD:
|
||||
_summonedNPCs.erase(unit->ToCreature()->GetGUID());
|
||||
break;
|
||||
case NPC_WINTERCHILL:
|
||||
case NPC_ANETHERON:
|
||||
case NPC_KAZROGAL:
|
||||
case NPC_AZGALOR:
|
||||
if (Creature* jaina = GetCreature(DATA_JAINA))
|
||||
jaina->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
if (Creature* thrall = GetCreature(DATA_THRALL))
|
||||
thrall->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
SetData(DATA_RESET_WAVES, 1);
|
||||
break;
|
||||
break;
|
||||
case NPC_TOWERING_INFERNAL:
|
||||
case NPC_LESSER_DOOMGUARD:
|
||||
_summonedNPCs.erase(creature->GetGUID());
|
||||
break;
|
||||
case NPC_WINTERCHILL:
|
||||
case NPC_ANETHERON:
|
||||
case NPC_KAZROGAL:
|
||||
case NPC_AZGALOR:
|
||||
if (Creature* jaina = GetCreature(DATA_JAINA))
|
||||
jaina->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
if (Creature* thrall = GetCreature(DATA_THRALL))
|
||||
thrall->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
SetData(DATA_RESET_WAVES, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -268,19 +268,23 @@ public:
|
||||
_retreat = DATA_ALLIANCE_RETREAT;
|
||||
// Spawn Ancient Gems
|
||||
for (ObjectGuid const& guid : _ancientGemAlliance)
|
||||
instance->GetGameObject(guid)->Respawn();
|
||||
if (GameObject* gem = instance->GetGameObject(guid))
|
||||
gem->Respawn();
|
||||
|
||||
// Move all alliance NPCs near Jaina (only happens in this base, not Horde's)
|
||||
if (Creature* jaina = GetCreature(DATA_JAINA))
|
||||
{
|
||||
for (ObjectGuid const& guid : _baseAlliance)
|
||||
{
|
||||
if (instance->GetCreature(guid) && instance->GetCreature(guid)->IsAlive())
|
||||
if (Creature* creature = instance->GetCreature(guid))
|
||||
{
|
||||
float x, y, z;
|
||||
jaina->GetNearPoint(instance->GetCreature(guid), x, y, z, 10.f, 0, jaina->GetAngle(instance->GetCreature(guid)));
|
||||
instance->GetCreature(guid)->SetWalk(true);
|
||||
instance->GetCreature(guid)->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
if (creature->IsAlive())
|
||||
{
|
||||
float x, y, z;
|
||||
jaina->GetNearPoint(creature, x, y, z, 10.f, 0, jaina->GetAngle(creature));
|
||||
creature->SetWalk(true);
|
||||
creature->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,7 +300,10 @@ public:
|
||||
_scheduler.Schedule(30s, [this](TaskContext)
|
||||
{
|
||||
for (ObjectGuid const& guid : _roaringFlameAlliance)
|
||||
instance->GetGameObject(guid)->Respawn();
|
||||
{
|
||||
if (GameObject* flame = instance->GetGameObject(guid))
|
||||
flame->Respawn();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -309,18 +316,24 @@ public:
|
||||
_bossWave = 0;
|
||||
_retreat = DATA_HORDE_RETREAT;
|
||||
for (ObjectGuid const& guid : _ancientGemHorde)
|
||||
instance->GetGameObject(guid)->Respawn();
|
||||
{
|
||||
if (GameObject* gem = instance->GetGameObject(guid))
|
||||
gem->Respawn();
|
||||
}
|
||||
|
||||
if (Creature* jaina = GetCreature(DATA_JAINA))
|
||||
{
|
||||
for (ObjectGuid const& guid : _baseHorde)
|
||||
{
|
||||
if (instance->GetCreature(guid) && instance->GetCreature(guid)->IsAlive())
|
||||
if (Creature* creature = instance->GetCreature(guid))
|
||||
{
|
||||
float x, y, z;
|
||||
jaina->GetNearPoint(instance->GetCreature(guid), x, y, z, 10.f, 0, jaina->GetAngle(instance->GetCreature(guid)));
|
||||
instance->GetCreature(guid)->SetWalk(true);
|
||||
instance->GetCreature(guid)->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
if (creature->IsAlive())
|
||||
{
|
||||
float x, y, z;
|
||||
jaina->GetNearPoint(creature, x, y, z, 10.f, 0, jaina->GetAngle(creature));
|
||||
creature->SetWalk(true);
|
||||
creature->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -334,7 +347,8 @@ public:
|
||||
_scheduler.Schedule(30s, [this](TaskContext)
|
||||
{
|
||||
for (ObjectGuid const& guid : _roaringFlameHorde)
|
||||
instance->GetGameObject(guid)->Respawn();
|
||||
if (GameObject* flame = instance->GetGameObject(guid))
|
||||
flame->Respawn();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -466,7 +480,8 @@ public:
|
||||
if (Creature* creature = instance->GetCreature(guid))
|
||||
creature->DespawnOrUnsummon();
|
||||
|
||||
GetCreature(DATA_ARCHIMONDE)->DespawnOrUnsummon();
|
||||
if (Creature* archimonde = GetCreature(DATA_ARCHIMONDE))
|
||||
archimonde->DespawnOrUnsummon();
|
||||
|
||||
_scheduler.Schedule(300s, [this](TaskContext)
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#define GOSSIP_ITEM_1 "Brann, it would be our honor!"
|
||||
#define GOSSIP_ITEM_2 "Let's move Brann, enough of the history lessons!"
|
||||
#define GOSSIP_ITEM_3 "We dont have time for this right now, we have to keep going."
|
||||
#define GOSSIP_ITEM_3 "There will be plenty of time for this later Brann, we need to get moving!"
|
||||
#define GOSSIP_ITEM_4 "We're with you Brann! Open it!"
|
||||
#define TEXT_ID_START 13100
|
||||
|
||||
|
||||
@@ -718,11 +718,15 @@ struct npc_pet_gen_toxic_wasteling : public PassiveAI
|
||||
}
|
||||
};
|
||||
|
||||
enum FetchBall
|
||||
{
|
||||
SPELL_PET_TOY_FETCH_BALL_COME_HERE = 48649,
|
||||
SPELL_PET_TOY_FETCH_BALL_HAS_BALL = 48708
|
||||
};
|
||||
|
||||
struct npc_pet_gen_fetch_ball : public NullCreatureAI
|
||||
{
|
||||
npc_pet_gen_fetch_ball(Creature* c) : NullCreatureAI(c)
|
||||
{
|
||||
}
|
||||
npc_pet_gen_fetch_ball(Creature* c) : NullCreatureAI(c) { }
|
||||
|
||||
uint32 checkTimer;
|
||||
ObjectGuid targetGUID;
|
||||
@@ -735,12 +739,12 @@ struct npc_pet_gen_fetch_ball : public NullCreatureAI
|
||||
me->SetOwnerGUID(summoner->GetGUID());
|
||||
checkTimer = 0;
|
||||
targetGUID.Clear();
|
||||
me->CastSpell(me, 48649 /*SPELL_PET_TOY_FETCH_BALL_COME_HERE*/, true);
|
||||
me->CastSpell(me, SPELL_PET_TOY_FETCH_BALL_COME_HERE, true);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (spellInfo->Id == 48649 /*SPELL_PET_TOY_FETCH_BALL_COME_HERE*/)
|
||||
if (spellInfo->Id == SPELL_PET_TOY_FETCH_BALL_COME_HERE)
|
||||
{
|
||||
target->GetMotionMaster()->MovePoint(50, me->GetHomePosition());
|
||||
targetGUID = target->GetGUID();
|
||||
@@ -757,8 +761,8 @@ struct npc_pet_gen_fetch_ball : public NullCreatureAI
|
||||
if (me->GetDistance2d(target) < 2.0f)
|
||||
{
|
||||
target->AI()->EnterEvadeMode();
|
||||
target->CastSpell(target, 48708 /*SPELL_PET_TOY_FETCH_BALL_HAS_BALL*/, true);
|
||||
me->DespawnOrUnsummon(1);
|
||||
target->CastSpell(target, SPELL_PET_TOY_FETCH_BALL_HAS_BALL, true);
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,8 +173,8 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
for (int removeIndex : newSocketsToRemoveIndexes)
|
||||
_newSockets.erase(_newSockets.begin() + removeIndex);
|
||||
for (auto it = newSocketsToRemoveIndexes.rbegin(); it != newSocketsToRemoveIndexes.rend(); ++it)
|
||||
_newSockets.erase(_newSockets.begin() + *it);
|
||||
}
|
||||
|
||||
void Run()
|
||||
|
||||
Reference in New Issue
Block a user