diff options
4 files changed, 36 insertions, 3 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 92d841821a1..3494ae059c0 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -1201,3 +1201,8 @@ INSERT INTO areatrigger_scripts VALUES (4156, 'at_naxxramas_frostwyrm_wing'); DELETE FROM areatrigger_scripts WHERE entry=3066; INSERT INTO areatrigger_scripts VALUES (3066,'at_ravenholdt'); + +/* Oculus: "Just for the logic, shouldn't be necessary": */ +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=23035 AND `comment` LIKE 'Anzu%Death'; +INSERT INTO `creature_ai_scripts` (`creature_id`,`event_type`,`event_chance`,`event_flags`,`action1_type`,`action1_param1`,`action1_param2`,`comment`) VALUES +(23035,6,100,6,34,2,3,'Anzu - Set Inst Data on Death'); diff --git a/sql/updates/4994_world_script.sql b/sql/updates/4994_world_script.sql new file mode 100644 index 00000000000..6b13eddc650 --- /dev/null +++ b/sql/updates/4994_world_script.sql @@ -0,0 +1,4 @@ +/* Oculus: "Just for the logic, shouldn't be necessary": */ +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=23035 AND `comment` LIKE 'Anzu%Death'; +INSERT INTO `creature_ai_scripts` (`creature_id`,`event_type`,`event_chance`,`event_flags`,`action1_type`,`action1_param1`,`action1_param2`,`comment`) VALUES +(23035,6,100,6,34,2,3,'Anzu - Set Inst Data on Death'); diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h index 698571faecc..6156f354d84 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h +++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h @@ -5,6 +5,10 @@ #ifndef DEF_SETHEKK_HALLS_H #define DEF_SETHEKK_HALLS_H -#define DATA_IKISSDOOREVENT 1 +enum +{ + DATA_IKISSDOOREVENT = 1, + TYPE_ANZU_ENCOUNTER = 2, +}; #endif diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp index 3406ce263f7..af2d49c4ee2 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp @@ -24,20 +24,37 @@ EndScriptData */ #include "precompiled.h" #include "def_sethekk_halls.h" -#define IKISS_DOOR 177203 +enum +{ + NPC_ANZU = 23035, + IKISS_DOOR = 177203, +}; struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance { instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + uint32 AnzuEncounter; uint64 m_uiIkissDoorGUID; void Initialize() { + AnzuEncounter = NOT_STARTED; m_uiIkissDoorGUID = 0; } - void OnGameObjectCreate(GameObject *pGo, bool add) + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) + { + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + pCreature->RemoveCorpse(); + } else { + AnzuEncounter = IN_PROGRESS; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) { if (pGo->GetEntry() == IKISS_DOOR) m_uiIkissDoorGUID = pGo->GetGUID(); @@ -51,6 +68,9 @@ struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance if (data == DONE) DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); break; + case TYPE_ANZU_ENCOUNTER: + AnzuEncounter = data; + break; } } }; |
