refactor(Scripts/Ashenvale): Move Naga Brazier script to SAI (#17733)
This commit is contained in:
parent
055e2dc5ab
commit
deff0ac587
2 changed files with 18 additions and 25 deletions
|
|
@ -53,7 +53,9 @@ enum Muglash
|
|||
NPC_WRATH_SEAWITCH = 3715,
|
||||
|
||||
NPC_VORSHA = 12940,
|
||||
NPC_MUGLASH = 12717
|
||||
NPC_MUGLASH = 12717,
|
||||
|
||||
ACTION_EXTINGUISH_BLAZIER = 0
|
||||
};
|
||||
|
||||
Position const FirstNagaCoord[3] =
|
||||
|
|
@ -88,6 +90,15 @@ public:
|
|||
_isBrazierExtinguished = false;
|
||||
}
|
||||
|
||||
void DoAction(int32 actionId) override
|
||||
{
|
||||
if (actionId == ACTION_EXTINGUISH_BLAZIER)
|
||||
{
|
||||
Talk(SAY_MUG_BRAZIER_WAIT);
|
||||
_isBrazierExtinguished = true;
|
||||
}
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
|
|
@ -202,7 +213,6 @@ public:
|
|||
private:
|
||||
uint32 eventTimer;
|
||||
uint8 waveId;
|
||||
public:
|
||||
bool _isBrazierExtinguished;
|
||||
};
|
||||
|
||||
|
|
@ -212,30 +222,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class go_naga_brazier : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_naga_brazier() : GameObjectScript("go_naga_brazier") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
{
|
||||
if (Creature* creature = GetClosestCreatureWithEntry(go, NPC_MUGLASH, INTERACTION_DISTANCE * 2))
|
||||
{
|
||||
if (npc_muglash::npc_muglashAI* pEscortAI = CAST_AI(npc_muglash::npc_muglashAI, creature->AI()))
|
||||
{
|
||||
creature->AI()->Talk(SAY_MUG_BRAZIER_WAIT);
|
||||
|
||||
pEscortAI->_isBrazierExtinguished = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_ashenvale()
|
||||
{
|
||||
new npc_muglash();
|
||||
new go_naga_brazier();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue