From 7163f598dc7987f8f95f541a8717859fbe22cc42 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 24 Jan 2009 14:11:17 -0600 Subject: *Add some script targets. By raczman. --HG-- branch : trunk --- sql/updates/965_world_scripts.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sql/updates/965_world_scripts.sql (limited to 'sql') diff --git a/sql/updates/965_world_scripts.sql b/sql/updates/965_world_scripts.sql new file mode 100644 index 00000000000..8f141c9290f --- /dev/null +++ b/sql/updates/965_world_scripts.sql @@ -0,0 +1,17 @@ +INSERT INTO `spell_script_target` VALUES +(33655,0,183350), +(33655,0,183351), +(44374,1,24722), +(31538,1,17895), +(29967,1,16524), +(39887,1,23002), +(31617,1,17899), +(31624,1,17899), +(31625,1,17899), +(34019,1,19422), +(34946,1,20040), +(34946,1,20041), +(21934,1,21934), +(43144,1,23817), +(12613,1,5843), +(9095,1,1200); -- cgit v1.2.3 From 1b0bab7f010ba5d188772685af7102ab9ece7d23 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sat, 24 Jan 2009 23:48:58 +0100 Subject: *Prevent summoning Nightbane more than one per instance - by Bagsac *Convert more text to database --HG-- branch : trunk --- sql/updates/966_world_scripts.sql | 24 +++ sql/updates/CMakeLists.txt | 2 + .../hellfire_peninsula/boss_doomlord_kazzak.cpp | 45 ++++- .../scripts/zone/karazhan/instance_karazhan.cpp | 9 +- .../zone/shadowmoon_valley/boss_doomwalker.cpp | 208 +++++++++------------ 5 files changed, 161 insertions(+), 127 deletions(-) create mode 100644 sql/updates/966_world_scripts.sql (limited to 'sql') diff --git a/sql/updates/966_world_scripts.sql b/sql/updates/966_world_scripts.sql new file mode 100644 index 00000000000..10a3e09985c --- /dev/null +++ b/sql/updates/966_world_scripts.sql @@ -0,0 +1,24 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000395 AND -1000375; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000375 ,'I remember well the sting of defeat at the conclusion of the Third War. I have waited far too long for my revenge. Now the shadow of the Legion falls over this world. It is only a matter of time until all of your failed creation... is undone.',11332,1,0,0,'kazzak SAY_INTRO'), +(-1000376,'The Legion will conquer all!',11333,1,0,0,'kazzak SAY_AGGRO1'), +(-1000377,'All mortals will perish!',11334,1,0,0,'kazzak SAY_AGGRO2'), +(-1000378,'All life must be eradicated!',11335,1,0,0,'kazzak SAY_SURPREME1'), +(-1000379,'I\'ll rip the flesh from your bones!',11336,1,0,0,'kazzak SAY_SURPREME2'), +(-1000380,'Kirel Narak!',11337,1,0,0,'kazzak SAY_KILL1'), +(-1000381,'Contemptible wretch!',11338,1,0,0,'kazzak SAY_KILL2'), +(-1000382,'The universe will be remade.',11339,1,0,0,'kazzak SAY_KILL3'), +(-1000383,'The Legion... will never... fall.',11340,1,0,0,'kazzak SAY_DEATH'), +(-1000384,'%s goes into a frenzy!',0,2,0,0,'kazzak EMOTE_FRENZY'), +(-1000385,'Invaders, you dangle upon the precipice of oblivion! The Burning Legion comes and with it comes your end.',0,1,0,0,'kazzak SAY_RAND1'), +(-1000386,'Impudent whelps, you only delay the inevitable. Where one has fallen, ten shall rise. Such is the will of Kazzak...',0,1,0,0,'kazzak SAY_RAND2'), + +(-1000387,'Do not proceed. You will be eliminated!',11344,1,0,0,'doomwalker SAY_AGGRO'), +(-1000388,'Tectonic disruption commencing.',11345,1,0,0,'doomwalker SAY_EARTHQUAKE_1'), +(-1000389,'Magnitude set. Release.',11346,1,0,0,'doomwalker SAY_EARTHQUAKE_2'), +(-1000390,'Trajectory locked.',11347,1,0,0,'doomwalker SAY_OVERRUN_1'), +(-1000391,'Engage maximum speed.',11348,1,0,0,'doomwalker SAY_OVERRUN_2'), +(-1000392,'Threat level zero.',11349,1,0,0,'doomwalker SAY_SLAY_1'), +(-1000393,'Directive accomplished.',11350,1,0,0,'doomwalker SAY_SLAY_2'), +(-1000394,'Target exterminated.',11351,1,0,0,'doomwalker SAY_SLAY_3'), +(-1000395,'System failure in five, f-o-u-r...',11352,1,0,0,'doomwalker SAY_DEATH'); \ No newline at end of file diff --git a/sql/updates/CMakeLists.txt b/sql/updates/CMakeLists.txt index afe3b1bff5d..657428c35f8 100644 --- a/sql/updates/CMakeLists.txt +++ b/sql/updates/CMakeLists.txt @@ -158,4 +158,6 @@ INSTALL(FILES 956_world_scripts.sql 957_world_scripts.sql 963_world_scripts.sql +965_world_scripts.sql +966_world_scripts.sql DESTINATION share/trinity/sql/updates) diff --git a/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp b/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp index c73fbd22225..1264a72f0cb 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp @@ -23,6 +23,19 @@ EndScriptData */ #include "precompiled.h" +#define SAY_INTRO -1000375 +#define SAY_AGGRO1 -1000376 +#define SAY_AGGRO2 -1000377 +#define SAY_SURPREME1 -1000378 +#define SAY_SURPREME2 -1000379 +#define SAY_KILL1 -1000380 +#define SAY_KILL2 -1000381 +#define SAY_KILL3 -1000382 +#define SAY_DEATH -1000383 +#define EMOTE_FRENZY -1000384 +#define SAY_RAND1 -1000385 +#define SAY_RAND2 -1000386 + #define SPELL_SHADOWVOLLEY 32963 #define SPELL_CLEAVE 31779 #define SPELL_THUNDERCLAP 36706 @@ -55,13 +68,39 @@ struct TRINITY_DLL_DECL boss_doomlordkazzakAI : public ScriptedAI Twisted_Reflection_Timer = 33000; // Timer may be incorrect } - void Aggro(Unit *who) {} + void JustRespawned() + { + DoScriptText(SAY_INTRO, m_creature); + } + + void Aggro(Unit *who) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + } + } void KilledUnit(Unit* victim) { // When Kazzak kills a player (not pets/totems), he regens some health - if(victim->GetTypeId() == TYPEID_PLAYER) + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + DoCast(m_creature,SPELL_CAPTURESOUL); + + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; + case 2: DoScriptText(SAY_KILL3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); } void UpdateAI(const uint32 diff) @@ -112,6 +151,7 @@ struct TRINITY_DLL_DECL boss_doomlordkazzakAI : public ScriptedAI //Enrage_Timer if (Enrage_Timer < diff) { + DoScriptText(EMOTE_FRENZY, m_creature); DoCast(m_creature,SPELL_ENRAGE); Enrage_Timer = 30000; }else Enrage_Timer -= diff; @@ -126,6 +166,7 @@ struct TRINITY_DLL_DECL boss_doomlordkazzakAI : public ScriptedAI } }; + CreatureAI* GetAI_boss_doomlordkazzak(Creature *_Creature) { return new boss_doomlordkazzakAI (_Creature); diff --git a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp index 1d2760be73c..5b5dd3dabd9 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp @@ -61,9 +61,10 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance uint64 GamesmansExitDoor; // Door after Chess uint64 NetherspaceDoor; // Door at Malchezaar uint64 MastersTerraceDoor[2]; - uint64 ImageGUID; + bool NightbaneSummoned; + void Initialize() { for (uint8 i = 0; i < ENCOUNTERS; ++i) @@ -87,8 +88,9 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance NetherspaceDoor = 0; MastersTerraceDoor[0]= 0; MastersTerraceDoor[1]= 0; - ImageGUID = 0; + + NightbaneSummoned = false; } bool IsEncounterInProgress() const @@ -131,6 +133,9 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance case 17229: KilrekGUID = creature->GetGUID(); break; case 15688: TerestianGUID = creature->GetGUID(); break; case 15687: MoroesGUID = creature->GetGUID(); break; + case 17225: if(NightbaneSummoned)creature->RemoveFromWorld(); + else NightbaneSummoned = true; + break; } } diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp index 949d447dcaa..eade0b96455 100644 --- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp +++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp @@ -23,53 +23,31 @@ EndScriptData */ #include "precompiled.h" -//-------------------------------------- -//Spells -#define SPELL_SUNDER_ARMOR 33661 +#define SAY_AGGRO -1000387 +#define SAY_EARTHQUAKE_1 -1000388 +#define SAY_EARTHQUAKE_2 -1000389 +#define SAY_OVERRUN_1 -1000390 +#define SAY_OVERRUN_2 -1000391 +#define SAY_SLAY_1 -1000392 +#define SAY_SLAY_2 -1000393 +#define SAY_SLAY_3 -1000394 +#define SAY_DEATH -1000395 +#define SPELL_EARTHQUAKE 32686 +#define SPELL_SUNDER_ARMOR 33661 #define SPELL_CHAIN_LIGHTNING 33665 - #define SPELL_OVERRUN 32636 -#define SAY_OVERRUN_1 "Trajectory locked." -#define SOUND_OVERRUN_1 11347 -#define SAY_OVERRUN_2 "Engage maximum speed." -#define SOUND_OVERRUN_2 11348 - #define SPELL_ENRAGE 33653 - #define SPELL_MARK_DEATH 37128 -#define SPELL_EARTHQUAKE 32686 -#define SAY_EARTHQUAKE_1 "Tectonic disruption commencing." -#define SOUND_EARTHQUAKE_1 11345 -#define SAY_EARTHQUAKE_2 "Magnitude set. Release." -#define SOUND_EARTHQUAKE_2 11346 -//--------------------------------------- -//Aggro -#define SAY_AGGRO "Do not proceed. You will be eliminated!" -#define SOUND_AGGRO 11344 -//--------------------------------------- -//Slay -#define SAY_SLAY_1 "Threat level zero." -#define SOUND_SLAY_1 11349 -#define SAY_SLAY_2 "Directive accomplished." -#define SOUND_SLAY_2 11350 -#define SAY_SLAY_3 "Target exterminated." -#define SOUND_SLAY_3 11351 -//--------------------------------------- -//Death -#define SAY_DEATH "System failure in five... four..." -#define SOUND_DEATH 11352 - -struct TRINITY_DLL_DECL boss_doomwalkerAI : public ScriptedAI +struct MANGOS_DLL_DECL boss_doomwalkerAI : public ScriptedAI { boss_doomwalkerAI(Creature *c) : ScriptedAI(c) {Reset();} - uint32 Chain_Timer; - uint32 Enrage_Timer; + uint32 Enrage_Timer; uint32 Overrun_Timer; - uint32 Quake_Timer; + uint32 Quake_Timer; uint32 Armor_Timer; bool InEnrage; @@ -82,7 +60,7 @@ struct TRINITY_DLL_DECL boss_doomwalkerAI : public ScriptedAI Quake_Timer = 25000 + rand()%10000; Overrun_Timer = 30000 + rand()%15000; - InEnrage = false; + InEnrage = false; } void KilledUnit(Unit* Victim) @@ -92,114 +70,98 @@ struct TRINITY_DLL_DECL boss_doomwalkerAI : public ScriptedAI switch(rand()%3) { - case 0: - DoYell(SAY_SLAY_1, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_SLAY_1); - break; - case 1: - DoYell(SAY_SLAY_2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_SLAY_2); - break; - case 2: - DoYell(SAY_SLAY_3, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_SLAY_3); - break; + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; } + + DoCast(m_creature->getVictim(), SPELL_MARK_DEATH); } void JustDied(Unit* Killer) { - DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_DEATH); + DoScriptText(SAY_DEATH, m_creature); } void Aggro(Unit *who) { - DoYell(SAY_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_AGGRO); + DoScriptText(SAY_AGGRO, m_creature); } void UpdateAI(const uint32 diff) { - if (!m_creature->SelectHostilTarget() || !m_creature->getVictim()) return; - //if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + //Spell Enrage, when hp <= 20% gain enrage + if (((m_creature->GetHealth()*100)/ m_creature->GetMaxHealth()) <= 20) { - //Spell Enrage - if (((m_creature->GetHealth()*100)/ m_creature->GetMaxHealth()) <= 20)//when hp <= 20% gain enrage - { - if(Enrage_Timer < diff) - { - DoCast(m_creature,SPELL_ENRAGE); - Enrage_Timer = 6000; - InEnrage = true; - }else Enrage_Timer -= diff; - } - - //Spell Overrun - if (Overrun_Timer < diff) - { - switch(rand()%2) - { - case 0: - DoYell(SAY_OVERRUN_1, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_OVERRUN_1); - break; - case 1: - DoYell(SAY_OVERRUN_2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_OVERRUN_2); - break; - } - DoCast(m_creature->getVictim(),SPELL_OVERRUN); - Overrun_Timer = 25000 + rand()%15000; - - }else Overrun_Timer -= diff; - - //Spell Earthquake - if (Quake_Timer < diff) + if(Enrage_Timer < diff) { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: - DoYell(SAY_EARTHQUAKE_1, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_EARTHQUAKE_1); - break; - case 1: - DoYell(SAY_EARTHQUAKE_2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_EARTHQUAKE_2); - break; - } - if(InEnrage) - { - m_creature->RemoveAura(SPELL_ENRAGE, 0);//remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead - } - DoCast(m_creature,SPELL_EARTHQUAKE); - Quake_Timer = 30000 + rand()%25000; - }else Quake_Timer -= diff; - - //Spell Chain Lightning - if (Chain_Timer < diff) + DoCast(m_creature,SPELL_ENRAGE); + Enrage_Timer = 6000; + InEnrage = true; + }else Enrage_Timer -= diff; + } + + //Spell Overrun + if (Overrun_Timer < diff) + { + switch(rand()%2) { - DoCast(m_creature->getVictim(),SPELL_CHAIN_LIGHTNING); - Chain_Timer = 15000 + rand()%25000; - }else Chain_Timer -= diff; + case 0: DoScriptText(SAY_OVERRUN_1, m_creature); break; + case 1: DoScriptText(SAY_OVERRUN_2, m_creature); break; + } + + DoCast(m_creature->getVictim(),SPELL_OVERRUN); + Overrun_Timer = 25000 + rand()%15000; + }else Overrun_Timer -= diff; + + //Spell Earthquake + if (Quake_Timer < diff) + { + if (rand()%2) + return; - //Spell Sunder Armor - if (Armor_Timer < diff) + switch(rand()%2) { - DoCast(m_creature->getVictim(),SPELL_SUNDER_ARMOR); - Armor_Timer = 15000 + rand()%15000; - }else Armor_Timer -= diff; + case 0: DoScriptText(SAY_EARTHQUAKE_1, m_creature); break; + case 1: DoScriptText(SAY_EARTHQUAKE_2, m_creature); break; + } - DoMeleeAttackIfReady(); - } + //remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead + if (InEnrage) + m_creature->RemoveAura(SPELL_ENRAGE, 0); + + DoCast(m_creature,SPELL_EARTHQUAKE); + Quake_Timer = 30000 + rand()%25000; + }else Quake_Timer -= diff; + + //Spell Chain Lightning + if (Chain_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + + if (!target) + target = m_creature->getVictim(); + + if (target) + DoCast(target,SPELL_CHAIN_LIGHTNING); + + Chain_Timer = 10000 + rand()%25000; + }else Chain_Timer -= diff; + + //Spell Sunder Armor + if (Armor_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SUNDER_ARMOR); + Armor_Timer = 10000 + rand()%15000; + }else Armor_Timer -= diff; + + DoMeleeAttackIfReady(); } -}; +}; CreatureAI* GetAI_boss_doomwalker(Creature *_Creature) { @@ -210,7 +172,7 @@ void AddSC_boss_doomwalker() { Script *newscript; newscript = new Script; - newscript->Name="boss_doomwalker"; + newscript->Name = "boss_doomwalker"; newscript->GetAI = &GetAI_boss_doomwalker; newscript->RegisterSelf(); } -- cgit v1.2.3 From 50172faf5a6128f7fd2a33d4b34a7b634ac88a61 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sun, 25 Jan 2009 09:57:40 +0100 Subject: *Updated FindCreature and FindGameObject function --HG-- branch : trunk --- sql/world_scripts_full.sql | 2 +- src/bindings/scripts/include/sc_creature.cpp | 16 +++--- src/bindings/scripts/include/sc_creature.h | 12 ++--- .../scripts/zone/ashenvale_forest/ashenvale.cpp | 4 +- .../mana_tombs/boss_nexusprince_shaffar.cpp | 2 +- .../scripts/scripts/zone/barrens/the_barrens.cpp | 2 +- .../scripts/scripts/zone/ghostlands/ghostlands.cpp | 6 +-- .../blood_furnace/boss_kelidan_the_breaker.cpp | 6 +-- .../hellfire_ramparts/boss_vazruden_the_herald.cpp | 6 +-- .../zone/isle_of_queldanas/isle_of_queldanas.cpp | 2 +- .../scripts/zone/netherstorm/netherstorm.cpp | 4 +- .../zone/shadowmoon_valley/shadowmoon_valley.cpp | 59 +++++++++------------- .../scripts/zone/shattrath/shattrath_city.cpp | 16 +++--- .../zone/silverpine_forest/silverpine_forest.cpp | 4 +- .../scripts/scripts/zone/tanaris/tanaris.cpp | 2 +- .../zone/terokkar_forest/terokkar_forest.cpp | 2 +- 16 files changed, 70 insertions(+), 75 deletions(-) (limited to 'sql') diff --git a/sql/world_scripts_full.sql b/sql/world_scripts_full.sql index 5c302e87b5c..951b58bfd61 100644 --- a/sql/world_scripts_full.sql +++ b/sql/world_scripts_full.sql @@ -720,7 +720,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_overlord_morghor' WHERE entry= UPDATE `creature_template` SET `ScriptName`='' WHERE entry=23141; UPDATE `creature_template` SET `ScriptName`='mob_illidari_spawn' WHERE `entry` IN (22075, 22074, 19797); UPDATE `creature_template` SET `ScriptName`='mob_torloth_the_magnificent' WHERE `entry`='22076'; -UPDATE `creature_template SET `ScriptName`='npc_lord_illidan_stormrage' WHERE `entry`=22083; +UPDATE `creature_template` SET `ScriptName`='npc_lord_illidan_stormrage' WHERE `entry`=22083; UPDATE `creature_template` SET `ScriptName`='npc_earthmender_wilda' WHERE `entry`=21027; /* SHATTRATH */ diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index cbbb574d253..82e7ab04ca9 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -761,21 +761,25 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o) i_pl->TeleportTo(m_creature->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); } -Unit* ScriptedAI::FindCreature(uint32 entry, float range) -{ +Unit* FindCreature(uint32 entry, float range, Unit* Finder) +{ + if(!Finder) + return NULL; Creature* target = NULL; - Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, range); + Trinity::AllCreaturesOfEntryInRange check(Finder, entry, range); Trinity::CreatureSearcher searcher(target, check); - m_creature->VisitNearbyObject(range, searcher); + Finder->VisitNearbyObject(range, searcher); return target; } -GameObject* ScriptedAI::FindGameObject(uint32 entry, float range) +GameObject* FindGameObject(uint32 entry, float range, Unit* Finder) { + if(!Finder) + return NULL; GameObject* target = NULL; Trinity::AllGameObjectsWithEntryInGrid go_check(entry); Trinity::GameObjectSearcher searcher(target, go_check); - m_creature->VisitNearbyGridObject(range, searcher); + Finder->VisitNearbyGridObject(range, searcher); return target; } diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index cf991baa301..6f60f8cf334 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -25,6 +25,12 @@ private: Creature *m_creature; }; +//Get a single creature of given entry +Unit* FindCreature(uint32 entry, float range, Unit* Finder); + +//Get a single gameobject of given entry +GameObject* FindGameObject(uint32 entry, float range, Unit* Finder); + struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI { ScriptedAI(Creature* creature) : m_creature(creature), InCombat(false), IsFleeing(false) {} @@ -153,12 +159,6 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI void DoTeleportPlayer(Unit* pUnit, float x, float y, float z, float o); void DoTeleportAll(float x, float y, float z, float o); - //Get a single creature of given entry - Unit* FindCreature(uint32 entry, float range); - - //Get a single gameobject of given entry - GameObject* FindGameObject(uint32 entry, float range); - //Returns friendly unit with the most amount of hp missing from max hp Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff = 1); diff --git a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp index 85ce5ea0bea..fcbb931cf06 100644 --- a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp +++ b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp @@ -202,7 +202,7 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI { case 0: { m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - GameObject* Cage = FindGameObject(GO_CAGE, 99); + GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); if(Cage) Cage->SetGoState(0); break;} @@ -232,7 +232,7 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI if (!IsBeingEscorted) m_creature->setFaction(1602); - GameObject* Cage = FindGameObject(GO_CAGE, 99); + GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); if(Cage) Cage->SetGoState(1); } 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 440f233bccf..5f4eae9fbfe 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 @@ -241,7 +241,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI { DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); ArcaneBolt_Timer = 2000 + rand()%2500; - Unit *shaffar = FindCreature(ENTRY_SHAFFAR, 100); + Unit *shaffar = FindCreature(ENTRY_SHAFFAR, 100, m_creature); if(!shaffar || shaffar->isDead()) { m_creature->SetVisibility(VISIBILITY_OFF); diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp index d7049a3b0f4..238918ed973 100644 --- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp +++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp @@ -427,7 +427,7 @@ struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI case 10: DoScriptText(SAY_PROGRESS_3, m_creature, player); m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; case 20:{ - Unit* Mercenary = FindCreature(MOB_MERCENARY, 99); + Unit* Mercenary = FindCreature(MOB_MERCENARY, 99, m_creature); if(Mercenary) { DoScriptText(SAY_MERCENARY_4, Mercenary); diff --git a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp index cf0bce15bae..ecbd37abf2e 100644 --- a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp +++ b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp @@ -165,7 +165,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI case 0: { m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - GameObject* Cage = FindGameObject(GO_CAGE, 99); + GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); if(Cage) Cage->SetGoState(0); DoScriptText(SAY_START, m_creature, player); @@ -200,7 +200,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI case 33: m_creature->SetOrientation(5.858011); DoScriptText(SAY_END2, m_creature, player); - Unit* CaptainHelios = FindCreature(NPC_CAPTAIN_HELIOS, 50); + Unit* CaptainHelios = FindCreature(NPC_CAPTAIN_HELIOS, 50, m_creature); if(CaptainHelios) DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); break; @@ -214,7 +214,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI if (!IsBeingEscorted) m_creature->setFaction(1602); - GameObject* Cage = FindGameObject(GO_CAGE, 99); + GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); if(Cage) Cage->SetGoState(1); } diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp index 94a75db6149..1a01cdab769 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp @@ -294,7 +294,7 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI void Aggro(Unit* who) { - if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100)) + if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100, m_creature)) ((boss_kelidan_the_breakerAI*)Kelidan->AI())->ChannelerEngaged(who); if (m_creature->IsNonMeleeSpellCasted(false)) m_creature->InterruptNonMeleeSpells(true); @@ -303,7 +303,7 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI void JustDied(Unit* Killer) { - if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100)) + if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100, m_creature)) ((boss_kelidan_the_breakerAI*)Kelidan->AI())->ChannelerDied(Killer); } @@ -314,7 +314,7 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI if(check_Timer < diff) { if (!m_creature->IsNonMeleeSpellCasted(false)) - if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100)) + if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100, m_creature)) { uint64 channeler = ((boss_kelidan_the_breakerAI*)Kelidan->AI())->GetChanneled(m_creature); if(Unit *channeled = Unit::GetUnit(*m_creature, channeler)) diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp index a62c4e06217..a89d6d04aa9 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp @@ -284,7 +284,7 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI { Creature *Nazan = (Creature*)Unit::GetUnit(*m_creature, NazanGUID); Creature *Vazruden = (Creature*)Unit::GetUnit(*m_creature, VazrudenGUID); - if(Nazan || (Nazan = (Creature *)FindCreature(ENTRY_NAZAN, 5000))) + if(Nazan || (Nazan = (Creature *)FindCreature(ENTRY_NAZAN, 5000, m_creature))) { Nazan->SetLootRecipient(NULL); Nazan->SetVisibility(VISIBILITY_OFF); @@ -292,7 +292,7 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI Nazan->RemoveCorpse(); NazanGUID = 0; } - if(Vazruden || (Vazruden = (Creature *)FindCreature(ENTRY_VAZRUDEN, 5000))) + if(Vazruden || (Vazruden = (Creature *)FindCreature(ENTRY_VAZRUDEN, 5000, m_creature))) { Vazruden->SetLootRecipient(NULL); Vazruden->SetVisibility(VISIBILITY_OFF); @@ -424,7 +424,7 @@ struct TRINITY_DLL_DECL mob_hellfire_sentryAI : public ScriptedAI void JustDied(Unit* who) { - if(Creature *herald = (Creature *)FindCreature(ENTRY_VAZRUDEN_HERALD,150)) + if(Creature *herald = (Creature *)FindCreature(ENTRY_VAZRUDEN_HERALD,150, m_creature)) ((boss_vazruden_the_heraldAI *)herald->AI())->SentryDownBy(who); } diff --git a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp index 7cea5685e55..b5fab052181 100644 --- a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp +++ b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp @@ -174,7 +174,7 @@ struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI ((Player*)plr)->KilledMonster(25086, m_creature->GetGUID()); } DoCast(m_creature, ENRAGE); - Unit* Myrmidon = FindCreature(DM, 70); + Unit* Myrmidon = FindCreature(DM, 70, m_creature); if(Myrmidon) { m_creature->AddThreat(Myrmidon, 100000.0f); diff --git a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp index eb1da1748a8..9b888365a4e 100644 --- a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp +++ b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp @@ -946,11 +946,11 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI ((Player*)player)->GroupEventHappens(Q_ALMABTRIEB, m_creature); Completed = true; } - {Unit* Thadell = FindCreature(N_THADELL, 30); + {Unit* Thadell = FindCreature(N_THADELL, 30, m_creature); if(Thadell) DoScriptText(SAY_THADELL_1, m_creature);}break; case 13: - {Unit* Thadell = FindCreature(N_THADELL, 30); + {Unit* Thadell = FindCreature(N_THADELL, 30, m_creature); if(Thadell) DoScriptText(SAY_THADELL_2, m_creature, player);}break; } diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp index 6618620de1e..30056b1e7ae 100644 --- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp +++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp @@ -165,15 +165,6 @@ CreatureAI* GetAI_mob_mature_netherwing_drake(Creature *_creature) # mob_enslaved_netherwing_drake ####*/ -Creature* SelectCreatureInGrid(Unit* pUnit, uint32 entry, float range) -{ - Creature* target = NULL; - Trinity::AllCreaturesOfEntryInRange check(pUnit, entry, range); - Trinity::CreatureSearcher searcher(target, check); - pUnit->VisitNearbyObject(range, searcher); - return target; -} - #define FACTION_DEFAULT 62 #define FACTION_FRIENDLY 1840 // Not sure if this is correct, it was taken off of Mordenai. @@ -221,7 +212,7 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI m_creature->setFaction(FACTION_FRIENDLY); DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true); - Creature* Dragonmaw = SelectCreatureInGrid(m_creature, CREATURE_DRAGONMAW_SUBJUGATOR, 50); + Unit* Dragonmaw = FindCreature(CREATURE_DRAGONMAW_SUBJUGATOR, 50, m_creature); if(Dragonmaw) { @@ -281,7 +272,7 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI float dx, dy, dz; - Creature* EscapeDummy = SelectCreatureInGrid(m_creature, CREATURE_ESCAPE_DUMMY, 30); + Unit* EscapeDummy = FindCreature(CREATURE_ESCAPE_DUMMY, 30, m_creature); if(EscapeDummy) EscapeDummy->GetPosition(dx, dy, dz); else @@ -637,7 +628,7 @@ bool QuestAccept_npc_karynaku(Player* player, Creature* creature, Quest const* q nodes.resize(2); nodes[0] = 161; // From Karynaku nodes[1] = 162; // To Mordenai - error_log("SD2: Player %s started quest 10870 which has disabled taxi node, need to be fixed in core", player->GetName()); + error_log("TSCR: Player %s started quest 10870 which has disabled taxi node, need to be fixed in core", player->GetName()); //player->ActivateTaxiPathTo(nodes, 20811); } @@ -780,7 +771,7 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI return 6000; break; case 27: { - Unit* Yarzill = FindCreature(C_YARZILL, 50); + Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature); if (Yarzill) Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 500; }break; @@ -792,19 +783,19 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI return 1000; break; case 29: { - Unit* Yarzill = FindCreature(C_YARZILL, 50); + Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature); if(Yarzill) DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, plr); return 5000; }break; case 30: { - Unit* Yarzill = FindCreature(C_YARZILL, 50); + Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature); if (Yarzill) Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0); return 5000; }break; case 31: { - Unit* Yarzill = FindCreature(C_YARZILL, 50); + Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature); if (Yarzill) Yarzill->CastSpell(plr, 41540, true); return 1000;}break; @@ -1128,10 +1119,10 @@ struct WaveData static WaveData WavesInfo[]= { - {9, 0, 22075, 10000, 7000, -1000371},//Illidari Soldier - {2, 9, 22074, 10000, 7000, -1000372},//Illidari Mind Breaker - {4, 11, 19797, 10000, 7000, -1000373},//Illidari Highlord - {1, 15, 22076, 10000, 7000, -1000374} //Torloth The Magnificent + {9, 0, 22075, 10000, 7000, -1000371}, //Illidari Soldier + {2, 9, 22074, 10000, 7000, -1000372}, //Illidari Mind Breaker + {4, 11, 19797, 10000, 7000, -1000373}, //Illidari Highlord + {1, 15, 22076, 10000, 7000, -1000374} //Torloth The Magnificent }; struct SpawnSpells @@ -1141,15 +1132,15 @@ struct SpawnSpells static SpawnSpells SpawnCast[]= { - {10000, 15000, 35871},// Illidari Soldier Cast - Spellbreaker - {10000, 10000, 38985},// Illidari Mind Breake Cast - Focused Bursts - {35000, 35000, 22884},// Illidari Mind Breake Cast - Psychic Scream - {20000, 20000, 17194},// Illidari Mind Breake Cast - Mind Blast - {8000, 15000, 38010},// Illidari Highlord Cast - Curse of Flames - {12000, 20000, 16102},// Illidari Highlord Cast - Flamestrike - {10000, 15000, 15284},// Torloth the Magnificent Cast - Cleave - {18000, 20000, 39082},// Torloth the Magnificent Cast - Shadowfury - {25000, 28000, 33961}// Torloth the Magnificent Cast - Spell Reflection + {10000, 15000, 35871}, // Illidari Soldier Cast - Spellbreaker + {10000, 10000, 38985}, // Illidari Mind Breake Cast - Focused Bursts + {35000, 35000, 22884}, // Illidari Mind Breake Cast - Psychic Scream + {20000, 20000, 17194}, // Illidari Mind Breake Cast - Mind Blast + {8000, 15000, 38010}, // Illidari Highlord Cast - Curse of Flames + {12000, 20000, 16102}, // Illidari Highlord Cast - Flamestrike + {10000, 15000, 15284}, // Torloth the Magnificent Cast - Cleave + {18000, 20000, 39082}, // Torloth the Magnificent Cast - Shadowfury + {25000, 28000, 33961} // Torloth the Magnificent Cast - Spell Reflection }; /*###### @@ -1618,13 +1609,13 @@ bool GOQuestAccept_GO_crystal_prison(Player* plr, GameObject* go, Quest const* q { if(quest->GetQuestId() == QUEST_BATTLE_OF_THE_CRIMSON_WATCH ) { - Creature* Illidan = SelectCreatureInGrid(plr, 22083, 50); + Unit* Illidan = FindCreature(22083, 50, plr); - if(Illidan && !(((npc_lord_illidan_stormrageAI*)Illidan->AI())->EventStarted)) + if(Illidan && !(((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->EventStarted)) { - ((npc_lord_illidan_stormrageAI*)Illidan->AI())->PlayerGUID = plr->GetGUID(); - ((npc_lord_illidan_stormrageAI*)Illidan->AI())->LiveCount = 0; - ((npc_lord_illidan_stormrageAI*)Illidan->AI())->EventStarted=true; + ((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->PlayerGUID = plr->GetGUID(); + ((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->LiveCount = 0; + ((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->EventStarted=true; } } return true; diff --git a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp index 339f8450c92..22f71e09be0 100644 --- a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp +++ b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp @@ -453,13 +453,13 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI Step = 0; m_creature->setFaction(1194); - Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20); + Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); if(Creepjack) { ((Creature*)Creepjack)->AI()->EnterEvadeMode(); Creepjack->setFaction(1194); } - Unit* Malone = FindCreature(NPC_MALONE, 20); + Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); if(Malone) { ((Creature*)Malone)->AI()->EnterEvadeMode(); @@ -474,10 +474,10 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI switch(Step) { case 0:{ m_creature->SetInFront(player); - Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20); + Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); if(Creepjack) Creepjack->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Unit* Malone = FindCreature(NPC_MALONE, 20); + Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); if(Malone) Malone->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }return 2000; @@ -508,14 +508,14 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); if(player) { - Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20); + Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); if(Creepjack) { Creepjack->Attack(player, true); Creepjack->setFaction(14); Creepjack->GetMotionMaster()->MoveChase(player); } - Unit* Malone = FindCreature(NPC_MALONE, 20); + Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); if(Malone) { Malone->Attack(player, true); @@ -531,13 +531,13 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI if((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1 && !Done) { - Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20); + Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); if(Creepjack) { ((Creature*)Creepjack)->AI()->EnterEvadeMode(); Creepjack->setFaction(1194); } - Unit* Malone = FindCreature(NPC_MALONE, 20); + Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); if(Malone) { ((Creature*)Malone)->AI()->EnterEvadeMode(); diff --git a/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp b/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp index a350594d860..3981c63d092 100644 --- a/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp +++ b/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp @@ -130,7 +130,7 @@ struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI ((Player*)player)->GroupEventHappens(QUEST_ESCORTING, m_creature);break; case 14: DoScriptText(SAY_THANKS, m_creature, player);break; case 15: { - Unit* Rane = FindCreature(NPC_RANE, 20); + Unit* Rane = FindCreature(NPC_RANE, 20, m_creature); if(Rane) DoScriptText(SAY_RANE, Rane); break;} @@ -138,7 +138,7 @@ struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI case 17: DoScriptText(SAY_MOVE_QUINN, m_creature); break; case 24: DoScriptText(SAY_GREETINGS, m_creature);break; case 25: { - Unit* Quinn = FindCreature(NPC_QUINN, 20); + Unit* Quinn = FindCreature(NPC_QUINN, 20, m_creature); if(Quinn) DoScriptText(SAY_QUINN, Quinn); break;} diff --git a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp index 7a68227457f..85621b1963f 100644 --- a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp +++ b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp @@ -405,7 +405,7 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI m_creature->SummonCreature(SPAWN_SECOND_2, -7515.07, -4797.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); m_creature->SummonCreature(SPAWN_SECOND_2, -7518.07, -4792.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); DoScriptText(SAY_CHICKEN_AMB, m_creature); - {Unit* scoff = FindCreature(SPAWN_SECOND_2, 30); + {Unit* scoff = FindCreature(SPAWN_SECOND_2, 30, m_creature); if(scoff) DoScriptText(SAY_SCOFF, scoff);}break; break; diff --git a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp index aca9d6957cd..4e4c5409911 100644 --- a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp +++ b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp @@ -387,7 +387,7 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI { case 0: { - GameObject* Cage = FindGameObject(GO_CAGE, 99); + GameObject* Cage = FindGameObject(GO_CAGE, 10, m_creature); if(Cage) Cage->SetGoState(0); }break; -- cgit v1.2.3 From f57ed8519cd76435146201404d4ab0e868136183 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sun, 25 Jan 2009 11:59:50 +0100 Subject: *Cleanup in Blade's Edge Mountain --HG-- branch : trunk --- sql/updates/970_world_scripts.sql | 9 ++++++ sql/updates/CMakeLists.txt | 1 + .../blades_edge_mountains.cpp | 35 +++++++++++++--------- 3 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 sql/updates/970_world_scripts.sql (limited to 'sql') diff --git a/sql/updates/970_world_scripts.sql b/sql/updates/970_world_scripts.sql new file mode 100644 index 00000000000..0664e079ba0 --- /dev/null +++ b/sql/updates/970_world_scripts.sql @@ -0,0 +1,9 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000401 AND -1000396; +INSERT INTO script_texts (entry, content_default, type, language, comment) VALUES +(-1000396, 'Muahahahaha! You fool! You've released me from my banishment in the interstices between space and time!', 0, 0, 'mobs_nether_drake - SAY_NIHIL_1'), +(-1000397, 'All of Draenor shall quick beneath my feet! I will destroy this world and reshape it in my image!', 0, 0, 'mobs_nether_drake - SAY_NIHIL_2'), +(-1000398, 0, 0, 'Where shall I begin? I cannot bother myself with a worm such as yourself. There is a world to be conquered!', 0, 0, 'mobs_nether_Drake - SAY_NIHIL_3'), +(-1000399, 'No doubt the fools that banished me are long dead. I shall take wing survey my demense. Pray to whatever gods you hold dear that we do not meet again.', 0, 0, 'mobs_nether_drake - SAY_NIHIL_4'), +(-1000400, 'NOOOOooooooo!', 1, 0, 'mobs_nether_drake - SAY_NIHIL_INTERRUPT'), + +(-1000401, 'Good $N, you are under the spell's influence. I must analyze it quickly, then we can talk.', 0, 7, 'npc_daranelle - SAY_DARANELLE'); \ No newline at end of file diff --git a/sql/updates/CMakeLists.txt b/sql/updates/CMakeLists.txt index 657428c35f8..c92e30e023e 100644 --- a/sql/updates/CMakeLists.txt +++ b/sql/updates/CMakeLists.txt @@ -160,4 +160,5 @@ INSTALL(FILES 963_world_scripts.sql 965_world_scripts.sql 966_world_scripts.sql +970_world_scripts.sql DESTINATION share/trinity/sql/updates) diff --git a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp index fba1ed20c72..116c08d4b0a 100644 --- a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp +++ b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp @@ -64,11 +64,11 @@ CreatureAI* GetAI_mobs_bladespire_ogre(Creature *_Creature) ## mobs_nether_drake ######*/ -#define SAY_NIHIL_1 "Muahahahaha! You fool! You've released me from my banishment in the interstices between space and time!" -#define SAY_NIHIL_2 "All of Draenor shall quick beneath my feet! I will destroy this world and reshape it in my image!" -#define SAY_NIHIL_3 "Where shall I begin? I cannot bother myself with a worm such as yourself. There is a world to be conquered!" -#define SAY_NIHIL_4 "No doubt the fools that banished me are long dead. I shall take wing survey my demense. Pray to whatever gods you hold dear that we do not meet again." -#define SAY_NIHIL_INTERRUPT "NOOOOooooooo!" +#define SAY_NIHIL_1 -1000396 +#define SAY_NIHIL_2 -1000397 +#define SAY_NIHIL_3 -1000398 +#define SAY_NIHIL_4 -1000399 +#define SAY_NIHIL_INTERRUPT -1000400 #define ENTRY_WHELP 20021 #define ENTRY_PROTO 21821 @@ -156,7 +156,7 @@ struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI case ENTRY_NIHIL: if( NihilSpeech_Phase ) { - DoYell(SAY_NIHIL_INTERRUPT,LANG_UNIVERSAL,NULL); + DoScriptText(SAY_NIHIL_INTERRUPT, m_creature); IsNihil = false; switch(rand()%3) { @@ -196,19 +196,19 @@ struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI switch( NihilSpeech_Phase ) { case 1: - DoSay(SAY_NIHIL_1,LANG_UNIVERSAL,NULL); + DoScriptText(SAY_NIHIL_1, m_creature); ++NihilSpeech_Phase; break; case 2: - DoSay(SAY_NIHIL_2,LANG_UNIVERSAL,NULL); + DoScriptText(SAY_NIHIL_2, m_creature); ++NihilSpeech_Phase; break; case 3: - DoSay(SAY_NIHIL_3,LANG_UNIVERSAL,NULL); + DoScriptText(SAY_NIHIL_3, m_creature); ++NihilSpeech_Phase; break; case 4: - DoSay(SAY_NIHIL_4,LANG_UNIVERSAL,NULL); + DoScriptText(SAY_NIHIL_4, m_creature); ++NihilSpeech_Phase; break; case 5: @@ -261,6 +261,8 @@ CreatureAI* GetAI_mobs_nether_drake(Creature *_Creature) ## npc_daranelle ######*/ +#define SAY_DARANELLE -1000401 + struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI { npc_daranelleAI(Creature *c) : ScriptedAI(c) {Reset();} @@ -279,7 +281,7 @@ struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI { if(who->HasAura(36904,0)) { - DoSay("Good $N, you are under the spell's influence. I must analyze it quickly, then we can talk.",LANG_COMMON,who); + DoScriptText(SAY_DARANELLE, m_creature, who); //TODO: Move the below to updateAI and run if this statement == true ((Player*)who)->KilledMonster(21511, m_creature->GetGUID()); ((Player*)who)->RemoveAurasDueToSpell(36904); @@ -299,10 +301,12 @@ CreatureAI* GetAI_npc_daranelle(Creature *_Creature) ## npc_overseer_nuaar ######*/ +#define GOSSIP_HON "Overseer, I am here to negotiate on behalf of the Cenarion Expedition." + bool GossipHello_npc_overseer_nuaar(Player *player, Creature *_Creature) { if (player->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM( 0, "Overseer, I am here to negotiate on behalf of the Cenarion Expedition.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM( 0, GOSSIP_HON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(10532, _Creature->GetGUID()); @@ -323,10 +327,13 @@ bool GossipSelect_npc_overseer_nuaar(Player *player, Creature *_Creature, uint32 ## npc_saikkal_the_elder ######*/ +#define GOSSIP_HSTE "Yes... yes, it's me." +#define GOSSIP_SSTE "Yes elder. Tell me more of the book." + bool GossipHello_npc_saikkal_the_elder(Player *player, Creature *_Creature) { if (player->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM( 0, "Yes... yes, it's me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM( 0, GOSSIP_HSTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(10794, _Creature->GetGUID()); @@ -338,7 +345,7 @@ bool GossipSelect_npc_saikkal_the_elder(Player *player, Creature *_Creature, uin switch (action) { case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM( 0, "Yes elder. Tell me more of the book.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->ADD_GOSSIP_ITEM( 0, GOSSIP_SSTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); player->SEND_GOSSIP_MENU(10795, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+2: -- cgit v1.2.3 From 2ecd61f028b3bdbce1009eef0a4c47bc5fd4e6d2 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sun, 25 Jan 2009 16:36:24 +0100 Subject: *Fix a typo --HG-- branch : trunk --- sql/updates/970_world_scripts.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sql') diff --git a/sql/updates/970_world_scripts.sql b/sql/updates/970_world_scripts.sql index 0664e079ba0..9e66e60f65d 100644 --- a/sql/updates/970_world_scripts.sql +++ b/sql/updates/970_world_scripts.sql @@ -1,9 +1,9 @@ DELETE FROM script_texts WHERE entry BETWEEN -1000401 AND -1000396; INSERT INTO script_texts (entry, content_default, type, language, comment) VALUES -(-1000396, 'Muahahahaha! You fool! You've released me from my banishment in the interstices between space and time!', 0, 0, 'mobs_nether_drake - SAY_NIHIL_1'), +(-1000396, 'Muahahahaha! You fool! You\'ve released me from my banishment in the interstices between space and time!', 0, 0, 'mobs_nether_drake - SAY_NIHIL_1'), (-1000397, 'All of Draenor shall quick beneath my feet! I will destroy this world and reshape it in my image!', 0, 0, 'mobs_nether_drake - SAY_NIHIL_2'), -(-1000398, 0, 0, 'Where shall I begin? I cannot bother myself with a worm such as yourself. There is a world to be conquered!', 0, 0, 'mobs_nether_Drake - SAY_NIHIL_3'), +(-1000398, 'Where shall I begin? I cannot bother myself with a worm such as yourself. There is a world to be conquered!', 0, 0, 'mobs_nether_Drake - SAY_NIHIL_3'), (-1000399, 'No doubt the fools that banished me are long dead. I shall take wing survey my demense. Pray to whatever gods you hold dear that we do not meet again.', 0, 0, 'mobs_nether_drake - SAY_NIHIL_4'), (-1000400, 'NOOOOooooooo!', 1, 0, 'mobs_nether_drake - SAY_NIHIL_INTERRUPT'), -(-1000401, 'Good $N, you are under the spell's influence. I must analyze it quickly, then we can talk.', 0, 7, 'npc_daranelle - SAY_DARANELLE'); \ No newline at end of file +(-1000401, 'Good $N, you are under the spell\'s influence. I must analyze it quickly, then we can talk.', 0, 7, 'npc_daranelle - SAY_DARANELLE'); -- cgit v1.2.3