aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMachiavelli <none@none>2009-06-11 20:17:44 +0200
committerMachiavelli <none@none>2009-06-11 20:17:44 +0200
commit181a647af56086f81bdc7473c8fa7484f7650ee8 (patch)
tree6e93d6315efc9558b6b6abe82e9de7313ae5d1cd
parent6be9e51035ca3aa3732bd3a81d4a678bf4724741 (diff)
* Add script for Razorfen Kraul, implements access to certain room after certain event. Script by ArticDevil, thank you.
* Rename the 'Azeroth' filter to 'Eastern Kingdoms' in the script vcproj files --HG-- branch : trunk
-rw-r--r--sql/updates/TC1_1569_world_scripts.sql3
-rw-r--r--src/bindings/scripts/VC71/71ScriptDev2.vcproj8
-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/razorfen_kraul/def_razorfen_kraul.h21
-rw-r--r--src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp119
-rw-r--r--src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp53
7 files changed, 219 insertions, 1 deletions
diff --git a/sql/updates/TC1_1569_world_scripts.sql b/sql/updates/TC1_1569_world_scripts.sql
new file mode 100644
index 00000000000..afe0759e711
--- /dev/null
+++ b/sql/updates/TC1_1569_world_scripts.sql
@@ -0,0 +1,3 @@
+-- Razorfen Kraul
+UPDATE `instance_template` SET `script` = 'instance_razorfen_kraul' WHERE `map` = '47' LIMIT 1;
+UPDATE `creature_template` SET `ScriptName` = 'npc_deaths_head_ward_keeper' WHERE `entry` = '4625' LIMIT 1; \ No newline at end of file
diff --git a/src/bindings/scripts/VC71/71ScriptDev2.vcproj b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
index e92d43e61c2..3fb0cd7ad8f 100644
--- a/src/bindings/scripts/VC71/71ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
@@ -536,6 +536,14 @@
RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\razorfen_kraul\instance_razorfen_kraul.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\razorfen_kraul\def_razorfen_kraul.h"
+ >
+ </File>
</Filter>
<Filter
Name="Redridge Mountains"
diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
index fcec093ee91..9341c9ddfa4 100644
--- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
@@ -713,6 +713,14 @@
RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\razorfen_kraul\instance_razorfen_kraul.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\razorfen_kraul\def_razorfen_kraul.h"
+ >
+ </File>
</Filter>
<Filter
Name="Redridge Mountains"
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index 7cf04d191ed..128be8ff8e0 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -706,6 +706,14 @@
RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\razorfen_kraul\instance_razorfen_kraul.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\razorfen_kraul\def_razorfen_kraul.h"
+ >
+ </File>
</Filter>
<Filter
Name="Redridge Mountains"
diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h b/src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h
new file mode 100644
index 00000000000..96917fcd4bf
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h
@@ -0,0 +1,21 @@
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * 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
+ */
+
+#ifndef DEF_RAZORFEN_KRAUL_H
+#define DEF_RAZORFEN_KRAUL_H
+
+#define TYPE_WARD_KEEPERS 1
+#endif \ No newline at end of file
diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp
new file mode 100644
index 00000000000..e7ede4b28d6
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp
@@ -0,0 +1,119 @@
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * 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
+ */
+
+/* ScriptData
+SDName: Instance_Razorfen_Kraul
+SD%Complete:
+SDComment:
+SDCategory: Razorfen Kraul
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_razorfen_kraul.h"
+
+
+#define WARD_KEEPERS_NR 2
+
+struct TRINITY_DLL_DECL instance_razorfen_kraul : public ScriptedInstance
+{
+ instance_razorfen_kraul(Map *map) : ScriptedInstance(map) {Initialize();};
+
+ uint64 DoorWardGUID;
+ uint32 WardCheck_Timer;
+ int WardKeeperAlive;
+
+ void Initialize()
+ {
+ WardKeeperAlive = 1;
+ WardCheck_Timer = 4000;
+ DoorWardGUID = 0;
+ }
+
+ Player* GetPlayerInMap()
+ {
+ Map::PlayerList const& players = instance->GetPlayers();
+
+ if (!players.isEmpty())
+ {
+ for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
+ {
+ if (Player* plr = itr->getSource())
+ return plr;
+ }
+ }
+ debug_log("TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!");
+ return NULL;
+ }
+
+ void OnObjectCreate(GameObject *go)
+ {
+ switch(go->GetEntry())
+ {
+ case 21099: DoorWardGUID = go->GetGUID(); break;
+ }
+ }
+
+ void HandleGameObject(uint64 guid, uint32 state)
+ {
+ Player *player = GetPlayerInMap();
+
+ if (!player || !guid)
+ {
+ debug_log("SD2: Instance Razorfen Kraul: HandleGameObject fail");
+ return;
+ }
+
+ if (GameObject *go = GameObject::GetGameObject(*player,guid))
+ go->SetGoState(state);
+ }
+
+ void Update(uint32 diff)
+ {
+ if (WardCheck_Timer < diff)
+ {
+ HandleGameObject(DoorWardGUID, WardKeeperAlive);
+ WardKeeperAlive = 0;
+ WardCheck_Timer = 4000;
+ }else
+ WardCheck_Timer -= diff;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case TYPE_WARD_KEEPERS:
+ if (data == NOT_STARTED)
+ WardKeeperAlive = 1;
+ break;
+ }
+ }
+
+};
+
+InstanceData* GetInstanceData_instance_razorfen_kraul(Map* map)
+{
+ return new instance_razorfen_kraul(map);
+}
+
+void AddSC_instance_razorfen_kraul()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_razorfen_kraul";
+ newscript->GetInstanceData = &GetInstanceData_instance_razorfen_kraul;
+ newscript->RegisterSelf();
+} \ No newline at end of file
diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp
index 39be57325d7..70d997c3c43 100644
--- a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp
+++ b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp
@@ -27,6 +27,7 @@ EndContentData */
#include "precompiled.h"
#include "../../npc/npc_escortAI.h"
+#include "def_razorfen_kraul.h"
#define SAY_READY -1047000
#define SAY_POINT -10470001
@@ -42,10 +43,11 @@ EndContentData */
#define QUEST_WILLIX_THE_IMPORTER 1144
#define ENTRY_BOAR 4514
+#define SPELL_QUILLBOAR_CHANNELING 7083
struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI
{
-npc_willixAI(Creature *c) : npc_escortAI(c) {}
+ npc_willixAI(Creature *c) : npc_escortAI(c) {}
void WaypointReached(uint32 i)
{
@@ -137,6 +139,50 @@ bool QuestAccept_npc_willix(Player* player, Creature* creature, Quest const* que
return true;
}
+struct TRINITY_DLL_DECL npc_deaths_head_ward_keeperAI : public ScriptedAI
+{
+ npc_deaths_head_ward_keeperAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+ uint32 QuillboarChanneling_Timer;
+
+ void Reset()
+ {
+ QuillboarChanneling_Timer = 1500;
+ }
+
+ void Aggro(Unit *who)
+ {
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!m_creature->isAlive())
+ return;
+
+ if (pInstance)
+ pInstance->SetData(TYPE_WARD_KEEPERS, NOT_STARTED);
+
+ if (QuillboarChanneling_Timer < diff)
+ {
+ if( m_creature->IsNonMeleeSpellCasted(false) )
+ m_creature->InterruptNonMeleeSpells(true);
+ DoCast(m_creature, SPELL_QUILLBOAR_CHANNELING);
+ QuillboarChanneling_Timer = 1100;
+ }else QuillboarChanneling_Timer -= diff;
+
+ }
+};
+
+CreatureAI* GetAI_npc_deaths_head_ward_keeper(Creature *_Creature)
+{
+ return new npc_deaths_head_ward_keeperAI(_Creature);
+}
+
CreatureAI* GetAI_npc_willix(Creature *_Creature)
{
npc_willixAI* thisAI = new npc_willixAI(_Creature);
@@ -201,5 +247,10 @@ void AddSC_razorfen_kraul()
newscript->GetAI = &GetAI_npc_willix;
newscript->pQuestAccept = &QuestAccept_npc_willix;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_deaths_head_ward_keeper";
+ newscript->GetAI = &GetAI_npc_deaths_head_ward_keeper;
+ newscript->RegisterSelf();
}