From 6be9e51035ca3aa3732bd3a81d4a678bf4724741 Mon Sep 17 00:00:00 2001 From: Chaz Brown Date: Thu, 11 Jun 2009 06:29:35 -0400 Subject: Forgotten changes in characters.sql --HG-- branch : trunk --- sql/characters.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sql') diff --git a/sql/characters.sql b/sql/characters.sql index bcb2b449c0f..17274932e18 100644 --- a/sql/characters.sql +++ b/sql/characters.sql @@ -197,10 +197,10 @@ CREATE TABLE `auctionhousebot` ( -- Data for table `auctionhousebot` -- -insert into `auctionhousebot`(`auctionhouse`,`name`,`minitems`,`maxitems`,`mintime`,`maxtime`,`percentgreytradegoods`,`percentwhitetradegoods`,`percentgreentradegoods`,`percentbluetradegoods`,`percentpurpletradegoods`,`percentorangetradegoods`,`percentyellowtradegoods`,`percentgreyitems`,`percentwhiteitems`,`percentgreenitems`,`percentblueitems`,`percentpurpleitems`,`percentorangeitems`,`percentyellowitems`,`minpricegrey`,`maxpricegrey`,`minpricewhite`,`maxpricewhite`,`minpricegreen`,`maxpricegreen`,`minpriceblue`,`maxpriceblue`,`minpricepurple`,`maxpricepurple`,`minpriceorange`,`maxpriceorange`,`minpriceyellow`,`maxpriceyellow`,`minbidpricegrey`,`maxbidpricegrey`,`minbidpricewhite`,`maxbidpricewhite`,`minbidpricegreen`,`maxbidpricegreen`,`minbidpriceblue`,`maxbidpriceblue`,`minbidpricepurple`,`maxbidpricepurple`,`minbidpriceorange`,`maxbidpriceorange`,`minbidpriceyellow`,`maxbidpriceyellow`,`maxstackgrey`,`maxstackwhite`,`maxstackgreen`,`maxstackblue`,`maxstackpurple`,`maxstackorange`,`maxstackyellow`,`buyerpricegrey`,`buyerpricewhite`,`buyerpricegreen`,`buyerpriceblue`,`buyerpricepurple`,`buyerpriceorange`,`buyerpriceyellow`,`buyerbiddinginterval`,`buyerbidsperinterval`) values -(2,'Alliance',0,0,8,24,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,1,5,12,15,20,22,1,1), -(6,'Horde',0,0,8,24,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,1,5,12,15,20,22,1,1), -(7,'Neutral',0,0,8,24,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,1,5,12,15,20,22,1,1); +insert into `auctionhousebot`(`auctionhouse`,`name`,`minitems`,`maxitems`,`percentgreytradegoods`,`percentwhitetradegoods`,`percentgreentradegoods`,`percentbluetradegoods`,`percentpurpletradegoods`,`percentorangetradegoods`,`percentyellowtradegoods`,`percentgreyitems`,`percentwhiteitems`,`percentgreenitems`,`percentblueitems`,`percentpurpleitems`,`percentorangeitems`,`percentyellowitems`,`minpricegrey`,`maxpricegrey`,`minpricewhite`,`maxpricewhite`,`minpricegreen`,`maxpricegreen`,`minpriceblue`,`maxpriceblue`,`minpricepurple`,`maxpricepurple`,`minpriceorange`,`maxpriceorange`,`minpriceyellow`,`maxpriceyellow`,`minbidpricegrey`,`maxbidpricegrey`,`minbidpricewhite`,`maxbidpricewhite`,`minbidpricegreen`,`maxbidpricegreen`,`minbidpriceblue`,`maxbidpriceblue`,`minbidpricepurple`,`maxbidpricepurple`,`minbidpriceorange`,`maxbidpriceorange`,`minbidpriceyellow`,`maxbidpriceyellow`,`maxstackgrey`,`maxstackwhite`,`maxstackgreen`,`maxstackblue`,`maxstackpurple`,`maxstackorange`,`maxstackyellow`,`buyerpricegrey`,`buyerpricewhite`,`buyerpricegreen`,`buyerpriceblue`,`buyerpricepurple`,`buyerpriceorange`,`buyerpriceyellow`,`buyerbiddinginterval`,`buyerbidsperinterval`) values +(2,'Alliance',0,0,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,1,5,12,15,20,22,1,1), +(6,'Horde',0,0,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,1,5,12,15,20,22,1,1), +(7,'Neutral',0,0,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,1,5,12,15,20,22,1,1); -- -- Table structure for table `bugreport` -- cgit v1.2.3 From 181a647af56086f81bdc7473c8fa7484f7650ee8 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 11 Jun 2009 20:17:44 +0200 Subject: * 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 --- sql/updates/TC1_1569_world_scripts.sql | 3 + src/bindings/scripts/VC71/71ScriptDev2.vcproj | 8 ++ src/bindings/scripts/VC80/80ScriptDev2.vcproj | 8 ++ src/bindings/scripts/VC90/90ScriptDev2.vcproj | 8 ++ .../zone/razorfen_kraul/def_razorfen_kraul.h | 21 ++++ .../razorfen_kraul/instance_razorfen_kraul.cpp | 119 +++++++++++++++++++++ .../scripts/zone/razorfen_kraul/razorfen_kraul.cpp | 53 ++++++++- 7 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 sql/updates/TC1_1569_world_scripts.sql create mode 100644 src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h create mode 100644 src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp (limited to 'sql') 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" > + + + + + + + + + + + + + * 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 + * 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(); } -- cgit v1.2.3