aboutsummaryrefslogtreecommitdiff
path: root/src/bindings
diff options
context:
space:
mode:
authormegamage <none@none>2008-11-21 19:49:54 -0600
committermegamage <none@none>2008-11-21 19:49:54 -0600
commit32485bc5d1bbde8f4b5e81d718f0fc0119442294 (patch)
treed2a8c99fdfe21d410ec2642831439fb0c3256ada /src/bindings
parentfa667cf4507e5635d597b878119ce20f2836cc8c (diff)
parenta2c168155d2871aae22d1e4bccc3951525f6085d (diff)
Merge with 284 (54b0e67d97fe).
--HG-- branch : trunk
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/scripts/scripts/npc/npcs_special.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp
index 00116746a68..d762c8803e6 100644
--- a/src/bindings/scripts/scripts/npc/npcs_special.cpp
+++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp
@@ -825,6 +825,71 @@ bool GossipSelect_npc_sayge(Player *player, Creature *_Creature, uint32 sender,
return true;
}
+struct TRINITY_DLL_DECL npc_steam_tonkAI : public ScriptedAI
+{
+ npc_steam_tonkAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset() {}
+ void Aggro(Unit *who) {}
+
+ void OnPossess(bool apply)
+ {
+ if (apply)
+ {
+ // Initialize the action bar without the melee attack command
+ m_creature->InitCharmInfo(m_creature);
+ m_creature->GetCharmInfo()->InitEmptyActionBar(false);
+
+ m_creature->SetAggressive(false);
+ }
+ else
+ m_creature->SetAggressive(true);
+ }
+
+};
+
+CreatureAI* GetAI_npc_steam_tonk(Creature *_Creature)
+{
+ return new npc_steam_tonkAI(_Creature);
+}
+
+#define SPELL_TONK_MINE_DETONATE 25099
+
+struct TRINITY_DLL_DECL npc_tonk_mineAI : public ScriptedAI
+{
+ npc_tonk_mineAI(Creature *c) : ScriptedAI(c)
+ {
+ m_creature->SetAggressive(false);
+ Reset();
+ }
+
+ uint32 ExplosionTimer;
+
+ void Reset()
+ {
+ ExplosionTimer = 3000;
+ }
+
+ void Aggro(Unit *who) {}
+ void AttackStart(Unit *who) {}
+ void MoveInLineOfSight(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (ExplosionTimer < diff)
+ {
+ m_creature->CastSpell(m_creature, SPELL_TONK_MINE_DETONATE, true);
+ m_creature->setDeathState(DEAD); // unsummon it
+ } else
+ ExplosionTimer -= diff;
+ }
+};
+
+CreatureAI* GetAI_npc_tonk_mine(Creature *_Creature)
+{
+ return new npc_tonk_mineAI(_Creature);
+}
+
void AddSC_npcs_special()
{
Script *newscript;
@@ -875,4 +940,14 @@ void AddSC_npcs_special()
newscript->pGossipHello = &GossipHello_npc_sayge;
newscript->pGossipSelect = &GossipSelect_npc_sayge;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="npc_steam_tonk";
+ newscript->GetAI = &GetAI_npc_steam_tonk;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="npc_tonk_mine";
+ newscript->GetAI = &GetAI_npc_tonk_mine;
+ newscript->RegisterSelf();
}