aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKudlaty <none@none>2009-07-23 19:30:25 +0200
committerKudlaty <none@none>2009-07-23 19:30:25 +0200
commit81e6f06680ce85989df27c2c34cdcd74932ab9ad (patch)
tree0ae10b7c15a47c97c4efddf34efec934612e4210 /src
parent21ffe5f70adfaee9fb1567fb42d0e276e79b8ec7 (diff)
Add script for quest 12861. Author: Drethek.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/CMakeLists.txt1
-rw-r--r--src/bindings/scripts/ScriptMgr.cpp6
-rw-r--r--src/bindings/scripts/VC80/80ScriptDev2.vcproj8
-rw-r--r--src/bindings/scripts/VC90/90ScriptDev2.vcproj8
-rw-r--r--src/bindings/scripts/scripts/zone/zuldrak/zuldrak.cpp187
5 files changed, 210 insertions, 0 deletions
diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt
index 3f86535f5e3..3dcd38fa256 100644
--- a/src/bindings/scripts/CMakeLists.txt
+++ b/src/bindings/scripts/CMakeLists.txt
@@ -380,6 +380,7 @@ SET(trinityscript_LIB_SRCS
scripts/zone/zulaman/def_zulaman.h
scripts/zone/zulaman/instance_zulaman.cpp
scripts/zone/zulaman/zulaman.cpp
+ scripts/zone/zuldrak/zuldrak.cpp
scripts/zone/zulfarrak/zulfarrak.cpp
scripts/zone/zulgurub/boss_arlokk.cpp
scripts/zone/zulgurub/boss_gahzranka.cpp
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp
index 217752b340e..3dbdd4899a1 100644
--- a/src/bindings/scripts/ScriptMgr.cpp
+++ b/src/bindings/scripts/ScriptMgr.cpp
@@ -636,6 +636,9 @@ extern void AddSC_boss_zuljin();
extern void AddSC_instance_zulaman();
extern void AddSC_zulaman();
+//Zul'Drak
+extern void AddSC_zuldrak();
+
//Northrend
//Dungeon
//Vault of Archavon
@@ -1534,6 +1537,9 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf")
AddSC_instance_zulaman();
AddSC_zulaman();
+ //Zul'Drak
+ AddSC_zuldrak();
+
//Northrend
//Dungeon
//Vault of Archavon
diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
index 76167df9ae1..a615d579f4c 100644
--- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
@@ -1835,6 +1835,14 @@
>
</File>
</Filter>
+ <Filter
+ Name="Zul&apos;Drak"
+ >
+ <File
+ RelativePath="..\scripts\zone\zuldrak\zuldrak.cpp"
+ >
+ </File>
+ </Filter>
<Filter
Name="Wetlands"
>
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index 4edd104a1c6..effb6e84d13 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -1836,6 +1836,14 @@
>
</File>
</Filter>
+ <Filter
+ Name="Zul&apos;Drak"
+ >
+ <File
+ RelativePath="..\scripts\zone\zuldrak\zuldrak.cpp"
+ >
+ </File>
+ </Filter>
<Filter
Name="Wetlands"
>
diff --git a/src/bindings/scripts/scripts/zone/zuldrak/zuldrak.cpp b/src/bindings/scripts/scripts/zone/zuldrak/zuldrak.cpp
new file mode 100644
index 00000000000..bcb2d1f4957
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/zuldrak/zuldrak.cpp
@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "precompiled.h"
+
+/*####
+## npc_drakuru_shackles
+####*/
+
+enum
+{
+ SPELL_LEFT_CHAIN = 59951,
+ SPELL_RIGHT_CHAIN = 59952,
+ SPELL_UNLOCK_SHACKLE = 55083,
+ SPELL_FREE_RAGECLAW = 55223,
+
+ NPC_RAGECLAW = 29686
+};
+
+struct TRINITY_DLL_DECL npc_drakuru_shacklesAI : public ScriptedAI
+{
+ npc_drakuru_shacklesAI(Creature *c) : ScriptedAI(c) {}
+
+ Unit* Rageclaw;
+
+ void Reset()
+ {
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ float x, y, z;
+ Rageclaw = NULL;
+ m_creature->GetClosePoint(x, y, z, m_creature->GetObjectSize()/3,0.1);
+ if (Unit* summon = m_creature->SummonCreature(NPC_RAGECLAW,x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1000))
+ DoActionOnRageclaw(true,summon);
+ }
+
+ void DoActionOnRageclaw(bool locking, Unit *who)
+ {
+ if (!who)
+ return;
+
+ if (locking)
+ {
+ if (who)
+ {
+ Rageclaw = who;
+
+ m_creature->SetInFront(Rageclaw);
+ Rageclaw->SetInFront(m_creature);
+
+ m_creature->CastSpell(Rageclaw, SPELL_LEFT_CHAIN, true);
+ m_creature->CastSpell(Rageclaw, SPELL_RIGHT_CHAIN, true);
+ }
+ }
+ else
+ {
+ DoCast(Rageclaw, SPELL_FREE_RAGECLAW, true);
+ CAST_PLR(who)->KilledMonsterCredit(NPC_RAGECLAW, Rageclaw->GetGUID());
+ m_creature->setDeathState(DEAD);
+ }
+ }
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if (spell->Id == SPELL_UNLOCK_SHACKLE)
+ {
+ if (Rageclaw)
+ DoActionOnRageclaw(false,caster);
+ else
+ m_creature->setDeathState(JUST_DIED);
+
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_drakuru_shackles(Creature *_Creature)
+{
+ return new npc_drakuru_shacklesAI (_Creature);
+}
+
+
+/*####
+## npc_captured_rageclaw
+####*/
+
+enum
+{
+ SPELL_UNSHACKLED = 55085,
+ SPELL_KNEEL = 39656
+};
+
+const char * SAY_RAGECLAW_1 = "I poop on you, trollses!";
+const char * SAY_RAGECLAW_2 = "ARRRROOOOGGGGAAAA!";
+const char * SAY_RAGECLAW_3 = "No more mister nice wolvar!";
+#define SAY_RAGECLAW RAND(SAY_RAGECLAW_1,SAY_RAGECLAW_2,SAY_RAGECLAW_3)
+
+struct TRINITY_DLL_DECL npc_captured_rageclawAI : public ScriptedAI
+{
+ npc_captured_rageclawAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 DespawnTimer;
+ bool Despawn;
+
+ void Reset()
+ {
+ Despawn = false;
+ DespawnTimer = 0;
+ m_creature->setFaction(35);
+ m_creature->CastSpell(m_creature, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P
+ }
+
+ void MoveInLineOfSight(Unit *who){}
+
+ void SpellHit(Unit *caster, const SpellEntry *spell)
+ {
+ if (spell->Id == SPELL_FREE_RAGECLAW)
+ {
+ if (m_creature->GetDummyAura(SPELL_LEFT_CHAIN))
+ m_creature->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN);
+
+ if (m_creature->GetDummyAura(SPELL_RIGHT_CHAIN))
+ m_creature->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN);
+
+ if (m_creature->GetDummyAura(SPELL_KNEEL))
+ m_creature->RemoveAurasDueToSpell(SPELL_KNEEL);
+
+ m_creature->setFaction(m_creature->GetCreatureInfo()->faction_H);
+
+ DoCast(m_creature, SPELL_UNSHACKLED, true);
+ DoSay(SAY_RAGECLAW, LANG_UNIVERSAL, NULL);
+ m_creature->GetMotionMaster()->MoveRandom(10);
+
+ DespawnTimer = 10000;
+ Despawn = true;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (m_creature->getVictim())
+ {
+ DoMeleeAttackIfReady();
+ return;
+ }
+
+ if (!Despawn)
+ return;
+
+ if (DespawnTimer < diff)
+ m_creature->setDeathState(JUST_DIED);
+ else DespawnTimer-=diff;
+ }
+};
+
+CreatureAI* GetAI_npc_captured_rageclaw(Creature *_Creature)
+{
+ return new npc_captured_rageclawAI (_Creature);
+}
+
+void AddSC_zuldrak()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="npc_drakuru_shackles";
+ newscript->GetAI = &GetAI_npc_drakuru_shackles;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="npc_captured_rageclaw";
+ newscript->GetAI = &GetAI_npc_captured_rageclaw;
+ newscript->RegisterSelf();
+}