Add script for Amberpine Woodsmen Grizzly Hills

--HG--
branch : trunk
This commit is contained in:
2010-03-17 18:27:17 -02:30
parent ebb62fb12c
commit bef85de621
3 changed files with 101 additions and 0 deletions
+2
View File
@@ -599,6 +599,8 @@ UPDATE `creature_template` SET `ScriptName` = 'npc_emily' WHERE `entry`=26588;
UPDATE `creature_template` SET `ScriptName` = 'npc_mrfloppy' WHERE `entry`=26589;
UPDATE `gameobject_template` SET `ScriptName`= 'go_amberpine_outhouse' WHERE `entry`=188666;
UPDATE `creature_template` SET `ScriptName`= 'npc_outhouse_bunny' WHERE `entry`=27326;
UPDATE `creature_template` SET `ScriptName`= 'npc_tallhorn_stag' WHERE `entry`=26363;
UPDATE `creature_template` SET `ScriptName`= 'npc_amberpine_woodsman' WHERE `entry`=27293;
/* DRAK'THARON KEEP */
UPDATE `instance_template` SET `script`='instance_drak_tharon' WHERE `map`=600;
+2
View File
@@ -0,0 +1,2 @@
UPDATE `creature_template` SET `ScriptName`= 'npc_tallhorn_stag' WHERE `entry`=26363;
UPDATE `creature_template` SET `ScriptName`= 'npc_amberpine_woodsman' WHERE `entry`=27293;
+97
View File
@@ -410,6 +410,93 @@ CreatureAI* GetAI_npc_outhouse_bunny(Creature* pCreature)
return new npc_outhouse_bunnyAI (pCreature);
}
// Tallhorn Stage
enum etallhornstage
{
OBJECT_HAUNCH = 188665
};
struct npc_tallhorn_stagAI : public ScriptedAI
{
npc_tallhorn_stagAI(Creature* pCreature) : ScriptedAI(pCreature) {}
void UpdateAI(const uint32 uiDiff)
{
if (GameObject* haunch = me->FindNearestGameObject(OBJECT_HAUNCH, 2.0f))
{
me->SetStandState(UNIT_STAND_STATE_DEAD);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
}
}
};
CreatureAI* GetAI_npc_tallhorn_stag(Creature* pCreature)
{
return new npc_tallhorn_stagAI (pCreature);
}
// Amberpine Woodsman
enum eamberpinewoodsman
{
TALLHORN_STAG = 26363
};
struct npc_amberpine_woodsmanAI : public ScriptedAI
{
npc_amberpine_woodsmanAI(Creature* pCreature) : ScriptedAI(pCreature) {}
uint8 m_uiPhase;
uint32 m_uiTimer;
void Reset()
{
m_uiTimer = 0;
m_uiPhase = 1;
}
void UpdateAI(const uint32 uiDiff)
{
if (Creature* stag = me->FindNearestCreature(TALLHORN_STAG, 0.2f))
{
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING);
}
else
if (m_uiPhase)
{
if (m_uiTimer <= uiDiff)
{
switch(m_uiPhase)
{
case 1:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_LOOT);
m_uiTimer = 3000;
m_uiPhase = 2;
break;
case 2:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACK1H);
m_uiTimer = 4000;
m_uiPhase = 1;
break;
}
}
else
m_uiTimer -= uiDiff;
}
ScriptedAI::UpdateAI(uiDiff);
if (!UpdateVictim())
return;
}
};
CreatureAI* GetAI_npc_amberpine_woodsman(Creature* pCreature)
{
return new npc_amberpine_woodsmanAI (pCreature);
}
void AddSC_grizzly_hills()
{
Script* newscript;
@@ -435,4 +522,14 @@ void AddSC_grizzly_hills()
newscript->Name = "npc_outhouse_bunny";
newscript->GetAI = &GetAI_npc_outhouse_bunny;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_tallhorn_stag";
newscript->GetAI = &GetAI_npc_tallhorn_stag;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_amberpine_woodsman";
newscript->GetAI = &GetAI_npc_amberpine_woodsman;
newscript->RegisterSelf();
}