From ce0a56b25523f5e8a2db21a6361c40d03667cc29 Mon Sep 17 00:00:00 2001 From: Chaz Brown Date: Thu, 10 Sep 2009 01:48:09 -0400 Subject: [PATCH] Add forgotten change to world.sql and update script for scarlet ghouls (quest 12698) so they are in defensive mode. Also make it so, if you abandon the quest, you don't get to keep your minions... Still need some official info on these, if anyone can help. --HG-- branch : trunk --- sql/world.sql | 4 ++- .../scarlet_enclave/chapter1.cpp | 28 ++++++++++++------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/sql/world.sql b/sql/world.sql index e96ffb4388e..48f52900ef4 100644 --- a/sql/world.sql +++ b/sql/world.sql @@ -2599,6 +2599,7 @@ DROP TABLE IF EXISTS `script_texts`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; CREATE TABLE `script_texts` ( + `npc_entry` mediumint(8) NOT NULL default '0' COMMENT 'creature_template entry', `entry` mediumint(8) NOT NULL, `content_default` text NOT NULL, `content_loc1` text, @@ -2614,10 +2615,11 @@ CREATE TABLE `script_texts` ( `language` tinyint(3) unsigned NOT NULL default '0', `emote` smallint(5) unsigned NOT NULL default '0', `comment` text, - PRIMARY KEY (`entry`) + PRIMARY KEY (`npc_entry`,`entry`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts'; SET character_set_client = @saved_cs_client; + -- -- Table structure for table `script_waypoint` -- diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp index eaf3992dabd..d68c0e3c6b8 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp @@ -709,18 +709,26 @@ CreatureAI* GetAI_npc_dkc1_gothik(Creature* pCreature) struct TRINITY_DLL_DECL npc_scarlet_ghoulAI : public ScriptedAI { - npc_scarlet_ghoulAI(Creature *c) : ScriptedAI(c) {} + npc_scarlet_ghoulAI(Creature *c) : ScriptedAI(c) + { + me->SetReactState(REACT_DEFENSIVE); + } - void MoveInLineOfSight(Unit *target) + void UpdateAI(const uint32 diff) { - EnterEvadeMode(); - return; - } - void Aggro(Unit *who) - { - EnterEvadeMode(); - return; - } + if (Unit *owner = m_creature->GetOwner()) + { + if (owner->GetTypeId() == TYPEID_PLAYER) + { + if (CAST_PLR(owner)->GetQuestStatus(12698) != QUEST_STATUS_INCOMPLETE) + { + m_creature->ForcedDespawn(); + m_creature->GetOwner()->RemoveAllMinionsByEntry(28845); + } + } + } + ScriptedAI::UpdateAI(diff); + } }; CreatureAI* GetAI_npc_scarlet_ghoul(Creature* pCreature)