From 81e6f06680ce85989df27c2c34cdcd74932ab9ad Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Thu, 23 Jul 2009 19:30:25 +0200 Subject: Add script for quest 12861. Author: Drethek. --HG-- branch : trunk --- src/bindings/scripts/ScriptMgr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/bindings/scripts/ScriptMgr.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 -- cgit v1.2.3 From 4f7e94ace27126cb272924f1f809635032edca97 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Fri, 24 Jul 2009 06:16:31 +0200 Subject: Merge [SD2] r1095 Correct one spellId in hyjal - skip r1096 Remove more grid search code from scripts and use functions. r1097 Remove obsolete functions redefined in 1094 r1098 Added text for bosses in map 615 r1099 Added instance script for map 615 --HG-- branch : trunk --- sql/FULL/world_script_texts.sql | 50 ++++++++++++++ sql/FULL/world_scripts_full.sql | 3 + src/bindings/scripts/CMakeLists.txt | 2 + src/bindings/scripts/ScriptMgr.cpp | 6 ++ src/bindings/scripts/VC80/80ScriptDev2.vcproj | 12 ++++ src/bindings/scripts/VC90/90ScriptDev2.vcproj | 12 ++++ .../zone/obsidian_sanctum/def_obsidian_sanctum.h | 16 +++++ .../obsidian_sanctum/instance_obsidian_sanctum.cpp | 77 ++++++++++++++++++++++ .../zone/temple_of_ahnqiraj/boss_twinemperors.cpp | 34 ++-------- src/shared/Errors.h | 4 ++ 10 files changed, 188 insertions(+), 28 deletions(-) (limited to 'src/bindings/scripts/ScriptMgr.cpp') diff --git a/sql/FULL/world_script_texts.sql b/sql/FULL/world_script_texts.sql index bfdfae626c2..d5efe5ad1f9 100644 --- a/sql/FULL/world_script_texts.sql +++ b/sql/FULL/world_script_texts.sql @@ -1690,6 +1690,56 @@ INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc1`, `content (-1585028, 'Do not... get too comfortable.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12420, 1, 0, 0, 'kaelthas MT SAY_RECAST_GRAVITY'), (-1585029, 'My demise accomplishes nothing! The Master will have you! You will drown in your own blood! This world shall burn! Aaaghh!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12421, 1, 0, 0, 'kaelthas MT SAY_DEATH'); +-- -1 615 000 OBSIDIAN SANCTUM +INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `emote`, `comment`) VALUES +(-1615000,'I fear nothing! Least of all you!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14111,1,0,0,'shadron SAY_SHADRON_AGGRO'), +(-1615001,'You are insignificant!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14112,1,0,0,'shadron SAY_SHADRON_SLAY_1'), +(-1615002,'Such mediocre resistance!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14113,1,0,0,'shadron SAY_SHADRON_SLAY_2'), +(-1615003,'We...are superior! How could this...be...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14118,1,0,0,'shadron SAY_SHADRON_DEATH'), +(-1615004,'You are easily bested! ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14114,1,0,0,'shadron SAY_SHADRON_BREATH'), +(-1615005,'I will take pity on you Sartharion, just this once.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14117,1,0,0,'shadron SAY_SHADRON_RESPOND'), +(-1615006,'Father tought me well!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14115,1,0,0,'shadron SAY_SHADRON_SPECIAL_1'), +(-1615007,'On your knees!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14116,1,0,0,'shadron SAY_SHADRON_SPECIAL_2'), +(-1615008,'A Shadron Disciple appears in the Twilight!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,0,5,0,0,'shadron WHISPER_SHADRON_DICIPLE'), + +(-1615009,'You have no place here. Your place is among the departed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14122,1,0,0,'tenebron SAY_TENEBRON_AGGRO'), +(-1615010,'No contest.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14123,1,0,0,'tenebron SAY_TENEBRON_SLAY_1'), +(-1615011,'Typical... Just as I was having fun.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14124,1,0,0,'tenebron SAY_TENEBRON_SLAY_2'), +(-1615012,'I should not... have held back...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 14129,1,0,0,'tenebron SAY_TENEBRON_DEATH'), +(-1615013,'To darkness I condemn you...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14125,1,0,0,'tenebron SAY_TENEBRON_BREATH'), +(-1615014,'It is amusing to watch you struggle. Very well, witness how it is done.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14128,1,0,0,'tenebron SAY_TENEBRON_RESPOND'), +(-1615015,'Arrogant little creatures! To challenge powers you do not yet understand...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14126,1,0,0,'tenebron SAY_TENEBRON_SPECIAL_1'), +(-1615016,'I am no mere dragon! You will find I am much, much, more...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14127,1,0,0,'tenebron SAY_TENEBRON_SPECIAL_2'), +(-1615017,'%s begins to hatch eggs in the twilight!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,0,5,0,0,'tenebron WHISPER_HATCH_EGGS'), + +(-1615018,'It is my charge to watch over these eggs. I will see you burn before any harm comes to them!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14093,1,0,0,'sartharion SAY_SARTHARION_AGGRO'), +(-1615019,'This pathetic siege ends NOW!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14103,1,0,0,'sartharion SAY_SARTHARION_BERSERK'), +(-1615020,'Burn, you miserable wretches!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14098, 1,0,0,'sartharion SAY_SARTHARION_BREATH'), +(-1615021,'Shadron! Come to me, all is at risk!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14105,1,0,0,'sartharion SARTHARION_CALL_SHADRON'), +(-1615022,'Tenebron! The eggs are yours to protect as well!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14106,1,0,0,'sartharion SAY_SARTHARION_CALL_TENEBRON'), +(-1615023,'Vesperon! The clutch is in danger! Assist me!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14104,1,0,0,'sartharion SAY_SARTHARION_CALL_VESPERON'), +(-1615024,'Such is the price... of failure...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14107,1,0,0,'sartharion SAY_SARTHARION_DEATH'), +(-1615025,'Such flammable little insects....', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14099,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_1'), +(-1615026,'Your charred bones will litter the floor!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14100,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_2'), +(-1615027,'How much heat can you take?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14101,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_3'), +(-1615028,'All will be reduced to ash!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14102,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_4'), +(-1615029,'You will make a fine meal for the hatchlings.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14094,1,0,0,'sartharion SAY_SARTHARION_SLAY_1'), +(-1615030,'You are the grave disadvantage.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14096,1,0,0,'sartharion SAY_SARTHARION_SLAY_2'), +(-1615031,'This is why we call you lesser beeings.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14097,1,0,0,'sartharion SAY_SARTHARION_SLAY_3'), +(-1615032,'The lava surrounding %s churns!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,0,5,0,0,'sartharion WHISPER_LAVA_CHURN'), + +(-1615033,'You pose no threat, lesser beings...give me your worst!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14133,1,0,0,'vesperon SAY_VESPERON_AGGRO'), +(-1615034,'The least you could do is put up a fight...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14134,1,0,0,'vesperon SAY_VESPERON_SLAY_1'), +(-1615035,'Was that the best you can do?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14135,1,0,0,'vesperon SAY_VESPERON_SLAY_2'), +(-1615036,'I still have some...fight..in...me...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 14140,1,0,0,'vesperon SAY_VESPERON_DEATH'), +(-1615037,'I will pick my teeth with your bones!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14136,1,0,0,'vesperon SAY_VESPERON_BREATH'), +(-1615038,'Father was right about you, Sartharion...You are a weakling!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14139,1,0,0,'vesperon SAY_VESPERON_RESPOND'), +(-1615039,'Aren\'t you tricky...I have a few tricks of my own...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14137,1,0,0,'vesperon SAY_VESPERON_SPECIAL_1'), +(-1615040,'Unlike, I have many talents.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,14138,1,0,0,'vesperon SAY_VESPERON_SPECIAL_2'), +(-1615041,'A Vesperon Disciple appears in the Twilight!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,0,5,0,0,'shadron WHISPER_VESPERON_DICIPLE'), + +(-1615042,'%s begins to open a Twilight Portal!',0,5,0,0,'sartharion drake WHISPER_OPEN_PORTAL'); + -- -1 645 000 ??? INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `emote`, `comment`) VALUES (-1645006, 'Let the trial begin, Bloodwrath, attack!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, 0, 'master_kelerun_bloodmourn YELL_PHASE'), diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 1ff50664213..9cd579b4da7 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -702,6 +702,9 @@ UPDATE `creature_template` SET `ScriptName`='mob_crystal_spike' WHERE `entry`=27 UPDATE `creature_template` SET `ScriptName`='mob_crystalline_tangler' WHERE `entry`=32665; UPDATE `creature_template` SET `ScriptName`='boss_keristrasza' WHERE `entry`=26723; +/* OBSIDIAN SANCTUM */ +UPDATE `instance_template` SET `script`='instance_obsidian_sanctum' WHERE map=615; + /* ONYXIA'S LAIR */ UPDATE `creature_template` SET `ScriptName`='boss_onyxia' WHERE `entry`=10184; diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 3dcd38fa256..e4375732161 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -246,6 +246,8 @@ SET(trinityscript_LIB_SRCS scripts/zone/naxxramas/def_naxxramas.h scripts/zone/naxxramas/instance_naxxramas.cpp scripts/zone/netherstorm/netherstorm.cpp + scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h + scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp scripts/zone/onyxias_lair/boss_onyxia.cpp scripts/zone/orgrimmar/orgrimmar.cpp scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 3dbdd4899a1..a7a57818df7 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -414,6 +414,9 @@ extern void AddSC_boss_ormorok(); extern void AddSC_boss_keristrasza(); extern void AddSC_instance_nexus(); +//Obsidian Sanctum +extern void AddSC_instance_obsidian_sanctum(); + //Onyxia's Lair extern void AddSC_boss_onyxia(); @@ -1315,6 +1318,9 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") AddSC_boss_keristrasza(); AddSC_instance_nexus(); + //Obsidian Sanctum + AddSC_instance_obsidian_sanctum(); + //Onyxia's Lair AddSC_boss_onyxia(); diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index a615d579f4c..fde415501c0 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -2818,6 +2818,18 @@ + + + + + + diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index effb6e84d13..958a0bf0eae 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -2819,6 +2819,18 @@ + + + + + + diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h b/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h index 59d76502af3..461834a2386 100644 --- a/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h +++ b/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h @@ -1,4 +1,20 @@ #ifndef DEF_OBSIDIAN_SANCTUM_H #define DEF_OBSIDIAN_SANCTUM_H +enum +{ + TYPE_SARTHARION_EVENT = 1, + + DATA_SARTHARION = 10, + DATA_TENEBRON = 11, + DATA_SHADRON = 12, + DATA_VESPERON = 13, + + NPC_SARTHARION = 28860, + NPC_TENEBRON = 30452, + NPC_SHADRON = 30451, + NPC_VESPERON = 30449, + GO_TWILIGHT_PORTAL = 193988 +}; + #endif diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp b/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp index 898574c99eb..72166261684 100644 --- a/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp +++ b/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp @@ -1,9 +1,86 @@ #include "precompiled.h" #include "def_obsidian_sanctum.h" +#define ENCOUNTERS 1 + +/* Obsidian Sanctum encounters: +0 - Sartharion +*/ + struct TRINITY_DLL_DECL instance_obsidian_sanctum : public ScriptedInstance { instance_obsidian_sanctum(Map *Map) : ScriptedInstance(Map) {Initialize();}; + + uint32 m_uiEncounter[ENCOUNTERS]; + uint64 m_uiSartharionGUID; + uint64 m_uiTenebronGUID; + uint64 m_uiShadronGUID; + uint64 m_uiVesperonGUID; + + void Initialize() + { + m_uiSartharionGUID = 0; + m_uiTenebronGUID = 0; + m_uiShadronGUID = 0; + m_uiVesperonGUID = 0; + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + m_uiEncounter[i] = NOT_STARTED; + } + + void OnCreatureCreate(Creature* pCreature, uint32 entry) + { + switch(pCreature->GetEntry()) + { + case NPC_SARTHARION: + m_uiSartharionGUID = pCreature->GetGUID(); + break; + //three dragons below set to active state once created. + //we must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences + case NPC_TENEBRON: + m_uiTenebronGUID = pCreature->GetGUID(); + pCreature->setActive(true); + break; + case NPC_SHADRON: + m_uiShadronGUID = pCreature->GetGUID(); + pCreature->setActive(true); + break; + case NPC_VESPERON: + m_uiVesperonGUID = pCreature->GetGUID(); + pCreature->setActive(true); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + if (uiType == TYPE_SARTHARION_EVENT) + m_uiEncounter[0] = uiData; + } + + uint32 GetData(uint32 uiType) + { + if (uiType == TYPE_SARTHARION_EVENT) + return m_uiEncounter[0]; + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_SARTHARION: + return m_uiSartharionGUID; + case DATA_TENEBRON: + return m_uiTenebronGUID; + case DATA_SHADRON: + return m_uiShadronGUID; + case DATA_VESPERON: + return m_uiVesperonGUID; + } + return 0; + } }; InstanceData* GetInstanceData_instance_obsidian_sanctum(Map* map) diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp index 3089f3267c8..9449524412c 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp @@ -312,40 +312,18 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI } } - class AnyBugCheck - { - public: - AnyBugCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {} - bool operator()(Creature* u) - { - Creature *c = u; - if (!i_obj->IsWithinDistInMap(c, i_range)) - return false; - return (c->GetEntry() == 15316 || c->GetEntry() == 15317); - } - private: - WorldObject const* i_obj; - float i_range; - }; - Creature *RespawnNearbyBugsAndGetOne() { - CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); - Cell cell(p); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - std::list unitList; + std::list lUnitList; + m_creature->GetCreatureListWithEntryInGrid(lUnitList,15316,150.0f); + m_creature->GetCreatureListWithEntryInGrid(lUnitList,15317,150.0f); - AnyBugCheck u_check(m_creature, 150); - Trinity::CreatureListSearcher searcher(m_creature, unitList, u_check); - TypeContainerVisitor, GridTypeMapContainer > grid_creature_searcher(searcher); - CellLock cell_lock(cell, p); - cell_lock->Visit(cell_lock, grid_creature_searcher, *(m_creature->GetMap())); + if (lUnitList.empty()) + return NULL; Creature *nearb = NULL; - for(std::list::iterator iter = unitList.begin(); iter != unitList.end(); ++iter) + for(std::list::iterator iter = lUnitList.begin(); iter != lUnitList.end(); ++iter) { Creature *c = *iter; if (c) diff --git a/src/shared/Errors.h b/src/shared/Errors.h index 992b1752a0f..5cfd109ee01 100644 --- a/src/shared/Errors.h +++ b/src/shared/Errors.h @@ -23,6 +23,10 @@ #include "Common.h" +#ifndef HAVE_CONFIG_H +#define HAVE_ACE_STACK_TRACE_H 1 +#endif + #ifdef HAVE_ACE_STACK_TRACE_H #include "ace/Stack_Trace.h" #endif -- cgit v1.2.3 From d62da4cc16c3498674450d5751d18bbe9f9b4f6f Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sat, 25 Jul 2009 22:16:21 +0200 Subject: Merge [SD2] r1106 Prevent abuse of item 44222. Apply some SD2 code style r1107 Add health modification for phase and correct phase value for kael(TK) r1108 Remove scripted function SetSheathState() and use mangos function instead. Fix one typo and apply sd2 code style for one script. r1109 Remove old makefile* files not needed. r1110 Some minor adjustments to sharkkis, add one spell and also add distance to MoveChase. Not kill boss' advisors on Reset when not needed. r1111 Check pointers and avoid possible crash r1112 Added script for friendly Kael in MgT (movement to orb-platform, transform and gossip) r1113 Correct misunderstanding added in 1112, and use timer for transformation instead (creature are expected to spawn/fly down once player use orb). --HG-- branch : trunk --- sql/FULL/world_scripts_full.sql | 2 ++ src/bindings/scripts/CMakeLists.txt | 1 + src/bindings/scripts/ScriptMgr.cpp | 2 ++ src/bindings/scripts/VC80/80ScriptDev2.vcproj | 4 +++ src/bindings/scripts/VC90/90ScriptDev2.vcproj | 4 +++ src/bindings/scripts/include/sc_creature.cpp | 5 ---- src/bindings/scripts/include/sc_creature.h | 2 -- src/bindings/scripts/scripts/item/item_scripts.cpp | 25 ++++++++++++++++ .../zone/tempest_keep/the_eye/boss_kaelthas.cpp | 11 +++++-- .../scripts/scripts/zone/westfall/westfall.cpp | 34 ++++++++++++++-------- .../scripts/scripts/zone/zulgurub/boss_thekal.cpp | 15 ++++------ 11 files changed, 74 insertions(+), 31 deletions(-) (limited to 'src/bindings/scripts/ScriptMgr.cpp') diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 71d430a6f02..02b7159d570 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -64,6 +64,7 @@ UPDATE `creature_template` SET `ScriptName`='guard_shattrath_scryer' WHERE `entr UPDATE `item_template` SET `ScriptName`='item_area_52_special' WHERE `entry`=28132; UPDATE `item_template` SET `ScriptName`='item_attuned_crystal_cores' WHERE `entry`=34368; UPDATE `item_template` SET `ScriptName`='item_blackwhelp_net' WHERE `entry`=31129; +UPDATE `item_template` SET `ScriptName`='item_dart_gun' WHERE `entry`=44222; UPDATE `item_template` SET `ScriptName`='item_disciplinary_rod' WHERE `entry`=22473; UPDATE `item_template` SET `ScriptName`='item_draenei_fishing_net' WHERE `entry`=23654; UPDATE `item_template` SET `ScriptName`='item_flying_machine' WHERE `entry` IN (34060,34061); @@ -615,6 +616,7 @@ UPDATE `creature_template` SET `ScriptName`='mob_arcane_sphere' WHERE `entry`=24 UPDATE `creature_template` SET `ScriptName`='mob_felkael_phoenix' WHERE `entry`=24674; UPDATE `creature_template` SET `ScriptName`='mob_felkael_phoenix_egg' WHERE `entry`=24675; UPDATE `creature_template` SET `ScriptName`='mob_felkael_flamestrike' WHERE `entry`=24666; +UPDATE `creature_template` SET `ScriptName`='npc_kalecgos' WHERE `entry` IN (24844, 24848); /* MARAUDON */ UPDATE `creature_template` SET `ScriptName`='boss_princess_theradras' WHERE `entry`=12201; diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 3dcd38fa256..6fe9c0e1ec0 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -208,6 +208,7 @@ SET(trinityscript_LIB_SRCS scripts/zone/magisters_terrace/boss_vexallus.cpp scripts/zone/magisters_terrace/def_magisters_terrace.h scripts/zone/magisters_terrace/instance_magisters_terrace.cpp + scripts/zone/magisters_terrace/magisters_terrace.cpp scripts/zone/maraudon/boss_celebras_the_cursed.cpp scripts/zone/maraudon/boss_landslide.cpp scripts/zone/maraudon/boss_noxxion.cpp diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index a7a57818df7..f81edfdfb01 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -356,6 +356,7 @@ extern void AddSC_boss_selin_fireheart(); extern void AddSC_boss_vexallus(); extern void AddSC_boss_priestess_delrissa(); extern void AddSC_instance_magisters_terrace(); +extern void AddSC_magisters_terrace(); //Maraudon extern void AddSC_boss_celebras_the_cursed(); @@ -1260,6 +1261,7 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") AddSC_boss_vexallus(); AddSC_boss_priestess_delrissa(); AddSC_instance_magisters_terrace(); + AddSC_magisters_terrace(); //Maraudon AddSC_boss_celebras_the_cursed(); diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index a615d579f4c..53a1624820c 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -1102,6 +1102,10 @@ RelativePath="..\scripts\zone\magisters_terrace\instance_magisters_terrace.cpp" > + + + + SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged)); } -void ScriptedAI::SetSheathState(SheathState newState) -{ - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, newState); -} - void ScriptedAI::SetCombatMovement(bool CombatMove) { CombatMovement = CombatMove; diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 7c57367332a..666ec1fad44 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -189,8 +189,6 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI bool CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered = false); void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE); - - void SetSheathState(SheathState newState); void SetCombatMovement(bool CombatMove); diff --git a/src/bindings/scripts/scripts/item/item_scripts.cpp b/src/bindings/scripts/scripts/item/item_scripts.cpp index d30efdae89f..a58edb58fa2 100644 --- a/src/bindings/scripts/scripts/item/item_scripts.cpp +++ b/src/bindings/scripts/scripts/item/item_scripts.cpp @@ -25,6 +25,7 @@ EndScriptData */ item_area_52_special(i28132) Prevents abuse of this item item_attuned_crystal_cores(i34368) Prevent abuse(quest 11524 & 11525) item_blackwhelp_net(i31129) Quest Whelps of the Wyrmcult (q10747). Prevents abuse +item_dart_gun Prevent quest provided item instakill anything but the expected item_draenei_fishing_net(i23654) Hacklike implements chance to spawn item or creature item_disciplinary_rod Prevents abuse item_nether_wraith_beacon(i31742) Summons creatures for quest Becoming a Spellfire Tailor (q10832) @@ -129,6 +130,25 @@ bool ItemUse_item_blackwhelp_net(Player *player, Item* _Item, SpellCastTargets c return true; } +/*##### +# item_dart_gun +#####*/ + +enum +{ + NPC_HAMMER_SCOUT = 32201 +}; + +bool ItemUse_item_dart_gun(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets) +{ + if (pTargets.getUnitTarget() && pTargets.getUnitTarget()->GetTypeId() == TYPEID_UNIT && + pTargets.getUnitTarget()->GetEntry() == NPC_HAMMER_SCOUT) + return false; + + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + return true; +} + /*##### # item_draenei_fishing_net #####*/ @@ -530,6 +550,11 @@ void AddSC_item_scripts() newscript->pItemUse = &ItemUse_item_blackwhelp_net; newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "item_dart_gun"; + newscript->pItemUse = &ItemUse_item_dart_gun; + newscript->RegisterSelf(); + newscript = new Script; newscript->Name="item_disciplinary_rod"; newscript->pItemUse = &ItemUse_item_disciplinary_rod; diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp index 1ebf18efa94..b33a3030e1d 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp @@ -144,7 +144,7 @@ float KaelthasWeapons[7][5] = #define GRAVITY_Z 70.0f #define TIME_PHASE_2_3 120000 -#define TIME_PHASE_3_4 120000 +#define TIME_PHASE_3_4 180000 #define KAEL_VISIBLE_RANGE 50.0f #define ROOM_BASE_Z 49.0f @@ -160,6 +160,7 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI advisorbase_ai(Creature *c) : ScriptedAI(c) { pInstance = c->GetInstanceData(); + FakeDeath = false; } void MoveInLineOfSight(Unit *who) @@ -180,6 +181,9 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI void Reset() { + if (FakeDeath) + m_creature->SetMaxHealth(m_creature->GetMaxHealth() / 2); + m_creature->SetNoCallAssistance(true); FakeDeath = false; DelayRes_Timer = 0; @@ -238,7 +242,10 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + + // Double health for Phase 3 + m_creature->SetMaxHealth(m_creature->GetMaxHealth() * 2); if (pInstance->GetData(DATA_KAELTHASEVENT) == 3) JustDied(pKiller); diff --git a/src/bindings/scripts/scripts/zone/westfall/westfall.cpp b/src/bindings/scripts/scripts/zone/westfall/westfall.cpp index f9e04a5186f..3548e9ee089 100644 --- a/src/bindings/scripts/scripts/zone/westfall/westfall.cpp +++ b/src/bindings/scripts/scripts/zone/westfall/westfall.cpp @@ -84,24 +84,23 @@ struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI { case 4: SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); - SetSheathState(SHEATH_STATE_RANGED); + m_creature->SetSheath(SHEATH_STATE_RANGED); m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); break; - case 6: - SetCombatMovement(false); - break; case 7: m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 8: + m_creature->SetSheath(SHEATH_STATE_RANGED); m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 9: + m_creature->SetSheath(SHEATH_STATE_RANGED); m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); @@ -115,9 +114,9 @@ struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI DoScriptText(SAY_DS_PROLOGUE, m_creature); break; case 13: - SetSheathState(SHEATH_STATE_UNARMED); - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); SetEquipmentSlots(true); + m_creature->SetSheath(SHEATH_STATE_UNARMED); + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); break; case 17: pPlayer->GroupEventHappens(QUEST_TOME_VALOR, m_creature); @@ -125,6 +124,21 @@ struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI } } + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f); + } + } + void JustSummoned(Creature* pSummoned) { pSummoned->AI()->AttackStart(m_creature); @@ -148,14 +162,10 @@ struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI if (uiShootTimer < diff) { - if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) - SetCombatMovement(true); - else - SetCombatMovement(false); - uiShootTimer = 1500; - DoCast(m_creature->getVictim(), SPELL_SHOOT); + if (!m_creature->IsWithinDist(m_creature->getVictim(), ATTACK_DISTANCE)) + DoCast(m_creature->getVictim(), SPELL_SHOOT); }else uiShootTimer -= diff; } }; diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp index 76d3d5268e9..5cd5fc61d8f 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp @@ -117,8 +117,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI if(pInstance->GetData(DATA_LORKHANISDEAD)) { //Resurrect LorKhan - Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN)); - if(pLorKhan) + if(Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->setFaction(14); @@ -336,8 +335,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI if(pInstance->GetData(DATA_THEKALISFAKEDEAD)) { //Resurrect Thekal - Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL)); - if(pThekal) + if(Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -349,8 +347,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI if(pInstance->GetData(DATA_ZATHISDEAD)) { //Resurrect Zath - Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH)); - if(pZath) + if(Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH))) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -473,8 +470,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI if(pInstance->GetData(DATA_LORKHANISDEAD)) { //Resurrect LorKhan - Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN)); - if(pLorKhan) + if(Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -486,8 +482,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI if(pInstance->GetData(DATA_THEKALISFAKEDEAD)) { //Resurrect Thekal - Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL)); - if(pThekal) + if(Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); -- cgit v1.2.3