diff options
32 files changed, 682 insertions, 115 deletions
diff --git a/sql/trinityscript_script_texts.sql b/sql/trinityscript_script_texts.sql index 556d330685b..0fa44dca7c3 100644 --- a/sql/trinityscript_script_texts.sql +++ b/sql/trinityscript_script_texts.sql @@ -59,6 +59,19 @@ INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc2`, `type`, (-1000162, 'All we know of this timeway is that it leads to Mount Hyjal. The Infinite Dragonflight have gone to great lengths to prevent our involvement. We know next to nothing, mortal. Soridormi is currently attempting to break through the timeway\'s defenses but has thus far been unsuccessful. You might be our only hope of breaking through and resolving the conflict.', 'Tout ce que nous savons sur cette voie temporelle est qu\'elle me`ne au Mont Hyjal. Le Vol du Dragon Infini s\'est donné beaucoup de peine pour empe^cher notre participation. Soridormi est actuellement en train de tenter de briser les défenses de cette voie, mais ses efforts ont été vain jusqu\'ici. Vous pourriez e^tre notre seul espoir de les briser et de résoudre le conflit.', 4, 0, 'WHISPER_CUSTODIAN_13'), (-1000163, 'Our time is at an end $N. I would wish you luck, if such a thing existed.', 'Notre entretien touche a` sa fin, $N. Je vous souhaite bonne chance, si tant est qu\'une telle chose a jamais existé.', 4, 0, 'WHISPER_CUSTODIAN_14'); +-- 2139_world_scripts.sql +(-1000164,'Ah, $GPriest:Priestess; you came along just in time. I appreciate it.',0,0,0,2,'garments SAY_COMMON_HEALED'), +(-1000165,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those gnolls with your power to back me!',0,0,1,1,'garments SAY_DG_KEL_THANKS'), +(-1000166,'Farewell to you, and may shadow always protect you!',0,0,1,3,'garments SAY_DG_KEL_GOODBYE'), +(-1000167, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those murlocs with the Light on my side!',0,0,7,1,'garments SAY_ROBERTS_THANKS'), +(-1000168, 'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_ROBERTS_GOODBYE'), +(-1000169, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those humans with your power to back me!',0,0,1,1,'garments SAY_KORJA_THANKS'), +(-1000170, 'Farewell to you, and may our ancestors be with you always!',0,0,1,3,'garments SAY_KORJA_GOODBYE'), +(-1000171, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those wendigo with the Light on my side!',0,0,7,1,'garments SAY_DOLF_THANKS'), +(-1000172, 'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_DOLF_GOODBYE'), +(-1000173, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those corrupt timberlings with Elune\'s power behind me!',0,0,2,1,'garments SAY_SHAYA_THANKS'), +(-1000174, 'Farewell to you, and may Elune be with you always.',0,0,2,3,'garments SAY_SHAYA_GOODBYE'); + -- 817_world_scripts.sql 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 (-1000200, 'A-Me good.Good A-me.Follow...A-ME follow.Home.A-ME go home.', NULL, NULL, 'A-ME gut.Gut A-Me.Folgen...Heim.A-ME geht heim.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL), diff --git a/sql/updates/2139_script_waypoint.sql b/sql/updates/2139_script_waypoint.sql new file mode 100644 index 00000000000..765c6b7cc46 --- /dev/null +++ b/sql/updates/2139_script_waypoint.sql @@ -0,0 +1,49 @@ +DROP TABLE IF EXISTS script_waypoint; +CREATE TABLE script_waypoint ( + entry mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'creature_template entry', + pointid mediumint(8) unsigned NOT NULL DEFAULT '0', + location_x float NOT NULL DEFAULT '0', + location_y float NOT NULL DEFAULT '0', + location_z float NOT NULL DEFAULT '0', + waittime int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'waittime in millisecs', + point_comment text, + PRIMARY KEY (entry, pointid) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; + +DELETE FROM script_waypoint WHERE entry=16295; +INSERT INTO script_waypoint VALUES +(16295, 0, 7545.070000, -7359.870000, 162.354000, 4000, 'SAY_START'), +(16295, 1, 7550.048340, -7362.237793, 162.235657, 0, ''), +(16295, 2, 7566.976074, -7364.315430, 161.738770, 0, ''), +(16295, 3, 7578.830566, -7361.677734, 161.738770, 0, ''), +(16295, 4, 7590.969238, -7359.053711, 162.257660, 0, ''), +(16295, 5, 7598.354004, -7362.815430, 162.256683, 4000, 'SAY_PROGRESS_1'), +(16295, 6, 7605.861328, -7380.424316, 161.937073, 0, ''), +(16295, 7, 7605.295410, -7387.382813, 157.253998, 0, ''), +(16295, 8, 7606.131836, -7393.893555, 156.941925, 0, ''), +(16295, 9, 7615.207520, -7400.187012, 157.142639, 0, ''), +(16295, 10, 7618.956543, -7402.652832, 158.202042, 0, ''), +(16295, 11, 7636.850586, -7401.756836, 162.144791, 0, 'SAY_PROGRESS_2'), +(16295, 12, 7637.058105, -7404.944824, 162.206970, 4000, ''), +(16295, 13, 7636.910645, -7412.585449, 162.366425, 0, ''), +(16295, 14, 7637.607910, -7425.591797, 162.630661, 0, ''), +(16295, 15, 7637.816895, -7459.057129, 163.302704, 0, ''), +(16295, 16, 7638.859863, -7470.902344, 162.517059, 0, ''), +(16295, 17, 7641.395996, -7488.217285, 157.381287, 0, ''), +(16295, 18, 7634.455566, -7505.451660, 154.682159, 0, 'SAY_PROGRESS_3'), +(16295, 19, 7631.906738, -7516.948730, 153.597382, 0, ''), +(16295, 20, 7622.231445, -7537.037598, 151.587112, 0, ''), +(16295, 21, 7610.921875, -7550.670410, 149.639374, 0, ''), +(16295, 22, 7598.229004, -7562.551758, 145.953888, 0, ''), +(16295, 23, 7588.509277, -7577.755371, 148.294479, 0, ''), +(16295, 24, 7567.339355, -7608.456055, 146.006485, 0, ''), +(16295, 25, 7562.547852, -7617.417969, 148.097504, 0, ''), +(16295, 26, 7561.508789, -7645.064453, 151.245163, 0, ''), +(16295, 27, 7563.337402, -7654.652344, 151.227158, 0, ''), +(16295, 28, 7565.533691, -7658.296387, 151.248886, 0, ''), +(16295, 39, 7571.155762, -7659.118652, 151.244568, 0, ''), +(16295, 30, 7579.119629, -7662.213867, 151.651505, 0, 'quest complete'), +(16295, 31, 7603.768066, -7667.000488, 153.997726, 0, ''), +(16295, 32, 7603.768066, -7667.000488, 153.997726, 4000, 'SAY_END_1'), +(16295, 33, 7603.768066, -7667.000488, 153.997726, 8000, 'SAY_END_2'), +(16295, 34, 7603.768066, -7667.000488, 153.997726, 0, ''); diff --git a/sql/updates/2139_world.sql b/sql/updates/2139_world.sql new file mode 100644 index 00000000000..335cb55a278 --- /dev/null +++ b/sql/updates/2139_world.sql @@ -0,0 +1,2 @@ +UPDATE gameobject_template SET `ScriptName`='go_cat_figurine' WHERE `entry`=13873; +UPDATE creature_template SET ScriptName='npc_garments_of_quests' WHERE entry IN (12429,12423,12427,12430,12428); diff --git a/sql/updates/2139_world_script.sql b/sql/updates/2139_world_script.sql new file mode 100644 index 00000000000..6de4ace6424 --- /dev/null +++ b/sql/updates/2139_world_script.sql @@ -0,0 +1,13 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000164 AND -1000174; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000164,'Ah, $GPriest:Priestess; you came along just in time. I appreciate it.',0,0,0,2,'garments SAY_COMMON_HEALED'), +(-1000165,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those gnolls with your power to back me!',0,0,1,1,'garments SAY_DG_KEL_THANKS'), +(-1000166,'Farewell to you, and may shadow always protect you!',0,0,1,3,'garments SAY_DG_KEL_GOODBYE'), +(-1000167, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those murlocs with the Light on my side!',0,0,7,1,'garments SAY_ROBERTS_THANKS'), +(-1000168, 'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_ROBERTS_GOODBYE'), +(-1000169, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those humans with your power to back me!',0,0,1,1,'garments SAY_KORJA_THANKS'), +(-1000170, 'Farewell to you, and may our ancestors be with you always!',0,0,1,3,'garments SAY_KORJA_GOODBYE'), +(-1000171, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those wendigo with the Light on my side!',0,0,7,1,'garments SAY_DOLF_THANKS'), +(-1000172, 'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_DOLF_GOODBYE'), +(-1000173, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those corrupt timberlings with Elune\'s power behind me!',0,0,2,1,'garments SAY_SHAYA_THANKS'), +(-1000174, 'Farewell to you, and may Elune be with you always.',0,0,2,3,'garments SAY_SHAYA_GOODBYE'); diff --git a/sql/world.sql b/sql/world.sql index 7ea191181f7..f11a5ca0411 100644 --- a/sql/world.sql +++ b/sql/world.sql @@ -13073,6 +13073,22 @@ LOCK TABLES `script_texts` WRITE; UNLOCK TABLES; -- +-- Table structure for table `script_waypoint` +-- + +DROP TABLE IF EXISTS script_waypoint; +CREATE TABLE script_waypoint ( + entry mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'creature_template entry', + pointid mediumint(8) unsigned NOT NULL DEFAULT '0', + location_x float NOT NULL DEFAULT '0', + location_y float NOT NULL DEFAULT '0', + location_z float NOT NULL DEFAULT '0', + waittime int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'waittime in millisecs', + point_comment text, + PRIMARY KEY (entry, pointid) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; + +-- -- Table structure for table `skill_discovery_template` -- diff --git a/sql/world_script_waypoints.sql b/sql/world_script_waypoints.sql new file mode 100644 index 00000000000..076a27b1e15 --- /dev/null +++ b/sql/world_script_waypoints.sql @@ -0,0 +1,44 @@ +-- This file contains all waypoints used by escortAI scripts
+
+/* GHOSTLANDS */
+
+DELETE FROM script_waypoint WHERE entry=16295;
+INSERT INTO script_waypoint VALUES
+(16295, 0, 7545.070000, -7359.870000, 162.354000, 4000, 'SAY_START'),
+(16295, 1, 7550.048340, -7362.237793, 162.235657, 0, ''),
+(16295, 2, 7566.976074, -7364.315430, 161.738770, 0, ''),
+(16295, 3, 7578.830566, -7361.677734, 161.738770, 0, ''),
+(16295, 4, 7590.969238, -7359.053711, 162.257660, 0, ''),
+(16295, 5, 7598.354004, -7362.815430, 162.256683, 4000, 'SAY_PROGRESS_1'),
+(16295, 6, 7605.861328, -7380.424316, 161.937073, 0, ''),
+(16295, 7, 7605.295410, -7387.382813, 157.253998, 0, ''),
+(16295, 8, 7606.131836, -7393.893555, 156.941925, 0, ''),
+(16295, 9, 7615.207520, -7400.187012, 157.142639, 0, ''),
+(16295, 10, 7618.956543, -7402.652832, 158.202042, 0, ''),
+(16295, 11, 7636.850586, -7401.756836, 162.144791, 0, 'SAY_PROGRESS_2'),
+(16295, 12, 7637.058105, -7404.944824, 162.206970, 4000, ''),
+(16295, 13, 7636.910645, -7412.585449, 162.366425, 0, ''),
+(16295, 14, 7637.607910, -7425.591797, 162.630661, 0, ''),
+(16295, 15, 7637.816895, -7459.057129, 163.302704, 0, ''),
+(16295, 16, 7638.859863, -7470.902344, 162.517059, 0, ''),
+(16295, 17, 7641.395996, -7488.217285, 157.381287, 0, ''),
+(16295, 18, 7634.455566, -7505.451660, 154.682159, 0, 'SAY_PROGRESS_3'),
+(16295, 19, 7631.906738, -7516.948730, 153.597382, 0, ''),
+(16295, 20, 7622.231445, -7537.037598, 151.587112, 0, ''),
+(16295, 21, 7610.921875, -7550.670410, 149.639374, 0, ''),
+(16295, 22, 7598.229004, -7562.551758, 145.953888, 0, ''),
+(16295, 23, 7588.509277, -7577.755371, 148.294479, 0, ''),
+(16295, 24, 7567.339355, -7608.456055, 146.006485, 0, ''),
+(16295, 25, 7562.547852, -7617.417969, 148.097504, 0, ''),
+(16295, 26, 7561.508789, -7645.064453, 151.245163, 0, ''),
+(16295, 27, 7563.337402, -7654.652344, 151.227158, 0, ''),
+(16295, 28, 7565.533691, -7658.296387, 151.248886, 0, ''),
+(16295, 39, 7571.155762, -7659.118652, 151.244568, 0, ''),
+(16295, 30, 7579.119629, -7662.213867, 151.651505, 0, 'quest complete'),
+(16295, 31, 7603.768066, -7667.000488, 153.997726, 0, ''),
+(16295, 32, 7603.768066, -7667.000488, 153.997726, 4000, 'SAY_END_1'),
+(16295, 33, 7603.768066, -7667.000488, 153.997726, 8000, 'SAY_END_2'),
+(16295, 34, 7603.768066, -7667.000488, 153.997726, 0, '');
+
+/* EOF */
+
diff --git a/sql/world_scripts_full.sql b/sql/world_scripts_full.sql index 6fa3644a020..62c6be957e8 100644 --- a/sql/world_scripts_full.sql +++ b/sql/world_scripts_full.sql @@ -9,6 +9,7 @@ UPDATE `creature_template` SET `ScriptName`='boss_azuregos' WHERE `entry`=6109; UPDATE `creature_template` SET `ScriptName`='mob_dementeddruids' WHERE `entry`=15260; /* GO */ +UPDATE `gameobject_template` SET `ScriptName`='go_cat_figurine' WHERE `entry`=13873; UPDATE `gameobject_template` SET `ScriptName`='go_northern_crystal_pylon' WHERE `entry`=164955; UPDATE `gameobject_template` SET `ScriptName`='go_western_crystal_pylon' WHERE `entry`=164956; UPDATE `gameobject_template` SET `ScriptName`='go_eastern_crystal_pylon' WHERE `entry`=164957; @@ -72,6 +73,7 @@ UPDATE `item_template` SET `ScriptName`='item_inoculating_crystal' WHERE `entry` /* NPC (usually creatures to be found in more than one specific zone) */ UPDATE `creature_template` SET `ScriptName`='npc_chicken_cluck' WHERE `entry`=620; UPDATE `creature_template` SET `ScriptName`='npc_dancing_flames' WHERE `entry`=25305; +UPDATE `creature_template` SET `ScriptName`='npc_garments_of_quests' WHERE `entry` IN (12429,12423,12427,12430,12428); UPDATE `creature_template` SET `ScriptName`='npc_guardian' WHERE `entry`=5764; UPDATE `creature_template` SET `ScriptName`='npc_mount_vendor' WHERE `entry` IN (384,1261,1460,2357,3362,3685,4730,4731,4885,7952,7955,16264,17584); UPDATE `creature_template` SET `ScriptName`='npc_doctor' WHERE `entry` IN (12939,12920); diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index f6e450283ab..54425873632 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -16,7 +16,6 @@ # define _TRINITY_SCRIPT_CONFIG "trinitycore.conf" #endif _TRINITY_SCRIPT_CONFIG -//*** Global data *** int num_sc_scripts; Script *m_scripts[MAX_SCRIPTS]; @@ -48,20 +47,16 @@ enum ChatType // Text Maps UNORDERED_MAP<int32, StringTextData> TextMap; -//*** End Global data *** +// Waypoint lists +std::list<PointMovement> PointMovementList; -//*** EventAI data *** //Event AI structure. Used exclusivly by mob_event_ai.cpp (60 bytes each) std::list<EventAI_Event> EventAI_Event_List; //Event AI summon structure. Used exclusivly by mob_event_ai.cpp. UNORDERED_MAP<uint32, EventAI_Summon> EventAI_Summon_Map; -//Event AI error prevention structure. Used at runtime to prevent error log spam of same creature id. -//UNORDERED_MAP<uint32, EventAI_CreatureError> EventAI_CreatureErrorPreventionList; - uint32 EAI_ErrorLevel; -//*** End EventAI data *** void FillSpellSummary(); void LoadOverridenSQLData(); @@ -858,6 +853,67 @@ void LoadDatabase() outstring_log(""); outstring_log(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); } + + // Drop Existing Waypoint list + PointMovementList.clear(); + uint64 uiCreatureCount = 0; + + // Load Waypoints + result = TScriptDB.PQuery("SELECT COUNT(entry) FROM script_waypoint GROUP BY entry"); + if (result) + { + uiCreatureCount = result->GetRowCount(); + delete result; + } + + outstring_log("SD2: Loading Script Waypoints for %u creature(s)...", uiCreatureCount); + + result = TScriptDB.PQuery("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid"); + + if (result) + { + barGoLink bar(result->GetRowCount()); + uint32 uiNodeCount = 0; + + do + { + bar.step(); + Field* pFields = result->Fetch(); + PointMovement pTemp; + + pTemp.m_uiCreatureEntry = pFields[0].GetUInt32(); + pTemp.m_uiPointId = pFields[1].GetUInt32(); + pTemp.m_fX = pFields[2].GetFloat(); + pTemp.m_fY = pFields[3].GetFloat(); + pTemp.m_fZ = pFields[4].GetFloat(); + pTemp.m_uiWaitTime = pFields[5].GetUInt32(); + + CreatureInfo const* pCInfo = GetCreatureTemplateStore(pTemp.m_uiCreatureEntry); + if (!pCInfo) + { + error_db_log("SD2: DB table script_waypoint has waypoint for non-existant creature entry %u", pTemp.m_uiCreatureEntry); + continue; + } + + if (!pCInfo->ScriptID) + error_db_log("SD2: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.m_uiCreatureEntry); + + PointMovementList.push_back(pTemp); + ++uiNodeCount; + } while (result->NextRow()); + + delete result; + + outstring_log(""); + outstring_log(">> Loaded %u Script Waypoint nodes.", uiNodeCount); + } + else + { + barGoLink bar(1); + bar.step(); + outstring_log(""); + outstring_log(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); + } //Gather additional data for EventAI result = TScriptDB.PQuery("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM eventai_summons"); @@ -913,6 +969,12 @@ void LoadDatabase() delete result; } + outstring_log("SD2: Loading EventAI scripts for %u creature(s)...", uiEAICreatureCount); + if (result) + { + uiEAICreatureCount = result->GetRowCount(); + delete result; + } //Gather event data result = TScriptDB.PQuery("SELECT id, creature_id, event_type, event_inverse_phase_mask, event_chance, event_flags, " @@ -1037,7 +1099,6 @@ void LoadDatabase() } break; - case EVENT_T_RANGE: case EVENT_T_FRIENDLY_HP: case EVENT_T_FRIENDLY_IS_CC: { diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index d6ea69bf457..364296597dc 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -31,6 +31,16 @@ Unit* FindCreature(uint32 entry, float range, Unit* Finder); //Get a single gameobject of given entry GameObject* FindGameObject(uint32 entry, float range, Unit* Finder); +struct PointMovement +{ + uint32 m_uiCreatureEntry; + uint32 m_uiPointId; + float m_fX; + float m_fY; + float m_fZ; + uint32 m_uiWaitTime; +}; + struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI { ScriptedAI(Creature* creature) : CreatureAI(creature), m_creature(creature), InCombat(false), IsFleeing(false) {} diff --git a/src/bindings/scripts/scripts/examples/example_escort.cpp b/src/bindings/scripts/scripts/examples/example_escort.cpp index 56c3f5c654b..46c80de652d 100644 --- a/src/bindings/scripts/scripts/examples/example_escort.cpp +++ b/src/bindings/scripts/scripts/examples/example_escort.cpp @@ -64,7 +64,7 @@ struct TRINITY_DLL_DECL example_escortAI : public npc_escortAI { DoScriptText(SAY_WP_2, m_creature); Creature* temp = m_creature->SummonCreature(21878, m_creature->GetPositionX()+5, m_creature->GetPositionY()+7, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000); - + if(temp) temp->AI()->AttackStart(m_creature); } break; diff --git a/src/bindings/scripts/scripts/go/go_scripts.cpp b/src/bindings/scripts/scripts/go/go_scripts.cpp index 07eb4656563..8489cc5417d 100644 --- a/src/bindings/scripts/scripts/go/go_scripts.cpp +++ b/src/bindings/scripts/scripts/go/go_scripts.cpp @@ -22,6 +22,7 @@ SDCategory: Game Objects EndScriptData */ /* ContentData +go_cat_figurine (the "trap" version of GO, two different exist) go_northern_crystal_pylon go_eastern_crystal_pylon go_western_crystal_pylon @@ -35,6 +36,21 @@ EndContentData */ #include "precompiled.h" /*###### +## go_cat_figurine +######*/ + +enum +{ + SPELL_SUMMON_GHOST_SABER = 5968, +}; + +bool GOHello_go_cat_figurine(Player *player, GameObject* _GO) +{ + player->CastSpell(player,SPELL_SUMMON_GHOST_SABER,true); + return false; +} + +/*###### ## go_crystal_pylons (3x) ######*/ @@ -107,6 +123,26 @@ bool GOHello_go_field_repair_bot_74A(Player *player, GameObject* _GO) } /*###### +## go_gilded_brazier +######*/ + +enum +{ + NPC_STILLBLADE = 17716, +}; + +bool GOHello_go_gilded_brazier(Player* pPlayer, GameObject* pGO) +{ + if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + { + if (Creature* pCreature = pPlayer->SummonCreature(NPC_STILLBLADE, 8087.632, -7542.740, 151.568, 0.122, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) + pCreature->AI()->AttackStart(pPlayer); + } + + return true; +} + +/*###### ## go_orb_of_command ######*/ @@ -152,6 +188,11 @@ void AddSC_go_scripts() Script *newscript; newscript = new Script; + newscript->Name = "go_cat_figurine"; + newscript->pGOHello = &GOHello_go_cat_figurine; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name="go_northern_crystal_pylon"; newscript->pGOHello = &GOHello_go_northern_crystal_pylon; newscript->RegisterSelf(); @@ -177,6 +218,11 @@ void AddSC_go_scripts() newscript->RegisterSelf(); newscript = new Script; + newscript->Name = "go_gilded_brazier"; + newscript->pGOHello = &GOHello_go_gilded_brazier; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name="go_orb_of_command"; newscript->pGOHello = &GOHello_go_orb_of_command; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp index d9089fe0ccc..2a0f5e16a1d 100644 --- a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp +++ b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp @@ -261,6 +261,20 @@ void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 Wait WaypointList.push_back(t); } +void npc_escortAI::FillPointMovementListForCreature() +{ + std::list<PointMovement>::iterator itr; + + for (itr = PointMovementList.begin(); itr != PointMovementList.end(); ++itr) + { + if (itr->m_uiCreatureEntry == m_creature->GetEntry()) + { + Escort_Waypoint pPoint(itr->m_uiPointId,itr->m_fX,itr->m_fY,itr->m_fZ,itr->m_uiWaitTime); + WaypointList.push_back(pPoint); + } + } +} + void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID) { if (InCombat) diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.h b/src/bindings/scripts/scripts/npc/npc_escortAI.h index af0d3f64aa5..ca284bd1b21 100644 --- a/src/bindings/scripts/scripts/npc/npc_escortAI.h +++ b/src/bindings/scripts/scripts/npc/npc_escortAI.h @@ -5,6 +5,8 @@ #ifndef SC_ESCORTAI_H #define SC_ESCORTAI_H +extern std::list<PointMovement> PointMovementList; + struct Escort_Waypoint { Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w) @@ -55,6 +57,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI // EscortAI functions void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0); + + void FillPointMovementListForCreature(); void Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID = 0); diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index be1986f3169..e54417cc03a 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -17,7 +17,7 @@ /* ScriptData SDName: Npcs_Special SD%Complete: 100 -SDComment: To be used for special NPCs that are located globally. Support for quest 3861 (Cluck!), 6622 and 6624 (Triage) +SDComment: To be used for special NPCs that are located globally. SDCategory: NPCs EndScriptData */ @@ -26,6 +26,7 @@ EndScriptData npc_chicken_cluck 100% support for quest 3861 (Cluck!) npc_dancing_flames 100% midsummer event NPC npc_guardian 100% guardianAI used to prevent players from accessing off-limits areas. Not in use by SD2 +npc_garments_of_quests 80% NPC's related to all Garments of-quests 5621, 5624, 5625, 5648, 565 npc_injured_patient 100% patients for triage-quests (6622 and 6624) npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage) npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy @@ -587,6 +588,258 @@ CreatureAI* GetAI_npc_doctor(Creature *_Creature) } /*###### +## npc_garments_of_quests +######*/ + +//TODO: get text for each NPC + +enum +{ + SPELL_LESSER_HEAL_R2 = 2052, + SPELL_FORTITUDE_R1 = 1243, + + QUEST_MOON = 5621, + QUEST_LIGHT_1 = 5624, + QUEST_LIGHT_2 = 5625, + QUEST_SPIRIT = 5648, + QUEST_DARKNESS = 5650, + + ENTRY_SHAYA = 12429, + ENTRY_ROBERTS = 12423, + ENTRY_DOLF = 12427, + ENTRY_KORJA = 12430, + ENTRY_DG_KEL = 12428, + + SAY_COMMON_HEALED = -1000164, + SAY_DG_KEL_THANKS = -1000165, + SAY_DG_KEL_GOODBYE = -1000166, + SAY_ROBERTS_THANKS = -1000167, + SAY_ROBERTS_GOODBYE = -1000168, + SAY_KORJA_THANKS = -1000169, + SAY_KORJA_GOODBYE = -1000170, + SAY_DOLF_THANKS = -1000171, + SAY_DOLF_GOODBYE = -1000172, + SAY_SHAYA_THANKS = -1000173, + SAY_SHAYA_GOODBYE = -1000174, +}; + +float fRunTo[5][3]= +{ + {9661.724, 869.803, 1270.742}, //shaya + {-9543.747, -117.770, 57.893}, //roberts + {-5650.226, -473.517, 397.027}, //dolf + {189.175, -4747.069, 11.215}, //kor'ja + {2471.303, 371.101, 30.919}, //kel +}; + +struct TRINITY_DLL_DECL npc_garments_of_questsAI : public ScriptedAI +{ + npc_garments_of_questsAI(Creature *c) : ScriptedAI(c) {Reset();} + + uint64 caster; + + bool bIsHealed; + bool bCanRun; + + uint32 RunAwayTimer; + + void Reset() + { + caster = 0; + + bIsHealed = false; + bCanRun = false; + + RunAwayTimer = 5000; + + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + //expect database to have RegenHealth=0 + m_creature->SetHealth(int(m_creature->GetMaxHealth()*0.7)); + m_creature->SetVisibility(VISIBILITY_ON); + } + + void Aggro(Unit *who) {} + + void SpellHit(Unit* pCaster, const SpellEntry *Spell) + { + if (Spell->Id == SPELL_LESSER_HEAL_R2 || Spell->Id == SPELL_FORTITUDE_R1) + { + //not while in combat + if (InCombat) + return; + + //nothing to be done now + if (bIsHealed && bCanRun) + return; + + if (pCaster->GetTypeId() == TYPEID_PLAYER) + { + switch(m_creature->GetEntry()) + { + case ENTRY_SHAYA: + if (((Player*)pCaster)->GetQuestStatus(QUEST_MOON) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_SHAYA_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_ROBERTS: + if (((Player*)pCaster)->GetQuestStatus(QUEST_LIGHT_1) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_ROBERTS_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_DOLF: + if (((Player*)pCaster)->GetQuestStatus(QUEST_LIGHT_2) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_DOLF_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_KORJA: + if (((Player*)pCaster)->GetQuestStatus(QUEST_SPIRIT) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_KORJA_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_DG_KEL: + if (((Player*)pCaster)->GetQuestStatus(QUEST_DARKNESS) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_DG_KEL_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + } + + //give quest credit, not expect any special quest objectives + if (bCanRun) + ((Player*)pCaster)->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID()); + } + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + //we reached destination, kill ourselves + if (id == 0) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->setDeathState(JUST_DIED); + m_creature->SetHealth(0); + m_creature->CombatStop(); + m_creature->DeleteThreatList(); + m_creature->RemoveCorpse(); + } + } + + void UpdateAI(const uint32 diff) + { + if (bCanRun && !InCombat) + { + if (RunAwayTimer <= diff) + { + if (Unit *pUnit = Unit::GetUnit(*m_creature,caster)) + { + switch(m_creature->GetEntry()) + { + case ENTRY_SHAYA: + DoScriptText(SAY_SHAYA_GOODBYE,m_creature,pUnit); + m_creature->GetMotionMaster()->MovePoint(0, fRunTo[0][0], fRunTo[0][1], fRunTo[0][2]); + break; + case ENTRY_ROBERTS: + DoScriptText(SAY_ROBERTS_GOODBYE,m_creature,pUnit); + m_creature->GetMotionMaster()->MovePoint(0, fRunTo[1][0], fRunTo[1][1], fRunTo[1][2]); + break; + case ENTRY_DOLF: + DoScriptText(SAY_DOLF_GOODBYE,m_creature,pUnit); + m_creature->GetMotionMaster()->MovePoint(0, fRunTo[2][0], fRunTo[2][1], fRunTo[2][2]); + break; + case ENTRY_KORJA: + DoScriptText(SAY_KORJA_GOODBYE,m_creature,pUnit); + m_creature->GetMotionMaster()->MovePoint(0, fRunTo[3][0], fRunTo[3][1], fRunTo[3][2]); + break; + case ENTRY_DG_KEL: + DoScriptText(SAY_DG_KEL_GOODBYE,m_creature,pUnit); + m_creature->GetMotionMaster()->MovePoint(0, fRunTo[4][0], fRunTo[4][1], fRunTo[4][2]); + break; + } + } + else + EnterEvadeMode(); //something went wrong + + RunAwayTimer = 30000; + }else RunAwayTimer -= diff; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_garments_of_quests(Creature* pCreature) +{ + return new npc_garments_of_questsAI(pCreature); +} + +/*###### ## npc_guardian ######*/ @@ -1156,6 +1409,11 @@ void AddSC_npcs_special() newscript->RegisterSelf(); newscript = new Script; + newscript->Name = "npc_garments_of_quests"; + newscript->GetAI = &GetAI_npc_garments_of_quests; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name="npc_guardian"; newscript->GetAI = &GetAI_npc_guardian; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp index 02e34437474..d0aa7fd45a6 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -201,7 +201,7 @@ CreatureAI* GetAI_boss_nexusprince_shaffar(Creature *_Creature) struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI { - mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) + mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c), CanEvade(false) { HeroicMode = m_creature->GetMap()->IsHeroic(); Reset(); diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp index 708b199d817..c18f87ccb9e 100644 --- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp +++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp @@ -89,50 +89,55 @@ bool GossipSelect_npc_sputtervalve(Player *player, Creature *_Creature, uint32 s ## npc_taskmaster_fizzule ######*/ -//#define FACTION_HOSTILE_F 430 -#define FACTION_HOSTILE_F 16 -#define FACTION_FRIENDLY_F 35 - -#define SPELL_FLARE 10113 -#define SPELL_FOLLY 10137 +enum +{ + FACTION_FRIENDLY_F = 35, + SPELL_FLARE = 10113, + SPELL_FOLLY = 10137, +}; struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI { - npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) { Reset(); } + npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) + { + factionNorm = c->getFaction(); + Reset(); + } + uint32 factionNorm; bool IsFriend; uint32 Reset_Timer; - uint32 FlareCount; + uint8 FlareCount; void Reset() { IsFriend = false; Reset_Timer = 120000; FlareCount = 0; - m_creature->setFaction(FACTION_HOSTILE_F); - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_creature->setFaction(factionNorm); } - //This is a hack. Spellcast will make creature aggro but that is not - //supposed to happen (Trinity not implemented/not found way to detect this spell kind) - void DoUglyHack() + void DoFriend() { m_creature->RemoveAllAuras(); m_creature->DeleteThreatList(); m_creature->CombatStop(); + + m_creature->StopMoving(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_creature->setFaction(FACTION_FRIENDLY_F); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); } void SpellHit(Unit *caster, const SpellEntry *spell) { - if( spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY ) + if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY) { - DoUglyHack(); ++FlareCount; - if( FlareCount >= 2 ) - { - m_creature->setFaction(FACTION_FRIENDLY_F); + + if (FlareCount >= 2) IsFriend = true; - } } } @@ -140,9 +145,9 @@ struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if( IsFriend ) + if (IsFriend) { - if( Reset_Timer < diff ) + if (Reset_Timer < diff) { EnterEvadeMode(); } else Reset_Timer -= diff; @@ -154,19 +159,22 @@ struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI DoMeleeAttackIfReady(); } }; -CreatureAI* GetAI_npc_taskmaster_fizzule(Creature *_Creature) + +CreatureAI* GetAI_npc_taskmaster_fizzule(Creature* pCreature) { - return new npc_taskmaster_fizzuleAI (_Creature); + return new npc_taskmaster_fizzuleAI(pCreature); } -bool ReciveEmote_npc_taskmaster_fizzule(Player *player, Creature *_Creature, uint32 emote) +bool ReciveEmote_npc_taskmaster_fizzule(Player* pPlayer, Creature* pCreature, uint32 emote) { - if( emote == TEXTEMOTE_SALUTE ) + if (emote == TEXTEMOTE_SALUTE) { - if( ((npc_taskmaster_fizzuleAI*)_Creature->AI())->FlareCount >= 2 ) + if (((npc_taskmaster_fizzuleAI*)pCreature->AI())->FlareCount >= 2) { - _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + if (pCreature->getFaction() == FACTION_FRIENDLY_F) + return true; + else + ((npc_taskmaster_fizzuleAI*)pCreature->AI())->DoFriend(); } } return true; diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp index c8ba7a91e8e..f597db32c70 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp @@ -103,8 +103,10 @@ struct TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI target = SelectUnit(SELECT_TARGET_RANDOM,0); SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000); + if(SummonedCreature) ((CreatureAI*)SummonedCreature->AI())->AttackStart(target); SummonedCreature = m_creature->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000); + if(SummonedCreature) ((CreatureAI*)SummonedCreature->AI())->AttackStart(target); Summoned = true; } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp index 960cea141c9..fa159bd9872 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp @@ -69,6 +69,7 @@ void hyjalAI::Reset() // Misc WaveCount = 0; + EnemyCount = 0; // Set faction properly based on creature entry switch(m_creature->GetEntry()) diff --git a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp index b7b462a85a7..12c6c3d26a3 100644 --- a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp +++ b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp @@ -135,17 +135,21 @@ bool GOHello_gilded_brazier(Player *player, GameObject* _GO) ## npc_ranger_lilatha ######*/ -#define SAY_START -1000140 -#define SAY_PROGRESS1 -1000141 -#define SAY_PROGRESS2 -1000142 -#define SAY_PROGRESS3 -1000143 -#define SAY_END1 -1000144 -#define SAY_END2 -1000145 -#define SAY_CAPTAIN_ANSWER -1000146 - -#define QUEST_ESCAPE_FROM_THE_CATACOMBS 9212 -#define GO_CAGE 181152 -#define NPC_CAPTAIN_HELIOS 16220 +enum +{ + SAY_START = -1000140, + SAY_PROGRESS1 = -1000141, + SAY_PROGRESS2 = -1000142, + SAY_PROGRESS3 = -1000143, + SAY_END1 = -1000144, + SAY_END2 = -1000145, + SAY_CAPTAIN_ANSWER = -1000146, + + QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212, + GO_CAGE = 181152, + NPC_CAPTAIN_HELIOS = 16220, + FACTION_SMOON_E = 1603, +}; struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI { @@ -249,41 +253,7 @@ CreatureAI* GetAI_npc_ranger_lilathaAI(Creature *_Creature) { npc_ranger_lilathaAI* ranger_lilathaAI = new npc_ranger_lilathaAI(_Creature); - ranger_lilathaAI->AddWaypoint(0, 7545.07, -7359.87, 162.354, 4000); // Say0 - ranger_lilathaAI->AddWaypoint(1, 7550.048340, -7362.237793, 162.235657); - ranger_lilathaAI->AddWaypoint(2, 7566.976074, -7364.315430, 161.738770); - ranger_lilathaAI->AddWaypoint(3, 7578.830566, -7361.677734, 161.738770); - ranger_lilathaAI->AddWaypoint(4, 7590.969238, -7359.053711, 162.257660); - ranger_lilathaAI->AddWaypoint(5, 7598.354004, -7362.815430, 162.256683, 4000); // Say1 - ranger_lilathaAI->AddWaypoint(6, 7605.861328, -7380.424316, 161.937073); - ranger_lilathaAI->AddWaypoint(7, 7605.295410, -7387.382813, 157.253998); - ranger_lilathaAI->AddWaypoint(8, 7606.131836, -7393.893555, 156.941925); - ranger_lilathaAI->AddWaypoint(9, 7615.207520, -7400.187012, 157.142639); - ranger_lilathaAI->AddWaypoint(10, 7618.956543, -7402.652832, 158.202042); - ranger_lilathaAI->AddWaypoint(11, 7636.850586, -7401.756836, 162.144791); - ranger_lilathaAI->AddWaypoint(12, 7637.058105, -7404.944824, 162.206970, 4000);// Say2 - ranger_lilathaAI->AddWaypoint(13, 7636.910645, -7412.585449, 162.366425); - ranger_lilathaAI->AddWaypoint(14, 7637.607910, -7425.591797, 162.630661); - ranger_lilathaAI->AddWaypoint(15, 7637.816895, -7459.057129, 163.302704); - ranger_lilathaAI->AddWaypoint(16, 7638.859863, -7470.902344, 162.517059); - ranger_lilathaAI->AddWaypoint(17, 7641.395996, -7488.217285, 157.381287); - ranger_lilathaAI->AddWaypoint(18, 7634.455566, -7505.451660, 154.682159); - ranger_lilathaAI->AddWaypoint(19, 7631.906738, -7516.948730, 153.597382); // say3 - ranger_lilathaAI->AddWaypoint(20, 7622.231445, -7537.037598, 151.587112); - ranger_lilathaAI->AddWaypoint(21, 7610.921875, -7550.670410, 149.639374); - ranger_lilathaAI->AddWaypoint(22, 7598.229004, -7562.551758, 145.953888); - ranger_lilathaAI->AddWaypoint(23, 7588.509277, -7577.755371, 148.294479); - ranger_lilathaAI->AddWaypoint(24, 7567.339355, -7608.456055, 146.006485); - ranger_lilathaAI->AddWaypoint(25, 7562.547852, -7617.417969, 148.097504); - ranger_lilathaAI->AddWaypoint(26, 7561.508789, -7645.064453, 151.245163); - ranger_lilathaAI->AddWaypoint(27, 7563.337402, -7654.652344, 151.227158); - ranger_lilathaAI->AddWaypoint(28, 7565.533691, -7658.296387, 151.248886); - ranger_lilathaAI->AddWaypoint(29, 7571.155762, -7659.118652, 151.244568); - ranger_lilathaAI->AddWaypoint(30, 7579.119629, -7662.213867, 151.651505); - ranger_lilathaAI->AddWaypoint(31, 7603.768066, -7667.000488, 153.997726); - ranger_lilathaAI->AddWaypoint(32, 7603.768066, -7667.000488, 153.997726, 4000); // Say4 & Set orientation - ranger_lilathaAI->AddWaypoint(33, 7603.768066, -7667.000488, 153.997726, 8000); // Say5 & Set orientation - ranger_lilathaAI->AddWaypoint(34, 7603.768066, -7667.000488, 153.997726); + ranger_lilathaAI->FillPointMovementListForCreature(); return (CreatureAI*)ranger_lilathaAI; } diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp index 391ec9f4b93..c87c91fc62a 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp @@ -256,15 +256,14 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI if (Summon_Assistant_Timer < diff) { Unit* target = NULL; - Creature* Assistance; for(int i = 0; i < summoned; i++) { switch(rand()%3) { - case 0: Assistance = m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - case 1: Assistance = m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - case 2: Assistance = m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 2: m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; } } if(rand()%100 < 20) summoned++; diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp index 52303a2abc8..03cf1a719f4 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp @@ -544,7 +544,7 @@ struct TRINITY_DLL_DECL boss_baron_rafe_dreugerAI : public boss_moroes_guestAI struct TRINITY_DLL_DECL boss_lady_catriona_von_indiAI : public boss_moroes_guestAI { //Holy Priest - boss_lady_catriona_von_indiAI(Creature *c) : boss_moroes_guestAI(c) {} + boss_lady_catriona_von_indiAI(Creature *c) : boss_moroes_guestAI(c) {Reset();} uint32 DispelMagic_Timer; uint32 GreaterHeal_Timer; @@ -614,7 +614,7 @@ struct TRINITY_DLL_DECL boss_lady_catriona_von_indiAI : public boss_moroes_guest struct TRINITY_DLL_DECL boss_lady_keira_berrybuckAI : public boss_moroes_guestAI { //Holy Pally - boss_lady_keira_berrybuckAI(Creature *c) : boss_moroes_guestAI(c) {} + boss_lady_keira_berrybuckAI(Creature *c) : boss_moroes_guestAI(c) {Reset();} uint32 Cleanse_Timer; uint32 GreaterBless_Timer; @@ -731,7 +731,7 @@ struct TRINITY_DLL_DECL boss_lord_robin_darisAI : public boss_moroes_guestAI struct TRINITY_DLL_DECL boss_lord_crispin_ferenceAI : public boss_moroes_guestAI { //Arms Warr - boss_lord_crispin_ferenceAI(Creature *c) : boss_moroes_guestAI(c) {} + boss_lord_crispin_ferenceAI(Creature *c) : boss_moroes_guestAI(c) {Reset();} uint32 Disarm_Timer; uint32 HeroicStrike_Timer; diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp index 1bad8750736..ef5a4753c9a 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp @@ -160,6 +160,8 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI { boss_terestianAI(Creature *c) : ScriptedAI(c) { + for(uint8 i = 0; i < 2; ++i) + PortalGUID[i] = 0; pInstance = ((ScriptedInstance*)c->GetInstanceData()); Reset(); } diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp index 1a0c7743933..25150ddf023 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp @@ -190,13 +190,16 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI if (resummon) { pAdd = m_creature->SummonCreature(Adds[i]->entry, LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0); + if (pAdd) + { Add* nAdd = new Add(Adds[i]->entry, pAdd->GetGUID()); Adds.erase(Adds.begin() + i); Adds.push_back(nAdd); } } } - + } + void KilledUnit(Unit* victim) { if (victim->GetTypeId() != TYPEID_PLAYER) diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp index 852fcd3873b..8ed490e3d58 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp @@ -225,6 +225,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI { target = SelectUnit(SELECT_TARGET_RANDOM,0); Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); } @@ -242,6 +243,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI { target = SelectUnit(SELECT_TARGET_RANDOM,0); Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); } diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp index bb285c3de4f..fc26214f474 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp @@ -258,7 +258,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI Walk_Pos_Z = ADDZ_RIGHT_NEAR; break; } - pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X, Walk_Pos_Y, Walk_Pos_Z,MOVEMENTFLAG_WALK_MODE); + pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X, Walk_Pos_Y, Walk_Pos_Z); } } @@ -408,7 +408,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI { //if we find no one to figth walk to the center if(!pUnit->isInCombat()) - pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X,Walk_Pos_Y,Walk_Pos_Z,MOVEMENTFLAG_WALK_MODE); + pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X,Walk_Pos_Y,Walk_Pos_Z); //Safe storing of creatures GuardiansOfIcecrown[GuardiansOfIcecrown_Count] = pUnit->GetGUID(); diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp index d2e94ad4ab9..d13b9d1c2f1 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp @@ -127,59 +127,79 @@ struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI case 0: DoTeleportPlayer(target, 250.0696,0.3921,84.8408,3.149); Summoned = m_creature->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); break; case 1: DoTeleportPlayer(target, 181.4220,-91.9481,84.8410,1.608); Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); break; case 2: DoTeleportPlayer(target, 95.1547,-1.8173,85.2289,0.043); Summoned = m_creature->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); break; case 3: DoTeleportPlayer(target, 250.0696,0.3921,72.6722,3.149); Summoned = m_creature->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); break; case 4: DoTeleportPlayer(target, 181.4220,-91.9481,70.7734,1.608); Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); break; case 5: DoTeleportPlayer(target, 106.1541,-1.8994,75.3663,0.043); Summoned = m_creature->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) ((CreatureAI*)Summoned->AI())->AttackStart(target); break; } diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp index b06225344a0..2c2e69125b0 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp @@ -135,34 +135,46 @@ struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI case 0: DoTeleportPlayer(target, -8106.0142,1289.2900,-74.419533,5.112); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); break; case 1: DoTeleportPlayer(target, -7990.135354,1155.1907,-78.849319,2.608); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); break; case 2: DoTeleportPlayer(target,-8159.7753,1127.9064,-76.868660,0.675); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) ((CreatureAI*)Hatchling->AI())->AttackStart(target); break; } diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp index 8ecb7ef0a7a..c4acade3b4f 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp @@ -262,6 +262,9 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI m_creature->SetVisibility(VISIBILITY_OFF); m_creature->Relocate(bossc->x, bossc->y, bossc->z, bossc->r); Invisible = true; + delete place1; + delete place2; + delete place3; DoResetThreat(); DoStopAttack(); @@ -275,20 +278,24 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5); - Image1->SetHealth(m_creature->GetHealth() / 5); - if (target) - Image1->AI()->AttackStart(target); + if (Image1) + { + Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5); + Image1->SetHealth(m_creature->GetHealth() / 5); + if (target) + Image1->AI()->AttackStart(target); + ((boss_skeramAI*)Image1->AI())->IsImage = true; + } Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5); - Image2->SetHealth(m_creature->GetHealth() / 5); - if (target) - Image2->AI()->AttackStart(target); - - ((boss_skeramAI*)Image1->AI())->IsImage = true; - ((boss_skeramAI*)Image2->AI())->IsImage = true; - + if (Image2) + { + Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5); + Image2->SetHealth(m_creature->GetHealth() / 5); + if (target) + Image2->AI()->AttackStart(target); + ((boss_skeramAI*)Image2->AI())->IsImage = true; + } Invisible = true; } }; diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp index d86e3937b13..41e2d7172e1 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp @@ -221,6 +221,8 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/ SendMyListToBuddies(); CallBuddiesToAttack(who); + + delete[] chosenAbilities; } bool gatherOthersWhenAggro; diff --git a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp b/src/bindings/scripts/scripts/zone/undercity/undercity.cpp index d1b7386ff31..7a7159cfcf9 100644 --- a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp +++ b/src/bindings/scripts/scripts/zone/undercity/undercity.cpp @@ -174,7 +174,7 @@ struct TRINITY_DLL_DECL npc_highborne_lamenterAI : public ScriptedAI { if( EventMove_Timer < diff ) { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,5000); m_creature->GetMap()->CreatureRelocation(m_creature,m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,m_creature->GetOrientation()); EventMove = false; diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp index d0c11277cb5..4a99dfa5c38 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp @@ -23,7 +23,7 @@ EndScriptData */ #include "precompiled.h" -#define SPELL_FROSTBREATH 21099 +#define SPELL_FROSTBREATH 16099 #define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon... #define SPELL_SLAM 24326 diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp index df3a02e69f2..5a6af5025a2 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp @@ -55,10 +55,6 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI uint32 Delusions_Timer; uint32 Teleport_Timer; - Creature *Shade; - Creature *Skeletons; - Creature *HealingWard; - void Reset() { BrainWashTotem_Timer = 20000; @@ -89,7 +85,7 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI if (HealingWard_Timer < diff) { //DoCast(m_creature, SPELL_POWERFULLHEALINGWARD); - HealingWard = m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000); + m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000); HealingWard_Timer = 14000 + rand()%6000; }else HealingWard_Timer -= diff; @@ -111,7 +107,8 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI { DoCast(target, SPELL_DELUSIONSOFJINDO); - Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Creature *Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Shade) Shade->AI()->AttackStart(target); } @@ -130,23 +127,33 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI if(DoGetThreat(m_creature->getVictim())) DoModifyThreatPercent(target,-100); + Creature *Skeletons; Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) Skeletons->AI()->AttackStart(target); Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) Skeletons->AI()->AttackStart(target); Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) Skeletons->AI()->AttackStart(target); Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) Skeletons->AI()->AttackStart(target); Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) Skeletons->AI()->AttackStart(target); Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) Skeletons->AI()->AttackStart(target); Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) Skeletons->AI()->AttackStart(target); Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) Skeletons->AI()->AttackStart(target); Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) Skeletons->AI()->AttackStart(target); } |