fix(Core/Events): Corrections to Apothecary Hummel (#10674)

This commit is contained in:
Nefertumm
2022-03-18 18:42:56 -03:00
committed by GitHub
parent 68891ccd74
commit c2b70e3927
3 changed files with 20 additions and 7 deletions

View File

@@ -71,7 +71,8 @@ enum ApothecaryMisc
NPC_VIAL_BUNNY = 36530, NPC_VIAL_BUNNY = 36530,
NPC_CROWN_APOTHECARY = 36885, NPC_CROWN_APOTHECARY = 36885,
PHASE_ALL = 0, PHASE_ALL = 0,
PHASE_INTRO = 1 PHASE_INTRO = 1,
PHASE_COMBAT = 2
}; };
Position const BaxterMovePos = { -221.4115f, 2206.825f, 79.93151f, 0.0f }; Position const BaxterMovePos = { -221.4115f, 2206.825f, 79.93151f, 0.0f };
@@ -108,22 +109,21 @@ public:
_deadCount = 0; _deadCount = 0;
_isDead = false; _isDead = false;
_phase = PHASE_ALL; _phase = PHASE_ALL;
summons.DespawnAll();
me->SetFaction(FACTION_FRIENDLY); me->SetFaction(FACTION_FRIENDLY);
me->SummonCreatureGroup(1); me->SummonCreatureGroup(1);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
} }
void EnterEvadeMode() override void JustSummoned(Creature* summon) override
{ {
summons.DespawnAll(); summons.Summon(summon);
_EnterEvadeMode();
} }
void DoAction(int32 action) override void DoAction(int32 action) override
{ {
if (action == ACTION_START_EVENT && events.IsInPhase(PHASE_ALL)) if (action == ACTION_START_EVENT && _phase == PHASE_ALL)
{ {
events.SetPhase(PHASE_INTRO);
_phase = PHASE_INTRO; _phase = PHASE_INTRO;
_scheduler.Schedule(1ms, [this](TaskContext /*context*/) _scheduler.Schedule(1ms, [this](TaskContext /*context*/)
{ {
@@ -140,6 +140,7 @@ public:
.Schedule(12s, [this](TaskContext context) .Schedule(12s, [this](TaskContext context)
{ {
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
_phase = PHASE_COMBAT;
DoZoneInCombat(); DoZoneInCombat();
context.Schedule(6s, [this](TaskContext /*context*/) // Call Baxter context.Schedule(6s, [this](TaskContext /*context*/) // Call Baxter

View File

@@ -51,6 +51,15 @@ public:
case NPC_DND_CRAZED_APOTHECARY_GENERATOR: case NPC_DND_CRAZED_APOTHECARY_GENERATOR:
_crazedApothecaryGeneratorGUIDs.push_back(creature->GetGUID()); _crazedApothecaryGeneratorGUIDs.push_back(creature->GetGUID());
break; break;
case NPC_APOTHECARY_HUMMEL:
_apothecaryHummel = creature->GetGUID();
break;
case NPC_CRAZED_APOTHECARY:
if (Creature* hummel = instance->GetCreature(_apothecaryHummel))
{
hummel->AI()->JustSummoned(creature);
}
break;
default: default:
break; break;
} }
@@ -132,6 +141,7 @@ public:
private: private:
uint32 _encounters[MAX_ENCOUNTERS]; uint32 _encounters[MAX_ENCOUNTERS];
GuidVector _crazedApothecaryGeneratorGUIDs; GuidVector _crazedApothecaryGeneratorGUIDs;
ObjectGuid _apothecaryHummel;
}; };
}; };

View File

@@ -36,7 +36,9 @@ enum DataTypes
enum SKCreatures enum SKCreatures
{ {
NPC_DND_CRAZED_APOTHECARY_GENERATOR = 36212 NPC_DND_CRAZED_APOTHECARY_GENERATOR = 36212,
NPC_APOTHECARY_HUMMEL = 36296,
NPC_CRAZED_APOTHECARY = 36568
}; };
enum GameObjects enum GameObjects