From d230302b16474ff22a35243ffed6236ef4fc7fb9 Mon Sep 17 00:00:00 2001 From: Paradox Date: Mon, 9 Feb 2009 08:16:34 -0500 Subject: Replace tabs with spaces in more files. --HG-- branch : trunk --- src/bindings/interface/ScriptMgr.cpp | 2 +- src/bindings/scripts/ScriptMgr.cpp | 106 +- src/bindings/scripts/include/sc_creature.cpp | 18 +- src/bindings/scripts/include/sc_instance.h | 2 +- .../scripts/areatrigger/areatrigger_scripts.cpp | 38 +- src/bindings/scripts/scripts/guard/guard_ai.cpp | 36 +- src/bindings/scripts/scripts/guard/guards.cpp | 2 +- src/bindings/scripts/scripts/item/item_scripts.cpp | 12 +- src/bindings/scripts/scripts/npc/npc_escortAI.cpp | 20 +- src/bindings/scripts/scripts/npc/npcs_special.cpp | 190 +-- .../scripts/zone/ashenvale_forest/ashenvale.cpp | 260 ++-- .../auchenai_crypts/boss_exarch_maladaar.cpp | 34 +- .../boss_shirrak_the_dead_watcher.cpp | 8 +- .../mana_tombs/boss_nexusprince_shaffar.cpp | 6 +- .../sethekk_halls/boss_darkweaver_syth.cpp | 22 +- .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 14 +- .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 138 +- .../scripts/scripts/zone/azshara/azshara.cpp | 40 +- .../scripts/scripts/zone/azshara/boss_azuregos.cpp | 4 +- .../scripts/zone/azuremyst_isle/azuremyst_isle.cpp | 492 +++---- .../scripts/scripts/zone/barrens/the_barrens.cpp | 204 +-- .../scripts/zone/black_temple/boss_bloodboil.cpp | 38 +- .../zone/black_temple/boss_mother_shahraz.cpp | 24 +- .../zone/black_temple/boss_reliquary_of_souls.cpp | 40 +- .../zone/black_temple/boss_shade_of_akama.cpp | 18 +- .../scripts/zone/black_temple/boss_supremus.cpp | 14 +- .../zone/black_temple/boss_teron_gorefiend.cpp | 28 +- .../zone/black_temple/boss_warlord_najentus.cpp | 16 +- .../scripts/zone/black_temple/illidari_council.cpp | 48 +- .../zone/black_temple/instance_black_temple.cpp | 116 +- .../zone/blackrock_depths/blackrock_depths.cpp | 1475 ++++++++++---------- .../blackrock_depths/instance_blackrock_depths.cpp | 468 +++---- .../scripts/zone/blackwing_lair/boss_flamegor.cpp | 2 +- .../caverns_of_time/dark_portal/boss_aeonus.cpp | 52 +- .../dark_portal/boss_chrono_lord_deja.cpp | 46 +- .../caverns_of_time/dark_portal/boss_temporus.cpp | 24 +- .../caverns_of_time/dark_portal/dark_portal.cpp | 496 +++---- .../zone/caverns_of_time/hyjal/boss_archimonde.cpp | 32 +- .../scripts/zone/caverns_of_time/hyjal/hyjal.cpp | 54 +- .../scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp | 58 +- .../scripts/zone/caverns_of_time/hyjal/hyjalAI.h | 56 +- .../zone/caverns_of_time/hyjal/instance_hyjal.cpp | 16 +- .../old_hillsbrad/boss_leutenant_drake.cpp | 12 +- .../old_hillsbrad/instance_old_hillsbrad.cpp | 112 +- .../old_hillsbrad/old_hillsbrad.cpp | 194 +-- .../serpent_shrine/boss_fathomlord_karathress.cpp | 500 +++---- .../serpent_shrine/boss_hydross_the_unstable.cpp | 114 +- .../serpent_shrine/boss_lady_vashj.cpp | 310 ++-- .../serpent_shrine/boss_leotheras_the_blind.cpp | 908 ++++++------ .../serpent_shrine/boss_lurker_below.cpp | 616 ++++---- .../serpent_shrine/boss_morogrim_tidewalker.cpp | 110 +- .../serpent_shrine/instance_serpent_shrine.cpp | 212 +-- .../steam_vault/instance_steam_vault.cpp | 136 +- .../scripts/zone/eversong_woods/eversong_woods.cpp | 326 ++--- .../scripts/scripts/zone/ghostlands/ghostlands.cpp | 228 +-- .../scripts/zone/gruuls_lair/boss_gruul.cpp | 82 +- .../zone/gruuls_lair/boss_high_king_maulgar.cpp | 54 +- .../blood_furnace/boss_kelidan_the_breaker.cpp | 56 +- .../hellfire_ramparts/boss_vazruden_the_herald.cpp | 2 +- .../magtheridons_lair/boss_magtheridon.cpp | 12 +- .../magtheridons_lair/def_magtheridons_lair.h | 6 +- .../instance_magtheridons_lair.cpp | 8 +- .../zone/hellfire_peninsula/hellfire_peninsula.cpp | 266 ++-- .../zone/isle_of_queldanas/isle_of_queldanas.cpp | 74 +- .../scripts/scripts/zone/karazhan/boss_curator.cpp | 6 +- .../zone/karazhan/boss_maiden_of_virtue.cpp | 10 +- .../scripts/zone/karazhan/boss_midnight.cpp | 102 +- .../scripts/scripts/zone/karazhan/boss_moroes.cpp | 38 +- .../scripts/zone/karazhan/boss_nightbane.cpp | 166 +-- .../zone/karazhan/boss_prince_malchezaar.cpp | 24 +- .../scripts/zone/karazhan/boss_shade_of_aran.cpp | 70 +- .../zone/karazhan/boss_terestian_illhoof.cpp | 26 +- .../scripts/scripts/zone/karazhan/bosses_opera.cpp | 170 +-- .../scripts/scripts/zone/karazhan/def_karazhan.h | 4 +- .../scripts/zone/karazhan/instance_karazhan.cpp | 52 +- .../scripts/scripts/zone/karazhan/karazhan.cpp | 88 +- .../magisters_terrace/boss_felblood_kaelthas.cpp | 418 +++--- .../magisters_terrace/boss_priestess_delrissa.cpp | 152 +- .../magisters_terrace/boss_selin_fireheart.cpp | 76 +- .../zone/magisters_terrace/boss_vexallus.cpp | 32 +- .../zone/magisters_terrace/def_magisters_terrace.h | 2 +- .../instance_magisters_terrace.cpp | 76 +- .../scripts/zone/molten_core/boss_baron_geddon.cpp | 8 +- .../scripts/zone/molten_core/boss_golemagg.cpp | 6 +- .../zone/molten_core/boss_majordomo_executus.cpp | 14 +- .../scripts/zone/molten_core/boss_ragnaros.cpp | 12 +- .../zone/molten_core/instance_molten_core.cpp | 78 +- .../scripts/scripts/zone/moonglade/moonglade.cpp | 8 +- .../scripts/scripts/zone/mulgore/mulgore.cpp | 178 +-- .../scripts/zone/naxxramas/boss_anubrekhan.cpp | 24 +- .../scripts/zone/naxxramas/boss_faerlina.cpp | 18 +- .../scripts/zone/naxxramas/boss_kelthuzad.cpp | 28 +- .../scripts/scripts/zone/naxxramas/boss_noth.cpp | 24 +- .../scripts/zone/naxxramas/boss_sapphiron.cpp | 16 +- .../scripts/zone/netherstorm/netherstorm.cpp | 656 ++++----- .../scripts/zone/onyxias_lair/boss_onyxia.cpp | 258 ++-- .../scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp | 4 +- .../scarlet_monastery/boss_headless_horseman.cpp | 1376 +++++++++--------- .../scripts/zone/scarlet_monastery/boss_herod.cpp | 124 +- .../instance_scarlet_monastery.cpp | 132 +- .../shadowfang_keep/instance_shadowfang_keep.cpp | 122 +- .../zone/shadowfang_keep/shadowfang_keep.cpp | 10 +- .../zone/shadowmoon_valley/shadowmoon_valley.cpp | 30 +- .../scripts/zone/shattrath/shattrath_city.cpp | 394 +++--- .../scripts/scripts/zone/silithus/silithus.cpp | 98 +- .../zone/silverpine_forest/silverpine_forest.cpp | 194 +-- .../stonetalon_mountains/stonetalon_mountains.cpp | 160 +-- .../zone/stranglethorn_vale/stranglethorn_vale.cpp | 4 +- .../zone/stratholme/boss_baron_rivendare.cpp | 60 +- .../zone/stratholme/boss_baroness_anastari.cpp | 30 +- .../zone/stratholme/boss_magistrate_barthilas.cpp | 84 +- .../zone/stratholme/boss_maleki_the_pallid.cpp | 22 +- .../scripts/zone/stratholme/boss_nerubenkan.cpp | 22 +- .../zone/stratholme/boss_ramstein_the_gorger.cpp | 28 +- .../zone/stratholme/instance_stratholme.cpp | 634 ++++----- .../scripts/scripts/zone/stratholme/stratholme.cpp | 14 +- .../zone/sunwell_plateau/boss_brutallus.cpp | 60 +- .../zone/sunwell_plateau/boss_eredar_twins.cpp | 22 +- .../scripts/zone/sunwell_plateau/boss_kalecgos.cpp | 14 +- .../zone/sunwell_plateau/def_sunwell_plateau.h | 2 +- .../sunwell_plateau/instance_sunwell_plateau.cpp | 8 +- .../scripts/scripts/zone/tanaris/tanaris.cpp | 74 +- .../zone/tempest_keep/arcatraz/arcatraz.cpp | 18 +- .../arcatraz/boss_harbinger_skyriss.cpp | 34 +- .../tempest_keep/arcatraz/instance_arcatraz.cpp | 28 +- .../botanica/boss_high_botanist_freywinn.cpp | 18 +- .../zone/tempest_keep/botanica/boss_laj.cpp | 2 +- .../tempest_keep/botanica/boss_warp_splinter.cpp | 24 +- .../zone/tempest_keep/the_eye/boss_astromancer.cpp | 32 +- .../zone/tempest_keep/the_eye/boss_kaelthas.cpp | 240 ++-- .../zone/tempest_keep/the_eye/boss_void_reaver.cpp | 18 +- .../zone/tempest_keep/the_eye/def_the_eye.h | 2 +- .../zone/tempest_keep/the_eye/instance_the_eye.cpp | 50 +- .../the_mechanar/boss_gatewatcher_ironhand.cpp | 48 +- .../the_mechanar/boss_nethermancer_sepethrea.cpp | 52 +- .../the_mechanar/boss_pathaleon_the_calculator.cpp | 70 +- .../scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp | 2 +- .../zone/temple_of_ahnqiraj/boss_sartura.cpp | 18 +- .../zone/temple_of_ahnqiraj/boss_skeram.cpp | 36 +- .../zone/terokkar_forest/terokkar_forest.cpp | 234 ++-- .../zone/thousand_needles/thousand_needles.cpp | 4 +- .../zone/tirisfal_glades/tirisfal_glades.cpp | 6 +- .../scripts/zone/uldaman/instance_uldaman.cpp | 6 +- .../scripts/zone/ungoro_crater/ungoro_crater.cpp | 6 +- .../scripts/zone/zangarmarsh/zangarmarsh.cpp | 208 +-- .../scripts/scripts/zone/zulaman/boss_akilzon.cpp | 128 +- .../scripts/scripts/zone/zulaman/boss_halazzi.cpp | 30 +- .../scripts/scripts/zone/zulaman/boss_janalai.cpp | 16 +- .../scripts/zone/zulaman/instance_zulaman.cpp | 10 +- .../scripts/scripts/zone/zulgurub/boss_arlokk.cpp | 24 +- .../scripts/scripts/zone/zulgurub/boss_hakkar.cpp | 22 +- .../scripts/scripts/zone/zulgurub/boss_jeklik.cpp | 20 +- .../scripts/scripts/zone/zulgurub/boss_jindo.cpp | 10 +- .../scripts/zone/zulgurub/boss_mandokir.cpp | 54 +- .../scripts/scripts/zone/zulgurub/boss_marli.cpp | 28 +- .../scripts/scripts/zone/zulgurub/boss_thekal.cpp | 6 +- .../scripts/scripts/zone/zulgurub/boss_venoxis.cpp | 24 +- src/game/BattleGround.h | 2 +- src/game/BattleGroundAV.cpp | 72 +- src/game/CharacterHandler.cpp | 6 +- src/game/Chat.cpp | 66 +- src/game/Chat.h | 52 +- src/game/ConfusedMovementGenerator.h | 6 +- src/game/Creature.cpp | 62 +- src/game/Creature.h | 32 +- src/game/CreatureGroups.cpp | 242 ++-- src/game/CreatureGroups.h | 40 +- src/game/FleeingMovementGenerator.cpp | 2 +- src/game/FleeingMovementGenerator.h | 2 +- src/game/GridNotifiers.h | 4 +- src/game/Group.cpp | 70 +- src/game/Group.h | 52 +- src/game/Guild.cpp | 4 +- src/game/HomeMovementGenerator.cpp | 8 +- src/game/HomeMovementGenerator.h | 2 +- src/game/Language.h | 42 +- src/game/Level0.cpp | 54 +- src/game/Level1.cpp | 484 +++---- src/game/Level2.cpp | 1228 ++++++++-------- src/game/Level3.cpp | 6 +- src/game/Map.cpp | 32 +- src/game/MiscHandler.cpp | 6 +- src/game/MotionMaster.cpp | 22 +- src/game/MotionMaster.h | 4 +- src/game/Object.cpp | 8 +- src/game/ObjectMgr.cpp | 20 +- src/game/ObjectMgr.h | 14 +- src/game/Opcodes.cpp | 4 +- src/game/Player.cpp | 14 +- src/game/PlayerDump.h | 10 +- src/game/RandomMovementGenerator.cpp | 4 +- src/game/RandomMovementGenerator.h | 10 +- src/game/ScriptCalls.cpp | 4 +- src/game/ScriptCalls.h | 2 +- src/game/SharedDefines.h | 12 +- src/game/Spell.cpp | 4 +- src/game/SpellAuras.cpp | 16 +- src/game/SpellEffects.cpp | 16 +- src/game/SpellHandler.cpp | 42 +- src/game/SpellMgr.cpp | 34 +- src/game/TicketHandler.cpp | 182 +-- src/game/TicketMgr.cpp | 250 ++-- src/game/TicketMgr.h | 56 +- src/game/Transports.cpp | 56 +- src/game/Transports.h | 4 +- src/game/Traveller.h | 8 +- src/game/Unit.cpp | 140 +- src/game/Unit.h | 2 +- src/game/WaypointManager.cpp | 58 +- src/game/WaypointManager.h | 16 +- src/game/WaypointMovementGenerator.cpp | 158 +-- src/game/WaypointMovementGenerator.h | 28 +- src/game/World.cpp | 224 +-- src/game/World.h | 12 +- src/game/WorldSession.h | 18 +- src/shared/Common.h | 2 +- src/shared/WheatyExceptionReport.cpp | 6 +- src/shared/vmap/AABSPTree.h | 214 +-- src/shared/vmap/ModelContainer.cpp | 2 +- src/trinitycore/Master.cpp | 2 +- 220 files changed, 10726 insertions(+), 10725 deletions(-) (limited to 'src') diff --git a/src/bindings/interface/ScriptMgr.cpp b/src/bindings/interface/ScriptMgr.cpp index c502f65b99c..276b5fa3a54 100644 --- a/src/bindings/interface/ScriptMgr.cpp +++ b/src/bindings/interface/ScriptMgr.cpp @@ -84,7 +84,7 @@ Script* GetScriptByName(std::string Name) TRINITY_DLL_EXPORT char const* ScriptsVersion() { - return "Default Trinity scripting library"; + return "Default Trinity scripting library"; } TRINITY_DLL_EXPORT bool GossipHello ( Player * player, Creature *_Creature ) diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 34b43b14a92..c41a461e4d1 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -29,7 +29,7 @@ struct StringTextData uint32 SoundId; uint8 Type; uint32 Language; - uint32 Emote; + uint32 Emote; }; // Enums used by StringTextData::Type @@ -677,7 +677,7 @@ void LoadDatabase() temp.SoundId = fields[1].GetInt32(); temp.Type = fields[2].GetInt32(); temp.Language = fields[3].GetInt32(); - temp.Emote = 0;//fields[4].GetInt32(); + temp.Emote = 0;//fields[4].GetInt32(); if (i >= 0) { @@ -742,7 +742,7 @@ void LoadDatabase() temp.SoundId = fields[1].GetInt32(); temp.Type = fields[2].GetInt32(); temp.Language = fields[3].GetInt32(); - temp.Emote = fields[4].GetInt32(); + temp.Emote = fields[4].GetInt32(); if (i >= 0) { @@ -807,7 +807,7 @@ void LoadDatabase() temp.SoundId = fields[1].GetInt32(); temp.Type = fields[2].GetInt32(); temp.Language = fields[3].GetInt32(); - temp.Emote = fields[4].GetInt32(); + temp.Emote = fields[4].GetInt32(); if (i >= 0) { @@ -1211,7 +1211,7 @@ void ScriptsFree() delete []SpellSummary; // Free resources before library unload - for(int i=0;i> Loaded %i C++ Scripts.", num_sc_scripts); + outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts); outstring_log(">> Load Overriden SQL Data."); LoadOverridenSQLData(); @@ -1864,15 +1864,15 @@ void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target) error_log("TSCR: DoScriptText entry %i tried to process invalid sound id %u.",textEntry,(*i).second.SoundId); } - if((*i).second.Emote) - { - if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER) - { - ((Unit*)pSource)->HandleEmoteCommand((*i).second.Emote); - } - else - error_log("TSCR: DoScriptText entry %i tried to process emote for invalid TypeId (%u).",textEntry,pSource->GetTypeId()); - } + if((*i).second.Emote) + { + if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER) + { + ((Unit*)pSource)->HandleEmoteCommand((*i).second.Emote); + } + else + error_log("TSCR: DoScriptText entry %i tried to process emote for invalid TypeId (%u).",textEntry,pSource->GetTypeId()); + } switch((*i).second.Type) { @@ -1923,7 +1923,7 @@ void Script::RegisterSelf() TRINITY_DLL_EXPORT char const* ScriptsVersion() { - return "Default Trinity scripting library"; + return "Default Trinity scripting library"; } TRINITY_DLL_EXPORT bool GossipHello ( Player * player, Creature *_Creature ) diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index 6ffa4261488..6c9a0059b11 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -221,12 +221,12 @@ void ScriptedAI::DoCastSpell(Unit* who,SpellEntry const *spellInfo, bool trigger void ScriptedAI::DoSay(const char* text, uint32 language, Unit* target, bool SayEmote) { - if (target) - { - m_creature->Say(text, language, target->GetGUID()); - if(SayEmote) - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); - } + if (target) + { + m_creature->Say(text, language, target->GetGUID()); + if(SayEmote) + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); + } else m_creature->Say(text, language, 0); } @@ -751,8 +751,8 @@ Unit* FindCreature(uint32 entry, float range, Unit* Finder) if(!Finder) return NULL; Creature* target = NULL; - Trinity::AllCreaturesOfEntryInRange check(Finder, entry, range); - Trinity::CreatureSearcher searcher(target, check); + Trinity::AllCreaturesOfEntryInRange check(Finder, entry, range); + Trinity::CreatureSearcher searcher(target, check); Finder->VisitNearbyObject(range, searcher); return target; } @@ -762,7 +762,7 @@ GameObject* FindGameObject(uint32 entry, float range, Unit* Finder) if(!Finder) return NULL; GameObject* target = NULL; - Trinity::AllGameObjectsWithEntryInGrid go_check(entry); + Trinity::AllGameObjectsWithEntryInGrid go_check(entry); Trinity::GameObjectSearcher searcher(target, go_check); Finder->VisitNearbyGridObject(range, searcher); return target; diff --git a/src/bindings/scripts/include/sc_instance.h b/src/bindings/scripts/include/sc_instance.h index c02b05fa709..59c19bda085 100644 --- a/src/bindings/scripts/include/sc_instance.h +++ b/src/bindings/scripts/include/sc_instance.h @@ -14,7 +14,7 @@ enum EncounterState IN_PROGRESS = 1, FAIL = 2, DONE = 3, - SPECIAL = 4 + SPECIAL = 4 }; #define OUT_SAVE_INST_DATA debug_log("SD2: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) diff --git a/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp b/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp index 18757d05510..9c2684072b6 100644 --- a/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp +++ b/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp @@ -37,23 +37,23 @@ EndContentData */ bool AreaTrigger_at_legion_teleporter(Player *player, AreaTriggerEntry *at) { - if (player->isAlive() && !player->isInCombat()) - { - if (player->GetTeam()== ALLIANCE && player->GetQuestRewardStatus(10589)) - { - player->CastSpell(player,SPELL_TELE_A_TO,false); - return true; - } + if (player->isAlive() && !player->isInCombat()) + { + if (player->GetTeam()== ALLIANCE && player->GetQuestRewardStatus(10589)) + { + player->CastSpell(player,SPELL_TELE_A_TO,false); + return true; + } - if (player->GetTeam()== HORDE && player->GetQuestRewardStatus(10604)) - { - player->CastSpell(player,SPELL_TELE_H_TO,false); - return true; - } + if (player->GetTeam()== HORDE && player->GetQuestRewardStatus(10604)) + { + player->CastSpell(player,SPELL_TELE_H_TO,false); + return true; + } - return false; - } - return false; + return false; + } + return false; } bool ATtest(Player *player, AreaTriggerEntry *at) @@ -66,10 +66,10 @@ void AddSC_areatrigger_scripts() { Script *newscript; - newscript = new Script; - newscript->Name = "at_legion_teleporter"; - newscript->pAreaTrigger = &AreaTrigger_at_legion_teleporter; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "at_legion_teleporter"; + newscript->pAreaTrigger = &AreaTrigger_at_legion_teleporter; + newscript->RegisterSelf(); newscript = new Script; newscript->Name="at_test"; diff --git a/src/bindings/scripts/scripts/guard/guard_ai.cpp b/src/bindings/scripts/scripts/guard/guard_ai.cpp index ed766d24e0e..1a27a87c108 100644 --- a/src/bindings/scripts/scripts/guard/guard_ai.cpp +++ b/src/bindings/scripts/scripts/guard/guard_ai.cpp @@ -36,24 +36,24 @@ void guardAI::Reset() void guardAI::Aggro(Unit *who) { - if (m_creature->GetEntry() == 15184) - { - switch(rand()%3) - { - case 0: - DoSay("Taste blade, mongrel!", LANG_UNIVERSAL,NULL); - break; - case 1: - DoSay("Please tell me that you didn't just do what I think you just did. Please tell me that I'm not going to have to hurt you...", LANG_UNIVERSAL,NULL); - break; - case 2: - DoSay("As if we don't have enough problems, you go and create more!", LANG_UNIVERSAL,NULL); - break; - } - } - - if (SpellEntry const *spell = m_creature->reachWithSpellAttack(who)) - DoCastSpell(who, spell); + if (m_creature->GetEntry() == 15184) + { + switch(rand()%3) + { + case 0: + DoSay("Taste blade, mongrel!", LANG_UNIVERSAL,NULL); + break; + case 1: + DoSay("Please tell me that you didn't just do what I think you just did. Please tell me that I'm not going to have to hurt you...", LANG_UNIVERSAL,NULL); + break; + case 2: + DoSay("As if we don't have enough problems, you go and create more!", LANG_UNIVERSAL,NULL); + break; + } + } + + if (SpellEntry const *spell = m_creature->reachWithSpellAttack(who)) + DoCastSpell(who, spell); } void guardAI::JustDied(Unit *Killer) diff --git a/src/bindings/scripts/scripts/guard/guards.cpp b/src/bindings/scripts/scripts/guard/guards.cpp index 46b455e806f..f4bc70d1b00 100644 --- a/src/bindings/scripts/scripts/guard/guards.cpp +++ b/src/bindings/scripts/scripts/guard/guards.cpp @@ -493,7 +493,7 @@ CreatureAI* GetAI_guard_bluffwatcher(Creature *_Creature) CreatureAI* GetAI_guard_contested(Creature *_Creature) { - return new guardAI (_Creature); + return new guardAI (_Creature); } /******************************************************* * guard_contested end diff --git a/src/bindings/scripts/scripts/item/item_scripts.cpp b/src/bindings/scripts/scripts/item/item_scripts.cpp index 35d0cb5ab62..7fd6e7679c8 100644 --- a/src/bindings/scripts/scripts/item/item_scripts.cpp +++ b/src/bindings/scripts/scripts/item/item_scripts.cpp @@ -41,7 +41,7 @@ item_voodoo_charm Provide proper error message and target(q256 item_vorenthals_presence(i30259) Prevents abuse of this item item_yehkinyas_bramble(i10699) Allow cast spell on vale screecher only and remove corpse if cast sucessful (q3520) item_zezzak_shard(i31463) Quest The eyes of Grillok (q10813). Prevents abuse -item_inoculating_crystal Quest Inoculating. Prevent abuse +item_inoculating_crystal Quest Inoculating. Prevent abuse EndContentData */ #include "precompiled.h" @@ -105,11 +105,11 @@ bool ItemUse_item_attuned_crystal_cores(Player *player, Item* _Item, SpellCastTa { if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT && targets.getUnitTarget()->GetEntry() == 24972 && targets.getUnitTarget()->isDead() && - (player->GetQuestStatus(11524) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11525) == QUEST_STATUS_INCOMPLETE) ) - { - ((Creature*)targets.getUnitTarget())->RemoveCorpse(); - return false; - } + (player->GetQuestStatus(11524) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11525) == QUEST_STATUS_INCOMPLETE) ) + { + ((Creature*)targets.getUnitTarget())->RemoveCorpse(); + return false; + } player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL); return true; diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp index 3d9bafb330a..16064bdd295 100644 --- a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp +++ b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp @@ -40,19 +40,19 @@ void npc_escortAI::AttackStart(Unit *who) { InCombat = true; - if (IsBeingEscorted) - { + if (IsBeingEscorted) + { //Store last position m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z); debug_log("SD2: EscortAI has entered combat and stored last location."); - } + } Aggro(who); } - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MoveChase(who); + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveChase(who); } } @@ -64,7 +64,7 @@ void npc_escortAI::MoveInLineOfSight(Unit *who) if(m_creature->getVictim() || !m_creature->canStartAttack(who)) return; - AttackStart(who); + AttackStart(who); } void npc_escortAI::JustRespawned() @@ -109,7 +109,7 @@ void npc_escortAI::UpdateAI(const uint32 diff) { //Waypoint Updating if (IsBeingEscorted && !InCombat && WaitTimer && !Returning) - { + { if (WaitTimer <= diff) { if (ReconnectWP) @@ -157,11 +157,11 @@ void npc_escortAI::UpdateAI(const uint32 diff) WaitTimer = 0; } }else WaitTimer -= diff; - } + } //Check if player is within range if (IsBeingEscorted && !InCombat && PlayerGUID) - { + { if (PlayerTimer < diff) { Unit* p = Unit::GetUnit(*m_creature, PlayerGUID); @@ -186,7 +186,7 @@ void npc_escortAI::UpdateAI(const uint32 diff) PlayerTimer = 1000; }else PlayerTimer -= diff; - } + } //Check if we have a current target if( m_creature->isAlive() && UpdateVictim()) diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index 432e225caa3..d0131bf4067 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -31,7 +31,7 @@ npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681 npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given -npc_snake_trap_serpents 80% AI for snakes that summoned by Snake Trap +npc_snake_trap_serpents 80% AI for snakes that summoned by Snake Trap EndContentData */ #include "precompiled.h" @@ -132,44 +132,44 @@ bool QuestComplete_npc_chicken_cluck(Player *player, Creature *_Creature, const ## npc_dancing_flames ######*/ -#define SPELL_BRAZIER 45423 -#define SPELL_SEDUCTION 47057 -#define SPELL_FIERY_AURA 45427 +#define SPELL_BRAZIER 45423 +#define SPELL_SEDUCTION 47057 +#define SPELL_FIERY_AURA 45427 struct TRINITY_DLL_DECL npc_dancing_flamesAI : public ScriptedAI { npc_dancing_flamesAI(Creature *c) : ScriptedAI(c) {Reset();} - bool active; - uint32 can_iteract; + bool active; + uint32 can_iteract; void Reset() - { - active = true; - can_iteract = 3500; - DoCast(m_creature,SPELL_BRAZIER,true); - DoCast(m_creature,SPELL_FIERY_AURA,false); - float x, y, z; - m_creature->GetPosition(x,y,z); - m_creature->Relocate(x,y,z + 0.94f); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); - WorldPacket data; //send update position to client - m_creature->BuildHeartBeatMsg(&data); - m_creature->SendMessageToSet(&data,true); - } + { + active = true; + can_iteract = 3500; + DoCast(m_creature,SPELL_BRAZIER,true); + DoCast(m_creature,SPELL_FIERY_AURA,false); + float x, y, z; + m_creature->GetPosition(x,y,z); + m_creature->Relocate(x,y,z + 0.94f); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); + WorldPacket data; //send update position to client + m_creature->BuildHeartBeatMsg(&data); + m_creature->SendMessageToSet(&data,true); + } void UpdateAI(const uint32 diff) - { - if (!active) - { - if(can_iteract <= diff){ - active = true; - can_iteract = 3500; - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); - }else can_iteract -= diff; - } - } + { + if (!active) + { + if(can_iteract <= diff){ + active = true; + can_iteract = 3500; + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); + }else can_iteract -= diff; + } + } void Aggro(Unit* who){} }; @@ -181,30 +181,30 @@ CreatureAI* GetAI_npc_dancing_flames(Creature *_Creature) bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *flame, uint32 emote ) { - if ( ((npc_dancing_flamesAI*)flame->AI())->active && - flame->IsWithinLOS(player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()) && flame->IsWithinDistInMap(player,30.0f)) - { - flame->SetInFront(player); - ((npc_dancing_flamesAI*)flame->AI())->active = false; - - WorldPacket data; - flame->BuildHeartBeatMsg(&data); - flame->SendMessageToSet(&data,true); - switch(emote) - { - case TEXTEMOTE_KISS: flame->HandleEmoteCommand(EMOTE_ONESHOT_SHY); break; - case TEXTEMOTE_WAVE: flame->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; - case TEXTEMOTE_BOW: flame->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break; - case TEXTEMOTE_JOKE: flame->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); break; - case TEXTEMOTE_DANCE: - { - if (!player->HasAura(SPELL_SEDUCTION,0)) - flame->CastSpell(player,SPELL_SEDUCTION,true); - } - break; - } - } - return true; + if ( ((npc_dancing_flamesAI*)flame->AI())->active && + flame->IsWithinLOS(player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()) && flame->IsWithinDistInMap(player,30.0f)) + { + flame->SetInFront(player); + ((npc_dancing_flamesAI*)flame->AI())->active = false; + + WorldPacket data; + flame->BuildHeartBeatMsg(&data); + flame->SendMessageToSet(&data,true); + switch(emote) + { + case TEXTEMOTE_KISS: flame->HandleEmoteCommand(EMOTE_ONESHOT_SHY); break; + case TEXTEMOTE_WAVE: flame->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; + case TEXTEMOTE_BOW: flame->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break; + case TEXTEMOTE_JOKE: flame->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); break; + case TEXTEMOTE_DANCE: + { + if (!player->HasAura(SPELL_SEDUCTION,0)) + flame->CastSpell(player,SPELL_SEDUCTION,true); + } + break; + } + } + return true; } /*###### @@ -964,22 +964,22 @@ CreatureAI* GetAI_npc_tonk_mine(Creature *_Creature) bool ReceiveEmote_npc_winter_reveler( Player *player, Creature *_Creature, uint32 emote ) { - //TODO: check auralist. - if(player->HasAura(26218, 0)) - return false; - - if( emote == TEXTEMOTE_KISS ) - { - _Creature->CastSpell(_Creature, 26218, false); - player->CastSpell(player, 26218, false); - switch(rand()%3) - { - case 0: _Creature->CastSpell(player, 26207, false); break; - case 1: _Creature->CastSpell(player, 26206, false); break; - case 2: _Creature->CastSpell(player, 45036, false); break; - } - } - return true; + //TODO: check auralist. + if(player->HasAura(26218, 0)) + return false; + + if( emote == TEXTEMOTE_KISS ) + { + _Creature->CastSpell(_Creature, 26218, false); + player->CastSpell(player, 26218, false); + switch(rand()%3) + { + case 0: _Creature->CastSpell(player, 26207, false); break; + case 1: _Creature->CastSpell(player, 26206, false); break; + case 2: _Creature->CastSpell(player, 45036, false); break; + } + } + return true; } /*#### @@ -988,10 +988,10 @@ bool ReceiveEmote_npc_winter_reveler( Player *player, Creature *_Creature, uint3 bool ReceiveEmote_npc_brewfest_reveler( Player *player, Creature *_Creature, uint32 emote ) { - if( emote == TEXTEMOTE_DANCE ) - _Creature->CastSpell(player, 41586, false); + if( emote == TEXTEMOTE_DANCE ) + _Creature->CastSpell(player, 41586, false); - return true; + return true; } /*#### @@ -1021,12 +1021,12 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI void Reset() { - Owner = m_creature->GetOwner(); + Owner = m_creature->GetOwner(); - if (!m_creature->isPet() || !Owner) - return; + if (!m_creature->isPet() || !Owner) + return; - CreatureInfo const *Info = m_creature->GetCreatureInfo(); + CreatureInfo const *Info = m_creature->GetCreatureInfo(); if(Info->Entry == C_VIPER) IsViper = true; @@ -1044,13 +1044,13 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI InCombat = false; - } + } //Redefined for random target selection: void MoveInLineOfSight(Unit *who) { if (!m_creature->isPet() || !Owner) - return; + return; if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) && Owner->IsHostileTo(who))//don't attack not-pvp-flaged { @@ -1060,21 +1060,21 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI float attackRadius = m_creature->GetAttackDistance(who); if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) ) { - if (!(rand() % RAND) ) + if (!(rand() % RAND) ) { m_creature->setAttackTimer(BASE_ATTACK, (rand() % 10) * 100); SpellTimer = (rand() % 10) * 100; AttackStart(who); InCombat = true; - } - } - } - } + } + } + } + } void UpdateAI(const uint32 diff) { if (!m_creature->isPet() || !Owner) - return; + return; //Follow if not in combat if (!m_creature->hasUnitState(UNIT_STAT_FOLLOW)&& !InCombat) @@ -1087,19 +1087,19 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI if (!m_creature->getVictim()) { if (InCombat) - DoStopAttack(); + DoStopAttack(); - InCombat = false; + InCombat = false; - if(Owner->getAttackerForHelper()) - AttackStart(Owner->getAttackerForHelper()); + if(Owner->getAttackerForHelper()) + AttackStart(Owner->getAttackerForHelper()); return; } if (SpellTimer < diff) { - if (IsViper) //Viper + if (IsViper) //Viper { if (rand() % 3 == 0) //33% chance to cast { @@ -1112,7 +1112,7 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI DoCast(m_creature->getVictim(),spell); } - SpellTimer = VIPER_TIMER; + SpellTimer = VIPER_TIMER; } else //Venomous Snake { @@ -1121,7 +1121,7 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI SpellTimer = VENOMOUS_SNAKE_TIMER + (rand() %5)*100; } }else SpellTimer-=diff; - DoMeleeAttackIfReady(); + DoMeleeAttackIfReady(); } }; @@ -1144,7 +1144,7 @@ void AddSC_npcs_special() newscript = new Script; newscript->Name="npc_dancing_flames"; - newscript->GetAI = &GetAI_npc_dancing_flames; + newscript->GetAI = &GetAI_npc_dancing_flames; newscript->pReceiveEmote = &ReceiveEmote_npc_dancing_flames; newscript->RegisterSelf(); @@ -1192,12 +1192,12 @@ void AddSC_npcs_special() newscript->GetAI = &GetAI_npc_tonk_mine; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="npc_winter_reveler"; newscript->pReceiveEmote = &ReceiveEmote_npc_winter_reveler; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="npc_brewfest_reveler"; newscript->pReceiveEmote = &ReceiveEmote_npc_brewfest_reveler; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp index c684eeaf97d..5af8088a0b6 100644 --- a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp +++ b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp @@ -51,133 +51,133 @@ EndContentData */ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI { - npc_torekAI(Creature *c) : npc_escortAI(c) {Reset();} - - uint32 Rend_Timer; - uint32 Thunderclap_Timer; - bool Completed; - - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - if (!player) - return; - - switch (i) - { - case 1: - DoScriptText(SAY_MOVE, m_creature, player); - break; - case 8: - DoScriptText(SAY_PREPARE, m_creature, player); - break; - case 19: - //TODO: verify location and creatures amount. - m_creature->SummonCreature(ENTRY_DURIEL,1776.73,-2049.06,109.83,1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); - m_creature->SummonCreature(ENTRY_SILVERWING_SENTINEL,1774.64,-2049.41,109.83,1.40,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); - m_creature->SummonCreature(ENTRY_SILVERWING_WARRIOR,1778.73,-2049.50,109.83,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); - break; - case 20: - DoScriptText(SAY_WIN, m_creature, player); - Completed = true; - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature); - break; - case 21: - DoScriptText(SAY_END, m_creature, player); - break; - } - } - - void Reset() - { - Rend_Timer = 5000; - Thunderclap_Timer = 8000; - Completed = false; - } - - void Aggro(Unit* who) - { - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID && !Completed) - { - if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID)) - ((Player*)player)->FailQuest(QUEST_TOREK_ASSULT); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (Rend_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_REND); - Rend_Timer = 20000; - }else Rend_Timer -= diff; - - if (Thunderclap_Timer < diff) - { - DoCast(m_creature,SPELL_THUNDERCLAP); - Thunderclap_Timer = 30000; - }else Thunderclap_Timer -= diff; - } + npc_torekAI(Creature *c) : npc_escortAI(c) {Reset();} + + uint32 Rend_Timer; + uint32 Thunderclap_Timer; + bool Completed; + + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if (!player) + return; + + switch (i) + { + case 1: + DoScriptText(SAY_MOVE, m_creature, player); + break; + case 8: + DoScriptText(SAY_PREPARE, m_creature, player); + break; + case 19: + //TODO: verify location and creatures amount. + m_creature->SummonCreature(ENTRY_DURIEL,1776.73,-2049.06,109.83,1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); + m_creature->SummonCreature(ENTRY_SILVERWING_SENTINEL,1774.64,-2049.41,109.83,1.40,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); + m_creature->SummonCreature(ENTRY_SILVERWING_WARRIOR,1778.73,-2049.50,109.83,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); + break; + case 20: + DoScriptText(SAY_WIN, m_creature, player); + Completed = true; + if (player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature); + break; + case 21: + DoScriptText(SAY_END, m_creature, player); + break; + } + } + + void Reset() + { + Rend_Timer = 5000; + Thunderclap_Timer = 8000; + Completed = false; + } + + void Aggro(Unit* who) + { + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID && !Completed) + { + if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID)) + ((Player*)player)->FailQuest(QUEST_TOREK_ASSULT); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (Rend_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_REND); + Rend_Timer = 20000; + }else Rend_Timer -= diff; + + if (Thunderclap_Timer < diff) + { + DoCast(m_creature,SPELL_THUNDERCLAP); + Thunderclap_Timer = 30000; + }else Thunderclap_Timer -= diff; + } }; bool QuestAccept_npc_torek(Player* player, Creature* creature, Quest const* quest) { - if (quest->GetQuestId() == QUEST_TOREK_ASSULT) - { - //TODO: find companions, make them follow Torek, at any time (possibly done by mangos/database in future?) - ((npc_escortAI*)(creature->AI()))->Start(true, true, true, player->GetGUID()); - DoScriptText(SAY_READY, creature, player); - creature->setFaction(113); - } - - return true; + if (quest->GetQuestId() == QUEST_TOREK_ASSULT) + { + //TODO: find companions, make them follow Torek, at any time (possibly done by mangos/database in future?) + ((npc_escortAI*)(creature->AI()))->Start(true, true, true, player->GetGUID()); + DoScriptText(SAY_READY, creature, player); + creature->setFaction(113); + } + + return true; } CreatureAI* GetAI_npc_torek(Creature *_Creature) { - npc_torekAI* thisAI = new npc_torekAI(_Creature); - - thisAI->AddWaypoint(0, 1782.63, -2241.11, 109.73, 5000); - thisAI->AddWaypoint(1, 1788.88, -2240.17, 111.71); - thisAI->AddWaypoint(2, 1797.49, -2238.11, 112.31); - thisAI->AddWaypoint(3, 1803.83, -2232.77, 111.22); - thisAI->AddWaypoint(4, 1806.65, -2217.83, 107.36); - thisAI->AddWaypoint(5, 1811.81, -2208.01, 107.45); - thisAI->AddWaypoint(6, 1820.85, -2190.82, 100.49); - thisAI->AddWaypoint(7, 1829.60, -2177.49, 96.44); - thisAI->AddWaypoint(8, 1837.98, -2164.19, 96.71); //prepare - thisAI->AddWaypoint(9, 1839.99, -2149.29, 96.78); - thisAI->AddWaypoint(10, 1835.14, -2134.98, 96.80); - thisAI->AddWaypoint(11, 1823.57, -2118.27, 97.43); - thisAI->AddWaypoint(12, 1814.99, -2110.35, 98.38); - thisAI->AddWaypoint(13, 1806.60, -2103.09, 99.19); - thisAI->AddWaypoint(14, 1798.27, -2095.77, 100.04); - thisAI->AddWaypoint(15, 1783.59, -2079.92, 100.81); - thisAI->AddWaypoint(16, 1776.79, -2069.48, 101.77); - thisAI->AddWaypoint(17, 1776.82, -2054.59, 109.82); - thisAI->AddWaypoint(18, 1776.88, -2047.56, 109.83); - thisAI->AddWaypoint(19, 1776.86, -2036.55, 109.83); - thisAI->AddWaypoint(20, 1776.90, -2024.56, 109.83); //win - thisAI->AddWaypoint(21, 1776.87, -2028.31, 109.83,60000);//stay - thisAI->AddWaypoint(22, 1776.90, -2028.30, 109.83); - - return (CreatureAI*)thisAI; + npc_torekAI* thisAI = new npc_torekAI(_Creature); + + thisAI->AddWaypoint(0, 1782.63, -2241.11, 109.73, 5000); + thisAI->AddWaypoint(1, 1788.88, -2240.17, 111.71); + thisAI->AddWaypoint(2, 1797.49, -2238.11, 112.31); + thisAI->AddWaypoint(3, 1803.83, -2232.77, 111.22); + thisAI->AddWaypoint(4, 1806.65, -2217.83, 107.36); + thisAI->AddWaypoint(5, 1811.81, -2208.01, 107.45); + thisAI->AddWaypoint(6, 1820.85, -2190.82, 100.49); + thisAI->AddWaypoint(7, 1829.60, -2177.49, 96.44); + thisAI->AddWaypoint(8, 1837.98, -2164.19, 96.71); //prepare + thisAI->AddWaypoint(9, 1839.99, -2149.29, 96.78); + thisAI->AddWaypoint(10, 1835.14, -2134.98, 96.80); + thisAI->AddWaypoint(11, 1823.57, -2118.27, 97.43); + thisAI->AddWaypoint(12, 1814.99, -2110.35, 98.38); + thisAI->AddWaypoint(13, 1806.60, -2103.09, 99.19); + thisAI->AddWaypoint(14, 1798.27, -2095.77, 100.04); + thisAI->AddWaypoint(15, 1783.59, -2079.92, 100.81); + thisAI->AddWaypoint(16, 1776.79, -2069.48, 101.77); + thisAI->AddWaypoint(17, 1776.82, -2054.59, 109.82); + thisAI->AddWaypoint(18, 1776.88, -2047.56, 109.83); + thisAI->AddWaypoint(19, 1776.86, -2036.55, 109.83); + thisAI->AddWaypoint(20, 1776.90, -2024.56, 109.83); //win + thisAI->AddWaypoint(21, 1776.87, -2028.31, 109.83,60000);//stay + thisAI->AddWaypoint(22, 1776.90, -2028.30, 109.83); + + return (CreatureAI*)thisAI; } /*#### @@ -237,10 +237,10 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI Cage->SetGoState(1); } - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } void JustDied(Unit* killer) { @@ -300,15 +300,15 @@ CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature *_Creature) void AddSC_ashenvale() { - Script *newscript; + Script *newscript; - newscript = new Script; - newscript->Name = "npc_torek"; - newscript->GetAI = &GetAI_npc_torek; - newscript->pQuestAccept = &QuestAccept_npc_torek; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_torek"; + newscript->GetAI = &GetAI_npc_torek; + newscript->pQuestAccept = &QuestAccept_npc_torek; + newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name = "npc_ruul_snowhoof"; newscript->GetAI = &GetAI_npc_ruul_snowhoofAI; newscript->pQuestAccept = &QuestAccept_npc_ruul_snowhoof; diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp index c0ceb9fd35f..fd880dca50c 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp @@ -143,11 +143,11 @@ CreatureAI* GetAI_mob_stolen_soul(Creature *_Creature) struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI { - boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) - { - HasTaunted = false; - Reset(); - } + boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) + { + HasTaunted = false; + Reset(); + } uint32 soulmodel; uint64 soulholder; @@ -175,14 +175,14 @@ struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } + if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } - ScriptedAI::MoveInLineOfSight(who); - } + ScriptedAI::MoveInLineOfSight(who); + } void Aggro(Unit *who) @@ -201,15 +201,15 @@ struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI { //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); - summoned->SetDisplayId(soulmodel); - summoned->setFaction(m_creature->getFaction()); + summoned->SetDisplayId(soulmodel); + summoned->setFaction(m_creature->getFaction()); if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) - { + { ((mob_stolen_soulAI*)summoned->AI())->SetMyClass(soulclass); - summoned->AI()->AttackStart(target); - } + summoned->AI()->AttackStart(target); + } } } diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp index 2db0ee3adc4..8802cbf5e4e 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp @@ -79,7 +79,7 @@ struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI void UpdateAI(const uint32 diff) { - //Inhibitmagic_Timer + //Inhibitmagic_Timer if (Inhibitmagic_Timer < diff) { float dist; @@ -110,7 +110,7 @@ struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI { DoCast(m_creature,SPELL_ATTRACTMAGIC); Attractmagic_Timer = 30000; - Carnivorousbite_Timer = 1500; + Carnivorousbite_Timer = 1500; }else Attractmagic_Timer -= diff; //Carnivorousbite_Timer @@ -133,11 +133,11 @@ struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI // Emote std::string *emote = new std::string("focuses on "); emote->append(target->GetName()); - emote->append("!"); + emote->append("!"); DoTextEmote(emote->c_str(),NULL,true); delete emote; } - FocusFire_Timer = 15000+(rand()%5000); + FocusFire_Timer = 15000+(rand()%5000); }else FocusFire_Timer -= diff; DoMeleeAttackIfReady(); 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 2f720d03db8..e6d5897f57b 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 @@ -205,7 +205,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI { HeroicMode = m_creature->GetMap()->IsHeroic(); Reset(); - CanEvade = false; + CanEvade = false; } bool HeroicMode; @@ -241,10 +241,10 @@ 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, m_creature); + Unit *shaffar = FindCreature(ENTRY_SHAFFAR, 100, m_creature); if(!shaffar || shaffar->isDead()) { - m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetVisibility(VISIBILITY_OFF); m_creature->SetLootRecipient(NULL); m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp index f7dfcb3ed0c..1b03590e7d9 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp @@ -55,7 +55,7 @@ struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI { boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) - { + { HeroicMode = m_creature->GetMap()->IsHeroic(); Reset(); } @@ -69,7 +69,7 @@ struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI bool summon90; bool summon50; bool summon10; - bool HeroicMode; + bool HeroicMode; void Reset() { @@ -208,14 +208,14 @@ struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI { mob_syth_fireAI(Creature *c) : ScriptedAI(c) - { + { HeroicMode = m_creature->GetMap()->IsHeroic(); Reset(); } uint32 flameshock_timer; uint32 flamebuffet_timer; - bool HeroicMode; + bool HeroicMode; void Reset() { @@ -260,14 +260,14 @@ struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI { mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); + { + HeroicMode = m_creature->GetMap()->IsHeroic(); Reset(); } uint32 arcaneshock_timer; uint32 arcanebuffet_timer; - bool HeroicMode; + bool HeroicMode; void Reset() { @@ -312,14 +312,14 @@ struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI { mob_syth_frostAI(Creature *c) : ScriptedAI(c) - { + { HeroicMode = m_creature->GetMap()->IsHeroic(); Reset(); } uint32 frostshock_timer; uint32 frostbuffet_timer; - bool HeroicMode; + bool HeroicMode; void Reset() { @@ -364,14 +364,14 @@ struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI { mob_syth_shadowAI(Creature *c) : ScriptedAI(c) - { + { HeroicMode = m_creature->GetMap()->IsHeroic(); Reset(); } uint32 shadowshock_timer; uint32 shadowbuffet_timer; - bool HeroicMode; + bool HeroicMode; void Reset() { diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp index f93f670d6bc..2e28b2a7661 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp @@ -47,7 +47,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI boss_ambassador_hellmawAI(Creature *c) : ScriptedAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); - HeroicMode = m_creature->GetMap()->IsHeroic(); + HeroicMode = m_creature->GetMap()->IsHeroic(); Reset(); } @@ -88,13 +88,13 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI } } - void MoveInLineOfSight(Unit *who) - { - if (m_creature->HasAura(SPELL_BANISH,0)) - return; + void MoveInLineOfSight(Unit *who) + { + if (m_creature->HasAura(SPELL_BANISH,0)) + return; - ScriptedAI::MoveInLineOfSight(who); - } + ScriptedAI::MoveInLineOfSight(who); + } void MovementInform(uint32 type, uint32 id) { diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp index 155f1c0e443..f94254f277d 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -41,18 +41,18 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance instance_shadow_labyrinth(Map *map) : ScriptedInstance(map) {Initialize();}; uint32 Encounter[ENCOUNTERS]; - std::string str_data; + std::string str_data; uint64 RefectoryDoorGUID; - uint64 ScreamingHallDoorGUID; + uint64 ScreamingHallDoorGUID; uint64 GrandmasterVorpil; uint32 FelOverseerCount; void Initialize() { - RefectoryDoorGUID = 0; - ScreamingHallDoorGUID = 0; + RefectoryDoorGUID = 0; + ScreamingHallDoorGUID = 0; GrandmasterVorpil = 0; FelOverseerCount = 0; @@ -73,8 +73,8 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance { switch(go->GetEntry()) { - case REFECTORY_DOOR: RefectoryDoorGUID = go->GetGUID(); break; - case SCREAMING_HALL_DOOR: ScreamingHallDoorGUID = go->GetGUID(); break; + case REFECTORY_DOOR: RefectoryDoorGUID = go->GetGUID(); break; + case SCREAMING_HALL_DOOR: ScreamingHallDoorGUID = go->GetGUID(); break; } } @@ -92,36 +92,36 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance } } - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("SD2: Instance Shadow Labyrinth: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void HandleGameObject(uint64 guid, uint32 state) - { - Player *player = GetPlayerInMap(); - - if (!player || !guid) - { - debug_log("SD2: Shadow Labyrinth: HandleGameObject fail"); - return; - } - - if (GameObject *go = GameObject::GetGameObject(*player,guid)) - go->SetGoState(state); - } + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("SD2: Instance Shadow Labyrinth: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void HandleGameObject(uint64 guid, uint32 state) + { + Player *player = GetPlayerInMap(); + + if (!player || !guid) + { + debug_log("SD2: Shadow Labyrinth: HandleGameObject fail"); + return; + } + + if (GameObject *go = GameObject::GetGameObject(*player,guid)) + go->SetGoState(state); + } void SetData(uint32 type, uint32 data) { @@ -149,7 +149,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance case DATA_BLACKHEARTTHEINCITEREVENT: if( data == DONE ) { - HandleGameObject(RefectoryDoorGUID,0); + HandleGameObject(RefectoryDoorGUID,0); } Encounter[2] = data; break; @@ -157,7 +157,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance case DATA_GRANDMASTERVORPILEVENT: if( data == DONE ) { - HandleGameObject(ScreamingHallDoorGUID,0); + HandleGameObject(ScreamingHallDoorGUID,0); } Encounter[3] = data; break; @@ -167,22 +167,22 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance break; } - if (data == DONE) - { - if (type == TYPE_OVERSEER && FelOverseerCount != 0) - return; + if (data == DONE) + { + if (type == TYPE_OVERSEER && FelOverseerCount != 0) + return; - OUT_SAVE_INST_DATA; + OUT_SAVE_INST_DATA; - std::ostringstream saveStream; - saveStream << Encounter[0] << " " << Encounter[1] << " " - << Encounter[2] << " " << Encounter[3] << " " << Encounter[4]; + std::ostringstream saveStream; + saveStream << Encounter[0] << " " << Encounter[1] << " " + << Encounter[2] << " " << Encounter[3] << " " << Encounter[4]; - str_data = saveStream.str(); + str_data = saveStream.str(); - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } } uint32 GetData(uint32 type) @@ -205,30 +205,30 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance return 0; } - const char* Save() - { - return str_data.c_str(); - } + const char* Save() + { + return str_data.c_str(); + } - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } - OUT_LOAD_INST_DATA(in); + OUT_LOAD_INST_DATA(in); - std::istringstream loadStream(in); - loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3] >> Encounter[4]; + std::istringstream loadStream(in); + loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3] >> Encounter[4]; - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if (Encounter[i] == IN_PROGRESS) - Encounter[i] = NOT_STARTED; + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if (Encounter[i] == IN_PROGRESS) + Encounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } + OUT_LOAD_INST_DATA_COMPLETE; + } }; InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* map) diff --git a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp index 6f31b7d0f67..adcb8fbf005 100644 --- a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp +++ b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp @@ -251,7 +251,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI bool Must_Die; bool Escape; bool ContinueWP; - bool Reached; + bool Reached; void Reset() { @@ -267,7 +267,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI Must_Die = false; Escape = false; ContinueWP = false; - Reached = false; + Reached = false; } void Despawn() @@ -306,8 +306,8 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI m_creature->AI_SendMoveToPacket(3706.39, -3969.15, 35.9118, 0, 0, 0); } //begin swimming and summon depth charges - Player* player = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID)); - SendText(MSG_ESCAPE_NOTICE, player); + Player* player = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID)); + SendText(MSG_ESCAPE_NOTICE, player); DoCast(m_creature, SPELL_PERIODIC_DEPTH_CHARGE); m_creature->SetUnitMovementFlags(MOVEMENTFLAG_FLYING2 | MOVEMENTFLAG_SWIMMING); m_creature->SetSpeed(MOVE_RUN, 0.85f, true); @@ -336,7 +336,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI Grenade_Timer = 30000; } else Grenade_Timer -= diff; - if(Check_Timer < diff) + if(Check_Timer < diff) { Player *player = (Player *)Unit::GetUnit((*m_creature), PlayerGUID); if(!player) @@ -345,16 +345,16 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI return; } float dist = m_creature->GetDistance(player); - if(dist < 10 && m_creature->GetPositionX() > player->GetPositionX() && !Reached) + if(dist < 10 && m_creature->GetPositionX() > player->GetPositionX() && !Reached) { DoScriptText(SAY_RIZZLE_FINAL, m_creature); m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 1); - m_creature->setFaction(35); + m_creature->setFaction(35); m_creature->StopMoving(); m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->Clear(true); + m_creature->GetMotionMaster()->Clear(true); m_creature->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE); - Reached = true; + Reached = true; } Check_Timer = 1000; @@ -362,13 +362,13 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI } - void SendText(const char *text, Player* player) - { - WorldPacket data(SMSG_SERVER_MESSAGE, 0); // guess size - data << text; - if(player) - player->GetSession()->SendPacket(&data); - } + void SendText(const char *text, Player* player) + { + WorldPacket data(SMSG_SERVER_MESSAGE, 0); // guess size + data << text; + if(player) + player->GetSession()->SendPacket(&data); + } void AttackStart(Unit *who) { @@ -443,7 +443,7 @@ struct TRINITY_DLL_DECL mob_depth_chargeAI : public ScriptedAI void Reset() { m_creature->SetUnitMovementFlags(MOVEMENTFLAG_FLYING2 | MOVEMENTFLAG_SWIMMING); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); we_must_die = false; must_die_timer = 1000; } @@ -478,9 +478,9 @@ struct TRINITY_DLL_DECL mob_depth_chargeAI : public ScriptedAI } void Aggro(Unit* who) - { + { return; - } + } }; CreatureAI* GetAI_mob_depth_charge(Creature *_Creature) @@ -503,7 +503,7 @@ void AddSC_azshara() newscript->pGossipSelect = &GossipSelect_npc_loramus_thalipedes; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="mob_rizzle_sprysprocket"; newscript->GetAI = &GetAI_mob_rizzle_sprysprocket; newscript->pGossipHello = &GossipHello_mob_rizzle_sprysprocket; diff --git a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp b/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp index 4ff46437e35..9b58b553d0a 100644 --- a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp +++ b/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp @@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL boss_azuregosAI : public ScriptedAI if(Teleport_Timer < diff) { - DoScriptText(SAY_TELEPORT, m_creature); + DoScriptText(SAY_TELEPORT, m_creature); std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); std::list::iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i!= m_threatlist.end();++i) @@ -110,7 +110,7 @@ struct TRINITY_DLL_DECL boss_azuregosAI : public ScriptedAI //ManaStorm_Timer if (ManaStorm_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) DoCast(target,SPELL_MANASTORM); ManaStorm_Timer = 7500 + rand()%5000; }else ManaStorm_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp index 94616ed555a..d1acc9373c4 100644 --- a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp +++ b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp @@ -326,110 +326,110 @@ CreatureAI* GetAI_npc_injured_draenei(Creature *_Creature) struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI { - npc_magwinAI(Creature *c) : npc_escortAI(c) {Reset();} - - - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - if (!player) - return; - - switch(i) - { - case 0: - DoScriptText(SAY_START, m_creature, player); - break; - case 17: - DoScriptText(SAY_PROGRESS, m_creature, player); - break; - case 28: - DoScriptText(SAY_END1, m_creature, player); - break; - case 29: - DoScriptText(EMOTE_HUG, m_creature, player); - DoScriptText(SAY_END2, m_creature, player); - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_A_CRY_FOR_HELP,m_creature); - break; - } - } - - void Aggro(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature, who); - } - - void Reset() - { - if (!IsBeingEscorted) - m_creature->setFaction(80); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (player) - ((Player*)player)->FailQuest(QUEST_A_CRY_FOR_HELP); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + npc_magwinAI(Creature *c) : npc_escortAI(c) {Reset();} + + + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if (!player) + return; + + switch(i) + { + case 0: + DoScriptText(SAY_START, m_creature, player); + break; + case 17: + DoScriptText(SAY_PROGRESS, m_creature, player); + break; + case 28: + DoScriptText(SAY_END1, m_creature, player); + break; + case 29: + DoScriptText(EMOTE_HUG, m_creature, player); + DoScriptText(SAY_END2, m_creature, player); + if (player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->GroupEventHappens(QUEST_A_CRY_FOR_HELP,m_creature); + break; + } + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature, who); + } + + void Reset() + { + if (!IsBeingEscorted) + m_creature->setFaction(80); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player) + ((Player*)player)->FailQuest(QUEST_A_CRY_FOR_HELP); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; bool QuestAccept_npc_magwin(Player* player, Creature* creature, Quest const* quest) { - if (quest->GetQuestId() == QUEST_A_CRY_FOR_HELP) - { - creature->setFaction(113); - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - } - return true; + if (quest->GetQuestId() == QUEST_A_CRY_FOR_HELP) + { + creature->setFaction(113); + ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + } + return true; } CreatureAI* GetAI_npc_magwinAI(Creature *_Creature) { - npc_magwinAI* magwinAI = new npc_magwinAI(_Creature); - - magwinAI->AddWaypoint(0, -4784.532227, -11051.060547, 3.484263); - magwinAI->AddWaypoint(1, -4805.509277, -11037.293945, 3.043942); - magwinAI->AddWaypoint(2, -4827.826172, -11034.398438, 1.741959); - magwinAI->AddWaypoint(3, -4852.630859, -11033.695313, 2.208656); - magwinAI->AddWaypoint(4, -4876.791992, -11034.517578, 3.175228); - magwinAI->AddWaypoint(5, -4895.486816, -11038.306641, 9.390890); - magwinAI->AddWaypoint(6, -4915.464844, -11048.402344, 12.369793); - magwinAI->AddWaypoint(7, -4937.288086, -11067.041992, 13.857983); - magwinAI->AddWaypoint(8, -4966.577637, -11067.507813, 15.754786); - magwinAI->AddWaypoint(9, -4993.799805, -11056.544922, 19.175295); - magwinAI->AddWaypoint(10, -5017.836426, -11052.569336, 22.476587); - magwinAI->AddWaypoint(11, -5039.706543, -11058.459961, 25.831593); - magwinAI->AddWaypoint(12, -5057.289063, -11045.474609, 26.972496); - magwinAI->AddWaypoint(13, -5078.828125, -11037.601563, 29.053417); - magwinAI->AddWaypoint(14, -5104.158691, -11039.195313, 29.440195); - magwinAI->AddWaypoint(15, -5120.780273, -11039.518555, 30.142139); - magwinAI->AddWaypoint(16, -5140.833008, -11039.810547, 28.788074); - magwinAI->AddWaypoint(17, -5161.201660, -11040.050781, 27.879545, 4000); - magwinAI->AddWaypoint(18, -5171.842285, -11046.803711, 27.183821); - magwinAI->AddWaypoint(19, -5185.995117, -11056.359375, 20.234867); - magwinAI->AddWaypoint(20, -5198.485840, -11065.065430, 18.872593); - magwinAI->AddWaypoint(21, -5214.062500, -11074.653320, 19.215731); - magwinAI->AddWaypoint(22, -5220.157227, -11088.377930, 19.818476); - magwinAI->AddWaypoint(23, -5233.652832, -11098.846680, 18.349432); - magwinAI->AddWaypoint(24, -5250.163086, -11111.653320, 16.438959); - magwinAI->AddWaypoint(25, -5268.194336, -11125.639648, 12.668313); - magwinAI->AddWaypoint(26, -5286.270508, -11130.669922, 6.912246); - magwinAI->AddWaypoint(27, -5317.449707, -11137.392578, 4.963446); - magwinAI->AddWaypoint(28, -5334.854492, -11154.384766, 6.742664); - magwinAI->AddWaypoint(29, -5353.874512, -11171.595703, 6.903912, 20000); - magwinAI->AddWaypoint(30, -5354.240000, -11171.940000, 6.890000); - - return (CreatureAI*)magwinAI; + npc_magwinAI* magwinAI = new npc_magwinAI(_Creature); + + magwinAI->AddWaypoint(0, -4784.532227, -11051.060547, 3.484263); + magwinAI->AddWaypoint(1, -4805.509277, -11037.293945, 3.043942); + magwinAI->AddWaypoint(2, -4827.826172, -11034.398438, 1.741959); + magwinAI->AddWaypoint(3, -4852.630859, -11033.695313, 2.208656); + magwinAI->AddWaypoint(4, -4876.791992, -11034.517578, 3.175228); + magwinAI->AddWaypoint(5, -4895.486816, -11038.306641, 9.390890); + magwinAI->AddWaypoint(6, -4915.464844, -11048.402344, 12.369793); + magwinAI->AddWaypoint(7, -4937.288086, -11067.041992, 13.857983); + magwinAI->AddWaypoint(8, -4966.577637, -11067.507813, 15.754786); + magwinAI->AddWaypoint(9, -4993.799805, -11056.544922, 19.175295); + magwinAI->AddWaypoint(10, -5017.836426, -11052.569336, 22.476587); + magwinAI->AddWaypoint(11, -5039.706543, -11058.459961, 25.831593); + magwinAI->AddWaypoint(12, -5057.289063, -11045.474609, 26.972496); + magwinAI->AddWaypoint(13, -5078.828125, -11037.601563, 29.053417); + magwinAI->AddWaypoint(14, -5104.158691, -11039.195313, 29.440195); + magwinAI->AddWaypoint(15, -5120.780273, -11039.518555, 30.142139); + magwinAI->AddWaypoint(16, -5140.833008, -11039.810547, 28.788074); + magwinAI->AddWaypoint(17, -5161.201660, -11040.050781, 27.879545, 4000); + magwinAI->AddWaypoint(18, -5171.842285, -11046.803711, 27.183821); + magwinAI->AddWaypoint(19, -5185.995117, -11056.359375, 20.234867); + magwinAI->AddWaypoint(20, -5198.485840, -11065.065430, 18.872593); + magwinAI->AddWaypoint(21, -5214.062500, -11074.653320, 19.215731); + magwinAI->AddWaypoint(22, -5220.157227, -11088.377930, 19.818476); + magwinAI->AddWaypoint(23, -5233.652832, -11098.846680, 18.349432); + magwinAI->AddWaypoint(24, -5250.163086, -11111.653320, 16.438959); + magwinAI->AddWaypoint(25, -5268.194336, -11125.639648, 12.668313); + magwinAI->AddWaypoint(26, -5286.270508, -11130.669922, 6.912246); + magwinAI->AddWaypoint(27, -5317.449707, -11137.392578, 4.963446); + magwinAI->AddWaypoint(28, -5334.854492, -11154.384766, 6.742664); + magwinAI->AddWaypoint(29, -5353.874512, -11171.595703, 6.903912, 20000); + magwinAI->AddWaypoint(30, -5354.240000, -11171.940000, 6.890000); + + return (CreatureAI*)magwinAI; } /*###### @@ -470,155 +470,155 @@ bool GossipSelect_npc_susurrus(Player *player, Creature *_Creature, uint32 sende ## npc_geezle ######*/ -#define GEEZLE_SAY_1 -1000259 -#define SPARK_SAY_2 -1000260 -#define SPARK_SAY_3 -1000261 -#define GEEZLE_SAY_4 -1000262 -#define SPARK_SAY_5 -1000263 -#define SPARK_SAY_6 -1000264 -#define GEEZLE_SAY_7 -1000265 +#define GEEZLE_SAY_1 -1000259 +#define SPARK_SAY_2 -1000260 +#define SPARK_SAY_3 -1000261 +#define GEEZLE_SAY_4 -1000262 +#define SPARK_SAY_5 -1000263 +#define SPARK_SAY_6 -1000264 +#define GEEZLE_SAY_7 -1000265 -#define EMOTE_SPARK -1000266 +#define EMOTE_SPARK -1000266 -#define MOB_SPARK 17243 -#define GO_NAGA_FLAG 181694 +#define MOB_SPARK 17243 +#define GO_NAGA_FLAG 181694 static float SparkPos[4] = {-5030.95, -11291.99, 7.97}; struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI { - npc_geezleAI(Creature *c) : ScriptedAI(c) {Reset();} - - std::list FlagList; - - uint64 SparkGUID; - - uint32 Step; - uint32 SayTimer; - - bool EventStarted; - - void Reset() - { - SparkGUID = 0; - Step = 0; - StartEvent(); - } - - void Aggro(Unit* who){} - - void StartEvent() - { - Step = 1; - EventStarted = true; - Creature* Spark = m_creature->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000); - SparkGUID = Spark->GetGUID(); - Spark->setActive(true); - Spark->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - m_creature->GetMotionMaster()->MovePoint(0, -5092.26, -11252, 0.71); - Spark->GetMotionMaster()->MovePoint(0, -5080.70, -11253.61, 0.56); - SayTimer = 23000; - } - - uint32 NextStep(uint32 Step) - { - Unit* Spark = Unit::GetUnit((*m_creature), SparkGUID); - - switch(Step) - { - case 0: return 99999; - case 1: - //DespawnNagaFlag(true); - DoScriptText(EMOTE_SPARK, Spark); - return 1000; - case 2: - DoScriptText(GEEZLE_SAY_1, m_creature, Spark); - Spark->SetInFront(m_creature); - m_creature->SetInFront(Spark); - return 5000; - case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000; - case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000; - case 5: DoScriptText(GEEZLE_SAY_4, m_creature, Spark); return 8000; - case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000; - case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000; - case 8: DoScriptText(GEEZLE_SAY_7, m_creature, Spark); return 2000; - case 9: - m_creature->GetMotionMaster()->MoveTargetedHome(); - Spark->GetMotionMaster()->MovePoint(0, -5030.95, -11291.99, 7.97); - return 20000; - case 10: - Spark->DealDamage(Spark,Spark->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - //DespawnNagaFlag(false); - m_creature->SetVisibility(VISIBILITY_OFF); - default: return 99999999; - } - } - - void DespawnNagaFlag(bool despawn) - { - CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::AllGameObjectsWithEntryInGrid go_check(GO_NAGA_FLAG); - Trinity::GameObjectListSearcher go_search(FlagList, go_check); - TypeContainerVisitor - , GridTypeMapContainer> go_visit(go_search); - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, go_visit, *(m_creature->GetMap())); - - Player* player = NULL; - if (!FlagList.empty()) - { - for(std::list::iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr) - { - //TODO: Found how to despawn and respawn - if(despawn) - (*itr)->RemoveFromWorld(); - else - (*itr)->Respawn(); - } - } else error_log("SD2 ERROR: FlagList is empty!"); - } - - void UpdateAI(const uint32 diff) - { - if(SayTimer < diff) - { - if(EventStarted) - { - SayTimer = NextStep(++Step); - } - }else SayTimer -= diff; - } + npc_geezleAI(Creature *c) : ScriptedAI(c) {Reset();} + + std::list FlagList; + + uint64 SparkGUID; + + uint32 Step; + uint32 SayTimer; + + bool EventStarted; + + void Reset() + { + SparkGUID = 0; + Step = 0; + StartEvent(); + } + + void Aggro(Unit* who){} + + void StartEvent() + { + Step = 1; + EventStarted = true; + Creature* Spark = m_creature->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000); + SparkGUID = Spark->GetGUID(); + Spark->setActive(true); + Spark->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->GetMotionMaster()->MovePoint(0, -5092.26, -11252, 0.71); + Spark->GetMotionMaster()->MovePoint(0, -5080.70, -11253.61, 0.56); + SayTimer = 23000; + } + + uint32 NextStep(uint32 Step) + { + Unit* Spark = Unit::GetUnit((*m_creature), SparkGUID); + + switch(Step) + { + case 0: return 99999; + case 1: + //DespawnNagaFlag(true); + DoScriptText(EMOTE_SPARK, Spark); + return 1000; + case 2: + DoScriptText(GEEZLE_SAY_1, m_creature, Spark); + Spark->SetInFront(m_creature); + m_creature->SetInFront(Spark); + return 5000; + case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000; + case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000; + case 5: DoScriptText(GEEZLE_SAY_4, m_creature, Spark); return 8000; + case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000; + case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000; + case 8: DoScriptText(GEEZLE_SAY_7, m_creature, Spark); return 2000; + case 9: + m_creature->GetMotionMaster()->MoveTargetedHome(); + Spark->GetMotionMaster()->MovePoint(0, -5030.95, -11291.99, 7.97); + return 20000; + case 10: + Spark->DealDamage(Spark,Spark->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + //DespawnNagaFlag(false); + m_creature->SetVisibility(VISIBILITY_OFF); + default: return 99999999; + } + } + + void DespawnNagaFlag(bool despawn) + { + CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::AllGameObjectsWithEntryInGrid go_check(GO_NAGA_FLAG); + Trinity::GameObjectListSearcher go_search(FlagList, go_check); + TypeContainerVisitor + , GridTypeMapContainer> go_visit(go_search); + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, go_visit, *(m_creature->GetMap())); + + Player* player = NULL; + if (!FlagList.empty()) + { + for(std::list::iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr) + { + //TODO: Found how to despawn and respawn + if(despawn) + (*itr)->RemoveFromWorld(); + else + (*itr)->Respawn(); + } + } else error_log("SD2 ERROR: FlagList is empty!"); + } + + void UpdateAI(const uint32 diff) + { + if(SayTimer < diff) + { + if(EventStarted) + { + SayTimer = NextStep(++Step); + } + }else SayTimer -= diff; + } }; CreatureAI* GetAI_npc_geezleAI(Creature *_Creature) { - return new npc_geezleAI(_Creature); + return new npc_geezleAI(_Creature); } /*###### ## mob_nestlewood_owlkin ######*/ -#define INOCULATION_CHANNEL 29528 -#define INOCULATED_OWLKIN 16534 +#define INOCULATION_CHANNEL 29528 +#define INOCULATED_OWLKIN 16534 struct TRINITY_DLL_DECL mob_nestlewood_owlkinAI : public ScriptedAI { mob_nestlewood_owlkinAI(Creature *c) : ScriptedAI(c) {Reset();} - uint32 ChannelTimer; - bool Channeled; - bool Hitted; + uint32 ChannelTimer; + bool Channeled; + bool Hitted; void Reset() { - ChannelTimer = 0; - Channeled = false; - Hitted = false; + ChannelTimer = 0; + Channeled = false; + Hitted = false; } void Aggro(Unit *who){} @@ -629,23 +629,23 @@ struct TRINITY_DLL_DECL mob_nestlewood_owlkinAI : public ScriptedAI return; if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == INOCULATION_CHANNEL) - { - ChannelTimer = 3000; - Hitted = true; - } + { + ChannelTimer = 3000; + Hitted = true; + } } void UpdateAI(const uint32 diff) { - if(ChannelTimer < diff && !Channeled && Hitted) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - m_creature->SummonCreature(INOCULATED_OWLKIN, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000); - Channeled = true; - }else ChannelTimer -= diff; - - DoMeleeAttackIfReady(); + if(ChannelTimer < diff && !Channeled && Hitted) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + m_creature->SummonCreature(INOCULATED_OWLKIN, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000); + Channeled = true; + }else ChannelTimer -= diff; + + DoMeleeAttackIfReady(); } }; @@ -675,11 +675,11 @@ void AddSC_azuremyst_isle() newscript->GetAI = &GetAI_npc_injured_draenei; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "npc_magwin"; - newscript->GetAI = &GetAI_npc_magwinAI; - newscript->pQuestAccept = &QuestAccept_npc_magwin; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_magwin"; + newscript->GetAI = &GetAI_npc_magwinAI; + newscript->pQuestAccept = &QuestAccept_npc_magwin; + newscript->RegisterSelf(); newscript = new Script; newscript->Name="npc_susurrus"; @@ -687,14 +687,14 @@ void AddSC_azuremyst_isle() newscript->pGossipSelect = &GossipSelect_npc_susurrus; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name="npc_geezle"; - newscript->GetAI = &GetAI_npc_geezleAI; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="npc_geezle"; + newscript->GetAI = &GetAI_npc_geezleAI; + newscript->RegisterSelf(); - newscript = new Script; - newscript->Name="mob_nestlewood_owlkin"; - newscript->GetAI = &GetAI_mob_nestlewood_owlkinAI; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="mob_nestlewood_owlkin"; + newscript->GetAI = &GetAI_mob_nestlewood_owlkinAI; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp index 08fb76889da..ceab92a1107 100644 --- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp +++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp @@ -391,87 +391,87 @@ CreatureAI* GetAI_npc_twiggy_flathead(Creature *_Creature) ## npc_wizzlecrank_shredder #####*/ -#define SAY_PROGRESS_1 -1000272 -#define SAY_PROGRESS_2 -1000273 -#define SAY_PROGRESS_3 -1000274 +#define SAY_PROGRESS_1 -1000272 +#define SAY_PROGRESS_2 -1000273 +#define SAY_PROGRESS_3 -1000274 -#define SAY_MERCENARY_4 -1000275 +#define SAY_MERCENARY_4 -1000275 -#define SAY_PROGRESS_5 -1000276 -#define SAY_PROGRESS_6 -1000277 -#define SAY_PROGRESS_7 -1000278 -#define SAY_PROGRESS_8 -1000279 +#define SAY_PROGRESS_5 -1000276 +#define SAY_PROGRESS_6 -1000277 +#define SAY_PROGRESS_7 -1000278 +#define SAY_PROGRESS_8 -1000279 -#define QUEST_ESCAPE 863 -#define NPC_PILOT 3451 -#define MOB_MERCENARY 3282 +#define QUEST_ESCAPE 863 +#define NPC_PILOT 3451 +#define MOB_MERCENARY 3282 struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI { - npc_wizzlecrank_shredderAI(Creature* c) : npc_escortAI(c) {Reset();} + npc_wizzlecrank_shredderAI(Creature* c) : npc_escortAI(c) {Reset();} bool Completed; - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - if(!player) - return; - - switch(i) - { - case 0: DoScriptText(SAY_PROGRESS_1, m_creature); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 1: DoScriptText(SAY_PROGRESS_2, m_creature); break; - case 10: DoScriptText(SAY_PROGRESS_3, m_creature, player); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 20:{ - Unit* Mercenary = FindCreature(MOB_MERCENARY, 99, m_creature); - if(Mercenary) - { - DoScriptText(SAY_MERCENARY_4, Mercenary); - ((Creature*)Mercenary)->AI()->AttackStart(m_creature); - AttackStart(Mercenary); - } - }break; - case 21: DoScriptText(SAY_PROGRESS_5, m_creature); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 28: DoScriptText(SAY_PROGRESS_6, m_creature); break; - case 29: DoScriptText(SAY_PROGRESS_7, m_creature); break; - case 30: DoScriptText(SAY_PROGRESS_8, m_creature); break; - case 31: m_creature->SummonCreature(NPC_PILOT, 1088.77, -2985.39, 91.84, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000); - m_creature->setDeathState(JUST_DIED); + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if(!player) + return; + + switch(i) + { + case 0: DoScriptText(SAY_PROGRESS_1, m_creature); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 1: DoScriptText(SAY_PROGRESS_2, m_creature); break; + case 10: DoScriptText(SAY_PROGRESS_3, m_creature, player); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 20:{ + Unit* Mercenary = FindCreature(MOB_MERCENARY, 99, m_creature); + if(Mercenary) + { + DoScriptText(SAY_MERCENARY_4, Mercenary); + ((Creature*)Mercenary)->AI()->AttackStart(m_creature); + AttackStart(Mercenary); + } + }break; + case 21: DoScriptText(SAY_PROGRESS_5, m_creature); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 28: DoScriptText(SAY_PROGRESS_6, m_creature); break; + case 29: DoScriptText(SAY_PROGRESS_7, m_creature); break; + case 30: DoScriptText(SAY_PROGRESS_8, m_creature); break; + case 31: m_creature->SummonCreature(NPC_PILOT, 1088.77, -2985.39, 91.84, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000); + m_creature->setDeathState(JUST_DIED); Completed = true; - if (player && player->GetTypeId() == TYPEID_PLAYER) + if (player && player->GetTypeId() == TYPEID_PLAYER) ((Player*)player)->GroupEventHappens(QUEST_ESCAPE, m_creature); - break; - } - } + break; + } + } - void Reset() - { - m_creature->setDeathState(ALIVE); + void Reset() + { + m_creature->setDeathState(ALIVE); Completed = false; m_creature->setFaction(69); - } + } - void Aggro(Unit* who){} + void Aggro(Unit* who){} - void JustDied(Unit* killer) - { - if (PlayerGUID && !Completed) + void JustDied(Unit* killer) + { + if (PlayerGUID && !Completed) { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); if (player) ((Player*)player)->FailQuest(QUEST_ESCAPE); } - } + } - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; bool QuestAccept_npc_wizzlecrank_shredder(Player* player, Creature* creature, Quest const* quest) @@ -479,49 +479,49 @@ bool QuestAccept_npc_wizzlecrank_shredder(Player* player, Creature* creature, Qu if (quest->GetQuestId() == QUEST_ESCAPE) { ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - creature->setFaction(113); + creature->setFaction(113); } return true; } CreatureAI* GetAI_npc_wizzlecrank_shredderAI(Creature *_Creature) { - npc_wizzlecrank_shredderAI* thisAI = new npc_wizzlecrank_shredderAI(_Creature); - - thisAI->AddWaypoint(0, 1109.15, -3104.11, 82.41, 6000); - thisAI->AddWaypoint(1, 1105.39, -3102.86, 82.74, 2000); - thisAI->AddWaypoint(2, 1104.97, -3108.52, 83.10, 1000); - thisAI->AddWaypoint(3, 1110.01, -3110.48, 82.81, 1000); - thisAI->AddWaypoint(4, 1111.72, -3103.03, 82.21, 1000); - thisAI->AddWaypoint(5, 1106.98, -3099.44, 82.18, 1000); - thisAI->AddWaypoint(6, 1103.74, -3103.29, 83.05, 1000); - thisAI->AddWaypoint(7, 1112.55, -3106.56, 82.31, 1000); - thisAI->AddWaypoint(8, 1108.12, -3111.04, 82.99, 1000); - thisAI->AddWaypoint(9, 1109.32, -3100.39, 82.08, 1000); - thisAI->AddWaypoint(10, 1109.32, -3100.39, 82.08, 6000); - thisAI->AddWaypoint(11, 1098.92, -3095.14, 82.97); - thisAI->AddWaypoint(12, 1100.94, -3082.60, 82.83); - thisAI->AddWaypoint(13, 1101.12, -3068.83, 82.53); - thisAI->AddWaypoint(14, 1096.97, -3051.99, 82.50); - thisAI->AddWaypoint(15, 1094.06, -3036.79, 82.70); - thisAI->AddWaypoint(16, 1098.22, -3027.84, 83.79); - thisAI->AddWaypoint(17, 1109.51, -3015.92, 85.73); - thisAI->AddWaypoint(18, 1119.87, -3007.21, 87.08); - thisAI->AddWaypoint(19, 1130.23, -3002.49, 91.27, 5000); - thisAI->AddWaypoint(20, 1130.23, -3002.49, 91.27, 3000); - thisAI->AddWaypoint(21, 1130.23, -3002.49, 91.27, 4000); - thisAI->AddWaypoint(22, 1129.73, -2985.89, 92.46); - thisAI->AddWaypoint(23, 1124.10, -2983.29, 92.81); - thisAI->AddWaypoint(24, 1111.74, -2992.38, 91.59); - thisAI->AddWaypoint(25, 1111.06, -2976.54, 91.81); - thisAI->AddWaypoint(26, 1099.91, -2991.17, 91.67); - thisAI->AddWaypoint(27, 1096.32, -2981.55, 91.73); - thisAI->AddWaypoint(28, 1091.28, -2985.82, 91.74, 4000); - thisAI->AddWaypoint(29, 1091.28, -2985.82, 91.74, 3000); - thisAI->AddWaypoint(30, 1091.28, -2985.82, 91.74, 7000); - thisAI->AddWaypoint(31, 1091.28, -2985.82, 91.74, 3000); - - return (CreatureAI*)thisAI; + npc_wizzlecrank_shredderAI* thisAI = new npc_wizzlecrank_shredderAI(_Creature); + + thisAI->AddWaypoint(0, 1109.15, -3104.11, 82.41, 6000); + thisAI->AddWaypoint(1, 1105.39, -3102.86, 82.74, 2000); + thisAI->AddWaypoint(2, 1104.97, -3108.52, 83.10, 1000); + thisAI->AddWaypoint(3, 1110.01, -3110.48, 82.81, 1000); + thisAI->AddWaypoint(4, 1111.72, -3103.03, 82.21, 1000); + thisAI->AddWaypoint(5, 1106.98, -3099.44, 82.18, 1000); + thisAI->AddWaypoint(6, 1103.74, -3103.29, 83.05, 1000); + thisAI->AddWaypoint(7, 1112.55, -3106.56, 82.31, 1000); + thisAI->AddWaypoint(8, 1108.12, -3111.04, 82.99, 1000); + thisAI->AddWaypoint(9, 1109.32, -3100.39, 82.08, 1000); + thisAI->AddWaypoint(10, 1109.32, -3100.39, 82.08, 6000); + thisAI->AddWaypoint(11, 1098.92, -3095.14, 82.97); + thisAI->AddWaypoint(12, 1100.94, -3082.60, 82.83); + thisAI->AddWaypoint(13, 1101.12, -3068.83, 82.53); + thisAI->AddWaypoint(14, 1096.97, -3051.99, 82.50); + thisAI->AddWaypoint(15, 1094.06, -3036.79, 82.70); + thisAI->AddWaypoint(16, 1098.22, -3027.84, 83.79); + thisAI->AddWaypoint(17, 1109.51, -3015.92, 85.73); + thisAI->AddWaypoint(18, 1119.87, -3007.21, 87.08); + thisAI->AddWaypoint(19, 1130.23, -3002.49, 91.27, 5000); + thisAI->AddWaypoint(20, 1130.23, -3002.49, 91.27, 3000); + thisAI->AddWaypoint(21, 1130.23, -3002.49, 91.27, 4000); + thisAI->AddWaypoint(22, 1129.73, -2985.89, 92.46); + thisAI->AddWaypoint(23, 1124.10, -2983.29, 92.81); + thisAI->AddWaypoint(24, 1111.74, -2992.38, 91.59); + thisAI->AddWaypoint(25, 1111.06, -2976.54, 91.81); + thisAI->AddWaypoint(26, 1099.91, -2991.17, 91.67); + thisAI->AddWaypoint(27, 1096.32, -2981.55, 91.73); + thisAI->AddWaypoint(28, 1091.28, -2985.82, 91.74, 4000); + thisAI->AddWaypoint(29, 1091.28, -2985.82, 91.74, 3000); + thisAI->AddWaypoint(30, 1091.28, -2985.82, 91.74, 7000); + thisAI->AddWaypoint(31, 1091.28, -2985.82, 91.74, 3000); + + return (CreatureAI*)thisAI; } void AddSC_the_barrens() @@ -551,9 +551,9 @@ void AddSC_the_barrens() newscript->GetAI = &GetAI_npc_twiggy_flathead; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name="npc_wizzlecrank_shredder"; - newscript->GetAI = &GetAI_npc_wizzlecrank_shredderAI; - newscript->pQuestAccept = &QuestAccept_npc_wizzlecrank_shredder; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="npc_wizzlecrank_shredder"; + newscript->GetAI = &GetAI_npc_wizzlecrank_shredderAI; + newscript->pQuestAccept = &QuestAccept_npc_wizzlecrank_shredder; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp index 29b625dcaf6..d483b4ec1be 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp @@ -116,7 +116,7 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI void Aggro(Unit *who) { DoZoneInCombat(); - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); if(pInstance) pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS); } @@ -125,8 +125,8 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; } } @@ -145,7 +145,7 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI std::list m_threatlist = m_creature->getThreatManager().getThreatList(); if(!m_threatlist.size()) // He doesn't have anyone in his threatlist, useless to continue - return; + return; std::list targets; std::list::iterator itr = m_threatlist.begin(); @@ -214,17 +214,17 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI }else FelAcidTimer -= diff; if(!m_creature->HasAura(SPELL_BERSERK, 0)) - { - if(EnrageTimer < diff) - { - DoCast(m_creature, SPELL_BERSERK); - switch(rand()%2) - { - case 0: DoScriptText(SAY_ENRAGE1, m_creature); break; - case 1: DoScriptText(SAY_ENRAGE2, m_creature); break; - } - }else EnrageTimer -= diff; - } + { + if(EnrageTimer < diff) + { + DoCast(m_creature, SPELL_BERSERK); + switch(rand()%2) + { + case 0: DoScriptText(SAY_ENRAGE1, m_creature); break; + case 1: DoScriptText(SAY_ENRAGE2, m_creature); break; + } + }else EnrageTimer -= diff; + } if(Phase1) { @@ -232,8 +232,8 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI { DoCast(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE); float mt_threat = DoGetThreat(m_creature->getVictim()); - if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) - m_creature->AddThreat(target, mt_threat); + if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) + m_creature->AddThreat(target, mt_threat); BewilderingStrikeTimer = 20000; }else BewilderingStrikeTimer -= diff; @@ -305,8 +305,8 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI switch(rand()%2) { - case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; - case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; + case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; + case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; } AcidGeyserTimer = 1000; diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp index a547034fd58..36dcd1ff58e 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp @@ -94,7 +94,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI uint32 FatalAttractionTimer; uint32 FatalAttractionExplodeTimer; uint32 ShriekTimer; - uint32 SaberTimer; + uint32 SaberTimer; uint32 RandomYellTimer; uint32 EnrageTimer; uint32 ExplosionCount; @@ -116,7 +116,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI FatalAttractionTimer = 60000; FatalAttractionExplodeTimer = 70000; ShriekTimer = 30000; - SaberTimer = 35000; + SaberTimer = 35000; RandomYellTimer = 70000 + rand()%41 * 1000; EnrageTimer = 600000; ExplosionCount = 0; @@ -130,15 +130,15 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS); DoZoneInCombat(); - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); } void KilledUnit(Unit *victim) { switch(rand()%2) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; } } @@ -230,8 +230,8 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI switch(rand()%2) { - case 0: DoScriptText(SAY_SPELL2, m_creature); break; - case 1: DoScriptText(SAY_SPELL3, m_creature); break; + case 0: DoScriptText(SAY_SPELL2, m_creature); break; + case 1: DoScriptText(SAY_SPELL3, m_creature); break; } FatalAttractionExplodeTimer = 2000; FatalAttractionTimer = 40000 + rand()%31 * 1000; @@ -270,7 +270,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI ShriekTimer = 25000+rand()%10 * 1000; }else ShriekTimer -= diff; - if(SaberTimer < diff) + if(SaberTimer < diff) { DoCast(m_creature->getVictim(), SPELL_SABER_LASH); SaberTimer = 25000+rand()%10 * 1000; @@ -281,7 +281,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI if(EnrageTimer < diff) { DoCast(m_creature, SPELL_BERSERK); - DoScriptText(SAY_ENRAGE, m_creature); + DoScriptText(SAY_ENRAGE, m_creature); }else EnrageTimer -= diff; //Random taunts @@ -289,9 +289,9 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI { switch(rand()%3) { - case 0: DoScriptText(SAY_TAUNT1, m_creature); break; - case 1: DoScriptText(SAY_TAUNT2, m_creature); break; - case 2: DoScriptText(SAY_TAUNT3, m_creature); break; + case 0: DoScriptText(SAY_TAUNT1, m_creature); break; + case 1: DoScriptText(SAY_TAUNT2, m_creature); break; + case 2: DoScriptText(SAY_TAUNT3, m_creature); break; } RandomYellTimer = 60000 + rand()%91 * 1000; }else RandomYellTimer -= diff; diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp index af712a9bfd0..231a8410724 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp @@ -270,11 +270,11 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI case 5: if(Phase == 1) { - DoScriptText(SUFF_SAY_AFTER, Essence); + DoScriptText(SUFF_SAY_AFTER, Essence); } else { - DoScriptText(DESI_SAY_AFTER, Essence); + DoScriptText(DESI_SAY_AFTER, Essence); } Essence->SetVisibility(VISIBILITY_OFF); Essence->setDeathState(DEAD); @@ -356,7 +356,7 @@ struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI void Aggro(Unit *who) { - DoScriptText(SUFF_SAY_FREED, m_creature); + DoScriptText(SUFF_SAY_FREED, m_creature); DoZoneInCombat(); m_creature->CastSpell(m_creature, AURA_OF_SUFFERING, true); // linked aura need core support m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE, true); @@ -367,9 +367,9 @@ struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SUFF_SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SUFF_SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SUFF_SAY_SLAY3, m_creature); break; + case 0: DoScriptText(SUFF_SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SUFF_SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SUFF_SAY_SLAY3, m_creature); break; } } @@ -407,7 +407,7 @@ struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI FixateTimer = 5000; if(!(rand()%16)) { - DoScriptText(SUFF_SAY_AGGRO, m_creature); + DoScriptText(SUFF_SAY_AGGRO, m_creature); } }else FixateTimer -= diff; @@ -415,7 +415,7 @@ struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI { DoCast(m_creature, SPELL_ENRAGE); EnrageTimer = 60000; - DoScriptText(SUFF_EMOTE_ENRAGE, m_creature); + DoScriptText(SUFF_EMOTE_ENRAGE, m_creature); }else EnrageTimer -= diff; if(SoulDrainTimer < diff) @@ -453,7 +453,7 @@ struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI { damage = 0; m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoScriptText(SUFF_SAY_RECAP, m_creature); + DoScriptText(SUFF_SAY_RECAP, m_creature); } else { @@ -474,7 +474,7 @@ struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI void Aggro(Unit *who) { - DoScriptText(DESI_SAY_FREED, m_creature); + DoScriptText(DESI_SAY_FREED, m_creature); DoZoneInCombat(); DoCast(m_creature, AURA_OF_DESIRE, true); } @@ -516,7 +516,7 @@ struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI DeadenTimer = 25000 + rand()%10000; if(!(rand()%2)) { - DoScriptText(DESI_SAY_SPEC, m_creature); + DoScriptText(DESI_SAY_SPEC, m_creature); } }else DeadenTimer -= diff; @@ -553,11 +553,11 @@ struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI void Aggro(Unit *who) { - switch(rand()%2) - { - case 0: DoScriptText(ANGER_SAY_FREED, m_creature); break; - case 1: DoScriptText(ANGER_SAY_FREED2, m_creature); break; - } + switch(rand()%2) + { + case 0: DoScriptText(ANGER_SAY_FREED, m_creature); break; + case 1: DoScriptText(ANGER_SAY_FREED2, m_creature); break; + } DoZoneInCombat(); DoCast(m_creature, AURA_OF_ANGER, true); @@ -565,7 +565,7 @@ struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI void JustDied(Unit *victim) { - DoScriptText(ANGER_SAY_DEATH, m_creature); + DoScriptText(ANGER_SAY_DEATH, m_creature); } void KilledUnit(Unit *victim) @@ -593,7 +593,7 @@ struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI { if(m_creature->getVictim()->GetGUID() != AggroTargetGUID) { - DoScriptText(ANGER_SAY_BEFORE, m_creature); + DoScriptText(ANGER_SAY_BEFORE, m_creature); DoCast(m_creature, SPELL_SELF_SEETHE, true); AggroTargetGUID = m_creature->getVictim()->GetGUID(); } @@ -606,7 +606,7 @@ struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI SoulScreamTimer = 9000 + rand()%2000; if(!(rand()%3)) { - DoScriptText(ANGER_SAY_SPEC, m_creature); + DoScriptText(ANGER_SAY_SPEC, m_creature); } }else SoulScreamTimer -= diff; @@ -614,7 +614,7 @@ struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI { DoCast(m_creature, SPELL_SPITE_TARGET); SpiteTimer = 30000; - DoScriptText(ANGER_SAY_SPEC, m_creature); + DoScriptText(ANGER_SAY_SPEC, m_creature); }else SpiteTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp index 1e82ce4be1b..d2b2da6d866 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp @@ -189,7 +189,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI bool IsBanished; bool HasKilledAkama; bool reseting; - bool GridSearcherSucceeded; + bool GridSearcherSucceeded; void Reset() { @@ -257,17 +257,17 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI { Channeler->RemoveCorpse(); Channeler->Respawn(); - Channeler->InterruptNonMeleeSpells(true); - Channeler->RemoveAurasDueToSpell(SPELL_SHADE_SOUL_CHANNEL); + Channeler->InterruptNonMeleeSpells(true); + Channeler->RemoveAurasDueToSpell(SPELL_SHADE_SOUL_CHANNEL); } - if (Channeler->isAlive()) - { + if (Channeler->isAlive()) + { Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true); Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true); Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - GridSearcherSucceeded = true; - } + GridSearcherSucceeded = true; + } } } }else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); @@ -329,8 +329,8 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI { Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - Spawn->AI()->AttackStart(target); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + Spawn->AI()->AttackStart(target); } } } diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp index 7b772cbeb26..e82c35fad36 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp @@ -152,11 +152,11 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI return; if(!m_creature->HasAura(SPELL_BERSERK, 0)) - { + { if(BerserkTimer < diff) DoCast(m_creature, SPELL_BERSERK); else BerserkTimer -= diff; - } + } if(SummonFlameTimer < diff) { @@ -184,7 +184,7 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI { DoResetThreat(); m_creature->AddThreat(target, 5000000.0f); - DoScriptText(EMOTE_NEW_TARGET, m_creature); + DoScriptText(EMOTE_NEW_TARGET, m_creature); SwitchTargetTimer = 10000; } }else SwitchTargetTimer -= diff; @@ -193,11 +193,11 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI { if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) { - if(!target) - target = m_creature->getVictim(); + if(!target) + target = m_creature->getVictim(); DoCast(target, SPELL_VOLCANIC_SUMMON); - DoScriptText(EMOTE_GROUND_CRACK, m_creature); + DoScriptText(EMOTE_GROUND_CRACK, m_creature); SummonVolcanoTimer = 10000; } }else SummonVolcanoTimer -= diff; @@ -306,7 +306,7 @@ void AddSC_boss_supremus() newscript->GetAI = &GetAI_molten_flame; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="npc_volcano"; newscript->GetAI = &GetAI_npc_volcano; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp index d691407b91c..35f17986e88 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp @@ -143,7 +143,7 @@ struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI if(!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID)) return; - ScriptedAI::MoveInLineOfSight(who); + ScriptedAI::MoveInLineOfSight(who); } /* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED @@ -265,7 +265,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI m_creature->GetMotionMaster()->Clear(false); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoScriptText(SAY_INTRO, m_creature); + DoScriptText(SAY_INTRO, m_creature); m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); AggroTargetGUID = who->GetGUID(); Intro = true; @@ -277,8 +277,8 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; } } @@ -287,7 +287,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI if(pInstance) pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE); - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); } float CalculateRandomLocation(float Loc, uint32 radius) @@ -375,7 +375,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI { m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); Intro = false; if(AggroTargetGUID) @@ -417,7 +417,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI if(SummonDoomBlossomTimer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) { float X = CalculateRandomLocation(target->GetPositionX(), 20); float Y = CalculateRandomLocation(target->GetPositionY(), 20); @@ -445,8 +445,8 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; - case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; + case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; + case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; } DoCast(target, SPELL_INCINERATE); IncinerateTimer = 20000 + rand()%31 * 1000; @@ -482,20 +482,20 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_SPELL1, m_creature); break; - case 1: DoScriptText(SAY_SPELL2, m_creature); break; + case 0: DoScriptText(SAY_SPELL1, m_creature); break; + case 1: DoScriptText(SAY_SPELL2, m_creature); break; } RandomYellTimer = 50000 + rand()%51 * 1000; }else RandomYellTimer -= diff; if(!m_creature->HasAura(SPELL_BERSERK, 0)) - { + { if(EnrageTimer < diff) { DoCast(m_creature, SPELL_BERSERK); - DoScriptText(SAY_ENRAGE, m_creature); + DoScriptText(SAY_ENRAGE, m_creature); }else EnrageTimer -= diff; - } + } DoMeleeAttackIfReady(); } diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp index d04ce294b22..1b1099e7948 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp @@ -81,8 +81,8 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; } } @@ -91,7 +91,7 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI if(pInstance) pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE); - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); } void SpellHit(Unit *caster, const SpellEntry *spell) @@ -143,7 +143,7 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI if(EnrageTimer < diff) { - DoScriptText(SAY_ENRAGE2, m_creature); + DoScriptText(SAY_ENRAGE2, m_creature); m_creature->CastSpell(m_creature, SPELL_BERSERK, true); EnrageTimer = 600000; }else EnrageTimer -= diff; @@ -162,8 +162,8 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; - case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; + case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; + case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; } SpecialYellTimer = 25000 + (rand()%76)*1000; }else SpecialYellTimer -= diff; @@ -181,8 +181,8 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI switch(rand()%2) { - case 0: DoScriptText(SAY_NEEDLE1, m_creature); break; - case 1: DoScriptText(SAY_NEEDLE2, m_creature); break; + case 0: DoScriptText(SAY_NEEDLE1, m_creature); break; + case 1: DoScriptText(SAY_NEEDLE2, m_creature); break; } ImpalingSpineTimer = 21000; } diff --git a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp index 18acc17322c..eecdd70dc30 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp @@ -53,25 +53,25 @@ EndScriptData */ struct CouncilYells { - int32 entry; - uint32 timer; + int32 entry; + uint32 timer; }; static CouncilYells CouncilAggro[]= { - {-1564069, 5000}, // Gathios - {-1564070, 5500}, // Veras - {-1564071, 5000}, // Malande - {-1564072, 0}, // Zerevor + {-1564069, 5000}, // Gathios + {-1564070, 5500}, // Veras + {-1564071, 5000}, // Malande + {-1564072, 0}, // Zerevor }; // Need to get proper timers for this later static CouncilYells CouncilEnrage[]= { - {-1564073, 2000}, // Gathios - {-1564074, 6000}, // Veras - {-1564075, 5000}, // Malande - {-1564076, 0}, // Zerevor + {-1564073, 2000}, // Gathios + {-1564074, 6000}, // Veras + {-1564075, 5000}, // Malande + {-1564076, 0}, // Zerevor }; // High Nethermancer Zerevor's spells @@ -159,33 +159,33 @@ struct TRINITY_DLL_DECL mob_blood_elf_council_voice_triggerAI : public ScriptedA return; if(AggroYellTimer) - { + { if(AggroYellTimer <= diff) { if(Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter])) { - DoScriptText(CouncilAggro[YellCounter].entry, pMember); + DoScriptText(CouncilAggro[YellCounter].entry, pMember); AggroYellTimer = CouncilAggro[YellCounter].timer; } ++YellCounter; if(YellCounter > 3) YellCounter = 0; // Reuse for Enrage Yells }else AggroYellTimer -= diff; - } + } if(EnrageTimer) - { + { if(EnrageTimer <= diff) { if(Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter])) { pMember->CastSpell(pMember, SPELL_BERSERK, true); - DoScriptText(CouncilEnrage[YellCounter].entry, pMember); + DoScriptText(CouncilEnrage[YellCounter].entry, pMember); EnrageTimer = CouncilEnrage[YellCounter].timer; } ++YellCounter; }else EnrageTimer -= diff; - } + } } }; @@ -451,12 +451,12 @@ struct TRINITY_DLL_DECL boss_gathios_the_shattererAI : public boss_illidari_coun void KilledUnit(Unit *victim) { - DoScriptText(SAY_GATH_SLAY, m_creature); + DoScriptText(SAY_GATH_SLAY, m_creature); } void JustDied(Unit *victim) { - DoScriptText(SAY_GATH_DEATH, m_creature); + DoScriptText(SAY_GATH_DEATH, m_creature); } Unit* SelectCouncilMember() @@ -568,12 +568,12 @@ struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_ void KilledUnit(Unit *victim) { - DoScriptText(SAY_ZERE_SLAY, m_creature); + DoScriptText(SAY_ZERE_SLAY, m_creature); } void JustDied(Unit *victim) { - DoScriptText(SAY_ZERE_DEATH, m_creature); + DoScriptText(SAY_ZERE_DEATH, m_creature); } void UpdateAI(const uint32 diff) @@ -656,12 +656,12 @@ struct TRINITY_DLL_DECL boss_lady_malandeAI : public boss_illidari_councilAI void KilledUnit(Unit *victim) { - DoScriptText(SAY_MALA_SLAY, m_creature); + DoScriptText(SAY_MALA_SLAY, m_creature); } void JustDied(Unit *victim) { - DoScriptText(SAY_MALA_DEATH, m_creature); + DoScriptText(SAY_MALA_DEATH, m_creature); } void UpdateAI(const uint32 diff) @@ -730,12 +730,12 @@ struct TRINITY_DLL_DECL boss_veras_darkshadowAI : public boss_illidari_councilAI void KilledUnit(Unit *victim) { - DoScriptText(SAY_VERA_SLAY, m_creature); + DoScriptText(SAY_VERA_SLAY, m_creature); } void JustDied(Unit *victim) { - DoScriptText(SAY_VERA_DEATH, m_creature); + DoScriptText(SAY_VERA_DEATH, m_creature); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp index 564958924b2..23f36badb62 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp @@ -113,35 +113,35 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance } Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void HandleGameObject(uint64 guid, uint32 state) - { - Player *player = GetPlayerInMap(); - - if (!player || !guid) - { - debug_log("TSCR: Black Temple: HandleGameObject fail"); - return; - } - - if (GameObject *go = GameObject::GetGameObject(*player,guid)) - go->SetGoState(state); - } + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void HandleGameObject(uint64 guid, uint32 state) + { + Player *player = GetPlayerInMap(); + + if (!player || !guid) + { + debug_log("TSCR: Black Temple: HandleGameObject fail"); + return; + } + + if (GameObject *go = GameObject::GetGameObject(*player,guid)) + go->SetGoState(state); + } void OnCreatureCreate(Creature *creature, uint32 creature_entry) { @@ -274,20 +274,20 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance } if (data == DONE) - { + { OUT_SAVE_INST_DATA; - std::ostringstream saveStream; - saveStream << Encounters[0] << " " << Encounters[1] << " " - << Encounters[2] << " " << Encounters[3] << " " << Encounters[4] + std::ostringstream saveStream; + saveStream << Encounters[0] << " " << Encounters[1] << " " + << Encounters[2] << " " << Encounters[3] << " " << Encounters[4] << " " << Encounters[5] << " " << Encounters[6] << " " << Encounters[7] << " " << Encounters[8]; - str_data = saveStream.str(); + str_data = saveStream.str(); - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } } uint32 GetData(uint32 type) @@ -309,31 +309,31 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance } const char* Save() - { - return str_data.c_str(); - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] + { + return str_data.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4] >> Encounters[5] >> Encounters[6] >> Encounters[7] >> Encounters[8]; - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if (Encounters[i] == IN_PROGRESS) - Encounters[i] = NOT_STARTED; + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if (Encounters[i] == IN_PROGRESS) + Encounters[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } + OUT_LOAD_INST_DATA_COMPLETE; + } }; InstanceData* GetInstanceData_instance_black_temple(Map* map) diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp index 75818bca575..44b668f7aca 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp @@ -1,5 +1,6 @@ /* Copyright (C) 2006 - 2008 ScriptDev2 * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. @@ -46,49 +47,49 @@ EndContentData */ uint32 RingMob[]= { - 8925, // Dredge Worm - 8926, // Deep Stinger - 8927, // Dark Screecher - 8928, // Burrowing Thundersnout - 8933, // Cave Creeper - 8932, // Borer Beetle + 8925, // Dredge Worm + 8926, // Deep Stinger + 8927, // Dark Screecher + 8928, // Burrowing Thundersnout + 8933, // Cave Creeper + 8932, // Borer Beetle }; uint32 RingBoss[]= { - 9027, // Gorosh - 9028, // Grizzle - 9029, // Eviscerator - 9030, // Ok'thor - 9031, // Anub'shiah - 9032, // Hedrum + 9027, // Gorosh + 9028, // Grizzle + 9029, // Eviscerator + 9030, // Ok'thor + 9031, // Anub'shiah + 9032, // Hedrum }; float RingLocations[6][3]= { - {604.802673, -191.081985, -54.058590}, // ring - {604.072998, -222.106918, -52.743759}, // first gate - {621.400391, -214.499054, -52.814453}, // hiding in corner - {601.300781, -198.556992, -53.950256}, // ring - {631.818359, -180.548126, -52.654770}, // second gate - {627.390381, -201.075974, -52.692917} // hiding in corner + {604.802673, -191.081985, -54.058590}, // ring + {604.072998, -222.106918, -52.743759}, // first gate + {621.400391, -214.499054, -52.814453}, // hiding in corner + {601.300781, -198.556992, -53.950256}, // ring + {631.818359, -180.548126, -52.654770}, // second gate + {627.390381, -201.075974, -52.692917} // hiding in corner }; bool AreaTrigger_at_ring_of_law(Player *player, AreaTriggerEntry *at) { - ScriptedInstance* pInstance = ((ScriptedInstance*)player->GetInstanceData()); + ScriptedInstance* pInstance = ((ScriptedInstance*)player->GetInstanceData()); - if (pInstance) - { - if (pInstance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || pInstance->GetData(TYPE_RING_OF_LAW) == DONE) - return false; + if (pInstance) + { + if (pInstance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || pInstance->GetData(TYPE_RING_OF_LAW) == DONE) + return false; - pInstance->SetData(TYPE_RING_OF_LAW,IN_PROGRESS); - player->SummonCreature(C_GRIMSTONE,625.559,-205.618,-52.735,2.609,TEMPSUMMON_DEAD_DESPAWN,0); + pInstance->SetData(TYPE_RING_OF_LAW,IN_PROGRESS); + player->SummonCreature(C_GRIMSTONE,625.559,-205.618,-52.735,2.609,TEMPSUMMON_DEAD_DESPAWN,0); - return false; - } - return false; + return false; + } + return false; } /*###### @@ -98,235 +99,235 @@ bool AreaTrigger_at_ring_of_law(Player *player, AreaTriggerEntry *at) //TODO: implement quest part of event (different end boss) struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI { - npc_grimstoneAI(Creature *c) : npc_escortAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - MobSpawnId = rand()%6; - Reset(); - } - - ScriptedInstance* pInstance; - - uint8 EventPhase; - uint32 Event_Timer; - - uint8 MobSpawnId; - uint8 MobCount; - uint32 MobDeath_Timer; - - uint64 RingMobGUID[4]; - uint64 RingBossGUID; - - bool CanWalk; - - void Reset() - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - EventPhase = 0; - Event_Timer = 1000; - - MobCount = 0; - MobDeath_Timer = 0; - - for(uint8 i = 0; i < MOB_AMOUNT; i++) - RingMobGUID[i] = 0; - - RingBossGUID = 0; - - CanWalk = false; - } - - void Aggro(Unit *who) { } - - void DoGate(uint32 id, uint32 state) - { - if (GameObject *go = GameObject::GetGameObject(*m_creature,pInstance->GetData64(id))) - go->SetGoState(state); - - debug_log("SD2: npc_grimstone, arena gate update state."); - } - - //TODO: move them to center - void SummonRingMob() - { - if (Creature* tmp = m_creature->SummonCreature(RingMob[MobSpawnId],608.960,-235.322,-53.907,1.857,TEMPSUMMON_DEAD_DESPAWN,0)) - RingMobGUID[MobCount] = tmp->GetGUID(); - - ++MobCount; - - if (MobCount == MOB_AMOUNT) - MobDeath_Timer = 2500; - } - - //TODO: move them to center - void SummonRingBoss() - { - if (Creature* tmp = m_creature->SummonCreature(RingBoss[rand()%6],644.300,-175.989,-53.739,3.418,TEMPSUMMON_DEAD_DESPAWN,0)) - RingBossGUID = tmp->GetGUID(); - - MobDeath_Timer = 2500; - } - - void WaypointReached(uint32 i) - { - switch(i) - { - case 0: - DoScriptText(-1000000, m_creature);//2 - CanWalk = false; - Event_Timer = 5000; - break; - case 1: - DoScriptText(-1000000, m_creature);//4 - CanWalk = false; - Event_Timer = 5000; - break; - case 2: - CanWalk = false; - break; - case 3: - DoScriptText(-1000000, m_creature);//5 - break; - case 4: - DoScriptText(-1000000, m_creature);//6 - CanWalk = false; - Event_Timer = 5000; - break; - case 5: - if (pInstance) - { - pInstance->SetData(TYPE_RING_OF_LAW,DONE); - debug_log("SD2: npc_grimstone: event reached end and set complete."); - } - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (MobDeath_Timer) - { - if (MobDeath_Timer <= diff) - { - MobDeath_Timer = 2500; - - if (RingBossGUID) - { - Creature *boss = (Creature*)Unit::GetUnit(*m_creature,RingBossGUID); - if (boss && !boss->isAlive() && boss->isDead()) - { - RingBossGUID = 0; - Event_Timer = 5000; - MobDeath_Timer = 0; - return; - } - return; - } - - for(uint8 i = 0; i < MOB_AMOUNT; i++) - { - Creature *mob = (Creature*)Unit::GetUnit(*m_creature,RingMobGUID[i]); - if (mob && !mob->isAlive() && mob->isDead()) - { - RingMobGUID[i] = 0; - --MobCount; - - //seems all are gone, so set timer to continue and discontinue this - if (!MobCount) - { - Event_Timer = 5000; - MobDeath_Timer = 0; - } - } - } - }else MobDeath_Timer -= diff; - } - - if (Event_Timer) - { - if (Event_Timer <= diff) - { - switch(EventPhase) - { - case 0: - DoScriptText(-1000000, m_creature);//1 - DoGate(DATA_ARENA4,1); - Start(false, false, false); - CanWalk = true; - Event_Timer = 0; - break; - case 1: - CanWalk = true; - Event_Timer = 0; - break; - case 2: - Event_Timer = 2000; - break; - case 3: - DoGate(DATA_ARENA1,0); - Event_Timer = 3000; - break; - case 4: - CanWalk = true; - m_creature->SetVisibility(VISIBILITY_OFF); - SummonRingMob(); - Event_Timer = 8000; - break; - case 5: - SummonRingMob(); - SummonRingMob(); - Event_Timer = 8000; - break; - case 6: - SummonRingMob(); - Event_Timer = 0; - break; - case 7: - m_creature->SetVisibility(VISIBILITY_ON); - DoGate(DATA_ARENA1,1); - DoScriptText(-1000000, m_creature);//4 - CanWalk = true; - Event_Timer = 0; - break; - case 8: - DoGate(DATA_ARENA2,0); - Event_Timer = 5000; - break; - case 9: - m_creature->SetVisibility(VISIBILITY_OFF); - SummonRingBoss(); - Event_Timer = 0; - break; - case 10: - //if quest, complete - DoGate(DATA_ARENA2,1); - DoGate(DATA_ARENA3,0); - DoGate(DATA_ARENA4,0); - CanWalk = true; - Event_Timer = 0; - break; - } - ++EventPhase; - }else Event_Timer -= diff; - } - - if (CanWalk) - npc_escortAI::UpdateAI(diff); - } + npc_grimstoneAI(Creature *c) : npc_escortAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + MobSpawnId = rand()%6; + Reset(); + } + + ScriptedInstance* pInstance; + + uint8 EventPhase; + uint32 Event_Timer; + + uint8 MobSpawnId; + uint8 MobCount; + uint32 MobDeath_Timer; + + uint64 RingMobGUID[4]; + uint64 RingBossGUID; + + bool CanWalk; + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + EventPhase = 0; + Event_Timer = 1000; + + MobCount = 0; + MobDeath_Timer = 0; + + for(uint8 i = 0; i < MOB_AMOUNT; i++) + RingMobGUID[i] = 0; + + RingBossGUID = 0; + + CanWalk = false; + } + + void Aggro(Unit *who) { } + + void DoGate(uint32 id, uint32 state) + { + if (GameObject *go = GameObject::GetGameObject(*m_creature,pInstance->GetData64(id))) + go->SetGoState(state); + + debug_log("SD2: npc_grimstone, arena gate update state."); + } + + //TODO: move them to center + void SummonRingMob() + { + if (Creature* tmp = m_creature->SummonCreature(RingMob[MobSpawnId],608.960,-235.322,-53.907,1.857,TEMPSUMMON_DEAD_DESPAWN,0)) + RingMobGUID[MobCount] = tmp->GetGUID(); + + ++MobCount; + + if (MobCount == MOB_AMOUNT) + MobDeath_Timer = 2500; + } + + //TODO: move them to center + void SummonRingBoss() + { + if (Creature* tmp = m_creature->SummonCreature(RingBoss[rand()%6],644.300,-175.989,-53.739,3.418,TEMPSUMMON_DEAD_DESPAWN,0)) + RingBossGUID = tmp->GetGUID(); + + MobDeath_Timer = 2500; + } + + void WaypointReached(uint32 i) + { + switch(i) + { + case 0: + DoScriptText(-1000000, m_creature);//2 + CanWalk = false; + Event_Timer = 5000; + break; + case 1: + DoScriptText(-1000000, m_creature);//4 + CanWalk = false; + Event_Timer = 5000; + break; + case 2: + CanWalk = false; + break; + case 3: + DoScriptText(-1000000, m_creature);//5 + break; + case 4: + DoScriptText(-1000000, m_creature);//6 + CanWalk = false; + Event_Timer = 5000; + break; + case 5: + if (pInstance) + { + pInstance->SetData(TYPE_RING_OF_LAW,DONE); + debug_log("SD2: npc_grimstone: event reached end and set complete."); + } + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (MobDeath_Timer) + { + if (MobDeath_Timer <= diff) + { + MobDeath_Timer = 2500; + + if (RingBossGUID) + { + Creature *boss = (Creature*)Unit::GetUnit(*m_creature,RingBossGUID); + if (boss && !boss->isAlive() && boss->isDead()) + { + RingBossGUID = 0; + Event_Timer = 5000; + MobDeath_Timer = 0; + return; + } + return; + } + + for(uint8 i = 0; i < MOB_AMOUNT; i++) + { + Creature *mob = (Creature*)Unit::GetUnit(*m_creature,RingMobGUID[i]); + if (mob && !mob->isAlive() && mob->isDead()) + { + RingMobGUID[i] = 0; + --MobCount; + + //seems all are gone, so set timer to continue and discontinue this + if (!MobCount) + { + Event_Timer = 5000; + MobDeath_Timer = 0; + } + } + } + }else MobDeath_Timer -= diff; + } + + if (Event_Timer) + { + if (Event_Timer <= diff) + { + switch(EventPhase) + { + case 0: + DoScriptText(-1000000, m_creature);//1 + DoGate(DATA_ARENA4,1); + Start(false, false, false); + CanWalk = true; + Event_Timer = 0; + break; + case 1: + CanWalk = true; + Event_Timer = 0; + break; + case 2: + Event_Timer = 2000; + break; + case 3: + DoGate(DATA_ARENA1,0); + Event_Timer = 3000; + break; + case 4: + CanWalk = true; + m_creature->SetVisibility(VISIBILITY_OFF); + SummonRingMob(); + Event_Timer = 8000; + break; + case 5: + SummonRingMob(); + SummonRingMob(); + Event_Timer = 8000; + break; + case 6: + SummonRingMob(); + Event_Timer = 0; + break; + case 7: + m_creature->SetVisibility(VISIBILITY_ON); + DoGate(DATA_ARENA1,1); + DoScriptText(-1000000, m_creature);//4 + CanWalk = true; + Event_Timer = 0; + break; + case 8: + DoGate(DATA_ARENA2,0); + Event_Timer = 5000; + break; + case 9: + m_creature->SetVisibility(VISIBILITY_OFF); + SummonRingBoss(); + Event_Timer = 0; + break; + case 10: + //if quest, complete + DoGate(DATA_ARENA2,1); + DoGate(DATA_ARENA3,0); + DoGate(DATA_ARENA4,0); + CanWalk = true; + Event_Timer = 0; + break; + } + ++EventPhase; + }else Event_Timer -= diff; + } + + if (CanWalk) + npc_escortAI::UpdateAI(diff); + } }; CreatureAI* GetAI_npc_grimstone(Creature *_Creature) { - npc_grimstoneAI* Grimstone_AI = new npc_grimstoneAI(_Creature); + npc_grimstoneAI* Grimstone_AI = new npc_grimstoneAI(_Creature); - for(uint8 i = 0; i < 6; ++i) - Grimstone_AI->AddWaypoint(i, RingLocations[i][0], RingLocations[i][1], RingLocations[i][2]); + for(uint8 i = 0; i < 6; ++i) + Grimstone_AI->AddWaypoint(i, RingLocations[i][0], RingLocations[i][1], RingLocations[i][2]); - return (CreatureAI*)Grimstone_AI; + return (CreatureAI*)Grimstone_AI; } @@ -425,10 +426,10 @@ bool GossipHello_npc_kharan_mighthammer(Player *player, Creature *_Creature) if( player->GetQuestStatus(4342) == QUEST_STATUS_INCOMPLETE ) player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KHARAN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - if (player->GetTeam() == HORDE) - player->SEND_GOSSIP_MENU(2473, _Creature->GetGUID()); - else - player->SEND_GOSSIP_MENU(2474, _Creature->GetGUID()); + if (player->GetTeam() == HORDE) + player->SEND_GOSSIP_MENU(2473, _Creature->GetGUID()); + else + player->SEND_GOSSIP_MENU(2474, _Creature->GetGUID()); return true; } @@ -473,9 +474,9 @@ bool GossipSelect_npc_kharan_mighthammer(Player *player, Creature *_Creature, ui case GOSSIP_ACTION_INFO_DEF+9: player->CLOSE_GOSSIP_MENU(); if (player->GetTeam() == HORDE) - player->AreaExploredOrEventHappens(QUEST_4001); - else - player->AreaExploredOrEventHappens(QUEST_4342); + player->AreaExploredOrEventHappens(QUEST_4001); + else + player->AreaExploredOrEventHappens(QUEST_4342); break; } return true; @@ -524,7 +525,7 @@ bool GossipSelect_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature, player->CastSpell(player, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND, false); } if (action == GOSSIP_ACTION_TRADE) - player->SEND_VENDORLIST( _Creature->GetGUID() ); + player->SEND_VENDORLIST( _Creature->GetGUID() ); return true; } @@ -533,9 +534,9 @@ bool GossipSelect_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature, ## npc_dughal_stormwing ######*/ -#define QUEST_JAIL_BREAK 4322 -#define SAY_DUGHAL_FREE "Thank you, $N! I'm free!!!" -#define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!" +#define QUEST_JAIL_BREAK 4322 +#define SAY_DUGHAL_FREE "Thank you, $N! I'm free!!!" +#define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!" ScriptedInstance *pInstance; /* @@ -545,49 +546,49 @@ struct TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI void WaypointReached(uint32 i) { - switch(i) - { - case 0:m_creature->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 1:pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 2: - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED); - break; - } - } + switch(i) + { + case 0:m_creature->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break; + case 1:pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; + case 2: + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED); + break; + } + } void Aggro(Unit* who) { } - void Reset() {} + void Reset() {} void JustDied(Unit* killer) { if (IsBeingEscorted && killer == m_creature) { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED); } } void UpdateAI(const uint32 diff) { - if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; - if( (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED ) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - else - { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - npc_escortAI::UpdateAI(diff); + if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if( (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED ) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + else + { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + npc_escortAI::UpdateAI(diff); } }; CreatureAI* GetAI_npc_dughal_stormwing(Creature *_Creature) @@ -602,10 +603,10 @@ CreatureAI* GetAI_npc_dughal_stormwing(Creature *_Creature) } bool GossipHello_npc_dughal_stormwing(Player *player, Creature *_Creature) { - if(player->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS ) + if(player->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS ) { player->ADD_GOSSIP_ITEM(0, GOSSIP_DUGHAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2846, _Creature->GetGUID()); + player->SEND_GOSSIP_MENU(2846, _Creature->GetGUID()); } return true; } @@ -616,8 +617,8 @@ bool GossipSelect_npc_dughal_stormwing(Player *player, Creature *_Creature, uint { player->CLOSE_GOSSIP_MENU(); ((npc_escortAI*)(_Creature->AI()))->Start(false, false, true, player->GetGUID()); - _Creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS); + _Creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS); } return true; } @@ -626,117 +627,117 @@ bool GossipSelect_npc_dughal_stormwing(Player *player, Creature *_Creature, uint ## npc_marshal_windsor ######*/ -#define SAY_WINDSOR_AGGRO1 "You locked up the wrong Marshal. Prepare to be destroyed!" -#define SAY_WINDSOR_AGGRO2 "I bet you're sorry now, aren't you !?!!" -#define SAY_WINDSOR_AGGRO3 "You better hold me back $N or they are going to feel some prison house beatings." -#define SAY_WINDSOR_1 "Let's get a move on. My gear should be in the storage area up this way..." -#define SAY_WINDSOR_4_1 "Check that cell, $N. If someone is alive in there, we need to get them out." -#define SAY_WINDSOR_4_2 "Get him out of there!" -#define SAY_WINDSOR_4_3 "Good work! We're almost there, $N. This way." -#define SAY_WINDSOR_6 "This is it, $N. My stuff should be in that room. Cover me, I'm going in!" -#define SAY_WINDSOR_9 "Ah, there it is!" -#define MOB_ENTRY_REGINALD_WINDSOR 9682 +#define SAY_WINDSOR_AGGRO1 "You locked up the wrong Marshal. Prepare to be destroyed!" +#define SAY_WINDSOR_AGGRO2 "I bet you're sorry now, aren't you !?!!" +#define SAY_WINDSOR_AGGRO3 "You better hold me back $N or they are going to feel some prison house beatings." +#define SAY_WINDSOR_1 "Let's get a move on. My gear should be in the storage area up this way..." +#define SAY_WINDSOR_4_1 "Check that cell, $N. If someone is alive in there, we need to get them out." +#define SAY_WINDSOR_4_2 "Get him out of there!" +#define SAY_WINDSOR_4_3 "Good work! We're almost there, $N. This way." +#define SAY_WINDSOR_6 "This is it, $N. My stuff should be in that room. Cover me, I'm going in!" +#define SAY_WINDSOR_9 "Ah, there it is!" +#define MOB_ENTRY_REGINALD_WINDSOR 9682 Player* PlayerStart; /* struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI { - npc_marshal_windsorAI(Creature *c) : npc_escortAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } + npc_marshal_windsorAI(Creature *c) : npc_escortAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } - void WaypointReached(uint32 i) + void WaypointReached(uint32 i) { - switch( i ) + switch( i ) { - case 1: - m_creature->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - m_creature->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 10: - m_creature->setFaction(534); - break; - case 12: - m_creature->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); - pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); - break; - case 13: - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 14: - pInstance->SetData(DATA_GATE_SR,0); - m_creature->setFaction(11); - break; - case 16: - m_creature->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); - break; - case 17: - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 18: - pInstance->SetData(DATA_GATE_SC,0); - break; - case 19: - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR,403.61,-51.71,-63.92,3.600434,TEMPSUMMON_DEAD_DESPAWN ,0); - pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED); - break; - } - } + case 1: + m_creature->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + m_creature->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 10: + m_creature->setFaction(534); + break; + case 12: + m_creature->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); + pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); + break; + case 13: + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 14: + pInstance->SetData(DATA_GATE_SR,0); + m_creature->setFaction(11); + break; + case 16: + m_creature->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); + break; + case 17: + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 18: + pInstance->SetData(DATA_GATE_SC,0); + break; + case 19: + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR,403.61,-51.71,-63.92,3.600434,TEMPSUMMON_DEAD_DESPAWN ,0); + pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED); + break; + } + } void Aggro(Unit* who) - { - switch(rand()%3) - { - case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break; - case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break; - case 2:m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID);break; - } - } + { + switch(rand()%3) + { + case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break; + case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break; + case 2:m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID);break; + } + } void Reset() {} - void JustDied(Unit *slayer) + void JustDied(Unit *slayer) { - pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED); + pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED); } void UpdateAI(const uint32 diff) { - if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; - if(pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) - IsOnHold = false; - if(!pInstance->GetData(DATA_GATE_D) && pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED ) - { - m_creature->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID); - pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START); - } - if( pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED ) - { - m_creature->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID); - pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); - } - if( (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED ) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - else - { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - npc_escortAI::UpdateAI(diff); + if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if(pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) + IsOnHold = false; + if(!pInstance->GetData(DATA_GATE_D) && pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED ) + { + m_creature->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID); + pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START); + } + if( pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED ) + { + m_creature->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID); + pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); + } + if( (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED ) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + else + { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + npc_escortAI::UpdateAI(diff); } }; CreatureAI* GetAI_npc_marshal_windsor(Creature *_Creature) @@ -745,7 +746,7 @@ CreatureAI* GetAI_npc_marshal_windsor(Creature *_Creature) marshal_windsorAI->AddWaypoint(0, 316.336,-225.528, -77.7258,7000); marshal_windsorAI->AddWaypoint(1, 316.336,-225.528, -77.7258,2000); - marshal_windsorAI->AddWaypoint(2, 322.96,-207.13, -77.87,0); + marshal_windsorAI->AddWaypoint(2, 322.96,-207.13, -77.87,0); marshal_windsorAI->AddWaypoint(3, 281.05,-172.16, -75.12,0); marshal_windsorAI->AddWaypoint(4, 272.19,-139.14, -70.61,0); marshal_windsorAI->AddWaypoint(5, 283.62,-116.09, -70.21,0); @@ -758,7 +759,7 @@ CreatureAI* GetAI_npc_marshal_windsor(Creature *_Creature) marshal_windsorAI->AddWaypoint(12, 400.98,-72.01, -62.31,0); marshal_windsorAI->AddWaypoint(13, 404.22,-62.30, -63.50,2300); marshal_windsorAI->AddWaypoint(14, 404.22,-62.30, -63.50,1500); - marshal_windsorAI->AddWaypoint(154, 407.65,-51.86, -63.96,0); + marshal_windsorAI->AddWaypoint(154, 407.65,-51.86, -63.96,0); marshal_windsorAI->AddWaypoint(16, 403.61,-51.71, -63.92,1000); marshal_windsorAI->AddWaypoint(17, 403.61,-51.71, -63.92,2000); marshal_windsorAI->AddWaypoint(18, 403.61,-51.71, -63.92,1000); @@ -770,15 +771,15 @@ CreatureAI* GetAI_npc_marshal_windsor(Creature *_Creature) bool QuestAccept_npc_marshal_windsor(Player *player, Creature *creature, Quest const *quest ) { if( quest->GetQuestId() == 4322 ) - {PlayerStart = player; - if( pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED ) - { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS); - creature->setFaction(11); - } - - } + {PlayerStart = player; + if( pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED ) + { + ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS); + creature->setFaction(11); + } + + } return false; } */ @@ -786,89 +787,89 @@ bool QuestAccept_npc_marshal_windsor(Player *player, Creature *creature, Quest c ## npc_marshal_reginald_windsor ######*/ -#define SAY_REGINALD_WINDSOR_0_1 "Can you feel the power, $N??? It's time to ROCK!" -#define SAY_REGINALD_WINDSOR_0_2 "Now we just have to free Tobias and we can get out of here. This way!" -#define SAY_REGINALD_WINDSOR_5_1 "Open it." -#define SAY_REGINALD_WINDSOR_5_2 "I never did like those two. Let's get moving." -#define SAY_REGINALD_WINDSOR_7_1 "Open it and be careful this time!" -#define SAY_REGINALD_WINDSOR_7_2 "That intolerant dirtbag finally got what was coming to him. Good riddance!" -#define SAY_REGINALD_WINDSOR_7_3 "Alright, let's go." -#define SAY_REGINALD_WINDSOR_13_1 "Open it. We need to hurry up. I can smell those Dark Irons coming a mile away and I can tell you one thing, they're COMING!" -#define SAY_REGINALD_WINDSOR_13_2 "Administering fists of fury on Crest Killer!" -#define SAY_REGINALD_WINDSOR_13_3 "He has to be in the last cell. Unless... they killed him." -#define SAY_REGINALD_WINDSOR_14_1 "Get him out of there!" -#define SAY_REGINALD_WINDSOR_14_2 "Excellent work, $N. Let's find the exit. I think I know the way. Follow me!" -#define SAY_REGINALD_WINDSOR_20_1 "We made it!" -#define SAY_REGINALD_WINDSOR_20_2 "Meet me at Maxwell's encampment. We'll go over the next stages of the plan there and figure out a way to decode my tablets without the decryption ring." -#define MOB_ENTRY_SHILL_DINGER 9678 -#define MOB_ENTRY_CREST_KILLER 9680 +#define SAY_REGINALD_WINDSOR_0_1 "Can you feel the power, $N??? It's time to ROCK!" +#define SAY_REGINALD_WINDSOR_0_2 "Now we just have to free Tobias and we can get out of here. This way!" +#define SAY_REGINALD_WINDSOR_5_1 "Open it." +#define SAY_REGINALD_WINDSOR_5_2 "I never did like those two. Let's get moving." +#define SAY_REGINALD_WINDSOR_7_1 "Open it and be careful this time!" +#define SAY_REGINALD_WINDSOR_7_2 "That intolerant dirtbag finally got what was coming to him. Good riddance!" +#define SAY_REGINALD_WINDSOR_7_3 "Alright, let's go." +#define SAY_REGINALD_WINDSOR_13_1 "Open it. We need to hurry up. I can smell those Dark Irons coming a mile away and I can tell you one thing, they're COMING!" +#define SAY_REGINALD_WINDSOR_13_2 "Administering fists of fury on Crest Killer!" +#define SAY_REGINALD_WINDSOR_13_3 "He has to be in the last cell. Unless... they killed him." +#define SAY_REGINALD_WINDSOR_14_1 "Get him out of there!" +#define SAY_REGINALD_WINDSOR_14_2 "Excellent work, $N. Let's find the exit. I think I know the way. Follow me!" +#define SAY_REGINALD_WINDSOR_20_1 "We made it!" +#define SAY_REGINALD_WINDSOR_20_2 "Meet me at Maxwell's encampment. We'll go over the next stages of the plan there and figure out a way to decode my tablets without the decryption ring." +#define MOB_ENTRY_SHILL_DINGER 9678 +#define MOB_ENTRY_CREST_KILLER 9680 int wp = 0; /* struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI { - npc_marshal_reginald_windsorAI(Creature *c) : npc_escortAI(c) - { - Reset(); - } + npc_marshal_reginald_windsorAI(Creature *c) : npc_escortAI(c) + { + Reset(); + } - void WaypointReached(uint32 i) + void WaypointReached(uint32 i) { - wp=i; - switch( i ) + wp=i; + switch( i ) { - case 0: - m_creature->setFaction(11); - m_creature->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 1: - m_creature->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - m_creature->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 8: - m_creature->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 11: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - m_creature->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 12: - m_creature->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 13: - m_creature->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 20: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - m_creature->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 21: - m_creature->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 23: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - m_creature->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 24: - m_creature->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 31: - m_creature->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 32: - m_creature->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); - PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, m_creature); - pInstance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); - break; - } - } + case 0: + m_creature->setFaction(11); + m_creature->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + m_creature->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + m_creature->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 8: + m_creature->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 11: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + m_creature->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 12: + m_creature->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 13: + m_creature->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 20: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + m_creature->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 21: + m_creature->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 23: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + m_creature->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 24: + m_creature->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 31: + m_creature->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 32: + m_creature->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); + PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, m_creature); + pInstance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); + break; + } + } void MoveInLineOfSight(Unit *who) { @@ -883,73 +884,73 @@ struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI if( m_creature->IsWithinDistInMap(who, Radius) ) { IsOnHold = false; - ((npc_escortAI*)(m_creature->AI()))->Start(true, true, false, who->GetGUID()); + ((npc_escortAI*)(m_creature->AI()))->Start(true, true, false, who->GetGUID()); } } } } void Aggro(Unit* who) - { - switch(rand()%3) - { - case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break; - case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break; - case 2:m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID);break; - } - } + { + switch(rand()%3) + { + case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break; + case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break; + case 2:m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID);break; + } + } void Reset() {} - void JustDied(Unit *slayer) + void JustDied(Unit *slayer) { - pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED); + pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED); } void UpdateAI(const uint32 diff) { - if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; - if(wp==7) - { - if(!pInstance->GetData(DATA_GATE_J) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED ) - { - pInstance->SetData(DATA_CREATURE_JAZ,1); - pInstance->SetData(DATA_JAZ,ENCOUNTER_STATE_IN_PROGRESS); - } - if( pInstance->GetData(DATA_CREATURE_JAZ) && pInstance->GetData(DATA_CREATURE_OGRABISI) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS ) - { - IsOnHold = false; - pInstance->SetData(DATA_JAZ,ENCOUNTER_STATE_ENDED); - } - } - else if(wp==11) - { - if(!pInstance->GetData(DATA_GATE_S) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED ) - { - pInstance->SetData(DATA_CREATURE_SHILL,1); - pInstance->SetData(DATA_SHILL,ENCOUNTER_STATE_IN_PROGRESS); - } - if( pInstance->GetData(DATA_CREATURE_SHILL) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS ) - { - pInstance->SetData(DATA_SHILL,ENCOUNTER_STATE_ENDED); - IsOnHold = false; - } - } - else if(wp==20) - { - if(!pInstance->GetData(DATA_GATE_C) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED) - { - pInstance->SetData(DATA_CREATURE_CREST,1); - m_creature->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID); - pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_IN_PROGRESS); - } - if( pInstance->GetData(DATA_CREATURE_CREST) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS ) - { - IsOnHold = false; - pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_ENDED); - } - } - if( pInstance->GetData(DATA_TOBIAS)==ENCOUNTER_STATE_OBJECTIVE_COMPLETED ) IsOnHold = false; - npc_escortAI::UpdateAI(diff); + if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if(wp==7) + { + if(!pInstance->GetData(DATA_GATE_J) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED ) + { + pInstance->SetData(DATA_CREATURE_JAZ,1); + pInstance->SetData(DATA_JAZ,ENCOUNTER_STATE_IN_PROGRESS); + } + if( pInstance->GetData(DATA_CREATURE_JAZ) && pInstance->GetData(DATA_CREATURE_OGRABISI) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS ) + { + IsOnHold = false; + pInstance->SetData(DATA_JAZ,ENCOUNTER_STATE_ENDED); + } + } + else if(wp==11) + { + if(!pInstance->GetData(DATA_GATE_S) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED ) + { + pInstance->SetData(DATA_CREATURE_SHILL,1); + pInstance->SetData(DATA_SHILL,ENCOUNTER_STATE_IN_PROGRESS); + } + if( pInstance->GetData(DATA_CREATURE_SHILL) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS ) + { + pInstance->SetData(DATA_SHILL,ENCOUNTER_STATE_ENDED); + IsOnHold = false; + } + } + else if(wp==20) + { + if(!pInstance->GetData(DATA_GATE_C) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED) + { + pInstance->SetData(DATA_CREATURE_CREST,1); + m_creature->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID); + pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_IN_PROGRESS); + } + if( pInstance->GetData(DATA_CREATURE_CREST) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS ) + { + IsOnHold = false; + pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_ENDED); + } + } + if( pInstance->GetData(DATA_TOBIAS)==ENCOUNTER_STATE_OBJECTIVE_COMPLETED ) IsOnHold = false; + npc_escortAI::UpdateAI(diff); } }; CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature *_Creature) @@ -962,9 +963,9 @@ CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature *_Creature) marshal_reginald_windsorAI->AddWaypoint(3, 407.99,-73.91, -62.26,0); marshal_reginald_windsorAI->AddWaypoint(4, 557.03,-119.71, -61.83,0); marshal_reginald_windsorAI->AddWaypoint(5, 573.40,-124.39, -65.07,0); - marshal_reginald_windsorAI->AddWaypoint(6, 593.91,-130.29, -69.25,0); - marshal_reginald_windsorAI->AddWaypoint(7, 593.21,-132.16, -69.25,0); - marshal_reginald_windsorAI->AddWaypoint(8, 593.21,-132.16, -69.25,3000); + marshal_reginald_windsorAI->AddWaypoint(6, 593.91,-130.29, -69.25,0); + marshal_reginald_windsorAI->AddWaypoint(7, 593.21,-132.16, -69.25,0); + marshal_reginald_windsorAI->AddWaypoint(8, 593.21,-132.16, -69.25,3000); marshal_reginald_windsorAI->AddWaypoint(9, 622.81,-135.55, -71.92,0); marshal_reginald_windsorAI->AddWaypoint(10, 634.68,-151.29, -70.32,0); marshal_reginald_windsorAI->AddWaypoint(11, 635.06,-153.25, -70.32,0); @@ -973,33 +974,33 @@ CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature *_Creature) marshal_reginald_windsorAI->AddWaypoint(14, 655.25,-172.39, -73.72,0); marshal_reginald_windsorAI->AddWaypoint(15, 654.79,-226.30, -83.06,0); marshal_reginald_windsorAI->AddWaypoint(16, 622.85,-268.85, -83.96,0); - marshal_reginald_windsorAI->AddWaypoint(17, 579.45,-275.56, -80.44,0); + marshal_reginald_windsorAI->AddWaypoint(17, 579.45,-275.56, -80.44,0); marshal_reginald_windsorAI->AddWaypoint(18, 561.19,-266.85, -75.59,0); - marshal_reginald_windsorAI->AddWaypoint(19, 547.91,-253.92, -70.34,0); - marshal_reginald_windsorAI->AddWaypoint(20, 549.20,-252.40, -70.34,0); - marshal_reginald_windsorAI->AddWaypoint(21, 549.20,-252.40, -70.34,4000); + marshal_reginald_windsorAI->AddWaypoint(19, 547.91,-253.92, -70.34,0); + marshal_reginald_windsorAI->AddWaypoint(20, 549.20,-252.40, -70.34,0); + marshal_reginald_windsorAI->AddWaypoint(21, 549.20,-252.40, -70.34,4000); marshal_reginald_windsorAI->AddWaypoint(22, 555.33,-269.16, -74.40,0); marshal_reginald_windsorAI->AddWaypoint(23, 554.31,-270.88, -74.40,0); marshal_reginald_windsorAI->AddWaypoint(24, 554.31,-270.88, -74.40,4000); - marshal_reginald_windsorAI->AddWaypoint(25, 536.10,-249.60, -67.47,0); + marshal_reginald_windsorAI->AddWaypoint(25, 536.10,-249.60, -67.47,0); marshal_reginald_windsorAI->AddWaypoint(26, 520.94,-216.65, -59.28,0); - marshal_reginald_windsorAI->AddWaypoint(27, 505.99,-148.74, -62.17,0); + marshal_reginald_windsorAI->AddWaypoint(27, 505.99,-148.74, -62.17,0); marshal_reginald_windsorAI->AddWaypoint(28, 484.21,-56.24, -62.43,0); - marshal_reginald_windsorAI->AddWaypoint(29, 470.39,-6.01, -70.10,0); + marshal_reginald_windsorAI->AddWaypoint(29, 470.39,-6.01, -70.10,0); marshal_reginald_windsorAI->AddWaypoint(30, 451.27,30.85, -70.07,0); marshal_reginald_windsorAI->AddWaypoint(31, 452.45,29.85, -70.37,1500); marshal_reginald_windsorAI->AddWaypoint(32, 452.45,29.85, -70.37,7000); marshal_reginald_windsorAI->AddWaypoint(33, 452.45,29.85, -70.37,10000); marshal_reginald_windsorAI->AddWaypoint(34, 451.27,31.85, -70.07,0); - return (CreatureAI*)marshal_reginald_windsorAI; + return (CreatureAI*)marshal_reginald_windsorAI; } */ /*###### ## npc_tobias_seecher ######*/ -#define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!" +#define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!" /* struct TRINITY_DLL_DECL npc_tobias_seecherAI : public npc_escortAI { @@ -1012,45 +1013,45 @@ struct TRINITY_DLL_DECL npc_tobias_seecherAI : public npc_escortAI { if (IsBeingEscorted && killer == m_creature) { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED); } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 i) { - switch(i) - { - case 0:m_creature->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 2: - pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 4: - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED); - break; - } - } + switch(i) + { + case 0:m_creature->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break; + case 2: + pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; + case 4: + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED); + break; + } + } void UpdateAI(const uint32 diff) { - if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; - if( (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED ) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - else - { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - npc_escortAI::UpdateAI(diff); + if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if( (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED ) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + else + { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + npc_escortAI::UpdateAI(diff); } }; @@ -1069,10 +1070,10 @@ CreatureAI* GetAI_npc_tobias_seecher(Creature *_Creature) bool GossipHello_npc_tobias_seecher(Player *player, Creature *_Creature) { - if(player->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS ) + if(player->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS ) { player->ADD_GOSSIP_ITEM(0, "Get out of here, Tobias, you're free!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2847, _Creature->GetGUID()); + player->SEND_GOSSIP_MENU(2847, _Creature->GetGUID()); } return true; } @@ -1083,8 +1084,8 @@ bool GossipSelect_npc_tobias_seecher(Player *player, Creature *_Creature, uint32 { player->CLOSE_GOSSIP_MENU(); ((npc_escortAI*)(_Creature->AI()))->Start(false, false, true, player->GetGUID()); - _Creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_IN_PROGRESS); + _Creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_IN_PROGRESS); } return true; } @@ -1100,159 +1101,159 @@ bool GossipSelect_npc_tobias_seecher(Player *player, Creature *_Creature, uint32 float BarWpLocations[8][3]= { - {883.294861, -188.926300, -43.703655}, - {872.763550, -185.605621, -43.703655}, //b1 - {867.923401, -188.006393, -43.703655}, //b2 - {863.295898, -190.795212, -43.703655}, //b3 - {856.139587, -194.652756, -43.703655}, //b4 - {851.878906, -196.928131, -43.703655}, //b5 - {877.035217, -187.048080, -43.703655}, - {891.198000, -197.924000, -43.620400} //home + {883.294861, -188.926300, -43.703655}, + {872.763550, -185.605621, -43.703655}, //b1 + {867.923401, -188.006393, -43.703655}, //b2 + {863.295898, -190.795212, -43.703655}, //b3 + {856.139587, -194.652756, -43.703655}, //b4 + {851.878906, -196.928131, -43.703655}, //b5 + {877.035217, -187.048080, -43.703655}, + {891.198000, -197.924000, -43.620400} //home }; uint32 BarWpWait[8]= { - 0, - 5000, - 5000, - 5000, - 5000, - 15000, - 0, - 0 + 0, + 5000, + 5000, + 5000, + 5000, + 15000, + 0, + 0 }; struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI { - npc_rocknotAI(Creature *c) : npc_escortAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } - - ScriptedInstance* pInstance; - - uint32 BreakKeg_Timer; - uint32 BreakDoor_Timer; - - void Reset() - { - if (IsBeingEscorted) - return; - - BreakKeg_Timer = 0; - BreakDoor_Timer = 0; - } - - void Aggro(Unit *who) { } - - void DoGo(uint32 id, uint32 state) - { - if (GameObject *go = GameObject::GetGameObject(*m_creature,pInstance->GetData64(id))) - go->SetGoState(state); - } - - void WaypointReached(uint32 i) - { - if (!pInstance) - return; - - switch(i) - { - case 1: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 2: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); - break; - case 3: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); - break; - case 4: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 5: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - BreakKeg_Timer = 2000; - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (BreakKeg_Timer) - { - if (BreakKeg_Timer <= diff) - { - DoGo(DATA_GO_BAR_KEG,0); - BreakKeg_Timer = 0; - BreakDoor_Timer = 1000; - }else BreakKeg_Timer -= diff; - } - - if (BreakDoor_Timer) - { - if (BreakDoor_Timer <= diff) - { - DoGo(DATA_GO_BAR_DOOR,2); - DoGo(DATA_GO_BAR_KEG_TRAP,0); //doesn't work very well, leaving code here for future - //spell by trap has effect61, this indicate the bar go hostile - - if (Unit *tmp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_PHALANX))) - tmp->setFaction(14); - - //for later, this event(s) has alot more to it. - //optionally, DONE can trigger bar to go hostile. - pInstance->SetData(TYPE_BAR,DONE); - - BreakDoor_Timer = 0; - }else BreakDoor_Timer -= diff; - } - - npc_escortAI::UpdateAI(diff); - } + npc_rocknotAI(Creature *c) : npc_escortAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } + + ScriptedInstance* pInstance; + + uint32 BreakKeg_Timer; + uint32 BreakDoor_Timer; + + void Reset() + { + if (IsBeingEscorted) + return; + + BreakKeg_Timer = 0; + BreakDoor_Timer = 0; + } + + void Aggro(Unit *who) { } + + void DoGo(uint32 id, uint32 state) + { + if (GameObject *go = GameObject::GetGameObject(*m_creature,pInstance->GetData64(id))) + go->SetGoState(state); + } + + void WaypointReached(uint32 i) + { + if (!pInstance) + return; + + switch(i) + { + case 1: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 2: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); + break; + case 3: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); + break; + case 4: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 5: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + BreakKeg_Timer = 2000; + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (BreakKeg_Timer) + { + if (BreakKeg_Timer <= diff) + { + DoGo(DATA_GO_BAR_KEG,0); + BreakKeg_Timer = 0; + BreakDoor_Timer = 1000; + }else BreakKeg_Timer -= diff; + } + + if (BreakDoor_Timer) + { + if (BreakDoor_Timer <= diff) + { + DoGo(DATA_GO_BAR_DOOR,2); + DoGo(DATA_GO_BAR_KEG_TRAP,0); //doesn't work very well, leaving code here for future + //spell by trap has effect61, this indicate the bar go hostile + + if (Unit *tmp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_PHALANX))) + tmp->setFaction(14); + + //for later, this event(s) has alot more to it. + //optionally, DONE can trigger bar to go hostile. + pInstance->SetData(TYPE_BAR,DONE); + + BreakDoor_Timer = 0; + }else BreakDoor_Timer -= diff; + } + + npc_escortAI::UpdateAI(diff); + } }; CreatureAI* GetAI_npc_rocknot(Creature *_Creature) { - npc_rocknotAI* Rocknot_AI = new npc_rocknotAI(_Creature); + npc_rocknotAI* Rocknot_AI = new npc_rocknotAI(_Creature); - for(uint8 i = 0; i < 8; ++i) - Rocknot_AI->AddWaypoint(i, BarWpLocations[i][0], BarWpLocations[i][1], BarWpLocations[i][2], BarWpWait[i]); + for(uint8 i = 0; i < 8; ++i) + Rocknot_AI->AddWaypoint(i, BarWpLocations[i][0], BarWpLocations[i][1], BarWpLocations[i][2], BarWpWait[i]); - return (CreatureAI*)Rocknot_AI; + return (CreatureAI*)Rocknot_AI; } bool ChooseReward_npc_rocknot(Player *player, Creature *_Creature, const Quest *_Quest, uint32 item) { - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); - if (!pInstance) - return true; + if (!pInstance) + return true; - if (pInstance->GetData(TYPE_BAR) == DONE || pInstance->GetData(TYPE_BAR) == SPECIAL) - return true; + if (pInstance->GetData(TYPE_BAR) == DONE || pInstance->GetData(TYPE_BAR) == SPECIAL) + return true; - if (_Quest->GetQuestId() == QUEST_ALE) - { - if (pInstance->GetData(TYPE_BAR) != IN_PROGRESS) - pInstance->SetData(TYPE_BAR,IN_PROGRESS); + if (_Quest->GetQuestId() == QUEST_ALE) + { + if (pInstance->GetData(TYPE_BAR) != IN_PROGRESS) + pInstance->SetData(TYPE_BAR,IN_PROGRESS); - pInstance->SetData(TYPE_BAR,SPECIAL); + pInstance->SetData(TYPE_BAR,SPECIAL); - //keep track of amount in instance script, returns SPECIAL if amount ok and event in progress - if (pInstance->GetData(TYPE_BAR) == SPECIAL) - { - DoScriptText(SAY_GOT_BEER, _Creature); - _Creature->CastSpell(_Creature,SPELL_DRUNKEN_RAGE,false); - ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false); - } - } + //keep track of amount in instance script, returns SPECIAL if amount ok and event in progress + if (pInstance->GetData(TYPE_BAR) == SPECIAL) + { + DoScriptText(SAY_GOT_BEER, _Creature); + _Creature->CastSpell(_Creature,SPELL_DRUNKEN_RAGE,false); + ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false); + } + } - return true; + return true; } /*###### @@ -1263,15 +1264,15 @@ void AddSC_blackrock_depths() { Script *newscript; - newscript = new Script; - newscript->Name = "at_ring_of_law"; - newscript->pAreaTrigger = &AreaTrigger_at_ring_of_law; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "at_ring_of_law"; + newscript->pAreaTrigger = &AreaTrigger_at_ring_of_law; + newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "npc_grimstone"; - newscript->GetAI = &GetAI_npc_grimstone; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_grimstone"; + newscript->GetAI = &GetAI_npc_grimstone; + newscript->RegisterSelf(); newscript = new Script; newscript->Name="phalanx"; @@ -1290,34 +1291,34 @@ void AddSC_blackrock_depths() newscript->pGossipSelect = &GossipSelect_npc_lokhtos_darkbargainer; newscript->RegisterSelf(); /* - newscript = new Script; - newscript->Name="npc_dughal_stormwing"; - newscript->pGossipHello = &GossipHello_npc_dughal_stormwing; - newscript->pGossipSelect = &GossipSelect_npc_dughal_stormwing; - newscript->GetAI = &GetAI_npc_dughal_stormwing; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_tobias_seecher"; + newscript = new Script; + newscript->Name="npc_dughal_stormwing"; + newscript->pGossipHello = &GossipHello_npc_dughal_stormwing; + newscript->pGossipSelect = &GossipSelect_npc_dughal_stormwing; + newscript->GetAI = &GetAI_npc_dughal_stormwing; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_tobias_seecher"; newscript->pGossipHello = &GossipHello_npc_tobias_seecher; newscript->pGossipSelect = &GossipSelect_npc_tobias_seecher; - newscript->GetAI = &GetAI_npc_tobias_seecher; - newscript->RegisterSelf(); + newscript->GetAI = &GetAI_npc_tobias_seecher; + newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="npc_marshal_windsor"; newscript->pQuestAccept = &QuestAccept_npc_marshal_windsor; - newscript->GetAI = &GetAI_npc_marshal_windsor; + newscript->GetAI = &GetAI_npc_marshal_windsor; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="npc_marshal_reginald_windsor"; - newscript->GetAI = &GetAI_npc_marshal_reginald_windsor; - newscript->RegisterSelf();*/ - - newscript = new Script; - newscript->Name = "npc_rocknot"; - newscript->GetAI = &GetAI_npc_rocknot; - newscript->pChooseReward = &ChooseReward_npc_rocknot; - newscript->RegisterSelf(); + newscript->GetAI = &GetAI_npc_marshal_reginald_windsor; + newscript->RegisterSelf();*/ + + newscript = new Script; + newscript->Name = "npc_rocknot"; + newscript->GetAI = &GetAI_npc_rocknot; + newscript->pChooseReward = &ChooseReward_npc_rocknot; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp index 324e3bb8816..3ae0b910d07 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp @@ -57,244 +57,244 @@ update `instance_template` set `script`='instance_blackrock_depths' where `map`= struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance { - instance_blackrock_depths(Map *map) : ScriptedInstance(map) {Initialize();}; - - uint32 Encounter[ENCOUNTERS]; - std::string str_data; - - uint64 EmperorGUID; - uint64 PhalanxGUID; - - uint64 GoArena1GUID; - uint64 GoArena2GUID; - uint64 GoArena3GUID; - uint64 GoArena4GUID; - uint64 GoShadowLockGUID; - uint64 GoShadowMechGUID; - uint64 GoShadowGiantGUID; - uint64 GoShadowDummyGUID; - uint64 GoBarKegGUID; - uint64 GoBarKegTrapGUID; - uint64 GoBarDoorGUID; - uint64 GoTombEnterGUID; - uint64 GoTombExitGUID; - uint64 GoLyceumGUID; - uint64 GoGolemNGUID; - uint64 GoGolemSGUID; - uint64 GoThoneGUID; - - uint32 BarAleCount; - - void Initialize() - { - EmperorGUID = 0; - PhalanxGUID = 0; - - GoArena1GUID = 0; - GoArena2GUID = 0; - GoArena3GUID = 0; - GoArena4GUID = 0; - GoShadowLockGUID = 0; - GoShadowMechGUID = 0; - GoShadowGiantGUID = 0; - GoShadowDummyGUID = 0; - GoBarKegGUID = 0; - GoBarKegTrapGUID = 0; - GoBarDoorGUID = 0; - GoTombEnterGUID = 0; - GoTombExitGUID = 0; - GoLyceumGUID = 0; - GoGolemNGUID = 0; - GoGolemSGUID = 0; - GoThoneGUID = 0; - - BarAleCount = 0; - - for(uint8 i = 0; i < ENCOUNTERS; i++) - Encounter[i] = NOT_STARTED; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("SD2: Instance Blackrock Depths: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void OnCreatureCreate(Creature *creature, uint32 creature_entry) - { - switch(creature->GetEntry()) - { - case C_EMPEROR: EmperorGUID = creature->GetGUID(); break; - case C_PHALANX: PhalanxGUID = creature->GetGUID(); break; - } - } - - void OnObjectCreate(GameObject* go) - { - switch(go->GetEntry()) - { - case GO_ARENA1: GoArena1GUID = go->GetGUID(); break; - case GO_ARENA2: GoArena2GUID = go->GetGUID(); break; - case GO_ARENA3: GoArena3GUID = go->GetGUID(); break; - case GO_ARENA4: GoArena4GUID = go->GetGUID(); break; - case GO_SHADOW_LOCK: GoShadowLockGUID = go->GetGUID(); break; - case GO_SHADOW_MECHANISM: GoShadowMechGUID = go->GetGUID(); break; - case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = go->GetGUID(); break; - case GO_SHADOW_DUMMY: GoShadowDummyGUID = go->GetGUID(); break; - case GO_BAR_KEG_SHOT: GoBarKegGUID = go->GetGUID(); break; - case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = go->GetGUID(); break; - case GO_BAR_DOOR: GoBarDoorGUID = go->GetGUID(); break; - case GO_TOMB_ENTER: GoTombEnterGUID = go->GetGUID(); break; - case GO_TOMB_EXIT: GoTombExitGUID = go->GetGUID(); break; - case GO_LYCEUM: GoLyceumGUID = go->GetGUID(); break; - case GO_GOLEM_ROOM_N: GoGolemNGUID = go->GetGUID(); break; - case GO_GOLEM_ROOM_S: GoGolemSGUID = go->GetGUID(); break; - case GO_THONE_ROOM: GoThoneGUID = go->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) - { - Player *player = GetPlayerInMap(); - - if (!player) - { - debug_log("SD2: Instance Blackrock Depths: SetData (Type: %u Data %u) cannot find any player.", type, data); - return; - } - - debug_log("SD2: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); - - switch(type) - { - case TYPE_RING_OF_LAW: - Encounter[0] = data; - break; - case TYPE_VAULT: - Encounter[1] = data; - break; - case TYPE_BAR: - if (data == SPECIAL) - ++BarAleCount; - else - Encounter[2] = data; - break; - case TYPE_TOMB_OF_SEVEN: - Encounter[3] = data; - break; - case TYPE_LYCEUM: - Encounter[4] = data; - break; - case TYPE_IRON_HALL: - Encounter[5] = data; - break; - } - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << Encounter[0] << " " << Encounter[1] << " " << Encounter[2] << " " - << Encounter[3] << " " << Encounter[4] << " " << Encounter[5]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_RING_OF_LAW: - return Encounter[0]; - case TYPE_VAULT: - return Encounter[1]; - case TYPE_BAR: - if (Encounter[2] == IN_PROGRESS && BarAleCount == 3) - return SPECIAL; - else - return Encounter[2]; - case TYPE_TOMB_OF_SEVEN: - return Encounter[3]; - case TYPE_LYCEUM: - return Encounter[4]; - case TYPE_IRON_HALL: - return Encounter[5]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_EMPEROR: - return EmperorGUID; - case DATA_PHALANX: - return PhalanxGUID; - case DATA_ARENA1: - return GoArena1GUID; - case DATA_ARENA2: - return GoArena2GUID; - case DATA_ARENA3: - return GoArena3GUID; - case DATA_ARENA4: - return GoArena4GUID; - case DATA_GO_BAR_KEG: - return GoBarKegGUID; - case DATA_GO_BAR_KEG_TRAP: - return GoBarKegTrapGUID; - case DATA_GO_BAR_DOOR: - return GoBarDoorGUID; - } - return 0; - } - - const char* Save() - { - return str_data.c_str(); - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3] - >> Encounter[4] >> Encounter[5]; - - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if (Encounter[i] == IN_PROGRESS) - Encounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } + instance_blackrock_depths(Map *map) : ScriptedInstance(map) {Initialize();}; + + uint32 Encounter[ENCOUNTERS]; + std::string str_data; + + uint64 EmperorGUID; + uint64 PhalanxGUID; + + uint64 GoArena1GUID; + uint64 GoArena2GUID; + uint64 GoArena3GUID; + uint64 GoArena4GUID; + uint64 GoShadowLockGUID; + uint64 GoShadowMechGUID; + uint64 GoShadowGiantGUID; + uint64 GoShadowDummyGUID; + uint64 GoBarKegGUID; + uint64 GoBarKegTrapGUID; + uint64 GoBarDoorGUID; + uint64 GoTombEnterGUID; + uint64 GoTombExitGUID; + uint64 GoLyceumGUID; + uint64 GoGolemNGUID; + uint64 GoGolemSGUID; + uint64 GoThoneGUID; + + uint32 BarAleCount; + + void Initialize() + { + EmperorGUID = 0; + PhalanxGUID = 0; + + GoArena1GUID = 0; + GoArena2GUID = 0; + GoArena3GUID = 0; + GoArena4GUID = 0; + GoShadowLockGUID = 0; + GoShadowMechGUID = 0; + GoShadowGiantGUID = 0; + GoShadowDummyGUID = 0; + GoBarKegGUID = 0; + GoBarKegTrapGUID = 0; + GoBarDoorGUID = 0; + GoTombEnterGUID = 0; + GoTombExitGUID = 0; + GoLyceumGUID = 0; + GoGolemNGUID = 0; + GoGolemSGUID = 0; + GoThoneGUID = 0; + + BarAleCount = 0; + + for(uint8 i = 0; i < ENCOUNTERS; i++) + Encounter[i] = NOT_STARTED; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("SD2: Instance Blackrock Depths: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnCreatureCreate(Creature *creature, uint32 creature_entry) + { + switch(creature->GetEntry()) + { + case C_EMPEROR: EmperorGUID = creature->GetGUID(); break; + case C_PHALANX: PhalanxGUID = creature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* go) + { + switch(go->GetEntry()) + { + case GO_ARENA1: GoArena1GUID = go->GetGUID(); break; + case GO_ARENA2: GoArena2GUID = go->GetGUID(); break; + case GO_ARENA3: GoArena3GUID = go->GetGUID(); break; + case GO_ARENA4: GoArena4GUID = go->GetGUID(); break; + case GO_SHADOW_LOCK: GoShadowLockGUID = go->GetGUID(); break; + case GO_SHADOW_MECHANISM: GoShadowMechGUID = go->GetGUID(); break; + case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = go->GetGUID(); break; + case GO_SHADOW_DUMMY: GoShadowDummyGUID = go->GetGUID(); break; + case GO_BAR_KEG_SHOT: GoBarKegGUID = go->GetGUID(); break; + case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = go->GetGUID(); break; + case GO_BAR_DOOR: GoBarDoorGUID = go->GetGUID(); break; + case GO_TOMB_ENTER: GoTombEnterGUID = go->GetGUID(); break; + case GO_TOMB_EXIT: GoTombExitGUID = go->GetGUID(); break; + case GO_LYCEUM: GoLyceumGUID = go->GetGUID(); break; + case GO_GOLEM_ROOM_N: GoGolemNGUID = go->GetGUID(); break; + case GO_GOLEM_ROOM_S: GoGolemSGUID = go->GetGUID(); break; + case GO_THONE_ROOM: GoThoneGUID = go->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) + { + Player *player = GetPlayerInMap(); + + if (!player) + { + debug_log("SD2: Instance Blackrock Depths: SetData (Type: %u Data %u) cannot find any player.", type, data); + return; + } + + debug_log("SD2: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); + + switch(type) + { + case TYPE_RING_OF_LAW: + Encounter[0] = data; + break; + case TYPE_VAULT: + Encounter[1] = data; + break; + case TYPE_BAR: + if (data == SPECIAL) + ++BarAleCount; + else + Encounter[2] = data; + break; + case TYPE_TOMB_OF_SEVEN: + Encounter[3] = data; + break; + case TYPE_LYCEUM: + Encounter[4] = data; + break; + case TYPE_IRON_HALL: + Encounter[5] = data; + break; + } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << Encounter[0] << " " << Encounter[1] << " " << Encounter[2] << " " + << Encounter[3] << " " << Encounter[4] << " " << Encounter[5]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_RING_OF_LAW: + return Encounter[0]; + case TYPE_VAULT: + return Encounter[1]; + case TYPE_BAR: + if (Encounter[2] == IN_PROGRESS && BarAleCount == 3) + return SPECIAL; + else + return Encounter[2]; + case TYPE_TOMB_OF_SEVEN: + return Encounter[3]; + case TYPE_LYCEUM: + return Encounter[4]; + case TYPE_IRON_HALL: + return Encounter[5]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_EMPEROR: + return EmperorGUID; + case DATA_PHALANX: + return PhalanxGUID; + case DATA_ARENA1: + return GoArena1GUID; + case DATA_ARENA2: + return GoArena2GUID; + case DATA_ARENA3: + return GoArena3GUID; + case DATA_ARENA4: + return GoArena4GUID; + case DATA_GO_BAR_KEG: + return GoBarKegGUID; + case DATA_GO_BAR_KEG_TRAP: + return GoBarKegTrapGUID; + case DATA_GO_BAR_DOOR: + return GoBarDoorGUID; + } + return 0; + } + + const char* Save() + { + return str_data.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3] + >> Encounter[4] >> Encounter[5]; + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if (Encounter[i] == IN_PROGRESS) + Encounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } }; InstanceData* GetInstanceData_instance_blackrock_depths(Map* map) { - return new instance_blackrock_depths(map); + return new instance_blackrock_depths(map); } void AddSC_instance_blackrock_depths() diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp index 1c3632c2326..32c7ae2aef6 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp @@ -74,7 +74,7 @@ struct TRINITY_DLL_DECL boss_flamegorAI : public ScriptedAI //Frenzy_Timer if (Frenzy_Timer < diff) { - DoScriptText(EMOTE_FRENZY, m_creature); + DoScriptText(EMOTE_FRENZY, m_creature); DoCast(m_creature,SPELL_FRENZY); Frenzy_Timer = 8000 + (rand()%2000); }else Frenzy_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp index 17958fb8ce0..d2d5f53e37c 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp @@ -40,15 +40,15 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI { - boss_aeonusAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Reset(); - } + boss_aeonusAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Reset(); + } - ScriptedInstance *pInstance; - bool HeroicMode; + ScriptedInstance *pInstance; + bool HeroicMode; uint32 SandBreath_Timer; uint32 TimeStop_Timer; @@ -66,28 +66,28 @@ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI DoScriptText(SAY_AGGRO, m_creature); } - void MoveInLineOfSight(Unit *who) - { - //Despawn Time Keeper - if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) - { - if (m_creature->IsWithinDistInMap(who,20.0f)) - { - DoScriptText(SAY_BANISH, m_creature); - m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } + void MoveInLineOfSight(Unit *who) + { + //Despawn Time Keeper + if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) + { + if (m_creature->IsWithinDistInMap(who,20.0f)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } void JustDied(Unit *victim) { DoScriptText(SAY_DEATH, m_creature); - if (pInstance) + if (pInstance) { - pInstance->SetData(TYPE_RIFT,DONE); + pInstance->SetData(TYPE_RIFT,DONE); pInstance->SetData(TYPE_MEDIVH,DONE);//FIXME: later should be removed } } @@ -110,7 +110,7 @@ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI //Sand Breath if (SandBreath_Timer < diff) { - DoCast(m_creature->getVictim(), SPELL_SAND_BREATH); + DoCast(m_creature->getVictim(), SPELL_SAND_BREATH); SandBreath_Timer = 30000; }else SandBreath_Timer -= diff; @@ -124,7 +124,7 @@ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI //Frenzy if (Frenzy_Timer < diff) { - DoScriptText(EMOTE_FRENZY, m_creature); + DoScriptText(EMOTE_FRENZY, m_creature); DoCast(m_creature, SPELL_ENRAGE); Frenzy_Timer = 120000; }else Frenzy_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp index 79f5ff10920..106a330ec5e 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp @@ -41,14 +41,14 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI { boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Reset(); - } + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Reset(); + } - ScriptedInstance *pInstance; - bool HeroicMode; + ScriptedInstance *pInstance; + bool HeroicMode; uint32 ArcaneBlast_Timer; uint32 TimeLapse_Timer; @@ -64,20 +64,20 @@ struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI DoScriptText(SAY_AGGRO, m_creature); } - void MoveInLineOfSight(Unit *who) - { - //Despawn Time Keeper - if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) - { - if (m_creature->IsWithinDistInMap(who,20.0f)) - { - DoScriptText(SAY_BANISH, m_creature); - m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } + void MoveInLineOfSight(Unit *who) + { + //Despawn Time Keeper + if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) + { + if (m_creature->IsWithinDistInMap(who,20.0f)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } void KilledUnit(Unit *victim) { @@ -92,8 +92,8 @@ struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI { DoScriptText(SAY_DEATH, m_creature); - if (pInstance) - pInstance->SetData(TYPE_RIFT,SPECIAL); + if (pInstance) + pInstance->SetData(TYPE_RIFT,SPECIAL); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp index cacb460ac92..d55a4c61f98 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp @@ -39,15 +39,15 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI { - boss_temporusAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Reset(); - } + boss_temporusAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Reset(); + } - ScriptedInstance *pInstance; - bool HeroicMode; + ScriptedInstance *pInstance; + bool HeroicMode; uint32 Haste_Timer; uint32 SpellReflection_Timer; @@ -79,8 +79,8 @@ struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI { DoScriptText(SAY_DEATH, m_creature); - if (pInstance) - pInstance->SetData(TYPE_RIFT,SPECIAL); + if (pInstance) + pInstance->SetData(TYPE_RIFT,SPECIAL); } void MoveInLineOfSight(Unit *who) @@ -88,9 +88,9 @@ struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI //Despawn Time Keeper if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) { - if (m_creature->IsWithinDistInMap(who,20.0f)) + if (m_creature->IsWithinDistInMap(who,20.0f)) { - DoScriptText(SAY_BANISH, m_creature); + DoScriptText(SAY_BANISH, m_creature); m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp index 1f12c88e8f3..58228135a01 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp @@ -56,293 +56,293 @@ EndContentData */ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI { - npc_medivh_bmAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } - - ScriptedInstance *pInstance; - - uint32 SpellCorrupt_Timer; - uint32 Check_Timer; - - bool Life75; - bool Life50; - bool Life25; - - void Reset() - { - SpellCorrupt_Timer = 0; - - if (!pInstance) - return; - - if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) - m_creature->CastSpell(m_creature,SPELL_CHANNEL,true); - else if (m_creature->HasAura(SPELL_CHANNEL,0)) - m_creature->RemoveAura(SPELL_CHANNEL,0); - - m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true); - } - - void MoveInLineOfSight(Unit *who) - { - if (!pInstance) - return; - - if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f)) - { - if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) - return; - - DoScriptText(SAY_INTRO, m_creature); - pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS); - m_creature->CastSpell(m_creature,SPELL_CHANNEL,false); - Check_Timer = 5000; - } - else if (who->GetTypeId() == TYPEID_UNIT && m_creature->IsWithinDistInMap(who, 15.0f)) - { - if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) - return; - - uint32 entry = who->GetEntry(); - if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU) - { - who->StopMoving(); - who->CastSpell(m_creature,SPELL_CORRUPT,false); - } - else if (entry == C_AEONUS) - { - who->StopMoving(); - who->CastSpell(m_creature,SPELL_CORRUPT_AEONUS,false); - } - } - } - - void AttackStart(Unit *who) - { - //if (pInstance && pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) - //return; - - //ScriptedAI::AttackStart(who); - } - - void Aggro(Unit *who) {} - - void SpellHit(Unit* caster, const SpellEntry* spell) - { - if (SpellCorrupt_Timer) - return; - - if (spell->Id == SPELL_CORRUPT_AEONUS) - SpellCorrupt_Timer = 1000; - - if (spell->Id == SPELL_CORRUPT) - SpellCorrupt_Timer = 3000; - } - - void JustDied(Unit* Killer) - { - if (Killer->GetEntry() == m_creature->GetEntry()) - return; - - DoScriptText(SAY_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (SpellCorrupt_Timer) - { - if (SpellCorrupt_Timer < diff) - { - pInstance->SetData(TYPE_MEDIVH,SPECIAL); - - if (m_creature->HasAura(SPELL_CORRUPT_AEONUS,0)) - SpellCorrupt_Timer = 1000; - else if (m_creature->HasAura(SPELL_CORRUPT,0)) - SpellCorrupt_Timer = 3000; - else - SpellCorrupt_Timer = 0; - }else SpellCorrupt_Timer -= diff; - } - - if (Check_Timer) - { - if (Check_Timer < diff) - { - uint32 pct = pInstance->GetData(DATA_SHIELD); - - Check_Timer = 5000; - - if (Life25 && pct <= 25) - { - DoScriptText(SAY_WEAK25, m_creature); - Life25 = false; - Check_Timer = 0; - } - else if (Life50 && pct <= 50) - { - DoScriptText(SAY_WEAK50, m_creature); - Life50 = false; - } - else if (Life75 && pct <= 75) - { - DoScriptText(SAY_WEAK75, m_creature); - Life75 = false; - } - - //if we reach this it means event was running but at some point reset. - if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - m_creature->Respawn(); - return; - } - - if (pInstance->GetData(TYPE_MEDIVH) == DONE) - { - DoScriptText(SAY_WIN, m_creature); - Check_Timer = 0; - //TODO: start the post-event here - } - }else Check_Timer -= diff; - } - - //if (!UpdateVictim()) - //return; - - //DoMeleeAttackIfReady(); - } + npc_medivh_bmAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } + + ScriptedInstance *pInstance; + + uint32 SpellCorrupt_Timer; + uint32 Check_Timer; + + bool Life75; + bool Life50; + bool Life25; + + void Reset() + { + SpellCorrupt_Timer = 0; + + if (!pInstance) + return; + + if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) + m_creature->CastSpell(m_creature,SPELL_CHANNEL,true); + else if (m_creature->HasAura(SPELL_CHANNEL,0)) + m_creature->RemoveAura(SPELL_CHANNEL,0); + + m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true); + } + + void MoveInLineOfSight(Unit *who) + { + if (!pInstance) + return; + + if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f)) + { + if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) + return; + + DoScriptText(SAY_INTRO, m_creature); + pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS); + m_creature->CastSpell(m_creature,SPELL_CHANNEL,false); + Check_Timer = 5000; + } + else if (who->GetTypeId() == TYPEID_UNIT && m_creature->IsWithinDistInMap(who, 15.0f)) + { + if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) + return; + + uint32 entry = who->GetEntry(); + if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU) + { + who->StopMoving(); + who->CastSpell(m_creature,SPELL_CORRUPT,false); + } + else if (entry == C_AEONUS) + { + who->StopMoving(); + who->CastSpell(m_creature,SPELL_CORRUPT_AEONUS,false); + } + } + } + + void AttackStart(Unit *who) + { + //if (pInstance && pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) + //return; + + //ScriptedAI::AttackStart(who); + } + + void Aggro(Unit *who) {} + + void SpellHit(Unit* caster, const SpellEntry* spell) + { + if (SpellCorrupt_Timer) + return; + + if (spell->Id == SPELL_CORRUPT_AEONUS) + SpellCorrupt_Timer = 1000; + + if (spell->Id == SPELL_CORRUPT) + SpellCorrupt_Timer = 3000; + } + + void JustDied(Unit* Killer) + { + if (Killer->GetEntry() == m_creature->GetEntry()) + return; + + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (SpellCorrupt_Timer) + { + if (SpellCorrupt_Timer < diff) + { + pInstance->SetData(TYPE_MEDIVH,SPECIAL); + + if (m_creature->HasAura(SPELL_CORRUPT_AEONUS,0)) + SpellCorrupt_Timer = 1000; + else if (m_creature->HasAura(SPELL_CORRUPT,0)) + SpellCorrupt_Timer = 3000; + else + SpellCorrupt_Timer = 0; + }else SpellCorrupt_Timer -= diff; + } + + if (Check_Timer) + { + if (Check_Timer < diff) + { + uint32 pct = pInstance->GetData(DATA_SHIELD); + + Check_Timer = 5000; + + if (Life25 && pct <= 25) + { + DoScriptText(SAY_WEAK25, m_creature); + Life25 = false; + Check_Timer = 0; + } + else if (Life50 && pct <= 50) + { + DoScriptText(SAY_WEAK50, m_creature); + Life50 = false; + } + else if (Life75 && pct <= 75) + { + DoScriptText(SAY_WEAK75, m_creature); + Life75 = false; + } + + //if we reach this it means event was running but at some point reset. + if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + m_creature->Respawn(); + return; + } + + if (pInstance->GetData(TYPE_MEDIVH) == DONE) + { + DoScriptText(SAY_WIN, m_creature); + Check_Timer = 0; + //TODO: start the post-event here + } + }else Check_Timer -= diff; + } + + //if (!UpdateVictim()) + //return; + + //DoMeleeAttackIfReady(); + } }; CreatureAI* GetAI_npc_medivh_bm(Creature *_Creature) { - return new npc_medivh_bmAI (_Creature); + return new npc_medivh_bmAI (_Creature); } struct Wave { - uint32 PortalMob[4]; //spawns for portal waves (in order) + uint32 PortalMob[4]; //spawns for portal waves (in order) }; static Wave PortalWaves[]= { - {C_ASSAS, C_WHELP, C_CHRON, 0}, - {C_EXECU, C_CHRON, C_WHELP, C_ASSAS}, - {C_EXECU, C_VANQU, C_CHRON, C_ASSAS} + {C_ASSAS, C_WHELP, C_CHRON, 0}, + {C_EXECU, C_CHRON, C_WHELP, C_ASSAS}, + {C_EXECU, C_VANQU, C_CHRON, C_ASSAS} }; struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI { - npc_time_riftAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } + npc_time_riftAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } - ScriptedInstance *pInstance; + ScriptedInstance *pInstance; - uint32 TimeRiftWave_Timer; - uint8 mRiftWaveCount; - uint8 mPortalCount; - uint8 mWaveId; + uint32 TimeRiftWave_Timer; + uint8 mRiftWaveCount; + uint8 mPortalCount; + uint8 mWaveId; - void Reset() - { + void Reset() + { - TimeRiftWave_Timer = 15000; - mRiftWaveCount = 0; + TimeRiftWave_Timer = 15000; + mRiftWaveCount = 0; - if (!pInstance) - return; + if (!pInstance) + return; - mPortalCount = pInstance->GetData(DATA_PORTAL_COUNT); + mPortalCount = pInstance->GetData(DATA_PORTAL_COUNT); - if (mPortalCount < 6) - mWaveId = 0; - else if (mPortalCount > 12) - mWaveId = 2; - else mWaveId = 1; + if (mPortalCount < 6) + mWaveId = 0; + else if (mPortalCount > 12) + mWaveId = 2; + else mWaveId = 1; - } - void Aggro(Unit *who) {} + } + void Aggro(Unit *who) {} - void DoSummonAtRift(uint32 creature_entry) - { - if (!creature_entry) - return; - - if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) - { - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - return; - } - - float x,y,z; - m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),10.0f,x,y,z); - - //normalize Z-level if we can, if rift is not at ground level. - z = std::max(m_creature->GetMap()->GetHeight(x, y, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(x, y)); - - Unit *Summon = m_creature->SummonCreature(creature_entry,x,y,z,m_creature->GetOrientation(), - TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - - if (Summon) - { - if (Unit *temp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MEDIVH))) - Summon->AddThreat(temp,0.0f); - } - } + void DoSummonAtRift(uint32 creature_entry) + { + if (!creature_entry) + return; - void DoSelectSummon() - { - uint32 entry = 0; + if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) + { + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + return; + } - if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3) - mRiftWaveCount = 0; + float x,y,z; + m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),10.0f,x,y,z); - entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; - debug_log("SD2: npc_time_rift: summoning wave creature (Wave %u, Entry %u).",mRiftWaveCount,entry); + //normalize Z-level if we can, if rift is not at ground level. + z = std::max(m_creature->GetMap()->GetHeight(x, y, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(x, y)); - ++mRiftWaveCount; + Unit *Summon = m_creature->SummonCreature(creature_entry,x,y,z,m_creature->GetOrientation(), + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - if (entry == C_WHELP) - { - for(uint8 i = 0; i < 3; i++) - DoSummonAtRift(entry); - }else DoSummonAtRift(entry); - } + if (Summon) + { + if (Unit *temp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MEDIVH))) + Summon->AddThreat(temp,0.0f); + } + } - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; + void DoSelectSummon() + { + uint32 entry = 0; - if (TimeRiftWave_Timer < diff) - { - DoSelectSummon(); - TimeRiftWave_Timer = 15000; - }else TimeRiftWave_Timer -= diff; + if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3) + mRiftWaveCount = 0; - if (m_creature->IsNonMeleeSpellCasted(false)) - return; + entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; + debug_log("SD2: npc_time_rift: summoning wave creature (Wave %u, Entry %u).",mRiftWaveCount,entry); - debug_log("SD2: npc_time_rift: not casting anylonger, i need to die."); - m_creature->setDeathState(JUST_DIED); + ++mRiftWaveCount; - pInstance->SetData(TYPE_RIFT,SPECIAL); - } + if (entry == C_WHELP) + { + for(uint8 i = 0; i < 3; i++) + DoSummonAtRift(entry); + }else DoSummonAtRift(entry); + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (TimeRiftWave_Timer < diff) + { + DoSelectSummon(); + TimeRiftWave_Timer = 15000; + }else TimeRiftWave_Timer -= diff; + + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + debug_log("SD2: npc_time_rift: not casting anylonger, i need to die."); + m_creature->setDeathState(JUST_DIED); + + pInstance->SetData(TYPE_RIFT,SPECIAL); + } }; CreatureAI* GetAI_npc_time_rift(Creature *_Creature) { - return new npc_time_riftAI (_Creature); + return new npc_time_riftAI (_Creature); } #define SAY_SAAT_WELCOME -1269019 diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp index e2248b541e9..295da36df23 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp @@ -249,7 +249,7 @@ struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI || who->GetEntry() == CREATURE_DOOMFIRE || who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack()) return; - m_creature->AddThreat(who, 0.0f); + m_creature->AddThreat(who, 0.0f); } void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } @@ -397,9 +397,9 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; } if(victim && (victim->GetTypeId() == TYPEID_PLAYER)) @@ -433,7 +433,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI void JustDied(Unit *victim) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); if(pInstance) pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE); @@ -493,9 +493,9 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI Doomfire->AI()->AttackStart(target); if(rand()%2 == 0) - DoScriptText(SAY_DOOMFIRE1, m_creature); - else - DoScriptText(SAY_DOOMFIRE2, m_creature); + DoScriptText(SAY_DOOMFIRE1, m_creature); + else + DoScriptText(SAY_DOOMFIRE2, m_creature); } } @@ -589,13 +589,13 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->MoveIdle(); Enraged = true; - DoScriptText(SAY_ENRAGE, m_creature); + DoScriptText(SAY_ENRAGE, m_creature); } }else EnrageTimer -= diff; if(CheckDistanceTimer < diff) - { - // To simplify the check, we simply summon a creature in the location and then check how far we are from the creature + { + // To simplify the check, we simply summon a creature in the location and then check how far we are from the creature Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000); if(Check) { @@ -605,7 +605,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->MoveIdle(); Enraged = true; - DoScriptText(SAY_ENRAGE, m_creature); + DoScriptText(SAY_ENRAGE, m_creature); } } CheckDistanceTimer = 5000; @@ -618,7 +618,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI { m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->MoveIdle(); - //all members of raid must get this buff + //all members of raid must get this buff DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE); HasProtected = true; Enraged = true; @@ -666,9 +666,9 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI if(AirBurstTimer < diff) { if(rand()%2 == 0) - DoScriptText(SAY_AIR_BURST1, m_creature); - else - DoScriptText(SAY_AIR_BURST2, m_creature); + DoScriptText(SAY_AIR_BURST1, m_creature); + else + DoScriptText(SAY_AIR_BURST2, m_creature); DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AIR_BURST); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp index d8b308d03cd..11d74508537 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp @@ -134,13 +134,13 @@ bool GossipHello_npc_thrall(Player *player, Creature *_Creature) { hyjalAI* ai = ((hyjalAI*)_Creature->AI()); - if (ai->EventBegun) - return false; + if (ai->EventBegun) + return false; uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT); - // Only let them start the Horde phases if Anetheron is dead. - if (AnetheronEvent == DONE) + // Only let them start the Horde phases if Anetheron is dead. + if (AnetheronEvent == DONE) { uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT); uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); @@ -187,37 +187,37 @@ bool GossipSelect_npc_thrall(Player *player, Creature *_Creature, uint32 sender, CreatureAI* GetAI_npc_tyrande_whisperwind(Creature *_Creature) { - hyjalAI* ai = new hyjalAI(_Creature); - ai->Reset(); - ai->EnterEvadeMode(); + hyjalAI* ai = new hyjalAI(_Creature); + ai->Reset(); + ai->EnterEvadeMode(); - return ai; + return ai; } bool GossipHello_npc_tyrande_whisperwind(Player* player, Creature* _Creature) { - hyjalAI* ai = ((hyjalAI*)_Creature->AI()); - uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); - - // Only let them get item if Azgalor is dead. - if (AzgalorEvent == DONE && !player->HasItemCount(ITEM_TEAR_OF_GODDESS,1)) - player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(907, _Creature->GetGUID()); - return true; + hyjalAI* ai = ((hyjalAI*)_Creature->AI()); + uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); + + // Only let them get item if Azgalor is dead. + if (AzgalorEvent == DONE && !player->HasItemCount(ITEM_TEAR_OF_GODDESS,1)) + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + player->SEND_GOSSIP_MENU(907, _Creature->GetGUID()); + return true; } bool GossipSelect_npc_tyrande_whisperwind(Player *player, Creature *_Creature, uint32 sender, uint32 action) { - if (action == GOSSIP_ACTION_INFO_DEF) - { - ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1); - if (msg == EQUIP_ERR_OK) - { - player->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true); - } - player->SEND_GOSSIP_MENU(907, _Creature->GetGUID()); - } + if (action == GOSSIP_ACTION_INFO_DEF) + { + ItemPosCountVec dest; + uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1); + if (msg == EQUIP_ERR_OK) + { + player->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true); + } + player->SEND_GOSSIP_MENU(907, _Creature->GetGUID()); + } return true; } @@ -244,6 +244,6 @@ void AddSC_hyjal() newscript->Name = "npc_tyrande_whisperwind"; newscript->pGossipHello = &GossipHello_npc_tyrande_whisperwind; newscript->pGossipSelect = &GossipSelect_npc_tyrande_whisperwind; - newscript->GetAI = &GetAI_npc_tyrande_whisperwind; + newscript->GetAI = &GetAI_npc_tyrande_whisperwind; newscript->RegisterSelf(); } 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 d0f1858271d..8b3eb0525dc 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 @@ -46,7 +46,7 @@ float HordeBase[4][3]= float AttackArea[2][3]= { {5042.9189, -1776.2562, 1323.0621}, // Alliance - {5510.4815, -2676.7112, 1480.4314} // Horde + {5510.4815, -2676.7112, 1480.4314} // Horde }; hyjalAI::hyjalAI(Creature *c) : ScriptedAI(c) @@ -78,9 +78,9 @@ void hyjalAI::Reset() DoCast(m_creature, SPELL_BRILLIANCE_AURA, true); break; - case 17852: - Faction = 1; - break; + case 17852: + Faction = 1; + break; } //Bools @@ -89,7 +89,7 @@ void hyjalAI::Reset() SecondBossDead = false; Summon = false; bRetreat = false; - Debug = false; + Debug = false; //Flags m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); @@ -132,7 +132,7 @@ void hyjalAI::EnterEvadeMode() if(m_creature->isAlive()) m_creature->GetMotionMaster()->MoveTargetedHome(); - m_creature->SetLootRecipient(NULL); + m_creature->SetLootRecipient(NULL); InCombat = false; } @@ -161,12 +161,12 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) Creature* pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); if(pCreature) { - // Increment Enemy Count to be used in World States and instance script - ++EnemyCount; + // Increment Enemy Count to be used in World States and instance script + ++EnemyCount; pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); pCreature->GetMotionMaster()->MovePoint(0, AttackLoc[0],AttackLoc[1],AttackLoc[2]); - pCreature->AddThreat(m_creature, 0.0f); + pCreature->AddThreat(m_creature, 0.0f); DoZoneInCombat(pCreature); // Check if creature is a boss. @@ -181,9 +181,9 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) void hyjalAI::SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]) { - // 1 in 4 chance we give a rally yell. Not sure if the chance is offilike. - if (rand()%4 == 0) - Talk(RALLY); + // 1 in 4 chance we give a rally yell. Not sure if the chance is offilike. + if (rand()%4 == 0) + Talk(RALLY); if(!pInstance) { @@ -278,18 +278,18 @@ void hyjalAI::Talk(uint32 id) uint8 ind = *(index.begin()) + rand()%index.size(); - int32 YellId = 0; + int32 YellId = 0; if(Faction == 0) // Alliance { - YellId = JainaQuotes[ind].textid; + YellId = JainaQuotes[ind].textid; } else if(Faction == 1) // Horde { - YellId = ThrallQuotes[ind].textid; + YellId = ThrallQuotes[ind].textid; } if (YellId) - DoScriptText(YellId, m_creature); + DoScriptText(YellId, m_creature); } void hyjalAI::UpdateWorldState(uint32 id, uint32 state) @@ -366,20 +366,20 @@ void hyjalAI::Retreat() void hyjalAI::UpdateAI(const uint32 diff) { if(bRetreat) - { + { if(RetreatTimer < diff) - { - bRetreat = false; - if(CreatureList.empty()) - return; - - for(std::list::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr) - if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr)) - pUnit->SetVisibility(VISIBILITY_OFF); - - m_creature->SetVisibility(VISIBILITY_OFF); - }else RetreatTimer -= diff; - } + { + bRetreat = false; + if(CreatureList.empty()) + return; + + for(std::list::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr) + if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr)) + pUnit->SetVisibility(VISIBILITY_OFF); + + m_creature->SetVisibility(VISIBILITY_OFF); + }else RetreatTimer -= diff; + } if(!EventBegun) return; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h index ca95b1b99bf..cd6341a0544 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h @@ -45,8 +45,8 @@ struct Wave }; static Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base -{ // Rage Winterchill Wave 1-8 - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, +{ // Rage Winterchill Wave 1-8 + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, @@ -55,8 +55,8 @@ static Wave AllianceWaves[]= // Waves that will b {GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, // All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron - {RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, - // Anetheron Wave 1-8 + {RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, + // Anetheron Wave 1-8 {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, @@ -66,11 +66,11 @@ static Wave AllianceWaves[]= // Waves that will b {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, // All 8 Waves are summoned, summon Anatheron - {ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} + {ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} }; static Wave HordeWaves[]= // Waves that are summoned in the Horde base -{ // Kaz'Rogal Wave 1-8 +{ // Kaz'Rogal Wave 1-8 {GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, GHOUL, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 120000, false}, @@ -80,8 +80,8 @@ static Wave HordeWaves[]= // Waves that are su {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, FROST_WYRM, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, 180000, false}, // All 8 Waves are summoned, summon Kaz'Rogal, next few waves are for Azgalor - {KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, - // Azgalor Wave 1-8 + {KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, + // Azgalor Wave 1-8 {ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, FROST_WYRM, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 120000, false}, @@ -90,7 +90,7 @@ static Wave HordeWaves[]= // Waves that are su {NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 120000, false}, {GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 0, 0, 120000, false}, {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 180000, false}, - // All 8 Waves are summoned, summon Azgalor + // All 8 Waves are summoned, summon Azgalor {AZGALOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} }; @@ -104,7 +104,7 @@ enum TargetType // Used in the spell struct Yells { uint32 id; // Used to determine the type of yell (attack, rally, etc) - int32 textid; // The text id to be yelled + int32 textid; // The text id to be yelled }; enum YellId @@ -120,28 +120,28 @@ enum YellId static Yells JainaQuotes[]= { - {ATTACKED, -1534000}, - {ATTACKED, -1534001}, - {INCOMING, -1534002}, - {BEGIN, -1534003}, - {RALLY, -1534004}, - {RALLY, -1534005}, - {FAILURE, -1534006}, - {SUCCESS, -1534007}, - {DEATH, -1534008}, + {ATTACKED, -1534000}, + {ATTACKED, -1534001}, + {INCOMING, -1534002}, + {BEGIN, -1534003}, + {RALLY, -1534004}, + {RALLY, -1534005}, + {FAILURE, -1534006}, + {SUCCESS, -1534007}, + {DEATH, -1534008}, }; static Yells ThrallQuotes[]= { - {ATTACKED, -1534009}, - {ATTACKED, -1534010}, - {INCOMING, -1534011}, - {BEGIN, -1534012}, - {RALLY, -1534013}, - {RALLY, -1534014}, - {FAILURE, -1534015}, - {SUCCESS, -1534016}, - {DEATH, -1534017}, + {ATTACKED, -1534009}, + {ATTACKED, -1534010}, + {INCOMING, -1534011}, + {BEGIN, -1534012}, + {RALLY, -1534013}, + {RALLY, -1534014}, + {FAILURE, -1534015}, + {SUCCESS, -1534016}, + {DEATH, -1534017}, }; struct TRINITY_DLL_DECL hyjalAI : public ScriptedAI diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp index a678b7f4776..e3b1c5ea0ec 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp @@ -124,7 +124,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance break; } - debug_log("SD2: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); + debug_log("SD2: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); if(data == DONE) SaveToDB(); @@ -162,8 +162,8 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance { OUT_SAVE_INST_DATA; std::ostringstream stream; - stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " - << Encounters[3] << " " << Encounters[4]; + stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " + << Encounters[3] << " " << Encounters[4]; char* out = new char[stream.str().length() + 1]; strcpy(out, stream.str().c_str()); if(out) @@ -183,11 +183,11 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance return; } - OUT_LOAD_INST_DATA(in); - std::istringstream loadStream; - loadStream.str(in); - loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4]; - for(uint8 i = 0; i < ENCOUNTERS; ++i) + OUT_LOAD_INST_DATA(in); + std::istringstream loadStream; + loadStream.str(in); + loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4]; + for(uint8 i = 0; i < ENCOUNTERS; ++i) if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead. Encounters[i] = NOT_STARTED; OUT_LOAD_INST_DATA_COMPLETE; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp index 1c8d9a3de6b..86214a50704 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp @@ -31,15 +31,15 @@ EndScriptData */ bool GOHello_go_barrel_old_hillsbrad(Player *player, GameObject* _GO) { - ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData(); + ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData(); - if (!pInstance) - return false; + if (!pInstance) + return false; - if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE) - return false; + if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE) + return false; - pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS); + pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS); return false; } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp index 075def2f0d9..02689a7aa11 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp @@ -56,42 +56,42 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance Encounter[i] = NOT_STARTED; } - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("SD2: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void UpdateOHWorldState() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* player = itr->getSource()) - { - player->SendUpdateWorldState(WORLD_STATE_OH,mBarrelCount); - - if (mBarrelCount == 5) - player->KilledMonster(LODGE_QUEST_TRIGGER,0); - } - } - }else - debug_log("SD2: Instance Old Hillsbrad: UpdateOHWorldState, but PlayerList is empty!"); - } + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("SD2: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void UpdateOHWorldState() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* player = itr->getSource()) + { + player->SendUpdateWorldState(WORLD_STATE_OH,mBarrelCount); + + if (mBarrelCount == 5) + player->KilledMonster(LODGE_QUEST_TRIGGER,0); + } + } + }else + debug_log("SD2: Instance Old Hillsbrad: UpdateOHWorldState, but PlayerList is empty!"); + } void OnCreatureCreate(Creature *creature, uint32 creature_entry) { @@ -108,36 +108,36 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance void SetData(uint32 type, uint32 data) { - Player *player = GetPlayerInMap(); + Player *player = GetPlayerInMap(); - if (!player) - { - debug_log("SD2: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); - return; - } + if (!player) + { + debug_log("SD2: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); + return; + } switch(type) { case TYPE_BARREL_DIVERSION: { - if (data == IN_PROGRESS) - { - if (mBarrelCount >= 5) - return; + if (data == IN_PROGRESS) + { + if (mBarrelCount >= 5) + return; - ++mBarrelCount; - UpdateOHWorldState(); + ++mBarrelCount; + UpdateOHWorldState(); - debug_log("SD2: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); + debug_log("SD2: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); - Encounter[0] = IN_PROGRESS; + Encounter[0] = IN_PROGRESS; - if (mBarrelCount == 5) - { - player->SummonCreature(DRAKE_ENTRY,2128.43,71.01,64.42,1.74,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); - Encounter[0] = DONE; - } - } + if (mBarrelCount == 5) + { + player->SummonCreature(DRAKE_ENTRY,2128.43,71.01,64.42,1.74,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); + Encounter[0] = DONE; + } + } break; } case TYPE_THRALL_EVENT: diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp index 288ccbb57ef..e3aeaf55605 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp @@ -214,7 +214,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI Reset(); } - ScriptedInstance *pInstance; + ScriptedInstance *pInstance; uint64 TarethaGUID; @@ -223,10 +223,10 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI void WaypointReached(uint32 i) { - if (!pInstance) - return; + if (!pInstance) + return; - switch( i ) + switch( i ) { case 8: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); @@ -234,7 +234,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI break; case 9: DoScriptText(SAY_TH_ARMORY, m_creature); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, THRALL_WEAPON_MODEL); m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO); m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781); @@ -297,7 +297,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI //make horsie run off IsOnHold = true; m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - pInstance->SetData(TYPE_THRALL_PART2, DONE); + pInstance->SetData(TYPE_THRALL_PART2, DONE); break; case 64: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); @@ -325,7 +325,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI break; case 91: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - break; + break; case 93: m_creature->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); m_creature->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); @@ -334,58 +334,58 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI break; case 94: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) - { - if (Unit* Taretha = Unit::GetUnit((*m_creature), TarethaGUID)) - DoScriptText(SAY_TA_ESCAPED, Taretha, m_creature); - } + if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) + { + if (Unit* Taretha = Unit::GetUnit((*m_creature), TarethaGUID)) + DoScriptText(SAY_TA_ESCAPED, Taretha, m_creature); + } break; case 95: DoScriptText(SAY_TH_MEET_TARETHA, m_creature); - pInstance->SetData(TYPE_THRALL_PART3,DONE); + pInstance->SetData(TYPE_THRALL_PART3,DONE); IsOnHold = true; break; case 96: DoScriptText(SAY_TH_EPOCH_WONDER, m_creature); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); break; case 97: DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, m_creature); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; case 98: //trigger epoch Yell("Thrall! Come outside and face your fate! ....") - //from here, thrall should not never be allowed to move to point 106 which he currently does. + //from here, thrall should not never be allowed to move to point 106 which he currently does. break; case 106: - if (!PlayerGUID) - break; - - //trigger taretha to run down outside - if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) - { - if (Creature* Taretha = ((Creature*)Unit::GetUnit(*m_creature, TarethaGUID))) - ((npc_escortAI*)(Taretha->AI()))->Start(false, false, true, PlayerGUID); - } - - //kill credit creature for quest - Map *map = m_creature->GetMap(); - Map::PlayerList const& players = map->GetPlayers(); - if (!players.isEmpty() && map->IsDungeon()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* pPlayer = itr->getSource()) - pPlayer->KilledMonster(20156,m_creature->GetGUID()); - } - } - - //alot will happen here, thrall and taretha talk, erozion appear at spot to explain - m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000); - break; - } - } + if (!PlayerGUID) + break; + + //trigger taretha to run down outside + if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) + { + if (Creature* Taretha = ((Creature*)Unit::GetUnit(*m_creature, TarethaGUID))) + ((npc_escortAI*)(Taretha->AI()))->Start(false, false, true, PlayerGUID); + } + + //kill credit creature for quest + Map *map = m_creature->GetMap(); + Map::PlayerList const& players = map->GetPlayers(); + if (!players.isEmpty() && map->IsDungeon()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + pPlayer->KilledMonster(20156,m_creature->GetGUID()); + } + } + + //alot will happen here, thrall and taretha talk, erozion appear at spot to explain + m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000); + break; + } + } void Reset() @@ -411,9 +411,9 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI { switch(rand()%3) { - case 0: DoScriptText(SAY_TH_LEAVE_COMBAT1, m_creature); break; - case 1: DoScriptText(SAY_TH_LEAVE_COMBAT2, m_creature); break; - case 2: DoScriptText(SAY_TH_LEAVE_COMBAT3, m_creature); break; + case 0: DoScriptText(SAY_TH_LEAVE_COMBAT1, m_creature); break; + case 1: DoScriptText(SAY_TH_LEAVE_COMBAT2, m_creature); break; + case 2: DoScriptText(SAY_TH_LEAVE_COMBAT3, m_creature); break; } } } @@ -437,10 +437,10 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI { switch(rand()%4) { - case 0: DoScriptText(SAY_TH_RANDOM_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_TH_RANDOM_AGGRO3, m_creature); break; - case 3: DoScriptText(SAY_TH_RANDOM_AGGRO4, m_creature); break; + case 0: DoScriptText(SAY_TH_RANDOM_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_TH_RANDOM_AGGRO3, m_creature); break; + case 3: DoScriptText(SAY_TH_RANDOM_AGGRO4, m_creature); break; } if( m_creature->IsMounted() ) { @@ -449,45 +449,45 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI } } - void JustSummoned(Creature* summoned) - { - switch(summoned->GetEntry()) - { - //TODO: make Scarloc start into event instead, and not start attack directly - case MOB_ENTRY_BARN_GUARDSMAN: - case MOB_ENTRY_BARN_PROTECTOR: - case MOB_ENTRY_BARN_LOOKOUT: - case SKARLOC_MOUNT: - case EROZION_ENTRY: - break; - default: - summoned->AI()->AttackStart(m_creature); - break; - } - } + void JustSummoned(Creature* summoned) + { + switch(summoned->GetEntry()) + { + //TODO: make Scarloc start into event instead, and not start attack directly + case MOB_ENTRY_BARN_GUARDSMAN: + case MOB_ENTRY_BARN_PROTECTOR: + case MOB_ENTRY_BARN_LOOKOUT: + case SKARLOC_MOUNT: + case EROZION_ENTRY: + break; + default: + summoned->AI()->AttackStart(m_creature); + break; + } + } void KilledUnit(Unit *victim) { switch(rand()%3) { - case 0: DoScriptText(SAY_TH_RANDOM_KILL1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_KILL2, m_creature); break; - case 2: DoScriptText(SAY_TH_RANDOM_KILL3, m_creature); break; + case 0: DoScriptText(SAY_TH_RANDOM_KILL1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_KILL2, m_creature); break; + case 2: DoScriptText(SAY_TH_RANDOM_KILL3, m_creature); break; } } void JustDied(Unit *slayer) { - if (pInstance) - pInstance->SetData(TYPE_THRALL_EVENT,FAIL); + if (pInstance) + pInstance->SetData(TYPE_THRALL_EVENT,FAIL); - // Don't do a yell if he kills self (if player goes too far or at the end). + // Don't do a yell if he kills self (if player goes too far or at the end). if(slayer == m_creature) return; switch(rand()%2) { - case 0: DoScriptText(SAY_TH_RANDOM_DIE1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_DIE2, m_creature); break; + case 0: DoScriptText(SAY_TH_RANDOM_DIE1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_DIE2, m_creature); break; } } @@ -495,16 +495,16 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI { npc_escortAI::UpdateAI(diff); - if (!UpdateVictim()) - return; + if (!UpdateVictim()) + return; //TODO: add his abilities'n-crap here if( !LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) ) { switch(rand()%2) { - case 0: DoScriptText(SAY_TH_RANDOM_LOW_HP1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_LOW_HP2, m_creature); break; + case 0: DoScriptText(SAY_TH_RANDOM_LOW_HP1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_LOW_HP2, m_creature); break; } LowHp = true; } @@ -670,15 +670,15 @@ CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature *_Creature) bool GossipHello_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature) { if( _Creature->isQuestGiver() ) - { - player->PrepareQuestMenu( _Creature->GetGUID() ); - player->SendPreparedQuest(_Creature->GetGUID()); - } + { + player->PrepareQuestMenu( _Creature->GetGUID() ); + player->SendPreparedQuest(_Creature->GetGUID()); + } ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); if( pInstance ) { - if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && !pInstance->GetData(TYPE_THRALL_EVENT)) + if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && !pInstance->GetData(TYPE_THRALL_EVENT)) { player->ADD_GOSSIP_ITEM( 0, "[PH] Start walking.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(GOSSIP_ID_START, _Creature->GetGUID()); @@ -772,10 +772,10 @@ struct TRINITY_DLL_DECL npc_tarethaAI : public npc_escortAI void Reset() {} void Aggro(Unit* who) {} - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; CreatureAI* GetAI_npc_taretha(Creature *_Creature) { @@ -821,15 +821,15 @@ bool GossipSelect_npc_taretha(Player *player, Creature *_Creature, uint32 sender pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS); _Creature->SummonCreature(ENTRY_EPOCH,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000); - if (uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL)) - { - Creature* Thrall = ((Creature*)Unit::GetUnit((*_Creature), ThrallGUID)); - if(Thrall) - ((npc_thrall_old_hillsbradAI*)Thrall->AI())->StartWP(); - } - } - } - return true; + if (uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL)) + { + Creature* Thrall = ((Creature*)Unit::GetUnit((*_Creature), ThrallGUID)); + if(Thrall) + ((npc_thrall_old_hillsbradAI*)Thrall->AI())->StartWP(); + } + } + } + return true; } /*###### @@ -863,6 +863,6 @@ void AddSC_old_hillsbrad() newscript->Name="npc_taretha"; newscript->pGossipHello = &GossipHello_npc_taretha; newscript->pGossipSelect = &GossipSelect_npc_taretha; - newscript->GetAI = &GetAI_npc_taretha; + newscript->GetAI = &GetAI_npc_taretha; newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp index c626a8d4544..d8416e37a50 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp @@ -42,38 +42,38 @@ EndScriptData */ #define SPELL_POWER_OF_CARIBDIS 38451 #define SPELL_ENRAGE 24318 #define SPELL_SEAR_NOVA 38445 -#define SPELL_BLESSING_OF_THE_TIDES 38449 +#define SPELL_BLESSING_OF_THE_TIDES 38449 //Sharkkis spells #define SPELL_LEECHING_THROW 29436 #define SPELL_THE_BEAST_WITHIN 38373 -#define SPELL_MULTISHOT 38366 -#define SPELL_SUMMON_FATHOM_LURKER 38433 -#define SPELL_SUMMON_FATHOM_SPOREBAT 38431 +#define SPELL_MULTISHOT 38366 +#define SPELL_SUMMON_FATHOM_LURKER 38433 +#define SPELL_SUMMON_FATHOM_SPOREBAT 38431 #define SPELL_PET_ENRAGE 19574 //Tidalvess spells -#define SPELL_FROST_SHOCK 38234 -#define SPELL_SPITFIRE_TOTEM 38236 -#define SPELL_POISON_CLEANSING_TOTEM 38306 -#define SPELL_POISON_CLEANSING_EFFECT 8167 -#define SPELL_EARTHBIND_TOTEM 38304 -#define SPELL_EARTHBIND_TOTEM_EFFECT 6474 -#define SPELL_WINDFURY_WEAPON 38184 +#define SPELL_FROST_SHOCK 38234 +#define SPELL_SPITFIRE_TOTEM 38236 +#define SPELL_POISON_CLEANSING_TOTEM 38306 +#define SPELL_POISON_CLEANSING_EFFECT 8167 +#define SPELL_EARTHBIND_TOTEM 38304 +#define SPELL_EARTHBIND_TOTEM_EFFECT 6474 +#define SPELL_WINDFURY_WEAPON 38184 //Caribdis Spells -#define SPELL_WATER_BOLT_VOLLEY 38335 -#define SPELL_TIDAL_SURGE 38358 -#define SPELL_TIDAL_SURGE_FREEZE 38357 -#define SPELL_HEAL 38330 -#define SPELL_SUMMON_CYCLONE 38337 -#define SPELL_CYCLONE_CYCLONE 29538 +#define SPELL_WATER_BOLT_VOLLEY 38335 +#define SPELL_TIDAL_SURGE 38358 +#define SPELL_TIDAL_SURGE_FREEZE 38357 +#define SPELL_HEAL 38330 +#define SPELL_SUMMON_CYCLONE 38337 +#define SPELL_CYCLONE_CYCLONE 29538 //Yells and Quotes -#define SAY_GAIN_BLESSING_OF_TIDES "Your overconfidence will be your undoing! Guards, lend me your strength!" -#define SOUND_GAIN_BLESSING_OF_TIDES 11278 -#define SAY_MISC "Alana be'lendor!" //don't know what use this -#define SOUND_MISC 11283 +#define SAY_GAIN_BLESSING_OF_TIDES "Your overconfidence will be your undoing! Guards, lend me your strength!" +#define SOUND_GAIN_BLESSING_OF_TIDES 11278 +#define SAY_MISC "Alana be'lendor!" //don't know what use this +#define SOUND_MISC 11283 //Summoned Unit GUIDs #define CREATURE_CYCLONE 22104 @@ -106,9 +106,9 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI uint32 CataclysmicBolt_Timer; uint32 Enrage_Timer; - uint32 SearNova_Timer; + uint32 SearNova_Timer; - bool BlessingOfTides; + bool BlessingOfTides; uint64 Advisors[3]; @@ -116,38 +116,38 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI { CataclysmicBolt_Timer = 10000; Enrage_Timer = 600000; //10 minutes - SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds + SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds - BlessingOfTides = false; + BlessingOfTides = false; - if(pInstance) - { - uint64 RAdvisors[3]; - RAdvisors[0] = pInstance->GetData64(DATA_SHARKKIS); - RAdvisors[1] = pInstance->GetData64(DATA_TIDALVESS); - RAdvisors[2] = pInstance->GetData64(DATA_CARIBDIS); - //Respawn of the 3 Advisors - Creature* pAdvisor = NULL; - for( int i=0; i<3; i++ ) + if(pInstance) + { + uint64 RAdvisors[3]; + RAdvisors[0] = pInstance->GetData64(DATA_SHARKKIS); + RAdvisors[1] = pInstance->GetData64(DATA_TIDALVESS); + RAdvisors[2] = pInstance->GetData64(DATA_CARIBDIS); + //Respawn of the 3 Advisors + Creature* pAdvisor = NULL; + for( int i=0; i<3; i++ ) - if(RAdvisors[i]) - { - pAdvisor = ((Creature*)Unit::GetUnit((*m_creature), RAdvisors[i])); - if(pAdvisor && !pAdvisor->isAlive()) - { - pAdvisor->Respawn(); - pAdvisor->AI()->EnterEvadeMode(); - pAdvisor->GetMotionMaster()->MoveTargetedHome(); - } - } - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } + if(RAdvisors[i]) + { + pAdvisor = ((Creature*)Unit::GetUnit((*m_creature), RAdvisors[i])); + if(pAdvisor && !pAdvisor->isAlive()) + { + pAdvisor->Respawn(); + pAdvisor->AI()->EnterEvadeMode(); + pAdvisor->GetMotionMaster()->MoveTargetedHome(); + } + } + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } - } + } void EventSharkkisDeath() { @@ -185,7 +185,7 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI GetAdvisors(); DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); + DoZoneInCombat(); pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); @@ -237,10 +237,10 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI //someone evaded! if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { + { EnterEvadeMode(); - return; - } + return; + } //CataclysmicBolt_Timer if (CataclysmicBolt_Timer < diff) @@ -258,12 +258,12 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI CataclysmicBolt_Timer = 10000; }else CataclysmicBolt_Timer -= diff; - //SearNova_Timer - if(SearNova_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SEAR_NOVA); - SearNova_Timer = 20000+rand()%40000; - }else SearNova_Timer -= diff; + //SearNova_Timer + if(SearNova_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SEAR_NOVA); + SearNova_Timer = 20000+rand()%40000; + }else SearNova_Timer -= diff; //Enrage_Timer if (Enrage_Timer < diff) @@ -272,32 +272,32 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI Enrage_Timer = 90000; }else Enrage_Timer -= diff; - //Blessing of Tides Trigger - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 75 && !BlessingOfTides) - { - BlessingOfTides = true; - bool continueTriggering; - Creature* Advisor; - for(uint8 i = 0; i < 4; ++i) - if(Advisors[i]) - { - Advisor = ((Creature*)Unit::GetUnit(*m_creature, Advisors[i])); - if(Advisor) - { - if(Advisor->isAlive()) - { - continueTriggering = true; - break; - } - } - } - if( continueTriggering ) - { - DoCast(m_creature, SPELL_BLESSING_OF_THE_TIDES); - DoYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_GAIN_BLESSING_OF_TIDES); - } - } + //Blessing of Tides Trigger + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 75 && !BlessingOfTides) + { + BlessingOfTides = true; + bool continueTriggering; + Creature* Advisor; + for(uint8 i = 0; i < 4; ++i) + if(Advisors[i]) + { + Advisor = ((Creature*)Unit::GetUnit(*m_creature, Advisors[i])); + if(Advisor) + { + if(Advisor->isAlive()) + { + continueTriggering = true; + break; + } + } + } + if( continueTriggering ) + { + DoCast(m_creature, SPELL_BLESSING_OF_THE_TIDES); + DoYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_GAIN_BLESSING_OF_TIDES); + } + } DoMeleeAttackIfReady(); } @@ -316,30 +316,30 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI uint32 LeechingThrow_Timer; uint32 TheBeastWithin_Timer; - uint32 Multishot_Timer; - uint32 Pet_Timer; + uint32 Multishot_Timer; + uint32 Pet_Timer; - bool pet; + bool pet; - uint64 SummonedPet; + uint64 SummonedPet; void Reset() { LeechingThrow_Timer = 20000; TheBeastWithin_Timer = 30000; - Multishot_Timer = 15000; - Pet_Timer = 10000; + Multishot_Timer = 15000; + Pet_Timer = 10000; - pet = false; + pet = false; - Creature *Pet = (Creature*) Unit::GetUnit(*m_creature, SummonedPet); - if( Pet && Pet->isAlive() ) - { - Pet->DealDamage( Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false ); - } + Creature *Pet = (Creature*) Unit::GetUnit(*m_creature, SummonedPet); + if( Pet && Pet->isAlive() ) + { + Pet->DealDamage( Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false ); + } - SummonedPet = 0; + SummonedPet = 0; if( pInstance ) pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); @@ -354,7 +354,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI if (Karathress) ((boss_fathomlord_karathressAI*)Karathress->AI())->EventSharkkisDeath(); - ((boss_fathomlord_karathressAI*)Karathress->AI())->EventSharkkisDeath(); + ((boss_fathomlord_karathressAI*)Karathress->AI())->EventSharkkisDeath(); } } @@ -386,10 +386,10 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI //someone evaded! if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } + { + EnterEvadeMode(); + return; + } //LeechingThrow_Timer if(LeechingThrow_Timer < diff) @@ -398,51 +398,51 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI LeechingThrow_Timer = 20000; }else LeechingThrow_Timer -= diff; - //Multishot_Timer - if(Multishot_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MULTISHOT); - Multishot_Timer = 20000; - }else Multishot_Timer -= diff; - - //TheBeastWithin_Timer - if(TheBeastWithin_Timer < diff) - { - DoCast(m_creature, SPELL_THE_BEAST_WITHIN); - Creature *Pet = (Creature*) Unit::GetUnit(*m_creature, SummonedPet); - if( Pet && Pet->isAlive() ) - { - Pet->CastSpell( Pet, SPELL_PET_ENRAGE, true ); - } - TheBeastWithin_Timer = 30000; - }else TheBeastWithin_Timer -= diff; - - //Pet_Timer - if(Pet_Timer < diff && pet == false) - { - pet = true; - //uint32 spell_id; - uint32 pet_id; - switch( rand()%2 ) - { - case 0: - //spell_id = SPELL_SUMMON_FATHOM_LURKER; - pet_id = CREATURE_FATHOM_LURKER; - break; - case 1: - //spell_id = SPELL_SUMMON_FATHOM_SPOREBAT; - pet_id = CREATURE_FATHOM_SPOREBAT; - break; - } - //DoCast( m_creature, spell_id, true ); - Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000 ); - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (Pet && target) - { - Pet->AI()->AttackStart(target); - SummonedPet = Pet->GetGUID(); - } - }else Pet_Timer -= diff; + //Multishot_Timer + if(Multishot_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MULTISHOT); + Multishot_Timer = 20000; + }else Multishot_Timer -= diff; + + //TheBeastWithin_Timer + if(TheBeastWithin_Timer < diff) + { + DoCast(m_creature, SPELL_THE_BEAST_WITHIN); + Creature *Pet = (Creature*) Unit::GetUnit(*m_creature, SummonedPet); + if( Pet && Pet->isAlive() ) + { + Pet->CastSpell( Pet, SPELL_PET_ENRAGE, true ); + } + TheBeastWithin_Timer = 30000; + }else TheBeastWithin_Timer -= diff; + + //Pet_Timer + if(Pet_Timer < diff && pet == false) + { + pet = true; + //uint32 spell_id; + uint32 pet_id; + switch( rand()%2 ) + { + case 0: + //spell_id = SPELL_SUMMON_FATHOM_LURKER; + pet_id = CREATURE_FATHOM_LURKER; + break; + case 1: + //spell_id = SPELL_SUMMON_FATHOM_SPOREBAT; + pet_id = CREATURE_FATHOM_SPOREBAT; + break; + } + //DoCast( m_creature, spell_id, true ); + Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000 ); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (Pet && target) + { + Pet->AI()->AttackStart(target); + SummonedPet = Pet->GetGUID(); + } + }else Pet_Timer -= diff; DoMeleeAttackIfReady(); } @@ -460,16 +460,16 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI ScriptedInstance* pInstance; uint32 FrostShock_Timer; - uint32 Spitfire_Timer; - uint32 PoisonCleansing_Timer; - uint32 Earthbind_Timer; + uint32 Spitfire_Timer; + uint32 PoisonCleansing_Timer; + uint32 Earthbind_Timer; void Reset() { FrostShock_Timer = 25000; - Spitfire_Timer = 60000; - PoisonCleansing_Timer = 30000; - Earthbind_Timer = 45000; + Spitfire_Timer = 60000; + PoisonCleansing_Timer = 30000; + Earthbind_Timer = 45000; if (pInstance) pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); @@ -483,8 +483,8 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); if (Karathress) - if(!m_creature->isAlive() && Karathress) - ((boss_fathomlord_karathressAI*)Karathress->AI())->EventTidalvessDeath(); + if(!m_creature->isAlive() && Karathress) + ((boss_fathomlord_karathressAI*)Karathress->AI())->EventTidalvessDeath(); } } @@ -495,7 +495,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); } - DoCast(m_creature, SPELL_WINDFURY_WEAPON); + DoCast(m_creature, SPELL_WINDFURY_WEAPON); } void UpdateAI(const uint32 diff) @@ -517,15 +517,15 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI //someone evaded! if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { + { EnterEvadeMode(); - return; - } + return; + } - if( !m_creature->HasAura(SPELL_WINDFURY_WEAPON, 0) ) - { - DoCast(m_creature, SPELL_WINDFURY_WEAPON); - } + if( !m_creature->HasAura(SPELL_WINDFURY_WEAPON, 0) ) + { + DoCast(m_creature, SPELL_WINDFURY_WEAPON); + } //FrostShock_Timer if (FrostShock_Timer < diff) @@ -534,31 +534,31 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI FrostShock_Timer = 25000+rand()%5000; }else FrostShock_Timer -= diff; - //Spitfire_Timer - if(Spitfire_Timer < diff) - { - DoCast(m_creature, SPELL_SPITFIRE_TOTEM); - Unit *SpitfireTotem = Unit::GetUnit( *m_creature, CREATURE_SPITFIRE_TOTEM ); - if( SpitfireTotem ) - { - ((Creature*)SpitfireTotem)->AI()->AttackStart( m_creature->getVictim() ); - } - Spitfire_Timer = 60000; - }else Spitfire_Timer -= diff; - - //PoisonCleansing_Timer - if(PoisonCleansing_Timer < diff) - { - DoCast(m_creature, SPELL_POISON_CLEANSING_TOTEM); - PoisonCleansing_Timer = 30000; - }else PoisonCleansing_Timer -= diff; - - //Earthbind_Timer - if(Earthbind_Timer < diff) - { - DoCast(m_creature, SPELL_EARTHBIND_TOTEM); - Earthbind_Timer = 45000; - }else Earthbind_Timer -= diff; + //Spitfire_Timer + if(Spitfire_Timer < diff) + { + DoCast(m_creature, SPELL_SPITFIRE_TOTEM); + Unit *SpitfireTotem = Unit::GetUnit( *m_creature, CREATURE_SPITFIRE_TOTEM ); + if( SpitfireTotem ) + { + ((Creature*)SpitfireTotem)->AI()->AttackStart( m_creature->getVictim() ); + } + Spitfire_Timer = 60000; + }else Spitfire_Timer -= diff; + + //PoisonCleansing_Timer + if(PoisonCleansing_Timer < diff) + { + DoCast(m_creature, SPELL_POISON_CLEANSING_TOTEM); + PoisonCleansing_Timer = 30000; + }else PoisonCleansing_Timer -= diff; + + //Earthbind_Timer + if(Earthbind_Timer < diff) + { + DoCast(m_creature, SPELL_EARTHBIND_TOTEM); + Earthbind_Timer = 45000; + }else Earthbind_Timer -= diff; DoMeleeAttackIfReady(); } @@ -578,14 +578,14 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI uint32 WaterBoltVolley_Timer; uint32 TidalSurge_Timer; uint32 Heal_Timer; - uint32 Cyclone_Timer; + uint32 Cyclone_Timer; void Reset() { WaterBoltVolley_Timer = 35000; TidalSurge_Timer = 15000+rand()%5000; Heal_Timer = 55000; - Cyclone_Timer = 30000+rand()%10000; + Cyclone_Timer = 30000+rand()%10000; if (pInstance) pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); @@ -599,8 +599,8 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); if (Karathress) - if(!m_creature->isAlive() && Karathress) - ((boss_fathomlord_karathressAI*)Karathress->AI())->EventCaribdisDeath(); + if(!m_creature->isAlive() && Karathress) + ((boss_fathomlord_karathressAI*)Karathress->AI())->EventCaribdisDeath(); } } @@ -632,10 +632,10 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI //someone evaded! if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { + { EnterEvadeMode(); - return; - } + return; + } //WaterBoltVolley_Timer if (WaterBoltVolley_Timer < diff) @@ -648,69 +648,69 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI if (TidalSurge_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_TIDAL_SURGE); - // Hacky way to do it - won't trigger elseways - m_creature->getVictim()->CastSpell( m_creature->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true ); + // Hacky way to do it - won't trigger elseways + m_creature->getVictim()->CastSpell( m_creature->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true ); TidalSurge_Timer = 15000+rand()%5000; }else TidalSurge_Timer -= diff; - //Cyclone_Timer - if(Cyclone_Timer < diff) - { - //DoCast(m_creature, SPELL_SUMMON_CYCLONE); // Doesn't work - Cyclone_Timer = 30000+rand()%10000; - Creature *Cyclone = m_creature->SummonCreature(CREATURE_CYCLONE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000); - if( Cyclone ) - { - ((Creature*)Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); - Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Cyclone->setFaction(m_creature->getFaction()); - Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if( target ) - { - Cyclone->AI()->AttackStart(target); - } - } - }else Cyclone_Timer -= diff; - - //Heal_Timer - if(Heal_Timer < diff) - { - // It can be cast on any of the mobs - Unit *pUnit = NULL; - - while( pUnit == NULL || !pUnit->isAlive() ) - { - pUnit = selectAdvisorUnit(); - } - - if(pUnit && pUnit->isAlive()) - DoCast(pUnit, SPELL_HEAL); - Heal_Timer = 60000; - }else Heal_Timer -= diff; + //Cyclone_Timer + if(Cyclone_Timer < diff) + { + //DoCast(m_creature, SPELL_SUMMON_CYCLONE); // Doesn't work + Cyclone_Timer = 30000+rand()%10000; + Creature *Cyclone = m_creature->SummonCreature(CREATURE_CYCLONE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000); + if( Cyclone ) + { + ((Creature*)Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); + Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Cyclone->setFaction(m_creature->getFaction()); + Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if( target ) + { + Cyclone->AI()->AttackStart(target); + } + } + }else Cyclone_Timer -= diff; + + //Heal_Timer + if(Heal_Timer < diff) + { + // It can be cast on any of the mobs + Unit *pUnit = NULL; + + while( pUnit == NULL || !pUnit->isAlive() ) + { + pUnit = selectAdvisorUnit(); + } + + if(pUnit && pUnit->isAlive()) + DoCast(pUnit, SPELL_HEAL); + Heal_Timer = 60000; + }else Heal_Timer -= diff; DoMeleeAttackIfReady(); } - Unit* selectAdvisorUnit() - { - Unit* pUnit; - if(pInstance) - { - switch(rand()%4) - { - case 0: - pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)); - break; - case 1: - pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHARKKIS)); - break; - case 2: - pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_TIDALVESS)); - break; - case 3: - pUnit = m_creature; - break; + Unit* selectAdvisorUnit() + { + Unit* pUnit; + if(pInstance) + { + switch(rand()%4) + { + case 0: + pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)); + break; + case 1: + pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHARKKIS)); + break; + case 2: + pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_TIDALVESS)); + break; + case 3: + pUnit = m_creature; + break; } }else pUnit = m_creature; diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp index 6c28e61e863..e9809b0a60f 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp @@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI } ScriptedInstance* pInstance; - uint64 beams[2]; + uint64 beams[2]; uint32 PosCheck_Timer; uint32 MarkOfHydross_Timer; uint32 MarkOfCorruption_Timer; @@ -93,14 +93,14 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI uint32 MarkOfCorruption_Count; uint32 EnrageTimer; bool CorruptedForm; - bool beam; - SummonList Summons; + bool beam; + SummonList Summons; void Reset() { - DeSummonBeams(); - beams[0] = 0; - beams[1] = 0; + DeSummonBeams(); + beams[0] = 0; + beams[1] = 0; PosCheck_Timer = 2500; MarkOfHydross_Timer = 15000; MarkOfCorruption_Timer = 15000; @@ -119,41 +119,41 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED); - beam = false; - Summons.DespawnAll(); + beam = false; + Summons.DespawnAll(); } - void SummonBeams() - { - Creature* beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0); - if(beamer) - { - beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); - beamer->SetUInt32Value(UNIT_FIELD_DISPLAYID , 11686); //invisible - beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - beams[0]=beamer->GetGUID(); - } - beamer = beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0); - if(beamer) - { - beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); - beamer->SetUInt32Value(UNIT_FIELD_DISPLAYID , 11686); //invisible - beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - beams[1]=beamer->GetGUID(); - } - } - void DeSummonBeams() - { - for(uint8 i=0;i<2;i++) - { - Creature* mob = (Creature*)Unit::GetUnit(*m_creature,beams[i]); - if(mob) - { - mob->setDeathState(DEAD); + void SummonBeams() + { + Creature* beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0); + if(beamer) + { + beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); + beamer->SetUInt32Value(UNIT_FIELD_DISPLAYID , 11686); //invisible + beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + beams[0]=beamer->GetGUID(); + } + beamer = beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0); + if(beamer) + { + beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); + beamer->SetUInt32Value(UNIT_FIELD_DISPLAYID , 11686); //invisible + beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + beams[1]=beamer->GetGUID(); + } + } + void DeSummonBeams() + { + for(uint8 i=0;i<2;i++) + { + Creature* mob = (Creature*)Unit::GetUnit(*m_creature,beams[i]); + if(mob) + { + mob->setDeathState(DEAD); mob->RemoveCorpse(); - } - } - } + } + } + } void Aggro(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); @@ -185,20 +185,20 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI void JustSummoned(Creature* summoned) { if (summoned->GetEntry() == ENTRY_PURE_SPAWN) - { - summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); - Summons.Summon(summoned); - } + { + summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); + Summons.Summon(summoned); + } if (summoned->GetEntry() == ENTRY_TAINTED_SPAWN) - { - summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); - summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); - Summons.Summon(summoned); - } + { + summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); + Summons.Summon(summoned); + } } - void SummonedCreatureDespawn(Creature *summon) + void SummonedCreatureDespawn(Creature *summon) { Summons.Despawn(summon); } @@ -212,16 +212,16 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED); - Summons.DespawnAll(); + Summons.DespawnAll(); } void UpdateAI(const uint32 diff) { - if(!beam) - { - SummonBeams(); - beam=true; - } + if(!beam) + { + SummonBeams(); + beam=true; + } //Return since we have no target if (!UpdateVictim() ) return; @@ -277,7 +277,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI DoScriptText(SAY_SWITCH_TO_CLEAN, m_creature); DoResetThreat(); - SummonBeams(); + SummonBeams(); // spawn 4 adds DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); @@ -344,7 +344,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI DoScriptText(SAY_SWITCH_TO_CORRUPT, m_creature); DoResetThreat(); - DeSummonBeams(); + DeSummonBeams(); // spawn 4 adds DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp index 1ef843807ee..eec977a7520 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp @@ -41,7 +41,7 @@ EndScriptData */ #define SAY_SLAY3 -1548054 #define SAY_DEATH -1548055 -#define SPELL_SURGE 38044 +#define SPELL_SURGE 38044 #define SPELL_MULTI_SHOT 38310 #define SPELL_SHOCK_BLAST 38509 #define SPELL_ENTANGLE 38316 @@ -133,17 +133,17 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI boss_lady_vashjAI (Creature *c) : ScriptedAI(c) { pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL; - Intro = false; - Reset(); - CanAttack = false;//must be after reset() - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on creature create (no need do intro if wiped) + Intro = false; + Reset(); + CanAttack = false;//must be after reset() + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on creature create (no need do intro if wiped) } ScriptedInstance *pInstance; uint64 ShieldGeneratorChannel[4]; - uint32 AggroTimer; + uint32 AggroTimer; uint32 ShockBlast_Timer; uint32 Entangle_Timer; uint32 StaticCharge_Timer; @@ -160,12 +160,12 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI bool Entangle; bool InCombat; - bool Intro; - bool CanAttack; + bool Intro; + bool CanAttack; void Reset() { - AggroTimer = 19000; + AggroTimer = 19000; ShockBlast_Timer = 1+rand()%60000; Entangle_Timer = 30000; StaticCharge_Timer = 10000+rand()%15000; @@ -182,24 +182,24 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI Entangle = false; InCombat = false; - CanAttack = true; + CanAttack = true; - Unit *remo; + Unit *remo; for(uint8 i = 0; i < 4; i++) { remo = Unit::GetUnit(*m_creature, ShieldGeneratorChannel[i]); if (remo) - remo->setDeathState(JUST_DIED); + remo->setDeathState(JUST_DIED); } if(pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); + pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); ShieldGeneratorChannel[0] = 0; ShieldGeneratorChannel[1] = 0; ShieldGeneratorChannel[2] = 0; ShieldGeneratorChannel[3] = 0; - m_creature->SetCorpseDelay(1000*60*60); + m_creature->SetCorpseDelay(1000*60*60); } //Called when a tainted elemental dies @@ -246,19 +246,19 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI void Aggro(Unit *who) { - if (pInstance) - { - //remove old tainted cores to prevent cheating in phase 2 - Map *map = m_creature->GetMap(); - Map::PlayerList const &PlayerList = map->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin();i != PlayerList.end(); ++i) + if (pInstance) + { + //remove old tainted cores to prevent cheating in phase 2 + Map *map = m_creature->GetMap(); + Map::PlayerList const &PlayerList = map->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin();i != PlayerList.end(); ++i) { if(Player* i_pl = i->getSource()) { i_pl->DestroyItemCount(31088, 1, true); } } - } + } if(Phase != 2) AttackStart(who); @@ -268,13 +268,13 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (!Intro) - { - Intro = true; - DoScriptText(SAY_INTRO, m_creature); - } - if (!CanAttack) - return; + if (!Intro) + { + Intro = true; + DoScriptText(SAY_INTRO, m_creature); + } + if (!CanAttack) + return; if (!who || m_creature->getVictim()) return; @@ -322,25 +322,25 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if(!CanAttack && Intro) - { - if(AggroTimer < diff) - { - CanAttack = true; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer=19000; - }else - { - AggroTimer-=diff; - return; - } - } + if(!CanAttack && Intro) + { + if(AggroTimer < diff) + { + CanAttack = true; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer=19000; + }else + { + AggroTimer-=diff; + return; + } + } //to prevent abuses during phase 2 if(Phase == 2 && !m_creature->getVictim() && InCombat) - { - EnterEvadeMode(); - return; - } + { + EnterEvadeMode(); + return; + } //Return since we have no target if (!UpdateVictim() ) return; @@ -438,7 +438,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI SummonSporebat_Timer = SummonSporebat_StaticTimer; - if(SummonSporebat_Timer < 5000) + if(SummonSporebat_Timer < 5000) SummonSporebat_Timer = 5000; }else SummonSporebat_Timer -= diff; @@ -519,15 +519,15 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI { uint32 pos = rand()%3; Creature* CoilfangElite = NULL; - CoilfangElite = m_creature->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if(CoilfangElite) + CoilfangElite = m_creature->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if(CoilfangElite) { Unit *target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM, 0); if(target) CoilfangElite->AI()->AttackStart(target); - else if(m_creature->getVictim()) - CoilfangElite->AI()->AttackStart(m_creature->getVictim()); + else if(m_creature->getVictim()) + CoilfangElite->AI()->AttackStart(m_creature->getVictim()); } CoilfangElite_Timer = 45000+rand()%5000; }else CoilfangElite_Timer -= diff; @@ -536,16 +536,16 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI if(CoilfangStrider_Timer < diff) { uint32 pos = rand()%3; - Creature* CoilfangStrider = NULL; - CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if(CoilfangStrider) + Creature* CoilfangStrider = NULL; + CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if(CoilfangStrider) { Unit *target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM, 0); if(target) CoilfangStrider->AI()->AttackStart(target); - else if(m_creature->getVictim()) - CoilfangStrider->AI()->AttackStart(m_creature->getVictim()); + else if(m_creature->getVictim()) + CoilfangStrider->AI()->AttackStart(m_creature->getVictim()); } CoilfangStrider_Timer = 60000+rand()%10000; }else CoilfangStrider_Timer -= diff; @@ -590,39 +590,39 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI } ScriptedInstance *pInstance; - uint32 move; - uint32 phase; - float x, y, z; - Unit *Vashj; + uint32 move; + uint32 phase; + float x, y, z; + Unit *Vashj; void Reset() { - m_creature->SetSpeed(MOVE_WALK,0.6);//walk - m_creature->SetSpeed(MOVE_RUN,0.6);//run - move = 0; - phase = 1; - Vashj = NULL; - - for (int i = 0;i<8;i++)//search for nearest waypoint (up on stairs) - { - if (!x || !y || !z) - { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; - } - else - { - if (m_creature->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < m_creature->GetDistance(x,y,z)) - { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; - } - } - } - if (pInstance) - Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); + m_creature->SetSpeed(MOVE_WALK,0.6);//walk + m_creature->SetSpeed(MOVE_RUN,0.6);//run + move = 0; + phase = 1; + Vashj = NULL; + + for (int i = 0;i<8;i++)//search for nearest waypoint (up on stairs) + { + if (!x || !y || !z) + { + x = ElementWPPos[i][0]; + y = ElementWPPos[i][1]; + z = ElementWPPos[i][2]; + } + else + { + if (m_creature->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < m_creature->GetDistance(x,y,z)) + { + x = ElementWPPos[i][0]; + y = ElementWPPos[i][1]; + z = ElementWPPos[i][2]; + } + } + } + if (pInstance) + Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); } void Aggro(Unit *who) { return; } @@ -631,31 +631,31 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if(!pInstance) - return; + if(!pInstance) + return; - if (!Vashj) - { - return; - } + if (!Vashj) + { + return; + } - if(move < diff) + if(move < diff) { - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE); - if (phase == 1) - { - m_creature->GetMotionMaster()->MovePoint(0, x, y, z); - } - if (phase == 1 && m_creature->GetDistance(x,y,z) < 0.1) - { - phase = 2; - } - if (phase == 2) - { - m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - phase = 3; - } - if (phase == 3) + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE); + if (phase == 1) + { + m_creature->GetMotionMaster()->MovePoint(0, x, y, z); + } + if (phase == 1 && m_creature->GetDistance(x,y,z) < 0.1) + { + phase = 2; + } + if (phase == 2) + { + m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); + phase = 3; + } + if (phase == 3) { m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); if(m_creature->GetDistance(MIDDLE_X, MIDDLE_Y, MIDDLE_Z) < 3) @@ -674,13 +674,13 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } } - if(((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->InCombat == false || ((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->Phase != 2 || Vashj->isDead()) + if(((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->InCombat == false || ((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->Phase != 2 || Vashj->isDead()) { //call Unsummon() - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } - move = 1000; - }else move -= diff; + move = 1000; + }else move -= diff; } }; @@ -719,7 +719,7 @@ struct TRINITY_DLL_DECL mob_tainted_elementalAI : public ScriptedAI void Aggro(Unit *who) { - m_creature->AddThreat(who, 0.1f); + m_creature->AddThreat(who, 0.1f); } void UpdateAI(const uint32 diff) @@ -760,18 +760,18 @@ struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI ScriptedInstance *pInstance; - uint32 movement_timer; + uint32 movement_timer; uint32 ToxicSpore_Timer; - uint32 bolt_timer; + uint32 bolt_timer; uint32 Check_Timer; void Reset() { - m_creature->AddUnitMovementFlag(/*MOVEMENTFLAG_ONTRANSPORT + */MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(/*MOVEMENTFLAG_ONTRANSPORT + */MOVEMENTFLAG_LEVITATING); m_creature->setFaction(14); - movement_timer = 0; + movement_timer = 0; ToxicSpore_Timer = 5000; - bolt_timer = 5500; + bolt_timer = 5500; Check_Timer = 1000; } @@ -781,50 +781,50 @@ struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI } void MoveInLineOfSight(Unit *who) - { + { } - void MovementInform(uint32 type, uint32 id) + void MovementInform(uint32 type, uint32 id) { if(type != POINT_MOTION_TYPE) return; if(id == 1) - movement_timer = 0; - } + movement_timer = 0; + } void UpdateAI (const uint32 diff) { - /*if(!m_creature->isInCombat()) - m_creature->SetInCombatState(false);*/ + /*if(!m_creature->isInCombat()) + m_creature->SetInCombatState(false);*/ - //Random movement + //Random movement if (movement_timer < diff) { - uint32 rndpos = rand()%8; - m_creature->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]); - movement_timer = 6000; - }else movement_timer -= diff; - - //toxic spores - if(bolt_timer < diff) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if(target) - { - Creature* trig = m_creature->SummonCreature(TOXIC_SPORES_TRIGGER,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); - if(trig) - { - trig->setFaction(14); - trig->CastSpell(trig, SPELL_TOXIC_SPORES,true); - } - } - bolt_timer = 10000+rand()%5000; - } - else bolt_timer -= diff; + uint32 rndpos = rand()%8; + m_creature->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]); + movement_timer = 6000; + }else movement_timer -= diff; + + //toxic spores + if(bolt_timer < diff) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if(target) + { + Creature* trig = m_creature->SummonCreature(TOXIC_SPORES_TRIGGER,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); + if(trig) + { + trig->setFaction(14); + trig->CastSpell(trig, SPELL_TOXIC_SPORES,true); + } + } + bolt_timer = 10000+rand()%5000; + } + else bolt_timer -= diff; //Check_Timer if(Check_Timer < diff) @@ -845,7 +845,7 @@ struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI Check_Timer = 1000; }else Check_Timer -= diff; - } + } }; //Coilfang Elite @@ -896,11 +896,11 @@ struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI ScriptedInstance *pInstance; uint32 Check_Timer; - bool Casted; + bool Casted; void Reset() { Check_Timer = 0; - Casted = false; + Casted = false; m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID , 11686); //invisible m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -923,13 +923,13 @@ struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI if(Vashj && Vashj->isAlive()) { //start visual channel - if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER,0)) - { - m_creature->CastSpell(Vashj,SPELL_MAGIC_BARRIER,true); - Casted = true; - } + if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER,0)) + { + m_creature->CastSpell(Vashj,SPELL_MAGIC_BARRIER,true); + Casted = true; + } } - Check_Timer = 1000; + Check_Timer = 1000; }else Check_Timer -= diff; } }; diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp index dfb3ba69eb9..1643f1068cf 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -27,30 +27,30 @@ EndScriptData */ // --- Spells used by Leotheras The Blind #define SPELL_WHIRLWIND 37640 #define SPELL_CHAOS_BLAST 37674 -#define SPELL_BERSERK 26662 +#define SPELL_BERSERK 26662 #define SPELL_INSIDIOUS_WHISPER 37676 -#define SPELL_DUAL_WIELD 42459 +#define SPELL_DUAL_WIELD 42459 // --- Spells used in banish phase --- -#define BANISH_BEAM 38909 -#define AURA_BANISH 37833 +#define BANISH_BEAM 38909 +#define AURA_BANISH 37833 // --- Spells used by Greyheart Spellbinders -#define SPELL_EARTHSHOCK 39076 -#define SPELL_MINDBLAST 37531 +#define SPELL_EARTHSHOCK 39076 +#define SPELL_MINDBLAST 37531 // --- Spells used by Inner Demons and creature ID -#define INNER_DEMON_ID 21857 -#define AURA_DEMONIC_ALIGNMENT 37713 -#define SPELL_SHADOWBOLT 39309 -#define SPELL_SOUL_LINK 38007 -#define SPELL_CONSUMING_MADNESS 37749 //not supported by core yet +#define INNER_DEMON_ID 21857 +#define AURA_DEMONIC_ALIGNMENT 37713 +#define SPELL_SHADOWBOLT 39309 +#define SPELL_SOUL_LINK 38007 +#define SPELL_CONSUMING_MADNESS 37749 //not supported by core yet //Misc. -#define MODEL_DEMON 20125 -#define MODEL_NIGHTELF 20514 -#define DEMON_FORM 21875 -#define MOB_SPELLBINDER 21806 +#define MODEL_DEMON 20125 +#define MODEL_NIGHTELF 20514 +#define DEMON_FORM 21875 +#define MOB_SPELLBINDER 21806 #define SAY_AGGRO -1548009 #define SAY_SWITCH_TO_DEMON -1548010 @@ -67,47 +67,47 @@ EndScriptData */ class TRINITY_DLL_DECL InsidiousAura : public Aura { public: - InsidiousAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL) - {} + InsidiousAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL) + {} }; struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI { mob_inner_demonAI(Creature *c) : ScriptedAI(c) { - victimGUID = 0; + victimGUID = 0; Reset(); } uint32 ShadowBolt_Timer; - uint32 Link_Timer; - uint64 victimGUID; + uint32 Link_Timer; + uint64 victimGUID; void Reset() { ShadowBolt_Timer = 10000; - Link_Timer = 1000; + Link_Timer = 1000; } - void JustDied(Unit *victim) + void JustDied(Unit *victim) { - Unit* pUnit = Unit::GetUnit((*m_creature),victimGUID); - if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER,0)) - pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if(done_by->GetGUID() != victimGUID && done_by->GetGUID() != m_creature->GetGUID()) - { - damage = 0; - DoModifyThreatPercent(done_by, -100); - } - } - - void Aggro(Unit *who) + Unit* pUnit = Unit::GetUnit((*m_creature),victimGUID); + if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER,0)) + pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if(done_by->GetGUID() != victimGUID && done_by->GetGUID() != m_creature->GetGUID()) + { + damage = 0; + DoModifyThreatPercent(done_by, -100); + } + } + + void Aggro(Unit *who) { - if (!victimGUID) return; + if (!victimGUID) return; } void UpdateAI(const uint32 diff) @@ -116,27 +116,27 @@ struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI if (!UpdateVictim()) return; - if (m_creature->getVictim()->GetGUID() != victimGUID) - { - Unit* owner = Unit::GetUnit((*m_creature),victimGUID); - if (owner) - AttackStart(owner); - } - if(Link_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SOUL_LINK, true); - Link_Timer = 1000; - }else Link_Timer -= diff; + if (m_creature->getVictim()->GetGUID() != victimGUID) + { + Unit* owner = Unit::GetUnit((*m_creature),victimGUID); + if (owner) + AttackStart(owner); + } + if(Link_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SOUL_LINK, true); + Link_Timer = 1000; + }else Link_Timer -= diff; - if(!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT, 0)) - DoCast(m_creature, AURA_DEMONIC_ALIGNMENT,true); + if(!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT, 0)) + DoCast(m_creature, AURA_DEMONIC_ALIGNMENT,true); - if(ShadowBolt_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT, false); - ShadowBolt_Timer = 10000; - }else ShadowBolt_Timer -= diff; + if(ShadowBolt_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT, false); + ShadowBolt_Timer = 10000; + }else ShadowBolt_Timer -= diff; DoMeleeAttackIfReady(); } @@ -146,112 +146,112 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI { boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c) { - m_creature->GetPosition(x,y,z); + m_creature->GetPosition(x,y,z); pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL; Demon = 0; - for(uint8 i = 0; i < 3; i++)//clear guids - SpellBinderGUID[i] = 0; + for(uint8 i = 0; i < 3; i++)//clear guids + SpellBinderGUID[i] = 0; Reset(); - } + } ScriptedInstance *pInstance; uint32 Whirlwind_Timer; uint32 ChaosBlast_Timer; - uint32 SwitchToDemon_Timer; + uint32 SwitchToDemon_Timer; uint32 SwitchToHuman_Timer; - uint32 Berserk_Timer; - uint32 InnerDemons_Timer; - uint32 BanishTimer; + uint32 Berserk_Timer; + uint32 InnerDemons_Timer; + uint32 BanishTimer; - bool DealDamage; - bool NeedThreatReset; + bool DealDamage; + bool NeedThreatReset; bool DemonForm; bool IsFinalForm; - bool EnrageUsed; - float x,y,z; + bool EnrageUsed; + float x,y,z; - uint64 InnderDemon[5]; - uint32 InnderDemon_Count; + uint64 InnderDemon[5]; + uint32 InnderDemon_Count; uint64 Demon; - uint64 SpellBinderGUID[3]; + uint64 SpellBinderGUID[3]; void Reset() { - CheckChannelers(); - BanishTimer = 1000; + CheckChannelers(); + BanishTimer = 1000; Whirlwind_Timer = 15000; ChaosBlast_Timer = 1000; - SwitchToDemon_Timer = 45000; + SwitchToDemon_Timer = 45000; SwitchToHuman_Timer = 60000; - Berserk_Timer = 600000; - InnerDemons_Timer = 30000; - m_creature->SetCanDualWield(true); - DealDamage = true; + Berserk_Timer = 600000; + InnerDemons_Timer = 30000; + m_creature->SetCanDualWield(true); + DealDamage = true; DemonForm = false; IsFinalForm = false; - NeedThreatReset = false; - EnrageUsed = false; - InnderDemon_Count = 0; - m_creature->SetSpeed( MOVE_RUN, 2.0f, true); - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY , 0); + NeedThreatReset = false; + EnrageUsed = false; + InnderDemon_Count = 0; + m_creature->SetSpeed( MOVE_RUN, 2.0f, true); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY , 0); m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); - m_creature->SetCorpseDelay(1000*60*60); - if(pInstance) - pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED); + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + m_creature->SetCorpseDelay(1000*60*60); + if(pInstance) + pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED); } - void CheckChannelers(bool DoEvade = true) - { - for(uint8 i = 0; i < 3; i++) - { - Creature *add = (Creature*)Unit::GetUnit(*m_creature,SpellBinderGUID[i]); - if (add && add->isAlive()) - { - add->setDeathState(DEAD); + void CheckChannelers(bool DoEvade = true) + { + for(uint8 i = 0; i < 3; i++) + { + Creature *add = (Creature*)Unit::GetUnit(*m_creature,SpellBinderGUID[i]); + if (add && add->isAlive()) + { + add->setDeathState(DEAD); add->RemoveCorpse(); - }else{ - if(add && add->isDead()) - add->RemoveCorpse(); - } - float nx = x; - float ny = y; - float o = 2.4f; - if (i == 0) {nx += 20;o=3.0f;} - if (i == 1) ny -= 20; - if (i == 2) {nx += 18;ny -= 18;o=2.0f;} - Creature* binder = m_creature->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0); - if (binder) - SpellBinderGUID[i] = binder->GetGUID(); - - } - } - void MoveInLineOfSight(Unit *who) - { - if(m_creature->HasAura(AURA_BANISH, 0)) - return; - - if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) - { - if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if(m_creature->IsWithinDistInMap(who, attackRadius)) - { - // Check first that object is in an angle in front of this one before LoS check - if( m_creature->HasInArc(M_PI/2.0f, who) && m_creature->IsWithinLOSInMap(who) ) - { - AttackStart(who); - } - } - } - } + }else{ + if(add && add->isDead()) + add->RemoveCorpse(); + } + float nx = x; + float ny = y; + float o = 2.4f; + if (i == 0) {nx += 20;o=3.0f;} + if (i == 1) ny -= 20; + if (i == 2) {nx += 18;ny -= 18;o=2.0f;} + Creature* binder = m_creature->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0); + if (binder) + SpellBinderGUID[i] = binder->GetGUID(); + + } + } + void MoveInLineOfSight(Unit *who) + { + if(m_creature->HasAura(AURA_BANISH, 0)) + return; + + if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) + { + if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if(m_creature->IsWithinDistInMap(who, attackRadius)) + { + // Check first that object is in an angle in front of this one before LoS check + if( m_creature->HasInArc(M_PI/2.0f, who) && m_creature->IsWithinLOSInMap(who) ) + { + AttackStart(who); + } + } + } + } void StartEvent() { @@ -260,95 +260,95 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS); } - void CheckBanish() - { - uint8 AliveChannelers = 0; - for(uint8 i = 0; i < 3; i++) - { - Unit *add = Unit::GetUnit(*m_creature,SpellBinderGUID[i]); - if (add && add->isAlive()) - AliveChannelers++; - } - - // channelers == 0 remove banish aura - if(AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH, 0)) - { - // removing banish aura - m_creature->RemoveAurasDueToSpell(AURA_BANISH); - - // Leotheras is getting immune again + void CheckBanish() + { + uint8 AliveChannelers = 0; + for(uint8 i = 0; i < 3; i++) + { + Unit *add = Unit::GetUnit(*m_creature,SpellBinderGUID[i]); + if (add && add->isAlive()) + AliveChannelers++; + } + + // channelers == 0 remove banish aura + if(AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH, 0)) + { + // removing banish aura + m_creature->RemoveAurasDueToSpell(AURA_BANISH); + + // Leotheras is getting immune again m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true); - // changing model to bloodelf + // changing model to bloodelf m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF); - // and reseting equipment - m_creature->LoadEquipment(m_creature->GetEquipmentId()); - - if(pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - Unit *victim = NULL; - victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); - if(victim) - m_creature->getThreatManager().addThreat(victim, 1); - StartEvent(); - } - } - else if(AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH, 0)) - { - // channelers != 0 apply banish aura - // removing Leotheras banish immune to apply AURA_BANISH + // and reseting equipment + m_creature->LoadEquipment(m_creature->GetEquipmentId()); + + if(pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + Unit *victim = NULL; + victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); + if(victim) + m_creature->getThreatManager().addThreat(victim, 1); + StartEvent(); + } + } + else if(AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH, 0)) + { + // channelers != 0 apply banish aura + // removing Leotheras banish immune to apply AURA_BANISH m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false); - DoCast(m_creature, AURA_BANISH); + DoCast(m_creature, AURA_BANISH); - // changing model + // changing model m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_DEMON); - // and removing weapons + // and removing weapons m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY , 0); m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); - } - } + } + } - //Despawn all Inner Demon summoned - void DespawnDemon() - { + //Despawn all Inner Demon summoned + void DespawnDemon() + { for(int i=0; i<5; i++) - { + { if(InnderDemon[i]) - { + { //delete creature Unit* pUnit = Unit::GetUnit((*m_creature), InnderDemon[i]); if (pUnit && pUnit->isAlive()) - { + { pUnit->DealDamage(pUnit, pUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - InnderDemon[i] = 0; - } - } + } + InnderDemon[i] = 0; + } + } - InnderDemon_Count = 0; - } + InnderDemon_Count = 0; + } - void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core - { + void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core + { for(int i=0; i<5; i++) - { + { if(InnderDemon[i] > 0 ) - { + { Unit* pUnit = Unit::GetUnit((*m_creature), InnderDemon[i]); if (pUnit && pUnit->isAlive()) - { - Unit* pUnit_target = Unit::GetUnit((*pUnit), ((mob_inner_demonAI *)((Creature *)pUnit)->AI())->victimGUID); - if( pUnit_target && pUnit_target->isAlive()) - { - pUnit->CastSpell(pUnit_target, SPELL_CONSUMING_MADNESS, true); - DoModifyThreatPercent(pUnit_target, -100); - } - } - } - } - } + { + Unit* pUnit_target = Unit::GetUnit((*pUnit), ((mob_inner_demonAI *)((Creature *)pUnit)->AI())->victimGUID); + if( pUnit_target && pUnit_target->isAlive()) + { + pUnit->CastSpell(pUnit_target, SPELL_CONSUMING_MADNESS, true); + DoModifyThreatPercent(pUnit_target, -100); + } + } + } + } + } void KilledUnit(Unit *victim) { @@ -394,85 +394,85 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI void Aggro(Unit *who) { - if(m_creature->HasAura(AURA_BANISH, 0)) - return; + if(m_creature->HasAura(AURA_BANISH, 0)) + return; - m_creature->LoadEquipment(m_creature->GetEquipmentId()); + m_creature->LoadEquipment(m_creature->GetEquipmentId()); } void UpdateAI(const uint32 diff) { //Return since we have no target if (m_creature->HasAura(AURA_BANISH, 0) || !UpdateVictim()) - { - if(BanishTimerHasAura(SPELL_WHIRLWIND, 0)) - if(Whirlwind_Timer < diff) - { - Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if(newTarget) - { - DoResetThreat(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ()); - } - Whirlwind_Timer = 2000; - }else Whirlwind_Timer -= diff; - - // reseting after changing forms and after ending whirlwind - if(NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND, 0)) - { - // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding) - if(DemonForm) - InnerDemons_Timer = 30000; - else - Whirlwind_Timer = 15000; - - NeedThreatReset = false; - DoResetThreat(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } + { + if(BanishTimerHasAura(SPELL_WHIRLWIND, 0)) + if(Whirlwind_Timer < diff) + { + Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if(newTarget) + { + DoResetThreat(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ()); + } + Whirlwind_Timer = 2000; + }else Whirlwind_Timer -= diff; + + // reseting after changing forms and after ending whirlwind + if(NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND, 0)) + { + // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding) + if(DemonForm) + InnerDemons_Timer = 30000; + else + Whirlwind_Timer = 15000; + + NeedThreatReset = false; + DoResetThreat(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } //Enrage_Timer ( 10 min ) if(Berserk_Timer < diff && !EnrageUsed) { DoCast(m_creature, SPELL_BERSERK); - EnrageUsed = true; + EnrageUsed = true; }else Berserk_Timer -= diff; if(!DemonForm) { - //Whirldind Timer + //Whirldind Timer if(!m_creature->HasAura(SPELL_WHIRLWIND, 0)) - { - if(Whirlwind_Timer < diff) - { - DoCast(m_creature, SPELL_WHIRLWIND); - // while whirlwinding this variable is used to countdown target's change - Whirlwind_Timer = 2000; - NeedThreatReset = true; - }else Whirlwind_Timer -= diff; - } + { + if(Whirlwind_Timer < diff) + { + DoCast(m_creature, SPELL_WHIRLWIND); + // while whirlwinding this variable is used to countdown target's change + Whirlwind_Timer = 2000; + NeedThreatReset = true; + }else Whirlwind_Timer -= diff; + } //Switch_Timer if(!IsFinalForm) if(SwitchToDemon_Timer < diff) { //switch to demon form - m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0); - m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_DEMON); - DoScriptText(SAY_SWITCH_TO_DEMON, m_creature); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY , 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); - DemonForm = true; - NeedThreatReset = true; + m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0); + m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_DEMON); + DoScriptText(SAY_SWITCH_TO_DEMON, m_creature); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY , 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); + DemonForm = true; + NeedThreatReset = true; SwitchToDemon_Timer = 45000; }else SwitchToDemon_Timer -= diff; DoMeleeAttackIfReady(); @@ -481,98 +481,98 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI { //ChaosBlast_Timer if (!m_creature->getVictim()) - return; - if(m_creature->GetDistance(m_creature->getVictim()) < 30) - m_creature->StopMoving(); - if(ChaosBlast_Timer < diff) - { - // will cast only when in range of spell - if(m_creature->GetDistance(m_creature->getVictim()) < 30) - { - //m_creature->CastSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, true); - int damage = 100; - m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); - } - ChaosBlast_Timer = 3000; - }else ChaosBlast_Timer -= diff; - //Summon Inner Demon - if(InnerDemons_Timer < diff) - { - std::list& ThreatList = m_creature->getThreatManager().getThreatList(); - std::vector TargetList; - for(std::list::iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr) - { - Unit *tempTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if(tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != m_creature->getVictim()->GetGUID() && TargetList.size()<5) - TargetList.push_back( tempTarget ); - } - SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_INSIDIOUS_WHISPER); - for(std::vector::iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr) - { - if( (*itr) && (*itr)->isAlive() ) - { - Creature * demon = (Creature *)m_creature->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if(demon) - { - ((ScriptedAI *)demon->AI())->AttackStart( (*itr) ); - ((mob_inner_demonAI *)demon->AI())->victimGUID = (*itr)->GetGUID(); - - for (int i=0; i<3; i++) - { - if (!spell->Effect[i]) - continue; - (*itr)->AddAura(new InsidiousAura(spell, i, NULL, (*itr), (*itr))); - } - if( InnderDemon_Count > 4 ) InnderDemon_Count = 0; - - //Safe storing of creatures - InnderDemon[InnderDemon_Count] = demon->GetGUID(); - - //Update demon count - InnderDemon_Count++; - } - } - } - DoScriptText(SAY_INNER_DEMONS, m_creature); - - InnerDemons_Timer = 999999; - }else InnerDemons_Timer -= diff; + return; + if(m_creature->GetDistance(m_creature->getVictim()) < 30) + m_creature->StopMoving(); + if(ChaosBlast_Timer < diff) + { + // will cast only when in range of spell + if(m_creature->GetDistance(m_creature->getVictim()) < 30) + { + //m_creature->CastSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, true); + int damage = 100; + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); + } + ChaosBlast_Timer = 3000; + }else ChaosBlast_Timer -= diff; + //Summon Inner Demon + if(InnerDemons_Timer < diff) + { + std::list& ThreatList = m_creature->getThreatManager().getThreatList(); + std::vector TargetList; + for(std::list::iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr) + { + Unit *tempTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if(tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != m_creature->getVictim()->GetGUID() && TargetList.size()<5) + TargetList.push_back( tempTarget ); + } + SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_INSIDIOUS_WHISPER); + for(std::vector::iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr) + { + if( (*itr) && (*itr)->isAlive() ) + { + Creature * demon = (Creature *)m_creature->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if(demon) + { + ((ScriptedAI *)demon->AI())->AttackStart( (*itr) ); + ((mob_inner_demonAI *)demon->AI())->victimGUID = (*itr)->GetGUID(); + + for (int i=0; i<3; i++) + { + if (!spell->Effect[i]) + continue; + (*itr)->AddAura(new InsidiousAura(spell, i, NULL, (*itr), (*itr))); + } + if( InnderDemon_Count > 4 ) InnderDemon_Count = 0; + + //Safe storing of creatures + InnderDemon[InnderDemon_Count] = demon->GetGUID(); + + //Update demon count + InnderDemon_Count++; + } + } + } + DoScriptText(SAY_INNER_DEMONS, m_creature); + + InnerDemons_Timer = 999999; + }else InnerDemons_Timer -= diff; //Switch_Timer if(SwitchToHuman_Timer < diff) { //switch to nightelf form m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF); - m_creature->LoadEquipment(m_creature->GetEquipmentId()); + m_creature->LoadEquipment(m_creature->GetEquipmentId()); - CastConsumingMadness(); - DespawnDemon(); + CastConsumingMadness(); + DespawnDemon(); DemonForm = false; - NeedThreatReset = true; + NeedThreatReset = true; SwitchToHuman_Timer = 60000; }else SwitchToHuman_Timer -= diff; - } + } if (!IsFinalForm && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) { //at this point he divides himself in two parts - Creature *Copy = NULL; + Creature *Copy = NULL; Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000); - if(Copy) + if(Copy) { Demon = Copy->GetGUID(); - if (m_creature->getVictim()) - Copy->AI()->AttackStart(m_creature->getVictim()); - } + if (m_creature->getVictim()) + Copy->AI()->AttackStart(m_creature->getVictim()); + } //set nightelf final form IsFinalForm = true; DemonForm = false; DoScriptText(SAY_FINAL_FORM, m_creature); - m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF); - m_creature->LoadEquipment(m_creature->GetEquipmentId()); + m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF); + m_creature->LoadEquipment(m_creature->GetEquipmentId()); } } }; @@ -586,12 +586,12 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI } uint32 ChaosBlast_Timer; - bool DealDamage; + bool DealDamage; void Reset() { ChaosBlast_Timer = 1000; - DealDamage = true; + DealDamage = true; } void StartEvent() @@ -629,19 +629,19 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI if (!UpdateVictim() ) return; //ChaosBlast_Timer - if(m_creature->GetDistance(m_creature->getVictim()) < 30) - m_creature->StopMoving(); + if(m_creature->GetDistance(m_creature->getVictim()) < 30) + m_creature->StopMoving(); - if(ChaosBlast_Timer < diff) + if(ChaosBlast_Timer < diff) { - // will cast only when in range od spell - if(m_creature->GetDistance(m_creature->getVictim()) < 30) - { - //m_creature->CastSpell(m_creature->getVictim(),SPELL_CHAOS_BLAST,true); - int damage = 100; - m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); - ChaosBlast_Timer = 3000; - } + // will cast only when in range od spell + if(m_creature->GetDistance(m_creature->getVictim()) < 30) + { + //m_creature->CastSpell(m_creature->getVictim(),SPELL_CHAOS_BLAST,true); + int damage = 100; + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); + ChaosBlast_Timer = 3000; + } }else ChaosBlast_Timer -= diff; //Do NOT deal any melee damage to the target. @@ -649,128 +649,128 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI }; struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI { - mob_greyheart_spellbinderAI(Creature *c) : ScriptedAI(c) + mob_greyheart_spellbinderAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance *)c->GetInstanceData());; + leotherasGUID = 0; + AddedBanish = false; + Reset(); + } + + ScriptedInstance *pInstance; + + uint64 leotherasGUID; + + uint32 Mindblast_Timer; + uint32 Earthshock_Timer; + + bool AddedBanish; + + void Reset() + { + Mindblast_Timer = 3000 + rand()%5000; + Earthshock_Timer = 5000 + rand()%5000; + + if(pInstance) + { + pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0); + Creature *leotheras = (Creature *)Unit::GetUnit(*m_creature, leotherasGUID); + if(leotheras && leotheras->isAlive()) + ((boss_leotheras_the_blindAI*)leotheras->AI())->CheckChannelers(false); + } + } + + void Aggro(Unit *who) { - pInstance = ((ScriptedInstance *)c->GetInstanceData());; - leotherasGUID = 0; - AddedBanish = false; - Reset(); - } - - ScriptedInstance *pInstance; - - uint64 leotherasGUID; - - uint32 Mindblast_Timer; - uint32 Earthshock_Timer; - - bool AddedBanish; - - void Reset() - { - Mindblast_Timer = 3000 + rand()%5000; - Earthshock_Timer = 5000 + rand()%5000; - - if(pInstance) - { - pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0); - Creature *leotheras = (Creature *)Unit::GetUnit(*m_creature, leotherasGUID); - if(leotheras && leotheras->isAlive()) - ((boss_leotheras_the_blindAI*)leotheras->AI())->CheckChannelers(false); - } - } - - void Aggro(Unit *who) - { - m_creature->InterruptNonMeleeSpells(false); - if(pInstance) - pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID()); - } - - void JustRespawned() - { - InCombat = false; - AddedBanish = false; - Reset(); - } - - void CastChanneling() - { - if(!InCombat && !m_creature->m_currentSpells[CURRENT_CHANNELED_SPELL]) - { - if(leotherasGUID) - { - Creature *leotheras = (Creature *)Unit::GetUnit(*m_creature, leotherasGUID); - if(leotheras && leotheras->isAlive()) - DoCast(leotheras, BANISH_BEAM); - } - } - } - - void UpdateAI(const uint32 diff) - { - if(pInstance) - { - if(!leotherasGUID) - leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS); - - if(!InCombat && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - Unit *victim = NULL; - victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); - if(victim) - AttackStart(victim); - } - } - - if(!UpdateVictim()) - { - CastChanneling(); - return; - } - - if(pInstance && !pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - EnterEvadeMode(); - return; - } - - if(Mindblast_Timer < diff) - { - Unit* target = NULL; + m_creature->InterruptNonMeleeSpells(false); + if(pInstance) + pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID()); + } + + void JustRespawned() + { + InCombat = false; + AddedBanish = false; + Reset(); + } + + void CastChanneling() + { + if(!InCombat && !m_creature->m_currentSpells[CURRENT_CHANNELED_SPELL]) + { + if(leotherasGUID) + { + Creature *leotheras = (Creature *)Unit::GetUnit(*m_creature, leotherasGUID); + if(leotheras && leotheras->isAlive()) + DoCast(leotheras, BANISH_BEAM); + } + } + } + + void UpdateAI(const uint32 diff) + { + if(pInstance) + { + if(!leotherasGUID) + leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS); + + if(!InCombat && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + Unit *victim = NULL; + victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); + if(victim) + AttackStart(victim); + } + } + + if(!UpdateVictim()) + { + CastChanneling(); + return; + } + + if(pInstance && !pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + EnterEvadeMode(); + return; + } + + if(Mindblast_Timer < diff) + { + Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM,0); - if ( target )DoCast(target, SPELL_MINDBLAST); + if ( target )DoCast(target, SPELL_MINDBLAST); - Mindblast_Timer = 10000 + rand()%5000; - }else Mindblast_Timer -= diff; + Mindblast_Timer = 10000 + rand()%5000; + }else Mindblast_Timer -= diff; - if(Earthshock_Timer < diff) - { - Map *map = m_creature->GetMap(); - Map::PlayerList const &PlayerList = map->GetPlayers(); - for(Map::PlayerList::const_iterator itr = PlayerList.begin();itr != PlayerList.end(); ++itr) + if(Earthshock_Timer < diff) + { + Map *map = m_creature->GetMap(); + Map::PlayerList const &PlayerList = map->GetPlayers(); + for(Map::PlayerList::const_iterator itr = PlayerList.begin();itr != PlayerList.end(); ++itr) { if (Player* i_pl = itr->getSource()) { - bool isCasting = false; - for(uint8 i = 0; i < CURRENT_MAX_SPELL; ++i) - if(i_pl->m_currentSpells[i]) - isCasting = true; - - if(isCasting) - { - DoCast(i_pl, SPELL_EARTHSHOCK); - break; - } + bool isCasting = false; + for(uint8 i = 0; i < CURRENT_MAX_SPELL; ++i) + if(i_pl->m_currentSpells[i]) + isCasting = true; + + if(isCasting) + { + DoCast(i_pl, SPELL_EARTHSHOCK); + break; + } } - } - Earthshock_Timer = 8000 + rand()%7000; - }else Earthshock_Timer -= diff; - DoMeleeAttackIfReady(); - } + } + Earthshock_Timer = 8000 + rand()%7000; + }else Earthshock_Timer -= diff; + DoMeleeAttackIfReady(); + } - void JustDied(Unit *killer) {} + void JustDied(Unit *killer) {} }; CreatureAI* GetAI_boss_leotheras_the_blind(Creature *_Creature) { @@ -784,12 +784,12 @@ CreatureAI* GetAI_boss_leotheras_the_blind_demonform(Creature *_Creature) CreatureAI* GetAI_mob_greyheart_spellbinder(Creature *_Creature) { - return new mob_greyheart_spellbinderAI (_Creature); + return new mob_greyheart_spellbinderAI (_Creature); } CreatureAI* GetAI_mob_inner_demon(Creature *_Creature) { - return new mob_inner_demonAI (_Creature); + return new mob_inner_demonAI (_Creature); } void AddSC_boss_leotheras_the_blind() { @@ -805,12 +805,12 @@ void AddSC_boss_leotheras_the_blind() newscript->GetAI = &GetAI_boss_leotheras_the_blind_demonform; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="mob_greyheart_spellbinder"; newscript->GetAI = &GetAI_mob_greyheart_spellbinder; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="mob_inner_demon"; newscript->GetAI = &GetAI_mob_inner_demon; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp index 83a8554c754..1489f128dbd 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp @@ -26,199 +26,199 @@ EndScriptData */ #include "../../../creature/simple_ai.h" #include "Spell.h" -#define SPELL_SPOUT 37433 -#define SPELL_SPOUT_ANIM 42835 -#define SPELL_SPOUT_BREATH 37431 -#define SPELL_KNOCKBACK 19813 -#define SPELL_GEYSER 37478 -#define SPELL_WHIRL 37660 -#define SPELL_WATERBOLT 37138 -#define SPELL_SUBMERGE 37550 -#define SPELL_EMERGE 20568 -#define SPELL_SCALDINGWATER 37284 +#define SPELL_SPOUT 37433 +#define SPELL_SPOUT_ANIM 42835 +#define SPELL_SPOUT_BREATH 37431 +#define SPELL_KNOCKBACK 19813 +#define SPELL_GEYSER 37478 +#define SPELL_WHIRL 37660 +#define SPELL_WATERBOLT 37138 +#define SPELL_SUBMERGE 37550 +#define SPELL_EMERGE 20568 +#define SPELL_SCALDINGWATER 37284 -#define EMOTE_SPOUT "takes a deep breath." +#define EMOTE_SPOUT "takes a deep breath." -#define SPOUT_DIST 100 +#define SPOUT_DIST 100 #define MOB_COILFANG_GUARDIAN 21873 #define MOB_COILFANG_AMBUSHER 21865 //Ambusher spells -#define SPELL_SPREAD_SHOT 37790 -#define SPELL_SHOOT 37770 +#define SPELL_SPREAD_SHOT 37790 +#define SPELL_SHOOT 37770 //Guardian spells -#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one. -#define SPELL_HAMSTRING 26211 +#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one. +#define SPELL_HAMSTRING 26211 float AddPos[9][3] = { - {2.8553810, -459.823914, -19.182686}, //MOVE_AMBUSHER_1 X, Y, Z - {12.400000, -466.042267, -19.182686}, //MOVE_AMBUSHER_2 X, Y, Z - {51.366653, -460.836060, -19.182686}, //MOVE_AMBUSHER_3 X, Y, Z - {62.597980, -457.433044, -19.182686}, //MOVE_AMBUSHER_4 X, Y, Z - {77.607452, -384.302765, -19.182686}, //MOVE_AMBUSHER_5 X, Y, Z - {63.897900, -378.984924, -19.182686}, //MOVE_AMBUSHER_6 X, Y, Z - {34.447250, -387.333618, -19.182686}, //MOVE_GUARDIAN_1 X, Y, Z - {14.388216, -423.468018, -19.625271}, //MOVE_GUARDIAN_2 X, Y, Z - {42.471519, -445.115295, -19.769423} //MOVE_GUARDIAN_3 X, Y, Z + {2.8553810, -459.823914, -19.182686}, //MOVE_AMBUSHER_1 X, Y, Z + {12.400000, -466.042267, -19.182686}, //MOVE_AMBUSHER_2 X, Y, Z + {51.366653, -460.836060, -19.182686}, //MOVE_AMBUSHER_3 X, Y, Z + {62.597980, -457.433044, -19.182686}, //MOVE_AMBUSHER_4 X, Y, Z + {77.607452, -384.302765, -19.182686}, //MOVE_AMBUSHER_5 X, Y, Z + {63.897900, -378.984924, -19.182686}, //MOVE_AMBUSHER_6 X, Y, Z + {34.447250, -387.333618, -19.182686}, //MOVE_GUARDIAN_1 X, Y, Z + {14.388216, -423.468018, -19.625271}, //MOVE_GUARDIAN_2 X, Y, Z + {42.471519, -445.115295, -19.769423} //MOVE_GUARDIAN_3 X, Y, Z }; enum RotationType { - NOROTATE = 0, - CLOCKWISE = 1, - COUNTERCLOCKWISE = 2, + NOROTATE = 0, + CLOCKWISE = 1, + COUNTERCLOCKWISE = 2, }; struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI { boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SPOUT_ANIM); + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SPOUT_ANIM); if(TempSpell) - { - TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed - TempSpell->Effect[1] = 0; - TempSpell->Effect[2] = 0; - } - } - - ScriptedInstance* pInstance; + { + TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed + TempSpell->Effect[1] = 0; + TempSpell->Effect[2] = 0; + } + } + + ScriptedInstance* pInstance; SummonList Summons; - bool Spawned; + bool Spawned; bool Submerged; double SpoutAngle; - uint8 RotType; + uint8 RotType; - uint32 RotTimer; - uint32 SpoutAnimTimer; - uint32 WaterboltTimer; - uint32 SpoutTimer; - uint32 WhirlTimer;//after avery spout - uint32 PhaseTimer; - uint32 GeyserTimer; + uint32 RotTimer; + uint32 SpoutAnimTimer; + uint32 WaterboltTimer; + uint32 SpoutTimer; + uint32 WhirlTimer;//after avery spout + uint32 PhaseTimer; + uint32 GeyserTimer; - void Reset() - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING + MOVEMENTFLAG_LEVITATING); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetCorpseDelay(1000*60*60); + void Reset() + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING + MOVEMENTFLAG_LEVITATING); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetCorpseDelay(1000*60*60); RotType = NOROTATE; - SpoutAngle = 0; - SpoutAnimTimer = 1000; - RotTimer = 20000; - WaterboltTimer = 3000; - SpoutTimer = 15000; - WhirlTimer = 18000;//after avery spout - PhaseTimer = 120000; - GeyserTimer = rand()%5000 + 15000; + SpoutAngle = 0; + SpoutAnimTimer = 1000; + RotTimer = 20000; + WaterboltTimer = 3000; + SpoutTimer = 15000; + WhirlTimer = 18000;//after avery spout + PhaseTimer = 120000; + GeyserTimer = rand()%5000 + 15000; Submerged = false; - Spawned = false; + Spawned = false; Summons.DespawnAll(); - if(pInstance) - pInstance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); + if(pInstance) + pInstance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); - /*if(pInstance->GetData(DATA_STRANGE_POOL) != DONE) - { - m_creature->SetReactState(REACT_PASSIVE); - m_creature->SetVisibility(VISIBILITY_OFF); - }else { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->SetReactState(REACT_AGGRESSIVE); - }*/ - } + /*if(pInstance->GetData(DATA_STRANGE_POOL) != DONE) + { + m_creature->SetReactState(REACT_PASSIVE); + m_creature->SetVisibility(VISIBILITY_OFF); + }else { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->SetReactState(REACT_AGGRESSIVE); + }*/ + } void MoveInLineOfSight(Unit *who) { - if (!who || m_creature->getVictim()) + if (!who || m_creature->getVictim()) return; - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { float attackRadius = m_creature->GetAttackDistance(who); if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - AttackStart(who); + AttackStart(who); } } - void Aggro(Unit *who) - { - if(pInstance) - pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); + void Aggro(Unit *who) + { + if(pInstance) + pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); - if (!who || m_creature->getVictim()) - return; + if (!who || m_creature->getVictim()) + return; - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - AttackStart(who); - } - } + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + AttackStart(who); + } + } - void JustDied(Unit* Killer) - { - if(pInstance) - pInstance->SetData(DATA_THELURKERBELOWEVENT, DONE); + void JustDied(Unit* Killer) + { + if(pInstance) + pInstance->SetData(DATA_THELURKERBELOWEVENT, DONE); Summons.DespawnAll(); - } - - void Rotate(const uint32 diff) - { - bool Spout = false; - switch (RotType) - { - case NOROTATE: - return; - case CLOCKWISE://20secs for 360turn - //no target if rotating! - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - SpoutAngle += (double)diff/20000*(double)M_PI*2; - if (SpoutAngle >= M_PI*2)SpoutAngle = 0; - m_creature->SetOrientation(SpoutAngle); - m_creature->StopMoving(); - Spout = true; - break; - case COUNTERCLOCKWISE://20secs for 360turn - //no target if rotating! - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - SpoutAngle -= (double)diff/20000*(double)M_PI*2; - if (SpoutAngle <= 0)SpoutAngle = M_PI*2; - m_creature->SetOrientation(SpoutAngle); - m_creature->StopMoving(); - Spout = true; - break; - } - - if(!Spout) - return; - - if(RotTimerInterruptNonMeleeSpells(false); - WhirlTimer = 4000; //whirl directly after spout ends - return; - }else RotTimer-=diff; - - if(SpoutAnimTimerSetUInt64Value(UNIT_FIELD_TARGET, 0); + SpoutAngle += (double)diff/20000*(double)M_PI*2; + if (SpoutAngle >= M_PI*2)SpoutAngle = 0; + m_creature->SetOrientation(SpoutAngle); + m_creature->StopMoving(); + Spout = true; + break; + case COUNTERCLOCKWISE://20secs for 360turn + //no target if rotating! + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + SpoutAngle -= (double)diff/20000*(double)M_PI*2; + if (SpoutAngle <= 0)SpoutAngle = M_PI*2; + m_creature->SetOrientation(SpoutAngle); + m_creature->StopMoving(); + Spout = true; + break; + } + + if(!Spout) + return; + + if(RotTimerInterruptNonMeleeSpells(false); + WhirlTimer = 4000; //whirl directly after spout ends + return; + }else RotTimer-=diff; + + if(SpoutAnimTimergetSource(); if(target->isAlive() && m_creature->HasInArc((double)diff/20000*(double)M_PI*2,target) && m_creature->GetDistance(target) <= SPOUT_DIST && !target->IsInWater()) - DoCast(target,SPELL_SPOUT,true);//only knock back palyers in arc, in 100yards, not in water - } + DoCast(target,SPELL_SPOUT,true);//only knock back palyers in arc, in 100yards, not in water + } + } + } + + void StartRotate(Unit* victim) + { + switch (rand()%2) + { + case 0: RotType = CLOCKWISE; break; + case 1: RotType = COUNTERCLOCKWISE; break; } - } - - void StartRotate(Unit* victim) - { - switch (rand()%2) - { - case 0: RotType = CLOCKWISE; break; - case 1: RotType = COUNTERCLOCKWISE; break; - } RotTimer=20000; if(victim) - SpoutAngle = m_creature->GetAngle(victim); + SpoutAngle = m_creature->GetAngle(victim); m_creature->MonsterTextEmote(EMOTE_SPOUT,0,true); - //DoCast(m_creature,SPELL_SPOUT_BREATH);//take breath anim - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim() /*|| !m_creature->getVictim()*/ )//rotate resets target - return; - - //Check if players in water and if in water cast spell - Map *map = m_creature->GetMap(); - if (map->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS) - { - Map::PlayerList const &PlayerList = map->GetPlayers(); - - if (PlayerList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER, 0)) - i->getSource()->CastSpell(i->getSource(), SPELL_SCALDINGWATER, true); - else if(!i->getSource()->IsInWater()) - i->getSource()->RemoveAurasDueToSpell(SPELL_SCALDINGWATER); - } - } - - Rotate(diff);//always check rotate things - if(!Submerged) - { - if(PhaseTimer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_SUBMERGE); - PhaseTimer = 60000;//60secs submerged - Submerged = true; - }else PhaseTimer-=diff; - } - - if(!Submerged && RotType == NOROTATE)//is not spouting and not submerged - { - if(SpoutTimer < diff) - { - if(m_creature->getVictim() && RotType == NOROTATE) - StartRotate(m_creature->getVictim());//start spout and random rotate - - SpoutTimer= 35000; - return; - }else SpoutTimer -= diff; - - //Whirl directly after a Spout and at random times - if(WhirlTimer < diff) - { - WhirlTimer = rand()%5000 + 15000; - DoCast(m_creature,SPELL_WHIRL); - WaterboltTimer += 5000;//add 5secs to waterbolt timer, to add some time to run back to boss - }else WhirlTimer -= diff; - - if(GeyserTimer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - - if(target) - DoCast(target,SPELL_GEYSER,true); - else - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if(target) - DoCast(target,SPELL_GEYSER,true); - - GeyserTimer = rand()%5000 + 15000; - }else GeyserTimer -= diff; - - if(WaterboltTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_NEAREST,0,14,true); - if(!target) - { - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if(target) - DoCast(target,SPELL_WATERBOLT); - } - WaterboltTimer = 3000; - }else WaterboltTimer -= diff; - - if (!UpdateVictim() ) - return; - - DoMeleeAttackIfReady(); - - }else if(!Submerged) - return; - else if(Submerged)//phase 2, submerged - { - if(PhaseTimer < diff) - { - Submerged = false; - m_creature->InterruptNonMeleeSpells(false);//shouldn't be any - m_creature->RemoveAllAuras(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); - m_creature->RemoveFlag(UNIT_FIELD_BYTES_1,9); - DoCast(m_creature,SPELL_EMERGE); - Spawned = false; - SpoutTimer = 4000; // directly cast Spout after emerging! - WhirlTimer = 26000; - PhaseTimer = 120000; - return; - }else PhaseTimer-=diff; - - if(!m_creature->isInCombat()) - m_creature->SetInCombatState(false); - - if(!Spawned) - { - m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //spawn adds + //DoCast(m_creature,SPELL_SPOUT_BREATH);//take breath anim + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim() /*|| !m_creature->getVictim()*/ )//rotate resets target + return; + + //Check if players in water and if in water cast spell + Map *map = m_creature->GetMap(); + if (map->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS) + { + Map::PlayerList const &PlayerList = map->GetPlayers(); + + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER, 0)) + i->getSource()->CastSpell(i->getSource(), SPELL_SCALDINGWATER, true); + else if(!i->getSource()->IsInWater()) + i->getSource()->RemoveAurasDueToSpell(SPELL_SCALDINGWATER); + } + } + + Rotate(diff);//always check rotate things + if(!Submerged) + { + if(PhaseTimer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_SUBMERGE); + PhaseTimer = 60000;//60secs submerged + Submerged = true; + }else PhaseTimer-=diff; + } + + if(!Submerged && RotType == NOROTATE)//is not spouting and not submerged + { + if(SpoutTimer < diff) + { + if(m_creature->getVictim() && RotType == NOROTATE) + StartRotate(m_creature->getVictim());//start spout and random rotate + + SpoutTimer= 35000; + return; + }else SpoutTimer -= diff; + + //Whirl directly after a Spout and at random times + if(WhirlTimer < diff) + { + WhirlTimer = rand()%5000 + 15000; + DoCast(m_creature,SPELL_WHIRL); + WaterboltTimer += 5000;//add 5secs to waterbolt timer, to add some time to run back to boss + }else WhirlTimer -= diff; + + if(GeyserTimer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + + if(target) + DoCast(target,SPELL_GEYSER,true); + else + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if(target) + DoCast(target,SPELL_GEYSER,true); + + GeyserTimer = rand()%5000 + 15000; + }else GeyserTimer -= diff; + + if(WaterboltTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_NEAREST,0,14,true); + if(!target) + { + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if(target) + DoCast(target,SPELL_WATERBOLT); + } + WaterboltTimer = 3000; + }else WaterboltTimer -= diff; + + if (!UpdateVictim() ) + return; + + DoMeleeAttackIfReady(); + + }else if(!Submerged) + return; + else if(Submerged)//phase 2, submerged + { + if(PhaseTimer < diff) + { + Submerged = false; + m_creature->InterruptNonMeleeSpells(false);//shouldn't be any + m_creature->RemoveAllAuras(); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); + m_creature->RemoveFlag(UNIT_FIELD_BYTES_1,9); + DoCast(m_creature,SPELL_EMERGE); + Spawned = false; + SpoutTimer = 4000; // directly cast Spout after emerging! + WhirlTimer = 26000; + PhaseTimer = 120000; + return; + }else PhaseTimer-=diff; + + if(!m_creature->isInCombat()) + m_creature->SetInCombatState(false); + + if(!Spawned) + { + m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //spawn adds for (uint8 i = 0; i < 9; ++i) { Creature* Summoned; - if(i < 7) + if(i < 7) Summoned = m_creature->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); else Summoned = m_creature->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); @@ -396,66 +396,66 @@ CreatureAI* GetAI_mob_coilfang_guardian(Creature *_Creature) ai->Spell[1].First_Cast = 2000; ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; - return ai; + return ai; } struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI { mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c) - { - Reset(); - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHOOT); + { + Reset(); + SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHOOT); if(TempSpell) - TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg - } + TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg + } - uint32 MultiShotTimer; - uint32 ShootBowTimer; + uint32 MultiShotTimer; + uint32 ShootBowTimer; void Reset() { - MultiShotTimer = 10000; - ShootBowTimer = 4000; + MultiShotTimer = 10000; + ShootBowTimer = 4000; - } + } - void Aggro(Unit *who) + void Aggro(Unit *who) { } void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) return; + { + if (!who || m_creature->getVictim()) return; - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { - AttackStart(who); + AttackStart(who); } - } + } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 diff) { - if(MultiShotTimer < diff) - { - if(m_creature->getVictim()) - DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true); - - MultiShotTimer = 10000; - ShootBowTimer += 1500;//add global cooldown - }else MultiShotTimer -= diff; - - if(ShootBowTimer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - int bp0 = 1100; - if(target) - m_creature->CastCustomSpell(target,SPELL_SHOOT,&bp0,NULL,NULL,true); - ShootBowTimer = 4000; - MultiShotTimer += 1500;//add global cooldown - }else ShootBowTimer -= diff; - } + if(MultiShotTimer < diff) + { + if(m_creature->getVictim()) + DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true); + + MultiShotTimer = 10000; + ShootBowTimer += 1500;//add global cooldown + }else MultiShotTimer -= diff; + + if(ShootBowTimer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + int bp0 = 1100; + if(target) + m_creature->CastCustomSpell(target,SPELL_SHOOT,&bp0,NULL,NULL,true); + ShootBowTimer = 4000; + MultiShotTimer += 1500;//add global cooldown + }else ShootBowTimer -= diff; + } }; CreatureAI* GetAI_mob_coilfang_ambusher(Creature *_Creature) @@ -476,12 +476,12 @@ void AddSC_boss_the_lurker_below() newscript->GetAI = &GetAI_boss_the_lurker_below; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="mob_coilfang_guardian"; newscript->GetAI = &GetAI_mob_coilfang_guardian; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="mob_coilfang_ambusher"; newscript->GetAI = &GetAI_mob_coilfang_ambusher; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp index 3e0ff3e2c77..febabd896cd 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp @@ -55,27 +55,27 @@ EndScriptData */ #define WATERY_GRAVE_Y4 -690.96 #define WATERY_GRAVE_Z4 -14.44 -#define SPELL_WATERY_GRAVE_1 38023 -#define SPELL_WATERY_GRAVE_2 38024 -#define SPELL_WATERY_GRAVE_3 38025 -#define SPELL_WATERY_GRAVE_4 37850 - -#define SPELL_SUMMON_WATER_GLOBULE_1 37854 -#define SPELL_SUMMON_WATER_GLOBULE_2 37858 -#define SPELL_SUMMON_WATER_GLOBULE_3 37860 -#define SPELL_SUMMON_WATER_GLOBULE_4 37861 - -/*#define SPELL_SUMMON_MURLOC_A6 39813 -#define SPELL_SUMMON_MURLOC_A7 39814 -#define SPELL_SUMMON_MURLOC_A8 39815 -#define SPELL_SUMMON_MURLOC_A9 39816 -#define SPELL_SUMMON_MURLOC_A10 39817 - -#define SPELL_SUMMON_MURLOC_B6 39818 -#define SPELL_SUMMON_MURLOC_B7 39819 -#define SPELL_SUMMON_MURLOC_B8 39820 -#define SPELL_SUMMON_MURLOC_B9 39821 -#define SPELL_SUMMON_MURLOC_B10 39822*/ +#define SPELL_WATERY_GRAVE_1 38023 +#define SPELL_WATERY_GRAVE_2 38024 +#define SPELL_WATERY_GRAVE_3 38025 +#define SPELL_WATERY_GRAVE_4 37850 + +#define SPELL_SUMMON_WATER_GLOBULE_1 37854 +#define SPELL_SUMMON_WATER_GLOBULE_2 37858 +#define SPELL_SUMMON_WATER_GLOBULE_3 37860 +#define SPELL_SUMMON_WATER_GLOBULE_4 37861 + +/*#define SPELL_SUMMON_MURLOC_A6 39813 +#define SPELL_SUMMON_MURLOC_A7 39814 +#define SPELL_SUMMON_MURLOC_A8 39815 +#define SPELL_SUMMON_MURLOC_A9 39816 +#define SPELL_SUMMON_MURLOC_A10 39817 + +#define SPELL_SUMMON_MURLOC_B6 39818 +#define SPELL_SUMMON_MURLOC_B7 39819 +#define SPELL_SUMMON_MURLOC_B8 39820 +#define SPELL_SUMMON_MURLOC_B9 39821 +#define SPELL_SUMMON_MURLOC_B10 39822*/ float MurlocCords[10][5] = { @@ -105,7 +105,7 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI } ScriptedInstance* pInstance; - Map::PlayerList const *PlayerList; + Map::PlayerList const *PlayerList; uint32 TidalWave_Timer; uint32 WateryGrave_Timer; @@ -124,7 +124,7 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI WateryGrave_Timer = 30000; Earthquake_Timer = 40000; WateryGlobules_Timer = 0; - globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1; + globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1; globulespell[1] = SPELL_SUMMON_WATER_GLOBULE_2; globulespell[2] = SPELL_SUMMON_WATER_GLOBULE_3; globulespell[3] = SPELL_SUMMON_WATER_GLOBULE_4; @@ -148,9 +148,9 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI { switch(rand()%3) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; } } @@ -162,18 +162,18 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED); } - void Aggro(Unit *who) - { + void Aggro(Unit *who) + { PlayerList = &((InstanceMap*)m_creature->GetMap())->GetPlayers(); Playercount = PlayerList->getSize(); StartEvent(); - } + } void ApplyWateryGrave(Unit *player, uint8 i) { - switch(i) + switch(i) { - case 0: player->CastSpell(player, SPELL_WATERY_GRAVE_1, true); break; + case 0: player->CastSpell(player, SPELL_WATERY_GRAVE_1, true); break; case 1: player->CastSpell(player, SPELL_WATERY_GRAVE_2, true); break; case 2: player->CastSpell(player, SPELL_WATERY_GRAVE_3, true); break; case 3: player->CastSpell(player, SPELL_WATERY_GRAVE_4, true); break; @@ -203,17 +203,17 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI case 1: DoScriptText(SAY_SUMMON2, m_creature); break; } - for(uint8 i = 0; i < 10; i++) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - Creature* Murloc = m_creature->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - Murloc->AI()->AttackStart(target); - } - DoScriptText(EMOTE_EARTHQUAKE, m_creature); - Earthquake = false; - Earthquake_Timer = 40000+rand()%5000; - } - }else Earthquake_Timer -= diff; + for(uint8 i = 0; i < 10; i++) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + Creature* Murloc = m_creature->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + Murloc->AI()->AttackStart(target); + } + DoScriptText(EMOTE_EARTHQUAKE, m_creature); + Earthquake = false; + Earthquake_Timer = 40000+rand()%5000; + } + }else Earthquake_Timer -= diff; //TidalWave_Timer if (TidalWave_Timer < diff) @@ -229,21 +229,21 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI { //Teleport 4 players under the waterfalls Unit *target; - using std::set; + using std::set; setlist; set::iterator itr; for(uint8 i = 0; i < 4; i++) { - counter = 0; - do{target = SelectUnit(SELECT_TARGET_RANDOM, 1, 50, true); //target players only - if(counter < Playercount) - break; - if(target) itr = list.find(target->GetGUID()); - counter++; - }while(itr != list.end()); - if(target){list.insert(target->GetGUID()); - ApplyWateryGrave(target, i); - } + counter = 0; + do{target = SelectUnit(SELECT_TARGET_RANDOM, 1, 50, true); //target players only + if(counter < Playercount) + break; + if(target) itr = list.find(target->GetGUID()); + counter++; + }while(itr != list.end()); + if(target){list.insert(target->GetGUID()); + ApplyWateryGrave(target, i); + } } switch(rand()%2) @@ -265,7 +265,7 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI //WateryGlobules_Timer if (WateryGlobules_Timer < diff) { - Unit* globuletarget; + Unit* globuletarget; using std::set; setglobulelist; set::iterator itr; @@ -333,7 +333,7 @@ struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI { if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 5)) { - DoCast(m_creature->getVictim(), SPELL_GLOBULE_EXPLOSION); + DoCast(m_creature->getVictim(), SPELL_GLOBULE_EXPLOSION); //despawn m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp index 1b7bade5f14..919a455bb79 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp @@ -39,11 +39,11 @@ bool GOHello_go_bridge_console(Player *player, GameObject* go) { ScriptedInstance* pInstance = (ScriptedInstance*)go->GetInstanceData(); - if(!pInstance) - return false; + if(!pInstance) + return false; - if (pInstance) - pInstance->SetData(DATA_CONTROL_CONSOLE, DONE); + if (pInstance) + pInstance->SetData(DATA_CONTROL_CONSOLE, DONE); return true; } @@ -52,40 +52,40 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance { instance_serpentshrine_cavern(Map *map) : ScriptedInstance(map) {Initialize();}; - uint64 LurkerBelow; + uint64 LurkerBelow; uint64 Sharkkis; uint64 Tidalvess; uint64 Caribdis; uint64 LadyVashj; uint64 Karathress; uint64 KarathressEvent_Starter; - uint64 LeotherasTheBlind; - uint64 LeotherasEventStarter; + uint64 LeotherasTheBlind; + uint64 LeotherasEventStarter; - uint64 ControlConsole; - uint64 BridgePart[3]; - uint64 StrangePool; + uint64 ControlConsole; + uint64 BridgePart[3]; + uint64 StrangePool; bool ShieldGeneratorDeactivated[4]; bool Encounters[ENCOUNTERS]; void Initialize() { - LurkerBelow = 0; + LurkerBelow = 0; Sharkkis = 0; Tidalvess = 0; Caribdis = 0; LadyVashj = 0; Karathress = 0; KarathressEvent_Starter = 0; - LeotherasTheBlind = 0; - LeotherasEventStarter = 0; + LeotherasTheBlind = 0; + LeotherasEventStarter = 0; - ControlConsole = 0; - BridgePart[0] = 0; - BridgePart[1] = 0; - BridgePart[2] = 0; - StrangePool = 0; + ControlConsole = 0; + BridgePart[0] = 0; + BridgePart[1] = 0; + BridgePart[2] = 0; + StrangePool = 0; ShieldGeneratorDeactivated[0] = false; ShieldGeneratorDeactivated[1] = false; @@ -104,37 +104,37 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance return false; } - void OnObjectCreate(GameObject *go) + void OnObjectCreate(GameObject *go) { switch(go->GetEntry()) { - case 184568: - ControlConsole = go->GetGUID(); - go->setActive(true); + case 184568: + ControlConsole = go->GetGUID(); + go->setActive(true); break; case 184203: - BridgePart[0] = go->GetGUID(); - go->setActive(true); + BridgePart[0] = go->GetGUID(); + go->setActive(true); break; case 184204: - BridgePart[1] = go->GetGUID(); - go->setActive(true); + BridgePart[1] = go->GetGUID(); + go->setActive(true); break; - case 184205: - BridgePart[2] = go->GetGUID(); - go->setActive(true); + case 184205: + BridgePart[2] = go->GetGUID(); + go->setActive(true); break; - case 184956: - StrangePool = go->GetGUID(); - if(go->isActive()) - SetData(DATA_STRANGE_POOL, DONE); + case 184956: + StrangePool = go->GetGUID(); + if(go->isActive()) + SetData(DATA_STRANGE_POOL, DONE); } } - void OpenDoor(uint64 DoorGUID, bool open) + void OpenDoor(uint64 DoorGUID, bool open) { if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID)) Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1); @@ -144,36 +144,36 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance { switch(creature_entry) { - case 21212: LadyVashj = creature->GetGUID(); break; - case 21214: Karathress = creature->GetGUID(); break; - case 21966: Sharkkis = creature->GetGUID(); break; - case 21217: LurkerBelow = creature->GetGUID(); break; - case 21965: Tidalvess = creature->GetGUID(); break; - case 21964: Caribdis = creature->GetGUID(); break; - case 21215: LeotherasTheBlind = creature->GetGUID(); break;} + case 21212: LadyVashj = creature->GetGUID(); break; + case 21214: Karathress = creature->GetGUID(); break; + case 21966: Sharkkis = creature->GetGUID(); break; + case 21217: LurkerBelow = creature->GetGUID(); break; + case 21965: Tidalvess = creature->GetGUID(); break; + case 21964: Caribdis = creature->GetGUID(); break; + case 21215: LeotherasTheBlind = creature->GetGUID(); break;} } void SetData64(uint32 type, uint64 data) { if(type == DATA_KARATHRESSEVENT_STARTER) - KarathressEvent_Starter = data; - if(type == DATA_LEOTHERAS_EVENT_STARTER) - LeotherasEventStarter = data; + KarathressEvent_Starter = data; + if(type == DATA_LEOTHERAS_EVENT_STARTER) + LeotherasEventStarter = data; } uint64 GetData64(uint32 identifier) { switch(identifier) { - case DATA_THELURKERBELOW: return LurkerBelow; - case DATA_SHARKKIS: return Sharkkis; - case DATA_TIDALVESS: return Tidalvess; - case DATA_CARIBDIS: return Caribdis; - case DATA_LADYVASHJ: return LadyVashj; - case DATA_KARATHRESS: return Karathress; - case DATA_KARATHRESSEVENT_STARTER: return KarathressEvent_Starter; - case DATA_LEOTHERAS: return LeotherasTheBlind; - case DATA_LEOTHERAS_EVENT_STARTER: return LeotherasEventStarter; + case DATA_THELURKERBELOW: return LurkerBelow; + case DATA_SHARKKIS: return Sharkkis; + case DATA_TIDALVESS: return Tidalvess; + case DATA_CARIBDIS: return Caribdis; + case DATA_LADYVASHJ: return LadyVashj; + case DATA_KARATHRESS: return Karathress; + case DATA_KARATHRESSEVENT_STARTER: return KarathressEvent_Starter; + case DATA_LEOTHERAS: return LeotherasTheBlind; + case DATA_LEOTHERAS_EVENT_STARTER: return LeotherasEventStarter; } return 0; } @@ -182,63 +182,63 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance { switch(type) { - case DATA_STRANGE_POOL: StrangePool = data; - case DATA_CONTROL_CONSOLE: - if(data = DONE) - { - OpenDoor(BridgePart[0], true); - OpenDoor(BridgePart[1], true); - OpenDoor(BridgePart[2], true); - } - ControlConsole = data; - case DATA_HYDROSSTHEUNSTABLEEVENT: Encounters[0] = data; break; - case DATA_LEOTHERASTHEBLINDEVENT: Encounters[1] = data; break; - case DATA_THELURKERBELOWEVENT: Encounters[2] = data; break; - case DATA_KARATHRESSEVENT: Encounters[3] = data; break; - case DATA_MOROGRIMTIDEWALKEREVENT: Encounters[4] = data; break; - //Lady Vashj - case DATA_LADYVASHJEVENT: - if(data == NOT_STARTED) - { - ShieldGeneratorDeactivated[0] = false; - ShieldGeneratorDeactivated[1] = false; - ShieldGeneratorDeactivated[2] = false; - ShieldGeneratorDeactivated[3] = false; - } - Encounters[5] = data; break; - case DATA_SHIELDGENERATOR1:ShieldGeneratorDeactivated[0] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR2:ShieldGeneratorDeactivated[1] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR3:ShieldGeneratorDeactivated[2] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR4:ShieldGeneratorDeactivated[3] = (data) ? true : false; break; - } - - if(data = DONE) - SaveToDB(); + case DATA_STRANGE_POOL: StrangePool = data; + case DATA_CONTROL_CONSOLE: + if(data = DONE) + { + OpenDoor(BridgePart[0], true); + OpenDoor(BridgePart[1], true); + OpenDoor(BridgePart[2], true); + } + ControlConsole = data; + case DATA_HYDROSSTHEUNSTABLEEVENT: Encounters[0] = data; break; + case DATA_LEOTHERASTHEBLINDEVENT: Encounters[1] = data; break; + case DATA_THELURKERBELOWEVENT: Encounters[2] = data; break; + case DATA_KARATHRESSEVENT: Encounters[3] = data; break; + case DATA_MOROGRIMTIDEWALKEREVENT: Encounters[4] = data; break; + //Lady Vashj + case DATA_LADYVASHJEVENT: + if(data == NOT_STARTED) + { + ShieldGeneratorDeactivated[0] = false; + ShieldGeneratorDeactivated[1] = false; + ShieldGeneratorDeactivated[2] = false; + ShieldGeneratorDeactivated[3] = false; + } + Encounters[5] = data; break; + case DATA_SHIELDGENERATOR1:ShieldGeneratorDeactivated[0] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR2:ShieldGeneratorDeactivated[1] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR3:ShieldGeneratorDeactivated[2] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR4:ShieldGeneratorDeactivated[3] = (data) ? true : false; break; + } + + if(data = DONE) + SaveToDB(); } uint32 GetData(uint32 type) { switch(type) { - case DATA_HYDROSSTHEUNSTABLEEVENT: return Encounters[0]; - case DATA_LEOTHERASTHEBLINDEVENT: return Encounters[1]; - case DATA_THELURKERBELOWEVENT: return Encounters[2]; - case DATA_KARATHRESSEVENT: return Encounters[3]; - case DATA_MOROGRIMTIDEWALKEREVENT: return Encounters[4]; + case DATA_HYDROSSTHEUNSTABLEEVENT: return Encounters[0]; + case DATA_LEOTHERASTHEBLINDEVENT: return Encounters[1]; + case DATA_THELURKERBELOWEVENT: return Encounters[2]; + case DATA_KARATHRESSEVENT: return Encounters[3]; + case DATA_MOROGRIMTIDEWALKEREVENT: return Encounters[4]; //Lady Vashj - case DATA_LADYVASHJEVENT: return Encounters[5]; - case DATA_SHIELDGENERATOR1: return ShieldGeneratorDeactivated[0]; - case DATA_SHIELDGENERATOR2: return ShieldGeneratorDeactivated[1]; - case DATA_SHIELDGENERATOR3: return ShieldGeneratorDeactivated[2]; - case DATA_SHIELDGENERATOR4: return ShieldGeneratorDeactivated[3]; + case DATA_LADYVASHJEVENT: return Encounters[5]; + case DATA_SHIELDGENERATOR1: return ShieldGeneratorDeactivated[0]; + case DATA_SHIELDGENERATOR2: return ShieldGeneratorDeactivated[1]; + case DATA_SHIELDGENERATOR3: return ShieldGeneratorDeactivated[2]; + case DATA_SHIELDGENERATOR4: return ShieldGeneratorDeactivated[3]; case DATA_CANSTARTPHASE3: - if(ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])return 1;break; + if(ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])return 1;break; } return 0; } - const char* Save() - { - OUT_SAVE_INST_DATA; + const char* Save() + { + OUT_SAVE_INST_DATA; std::ostringstream stream; stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " << Encounters[3] << " " << Encounters[4] << " " << Encounters[5]; @@ -262,11 +262,11 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance OUT_LOAD_INST_DATA(in); std::istringstream stream(in); stream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] - >> Encounters[4] >> Encounters[5]; - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. - Encounters[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; + >> Encounters[4] >> Encounters[5]; + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + Encounters[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; } }; @@ -284,8 +284,8 @@ void AddSC_instance_serpentshrine_cavern() newscript->GetInstanceData = &GetInstanceData_instance_serpentshrine_cavern; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="go_bridge_console"; newscript->pGOHello = &GOHello_go_bridge_console; - newscript->RegisterSelf(); + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp index 6ea5517acf7..a0063a4eef9 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp @@ -38,33 +38,33 @@ EndScriptData */ bool GOHello_go_main_chambers_access_panel(Player *player, GameObject* _GO) { - ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData(); + ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData(); - if (!pInstance) - return false; + if (!pInstance) + return false; - if (_GO->GetEntry() == ACCESS_PANEL_HYDRO && pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL); + if (_GO->GetEntry() == ACCESS_PANEL_HYDRO && pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL); - if (_GO->GetEntry() == ACCESS_PANEL_MEK && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL); + if (_GO->GetEntry() == ACCESS_PANEL_MEK && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL); - return true; + return true; } struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance { instance_steam_vault(Map *map) : ScriptedInstance(map) {Initialize();}; - uint32 Encounter[ENCOUNTERS]; + uint32 Encounter[ENCOUNTERS]; uint64 ThespiaGUID; uint64 MekgineerGUID; uint64 KalithreshGUID; - uint64 MainChambersDoor; - uint64 AccessPanelHydro; - uint64 AccessPanelMek; + uint64 MainChambersDoor; + uint64 AccessPanelHydro; + uint64 AccessPanelMek; void Initialize() { @@ -72,46 +72,46 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance MekgineerGUID = 0; KalithreshGUID = 0; MainChambersDoor = 0; - AccessPanelHydro = 0; - AccessPanelMek = 0; + AccessPanelHydro = 0; + AccessPanelMek = 0; for(uint8 i = 0; i < ENCOUNTERS; i++) - Encounter[i] = NOT_STARTED; + Encounter[i] = NOT_STARTED; } bool IsEncounterInProgress() const { for(uint8 i = 0; i < ENCOUNTERS; i++) if (Encounter[i] == IN_PROGRESS) - return true; + return true; return false; } - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } - debug_log("SD2: Instance Steamvault: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } + debug_log("SD2: Instance Steamvault: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } void OnCreatureCreate(Creature *creature, uint32 creature_entry) { switch(creature->GetEntry()) { - case 17797: ThespiaGUID = creature->GetGUID(); break; - case 17796: MekgineerGUID = creature->GetGUID(); break; - case 17798: KalithreshGUID = creature->GetGUID(); break; + case 17797: ThespiaGUID = creature->GetGUID(); break; + case 17796: MekgineerGUID = creature->GetGUID(); break; + case 17798: KalithreshGUID = creature->GetGUID(); break; } } @@ -119,51 +119,51 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance { switch(go->GetEntry()) { - case MAIN_CHAMBERS_DOOR: MainChambersDoor = go->GetGUID(); break; - case ACCESS_PANEL_HYDRO: AccessPanelHydro = go->GetGUID(); break; - case ACCESS_PANEL_MEK: AccessPanelMek = go->GetGUID(); break; + case MAIN_CHAMBERS_DOOR: MainChambersDoor = go->GetGUID(); break; + case ACCESS_PANEL_HYDRO: AccessPanelHydro = go->GetGUID(); break; + case ACCESS_PANEL_MEK: AccessPanelMek = go->GetGUID(); break; } } void SetData(uint32 type, uint32 data) { - Player *player = GetPlayerInMap(); + Player *player = GetPlayerInMap(); - if (!player) - { - debug_log("SD2: Instance Steamvault: SetData (Type: %u Data %u) cannot find any player.", type, data); - return; - } + if (!player) + { + debug_log("SD2: Instance Steamvault: SetData (Type: %u Data %u) cannot find any player.", type, data); + return; + } switch(type) { case TYPE_HYDROMANCER_THESPIA: - if (data == SPECIAL) - { - if (GameObject *_go = GameObject::GetGameObject(*player,AccessPanelHydro)) - _go->SetGoState(0); - - if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) - { - if (GameObject *_go = GameObject::GetGameObject(*player,MainChambersDoor)) - _go->SetGoState(0); - } - debug_log("SD2: Instance Steamvault: Access panel used."); - } - Encounter[0] = data; - break; + if (data == SPECIAL) + { + if (GameObject *_go = GameObject::GetGameObject(*player,AccessPanelHydro)) + _go->SetGoState(0); + + if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) + { + if (GameObject *_go = GameObject::GetGameObject(*player,MainChambersDoor)) + _go->SetGoState(0); + } + debug_log("SD2: Instance Steamvault: Access panel used."); + } + Encounter[0] = data; + break; case TYPE_MEKGINEER_STEAMRIGGER: - if (data == SPECIAL) - { - if (GameObject *_go = GameObject::GetGameObject(*player,AccessPanelMek)) - _go->SetGoState(0); + if (data == SPECIAL) + { + if (GameObject *_go = GameObject::GetGameObject(*player,AccessPanelMek)) + _go->SetGoState(0); - if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) - { + if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) + { if (GameObject *_go = GameObject::GetGameObject(*player,MainChambersDoor)) _go->SetGoState(0); - } - debug_log("SD2: Instance Steamvault: Access panel used."); + } + debug_log("SD2: Instance Steamvault: Access panel used."); } Encounter[1] = data; break; @@ -216,10 +216,10 @@ void AddSC_instance_steam_vault() { Script *newscript; - newscript = new Script; - newscript->Name = "go_main_chambers_access_panel"; - newscript->pGOHello = &GOHello_go_main_chambers_access_panel; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "go_main_chambers_access_panel"; + newscript->pGOHello = &GOHello_go_main_chambers_access_panel; + newscript->RegisterSelf(); newscript = new Script; newscript->Name = "instance_steam_vault"; diff --git a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp index b0fbc5487e3..1aa7a6259d9 100644 --- a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp +++ b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp @@ -554,79 +554,79 @@ bool GOHello_go_second_trial(Player *player, GameObject* _GO) ## npc_apprentice_mirveda ######*/ -#define QUEST_UNEXPECTED_RESULT 8488 -#define MOB_GHARZUL 15958 -#define MOB_ANGERSHADE 15656 +#define QUEST_UNEXPECTED_RESULT 8488 +#define MOB_GHARZUL 15958 +#define MOB_ANGERSHADE 15656 struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI { - npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(m_creature) {Reset();} - - uint32 KillCount; - uint64 PlayerGUID; - bool Summon; - SummonList Summons; - - void Reset() - { - KillCount = 0; - PlayerGUID = 0; - Summons.DespawnAll(); - Summon = false; - } - - void Aggro(Unit* who){} - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature); - Summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature* summoned) - { - Summons.Despawn(summoned); - ++KillCount; - } - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (player) - ((Player*)player)->FailQuest(QUEST_UNEXPECTED_RESULT); - } - } - - void UpdateAI(const uint32 diff) - { - if(KillCount >= 3) - { - if (PlayerGUID) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if(player) - ((Player*)player)->CompleteQuest(QUEST_UNEXPECTED_RESULT); - } - } - - if(Summon) - { - m_creature->SummonCreature(MOB_GHARZUL, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); - m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); - m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); - Summon = false; - } - } + npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(m_creature) {Reset();} + + uint32 KillCount; + uint64 PlayerGUID; + bool Summon; + SummonList Summons; + + void Reset() + { + KillCount = 0; + PlayerGUID = 0; + Summons.DespawnAll(); + Summon = false; + } + + void Aggro(Unit* who){} + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature); + Summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature* summoned) + { + Summons.Despawn(summoned); + ++KillCount; + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player) + ((Player*)player)->FailQuest(QUEST_UNEXPECTED_RESULT); + } + } + + void UpdateAI(const uint32 diff) + { + if(KillCount >= 3) + { + if (PlayerGUID) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if(player) + ((Player*)player)->CompleteQuest(QUEST_UNEXPECTED_RESULT); + } + } + + if(Summon) + { + m_creature->SummonCreature(MOB_GHARZUL, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); + m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); + m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); + Summon = false; + } + } }; bool QuestAccept_npc_apprentice_mirveda(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == QUEST_UNEXPECTED_RESULT) { - ((npc_apprentice_mirvedaAI*)creature->AI())->Summon = true; - ((npc_apprentice_mirvedaAI*)creature->AI())->PlayerGUID = player->GetGUID(); + ((npc_apprentice_mirvedaAI*)creature->AI())->Summon = true; + ((npc_apprentice_mirvedaAI*)creature->AI())->PlayerGUID = player->GetGUID(); } return true; } @@ -640,9 +640,9 @@ CreatureAI* GetAI_npc_apprentice_mirvedaAI(Creature *_Creature) ## npc_infused_crystal ######*/ -#define MOB_ENRAGED_WRAITH 17086 -#define EMOTE -1000283 -#define QUEST_POWERING_OUR_DEFENSES 8490 +#define MOB_ENRAGED_WRAITH 17086 +#define EMOTE -1000283 +#define QUEST_POWERING_OUR_DEFENSES 8490 struct Location { @@ -651,97 +651,97 @@ struct Location static Location SpawnLocations[]= { - {8270.68, -7188.53, 139.619}, - {8284.27, -7187.78, 139.603}, - {8297.43, -7193.53, 139.603}, - {8303.5, -7201.96, 139.577}, - {8273.22, -7241.82, 139.382}, - {8254.89, -7222.12, 139.603}, - {8278.51, -7242.13, 139.162}, - {8267.97, -7239.17, 139.517} + {8270.68, -7188.53, 139.619}, + {8284.27, -7187.78, 139.603}, + {8297.43, -7193.53, 139.603}, + {8303.5, -7201.96, 139.577}, + {8273.22, -7241.82, 139.382}, + {8254.89, -7222.12, 139.603}, + {8278.51, -7242.13, 139.162}, + {8267.97, -7239.17, 139.517} }; struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI { - npc_infused_crystalAI(Creature* c) : Scripted_NoMovementAI(c) {Reset();} - - uint32 EndTimer; - uint32 WaveTimer; - bool Completed; - bool Progress; - uint64 PlayerGUID; - - void Reset() - { - EndTimer = 0; - Completed = false; - Progress = false; - PlayerGUID = 0; - WaveTimer = 0; - } - - void Aggro(Unit* who){} - - void MoveInLineOfSight(Unit* who) - { - if( who->GetTypeId() == TYPEID_PLAYER && !m_creature->canStartAttack(who) && !Progress) - { - if( ((Player*)who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE ) - { - float Radius = 10.0; - if( m_creature->IsWithinDistInMap(who, Radius) ) - { - PlayerGUID = who->GetGUID(); - WaveTimer = 1000; - EndTimer = 60000; - Progress = true; - } - } - } - } - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID && !Completed) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (player) - ((Player*)player)->FailQuest(QUEST_POWERING_OUR_DEFENSES); - } - } - - void UpdateAI(const uint32 diff) - { - if(EndTimer < diff && Progress) - { - DoScriptText(EMOTE, m_creature); - Completed = true; - if (PlayerGUID) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if(player) - ((Player*)player)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES); - } - m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - }else EndTimer -= diff; - - if(WaveTimer < diff && !Completed && Progress) - { - uint32 ran1 = rand()%8; - uint32 ran2 = rand()%8; - uint32 ran3 = rand()%8; - m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - WaveTimer = 30000; - }else WaveTimer -= diff; - } + npc_infused_crystalAI(Creature* c) : Scripted_NoMovementAI(c) {Reset();} + + uint32 EndTimer; + uint32 WaveTimer; + bool Completed; + bool Progress; + uint64 PlayerGUID; + + void Reset() + { + EndTimer = 0; + Completed = false; + Progress = false; + PlayerGUID = 0; + WaveTimer = 0; + } + + void Aggro(Unit* who){} + + void MoveInLineOfSight(Unit* who) + { + if( who->GetTypeId() == TYPEID_PLAYER && !m_creature->canStartAttack(who) && !Progress) + { + if( ((Player*)who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE ) + { + float Radius = 10.0; + if( m_creature->IsWithinDistInMap(who, Radius) ) + { + PlayerGUID = who->GetGUID(); + WaveTimer = 1000; + EndTimer = 60000; + Progress = true; + } + } + } + } + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID && !Completed) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player) + ((Player*)player)->FailQuest(QUEST_POWERING_OUR_DEFENSES); + } + } + + void UpdateAI(const uint32 diff) + { + if(EndTimer < diff && Progress) + { + DoScriptText(EMOTE, m_creature); + Completed = true; + if (PlayerGUID) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if(player) + ((Player*)player)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES); + } + m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + }else EndTimer -= diff; + + if(WaveTimer < diff && !Completed && Progress) + { + uint32 ran1 = rand()%8; + uint32 ran2 = rand()%8; + uint32 ran3 = rand()%8; + m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + WaveTimer = 30000; + }else WaveTimer -= diff; + } }; CreatureAI* GetAI_npc_infused_crystalAI(Creature *_Creature) @@ -782,14 +782,14 @@ void AddSC_eversong_woods() newscript->pGOHello = &GOHello_go_second_trial; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "npc_apprentice_mirveda"; - newscript->GetAI = &GetAI_npc_apprentice_mirvedaAI; - newscript->pQuestAccept = &QuestAccept_npc_apprentice_mirveda; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_apprentice_mirveda"; + newscript->GetAI = &GetAI_npc_apprentice_mirvedaAI; + newscript->pQuestAccept = &QuestAccept_npc_apprentice_mirveda; + newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "npc_infused_crystal"; - newscript->GetAI = &GetAI_npc_infused_crystalAI; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_infused_crystal"; + newscript->GetAI = &GetAI_npc_infused_crystalAI; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp index a81adad1291..c61a9318bdb 100644 --- a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp +++ b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp @@ -149,87 +149,87 @@ bool GOHello_gilded_brazier(Player *player, GameObject* _GO) struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI { - npc_ranger_lilathaAI(Creature *c) : npc_escortAI(c) {Reset();} + npc_ranger_lilathaAI(Creature *c) : npc_escortAI(c) {Reset();} - std::list CageList; + std::list CageList; - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (!player) + if (!player) return; switch(i) - { - case 0: - { - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); - if(Cage) - Cage->SetGoState(0); - DoScriptText(SAY_START, m_creature, player); - break; - } - case 5: - DoScriptText(SAY_PROGRESS1, m_creature, player); - case 11: - DoScriptText(SAY_PROGRESS2, m_creature, player); - m_creature->SetOrientation(4.762841); - break; - case 18: - { - DoScriptText(SAY_PROGRESS3, m_creature, player); - Creature* Summ1 = m_creature->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0); - Creature* Summ2 = m_creature->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0); - Summ1->Attack(m_creature, true); - Summ2->Attack(player, true); - m_creature->AI()->AttackStart(Summ1); - break; - } - case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 25: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 30: - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature); - break; - case 32: - m_creature->SetOrientation(2.978281); - DoScriptText(SAY_END1, m_creature, player); - break; - case 33: - m_creature->SetOrientation(5.858011); - DoScriptText(SAY_END2, m_creature, player); - Unit* CaptainHelios = FindCreature(NPC_CAPTAIN_HELIOS, 50, m_creature); - if(CaptainHelios) - DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); - break; - } - } + { + case 0: + { + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); + if(Cage) + Cage->SetGoState(0); + DoScriptText(SAY_START, m_creature, player); + break; + } + case 5: + DoScriptText(SAY_PROGRESS1, m_creature, player); + case 11: + DoScriptText(SAY_PROGRESS2, m_creature, player); + m_creature->SetOrientation(4.762841); + break; + case 18: + { + DoScriptText(SAY_PROGRESS3, m_creature, player); + Creature* Summ1 = m_creature->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0); + Creature* Summ2 = m_creature->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0); + Summ1->Attack(m_creature, true); + Summ2->Attack(player, true); + m_creature->AI()->AttackStart(Summ1); + break; + } + case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 25: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 30: + if (player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature); + break; + case 32: + m_creature->SetOrientation(2.978281); + DoScriptText(SAY_END1, m_creature, player); + break; + case 33: + m_creature->SetOrientation(5.858011); + DoScriptText(SAY_END2, m_creature, player); + Unit* CaptainHelios = FindCreature(NPC_CAPTAIN_HELIOS, 50, m_creature); + if(CaptainHelios) + DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); + break; + } + } void Aggro(Unit* who) {} - void Reset() - { - if (!IsBeingEscorted) - m_creature->setFaction(1602); - - GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); - if(Cage) - Cage->SetGoState(1); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (player) - ((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_THE_CATACOMBS); - } - } - - void UpdateAI(const uint32 diff) + void Reset() + { + if (!IsBeingEscorted) + m_creature->setFaction(1602); + + GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); + if(Cage) + Cage->SetGoState(1); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player) + ((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_THE_CATACOMBS); + } + } + + void UpdateAI(const uint32 diff) { npc_escortAI::UpdateAI(diff); } @@ -249,43 +249,43 @@ 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); - - return (CreatureAI*)ranger_lilathaAI; + 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); + + return (CreatureAI*)ranger_lilathaAI; } void AddSC_ghostlands() @@ -315,9 +315,9 @@ void AddSC_ghostlands() newscript->pGOHello = &GOHello_gilded_brazier; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "npc_ranger_lilatha"; - newscript->GetAI = &GetAI_npc_ranger_lilathaAI; - newscript->pQuestAccept = &QuestAccept_npc_ranger_lilatha; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_ranger_lilatha"; + newscript->GetAI = &GetAI_npc_ranger_lilathaAI; + newscript->pQuestAccept = &QuestAccept_npc_ranger_lilatha; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp index 0aed97dcf66..3588552fb46 100644 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp +++ b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp @@ -52,10 +52,10 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI { boss_gruulAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } ScriptedInstance *pInstance; @@ -77,36 +77,36 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI HurtfulStrike_Timer= 8000; Reverberation_Timer= 60000+45000; - if(pInstance) - { - pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED); + if(pInstance) + { + pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED); - GameObject* Door = NULL; - Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR)); - if(Door) - Door->SetGoState(0); - } - } + GameObject* Door = NULL; + Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR)); + if(Door) + Door->SetGoState(0); + } + } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); - if(pInstance) - { - pInstance->SetData(DATA_GRUULEVENT, DONE); + if(pInstance) + { + pInstance->SetData(DATA_GRUULEVENT, DONE); - GameObject* Door = NULL; - Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR)); - if(Door) - Door->SetGoState(0); - } - } + GameObject* Door = NULL; + Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR)); + if(Door) + Door->SetGoState(0); + } + } void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); if(pInstance) { @@ -119,15 +119,15 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI } } - void KilledUnit() - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } + void KilledUnit() + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } void UpdateAI(const uint32 diff) { @@ -184,7 +184,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI GroundSlamTimer = 7000; break; - } + } case 1: { @@ -205,7 +205,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI GroundSlamTimer = 5000; break; - } + } case 2: { @@ -215,7 +215,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI GroundSlamTimer = 1000; break; - } + } case 3: { @@ -253,7 +253,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI Reverberation_Timer += 10000; break; - } + } } GroundSlamStage++; @@ -280,14 +280,14 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI // Reverberation if (Reverberation_Timer < diff) { - DoCast(m_creature->getVictim(), SPELL_REVERBERATION, true); - Reverberation_Timer = 30000; + DoCast(m_creature->getVictim(), SPELL_REVERBERATION, true); + Reverberation_Timer = 30000; }else Reverberation_Timer -= diff; // Cave In if (CaveIn_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) DoCast(target,SPELL_CAVE_IN); CaveIn_Timer = 20000; diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp index ce828367531..e0d3aea7d06 100644 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp +++ b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp @@ -42,7 +42,7 @@ EndScriptData */ #define SPELL_BERSERKER_C 26561 #define SPELL_ROAR 16508 #define SPELL_FLURRY 33232 -#define SPELL_DUAL_WIELD 29651 //used in phase +#define SPELL_DUAL_WIELD 29651 //used in phase // Olm the Summoner #define SPELL_DARK_DECAY 33129 @@ -50,14 +50,14 @@ EndScriptData */ #define SPELL_SUMMON_WFH 33131 //Kiggler the Craed -#define SPELL_GREATER_POLYMORPH 33173 -#define SPELL_LIGHTNING_BOLT 36152 -#define SPELL_ARCANE_SHOCK 33175 -#define SPELL_ARCANE_EXPLOSION 33237 +#define SPELL_GREATER_POLYMORPH 33173 +#define SPELL_LIGHTNING_BOLT 36152 +#define SPELL_ARCANE_SHOCK 33175 +#define SPELL_ARCANE_EXPLOSION 33237 //Blindeye the Seer -#define SPELL_GREATER_PW_SHIELD 33147 -#define SPELL_HEAL 33144 +#define SPELL_GREATER_PW_SHIELD 33147 +#define SPELL_HEAL 33144 #define SPELL_PRAYER_OH 33152 //Krosh Firehand @@ -94,9 +94,9 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI MightyBlow_Timer = 40000; Whirlwind_Timer = 30000; Charging_Timer = 0; - Roar_Timer = 0; + Roar_Timer = 0; - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, false); + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, false); Phase2 = false; @@ -134,25 +134,25 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI DoScriptText(SAY_DEATH, m_creature); if (pInstance) - { - pInstance->SetData(DATA_MAULGAREVENT, DONE); + { + pInstance->SetData(DATA_MAULGAREVENT, DONE); - GameObject* Door = NULL; - Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_MAULGARDOOR)); - if(Door) - Door->SetGoState(0); - } - } + GameObject* Door = NULL; + Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_MAULGARDOOR)); + if(Door) + Door->SetGoState(0); + } + } void AddDeath() { switch(rand()%4) - { - case 0: DoScriptText(SAY_OGRE_DEATH1, m_creature);break; - case 1: DoScriptText(SAY_OGRE_DEATH2, m_creature);break; - case 2: DoScriptText(SAY_OGRE_DEATH3, m_creature);break; - case 3: DoScriptText(SAY_OGRE_DEATH4, m_creature);break; - } + { + case 0: DoScriptText(SAY_OGRE_DEATH1, m_creature);break; + case 1: DoScriptText(SAY_OGRE_DEATH2, m_creature);break; + case 2: DoScriptText(SAY_OGRE_DEATH3, m_creature);break; + case 3: DoScriptText(SAY_OGRE_DEATH4, m_creature);break; + } } @@ -182,7 +182,7 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - DoZoneInCombat(); + DoZoneInCombat(); } void UpdateAI(const uint32 diff) @@ -234,10 +234,10 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI //Entering Phase 2 if(!Phase2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) { - Phase2 = true; - DoScriptText(SAY_ENRAGE, m_creature); + Phase2 = true; + DoScriptText(SAY_ENRAGE, m_creature); - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); } 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 b8247eac92f..ed94765333f 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 @@ -134,21 +134,21 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI } } for(int i=0; i<5; ++i) - { - Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]); - if(who && channeler && !channeler->isInCombat()) - channeler->AI()->AttackStart(who); - } + { + Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]); + if(who && channeler && !channeler->isInCombat()) + channeler->AI()->AttackStart(who); + } } void ChannelerDied(Unit* killer) { for(int i=0; i<5; ++i) - { - Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]); - if(channeler && channeler->isAlive()) - return; - } + { + Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]); + if(channeler && channeler->isAlive()) + return; + } if(killer) m_creature->AI()->AttackStart(killer); @@ -160,30 +160,30 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI if(!channeler1) return NULL; int i; for(i=0; i<5; ++i) - { - Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]); - if(channeler && channeler->GetGUID()==channeler1->GetGUID()) - break; - } + { + Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]); + if(channeler && channeler->GetGUID()==channeler1->GetGUID()) + break; + } return Channelers[(i+2)%5]; } void SummonChannelers() { - for(int i=0; i<5; ++i) - { - Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]); - if(!channeler || channeler->isDead()) - channeler = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000); - Channelers[i] = channeler->GetGUID(); - } + for(int i=0; i<5; ++i) + { + Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]); + if(!channeler || channeler->isDead()) + channeler = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000); + Channelers[i] = channeler->GetGUID(); + } } void JustDied(Unit* Killer) { DoScriptText(SAY_DIE, m_creature); if(pInstance) - pInstance->SetData(DATA_KELIDANEVENT, DONE); + pInstance->SetData(DATA_KELIDANEVENT, DONE); } void UpdateAI(const uint32 diff) @@ -315,11 +315,11 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI { if (!m_creature->IsNonMeleeSpellCasted(false)) 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)) - DoCast(channeled,SPELL_CHANNELING); - } + { + uint64 channeler = ((boss_kelidan_the_breakerAI*)Kelidan->AI())->GetChanneled(m_creature); + if(Unit *channeled = Unit::GetUnit(*m_creature, channeler)) + DoCast(channeled,SPELL_CHANNELING); + } check_Timer = 5000; }else check_Timer -= diff; return; 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 165b27c9a0f..97d2878bc1d 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 @@ -114,7 +114,7 @@ struct TRINITY_DLL_DECL boss_nazanAI : public ScriptedAI m_creature->SetLootRecipient(NULL); m_creature->SetVisibility(VISIBILITY_OFF); m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); + m_creature->RemoveCorpse(); }else UnsummonCheck -= diff; return; } diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp index c6d7fd2031a..f114cd005f7 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp @@ -62,15 +62,15 @@ static Yell RandomTaunt[]= #define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 #define SPELL_BLAZE_TRAP 30542 #define SPELL_DEBRIS_KNOCKDOWN 36449 -#define SPELL_DEBRIS_VISUAL 30632 -#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8 +#define SPELL_DEBRIS_VISUAL 30632 +#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8 #define SPELL_CAMERA_SHAKE 36455 #define SPELL_BERSERK 27680 #define SPELL_SHADOW_CAGE 30168 #define SPELL_SHADOW_GRASP 30410 #define SPELL_SHADOW_GRASP_VISUAL 30166 -#define SPELL_MIND_EXHAUSTION 44032 //Casted by the cubes when channeling ends +#define SPELL_MIND_EXHAUSTION 44032 //Casted by the cubes when channeling ends #define SPELL_SHADOW_CAGE_C 30205 #define SPELL_SHADOW_GRASP_C 30207 @@ -81,10 +81,10 @@ static Yell RandomTaunt[]= #define SPELL_BURNING_ABYSSAL 30511 #define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 -#define SPELL_FIRE_BLAST 37110 +#define SPELL_FIRE_BLAST 37110 // count of clickers needed to interrupt blast nova -#define CLICKERS_COUNT 5 +#define CLICKERS_COUNT 5 typedef std::map CubeMap; @@ -202,7 +202,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI uint32 BlastNova_Timer; uint32 Blaze_Timer; uint32 Debris_Timer; - uint32 RandChat_Timer; + uint32 RandChat_Timer; bool Phase3; bool NeedCheckCube; diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h index 6469ed413c5..8c235a36a30 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h @@ -6,8 +6,8 @@ #define DEF_MAGTHERIDONS_LAIR_H #define DATA_MAGTHERIDON_EVENT 1 -#define DATA_MAGTHERIDON 3 +#define DATA_MAGTHERIDON 3 #define DATA_CHANNELER_EVENT 2 -#define DATA_COLLAPSE 6 -#define DATA_CHANNELER 9 +#define DATA_COLLAPSE 6 +#define DATA_CHANNELER 9 #endif diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp index c4a2eabd068..20c64e0504b 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp @@ -27,9 +27,9 @@ EndScriptData */ #define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 #define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 -#define CHAMBER_CENTER_X -15.14 -#define CHAMBER_CENTER_Y 1.8 -#define CHAMBER_CENTER_Z -0.4 +#define CHAMBER_CENTER_X -15.14 +#define CHAMBER_CENTER_Y 1.8 +#define CHAMBER_CENTER_Z -0.4 #define ENCOUNTERS 2 @@ -180,7 +180,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance { //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); data = IN_PROGRESS; - break; + break; } }break; } diff --git a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp index 7cfd32955ca..1a96f0be0c2 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp @@ -238,22 +238,22 @@ bool GossipHello_npc_wing_commander_brack(Player *player, Creature *_Creature) bool GossipSelect_npc_wing_commander_brack(Player *player, Creature *_Creature, uint32 sender, uint32 action ) { - switch(action) - { - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,33659,true); //TaxiPath 584 (Gateways Murket and Shaadraz) - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,33825,true); //TaxiPath 587 (Aerial Assault Flight (Horde)) - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,34578,true); //TaxiPath 604 (Taxi - Reaver's Fall to Spinebreaker Ridge) - break; - } - return true; + switch(action) + { + case GOSSIP_ACTION_INFO_DEF + 1: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,33659,true); //TaxiPath 584 (Gateways Murket and Shaadraz) + break; + case GOSSIP_ACTION_INFO_DEF + 2: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,33825,true); //TaxiPath 587 (Aerial Assault Flight (Horde)) + break; + case GOSSIP_ACTION_INFO_DEF + 3: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,34578,true); //TaxiPath 604 (Taxi - Reaver's Fall to Spinebreaker Ridge) + break; + } + return true; } /*###### @@ -271,130 +271,130 @@ bool GossipSelect_npc_wing_commander_brack(Player *player, Creature *_Creature, struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI { - npc_wounded_blood_elfAI(Creature *c) : npc_escortAI(c) {Reset();} - - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - if (!player) - return; - - switch (i) - { - case 0: - DoScriptText(SAY_ELF_START, m_creature, player); - break; - case 9: - DoScriptText(SAY_ELF_SUMMON1, m_creature, player); - // Spawn two Haal'eshi Talonguard - DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - break; - case 13: - DoScriptText(SAY_ELF_RESTING, m_creature, player); - // make the NPC kneel - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); - break; - case 14: - DoScriptText(SAY_ELF_SUMMON2, m_creature, player); - // Spawn two Haal'eshi Windwalker - DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - break; - case 27: - DoScriptText(SAY_ELF_COMPLETE, m_creature, player); - // Award quest credit - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,m_creature); - break; - } - } - - void Reset() - { - if (!IsBeingEscorted) - m_creature->setFaction(1604); - } - - void Aggro(Unit* who) - { - if (IsBeingEscorted) - DoScriptText(SAY_ELF_AGGRO, m_creature); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void JustDied(Unit* killer) - { - if (!IsBeingEscorted) - return; - - if (PlayerGUID) - { - // If NPC dies, player fails the quest - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->FailQuest(QUEST_ROAD_TO_FALCON_WATCH); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + npc_wounded_blood_elfAI(Creature *c) : npc_escortAI(c) {Reset();} + + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if (!player) + return; + + switch (i) + { + case 0: + DoScriptText(SAY_ELF_START, m_creature, player); + break; + case 9: + DoScriptText(SAY_ELF_SUMMON1, m_creature, player); + // Spawn two Haal'eshi Talonguard + DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 13: + DoScriptText(SAY_ELF_RESTING, m_creature, player); + // make the NPC kneel + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); + break; + case 14: + DoScriptText(SAY_ELF_SUMMON2, m_creature, player); + // Spawn two Haal'eshi Windwalker + DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 27: + DoScriptText(SAY_ELF_COMPLETE, m_creature, player); + // Award quest credit + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,m_creature); + break; + } + } + + void Reset() + { + if (!IsBeingEscorted) + m_creature->setFaction(1604); + } + + void Aggro(Unit* who) + { + if (IsBeingEscorted) + DoScriptText(SAY_ELF_AGGRO, m_creature); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (!IsBeingEscorted) + return; + + if (PlayerGUID) + { + // If NPC dies, player fails the quest + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->FailQuest(QUEST_ROAD_TO_FALCON_WATCH); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; CreatureAI* GetAI_npc_wounded_blood_elf(Creature *_Creature) { - npc_wounded_blood_elfAI* welfAI = new npc_wounded_blood_elfAI(_Creature); - - welfAI->AddWaypoint(0, -1137.72, 4272.10, 14.04, 5000); - welfAI->AddWaypoint(1, -1141.34, 4232.42, 14.63); - welfAI->AddWaypoint(2, -1133.47, 4220.88, 11.78); - welfAI->AddWaypoint(3, -1126.18, 4213.26, 13.51); - welfAI->AddWaypoint(4, -1100.12, 4204.32, 16.41); - welfAI->AddWaypoint(5, -1063.68, 4197.92, 15.51); - welfAI->AddWaypoint(6, -1027.28, 4194.36, 15.52); - welfAI->AddWaypoint(7, -995.68, 4189.59, 19.84); - welfAI->AddWaypoint(8, -970.90, 4188.60, 24.61); - welfAI->AddWaypoint(9, -961.93, 4193.34, 26.11, 15000); // Summon 1 - welfAI->AddWaypoint(10, -935.52, 4210.99, 31.98); - welfAI->AddWaypoint(11, -913.42, 4218.27, 37.29); - welfAI->AddWaypoint(12, -896.53, 4207.73, 43.23); - welfAI->AddWaypoint(13, -868.49, 4194.77, 46.75, 30000);// Kneel and Rest Here - welfAI->AddWaypoint(14, -852.83, 4198.29, 47.28, 15000);// Summon 2 - welfAI->AddWaypoint(15, -819.85, 4200.50, 46.37); - welfAI->AddWaypoint(16, -791.92, 4201.96, 44.19); - welfAI->AddWaypoint(17, -774.42, 4202.46, 47.41); - welfAI->AddWaypoint(18, -762.90, 4202.17, 48.81); - welfAI->AddWaypoint(19, -728.25, 4195.35, 50.68); - welfAI->AddWaypoint(20, -713.58, 4192.07, 53.98); - welfAI->AddWaypoint(21, -703.09, 4189.74, 56.96); - welfAI->AddWaypoint(22, -693.70, 4185.43, 57.06); - welfAI->AddWaypoint(23, -686.38, 4159.81, 60.26); - welfAI->AddWaypoint(24, -679.88, 4147.04, 64.20); - welfAI->AddWaypoint(25, -656.74, 4147.72, 64.11); - welfAI->AddWaypoint(26, -652.22, 4137.50, 64.58); - welfAI->AddWaypoint(27, -649.99, 4136.38, 64.63, 30000);// Award Quest Credit - - return (CreatureAI*)welfAI; + npc_wounded_blood_elfAI* welfAI = new npc_wounded_blood_elfAI(_Creature); + + welfAI->AddWaypoint(0, -1137.72, 4272.10, 14.04, 5000); + welfAI->AddWaypoint(1, -1141.34, 4232.42, 14.63); + welfAI->AddWaypoint(2, -1133.47, 4220.88, 11.78); + welfAI->AddWaypoint(3, -1126.18, 4213.26, 13.51); + welfAI->AddWaypoint(4, -1100.12, 4204.32, 16.41); + welfAI->AddWaypoint(5, -1063.68, 4197.92, 15.51); + welfAI->AddWaypoint(6, -1027.28, 4194.36, 15.52); + welfAI->AddWaypoint(7, -995.68, 4189.59, 19.84); + welfAI->AddWaypoint(8, -970.90, 4188.60, 24.61); + welfAI->AddWaypoint(9, -961.93, 4193.34, 26.11, 15000); // Summon 1 + welfAI->AddWaypoint(10, -935.52, 4210.99, 31.98); + welfAI->AddWaypoint(11, -913.42, 4218.27, 37.29); + welfAI->AddWaypoint(12, -896.53, 4207.73, 43.23); + welfAI->AddWaypoint(13, -868.49, 4194.77, 46.75, 30000);// Kneel and Rest Here + welfAI->AddWaypoint(14, -852.83, 4198.29, 47.28, 15000);// Summon 2 + welfAI->AddWaypoint(15, -819.85, 4200.50, 46.37); + welfAI->AddWaypoint(16, -791.92, 4201.96, 44.19); + welfAI->AddWaypoint(17, -774.42, 4202.46, 47.41); + welfAI->AddWaypoint(18, -762.90, 4202.17, 48.81); + welfAI->AddWaypoint(19, -728.25, 4195.35, 50.68); + welfAI->AddWaypoint(20, -713.58, 4192.07, 53.98); + welfAI->AddWaypoint(21, -703.09, 4189.74, 56.96); + welfAI->AddWaypoint(22, -693.70, 4185.43, 57.06); + welfAI->AddWaypoint(23, -686.38, 4159.81, 60.26); + welfAI->AddWaypoint(24, -679.88, 4147.04, 64.20); + welfAI->AddWaypoint(25, -656.74, 4147.72, 64.11); + welfAI->AddWaypoint(26, -652.22, 4137.50, 64.58); + welfAI->AddWaypoint(27, -649.99, 4136.38, 64.63, 30000);// Award Quest Credit + + return (CreatureAI*)welfAI; } bool QuestAccept_npc_wounded_blood_elf(Player* player, Creature* creature, Quest const* quest) { - if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH) - { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - // Change faction so mobs attack - creature->setFaction(775); - } - - return true; + if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH) + { + ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + // Change faction so mobs attack + creature->setFaction(775); + } + + return true; } /*###### @@ -406,7 +406,7 @@ void AddSC_hellfire_peninsula() Script *newscript; newscript = new Script; - newscript->Name = "npc_aeranas"; + newscript->Name = "npc_aeranas"; newscript->GetAI = &GetAI_npc_aeranas; newscript->RegisterSelf(); 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 99aedf23bca..4e61ad68780 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 @@ -141,52 +141,52 @@ bool GossipSelect_npc_unrestrained_dragonhawk(Player *player, Creature *_Creatur ## npc_greengill_slave ######*/ -#define ENRAGE 45111 -#define ORB 45109 -#define QUESTG 11541 -#define DM 25060 +#define ENRAGE 45111 +#define ORB 45109 +#define QUESTG 11541 +#define DM 25060 struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI { - npc_greengill_slaveAI(Creature* c) : ScriptedAI(c) {Reset();} + npc_greengill_slaveAI(Creature* c) : ScriptedAI(c) {Reset();} - uint64 PlayerGUID; + uint64 PlayerGUID; - void Aggro(Unit* who){} + void Aggro(Unit* who){} - void Reset() - { - PlayerGUID = 0; - } + void Reset() + { + PlayerGUID = 0; + } - void SpellHit(Unit* caster, const SpellEntry* spell) - { - if(!caster) + void SpellHit(Unit* caster, const SpellEntry* spell) + { + if(!caster) return; - if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE, 0)) - { - PlayerGUID = caster->GetGUID(); - if(PlayerGUID) + if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE, 0)) + { + PlayerGUID = caster->GetGUID(); + if(PlayerGUID) { Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID); if(plr && ((Player*)plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) - ((Player*)plr)->KilledMonster(25086, m_creature->GetGUID()); - } - DoCast(m_creature, ENRAGE); - Unit* Myrmidon = FindCreature(DM, 70, m_creature); - if(Myrmidon) - { - m_creature->AddThreat(Myrmidon, 100000.0f); + ((Player*)plr)->KilledMonster(25086, m_creature->GetGUID()); + } + DoCast(m_creature, ENRAGE); + Unit* Myrmidon = FindCreature(DM, 70, m_creature); + if(Myrmidon) + { + m_creature->AddThreat(Myrmidon, 100000.0f); AttackStart(Myrmidon); - } - } - } - - void UpdateAI(const uint32 diff) - { - DoMeleeAttackIfReady(); - } + } + } + } + + void UpdateAI(const uint32 diff) + { + DoMeleeAttackIfReady(); + } }; CreatureAI* GetAI_npc_greengill_slaveAI(Creature* _Creature) @@ -215,8 +215,8 @@ void AddSC_isle_of_queldanas() newscript->pGossipSelect = &GossipSelect_npc_unrestrained_dragonhawk; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name="npc_greengill_slave"; - newscript->GetAI = &GetAI_npc_greengill_slaveAI; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="npc_greengill_slave"; + newscript->GetAI = &GetAI_npc_greengill_slaveAI; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp index bf26d71398f..eada90f9473 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp @@ -69,9 +69,9 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_KILL1, m_creature); break; - case 1: DoScriptText(SAY_KILL2, m_creature); break; - } + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; + } } void JustDied(Unit *victim) diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp index 3030715ff27..b04b39c0796 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp @@ -66,7 +66,7 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI void KilledUnit(Unit* Victim) { if(rand()%2) - return; + return; switch(rand()%3) { @@ -117,7 +117,7 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI if (Holyfire_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) DoCast(target,SPELL_HOLYFIRE); Holyfire_Timer = 8000 + rand()%17000; //Anywhere from 8 to 25 seconds, good luck having several of those in a row! @@ -125,10 +125,10 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI if (Holywrath_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_HOLYWRATH); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_HOLYWRATH); - Holywrath_Timer = 20000+(rand()%10000); //20-30 secs sounds nice + Holywrath_Timer = 20000+(rand()%10000); //20-30 secs sounds nice }else Holywrath_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp index 731f7ce2df9..2324385e4ba 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp @@ -58,7 +58,7 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI Attumen = 0; Mount_Timer = 0; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetVisibility(VISIBILITY_ON); } @@ -81,7 +81,7 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI if(Phase == 1 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 95) { Phase = 2; - Creature *pAttumen = DoSpawnCreature(SUMMON_ATTUMEN, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); + Creature *pAttumen = DoSpawnCreature(SUMMON_ATTUMEN, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); if(pAttumen) { Attumen = pAttumen->GetGUID(); @@ -89,9 +89,9 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI SetMidnight(pAttumen, m_creature->GetGUID()); switch(rand()%3) { - case 0: DoScriptText(SAY_APPEAR1, pAttumen); break; - case 1: DoScriptText(SAY_APPEAR2, pAttumen); break; - case 2: DoScriptText(SAY_APPEAR3, pAttumen); break; + case 0: DoScriptText(SAY_APPEAR1, pAttumen); break; + case 1: DoScriptText(SAY_APPEAR2, pAttumen); break; + case 2: DoScriptText(SAY_APPEAR3, pAttumen); break; } } } @@ -102,27 +102,27 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI } else if(Phase ==3) { - if(Mount_Timer) - { - if(Mount_Timer <= diff) - { - Mount_Timer = 0; - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->GetMotionMaster()->MoveIdle(); - if (Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen)) - { - pAttumen->SetUInt32Value(UNIT_FIELD_DISPLAYID, MOUNTED_DISPLAYID); - pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if(pAttumen->getVictim()) - { - pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim()); - pAttumen->SetUInt64Value(UNIT_FIELD_TARGET, pAttumen->getVictim()->GetGUID()); - } - pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X,1); - } - } else Mount_Timer -= diff; - } - } + if(Mount_Timer) + { + if(Mount_Timer <= diff) + { + Mount_Timer = 0; + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->GetMotionMaster()->MoveIdle(); + if (Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen)) + { + pAttumen->SetUInt32Value(UNIT_FIELD_DISPLAYID, MOUNTED_DISPLAYID); + pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if(pAttumen->getVictim()) + { + pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim()); + pAttumen->SetUInt64Value(UNIT_FIELD_TARGET, pAttumen->getVictim()->GetGUID()); + } + pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X,1); + } + } else Mount_Timer -= diff; + } + } if(Phase != 3) DoMeleeAttackIfReady(); @@ -130,7 +130,7 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI void Mount(Unit *pAttumen) { - DoScriptText(SAY_MOUNT, pAttumen); + DoScriptText(SAY_MOUNT, pAttumen); Phase = 3; m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -194,36 +194,36 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_KILL1, m_creature); break; - case 1: DoScriptText(SAY_KILL2, m_creature); break; + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; } } void JustDied(Unit *victim) { DoScriptText(SAY_DEATH, m_creature); - if (Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight)) - pMidnight->DealDamage(pMidnight, pMidnight->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + if (Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight)) + pMidnight->DealDamage(pMidnight, pMidnight->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } void UpdateAI(const uint32 diff) { - if(ResetTimer) - { - if(ResetTimer <= diff) - { - ResetTimer = 0; - Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight); - if(pMidnight) - { - pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pMidnight->SetVisibility(VISIBILITY_ON); - } - Midnight = 0; - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } else ResetTimer -= diff; + if(ResetTimer) + { + if(ResetTimer <= diff) + { + ResetTimer = 0; + Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight); + if(pMidnight) + { + pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pMidnight->SetVisibility(VISIBILITY_ON); + } + Midnight = 0; + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } else ResetTimer -= diff; //Return since we have no target if (!UpdateVictim()) @@ -234,7 +234,7 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI if(CleaveTimer < diff) { - DoCast(m_creature->getVictim(), SPELL_SHADOWCLEAVE); + DoCast(m_creature->getVictim(), SPELL_SHADOWCLEAVE); CleaveTimer = 10000 + (rand()%6)*1000; } else CleaveTimer -= diff; @@ -248,8 +248,8 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_RANDOM1, m_creature); break; - case 1: DoScriptText(SAY_RANDOM2, m_creature); break; + case 0: DoScriptText(SAY_RANDOM1, m_creature); break; + case 1: DoScriptText(SAY_RANDOM2, m_creature); break; } RandomYellTimer = 30000 + (rand()%31)*1000; } else RandomYellTimer -= diff; @@ -294,7 +294,7 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI void SpellHit(Unit *source, const SpellEntry *spell) { if(spell->Mechanic == MECHANIC_DISARM) - DoScriptText(SAY_DISARMED, m_creature); + DoScriptText(SAY_DISARMED, m_creature); } }; diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp index 12c2a92ec91..5055d7ca0ed 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp @@ -124,9 +124,9 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI { switch (rand()%3) { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - case 2: DoScriptText(SAY_KILL_3, m_creature); break; + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 2: DoScriptText(SAY_KILL_3, m_creature); break; } } @@ -139,22 +139,22 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI DeSpawnAdds(); - //remove aura from spell Garrote when Moroes dies - Map *map = m_creature->GetMap(); - if (map->IsDungeon()) - { - Map::PlayerList const &PlayerList = map->GetPlayers(); + //remove aura from spell Garrote when Moroes dies + Map *map = m_creature->GetMap(); + if (map->IsDungeon()) + { + Map::PlayerList const &PlayerList = map->GetPlayers(); - if (PlayerList.isEmpty()) - return; + if (PlayerList.isEmpty()) + return; - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_GARROTE,0)) - i->getSource()->RemoveAurasDueToSpell(SPELL_GARROTE); - } - } - } + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_GARROTE,0)) + i->getSource()->RemoveAurasDueToSpell(SPELL_GARROTE); + } + } + } uint8 CheckAdd(uint64 guid) { @@ -308,8 +308,8 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_SPECIAL_1, m_creature); break; - case 1: DoScriptText(SAY_SPECIAL_2, m_creature); break; + case 0: DoScriptText(SAY_SPECIAL_1, m_creature); break; + case 1: DoScriptText(SAY_SPECIAL_2, m_creature); break; } if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp index f819037e7da..1a3c6684bbd 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp @@ -35,7 +35,7 @@ EndScriptData */ #define SPELL_SMOKING_BLAST 37057 #define SPELL_FIREBALL_BARRAGE 30282 #define SPELL_SEARING_CINDERS 30127 -#define SPELL_SUMMON_SKELETON 30170 +#define SPELL_SUMMON_SKELETON 30170 #define EMOTE_SUMMON "An ancient being awakens in the distance..." #define YELL_AGGRO "What fools! I shall bring a quick end to your suffering!" @@ -60,17 +60,17 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI { boss_nightbaneAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = ((ScriptedInstance*)c->GetInstanceData()); Intro = true; Reset(); } - ScriptedInstance* pInstance; + ScriptedInstance* pInstance; uint32 Phase; bool RainBones; - bool Skeletons; + bool Skeletons; uint32 BellowingRoarTimer; uint32 CharredEarthTimer; @@ -87,7 +87,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI bool Intro; bool Flying; - bool Movement; + bool Movement; uint32 WaitTimer; uint32 MovePhase; @@ -103,16 +103,16 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI SmokingBlastTimer = 20000; FireballBarrageTimer = 13000; SearingCindersTimer = 14000; - WaitTimer = 1000; + WaitTimer = 1000; - Phase =1; + Phase =1; FlyCount = 0; - MovePhase = 0; + MovePhase = 0; m_creature->SetSpeed(MOVE_RUN, 2.0f); m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->setActive(true); + m_creature->setActive(true); pInstance->SetData(DATA_NIGHTBANE_EVENT, 6); if(pInstance->GetData(DATA_NIGHTBANE_EVENT) > 1) @@ -121,10 +121,10 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI m_creature->RemoveCorpse(); }else pInstance->SetData(DATA_NIGHTBANE_EVENT, NOT_STARTED); - HandleTerraceDoors(true); + HandleTerraceDoors(true); Flying = false; - Movement = false; + Movement = false; if(!Intro) { @@ -133,22 +133,22 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI } } - void HandleTerraceDoors(bool open) + void HandleTerraceDoors(bool open) { - if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1))) - Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1); - if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2))) - Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1); + if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1))) + Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1); + if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2))) + Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1); } void Aggro(Unit *who) - { - if(pInstance) - pInstance->SetData(DATA_NIGHTBANE_EVENT, IN_PROGRESS); + { + if(pInstance) + pInstance->SetData(DATA_NIGHTBANE_EVENT, IN_PROGRESS); - HandleTerraceDoors(false); - DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - } + HandleTerraceDoors(false); + DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + } void AttackStart(Unit* who) { @@ -156,13 +156,13 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI ScriptedAI::AttackStart(who); } - void JustDied(Unit* killer) - { - if(pInstance) - pInstance->SetData(DATA_NIGHTBANE_EVENT, DONE); + void JustDied(Unit* killer) + { + if(pInstance) + pInstance->SetData(DATA_NIGHTBANE_EVENT, DONE); - HandleTerraceDoors(true); - } + HandleTerraceDoors(true); + } void MoveInLineOfSight(Unit *who) { @@ -194,7 +194,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI { if(id == 0) { - DoTextEmote(EMOTE_BREATH, NULL, true); + DoTextEmote(EMOTE_BREATH, NULL, true); Flying = false; Phase = 2; return; @@ -211,7 +211,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI { Flying = false; Phase = 1; - Movement = true; + Movement = true; return; } @@ -219,12 +219,12 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI } } - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature->getVictim()); - } + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature->getVictim()); + } - void TakeOff() + void TakeOff() { DoYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL); @@ -234,14 +234,14 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI (*m_creature).GetMotionMaster()->Clear(false); (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]); - Flying = true; + Flying = true; FlyTimer = 45000+rand()%15000; //timer wrong between 45 and 60 seconds ++FlyCount; RainofBonesTimer = 5000; //timer wrong (maybe) RainBones = false; - Skeletons = false; + Skeletons = false; } void UpdateAI(const uint32 diff) @@ -291,44 +291,44 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI // Phase 1 "GROUND FIGHT" if(Phase == 1) { - if(Movement) - { - DoStartMovement(m_creature->getVictim()); - Movement = false; - } - - if (BellowingRoarTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_BELLOWING_ROAR); - BellowingRoarTimer = 30000+rand()%10000 ; //Timer - }else BellowingRoarTimer -= diff; + if(Movement) + { + DoStartMovement(m_creature->getVictim()); + Movement = false; + } + + if (BellowingRoarTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_BELLOWING_ROAR); + BellowingRoarTimer = 30000+rand()%10000 ; //Timer + }else BellowingRoarTimer -= diff; if (SmolderingBreathTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SMOLDERING_BREATH); - SmolderingBreathTimer = 20000;//timer + { + DoCast(m_creature->getVictim(),SPELL_SMOLDERING_BREATH); + SmolderingBreathTimer = 20000;//timer }else SmolderingBreathTimer -= diff; if (CharredEarthTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target,SPELL_CHARRED_EARTH); - CharredEarthTimer = 20000; //timer + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target,SPELL_CHARRED_EARTH); + CharredEarthTimer = 20000; //timer }else CharredEarthTimer -= diff; if (TailSweepTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - if (!m_creature->HasInArc( M_PI, target)) - DoCast(target,SPELL_TAIL_SWEEP); - TailSweepTimer = 15000;//timer - }else TailSweepTimer -= diff; + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (!m_creature->HasInArc( M_PI, target)) + DoCast(target,SPELL_TAIL_SWEEP); + TailSweepTimer = 15000;//timer + }else TailSweepTimer -= diff; if (SearingCindersTimer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target,SPELL_SEARING_CINDERS); - SearingCindersTimer = 10000; //timer + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target,SPELL_SEARING_CINDERS); + SearingCindersTimer = 10000; //timer }else SearingCindersTimer -= diff; uint32 Prozent; @@ -338,10 +338,10 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI TakeOff(); if (Prozent < 50 && FlyCount == 1) // secound take off 50% - TakeOff(); + TakeOff(); if (Prozent < 25 && FlyCount == 2) // third take off 25% - TakeOff(); + TakeOff(); DoMeleeAttackIfReady(); } @@ -351,13 +351,13 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI { if (!RainBones) { - if (!Skeletons) - { - DoCast(m_creature->getVictim(), SPELL_SUMMON_SKELETON); - DoCast(m_creature->getVictim(), SPELL_SUMMON_SKELETON); - DoCast(m_creature->getVictim(), SPELL_SUMMON_SKELETON); - Skeletons = true; - } + if (!Skeletons) + { + DoCast(m_creature->getVictim(), SPELL_SUMMON_SKELETON); + DoCast(m_creature->getVictim(), SPELL_SUMMON_SKELETON); + DoCast(m_creature->getVictim(), SPELL_SUMMON_SKELETON); + Skeletons = true; + } if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2 { @@ -368,8 +368,8 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI if (DistractingAshTimer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target,SPELL_DISTRACTING_ASH); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target,SPELL_DISTRACTING_ASH); DistractingAshTimer = 2000;//timer wrong }else DistractingAshTimer -= diff; } @@ -385,17 +385,17 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI if (FireballBarrageTimer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_FARTHEST, 0)) - DoCast(target,SPELL_FIREBALL_BARRAGE); - FireballBarrageTimer = 20000; //Timer + if (Unit* target = SelectUnit(SELECT_TARGET_FARTHEST, 0)) + DoCast(target,SPELL_FIREBALL_BARRAGE); + FireballBarrageTimer = 20000; //Timer }else FireballBarrageTimer -= diff; if (FlyTimer < diff) //landing { - if(rand()%2 == 0) - DoYell(YELL_LAND_PHASE_1, LANG_UNIVERSAL, NULL); - else - DoYell(YELL_LAND_PHASE_2, LANG_UNIVERSAL, NULL); + if(rand()%2 == 0) + DoYell(YELL_LAND_PHASE_1, LANG_UNIVERSAL, NULL); + else + DoYell(YELL_LAND_PHASE_2, LANG_UNIVERSAL, NULL); (*m_creature).GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]); @@ -416,6 +416,6 @@ void AddSC_boss_nightbane() Script *newscript; newscript = new Script; newscript->Name="boss_nightbane"; - newscript->GetAI = &GetAI_boss_nightbane; + newscript->GetAI = &GetAI_boss_nightbane; newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp index 96d24878ebd..34a1114a12d 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp @@ -219,15 +219,15 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI { switch(rand()%3) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; } } void JustDied(Unit *victim) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); AxesCleanup(); ClearWeapons(); @@ -249,7 +249,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); if(pInstance) { @@ -392,8 +392,8 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI switch(rand()%2) { - case 0: DoScriptText(SAY_SUMMON1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON2, m_creature); break; + case 0: DoScriptText(SAY_SUMMON1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON2, m_creature); break; } } @@ -451,7 +451,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI m_creature->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg); m_creature->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg); - m_creature->SetAttackTime(OFF_ATTACK, (m_creature->GetAttackTime(BASE_ATTACK)*150)/100); + m_creature->SetAttackTime(OFF_ATTACK, (m_creature->GetAttackTime(BASE_ATTACK)*150)/100); } } else if(phase == 2) @@ -557,16 +557,16 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI { if(SWPainTimer < diff) { - Unit* target = NULL; + Unit* target = NULL; if(phase == 1) target = m_creature->getVictim(); // the tank else //anyone but the tank target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (target) - DoCast(target, SPELL_SW_PAIN); + if (target) + DoCast(target, SPELL_SW_PAIN); - SWPainTimer = 20000; + SWPainTimer = 20000; }else SWPainTimer -= diff; } diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp index 5ffc122f233..dac9b190065 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp @@ -152,14 +152,14 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_KILL1, m_creature); break; - case 1: DoScriptText(SAY_KILL2, m_creature); break; + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; } } void JustDied(Unit *victim) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); if(pInstance) { @@ -174,9 +174,9 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI { switch(rand()%3) { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; } if(pInstance) @@ -228,39 +228,39 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI return; if(CloseDoorTimer) - { - if(CloseDoorTimer <= diff) - { - if(pInstance) - { - if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR))) - Door->SetGoState(1); - CloseDoorTimer = 0; - } - }else CloseDoorTimer -= diff; - } + { + if(CloseDoorTimer <= diff) + { + if(pInstance) + { + if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR))) + Door->SetGoState(1); + CloseDoorTimer = 0; + } + }else CloseDoorTimer -= diff; + } //Cooldowns for casts if (ArcaneCooldown) - { + { if (ArcaneCooldown >= diff) ArcaneCooldown -= diff; else ArcaneCooldown = 0; - } + } if (FireCooldown) - { + { if (FireCooldown >= diff) FireCooldown -= diff; else FireCooldown = 0; - } + } if (FrostCooldown) - { - if (FrostCooldown >= diff) + { + if (FrostCooldown >= diff) FrostCooldown -= diff; else FrostCooldown = 0; - } + } if(!Drinking && m_creature->GetMaxPower(POWER_MANA) && (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA)) < 20) { @@ -356,8 +356,8 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI DoCast(m_creature, SPELL_AOE_CS); break; case 1: - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_CHAINSOFICE); + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_CHAINSOFICE); break; } SecondarySpellTimer = 5000 + (rand()%15000); @@ -390,9 +390,9 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI case SUPER_AE: if (rand()%2) - DoScriptText(SAY_EXPLOSION1, m_creature); - else - DoScriptText(SAY_EXPLOSION2, m_creature); + DoScriptText(SAY_EXPLOSION1, m_creature); + else + DoScriptText(SAY_EXPLOSION2, m_creature); m_creature->CastSpell(m_creature, SPELL_BLINK_CENTER, true); m_creature->CastSpell(m_creature, SPELL_PLAYERPULL, true); @@ -402,9 +402,9 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI case SUPER_FLAME: if (rand()%2) - DoScriptText(SAY_FLAMEWREATH1, m_creature); - else - DoScriptText(SAY_FLAMEWREATH2, m_creature); + DoScriptText(SAY_FLAMEWREATH1, m_creature); + else + DoScriptText(SAY_FLAMEWREATH2, m_creature); FlameWreathTimer = 20000; FlameWreathCheckTime = 500; @@ -419,9 +419,9 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI case SUPER_BLIZZARD: if (rand()%2) - DoScriptText(SAY_BLIZZARD1, m_creature); - else - DoScriptText(SAY_BLIZZARD2, m_creature); + DoScriptText(SAY_BLIZZARD1, m_creature); + else + DoScriptText(SAY_BLIZZARD2, m_creature); Creature* Spawn = NULL; Spawn = DoSpawnCreature(CREATURE_ARAN_BLIZZARD, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 25000); 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 c7c95a4eabc..dd4c0ce3300 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp @@ -230,8 +230,8 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; } } @@ -298,8 +298,8 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true); switch(rand()%2) { - case 0: DoScriptText(SAY_SACRIFICE1, m_creature); break; - case 1: DoScriptText(SAY_SACRIFICE2, m_creature); break; + case 0: DoScriptText(SAY_SACRIFICE1, m_creature); break; + case 1: DoScriptText(SAY_SACRIFICE2, m_creature); break; } SacrificeTimer = 30000; } @@ -325,8 +325,8 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI SummonedPortals = true; switch(rand()%2) { - case 0: DoScriptText(SAY_SUMMON1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON2, m_creature); break; + case 0: DoScriptText(SAY_SUMMON1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON2, m_creature); break; } } uint32 random = rand()%2; @@ -340,13 +340,13 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI }else SummonTimer -= diff; if(!Berserk) - { - if(BerserkTimer < diff) - { - DoCast(m_creature, SPELL_BERSERK); - Berserk = true; - }else BerserkTimer -= diff; - } + { + if(BerserkTimer < diff) + { + DoCast(m_creature, SPELL_BERSERK); + Berserk = true; + }else BerserkTimer -= diff; + } DoMeleeAttackIfReady(); } diff --git a/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp b/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp index ef528d518df..10828248927 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp @@ -135,7 +135,7 @@ struct TRINITY_DLL_DECL boss_dorotheeAI : public ScriptedAI void Aggro(Unit* who) { - DoScriptText(SAY_DOROTHEE_AGGRO, m_creature); + DoScriptText(SAY_DOROTHEE_AGGRO, m_creature); } void SummonTito(); // See below @@ -167,13 +167,13 @@ struct TRINITY_DLL_DECL boss_dorotheeAI : public ScriptedAI void UpdateAI(const uint32 diff) { if(AggroTimer) - { - if(AggroTimer <= diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer = 0; - }else AggroTimer -= diff; - } + { + if(AggroTimer <= diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + }else AggroTimer -= diff; + } if(!UpdateVictim()) return; @@ -229,7 +229,7 @@ struct TRINITY_DLL_DECL mob_titoAI : public ScriptedAI if(Dorothee && Dorothee->isAlive()) { ((boss_dorotheeAI*)Dorothee->AI())->TitoDied = true; - DoScriptText(SAY_DOROTHEE_TITO_DEATH, Dorothee); + DoScriptText(SAY_DOROTHEE_TITO_DEATH, Dorothee); } } } @@ -254,7 +254,7 @@ void boss_dorotheeAI::SummonTito() Creature* Tito = DoSpawnCreature(CREATURE_TITO, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); if(Tito) { - DoScriptText(SAY_DOROTHEE_SUMMON, m_creature); + DoScriptText(SAY_DOROTHEE_SUMMON, m_creature); ((mob_titoAI*)Tito->AI())->DorotheeGUID = m_creature->GetGUID(); Tito->AI()->AttackStart(m_creature->getVictim()); SummonedTito = true; @@ -301,7 +301,7 @@ struct TRINITY_DLL_DECL boss_strawmanAI : public ScriptedAI void Aggro(Unit* who) { - DoScriptText(SAY_STRAWMAN_AGGRO, m_creature); + DoScriptText(SAY_STRAWMAN_AGGRO, m_creature); } void SpellHit(Unit* caster, const SpellEntry *Spell) @@ -312,7 +312,7 @@ struct TRINITY_DLL_DECL boss_strawmanAI : public ScriptedAI void JustDied(Unit* killer) { - DoScriptText(SAY_STRAWMAN_DEATH, m_creature); + DoScriptText(SAY_STRAWMAN_DEATH, m_creature); if(pInstance) SummonCroneIfReady(pInstance, m_creature); @@ -320,19 +320,19 @@ struct TRINITY_DLL_DECL boss_strawmanAI : public ScriptedAI void KilledUnit(Unit* victim) { - DoScriptText(SAY_STRAWMAN_SLAY, m_creature); + DoScriptText(SAY_STRAWMAN_SLAY, m_creature); } void UpdateAI(const uint32 diff) { if(AggroTimer) - { - if(AggroTimer <= diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer = 0; - }else AggroTimer -= diff; - } + { + if(AggroTimer <= diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + }else AggroTimer -= diff; + } if(!UpdateVictim()) return; @@ -380,7 +380,7 @@ struct TRINITY_DLL_DECL boss_tinheadAI : public ScriptedAI void Aggro(Unit* who) { - DoScriptText(SAY_TINHEAD_AGGRO, m_creature); + DoScriptText(SAY_TINHEAD_AGGRO, m_creature); } void AttackStart(Unit* who) @@ -401,7 +401,7 @@ struct TRINITY_DLL_DECL boss_tinheadAI : public ScriptedAI void JustDied(Unit* killer) { - DoScriptText(SAY_TINHEAD_DEATH, m_creature); + DoScriptText(SAY_TINHEAD_DEATH, m_creature); if(pInstance) SummonCroneIfReady(pInstance, m_creature); @@ -409,19 +409,19 @@ struct TRINITY_DLL_DECL boss_tinheadAI : public ScriptedAI void KilledUnit(Unit* victim) { - DoScriptText(SAY_TINHEAD_SLAY, m_creature); + DoScriptText(SAY_TINHEAD_SLAY, m_creature); } void UpdateAI(const uint32 diff) { if(AggroTimer) - { + { if(AggroTimer < diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer = 0; - }else AggroTimer -= diff; - } + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + }else AggroTimer -= diff; + } if(!UpdateVictim()) return; @@ -488,12 +488,12 @@ struct TRINITY_DLL_DECL boss_roarAI : public ScriptedAI void Aggro(Unit* who) { - DoScriptText(SAY_ROAR_AGGRO, m_creature); + DoScriptText(SAY_ROAR_AGGRO, m_creature); } void JustDied(Unit* killer) { - DoScriptText(SAY_ROAR_DEATH, m_creature); + DoScriptText(SAY_ROAR_DEATH, m_creature); if(pInstance) SummonCroneIfReady(pInstance, m_creature); @@ -501,19 +501,19 @@ struct TRINITY_DLL_DECL boss_roarAI : public ScriptedAI void KilledUnit(Unit* victim) { - DoScriptText(SAY_ROAR_SLAY, m_creature); + DoScriptText(SAY_ROAR_SLAY, m_creature); } void UpdateAI(const uint32 diff) { if(AggroTimer) - { + { if(AggroTimer <= diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer = 0; - }else AggroTimer -= diff; - } + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + }else AggroTimer -= diff; + } if(!UpdateVictim()) return; @@ -563,11 +563,11 @@ struct TRINITY_DLL_DECL boss_croneAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_CRONE_AGGRO, m_creature); break; - case 1: DoScriptText(SAY_CRONE_AGGRO2, m_creature); break; + case 0: DoScriptText(SAY_CRONE_AGGRO, m_creature); break; + case 1: DoScriptText(SAY_CRONE_AGGRO2, m_creature); break; } m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); } void JustDied(Unit* killer) @@ -1088,12 +1088,12 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI void JustDied(Unit* killer) { - DoScriptText(SAY_ROMULO_DEATH, m_creature); + DoScriptText(SAY_ROMULO_DEATH, m_creature); } void KilledUnit(Unit* victim) { - DoScriptText(SAY_ROMULO_SLAY, m_creature); + DoScriptText(SAY_ROMULO_SLAY, m_creature); } void UpdateAI(const uint32 diff); @@ -1106,7 +1106,7 @@ void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage) if(Phase == PHASE_JULIANNE) { - DoScriptText(SAY_JULIANNE_DEATH01, m_creature); + DoScriptText(SAY_JULIANNE_DEATH01, m_creature); m_creature->InterruptNonMeleeSpells(true); DoCast(m_creature, SPELL_DRINK_POISON); PretendToDie(m_creature); @@ -1200,23 +1200,23 @@ void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage) void boss_julianneAI::UpdateAI(const uint32 diff) { if(EntryYellTimer) - { - if(EntryYellTimer < diff) - { - DoScriptText(SAY_JULIANNE_ENTER, m_creature); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - EntryYellTimer = 0; - }else EntryYellTimer -= diff; - } + { + if(EntryYellTimer < diff) + { + DoScriptText(SAY_JULIANNE_ENTER, m_creature); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + EntryYellTimer = 0; + }else EntryYellTimer -= diff; + } if(AggroYellTimer) - { - if(AggroYellTimer < diff) - { - DoScriptText(SAY_JULIANNE_AGGRO, m_creature); - AggroYellTimer = 0; - }else AggroYellTimer -= diff; - } + { + if(AggroYellTimer < diff) + { + DoScriptText(SAY_JULIANNE_AGGRO, m_creature); + AggroYellTimer = 0; + }else AggroYellTimer -= diff; + } if(Phase == PHASE_ROMULO && !SummonedRomulo) { @@ -1243,20 +1243,20 @@ void boss_julianneAI::UpdateAI(const uint32 diff) return; if(RomuloDead) - { + { if(ResurrectTimer < diff) - { - Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID)); - if(Romulo && ((boss_romuloAI*)Romulo->AI())->IsFakingDeath) - { - DoScriptText(SAY_JULIANNE_RESURRECT, m_creature); - Resurrect(Romulo); - ((boss_romuloAI*)Romulo->AI())->IsFakingDeath = false; - ResurrectTimer = 10000; - } - RomuloDead = false; - }else ResurrectTimer -= diff; - } + { + Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID)); + if(Romulo && ((boss_romuloAI*)Romulo->AI())->IsFakingDeath) + { + DoScriptText(SAY_JULIANNE_RESURRECT, m_creature); + Resurrect(Romulo); + ((boss_romuloAI*)Romulo->AI())->IsFakingDeath = false; + ResurrectTimer = 10000; + } + RomuloDead = false; + }else ResurrectTimer -= diff; + } if(BlindingPassionTimer < diff) { @@ -1299,20 +1299,20 @@ void boss_romuloAI::UpdateAI(const uint32 diff) return; if(JulianneDead) - { + { if(ResurrectTimer < diff) - { - Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID)); - if(Julianne && ((boss_julianneAI*)Julianne->AI())->IsFakingDeath) - { - DoScriptText(SAY_ROMULO_RESURRECT, m_creature); - Resurrect(Julianne); - ((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false; - ResurrectTimer = 10000; - } - JulianneDead = false; - }else ResurrectTimer -= diff; - } + { + Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID)); + if(Julianne && ((boss_julianneAI*)Julianne->AI())->IsFakingDeath) + { + DoScriptText(SAY_ROMULO_RESURRECT, m_creature); + Resurrect(Julianne); + ((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false; + ResurrectTimer = 10000; + } + JulianneDead = false; + }else ResurrectTimer -= diff; + } if(BackwardLungeTimer < diff) { diff --git a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h index 29660dd6426..e1c4f7c3220 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h +++ b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h @@ -31,8 +31,8 @@ #define DATA_GAMEOBJECT_GAME_DOOR 24 #define DATA_GAMEOBJECT_GAME_EXIT_DOOR 25 #define DATA_IMAGE_OF_MEDIVH 26 -#define DATA_MASTERS_TERRACE_DOOR_1 27 -#define DATA_MASTERS_TERRACE_DOOR_2 28 +#define DATA_MASTERS_TERRACE_DOOR_1 27 +#define DATA_MASTERS_TERRACE_DOOR_2 28 // Opera Performances #define EVENT_OZ 1 diff --git a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp index 96938daaa82..f997f5fc6ea 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp @@ -60,9 +60,9 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance uint64 MassiveDoor; // Door at Netherspite uint64 GamesmansDoor; // Door before Chess uint64 GamesmansExitDoor; // Door after Chess - uint64 NetherspaceDoor; // Door at Malchezaar - uint64 MastersTerraceDoor[2]; - uint64 ImageGUID; + uint64 NetherspaceDoor; // Door at Malchezaar + uint64 MastersTerraceDoor[2]; + uint64 ImageGUID; uint8 Nightbane; bool CheckNightbane; @@ -88,12 +88,12 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance GamesmansDoor = 0; GamesmansExitDoor = 0; NetherspaceDoor = 0; - MastersTerraceDoor[0]= 0; - MastersTerraceDoor[1]= 0; - ImageGUID = 0; + MastersTerraceDoor[0]= 0; + MastersTerraceDoor[1]= 0; + ImageGUID = 0; Nightbane = 0; - + CheckNightbane = false; } @@ -101,7 +101,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance { for (uint8 i = 0; i < ENCOUNTERS; ++i) if (Encounters[i] == IN_PROGRESS) - return true; + return true; return false; } @@ -129,7 +129,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance }else return Encounters[11]; case DATA_OPERA_PERFORMANCE: return OperaEvent; case DATA_OPERA_OZ_DEATHCOUNT: return OzDeathCount; - case DATA_IMAGE_OF_MEDIVH: return ImageGUID; + case DATA_IMAGE_OF_MEDIVH: return ImageGUID; } return 0; @@ -160,8 +160,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance case DATA_GAMEOBJECT_GAME_DOOR: return GamesmansDoor; case DATA_GAMEOBJECT_GAME_EXIT_DOOR: return GamesmansExitDoor; case DATA_GAMEOBJECT_NETHER_DOOR: return NetherspaceDoor; - case DATA_MASTERS_TERRACE_DOOR_1: return MastersTerraceDoor[0]; - case DATA_MASTERS_TERRACE_DOOR_2: return MastersTerraceDoor[1]; + case DATA_MASTERS_TERRACE_DOOR_1: return MastersTerraceDoor[0]; + case DATA_MASTERS_TERRACE_DOOR_2: return MastersTerraceDoor[1]; } return 0; @@ -172,11 +172,11 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance switch (type) { case DATA_ATTUMEN_EVENT: Encounters[0] = data; break; - case DATA_MOROES_EVENT: - if (Encounters[1] == DONE) - break; - Encounters[1] = data; - break; + case DATA_MOROES_EVENT: + if (Encounters[1] == DONE) + break; + Encounters[1] = data; + break; case DATA_MAIDENOFVIRTUE_EVENT: Encounters[2] = data; break; case DATA_OPTIONAL_BOSS_EVENT: Encounters[3] = data; break; case DATA_OPERA_EVENT: Encounters[4] = data; break; @@ -186,7 +186,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance case DATA_NETHERSPITE_EVENT: Encounters[8] = data; break; case DATA_CHESS_EVENT: Encounters[9] = data; break; case DATA_MALCHEZZAR_EVENT: Encounters[10] = data; break; - case DATA_NIGHTBANE_EVENT: + case DATA_NIGHTBANE_EVENT: if(data == 6) { Nightbane; @@ -200,13 +200,13 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance SaveToDB(); } - void SetData64(uint32 identifier, uint64 data) - { - switch(identifier) - { - case DATA_IMAGE_OF_MEDIVH: ImageGUID = data; - } - } + void SetData64(uint32 identifier, uint64 data) + { + switch(identifier) + { + case DATA_IMAGE_OF_MEDIVH: ImageGUID = data; + } + } void OnObjectCreate(GameObject* go) { @@ -220,8 +220,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance case 184276: GamesmansDoor = go->GetGUID(); break; case 184277: GamesmansExitDoor = go->GetGUID(); break; case 185134: NetherspaceDoor = go->GetGUID(); break; - case 184274: MastersTerraceDoor[0] = go->GetGUID(); break; - case 184280: MastersTerraceDoor[1] = go->GetGUID(); break; + case 184274: MastersTerraceDoor[0] = go->GetGUID(); break; + case 184280: MastersTerraceDoor[1] = go->GetGUID(); break; } switch(OperaEvent) diff --git a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp index 49febb5520f..fd315e65cce 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp @@ -49,31 +49,31 @@ EndContentData */ struct Dialogue { int32 textid; - uint32 timer; + uint32 timer; }; static Dialogue OzDialogue[]= { - {-1532103, 6000}, - {-1532104, 18000}, - {-1532105, 9000}, - {-1532106, 15000} + {-1532103, 6000}, + {-1532104, 18000}, + {-1532105, 9000}, + {-1532106, 15000} }; static Dialogue HoodDialogue[]= { - {-1532107, 6000}, - {-1532108, 10000}, - {-1532109, 14000}, - {-1532110, 15000} + {-1532107, 6000}, + {-1532108, 10000}, + {-1532109, 14000}, + {-1532110, 15000} }; static Dialogue RAJDialogue[]= { - {-1532111, 5000}, - {-1532112, 7000}, - {-1532113, 14000}, - {-1532114, 14000} + {-1532111, 5000}, + {-1532112, 7000}, + {-1532113, 14000}, + {-1532114, 14000} }; // Entries and spawn locations for creatures in Oz event @@ -166,7 +166,7 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI float x,y,z; m_creature->GetPosition(x, y, z); - if (Creature* Spotlight = m_creature->SummonCreature(CREATURE_SPOTLIGHT, x, y, z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 50000)) + if (Creature* Spotlight = m_creature->SummonCreature(CREATURE_SPOTLIGHT, x, y, z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 50000)) { Spotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Spotlight->CastSpell(Spotlight, SPELL_SPOTLIGHT, false); @@ -177,7 +177,7 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI case 5: if(pInstance) { - if (GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT))) + if (GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT))) Door->SetGoState(1); } IsBeingEscorted = false; @@ -194,21 +194,21 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI { case EVENT_OZ: if (OzDialogue[count].textid) - text = OzDialogue[count].textid; + text = OzDialogue[count].textid; if(OzDialogue[count].timer) TalkTimer = OzDialogue[count].timer; break; case EVENT_HOOD: - if (HoodDialogue[count].textid) - text = HoodDialogue[count].textid; + if (HoodDialogue[count].textid) + text = HoodDialogue[count].textid; if(HoodDialogue[count].timer) TalkTimer = HoodDialogue[count].timer; break; case EVENT_RAJ: if (RAJDialogue[count].textid) - text = RAJDialogue[count].textid; + text = RAJDialogue[count].textid; if(RAJDialogue[count].timer) TalkTimer = RAJDialogue[count].timer; break; @@ -249,7 +249,7 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI if(PerformanceReady) { if(CurtainTimer) - { + { if(CurtainTimer <= diff) { PrepareEncounter(); @@ -257,12 +257,12 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI if(!pInstance) return; - if (GameObject* Curtain = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_CURTAINS))) + if (GameObject* Curtain = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_CURTAINS))) Curtain->SetGoState(0); CurtainTimer = 0; }else CurtainTimer -= diff; - } + } if(!RaidWiped) { @@ -310,7 +310,7 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI pInstance->SetData(DATA_OPERA_EVENT, IN_PROGRESS); - if (GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT))) + if (GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT))) Door->SetGoState(0); m_creature->CastSpell(m_creature, SPELL_TUXEDO, true); @@ -451,7 +451,7 @@ bool GossipSelect_npc_berthold(Player* player, Creature* _Creature, uint32 sende #define SPELL_FIRE_BALL 30967 #define SPELL_UBER_FIREBALL 30971 #define SPELL_CONFLAGRATION_BLAST 30977 -#define SPELL_MANA_SHIELD 31635 +#define SPELL_MANA_SHIELD 31635 static float MedivPos[4] = {-11161.49,-1902.24,91.48,1.94}; static float ArcanagosPos[4] = {-11169.75,-1881.48,95.39,4.83}; @@ -473,11 +473,11 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI uint32 FireMedivhTimer; uint32 FireArcanagosTimer; - bool EventStarted; + bool EventStarted; void Reset() { - ArcanagosGUID = 0; + ArcanagosGUID = 0; if(pInstance && pInstance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0) { @@ -551,7 +551,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI return 5000; case 8: FireMedivhTimer = 500; - DoCast(m_creature, SPELL_MANA_SHIELD); + DoCast(m_creature, SPELL_MANA_SHIELD); return 10000; case 9: m_creature->TextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false); @@ -565,34 +565,34 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL); return 5000; case 12: - arca->GetMotionMaster()->MovePoint(0, -11010.82,-1761.18, 156.47); - arca->setActive(true); - arca->InterruptNonMeleeSpells(true); - arca->SetSpeed(MOVE_FLIGHT, 2.0f); + arca->GetMotionMaster()->MovePoint(0, -11010.82,-1761.18, 156.47); + arca->setActive(true); + arca->InterruptNonMeleeSpells(true); + arca->SetSpeed(MOVE_FLIGHT, 2.0f); return 10000; case 13: m_creature->Yell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL); return 10000; - case 14: - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->ClearInCombat(); + case 14: + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->ClearInCombat(); - if(map->IsDungeon()) - { + if(map->IsDungeon()) + { InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers(); for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { - if(i->getSource()->isAlive()) + if(i->getSource()->isAlive()) { - if(i->getSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE) - i->getSource()->CompleteQuest(9645); + if(i->getSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE) + i->getSource()->CompleteQuest(9645); } } } - return 50000; - case 15: - arca->DealDamage(arca,arca->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return 5000; + return 50000; + case 15: + arca->DealDamage(arca,arca->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return 5000; default : return 9999999; } @@ -653,7 +653,7 @@ void AddSC_karazhan() newscript->pGossipSelect = &GossipSelect_npc_berthold; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name = "npc_image_of_medivh"; newscript->GetAI = &GetAI_npc_image_of_medivh; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp index edcf0c09c13..7136e4c83bd 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp @@ -42,7 +42,7 @@ EndScriptData */ #define SPELL_PHOENIX 44194 // Summons a phoenix (Doesn't work?) #define SPELL_PHOENIX_BURN 44198 // A spell Phoenix uses to damage everything around -#define SPELL_PHOENIX_FIREBALL 44202 // Phoenix casts this in phase 2 and stops moving +#define SPELL_PHOENIX_FIREBALL 44202 // Phoenix casts this in phase 2 and stops moving #define SPELL_FLAMESTRIKE1_NORMAL 44190 // Damage part #define SPELL_FLAMESTRIKE1_HEROIC 46163 // Heroic damage part @@ -73,9 +73,9 @@ float KaelLocations[6][2]= {148.744659, 181.377426},//center {140.823883, 195.403046},//phoenixpos1 {156.574188, 195.650482},//phoenixpos2 - {149.813, 160.917},//spherepos1 - {167.223, 173.594},//spherepos2 - {130.68, 173.007},//spherepos3 + {149.813, 160.917},//spherepos1 + {167.223, 173.594},//spherepos2 + {130.68, 173.007},//spherepos3 }; #define LOCATION_Z -16.727455 @@ -85,7 +85,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI { pInstance = ((ScriptedInstance*)c->GetInstanceData()); Reset(); - Heroic = c->GetMap()->IsHeroic(); + Heroic = c->GetMap()->IsHeroic(); } ScriptedInstance* pInstance; @@ -132,15 +132,15 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI Phase = 0; if(pInstance) - { - if(m_creature->isDead()) - pInstance->SetData(DATA_KAELTHAS_EVENT, DONE); - else - pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED); - } + { + if(m_creature->isDead()) + pInstance->SetData(DATA_KAELTHAS_EVENT, DONE); + else + pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED); + } } - void KilledUnit(Unit* victim) + void KilledUnit(Unit* victim) { if(victim && (victim->GetTypeId() == TYPEID_PLAYER)) { @@ -152,13 +152,13 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI data << uint32(0); victim->SendMessageToSet(&data, true); } - } + } void JustDied(Unit *killer) { - RemoveGravityLapse(); + RemoveGravityLapse(); DoScriptText(SAY_DEATH, m_creature); - if(pInstance) - pInstance->SetData(DATA_KAELTHAS_EVENT, DONE); + if(pInstance) + pInstance->SetData(DATA_KAELTHAS_EVENT, DONE); } void DamageTaken(Unit* done_by, uint32 &damage) @@ -170,14 +170,14 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI void Aggro(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); - if(pInstance) - pInstance->SetData(DATA_KAELTHAS_EVENT, IN_PROGRESS); + if(pInstance) + pInstance->SetData(DATA_KAELTHAS_EVENT, IN_PROGRESS); } void SetThreatList(Creature* SummonedUnit) { if(!SummonedUnit) - return; + return; std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); std::list::iterator i = m_threatlist.begin(); @@ -192,53 +192,53 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI } } - void EnterEvadeMode() - { - RemoveGravityLapse(); - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(); - m_creature->LoadCreaturesAddon(); + void EnterEvadeMode() + { + RemoveGravityLapse(); + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(); + m_creature->LoadCreaturesAddon(); - if( m_creature->isAlive() ) - m_creature->GetMotionMaster()->MoveTargetedHome(); + if( m_creature->isAlive() ) + m_creature->GetMotionMaster()->MoveTargetedHome(); - m_creature->SetLootRecipient(NULL); + m_creature->SetLootRecipient(NULL); - InCombat = false; - Reset(); - } + InCombat = false; + Reset(); + } void TeleportPlayersToSelf() { - float x,y,z; + float x,y,z; m_creature->Relocate(KaelLocations[0][0], KaelLocations[0][1], LOCATION_Z, 0); - Map *map = m_creature->GetMap(); + Map *map = m_creature->GetMap(); Map::PlayerList const &PlayerList = map->GetPlayers(); - Map::PlayerList::const_iterator i; - for (i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (Player* i_pl = i->getSource()) - if(i_pl->isAlive()) - { - i_pl->CastSpell(i_pl, SPELL_TELEPORT_CENTER, true); - m_creature->GetNearPoint(m_creature,x,y,z,5,5,0); - i_pl->TeleportTo(m_creature->GetMapId(),x,y,LOCATION_Z,i_pl->GetOrientation()); - } + Map::PlayerList::const_iterator i; + for (i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (Player* i_pl = i->getSource()) + if(i_pl->isAlive()) + { + i_pl->CastSpell(i_pl, SPELL_TELEPORT_CENTER, true); + m_creature->GetNearPoint(m_creature,x,y,z,5,5,0); + i_pl->TeleportTo(m_creature->GetMapId(),x,y,LOCATION_Z,i_pl->GetOrientation()); + } } DoCast(m_creature, SPELL_TELEPORT_CENTER, true); } void CastGravityLapseKnockUp() { - Map *map = m_creature->GetMap(); + Map *map = m_creature->GetMap(); Map::PlayerList const &PlayerList = map->GetPlayers(); - Map::PlayerList::const_iterator i; - for (i = PlayerList.begin(); i != PlayerList.end(); ++i) - { + Map::PlayerList::const_iterator i; + for (i = PlayerList.begin(); i != PlayerList.end(); ++i) + { if (Player* i_pl = i->getSource()) - if(i_pl->isAlive()) + if(i_pl->isAlive()) // Knockback into the air i_pl->CastSpell(i_pl, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->GetGUID()); } @@ -246,14 +246,14 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air... { - Map *map = m_creature->GetMap(); - Map::PlayerList const &PlayerList = map->GetPlayers(); - Map::PlayerList::const_iterator i; - for (i = PlayerList.begin(); i != PlayerList.end(); ++i) - { + Map *map = m_creature->GetMap(); + Map::PlayerList const &PlayerList = map->GetPlayers(); + Map::PlayerList::const_iterator i; + for (i = PlayerList.begin(); i != PlayerList.end(); ++i) + { if (Player* i_pl = i->getSource()) { - if(i_pl->isAlive()) + if(i_pl->isAlive()) { // Also needs an exception in spell system. i_pl->CastSpell(i_pl, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, m_creature->GetGUID()); @@ -263,7 +263,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI data.append(i_pl->GetPackGUID()); data << uint32(0); i_pl->SendMessageToSet(&data, true); - i_pl->SetSpeed(MOVE_FLIGHT, 2.0f); + i_pl->SetSpeed(MOVE_FLIGHT, 2.0f); } } } @@ -271,11 +271,11 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI void RemoveGravityLapse() { - Map *map = m_creature->GetMap(); + Map *map = m_creature->GetMap(); Map::PlayerList const &PlayerList = map->GetPlayers(); - Map::PlayerList::const_iterator i; - for (i = PlayerList.begin(); i != PlayerList.end(); ++i) - { + Map::PlayerList::const_iterator i; + for (i = PlayerList.begin(); i != PlayerList.end(); ++i) + { if(Player* i_pl = i->getSource()) { i_pl->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); @@ -300,14 +300,14 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI { // *Heroic mode only: if(Heroic) - { + { if(PyroblastTimer < diff) - { - DoCast(m_creature, SPELL_SHOCK_BARRIER, true); - DoCast(m_creature->getVictim(), SPELL_PYROBLAST); - PyroblastTimer = 60000; - }else PyroblastTimer -= diff; - } + { + DoCast(m_creature, SPELL_SHOCK_BARRIER, true); + DoCast(m_creature->getVictim(), SPELL_PYROBLAST); + PyroblastTimer = 60000; + }else PyroblastTimer -= diff; + } if(FireballTimer < diff) { @@ -325,19 +325,19 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI { Phoenix->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); SetThreatList(Phoenix); - Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); - if(target) - { - Phoenix->AddThreat(target,1000); - Phoenix->Attack(target,true); - Phoenix->GetMotionMaster()->MoveChase(target); - } - else - { - Phoenix->AddThreat(m_creature->getVictim(),1000); - Phoenix->Attack(m_creature->getVictim(),true); - Phoenix->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } + Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); + if(target) + { + Phoenix->AddThreat(target,1000); + Phoenix->Attack(target,true); + Phoenix->GetMotionMaster()->MoveChase(target); + } + else + { + Phoenix->AddThreat(m_creature->getVictim(),1000); + Phoenix->Attack(m_creature->getVictim(),true); + Phoenix->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } } DoScriptText(SAY_PHOENIX, m_creature); @@ -347,13 +347,13 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI if(FlameStrikeTimer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) { - m_creature->InterruptNonMeleeSpells(false); + m_creature->InterruptNonMeleeSpells(false); DoCast(target, SPELL_FLAMESTRIKE3, true); - DoScriptText(SAY_FLAMESTRIKE, m_creature); + DoScriptText(SAY_FLAMESTRIKE, m_creature); - FlameStrikeTimer = 20000 + rand()%5000; + FlameStrikeTimer = 20000 + rand()%5000; } }else FlameStrikeTimer -= diff; @@ -374,7 +374,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI case 1: { - m_creature->StopMoving(); + m_creature->StopMoving(); if(GravityLapseTimer < diff) { switch(GravityLapsePhase) @@ -382,7 +382,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI case 0: if(FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse { - DoScriptText(SAY_GRAVITY_LAPSE, m_creature); + DoScriptText(SAY_GRAVITY_LAPSE, m_creature); FirstGravityLapse = false; if(pInstance) { @@ -393,9 +393,9 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI } }else { - DoScriptText(SAY_RECAST_GRAVITY, m_creature); + DoScriptText(SAY_RECAST_GRAVITY, m_creature); } - m_creature->StopMoving(); + m_creature->StopMoving(); DoCast(m_creature, SPELL_GRAVITY_LAPSE_INITIAL); GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell GravityLapsePhase = 1; @@ -419,28 +419,28 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI GravityLapsePhase = 4; for(uint8 i = 0; i < 3; ++i) { - Creature* Orb = m_creature->SummonCreature(CREATURE_ARCANE_SPHERE,KaelLocations[3+i][0],KaelLocations[3+i][1],LOCATION_Z,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000); - if(Orb) - { - SetThreatList(Orb); - Unit *target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,i); - if(target) - { - Orb->AddThreat(target,1000); - Orb->Attack(target,true); - Orb->GetMotionMaster()->MoveChase(target); - } - else - { - Unit *ntarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if(ntarget) - { - Orb->AddThreat(ntarget,1000); - Orb->Attack(ntarget,true); - Orb->GetMotionMaster()->MoveChase(ntarget); - } - } - } + Creature* Orb = m_creature->SummonCreature(CREATURE_ARCANE_SPHERE,KaelLocations[3+i][0],KaelLocations[3+i][1],LOCATION_Z,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000); + if(Orb) + { + SetThreatList(Orb); + Unit *target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,i); + if(target) + { + Orb->AddThreat(target,1000); + Orb->Attack(target,true); + Orb->GetMotionMaster()->MoveChase(target); + } + else + { + Unit *ntarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if(ntarget) + { + Orb->AddThreat(ntarget,1000); + Orb->Attack(ntarget,true); + Orb->GetMotionMaster()->MoveChase(ntarget); + } + } + } } DoCast(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL); break; @@ -497,73 +497,73 @@ struct TRINITY_DLL_DECL mob_felkael_flamestrikeAI : public ScriptedAI struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI { mob_felkael_phoenixAI(Creature *c) : ScriptedAI(c) - { + { pInstance = ((ScriptedInstance*)c->GetInstanceData()); Reset(); } uint32 BurnTimer; - uint32 CheckTimer; - uint8 phase; - ScriptedInstance* pInstance; - bool end; + uint32 CheckTimer; + uint8 phase; + ScriptedInstance* pInstance; + bool end; void Reset() { - m_creature->SetSpeed(MOVE_RUN, 0.5f); - m_creature->SetSpeed(MOVE_WALK, 0.5f); + m_creature->SetSpeed(MOVE_RUN, 0.5f); + m_creature->SetSpeed(MOVE_WALK, 0.5f); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); BurnTimer = 2000; - CheckTimer = 1000; - phase = 0; - end = false; + CheckTimer = 1000; + phase = 0; + end = false; } void Aggro(Unit* who) {} void JustDied(Unit* slayer) { - if (end) - return; + if (end) + return; DoSpawnCreature(CREATURE_PHOENIX_EGG, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 45000); } void UpdateAI(const uint32 diff) { - if(CheckTimer < diff) + if(CheckTimer < diff) { if (pInstance) - { - Creature *boss = ((Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_KAEL))); - if (boss) - { - phase = ((boss_felblood_kaelthasAI*)boss->AI())->Phase; - if(boss->isDead() || !boss->isInCombat()) - { - end = true; - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, NULL, false);//temphack, hellfire is not damaging self - } - } - } + { + Creature *boss = ((Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_KAEL))); + if (boss) + { + phase = ((boss_felblood_kaelthasAI*)boss->AI())->Phase; + if(boss->isDead() || !boss->isInCombat()) + { + end = true; + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, NULL, false);//temphack, hellfire is not damaging self + } + } + } CheckTimer = 1000; }else CheckTimer -= diff; if (!UpdateVictim()) return; - if (BurnTimer < diff) - { - if(!phase) - { - DoCast(m_creature, SPELL_PHOENIX_BURN); - m_creature->DealDamage(m_creature, 1500, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, NULL, false);//temphack, hellfire is not damaging self - } - else - { - m_creature->StopMoving(); - DoCast(m_creature->getVictim(), SPELL_PHOENIX_FIREBALL); - } - BurnTimer = 2000; - }else BurnTimer -= diff; + if (BurnTimer < diff) + { + if(!phase) + { + DoCast(m_creature, SPELL_PHOENIX_BURN); + m_creature->DealDamage(m_creature, 1500, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, NULL, false);//temphack, hellfire is not damaging self + } + else + { + m_creature->StopMoving(); + DoCast(m_creature->getVictim(), SPELL_PHOENIX_FIREBALL); + } + BurnTimer = 2000; + }else BurnTimer -= diff; //DoMeleeAttackIfReady(); } @@ -572,13 +572,13 @@ struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public Scripted_NoMovementAI { mob_felkael_phoenix_eggAI(Creature *c) : Scripted_NoMovementAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } uint32 HatchTimer; - ScriptedInstance* pInstance; + ScriptedInstance* pInstance; void Reset() { HatchTimer = 15000; } void Aggro(Unit* who) {} @@ -588,43 +588,43 @@ struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public Scripted_NoMovementAI if(HatchTimer < diff) { - Creature *bird = DoSpawnCreature(CREATURE_PHOENIX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 60000); - if (bird) - { - Unit *boss = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_KAEL)); - if (boss && boss->getVictim()) - { - bird->AddThreat(boss->getVictim(),100); - bird->Attack(boss->getVictim(),true); - bird->GetMotionMaster()->MoveChase(boss->getVictim()); - } - } - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - }else HatchTimer -= diff; + Creature *bird = DoSpawnCreature(CREATURE_PHOENIX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 60000); + if (bird) + { + Unit *boss = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_KAEL)); + if (boss && boss->getVictim()) + { + bird->AddThreat(boss->getVictim(),100); + bird->Attack(boss->getVictim(),true); + bird->GetMotionMaster()->MoveChase(boss->getVictim()); + } + } + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + }else HatchTimer -= diff; } }; struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI { mob_arcane_sphereAI(Creature *c) : ScriptedAI(c) - { + { pInstance = ((ScriptedInstance*)c->GetInstanceData()); Reset(); } uint32 DespawnTimer; uint32 ChangeTargetTimer; - uint32 CheckTimer; + uint32 CheckTimer; - ScriptedInstance* pInstance; + ScriptedInstance* pInstance; void Reset() { - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); DespawnTimer = 30000; ChangeTargetTimer = 5000; - CheckTimer = 1000; - m_creature->SetSpeed(MOVE_RUN, 0.5f); - m_creature->SetSpeed(MOVE_WALK, 0.5f); + CheckTimer = 1000; + m_creature->SetSpeed(MOVE_RUN, 0.5f); + m_creature->SetSpeed(MOVE_WALK, 0.5f); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->setFaction(14); DoCast(m_creature, SPELL_ARCANE_SPHERE_PASSIVE, true); @@ -636,9 +636,9 @@ struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI { if(!target) return; - m_creature->AddThreat(target,100000); - m_creature->GetMotionMaster()->MoveChase(target); - m_creature->Attack(target,true); + m_creature->AddThreat(target,100000); + m_creature->GetMotionMaster()->MoveChase(target); + m_creature->Attack(target,true); } void UpdateAI(const uint32 diff) @@ -648,28 +648,28 @@ struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI else DespawnTimer -= diff; if(!UpdateVictim()) - ChangeTargetTimer = 0; + ChangeTargetTimer = 0; if(ChangeTargetTimer < diff) { - DoResetThreat(); + DoResetThreat(); Unit *ntarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (ntarget) - StalkTarget(ntarget); + if (ntarget) + StalkTarget(ntarget); ChangeTargetTimer = 10000; }else ChangeTargetTimer -= diff; - if(CheckTimer < diff) + if(CheckTimer < diff) { if (pInstance) - { - Creature *boss = (Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_KAEL)); - if(boss) - { - if(!((boss_felblood_kaelthasAI*)boss->AI())->Phase || boss->isDead()) - DespawnTimer = 0; - }else DespawnTimer = 0; - } + { + Creature *boss = (Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_KAEL)); + if(boss) + { + if(!((boss_felblood_kaelthasAI*)boss->AI())->Phase || boss->isDead()) + DespawnTimer = 0; + }else DespawnTimer = 0; + } CheckTimer = 1000; }else CheckTimer -= diff; } @@ -678,30 +678,30 @@ struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI bool GOHello_go_kael_orb(Player *player, GameObject* _GO) { ScriptedInstance* pInst = (ScriptedInstance*)_GO->GetInstanceData(); - if (pInst && player) - { - Unit *kael = Unit::GetUnit((*_GO),pInst->GetData64(DATA_KAEL)); - if (kael && kael->isDead()) - player->TeleportTo(530, 12888, -6876, 9, 0.3); - } + if (pInst && player) + { + Unit *kael = Unit::GetUnit((*_GO),pInst->GetData64(DATA_KAEL)); + if (kael && kael->isDead()) + player->TeleportTo(530, 12888, -6876, 9, 0.3); + } return true; } bool GOHello_go_movie_orb(Player *player, GameObject* _GO) { - if (player) - { - WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4); + if (player) + { + WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4); data << (uint32)164; player->GetSession()->SendPacket(&data); - if (player->GetQuestStatus(11490) == QUEST_STATUS_INCOMPLETE) - { - Unit *qUnit = player->SummonCreature(25042,player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()-10,0,TEMPSUMMON_CORPSE_DESPAWN,0); - if(qUnit) - player->DealDamage(qUnit, qUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } + if (player->GetQuestStatus(11490) == QUEST_STATUS_INCOMPLETE) + { + Unit *qUnit = player->SummonCreature(25042,player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()-10,0,TEMPSUMMON_CORPSE_DESPAWN,0); + if(qUnit) + player->DealDamage(qUnit, qUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } return true; } @@ -759,12 +759,12 @@ void AddSC_boss_felblood_kaelthas() newscript->GetAI = &GetAI_mob_felkael_flamestrike; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="go_kael_orb"; newscript->pGOHello = &GOHello_go_kael_orb; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="go_movie_orb"; newscript->pGOHello = &GOHello_go_movie_orb; newscript->RegisterSelf(); 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 5eae41aa45f..15af5cce3b8 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 @@ -26,7 +26,7 @@ EndScriptData */ struct Speech { - int32 id; + int32 id; }; static Speech LackeyDeath[]= @@ -39,10 +39,10 @@ static Speech LackeyDeath[]= static Speech PlayerDeath[]= { - {-1585017}, - {-1585018}, - {-1585019}, - {-1585020}, + {-1585017}, + {-1585018}, + {-1585019}, + {-1585020}, {-1585021}, }; @@ -98,7 +98,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI { pInstance = ((ScriptedInstance*)c->GetInstanceData()); Adds.clear(); - //SummonAdds(); + //SummonAdds(); Reset(); Heroic = c->GetMap()->IsHeroic(); } @@ -122,7 +122,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI void Reset() { - m_creature->SetCorpseDelay(60*60*1000); + m_creature->SetCorpseDelay(60*60*1000); LackeysKilled = 0; PlayersKilled = 0; @@ -136,18 +136,18 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI CheckAdds(); - if(pInstance) - { - pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 0); - if (m_creature->isDead()) - pInstance->SetData(DATA_DELRISSA_EVENT, DONE); - else pInstance->SetData(DATA_DELRISSA_EVENT, NOT_STARTED); - }else error_log(ERROR_INST_DATA); + if(pInstance) + { + pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 0); + if (m_creature->isDead()) + pInstance->SetData(DATA_DELRISSA_EVENT, DONE); + else pInstance->SetData(DATA_DELRISSA_EVENT, NOT_STARTED); + }else error_log(ERROR_INST_DATA); } void Aggro(Unit* who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); for(uint8 i = 0; i < Adds.size(); ++i) if(Unit* pAdd = Unit::GetUnit(*m_creature, Adds[i]->guid)) @@ -156,8 +156,8 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI void SummonAdds() { - /*if (m_creature->isDead()) - return;*/ + /*if (m_creature->isDead()) + return;*/ std::vector AddList; for(uint8 i = 0; i < 8; ++i) AddList.push_back(AddEntry[i]); @@ -178,35 +178,35 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI void CheckAdds() { - //if (m_creature->isDead()) - // return; + //if (m_creature->isDead()) + // return; if(Adds.empty()) - { - SummonAdds(); + { + SummonAdds(); return; - } + } for(uint8 i = 0; i < Adds.size(); ++i) { Creature* pAdd = ((Creature*)Unit::GetUnit(*m_creature, Adds[i]->guid)); if(pAdd && pAdd->isAlive()) { - pAdd->AI()->EnterEvadeMode(); - pAdd->GetMotionMaster()->MovePoint(0,LackeyLocations[i][0], LackeyLocations[i][1], POS_Z); + pAdd->AI()->EnterEvadeMode(); + pAdd->GetMotionMaster()->MovePoint(0,LackeyLocations[i][0], LackeyLocations[i][1], POS_Z); } - if(!pAdd || (pAdd && pAdd->isDead())) + if(!pAdd || (pAdd && pAdd->isDead())) { - if(pAdd) - pAdd->RemoveCorpse();//looks stupid if mob is alive but has a dead corpse in front of him :) - Creature* pAdd = m_creature->SummonCreature(Adds[i]->entry, LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0); - if(pAdd) - Adds[i]->guid = pAdd->GetGUID(); - } + if(pAdd) + pAdd->RemoveCorpse();//looks stupid if mob is alive but has a dead corpse in front of him :) + Creature* pAdd = m_creature->SummonCreature(Adds[i]->entry, LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0); + if(pAdd) + Adds[i]->guid = pAdd->GetGUID(); + } } } void KilledUnit(Unit* victim) { - if(victim->GetTypeId() != TYPEID_PLAYER || m_creature->isDead()) + if(victim->GetTypeId() != TYPEID_PLAYER || m_creature->isDead()) return; DoScriptText(PlayerDeath[PlayersKilled].id, m_creature); @@ -216,18 +216,18 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI void KilledLackey() { - if(m_creature->isDead())//no sense to talk if dead.. - return; + if(m_creature->isDead())//no sense to talk if dead.. + return; DoScriptText(LackeyDeath[LackeysKilled].id, m_creature); if( LackeysKilled < 3 ) ++LackeysKilled; - CheckLootable(); + CheckLootable(); } void JustDied(Unit* killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); CheckLootable(); @@ -370,12 +370,12 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI void Reset() { UsedPotion = false; - if(pInstance) - { - Creature *boss = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_DELRISSA))); - if (boss && boss->isDead()) - boss->Respawn(); - } + if(pInstance) + { + Creature *boss = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_DELRISSA))); + if (boss && boss->isDead()) + boss->Respawn(); + } ResetThreatTimer = 5000 + rand()%15000; // These guys like to switch targets often, and are not meant to be tanked. } @@ -646,8 +646,8 @@ struct TRINITY_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_guestAI Fear_Timer = 10000; }else Fear_Timer -= diff; - if (m_creature->GetDistance(m_creature->getVictim()) <= 10) - m_creature->StopMoving(); + if (m_creature->GetDistance(m_creature->getVictim()) <= 10) + m_creature->StopMoving(); //DoMeleeAttackIfReady();//should not melee, she's a warlock } }; @@ -755,7 +755,7 @@ struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI if(Polymorph_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) { DoCast(target, SPELL_POLYMORPH); DoModifyThreatPercent(target,-100); @@ -802,27 +802,27 @@ struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI if(Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid())) //if in melee range if (target->IsWithinDistInMap(m_creature, 5)) - { - InMeleeRange = true; - break; - } + { + InMeleeRange = true; + break; + } } //if anybody is in melee range than escape by blink if(InMeleeRange) - { - //DoCast(m_creature, SPELL_BLINK); //blink does not work on npcs - float x,y,z; - m_creature->GetPosition(x,y,z); - x = rand()%2 ? x+10+rand()%10 : x-10-rand()%10; - y = rand()%2 ? y+10+rand()%10 : y-10-rand()%10; - m_creature->Relocate(x,y,z); - m_creature->SendMonsterMove(x, y, m_creature->GetPositionZ(), 0,0,0); - } + { + //DoCast(m_creature, SPELL_BLINK); //blink does not work on npcs + float x,y,z; + m_creature->GetPosition(x,y,z); + x = rand()%2 ? x+10+rand()%10 : x-10-rand()%10; + y = rand()%2 ? y+10+rand()%10 : y-10-rand()%10; + m_creature->Relocate(x,y,z); + m_creature->SendMonsterMove(x, y, m_creature->GetPositionZ(), 0,0,0); + } Blink_Timer = 8000; }else Blink_Timer -= diff; - if (m_creature->GetDistance(m_creature->getVictim()) <= 10) - m_creature->StopMoving(); + if (m_creature->GetDistance(m_creature->getVictim()) <= 10) + m_creature->StopMoving(); //DoMeleeAttackIfReady(); //mage type, no melee needed } @@ -968,8 +968,8 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI uint32 Multi_Shot_Timer; uint32 Wing_Clip_Timer; uint32 Freezing_Trap_Timer; - uint32 StopMoving; - bool Stopped; + uint32 StopMoving; + bool Stopped; void Reset() { @@ -982,8 +982,8 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI Multi_Shot_Timer = 10000; Wing_Clip_Timer = 4000; Freezing_Trap_Timer = 15000; - StopMoving = 2000; - Stopped = false; + StopMoving = 2000; + Stopped = false; boss_priestess_guestAI::Reset(); } @@ -1054,16 +1054,16 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI Shoot_Timer = 2500; }else Shoot_Timer -= diff; } - if(StopMoving < diff) + if(StopMoving < diff) { - if(Stopped) - Stopped = false; - else - Stopped = true; + if(Stopped) + Stopped = false; + else + Stopped = true; StopMoving = 2000+rand()%5000; }else StopMoving -= diff; - if (Stopped) - m_creature->StopMoving(); + if (Stopped) + m_creature->StopMoving(); } }; @@ -1207,11 +1207,11 @@ struct TRINITY_DLL_DECL boss_zelfanAI : public boss_priestess_guestAI if(Goblin_Dragon_Gun_Timer < diff) { - if (m_creature->GetDistance(m_creature->getVictim()) <= 5) - { - Goblin_Dragon_Gun_Timer = 10000; - DoCast(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN); - }else Goblin_Dragon_Gun_Timer = 2000; + if (m_creature->GetDistance(m_creature->getVictim()) <= 5) + { + Goblin_Dragon_Gun_Timer = 10000; + DoCast(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN); + }else Goblin_Dragon_Gun_Timer = 2000; }else Goblin_Dragon_Gun_Timer -= diff; if(Rocket_Launch_Timer < diff) diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp index df5653eba1f..219a773039b 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp @@ -68,7 +68,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI } } Reset(); - Heroic = c->GetMap()->IsHeroic(); + Heroic = c->GetMap()->IsHeroic(); } ScriptedInstance* pInstance; @@ -109,9 +109,9 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI Door->SetGoState(0); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) // Small door opened after event are expected to be closed by default // Set Inst data for encounter - if (m_creature->isDead()) - pInstance->SetData(DATA_SELIN_EVENT, DONE); - else pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED); + if (m_creature->isDead()) + pInstance->SetData(DATA_SELIN_EVENT, DONE); + else pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED); }else error_log(ERROR_INST_DATA); DrainLifeTimer = 3000 + rand()%4000; @@ -154,7 +154,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI if( CrystalChosen ) { DoScriptText(SAY_ENERGY, m_creature); - DoScriptText(EMOTE_CRYSTAL, m_creature); + DoScriptText(EMOTE_CRYSTAL, m_creature); CrystalChosen->CastSpell(CrystalChosen, SPELL_FEL_CRYSTAL_COSMETIC, true); @@ -184,7 +184,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI void Aggro(Unit* who) { - m_creature->SetPower(POWER_MANA, 0); + m_creature->SetPower(POWER_MANA, 0); DoScriptText(SAY_AGGRO, m_creature); if( pInstance ) @@ -199,8 +199,8 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; } } @@ -228,7 +228,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI void JustDied(Unit* killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); if(!pInstance) { @@ -300,33 +300,33 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI { if( IsDraining ) { - if (CheckTimer < diff) - { - Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID); - if(CrystalChosen) - { - if(CrystalChosen->GetUInt32Value(UNIT_CHANNEL_SPELL) == SPELL_MANA_RAGE) - { - m_creature->StopMoving(); - }else{ - IsDraining = false; - DrainingCrystal = false; - - DoScriptText(SAY_EMPOWERED, m_creature); - - Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID); - if( CrystalChosen && CrystalChosen->isAlive() ) - // Use Deal Damage to kill it, not setDeathState. - CrystalChosen->DealDamage(CrystalChosen, CrystalChosen->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - CrystalGUID = 0; - - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - } - CheckTimer = 1000; - }else CheckTimer -= diff; - } + if (CheckTimer < diff) + { + Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID); + if(CrystalChosen) + { + if(CrystalChosen->GetUInt32Value(UNIT_CHANNEL_SPELL) == SPELL_MANA_RAGE) + { + m_creature->StopMoving(); + }else{ + IsDraining = false; + DrainingCrystal = false; + + DoScriptText(SAY_EMPOWERED, m_creature); + + Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID); + if( CrystalChosen && CrystalChosen->isAlive() ) + // Use Deal Damage to kill it, not setDeathState. + CrystalChosen->DealDamage(CrystalChosen, CrystalChosen->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + CrystalGUID = 0; + + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + } + CheckTimer = 1000; + }else CheckTimer -= diff; + } } DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun. } @@ -349,7 +349,7 @@ struct TRINITY_DLL_DECL mob_fel_crystalAI : public ScriptedAI void JustDied(Unit* killer) { - m_creature->RemoveAurasDueToSpell(SPELL_MANA_RAGE); + m_creature->RemoveAurasDueToSpell(SPELL_MANA_RAGE); if(ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData())) { Creature* Selin = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SELIN))); @@ -360,7 +360,7 @@ struct TRINITY_DLL_DECL mob_fel_crystalAI : public ScriptedAI // Set this to false if we are the creature that Selin is draining so his AI flows properly ((boss_selin_fireheartAI*)Selin->AI())->DrainingCrystal = false; ((boss_selin_fireheartAI*)Selin->AI())->IsDraining = false; - Selin->RemoveAurasDueToSpell(SPELL_MANA_RAGE); + Selin->RemoveAurasDueToSpell(SPELL_MANA_RAGE); if(Selin->getVictim()) { Selin->AI()->AttackStart(Selin->getVictim()); diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp index 1c51e98a1d4..e3ed21fcbea 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp @@ -41,7 +41,7 @@ EndScriptData */ #define SPELL_SUMMON_PURE_ENERGY 44322 //not-working, this script summon this creatures without this spell #define SPELL_OVERLOAD 44353 #define SPELL_ARCANE_SHOCK 44319 -#define ASTRAL_FLARE_VISUAL 30237 +#define ASTRAL_FLARE_VISUAL 30237 //Creatures #define CREATURE_PURE_ENERGY 24745 @@ -76,16 +76,16 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI Enraged = false; if(pInstance) - { - if (m_creature->isDead()) - pInstance->SetData(DATA_VEXALLUS_EVENT, DONE); - else pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED); - } + { + if (m_creature->isDead()) + pInstance->SetData(DATA_VEXALLUS_EVENT, DONE); + else pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED); + } } void KilledUnit(Unit *victim) { - DoScriptText(SAY_KILL, m_creature); + DoScriptText(SAY_KILL, m_creature); } void JustDied(Unit *victim) @@ -124,8 +124,8 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI //used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25% if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(SpawnAddInterval*(AlreadySpawnedAmount+1)))) { - DoScriptText(SAY_ENERGY, m_creature); - DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature); + DoScriptText(SAY_ENERGY, m_creature); + DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature); Creature* PureEnergyCreature = NULL; PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, 10, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); Unit* target = NULL; @@ -146,7 +146,7 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI if(ChainLightningTimer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_CHAIN_LIGHTNING); ChainLightningTimer = 10000; }else ChainLightningTimer -= diff; @@ -162,7 +162,7 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI { if(OverloadTimer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_OVERLOAD); OverloadTimer = 2200; }else OverloadTimer -= diff; @@ -181,14 +181,14 @@ struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI mob_pure_energyAI(Creature *c) : ScriptedAI(c) {Reset();} uint32 EnergyBoltTimer; - uint32 VisualTimer; + uint32 VisualTimer; void Reset() { EnergyBoltTimer = 1700; - VisualTimer = 1000; - m_creature->SetSpeed(MOVE_RUN, 0.5f); - m_creature->SetSpeed(MOVE_WALK, 0.5f); + VisualTimer = 1000; + m_creature->SetSpeed(MOVE_RUN, 0.5f); + m_creature->SetSpeed(MOVE_WALK, 0.5f); } void JustDied(Unit* slayer) @@ -208,7 +208,7 @@ struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI DoCast(m_creature->getVictim(), SPELL_ENERGY_BOLT); EnergyBoltTimer = 1700; }else EnergyBoltTimer -= diff; - if(VisualTimer < diff) + if(VisualTimer < diff) { DoCast(m_creature->getVictim(), ASTRAL_FLARE_VISUAL, true); VisualTimer = 1000; diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h b/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h index 1e31421247f..7d52cbb7404 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h @@ -25,7 +25,7 @@ #define DATA_DELRISSA_DEATH_COUNT 15 -#define DATA_KAEL 16 +#define DATA_KAEL 16 #define ERROR_INST_DATA "SD2 Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy." #endif diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp index fe07b7d7f2f..018c86b065d 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp @@ -37,14 +37,14 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance { instance_magisters_terrace(Map* map) : ScriptedInstance(map) {Initialize();} - uint32 DoorState[3];//0seline, 1vexallus, 2derlissa + uint32 DoorState[3];//0seline, 1vexallus, 2derlissa uint32 Encounters[NUMBER_OF_ENCOUNTERS]; uint32 DelrissaDeathCount; std::list FelCrystals; std::list::iterator CrystalItr; - uint64 KaelGUID; + uint64 KaelGUID; uint64 SelinGUID; uint64 DelrissaGUID; uint64 VexallusDoorGUID; @@ -57,8 +57,8 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance void Initialize() { - for(uint8 i = 0; i < 3; i++) - DoorState[i] = 1;//1 closed, 0 opened + for(uint8 i = 0; i < 3; i++) + DoorState[i] = 1;//1 closed, 0 opened for(uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; i++) Encounters[i] = NOT_STARTED; @@ -67,7 +67,7 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance DelrissaDeathCount = 0; - KaelGUID = 0; + KaelGUID = 0; SelinGUID = 0; DelrissaGUID = 0; VexallusDoorGUID = 0; @@ -107,29 +107,29 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance switch(identifier) { case DATA_SELIN_EVENT: - Encounters[0] = data; - if(data==DONE) - { - DoorState[0] = 0; - SaveToDB(); - } - break; + Encounters[0] = data; + if(data==DONE) + { + DoorState[0] = 0; + SaveToDB(); + } + break; case DATA_VEXALLUS_EVENT: - Encounters[1] = data; - if(data==DONE) - { - DoorState[1] = 0; - SaveToDB(); - } - break; + Encounters[1] = data; + if(data==DONE) + { + DoorState[1] = 0; + SaveToDB(); + } + break; case DATA_DELRISSA_EVENT: - Encounters[2] = data; - if(data==DONE) - { - DoorState[2] = 0; - SaveToDB(); - } - break; + Encounters[2] = data; + if(data==DONE) + { + DoorState[2] = 0; + SaveToDB(); + } + break; case DATA_KAELTHAS_EVENT: Encounters[3] = data; break; case DATA_DELRISSA_DEATH_COUNT: @@ -138,7 +138,7 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance } } - const char* Save() + const char* Save() { std::ostringstream ss; ss << "S " << DoorState[0] << " " << DoorState[1] << " " << DoorState[2]; @@ -169,7 +169,7 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance case 24723: SelinGUID = creature->GetGUID(); break; case 24560: DelrissaGUID = creature->GetGUID(); break; case 24722: FelCrystals.push_back(creature->GetGUID()); break; - case 24664: KaelGUID = creature->GetGUID(); break; + case 24664: KaelGUID = creature->GetGUID(); break; } } @@ -178,20 +178,20 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance switch(go->GetEntry()) { case 187896: - VexallusDoorGUID = go->GetGUID(); - go->SetGoState(DoorState[1]); - break; + VexallusDoorGUID = go->GetGUID(); + go->SetGoState(DoorState[1]); + break; //SunwellRaid Gate 02 case 187979: - SelinDoorGUID = go->GetGUID(); - go->SetGoState(DoorState[0]); - break; + SelinDoorGUID = go->GetGUID(); + go->SetGoState(DoorState[0]); + break; //Assembly Chamber Door case 188065: SelinEncounterDoorGUID = go->GetGUID(); break; case 187770: - DelrissaDoorGUID = go->GetGUID(); - go->SetGoState(DoorState[2]); - break; + DelrissaDoorGUID = go->GetGUID(); + go->SetGoState(DoorState[2]); + break; case 188165: KaelStatue[0] = go->GetGUID(); break; case 188166: KaelStatue[1] = go->GetGUID(); break; } @@ -202,7 +202,7 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance switch(identifier) { case DATA_SELIN: return SelinGUID; - case DATA_KAEL: return KaelGUID; + case DATA_KAEL: return KaelGUID; case DATA_DELRISSA: return DelrissaGUID; case DATA_VEXALLUS_DOOR: return VexallusDoorGUID; case DATA_SELIN_DOOR: return SelinDoorGUID; diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp index 7e907c41581..4f74a48c431 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp @@ -57,9 +57,9 @@ struct TRINITY_DLL_DECL boss_baron_geddonAI : public ScriptedAI //If we are <2% hp cast Armageddom if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 2) { - m_creature->InterruptNonMeleeSpells(true); + m_creature->InterruptNonMeleeSpells(true); DoCast(m_creature,SPELL_ARMAGEDDOM); - DoScriptText(EMOTE_SERVICE, m_creature); + DoScriptText(EMOTE_SERVICE, m_creature); return; } @@ -74,7 +74,7 @@ struct TRINITY_DLL_DECL boss_baron_geddonAI : public ScriptedAI if (IgniteMana_Timer < diff) { if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_IGNITEMANA); + DoCast(target,SPELL_IGNITEMANA); IgniteMana_Timer = 30000; }else IgniteMana_Timer -= diff; @@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL boss_baron_geddonAI : public ScriptedAI if (LivingBomb_Timer < diff) { if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_LIVINGBOMB); + DoCast(target,SPELL_LIVINGBOMB); LivingBomb_Timer = 35000; }else LivingBomb_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp index 1001a9240ab..76c19d26436 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp @@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL boss_golemaggAI : public ScriptedAI pInstance = ((ScriptedInstance*)c->GetInstanceData()); Reset(); } - ScriptedInstance *pInstance; + ScriptedInstance *pInstance; uint32 Pyroblast_Timer; uint32 EarthQuake_Timer; @@ -79,7 +79,7 @@ struct TRINITY_DLL_DECL boss_golemaggAI : public ScriptedAI if (Pyroblast_Timer < diff) { if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_PYROBLAST); + DoCast(target,SPELL_PYROBLAST); Pyroblast_Timer = 7000; }else Pyroblast_Timer -= diff; @@ -153,7 +153,7 @@ struct TRINITY_DLL_DECL mob_core_ragerAI : public ScriptedAI if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50 ) { DoCast(m_creature,SPELL_AEGIS); - DoScriptText(EMOTE_AEGIS, m_creature); + DoScriptText(EMOTE_AEGIS, m_creature); } //Check_Timer diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp index cce0a783d44..17d45819a15 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp @@ -54,12 +54,12 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_majordomoAI : public ScriptedAI { boss_majordomoAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } - ScriptedInstance* pInstance; + ScriptedInstance* pInstance; uint32 MagicReflection_Timer; uint32 DamageReflection_Timer; @@ -77,12 +77,12 @@ struct TRINITY_DLL_DECL boss_majordomoAI : public ScriptedAI if (rand()%5) return; - DoScriptText(SAY_SLAY, m_creature); + DoScriptText(SAY_SLAY, m_creature); } void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); } void UpdateAI(const uint32 diff) 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 8c2f65930f5..d4304c6196d 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp @@ -124,7 +124,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI if (rand()%5) return; - DoScriptText(SAY_KILL, m_creature); + DoScriptText(SAY_KILL, m_creature); } void Aggro(Unit *who) @@ -158,7 +158,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI if (rand()%2 == 0) { - DoScriptText(SAY_WRATH, m_creature); + DoScriptText(SAY_WRATH, m_creature); } WrathOfRagnaros_Timer = 30000; @@ -171,7 +171,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI if (rand()%2==0) { - DoScriptText(SAY_HAND, m_creature); + DoScriptText(SAY_HAND, m_creature); } HandOfRagnaros_Timer = 25000; @@ -217,7 +217,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI if (!HasSubmergedOnce) { - DoScriptText(SAY_REINFORCEMENTS1, m_creature); + DoScriptText(SAY_REINFORCEMENTS1, m_creature); // summon 10 elementals Unit* target = NULL; @@ -235,7 +235,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI }else { - DoScriptText(SAY_REINFORCEMENTS2, m_creature); + DoScriptText(SAY_REINFORCEMENTS2, m_creature); Unit* target = NULL; for(int i = 0; i < 9;i++) @@ -272,7 +272,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI if (!HasYelledMagmaBurst) { //Say our dialog - DoScriptText(SAY_MAGMABURST, m_creature); + DoScriptText(SAY_MAGMABURST, m_creature); HasYelledMagmaBurst = true; } diff --git a/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp b/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp index 9069175a5ef..4326315d4c3 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp @@ -40,15 +40,15 @@ EndScriptData */ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance { - instance_molten_core(Map *map) : ScriptedInstance(map) {Initialize();}; + instance_molten_core(Map *map) : ScriptedInstance(map) {Initialize();}; uint64 Lucifron, Magmadar, Gehennas, Garr, Geddon, Shazzrah, Sulfuron, Golemagg, Domo, Ragnaros, FlamewakerPriest; - uint64 RuneKoro, RuneZeth, RuneMazj, RuneTheri, RuneBlaz, RuneKress, RuneMohn; + uint64 RuneKoro, RuneZeth, RuneMazj, RuneTheri, RuneBlaz, RuneKress, RuneMohn; //If all Bosses are dead. bool IsBossDied[9]; - uint32 Encounter[ENCOUNTERS]; + uint32 Encounter[ENCOUNTERS]; void Initialize() { @@ -64,13 +64,13 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance Ragnaros = 0; FlamewakerPriest = 0; - RuneKoro = 0; - RuneZeth = 0; - RuneMazj = 0; - RuneTheri = 0; - RuneBlaz = 0; - RuneKress = 0; - RuneMohn = 0; + RuneKoro = 0; + RuneZeth = 0; + RuneMazj = 0; + RuneTheri = 0; + RuneBlaz = 0; + RuneKress = 0; + RuneMohn = 0; IsBossDied[0] = false; IsBossDied[1] = false; @@ -84,7 +84,7 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance IsBossDied[8] = false; for(uint8 i = 0; i < ENCOUNTERS; i++) - Encounter[i] = NOT_STARTED; + Encounter[i] = NOT_STARTED; } @@ -98,29 +98,29 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance void OnObjectCreate(GameObject *go) { switch(go->GetEntry()) - { - case 176951: //Sulfuron - RuneKoro = go->GetGUID(); - break; - case 176952: //Geddon - RuneZeth = go->GetGUID(); - break; - case 176953: //Shazzrah - RuneMazj = go->GetGUID(); - break; - case 176954: //Golemagg - RuneTheri = go->GetGUID(); - break; - case 176955: //Garr - RuneBlaz = go->GetGUID(); - break; - case 176956: //Magmadar - RuneKress = go->GetGUID(); - break; - case 176957: //Gehennas - RuneMohn = go->GetGUID(); - break; - } + { + case 176951: //Sulfuron + RuneKoro = go->GetGUID(); + break; + case 176952: //Geddon + RuneZeth = go->GetGUID(); + break; + case 176953: //Shazzrah + RuneMazj = go->GetGUID(); + break; + case 176954: //Golemagg + RuneTheri = go->GetGUID(); + break; + case 176955: //Garr + RuneBlaz = go->GetGUID(); + break; + case 176956: //Magmadar + RuneKress = go->GetGUID(); + break; + case 176957: //Gehennas + RuneMohn = go->GetGUID(); + break; + } } @@ -243,11 +243,11 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance return 0; } - void SetData(uint32 type, uint32 data) - { - if (type == DATA_GOLEMAGG_DEATH) - IsBossDied[7] = true; - } + void SetData(uint32 type, uint32 data) + { + if (type == DATA_GOLEMAGG_DEATH) + IsBossDied[7] = true; + } }; InstanceData* GetInstance_instance_molten_core(Map *map) diff --git a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp b/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp index 03d799e30d7..70ce6517c15 100644 --- a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp +++ b/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp @@ -275,9 +275,9 @@ public: uint32 Event_Timer; uint32 checkPlayer_Timer; - uint64 PlayerGUID; + uint64 PlayerGUID; - bool Event_onWait; + bool Event_onWait; void Reset() { @@ -481,7 +481,7 @@ public: case 0: m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2); DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, m_creature, player); - player->CompleteQuest(10965); + player->CompleteQuest(10965); Event_Timer = 1500; Step = 1; break; @@ -563,7 +563,7 @@ void AddSC_moonglade() newscript->pGossipSelect = &GossipSelect_npc_silva_filnaveth; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="npc_clintar_dreamwalker"; newscript->pQuestAccept = &QuestAccept_npc_clintar_dreamwalker; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp b/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp index 8d4d68fe7fb..51bdf5c3af0 100644 --- a/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp +++ b/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp @@ -61,96 +61,96 @@ bool GossipSelect_npc_skorn_whitecloud(Player *player, Creature *_Creature, uint struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI { - npc_kyle_frenziedAI(Creature *c) : ScriptedAI(c) {Reset();} - - int STATE; - uint32 wait; - uint64 player; - - void Reset() - { - STATE = 0; - m_creature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); - m_creature->GetMotionMaster()->Initialize(); - } - void Aggro(Unit* who){} - - void SpellHit(Unit *caster, const SpellEntry* spell) - { // we can feed him without any quest - if(spell->Id == 42222 && caster->GetTypeId() == TYPEID_PLAYER && ((Player*)caster)->GetTeam() == HORDE) - { - STATE = 1; - player = caster->GetGUID(); - float x, y, z, z2; - caster->GetPosition(x, y, z); - x = x + 3.7*cos(caster->GetOrientation()); - y = y + 3.7*sin(caster->GetOrientation()); - z2 = m_creature->GetBaseMap()->GetHeight(x,y,z,false); - z = (z2 <= INVALID_HEIGHT) ? z : z2; - m_creature->SetDefaultMovementType(IDLE_MOTION_TYPE); //there is other way to stop waypoint movement? - m_creature->GetMotionMaster()->Initialize(); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->GetMotionMaster()->MovePoint(0,x, y, z); - } - } + npc_kyle_frenziedAI(Creature *c) : ScriptedAI(c) {Reset();} + + int STATE; + uint32 wait; + uint64 player; + + void Reset() + { + STATE = 0; + m_creature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); + m_creature->GetMotionMaster()->Initialize(); + } + void Aggro(Unit* who){} + + void SpellHit(Unit *caster, const SpellEntry* spell) + { // we can feed him without any quest + if(spell->Id == 42222 && caster->GetTypeId() == TYPEID_PLAYER && ((Player*)caster)->GetTeam() == HORDE) + { + STATE = 1; + player = caster->GetGUID(); + float x, y, z, z2; + caster->GetPosition(x, y, z); + x = x + 3.7*cos(caster->GetOrientation()); + y = y + 3.7*sin(caster->GetOrientation()); + z2 = m_creature->GetBaseMap()->GetHeight(x,y,z,false); + z = (z2 <= INVALID_HEIGHT) ? z : z2; + m_creature->SetDefaultMovementType(IDLE_MOTION_TYPE); //there is other way to stop waypoint movement? + m_creature->GetMotionMaster()->Initialize(); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->GetMotionMaster()->MovePoint(0,x, y, z); + } + } void MovementInform(uint32 type, uint32 id) - { - if(type == POINT_MOTION_TYPE) - { - switch(STATE) - { - case 1: - { - Unit *plr = Unit::GetUnit((*m_creature),player); - if(plr) - m_creature->SetOrientation(m_creature->GetAngle(plr)); - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING); //eat - WorldPacket data; - m_creature->BuildHeartBeatMsg(&data); - m_creature->SendMessageToSet(&data,true); - wait = 3000; - STATE = 2; - break; - } - case 4: - m_creature->setDeathState(JUST_DIED); - m_creature->Respawn(); - break; - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!STATE || STATE == 4) - return; - if(wait < diff) - { - switch(STATE) - { - case 2: - STATE = 3; wait = 7000; - m_creature->UpdateEntry(23622,HORDE); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); - break; - case 3: - STATE = 4; //go home - Unit *plr = Unit::GetUnit((*m_creature),player); - if(plr && ((Player*)plr)->GetQuestStatus(11129) == QUEST_STATUS_INCOMPLETE) - ((Player*)plr)->CompleteQuest(11129); - float x, y, z, z2, angle; - angle = m_creature->GetAngle(-2146, -430); - m_creature->GetPosition(x,y,z); - x = x + 40*cos(angle); - y = y + 40*sin(angle); - z2 = m_creature->GetBaseMap()->GetHeight(x,y,MAX_HEIGHT,false); - z = (z2 <= INVALID_HEIGHT) ? z : z2; - m_creature->GetMotionMaster()->MovePoint(0,x,y,z); - break; - } - }else wait -= diff; - } + { + if(type == POINT_MOTION_TYPE) + { + switch(STATE) + { + case 1: + { + Unit *plr = Unit::GetUnit((*m_creature),player); + if(plr) + m_creature->SetOrientation(m_creature->GetAngle(plr)); + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING); //eat + WorldPacket data; + m_creature->BuildHeartBeatMsg(&data); + m_creature->SendMessageToSet(&data,true); + wait = 3000; + STATE = 2; + break; + } + case 4: + m_creature->setDeathState(JUST_DIED); + m_creature->Respawn(); + break; + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!STATE || STATE == 4) + return; + if(wait < diff) + { + switch(STATE) + { + case 2: + STATE = 3; wait = 7000; + m_creature->UpdateEntry(23622,HORDE); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); + break; + case 3: + STATE = 4; //go home + Unit *plr = Unit::GetUnit((*m_creature),player); + if(plr && ((Player*)plr)->GetQuestStatus(11129) == QUEST_STATUS_INCOMPLETE) + ((Player*)plr)->CompleteQuest(11129); + float x, y, z, z2, angle; + angle = m_creature->GetAngle(-2146, -430); + m_creature->GetPosition(x,y,z); + x = x + 40*cos(angle); + y = y + 40*sin(angle); + z2 = m_creature->GetBaseMap()->GetHeight(x,y,MAX_HEIGHT,false); + z = (z2 <= INVALID_HEIGHT) ? z : z2; + m_creature->GetMotionMaster()->MovePoint(0,x,y,z); + break; + } + }else wait -= diff; + } }; CreatureAI* GetAI_npc_kyle_frenzied(Creature *_Creature) @@ -168,7 +168,7 @@ void AddSC_mulgore() newscript->pGossipSelect = &GossipSelect_npc_skorn_whitecloud; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="npc_kyle_frenzied"; newscript->GetAI = &GetAI_npc_kyle_frenzied; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp index eb601bc7979..e876dc93201 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp @@ -75,24 +75,24 @@ struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI { switch(rand()%3) { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; } } void MoveInLineOfSight(Unit *who) { - if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f)) - { + if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f)) + { switch(rand()%5) { - case 0: DoScriptText(SAY_GREET, m_creature); break; - case 1: DoScriptText(SAY_TAUNT1, m_creature); break; - case 2: DoScriptText(SAY_TAUNT2, m_creature); break; - case 3: DoScriptText(SAY_TAUNT3, m_creature); break; - case 4: DoScriptText(SAY_TAUNT4, m_creature); break; + case 0: DoScriptText(SAY_GREET, m_creature); break; + case 1: DoScriptText(SAY_TAUNT1, m_creature); break; + case 2: DoScriptText(SAY_TAUNT2, m_creature); break; + case 3: DoScriptText(SAY_TAUNT3, m_creature); break; + case 4: DoScriptText(SAY_TAUNT4, m_creature); break; } HasTaunted = true; } @@ -111,8 +111,8 @@ struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI //Do NOT cast it when we are afflicted by locust swarm if (!m_creature->HasAura(SPELL_LOCUSTSWARM,1)) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_IMPALE); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_IMPALE); } Impale_Timer = 15000; diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp index 1df59d08ca5..dcf4d7cab0e 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp @@ -59,22 +59,22 @@ struct TRINITY_DLL_DECL boss_faerlinaAI : public ScriptedAI { switch (rand()%4) { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - case 3: DoScriptText(SAY_AGGRO4, m_creature); break; + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + case 3: DoScriptText(SAY_AGGRO4, m_creature); break; } } void MoveInLineOfSight(Unit *who) { if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f)) - { + { DoScriptText(SAY_GREET, m_creature); HasTaunted = true; } - ScriptedAI::MoveInLineOfSight(who); + ScriptedAI::MoveInLineOfSight(who); } void KilledUnit(Unit* victim) @@ -88,7 +88,7 @@ struct TRINITY_DLL_DECL boss_faerlinaAI : public ScriptedAI void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); } void UpdateAI(const uint32 diff) @@ -106,8 +106,8 @@ struct TRINITY_DLL_DECL boss_faerlinaAI : public ScriptedAI //RainOfFire_Timer if (RainOfFire_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_RAINOFFIRE); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_RAINOFFIRE); RainOfFire_Timer = 16000; }else RainOfFire_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp index bf939da9572..ded2c5bdc71 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp @@ -187,7 +187,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI GuardiansOfIcecrown_Timer = 5000; //5 seconds for summoning each Guardian of Icecrown in phase 3 for(int i=0; i<5; i++) - { + { if(GuardiansOfIcecrown[i]) { //delete creature @@ -196,7 +196,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI pUnit->DealDamage(pUnit, pUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); GuardiansOfIcecrown[i] = 0; } - } + } Phase1_Timer = 310000; //Phase 1 lasts 5 minutes and 10 seconds Phase2 = false; @@ -205,10 +205,10 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI void KilledUnit() { - if (rand()%2) - DoScriptText(SAY_SLAY1, m_creature); - else - DoScriptText(SAY_SLAY2, m_creature); + if (rand()%2) + DoScriptText(SAY_SLAY1, m_creature); + else + DoScriptText(SAY_SLAY2, m_creature); } void JustDied(Unit* Killer) @@ -266,9 +266,9 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI { switch(rand()%3) { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; } } @@ -299,7 +299,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI { //DoCast(m_creature->getVictim(),SPELL_CHAINS_OF_KELTHUZAD); - //if(rand()%2 == 0) + //if(rand()%2 == 0) //DoScriptText(SAY_CHAIN1, m_creature); //else //DoScriptText(SAY_CHAIN2, m_creature); @@ -313,7 +313,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI DoCast(m_creature->getVictim(),SPELL_MANA_DETONATION); if (rand()%2) - DoScriptText(SAY_SPECIAL1_MANA_DET, m_creature); + DoScriptText(SAY_SPECIAL1_MANA_DET, m_creature); ManaDetonation_Timer = 20000; }else ManaDetonation_Timer -= diff; @@ -323,7 +323,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI DoCast(m_creature->getVictim(),SPELL_SHADOW_FISURE); if (rand()%2) - DoScriptText(SAY_SPECIAL3_MANA_DET, m_creature); + DoScriptText(SAY_SPECIAL3_MANA_DET, m_creature); ShadowFisure_Timer = 25000; }else ShadowFisure_Timer -= diff; @@ -334,7 +334,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI DoCast(m_creature->getVictim(),SPELL_FROST_BLAST); if(rand()%2 == 0) - DoScriptText(SAY_FROST_BLAST, m_creature); + DoScriptText(SAY_FROST_BLAST, m_creature); FrostBlast_Timer = (rand()%30+30)*1000; }else FrostBlast_Timer -= diff; @@ -342,7 +342,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI if(!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) { Phase3 = true; - DoScriptText(SAY_REQUEST_AID, m_creature); + DoScriptText(SAY_REQUEST_AID, m_creature); //here Lich King should respond to KelThuzad but I don't know which creature to make talk //so for now just make Kelthuzad says it. DoScriptText(SAY_ANSWER_REQUEST, m_creature); diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp index 57dbe53cc0a..24e4deaf7e5 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp @@ -68,9 +68,9 @@ struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI { switch (rand()%3) { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; } } @@ -78,16 +78,16 @@ struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI { switch (rand()%2) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; } } - void JustSummoned(Creature* summoned) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AddThreat(target,0.0f); - } + void JustSummoned(Creature* summoned) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AddThreat(target,0.0f); + } void JustDied(Unit* Killer) { @@ -120,8 +120,8 @@ struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI { DoScriptText(SAY_SUMMON, m_creature); - for(uint8 i = 0; i < 6; i++) - m_creature->SummonCreature(C_PLAGUED_WARRIOR,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); + for(uint8 i = 0; i < 6; i++) + m_creature->SummonCreature(C_PLAGUED_WARRIOR,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); Summon_Timer = 30500; } else Summon_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp index 2c28cf0d438..8529ba85a77 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp @@ -88,15 +88,15 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI if(LifeDrain_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_LIFE_DRAIN); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_LIFE_DRAIN); LifeDrain_Timer = 24000; }else LifeDrain_Timer -= diff; if(Blizzard_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_BLIZZARD); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_BLIZZARD); Blizzard_Timer = 20000; }else Blizzard_Timer -= diff; @@ -117,14 +117,14 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI landoff = false; }else Fly_Timer -= diff; } - } + } if (phase == 2) { if(Icebolt_Timer < diff && Icebolt_Count < 5) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ICEBOLT); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ICEBOLT); Icebolt_Count ++; Icebolt_Timer = 4000; }else Icebolt_Timer -= diff; @@ -167,7 +167,7 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI } if (phase!=2) - DoMeleeAttackIfReady(); + DoMeleeAttackIfReady(); } }; diff --git a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp index ba98121757c..fc27da1b649 100644 --- a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp +++ b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp @@ -356,323 +356,323 @@ bool GOHello_go_manaforge_control_console(Player *player, GameObject* _GO) // Entries of Arcanist Ardonis, Commander Dawnforge, Pathaleon the Curators Image int CreatureEntry[3][1] = { - {19830}, // Ardonis - {19831}, // Dawnforge - {21504} // Pathaleon + {19830}, // Ardonis + {19831}, // Dawnforge + {21504} // Pathaleon }; struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI { - npc_commander_dawnforgeAI(Creature *c) : ScriptedAI(c) { Reset (); } + npc_commander_dawnforgeAI(Creature *c) : ScriptedAI(c) { Reset (); } - uint64 playerGUID; - uint64 ardonisGUID; - uint64 pathaleonGUID; - - - uint32 Phase; - uint32 PhaseSubphase; - uint32 Phase_Timer; - bool isEvent; - - float angle_dawnforge; - float angle_ardonis; - - void Reset() - { - playerGUID = 0; - ardonisGUID = 0; - pathaleonGUID = 0; - - Phase = 1; - PhaseSubphase = 0; - Phase_Timer = 4000; - isEvent = false; - } - - void Aggro(Unit *who) { } - - //Select any creature in a grid - Creature* SelectCreatureInGrid(uint32 entry, float range) - { - Creature* pCreature = NULL; - - CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*m_creature, entry, true, range); - Trinity::CreatureLastSearcher searcher(pCreature, creature_check); - - TypeContainerVisitor, GridTypeMapContainer> creature_searcher(searcher); - - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, creature_searcher,*(m_creature->GetMap())); - - return pCreature; - } - - void JustSummoned(Creature *summoned) - { - pathaleonGUID = summoned->GetGUID(); - } - - // Emote Ardonis and Pathaleon - void Turn_to_Pathaleons_Image() - { - Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID); - Unit *pathaleon = Unit::GetUnit(*m_creature,pathaleonGUID); - Player *player = (Player*)Unit::GetUnit(*m_creature,playerGUID); - - if (!ardonis || !pathaleon || !player) - return; - - //Calculate the angle to Pathaleon - angle_dawnforge = m_creature->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY()); - angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY()); - - //Turn Dawnforge and update - m_creature->SetOrientation(angle_dawnforge); - m_creature->SendUpdateToPlayer(player); - //Turn Ardonis and update - ardonis->SetOrientation(angle_ardonis); - ardonis->SendUpdateToPlayer(player); - - //Set them to kneel - m_creature->SetStandState(PLAYER_STATE_KNEEL); - ardonis->SetStandState(PLAYER_STATE_KNEEL); - } - - //Set them back to each other - void Turn_to_eachother() - { - if (Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID)) - { - Player *player = (Player*)Unit::GetUnit(*m_creature,playerGUID); - - if (!player) - return; - - angle_dawnforge = m_creature->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY()); - angle_ardonis = ardonis->GetAngle(m_creature->GetPositionX(), m_creature->GetPositionY()); - - //Turn Dawnforge and update - m_creature->SetOrientation(angle_dawnforge); - m_creature->SendUpdateToPlayer(player); - //Turn Ardonis and update - ardonis->SetOrientation(angle_ardonis); - ardonis->SendUpdateToPlayer(player); - - //Set state - m_creature->SetStandState(PLAYER_STATE_NONE); - ardonis->SetStandState(PLAYER_STATE_NONE); - } - } - - bool CanStartEvent(Player *player) - { - if (!isEvent) - { - Creature *ardonis = SelectCreatureInGrid(CreatureEntry[0][0], 10.0f); - if (!ardonis) - return false; - - ardonisGUID = ardonis->GetGUID(); - playerGUID = player->GetGUID(); - - isEvent = true; - - Turn_to_eachother(); - return true; - } - - debug_log("TSCR: npc_commander_dawnforge event already in progress, need to wait."); - return false; - } - - void UpdateAI(const uint32 diff) - { - //Is event even running? - if (!isEvent) - return; - - //Phase timing - if (Phase_Timer >= diff) - { - Phase_Timer -= diff; - return; - } - - Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID); - Unit *pathaleon = Unit::GetUnit(*m_creature,pathaleonGUID); - Player *player = (Player*)Unit::GetUnit(*m_creature,playerGUID); - - if (!ardonis || !player) - { - Reset(); - return; - } - - if (Phase > 4 && !pathaleon) - { - Reset(); - return; - } - - //Phase 1 Dawnforge say - switch (Phase) - { - case 1: - DoScriptText(SAY_COMMANDER_DAWNFORGE_1, m_creature); - ++Phase; - Phase_Timer = 16000; - break; - //Phase 2 Ardonis say - case 2: - DoScriptText(SAY_ARCANIST_ARDONIS_1, ardonis); - ++Phase; - Phase_Timer = 16000; - break; - //Phase 3 Dawnforge say - case 3: - DoScriptText(SAY_COMMANDER_DAWNFORGE_2, m_creature); - ++Phase; - Phase_Timer = 16000; - break; - //Phase 4 Pathaleon spawns up to phase 9 - case 4: - //spawn pathaleon's image - m_creature->SummonCreature(CreatureEntry[2][0], 2325.851563, 2799.534668, 133.084229, 6.038996, TEMPSUMMON_TIMED_DESPAWN, 90000); - ++Phase; - Phase_Timer = 500; - break; - //Phase 5 Pathaleon say - case 5: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_1, pathaleon); - ++Phase; - Phase_Timer = 6000; - break; - //Phase 6 - case 6: - switch(PhaseSubphase) - { - //Subphase 1: Turn Dawnforge and Ardonis - case 0: - Turn_to_Pathaleons_Image(); - ++PhaseSubphase; - Phase_Timer = 8000; - break; - //Subphase 2 Dawnforge say - case 1: - DoScriptText(SAY_COMMANDER_DAWNFORGE_3, m_creature); - PhaseSubphase = 0; - ++Phase; - Phase_Timer = 8000; - break; - } - break; - //Phase 7 Pathaleons say 3 Sentence, every sentence need a subphase - case 7: - switch(PhaseSubphase) - { - //Subphase 1 - case 0: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2, pathaleon); - ++PhaseSubphase; - Phase_Timer = 12000; - break; - //Subphase 2 - case 1: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_1, pathaleon); - ++PhaseSubphase; - Phase_Timer = 16000; - break; - //Subphase 3 - case 2: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_2, pathaleon); - PhaseSubphase = 0; - ++Phase; - Phase_Timer = 10000; - break; - } - break; - //Phase 8 Dawnforge & Ardonis say - case 8: - DoScriptText(SAY_COMMANDER_DAWNFORGE_4, m_creature); - DoScriptText(SAY_ARCANIST_ARDONIS_2, ardonis); - ++Phase; - Phase_Timer = 4000; - break; - //Phase 9 Pathaleons Despawn, Reset Dawnforge & Ardonis angle - case 9: - Turn_to_eachother(); - //hide pathaleon, unit will despawn shortly - pathaleon->SetVisibility(VISIBILITY_OFF); - PhaseSubphase = 0; - ++Phase; - Phase_Timer = 3000; - break; - //Phase 10 Dawnforge say - case 10: - DoScriptText(SAY_COMMANDER_DAWNFORGE_5, m_creature); - player->AreaExploredOrEventHappens(QUEST_INFO_GATHERING); - Reset(); - break; - } - } + uint64 playerGUID; + uint64 ardonisGUID; + uint64 pathaleonGUID; + + + uint32 Phase; + uint32 PhaseSubphase; + uint32 Phase_Timer; + bool isEvent; + + float angle_dawnforge; + float angle_ardonis; + + void Reset() + { + playerGUID = 0; + ardonisGUID = 0; + pathaleonGUID = 0; + + Phase = 1; + PhaseSubphase = 0; + Phase_Timer = 4000; + isEvent = false; + } + + void Aggro(Unit *who) { } + + //Select any creature in a grid + Creature* SelectCreatureInGrid(uint32 entry, float range) + { + Creature* pCreature = NULL; + + CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*m_creature, entry, true, range); + Trinity::CreatureLastSearcher searcher(pCreature, creature_check); + + TypeContainerVisitor, GridTypeMapContainer> creature_searcher(searcher); + + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, creature_searcher,*(m_creature->GetMap())); + + return pCreature; + } + + void JustSummoned(Creature *summoned) + { + pathaleonGUID = summoned->GetGUID(); + } + + // Emote Ardonis and Pathaleon + void Turn_to_Pathaleons_Image() + { + Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID); + Unit *pathaleon = Unit::GetUnit(*m_creature,pathaleonGUID); + Player *player = (Player*)Unit::GetUnit(*m_creature,playerGUID); + + if (!ardonis || !pathaleon || !player) + return; + + //Calculate the angle to Pathaleon + angle_dawnforge = m_creature->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY()); + angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY()); + + //Turn Dawnforge and update + m_creature->SetOrientation(angle_dawnforge); + m_creature->SendUpdateToPlayer(player); + //Turn Ardonis and update + ardonis->SetOrientation(angle_ardonis); + ardonis->SendUpdateToPlayer(player); + + //Set them to kneel + m_creature->SetStandState(PLAYER_STATE_KNEEL); + ardonis->SetStandState(PLAYER_STATE_KNEEL); + } + + //Set them back to each other + void Turn_to_eachother() + { + if (Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID)) + { + Player *player = (Player*)Unit::GetUnit(*m_creature,playerGUID); + + if (!player) + return; + + angle_dawnforge = m_creature->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY()); + angle_ardonis = ardonis->GetAngle(m_creature->GetPositionX(), m_creature->GetPositionY()); + + //Turn Dawnforge and update + m_creature->SetOrientation(angle_dawnforge); + m_creature->SendUpdateToPlayer(player); + //Turn Ardonis and update + ardonis->SetOrientation(angle_ardonis); + ardonis->SendUpdateToPlayer(player); + + //Set state + m_creature->SetStandState(PLAYER_STATE_NONE); + ardonis->SetStandState(PLAYER_STATE_NONE); + } + } + + bool CanStartEvent(Player *player) + { + if (!isEvent) + { + Creature *ardonis = SelectCreatureInGrid(CreatureEntry[0][0], 10.0f); + if (!ardonis) + return false; + + ardonisGUID = ardonis->GetGUID(); + playerGUID = player->GetGUID(); + + isEvent = true; + + Turn_to_eachother(); + return true; + } + + debug_log("TSCR: npc_commander_dawnforge event already in progress, need to wait."); + return false; + } + + void UpdateAI(const uint32 diff) + { + //Is event even running? + if (!isEvent) + return; + + //Phase timing + if (Phase_Timer >= diff) + { + Phase_Timer -= diff; + return; + } + + Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID); + Unit *pathaleon = Unit::GetUnit(*m_creature,pathaleonGUID); + Player *player = (Player*)Unit::GetUnit(*m_creature,playerGUID); + + if (!ardonis || !player) + { + Reset(); + return; + } + + if (Phase > 4 && !pathaleon) + { + Reset(); + return; + } + + //Phase 1 Dawnforge say + switch (Phase) + { + case 1: + DoScriptText(SAY_COMMANDER_DAWNFORGE_1, m_creature); + ++Phase; + Phase_Timer = 16000; + break; + //Phase 2 Ardonis say + case 2: + DoScriptText(SAY_ARCANIST_ARDONIS_1, ardonis); + ++Phase; + Phase_Timer = 16000; + break; + //Phase 3 Dawnforge say + case 3: + DoScriptText(SAY_COMMANDER_DAWNFORGE_2, m_creature); + ++Phase; + Phase_Timer = 16000; + break; + //Phase 4 Pathaleon spawns up to phase 9 + case 4: + //spawn pathaleon's image + m_creature->SummonCreature(CreatureEntry[2][0], 2325.851563, 2799.534668, 133.084229, 6.038996, TEMPSUMMON_TIMED_DESPAWN, 90000); + ++Phase; + Phase_Timer = 500; + break; + //Phase 5 Pathaleon say + case 5: + DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_1, pathaleon); + ++Phase; + Phase_Timer = 6000; + break; + //Phase 6 + case 6: + switch(PhaseSubphase) + { + //Subphase 1: Turn Dawnforge and Ardonis + case 0: + Turn_to_Pathaleons_Image(); + ++PhaseSubphase; + Phase_Timer = 8000; + break; + //Subphase 2 Dawnforge say + case 1: + DoScriptText(SAY_COMMANDER_DAWNFORGE_3, m_creature); + PhaseSubphase = 0; + ++Phase; + Phase_Timer = 8000; + break; + } + break; + //Phase 7 Pathaleons say 3 Sentence, every sentence need a subphase + case 7: + switch(PhaseSubphase) + { + //Subphase 1 + case 0: + DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2, pathaleon); + ++PhaseSubphase; + Phase_Timer = 12000; + break; + //Subphase 2 + case 1: + DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_1, pathaleon); + ++PhaseSubphase; + Phase_Timer = 16000; + break; + //Subphase 3 + case 2: + DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_2, pathaleon); + PhaseSubphase = 0; + ++Phase; + Phase_Timer = 10000; + break; + } + break; + //Phase 8 Dawnforge & Ardonis say + case 8: + DoScriptText(SAY_COMMANDER_DAWNFORGE_4, m_creature); + DoScriptText(SAY_ARCANIST_ARDONIS_2, ardonis); + ++Phase; + Phase_Timer = 4000; + break; + //Phase 9 Pathaleons Despawn, Reset Dawnforge & Ardonis angle + case 9: + Turn_to_eachother(); + //hide pathaleon, unit will despawn shortly + pathaleon->SetVisibility(VISIBILITY_OFF); + PhaseSubphase = 0; + ++Phase; + Phase_Timer = 3000; + break; + //Phase 10 Dawnforge say + case 10: + DoScriptText(SAY_COMMANDER_DAWNFORGE_5, m_creature); + player->AreaExploredOrEventHappens(QUEST_INFO_GATHERING); + Reset(); + break; + } + } }; CreatureAI* GetAI_npc_commander_dawnforge(Creature* _Creature) { - return new npc_commander_dawnforgeAI(_Creature); + return new npc_commander_dawnforgeAI(_Creature); } Creature* SearchDawnforge(Player *source, uint32 entry, float range) { - Creature* pCreature = NULL; + Creature* pCreature = NULL; - CellPair pair(Trinity::ComputeCellPair(source->GetPositionX(), source->GetPositionY())); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); + CellPair pair(Trinity::ComputeCellPair(source->GetPositionX(), source->GetPositionY())); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); - Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*source, entry, true, range); - Trinity::CreatureLastSearcher searcher(pCreature, creature_check); + Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*source, entry, true, range); + Trinity::CreatureLastSearcher searcher(pCreature, creature_check); - TypeContainerVisitor, GridTypeMapContainer> creature_searcher(searcher); + TypeContainerVisitor, GridTypeMapContainer> creature_searcher(searcher); - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, creature_searcher,*(source->GetMap())); + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, creature_searcher,*(source->GetMap())); - return pCreature; + return pCreature; } bool AreaTrigger_at_commander_dawnforge(Player *player, AreaTriggerEntry *at) { - //if player lost aura or not have at all, we should not try start event. - if (!player->HasAura(SPELL_SUNFURY_DISGUISE,0)) - return false; + //if player lost aura or not have at all, we should not try start event. + if (!player->HasAura(SPELL_SUNFURY_DISGUISE,0)) + return false; - if (player->isAlive() && player->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE) - { - Creature* Dawnforge = SearchDawnforge(player, CreatureEntry[1][0], 30.0f); + if (player->isAlive() && player->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE) + { + Creature* Dawnforge = SearchDawnforge(player, CreatureEntry[1][0], 30.0f); - if (!Dawnforge) - return false; + if (!Dawnforge) + return false; - if (((npc_commander_dawnforgeAI*)Dawnforge->AI())->CanStartEvent(player)) - return true; - } - return false; + if (((npc_commander_dawnforgeAI*)Dawnforge->AI())->CanStartEvent(player)) + return true; + } + return false; } /*###### ## npc_protectorate_nether_drake ######*/ -#define GOSSIP_ITEM "I'm ready to fly! Take me up, dragon!" +#define GOSSIP_ITEM "I'm ready to fly! Take me up, dragon!" bool GossipHello_npc_protectorate_nether_drake(Player *player, Creature *_Creature) { @@ -705,43 +705,43 @@ bool GossipSelect_npc_protectorate_nether_drake(Player *player, Creature *_Creat ## npc_professor_dabiri ######*/ -#define SPELL_PHASE_DISTRUPTOR 35780 -#define GOSSIP_ITEM "I need a new phase distruptor, Professor" +#define SPELL_PHASE_DISTRUPTOR 35780 +#define GOSSIP_ITEM "I need a new phase distruptor, Professor" #define WHISPER_DABIRI -1000302 -#define QUEST_DIMENSIUS 10439 +#define QUEST_DIMENSIUS 10439 #define QUEST_ON_NETHERY_WINGS 10438 bool GossipHello_npc_professor_dabiri(Player *player, Creature *_Creature) { - if (_Creature->isQuestGiver()) + if (_Creature->isQuestGiver()) player->PrepareQuestMenu( _Creature->GetGUID() ); - if(player->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(29778, 1)) - player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + if(player->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(29778, 1)) + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); + player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); - return true; + return true; } bool GossipSelect_npc_professor_dabiri(Player *player, Creature *_Creature, uint32 sender, uint32 action ) { - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - _Creature->CastSpell(player, SPELL_PHASE_DISTRUPTOR, false); - player->CLOSE_GOSSIP_MENU(); - } + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + _Creature->CastSpell(player, SPELL_PHASE_DISTRUPTOR, false); + player->CLOSE_GOSSIP_MENU(); + } - return true; + return true; } bool QuestAccept_npc_professor_dabiri(Player *player, Creature *creature, Quest const *quest ) { - if(quest->GetQuestId() == QUEST_DIMENSIUS) - DoScriptText(WHISPER_DABIRI, creature, player); + if(quest->GetQuestId() == QUEST_DIMENSIUS) + DoScriptText(WHISPER_DABIRI, creature, player); - return true; + return true; } /*###### @@ -911,7 +911,7 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI bool Completed; - void JustDied(Unit* killer) + void JustDied(Unit* killer) { if (PlayerGUID) { @@ -928,12 +928,12 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI return; switch(i) - { + { case 3: //first spawn m_creature->SummonCreature(SPAWN_FIRST, 2449.67, 2183.11, 96.85, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); m_creature->SummonCreature(SPAWN_FIRST, 2449.53, 2184.43, 96.36, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); m_creature->SummonCreature(SPAWN_FIRST, 2449.85, 2186.34, 97.57, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; + break; case 7: m_creature->SummonCreature(SPAWN_SECOND, 2309.64, 2186.24, 92.25, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); @@ -947,16 +947,16 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI Completed = true; } {Unit* Thadell = FindCreature(N_THADELL, 30, m_creature); - if(Thadell) + if(Thadell) DoScriptText(SAY_THADELL_1, m_creature);}break; - case 13: - {Unit* Thadell = FindCreature(N_THADELL, 30, m_creature); - if(Thadell) + case 13: + {Unit* Thadell = FindCreature(N_THADELL, 30, m_creature); + if(Thadell) DoScriptText(SAY_THADELL_2, m_creature, player);}break; - } + } } - void JustSummoned(Creature* summoned) + void JustSummoned(Creature* summoned) { summoned->AI()->AttackStart(m_creature); } @@ -980,8 +980,8 @@ bool QuestAccept_npc_bessy(Player* player, Creature* creature, Quest const* ques { if (quest->GetQuestId() == Q_ALMABTRIEB) { - creature->setFaction(113); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + creature->setFaction(113); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; @@ -1004,7 +1004,7 @@ CreatureAI* GetAI_npc_bessy(Creature *_Creature) bessyAI->AddWaypoint(10, 2304.58, 2272.23, 96.67); bessyAI->AddWaypoint(11, 2297.09, 2271.40, 95.16); bessyAI->AddWaypoint(12, 2297.68, 2266.79, 95.07,4000); - bessyAI->AddWaypoint(13, 2297.67, 2266.76, 95.07,4000); + bessyAI->AddWaypoint(13, 2297.67, 2266.76, 95.07,4000); return (CreatureAI*)bessyAI; } @@ -1027,15 +1027,15 @@ void AddSC_netherstorm() newscript->GetAI = &GetAI_npc_manaforge_control_console; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "npc_commander_dawnforge"; - newscript->GetAI = &GetAI_npc_commander_dawnforge; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_commander_dawnforge"; + newscript->GetAI = &GetAI_npc_commander_dawnforge; + newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "at_commander_dawnforge"; - newscript->pAreaTrigger = &AreaTrigger_at_commander_dawnforge; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "at_commander_dawnforge"; + newscript->pAreaTrigger = &AreaTrigger_at_commander_dawnforge; + newscript->RegisterSelf(); newscript = new Script; newscript->Name="npc_protectorate_nether_drake"; @@ -1043,12 +1043,12 @@ void AddSC_netherstorm() newscript->pGossipSelect = &GossipSelect_npc_protectorate_nether_drake; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "npc_professor_dabiri"; - newscript->pGossipHello = &GossipHello_npc_professor_dabiri; + newscript = new Script; + newscript->Name = "npc_professor_dabiri"; + newscript->pGossipHello = &GossipHello_npc_professor_dabiri; newscript->pGossipSelect = &GossipSelect_npc_professor_dabiri; - newscript->pQuestAccept = &QuestAccept_npc_professor_dabiri; - newscript->RegisterSelf(); + newscript->pQuestAccept = &QuestAccept_npc_professor_dabiri; + newscript->RegisterSelf(); newscript = new Script; newscript->Name="npc_veronia"; @@ -1061,7 +1061,7 @@ void AddSC_netherstorm() newscript->GetAI = &GetAI_mob_phase_hunter; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name = "npc_bessy"; newscript->GetAI = &GetAI_npc_bessy; newscript->pQuestAccept = &QuestAccept_npc_bessy; diff --git a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp index 8a0342cb116..c621ebf566c 100644 --- a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp +++ b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp @@ -40,7 +40,7 @@ EndScriptData */ #define SPELL_FIREBALL 18392 #define SPELL_BELLOWINGROAR 18431 -#define SPELL_HEATED_GROUND 22191 //Wrong Spell +#define SPELL_HEATED_GROUND 22191 //Wrong Spell #define SPELL_SUMMONWHELP 17646 @@ -76,10 +76,10 @@ struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI uint32 SummonWhelpsTimer; uint32 BellowingRoarTimer; uint32 WingBuffetTimer; - uint32 KnockAwayTimer; - uint32 FireballTimer; + uint32 KnockAwayTimer; + uint32 FireballTimer; - bool InitialSpawn; + bool InitialSpawn; void Reset() { @@ -93,24 +93,24 @@ struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI SummonWhelpsTimer = 45000; BellowingRoarTimer = 30000; WingBuffetTimer = 17000; - KnockAwayTimer = 15000; - FireballTimer = 18000; + KnockAwayTimer = 15000; + FireballTimer = 18000; - InitialSpawn = true; + InitialSpawn = true; - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); } - void Aggro(Unit* who) + void Aggro(Unit* who) { DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); + DoZoneInCombat(); } - void JustDied(Unit* Killer) + void JustDied(Unit* Killer) { - } + } void KilledUnit(Unit *victim) { @@ -122,30 +122,30 @@ struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI if(!UpdateVictim()) return; - if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 60) && (Phase == 1)) + if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 60) && (Phase == 1)) { - Phase = 2; - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + Phase = 2; + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); - m_creature->SetHover(true); + m_creature->SetHover(true); m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->MoveIdle(); - DoScriptText(SAY_PHASE_2_TRANS, m_creature); - } + DoScriptText(SAY_PHASE_2_TRANS, m_creature); + } - if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) && (Phase == 2)) + if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) && (Phase == 2)) { - Phase = 3; + Phase = 3; m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - m_creature->SetHover(false); - m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344); - DoStartMovement(m_creature->getVictim()); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->SetHover(false); + m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344); + DoStartMovement(m_creature->getVictim()); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); DoScriptText(SAY_PHASE_3_TRANS, m_creature); - } + } - if(Phase == 1 || Phase == 3) + if(Phase == 1 || Phase == 3) { if(FlameBreathTimer < diff) { @@ -174,75 +174,75 @@ struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI WingBuffetTimer = 7000 + ((rand()%8)*1000); }else WingBuffetTimer -= diff; - if(KnockAwayTimer < diff) - { - if(rand() <= 30) - { - DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); - } - KnockAwayTimer = 15000; - }else KnockAwayTimer -= diff; - - if(Phase == 3) - { - if(BellowingRoarTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR); + if(KnockAwayTimer < diff) + { + if(rand() <= 30) + { + DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); + } + KnockAwayTimer = 15000; + }else KnockAwayTimer -= diff; + + if(Phase == 3) + { + if(BellowingRoarTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR); - BellowingRoarTimer = 30000; - }else BellowingRoarTimer -= diff; + BellowingRoarTimer = 30000; + }else BellowingRoarTimer -= diff; - if(SummonWhelpsTimer < diff) - { - SummonWhelps(Phase); + if(SummonWhelpsTimer < diff) + { + SummonWhelps(Phase); - SummonWhelpsTimer = 45000; - }else SummonWhelpsTimer -= diff; - } + SummonWhelpsTimer = 45000; + }else SummonWhelpsTimer -= diff; + } - DoMeleeAttackIfReady(); - } + DoMeleeAttackIfReady(); + } - if(Phase == 2) + if(Phase == 2) { - if(InitialSpawn) - { - InitialSpawn = false; - - for(uint32 i = 0; i < 10; ++i) - { - uint32 random = rand()%4; - Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if(Whelp) - Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - - if(EngulfingFlamesTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_ENGULFINGFLAMES); - m_creature->HandleEmoteCommand(ANIM_FLY); - - EngulfingFlamesTimer = 10000; - } - else EngulfingFlamesTimer -= diff; - - if(FireballTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); - - FireballTimer = 18000; - } - else FireballTimer -= diff; - - if(MovementTimer < diff) + if(InitialSpawn) + { + InitialSpawn = false; + + for(uint32 i = 0; i < 10; ++i) + { + uint32 random = rand()%4; + Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if(Whelp) + Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + + if(EngulfingFlamesTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_ENGULFINGFLAMES); + m_creature->HandleEmoteCommand(ANIM_FLY); + + EngulfingFlamesTimer = 10000; + } + else EngulfingFlamesTimer -= diff; + + if(FireballTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); + + FireballTimer = 18000; + } + else FireballTimer -= diff; + + if(MovementTimer < diff) { - if(rand()%100 < 30) - { - DoScriptText(EMOTE_BREATH, m_creature); - DoCast(m_creature->getVictim(), SPELL_DEEPBREATH); - } - else ChangePosition(); + if(rand()%100 < 30) + { + DoScriptText(EMOTE_BREATH, m_creature); + DoCast(m_creature->getVictim(), SPELL_DEEPBREATH); + } + else ChangePosition(); MovementTimer = 25000; }else MovementTimer -= diff; @@ -253,46 +253,46 @@ struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI SummonWhelpsTimer = 45000; } - else SummonWhelpsTimer -= diff; - } - } - - void ChangePosition() - { - uint32 random = rand() % 4; - if(random<4){ - m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);} - } - - void SummonWhelps(uint32 Phase) - { - if(Phase == 2) - { - uint32 max = rand()%10; - for(uint32 i = 0; i < max; ++i) - { - uint32 random = rand()%3; - Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if(Whelp) - Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - - if(Phase == 3) - { - uint32 max = rand() % 10 +1; - if(max < 5) - { - for(uint32 i = 0; i < max; ++i) - { - uint32 random = rand()%4; - Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if(Whelp) - Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - } - } + else SummonWhelpsTimer -= diff; + } + } + + void ChangePosition() + { + uint32 random = rand() % 4; + if(random<4){ + m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);} + } + + void SummonWhelps(uint32 Phase) + { + if(Phase == 2) + { + uint32 max = rand()%10; + for(uint32 i = 0; i < max; ++i) + { + uint32 random = rand()%3; + Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if(Whelp) + Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + + if(Phase == 3) + { + uint32 max = rand() % 10 +1; + if(max < 5) + { + for(uint32 i = 0; i < max; ++i) + { + uint32 random = rand()%4; + Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if(Whelp) + Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + } + } }; CreatureAI* GetAI_boss_onyxiaAI(Creature *_Creature) diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp index e6336122406..2b148b2e730 100644 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp +++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp @@ -54,7 +54,7 @@ struct TRINITY_DLL_DECL boss_moamAI : public ScriptedAI void Aggro(Unit *who) { - DoScriptText(EMOTE_AGGRO, m_creature); + DoScriptText(EMOTE_AGGRO, m_creature); pTarget = who; } @@ -67,7 +67,7 @@ struct TRINITY_DLL_DECL boss_moamAI : public ScriptedAI //if (j==1 && m_creature->GetMana()*100 / m_creature->GetMaxMana() == 100 && !m_creature->IsNonMeleeSpellCasted(false)) { DoCast(m_creature->getVictim(),SPELL_ARCANEERUPTION); - DoScriptText(EMOTE_MANA_FULL, m_creature); + DoScriptText(EMOTE_MANA_FULL, m_creature); } //If we are <50%HP cast MANA FIEND (Summon Mana) and Sleep diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp index fd8b070f50a..66270e79539 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp @@ -25,59 +25,59 @@ EndScriptData */ #include "SpellMgr.h" #include "def_scarlet_monastery.h" -#define SAY_ENTRANCE -1189001 -#define SAY_REJOINED -1189002 -#define SAY_LOST_HEAD -1189003 -#define SAY_CONFLAGRATION -1189004 -#define SAY_SPROUTING_PUMPKINS -1189005 -#define SAY_PLAYER_DEATH -1189006 -#define SAY_DEATH -1189007 +#define SAY_ENTRANCE -1189001 +#define SAY_REJOINED -1189002 +#define SAY_LOST_HEAD -1189003 +#define SAY_CONFLAGRATION -1189004 +#define SAY_SPROUTING_PUMPKINS -1189005 +#define SAY_PLAYER_DEATH -1189006 +#define SAY_DEATH -1189007 uint32 RandomLaught[] = {11965, 11975, 11976}; - // Entryes -#define HH_MOUNTED 23682 -#define HH_UNHORSED 23800 -#define HEAD 23775 -#define PULSING_PUMPKIN 23694 -#define PUMPKIN_FIEND 23545 -#define HELPER 23686 -#define WISP_INVIS 24034 - - //Spells -#define SPELL_CLEAVE 42587 -#define SPELL_CONFLAGRATION 42380 //Phase 2, can't find real spell(Dim Fire?) -//#define SPELL_CONFL_SPEED 22587 //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell? -#define SPELL_SUMMON_PUMPKIN 42394 - -#define SPELL_WHIRLWIND 43116 -#define SPELL_IMMUNE 42556 -#define SPELL_BODY_REGEN 42403 -#define SPELL_CONFUSE 43105 - -#define SPELL_FLYING_HEAD 42399 //visual flying head -#define SPELL_HEAD 42413 //visual buff, "head" -#define SPELL_HEAD_IS_DEAD 42428 //at killing head, Phase 3 - -#define SPELL_PUMPKIN_AURA 42280 -#define SPELL_PUMPKIN_AURA_GREEN 42294 -#define SPELL_SQUASH_SOUL 42514 -#define SPELL_SPROUTING 42281 -#define SPELL_SPROUT_BODY 42285 - - //Effects -#define SPELL_RHYME_BIG 42909 -//#define SPELL_RHYME_SMALL 42910 -#define SPELL_HEAD_SPEAKS 43129 -#define SPELL_HEAD_LANDS 42400 -#define SPELL_BODY_FLAME 42074 -#define SPELL_HEAD_FLAME 42971 -//#define SPELL_ENRAGE_VISUAL 42438 // he uses this spell? -#define SPELL_WISP_BLUE 42821 -#define SPELL_WISP_FLIGHT_PORT 42818 -//#define SPELL_WISP_INVIS 42823 -#define SPELL_SMOKE 42355 -#define SPELL_DEATH 42566 //not correct spell + // Entryes +#define HH_MOUNTED 23682 +#define HH_UNHORSED 23800 +#define HEAD 23775 +#define PULSING_PUMPKIN 23694 +#define PUMPKIN_FIEND 23545 +#define HELPER 23686 +#define WISP_INVIS 24034 + + //Spells +#define SPELL_CLEAVE 42587 +#define SPELL_CONFLAGRATION 42380 //Phase 2, can't find real spell(Dim Fire?) +//#define SPELL_CONFL_SPEED 22587 //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell? +#define SPELL_SUMMON_PUMPKIN 42394 + +#define SPELL_WHIRLWIND 43116 +#define SPELL_IMMUNE 42556 +#define SPELL_BODY_REGEN 42403 +#define SPELL_CONFUSE 43105 + +#define SPELL_FLYING_HEAD 42399 //visual flying head +#define SPELL_HEAD 42413 //visual buff, "head" +#define SPELL_HEAD_IS_DEAD 42428 //at killing head, Phase 3 + +#define SPELL_PUMPKIN_AURA 42280 +#define SPELL_PUMPKIN_AURA_GREEN 42294 +#define SPELL_SQUASH_SOUL 42514 +#define SPELL_SPROUTING 42281 +#define SPELL_SPROUT_BODY 42285 + + //Effects +#define SPELL_RHYME_BIG 42909 +//#define SPELL_RHYME_SMALL 42910 +#define SPELL_HEAD_SPEAKS 43129 +#define SPELL_HEAD_LANDS 42400 +#define SPELL_BODY_FLAME 42074 +#define SPELL_HEAD_FLAME 42971 +//#define SPELL_ENRAGE_VISUAL 42438 // he uses this spell? +#define SPELL_WISP_BLUE 42821 +#define SPELL_WISP_FLIGHT_PORT 42818 +//#define SPELL_WISP_INVIS 42823 +#define SPELL_SMOKE 42355 +#define SPELL_DEATH 42566 //not correct spell struct Locations { @@ -86,397 +86,397 @@ struct Locations static Locations FlightPoint[]= { - {1754.00,1346.00,17.50}, - {1765.00,1347.00,19.00}, - {1784.00,1346.80,25.40}, - {1803.30,1347.60,33.00}, - {1824.00,1350.00,42.60}, - {1838.80,1353.20,49.80}, - {1852.00,1357.60,55.70}, - {1861.30,1364.00,59.40}, - {1866.30,1374.80,61.70}, - {1864.00,1387.30,63.20}, - {1854.80,1399.40,64.10}, - {1844.00,1406.90,64.10}, - {1824.30,1411.40,63.30}, - {1801.00,1412.30,60.40}, - {1782.00,1410.10,55.50}, - {1770.50,1405.20,50.30}, - {1765.20,1400.70,46.60}, - {1761.40,1393.40,41.70}, - {1759.10,1386.70,36.60}, - {1757.80,1378.20,29.00}, - {1758.00,1367.00,19.51} + {1754.00,1346.00,17.50}, + {1765.00,1347.00,19.00}, + {1784.00,1346.80,25.40}, + {1803.30,1347.60,33.00}, + {1824.00,1350.00,42.60}, + {1838.80,1353.20,49.80}, + {1852.00,1357.60,55.70}, + {1861.30,1364.00,59.40}, + {1866.30,1374.80,61.70}, + {1864.00,1387.30,63.20}, + {1854.80,1399.40,64.10}, + {1844.00,1406.90,64.10}, + {1824.30,1411.40,63.30}, + {1801.00,1412.30,60.40}, + {1782.00,1410.10,55.50}, + {1770.50,1405.20,50.30}, + {1765.20,1400.70,46.60}, + {1761.40,1393.40,41.70}, + {1759.10,1386.70,36.60}, + {1757.80,1378.20,29.00}, + {1758.00,1367.00,19.51} }; static Locations Spawn[]= { - {1776.27,1348.74,19.20}, //spawn point for pumpkin shrine mob - {1765.28,1347.46,17.55} //spawn point for smoke + {1776.27,1348.74,19.20}, //spawn point for pumpkin shrine mob + {1765.28,1347.46,17.55} //spawn point for smoke }; struct Summon { - const std::string text; + const std::string text; }; static Summon Text[]= { - {"Horseman rise..."}, - {"Your time is night..."}, - {"You felt death once..."}, - {"Now, know demise!"} + {"Horseman rise..."}, + {"Your time is night..."}, + {"You felt death once..."}, + {"Now, know demise!"} }; struct TRINITY_DLL_DECL mob_wisp_invisAI : public ScriptedAI { - mob_wisp_invisAI(Creature *c) : ScriptedAI(c) - { - Creaturetype = delay = spell = spell2 = 0; - //that's hack but there are no info about range of this spells in dbc - SpellEntry *wisp = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_WISP_BLUE); - if (wisp) - wisp->rangeIndex = 6; //100 yards - SpellEntry *port = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_WISP_FLIGHT_PORT); - if (port) - port->rangeIndex = 6; - } - - uint32 Creaturetype; - uint32 delay; - uint32 spell; - uint32 spell2; - void Reset(){} - void Aggro(Unit *who){} - void SetType(uint32 _type) - { - Creaturetype = _type; - switch(Creaturetype) - { - case 1: - spell = SPELL_PUMPKIN_AURA_GREEN; break; - case 2: - delay = 15000; spell = SPELL_BODY_FLAME;spell2 = SPELL_DEATH; break; - case 3: - delay = 15000; spell = SPELL_SMOKE; break; - case 4: - delay = 7000; spell2 = SPELL_WISP_BLUE; break; - } - if (spell)DoCast(m_creature,spell); - } - - void SpellHit(Unit* caster, const SpellEntry *spell) - { - if(spell->Id == SPELL_WISP_FLIGHT_PORT && Creaturetype == 4) - m_creature->SetDisplayId(2027); - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || Creaturetype != 1 || !who->isTargetableForAttack()) - return; - - if (m_creature->GetDistance2d(who) < 0.1 && !who->HasAura(SPELL_SQUASH_SOUL,0)) - DoCast(who,SPELL_SQUASH_SOUL); - } - - void UpdateAI(const uint32 diff) - { - if(delay) - { - if (delay <= diff) - { - m_creature->RemoveAurasDueToSpell(SPELL_SMOKE); - if(spell2) - DoCast(m_creature,spell2); - delay = 0; - }else delay -= diff; - } - } + mob_wisp_invisAI(Creature *c) : ScriptedAI(c) + { + Creaturetype = delay = spell = spell2 = 0; + //that's hack but there are no info about range of this spells in dbc + SpellEntry *wisp = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_WISP_BLUE); + if (wisp) + wisp->rangeIndex = 6; //100 yards + SpellEntry *port = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_WISP_FLIGHT_PORT); + if (port) + port->rangeIndex = 6; + } + + uint32 Creaturetype; + uint32 delay; + uint32 spell; + uint32 spell2; + void Reset(){} + void Aggro(Unit *who){} + void SetType(uint32 _type) + { + Creaturetype = _type; + switch(Creaturetype) + { + case 1: + spell = SPELL_PUMPKIN_AURA_GREEN; break; + case 2: + delay = 15000; spell = SPELL_BODY_FLAME;spell2 = SPELL_DEATH; break; + case 3: + delay = 15000; spell = SPELL_SMOKE; break; + case 4: + delay = 7000; spell2 = SPELL_WISP_BLUE; break; + } + if (spell)DoCast(m_creature,spell); + } + + void SpellHit(Unit* caster, const SpellEntry *spell) + { + if(spell->Id == SPELL_WISP_FLIGHT_PORT && Creaturetype == 4) + m_creature->SetDisplayId(2027); + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || Creaturetype != 1 || !who->isTargetableForAttack()) + return; + + if (m_creature->GetDistance2d(who) < 0.1 && !who->HasAura(SPELL_SQUASH_SOUL,0)) + DoCast(who,SPELL_SQUASH_SOUL); + } + + void UpdateAI(const uint32 diff) + { + if(delay) + { + if (delay <= diff) + { + m_creature->RemoveAurasDueToSpell(SPELL_SMOKE); + if(spell2) + DoCast(m_creature,spell2); + delay = 0; + }else delay -= diff; + } + } }; struct TRINITY_DLL_DECL mob_headAI : public ScriptedAI { - mob_headAI(Creature *c) : ScriptedAI(c) {Reset();} + mob_headAI(Creature *c) : ScriptedAI(c) {Reset();} - uint64 bodyGUID; + uint64 bodyGUID; - uint32 Phase; - uint32 laugh; - uint32 wait; + uint32 Phase; + uint32 laugh; + uint32 wait; - bool withbody; - bool die; + bool withbody; + bool die; void Reset() { - Phase = 0; - bodyGUID = 0; - die = false; - withbody = true; - wait = 1000; - laugh = 15000 + rand()%16 * 1000; + Phase = 0; + bodyGUID = 0; + die = false; + withbody = true; + wait = 1000; + laugh = 15000 + rand()%16 * 1000; } - void Aggro(Unit *who) {} - void SaySound(int32 textEntry, Unit *target = 0) - { - DoScriptText(textEntry, m_creature, target); - //DoCast(m_creature,SPELL_HEAD_SPEAKS,true); - Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000); - speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false); - laugh += 3000; - } - - void DamageTaken(Unit* done_by,uint32 &damage) - { - if (withbody) - return; - - switch(Phase) - { - case 1: - if(((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 67) - Disappear();break; - case 2: - if(((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 34) - Disappear();break; - case 3: - if (damage >= m_creature->GetHealth()) - { - die = true; - withbody = true; - wait = 300; - damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->StopMoving(); - //m_creature->GetMotionMaster()->MoveIdle(); - DoCast(m_creature,SPELL_HEAD_IS_DEAD); - }break; - } - } - - void SpellHit(Unit *caster, const SpellEntry* spell) - { - if (!withbody) - return; - - if (spell->Id == SPELL_FLYING_HEAD) - { - if (Phase < 3) ++Phase; - else Phase = 3; - withbody = false; - if(!bodyGUID) - bodyGUID = caster->GetGUID(); - m_creature->RemoveAllAuras(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoCast(m_creature,SPELL_HEAD_LANDS,true); - DoCast(m_creature,SPELL_HEAD,false); - SaySound(SAY_LOST_HEAD); - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveFleeing(caster->getVictim()); - } - } - void Disappear();//we must set returned=true(this will prevent from "body calls head" while head flying to body), see function below + void Aggro(Unit *who) {} + void SaySound(int32 textEntry, Unit *target = 0) + { + DoScriptText(textEntry, m_creature, target); + //DoCast(m_creature,SPELL_HEAD_SPEAKS,true); + Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000); + speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false); + laugh += 3000; + } + + void DamageTaken(Unit* done_by,uint32 &damage) + { + if (withbody) + return; + + switch(Phase) + { + case 1: + if(((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 67) + Disappear();break; + case 2: + if(((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 34) + Disappear();break; + case 3: + if (damage >= m_creature->GetHealth()) + { + die = true; + withbody = true; + wait = 300; + damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->StopMoving(); + //m_creature->GetMotionMaster()->MoveIdle(); + DoCast(m_creature,SPELL_HEAD_IS_DEAD); + }break; + } + } + + void SpellHit(Unit *caster, const SpellEntry* spell) + { + if (!withbody) + return; + + if (spell->Id == SPELL_FLYING_HEAD) + { + if (Phase < 3) ++Phase; + else Phase = 3; + withbody = false; + if(!bodyGUID) + bodyGUID = caster->GetGUID(); + m_creature->RemoveAllAuras(); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(m_creature,SPELL_HEAD_LANDS,true); + DoCast(m_creature,SPELL_HEAD,false); + SaySound(SAY_LOST_HEAD); + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveFleeing(caster->getVictim()); + } + } + void Disappear();//we must set returned=true(this will prevent from "body calls head" while head flying to body), see function below void UpdateAI(const uint32 diff) { - if (!withbody) - { - if (wait < diff) - { - wait = 1000; - if (!m_creature->getVictim()) return; - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveFleeing(m_creature->getVictim()); - }else wait -= diff; - if (laugh < diff) - { - laugh = 15000 + (rand()%16)*1000; - DoPlaySoundToSet(m_creature, RandomLaught[rand()%3]); - //DoCast(m_creature,SPELL_HEAD_SPEAKS,true); //this spell remove buff "head" - Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000); - speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false); - DoTextEmote("laughts",NULL); - } else laugh -= diff; - - } else { - - if (die) { - if (wait < diff) - { - die = false; - Unit *body = Unit::GetUnit((*m_creature),bodyGUID); - if (body) - body->DealDamage(body, body->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->setDeathState(JUST_DIED); - } else wait -= diff; - } - } + if (!withbody) + { + if (wait < diff) + { + wait = 1000; + if (!m_creature->getVictim()) return; + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveFleeing(m_creature->getVictim()); + }else wait -= diff; + if (laugh < diff) + { + laugh = 15000 + (rand()%16)*1000; + DoPlaySoundToSet(m_creature, RandomLaught[rand()%3]); + //DoCast(m_creature,SPELL_HEAD_SPEAKS,true); //this spell remove buff "head" + Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000); + speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false); + DoTextEmote("laughts",NULL); + } else laugh -= diff; + + } else { + + if (die) { + if (wait < diff) + { + die = false; + Unit *body = Unit::GetUnit((*m_creature),bodyGUID); + if (body) + body->DealDamage(body, body->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->setDeathState(JUST_DIED); + } else wait -= diff; + } + } } }; struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI { - boss_headless_horsemanAI(Creature *c) : ScriptedAI(c) - { - SpellEntry *confl = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_CONFLAGRATION); - if(confl) - { - confl->EffectApplyAuraName[0] = SPELL_AURA_PERIODIC_DAMAGE_PERCENT; - confl->EffectBasePoints[0] = 10; - confl->EffectBaseDice[0] = 10; - confl->DmgMultiplier[0] = 1; - } -/* SpellEntry *confl = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_CONFLAGRATION); - if(confl) - confl->EffectTriggerSpell[1] = 22587; - - SpellEntry *speed = (SpellEntry*)GetSpellStore()->LookupEntry(22587); - if(speed) - { - speed->Effect[1] = SPELL_EFFECT_APPLY_AURA; - speed->EffectApplyAuraName[1] = SPELL_AURA_MOD_CONFUSE; - }*/ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } - - ScriptedInstance *pInstance; - - uint64 headGUID; - uint64 playerGUID; - - uint32 Phase; - uint32 id; - uint32 count; - uint32 say_timer; - - uint32 conflagrate; - uint32 summonadds; - uint32 cleave; - uint32 regen; - uint32 whirlwind; - uint32 laugh; - uint32 burn; - - bool withhead; - bool returned; - bool IsFlying; - bool wp_reached; - bool burned; + boss_headless_horsemanAI(Creature *c) : ScriptedAI(c) + { + SpellEntry *confl = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_CONFLAGRATION); + if(confl) + { + confl->EffectApplyAuraName[0] = SPELL_AURA_PERIODIC_DAMAGE_PERCENT; + confl->EffectBasePoints[0] = 10; + confl->EffectBaseDice[0] = 10; + confl->DmgMultiplier[0] = 1; + } +/* SpellEntry *confl = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_CONFLAGRATION); + if(confl) + confl->EffectTriggerSpell[1] = 22587; + + SpellEntry *speed = (SpellEntry*)GetSpellStore()->LookupEntry(22587); + if(speed) + { + speed->Effect[1] = SPELL_EFFECT_APPLY_AURA; + speed->EffectApplyAuraName[1] = SPELL_AURA_MOD_CONFUSE; + }*/ + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } + + ScriptedInstance *pInstance; + + uint64 headGUID; + uint64 playerGUID; + + uint32 Phase; + uint32 id; + uint32 count; + uint32 say_timer; + + uint32 conflagrate; + uint32 summonadds; + uint32 cleave; + uint32 regen; + uint32 whirlwind; + uint32 laugh; + uint32 burn; + + bool withhead; + bool returned; + bool IsFlying; + bool wp_reached; + bool burned; void Reset() { - Phase = 1; - conflagrate = 15000; - summonadds = 15000; - laugh = 16000 + rand()%5 * 1000; - cleave = 2000; - regen = 1000; - burn = 6000; - count = 0; - say_timer = 3000; - - withhead = true; - returned = true; - burned = false; - IsFlying = false; - DoCast(m_creature,SPELL_HEAD); - if (headGUID){ - Unit* Head = Unit::GetUnit((*m_creature), headGUID); - if(Head){ - Head->SetVisibility(VISIBILITY_OFF); - Head->setDeathState(JUST_DIED); - } - headGUID = 0; - } - - if (pInstance) - pInstance->SetData(DATA_HORSEMAN_EVENT, 0); + Phase = 1; + conflagrate = 15000; + summonadds = 15000; + laugh = 16000 + rand()%5 * 1000; + cleave = 2000; + regen = 1000; + burn = 6000; + count = 0; + say_timer = 3000; + + withhead = true; + returned = true; + burned = false; + IsFlying = false; + DoCast(m_creature,SPELL_HEAD); + if (headGUID){ + Unit* Head = Unit::GetUnit((*m_creature), headGUID); + if(Head){ + Head->SetVisibility(VISIBILITY_OFF); + Head->setDeathState(JUST_DIED); + } + headGUID = 0; + } + + if (pInstance) + pInstance->SetData(DATA_HORSEMAN_EVENT, 0); } - void FlyMode() - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); - m_creature->SetSpeed(MOVE_WALK,5.0f,true); - wp_reached = false; - count = 0; - say_timer = 3000; - id = 0; - Phase = 0; + void FlyMode() + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + m_creature->SetSpeed(MOVE_WALK,5.0f,true); + wp_reached = false; + count = 0; + say_timer = 3000; + id = 0; + Phase = 0; + } + + void MovementInform(uint32 type, uint32 i) + { + if (type != POINT_MOTION_TYPE || !IsFlying) + return; + if (i != id) + return; + wp_reached = true; + + switch (id) + { + case 0: + m_creature->SetVisibility(VISIBILITY_ON);break; + case 1: { + Creature *smoke = m_creature->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000); + ((mob_wisp_invisAI*)smoke->AI())->SetType(3); + DoCast(m_creature,SPELL_RHYME_BIG); + break;} + case 6: + if(pInstance) + pInstance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject + break; + case 19: + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING2);break; + case 20: { + Phase = 1; + IsFlying = false; + wp_reached = false; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + SaySound(SAY_ENTRANCE); + Unit *plr = Unit::GetUnit((*m_creature),playerGUID); + if (plr) + DoStartMovement(plr); + } + break; + } + ++id; } - void MovementInform(uint32 type, uint32 i) - { - if (type != POINT_MOTION_TYPE || !IsFlying) - return; - if (i != id) - return; - wp_reached = true; - - switch (id) - { - case 0: - m_creature->SetVisibility(VISIBILITY_ON);break; - case 1: { - Creature *smoke = m_creature->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000); - ((mob_wisp_invisAI*)smoke->AI())->SetType(3); - DoCast(m_creature,SPELL_RHYME_BIG); - break;} - case 6: - if(pInstance) - pInstance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject - break; - case 19: - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING2);break; - case 20: { - Phase = 1; - IsFlying = false; - wp_reached = false; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - SaySound(SAY_ENTRANCE); - Unit *plr = Unit::GetUnit((*m_creature),playerGUID); - if (plr) - DoStartMovement(plr); - } - break; - } - ++id; - } - - void Aggro(Unit *who) - { - if(pInstance) + void Aggro(Unit *who) + { + if(pInstance) pInstance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS); - DoZoneInCombat(); - } - void AttackStart(Unit* who) {ScriptedAI::AttackStart(who);} - void MoveInLineOfSight(Unit *who) - { - if (withhead && Phase != 0) - ScriptedAI::MoveInLineOfSight(who); - } - void KilledUnit(Unit *plr) - { - if (plr->GetTypeId() == TYPEID_PLAYER) - { - if (withhead) - SaySound(SAY_PLAYER_DEATH); - else { //maybe possible when player dies from conflagration - Creature *Head = (Creature*)Unit::GetUnit((*m_creature), headGUID); - if (Head) - ((mob_headAI*)Head->AI())->SaySound(SAY_PLAYER_DEATH); - } - } - } - - void SaySound(int32 textEntry, Unit *target = 0) - { - DoScriptText(textEntry, m_creature, target); - laugh += 4000; - } + DoZoneInCombat(); + } + void AttackStart(Unit* who) {ScriptedAI::AttackStart(who);} + void MoveInLineOfSight(Unit *who) + { + if (withhead && Phase != 0) + ScriptedAI::MoveInLineOfSight(who); + } + void KilledUnit(Unit *plr) + { + if (plr->GetTypeId() == TYPEID_PLAYER) + { + if (withhead) + SaySound(SAY_PLAYER_DEATH); + else { //maybe possible when player dies from conflagration + Creature *Head = (Creature*)Unit::GetUnit((*m_creature), headGUID); + if (Head) + ((mob_headAI*)Head->AI())->SaySound(SAY_PLAYER_DEATH); + } + } + } + + void SaySound(int32 textEntry, Unit *target = 0) + { + DoScriptText(textEntry, m_creature, target); + laugh += 4000; + } Player* SelectRandomPlayer(float range = 0.0f, bool checkLoS = true) { @@ -484,320 +484,320 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI if (!map->IsDungeon()) return NULL; Map::PlayerList const &PlayerList = map->GetPlayers(); - Map::PlayerList::const_iterator i; - if(PlayerList.isEmpty()) return NULL; + Map::PlayerList::const_iterator i; + if(PlayerList.isEmpty()) return NULL; std::list temp; std::list::iterator j; for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if((m_creature->IsWithinLOSInMap(i->getSource()) || !checkLoS) && m_creature->getVictim() != i->getSource() && - m_creature->IsWithinDistInMap(i->getSource(), range) && i->getSource()->isAlive()) - temp.push_back(i->getSource()); - - if (temp.size()) { - j = temp.begin(); - advance(j, rand()%temp.size()); - return (*j); - } + if((m_creature->IsWithinLOSInMap(i->getSource()) || !checkLoS) && m_creature->getVictim() != i->getSource() && + m_creature->IsWithinDistInMap(i->getSource(), range) && i->getSource()->isAlive()) + temp.push_back(i->getSource()); + + if (temp.size()) { + j = temp.begin(); + advance(j, rand()%temp.size()); + return (*j); + } return NULL; } - void SpellHitTarget(Unit* unit, const SpellEntry* spell) - { - if (spell->Id == SPELL_CONFLAGRATION) - if (unit->HasAura(SPELL_CONFLAGRATION,0)) - SaySound(SAY_CONFLAGRATION,unit); - } - - void JustDied(Unit* killer) - { - m_creature->StopMoving(); - //m_creature->GetMotionMaster()->MoveIdle(); test - SaySound(SAY_DEATH); - Creature *flame = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000); - flame->CastSpell(flame,SPELL_BODY_FLAME,false); - Creature *wisp = DoSpawnCreature(WISP_INVIS,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000); - ((mob_wisp_invisAI*)wisp->AI())->SetType(4); - if(pInstance) - pInstance->SetData(DATA_HORSEMAN_EVENT, DONE); - } - - void SpellHit(Unit *caster, const SpellEntry* spell) - { - if (withhead) - return; - - if (spell->Id == SPELL_FLYING_HEAD) - { - if (Phase < 3) Phase++; - else Phase = 3; - withhead = true; - m_creature->RemoveAllAuras(); - m_creature->SetName("Headless Horseman"); - m_creature->SetHealth(m_creature->GetMaxHealth()); - SaySound(SAY_REJOINED); - DoCast(m_creature,SPELL_HEAD); - caster->GetMotionMaster()->Clear(false); - caster->GetMotionMaster()->MoveFollow(m_creature,6,rand()%6); - //DoResetThreat();//not sure if need - std::list::iterator itr; - for(itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if(pUnit && pUnit->isAlive() && pUnit != caster) - m_creature->AddThreat(pUnit,caster->getThreatManager().getThreat(pUnit)); - } - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && withhead) - { - withhead = false; - returned = false; - damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100; - m_creature->RemoveAllAuras(); - m_creature->SetName("Headless Horseman, Unhorsed"); - - if (!headGUID) - headGUID = DoSpawnCreature(HEAD,rand()%6,rand()%6,0,0,TEMPSUMMON_DEAD_DESPAWN,0)->GetGUID(); - Unit* Head = Unit::GetUnit((*m_creature), headGUID); - if (Head && Head->isAlive()) - { - Head->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - //Head->CastSpell(Head,SPELL_HEAD_INVIS,false); - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_IMMUNE,true); - DoCast(m_creature,SPELL_BODY_REGEN,true); - m_creature->CastSpell(Head, SPELL_FLYING_HEAD,true); - DoCast(m_creature,SPELL_CONFUSE,false); //test - done_by->ProcDamageAndSpell(m_creature,PROC_FLAG_KILL_AND_GET_XP,PROC_FLAG_KILLED,PROC_EX_NONE,0); - whirlwind = 4000 + (rand()%5)*1000; - regen = 0; - } - } - } + void SpellHitTarget(Unit* unit, const SpellEntry* spell) + { + if (spell->Id == SPELL_CONFLAGRATION) + if (unit->HasAura(SPELL_CONFLAGRATION,0)) + SaySound(SAY_CONFLAGRATION,unit); + } + + void JustDied(Unit* killer) + { + m_creature->StopMoving(); + //m_creature->GetMotionMaster()->MoveIdle(); test + SaySound(SAY_DEATH); + Creature *flame = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000); + flame->CastSpell(flame,SPELL_BODY_FLAME,false); + Creature *wisp = DoSpawnCreature(WISP_INVIS,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000); + ((mob_wisp_invisAI*)wisp->AI())->SetType(4); + if(pInstance) + pInstance->SetData(DATA_HORSEMAN_EVENT, DONE); + } + + void SpellHit(Unit *caster, const SpellEntry* spell) + { + if (withhead) + return; + + if (spell->Id == SPELL_FLYING_HEAD) + { + if (Phase < 3) Phase++; + else Phase = 3; + withhead = true; + m_creature->RemoveAllAuras(); + m_creature->SetName("Headless Horseman"); + m_creature->SetHealth(m_creature->GetMaxHealth()); + SaySound(SAY_REJOINED); + DoCast(m_creature,SPELL_HEAD); + caster->GetMotionMaster()->Clear(false); + caster->GetMotionMaster()->MoveFollow(m_creature,6,rand()%6); + //DoResetThreat();//not sure if need + std::list::iterator itr; + for(itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if(pUnit && pUnit->isAlive() && pUnit != caster) + m_creature->AddThreat(pUnit,caster->getThreatManager().getThreat(pUnit)); + } + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && withhead) + { + withhead = false; + returned = false; + damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100; + m_creature->RemoveAllAuras(); + m_creature->SetName("Headless Horseman, Unhorsed"); + + if (!headGUID) + headGUID = DoSpawnCreature(HEAD,rand()%6,rand()%6,0,0,TEMPSUMMON_DEAD_DESPAWN,0)->GetGUID(); + Unit* Head = Unit::GetUnit((*m_creature), headGUID); + if (Head && Head->isAlive()) + { + Head->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //Head->CastSpell(Head,SPELL_HEAD_INVIS,false); + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_IMMUNE,true); + DoCast(m_creature,SPELL_BODY_REGEN,true); + m_creature->CastSpell(Head, SPELL_FLYING_HEAD,true); + DoCast(m_creature,SPELL_CONFUSE,false); //test + done_by->ProcDamageAndSpell(m_creature,PROC_FLAG_KILL_AND_GET_XP,PROC_FLAG_KILLED,PROC_EX_NONE,0); + whirlwind = 4000 + (rand()%5)*1000; + regen = 0; + } + } + } void UpdateAI(const uint32 diff) { - if (withhead) - { - switch(Phase) - { - case 0: { - if (!IsFlying) - { - if (say_timer < diff) { - say_timer = 3000; - Player *plr = SelectRandomPlayer(100.0f,false); - if (count < 3) - plr->Say(Text[count].text,0); - else { - DoCast(m_creature,SPELL_RHYME_BIG); - plr->Say(Text[count].text,0); - plr->HandleEmoteCommand(ANIM_EMOTE_SHOUT); - wp_reached = true; - IsFlying = true; - count = 0; - break; - } - ++count; - }else say_timer -= diff; - }else{ - if (wp_reached) { - wp_reached = false; - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MovePoint(id,FlightPoint[id].x,FlightPoint[id].y,FlightPoint[id].z); - } - } - } - break; - case 1: - if(burned) break; - if(burn < diff) - { - Creature *flame = m_creature->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000); - ((mob_wisp_invisAI*)flame->AI())->SetType(2); - burned = true; - }else burn -= diff; - break; - case 2: - if (conflagrate < diff) - { - Unit *plr = (Unit*)SelectRandomPlayer(30.0f); - if (plr) - m_creature->CastSpell(plr,SPELL_CONFLAGRATION,false); - conflagrate = 10000 + rand()%7 * 1000; - }else conflagrate -= diff; - break; - case 3: - if (summonadds < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_SUMMON_PUMPKIN); - SaySound(SAY_SPROUTING_PUMPKINS); - summonadds = 25000 + rand()%11 *1000; - }else summonadds -= diff; - break; - } - - if (laugh < diff) { - laugh = 11000 + rand()%12 * 1000; - DoTextEmote("laughts",NULL); - DoPlaySoundToSet(m_creature, RandomLaught[rand()%3]); - } else laugh -= diff; - - if (UpdateVictim()) - { - DoMeleeAttackIfReady(); - if (cleave < diff) { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - cleave = 2000*(1 + rand()%3); //1 cleave per 2.0-6.0sec - } else cleave -= diff; - } - - } else { - - if (regen < diff) - { - regen = 1000; //"body calls head" - if (m_creature->GetHealth()/m_creature->GetMaxHealth() == 1 && !returned) - { - if (Phase > 1) --Phase; - else Phase = 1; - Creature* Head = (Creature*)Unit::GetUnit((*m_creature), headGUID); - if (Head && Head->isAlive()) - { - ((mob_headAI*)Head->AI())->Phase = Phase; - ((mob_headAI*)Head->AI())->Disappear(); - } - return; - } - } - else regen -= diff; - - if (whirlwind < diff) - { - whirlwind = 4000 + rand()%5 * 1000; - if (rand()%2) { - m_creature->RemoveAurasDueToSpell(SPELL_CONFUSE); - DoCast(m_creature,SPELL_WHIRLWIND,true); - DoCast(m_creature,SPELL_CONFUSE); - }else - m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND); - }else whirlwind -= diff; - } + if (withhead) + { + switch(Phase) + { + case 0: { + if (!IsFlying) + { + if (say_timer < diff) { + say_timer = 3000; + Player *plr = SelectRandomPlayer(100.0f,false); + if (count < 3) + plr->Say(Text[count].text,0); + else { + DoCast(m_creature,SPELL_RHYME_BIG); + plr->Say(Text[count].text,0); + plr->HandleEmoteCommand(ANIM_EMOTE_SHOUT); + wp_reached = true; + IsFlying = true; + count = 0; + break; + } + ++count; + }else say_timer -= diff; + }else{ + if (wp_reached) { + wp_reached = false; + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MovePoint(id,FlightPoint[id].x,FlightPoint[id].y,FlightPoint[id].z); + } + } + } + break; + case 1: + if(burned) break; + if(burn < diff) + { + Creature *flame = m_creature->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000); + ((mob_wisp_invisAI*)flame->AI())->SetType(2); + burned = true; + }else burn -= diff; + break; + case 2: + if (conflagrate < diff) + { + Unit *plr = (Unit*)SelectRandomPlayer(30.0f); + if (plr) + m_creature->CastSpell(plr,SPELL_CONFLAGRATION,false); + conflagrate = 10000 + rand()%7 * 1000; + }else conflagrate -= diff; + break; + case 3: + if (summonadds < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_SUMMON_PUMPKIN); + SaySound(SAY_SPROUTING_PUMPKINS); + summonadds = 25000 + rand()%11 *1000; + }else summonadds -= diff; + break; + } + + if (laugh < diff) { + laugh = 11000 + rand()%12 * 1000; + DoTextEmote("laughts",NULL); + DoPlaySoundToSet(m_creature, RandomLaught[rand()%3]); + } else laugh -= diff; + + if (UpdateVictim()) + { + DoMeleeAttackIfReady(); + if (cleave < diff) { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + cleave = 2000*(1 + rand()%3); //1 cleave per 2.0-6.0sec + } else cleave -= diff; + } + + } else { + + if (regen < diff) + { + regen = 1000; //"body calls head" + if (m_creature->GetHealth()/m_creature->GetMaxHealth() == 1 && !returned) + { + if (Phase > 1) --Phase; + else Phase = 1; + Creature* Head = (Creature*)Unit::GetUnit((*m_creature), headGUID); + if (Head && Head->isAlive()) + { + ((mob_headAI*)Head->AI())->Phase = Phase; + ((mob_headAI*)Head->AI())->Disappear(); + } + return; + } + } + else regen -= diff; + + if (whirlwind < diff) + { + whirlwind = 4000 + rand()%5 * 1000; + if (rand()%2) { + m_creature->RemoveAurasDueToSpell(SPELL_CONFUSE); + DoCast(m_creature,SPELL_WHIRLWIND,true); + DoCast(m_creature,SPELL_CONFUSE); + }else + m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND); + }else whirlwind -= diff; + } } }; void mob_headAI::Disappear() { - if (withbody) - return; - if (bodyGUID) - { - Creature *body = (Creature*)Unit::GetUnit((*m_creature), bodyGUID); - if(body && body->isAlive()) - { - withbody = true; - m_creature->RemoveAllAuras(); - body->RemoveAurasDueToSpell(SPELL_IMMUNE);//hack, SpellHit doesn't calls if body has immune aura - DoCast(body,SPELL_FLYING_HEAD); - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->StopMoving(); - ((boss_headless_horsemanAI*)body->AI())->returned = true; - } - } + if (withbody) + return; + if (bodyGUID) + { + Creature *body = (Creature*)Unit::GetUnit((*m_creature), bodyGUID); + if(body && body->isAlive()) + { + withbody = true; + m_creature->RemoveAllAuras(); + body->RemoveAurasDueToSpell(SPELL_IMMUNE);//hack, SpellHit doesn't calls if body has immune aura + DoCast(body,SPELL_FLYING_HEAD); + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->StopMoving(); + ((boss_headless_horsemanAI*)body->AI())->returned = true; + } + } } struct TRINITY_DLL_DECL mob_pulsing_pumpkinAI : public ScriptedAI { - mob_pulsing_pumpkinAI(Creature *c) : ScriptedAI(c) {Reset();} - - bool sprouted; - uint64 debuffGUID; - - void Reset() - { - float x, y, z; - m_creature->GetPosition(x, y, z); //this visual aura some under ground - m_creature->Relocate(x,y,z + 0.35f); - Despawn(); - Creature *debuff = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,14500); - debuff->SetDisplayId(m_creature->GetDisplayId()); - debuff->CastSpell(debuff,SPELL_PUMPKIN_AURA_GREEN,false); - ((mob_wisp_invisAI*)debuff->AI())->SetType(1); - debuffGUID = debuff->GetGUID(); - sprouted = false; - DoCast(m_creature,SPELL_PUMPKIN_AURA,true); - DoCast(m_creature,SPELL_SPROUTING); - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_ROTATE); - } - - void Aggro(Unit *who){} - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_SPROUTING) - { - sprouted = true; - m_creature->RemoveAllAuras(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_ROTATE); - DoCast(m_creature,SPELL_SPROUT_BODY,true); - m_creature->UpdateEntry(PUMPKIN_FIEND); - DoStartMovement(m_creature->getVictim()); - } - } - - void Despawn() - { - if (!debuffGUID) return; - Unit *debuff = Unit::GetUnit((*m_creature),debuffGUID); - if(debuff) - debuff->SetVisibility(VISIBILITY_OFF); - debuffGUID = 0; - } - - void JustDied(Unit *killer) {if(!sprouted) Despawn();} - - void MoveInLineOfSight(Unit *who) - { - if (!who || !who->isTargetableForAttack() || !m_creature->IsHostileTo(who) || m_creature->getVictim()) - return; - - m_creature->AddThreat(who,0.0f); - if(sprouted) - DoStartMovement(who); - } + mob_pulsing_pumpkinAI(Creature *c) : ScriptedAI(c) {Reset();} + + bool sprouted; + uint64 debuffGUID; + + void Reset() + { + float x, y, z; + m_creature->GetPosition(x, y, z); //this visual aura some under ground + m_creature->Relocate(x,y,z + 0.35f); + Despawn(); + Creature *debuff = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,14500); + debuff->SetDisplayId(m_creature->GetDisplayId()); + debuff->CastSpell(debuff,SPELL_PUMPKIN_AURA_GREEN,false); + ((mob_wisp_invisAI*)debuff->AI())->SetType(1); + debuffGUID = debuff->GetGUID(); + sprouted = false; + DoCast(m_creature,SPELL_PUMPKIN_AURA,true); + DoCast(m_creature,SPELL_SPROUTING); + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_ROTATE); + } + + void Aggro(Unit *who){} + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_SPROUTING) + { + sprouted = true; + m_creature->RemoveAllAuras(); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_ROTATE); + DoCast(m_creature,SPELL_SPROUT_BODY,true); + m_creature->UpdateEntry(PUMPKIN_FIEND); + DoStartMovement(m_creature->getVictim()); + } + } + + void Despawn() + { + if (!debuffGUID) return; + Unit *debuff = Unit::GetUnit((*m_creature),debuffGUID); + if(debuff) + debuff->SetVisibility(VISIBILITY_OFF); + debuffGUID = 0; + } + + void JustDied(Unit *killer) {if(!sprouted) Despawn();} + + void MoveInLineOfSight(Unit *who) + { + if (!who || !who->isTargetableForAttack() || !m_creature->IsHostileTo(who) || m_creature->getVictim()) + return; + + m_creature->AddThreat(who,0.0f); + if(sprouted) + DoStartMovement(who); + } void UpdateAI(const uint32 diff) { - if (sprouted) - if (UpdateVictim()) - DoMeleeAttackIfReady(); - } + if (sprouted) + if (UpdateVictim()) + DoMeleeAttackIfReady(); + } }; bool GOHello_go_loosely_turned_soil(Player *plr, GameObject* soil) { -/* if (soil->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER && plr->getLevel() > 64) - { - plr->PrepareQuestMenu(soil->GetGUID()); - plr->SendPreparedQuest(soil->GetGUID()); - } - if (plr->GetQuestStatus(11405) == QUEST_STATUS_INCOMPLETE && plr->getLevel() > 64) - { */ - plr->AreaExploredOrEventHappens(11405); - Creature *horseman = soil->SummonCreature(HH_MOUNTED,FlightPoint[20].x,FlightPoint[20].y,FlightPoint[20].z,0,TEMPSUMMON_MANUAL_DESPAWN,0); - ((boss_headless_horsemanAI*)horseman->AI())->playerGUID = plr->GetGUID(); - ((boss_headless_horsemanAI*)horseman->AI())->FlyMode(); - //} - return true; +/* if (soil->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER && plr->getLevel() > 64) + { + plr->PrepareQuestMenu(soil->GetGUID()); + plr->SendPreparedQuest(soil->GetGUID()); + } + if (plr->GetQuestStatus(11405) == QUEST_STATUS_INCOMPLETE && plr->getLevel() > 64) + { */ + plr->AreaExploredOrEventHappens(11405); + Creature *horseman = soil->SummonCreature(HH_MOUNTED,FlightPoint[20].x,FlightPoint[20].y,FlightPoint[20].z,0,TEMPSUMMON_MANUAL_DESPAWN,0); + ((boss_headless_horsemanAI*)horseman->AI())->playerGUID = plr->GetGUID(); + ((boss_headless_horsemanAI*)horseman->AI())->FlyMode(); + //} + return true; } CreatureAI* GetAI_mob_head(Creature *_Creature) @@ -844,8 +844,8 @@ void AddSC_boss_headless_horseman() newscript->GetAI = &GetAI_mob_wisp_invis; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "go_loosely_turned_soil"; - newscript->pGOHello = &GOHello_go_loosely_turned_soil; + newscript = new Script; + newscript->Name = "go_loosely_turned_soil"; + newscript->pGOHello = &GOHello_go_loosely_turned_soil; newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp index 2bfc66f38df..9cd9b930ba2 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_herodAI : public ScriptedAI { boss_herodAI(Creature *c) : ScriptedAI(c) {Reset();} - bool Enrage; + bool Enrage; uint32 Cleave_Timer; uint32 Whirlwind_Timer; @@ -50,40 +50,40 @@ struct TRINITY_DLL_DECL boss_herodAI : public ScriptedAI void Reset() { - Enrage = false; + Enrage = false; Cleave_Timer = 12000; Whirlwind_Timer = 60000; } void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); - DoCast(m_creature,SPELL_RUSHINGCHARGE); + DoScriptText(SAY_AGGRO, m_creature); + DoCast(m_creature,SPELL_RUSHINGCHARGE); } - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_KILL, m_creature); - } + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_KILL, m_creature); + } - void JustDied(Unit* killer) - { - for(uint8 i = 0; i < 20; ++i) - m_creature->SummonCreature(ENTRY_SCARLET_TRAINEE, 1939.18, -431.58, 17.09, 6.22, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - } + void JustDied(Unit* killer) + { + for(uint8 i = 0; i < 20; ++i) + m_creature->SummonCreature(ENTRY_SCARLET_TRAINEE, 1939.18, -431.58, 17.09, 6.22, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + } void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; - //If we are <30% hp goes Enraged - if (!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false)) - { - DoScriptText(EMOTE_ENRAGE, m_creature); - DoScriptText(SAY_ENRAGE, m_creature); + //If we are <30% hp goes Enraged + if (!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false)) + { + DoScriptText(EMOTE_ENRAGE, m_creature); + DoScriptText(SAY_ENRAGE, m_creature); DoCast(m_creature,SPELL_FRENZY); - Enrage = true; + Enrage = true; } //Cleave_Timer @@ -93,10 +93,10 @@ struct TRINITY_DLL_DECL boss_herodAI : public ScriptedAI Cleave_Timer = 12000; }else Cleave_Timer -= diff; - // Whirlwind_Timer + // Whirlwind_Timer if (Whirlwind_Timer < diff) { - DoScriptText(SAY_WHIRLWIND, m_creature); + DoScriptText(SAY_WHIRLWIND, m_creature); DoCast(m_creature->getVictim(),SPELL_WHIRLWIND); Whirlwind_Timer = 30000; }else Whirlwind_Timer -= diff; @@ -112,63 +112,63 @@ CreatureAI* GetAI_boss_herod(Creature *_Creature) float Location[12][3]= { - {1945.81, -431.54, 16.36}, - {1946.21, -436.41, 16.36}, - {1950.01, -444.11, 14.63}, - {1956.08, -449.34, 13.12}, - {1966.59, -450.55, 11.27}, - {1976.09, -447.51, 11.27}, - {1983.42, -435.85, 11.27}, - {1978.17, -428.81, 11.27}, - {1973.97, -422.08, 9.04}, - {1963.84, -418.90, 6.17}, - {1961.22, -422.74, 6.17}, - {1964.80, -431.26, 6.17} + {1945.81, -431.54, 16.36}, + {1946.21, -436.41, 16.36}, + {1950.01, -444.11, 14.63}, + {1956.08, -449.34, 13.12}, + {1966.59, -450.55, 11.27}, + {1976.09, -447.51, 11.27}, + {1983.42, -435.85, 11.27}, + {1978.17, -428.81, 11.27}, + {1973.97, -422.08, 9.04}, + {1963.84, -418.90, 6.17}, + {1961.22, -422.74, 6.17}, + {1964.80, -431.26, 6.17} }; uint32 Wait[12][1]= { - {0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{600000} + {0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{600000} }; struct TRINITY_DLL_DECL mob_scarlet_traineeAI : public npc_escortAI { - mob_scarlet_traineeAI(Creature *c) : npc_escortAI(c) {Reset();} + mob_scarlet_traineeAI(Creature *c) : npc_escortAI(c) {Reset();} - uint32 Start_Timer; + uint32 Start_Timer; - void WaypointReached(uint32 i) { } + void WaypointReached(uint32 i) { } - void Reset() - { - Start_Timer = urand(1500,4500); - } + void Reset() + { + Start_Timer = urand(1500,4500); + } - void Aggro(Unit* who) { } + void Aggro(Unit* who) { } - void UpdateAI(const uint32 diff) - { - if (Start_Timer) - { - if (Start_Timer < diff) - { - Start(true,true,true); - Start_Timer = 0; - }else Start_Timer -= diff; - } + void UpdateAI(const uint32 diff) + { + if (Start_Timer) + { + if (Start_Timer < diff) + { + Start(true,true,true); + Start_Timer = 0; + }else Start_Timer -= diff; + } - npc_escortAI::UpdateAI(diff); - } + npc_escortAI::UpdateAI(diff); + } }; CreatureAI* GetAI_mob_scarlet_trainee(Creature* _Creature) { - mob_scarlet_traineeAI* thisAI = new mob_scarlet_traineeAI(_Creature); + mob_scarlet_traineeAI* thisAI = new mob_scarlet_traineeAI(_Creature); - for(uint32 i = 0; i < 12; ++i) - thisAI->AddWaypoint(i, Location[i][0], Location[i][1], Location[i][2], Wait[i][0]); + for(uint32 i = 0; i < 12; ++i) + thisAI->AddWaypoint(i, Location[i][0], Location[i][1], Location[i][2], Wait[i][0]); - return ((CreatureAI*)thisAI); + return ((CreatureAI*)thisAI); } void AddSC_boss_herod() @@ -179,8 +179,8 @@ void AddSC_boss_herod() newscript->GetAI = &GetAI_boss_herod; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "mob_scarlet_trainee"; - newscript->GetAI = &GetAI_mob_scarlet_trainee; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "mob_scarlet_trainee"; + newscript->GetAI = &GetAI_mob_scarlet_trainee; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp index fdf12f2fd2f..953ae804e39 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp @@ -25,10 +25,10 @@ EndScriptData */ #include "def_scarlet_monastery.h" #include "sc_creature.h" -#define ENTRY_PUMPKIN_SHRINE 186267 -#define ENTRY_HORSEMAN 23682 -#define ENTRY_HEAD 23775 -#define ENTRY_PUMPKIN 23694 +#define ENTRY_PUMPKIN_SHRINE 186267 +#define ENTRY_HORSEMAN 23682 +#define ENTRY_HEAD 23775 +#define ENTRY_PUMPKIN 23694 #define ENCOUNTERS 1 @@ -37,102 +37,102 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance instance_scarlet_monastery(Map *Map) : ScriptedInstance(Map) {Initialize();}; uint64 PumpkinShrineGUID; - uint64 HorsemanGUID; - uint64 HeadGUID; - std::set HorsemanAdds; + uint64 HorsemanGUID; + uint64 HeadGUID; + std::set HorsemanAdds; - uint64 MograineGUID; - uint64 WhitemaneGUID; - uint64 DoorHighInquisitorGUID; + uint64 MograineGUID; + uint64 WhitemaneGUID; + uint64 DoorHighInquisitorGUID; - uint32 Encounter[ENCOUNTERS]; + uint32 Encounter[ENCOUNTERS]; void Initialize() { PumpkinShrineGUID = 0; - HorsemanGUID = 0; - HeadGUID = 0; - HorsemanAdds.clear(); + HorsemanGUID = 0; + HeadGUID = 0; + HorsemanAdds.clear(); - MograineGUID = 0; - WhitemaneGUID = 0; - DoorHighInquisitorGUID = 0; + MograineGUID = 0; + WhitemaneGUID = 0; + DoorHighInquisitorGUID = 0; - for(uint8 i = 0; i < ENCOUNTERS; i++) - Encounter[i] = NOT_STARTED; + for(uint8 i = 0; i < ENCOUNTERS; i++) + Encounter[i] = NOT_STARTED; } void OnObjectCreate(GameObject *go) { switch(go->GetEntry()) { - case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = go->GetGUID();break; - case 104600: DoorHighInquisitorGUID = go->GetGUID(); break; + case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = go->GetGUID();break; + case 104600: DoorHighInquisitorGUID = go->GetGUID(); break; } } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, uint32 creature_entry) { switch(creature_entry) { - case ENTRY_HORSEMAN: HorsemanGUID = creature->GetGUID(); break; - case ENTRY_HEAD: HeadGUID = creature->GetGUID(); break; - case ENTRY_PUMPKIN: HorsemanAdds.insert(creature->GetGUID());break; - case 3976: MograineGUID = creature->GetGUID(); break; - case 3977: WhitemaneGUID = creature->GetGUID(); break; + case ENTRY_HORSEMAN: HorsemanGUID = creature->GetGUID(); break; + case ENTRY_HEAD: HeadGUID = creature->GetGUID(); break; + case ENTRY_PUMPKIN: HorsemanAdds.insert(creature->GetGUID());break; + case 3976: MograineGUID = creature->GetGUID(); break; + case 3977: WhitemaneGUID = creature->GetGUID(); break; } } void SetData(uint32 type, uint32 data) { - switch(type) + switch(type) { - case TYPE_MOGRAINE_AND_WHITE_EVENT: Encounter[0] = data; break; - case GAMEOBJECT_PUMPKIN_SHRINE: - { - GameObject *Shrine = instance->GetGameObjectInMap(PumpkinShrineGUID); - if(Shrine) - Shrine->SetUInt32Value(GAMEOBJECT_STATE,1); - }break; - case DATA_HORSEMAN_EVENT: - if (data == DONE) - { - for(std::set::iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr) - { - Creature* add = instance->GetCreatureInMap(*itr); - if(add && add->isAlive()) - add->DealDamage(add, add->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - HorsemanAdds.clear(); - GameObject *Shrine = instance->GetGameObjectInMap(PumpkinShrineGUID); - if(Shrine) - Shrine->SetUInt32Value(GAMEOBJECT_STATE,1); - } - break; + case TYPE_MOGRAINE_AND_WHITE_EVENT: Encounter[0] = data; break; + case GAMEOBJECT_PUMPKIN_SHRINE: + { + GameObject *Shrine = instance->GetGameObjectInMap(PumpkinShrineGUID); + if(Shrine) + Shrine->SetUInt32Value(GAMEOBJECT_STATE,1); + }break; + case DATA_HORSEMAN_EVENT: + if (data == DONE) + { + for(std::set::iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr) + { + Creature* add = instance->GetCreatureInMap(*itr); + if(add && add->isAlive()) + add->DealDamage(add, add->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + HorsemanAdds.clear(); + GameObject *Shrine = instance->GetGameObjectInMap(PumpkinShrineGUID); + if(Shrine) + Shrine->SetUInt32Value(GAMEOBJECT_STATE,1); + } + break; } } - uint64 GetData64(uint32 type) - { + uint64 GetData64(uint32 type) + { switch(type) { - //case GAMEOBJECT_PUMPKIN_SHRINE: return PumpkinShrineGUID; - //case DATA_HORSEMAN: return HorsemanGUID; - //case DATA_HEAD: return HeadGUID; - case DATA_MOGRAINE: return MograineGUID; - case DATA_WHITEMANE: return WhitemaneGUID; - case DATA_DOOR_WHITEMANE: return DoorHighInquisitorGUID; + //case GAMEOBJECT_PUMPKIN_SHRINE: return PumpkinShrineGUID; + //case DATA_HORSEMAN: return HorsemanGUID; + //case DATA_HEAD: return HeadGUID; + case DATA_MOGRAINE: return MograineGUID; + case DATA_WHITEMANE: return WhitemaneGUID; + case DATA_DOOR_WHITEMANE: return DoorHighInquisitorGUID; } - return 0; - } + return 0; + } - uint32 GetData(uint32 type) - { - if (type == TYPE_MOGRAINE_AND_WHITE_EVENT) - return Encounter[0]; + uint32 GetData(uint32 type) + { + if (type == TYPE_MOGRAINE_AND_WHITE_EVENT) + return Encounter[0]; - return 0; - } + return 0; + } }; InstanceData* GetInstanceData_instance_scarlet_monastery(Map* map) diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp index ca63a3338f8..07fbeb0d54f 100644 --- a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp +++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp @@ -31,7 +31,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance instance_shadowfang_keep(Map *map) : ScriptedInstance(map) {Initialize();}; uint32 Encounter[ENCOUNTERS]; - std::string str_data; + std::string str_data; uint64 DoorCourtyardGUID; uint64 DoorSorcererGUID; @@ -43,49 +43,49 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance DoorSorcererGUID = 0; DoorArugalGUID = 0; - for(uint8 i=0; i < ENCOUNTERS; ++i) - Encounter[i] = NOT_STARTED; + for(uint8 i=0; i < ENCOUNTERS; ++i) + Encounter[i] = NOT_STARTED; } - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - debug_log("TSCR: Instance Shadowfang Keep: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + debug_log("TSCR: Instance Shadowfang Keep: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } void OnObjectCreate(GameObject *go) { switch(go->GetEntry()) { - case 18895: DoorCourtyardGUID = go->GetGUID(); break; - case 18972: DoorSorcererGUID = go->GetGUID(); break; - case 18971: DoorArugalGUID = go->GetGUID(); break; + case 18895: DoorCourtyardGUID = go->GetGUID(); break; + case 18972: DoorSorcererGUID = go->GetGUID(); break; + case 18971: DoorArugalGUID = go->GetGUID(); break; } } - void HandleGameObject(uint64 guid, uint32 state) - { - Player *player = GetPlayerInMap(); + void HandleGameObject(uint64 guid, uint32 state) + { + Player *player = GetPlayerInMap(); - if (!player || !guid) - { - debug_log("SD2: Instance Shadowfang Keep: HandleGameObject fail"); - return; - } + if (!player || !guid) + { + debug_log("SD2: Instance Shadowfang Keep: HandleGameObject fail"); + return; + } - if (GameObject *go = GameObject::GetGameObject(*player,guid)) - go->SetGoState(state); - } + if (GameObject *go = GameObject::GetGameObject(*player,guid)) + go->SetGoState(state); + } void SetData(uint32 type, uint32 data) { @@ -101,7 +101,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance break; case TYPE_FENRUS: if(data == DONE) - HandleGameObject(DoorSorcererGUID,0); + HandleGameObject(DoorSorcererGUID,0); Encounter[2] = data; break; case TYPE_NANDOS: @@ -111,18 +111,18 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance break; } - if (data == DONE) - { - OUT_SAVE_INST_DATA; + if (data == DONE) + { + OUT_SAVE_INST_DATA; - std::ostringstream saveStream; - saveStream << Encounter[0] << " " << Encounter[1] << " " << Encounter[2] << " " << Encounter[3]; + std::ostringstream saveStream; + saveStream << Encounter[0] << " " << Encounter[1] << " " << Encounter[2] << " " << Encounter[3]; - str_data = saveStream.str(); + str_data = saveStream.str(); - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } } uint32 GetData(uint32 type) @@ -141,30 +141,30 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance return 0; } - const char* Save() - { - return str_data.c_str(); - } + const char* Save() + { + return str_data.c_str(); + } - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } - OUT_LOAD_INST_DATA(in); + OUT_LOAD_INST_DATA(in); - std::istringstream loadStream(in); - loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3]; + std::istringstream loadStream(in); + loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3]; - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if (Encounter[i] == IN_PROGRESS) - Encounter[i] = NOT_STARTED; + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if (Encounter[i] == IN_PROGRESS) + Encounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } + OUT_LOAD_INST_DATA_COMPLETE; + } }; InstanceData* GetInstanceData_instance_shadowfang_keep(Map* map) diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp index 4fa7baa2561..1d00385a076 100644 --- a/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp +++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp @@ -85,11 +85,11 @@ bool GossipHello_npc_shadowfang_prisoner(Player *player, Creature *_Creature) { ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); - if (!pInstance) - return false; + if (!pInstance) + return false; - if (pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE) - player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + if (pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE) + player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); @@ -101,7 +101,7 @@ bool GossipSelect_npc_shadowfang_prisoner(Player *player, Creature *_Creature, u if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); - ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false); + ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false); } return true; } 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 eb929787f5f..4d4f0f69799 100644 --- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp +++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp @@ -826,13 +826,13 @@ return new npc_overlord_morghorAI(_Creature); bool QuestAccept_npc_overlord_morghor(Player *player, Creature *_Creature, const Quest *_Quest ) { - if(_Quest->GetQuestId() == QUEST_LORD_ILLIDAN_STORMRAGE) - { + if(_Quest->GetQuestId() == QUEST_LORD_ILLIDAN_STORMRAGE) + { ((npc_overlord_morghorAI*)_Creature->AI())->PlayerGUID = player->GetGUID(); ((npc_overlord_morghorAI*)_Creature->AI())->StartEvent(); - return true; - } - return false; + return true; + } + return false; } /*#### @@ -1771,10 +1771,10 @@ void AddSC_shadowmoon_valley() newscript->GetAI = &GetAI_mob_enslaved_netherwing_drake; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "mob_dragonmaw_peon"; - newscript->GetAI = &GetAI_mob_dragonmaw_peon; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "mob_dragonmaw_peon"; + newscript->GetAI = &GetAI_mob_dragonmaw_peon; + newscript->RegisterSelf(); newscript = new Script; newscript->Name="npc_drake_dealer_hurlunk"; @@ -1811,13 +1811,13 @@ void AddSC_shadowmoon_valley() newscript->pGossipSelect = &GossipSelect_npc_oronok_tornheart; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "npc_overlord_morghor"; - newscript->GetAI = &GetAI_npc_overlord_morghorAI; - newscript->pQuestAccept = &QuestAccept_npc_overlord_morghor; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_overlord_morghor"; + newscript->GetAI = &GetAI_npc_overlord_morghorAI; + newscript->pQuestAccept = &QuestAccept_npc_overlord_morghor; + newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name = "npc_earthmender_wilda"; newscript->GetAI = &GetAI_npc_earthmender_wildaAI; newscript->pQuestAccept = &QuestAccept_npc_earthmender_wilda; diff --git a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp index 4c560066b85..ce86aa21b1f 100644 --- a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp +++ b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp @@ -416,168 +416,168 @@ CreatureAI* GetAI_npc_kservantAI(Creature *_Creature) # npc_dirty_larry ######*/ -#define GOSSIP_BOOK "Ezekiel said that you might have a certain book..." +#define GOSSIP_BOOK "Ezekiel said that you might have a certain book..." -#define SAY_1 -1000328 -#define SAY_2 -1000329 -#define SAY_3 -1000330 -#define SAY_4 -1000331 -#define SAY_5 -1000332 -#define SAY_GIVEUP -1000333 +#define SAY_1 -1000328 +#define SAY_2 -1000329 +#define SAY_3 -1000330 +#define SAY_4 -1000331 +#define SAY_5 -1000332 +#define SAY_GIVEUP -1000333 -#define QUEST_WBI 10231 -#define NPC_CREEPJACK 19726 -#define NPC_MALONE 19725 +#define QUEST_WBI 10231 +#define NPC_CREEPJACK 19726 +#define NPC_MALONE 19725 struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI { - npc_dirty_larryAI(Creature* c) : ScriptedAI(c) {Reset();} - - bool Event; - bool Attack; - bool Done; - - uint64 PlayerGUID; - - uint32 SayTimer; - uint32 Step; - - void Reset() - { - Event = false; - Attack = false; - Done = false; - - PlayerGUID = 0; - SayTimer = 0; - Step = 0; - - m_creature->setFaction(1194); - Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); - if(Creepjack) - { - ((Creature*)Creepjack)->AI()->EnterEvadeMode(); - Creepjack->setFaction(1194); - } - Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); - if(Malone) - { - ((Creature*)Malone)->AI()->EnterEvadeMode(); - Malone->setFaction(1194); - } - } - - uint32 NextStep(uint32 Step) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - switch(Step) - { - case 0:{ m_creature->SetInFront(player); - Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); - if(Creepjack) - Creepjack->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - 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; - case 1: DoScriptText(SAY_1, m_creature, player); return 3000; - case 2: DoScriptText(SAY_2, m_creature, player); return 5000; - case 3: DoScriptText(SAY_3, m_creature, player); return 2000; - case 4: DoScriptText(SAY_4, m_creature, player); return 2000; - case 5: DoScriptText(SAY_5, m_creature, player); return 2000; - case 6: Attack = true; return 2000; - default: return 0; - } - } - - void Aggro(Unit* who){} - - void UpdateAI(const uint32 diff) - { - if(SayTimer < diff) + npc_dirty_larryAI(Creature* c) : ScriptedAI(c) {Reset();} + + bool Event; + bool Attack; + bool Done; + + uint64 PlayerGUID; + + uint32 SayTimer; + uint32 Step; + + void Reset() + { + Event = false; + Attack = false; + Done = false; + + PlayerGUID = 0; + SayTimer = 0; + Step = 0; + + m_creature->setFaction(1194); + Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); + if(Creepjack) + { + ((Creature*)Creepjack)->AI()->EnterEvadeMode(); + Creepjack->setFaction(1194); + } + Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); + if(Malone) + { + ((Creature*)Malone)->AI()->EnterEvadeMode(); + Malone->setFaction(1194); + } + } + + uint32 NextStep(uint32 Step) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + switch(Step) + { + case 0:{ m_creature->SetInFront(player); + Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); + if(Creepjack) + Creepjack->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + 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; + case 1: DoScriptText(SAY_1, m_creature, player); return 3000; + case 2: DoScriptText(SAY_2, m_creature, player); return 5000; + case 3: DoScriptText(SAY_3, m_creature, player); return 2000; + case 4: DoScriptText(SAY_4, m_creature, player); return 2000; + case 5: DoScriptText(SAY_5, m_creature, player); return 2000; + case 6: Attack = true; return 2000; + default: return 0; + } + } + + void Aggro(Unit* who){} + + void UpdateAI(const uint32 diff) + { + if(SayTimer < diff) { if(Event) SayTimer = NextStep(++Step); }else SayTimer -= diff; - if(Attack) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - m_creature->setFaction(14); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if(player) - { - 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, m_creature); - if(Malone) - { - Malone->Attack(player, true); - Malone->setFaction(14); - Malone->GetMotionMaster()->MoveChase(player); - } - DoStartMovement(player); - AttackStart(player); - } - Attack = false; - } - - if((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1 && !Done) - { - Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); - if(Creepjack) - { - ((Creature*)Creepjack)->AI()->EnterEvadeMode(); - Creepjack->setFaction(1194); - } - Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); - if(Malone) - { - ((Creature*)Malone)->AI()->EnterEvadeMode(); - Malone->setFaction(1194); - } - m_creature->setFaction(1194); - Done = true; - DoScriptText(SAY_GIVEUP, m_creature, NULL); - m_creature->DeleteThreatList(); - m_creature->CombatStop(); - m_creature->GetMotionMaster()->MoveTargetedHome(); - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if(player) - ((Player*)player)->GroupEventHappens(QUEST_WBI, m_creature); - } - DoMeleeAttackIfReady(); - } + if(Attack) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if(player) + { + 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, m_creature); + if(Malone) + { + Malone->Attack(player, true); + Malone->setFaction(14); + Malone->GetMotionMaster()->MoveChase(player); + } + DoStartMovement(player); + AttackStart(player); + } + Attack = false; + } + + if((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1 && !Done) + { + Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); + if(Creepjack) + { + ((Creature*)Creepjack)->AI()->EnterEvadeMode(); + Creepjack->setFaction(1194); + } + Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); + if(Malone) + { + ((Creature*)Malone)->AI()->EnterEvadeMode(); + Malone->setFaction(1194); + } + m_creature->setFaction(1194); + Done = true; + DoScriptText(SAY_GIVEUP, m_creature, NULL); + m_creature->DeleteThreatList(); + m_creature->CombatStop(); + m_creature->GetMotionMaster()->MoveTargetedHome(); + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if(player) + ((Player*)player)->GroupEventHappens(QUEST_WBI, m_creature); + } + DoMeleeAttackIfReady(); + } }; bool GossipHello_npc_dirty_larry(Player *player, Creature *creature) { - if (creature->isQuestGiver()) + if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); - if(player->GetQuestStatus(QUEST_WBI) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(0, GOSSIP_BOOK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + if(player->GetQuestStatus(QUEST_WBI) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(0, GOSSIP_BOOK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(creature->GetNpcTextId(), creature->GetGUID()); - return true; + player->SEND_GOSSIP_MENU(creature->GetNpcTextId(), creature->GetGUID()); + return true; } bool GossipSelect_npc_dirty_larry(Player *player, Creature *creature, uint32 sender, uint32 action ) { - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - ((npc_dirty_larryAI*)creature->AI())->Event = true; - ((npc_dirty_larryAI*)creature->AI())->PlayerGUID = player->GetGUID(); - player->CLOSE_GOSSIP_MENU(); - } - - return true; + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + ((npc_dirty_larryAI*)creature->AI())->Event = true; + ((npc_dirty_larryAI*)creature->AI())->PlayerGUID = player->GetGUID(); + player->CLOSE_GOSSIP_MENU(); + } + + return true; } CreatureAI* GetAI_npc_dirty_larryAI(Creature *_Creature) @@ -594,8 +594,8 @@ CreatureAI* GetAI_npc_dirty_larryAI(Creature *_Creature) bool GossipHello_npc_ishanah(Player *player, Creature *_Creature) { - if (_Creature->isQuestGiver()) - player->PrepareQuestMenu(_Creature->GetGUID()); + if (_Creature->isQuestGiver()) + player->PrepareQuestMenu(_Creature->GetGUID()); player->ADD_GOSSIP_ITEM(0, ISANAH_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->ADD_GOSSIP_ITEM(0, ISANAH_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -619,60 +619,60 @@ bool GossipSelect_npc_ishanah(Player *player, Creature *_Creature, uint32 sender # npc_khadgar ######*/ -#define KHADGAR_GOSSIP_1 "I've heard your name spoken only in whispers, mage. Who are you?" -#define KHADGAR_GOSSIP_2 "Go on, please." -#define KHADGAR_GOSSIP_3 "I see." //6th too this -#define KHADGAR_GOSSIP_4 "What did you do then?" -#define KHADGAR_GOSSIP_5 "What happened next?" -#define KHADGAR_GOSSIP_7 "There was something else I wanted to ask you." +#define KHADGAR_GOSSIP_1 "I've heard your name spoken only in whispers, mage. Who are you?" +#define KHADGAR_GOSSIP_2 "Go on, please." +#define KHADGAR_GOSSIP_3 "I see." //6th too this +#define KHADGAR_GOSSIP_4 "What did you do then?" +#define KHADGAR_GOSSIP_5 "What happened next?" +#define KHADGAR_GOSSIP_7 "There was something else I wanted to ask you." bool GossipHello_npc_khadgar(Player *player, Creature *creature) { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); - if(!player->hasQuest(10211)) - player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + if(!player->hasQuest(10211)) + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(9243, creature->GetGUID()); + player->SEND_GOSSIP_MENU(9243, creature->GetGUID()); - return true; + return true; } bool GossipSelect_npc_khadgar(Player *player, Creature *creature, uint32 sender, uint32 action) { - switch(action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(9876, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(9877, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(9878, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(9879, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - player->SEND_GOSSIP_MENU(9880, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); - player->SEND_GOSSIP_MENU(9881, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(9243, creature->GetGUID()); - break; - } - return true; + switch(action) + { + case GOSSIP_ACTION_INFO_DEF+1: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->SEND_GOSSIP_MENU(9876, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + player->SEND_GOSSIP_MENU(9877, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + player->SEND_GOSSIP_MENU(9878, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->SEND_GOSSIP_MENU(9879, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + player->SEND_GOSSIP_MENU(9880, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + player->SEND_GOSSIP_MENU(9881, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(9243, creature->GetGUID()); + break; + } + return true; } void AddSC_shattrath_city() @@ -708,22 +708,22 @@ void AddSC_shattrath_city() newscript->GetAI = &GetAI_npc_kservantAI; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name="npc_dirty_larry"; - newscript->GetAI = &GetAI_npc_dirty_larryAI; - newscript->pGossipHello = &GossipHello_npc_dirty_larry; - newscript->pGossipSelect = &GossipSelect_npc_dirty_larry; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="npc_dirty_larry"; + newscript->GetAI = &GetAI_npc_dirty_larryAI; + newscript->pGossipHello = &GossipHello_npc_dirty_larry; + newscript->pGossipSelect = &GossipSelect_npc_dirty_larry; + newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="npc_ishanah"; newscript->pGossipHello = &GossipHello_npc_ishanah; newscript->pGossipSelect = &GossipSelect_npc_ishanah; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name="npc_khadgar"; - newscript->pGossipHello = &GossipHello_npc_khadgar; + newscript = new Script; + newscript->Name="npc_khadgar"; + newscript->pGossipHello = &GossipHello_npc_khadgar; newscript->pGossipSelect = &GossipSelect_npc_khadgar; newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/silithus/silithus.cpp b/src/bindings/scripts/scripts/zone/silithus/silithus.cpp index 443a9a709c7..b2fb697811a 100644 --- a/src/bindings/scripts/scripts/zone/silithus/silithus.cpp +++ b/src/bindings/scripts/scripts/zone/silithus/silithus.cpp @@ -42,55 +42,55 @@ EndContentData */ bool GossipHello_npc_highlord_demitrian(Player *player, Creature *_Creature) { - if (_Creature->isQuestGiver()) - player->PrepareQuestMenu(_Creature->GetGUID()); + if (_Creature->isQuestGiver()) + player->PrepareQuestMenu(_Creature->GetGUID()); - if (player->GetQuestStatus(7785) == QUEST_STATUS_NONE && - (player->HasItemCount(18563,1,false) || player->HasItemCount(18564,1,false))) - player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + if (player->GetQuestStatus(7785) == QUEST_STATUS_NONE && + (player->HasItemCount(18563,1,false) || player->HasItemCount(18564,1,false))) + player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(6812, _Creature->GetGUID()); - return true; + player->SEND_GOSSIP_MENU(6812, _Creature->GetGUID()); + return true; } bool GossipSelect_npc_highlord_demitrian(Player *player, Creature *_Creature, uint32 sender, uint32 action) { - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(6842, _Creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(6843, _Creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(6844, _Creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(6867, _Creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(6868, _Creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - player->SEND_GOSSIP_MENU(6869, _Creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->SEND_GOSSIP_MENU(6870, _Creature->GetGUID()); - - ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 19016, 1); - if (msg == EQUIP_ERR_OK) - player->StoreNewItem(dest, 19016, true); - break; - } - return true; + switch (action) + { + case GOSSIP_ACTION_INFO_DEF: + player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(6842, _Creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->SEND_GOSSIP_MENU(6843, _Creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + player->SEND_GOSSIP_MENU(6844, _Creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + player->SEND_GOSSIP_MENU(6867, _Creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->SEND_GOSSIP_MENU(6868, _Creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + player->ADD_GOSSIP_ITEM(0, GOSSIP_DEMITRIAN7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + player->SEND_GOSSIP_MENU(6869, _Creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + player->SEND_GOSSIP_MENU(6870, _Creature->GetGUID()); + + ItemPosCountVec dest; + uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 19016, 1); + if (msg == EQUIP_ERR_OK) + player->StoreNewItem(dest, 19016, true); + break; + } + return true; } /*### @@ -208,13 +208,13 @@ void AddSC_silithus() { Script *newscript; - newscript = new Script; - newscript->Name = "npc_highlord_demitrian"; - newscript->pGossipHello = &GossipHello_npc_highlord_demitrian; - newscript->pGossipSelect = &GossipSelect_npc_highlord_demitrian; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_highlord_demitrian"; + newscript->pGossipHello = &GossipHello_npc_highlord_demitrian; + newscript->pGossipSelect = &GossipSelect_npc_highlord_demitrian; + newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="npcs_rutgar_and_frankal"; newscript->pGossipHello = &GossipHello_npcs_rutgar_and_frankal; newscript->pGossipSelect = &GossipSelect_npcs_rutgar_and_frankal; 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 05890cd67aa..73c708d4a21 100644 --- a/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp +++ b/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp @@ -91,86 +91,86 @@ bool GossipSelect_npc_astor_hadren(Player *player, Creature *_Creature, uint32 s ## npc_deathstalker_erland ######*/ -#define SAY_QUESTACCEPT -1000335 -#define SAY_START -1000336 -#define SAY_AGGRO_1 -1000337 -#define SAY_AGGRO_2 -1000338 -#define SAY_LAST -1000339 +#define SAY_QUESTACCEPT -1000335 +#define SAY_START -1000336 +#define SAY_AGGRO_1 -1000337 +#define SAY_AGGRO_2 -1000338 +#define SAY_LAST -1000339 -#define SAY_THANKS -1000340 -#define SAY_RANE -1000341 -#define SAY_ANSWER -1000342 -#define SAY_MOVE_QUINN -1000343 +#define SAY_THANKS -1000340 +#define SAY_RANE -1000341 +#define SAY_ANSWER -1000342 +#define SAY_MOVE_QUINN -1000343 -#define SAY_GREETINGS -1000344 -#define SAY_QUINN -1000345 -#define SAY_ON_BYE -1000346 +#define SAY_GREETINGS -1000344 +#define SAY_QUINN -1000345 +#define SAY_ON_BYE -1000346 -#define QUEST_ESCORTING 435 -#define NPC_RANE 1950 -#define NPC_QUINN 1951 +#define QUEST_ESCORTING 435 +#define NPC_RANE 1950 +#define NPC_QUINN 1951 struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI { - npc_deathstalker_erlandAI(Creature *c) : npc_escortAI(c) {Reset();} + npc_deathstalker_erlandAI(Creature *c) : npc_escortAI(c) {Reset();} - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (!player) + if (!player) return; - switch(i) - { - case 1: DoScriptText(SAY_START, m_creature, player);break; - case 13: - DoScriptText(SAY_LAST, m_creature, player); + switch(i) + { + case 1: DoScriptText(SAY_START, m_creature, player);break; + case 13: + DoScriptText(SAY_LAST, m_creature, player); if(player) ((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, m_creature); - if(Rane) - DoScriptText(SAY_RANE, Rane); - break;} - case 16: DoScriptText(SAY_ANSWER, m_creature);break; - 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, m_creature); - if(Quinn) - DoScriptText(SAY_QUINN, Quinn); - break;} - case 26: DoScriptText(SAY_ON_BYE, m_creature, NULL);break; - - } - } - - void Reset() {} - - void Aggro(Unit* who) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature, who);break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature, who);break; - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + case 14: DoScriptText(SAY_THANKS, m_creature, player);break; + case 15: { + Unit* Rane = FindCreature(NPC_RANE, 20, m_creature); + if(Rane) + DoScriptText(SAY_RANE, Rane); + break;} + case 16: DoScriptText(SAY_ANSWER, m_creature);break; + 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, m_creature); + if(Quinn) + DoScriptText(SAY_QUINN, Quinn); + break;} + case 26: DoScriptText(SAY_ON_BYE, m_creature, NULL);break; + + } + } + + void Reset() {} + + void Aggro(Unit* who) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature, who);break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature, who);break; + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; bool QuestAccept_npc_deathstalker_erland(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == QUEST_ESCORTING) - { - DoScriptText(SAY_QUESTACCEPT, creature, player); - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - } + { + DoScriptText(SAY_QUESTACCEPT, creature, player); + ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + } return true; } @@ -179,35 +179,35 @@ CreatureAI* GetAI_npc_deathstalker_erlandAI(Creature *_Creature) { npc_deathstalker_erlandAI* deathstalker_erlandAI = new npc_deathstalker_erlandAI(_Creature); - deathstalker_erlandAI->AddWaypoint(0, 1406.32, 1083.10, 52.55); - deathstalker_erlandAI->AddWaypoint(1, 1400.49, 1080.42, 52.50); //first say - deathstalker_erlandAI->AddWaypoint(2, 1388.48, 1083.10, 52.52); - deathstalker_erlandAI->AddWaypoint(3, 1370.16, 1084.02, 52.30); - deathstalker_erlandAI->AddWaypoint(4, 1359.02, 1080.85, 52.46); - deathstalker_erlandAI->AddWaypoint(5, 1341.43, 1087.39, 52.69); - deathstalker_erlandAI->AddWaypoint(6, 1321.93, 1090.51, 50.66); - deathstalker_erlandAI->AddWaypoint(7, 1312.98, 1095.91, 47.49); - deathstalker_erlandAI->AddWaypoint(8, 1301.09, 1102.94, 47.76); - deathstalker_erlandAI->AddWaypoint(9, 1297.73, 1106.35, 50.18); - deathstalker_erlandAI->AddWaypoint(10, 1295.49, 1124.32, 50.49); - deathstalker_erlandAI->AddWaypoint(11, 1294.84, 1137.25, 51.75); - deathstalker_erlandAI->AddWaypoint(12, 1292.89, 1158.99, 52.65); - deathstalker_erlandAI->AddWaypoint(13, 1290.75, 1168.67, 52.56, 1000); //complete quest and say last - deathstalker_erlandAI->AddWaypoint(14, 1287.12, 1203.49, 52.66, 5000); - deathstalker_erlandAI->AddWaypoint(15, 1287.12, 1203.49, 52.66, 4000); - deathstalker_erlandAI->AddWaypoint(16, 1287.12, 1203.49, 52.66, 5000); - deathstalker_erlandAI->AddWaypoint(17, 1287.12, 1203.49, 52.66, 4000); - deathstalker_erlandAI->AddWaypoint(18, 1290.72, 1207.44, 52.69); - deathstalker_erlandAI->AddWaypoint(19, 1297.50, 1207.18, 53.74); - deathstalker_erlandAI->AddWaypoint(20, 1301.32, 1220.90, 53.74); - deathstalker_erlandAI->AddWaypoint(21, 1298.55, 1220.43, 53.74); - deathstalker_erlandAI->AddWaypoint(22, 1297.59, 1211.23, 58.47); - deathstalker_erlandAI->AddWaypoint(23, 1305.01, 1206.10, 58.51); - deathstalker_erlandAI->AddWaypoint(24, 1310.51, 1207.36, 58.51, 5000); - deathstalker_erlandAI->AddWaypoint(25, 1310.51, 1207.36, 58.51, 5000); - deathstalker_erlandAI->AddWaypoint(26, 1310.51, 1207.36, 58.51, 2000); - - return (CreatureAI*)deathstalker_erlandAI; + deathstalker_erlandAI->AddWaypoint(0, 1406.32, 1083.10, 52.55); + deathstalker_erlandAI->AddWaypoint(1, 1400.49, 1080.42, 52.50); //first say + deathstalker_erlandAI->AddWaypoint(2, 1388.48, 1083.10, 52.52); + deathstalker_erlandAI->AddWaypoint(3, 1370.16, 1084.02, 52.30); + deathstalker_erlandAI->AddWaypoint(4, 1359.02, 1080.85, 52.46); + deathstalker_erlandAI->AddWaypoint(5, 1341.43, 1087.39, 52.69); + deathstalker_erlandAI->AddWaypoint(6, 1321.93, 1090.51, 50.66); + deathstalker_erlandAI->AddWaypoint(7, 1312.98, 1095.91, 47.49); + deathstalker_erlandAI->AddWaypoint(8, 1301.09, 1102.94, 47.76); + deathstalker_erlandAI->AddWaypoint(9, 1297.73, 1106.35, 50.18); + deathstalker_erlandAI->AddWaypoint(10, 1295.49, 1124.32, 50.49); + deathstalker_erlandAI->AddWaypoint(11, 1294.84, 1137.25, 51.75); + deathstalker_erlandAI->AddWaypoint(12, 1292.89, 1158.99, 52.65); + deathstalker_erlandAI->AddWaypoint(13, 1290.75, 1168.67, 52.56, 1000); //complete quest and say last + deathstalker_erlandAI->AddWaypoint(14, 1287.12, 1203.49, 52.66, 5000); + deathstalker_erlandAI->AddWaypoint(15, 1287.12, 1203.49, 52.66, 4000); + deathstalker_erlandAI->AddWaypoint(16, 1287.12, 1203.49, 52.66, 5000); + deathstalker_erlandAI->AddWaypoint(17, 1287.12, 1203.49, 52.66, 4000); + deathstalker_erlandAI->AddWaypoint(18, 1290.72, 1207.44, 52.69); + deathstalker_erlandAI->AddWaypoint(19, 1297.50, 1207.18, 53.74); + deathstalker_erlandAI->AddWaypoint(20, 1301.32, 1220.90, 53.74); + deathstalker_erlandAI->AddWaypoint(21, 1298.55, 1220.43, 53.74); + deathstalker_erlandAI->AddWaypoint(22, 1297.59, 1211.23, 58.47); + deathstalker_erlandAI->AddWaypoint(23, 1305.01, 1206.10, 58.51); + deathstalker_erlandAI->AddWaypoint(24, 1310.51, 1207.36, 58.51, 5000); + deathstalker_erlandAI->AddWaypoint(25, 1310.51, 1207.36, 58.51, 5000); + deathstalker_erlandAI->AddWaypoint(26, 1310.51, 1207.36, 58.51, 2000); + + return (CreatureAI*)deathstalker_erlandAI; } /*###### @@ -225,9 +225,9 @@ void AddSC_silverpine_forest() newscript->GetAI = &GetAI_npc_astor_hadren; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name="npc_deathstalker_erland"; - newscript->GetAI = &GetAI_npc_deathstalker_erlandAI; - newscript->pQuestAccept = &QuestAccept_npc_deathstalker_erland; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="npc_deathstalker_erland"; + newscript->GetAI = &GetAI_npc_deathstalker_erlandAI; + newscript->pQuestAccept = &QuestAccept_npc_deathstalker_erland; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp b/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp index 40d3a5c7b9d..b20998b5884 100644 --- a/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp +++ b/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp @@ -80,65 +80,65 @@ bool GossipSelect_npc_braug_dimspirit(Player *player, Creature *_Creature, uint3 ## npc_kaya_flathoof ######*/ -#define SAY_START -1000347 -#define SAY_AMBUSH -1000348 -#define SAY_END -1000349 +#define SAY_START -1000347 +#define SAY_AMBUSH -1000348 +#define SAY_END -1000349 -#define QUEST_PK 6523 -#define MOB_GB 11912 -#define MOB_GR 11910 -#define MOB_GS 11913 +#define QUEST_PK 6523 +#define MOB_GB 11912 +#define MOB_GR 11910 +#define MOB_GS 11913 struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI { - npc_kaya_flathoofAI(Creature* c) : npc_escortAI(c) {Reset();} - - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - if(!player) - return; - - switch(i) - { - case 22: - DoScriptText(SAY_AMBUSH, m_creature); - m_creature->SummonCreature(MOB_GB, -48.53, -503.34, -46.31, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - m_creature->SummonCreature(MOB_GR, -38.85, -503.77, -45.90, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - m_creature->SummonCreature(MOB_GS, -36.37, -496.23, -45.71, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 23: m_creature->SetInFront(player); - DoScriptText(SAY_END, m_creature, player); - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_PK, m_creature); - break; - } - } - - void JustSummoned(Creature* summoned) + npc_kaya_flathoofAI(Creature* c) : npc_escortAI(c) {Reset();} + + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if(!player) + return; + + switch(i) + { + case 22: + DoScriptText(SAY_AMBUSH, m_creature); + m_creature->SummonCreature(MOB_GB, -48.53, -503.34, -46.31, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(MOB_GR, -38.85, -503.77, -45.90, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(MOB_GS, -36.37, -496.23, -45.71, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 23: m_creature->SetInFront(player); + DoScriptText(SAY_END, m_creature, player); + if (player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->GroupEventHappens(QUEST_PK, m_creature); + break; + } + } + + void JustSummoned(Creature* summoned) { summoned->AI()->AttackStart(m_creature); } - void Reset(){} + void Reset(){} - void Aggro(Unit* who){} + void Aggro(Unit* who){} - void JustDied(Unit* killer) - { - if (PlayerGUID) + void JustDied(Unit* killer) + { + if (PlayerGUID) { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); if (player) ((Player*)player)->FailQuest(QUEST_PK); } - } + } - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; bool QuestAccept_npc_kaya_flathoof(Player* player, Creature* creature, Quest const* quest) @@ -146,43 +146,43 @@ bool QuestAccept_npc_kaya_flathoof(Player* player, Creature* creature, Quest con if (quest->GetQuestId() == QUEST_PK) { ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - DoScriptText(SAY_START, creature); - creature->setFaction(113); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + DoScriptText(SAY_START, creature); + creature->setFaction(113); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); } return true; } CreatureAI* GetAI_npc_kaya_flathoofAI(Creature *_Creature) { - npc_kaya_flathoofAI* thisAI = new npc_kaya_flathoofAI(_Creature); - - thisAI->AddWaypoint(0, 122.37, -345.80, 3.59); - thisAI->AddWaypoint(1, 113.69, -350.01, 4.54); - thisAI->AddWaypoint(2, 107.32, -353.09, 3.33); - thisAI->AddWaypoint(3, 99.25, -342.43, 2.87); - thisAI->AddWaypoint(4, 111.19, -315.60, 3.71); - thisAI->AddWaypoint(5, 109.99, -293.92, 5.16); - thisAI->AddWaypoint(6, 104.59, -268.27, 4.78); - thisAI->AddWaypoint(7, 82.80, -247.28, 5.73); - thisAI->AddWaypoint(8, 66.44, -245.99, 5.85); - thisAI->AddWaypoint(9, 34.36, -246.01, 5.97); - thisAI->AddWaypoint(10, 13.24, -245.61, 5.25); - thisAI->AddWaypoint(11, -10.27, -248.66, 4.69); - thisAI->AddWaypoint(12, -26.07, -262.76, 0.01); - thisAI->AddWaypoint(13, -33.15, -282.03, -4.12); - thisAI->AddWaypoint(14, -28.42, -315.52, -8.56); - thisAI->AddWaypoint(15, -32.05, -339.34, -10.84); - thisAI->AddWaypoint(16, -35.22, -358.11, -16.20); - thisAI->AddWaypoint(17, -51.57, -391.63, -24.85); - thisAI->AddWaypoint(18, -58.58, -409.08, -29.97); - thisAI->AddWaypoint(19, -60.37, -441.23, -36.80); - thisAI->AddWaypoint(20, -59.03, -476.39, -44.98); - thisAI->AddWaypoint(21, -53.18, -490.31, -46.11); - thisAI->AddWaypoint(22, -43.77, -497.99, -46.13, 3000);// summon - thisAI->AddWaypoint(23, -41.77, -518.15, -46.13, 5000);//end - - return (CreatureAI*)thisAI; + npc_kaya_flathoofAI* thisAI = new npc_kaya_flathoofAI(_Creature); + + thisAI->AddWaypoint(0, 122.37, -345.80, 3.59); + thisAI->AddWaypoint(1, 113.69, -350.01, 4.54); + thisAI->AddWaypoint(2, 107.32, -353.09, 3.33); + thisAI->AddWaypoint(3, 99.25, -342.43, 2.87); + thisAI->AddWaypoint(4, 111.19, -315.60, 3.71); + thisAI->AddWaypoint(5, 109.99, -293.92, 5.16); + thisAI->AddWaypoint(6, 104.59, -268.27, 4.78); + thisAI->AddWaypoint(7, 82.80, -247.28, 5.73); + thisAI->AddWaypoint(8, 66.44, -245.99, 5.85); + thisAI->AddWaypoint(9, 34.36, -246.01, 5.97); + thisAI->AddWaypoint(10, 13.24, -245.61, 5.25); + thisAI->AddWaypoint(11, -10.27, -248.66, 4.69); + thisAI->AddWaypoint(12, -26.07, -262.76, 0.01); + thisAI->AddWaypoint(13, -33.15, -282.03, -4.12); + thisAI->AddWaypoint(14, -28.42, -315.52, -8.56); + thisAI->AddWaypoint(15, -32.05, -339.34, -10.84); + thisAI->AddWaypoint(16, -35.22, -358.11, -16.20); + thisAI->AddWaypoint(17, -51.57, -391.63, -24.85); + thisAI->AddWaypoint(18, -58.58, -409.08, -29.97); + thisAI->AddWaypoint(19, -60.37, -441.23, -36.80); + thisAI->AddWaypoint(20, -59.03, -476.39, -44.98); + thisAI->AddWaypoint(21, -53.18, -490.31, -46.11); + thisAI->AddWaypoint(22, -43.77, -497.99, -46.13, 3000);// summon + thisAI->AddWaypoint(23, -41.77, -518.15, -46.13, 5000);//end + + return (CreatureAI*)thisAI; } /*###### @@ -199,9 +199,9 @@ void AddSC_stonetalon_mountains() newscript->pGossipSelect = &GossipSelect_npc_braug_dimspirit; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name="npc_kaya_flathoof"; - newscript->GetAI = &GetAI_npc_kaya_flathoofAI; - newscript->pQuestAccept = &QuestAccept_npc_kaya_flathoof; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="npc_kaya_flathoof"; + newscript->GetAI = &GetAI_npc_kaya_flathoofAI; + newscript->pQuestAccept = &QuestAccept_npc_kaya_flathoof; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp b/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp index 0eb90f5702e..e517a17d766 100644 --- a/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp +++ b/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp @@ -72,8 +72,8 @@ struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI void UpdateAI(const uint32 diff) { if (bReset) - { - if(Reset_Timer < diff) + { + if(Reset_Timer < diff) { EnterEvadeMode(); bReset = false; diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp index 48eb910dd4b..4a49dae13bc 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp @@ -77,13 +77,13 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_baron_rivendareAI : public ScriptedAI { - boss_baron_rivendareAI(Creature *c) : ScriptedAI(c) - { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); - Reset(); - } + boss_baron_rivendareAI(Creature *c) : ScriptedAI(c) + { + pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + Reset(); + } - ScriptedInstance* pInstance; + ScriptedInstance* pInstance; uint32 ShadowBolt_Timer; uint32 Cleave_Timer; @@ -103,21 +103,21 @@ struct TRINITY_DLL_DECL boss_baron_rivendareAI : public ScriptedAI void Aggro(Unit *who) { - if (pInstance) - pInstance->SetData(TYPE_BARON,IN_PROGRESS); + if (pInstance) + pInstance->SetData(TYPE_BARON,IN_PROGRESS); } - void JustSummoned(Creature* summoned) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } + void JustSummoned(Creature* summoned) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(TYPE_BARON,DONE); - } + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(TYPE_BARON,DONE); + } void UpdateAI(const uint32 diff) { @@ -127,7 +127,7 @@ struct TRINITY_DLL_DECL boss_baron_rivendareAI : public ScriptedAI //ShadowBolt if (ShadowBolt_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT); ShadowBolt_Timer = 10000; @@ -136,7 +136,7 @@ struct TRINITY_DLL_DECL boss_baron_rivendareAI : public ScriptedAI //Cleave if (Cleave_Timer < diff) { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); + DoCast(m_creature->getVictim(),SPELL_CLEAVE); //13 seconds until we should cast this again Cleave_Timer = 7000 + (rand()%10000); }else Cleave_Timer -= diff; @@ -144,26 +144,26 @@ struct TRINITY_DLL_DECL boss_baron_rivendareAI : public ScriptedAI //MortalStrike if (MortalStrike_Timer < diff) { - DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE); - MortalStrike_Timer = 10000 + (rand()%15000); + DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE); + MortalStrike_Timer = 10000 + (rand()%15000); }else MortalStrike_Timer -= diff; //RaiseDead // if (RaiseDead_Timer < diff) - // { - // DoCast(m_creature,SPELL_RAISEDEAD); + // { + // DoCast(m_creature,SPELL_RAISEDEAD); // RaiseDead_Timer = 45000; // }else RaiseDead_Timer -= diff; //SummonSkeletons if (SummonSkeletons_Timer < diff) { - m_creature->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,29000); //34 seconds until we should cast this again SummonSkeletons_Timer = 40000; diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp index 438d7f6501b..108ae8bb9d3 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp @@ -31,13 +31,13 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_baroness_anastariAI : public ScriptedAI { - boss_baroness_anastariAI(Creature *c) : ScriptedAI(c) - { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); - Reset(); - } + boss_baroness_anastariAI(Creature *c) : ScriptedAI(c) + { + pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + Reset(); + } - ScriptedInstance* pInstance; + ScriptedInstance* pInstance; uint32 BansheeWail_Timer; uint32 BansheeCurse_Timer; @@ -56,11 +56,11 @@ struct TRINITY_DLL_DECL boss_baroness_anastariAI : public ScriptedAI { } - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(TYPE_BARONESS,IN_PROGRESS); - } + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(TYPE_BARONESS,IN_PROGRESS); + } void UpdateAI(const uint32 diff) { @@ -70,8 +70,8 @@ struct TRINITY_DLL_DECL boss_baroness_anastariAI : public ScriptedAI //BansheeWail if (BansheeWail_Timer < diff) { - if (rand()%100 < 95) - DoCast(m_creature->getVictim(),SPELL_BANSHEEWAIL); + if (rand()%100 < 95) + DoCast(m_creature->getVictim(),SPELL_BANSHEEWAIL); //4 seconds until we should cast this again BansheeWail_Timer = 4000; }else BansheeWail_Timer -= diff; @@ -88,8 +88,8 @@ struct TRINITY_DLL_DECL boss_baroness_anastariAI : public ScriptedAI //Silence if (Silence_Timer < diff) { - if (rand()%100 < 80) - DoCast(m_creature->getVictim(),SPELL_SILENCE); + if (rand()%100 < 80) + DoCast(m_creature->getVictim(),SPELL_SILENCE); //13 seconds until we should cast this again Silence_Timer = 13000; }else Silence_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp index 89f1cafcaaa..95f2a5670dc 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp @@ -34,45 +34,45 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_magistrate_barthilasAI : public ScriptedAI { - boss_magistrate_barthilasAI(Creature *c) : ScriptedAI(c) - { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); - Reset(); - } + boss_magistrate_barthilasAI(Creature *c) : ScriptedAI(c) + { + pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + Reset(); + } - ScriptedInstance* pInstance; + ScriptedInstance* pInstance; uint32 DrainingBlow_Timer; uint32 CrowdPummel_Timer; uint32 MightyBlow_Timer; uint32 FuriousAnger_Timer; - uint32 AngerCount; + uint32 AngerCount; void Reset() { - DrainingBlow_Timer = 20000; - CrowdPummel_Timer = 15000; - MightyBlow_Timer = 10000; - FuriousAnger_Timer = 5000; - AngerCount = 0; - - if (m_creature->isAlive()) - m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NORMAL); - else - m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_HUMAN); - } - - void MoveInLineOfSight(Unit *who) - { - //nothing to see here yet - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustDied(Unit* Killer) - { - m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_HUMAN); - } + DrainingBlow_Timer = 20000; + CrowdPummel_Timer = 15000; + MightyBlow_Timer = 10000; + FuriousAnger_Timer = 5000; + AngerCount = 0; + + if (m_creature->isAlive()) + m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NORMAL); + else + m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_HUMAN); + } + + void MoveInLineOfSight(Unit *who) + { + //nothing to see here yet + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit* Killer) + { + m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_HUMAN); + } void Aggro(Unit *who) { @@ -84,35 +84,35 @@ struct TRINITY_DLL_DECL boss_magistrate_barthilasAI : public ScriptedAI if (!UpdateVictim()) return; - if (FuriousAnger_Timer < diff) - { - FuriousAnger_Timer = 4000; - if (AngerCount > 25) - return; + if (FuriousAnger_Timer < diff) + { + FuriousAnger_Timer = 4000; + if (AngerCount > 25) + return; - ++AngerCount; - m_creature->CastSpell(m_creature,SPELL_FURIOUS_ANGER,false); - }else FuriousAnger_Timer -= diff; + ++AngerCount; + m_creature->CastSpell(m_creature,SPELL_FURIOUS_ANGER,false); + }else FuriousAnger_Timer -= diff; //DrainingBlow if (DrainingBlow_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_DRAININGBLOW); - DrainingBlow_Timer = 15000; + DrainingBlow_Timer = 15000; }else DrainingBlow_Timer -= diff; //CrowdPummel if (CrowdPummel_Timer < diff) { - DoCast(m_creature->getVictim(),SPELL_CROWDPUMMEL); - CrowdPummel_Timer = 15000; + DoCast(m_creature->getVictim(),SPELL_CROWDPUMMEL); + CrowdPummel_Timer = 15000; }else CrowdPummel_Timer -= diff; //MightyBlow if (MightyBlow_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW); - MightyBlow_Timer = 20000; + MightyBlow_Timer = 20000; }else MightyBlow_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp index f980df57c5e..7e3d8340c4e 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp @@ -31,13 +31,13 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_maleki_the_pallidAI : public ScriptedAI { - boss_maleki_the_pallidAI(Creature *c) : ScriptedAI(c) - { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); - Reset(); - } + boss_maleki_the_pallidAI(Creature *c) : ScriptedAI(c) + { + pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + Reset(); + } - ScriptedInstance* pInstance; + ScriptedInstance* pInstance; uint32 Frostbolt_Timer; uint32 IceTomb_Timer; @@ -54,11 +54,11 @@ struct TRINITY_DLL_DECL boss_maleki_the_pallidAI : public ScriptedAI { } - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(TYPE_PALLID,IN_PROGRESS); - } + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(TYPE_PALLID,IN_PROGRESS); + } void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp index 57fa122e6c0..a9441c6008f 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp @@ -31,13 +31,13 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI { - boss_nerubenkanAI(Creature *c) : ScriptedAI(c) - { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); - Reset(); - } + boss_nerubenkanAI(Creature *c) : ScriptedAI(c) + { + pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + Reset(); + } - ScriptedInstance* pInstance; + ScriptedInstance* pInstance; uint32 EncasingWebs_Timer; uint32 PierceArmor_Timer; @@ -60,11 +60,11 @@ struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI { } - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(TYPE_NERUB,IN_PROGRESS); - } + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(TYPE_NERUB,IN_PROGRESS); + } void RaiseUndeadScarab(Unit* victim) { diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp index 2f2186f5749..5984a60ac9c 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp @@ -31,13 +31,13 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_ramstein_the_gorgerAI : public ScriptedAI { - boss_ramstein_the_gorgerAI(Creature *c) : ScriptedAI(c) - { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); - Reset(); - } + boss_ramstein_the_gorgerAI(Creature *c) : ScriptedAI(c) + { + pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + Reset(); + } - ScriptedInstance* pInstance; + ScriptedInstance* pInstance; uint32 Trample_Timer; uint32 Knockout_Timer; @@ -52,14 +52,14 @@ struct TRINITY_DLL_DECL boss_ramstein_the_gorgerAI : public ScriptedAI { } - void JustDied(Unit* Killer) - { - for(uint8 i = 0; i < 30; i++) - m_creature->SummonCreature(C_MINDLESS_UNDEAD,3969.35,-3391.87,119.11,5.91,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); + void JustDied(Unit* Killer) + { + for(uint8 i = 0; i < 30; i++) + m_creature->SummonCreature(C_MINDLESS_UNDEAD,3969.35,-3391.87,119.11,5.91,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); - if (pInstance) - pInstance->SetData(TYPE_RAMSTEIN,DONE); - } + if (pInstance) + pInstance->SetData(TYPE_RAMSTEIN,DONE); + } void UpdateAI(const uint32 diff) { @@ -77,7 +77,7 @@ struct TRINITY_DLL_DECL boss_ramstein_the_gorgerAI : public ScriptedAI //Knockout if (Knockout_Timer < diff) { - DoCast(m_creature->getVictim(),SPELL_KNOCKOUT); + DoCast(m_creature->getVictim(),SPELL_KNOCKOUT); Knockout_Timer = 10000; }else Knockout_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp index fbabfa7b3f8..108bfd1dbc0 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp @@ -51,332 +51,332 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance { instance_stratholme(Map *map) : ScriptedInstance(map) {Initialize();}; - uint32 Encounter[ENCOUNTERS]; - - bool IsSilverHandDead[5]; - - uint32 BaronRun_Timer; - uint32 SlaugtherSquare_Timer; - - uint64 serviceEntranceGUID; - uint64 gauntletGate1GUID; - uint64 ziggurat1GUID; - uint64 ziggurat2GUID; - uint64 ziggurat3GUID; - uint64 ziggurat4GUID; - uint64 ziggurat5GUID; - uint64 portGauntletGUID; - uint64 portSlaugtherGUID; - uint64 portElderGUID; - - uint64 baronGUID; - uint64 ysidaTriggerGUID; - std::set crystalsGUID; - std::set abomnationGUID; - - void Initialize() - { - for(uint8 i = 0; i < ENCOUNTERS; i++) - Encounter[i] = NOT_STARTED; - - for(uint8 i = 0; i < 5; i++) - IsSilverHandDead[5] = false; - - BaronRun_Timer = 0; - SlaugtherSquare_Timer = 0; - - serviceEntranceGUID = 0; - gauntletGate1GUID = 0; - ziggurat1GUID = 0; - ziggurat2GUID = 0; - ziggurat3GUID = 0; - ziggurat4GUID = 0; - ziggurat5GUID = 0; - portGauntletGUID = 0; - portSlaugtherGUID = 0; - portElderGUID = 0; - - baronGUID = 0; - ysidaTriggerGUID = 0; - crystalsGUID.clear(); - abomnationGUID.clear(); - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("SD2: Instance Stratholme: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - bool StartSlaugtherSquare() - { - //change to DONE when crystals implemented - if (Encounter[1] == IN_PROGRESS && Encounter[2] == IN_PROGRESS && Encounter[3] == IN_PROGRESS) - { - UpdateGoState(portGauntletGUID,0,false); - UpdateGoState(portSlaugtherGUID,0,false); - return true; - } - - debug_log("SD2: Instance Stratholme: Cannot open slaugther square yet."); - return false; - } - - //if withRestoreTime true, then newState will be ignored and GO should be restored to original state after 10 seconds - void UpdateGoState(uint64 goGuid, uint32 newState, bool withRestoreTime) - { - Player *player = GetPlayerInMap(); - - if (!player || !goGuid) - return; - - if (GameObject *go = GameObject::GetGameObject(*player, goGuid)) - { - if (withRestoreTime) - go->UseDoorOrButton(10); - else - go->SetGoState(newState); - } - } - - void OnCreatureCreate(Creature *creature, uint32 creature_entry) - { - switch(creature->GetEntry()) - { - case C_BARON: baronGUID = creature->GetGUID(); break; - case C_YSIDA_TRIGGER: ysidaTriggerGUID = creature->GetGUID(); break; - case C_CRYSTAL: crystalsGUID.insert(creature->GetGUID()); break; - case C_ABOM_BILE: - case C_ABOM_VENOM: abomnationGUID.insert(creature->GetGUID()); break; - } - } - - void OnObjectCreate(GameObject *go) - { - switch(go->GetEntry()) - { - case GO_SERVICE_ENTRANCE: serviceEntranceGUID = go->GetGUID(); break; - case GO_GAUNTLET_GATE1: - //weird, but unless flag is set, client will not respond as expected. DB bug? - go->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_LOCKED); - gauntletGate1GUID = go->GetGUID(); - break; - case GO_ZIGGURAT1: ziggurat1GUID = go->GetGUID(); break; - case GO_ZIGGURAT2: ziggurat2GUID = go->GetGUID(); break; - case GO_ZIGGURAT3: ziggurat3GUID = go->GetGUID(); break; - case GO_ZIGGURAT4: ziggurat4GUID = go->GetGUID(); break; - case GO_ZIGGURAT5: ziggurat5GUID = go->GetGUID(); break; - case GO_PORT_GAUNTLET: portGauntletGUID = go->GetGUID(); break; - case GO_PORT_SLAUGTHER: portSlaugtherGUID = go->GetGUID(); break; - case GO_PORT_ELDERS: portElderGUID = go->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) + uint32 Encounter[ENCOUNTERS]; + + bool IsSilverHandDead[5]; + + uint32 BaronRun_Timer; + uint32 SlaugtherSquare_Timer; + + uint64 serviceEntranceGUID; + uint64 gauntletGate1GUID; + uint64 ziggurat1GUID; + uint64 ziggurat2GUID; + uint64 ziggurat3GUID; + uint64 ziggurat4GUID; + uint64 ziggurat5GUID; + uint64 portGauntletGUID; + uint64 portSlaugtherGUID; + uint64 portElderGUID; + + uint64 baronGUID; + uint64 ysidaTriggerGUID; + std::set crystalsGUID; + std::set abomnationGUID; + + void Initialize() { - Player *player = GetPlayerInMap(); + for(uint8 i = 0; i < ENCOUNTERS; i++) + Encounter[i] = NOT_STARTED; + + for(uint8 i = 0; i < 5; i++) + IsSilverHandDead[5] = false; + + BaronRun_Timer = 0; + SlaugtherSquare_Timer = 0; + + serviceEntranceGUID = 0; + gauntletGate1GUID = 0; + ziggurat1GUID = 0; + ziggurat2GUID = 0; + ziggurat3GUID = 0; + ziggurat4GUID = 0; + ziggurat5GUID = 0; + portGauntletGUID = 0; + portSlaugtherGUID = 0; + portElderGUID = 0; + + baronGUID = 0; + ysidaTriggerGUID = 0; + crystalsGUID.clear(); + abomnationGUID.clear(); + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("SD2: Instance Stratholme: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + bool StartSlaugtherSquare() + { + //change to DONE when crystals implemented + if (Encounter[1] == IN_PROGRESS && Encounter[2] == IN_PROGRESS && Encounter[3] == IN_PROGRESS) + { + UpdateGoState(portGauntletGUID,0,false); + UpdateGoState(portSlaugtherGUID,0,false); + return true; + } + + debug_log("SD2: Instance Stratholme: Cannot open slaugther square yet."); + return false; + } + + //if withRestoreTime true, then newState will be ignored and GO should be restored to original state after 10 seconds + void UpdateGoState(uint64 goGuid, uint32 newState, bool withRestoreTime) + { + Player *player = GetPlayerInMap(); + + if (!player || !goGuid) + return; + + if (GameObject *go = GameObject::GetGameObject(*player, goGuid)) + { + if (withRestoreTime) + go->UseDoorOrButton(10); + else + go->SetGoState(newState); + } + } + + void OnCreatureCreate(Creature *creature, uint32 creature_entry) + { + switch(creature->GetEntry()) + { + case C_BARON: baronGUID = creature->GetGUID(); break; + case C_YSIDA_TRIGGER: ysidaTriggerGUID = creature->GetGUID(); break; + case C_CRYSTAL: crystalsGUID.insert(creature->GetGUID()); break; + case C_ABOM_BILE: + case C_ABOM_VENOM: abomnationGUID.insert(creature->GetGUID()); break; + } + } + + void OnObjectCreate(GameObject *go) + { + switch(go->GetEntry()) + { + case GO_SERVICE_ENTRANCE: serviceEntranceGUID = go->GetGUID(); break; + case GO_GAUNTLET_GATE1: + //weird, but unless flag is set, client will not respond as expected. DB bug? + go->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_LOCKED); + gauntletGate1GUID = go->GetGUID(); + break; + case GO_ZIGGURAT1: ziggurat1GUID = go->GetGUID(); break; + case GO_ZIGGURAT2: ziggurat2GUID = go->GetGUID(); break; + case GO_ZIGGURAT3: ziggurat3GUID = go->GetGUID(); break; + case GO_ZIGGURAT4: ziggurat4GUID = go->GetGUID(); break; + case GO_ZIGGURAT5: ziggurat5GUID = go->GetGUID(); break; + case GO_PORT_GAUNTLET: portGauntletGUID = go->GetGUID(); break; + case GO_PORT_SLAUGTHER: portSlaugtherGUID = go->GetGUID(); break; + case GO_PORT_ELDERS: portElderGUID = go->GetGUID(); break; + } + } - if (!player) - { - debug_log("SD2: Instance Stratholme: SetData (Type: %u Data %u) cannot find any player.", type, data); - return; - } + void SetData(uint32 type, uint32 data) + { + Player *player = GetPlayerInMap(); + + if (!player) + { + debug_log("SD2: Instance Stratholme: SetData (Type: %u Data %u) cannot find any player.", type, data); + return; + } switch(type) { - case TYPE_BARON_RUN: - switch(data) - { - case IN_PROGRESS: - if (Encounter[0] == IN_PROGRESS || Encounter[0] == FAIL) - break; - BaronRun_Timer = 2700000; - debug_log("SD2: Instance Stratholme: Baron run in progress."); - break; - case FAIL: - //may add code to remove aura from players, but in theory the time should be up already and removed. - break; - case DONE: - if (Unit *t = Unit::GetUnit(*player, ysidaTriggerGUID)) - t->SummonCreature(C_YSIDA,t->GetPositionX(),t->GetPositionY(),t->GetPositionZ(),t->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1800000); - BaronRun_Timer = 0; - break; - } - Encounter[0] = data; - break; - case TYPE_BARONESS: - Encounter[1] = data; - if (data == IN_PROGRESS) - UpdateGoState(ziggurat1GUID,0,false); - if (data == IN_PROGRESS) //change to DONE when crystals implemented - StartSlaugtherSquare(); - break; - case TYPE_NERUB: - Encounter[2] = data; - if (data == IN_PROGRESS) - UpdateGoState(ziggurat2GUID,0,false); - if (data == IN_PROGRESS) //change to DONE when crystals implemented - StartSlaugtherSquare(); - break; - case TYPE_PALLID: - Encounter[3] = data; - if (data == IN_PROGRESS) - UpdateGoState(ziggurat3GUID,0,false); - if (data == IN_PROGRESS) //change to DONE when crystals implemented - StartSlaugtherSquare(); - break; - case TYPE_RAMSTEIN: - if (data == IN_PROGRESS) - { - if (Encounter[4] != IN_PROGRESS) - UpdateGoState(portGauntletGUID,1,false); - - uint32 count = abomnationGUID.size(); - for(std::set::iterator i = abomnationGUID.begin(); i != abomnationGUID.end(); ++i) - { - if (Unit* abom = Unit::GetUnit(*player, *i)) - { - if (!abom->isAlive()) - --count; - } - } - - if (!count) - { - //a bit itchy, it should close the door after 10 secs, but it doesn't. skipping it for now. - //UpdateGoState(ziggurat4GUID,0,true); - player->SummonCreature(C_RAMSTEIN,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); - debug_log("SD2: Instance Stratholme: Ramstein spawned."); - } else debug_log("SD2: Instance Stratholme: %u Abomnation left to kill.",count); - } - if (data == DONE) - { - SlaugtherSquare_Timer = 300000; - debug_log("SD2: Instance Stratholme: Slaugther event will continue in 5 minutes."); - } - Encounter[4] = data; - break; - case TYPE_BARON: - if (data == IN_PROGRESS) - { - if (GetData(TYPE_BARON_RUN) == IN_PROGRESS) - { - if (Group *pGroup = player->GetGroup()) - { - for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* pGroupie = itr->getSource(); - if (!pGroupie) - continue; - - if (pGroupie->HasAura(SPELL_BARON_ULTIMATUM,0)) - pGroupie->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); - } - } else if (player->HasAura(SPELL_BARON_ULTIMATUM,0)) - player->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); - - if (Unit *temp = Unit::GetUnit(*player,GetData64(DATA_BARON))) - player->GroupEventHappens(QUEST_DEAD_MAN_PLEA,temp); - - SetData(TYPE_BARON_RUN,DONE); - } - } - Encounter[5] = data; - break; - case TYPE_SH_AELMAR: - IsSilverHandDead[0] = (data) ? true : false; - break; - case TYPE_SH_CATHELA: - IsSilverHandDead[1] = (data) ? true : false; - break; - case TYPE_SH_GREGOR: - IsSilverHandDead[2] = (data) ? true : false; - break; - case TYPE_SH_NEMAS: - IsSilverHandDead[3] = (data) ? true : false; - break; - case TYPE_SH_VICAR: - IsSilverHandDead[4] = (data) ? true : false; - break; - } - } + case TYPE_BARON_RUN: + switch(data) + { + case IN_PROGRESS: + if (Encounter[0] == IN_PROGRESS || Encounter[0] == FAIL) + break; + BaronRun_Timer = 2700000; + debug_log("SD2: Instance Stratholme: Baron run in progress."); + break; + case FAIL: + //may add code to remove aura from players, but in theory the time should be up already and removed. + break; + case DONE: + if (Unit *t = Unit::GetUnit(*player, ysidaTriggerGUID)) + t->SummonCreature(C_YSIDA,t->GetPositionX(),t->GetPositionY(),t->GetPositionZ(),t->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1800000); + BaronRun_Timer = 0; + break; + } + Encounter[0] = data; + break; + case TYPE_BARONESS: + Encounter[1] = data; + if (data == IN_PROGRESS) + UpdateGoState(ziggurat1GUID,0,false); + if (data == IN_PROGRESS) //change to DONE when crystals implemented + StartSlaugtherSquare(); + break; + case TYPE_NERUB: + Encounter[2] = data; + if (data == IN_PROGRESS) + UpdateGoState(ziggurat2GUID,0,false); + if (data == IN_PROGRESS) //change to DONE when crystals implemented + StartSlaugtherSquare(); + break; + case TYPE_PALLID: + Encounter[3] = data; + if (data == IN_PROGRESS) + UpdateGoState(ziggurat3GUID,0,false); + if (data == IN_PROGRESS) //change to DONE when crystals implemented + StartSlaugtherSquare(); + break; + case TYPE_RAMSTEIN: + if (data == IN_PROGRESS) + { + if (Encounter[4] != IN_PROGRESS) + UpdateGoState(portGauntletGUID,1,false); + + uint32 count = abomnationGUID.size(); + for(std::set::iterator i = abomnationGUID.begin(); i != abomnationGUID.end(); ++i) + { + if (Unit* abom = Unit::GetUnit(*player, *i)) + { + if (!abom->isAlive()) + --count; + } + } + + if (!count) + { + //a bit itchy, it should close the door after 10 secs, but it doesn't. skipping it for now. + //UpdateGoState(ziggurat4GUID,0,true); + player->SummonCreature(C_RAMSTEIN,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); + debug_log("SD2: Instance Stratholme: Ramstein spawned."); + } else debug_log("SD2: Instance Stratholme: %u Abomnation left to kill.",count); + } + if (data == DONE) + { + SlaugtherSquare_Timer = 300000; + debug_log("SD2: Instance Stratholme: Slaugther event will continue in 5 minutes."); + } + Encounter[4] = data; + break; + case TYPE_BARON: + if (data == IN_PROGRESS) + { + if (GetData(TYPE_BARON_RUN) == IN_PROGRESS) + { + if (Group *pGroup = player->GetGroup()) + { + for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player* pGroupie = itr->getSource(); + if (!pGroupie) + continue; + + if (pGroupie->HasAura(SPELL_BARON_ULTIMATUM,0)) + pGroupie->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); + } + } else if (player->HasAura(SPELL_BARON_ULTIMATUM,0)) + player->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); + + if (Unit *temp = Unit::GetUnit(*player,GetData64(DATA_BARON))) + player->GroupEventHappens(QUEST_DEAD_MAN_PLEA,temp); + + SetData(TYPE_BARON_RUN,DONE); + } + } + Encounter[5] = data; + break; + case TYPE_SH_AELMAR: + IsSilverHandDead[0] = (data) ? true : false; + break; + case TYPE_SH_CATHELA: + IsSilverHandDead[1] = (data) ? true : false; + break; + case TYPE_SH_GREGOR: + IsSilverHandDead[2] = (data) ? true : false; + break; + case TYPE_SH_NEMAS: + IsSilverHandDead[3] = (data) ? true : false; + break; + case TYPE_SH_VICAR: + IsSilverHandDead[4] = (data) ? true : false; + break; + } + } uint32 GetData(uint32 type) { switch(type) - { - case TYPE_SH_QUEST: - if(IsSilverHandDead[0] && IsSilverHandDead[1] && IsSilverHandDead[2] && IsSilverHandDead[3] && IsSilverHandDead[4]) - return 1; - return 0; - case TYPE_BARON_RUN: - return Encounter[0]; - case TYPE_BARONESS: - return Encounter[1]; - case TYPE_NERUB: - return Encounter[2]; - case TYPE_PALLID: - return Encounter[3]; - case TYPE_RAMSTEIN: - return Encounter[4]; - case TYPE_BARON: - return Encounter[5]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_BARON: - return baronGUID; - case DATA_YSIDA_TRIGGER: - return ysidaTriggerGUID; - } - return 0; - } - - void Update(uint32 diff) - { - if (BaronRun_Timer) - { - if (BaronRun_Timer <= diff) - { - if (GetData(TYPE_BARON_RUN) != DONE) - SetData(TYPE_BARON_RUN, FAIL); - BaronRun_Timer = 0; - debug_log("SD2: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN)); - }else BaronRun_Timer -= diff; - } - - if (SlaugtherSquare_Timer) - { - if (SlaugtherSquare_Timer <= diff) - { - if (Player *p = GetPlayerInMap()) - { - for(uint8 i = 0; i < 4; i++) - p->SummonCreature(C_BLACK_GUARD,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); - - UpdateGoState(ziggurat4GUID,0,false); - UpdateGoState(ziggurat5GUID,0,false); - debug_log("SD2: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); - } - SlaugtherSquare_Timer = 0; - }else SlaugtherSquare_Timer -= diff; - } + { + case TYPE_SH_QUEST: + if(IsSilverHandDead[0] && IsSilverHandDead[1] && IsSilverHandDead[2] && IsSilverHandDead[3] && IsSilverHandDead[4]) + return 1; + return 0; + case TYPE_BARON_RUN: + return Encounter[0]; + case TYPE_BARONESS: + return Encounter[1]; + case TYPE_NERUB: + return Encounter[2]; + case TYPE_PALLID: + return Encounter[3]; + case TYPE_RAMSTEIN: + return Encounter[4]; + case TYPE_BARON: + return Encounter[5]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_BARON: + return baronGUID; + case DATA_YSIDA_TRIGGER: + return ysidaTriggerGUID; + } + return 0; + } + + void Update(uint32 diff) + { + if (BaronRun_Timer) + { + if (BaronRun_Timer <= diff) + { + if (GetData(TYPE_BARON_RUN) != DONE) + SetData(TYPE_BARON_RUN, FAIL); + BaronRun_Timer = 0; + debug_log("SD2: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN)); + }else BaronRun_Timer -= diff; + } + + if (SlaugtherSquare_Timer) + { + if (SlaugtherSquare_Timer <= diff) + { + if (Player *p = GetPlayerInMap()) + { + for(uint8 i = 0; i < 4; i++) + p->SummonCreature(C_BLACK_GUARD,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); + + UpdateGoState(ziggurat4GUID,0,false); + UpdateGoState(ziggurat5GUID,0,false); + debug_log("SD2: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); + } + SlaugtherSquare_Timer = 0; + }else SlaugtherSquare_Timer -= diff; + } } }; diff --git a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp index e3c11e5480c..0ce345f65dd 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp @@ -204,13 +204,13 @@ struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI float x,y,z; m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),20.0f,x,y,z); - //100%, 50%, 33%, 25% chance to spawn - uint32 j = urand(1,i); - if (j==1) - m_creature->SummonCreature(ENTRY_RESTLESS,x,y,z,0,TEMPSUMMON_CORPSE_DESPAWN,600000); - } - } - } + //100%, 50%, 33%, 25% chance to spawn + uint32 j = urand(1,i); + if (j==1) + m_creature->SummonCreature(ENTRY_RESTLESS,x,y,z,0,TEMPSUMMON_CORPSE_DESPAWN,600000); + } + } + } void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp index 9ab4009a8e7..d114ee28378 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp @@ -59,20 +59,20 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI { boss_brutallusAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } - ScriptedInstance* pInstance; + ScriptedInstance* pInstance; uint32 SlashTimer; uint32 BurnTimer; uint32 StompTimer; uint32 BerserkTimer; - uint32 ConversationTimer; - bool Intro; + uint32 ConversationTimer; + bool Intro; void Reset() { @@ -82,34 +82,34 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI BerserkTimer = 360000; m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); - if(pInstance) - pInstance->SetData(DATA_BRUTALLUS, NOT_STARTED); + if(pInstance) + pInstance->SetData(DATA_BRUTALLUS, NOT_STARTED); } void Aggro(Unit *who) { - DoScriptText(YELL_AGGRO, m_creature); + DoScriptText(YELL_AGGRO, m_creature); - if(pInstance) - pInstance->SetData(DATA_BRUTALLUS, IN_PROGRESS); + if(pInstance) + pInstance->SetData(DATA_BRUTALLUS, IN_PROGRESS); } void KilledUnit(Unit* victim) { switch(rand()%3) { - case 0: DoScriptText(YELL_KILL1, m_creature); break; - case 1: DoScriptText(YELL_KILL2, m_creature); break; - case 2: DoScriptText(YELL_KILL3, m_creature); break; + case 0: DoScriptText(YELL_KILL1, m_creature); break; + case 1: DoScriptText(YELL_KILL2, m_creature); break; + case 2: DoScriptText(YELL_KILL3, m_creature); break; } } void JustDied(Unit* Killer) { - DoScriptText(YELL_DEATH, m_creature); + DoScriptText(YELL_DEATH, m_creature); - if(pInstance) - pInstance->SetData(DATA_BRUTALLUS, DONE); + if(pInstance) + pInstance->SetData(DATA_BRUTALLUS, DONE); } void UpdateAI(const uint32 diff) @@ -119,20 +119,20 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI if(SlashTimer < diff) { - DoCast(m_creature->getVictim(),SPELL_METEOR_SLASH); + DoCast(m_creature->getVictim(),SPELL_METEOR_SLASH); SlashTimer = 11000; }else SlashTimer -= diff; if(StompTimer < diff) { - switch(rand()%3) - { - case 0: DoScriptText(YELL_LOVE1, m_creature); break; - case 1: DoScriptText(YELL_LOVE2, m_creature); break; - case 2: DoScriptText(YELL_LOVE3, m_creature); break; - } - - Unit *Target = m_creature->getVictim(); + switch(rand()%3) + { + case 0: DoScriptText(YELL_LOVE1, m_creature); break; + case 1: DoScriptText(YELL_LOVE2, m_creature); break; + case 2: DoScriptText(YELL_LOVE3, m_creature); break; + } + + Unit *Target = m_creature->getVictim(); DoCast(Target,SPELL_STOMP); if(Target->HasAura(45151,0)) Target->RemoveAura(45151,0); StompTimer = 30000; @@ -142,19 +142,19 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI { if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) target->CastSpell(target,SPELL_BURN,true); - BurnTimer = 60000; + BurnTimer = 60000; } else BurnTimer -= diff; if(BerserkTimer < diff) { - DoScriptText(YELL_BERSERK, m_creature); + DoScriptText(YELL_BERSERK, m_creature); DoCast(m_creature,SPELL_BERSERK); BerserkTimer = 20000; } else BerserkTimer -= diff; - DoMeleeAttackIfReady(); + DoMeleeAttackIfReady(); } }; diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp index a00f1ab1c2e..e7762757c4a 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp @@ -420,17 +420,17 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI { Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) - ((Creature*)Temp)->AI()->AttackStart(who); - } - } - - void AttackStart(Unit *who) - { - if (!InCombat) - { - Scripted_NoMovementAI::AttackStart(who); - } - } + ((Creature*)Temp)->AI()->AttackStart(who); + } + } + + void AttackStart(Unit *who) + { + if (!InCombat) + { + Scripted_NoMovementAI::AttackStart(who); + } + } void MoveInLineOfSight(Unit *who) { diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp index f2238af0866..3c358c1f3b6 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp @@ -169,8 +169,8 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_EVIL_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_EVIL_SLAY2, m_creature); break; + case 0: DoScriptText(SAY_EVIL_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_EVIL_SLAY2, m_creature); break; } } @@ -215,7 +215,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI switch(TalkSequence) { case 1: - DoScriptText(SAY_EVIL_ENRAGE, m_creature); + DoScriptText(SAY_EVIL_ENRAGE, m_creature); TalkTimer = 3000; break; case 2: @@ -321,7 +321,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI void JustDied(Unit *killer) { - DoScriptText(SAY_SATH_DEATH, m_creature); + DoScriptText(SAY_SATH_DEATH, m_creature); m_creature->Relocate(m_creature->GetPositionX(), m_creature->GetPositionY(), DRAGON_REALM_Z, m_creature->GetOrientation()); TeleportAllPlayersBack(); if(Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID)) @@ -381,7 +381,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI if(ShadowBoltTimer < diff) { - DoScriptText(SAY_SATH_SPELL1, m_creature); + DoScriptText(SAY_SATH_SPELL1, m_creature); DoCast(m_creature, SPELL_SHADOW_BOLT); ShadowBoltTimer = 7000+(rand()%3000); }else ShadowBoltTimer -= diff; @@ -396,7 +396,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI if(CorruptionStrikeTimer < diff) { - DoScriptText(SAY_SATH_SPELL2, m_creature); + DoScriptText(SAY_SATH_SPELL2, m_creature); DoCast(m_creature->getVictim(), SPELL_CORRUPTION_STRIKE); CorruptionStrikeTimer = 13000; }else CorruptionStrikeTimer -= diff; @@ -611,7 +611,7 @@ void boss_sathrovarrAI::Enrage() error_log("SD2 ERROR: unable to find Kalec"); return; } - DoScriptText(SAY_SATH_ENRAGE, m_creature); + DoScriptText(SAY_SATH_ENRAGE, m_creature); m_creature->CastSpell(m_creature, SPELL_ENRAGE, true); Kalecgos->CastSpell(Kalecgos, SPELL_ENRAGE, true); isEnraged = true; diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h index 95ff1f112bf..497f6d30479 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h @@ -18,7 +18,7 @@ #define DATA_KALECGOS_HUMAN 7 #define DATA_SATHROVARR 8 #define DATA_BRUTALLUS 9 -#define DATA_MADRIGOSA 24 +#define DATA_MADRIGOSA 24 #define DATA_FELMYST 10 #define DATA_ALYTHESS 11 #define DATA_SACROLASH 12 diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp index 3de2c14e93a..2bbc0160d4c 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp @@ -34,7 +34,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance uint64 Kalecgos_Human; uint64 Sathrovarr; uint64 Brutallus; - uint64 Madrigosa; + uint64 Madrigosa; uint64 Felmyst; uint64 Alythess; uint64 Sacrolash; @@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance Kalecgos_Human = 0; Sathrovarr = 0; Brutallus = 0; - Madrigosa = 0; + Madrigosa = 0; Felmyst = 0; Alythess = 0; Sacrolash = 0; @@ -102,7 +102,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance case 24891: Kalecgos_Human = creature->GetGUID(); break; case 24892: Sathrovarr = creature->GetGUID(); break; case 24882: Brutallus = creature->GetGUID(); break; - case 24895: Madrigosa = creature->GetGUID(); break; + case 24895: Madrigosa = creature->GetGUID(); break; case 25038: Felmyst = creature->GetGUID(); break; case 25166: Alythess = creature->GetGUID(); break; case 25165: Sacrolash = creature->GetGUID(); break; @@ -150,7 +150,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance case DATA_KALECGOS_HUMAN: return Kalecgos_Human; break; case DATA_SATHROVARR: return Sathrovarr; break; case DATA_BRUTALLUS: return Brutallus; break; - case DATA_MADRIGOSA: return Madrigosa; break; + case DATA_MADRIGOSA: return Madrigosa; break; case DATA_FELMYST: return Felmyst; break; case DATA_ALYTHESS: return Alythess; break; case DATA_SACROLASH: return Sacrolash; break; diff --git a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp index db1cb4c43a4..022f1d29f6b 100644 --- a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp +++ b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp @@ -158,7 +158,7 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI switch( i ) { - case 2: DoScriptText(WHISPER_CUSTODIAN_1, m_creature, pTemp); break; + case 2: DoScriptText(WHISPER_CUSTODIAN_1, m_creature, pTemp); break; case 3: DoScriptText(WHISPER_CUSTODIAN_2, m_creature, pTemp); break; case 4: DoScriptText(WHISPER_CUSTODIAN_3, m_creature, pTemp); break; case 5: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pTemp); break; @@ -370,20 +370,20 @@ bool GossipSelect_npc_stone_watcher_of_norgannon(Player *player, Creature *_Crea ## npc_OOX17 ######*/ -#define Q_OOX17 648 -#define SPAWN_FIRST 7803 -#define SPAWN_SECOND_1 5617 -#define SPAWN_SECOND_2 7805 -#define SAY_SCOFF -1060004 -#define SAY_CHICKEN_ACC -1060000 -#define SAY_CHICKEN_AGGRO_1 -1060001 +#define Q_OOX17 648 +#define SPAWN_FIRST 7803 +#define SPAWN_SECOND_1 5617 +#define SPAWN_SECOND_2 7805 +#define SAY_SCOFF -1060004 +#define SAY_CHICKEN_ACC -1060000 +#define SAY_CHICKEN_AGGRO_1 -1060001 #define SAY_CHICKEN_AGGRO_2 -1060002 -#define SAY_CHICKEN_AMB -1060003 -#define SAY_CHICKEN_COMP -1060005 +#define SAY_CHICKEN_AMB -1060003 +#define SAY_CHICKEN_COMP -1060005 struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI { - npc_OOX17AI(Creature *c) : npc_escortAI(c) {Reset();} + npc_OOX17AI(Creature *c) : npc_escortAI(c) {Reset();} void WaypointReached(uint32 i) { @@ -393,50 +393,50 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI return; switch(i) { - case 23: + case 23: m_creature->SummonCreature(SPAWN_FIRST, -8350.96, -4445.79, 10.10, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); m_creature->SummonCreature(SPAWN_FIRST, -8355.96, -4447.79, 10.10, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); m_creature->SummonCreature(SPAWN_FIRST, -8353.96, -4442.79, 10.10, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_CHICKEN_AMB, m_creature); - break; + DoScriptText(SAY_CHICKEN_AMB, m_creature); + break; case 56: m_creature->SummonCreature(SPAWN_SECOND_1, -7510.07, -4795.50, 9.35, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); 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, m_creature); - if(scoff) - DoScriptText(SAY_SCOFF, scoff);}break; + 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, m_creature); + if(scoff) + DoScriptText(SAY_SCOFF, scoff);}break; break; case 86: if (player) { - DoScriptText(SAY_CHICKEN_COMP, m_creature); + DoScriptText(SAY_CHICKEN_COMP, m_creature); ((Player*)player)->GroupEventHappens(Q_OOX17, m_creature); } - break; + break; } } - void Reset(){} + void Reset(){} - void Aggro(Unit* who) + void Aggro(Unit* who) { - switch (rand()%2) + switch (rand()%2) { - case 0: DoScriptText(SAY_CHICKEN_AGGRO_1, m_creature); break; + case 0: DoScriptText(SAY_CHICKEN_AGGRO_1, m_creature); break; case 1: DoScriptText(SAY_CHICKEN_AGGRO_2, m_creature); break; - } + } } - void JustSummoned(Creature* summoned) + void JustSummoned(Creature* summoned) { summoned->AI()->AttackStart(m_creature); } - void JustDied(Unit* killer) + void JustDied(Unit* killer) { if (PlayerGUID) { @@ -449,20 +449,20 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI void UpdateAI(const uint32 diff) { npc_escortAI::UpdateAI(diff); - if (!UpdateVictim()) - return; + if (!UpdateVictim()) + return; } - }; + }; bool QuestAccept_npc_OOX17(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == Q_OOX17) { - creature->setFaction(113); - creature->SetHealth(creature->GetMaxHealth()); - creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - DoScriptText(SAY_CHICKEN_ACC, creature); + creature->setFaction(113); + creature->SetHealth(creature->GetMaxHealth()); + creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + DoScriptText(SAY_CHICKEN_ACC, creature); ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); } @@ -601,7 +601,7 @@ void AddSC_tanaris() newscript->pGossipSelect = &GossipSelect_npc_stone_watcher_of_norgannon; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name = "npc_OOX17"; newscript->GetAI = &GetAI_npc_OOX17; newscript->pQuestAccept = &QuestAccept_npc_OOX17; diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp index 85fa16e21be..1493b6d0d1d 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp @@ -94,7 +94,7 @@ struct TRINITY_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI if( pInstance->GetData(TYPE_HARBINGERSKYRISS) == DONE ) { - DoScriptText(SAY_COMPLETE, m_creature); + DoScriptText(SAY_COMPLETE, m_creature); } } } @@ -124,14 +124,14 @@ struct TRINITY_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; } } void JustDied(Unit *victim) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); /*for questId 10886 (heroic mode only) if( pInstance && pInstance->GetData(TYPE_HARBINGERSKYRISS) != DONE ) @@ -315,13 +315,13 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI if( pInstance ) { pInstance->SetData(TYPE_HARBINGERSKYRISS,IN_PROGRESS); - if (GameObject* Sphere = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_SPHERE_SHIELD))) - Sphere->SetGoState(1); + if (GameObject* Sphere = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_SPHERE_SHIELD))) + Sphere->SetGoState(1); IsRunning = true; } } - bool CanProgress() + bool CanProgress() { if( pInstance ) { @@ -356,8 +356,8 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI case 2: DoCast(m_creature,SPELL_TARGET_ALPHA); pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS); - if (GameObject *Sphere = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_SPHERE_SHIELD))) - Sphere->SetGoState(1); + if (GameObject *Sphere = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_SPHERE_SHIELD))) + Sphere->SetGoState(1); break; case 3: DoCast(m_creature,SPELL_TARGET_BETA); diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp index bb418e29389..1721c8bfe61 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp @@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI { pInstance = ((ScriptedInstance*)c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); - Intro = false; + Intro = false; Reset(); } @@ -80,7 +80,7 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI void Reset() { if(!Intro) - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); IsImage33 = false; IsImage66 = false; @@ -96,9 +96,9 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { if(!Intro) - { - return; - } + { + return; + } ScriptedAI::MoveInLineOfSight(who); } @@ -126,14 +126,14 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI void KilledUnit(Unit* victim) { - //won't yell killing pet/other unit - if( victim->GetEntry() == 21436 ) + //won't yell killing pet/other unit + if( victim->GetEntry() == 21436 ) return; switch(rand()%2) { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; } } @@ -163,8 +163,8 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI { case 1: DoScriptText(SAY_INTRO, m_creature); - if (GameObject* Sphere = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_SPHERE_SHIELD))) - Sphere->SetGoState(0); + if (GameObject* Sphere = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_SPHERE_SHIELD))) + Sphere->SetGoState(0); ++Intro_Phase; Intro_Timer = 25000; break; @@ -175,13 +175,13 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI //should have a better way to do this. possibly spell exist. mellic->setDeathState(JUST_DIED); mellic->SetHealth(0); - pInstance->SetData(TYPE_SHIELD_OPEN,IN_PROGRESS); + pInstance->SetData(TYPE_SHIELD_OPEN,IN_PROGRESS); } ++Intro_Phase; Intro_Timer = 3000; break; case 3: - m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); Intro = true; break; } @@ -219,8 +219,8 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI switch(rand()%2) { - case 0: DoScriptText(SAY_FEAR_1, m_creature); break; - case 1: DoScriptText(SAY_FEAR_2, m_creature); break; + case 0: DoScriptText(SAY_FEAR_1, m_creature); break; + case 1: DoScriptText(SAY_FEAR_2, m_creature); break; } if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) ) @@ -238,8 +238,8 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI switch(rand()%2) { - case 0: DoScriptText(SAY_MIND_1, m_creature); break; - case 1: DoScriptText(SAY_MIND_2, m_creature); break; + case 0: DoScriptText(SAY_MIND_1, m_creature); break; + case 1: DoScriptText(SAY_MIND_2, m_creature); break; } if( Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1) ) diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp index ae355968650..86cf7d35d9b 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp @@ -33,7 +33,7 @@ EndScriptData */ #define POD_DELTA 183964 //pod third boss wave #define POD_GAMMA 183962 //pod fourth boss wave #define POD_OMEGA 183965 //pod fifth boss wave -#define WARDENS_SHIELD 184802 // warden shield +#define WARDENS_SHIELD 184802 // warden shield #define SEAL_SPHERE 184802 //shield 'protecting' mellichar #define MELLICHAR 20904 //skyriss will kill this unit @@ -59,10 +59,10 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance GameObject *Pod_Beta; GameObject *Pod_Delta; GameObject *Pod_Omega; - GameObject *Wardens_Shield; + GameObject *Wardens_Shield; - uint64 GoSphereGUID; - uint64 MellicharGUID; + uint64 GoSphereGUID; + uint64 MellicharGUID; void Initialize() { @@ -73,10 +73,10 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance Pod_Delta = NULL; Pod_Gamma = NULL; Pod_Omega = NULL; - Wardens_Shield = NULL; + Wardens_Shield = NULL; - GoSphereGUID = 0; - MellicharGUID = 0; + GoSphereGUID = 0; + MellicharGUID = 0; for(uint8 i = 0; i < ENCOUNTERS; i++) Encounter[i] = NOT_STARTED; @@ -86,7 +86,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance { for(uint8 i = 0; i < ENCOUNTERS; i++) if(Encounter[i]) - return true; + return true; return false; } @@ -97,20 +97,20 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance { case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: Containment_Core_Security_Field_Alpha = go; break; case CONTAINMENT_CORE_SECURITY_FIELD_BETA: Containment_Core_Security_Field_Beta = go; break; - case SEAL_SPHERE: GoSphereGUID = go->GetGUID(); break; + case SEAL_SPHERE: GoSphereGUID = go->GetGUID(); break; case POD_ALPHA: Pod_Alpha = go; break; case POD_BETA: Pod_Beta = go; break; case POD_DELTA: Pod_Delta = go; break; case POD_GAMMA: Pod_Gamma = go; break; case POD_OMEGA: Pod_Omega = go; break; - //case WARDENS_SHIELD: Wardens_Shield = go; break; + //case WARDENS_SHIELD: Wardens_Shield = go; break; } } void OnCreatureCreate(Creature *creature, uint32 creature_entry) { if (creature->GetEntry() == MELLICHAR) - MellicharGUID = creature->GetGUID(); + MellicharGUID = creature->GetGUID(); } void SetData(uint32 type, uint32 data) @@ -215,9 +215,9 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance switch(data) { case DATA_MELLICHAR: - return MellicharGUID; - case DATA_SPHERE_SHIELD: - return GoSphereGUID; + return MellicharGUID; + case DATA_SPHERE_SHIELD: + return GoSphereGUID; } return 0; } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp index a524c06352c..7eeeb55f5c1 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp @@ -66,7 +66,7 @@ struct TRINITY_DLL_DECL boss_high_botanist_freywinnAI : public ScriptedAI void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); } void JustSummoned(Creature *summoned) @@ -90,15 +90,15 @@ struct TRINITY_DLL_DECL boss_high_botanist_freywinnAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; } } - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } void UpdateAI(const uint32 diff) { @@ -109,8 +109,8 @@ struct TRINITY_DLL_DECL boss_high_botanist_freywinnAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_TREE_1, m_creature); break; - case 1: DoScriptText(SAY_TREE_2, m_creature); break; + case 0: DoScriptText(SAY_TREE_1, m_creature); break; + case 1: DoScriptText(SAY_TREE_2, m_creature); break; } if( m_creature->IsNonMeleeSpellCasted(false) ) diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp index ad78c98ba21..19f5445b380 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp @@ -159,7 +159,7 @@ struct TRINITY_DLL_DECL boss_lajAI : public ScriptedAI { if( Summon_Timer < diff ) { - DoScriptText(EMOTE_SUMMON, m_creature); + DoScriptText(EMOTE_SUMMON, m_creature); DoSummons(); Summon_Timer = 2500; }else Summon_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp index 3fdadb2903c..3602729587c 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp @@ -95,7 +95,7 @@ struct TRINITY_DLL_DECL mob_treantAI : public ScriptedAI #define TREANT_SPAWN_DIST 50 //50 yards from Warp Splinter's spawn point -float treant_pos[6][3] = +float treant_pos[6][3] = { {24.301233, 427.221100, -27.060635}, {16.795492, 359.678802, -27.355425}, @@ -134,27 +134,27 @@ struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); } void KilledUnit(Unit* victim) { switch(rand()%2) { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; } } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); } void SummonTreants() { for(int i = 0; i < 6; ++i) - { + { float angle = (M_PI / 3) * i; float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle); @@ -165,9 +165,9 @@ struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI ((mob_treantAI*)pTreant->AI())->WarpGuid = m_creature->GetGUID(); } switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON_1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON_2, m_creature); break; + { + case 0: DoScriptText(SAY_SUMMON_1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON_2, m_creature); break; } } @@ -180,21 +180,21 @@ struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI if(War_Stomp_Timer < diff) { DoCast(m_creature->getVictim(),WAR_STOMP); - War_Stomp_Timer = 25000 + rand()%15000; + War_Stomp_Timer = 25000 + rand()%15000; }else War_Stomp_Timer -= diff; //Check for Arcane Volley if(Arcane_Volley_Timer < diff) { DoCast(m_creature->getVictim(),ARCANE_VOLLEY); - Arcane_Volley_Timer = 20000 + rand()%15000; + Arcane_Volley_Timer = 20000 + rand()%15000; }else Arcane_Volley_Timer -= diff; //Check for Summon Treants if(Summon_Treants_Timer < diff) { SummonTreants(); - Summon_Treants_Timer = 45000; + Summon_Treants_Timer = 45000; }else Summon_Treants_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp index 45797e010e6..ea5e8ca9f58 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp @@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI void StartEvent() { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); if(pInstance) pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS); @@ -138,9 +138,9 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI { 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; + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; + case 2: DoScriptText(SAY_KILL3, m_creature); break; } } @@ -148,7 +148,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI { m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_HUMAN); - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); if(pInstance) pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE); @@ -164,15 +164,15 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI Creature* Summoned = m_creature->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); if(Summoned) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Summoned->AI()->AttackStart(target); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Summoned->AI()->AttackStart(target); } } float Portal_X(float radius) { if ((rand()%2)==1) - radius = -radius; + radius = -radius; return (radius * (float)(rand()%100)/100.0f + CENTER_X); } @@ -271,7 +271,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI if (MarkOfTheAstromancer_Timer < diff) { //A debuff that lasts for 5 seconds, cast several times each phase on a random raid member, but not the main tank - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1)) { DoCast(target, SPELL_MARK_OF_THE_ASTROMANCER); @@ -307,7 +307,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS); Portals[i][2] = CENTER_Z; } - else + else { Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS); Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS); @@ -346,19 +346,19 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI for (int j=1; j<=4; j++) SummonMinion(SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]); - DoScriptText(SAY_SUMMON1, m_creature); + DoScriptText(SAY_SUMMON1, m_creature); Phase2_Timer = 10000; } else Phase2_Timer -= diff; } else if(Phase == 3) { - m_creature->AttackStop(); - m_creature->StopMoving(); + m_creature->AttackStop(); + m_creature->StopMoving(); //Check Phase3_Timer if(Phase3_Timer < diff) { - Phase = 1; + Phase = 1; //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals. int i = rand()%3; @@ -402,8 +402,8 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI //To make sure she wont be invisible or not selecatble m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetVisibility(VISIBILITY_ON); - DoScriptText(SAY_VOIDA, m_creature); - DoScriptText(SAY_VOIDB, m_creature); + DoScriptText(SAY_VOIDA, m_creature); + DoScriptText(SAY_VOIDB, m_creature); m_creature->SetArmor(WV_ARMOR); m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_VOIDWALKER); m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f); diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp index 0e84f71d8de..2c9df9cb219 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp @@ -248,23 +248,23 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI void UpdateAI(const uint32 diff) { if (DelayRes_Timer) - { + { if (DelayRes_Timer <= diff) - { - DelayRes_Timer = 0; - FakeDeath = false; - - Unit* Target = Unit::GetUnit((*m_creature), DelayRes_Target); - if (!Target) - Target = m_creature->getVictim(); - DoResetThreat(); - AttackStart(Target); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(Target); - m_creature->AddThreat(Target, 0.0f); - }else DelayRes_Timer -= diff; - } - } + { + DelayRes_Timer = 0; + FakeDeath = false; + + Unit* Target = Unit::GetUnit((*m_creature), DelayRes_Target); + if (!Target) + Target = m_creature->getVictim(); + DoResetThreat(); + AttackStart(Target); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(Target); + m_creature->AddThreat(Target, 0.0f); + }else DelayRes_Timer -= diff; + } + } }; //Kael'thas AI @@ -282,7 +282,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI ScriptedInstance* pInstance; - std::list Phoenix; + std::list Phoenix; uint32 Fireball_Timer; uint32 ArcaneDisruption_Timer; @@ -294,7 +294,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI uint32 NetherVapor_Timer; uint32 FlameStrike_Timer; uint32 MindControl_Timer; - uint32 Check_Timer; + uint32 Check_Timer; uint32 Phase; uint32 PhaseSubphase; //generic uint32 Phase_Timer; //generic timer @@ -305,37 +305,37 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI bool ChainPyros; uint64 AdvisorGuid[4]; - uint64 WeaponGuid[7]; - - void DeleteLegs() - { - InstanceMap::PlayerList const &playerliste = ((InstanceMap*)m_creature->GetMap())->GetPlayers(); - InstanceMap::PlayerList::const_iterator it; - - Map::PlayerList const &PlayerList = ((InstanceMap*)m_creature->GetMap())->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - Player* i_pl = i->getSource(); - i_pl->DestroyItemCount(30312, 1, true); - i_pl->DestroyItemCount(30311, 1, true); - i_pl->DestroyItemCount(30317, 1, true); - i_pl->DestroyItemCount(30316, 1, true); - i_pl->DestroyItemCount(30313, 1, true); - i_pl->DestroyItemCount(30314, 1, true); - i_pl->DestroyItemCount(30318, 1, true); - i_pl->DestroyItemCount(30319, 1, true); - i_pl->DestroyItemCount(30320, 1, true); - } - if(pInstance) { - for(uint32 i = 0; i < 7; i++) { - Creature* weapon = (Creature*)(Unit::GetUnit((*m_creature), WeaponGuid[i]));; - delete weapon; - } - } - } - - void CleanPhoenix() - { + uint64 WeaponGuid[7]; + + void DeleteLegs() + { + InstanceMap::PlayerList const &playerliste = ((InstanceMap*)m_creature->GetMap())->GetPlayers(); + InstanceMap::PlayerList::const_iterator it; + + Map::PlayerList const &PlayerList = ((InstanceMap*)m_creature->GetMap())->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + Player* i_pl = i->getSource(); + i_pl->DestroyItemCount(30312, 1, true); + i_pl->DestroyItemCount(30311, 1, true); + i_pl->DestroyItemCount(30317, 1, true); + i_pl->DestroyItemCount(30316, 1, true); + i_pl->DestroyItemCount(30313, 1, true); + i_pl->DestroyItemCount(30314, 1, true); + i_pl->DestroyItemCount(30318, 1, true); + i_pl->DestroyItemCount(30319, 1, true); + i_pl->DestroyItemCount(30320, 1, true); + } + if(pInstance) { + for(uint32 i = 0; i < 7; i++) { + Creature* weapon = (Creature*)(Unit::GetUnit((*m_creature), WeaponGuid[i]));; + delete weapon; + } + } + } + + void CleanPhoenix() + { CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); Cell cell(pair); cell.data.Part.reserved = ALL_DISTRICT; @@ -354,10 +354,10 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI { for(std::list::iterator itr = PhoenixList.begin(); itr != PhoenixList.end(); ++itr) { - (*itr)->RemoveFromWorld(); + (*itr)->RemoveFromWorld(); } - } - } + } + } void Reset() { @@ -371,7 +371,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI GravityLapse_Phase = 0; NetherBeam_Timer = 8000; NetherVapor_Timer = 10000; - Check_Timer = 4000; + Check_Timer = 4000; PyrosCasted = 0; Phase = 0; InGravityLapse = false; @@ -381,13 +381,13 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI if(InCombat) PrepareAdvisors(); - DeleteLegs(); - CleanPhoenix(); + DeleteLegs(); + CleanPhoenix(); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); if(pInstance) @@ -419,7 +419,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI AdvisorGuid[1] = pInstance->GetData64(DATA_LORDSANGUINAR); AdvisorGuid[2] = pInstance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN); AdvisorGuid[3] = pInstance->GetData64(DATA_MASTERENGINEERTELONICUS); - m_creature->addUnitState(UNIT_STAT_STUNNED); + m_creature->addUnitState(UNIT_STAT_STUNNED); if(!AdvisorGuid[0] || !AdvisorGuid[1] || !AdvisorGuid[2] || !AdvisorGuid[3]) { @@ -456,32 +456,32 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI void KilledUnit() { - switch(rand()%3) + switch(rand()%3) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; } } - void JustSummoned(Creature* summoned) - { - if(summoned->GetEntry() == PHOENIX) - { - summoned->setFaction(m_creature->getFaction()); - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - summoned->AI()->AttackStart(target); - } - } + void JustSummoned(Creature* summoned) + { + if(summoned->GetEntry() == PHOENIX) + { + summoned->setFaction(m_creature->getFaction()); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + summoned->AI()->AttackStart(target); + } + } void JustDied(Unit* Killer) { m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); - DeleteLegs(); + DeleteLegs(); if(pInstance) pInstance->SetData(DATA_KAELTHASEVENT, DONE); @@ -577,7 +577,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[0])); if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD)) { - DoScriptText(SAY_INTRO_SANGUINAR, m_creature); + DoScriptText(SAY_INTRO_SANGUINAR, m_creature); //start advisor within 12.5 seconds Phase_Timer = 12500; @@ -645,7 +645,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[2])); if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD)) { - DoScriptText(SAY_INTRO_TELONICUS, m_creature); + DoScriptText(SAY_INTRO_TELONICUS, m_creature); //start advisor within 8.4 seconds Phase_Timer = 8400; @@ -709,7 +709,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI Creature* Weapon; for (uint32 i = 0; i < 7; ++i) { - Unit* Target = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit* Target = SelectUnit(SELECT_TARGET_RANDOM, 0); Weapon = m_creature->SummonCreature(((uint32)KaelthasWeapons[i][0]),KaelthasWeapons[i][1],KaelthasWeapons[i][2],KaelthasWeapons[i][3],0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); if (!Weapon) @@ -719,7 +719,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI Weapon->setFaction(m_creature->getFaction()); Weapon->AI()->AttackStart(Target); Weapon->CastSpell(Weapon, SPELL_WEAPON_SPAWN, false); - WeaponGuid[i] = Weapon->GetGUID(); + WeaponGuid[i] = Weapon->GetGUID(); } } @@ -735,7 +735,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI Phase = 3; PhaseSubphase = 0; }else Phase_Timer -= diff; - //missing Resetcheck + //missing Resetcheck }break; case 3: @@ -770,7 +770,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) { - m_creature->clearUnitState(UNIT_STAT_STUNNED); + m_creature->clearUnitState(UNIT_STAT_STUNNED); AttackStart(target); } Phase_Timer = 30000; @@ -821,8 +821,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI if (FlameStrike_Timer < diff) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0, 70, true)) - DoCast(pUnit, SPELL_FLAME_STRIKE); + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0, 70, true)) + DoCast(pUnit, SPELL_FLAME_STRIKE); FlameStrike_Timer = 30000; }FlameStrike_Timer -= diff; @@ -833,10 +833,10 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI for (uint32 i = 0; i < 3; i++) { - Unit* target =SelectUnit(SELECT_TARGET_RANDOM, 1, 70, true); - if(!target) target = m_creature->getVictim(); - debug_log("TSCR: Kael'Thas mind control not supported."); - DoCast(target, SPELL_MIND_CONTROL); + Unit* target =SelectUnit(SELECT_TARGET_RANDOM, 1, 70, true); + if(!target) target = m_creature->getVictim(); + debug_log("TSCR: Kael'Thas mind control not supported."); + DoCast(target, SPELL_MIND_CONTROL); } MindControl_Timer = 60000; @@ -846,11 +846,11 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI //Phoenix_Timer if(Phoenix_Timer < diff) { - DoCast(m_creature, SPELL_SUMMON_PHOENIX); - switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON_PHOENIX1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON_PHOENIX2, m_creature); break; + DoCast(m_creature, SPELL_SUMMON_PHOENIX); + switch(rand()%2) + { + case 0: DoScriptText(SAY_SUMMON_PHOENIX1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON_PHOENIX2, m_creature); break; } Phoenix_Timer = 60000; @@ -865,7 +865,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI Phase = 5; Phase_Timer = 10000; - DoScriptText(SAY_PHASE5_NUTS, m_creature); + DoScriptText(SAY_PHASE5_NUTS, m_creature); m_creature->StopMoving(); m_creature->GetMotionMaster()->Clear(); @@ -884,22 +884,22 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI DoCast(m_creature, SPELL_SHOCK_BARRIER); ChainPyros = true; PyrosCasted = 0; - Check_Timer = 0; + Check_Timer = 0; ShockBarrier_Timer = 60000; }else ShockBarrier_Timer -= diff; //Chain Pyros (3 of them max) - if (ChainPyros){ - if (PyrosCasted < 3 && Check_Timer < diff) + if (ChainPyros){ + if (PyrosCasted < 3 && Check_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_PYROBLAST); ++PyrosCasted; - Check_Timer = 4400; - }else Check_Timer -= diff; - if(PyrosCasted > 3) - { + Check_Timer = 4400; + }else Check_Timer -= diff; + if(PyrosCasted > 3) + { ChainPyros = false; Fireball_Timer = 2500; ArcaneDisruption_Timer = 60000; @@ -916,7 +916,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI DoCast(m_creature, SPELL_EXPLODE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Phase = 6; - DoStartMovement(m_creature->getVictim()); + DoStartMovement(m_creature->getVictim()); AttackStart(m_creature->getVictim()); }else Phase_Timer -= diff; } @@ -957,8 +957,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI case 1: switch(rand()%2) { - case 0: DoScriptText(SAY_GRAVITYLAPSE1, m_creature); break; - case 1: DoScriptText(SAY_GRAVITYLAPSE2, m_creature); break; + case 0: DoScriptText(SAY_GRAVITYLAPSE1, m_creature); break; + case 1: DoScriptText(SAY_GRAVITYLAPSE2, m_creature); break; } // 2) At that point he will put a Gravity Lapse debuff on everyone @@ -1013,7 +1013,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI InGravityLapse = false; GravityLapse_Timer = 60000; GravityLapse_Phase = 0; - DoStartMovement(m_creature->getVictim()); + DoStartMovement(m_creature->getVictim()); AttackStart(m_creature->getVictim()); DoResetThreat(); break; @@ -1032,8 +1032,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI //NetherBeam_Timer if(NetherBeam_Timer < diff) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_NETHER_BEAM); + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_NETHER_BEAM); NetherBeam_Timer = 4000; }else NetherBeam_Timer -= diff; @@ -1067,8 +1067,8 @@ struct TRINITY_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai void JustDied(Unit* pKiller) { - DoScriptText(SAY_THALADRED_DEATH, m_creature); - } + DoScriptText(SAY_THALADRED_DEATH, m_creature); + } void Aggro(Unit *who) { @@ -1101,7 +1101,7 @@ struct TRINITY_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai { DoResetThreat(); m_creature->AddThreat(target, 5000000.0f); - DoScriptText(EMOTE_THALADRED_GAZE, m_creature, target); + DoScriptText(EMOTE_THALADRED_GAZE, m_creature, target); Gaze_Timer = 8500; } }else Gaze_Timer -= diff; @@ -1139,7 +1139,7 @@ struct TRINITY_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai void JustDied(Unit* Killer) { - DoScriptText(SAY_SANGUINAR_DEATH, m_creature); + DoScriptText(SAY_SANGUINAR_DEATH, m_creature); } void Aggro(Unit *who) @@ -1150,7 +1150,7 @@ struct TRINITY_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai if (!who || FakeDeath) return; - DoScriptText(SAY_SANGUINAR_AGGRO, m_creature); + DoScriptText(SAY_SANGUINAR_AGGRO, m_creature); } void UpdateAI(const uint32 diff) @@ -1245,14 +1245,14 @@ struct TRINITY_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_ //Yell_Timer if(!Yell) - { + { if(Yell_Timer < diff) - { - DoScriptText(SAY_CAPERNIAN_AGGRO, m_creature); + { + DoScriptText(SAY_CAPERNIAN_AGGRO, m_creature); - Yell = true; - }else Yell_Timer -= diff; - } + Yell = true; + }else Yell_Timer -= diff; + } //Fireball_Timer if(Fireball_Timer < diff) @@ -1562,7 +1562,7 @@ CreatureAI* GetAI_mob_phoenix_tk(Creature *_Creature) CreatureAI* GetAI_mob_phoenix_egg_tk(Creature *_Creature) { - return new mob_phoenix_egg_tkAI (_Creature); + return new mob_phoenix_egg_tkAI (_Creature); } void AddSC_boss_kaelthas() { @@ -1602,8 +1602,8 @@ void AddSC_boss_kaelthas() newscript->GetAI = &GetAI_mob_phoenix_tk; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "mob_phoenix_egg_tk"; - newscript->GetAI = &GetAI_mob_phoenix_egg_tk; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "mob_phoenix_egg_tk"; + newscript->GetAI = &GetAI_mob_phoenix_egg_tk; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp index 82d4e22d3dd..14a2dc60f33 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp @@ -57,12 +57,12 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); - Pounding_Timer = 15000; + Pounding_Timer = 15000; ArcaneOrb_Timer = 3000; KnockAway_Timer = 30000; Berserk_Timer = 600000; - if (pInstance && m_creature->isAlive()) + if (pInstance && m_creature->isAlive()) pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); } @@ -70,9 +70,9 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI { switch(rand()%3) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; } } @@ -104,8 +104,8 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI switch(rand()%2) { - case 0: DoScriptText(SAY_POUNDING1, m_creature); break; - case 1: DoScriptText(SAY_POUNDING2, m_creature); break; + case 0: DoScriptText(SAY_POUNDING1, m_creature); break; + case 1: DoScriptText(SAY_POUNDING2, m_creature); break; } Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) }else Pounding_Timer -= diff; @@ -113,7 +113,7 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI // Arcane Orb if(ArcaneOrb_Timer < diff) { - Unit *target = NULL; + Unit *target = NULL; std::list t_list = m_creature->getThreatManager().getThreatList(); std::vector target_list; for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) @@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI target = *(target_list.begin()+rand()%target_list.size()); if (target) - m_creature->CastSpell(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), SPELL_ARCANE_ORB, false); + m_creature->CastSpell(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), SPELL_ARCANE_ORB, false); ArcaneOrb_Timer = 3000; }else ArcaneOrb_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h index 2a6492fdd74..42b3af63421 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h @@ -15,5 +15,5 @@ #define DATA_MASTERENGINEERTELONICUS 8 #define DATA_THALADREDTHEDARKENER 10 #define DATA_VOIDREAVEREVENT 11 -#define DATA_ALAR 12 +#define DATA_ALAR 12 #endif diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp index b92d18ac54e..20bd72ab593 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp @@ -85,7 +85,7 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance case 20060: LordSanguinar = creature->GetGUID(); break; case 19622: Kaelthas = creature->GetGUID(); break; case 18805: Astromancer = creature->GetGUID(); break; - case 19514: Alar = creature->GetGUID(); break; + case 19514: Alar = creature->GetGUID(); break; } } @@ -93,13 +93,13 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance { switch(identifier) { - case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener; - case DATA_LORDSANGUINAR: return LordSanguinar; - case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian; - case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus; - case DATA_KAELTHAS: return Kaelthas; - case DATA_ASTROMANCER: return Astromancer; - case DATA_ALAR: return Alar; + case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener; + case DATA_LORDSANGUINAR: return LordSanguinar; + case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian; + case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus; + case DATA_KAELTHAS: return Kaelthas; + case DATA_ASTROMANCER: return Astromancer; + case DATA_ALAR: return Alar; } return 0; } @@ -108,30 +108,30 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance { switch(type) { - case DATA_ALAREVENT: AlarEventPhase = data; Encounters[0] = data; break; - case DATA_HIGHASTROMANCERSOLARIANEVENT: Encounters[1] = data; break; - case DATA_VOIDREAVEREVENT: Encounters[2] = data; break; - case DATA_KAELTHASEVENT: KaelthasEventPhase = data; Encounters[3] = data; break; + case DATA_ALAREVENT: AlarEventPhase = data; Encounters[0] = data; break; + case DATA_HIGHASTROMANCERSOLARIANEVENT: Encounters[1] = data; break; + case DATA_VOIDREAVEREVENT: Encounters[2] = data; break; + case DATA_KAELTHASEVENT: KaelthasEventPhase = data; Encounters[3] = data; break; } - if(data == DONE) - SaveToDB(); + if(data == DONE) + SaveToDB(); } uint32 GetData(uint32 type) { switch(type) { - case DATA_ALAREVENT: return AlarEventPhase; - case DATA_HIGHASTROMANCERSOLARIANEVENT: return Encounters[1]; - case DATA_VOIDREAVEREVENT: return Encounters[2]; - case DATA_KAELTHASEVENT: return KaelthasEventPhase; + case DATA_ALAREVENT: return AlarEventPhase; + case DATA_HIGHASTROMANCERSOLARIANEVENT: return Encounters[1]; + case DATA_VOIDREAVEREVENT: return Encounters[2]; + case DATA_KAELTHASEVENT: return KaelthasEventPhase; } return 0; } - const char* Save() - { - OUT_SAVE_INST_DATA; + const char* Save() + { + OUT_SAVE_INST_DATA; std::ostringstream stream; stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " << Encounters[3]; char* out = new char[stream.str().length() + 1]; @@ -154,10 +154,10 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance OUT_LOAD_INST_DATA(in); std::istringstream stream(in); stream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3]; - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. - Encounters[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + Encounters[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; } }; diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp index de9526d495a..2a7d9eae3dc 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp @@ -32,26 +32,26 @@ EndScriptData */ #define EMOTE_HAMMER -1554012 // Spells to be casted -#define SPELL_SHADOW_POWER 35322 +#define SPELL_SHADOW_POWER 35322 #define H_SPELL_SHADOW_POWER 39193 #define SPELL_HAMMER_PUNCH 35326 #define SPELL_JACKHAMMER 35327 #define H_SPELL_JACKHAMMER 39194 -#define SPELL_STREAM_OF_MACHINE_FLUID 35311 +#define SPELL_STREAM_OF_MACHINE_FLUID 35311 // Gatewatcher Iron-Hand AI struct TRINITY_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI { boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Reset(); + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Reset(); } - ScriptedInstance *pInstance; + ScriptedInstance *pInstance; - bool HeroicMode; + bool HeroicMode; uint32 Shadow_Power_Timer; uint32 Jackhammer_Timer; @@ -66,7 +66,7 @@ boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) } void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO_1, m_creature); + DoScriptText(SAY_AGGRO_1, m_creature); } void KilledUnit(Unit* victim) @@ -76,20 +76,20 @@ boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) switch(rand()%2) { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; } } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH_1, m_creature); + DoScriptText(SAY_DEATH_1, m_creature); - if (!pInstance) - return; + if (!pInstance) + return; - //TODO: Add door check/open code - } + //TODO: Add door check/open code + } void UpdateAI(const uint32 diff) { @@ -100,25 +100,25 @@ boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) //Shadow Power if(Shadow_Power_Timer < diff) { - DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_POWER : SPELL_SHADOW_POWER); + DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_POWER : SPELL_SHADOW_POWER); Shadow_Power_Timer = 20000 + rand()%8000; }else Shadow_Power_Timer -= diff; //Jack Hammer if(Jackhammer_Timer < diff) { - //TODO: expect cast this about 5 times in a row (?), announce it by emote only once - DoScriptText(EMOTE_HAMMER, m_creature); - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_JACKHAMMER : SPELL_JACKHAMMER); + //TODO: expect cast this about 5 times in a row (?), announce it by emote only once + DoScriptText(EMOTE_HAMMER, m_creature); + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_JACKHAMMER : SPELL_JACKHAMMER); - //chance to yell, but not same time as emote (after spell in fact casted) - if (rand()%2) + //chance to yell, but not same time as emote (after spell in fact casted) + if (rand()%2) return; switch(rand()%2) { - case 0: DoScriptText(SAY_HAMMER_1, m_creature); break; - case 1: DoScriptText(SAY_HAMMER_2, m_creature); break; + case 0: DoScriptText(SAY_HAMMER_1, m_creature); break; + case 1: DoScriptText(SAY_HAMMER_2, m_creature); break; } Jackhammer_Timer = 30000; }else Jackhammer_Timer -= diff; @@ -131,7 +131,7 @@ boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) }else Stream_of_Machine_Fluid_Timer -= diff; DoMeleeAttackIfReady(); - } + } }; CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature *_Creature) { diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp index 31293ca9f56..01c786be535 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp @@ -44,14 +44,14 @@ struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI { boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Reset(); + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Reset(); } - ScriptedInstance *pInstance; + ScriptedInstance *pInstance; - bool HeroicMode; + bool HeroicMode; uint32 frost_attack_Timer; uint32 arcane_blast_Timer; @@ -70,25 +70,25 @@ boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); - - //Summon two guards, three in heroic - uint8 am = (HeroicMode ? 1 : 2); - for(int i = 0; i < am; i++) - { - DoCast(who,SPELL_SUMMON_RAGIN_FLAMES); - } - DoScriptText(SAY_SUMMON, m_creature); + DoScriptText(SAY_AGGRO, m_creature); + + //Summon two guards, three in heroic + uint8 am = (HeroicMode ? 1 : 2); + for(int i = 0; i < am; i++) + { + DoCast(who,SPELL_SUMMON_RAGIN_FLAMES); + } + DoScriptText(SAY_SUMMON, m_creature); } void KilledUnit(Unit* victim) { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } void JustDied(Unit* Killer) { @@ -128,8 +128,8 @@ boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) switch(rand()%2) { - case 0: DoScriptText(SAY_DRAGONS_BREATH_1, m_creature); break; - case 1: DoScriptText(SAY_DRAGONS_BREATH_2, m_creature); break; + case 0: DoScriptText(SAY_DRAGONS_BREATH_1, m_creature); break; + case 1: DoScriptText(SAY_DRAGONS_BREATH_2, m_creature); break; } } dragons_breath_Timer = 12000 + rand()%10000; @@ -169,12 +169,12 @@ struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI { pInstance = ((ScriptedInstance*)c->GetInstanceData()); Reset(); - HeroicMode = m_creature->GetMap()->IsHeroic(); + HeroicMode = m_creature->GetMap()->IsHeroic(); } ScriptedInstance *pInstance; - bool HeroicMode; + bool HeroicMode; uint32 inferno_Timer; uint32 flame_timer; @@ -203,8 +203,8 @@ struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI if (!onlyonce) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - m_creature->GetMotionMaster()->MoveChase(target); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + m_creature->GetMotionMaster()->MoveChase(target); onlyonce = true; } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp index 18fe0a6476b..c93d38a0d6e 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp @@ -81,21 +81,21 @@ struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI } void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); } void KilledUnit(Unit* victim) { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); } void UpdateAI(const uint32 diff) @@ -108,14 +108,14 @@ struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI { for(int i = 0; i < 3;i++) { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - Creature* Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - if (target && Wraith) - Wraith->AI()->AttackStart(target); + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + Creature* Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + if (target && Wraith) + Wraith->AI()->AttackStart(target); } - DoScriptText(SAY_SUMMON, m_creature); - Summon_Timer = 30000 + rand()%15000; + DoScriptText(SAY_SUMMON, m_creature); + Summon_Timer = 30000 + rand()%15000; }else Summon_Timer -= diff; if(ManaTap_Timer < diff) @@ -132,18 +132,18 @@ struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI if(Domination_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_DOMINATION_1, m_creature); break; - case 1: DoScriptText(SAY_DOMINATION_2, m_creature); break; - } - - DoCast(target,SPELL_DOMINATION); - } - Domination_Timer = 25000 + rand()%5000; - }else Domination_Timer -= diff; + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_DOMINATION_1, m_creature); break; + case 1: DoScriptText(SAY_DOMINATION_2, m_creature); break; + } + + DoCast(target,SPELL_DOMINATION); + } + Domination_Timer = 25000 + rand()%5000; + }else Domination_Timer -= diff; //Only casting if Heroic Mode is used if (HeroicMode) @@ -157,8 +157,8 @@ struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI if (!Enraged && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21) { - DoCast(m_creature, SPELL_FRENZY); - DoScriptText(SAY_ENRAGE, m_creature); + DoCast(m_creature, SPELL_FRENZY); + DoScriptText(SAY_ENRAGE, m_creature); Enraged = true; } @@ -202,13 +202,13 @@ struct TRINITY_DLL_DECL mob_nether_wraithAI : public ScriptedAI if(ArcaneMissiles_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,SPELL_ARCANE_MISSILES); - else - DoCast(m_creature->getVictim(),SPELL_ARCANE_MISSILES); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,SPELL_ARCANE_MISSILES); + else + DoCast(m_creature->getVictim(),SPELL_ARCANE_MISSILES); - ArcaneMissiles_Timer = 5000 + rand()%5000; - }else ArcaneMissiles_Timer -=diff; + ArcaneMissiles_Timer = 5000 + rand()%5000; + }else ArcaneMissiles_Timer -=diff; if (!Detonation) { diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp index ede0c649b36..52106a6825f 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp @@ -576,7 +576,7 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI if (Player* i_pl = i->getSource()) { //Play random sound to the zone - i_pl->SendPlaySound(RANDOM_SOUND_WHISPER, true); + i_pl->SendPlaySound(RANDOM_SOUND_WHISPER, true); } } diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp index 8fe53cc70a1..918ad92c6e2 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp @@ -70,18 +70,18 @@ struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); } - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_SLAY, m_creature); - } + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY, m_creature); + } void UpdateAI(const uint32 diff) { 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 9e6cdf2abb7..ffea6281d60 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 @@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI { boss_skeramAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = ((ScriptedInstance*)c->GetInstanceData()); IsImage = false; Reset(); } @@ -98,16 +98,16 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI { switch(rand()%3) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; } } void JustDied(Unit* Killer) { if (!IsImage) - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); } void Aggro(Unit *who) @@ -116,9 +116,9 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI return; switch(rand()%3) { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; } } @@ -212,7 +212,7 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI void DoSplit(int atPercent /* 75 50 25 */) { - DoScriptText(SAY_SPLIT, m_creature); + DoScriptText(SAY_SPLIT, m_creature); ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227,2083.814453,125.648788,0); ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875,2118.504639,133.058151,0); @@ -224,18 +224,18 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI { case 0: bossc=place1; - i1=place2; - i2=place3; + i1=place2; + i2=place3; break; case 1: bossc=place2; - i1=place1; - i2=place3; + i1=place1; + i2=place3; break; case 2: bossc=place3; - i1=place1; - i2=place2; + i1=place1; + i2=place2; break; } @@ -272,18 +272,18 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI case 25: Images25 = true; break; } - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + 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) + if (target) Image1->AI()->AttackStart(target); 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) + if (target) Image2->AI()->AttackStart(target); ((boss_skeramAI*)Image1->AI())->IsImage = true; 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 d03579bdaff..444e8b0a528 100644 --- a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp +++ b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp @@ -360,135 +360,135 @@ bool GossipSelect_npc_skyguard_handler_deesak(Player *player, Creature *_Creatur ## npc_isla_starmane ######*/ -#define SAY_PROGRESS_1 -1000353 -#define SAY_PROGRESS_2 -1000354 -#define SAY_PROGRESS_3 -1000355 -#define SAY_PROGRESS_4 -1000356 +#define SAY_PROGRESS_1 -1000353 +#define SAY_PROGRESS_2 -1000354 +#define SAY_PROGRESS_3 -1000355 +#define SAY_PROGRESS_4 -1000356 -#define QUEST_EFTW_H 10052 -#define QUEST_EFTW_A 10051 -#define GO_CAGE 182794 -#define SPELL_CAT 32447 +#define QUEST_EFTW_H 10052 +#define QUEST_EFTW_A 10051 +#define GO_CAGE 182794 +#define SPELL_CAT 32447 struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI { - npc_isla_starmaneAI(Creature* c) : npc_escortAI(c) {Reset();} - - bool Completed; - - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - if(!player) - return; - - switch(i) - { - case 0: - { - GameObject* Cage = FindGameObject(GO_CAGE, 10, m_creature); - if(Cage) - Cage->SetGoState(0); - }break; - case 2: DoScriptText(SAY_PROGRESS_1, m_creature, player); break; - case 5: DoScriptText(SAY_PROGRESS_2, m_creature, player); break; - case 6: DoScriptText(SAY_PROGRESS_3, m_creature, player); break; - case 29:DoScriptText(SAY_PROGRESS_4, m_creature, player); - if (player) - { - if(((Player*)player)->GetTeam() == ALLIANCE) - ((Player*)player)->GroupEventHappens(QUEST_EFTW_A, m_creature); - else if(((Player*)player)->GetTeam() == HORDE) - ((Player*)player)->GroupEventHappens(QUEST_EFTW_H, m_creature); - } Completed = true; - m_creature->SetInFront(player); break; - case 30: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; - case 31: DoCast(m_creature, SPELL_CAT); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - } - } - - void Reset() - { - Completed = false; + npc_isla_starmaneAI(Creature* c) : npc_escortAI(c) {Reset();} + + bool Completed; + + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if(!player) + return; + + switch(i) + { + case 0: + { + GameObject* Cage = FindGameObject(GO_CAGE, 10, m_creature); + if(Cage) + Cage->SetGoState(0); + }break; + case 2: DoScriptText(SAY_PROGRESS_1, m_creature, player); break; + case 5: DoScriptText(SAY_PROGRESS_2, m_creature, player); break; + case 6: DoScriptText(SAY_PROGRESS_3, m_creature, player); break; + case 29:DoScriptText(SAY_PROGRESS_4, m_creature, player); + if (player) + { + if(((Player*)player)->GetTeam() == ALLIANCE) + ((Player*)player)->GroupEventHappens(QUEST_EFTW_A, m_creature); + else if(((Player*)player)->GetTeam() == HORDE) + ((Player*)player)->GroupEventHappens(QUEST_EFTW_H, m_creature); + } Completed = true; + m_creature->SetInFront(player); break; + case 30: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; + case 31: DoCast(m_creature, SPELL_CAT); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + } + } + + void Reset() + { + Completed = false; m_creature->setFaction(1660); - } - - void Aggro(Unit* who){} - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (player && !Completed) - { - if(((Player*)player)->GetTeam() == ALLIANCE) - ((Player*)player)->FailQuest(QUEST_EFTW_A); - else if(((Player*)player)->GetTeam() == HORDE) - ((Player*)player)->FailQuest(QUEST_EFTW_H); - } - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + } + + void Aggro(Unit* who){} + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player && !Completed) + { + if(((Player*)player)->GetTeam() == ALLIANCE) + ((Player*)player)->FailQuest(QUEST_EFTW_A); + else if(((Player*)player)->GetTeam() == HORDE) + ((Player*)player)->FailQuest(QUEST_EFTW_H); + } + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; bool QuestAccept_npc_isla_starmane(Player* player, Creature* creature, Quest const* quest) { - if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A) + if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A) { ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - creature->setFaction(113); + creature->setFaction(113); } return true; } CreatureAI* GetAI_npc_isla_starmaneAI(Creature *_Creature) { - npc_isla_starmaneAI* thisAI = new npc_isla_starmaneAI(_Creature); - - thisAI->AddWaypoint(0, -2265.21, 3091.14, 13.91); - thisAI->AddWaypoint(1, -2266.80, 3091.33, 13.82, 1000); - thisAI->AddWaypoint(2, -2268.20, 3091.14, 13.82, 7000);//progress1 - thisAI->AddWaypoint(3, -2278.32, 3098.98, 13.82); - thisAI->AddWaypoint(4, -2294.82, 3110.59, 13.82); - thisAI->AddWaypoint(5, -2300.71, 3114.60, 13.82, 20000);//progress2 - thisAI->AddWaypoint(6, -2300.71, 3114.60, 13.82, 3000);//progress3 - thisAI->AddWaypoint(7, -2307.36, 3122.76, 13.79); - thisAI->AddWaypoint(8, -2312.83, 3130.55, 12.04); - thisAI->AddWaypoint(9, -2345.02, 3151.00, 8.38); - thisAI->AddWaypoint(10, -2351.97, 3157.61, 6.27); - thisAI->AddWaypoint(11, -2360.35, 3171.48, 3.31); - thisAI->AddWaypoint(12, -2371.44, 3185.41, 0.89); - thisAI->AddWaypoint(13, -2371.21, 3197.92, -0.96); - thisAI->AddWaypoint(14, -2380.35, 3210.45, -1.08); - thisAI->AddWaypoint(15, -2384.74, 3221.25, -1.17); - thisAI->AddWaypoint(16, -2386.15, 3233.39, -1.29); - thisAI->AddWaypoint(17, -2383.45, 3247.79, -1.32); - thisAI->AddWaypoint(18, -2367.50, 3265.64, -1.33); - thisAI->AddWaypoint(19, -2354.90, 3273.30, -1.50); - thisAI->AddWaypoint(20, -2348.88, 3280.58, -0.09); - thisAI->AddWaypoint(21, -2349.06, 3295.86, -0.95); - thisAI->AddWaypoint(22, -2350.43, 3328.27, -2.10); - thisAI->AddWaypoint(23, -2346.76, 3356.27, -2.82); - thisAI->AddWaypoint(24, -2340.56, 3370.68, -4.02); - thisAI->AddWaypoint(25, -2318.84, 3384.60, -7.61); - thisAI->AddWaypoint(26, -2313.99, 3398.61, -10.40); - thisAI->AddWaypoint(27, -2320.85, 3414.49, -11.49); - thisAI->AddWaypoint(28, -2338.26, 3426.06, -11.46); - thisAI->AddWaypoint(29, -2342.67, 3439.44, -11.32, 12000);//progress4 - thisAI->AddWaypoint(30, -2342.67, 3439.44, -11.32, 7000);//emote bye - thisAI->AddWaypoint(31, -2342.67, 3439.44, -11.32, 5000);//cat form - thisAI->AddWaypoint(32, -2344.60, 3461.27, -10.44); - thisAI->AddWaypoint(33, -2396.81, 3517.17, -3.55); - thisAI->AddWaypoint(34, -2439.23, 3523.00, -1.05); - - return (CreatureAI*)thisAI; + npc_isla_starmaneAI* thisAI = new npc_isla_starmaneAI(_Creature); + + thisAI->AddWaypoint(0, -2265.21, 3091.14, 13.91); + thisAI->AddWaypoint(1, -2266.80, 3091.33, 13.82, 1000); + thisAI->AddWaypoint(2, -2268.20, 3091.14, 13.82, 7000);//progress1 + thisAI->AddWaypoint(3, -2278.32, 3098.98, 13.82); + thisAI->AddWaypoint(4, -2294.82, 3110.59, 13.82); + thisAI->AddWaypoint(5, -2300.71, 3114.60, 13.82, 20000);//progress2 + thisAI->AddWaypoint(6, -2300.71, 3114.60, 13.82, 3000);//progress3 + thisAI->AddWaypoint(7, -2307.36, 3122.76, 13.79); + thisAI->AddWaypoint(8, -2312.83, 3130.55, 12.04); + thisAI->AddWaypoint(9, -2345.02, 3151.00, 8.38); + thisAI->AddWaypoint(10, -2351.97, 3157.61, 6.27); + thisAI->AddWaypoint(11, -2360.35, 3171.48, 3.31); + thisAI->AddWaypoint(12, -2371.44, 3185.41, 0.89); + thisAI->AddWaypoint(13, -2371.21, 3197.92, -0.96); + thisAI->AddWaypoint(14, -2380.35, 3210.45, -1.08); + thisAI->AddWaypoint(15, -2384.74, 3221.25, -1.17); + thisAI->AddWaypoint(16, -2386.15, 3233.39, -1.29); + thisAI->AddWaypoint(17, -2383.45, 3247.79, -1.32); + thisAI->AddWaypoint(18, -2367.50, 3265.64, -1.33); + thisAI->AddWaypoint(19, -2354.90, 3273.30, -1.50); + thisAI->AddWaypoint(20, -2348.88, 3280.58, -0.09); + thisAI->AddWaypoint(21, -2349.06, 3295.86, -0.95); + thisAI->AddWaypoint(22, -2350.43, 3328.27, -2.10); + thisAI->AddWaypoint(23, -2346.76, 3356.27, -2.82); + thisAI->AddWaypoint(24, -2340.56, 3370.68, -4.02); + thisAI->AddWaypoint(25, -2318.84, 3384.60, -7.61); + thisAI->AddWaypoint(26, -2313.99, 3398.61, -10.40); + thisAI->AddWaypoint(27, -2320.85, 3414.49, -11.49); + thisAI->AddWaypoint(28, -2338.26, 3426.06, -11.46); + thisAI->AddWaypoint(29, -2342.67, 3439.44, -11.32, 12000);//progress4 + thisAI->AddWaypoint(30, -2342.67, 3439.44, -11.32, 7000);//emote bye + thisAI->AddWaypoint(31, -2342.67, 3439.44, -11.32, 5000);//cat form + thisAI->AddWaypoint(32, -2344.60, 3461.27, -10.44); + thisAI->AddWaypoint(33, -2396.81, 3517.17, -3.55); + thisAI->AddWaypoint(34, -2439.23, 3523.00, -1.05); + + return (CreatureAI*)thisAI; } void AddSC_terokkar_forest() @@ -527,9 +527,9 @@ void AddSC_terokkar_forest() newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_deesak; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name= "npc_isla_starmane"; - newscript->GetAI = &GetAI_npc_isla_starmaneAI; - newscript->pQuestAccept = &QuestAccept_npc_isla_starmane; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name= "npc_isla_starmane"; + newscript->GetAI = &GetAI_npc_isla_starmaneAI; + newscript->pQuestAccept = &QuestAccept_npc_isla_starmane; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp index e95f7e7ca5d..d1ba50406d1 100644 --- a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp +++ b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp @@ -53,12 +53,12 @@ npc_swiftmountainAI(Creature *c) : npc_escortAI(c) {Reset();} case 46: DoScriptText(SAY_AGGRO, m_creature, player); break; - case 47: + case 47: m_creature->SummonCreature(ENTRY_WYVERN, -5016.45, -935.01, -5.46, 5.36,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); m_creature->SummonCreature(ENTRY_WYVERN, -5001.98, -934.96, -5.55, 3.18,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); m_creature->SummonCreature(ENTRY_WYVERN, -4999.06, -949.61, -5.42, 2.04,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); break; - case 70: + case 70: DoScriptText(SAY_FINISH, m_creature, player); if (player && player->GetTypeId() == TYPEID_PLAYER) ((Player*)player)->GroupEventHappens(QUEST_HOMEWARD_BOUND,m_creature); diff --git a/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp b/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp index 9b75549bc4c..779466f2863 100644 --- a/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp +++ b/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp @@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL npc_calvin_montagueAI : public ScriptedAI void Reset() { m_creature->setFaction(FACTION_FRIENDLY); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); } void Aggro(Unit* who) { } @@ -74,7 +74,7 @@ bool QuestAccept_npc_calvin_montague(Player* player, Creature* creature, Quest c if( quest->GetQuestId() == QUEST_590 ) { creature->setFaction(FACTION_HOSTILE); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); ((npc_calvin_montagueAI*)creature->AI())->AttackStart(player); } return true; @@ -150,7 +150,7 @@ void AddSC_tirisfal_glades() newscript->pQuestAccept = &QuestAccept_npc_calvin_montague; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name = "go_mausoleum_door"; newscript->pGOHello = &GOHello_go_mausoleum_door; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp b/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp index 930e0d2f562..08e1eeee423 100644 --- a/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp +++ b/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp @@ -185,7 +185,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance if (target && target->isDead()) { target->Respawn(); - target->GetMotionMaster()->MoveTargetedHome(); + target->GetMotionMaster()->MoveTargetedHome(); SetFrozenState(target); } } @@ -197,7 +197,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance if (target && target->isDead()) { target->Respawn(); - target->GetMotionMaster()->MoveTargetedHome(); + target->GetMotionMaster()->MoveTargetedHome(); SetFrozenState(target); } } @@ -209,7 +209,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance if (target && target->isDead()) { target->Respawn(); - target->GetMotionMaster()->MoveTargetedHome(); + target->GetMotionMaster()->MoveTargetedHome(); SetFrozenState(target); } } diff --git a/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp b/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp index 50f7bbcf9e4..36598bddf2d 100644 --- a/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp +++ b/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp @@ -45,9 +45,9 @@ EndContentData */ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI { - npc_ameAI(Creature *c) : npc_escortAI(c) {Reset();} + npc_ameAI(Creature *c) : npc_escortAI(c) {Reset();} - uint32 DEMORALIZINGSHOUT_Timer; + uint32 DEMORALIZINGSHOUT_Timer; void WaypointReached(uint32 i) { @@ -126,7 +126,7 @@ bool QuestAccept_npc_ame(Player* player, Creature* creature, Quest const* quest) { ((npc_escortAI*)(creature->AI()))->Start(false, true, false, player->GetGUID()); DoScriptText(SAY_READY, creature, player); - creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); // Change faction so mobs attack creature->setFaction(113); } diff --git a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp index 274d07ca0e8..235813ec98b 100644 --- a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp +++ b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp @@ -255,123 +255,123 @@ bool GossipSelect_npc_mortog_steamhead(Player *player, Creature *_Creature, uint ## npc_kayra_longmane ######*/ -#define SAY_PROGRESS_1 -1000360 -#define SAY_PROGRESS_2 -1000361 -#define SAY_PROGRESS_3 -1000362 -#define SAY_PROGRESS_4 -1000363 -#define SAY_PROGRESS_5 -1000364 -#define SAY_PROGRESS_6 -1000365 +#define SAY_PROGRESS_1 -1000360 +#define SAY_PROGRESS_2 -1000361 +#define SAY_PROGRESS_3 -1000362 +#define SAY_PROGRESS_4 -1000363 +#define SAY_PROGRESS_5 -1000364 +#define SAY_PROGRESS_6 -1000365 -#define QUEST_EFU 9752 -#define MOB_AMBUSH 18042 +#define QUEST_EFU 9752 +#define MOB_AMBUSH 18042 -struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI +struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI { - npc_kayra_longmaneAI(Creature* c) : npc_escortAI(c) {Reset();} + npc_kayra_longmaneAI(Creature* c) : npc_escortAI(c) {Reset();} - bool Completed; + bool Completed; - void Reset() - { - Completed = false; + void Reset() + { + Completed = false; m_creature->setFaction(1660); - } - - void Aggro(Unit* who){} - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature); - summoned->setFaction(14); - } - - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - switch(i) - { - case 0: DoScriptText(SAY_PROGRESS_1, m_creature, player); break; - case 5: DoScriptText(SAY_PROGRESS_2, m_creature, player); - m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - break; - case 6: DoScriptText(SAY_PROGRESS_3, m_creature, player); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - break; - case 18: DoScriptText(SAY_PROGRESS_4, m_creature, player); - m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - break; - case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - DoScriptText(SAY_PROGRESS_5, m_creature, player); break; - case 26: DoScriptText(SAY_PROGRESS_6, m_creature, player); - Completed = true; - if(player) - ((Player*)player)->GroupEventHappens(QUEST_EFU, m_creature); - break; - } - } - - void JustDied(Unit* killer) - { - if (PlayerGUID && !Completed) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (player && !Completed) - ((Player*)player)->FailQuest(QUEST_EFU); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + } + + void Aggro(Unit* who){} + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature); + summoned->setFaction(14); + } + + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + switch(i) + { + case 0: DoScriptText(SAY_PROGRESS_1, m_creature, player); break; + case 5: DoScriptText(SAY_PROGRESS_2, m_creature, player); + m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + break; + case 6: DoScriptText(SAY_PROGRESS_3, m_creature, player); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + break; + case 18: DoScriptText(SAY_PROGRESS_4, m_creature, player); + m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + break; + case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + DoScriptText(SAY_PROGRESS_5, m_creature, player); break; + case 26: DoScriptText(SAY_PROGRESS_6, m_creature, player); + Completed = true; + if(player) + ((Player*)player)->GroupEventHappens(QUEST_EFU, m_creature); + break; + } + } + + void JustDied(Unit* killer) + { + if (PlayerGUID && !Completed) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player && !Completed) + ((Player*)player)->FailQuest(QUEST_EFU); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; bool QuestAccept_npc_kayra_longmane(Player* player, Creature* creature, Quest const* quest) { - if (quest->GetQuestId() == QUEST_EFU) + if (quest->GetQuestId() == QUEST_EFU) { ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - creature->setFaction(113); + creature->setFaction(113); } return true; } CreatureAI* GetAI_npc_kayra_longmaneAI(Creature* _Creature) { - npc_kayra_longmaneAI* thisAI = new npc_kayra_longmaneAI(_Creature); - - thisAI->AddWaypoint(0, -931.88, 5283.56, 23.98);//SAY_PROGRESS_1 - thisAI->AddWaypoint(1, -930.52, 5287.57, 23.82); - thisAI->AddWaypoint(2, -924.98, 5297.94, 17.78); - thisAI->AddWaypoint(3, -928.83, 5316.07, 18.18); - thisAI->AddWaypoint(4, -930.07, 5323.10, 18.63); - thisAI->AddWaypoint(5, -926.58, 5331.24, 18.74, 6000);//SAY_PROGRESS_2 - thisAI->AddWaypoint(6, -926.58, 5331.24, 18.74, 3000);//SAY_PROGRESS_3 Run to the hills! - thisAI->AddWaypoint(7, -931.24, 5358.89, 18.14); - thisAI->AddWaypoint(8, -934.43, 5370.20, 22.41); - thisAI->AddWaypoint(9, -943.01, 5400.55, 22.74); - thisAI->AddWaypoint(10, -929.62, 5417.98, 23.07); - thisAI->AddWaypoint(11, -901.92, 5420.38, 24.19); - thisAI->AddWaypoint(12, -859.03, 5415.36, 23.64); - thisAI->AddWaypoint(13, -808.94, 5401.93, 23.11); - thisAI->AddWaypoint(14, -772.74, 5390.53, 22.97); - thisAI->AddWaypoint(15, -749.71, 5385.39, 22.75); - thisAI->AddWaypoint(16, -721.23, 5380.38, 22.47); - thisAI->AddWaypoint(17, -687.96, 5379.08, 22.16); - thisAI->AddWaypoint(18, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_4 Summon Ambush - thisAI->AddWaypoint(19, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_5 - thisAI->AddWaypoint(20, -636.14, 5385.25, 22.20); - thisAI->AddWaypoint(21, -602.94, 5411.36, 21.48); - thisAI->AddWaypoint(22, -566.86, 5421.87, 21.25); - thisAI->AddWaypoint(23, -547.27, 5427.87, 21.10); - thisAI->AddWaypoint(24, -520.59, 5444.83, 21.15); - thisAI->AddWaypoint(25, -488.45, 5447.83, 22.38); - thisAI->AddWaypoint(26, -449.65, 5463.78, 21.77, 11000);//SAY_PROGRESS_6 - - return (CreatureAI*)thisAI; + npc_kayra_longmaneAI* thisAI = new npc_kayra_longmaneAI(_Creature); + + thisAI->AddWaypoint(0, -931.88, 5283.56, 23.98);//SAY_PROGRESS_1 + thisAI->AddWaypoint(1, -930.52, 5287.57, 23.82); + thisAI->AddWaypoint(2, -924.98, 5297.94, 17.78); + thisAI->AddWaypoint(3, -928.83, 5316.07, 18.18); + thisAI->AddWaypoint(4, -930.07, 5323.10, 18.63); + thisAI->AddWaypoint(5, -926.58, 5331.24, 18.74, 6000);//SAY_PROGRESS_2 + thisAI->AddWaypoint(6, -926.58, 5331.24, 18.74, 3000);//SAY_PROGRESS_3 Run to the hills! + thisAI->AddWaypoint(7, -931.24, 5358.89, 18.14); + thisAI->AddWaypoint(8, -934.43, 5370.20, 22.41); + thisAI->AddWaypoint(9, -943.01, 5400.55, 22.74); + thisAI->AddWaypoint(10, -929.62, 5417.98, 23.07); + thisAI->AddWaypoint(11, -901.92, 5420.38, 24.19); + thisAI->AddWaypoint(12, -859.03, 5415.36, 23.64); + thisAI->AddWaypoint(13, -808.94, 5401.93, 23.11); + thisAI->AddWaypoint(14, -772.74, 5390.53, 22.97); + thisAI->AddWaypoint(15, -749.71, 5385.39, 22.75); + thisAI->AddWaypoint(16, -721.23, 5380.38, 22.47); + thisAI->AddWaypoint(17, -687.96, 5379.08, 22.16); + thisAI->AddWaypoint(18, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_4 Summon Ambush + thisAI->AddWaypoint(19, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_5 + thisAI->AddWaypoint(20, -636.14, 5385.25, 22.20); + thisAI->AddWaypoint(21, -602.94, 5411.36, 21.48); + thisAI->AddWaypoint(22, -566.86, 5421.87, 21.25); + thisAI->AddWaypoint(23, -547.27, 5427.87, 21.10); + thisAI->AddWaypoint(24, -520.59, 5444.83, 21.15); + thisAI->AddWaypoint(25, -488.45, 5447.83, 22.38); + thisAI->AddWaypoint(26, -449.65, 5463.78, 21.77, 11000);//SAY_PROGRESS_6 + + return (CreatureAI*)thisAI; } /*###### ## AddSC @@ -405,9 +405,9 @@ void AddSC_zangarmarsh() newscript->pGossipSelect = &GossipSelect_npc_mortog_steamhead; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name="npc_kayra_longmane"; - newscript->GetAI = &GetAI_npc_kayra_longmaneAI; - newscript->pQuestAccept = &QuestAccept_npc_kayra_longmane; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="npc_kayra_longmane"; + newscript->GetAI = &GetAI_npc_kayra_longmaneAI; + newscript->pQuestAccept = &QuestAccept_npc_kayra_longmane; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp index 453f111d6bd..7eb9fb81426 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp @@ -27,15 +27,15 @@ EndScriptData */ #include "def_zulaman.h" #include "Weather.h" -#define SPELL_STATIC_DISRUPTION 43622 -#define SPELL_STATIC_VISUAL 45265 -#define SPELL_CALL_LIGHTNING 43661 //Missing timer -#define SPELL_GUST_OF_WIND 43621 -#define SPELL_ELECTRICAL_STORM 43648 -#define SPELL_BERSERK 45078 -#define SPELL_ELECTRICAL_DAMAGE 43657 -#define SPELL_ELECTRICAL_OVERLOAD 43658 -#define SPELL_EAGLE_SWOOP 44732 +#define SPELL_STATIC_DISRUPTION 43622 +#define SPELL_STATIC_VISUAL 45265 +#define SPELL_CALL_LIGHTNING 43661 //Missing timer +#define SPELL_GUST_OF_WIND 43621 +#define SPELL_ELECTRICAL_STORM 43648 +#define SPELL_BERSERK 45078 +#define SPELL_ELECTRICAL_DAMAGE 43657 +#define SPELL_ELECTRICAL_OVERLOAD 43658 +#define SPELL_EAGLE_SWOOP 44732 //"Your death gonna be quick, strangers. You shoulda never have come to this place..." #define SAY_ONAGGRO "I be da predator! You da prey..." @@ -61,7 +61,7 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI { boss_akilzonAI(Creature *c) : ScriptedAI(c) { - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ELECTRICAL_DAMAGE); + SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ELECTRICAL_DAMAGE); if(TempSpell) TempSpell->EffectBasePoints[1] = 49;//disable bugged lightning until fixed in core pInstance = ((ScriptedInstance*)c->GetInstanceData()); @@ -69,7 +69,7 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI } ScriptedInstance *pInstance; - uint64 BirdGUIDs[8]; + uint64 BirdGUIDs[8]; uint64 TargetGUID; uint64 CycloneGUID; uint64 CloudGUID; @@ -101,9 +101,9 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI TargetGUID = 0; CloudGUID = 0; CycloneGUID = 0; - DespawnSummons(); - for(uint8 i = 0; i < 8; i++) - BirdGUIDs[i] = 0; + DespawnSummons(); + for(uint8 i = 0; i < 8; i++) + BirdGUIDs[i] = 0; StormCount = 0; StormSequenceTimer = 0; @@ -148,15 +148,15 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI void DespawnSummons() { - for (uint8 i = 0; i < 8; i++) + for (uint8 i = 0; i < 8; i++) { - Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); - if(bird && bird->isAlive()) - { - bird->SetVisibility(VISIBILITY_OFF); - bird->setDeathState(JUST_DIED); - } - } + Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); + if(bird && bird->isAlive()) + { + bird->SetVisibility(VISIBILITY_OFF); + bird->setDeathState(JUST_DIED); + } + } } void SetWeather(uint32 weather, float grade) @@ -197,29 +197,29 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI cell_lock->Visit(cell_lock, world_unit_searcher, *(m_creature->GetMap())); cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap())); } - //dealdamege - for(std::list::iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) + //dealdamege + for(std::list::iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) { - if(Cloud->GetDistance2d(*i)>= 6) + if(Cloud->GetDistance2d(*i)>= 6) { Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, m_creature->GetGUID()); } } // visual float x,y,z; - z = m_creature->GetPositionZ(); + z = m_creature->GetPositionZ(); for(uint8 i = 0; i < 5+rand()%5; ++i) { x = 343+rand()%60; y = 1380+rand()%60; if(Unit *trigger = m_creature->SummonTrigger(x, y, z, 0, 2000)) { - trigger->setFaction(35); + trigger->setFaction(35); trigger->SetMaxHealth(100000); trigger->SetHealth(100000); - trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (Cloud) - Cloud->CastCustomSpell(trigger, /*43661*/43137, &bp0, NULL, NULL,true, 0, 0, Cloud->GetGUID()); + trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + if (Cloud) + Cloud->CastCustomSpell(trigger, /*43661*/43137, &bp0, NULL, NULL,true, 0, 0, Cloud->GetGUID()); } } } @@ -230,8 +230,8 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI SummonEagles_Timer = 5000; m_creature->InterruptNonMeleeSpells(false); CloudGUID = 0; - if (Cloud) - Cloud->DealDamage(Cloud, Cloud->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + if (Cloud) + Cloud->DealDamage(Cloud, Cloud->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); SetWeather(WEATHER_STATE_FINE, 0.0f); isRaining = false; } @@ -304,23 +304,23 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI EnterEvadeMode(); return; } - target->CastSpell(target, 44007, true);//cloud visual - m_creature->CastSpell(target, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual + target->CastSpell(target, 44007, true);//cloud visual + m_creature->CastSpell(target, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual float x,y,z; - target->GetPosition(x,y,z); - if (target) - { - target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - target->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0,0,0); - } - Unit *Cloud = m_creature->SummonTrigger(x, y, m_creature->GetPositionZ()+16, 0, 15000); + target->GetPosition(x,y,z); + if (target) + { + target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + target->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0,0,0); + } + Unit *Cloud = m_creature->SummonTrigger(x, y, m_creature->GetPositionZ()+16, 0, 15000); if(Cloud) { - CloudGUID = Cloud->GetGUID(); - Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + CloudGUID = Cloud->GetGUID(); + Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); Cloud->StopMoving(); Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); - Cloud->setFaction(35); + Cloud->setFaction(35); Cloud->SetMaxHealth(9999999); Cloud->SetHealth(9999999); Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -338,27 +338,27 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI float x, y, z; m_creature->GetPosition(x, y, z); - for (uint8 i = 0; i < 8; i++) + for (uint8 i = 0; i < 8; i++) { - Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); - if(!bird)//they despawned on die - { - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - x = target->GetPositionX() + 10 - rand()%20; - y = target->GetPositionY() + 10 - rand()%20; - z = target->GetPositionZ() + 6 + rand()%5 + 10; - if(z > 95) z = 95 - rand()%5; - } - Creature *pCreature = m_creature->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (pCreature) - { - pCreature->AddThreat(m_creature->getVictim(), 1.0f); - pCreature->AI()->AttackStart(m_creature->getVictim()); - BirdGUIDs[i] = pCreature->GetGUID(); - } - } - } + Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); + if(!bird)//they despawned on die + { + if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + x = target->GetPositionX() + 10 - rand()%20; + y = target->GetPositionY() + 10 - rand()%20; + z = target->GetPositionZ() + 6 + rand()%5 + 10; + if(z > 95) z = 95 - rand()%5; + } + Creature *pCreature = m_creature->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (pCreature) + { + pCreature->AddThreat(m_creature->getVictim(), 1.0f); + pCreature->AI()->AttackStart(m_creature->getVictim()); + BirdGUIDs[i] = pCreature->GetGUID(); + } + } + } SummonEagles_Timer = 999999; } else SummonEagles_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp index 818e87b3ce0..03ed35fcf6c 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp @@ -100,7 +100,7 @@ struct TRINITY_DLL_DECL boss_halazziAI : public ScriptedAI void Reset() { - if(pInstance) + if(pInstance) pInstance->SetData(DATA_HALAZZIEVENT, NOT_STARTED); TransformCount = 0; @@ -115,7 +115,7 @@ struct TRINITY_DLL_DECL boss_halazziAI : public ScriptedAI void Aggro(Unit *who) { - if(pInstance) + if(pInstance) pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS); DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); @@ -282,18 +282,18 @@ struct TRINITY_DLL_DECL boss_halazziAI : public ScriptedAI if(CheckTimer < diff) { Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID); - if(Lynx) - { - Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); - m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0); - if(m_creature->IsWithinDistInMap(Lynx, 6.0f)) - { - if(TransformCount < 3) - EnterPhase(PHASE_LYNX); - else - EnterPhase(PHASE_ENRAGE); - } - } + if(Lynx) + { + Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); + m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0); + if(m_creature->IsWithinDistInMap(Lynx, 6.0f)) + { + if(TransformCount < 3) + EnterPhase(PHASE_LYNX); + else + EnterPhase(PHASE_ENRAGE); + } + } CheckTimer = 1000; }else CheckTimer -= diff; } @@ -319,7 +319,7 @@ struct TRINITY_DLL_DECL boss_halazziAI : public ScriptedAI void JustDied(Unit* Killer) { - if(pInstance) + if(pInstance) pInstance->SetData(DATA_HALAZZIEVENT, DONE); DoYell(YELL_DEATH, LANG_UNIVERSAL, NULL); diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp index e4efe3d83ba..d7ce85055d3 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp @@ -157,7 +157,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); if(pInstance) pInstance->SetData(DATA_JANALAIEVENT, DONE); @@ -167,8 +167,8 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; } } @@ -177,7 +177,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI if(pInstance) pInstance->SetData(DATA_JANALAIEVENT, IN_PROGRESS); - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); // DoZoneInCombat(); } @@ -353,7 +353,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI } else { - DoScriptText(SAY_BERSERK, m_creature); + DoScriptText(SAY_BERSERK, m_creature); m_creature->CastSpell(m_creature, SPELL_BERSERK, true); EnrageTimer = 300000; } @@ -361,7 +361,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI if(BombTimer < diff) { - DoScriptText(SAY_FIRE_BOMBS, m_creature); + DoScriptText(SAY_FIRE_BOMBS, m_creature); m_creature->AttackStop(); m_creature->GetMotionMaster()->Clear(); @@ -395,7 +395,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI { if(100 * m_creature->GetHealth() < 35 * m_creature->GetMaxHealth()) { - DoScriptText(SAY_ALL_EGGS, m_creature); + DoScriptText(SAY_ALL_EGGS, m_creature); m_creature->AttackStop(); m_creature->GetMotionMaster()->Clear(); @@ -410,7 +410,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI { if(HatchAllEggs(0)) { - DoScriptText(SAY_SUMMON_HATCHER, m_creature); + DoScriptText(SAY_SUMMON_HATCHER, m_creature); m_creature->SummonCreature(MOB_AMANI_HATCHER,hatcherway[0][0][0],hatcherway[0][0][1],hatcherway[0][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); m_creature->SummonCreature(MOB_AMANI_HATCHER,hatcherway[1][0][0],hatcherway[1][0][1],hatcherway[1][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); HatcherTimer = 90000; diff --git a/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp b/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp index 8ab8b973581..dff3148aa57 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp @@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance { instance_zulaman(Map *map) : ScriptedInstance(map) {Initialize();}; - uint64 HarkorsSatchelGUID; + uint64 HarkorsSatchelGUID; uint64 TanzarsTrunkGUID; uint64 AshlisBagGUID; uint64 KrazsPackageGUID; @@ -74,10 +74,10 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance void Initialize() { - HarkorsSatchelGUID = 0; - TanzarsTrunkGUID = 0; - AshlisBagGUID = 0; - KrazsPackageGUID = 0; + HarkorsSatchelGUID = 0; + TanzarsTrunkGUID = 0; + AshlisBagGUID = 0; + KrazsPackageGUID = 0; uint64 HexLordGateGUID = 0; uint64 ZulJinGateGUID = 0; diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp index 16344adc5ba..461b1a8ee33 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp @@ -36,15 +36,15 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_arlokkAI : public ScriptedAI { - boss_arlokkAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } + boss_arlokkAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } - ScriptedInstance *pInstance; + ScriptedInstance *pInstance; - uint32 ShadowWordPain_Timer; + uint32 ShadowWordPain_Timer; uint32 Gouge_Timer; uint32 Mark_Timer; uint32 Cleave_Timer; @@ -81,12 +81,12 @@ struct TRINITY_DLL_DECL boss_arlokkAI : public ScriptedAI void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15218); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -123,10 +123,10 @@ struct TRINITY_DLL_DECL boss_arlokkAI : public ScriptedAI Panther = m_creature->SummonCreature(15101,-11532.79980,-1649.6734,41.4800,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(markedTarget && Panther ) - { - DoScriptText(SAY_FEAST_PANTHER, m_creature, markedTarget); + { + DoScriptText(SAY_FEAST_PANTHER, m_creature, markedTarget); Panther ->AI()->AttackStart(markedTarget); - }else Panther ->AI()->AttackStart(target); + }else Panther ->AI()->AttackStart(target); Panther = m_creature->SummonCreature(15101,-11532.9970,-1606.4840,41.2979,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp index d8eada5662c..d4c8039f5c6 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp @@ -50,7 +50,7 @@ struct TRINITY_DLL_DECL boss_hakkarAI : public ScriptedAI Reset(); } - ScriptedInstance *pInstance; + ScriptedInstance *pInstance; uint32 BloodSiphon_Timer; uint32 CorruptedBlood_Timer; @@ -97,7 +97,7 @@ struct TRINITY_DLL_DECL boss_hakkarAI : public ScriptedAI void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); } void UpdateAI(const uint32 diff) @@ -120,21 +120,21 @@ struct TRINITY_DLL_DECL boss_hakkarAI : public ScriptedAI }else CorruptedBlood_Timer -= diff; //CauseInsanity_Timer - /*if (CauseInsanity_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_CAUSEINSANITY); + /*if (CauseInsanity_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_CAUSEINSANITY); - CauseInsanity_Timer = 35000 + rand()%8000; - }else CauseInsanity_Timer -= diff;*/ + CauseInsanity_Timer = 35000 + rand()%8000; + }else CauseInsanity_Timer -= diff;*/ //WillOfHakkar_Timer if (WillOfHakkar_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_WILLOFHAKKAR); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_WILLOFHAKKAR); - WillOfHakkar_Timer = 25000 + rand()%10000; + WillOfHakkar_Timer = 25000 + rand()%10000; }else WillOfHakkar_Timer -= diff; if (!Enraged && Enrage_Timer < diff) diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp index 0d22a980f37..a5ac43e6cef 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp @@ -43,13 +43,13 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_jeklikAI : public ScriptedAI { - boss_jeklikAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } + boss_jeklikAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } - ScriptedInstance *pInstance; + ScriptedInstance *pInstance; uint32 Charge_Timer; uint32 SonicBurst_Timer; @@ -94,8 +94,8 @@ struct TRINITY_DLL_DECL boss_jeklikAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if (!UpdateVictim()) - return; + if (!UpdateVictim()) + return; if( m_creature->getVictim() && m_creature->isAlive()) { @@ -158,7 +158,7 @@ struct TRINITY_DLL_DECL boss_jeklikAI : public ScriptedAI { if(PhaseTwo && ShadowWordPain_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) { DoCast(target, SPELL_SHADOW_WORD_PAIN); ShadowWordPain_Timer = 12000 + rand()%6000; @@ -244,7 +244,7 @@ struct TRINITY_DLL_DECL mob_batriderAI : public ScriptedAI //Bomb_Timer if(Bomb_Timer < diff) { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) { DoCast(target, SPELL_BOMB); Bomb_Timer = 5000; diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp index 3be31b32e11..fa0bced67c9 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp @@ -47,7 +47,7 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI Reset(); } - ScriptedInstance *pInstance; + ScriptedInstance *pInstance; uint32 BrainWashTotem_Timer; uint32 HealingWard_Timer; @@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); } void UpdateAI(const uint32 diff) @@ -107,13 +107,13 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI //Casting the delusion curse with a shade. So shade will attack the same target with the curse. if (Delusions_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { DoCast(target, SPELL_DELUSIONSOFJINDO); Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); Shade->AI()->AttackStart(target); - } + } Delusions_Timer = 4000 + rand()%8000; }else Delusions_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp index bccd9c44bf5..e365ba7f153 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp @@ -50,7 +50,7 @@ struct TRINITY_DLL_DECL boss_mandokirAI : public ScriptedAI Reset(); } - uint32 KillCount; + uint32 KillCount; uint32 Watch_Timer; uint32 TargetInRange; uint32 Cleave_Timer; @@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL boss_mandokirAI : public ScriptedAI void Reset() { - KillCount = 0; + KillCount = 0; Watch_Timer = 33000; Cleave_Timer = 7000; Whirlwind_Timer = 20000; @@ -100,34 +100,34 @@ struct TRINITY_DLL_DECL boss_mandokirAI : public ScriptedAI { if(victim->GetTypeId() == TYPEID_PLAYER) { - ++KillCount; - - if (KillCount == 3) - { - DoScriptText(SAY_DING_KILL, m_creature); - - if (pInstance) - { - uint64 JindoGUID = pInstance->GetData64(DATA_JINDO); - if (JindoGUID) - { - if (Unit* jTemp = Unit::GetUnit(*m_creature,JindoGUID)) - { - if (jTemp->isAlive()) - DoScriptText(SAY_GRATS_JINDO, jTemp); - } - } - } + ++KillCount; + + if (KillCount == 3) + { + DoScriptText(SAY_DING_KILL, m_creature); + + if (pInstance) + { + uint64 JindoGUID = pInstance->GetData64(DATA_JINDO); + if (JindoGUID) + { + if (Unit* jTemp = Unit::GetUnit(*m_creature,JindoGUID)) + { + if (jTemp->isAlive()) + DoScriptText(SAY_GRATS_JINDO, jTemp); + } + } + } DoCast(m_creature, SPELL_LEVEL_UP, true); - KillCount = 0; - } - } - } + KillCount = 0; + } + } + } void Aggro(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } + { + DoScriptText(SAY_AGGRO, m_creature); + } void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp index 481784cc04c..31aff621b00 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp @@ -40,13 +40,13 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_marliAI : public ScriptedAI { - boss_marliAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } + boss_marliAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } - ScriptedInstance *pInstance; + ScriptedInstance *pInstance; uint32 SpawnStartSpiders_Timer; uint32 PoisonVolley_Timer; @@ -79,12 +79,12 @@ struct TRINITY_DLL_DECL boss_marliAI : public ScriptedAI void Aggro(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, m_creature); } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, m_creature); if(pInstance) pInstance->SetData(DATA_MARLI_DEATH, 0); } @@ -110,9 +110,9 @@ struct TRINITY_DLL_DECL boss_marliAI : public ScriptedAI if (!Spawned && SpawnStartSpiders_Timer < diff) { - DoScriptText(SAY_SPIDER_SPAWN, m_creature); + DoScriptText(SAY_SPIDER_SPAWN, m_creature); - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(target && Spider ) Spider ->AI()->AttackStart(target); @@ -128,17 +128,17 @@ struct TRINITY_DLL_DECL boss_marliAI : public ScriptedAI if (SpawnSpider_Timer < diff) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Spider ) - Spider ->AI()->AttackStart(target); + if (target && Spider ) + Spider ->AI()->AttackStart(target); SpawnSpider_Timer = 12000 + rand()%5000; }else SpawnSpider_Timer -= diff; if(!PhaseTwo && Transform_Timer < diff) { - DoScriptText(SAY_TRANSFORM, m_creature); + DoScriptText(SAY_TRANSFORM, m_creature); DoCast(m_creature,SPELL_SPIDER_FORM); const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp index db9ad23858d..312c94bd009 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp @@ -54,7 +54,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI { boss_thekalAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = ((ScriptedInstance*)c->GetInstanceData()); Reset(); } @@ -192,12 +192,12 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI if (Charge_Timer < diff) { if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { + { DoCast(target,SPELL_CHARGE); m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); DoResetThreat(); AttackStart(target); - } + } Charge_Timer = 15000 + rand()%7000; }else Charge_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp index 721476c5780..75436b8080b 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp @@ -39,13 +39,13 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI { - boss_venoxisAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } + boss_venoxisAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } - ScriptedInstance *pInstance; + ScriptedInstance *pInstance; uint32 HolyFire_Timer; uint32 HolyWrath_Timer; @@ -80,9 +80,9 @@ struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); - if(pInstance) - pInstance->SetData(DATA_VENOXIS_DEATH, 0); + DoScriptText(SAY_DEATH, m_creature); + if(pInstance) + pInstance->SetData(DATA_VENOXIS_DEATH, 0); } void UpdateAI(const uint32 diff) @@ -115,7 +115,7 @@ struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI TargetInRange = 0; for(int i=0; i<10; i++) { - if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO,i)) + if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO,i)) if(m_creature->IsWithinMeleeRange(target)) TargetInRange++; } @@ -134,7 +134,7 @@ struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI if (HolyFire_Timer < diff && TargetInRange < 3) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) DoCast(target, SPELL_HOLY_FIRE); HolyFire_Timer = 8000; @@ -144,7 +144,7 @@ struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI { if(!PhaseTwo) { - DoScriptText(SAY_TRANSFORM, m_creature); + DoScriptText(SAY_TRANSFORM, m_creature); m_creature->InterruptNonMeleeSpells(false); DoCast(m_creature,SPELL_SNAKE_FORM); m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h index 3c98afe6d17..d1d9cb19f28 100644 --- a/src/game/BattleGround.h +++ b/src/game/BattleGround.h @@ -34,7 +34,7 @@ enum BattleGroundSounds SOUND_HORDE_WINS = 8454, SOUND_ALLIANCE_WINS = 8455, SOUND_BG_START = 3439, - SOUND_BG_START_L70ETC = 11803, + SOUND_BG_START_L70ETC = 11803, }; enum BattleGroundQuests diff --git a/src/game/BattleGroundAV.cpp b/src/game/BattleGroundAV.cpp index 6b892a0fa5d..c65ca479712 100644 --- a/src/game/BattleGroundAV.cpp +++ b/src/game/BattleGroundAV.cpp @@ -53,7 +53,7 @@ void BattleGroundAV::HandleKillPlayer(Player *player, Player *killer) return; BattleGround::HandleKillPlayer(player, killer); - UpdateScore(player->GetTeam(),-1); + UpdateScore(player->GetTeam(),-1); } void BattleGroundAV::HandleKillUnit(Creature *unit, Player *killer) @@ -344,19 +344,19 @@ void BattleGroundAV::Update(time_t diff) //creatures sLog.outDebug("BG_AV start poputlating nodes"); - for(BG_AV_Nodes i= BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i ) + for(BG_AV_Nodes i= BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i ) { if(m_Nodes[i].Owner) - PopulateNode(i); + PopulateNode(i); } //all creatures which don't get despawned through the script are static sLog.outDebug("BG_AV: start spawning static creatures"); for(i=0; i < AV_STATICCPLACE_MAX; i++ ) AddAVCreature(0,i+AV_CPLACE_MAX); - //mainspiritguides: + //mainspiritguides: sLog.outDebug("BG_AV: start spawning spiritguides creatures"); - AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], ALLIANCE); - AddSpiritGuide(8, BG_AV_CreaturePos[8][0], BG_AV_CreaturePos[8][1], BG_AV_CreaturePos[8][2], BG_AV_CreaturePos[8][3], HORDE); + AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], ALLIANCE); + AddSpiritGuide(8, BG_AV_CreaturePos[8][0], BG_AV_CreaturePos[8][1], BG_AV_CreaturePos[8][2], BG_AV_CreaturePos[8][3], HORDE); //spawn the marshals (those who get deleted, if a tower gets destroyed) sLog.outDebug("BG_AV: start spawning marshal creatures"); for(i=AV_NPC_A_MARSHAL_SOUTH; i<= AV_NPC_H_MARSHAL_WTOWER; i++) @@ -541,7 +541,7 @@ void BattleGroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger) { case 95: case 2608: - if(Source->GetTeam() != ALLIANCE) + if(Source->GetTeam() != ALLIANCE) Source->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal"); else Source->LeaveBattleground(); @@ -558,7 +558,7 @@ void BattleGroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger) case 3329: case 3330: case 3331: - //Source->Unmount(); + //Source->Unmount(); break; default: sLog.outDebug("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); @@ -743,8 +743,8 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) if(team == ALLIANCE || team == HORDE) { m_Mine_Reclaim_Timer[mine]=AV_MINE_RECLAIM_TIMER; - char buf[256]; - sprintf(buf, GetTrinityString(LANG_BG_AV_MINE_TAKEN), GetTrinityString(( mine == AV_NORTH_MINE ) ? LANG_BG_AV_MINE_NORTH : LANG_BG_AV_MINE_SOUTH), ( team == ALLIANCE ) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE)); + char buf[256]; + sprintf(buf, GetTrinityString(LANG_BG_AV_MINE_TAKEN), GetTrinityString(( mine == AV_NORTH_MINE ) ? LANG_BG_AV_MINE_NORTH : LANG_BG_AV_MINE_SOUTH), ( team == ALLIANCE ) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE)); Creature* creature = GetBGCreature(AV_CPLACE_HERALD); if(creature) YellToAll(creature,buf,LANG_UNIVERSAL); @@ -772,7 +772,7 @@ bool BattleGroundAV::PlayerCanDoMineQuest(int32 GOId,uint32 team) void BattleGroundAV::PopulateNode(BG_AV_Nodes node) { uint32 owner = m_Nodes[node].Owner; - assert(owner); + assert(owner); uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + ( 4 * node ); uint32 creatureid; @@ -781,7 +781,7 @@ void BattleGroundAV::PopulateNode(BG_AV_Nodes node) else { uint8 team2 = GetTeamIndexByTeamId(owner); - if (m_Team_QuestStatus[team2][0] < 500 ) + if (m_Team_QuestStatus[team2][0] < 500 ) creatureid = ( owner == ALLIANCE )? AV_NPC_A_GRAVEDEFENSE0 : AV_NPC_H_GRAVEDEFENSE0; else if ( m_Team_QuestStatus[team2][0] < 1000 ) creatureid = ( owner == ALLIANCE )? AV_NPC_A_GRAVEDEFENSE1 : AV_NPC_H_GRAVEDEFENSE1; @@ -803,7 +803,7 @@ void BattleGroundAV::PopulateNode(BG_AV_Nodes node) } void BattleGroundAV::DePopulateNode(BG_AV_Nodes node) { - uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + ( 4 * node ); + uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + ( 4 * node ); for(uint8 i=0; i<4; i++) if( m_BgCreatures[c_place+i] ) DelCreature(c_place+i); @@ -816,21 +816,21 @@ void BattleGroundAV::DePopulateNode(BG_AV_Nodes node) const BG_AV_Nodes BattleGroundAV::GetNodeThroughObject(uint32 object) { sLog.outDebug("bg_AV getnodethroughobject %i",object); - if( object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER ) - return BG_AV_Nodes(object); - if( object <= BG_AV_OBJECT_FLAG_C_A_FROSTWOLF_HUT ) - return BG_AV_Nodes(object - 11); - if( object <= BG_AV_OBJECT_FLAG_C_A_FROSTWOLF_WTOWER ) - return BG_AV_Nodes(object - 7); - if( object <= BG_AV_OBJECT_FLAG_C_H_STONEHEART_BUNKER ) - return BG_AV_Nodes(object -22); - if( object <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_HUT ) - return BG_AV_Nodes(object - 33); - if( object <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER ) - return BG_AV_Nodes(object - 29); - if( object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE ) - return BG_AV_NODES_SNOWFALL_GRAVE; - sLog.outError("BattleGroundAV: ERROR! GetPlace got a wrong object :("); + if( object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER ) + return BG_AV_Nodes(object); + if( object <= BG_AV_OBJECT_FLAG_C_A_FROSTWOLF_HUT ) + return BG_AV_Nodes(object - 11); + if( object <= BG_AV_OBJECT_FLAG_C_A_FROSTWOLF_WTOWER ) + return BG_AV_Nodes(object - 7); + if( object <= BG_AV_OBJECT_FLAG_C_H_STONEHEART_BUNKER ) + return BG_AV_Nodes(object -22); + if( object <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_HUT ) + return BG_AV_Nodes(object - 33); + if( object <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER ) + return BG_AV_Nodes(object - 29); + if( object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE ) + return BG_AV_NODES_SNOWFALL_GRAVE; + sLog.outError("BattleGroundAV: ERROR! GetPlace got a wrong object :("); assert(false); return BG_AV_Nodes(0); } @@ -941,7 +941,7 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) SpawnBGObject(object, RESPAWN_ONE_DAY); DefendNode(node,team); - PopulateNode(node); + PopulateNode(node); UpdateNodeWorldState(node); if(IsTower(node)) @@ -960,14 +960,14 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) SpawnBGObject(((team==ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i,RESPAWN_IMMEDIATELY); } } - //send a nice message to all :) - char buf[256]; - sprintf(buf, GetTrinityString(( IsTower(node) ) ? LANG_BG_AV_TOWER_DEFENDED : LANG_BG_AV_GRAVE_DEFENDED), GetNodeName(node),( team == ALLIANCE ) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE)); + //send a nice message to all :) + char buf[256]; + sprintf(buf, GetTrinityString(( IsTower(node) ) ? LANG_BG_AV_TOWER_DEFENDED : LANG_BG_AV_GRAVE_DEFENDED), GetNodeName(node),( team == ALLIANCE ) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE)); Creature* creature = GetBGCreature(AV_CPLACE_HERALD); if(creature) YellToAll(creature,buf,LANG_UNIVERSAL); - //update the statistic for the defending player - UpdatePlayerScore(player, ( IsTower(node) ) ? SCORE_TOWERS_DEFENDED : SCORE_GRAVEYARDS_DEFENDED, 1); + //update the statistic for the defending player + UpdatePlayerScore(player, ( IsTower(node) ) ? SCORE_TOWERS_DEFENDED : SCORE_GRAVEYARDS_DEFENDED, 1); if(IsTower(node)) PlaySoundToAll(AV_SOUND_BOTH_TOWER_DEFEND); else @@ -1421,7 +1421,7 @@ void BattleGroundAV::ResetBGSubclass() { for(uint8 j=0; j<9; j++) m_Team_QuestStatus[i][j]=0; - m_Team_Scores[i]=BG_AV_SCORE_INITIAL_POINTS; + m_Team_Scores[i]=BG_AV_SCORE_INITIAL_POINTS; m_IsInformedNearVictory[i]=false; m_CaptainAlive[i] = true; m_CaptainBuffTimer[i] = 120000 + urand(0,4)* 60; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times @@ -1430,7 +1430,7 @@ void BattleGroundAV::ResetBGSubclass() } for(BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_STONEHEART_GRAVE; ++i) //alliance graves InitNode(i,ALLIANCE,false); - for(BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) //alliance towers + for(BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) //alliance towers InitNode(i,ALLIANCE,true); for(BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_GRAVE; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) //horde graves InitNode(i,HORDE,false); diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index ccc6594a72c..192e85a5347 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -489,7 +489,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) Player* pCurrChar = new Player(this); pCurrChar->GetMotionMaster()->Initialize(); - // for send server info and strings (config) + // for send server info and strings (config) ChatHandler chH = ChatHandler(pCurrChar); // "GetAccountId()==db stored account id" checked in LoadFromDB (prevent login not own character using cheating tools) @@ -555,7 +555,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) SendPacket( &data ); DEBUG_LOG( "WORLD: Sent motd (SMSG_MOTD)" ); - // send server info + // send server info if(sWorld.getConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) chH.PSendSysMessage(_FULLVERSION); @@ -626,7 +626,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) data << uint32(rEntry->startmovie); SendPacket( &data ); - // send new char string if not empty + // send new char string if not empty if (!sWorld.GetNewCharString().empty()) chH.PSendSysMessage(sWorld.GetNewCharString().c_str()); } diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 05204262c77..fa2bc71152c 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -140,12 +140,12 @@ ChatCommand * ChatHandler::getCommandTable() { { "show", SEC_GAMEMASTER, false, &ChatHandler::HandleWpShowCommand, "", NULL }, { "addwp", SEC_GAMEMASTER, false, &ChatHandler::HandleWpAddCommand, "", NULL }, - { "load", SEC_GAMEMASTER, false, &ChatHandler::HandleWpLoadPathCommand, "", NULL }, - { "modify", SEC_GAMEMASTER, false, &ChatHandler::HandleWpModifyCommand, "", NULL }, - { "event", SEC_GAMEMASTER, false, &ChatHandler::HandleWpEventCommand, "", NULL }, - { "unload", SEC_GAMEMASTER, false, &ChatHandler::HandleWpUnLoadPathCommand, "", NULL }, + { "load", SEC_GAMEMASTER, false, &ChatHandler::HandleWpLoadPathCommand, "", NULL }, + { "modify", SEC_GAMEMASTER, false, &ChatHandler::HandleWpModifyCommand, "", NULL }, + { "event", SEC_GAMEMASTER, false, &ChatHandler::HandleWpEventCommand, "", NULL }, + { "unload", SEC_GAMEMASTER, false, &ChatHandler::HandleWpUnLoadPathCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { NULL, 0, false, NULL, "", NULL } }; @@ -299,8 +299,8 @@ ChatCommand * ChatHandler::getCommandTable() { "locales_npc_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesNpcTextCommand, "", NULL }, { "locales_page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPageTextCommand, "", NULL }, { "locales_quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesQuestCommand, "", NULL }, - { "waypoint_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadWpScriptsCommand, "", NULL }, - { "gm_tickets", SEC_ADMINISTRATOR, true, &ChatHandler::HandleGMTicketReloadCommand, "", NULL }, + { "waypoint_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadWpScriptsCommand, "", NULL }, + { "gm_tickets", SEC_ADMINISTRATOR, true, &ChatHandler::HandleGMTicketReloadCommand, "", NULL }, { "", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } @@ -339,7 +339,7 @@ ChatCommand * ChatHandler::getCommandTable() { "leader", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupLeaderCommand, "", NULL }, { "disband", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupDisbandCommand, "", NULL }, { "remove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupRemoveCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand lookupPlayerCommandTable[] = @@ -438,8 +438,8 @@ ChatCommand * ChatHandler::getCommandTable() { "unfollow", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcUnFollowCommand, "", NULL }, { "whisper", SEC_MODERATOR, false, &ChatHandler::HandleNpcWhisperCommand, "", NULL }, { "yell", SEC_MODERATOR, false, &ChatHandler::HandleNpcYellCommand, "", NULL }, - { "addtemp", SEC_GAMEMASTER, false, &ChatHandler::HandleTempAddSpwCommand, "", NULL }, - { "addformation", SEC_MODERATOR, false, &ChatHandler::HandleNpcAddFormationCommand, "", NULL }, + { "addtemp", SEC_GAMEMASTER, false, &ChatHandler::HandleTempAddSpwCommand, "", NULL }, + { "addformation", SEC_MODERATOR, false, &ChatHandler::HandleNpcAddFormationCommand, "", NULL }, //{ TODO: fix or remove this commands { "name", SEC_GAMEMASTER, false, &ChatHandler::HandleNameCommand, "", NULL }, @@ -473,7 +473,7 @@ ChatCommand * ChatHandler::getCommandTable() { "move", SEC_GAMEMASTER, false, &ChatHandler::HandleMoveObjectCommand, "", NULL }, { "near", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNearObjectCommand, "", NULL }, { "activate", SEC_GAMEMASTER, false, &ChatHandler::HandleActivateObjectCommand, "", NULL }, - { "addtemp", SEC_GAMEMASTER, false, &ChatHandler::HandleTempGameObjectCommand, "", NULL }, + { "addtemp", SEC_GAMEMASTER, false, &ChatHandler::HandleTempGameObjectCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; @@ -505,26 +505,26 @@ ChatCommand * ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand ticketCommandTable[] = - { - { "list", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketListCommand, "", NULL }, - { "onlinelist", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketListOnlineCommand, "", NULL }, - { "viewname", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketGetByNameCommand, "", NULL }, - { "viewid", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketGetByIdCommand, "", NULL }, - { "close", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketCloseByIdCommand, "", NULL }, - { "closedlist", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketListClosedCommand, "", NULL }, - { "delete", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGMTicketDeleteByIdCommand, "", NULL }, - { "assign", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketAssignToCommand, "", NULL }, - { "unassign", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketUnAssignCommand, "", NULL }, - { "comment", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketCommentCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; + static ChatCommand ticketCommandTable[] = + { + { "list", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketListCommand, "", NULL }, + { "onlinelist", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketListOnlineCommand, "", NULL }, + { "viewname", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketGetByNameCommand, "", NULL }, + { "viewid", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketGetByIdCommand, "", NULL }, + { "close", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketCloseByIdCommand, "", NULL }, + { "closedlist", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketListClosedCommand, "", NULL }, + { "delete", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGMTicketDeleteByIdCommand, "", NULL }, + { "assign", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketAssignToCommand, "", NULL }, + { "unassign", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketUnAssignCommand, "", NULL }, + { "comment", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketCommentCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; static ChatCommand commandTable[] = { { "account", SEC_PLAYER, true, NULL, "", accountCommandTable }, { "gm", SEC_MODERATOR, true, NULL, "", gmCommandTable }, - { "ticket", SEC_MODERATOR, false, NULL, "", ticketCommandTable }, + { "ticket", SEC_MODERATOR, false, NULL, "", ticketCommandTable }, { "npc", SEC_MODERATOR, false, NULL, "", npcCommandTable }, { "go", SEC_MODERATOR, false, NULL, "", goCommandTable }, { "learn", SEC_MODERATOR, false, NULL, "", learnCommandTable }, @@ -535,11 +535,11 @@ ChatCommand * ChatHandler::getCommandTable() { "gobject", SEC_GAMEMASTER, false, NULL, "", gobjectCommandTable }, { "honor", SEC_GAMEMASTER, false, NULL, "", honorCommandTable }, - //wp commands - { "path", SEC_GAMEMASTER, false, NULL, "", wpCommandTable }, - { "loadpath", SEC_ADMINISTRATOR, false, &ChatHandler::HandleReloadAllPaths, "", NULL }, + //wp commands + { "path", SEC_GAMEMASTER, false, NULL, "", wpCommandTable }, + { "loadpath", SEC_ADMINISTRATOR, false, &ChatHandler::HandleReloadAllPaths, "", NULL }, - { "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable }, + { "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable }, { "reload", SEC_ADMINISTRATOR, true, NULL, "", reloadCommandTable }, { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable }, { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable }, @@ -863,10 +863,10 @@ int ChatHandler::ParseCommands(const char* text) ASSERT(text); ASSERT(*text); - std::string fullcmd = text; + std::string fullcmd = text; - //if(m_session->GetSecurity() == 0) - // return 0; + //if(m_session->GetSecurity() == 0) + // return 0; /// chat case (.command or !command format) if(m_session) diff --git a/src/game/Chat.h b/src/game/Chat.h index 0317886c691..8329aab4d67 100644 --- a/src/game/Chat.h +++ b/src/game/Chat.h @@ -46,7 +46,7 @@ class ChatHandler public: explicit ChatHandler(WorldSession* session) : m_session(session) {} explicit ChatHandler(Player* player) : m_session(player->GetSession()) {} - ~ChatHandler() {} + ~ChatHandler() {} static void FillMessageData( WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit *speaker); @@ -204,7 +204,7 @@ class ChatHandler bool HandleNpcUnFollowCommand(const char* args); bool HandleNpcWhisperCommand(const char* args); bool HandleNpcYellCommand(const char* args); - bool HandleNpcAddFormationCommand(const char* args); + bool HandleNpcAddFormationCommand(const char* args); bool HandleReloadCommand(const char* args); bool HandleReloadAllCommand(const char* args); @@ -220,7 +220,7 @@ class ChatHandler bool HandleReloadConfigCommand(const char* args); bool HandleReloadWpScriptsCommand(const char* args); - bool HandleReloadAreaTriggerTavernCommand(const char* args); + bool HandleReloadAreaTriggerTavernCommand(const char* args); bool HandleReloadAreaTriggerTeleportCommand(const char* args); bool HandleReloadEventScriptsCommand(const char* args); bool HandleReloadCommandCommand(const char* args); @@ -411,18 +411,18 @@ class ChatHandler bool HandleResetAllCommand(const char * args); - // GM ticket command handlers - bool HandleGMTicketListCommand(const char* args); - bool HandleGMTicketListOnlineCommand(const char* args); - bool HandleGMTicketListClosedCommand(const char* args); - bool HandleGMTicketGetByIdCommand(const char* args); - bool HandleGMTicketGetByNameCommand(const char* args); - bool HandleGMTicketCloseByIdCommand(const char* args); - bool HandleGMTicketAssignToCommand(const char* args); - bool HandleGMTicketUnAssignCommand(const char* args); - bool HandleGMTicketCommentCommand(const char* args); - bool HandleGMTicketDeleteByIdCommand(const char* args); - bool HandleGMTicketReloadCommand(const char*); + // GM ticket command handlers + bool HandleGMTicketListCommand(const char* args); + bool HandleGMTicketListOnlineCommand(const char* args); + bool HandleGMTicketListClosedCommand(const char* args); + bool HandleGMTicketGetByIdCommand(const char* args); + bool HandleGMTicketGetByNameCommand(const char* args); + bool HandleGMTicketCloseByIdCommand(const char* args); + bool HandleGMTicketAssignToCommand(const char* args); + bool HandleGMTicketUnAssignCommand(const char* args); + bool HandleGMTicketCommentCommand(const char* args); + bool HandleGMTicketDeleteByIdCommand(const char* args); + bool HandleGMTicketReloadCommand(const char*); bool HandleMaxSkillCommand(const char* args); bool HandleSetSkillCommand(const char* args); @@ -434,13 +434,13 @@ class ChatHandler bool HandleLockAccountCommand(const char* args); bool HandleRespawnCommand(const char* args); - //New Wp Commands - bool HandleWpAddCommand(const char* args); + //New Wp Commands + bool HandleWpAddCommand(const char* args); bool HandleWpLoadPathCommand(const char* args); - bool HandleWpUnLoadPathCommand(const char* args); - bool HandleWpModifyCommand(const char* args); + bool HandleWpUnLoadPathCommand(const char* args); + bool HandleWpModifyCommand(const char* args); bool HandleWpEventCommand(const char* args); - bool HandleWpShowCommand(const char* args); + bool HandleWpShowCommand(const char* args); bool HandleReloadAllPaths(const char *args); bool HandleFlyModeCommand(const char* args); @@ -462,12 +462,12 @@ class ChatHandler bool HandleComeToMeCommand(const char *args); bool HandleCombatStopCommand(const char *args); bool HandleCharDeleteCommand(const char *args); - bool HandleSendMessageCommand(const char * args); + bool HandleSendMessageCommand(const char * args); bool HandleFlushArenaPointsCommand(const char *args); bool HandlePlayAllCommand(const char* args); bool HandleRepairitemsCommand(const char* args); - bool HandleTempGameObjectCommand(const char* args); + bool HandleTempGameObjectCommand(const char* args); bool HandleTempAddSpwCommand(const char* args); //! Development Commands @@ -523,10 +523,10 @@ class CliHandler : public ChatHandler typedef void Print(char const*); explicit CliHandler(Print* zprint) : m_print(zprint) {} - // overwrite functions - const char *GetTrinityString(int32 entry) const; - bool isAvailable(ChatCommand const& cmd) const; - void SendSysMessage(const char *str); + // overwrite functions + const char *GetTrinityString(int32 entry) const; + bool isAvailable(ChatCommand const& cmd) const; + void SendSysMessage(const char *str); char const* GetName() const; bool needReportToTarget(Player* chr) const; diff --git a/src/game/ConfusedMovementGenerator.h b/src/game/ConfusedMovementGenerator.h index 502617e140f..8847460c504 100644 --- a/src/game/ConfusedMovementGenerator.h +++ b/src/game/ConfusedMovementGenerator.h @@ -39,14 +39,14 @@ class TRINITY_DLL_SPEC ConfusedMovementGenerator void Reset(T &); bool Update(T &, const uint32 &); - bool GetDestination(float &x, float &y, float &z) const + bool GetDestination(float &x, float &y, float &z) const { - if(i_destinationHolder.HasArrived()) return false; + if(i_destinationHolder.HasArrived()) return false; i_destinationHolder.GetDestination(x,y,z); return true; } - MovementGeneratorType GetMovementGeneratorType() { return CONFUSED_MOTION_TYPE; } + MovementGeneratorType GetMovementGeneratorType() { return CONFUSED_MOTION_TYPE; } private: void _InitSpecific(T &, bool &, bool &); TimeTracker i_nextMoveTime; diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index efad9c5e484..681aab3ebe3 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -182,28 +182,28 @@ void Creature::AddToWorld() ///- Register the creature for guid lookup if(!IsInWorld()) ObjectAccessor::Instance().AddObject(this); Unit::AddToWorld(); - SearchFormation(); + SearchFormation(); } void Creature::RemoveFromWorld() { if(m_formationID) - formation_mgr.DestroyGroup(m_formationID, GetGUID()); + formation_mgr.DestroyGroup(m_formationID, GetGUID()); - ///- Remove the creature from the accessor + ///- Remove the creature from the accessor if(IsInWorld()) ObjectAccessor::Instance().RemoveObject(this); Unit::RemoveFromWorld(); } void Creature::SearchFormation() { - uint32 lowguid = GetDBTableGUIDLow(); + uint32 lowguid = GetDBTableGUIDLow(); - if(CreatureGroupMap.find(lowguid) != CreatureGroupMap.end()) - { - m_formationID = CreatureGroupMap[lowguid]->leaderGUID; - formation_mgr.UpdateCreatureGroup(m_formationID, this); - } + if(CreatureGroupMap.find(lowguid) != CreatureGroupMap.end()) + { + m_formationID = CreatureGroupMap[lowguid]->leaderGUID; + formation_mgr.UpdateCreatureGroup(m_formationID, this); + } } void Creature::RemoveCorpse() @@ -219,8 +219,8 @@ void Creature::RemoveCorpse() float x,y,z,o; GetRespawnCoord(x, y, z, &o); - SetHomePosition(x,y,z,o); - GetMap()->CreatureRelocation(this,x,y,z,o); + SetHomePosition(x,y,z,o); + GetMap()->CreatureRelocation(this,x,y,z,o); } /** @@ -416,7 +416,7 @@ void Creature::Update(uint32 diff) UpdateEntry(m_originalEntry); CreatureInfo const *cinfo = GetCreatureInfo(); - SelectLevel(cinfo); + SelectLevel(cinfo); if (m_isDeadByDefault) { @@ -512,14 +512,14 @@ void Creature::Update(uint32 diff) if (m_regenTimer != 0) break; - if (!isInCombat()) - { - if(HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER)) - SetUInt32Value(UNIT_DYNAMIC_FLAGS, GetCreatureInfo()->dynamicflags); - RegenerateHealth(); - } - else if(IsPolymorphed()) - RegenerateHealth(); + if (!isInCombat()) + { + if(HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER)) + SetUInt32Value(UNIT_DYNAMIC_FLAGS, GetCreatureInfo()->dynamicflags); + RegenerateHealth(); + } + else if(IsPolymorphed()) + RegenerateHealth(); RegenerateMana(); @@ -974,7 +974,7 @@ void Creature::OnGossipSelect(Player* player, uint32 option) player->PlayerTalkClass->CloseGossip(); player->PlayerTalkClass->SendTalking(textid); break; - } + } case GOSSIP_OPTION_OUTDOORPVP: sOutdoorPvPMgr.HandleGossipOption(player, GetGUID(), option); break; @@ -1427,10 +1427,10 @@ bool Creature::LoadFromDB(uint32 guid, Map *map) sLog.outError("ERROR: Creature (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",GetGUIDLow(),GetEntry(),GetPositionX(),GetPositionY()); return false; } - //We should set first home position, because then AI calls home movement - SetHomePosition(data->posX,data->posY,data->posZ,data->orientation); + //We should set first home position, because then AI calls home movement + SetHomePosition(data->posX,data->posY,data->posZ,data->orientation); - m_respawnradius = data->spawndist; + m_respawnradius = data->spawndist; m_respawnDelay = data->spawntimesecs; m_isDeadByDefault = data->is_dead; @@ -1679,11 +1679,11 @@ void Creature::setDeathState(DeathState s) SetLootRecipient(NULL); Unit::setDeathState(ALIVE); CreatureInfo const *cinfo = GetCreatureInfo(); - RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); + RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); clearUnitState(UNIT_STAT_ALL_STATE); - i_motionMaster.Initialize(); + i_motionMaster.Initialize(); SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); LoadCreaturesAddon(true); } @@ -1695,9 +1695,9 @@ bool Creature::FallGround() if (getDeathState() == DEAD_FALLING) return false; - float x, y, z; - GetPosition(x, y, z); - float ground_Z = GetMap()->GetVmapHeight(x, y, z, true); + float x, y, z; + GetPosition(x, y, z); + float ground_Z = GetMap()->GetVmapHeight(x, y, z, true); if (fabs(ground_Z - z) < 0.1f) return false; @@ -2055,8 +2055,8 @@ bool Creature::LoadCreaturesAddon(bool reload) SetUnitMovementFlags(cainfo->move_flags); //Load Path - if (cainfo->path_id != 0) - m_path_id = cainfo->path_id; + if (cainfo->path_id != 0) + m_path_id = cainfo->path_id; if(cainfo->auras) { diff --git a/src/game/Creature.h b/src/game/Creature.h index aafb4f3249a..97796f3e639 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -283,7 +283,7 @@ struct CreatureDataAddon { uint32 guidOrEntry; uint32 path_id; - uint32 mount; + uint32 mount; uint32 bytes0; uint32 bytes1; uint32 bytes2; @@ -622,18 +622,18 @@ class TRINITY_DLL_SPEC Creature : public Unit uint32 GetGlobalCooldown() const { return m_GlobalCooldown; } - uint32 GetWaypointPath(){return m_path_id;} - void LoadPath(uint32 pathid) { m_path_id = pathid; } + uint32 GetWaypointPath(){return m_path_id;} + void LoadPath(uint32 pathid) { m_path_id = pathid; } - uint32 GetCurrentWaypointID(){return m_waypointID;} - void UpdateWaypointID(uint32 wpID){m_waypointID = wpID;} + uint32 GetCurrentWaypointID(){return m_waypointID;} + void UpdateWaypointID(uint32 wpID){m_waypointID = wpID;} - void SearchFormation(); - bool IsFormationLeader() {return (GetDBTableGUIDLow() && GetDBTableGUIDLow() == m_formationID);} - uint32 GetFormationID(){return m_formationID;} + void SearchFormation(); + bool IsFormationLeader() {return (GetDBTableGUIDLow() && GetDBTableGUIDLow() == m_formationID);} + uint32 GetFormationID(){return m_formationID;} Unit *SelectVictim(); - protected: + protected: bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL); bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL); @@ -681,17 +681,17 @@ class TRINITY_DLL_SPEC Creature : public Unit float mHome_X; float mHome_Y; float mHome_Z; - float mHome_O; + float mHome_O; private: - //WaypointMovementGenerator vars - uint32 m_waypointID; - uint32 m_path_id; + //WaypointMovementGenerator vars + uint32 m_waypointID; + uint32 m_path_id; - //Formation var - uint32 m_formationID; + //Formation var + uint32 m_formationID; - GridReference m_gridRef; + GridReference m_gridRef; CreatureInfo const* m_creatureInfo; // in heroic mode can different from ObjMgr::GetCreatureTemplate(GetEntry()) }; diff --git a/src/game/CreatureGroups.cpp b/src/game/CreatureGroups.cpp index 49d77881e74..3669c638c45 100644 --- a/src/game/CreatureGroups.cpp +++ b/src/game/CreatureGroups.cpp @@ -33,182 +33,182 @@ UNORDERED_MAP CreatureGroupMap; void CreatureGroupManager::UpdateCreatureGroup(uint32 group_id, Creature *member) { - if(CreatureGroupHolder.find(group_id) != CreatureGroupHolder.end()) - { - sLog.outDebug("Group found: %u, inserting creature GUID: %u", group_id, member->GetGUIDLow()); - CreatureGroupHolder[group_id]->AddMember(member); - } - else - { - sLog.outDebug("Group not found: %u. Creating new group.", group_id); - CreatureGroup* formation = new CreatureGroup; - CreatureGroupHolder[group_id] = formation; - formation->AddMember(member); - } + if(CreatureGroupHolder.find(group_id) != CreatureGroupHolder.end()) + { + sLog.outDebug("Group found: %u, inserting creature GUID: %u", group_id, member->GetGUIDLow()); + CreatureGroupHolder[group_id]->AddMember(member); + } + else + { + sLog.outDebug("Group not found: %u. Creating new group.", group_id); + CreatureGroup* formation = new CreatureGroup; + CreatureGroupHolder[group_id] = formation; + formation->AddMember(member); + } } void CreatureGroupManager::DestroyGroup(uint32 group_id, uint64 guid) { - if(CreatureGroupHolder.find(group_id) != CreatureGroupHolder.end()) - { - sLog.outDebug("Deleting member pointer to GUID: %u from group %u", group_id, guid); - CreatureGroupHolder[group_id]->RemoveMember(guid); - - if(CreatureGroupHolder[group_id]->isEmpty()) - { - sLog.outDebug("Deleting group %u", group_id); - delete CreatureGroupHolder[group_id]; - CreatureGroupHolder.erase(group_id); - } - } + if(CreatureGroupHolder.find(group_id) != CreatureGroupHolder.end()) + { + sLog.outDebug("Deleting member pointer to GUID: %u from group %u", group_id, guid); + CreatureGroupHolder[group_id]->RemoveMember(guid); + + if(CreatureGroupHolder[group_id]->isEmpty()) + { + sLog.outDebug("Deleting group %u", group_id); + delete CreatureGroupHolder[group_id]; + CreatureGroupHolder.erase(group_id); + } + } } void CreatureGroupManager::LoadCreatureFormations() { - //Clear existing map - CreatureGroupMap.clear(); + //Clear existing map + CreatureGroupMap.clear(); - //Check Integrity of the table - QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`leaderGUID`) FROM `creature_formations`"); + //Check Integrity of the table + QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`leaderGUID`) FROM `creature_formations`"); - if(!result) + if(!result) { sLog.outErrorDb(" an error occured while loading the table `creature_formations` ( maybe it doesn't exist ?)\n"); return; } - delete result; + delete result; - //Get group data - result = WorldDatabase.PQuery("SELECT `leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI` FROM `creature_formations` ORDER BY `leaderGUID`"); + //Get group data + result = WorldDatabase.PQuery("SELECT `leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI` FROM `creature_formations` ORDER BY `leaderGUID`"); - if(!result) + if(!result) { sLog.outErrorDb("The table `creature_formations` is empty or corrupted"); return; } uint32 total_records = result->GetRowCount(), lastLeaderGUID = 0; - barGoLink bar( total_records); + barGoLink bar( total_records); Field *fields; - FormationMember *group_member; - //Loading data... - do + FormationMember *group_member; + //Loading data... + do { fields = result->Fetch(); - bar.step(); + bar.step(); //Load group member data - group_member = new FormationMember; - group_member->leaderGUID = fields[0].GetUInt32(); - group_member->memberGUID = fields[1].GetUInt32(); - group_member->groupAI = fields[4].GetUInt8(); - //If creature is group leader we may skip loading of dist/angle - if(group_member->leaderGUID != group_member->memberGUID) - { - group_member->follow_dist = fields[2].GetUInt32(); - group_member->follow_angle = fields[3].GetUInt32(); - } - - CreatureGroupMap[group_member->memberGUID] = group_member; - - if(lastLeaderGUID != group_member->leaderGUID) - lastLeaderGUID = group_member->leaderGUID; - } - while(result->NextRow()) ; - - sLog.outString(); - sLog.outString( ">> Loaded %u creatures in formations", total_records ); + group_member = new FormationMember; + group_member->leaderGUID = fields[0].GetUInt32(); + group_member->memberGUID = fields[1].GetUInt32(); + group_member->groupAI = fields[4].GetUInt8(); + //If creature is group leader we may skip loading of dist/angle + if(group_member->leaderGUID != group_member->memberGUID) + { + group_member->follow_dist = fields[2].GetUInt32(); + group_member->follow_angle = fields[3].GetUInt32(); + } + + CreatureGroupMap[group_member->memberGUID] = group_member; + + if(lastLeaderGUID != group_member->leaderGUID) + lastLeaderGUID = group_member->leaderGUID; + } + while(result->NextRow()) ; + + sLog.outString(); + sLog.outString( ">> Loaded %u creatures in formations", total_records ); sLog.outString(); - //Free some heap - delete result; + //Free some heap + delete result; } void CreatureGroup::AddMember(Creature *member) { - sLog.outDebug("Adding unit GUID: %u.", member->GetGUIDLow()); - - uint64 guid = member->GetGUID(); - //We first search creature member if exist - if(CreatureGroupMembers.find(guid) != CreatureGroupMembers.end()) - return; - //Check is that shit is a leader - if(member->IsFormationLeader()) - { - sLog.outDebug("Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow()); - m_leader = member; - } - //Add to the club - CreatureGroupMembers[guid] = member; - sLog.outDebug("Unit GUID: %u added.", member->GetGUID()); + sLog.outDebug("Adding unit GUID: %u.", member->GetGUIDLow()); + + uint64 guid = member->GetGUID(); + //We first search creature member if exist + if(CreatureGroupMembers.find(guid) != CreatureGroupMembers.end()) + return; + //Check is that shit is a leader + if(member->IsFormationLeader()) + { + sLog.outDebug("Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow()); + m_leader = member; + } + //Add to the club + CreatureGroupMembers[guid] = member; + sLog.outDebug("Unit GUID: %u added.", member->GetGUID()); } void CreatureGroup::RemoveMember(uint64 guid) { - if(CreatureGroupMembers.find(guid) != CreatureGroupMembers.end()) - CreatureGroupMembers.erase(guid); + if(CreatureGroupMembers.find(guid) != CreatureGroupMembers.end()) + CreatureGroupMembers.erase(guid); } void CreatureGroup::MemberHasAttacked(Creature *member) { - uint8 groupAI = CreatureGroupMap[member->GetDBTableGUIDLow()]->groupAI;; - - for(UNORDERED_MAP::iterator itr = CreatureGroupMembers.begin(); itr != CreatureGroupMembers.end(); itr++) - { - sLog.outDebug("AI:%u:Group member found: %u, attacked by %s.", groupAI, itr->second->GetGUIDLow(), member->getVictim()->GetName()); - if(itr->second) - { - switch(groupAI) - { - case 0: - return; - case 1: - if(!member->IsFormationLeader()) - return; - } - //Attack if everything is OK - itr->second->AI()->AttackStart(member->getVictim()); - } - } + uint8 groupAI = CreatureGroupMap[member->GetDBTableGUIDLow()]->groupAI;; + + for(UNORDERED_MAP::iterator itr = CreatureGroupMembers.begin(); itr != CreatureGroupMembers.end(); itr++) + { + sLog.outDebug("AI:%u:Group member found: %u, attacked by %s.", groupAI, itr->second->GetGUIDLow(), member->getVictim()->GetName()); + if(itr->second) + { + switch(groupAI) + { + case 0: + return; + case 1: + if(!member->IsFormationLeader()) + return; + } + //Attack if everything is OK + itr->second->AI()->AttackStart(member->getVictim()); + } + } } void CreatureGroup::LeaderMovedInEvade() { - for(UNORDERED_MAP::iterator itr = CreatureGroupMembers.begin(); itr != CreatureGroupMembers.end(); itr++) - { - if(itr->second && itr->second->isAlive() && !itr->second->isInCombat() && !itr->second->getVictim()) - SetMemberDestination(itr->second); - } + for(UNORDERED_MAP::iterator itr = CreatureGroupMembers.begin(); itr != CreatureGroupMembers.end(); itr++) + { + if(itr->second && itr->second->isAlive() && !itr->second->isInCombat() && !itr->second->getVictim()) + SetMemberDestination(itr->second); + } } void CreatureGroup::SetMemberDestination(Creature *member) { - if(!member || !m_leader || member->IsFormationLeader()) - return; + if(!member || !m_leader || member->IsFormationLeader()) + return; - float x,y,z; - uint32 lowguid = member->GetGUIDLow(); + float x,y,z; + uint32 lowguid = member->GetGUIDLow(); - UNORDERED_MAP::iterator itr2 = CreatureGroupMap.find(lowguid); + UNORDERED_MAP::iterator itr2 = CreatureGroupMap.find(lowguid); - if(m_leader->GetMotionMaster()->GetDestination(x,y,z) && itr2 != CreatureGroupMap.end()) - { - float dist, angle, pathangle; + if(m_leader->GetMotionMaster()->GetDestination(x,y,z) && itr2 != CreatureGroupMap.end()) + { + float dist, angle, pathangle; - angle = CreatureGroupMap[lowguid]->follow_angle; - dist = CreatureGroupMap[lowguid]->follow_dist; - pathangle = atan2(m_leader->GetPositionY()-y, m_leader->GetPositionX()-x); + angle = CreatureGroupMap[lowguid]->follow_angle; + dist = CreatureGroupMap[lowguid]->follow_dist; + pathangle = atan2(m_leader->GetPositionY()-y, m_leader->GetPositionX()-x); - x = x+cos(angle+pathangle)*dist; - y = y+sin(angle+pathangle)*dist; + x = x+cos(angle+pathangle)*dist; + y = y+sin(angle+pathangle)*dist; - member->GetMotionMaster()->Clear(); + member->GetMotionMaster()->Clear(); - if(member->GetDistance(m_leader) < dist+MAX_DESYNC) - member->SetUnitMovementFlags(m_leader->GetUnitMovementFlags()); - else - member->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + if(member->GetDistance(m_leader) < dist+MAX_DESYNC) + member->SetUnitMovementFlags(m_leader->GetUnitMovementFlags()); + else + member->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - member->GetMotionMaster()->MovePoint(0, x, y, z); - } + member->GetMotionMaster()->MovePoint(0, x, y, z); + } } diff --git a/src/game/CreatureGroups.h b/src/game/CreatureGroups.h index c2155049745..c8dd45c1b3f 100644 --- a/src/game/CreatureGroups.h +++ b/src/game/CreatureGroups.h @@ -27,35 +27,35 @@ struct FormationMember { - float follow_dist; - float follow_angle; - uint32 memberGUID; - uint32 leaderGUID; - uint8 groupAI; + float follow_dist; + float follow_angle; + uint32 memberGUID; + uint32 leaderGUID; + uint8 groupAI; }; class CreatureGroupManager { - public: - void UpdateCreatureGroup(uint32 group_id, Creature *member); - void DestroyGroup(uint32 group_id, uint64 guid); - void LoadCreatureFormations(); + public: + void UpdateCreatureGroup(uint32 group_id, Creature *member); + void DestroyGroup(uint32 group_id, uint64 guid); + void LoadCreatureFormations(); }; class CreatureGroup { - UNORDERED_MAPCreatureGroupMembers; - Creature *m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D + UNORDERED_MAPCreatureGroupMembers; + Creature *m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D - public: - CreatureGroup() : m_leader(NULL) {} - ~CreatureGroup(){sLog.outDebug("Destroying group");} - void AddMember(Creature *); - void RemoveMember(uint64 guid); - void LeaderMovedInEvade(); - void MemberHasAttacked(Creature *); - void SetMemberDestination(Creature *); - bool isEmpty() {return CreatureGroupMembers.empty();} + public: + CreatureGroup() : m_leader(NULL) {} + ~CreatureGroup(){sLog.outDebug("Destroying group");} + void AddMember(Creature *); + void RemoveMember(uint64 guid); + void LeaderMovedInEvade(); + void MemberHasAttacked(Creature *); + void SetMemberDestination(Creature *); + bool isEmpty() {return CreatureGroupMembers.empty();} }; typedef UNORDERED_MAP CreatureGroupHolderType; diff --git a/src/game/FleeingMovementGenerator.cpp b/src/game/FleeingMovementGenerator.cpp index 478e472662c..ff3d2f21b78 100644 --- a/src/game/FleeingMovementGenerator.cpp +++ b/src/game/FleeingMovementGenerator.cpp @@ -62,7 +62,7 @@ bool FleeingMovementGenerator::GetDestination(float &x, float &y, floa template<> bool FleeingMovementGenerator::GetDestination(float &x, float &y, float &z) const { - return false; + return false; } template diff --git a/src/game/FleeingMovementGenerator.h b/src/game/FleeingMovementGenerator.h index 6024f64ded6..23b5a0ad589 100644 --- a/src/game/FleeingMovementGenerator.h +++ b/src/game/FleeingMovementGenerator.h @@ -37,7 +37,7 @@ class TRINITY_DLL_SPEC FleeingMovementGenerator void Finalize(T &); void Reset(T &); bool Update(T &, const uint32 &); - bool GetDestination(float &x, float &y, float &z) const; + bool GetDestination(float &x, float &y, float &z) const; MovementGeneratorType GetMovementGeneratorType() { return FLEEING_MOTION_TYPE; } diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index bea125cf5ee..4bbb31c65c0 100644 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -596,13 +596,13 @@ namespace Trinity float i_range; }; - class CreatureWithDbGUIDCheck + class CreatureWithDbGUIDCheck { public: CreatureWithDbGUIDCheck(WorldObject const* obj, uint32 lowguid) : i_obj(obj), i_lowguid(lowguid) {} bool operator()(Creature* u) { - return u->GetDBTableGUIDLow() == i_lowguid; + return u->GetDBTableGUIDLow() == i_lowguid; } private: WorldObject const* i_obj; diff --git a/src/game/Group.cpp b/src/game/Group.cpp index 52b8e6244d9..829538f8af7 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -44,7 +44,7 @@ Group::Group() m_lootMethod = (LootMethod)0; m_looterGuid = 0; m_lootThreshold = ITEM_QUALITY_UNCOMMON; - m_subGroupsCounts = NULL; + m_subGroupsCounts = NULL; for(int i=0; isecond.save->RemoveGroup(this); - if (m_subGroupsCounts) - delete[] m_subGroupsCounts; + if (m_subGroupsCounts) + delete[] m_subGroupsCounts; } bool Group::Create(const uint64 &guid, const char * name) @@ -85,8 +85,8 @@ bool Group::Create(const uint64 &guid, const char * name) m_groupType = isBGGroup() ? GROUPTYPE_RAID : GROUPTYPE_NORMAL; - if (m_groupType == GROUPTYPE_RAID) - _initRaidSubGroupsCounter(); + if (m_groupType == GROUPTYPE_RAID) + _initRaidSubGroupsCounter(); m_lootMethod = GROUP_LOOT; m_lootThreshold = ITEM_QUALITY_UNCOMMON; @@ -144,8 +144,8 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool m_groupType = (*result)[13].GetBool() ? GROUPTYPE_RAID : GROUPTYPE_NORMAL; - if (m_groupType == GROUPTYPE_RAID) - _initRaidSubGroupsCounter(); + if (m_groupType == GROUPTYPE_RAID) + _initRaidSubGroupsCounter(); m_difficulty = (*result)[14].GetUInt8(); m_mainTank = (*result)[0].GetUInt64(); @@ -190,19 +190,19 @@ bool Group::LoadMemberFromDB(uint32 guidLow, uint8 subgroup, bool assistant) member.assistant = assistant; m_memberSlots.push_back(member); - SubGroupCounterIncrease(subgroup); + SubGroupCounterIncrease(subgroup); return true; } void Group::ConvertToRaid() { - m_groupType = GROUPTYPE_RAID; + m_groupType = GROUPTYPE_RAID; - _initRaidSubGroupsCounter(); + _initRaidSubGroupsCounter(); - if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE groups SET isRaid = 1 WHERE leaderGuid='%u'", GUID_LOPART(m_leaderGuid)); - SendUpdate(); + if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE groups SET isRaid = 1 WHERE leaderGuid='%u'", GUID_LOPART(m_leaderGuid)); + SendUpdate(); } bool Group::AddInvite(Player *player) @@ -974,17 +974,17 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant) if (m_subGroupsCounts) { bool groupFound = false; - for (; groupid < MAXRAIDSIZE/MAXGROUPSIZE; ++groupid) - { - if (m_subGroupsCounts[groupid] < MAXGROUPSIZE) - { - groupFound = true; - break; - } - } - // We are raid group and no one slot is free - if (!groupFound) - return false; + for (; groupid < MAXRAIDSIZE/MAXGROUPSIZE; ++groupid) + { + if (m_subGroupsCounts[groupid] < MAXGROUPSIZE) + { + groupFound = true; + break; + } + } + // We are raid group and no one slot is free + if (!groupFound) + return false; } return _addMember(guid, name, isAssistant, groupid); @@ -1007,7 +1007,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u member.assistant = isAssistant; m_memberSlots.push_back(member); - SubGroupCounterIncrease(group); + SubGroupCounterIncrease(group); if(player) { @@ -1046,10 +1046,10 @@ bool Group::_removeMember(const uint64 &guid) member_witerator slot = _getMemberWSlot(guid); if (slot != m_memberSlots.end()) - { - SubGroupCounterDecrease(slot->group); + { + SubGroupCounterDecrease(slot->group); m_memberSlots.erase(slot); - } + } if(!isBGGroup()) CharacterDatabase.PExecute("DELETE FROM group_member WHERE memberGuid='%u'", GUID_LOPART(guid)); @@ -1150,7 +1150,7 @@ bool Group::_setMembersGroup(const uint64 &guid, const uint8 &group) slot->group = group; - SubGroupCounterIncrease(group); + SubGroupCounterIncrease(group); if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE group_member SET subgroup='%u' WHERE memberGuid='%u'", group, GUID_LOPART(guid)); @@ -1209,16 +1209,16 @@ void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group) Player *player = objmgr.GetPlayer(guid); if (!player) { - uint8 prevSubGroup; - prevSubGroup = GetMemberGroup(guid); + uint8 prevSubGroup; + prevSubGroup = GetMemberGroup(guid); - SubGroupCounterDecrease(prevSubGroup); + SubGroupCounterDecrease(prevSubGroup); if(_setMembersGroup(guid, group)) SendUpdate(); } else - ChangeMembersGroup(player, group); + ChangeMembersGroup(player, group); } // only for online members @@ -1228,10 +1228,10 @@ void Group::ChangeMembersGroup(Player *player, const uint8 &group) return; if(_setMembersGroup(player->GetGUID(), group)) { - uint8 prevSubGroup; - prevSubGroup = player->GetSubGroup(); + uint8 prevSubGroup; + prevSubGroup = player->GetSubGroup(); - SubGroupCounterDecrease(prevSubGroup); + SubGroupCounterDecrease(prevSubGroup); player->GetGroupRef().setSubGroup(group); SendUpdate(); diff --git a/src/game/Group.h b/src/game/Group.h index dabb1715968..9882966e3f6 100644 --- a/src/game/Group.h +++ b/src/game/Group.h @@ -225,10 +225,10 @@ class TRINITY_DLL_SPEC Group return (mslot1->group==slot2->group); } - bool HasFreeSlotSubGroup(uint8 subgroup) const - { - return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAXGROUPSIZE); - } + bool HasFreeSlotSubGroup(uint8 subgroup) const + { + return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAXGROUPSIZE); + } bool SameSubGroup(Player const* member1, Player const* member2) const; @@ -304,8 +304,8 @@ class TRINITY_DLL_SPEC Group void SendLootRollWon(const uint64& SourceGuid, const uint64& TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r); void SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r); void GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature); - void NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *creature); - void MasterLoot(const uint64& playerGUID, Loot *loot, Creature *creature); + void NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *creature); + void MasterLoot(const uint64& playerGUID, Loot *loot, Creature *creature); Rolls::iterator GetRoll(uint64 Guid) { Rolls::iterator iter; @@ -348,17 +348,17 @@ class TRINITY_DLL_SPEC Group void _homebindIfInstance(Player *player); - void _initRaidSubGroupsCounter() - { - // Sub group counters initialization - if (!m_subGroupsCounts) - m_subGroupsCounts = new uint8[MAXRAIDSIZE / MAXGROUPSIZE]; + void _initRaidSubGroupsCounter() + { + // Sub group counters initialization + if (!m_subGroupsCounts) + m_subGroupsCounts = new uint8[MAXRAIDSIZE / MAXGROUPSIZE]; - memset((void*)m_subGroupsCounts, 0, (MAXRAIDSIZE / MAXGROUPSIZE)*sizeof(uint8)); + memset((void*)m_subGroupsCounts, 0, (MAXRAIDSIZE / MAXGROUPSIZE)*sizeof(uint8)); - for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr) - ++m_subGroupsCounts[itr->group]; - } + for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr) + ++m_subGroupsCounts[itr->group]; + } member_citerator _getMemberCSlot(uint64 Guid) const { @@ -380,17 +380,17 @@ class TRINITY_DLL_SPEC Group return m_memberSlots.end(); } - void SubGroupCounterIncrease(uint8 subgroup) - { - if (m_subGroupsCounts) - ++m_subGroupsCounts[subgroup]; - } + void SubGroupCounterIncrease(uint8 subgroup) + { + if (m_subGroupsCounts) + ++m_subGroupsCounts[subgroup]; + } - void SubGroupCounterDecrease(uint8 subgroup) - { - if (m_subGroupsCounts) - --m_subGroupsCounts[subgroup]; - } + void SubGroupCounterDecrease(uint8 subgroup) + { + if (m_subGroupsCounts) + --m_subGroupsCounts[subgroup]; + } MemberSlotList m_memberSlots; GroupRefManager m_memberMgr; @@ -408,6 +408,6 @@ class TRINITY_DLL_SPEC Group uint64 m_looterGuid; Rolls RollId; BoundInstancesMap m_boundInstances[TOTAL_DIFFICULTIES]; - uint8* m_subGroupsCounts; + uint8* m_subGroupsCounts; }; #endif diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp index 897110afe55..d16274dbf5b 100644 --- a/src/game/Guild.cpp +++ b/src/game/Guild.cpp @@ -361,7 +361,7 @@ bool Guild::FillPlayerData(uint64 guid, MemberSlot* memslot) } else { - PCachePlayerInfo pInfo = objmgr.GetPlayerInfoFromCache(GUID_LOPART(guid)); + PCachePlayerInfo pInfo = objmgr.GetPlayerInfoFromCache(GUID_LOPART(guid)); if(pInfo) { plName = pInfo->sPlayerName; @@ -412,7 +412,7 @@ bool Guild::FillPlayerData(uint64 guid, MemberSlot* memslot) return false; } } - } + } memslot->name = plName; memslot->level = plLevel; diff --git a/src/game/HomeMovementGenerator.cpp b/src/game/HomeMovementGenerator.cpp index 76d5b9626d6..0f5b9b2543b 100644 --- a/src/game/HomeMovementGenerator.cpp +++ b/src/game/HomeMovementGenerator.cpp @@ -70,10 +70,10 @@ HomeMovementGenerator::Update(Creature &owner, const uint32& time_diff // restore orientation of not moving creature at returning to home if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE) { - owner.SetOrientation(ori); - WorldPacket packet; - owner.BuildHeartBeatMsg(&packet); - owner.SendMessageToSet(&packet, false); + owner.SetOrientation(ori); + WorldPacket packet; + owner.BuildHeartBeatMsg(&packet); + owner.SendMessageToSet(&packet, false); } return false; } diff --git a/src/game/HomeMovementGenerator.h b/src/game/HomeMovementGenerator.h index ce47d0351ee..a116027608f 100644 --- a/src/game/HomeMovementGenerator.h +++ b/src/game/HomeMovementGenerator.h @@ -51,7 +51,7 @@ class TRINITY_DLL_SPEC HomeMovementGenerator void _setTargetLocation(Creature &); DestinationHolder< Traveller > i_destinationHolder; - float ori; + float ori; uint32 i_travel_timer; }; #endif diff --git a/src/game/Language.h b/src/game/Language.h index a76393e95b5..590c21e715b 100644 --- a/src/game/Language.h +++ b/src/game/Language.h @@ -269,9 +269,9 @@ enum TrinityStrings LANG_COMMAND_WHISPERON = 285, LANG_COMMAND_WHISPEROFF = 286, LANG_COMMAND_CREATGUIDNOTFOUND = 287, - // TICKET STRINGS NEED REWRITE // 288-296 FREE + // TICKET STRINGS NEED REWRITE // 288-296 FREE - // END + // END LANG_COMMAND_SPAWNDIST = 297, LANG_COMMAND_SPAWNTIME = 298, LANG_COMMAND_MODIFY_HONOR = 299, @@ -758,24 +758,24 @@ enum TrinityStrings LANG_YOU_CHANGE_GENDER = 1120, LANG_YOUR_GENDER_CHANGED = 1121, - // Ticket Strings 2000-2029 - LANG_COMMAND_TICKETNEW = 2000, + // Ticket Strings 2000-2029 + LANG_COMMAND_TICKETNEW = 2000, LANG_COMMAND_TICKETUPDATED = 2001, - LANG_COMMAND_TICKETPLAYERABANDON = 2002, - LANG_COMMAND_TICKETCLOSED = 2003, - LANG_COMMAND_TICKETDELETED = 2004, - LANG_COMMAND_TICKETNOTEXIST = 2005, - LANG_COMMAND_TICKETCLOSEFIRST = 2006, - LANG_COMMAND_TICKETALREADYASSIGNED = 2007, - LANG_COMMAND_TICKETRELOAD = 2008, - LANG_COMMAND_TICKETSHOWLIST = 2009, - LANG_COMMAND_TICKETSHOWONLINELIST = 2010, - LANG_COMMAND_TICKETSHOWCLOSEDLIST = 2011, - LANG_COMMAND_TICKETASSIGNERROR_A = 2012, - LANG_COMMAND_TICKETASSIGNERROR_B = 2013, - LANG_COMMAND_TICKETNOTASSIGNED = 2014, - LANG_COMMAND_TICKETUNASSIGNSECURITY = 2015, - LANG_COMMAND_TICKETCANNOTCLOSE = 2016, + LANG_COMMAND_TICKETPLAYERABANDON = 2002, + LANG_COMMAND_TICKETCLOSED = 2003, + LANG_COMMAND_TICKETDELETED = 2004, + LANG_COMMAND_TICKETNOTEXIST = 2005, + LANG_COMMAND_TICKETCLOSEFIRST = 2006, + LANG_COMMAND_TICKETALREADYASSIGNED = 2007, + LANG_COMMAND_TICKETRELOAD = 2008, + LANG_COMMAND_TICKETSHOWLIST = 2009, + LANG_COMMAND_TICKETSHOWONLINELIST = 2010, + LANG_COMMAND_TICKETSHOWCLOSEDLIST = 2011, + LANG_COMMAND_TICKETASSIGNERROR_A = 2012, + LANG_COMMAND_TICKETASSIGNERROR_B = 2013, + LANG_COMMAND_TICKETNOTASSIGNED = 2014, + LANG_COMMAND_TICKETUNASSIGNSECURITY = 2015, + LANG_COMMAND_TICKETCANNOTCLOSE = 2016, LANG_COMMAND_TICKETLISTGUID = 2017, LANG_COMMAND_TICKETLISTNAME = 2018, LANG_COMMAND_TICKETLISTAGE = 2019, @@ -867,8 +867,8 @@ enum TrinityStrings LANG_OPVP_EP_FLIGHT_CGT = 10053, LANG_OPVP_ZM_GOSSIP_ALLIANCE = 10054, LANG_OPVP_ZM_GOSSIP_HORDE = 10055, - LANG_NO_ENTER_HALL_OF_LEGENDS = 10056, - LANG_NO_ENTER_CHAMPIONS_HALL = 10057, + LANG_NO_ENTER_HALL_OF_LEGENDS = 10056, + LANG_NO_ENTER_CHAMPIONS_HALL = 10057, // Use for custom patches 11000-11999 diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp index ff7d58f8da1..bd40ee431ac 100644 --- a/src/game/Level0.cpp +++ b/src/game/Level0.cpp @@ -36,17 +36,17 @@ bool ChatHandler::HandleHelpCommand(const char* args) { - char* cmd = strtok((char*)args, " "); + char* cmd = strtok((char*)args, " "); if(!cmd) - { - ShowHelpForCommand(getCommandTable(), "help"); - ShowHelpForCommand(getCommandTable(), ""); - } - else - { - if(!ShowHelpForCommand(getCommandTable(), cmd)) - SendSysMessage(LANG_NO_HELP_CMD); - } + { + ShowHelpForCommand(getCommandTable(), "help"); + ShowHelpForCommand(getCommandTable(), ""); + } + else + { + if(!ShowHelpForCommand(getCommandTable(), cmd)) + SendSysMessage(LANG_NO_HELP_CMD); + } return true; } @@ -163,8 +163,8 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/) for(; itr != m.end(); ++itr) { if (itr->second->GetSession()->GetSecurity() && - (itr->second->isGameMaster() || sWorld.getConfig(CONFIG_GM_IN_GM_LIST)) && - (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())) ) + (itr->second->isGameMaster() || sWorld.getConfig(CONFIG_GM_IN_GM_LIST)) && + (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())) ) { if(first) { @@ -201,14 +201,14 @@ bool ChatHandler::HandlePasswordCommand(const char* args) if (strcmp(new_pass, new_pass_c) != 0) { SendSysMessage (LANG_NEW_PASSWORDS_NOT_MATCH); - SetSentErrorMessage (true); - return false; - } - - if (!accmgr.CheckPassword (m_session->GetAccountId(), password_old)) - { - SendSysMessage (LANG_COMMAND_WRONGOLDPASSWORD); - SetSentErrorMessage (true); + SetSentErrorMessage (true); + return false; + } + + if (!accmgr.CheckPassword (m_session->GetAccountId(), password_old)) + { + SendSysMessage (LANG_COMMAND_WRONGOLDPASSWORD); + SetSentErrorMessage (true); return false; } @@ -219,11 +219,11 @@ bool ChatHandler::HandlePasswordCommand(const char* args) case AOR_OK: SendSysMessage(LANG_COMMAND_PASSWORD); break; - case AOR_PASS_TOO_LONG: - SendSysMessage(LANG_PASSWORD_TOO_LONG); - SetSentErrorMessage(true); - return false; - case AOR_NAME_NOT_EXIST: // not possible case, don't want get account name for output + case AOR_PASS_TOO_LONG: + SendSysMessage(LANG_PASSWORD_TOO_LONG); + SetSentErrorMessage(true); + return false; + case AOR_NAME_NOT_EXIST: // not possible case, don't want get account name for output default: SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD); SetSentErrorMessage(true); @@ -263,6 +263,6 @@ bool ChatHandler::HandleLockAccountCommand(const char* args) /// Display the 'Message of the day' for the realm bool ChatHandler::HandleServerMotdCommand(const char* /*args*/) { - PSendSysMessage(LANG_MOTD_CURRENT, sWorld.GetMotd()); - return true; + PSendSysMessage(LANG_MOTD_CURRENT, sWorld.GetMotd()); + return true; } diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index 0219876aa7f..5ee72a786d9 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -279,345 +279,345 @@ std::string ChatHandler::PGetParseString(int32 entry, ...) } bool ChatHandler::HandleGMTicketListCommand(const char* args) { - SendSysMessage(LANG_COMMAND_TICKETSHOWLIST); - for(GmTicketList::iterator itr = ticketmgr.GM_TicketList.begin(); itr != ticketmgr.GM_TicketList.end(); ++itr) - { - if((*itr)->closed != 0) - continue; + SendSysMessage(LANG_COMMAND_TICKETSHOWLIST); + for(GmTicketList::iterator itr = ticketmgr.GM_TicketList.begin(); itr != ticketmgr.GM_TicketList.end(); ++itr) + { + if((*itr)->closed != 0) + continue; std::string gmname; std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, (*itr)->guid); ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, (*itr)->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str()); - if(objmgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) - { + if(objmgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) + { ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); } SendSysMessage(ss.str().c_str()); - } - return true; + } + return true; } bool ChatHandler::HandleGMTicketListOnlineCommand(const char* args) { - SendSysMessage(LANG_COMMAND_TICKETSHOWONLINELIST); - for(GmTicketList::iterator itr = ticketmgr.GM_TicketList.begin(); itr != ticketmgr.GM_TicketList.end(); ++itr) - { - if((*itr)->closed != 0 || !objmgr.GetPlayer((*itr)->playerGuid)) - continue; + SendSysMessage(LANG_COMMAND_TICKETSHOWONLINELIST); + for(GmTicketList::iterator itr = ticketmgr.GM_TicketList.begin(); itr != ticketmgr.GM_TicketList.end(); ++itr) + { + if((*itr)->closed != 0 || !objmgr.GetPlayer((*itr)->playerGuid)) + continue; std::string gmname; std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, (*itr)->guid); ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, (*itr)->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str()); - if(objmgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) - { + if(objmgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) + { ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); } SendSysMessage(ss.str().c_str()); - } - return true; + } + return true; } bool ChatHandler::HandleGMTicketListClosedCommand(const char* args) { - SendSysMessage(LANG_COMMAND_TICKETSHOWCLOSEDLIST); - for(GmTicketList::iterator itr = ticketmgr.GM_TicketList.begin(); itr != ticketmgr.GM_TicketList.end(); ++itr) - { - if((*itr)->closed == 0) - continue; + SendSysMessage(LANG_COMMAND_TICKETSHOWCLOSEDLIST); + for(GmTicketList::iterator itr = ticketmgr.GM_TicketList.begin(); itr != ticketmgr.GM_TicketList.end(); ++itr) + { + if((*itr)->closed == 0) + continue; std::string gmname; std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, (*itr)->guid); ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, (*itr)->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - (*itr)->timestamp, true, false)).c_str()); - if(objmgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) - { + if(objmgr.GetPlayerNameByGUID((*itr)->assignedToGM, gmname)) + { ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); } SendSysMessage(ss.str().c_str()); - } - return true; + } + return true; } bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args) { - if(!*args) - return false; + if(!*args) + return false; - uint64 tguid = atoi(args); - GM_Ticket *ticket = ticketmgr.GetGMTicket(tguid); - if(!ticket) - { - SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); - return true; - } + uint64 tguid = atoi(args); + GM_Ticket *ticket = ticketmgr.GetGMTicket(tguid); + if(!ticket) + { + SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); + return true; + } std::string gmname; std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid); ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - ticket->timestamp, true, false)).c_str()); - if(objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname)) - { + if(objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname)) + { ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); } - ss << PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, ticket->message.c_str()); - if(ticket->comment != "") - { - ss << PGetParseString(LANG_COMMAND_TICKETLISTCOMMENT, ticket->comment.c_str()); - } + ss << PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, ticket->message.c_str()); + if(ticket->comment != "") + { + ss << PGetParseString(LANG_COMMAND_TICKETLISTCOMMENT, ticket->comment.c_str()); + } SendSysMessage(ss.str().c_str()); - return true; + return true; } bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args) { - if(!*args) - return false; + if(!*args) + return false; - GM_Ticket *ticket = ticketmgr.GetGMTicketByName(args); - if(!ticket) - { - SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); - return true; - } + GM_Ticket *ticket = ticketmgr.GetGMTicketByName(args); + if(!ticket) + { + SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); + return true; + } std::string gmname; std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid); ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTAGE, (secsToTimeString(time(NULL) - ticket->timestamp, true, false)).c_str()); - if(objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname)) - { + if(objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname)) + { ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); } - ss << PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, ticket->message.c_str()); - if(ticket->comment != "") - { - ss << PGetParseString(LANG_COMMAND_TICKETLISTCOMMENT, ticket->comment.c_str()); - } + ss << PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, ticket->message.c_str()); + if(ticket->comment != "") + { + ss << PGetParseString(LANG_COMMAND_TICKETLISTCOMMENT, ticket->comment.c_str()); + } SendSysMessage(ss.str().c_str()); - return true; + return true; } bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args) { - if(!*args) - return false; - - uint64 tguid = atoi(args); - GM_Ticket *ticket = ticketmgr.GetGMTicket(tguid); - if(!ticket || ticket->closed != 0) - { - SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); - return true; - } - if(ticket && ticket->assignedToGM != 0 && ticket->assignedToGM != m_session->GetPlayer()->GetGUID()) - { - PSendSysMessage(LANG_COMMAND_TICKETCANNOTCLOSE, ticket->guid); - return true; - } - std::stringstream ss; + if(!*args) + return false; + + uint64 tguid = atoi(args); + GM_Ticket *ticket = ticketmgr.GetGMTicket(tguid); + if(!ticket || ticket->closed != 0) + { + SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); + return true; + } + if(ticket && ticket->assignedToGM != 0 && ticket->assignedToGM != m_session->GetPlayer()->GetGUID()) + { + PSendSysMessage(LANG_COMMAND_TICKETCANNOTCLOSE, ticket->guid); + return true; + } + std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid); ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETCLOSED, m_session->GetPlayer()->GetName()); - SendGlobalGMSysMessage(ss.str().c_str()); - ticketmgr.RemoveGMTicket(ticket->guid, m_session->GetPlayer()->GetGUID()); - Player *plr = objmgr.GetPlayer(ticket->playerGuid); - - if(!plr || !plr->IsInWorld()) - return true; - - // send abandon ticket - WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4); - data << uint32(9); - plr->GetSession()->SendPacket( &data ); - return true; + SendGlobalGMSysMessage(ss.str().c_str()); + ticketmgr.RemoveGMTicket(ticket->guid, m_session->GetPlayer()->GetGUID()); + Player *plr = objmgr.GetPlayer(ticket->playerGuid); + + if(!plr || !plr->IsInWorld()) + return true; + + // send abandon ticket + WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4); + data << uint32(9); + plr->GetSession()->SendPacket( &data ); + return true; } bool ChatHandler::HandleGMTicketAssignToCommand(const char* args) { - if(!*args) - return false; - - char* tguid = strtok((char*)args, " "); - uint64 ticketGuid = atoi(tguid); - char* targetgm = strtok( NULL, " "); - - if(!targetgm) - return false; - - std::string targm = targetgm; - - if(!normalizePlayerName(targm)) - return true; - - Player *cplr = m_session->GetPlayer(); - std::string gmname; - GM_Ticket *ticket = ticketmgr.GetGMTicket(ticketGuid); - - if(!ticket || ticket->closed != 0) - { - SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); - return true; - } - uint64 tarGUID = objmgr.GetPlayerGUIDByName(targm.c_str()); - uint64 accid = objmgr.GetPlayerAccountIdByGUID(tarGUID); - QueryResult *result = LoginDatabase.PQuery("SELECT `gmlevel` FROM `account` WHERE `id` = '%u'", accid); - if(!tarGUID|| !result || result->Fetch()->GetUInt32() < SEC_MODERATOR) - { - SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A); - return true; - } - if(ticket->assignedToGM == tarGUID) - { - PSendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_B, ticket->guid); - return true; - } - objmgr.GetPlayerNameByGUID(tarGUID, gmname); - if(ticket->assignedToGM != 0 && ticket->assignedToGM != cplr->GetGUID()) - { - PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->guid, gmname.c_str()); - return true; - } - - ticket->assignedToGM = tarGUID; - ticketmgr.UpdateGMTicket(ticket); - std::stringstream ss; + if(!*args) + return false; + + char* tguid = strtok((char*)args, " "); + uint64 ticketGuid = atoi(tguid); + char* targetgm = strtok( NULL, " "); + + if(!targetgm) + return false; + + std::string targm = targetgm; + + if(!normalizePlayerName(targm)) + return true; + + Player *cplr = m_session->GetPlayer(); + std::string gmname; + GM_Ticket *ticket = ticketmgr.GetGMTicket(ticketGuid); + + if(!ticket || ticket->closed != 0) + { + SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); + return true; + } + uint64 tarGUID = objmgr.GetPlayerGUIDByName(targm.c_str()); + uint64 accid = objmgr.GetPlayerAccountIdByGUID(tarGUID); + QueryResult *result = LoginDatabase.PQuery("SELECT `gmlevel` FROM `account` WHERE `id` = '%u'", accid); + if(!tarGUID|| !result || result->Fetch()->GetUInt32() < SEC_MODERATOR) + { + SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A); + return true; + } + if(ticket->assignedToGM == tarGUID) + { + PSendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_B, ticket->guid); + return true; + } + objmgr.GetPlayerNameByGUID(tarGUID, gmname); + if(ticket->assignedToGM != 0 && ticket->assignedToGM != cplr->GetGUID()) + { + PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->guid, gmname.c_str()); + return true; + } + + ticket->assignedToGM = tarGUID; + ticketmgr.UpdateGMTicket(ticket); + std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid); ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); - SendGlobalGMSysMessage(ss.str().c_str()); - return true; + SendGlobalGMSysMessage(ss.str().c_str()); + return true; } bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args) { - if(!*args) - return false; - - uint64 ticketGuid = atoi(args); - Player *cplr = m_session->GetPlayer(); - GM_Ticket *ticket = ticketmgr.GetGMTicket(ticketGuid); - - if(!ticket|| ticket->closed != 0) - { - SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); - return true; - } - if(ticket->assignedToGM == 0) - { - PSendSysMessage(LANG_COMMAND_TICKETNOTASSIGNED, ticket->guid); - return true; - } - - std::string gmname; - objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname); - Player *plr = objmgr.GetPlayer(ticket->assignedToGM); - if(plr && plr->IsInWorld() && plr->GetSession()->GetSecurity() > cplr->GetSession()->GetSecurity()) - { - SendSysMessage(LANG_COMMAND_TICKETUNASSIGNSECURITY); - return true; - } - - std::stringstream ss; + if(!*args) + return false; + + uint64 ticketGuid = atoi(args); + Player *cplr = m_session->GetPlayer(); + GM_Ticket *ticket = ticketmgr.GetGMTicket(ticketGuid); + + if(!ticket|| ticket->closed != 0) + { + SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); + return true; + } + if(ticket->assignedToGM == 0) + { + PSendSysMessage(LANG_COMMAND_TICKETNOTASSIGNED, ticket->guid); + return true; + } + + std::string gmname; + objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname); + Player *plr = objmgr.GetPlayer(ticket->assignedToGM); + if(plr && plr->IsInWorld() && plr->GetSession()->GetSecurity() > cplr->GetSession()->GetSecurity()) + { + SendSysMessage(LANG_COMMAND_TICKETUNASSIGNSECURITY); + return true; + } + + std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid); ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETLISTUNASSIGNED, cplr->GetName()); - SendGlobalGMSysMessage(ss.str().c_str()); - ticket->assignedToGM = 0; - ticketmgr.UpdateGMTicket(ticket); - return true; + SendGlobalGMSysMessage(ss.str().c_str()); + ticket->assignedToGM = 0; + ticketmgr.UpdateGMTicket(ticket); + return true; } bool ChatHandler::HandleGMTicketCommentCommand(const char* args) { - if(!*args) - return false; - - char* tguid = strtok((char*)args, " "); - uint64 ticketGuid = atoi(tguid); - char* comment = strtok( NULL, "\n"); - - if(!comment) - return false; - - Player *cplr = m_session->GetPlayer(); - GM_Ticket *ticket = ticketmgr.GetGMTicket(ticketGuid); - - if(!ticket || ticket->closed != 0) - { - PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST); - return true; - } - if(ticket->assignedToGM != 0 && ticket->assignedToGM != cplr->GetGUID()) - { - PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->guid); - return true; - } - - std::string gmname; - objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname); - ticket->comment = comment; - ticketmgr.UpdateGMTicket(ticket); - std::stringstream ss; + if(!*args) + return false; + + char* tguid = strtok((char*)args, " "); + uint64 ticketGuid = atoi(tguid); + char* comment = strtok( NULL, "\n"); + + if(!comment) + return false; + + Player *cplr = m_session->GetPlayer(); + GM_Ticket *ticket = ticketmgr.GetGMTicket(ticketGuid); + + if(!ticket || ticket->closed != 0) + { + PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST); + return true; + } + if(ticket->assignedToGM != 0 && ticket->assignedToGM != cplr->GetGUID()) + { + PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->guid); + return true; + } + + std::string gmname; + objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname); + ticket->comment = comment; + ticketmgr.UpdateGMTicket(ticket); + std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid); ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str()); - if(objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname)) - { + if(objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname)) + { ss << PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, gmname.c_str()); } ss << PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, cplr->GetName(), ticket->comment.c_str()); - SendGlobalGMSysMessage(ss.str().c_str()); - return true; + SendGlobalGMSysMessage(ss.str().c_str()); + return true; } bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args) { - if(!*args) - return false; - uint64 ticketGuid = atoi(args); - GM_Ticket *ticket = ticketmgr.GetGMTicket(ticketGuid); - - if(!ticket) - { - SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); - return true; - } - if(ticket->closed == 0) - { - SendSysMessage(LANG_COMMAND_TICKETCLOSEFIRST); - return true; - } - - std::stringstream ss; + if(!*args) + return false; + uint64 ticketGuid = atoi(args); + GM_Ticket *ticket = ticketmgr.GetGMTicket(ticketGuid); + + if(!ticket) + { + SendSysMessage(LANG_COMMAND_TICKETNOTEXIST); + return true; + } + if(ticket->closed == 0) + { + SendSysMessage(LANG_COMMAND_TICKETCLOSEFIRST); + return true; + } + + std::stringstream ss; ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid); ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str()); ss << PGetParseString(LANG_COMMAND_TICKETDELETED, m_session->GetPlayer()->GetName()); - SendGlobalGMSysMessage(ss.str().c_str()); - Player *plr = objmgr.GetPlayer(ticket->playerGuid); - ticketmgr.DeleteGMTicketPermanently(ticket->guid); - if(plr && plr->IsInWorld()) - { - // Force abandon ticket - WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4); - data << uint32(9); - plr->GetSession()->SendPacket( &data ); - } - - ticket = NULL; - return true; + SendGlobalGMSysMessage(ss.str().c_str()); + Player *plr = objmgr.GetPlayer(ticket->playerGuid); + ticketmgr.DeleteGMTicketPermanently(ticket->guid); + if(plr && plr->IsInWorld()) + { + // Force abandon ticket + WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4); + data << uint32(9); + plr->GetSession()->SendPacket( &data ); + } + + ticket = NULL; + return true; } bool ChatHandler::HandleGMTicketReloadCommand(const char*) { - ticketmgr.LoadGMTickets(); - return true; + ticketmgr.LoadGMTickets(); + return true; } //Enable\Dissable Invisible mode @@ -635,7 +635,7 @@ bool ChatHandler::HandleVisibleCommand(const char* args) { m_session->GetPlayer()->SetGMVisible(true); m_session->SendNotification(LANG_INVISIBLE_VISIBLE); - return true; + return true; } if (argstr == "off") @@ -2116,9 +2116,9 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) // send area in "id - [name]" format std::ostringstream ss; if (m_session) - ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << " " << localeNames[loc]<< "]|h|r"; - else - ss << areaEntry->ID << " - " << name << " " << localeNames[loc]; + ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << " " << localeNames[loc]<< "]|h|r"; + else + ss << areaEntry->ID << " - " << name << " " << localeNames[loc]; SendSysMessage (ss.str ().c_str()); @@ -2156,7 +2156,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args) std::ostringstream reply; - GameTeleMap const & teleMap = objmgr.GetGameTeleMap(); + GameTeleMap const & teleMap = objmgr.GetGameTeleMap(); for(GameTeleMap::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr) { GameTele const* tele = &itr->second; @@ -2165,9 +2165,9 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args) continue; if (m_session) - reply << " |cffffffff|Htele:" << itr->first << "|h[" << tele->name << "]|h|r\n"; - else - reply << " " << itr->first << " " << tele->name << "\n"; + reply << " |cffffffff|Htele:" << itr->first << "|h[" << tele->name << "]|h|r\n"; + else + reply << " " << itr->first << " " << tele->name << "\n"; } if(reply.str().empty()) diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index d155b0d274f..2b996cfd0fb 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -562,7 +562,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char* args) return false; // Can be NULL at console call - Player *target = getSelectedPlayer (); + Player *target = getSelectedPlayer (); std::string namepart = args; std::wstring wnamepart; @@ -581,12 +581,12 @@ bool ChatHandler::HandleLookupFactionCommand(const char* args) if (factionEntry) { FactionState const* repState = NULL; - if(target) - { - FactionStateList::const_iterator repItr = target->m_factions.find (factionEntry->reputationListID); - if(repItr != target->m_factions.end()) - repState = &repItr->second; - } + if(target) + { + FactionStateList::const_iterator repItr = target->m_factions.find (factionEntry->reputationListID); + if(repItr != target->m_factions.end()) + repState = &repItr->second; + } int loc = m_session ? m_session->GetSessionDbcLocale() : sWorld.GetDefaultDbcLocale(); std::string name = factionEntry->name[loc]; @@ -616,9 +616,9 @@ bool ChatHandler::HandleLookupFactionCommand(const char* args) // or "id - [faction] [no reputation]" format std::ostringstream ss; if (m_session) - ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << " " << localeNames[loc] << "]|h|r"; - else - ss << id << " - " << name << " " << localeNames[loc]; + ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << " " << localeNames[loc] << "]|h|r"; + else + ss << id << " - " << name << " " << localeNames[loc]; if (repState) // and then target!=NULL also { @@ -1505,10 +1505,10 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(const char* args) if(pCreature) { // update movement type - if(doNotDelete == false) - pCreature->LoadPath(0); + if(doNotDelete == false) + pCreature->LoadPath(0); - pCreature->SetDefaultMovementType(move_type); + pCreature->SetDefaultMovementType(move_type); pCreature->GetMotionMaster()->Initialize(); if(pCreature->isAlive()) // dead creature will reset movement generator at respawn { @@ -1678,96 +1678,96 @@ bool ChatHandler::HandleNpcFactionIdCommand(const char* args) //kick player bool ChatHandler::HandleKickPlayerCommand(const char *args) { - const char* kickName = strtok((char*)args, " "); - char* kickReason = strtok(NULL, "\n"); - std::string reason = "No Reason"; - std::string kicker = "Console"; - if(kickReason) - reason = kickReason; - if(m_session) - kicker = m_session->GetPlayer()->GetName(); + const char* kickName = strtok((char*)args, " "); + char* kickReason = strtok(NULL, "\n"); + std::string reason = "No Reason"; + std::string kicker = "Console"; + if(kickReason) + reason = kickReason; + if(m_session) + kicker = m_session->GetPlayer()->GetName(); - if(!kickName) + if(!kickName) { - Player* player = getSelectedPlayer(); - if(!player) - { - SendSysMessage(LANG_NO_CHAR_SELECTED); - SetSentErrorMessage(true); - return false; - } + Player* player = getSelectedPlayer(); + if(!player) + { + SendSysMessage(LANG_NO_CHAR_SELECTED); + SetSentErrorMessage(true); + return false; + } - if(player==m_session->GetPlayer()) + if(player==m_session->GetPlayer()) { SendSysMessage(LANG_COMMAND_KICKSELF); SetSentErrorMessage(true); return false; } - if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1) - { + if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1) + { - sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str()); - } - else - { + sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str()); + } + else + { - PSendSysMessage(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str()); - } + PSendSysMessage(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str()); + } player->GetSession()->KickPlayer(); } - else - { - std::string name = kickName; - if(!normalizePlayerName(name)) - { - SendSysMessage(LANG_PLAYER_NOT_FOUND); - SetSentErrorMessage(true); - return false; - } - - if(m_session && name==m_session->GetPlayer()->GetName()) - { - SendSysMessage(LANG_COMMAND_KICKSELF); - SetSentErrorMessage(true); - return false; - } - - Player* player = objmgr.GetPlayer(kickName); - if(!player) - { - SendSysMessage(LANG_PLAYER_NOT_FOUND); - SetSentErrorMessage(true); - return false; - } - - if(m_session && player->GetSession()->GetSecurity() > m_session->GetSecurity()) - { - SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on - SetSentErrorMessage(true); - return false; - } - - if(sWorld.KickPlayer(name.c_str())) - { - if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1) - { - - sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, name.c_str(), kicker.c_str(), reason.c_str()); - } - else - { - PSendSysMessage(LANG_COMMAND_KICKMESSAGE, name.c_str(), kicker.c_str(), reason.c_str()); - } - } - else - { - PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER, name.c_str()); - return false; - } - } - return true; + else + { + std::string name = kickName; + if(!normalizePlayerName(name)) + { + SendSysMessage(LANG_PLAYER_NOT_FOUND); + SetSentErrorMessage(true); + return false; + } + + if(m_session && name==m_session->GetPlayer()->GetName()) + { + SendSysMessage(LANG_COMMAND_KICKSELF); + SetSentErrorMessage(true); + return false; + } + + Player* player = objmgr.GetPlayer(kickName); + if(!player) + { + SendSysMessage(LANG_PLAYER_NOT_FOUND); + SetSentErrorMessage(true); + return false; + } + + if(m_session && player->GetSession()->GetSecurity() > m_session->GetSecurity()) + { + SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on + SetSentErrorMessage(true); + return false; + } + + if(sWorld.KickPlayer(name.c_str())) + { + if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1) + { + + sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, name.c_str(), kicker.c_str(), reason.c_str()); + } + else + { + PSendSysMessage(LANG_COMMAND_KICKMESSAGE, name.c_str(), kicker.c_str(), reason.c_str()); + } + } + else + { + PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER, name.c_str()); + return false; + } + } + return true; } //show info of player @@ -1876,7 +1876,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args) username = fields[0].GetCppString(); security = fields[1].GetUInt32(); - if(!m_session || m_session->GetSecurity() >= security) + if(!m_session || m_session->GetSecurity() >= security) { last_ip = fields[2].GetCppString(); last_login = fields[3].GetCppString(); @@ -2021,170 +2021,170 @@ bool ChatHandler::HandleWpAddCommand(const char* args) // optional char* path_number = NULL; - uint32 pathid = 0; + uint32 pathid = 0; if(*args) - path_number = strtok((char*)args, " "); + path_number = strtok((char*)args, " "); uint32 point = 0; Creature* target = getSelectedCreature(); - if (!path_number) - { - if(target) - pathid = target->GetWaypointPath(); - else - { - QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(id) FROM waypoint_data"); - uint32 maxpathid = result->Fetch()->GetInt32(); - pathid = maxpathid+1; - sLog.outDebug("DEBUG: HandleWpAddCommand - New path started."); - PSendSysMessage("%s%s|r", "|cff00ff00", "New path started."); - } - } - else - pathid = atoi(path_number); - - // path_id -> ID of the Path + if (!path_number) + { + if(target) + pathid = target->GetWaypointPath(); + else + { + QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(id) FROM waypoint_data"); + uint32 maxpathid = result->Fetch()->GetInt32(); + pathid = maxpathid+1; + sLog.outDebug("DEBUG: HandleWpAddCommand - New path started."); + PSendSysMessage("%s%s|r", "|cff00ff00", "New path started."); + } + } + else + pathid = atoi(path_number); + + // path_id -> ID of the Path // point -> number of the waypoint (if not 0) - if(!pathid) - { - sLog.outDebug("DEBUG: HandleWpAddCommand - Current creature haven't loaded path."); - PSendSysMessage("%s%s|r", "|cffff33ff", "Current creature haven't loaded path."); - return true; - } + if(!pathid) + { + sLog.outDebug("DEBUG: HandleWpAddCommand - Current creature haven't loaded path."); + PSendSysMessage("%s%s|r", "|cffff33ff", "Current creature haven't loaded path."); + return true; + } - sLog.outDebug("DEBUG: HandleWpAddCommand - point == 0"); + sLog.outDebug("DEBUG: HandleWpAddCommand - point == 0"); QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid); - if( result ) + if( result ) { point = (*result)[0].GetUInt32(); delete result; } - Player* player = m_session->GetPlayer(); - Map *map = player->GetMap(); + Player* player = m_session->GetPlayer(); + Map *map = player->GetMap(); - WorldDatabase.PExecuteLog("INSERT INTO waypoint_data (id, point, position_x, position_y, position_z) VALUES ('%u','%u','%f', '%f', '%f')", + WorldDatabase.PExecuteLog("INSERT INTO waypoint_data (id, point, position_x, position_y, position_z) VALUES ('%u','%u','%f', '%f', '%f')", pathid, point+1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); - PSendSysMessage("%s%s%u%s%u%s|r", "|cff00ff00", "PathID: |r|cff00ffff", pathid, "|r|cff00ff00: Waypoint |r|cff00ffff", point,"|r|cff00ff00 created. "); + PSendSysMessage("%s%s%u%s%u%s|r", "|cff00ff00", "PathID: |r|cff00ffff", pathid, "|r|cff00ff00: Waypoint |r|cff00ffff", point,"|r|cff00ff00 created. "); return true; } // HandleWpAddCommand bool ChatHandler::HandleWpLoadPathCommand(const char *args) { - if(!*args) - return false; + if(!*args) + return false; - // optional + // optional char* path_number = NULL; - if(*args) - path_number = strtok((char*)args, " "); + if(*args) + path_number = strtok((char*)args, " "); - uint32 pathid = 0; + uint32 pathid = 0; uint32 guidlow = 0; Creature* target = getSelectedCreature(); - // Did player provide a path_id? + // Did player provide a path_id? if (!path_number) - sLog.outDebug("DEBUG: HandleWpLoadPathCommand - No path number provided"); + sLog.outDebug("DEBUG: HandleWpLoadPathCommand - No path number provided"); if(!target) - { - SendSysMessage(LANG_SELECT_CREATURE); + { + SendSysMessage(LANG_SELECT_CREATURE); SetSentErrorMessage(true); - return false; - } + return false; + } - if(target->GetEntry() == 1) - { - PSendSysMessage("%s%s|r", "|cffff33ff", "You want to load path to a waypoint? Aren't you?"); - SetSentErrorMessage(true); - return false; - } + if(target->GetEntry() == 1) + { + PSendSysMessage("%s%s|r", "|cffff33ff", "You want to load path to a waypoint? Aren't you?"); + SetSentErrorMessage(true); + return false; + } - pathid = atoi(path_number); + pathid = atoi(path_number); - if(!pathid) - { - PSendSysMessage("%s%s|r", "|cffff33ff", "No vallid path number provided."); - return true; - } + if(!pathid) + { + PSendSysMessage("%s%s|r", "|cffff33ff", "No vallid path number provided."); + return true; + } - guidlow = target->GetGUIDLow(); - QueryResult *result = WorldDatabase.PQuery( "SELECT guid FROM creature_addon WHERE guid = '%u'",guidlow); + guidlow = target->GetGUIDLow(); + QueryResult *result = WorldDatabase.PQuery( "SELECT guid FROM creature_addon WHERE guid = '%u'",guidlow); - if( result ) + if( result ) { WorldDatabase.PExecute("UPDATE creature_addon SET path_id = '%u' WHERE guid = '%u'", pathid, guidlow); - delete result; - } + delete result; + } else - WorldDatabase.PExecute("INSERT INTO creature_addon(guid,path_id) VALUES ('%u','%u')", guidlow, pathid); + WorldDatabase.PExecute("INSERT INTO creature_addon(guid,path_id) VALUES ('%u','%u')", guidlow, pathid); - WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE, guidlow); + WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE, guidlow); - target->LoadPath(pathid); - target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); + target->LoadPath(pathid); + target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); target->GetMotionMaster()->Initialize(); target->Say("Path loaded.",0,0); - return true; + return true; } bool ChatHandler::HandleReloadAllPaths(const char* args) { if(!*args) - return false; + return false; uint32 id = atoi(args); if(!id) - return false; + return false; - PSendSysMessage("%s%s|r|cff00ffff%u|r", "|cff00ff00", "Loading Path: ", id); - WaypointMgr.UpdatePath(id); - return true; + PSendSysMessage("%s%s|r|cff00ffff%u|r", "|cff00ff00", "Loading Path: ", id); + WaypointMgr.UpdatePath(id); + return true; } bool ChatHandler::HandleWpUnLoadPathCommand(const char *args) { - uint32 guidlow = 0; - Creature* target = getSelectedCreature(); - - if(!target) - { - PSendSysMessage("%s%s|r", "|cff33ffff", "You must select target."); - return true; - } - - if(target->GetCreatureAddon()) - { - if(target->GetCreatureAddon()->path_id != 0) - { - WorldDatabase.PExecute("DELETE FROM creature_addon WHERE guid = %u", target->GetGUIDLow()); - target->UpdateWaypointID(0); - WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", IDLE_MOTION_TYPE, guidlow); - target->LoadPath(0); - target->SetDefaultMovementType(IDLE_MOTION_TYPE); - target->GetMotionMaster()->MoveTargetedHome(); - target->GetMotionMaster()->Initialize(); - target->Say("Path unloaded.",0,0); - return true; - } - PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path."); - return true; - } - PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path."); - return true; + uint32 guidlow = 0; + Creature* target = getSelectedCreature(); + + if(!target) + { + PSendSysMessage("%s%s|r", "|cff33ffff", "You must select target."); + return true; + } + + if(target->GetCreatureAddon()) + { + if(target->GetCreatureAddon()->path_id != 0) + { + WorldDatabase.PExecute("DELETE FROM creature_addon WHERE guid = %u", target->GetGUIDLow()); + target->UpdateWaypointID(0); + WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", IDLE_MOTION_TYPE, guidlow); + target->LoadPath(0); + target->SetDefaultMovementType(IDLE_MOTION_TYPE); + target->GetMotionMaster()->MoveTargetedHome(); + target->GetMotionMaster()->Initialize(); + target->Say("Path unloaded.",0,0); + return true; + } + PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path."); + return true; + } + PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path."); + return true; } bool ChatHandler::HandleWpEventCommand(const char* args) @@ -2192,151 +2192,151 @@ bool ChatHandler::HandleWpEventCommand(const char* args) if(!*args) return false; - char* show_str = strtok((char*)args, " "); + char* show_str = strtok((char*)args, " "); - std::string show = show_str; + std::string show = show_str; - // Check + // Check if( (show != "add") && (show != "mod") && (show != "del") && (show != "listid")) return false; - if(show == "add") - { - uint32 id = 0; - char* arg_id = strtok(NULL, " "); + if(show == "add") + { + uint32 id = 0; + char* arg_id = strtok(NULL, " "); - if(arg_id) - uint32 id = atoi(arg_id); + if(arg_id) + uint32 id = atoi(arg_id); - if(id) - { - QueryResult *result = WorldDatabase.PQuery( "SELECT `id` FROM waypoint_scripts WHERE guid = %u", id); + if(id) + { + QueryResult *result = WorldDatabase.PQuery( "SELECT `id` FROM waypoint_scripts WHERE guid = %u", id); - if( !result ) - { + if( !result ) + { WorldDatabase.PExecute("INSERT INTO waypoint_scripts(guid)VALUES(%u)", id); - PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: New waypoint event added: ", id); - } - else - { - PSendSysMessage("|cff00ff00Wp Event: You have choosed an existing waypoint script guid: %u|r", id); - delete result; - } - } - else - { - QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(guid) FROM waypoint_scripts"); - id = result->Fetch()->GetUInt32(); - WorldDatabase.PExecute("INSERT INTO waypoint_scripts(guid)VALUES(%u)", id+1); - PSendSysMessage("%s%s%u|r", "|cff00ff00","Wp Event: New waypoint event added: |r|cff00ffff", id+1); - } - - return true; - } - - - if(show == "listid") - { - uint32 id; - char* arg_id = strtok(NULL, " "); - - if(!arg_id) - { - PSendSysMessage("%s%s|r", "|cff33ffff","Wp Event: You must provide waypoint script id."); - return true; - } - - id = atoi(arg_id); - - uint32 a2, a3, a4, a5, a6; - float a8, a9, a10, a11; - char const* a7; - - QueryResult *result = WorldDatabase.PQuery( "SELECT `guid`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o` FROM waypoint_scripts WHERE id = %u", id); - - if( !result ) - { - PSendSysMessage("%s%s%u|r", "|cff33ffff", "Wp Event: No waypoint scripts found on id: ", id); - return true; - } - - Field *fields; - - do - { - fields = result->Fetch(); - a2 = fields[0].GetUInt32(); - a3 = fields[1].GetUInt32(); - a4 = fields[2].GetUInt32(); - a5 = fields[3].GetUInt32(); - a6 = fields[4].GetUInt32(); - a7 = fields[5].GetString(); - a8 = fields[6].GetFloat(); - a9 = fields[7].GetFloat(); - a10 = fields[8].GetFloat(); - a11 = fields[9].GetFloat(); - - PSendSysMessage("|cffff33ffid:|r|cff00ffff %u|r|cff00ff00, guid: |r|cff00ffff%u|r|cff00ff00, delay: |r|cff00ffff%u|r|cff00ff00, command: |r|cff00ffff%u|r|cff00ff00, datalong: |r|cff00ffff%u|r|cff00ff00, datalong2: |r|cff00ffff%u|r|cff00ff00, datatext: |r|cff00ffff%s|r|cff00ff00, posx: |r|cff00ffff%f|r|cff00ff00, posy: |r|cff00ffff%f|r|cff00ff00, posz: |r|cff00ffff%f|r|cff00ff00, orientation: |r|cff00ffff%f|r", id, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); - }while(result->NextRow()); - - delete result; - } - - if(show == "del") - { - - char* arg_id = strtok(NULL, " "); - uint32 id = atoi(arg_id); - - QueryResult *result = WorldDatabase.PQuery( "SELECT `guid` FROM waypoint_scripts WHERE guid = %u", id); - - if( result ) + PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: New waypoint event added: ", id); + } + else + { + PSendSysMessage("|cff00ff00Wp Event: You have choosed an existing waypoint script guid: %u|r", id); + delete result; + } + } + else + { + QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(guid) FROM waypoint_scripts"); + id = result->Fetch()->GetUInt32(); + WorldDatabase.PExecute("INSERT INTO waypoint_scripts(guid)VALUES(%u)", id+1); + PSendSysMessage("%s%s%u|r", "|cff00ff00","Wp Event: New waypoint event added: |r|cff00ffff", id+1); + } + + return true; + } + + + if(show == "listid") + { + uint32 id; + char* arg_id = strtok(NULL, " "); + + if(!arg_id) + { + PSendSysMessage("%s%s|r", "|cff33ffff","Wp Event: You must provide waypoint script id."); + return true; + } + + id = atoi(arg_id); + + uint32 a2, a3, a4, a5, a6; + float a8, a9, a10, a11; + char const* a7; + + QueryResult *result = WorldDatabase.PQuery( "SELECT `guid`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o` FROM waypoint_scripts WHERE id = %u", id); + + if( !result ) + { + PSendSysMessage("%s%s%u|r", "|cff33ffff", "Wp Event: No waypoint scripts found on id: ", id); + return true; + } + + Field *fields; + + do + { + fields = result->Fetch(); + a2 = fields[0].GetUInt32(); + a3 = fields[1].GetUInt32(); + a4 = fields[2].GetUInt32(); + a5 = fields[3].GetUInt32(); + a6 = fields[4].GetUInt32(); + a7 = fields[5].GetString(); + a8 = fields[6].GetFloat(); + a9 = fields[7].GetFloat(); + a10 = fields[8].GetFloat(); + a11 = fields[9].GetFloat(); + + PSendSysMessage("|cffff33ffid:|r|cff00ffff %u|r|cff00ff00, guid: |r|cff00ffff%u|r|cff00ff00, delay: |r|cff00ffff%u|r|cff00ff00, command: |r|cff00ffff%u|r|cff00ff00, datalong: |r|cff00ffff%u|r|cff00ff00, datalong2: |r|cff00ffff%u|r|cff00ff00, datatext: |r|cff00ffff%s|r|cff00ff00, posx: |r|cff00ffff%f|r|cff00ff00, posy: |r|cff00ffff%f|r|cff00ff00, posz: |r|cff00ffff%f|r|cff00ff00, orientation: |r|cff00ffff%f|r", id, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + }while(result->NextRow()); + + delete result; + } + + if(show == "del") + { + + char* arg_id = strtok(NULL, " "); + uint32 id = atoi(arg_id); + + QueryResult *result = WorldDatabase.PQuery( "SELECT `guid` FROM waypoint_scripts WHERE guid = %u", id); + + if( result ) { WorldDatabase.PExecuteLog("DELETE FROM waypoint_scripts WHERE guid = %u", id); PSendSysMessage("%s%s%u|r","|cff00ff00","Wp Event: Waypoint script removed: ", id); - delete result; - } + delete result; + } else - PSendSysMessage("|cffff33ffWp Event: ERROR: you have selected a non existing script: %u|r", id); + PSendSysMessage("|cffff33ffWp Event: ERROR: you have selected a non existing script: %u|r", id); - return true; - } + return true; + } - if(show == "mod") - { - char* arg_1 = strtok(NULL," "); + if(show == "mod") + { + char* arg_1 = strtok(NULL," "); - if(!arg_1) - { - SendSysMessage("|cffff33ffERROR: Waypoint script guid not present.|r"); - return true; - } + if(!arg_1) + { + SendSysMessage("|cffff33ffERROR: Waypoint script guid not present.|r"); + return true; + } - uint32 id = atoi(arg_1); + uint32 id = atoi(arg_1); - if(!id) - { - SendSysMessage("|cffff33ffERROR: No vallid waypoint script id not present.|r"); - return true; - } + if(!id) + { + SendSysMessage("|cffff33ffERROR: No vallid waypoint script id not present.|r"); + return true; + } - char* arg_2 = strtok(NULL," "); + char* arg_2 = strtok(NULL," "); - if(!arg_2) - { SendSysMessage("|cffff33ffERROR: No argument present.|r"); - return true;} + if(!arg_2) + { SendSysMessage("|cffff33ffERROR: No argument present.|r"); + return true;} - std::string arg_string = arg_2; + std::string arg_string = arg_2; if( (arg_string != "setid") && (arg_string != "delay") && (arg_string != "command") && (arg_string != "datalong") && (arg_string != "datalong2") && (arg_string != "dataint") && (arg_string != "posx") && (arg_string != "posy") && (arg_string != "posz") && (arg_string != "orientation") -) { SendSysMessage("|cffff33ffERROR: No valid argument present.|r"); - return true;} +) { SendSysMessage("|cffff33ffERROR: No valid argument present.|r"); + return true;} char* arg_3; @@ -2345,73 +2345,73 @@ arg_3 = strtok(NULL," "); if(!arg_3) {SendSysMessage("|cffff33ffERROR: No additional argument present.|r"); - return true;} + return true;} float coord; - if(arg_str_2 == "setid") - { - uint32 newid = atoi(arg_3); - PSendSysMessage("%s%s|r|cff00ffff%u|r|cff00ff00%s|r|cff00ffff%u|r","|cff00ff00","Wp Event: Wypoint scipt guid: ", newid," id changed: ", id); - WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET id='%u' WHERE guid='%u'", + if(arg_str_2 == "setid") + { + uint32 newid = atoi(arg_3); + PSendSysMessage("%s%s|r|cff00ffff%u|r|cff00ff00%s|r|cff00ffff%u|r","|cff00ff00","Wp Event: Wypoint scipt guid: ", newid," id changed: ", id); + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET id='%u' WHERE guid='%u'", newid, id); return true; - } - else - { + } + else + { - QueryResult *result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid='%u'",id); + QueryResult *result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid='%u'",id); - if(!result) - { - SendSysMessage("|cffff33ffERROR: You have selected an non existing waypoint script guid.|r"); - return true; - } + if(!result) + { + SendSysMessage("|cffff33ffERROR: You have selected an non existing waypoint script guid.|r"); + return true; + } - delete result; + delete result; if(arg_str_2 == "posx") { - coord = atof(arg_3); - WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET x='%f' WHERE guid='%u'", + coord = atof(arg_3); + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET x='%f' WHERE guid='%u'", coord, id); - PSendSysMessage("|cff00ff00Waypoint script:|r|cff00ffff %u|r|cff00ff00 position_x updated.|r", id); - return true; + PSendSysMessage("|cff00ff00Waypoint script:|r|cff00ffff %u|r|cff00ff00 position_x updated.|r", id); + return true; }else if(arg_str_2 == "posy") { - coord = atof(arg_3); - WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET y='%f' WHERE guid='%u'", + coord = atof(arg_3); + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET y='%f' WHERE guid='%u'", coord, id); - PSendSysMessage("|cff00ff00Waypoint script: %u position_y updated.|r", id); - return true; + PSendSysMessage("|cff00ff00Waypoint script: %u position_y updated.|r", id); + return true; } else if(arg_str_2 == "posz") { - coord = atof(arg_3); - WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET z='%f' WHERE guid='%u'", - coord, id); - PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 position_z updated.|r", id); - return true; + coord = atof(arg_3); + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET z='%f' WHERE guid='%u'", + coord, id); + PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 position_z updated.|r", id); + return true; } else if(arg_str_2 == "orientation") { - coord = atof(arg_3); - WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET o='%f' WHERE guid='%u'", + coord = atof(arg_3); + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET o='%f' WHERE guid='%u'", coord, id); - PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 orientation updated.|r", id); - return true; + PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 orientation updated.|r", id); + return true; } else if(arg_str_2 == "dataint") { - WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET %s='%u' WHERE guid='%u'", + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET %s='%u' WHERE guid='%u'", arg_2, atoi(arg_3), id); - PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 dataint updated.|r", id); - return true; + PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 dataint updated.|r", id); + return true; }else { - std::string arg_str_3 = arg_3; + std::string arg_str_3 = arg_3; WorldDatabase.escape_string(arg_str_3); WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET %s='%s' WHERE guid='%u'", arg_2, arg_str_3.c_str(), id); } } - PSendSysMessage("%s%s|r|cff00ffff%u:|r|cff00ff00 %s %s|r","|cff00ff00","Waypoint script:", id, arg_2,"updated."); + PSendSysMessage("%s%s|r|cff00ffff%u:|r|cff00ff00 %s %s|r","|cff00ff00","Waypoint script:", id, arg_2,"updated."); } return true; } @@ -2452,87 +2452,87 @@ bool ChatHandler::HandleWpModifyCommand(const char* args) Creature* target = getSelectedCreature(); if(!target || target->GetEntry() != VISUAL_WAYPOINT) - { - SendSysMessage("|cffff33ffERROR: You must select a waypoint.|r"); - return false; - } + { + SendSysMessage("|cffff33ffERROR: You must select a waypoint.|r"); + return false; + } - sLog.outDebug("DEBUG: HandleWpModifyCommand - User did select an NPC"); - // The visual waypoint + sLog.outDebug("DEBUG: HandleWpModifyCommand - User did select an NPC"); + // The visual waypoint Creature* wpCreature = NULL; - wpGuid = target->GetGUIDLow(); + wpGuid = target->GetGUIDLow(); // Did the user select a visual spawnpoint? - if(wpGuid) - wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); - // attempt check creature existence by DB data + if(wpGuid) + wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); + // attempt check creature existence by DB data else { - PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, wpGuid); - return false; - } - // User did select a visual waypoint? - // Check the creature - if (wpCreature->GetEntry() == VISUAL_WAYPOINT ) - { - QueryResult *result = - WorldDatabase.PQuery( "SELECT id, point FROM waypoint_data WHERE wpguid = %u", wpGuid); - - if(!result) - { - sLog.outDebug("DEBUG: HandleWpModifyCommand - No waypoint found - used 'wpguid'"); - - PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUIDLow()); - // Select waypoint number from database - // Since we compare float values, we have to deal with - // some difficulties. - // Here we search for all waypoints that only differ in one from 1 thousand - // (0.001) - There is no other way to compare C++ floats with mySQL floats - // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html - const char* maxDIFF = "0.01"; - result = WorldDatabase.PQuery( "SELECT id, point FROM waypoint_data WHERE (abs(position_x - %f) <= %s ) and (abs(position_y - %f) <= %s ) and (abs(position_z - %f) <= %s )", - wpCreature->GetPositionX(), maxDIFF, wpCreature->GetPositionY(), maxDIFF, wpCreature->GetPositionZ(), maxDIFF); - if(!result) - { + PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, wpGuid); + return false; + } + // User did select a visual waypoint? + // Check the creature + if (wpCreature->GetEntry() == VISUAL_WAYPOINT ) + { + QueryResult *result = + WorldDatabase.PQuery( "SELECT id, point FROM waypoint_data WHERE wpguid = %u", wpGuid); + + if(!result) + { + sLog.outDebug("DEBUG: HandleWpModifyCommand - No waypoint found - used 'wpguid'"); + + PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUIDLow()); + // Select waypoint number from database + // Since we compare float values, we have to deal with + // some difficulties. + // Here we search for all waypoints that only differ in one from 1 thousand + // (0.001) - There is no other way to compare C++ floats with mySQL floats + // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html + const char* maxDIFF = "0.01"; + result = WorldDatabase.PQuery( "SELECT id, point FROM waypoint_data WHERE (abs(position_x - %f) <= %s ) and (abs(position_y - %f) <= %s ) and (abs(position_z - %f) <= %s )", + wpCreature->GetPositionX(), maxDIFF, wpCreature->GetPositionY(), maxDIFF, wpCreature->GetPositionZ(), maxDIFF); + if(!result) + { PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, wpGuid); return true; - } - } - sLog.outDebug("DEBUG: HandleWpModifyCommand - After getting wpGuid"); - - do - { - Field *fields = result->Fetch(); - pathid = fields[0].GetUInt32(); - point = fields[1].GetUInt32(); - } - while( result->NextRow() ); + } + } + sLog.outDebug("DEBUG: HandleWpModifyCommand - After getting wpGuid"); + + do + { + Field *fields = result->Fetch(); + pathid = fields[0].GetUInt32(); + point = fields[1].GetUInt32(); + } + while( result->NextRow() ); // Cleanup memory sLog.outDebug("DEBUG: HandleWpModifyCommand - Cleanup memory"); delete result; // We have the waypoint number and the GUID of the "master npc" - // Text is enclosed in "<>", all other arguments not + // Text is enclosed in "<>", all other arguments not arg_str = strtok((char*)NULL, " "); } - sLog.outDebug("DEBUG: HandleWpModifyCommand - Parameters parsed - now execute the command"); + sLog.outDebug("DEBUG: HandleWpModifyCommand - Parameters parsed - now execute the command"); // Check for argument if(show != "del" && show != "move" && arg_str == NULL) { PSendSysMessage(LANG_WAYPOINT_ARGUMENTREQ, show_str); - return false; + return false; } if(show == "del" && target) { PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid); - // wpCreature - Creature* wpCreature = NULL; + // wpCreature + Creature* wpCreature = NULL; - if( wpGuid != 0 ) + if( wpGuid != 0 ) { wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); wpCreature->CombatStop(); @@ -2540,7 +2540,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args) wpCreature->AddObjectToRemoveList(); } - WorldDatabase.PExecuteLog("DELETE FROM waypoint_data WHERE id='%u' AND point='%u'", + WorldDatabase.PExecuteLog("DELETE FROM waypoint_data WHERE id='%u' AND point='%u'", pathid, point); WorldDatabase.PExecuteLog("UPDATE waypoint_data SET point=point-1 WHERE id='%u' AND point>'%u'", pathid, point); @@ -2556,8 +2556,8 @@ bool ChatHandler::HandleWpModifyCommand(const char* args) Player *chr = m_session->GetPlayer(); Map *map = chr->GetMap(); { - // wpCreature - Creature* wpCreature = NULL; + // wpCreature + Creature* wpCreature = NULL; // What to do: // Move the visual spawnpoint // Respawn the owner of the waypoints @@ -2617,7 +2617,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args) show_str, text2.c_str(), pathid, point); } - PSendSysMessage(LANG_WAYPOINT_CHANGED_NO, show_str); + PSendSysMessage(LANG_WAYPOINT_CHANGED_NO, show_str); return true; } @@ -2641,7 +2641,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args) sLog.outDebug("DEBUG: HandleWpShowCommand: show_str: %s guid_str: %s", show_str, guid_str); uint32 pathid = 0; - Creature* target = getSelectedCreature(); + Creature* target = getSelectedCreature(); // Did player provide a PathID? @@ -2658,8 +2658,8 @@ bool ChatHandler::HandleWpShowCommand(const char* args) return false; } - pathid = target->GetWaypointPath(); - } + pathid = target->GetWaypointPath(); + } else { @@ -2673,26 +2673,26 @@ bool ChatHandler::HandleWpShowCommand(const char* args) } pathid = atoi((char*)guid_str); - } + } - sLog.outDebug("DEBUG: HandleWpShowCommand: danach"); + sLog.outDebug("DEBUG: HandleWpShowCommand: danach"); std::string show = show_str; uint32 Maxpoint; - sLog.outDebug("DEBUG: HandleWpShowCommand: PathID: %u", pathid); + sLog.outDebug("DEBUG: HandleWpShowCommand: PathID: %u", pathid); - //PSendSysMessage("wpshow - show: %s", show); + //PSendSysMessage("wpshow - show: %s", show); // Show info for the selected waypoint if(show == "info") - { + { - // Check if the user did specify a visual waypoint + // Check if the user did specify a visual waypoint if( target->GetEntry() != VISUAL_WAYPOINT ) { @@ -2702,56 +2702,56 @@ bool ChatHandler::HandleWpShowCommand(const char* args) } - QueryResult *result = WorldDatabase.PQuery( "SELECT id, point, delay, move_flag, action, action_chance FROM waypoint_data WHERE wpguid = %u", target->GetGUIDLow()); + QueryResult *result = WorldDatabase.PQuery( "SELECT id, point, delay, move_flag, action, action_chance FROM waypoint_data WHERE wpguid = %u", target->GetGUIDLow()); - if(!result) + if(!result) { - SendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM); + SendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM); return true; - } + } - SendSysMessage("|cff00ffffDEBUG: wp show info:|r"); + SendSysMessage("|cff00ffffDEBUG: wp show info:|r"); - do + do { Field *fields = result->Fetch(); - pathid = fields[0].GetUInt32(); - uint32 point = fields[1].GetUInt32(); - uint32 delay = fields[2].GetUInt32(); - uint32 flag = fields[3].GetUInt32(); - uint32 ev_id = fields[4].GetUInt32(); - uint32 ev_chance = fields[5].GetUInt32(); - - PSendSysMessage("|cff00ff00Show info: for current point: |r|cff00ffff%u|r|cff00ff00, Path ID: |r|cff00ffff%u|r", point, pathid); - PSendSysMessage("|cff00ff00Show info: delay: |r|cff00ffff%u|r", delay); - PSendSysMessage("|cff00ff00Show info: Move flag: |r|cff00ffff%u|r", flag); - PSendSysMessage("|cff00ff00Show info: Waypoint event: |r|cff00ffff%u|r", ev_id); - PSendSysMessage("|cff00ff00Show info: Event chance: |r|cff00ffff%u|r", ev_chance); + pathid = fields[0].GetUInt32(); + uint32 point = fields[1].GetUInt32(); + uint32 delay = fields[2].GetUInt32(); + uint32 flag = fields[3].GetUInt32(); + uint32 ev_id = fields[4].GetUInt32(); + uint32 ev_chance = fields[5].GetUInt32(); + + PSendSysMessage("|cff00ff00Show info: for current point: |r|cff00ffff%u|r|cff00ff00, Path ID: |r|cff00ffff%u|r", point, pathid); + PSendSysMessage("|cff00ff00Show info: delay: |r|cff00ffff%u|r", delay); + PSendSysMessage("|cff00ff00Show info: Move flag: |r|cff00ffff%u|r", flag); + PSendSysMessage("|cff00ff00Show info: Waypoint event: |r|cff00ffff%u|r", ev_id); + PSendSysMessage("|cff00ff00Show info: Event chance: |r|cff00ffff%u|r", ev_chance); }while( result->NextRow() ); - // Cleanup memory + // Cleanup memory delete result; return true; } if(show == "on") - { + { QueryResult *result = WorldDatabase.PQuery( "SELECT point, position_x,position_y,position_z FROM waypoint_data WHERE id = '%u'", pathid); - if(!result) + if(!result) { - SendSysMessage("|cffff33ffPath no found.|r"); + SendSysMessage("|cffff33ffPath no found.|r"); SetSentErrorMessage(true); return false; } - PSendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff%u|r", pathid); + PSendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff%u|r", pathid); - // Delete all visuals for this NPC + // Delete all visuals for this NPC QueryResult *result2 = WorldDatabase.PQuery( "SELECT wpguid FROM waypoint_data WHERE id = '%u' and wpguid <> 0", pathid); - if(result2) + if(result2) { bool hasError = false; do @@ -2775,9 +2775,9 @@ bool ChatHandler::HandleWpShowCommand(const char* args) }while( result2->NextRow() ); - delete result2; + delete result2; - if( hasError ) + if( hasError ) { PSendSysMessage(LANG_WAYPOINT_TOOFAR1); PSendSysMessage(LANG_WAYPOINT_TOOFAR2); @@ -2808,9 +2808,9 @@ bool ChatHandler::HandleWpShowCommand(const char* args) return false; } - wpCreature->Relocate(x, y, z, o); + wpCreature->Relocate(x, y, z, o); - if(!wpCreature->IsPositionValid()) + if(!wpCreature->IsPositionValid()) { sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",wpCreature->GetGUIDLow(),wpCreature->GetEntry(),wpCreature->GetPositionX(),wpCreature->GetPositionY()); delete wpCreature; @@ -2818,7 +2818,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args) return false; } - sLog.outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u"); + sLog.outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u"); // set "wpguid" column to the visual waypoint WorldDatabase.PExecuteLog("UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point); @@ -2826,16 +2826,16 @@ bool ChatHandler::HandleWpShowCommand(const char* args) wpCreature->LoadFromDB(wpCreature->GetDBTableGUIDLow(),map); map->Add(wpCreature); - if(target) - { - wpCreature->SetDisplayId(target->GetDisplayId()); - wpCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5); - } - } - while( result->NextRow() ); + if(target) + { + wpCreature->SetDisplayId(target->GetDisplayId()); + wpCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5); + } + } + while( result->NextRow() ); SendSysMessage("|cff00ff00Showing the current creature's path.|r"); - // Cleanup memory + // Cleanup memory delete result; return true; } @@ -2881,17 +2881,17 @@ bool ChatHandler::HandleWpShowCommand(const char* args) return false; } - pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); + pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); pCreature->LoadFromDB(pCreature->GetDBTableGUIDLow(), map); map->Add(pCreature); - if(target) - { - pCreature->SetDisplayId(target->GetDisplayId()); - pCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5); - } + if(target) + { + pCreature->SetDisplayId(target->GetDisplayId()); + pCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5); + } - // Cleanup memory + // Cleanup memory delete result; return true; } @@ -2946,17 +2946,17 @@ bool ChatHandler::HandleWpShowCommand(const char* args) return false; } - pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); + pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); pCreature->LoadFromDB(pCreature->GetDBTableGUIDLow(), map); map->Add(pCreature); - if(target) - { - pCreature->SetDisplayId(target->GetDisplayId()); - pCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5); - } + if(target) + { + pCreature->SetDisplayId(target->GetDisplayId()); + pCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5); + } - // Cleanup memory + // Cleanup memory delete result; return true; } @@ -3242,10 +3242,10 @@ bool ChatHandler::HandleLookupEventCommand(const char* args) { char const* active = activeEvents.find(id) != activeEvents.end() ? GetTrinityString(LANG_ACTIVE) : ""; - if(m_session) - PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,id,id,eventData.description.c_str(),active ); - else - PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,id,eventData.description.c_str(),active ); + if(m_session) + PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,id,id,eventData.description.c_str(),active ); + else + PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,id,eventData.description.c_str(),active ); ++counter; } @@ -3272,9 +3272,9 @@ bool ChatHandler::HandleEventActiveListCommand(const char* args) GameEventData const& eventData = events[event_id]; if(m_session) - PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,event_id,event_id,eventData.description.c_str(),active ); - else - PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,event_id,eventData.description.c_str(),active ); + PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,event_id,event_id,eventData.description.c_str(),active ); + else + PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,event_id,eventData.description.c_str(),active ); ++counter; } @@ -3580,8 +3580,8 @@ bool ChatHandler::HandleLookupPlayerIpCommand(const char* args) return false; std::string ip = strtok ((char*)args, " "); - char* limit_str = strtok (NULL, " "); - int32 limit = limit_str ? atoi (limit_str) : -1; + char* limit_str = strtok (NULL, " "); + int32 limit = limit_str ? atoi (limit_str) : -1; LoginDatabase.escape_string (ip); @@ -3596,8 +3596,8 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args) return false; std::string account = strtok ((char*)args, " "); - char* limit_str = strtok (NULL, " "); - int32 limit = limit_str ? atoi (limit_str) : -1; + char* limit_str = strtok (NULL, " "); + int32 limit = limit_str ? atoi (limit_str) : -1; if (!AccountMgr::normilizeString (account)) return false; @@ -3616,8 +3616,8 @@ bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args) return false; std::string email = strtok ((char*)args, " "); - char* limit_str = strtok (NULL, " "); - int32 limit = limit_str ? atoi (limit_str) : -1; + char* limit_str = strtok (NULL, " "); + int32 limit = limit_str ? atoi (limit_str) : -1; LoginDatabase.escape_string (email); @@ -3673,8 +3673,8 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult* result, int32 limit) /// Triggering corpses expire check in world bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/) { - CorpsesErase(); - return true; + CorpsesErase(); + return true; } bool ChatHandler::HandleRepairitemsCommand(const char* /*args*/) @@ -3686,7 +3686,7 @@ bool ChatHandler::HandleRepairitemsCommand(const char* /*args*/) PSendSysMessage(LANG_NO_CHAR_SELECTED); SetSentErrorMessage(true); return false; - } + } // Repair items target->DurabilityRepairAll(false, 0, false); @@ -3755,175 +3755,175 @@ bool ChatHandler::HandleNpcUnFollowCommand(const char* /*args*/) bool ChatHandler::HandleCreatePetCommand(const char* args) { - Player *player = m_session->GetPlayer(); - Creature *creatureTarget = getSelectedCreature(); - - if(!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER) - { - PSendSysMessage(LANG_SELECT_CREATURE); - SetSentErrorMessage(true); - return false; - } - - CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(creatureTarget->GetEntry()); - // Creatures with family 0 crashes the server - if(cInfo->family == 0) - { - PSendSysMessage("This creature cannot be tamed. (family id: 0)."); - SetSentErrorMessage(true); - return false; - } - - if(player->GetPetGUID()) - { - PSendSysMessage("You already have a pet"); - SetSentErrorMessage(true); - return false; - } - - // Everything looks OK, create new pet - Pet* pet = new Pet(HUNTER_PET); - - if(!pet->CreateBaseAtCreature(creatureTarget)) - { - delete pet; - PSendSysMessage("Error 1"); - return false; - } - - creatureTarget->setDeathState(JUST_DIED); - creatureTarget->RemoveCorpse(); - creatureTarget->SetHealth(0); // just for nice GM-mode view - - pet->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, player->GetGUID()); - pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID()); - pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction()); - - if(!pet->InitStatsForLevel(creatureTarget->getLevel())) - { - sLog.outError("ERROR: InitStatsForLevel() in EffectTameCreature failed! Pet deleted."); - PSendSysMessage("Error 2"); - return false; - } - - // prepare visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()-1); - - pet->GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true); - // this enables pet details window (Shift+P) - pet->AIM_Initialize(); - pet->InitPetCreateSpells(); - pet->SetHealth(pet->GetMaxHealth()); - - MapManager::Instance().GetMap(pet->GetMapId(), pet)->Add((Creature*)pet); - - // visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()); - - player->SetPet(pet); - pet->SavePetToDB(PET_SAVE_AS_CURRENT); - player->PetSpellInitialize(); - - return true; + Player *player = m_session->GetPlayer(); + Creature *creatureTarget = getSelectedCreature(); + + if(!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER) + { + PSendSysMessage(LANG_SELECT_CREATURE); + SetSentErrorMessage(true); + return false; + } + + CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(creatureTarget->GetEntry()); + // Creatures with family 0 crashes the server + if(cInfo->family == 0) + { + PSendSysMessage("This creature cannot be tamed. (family id: 0)."); + SetSentErrorMessage(true); + return false; + } + + if(player->GetPetGUID()) + { + PSendSysMessage("You already have a pet"); + SetSentErrorMessage(true); + return false; + } + + // Everything looks OK, create new pet + Pet* pet = new Pet(HUNTER_PET); + + if(!pet->CreateBaseAtCreature(creatureTarget)) + { + delete pet; + PSendSysMessage("Error 1"); + return false; + } + + creatureTarget->setDeathState(JUST_DIED); + creatureTarget->RemoveCorpse(); + creatureTarget->SetHealth(0); // just for nice GM-mode view + + pet->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, player->GetGUID()); + pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID()); + pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction()); + + if(!pet->InitStatsForLevel(creatureTarget->getLevel())) + { + sLog.outError("ERROR: InitStatsForLevel() in EffectTameCreature failed! Pet deleted."); + PSendSysMessage("Error 2"); + return false; + } + + // prepare visual effect for levelup + pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()-1); + + pet->GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true); + // this enables pet details window (Shift+P) + pet->AIM_Initialize(); + pet->InitPetCreateSpells(); + pet->SetHealth(pet->GetMaxHealth()); + + MapManager::Instance().GetMap(pet->GetMapId(), pet)->Add((Creature*)pet); + + // visual effect for levelup + pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()); + + player->SetPet(pet); + pet->SavePetToDB(PET_SAVE_AS_CURRENT); + player->PetSpellInitialize(); + + return true; } bool ChatHandler::HandlePetLearnCommand(const char* args) { - if(!*args) - return false; + if(!*args) + return false; - Player *plr = m_session->GetPlayer(); - Pet *pet = plr->GetPet(); + Player *plr = m_session->GetPlayer(); + Pet *pet = plr->GetPet(); - if(!pet) - { - PSendSysMessage("You have no pet"); - SetSentErrorMessage(true); - return false; - } + if(!pet) + { + PSendSysMessage("You have no pet"); + SetSentErrorMessage(true); + return false; + } - uint32 spellId = extractSpellIdFromLink((char*)args); + uint32 spellId = extractSpellIdFromLink((char*)args); - if(!spellId || !sSpellStore.LookupEntry(spellId)) + if(!spellId || !sSpellStore.LookupEntry(spellId)) return false; - // Check if pet already has it - if(pet->HasSpell(spellId)) - { - PSendSysMessage("Pet already has spell: %u", spellId); - SetSentErrorMessage(true); + // Check if pet already has it + if(pet->HasSpell(spellId)) + { + PSendSysMessage("Pet already has spell: %u", spellId); + SetSentErrorMessage(true); return false; - } + } - // Check if spell is valid - SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId); - if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo)) + // Check if spell is valid + SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId); + if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo)) { PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spellId); SetSentErrorMessage(true); return false; } - pet->learnSpell(spellId); + pet->learnSpell(spellId); - PSendSysMessage("Pet has learned spell %u", spellId); - return true; + PSendSysMessage("Pet has learned spell %u", spellId); + return true; } bool ChatHandler::HandlePetUnlearnCommand(const char *args) { - if(!*args) - return false; + if(!*args) + return false; - Player *plr = m_session->GetPlayer(); - Pet *pet = plr->GetPet(); + Player *plr = m_session->GetPlayer(); + Pet *pet = plr->GetPet(); - if(!pet) - { - PSendSysMessage("You have no pet"); - SetSentErrorMessage(true); - return false; - } + if(!pet) + { + PSendSysMessage("You have no pet"); + SetSentErrorMessage(true); + return false; + } - uint32 spellId = extractSpellIdFromLink((char*)args); + uint32 spellId = extractSpellIdFromLink((char*)args); - if(pet->HasSpell(spellId)) - pet->removeSpell(spellId); - else - PSendSysMessage("Pet doesn't have that spell"); + if(pet->HasSpell(spellId)) + pet->removeSpell(spellId); + else + PSendSysMessage("Pet doesn't have that spell"); - return true; + return true; } bool ChatHandler::HandlePetTpCommand(const char *args) { - if(!*args) - return false; + if(!*args) + return false; - Player *plr = m_session->GetPlayer(); - Pet *pet = plr->GetPet(); + Player *plr = m_session->GetPlayer(); + Pet *pet = plr->GetPet(); - if(!pet) - { - PSendSysMessage("You have no pet"); - SetSentErrorMessage(true); - return false; - } + if(!pet) + { + PSendSysMessage("You have no pet"); + SetSentErrorMessage(true); + return false; + } - uint32 tp = atol(args); + uint32 tp = atol(args); - pet->SetTP(tp); + pet->SetTP(tp); - PSendSysMessage("Pet's tp changed to %u", tp); - return true; + PSendSysMessage("Pet's tp changed to %u", tp); + return true; } bool ChatHandler::HandleActivateObjectCommand(const char *args) { - if(!*args) - return false; + if(!*args) + return false; - char* cId = extractKeyFromLink((char*)args,"Hgameobject"); + char* cId = extractKeyFromLink((char*)args,"Hgameobject"); if(!cId) return false; @@ -3944,13 +3944,13 @@ bool ChatHandler::HandleActivateObjectCommand(const char *args) return false; } - // Activate - obj->SetLootState(GO_READY); - obj->UseDoorOrButton(10000); + // Activate + obj->SetLootState(GO_READY); + obj->UseDoorOrButton(10000); - PSendSysMessage("Object activated!"); + PSendSysMessage("Object activated!"); - return true; + return true; } // add creature, temp only @@ -4036,12 +4036,12 @@ bool ChatHandler::HandleNpcAddFormationCommand(const char* args) Player *chr = m_session->GetPlayer(); FormationMember *group_member; - group_member = new FormationMember; - group_member->follow_angle = pCreature->GetAngle(chr) - chr->GetOrientation(); - group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - pCreature->GetPositionX(),int(2))+pow(chr->GetPositionY()-pCreature->GetPositionY(),int(2))); - group_member->memberGUID = lowguid; - group_member->leaderGUID = leaderGUID; - group_member->groupAI = 0; + group_member = new FormationMember; + group_member->follow_angle = pCreature->GetAngle(chr) - chr->GetOrientation(); + group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - pCreature->GetPositionX(),int(2))+pow(chr->GetPositionY()-pCreature->GetPositionY(),int(2))); + group_member->memberGUID = lowguid; + group_member->leaderGUID = leaderGUID; + group_member->groupAI = 0; CreatureGroupMap[lowguid] = group_member; pCreature->SearchFormation(); diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 6e9704c322d..a36571d20a4 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -510,7 +510,7 @@ bool ChatHandler::HandleReloadAllScriptsCommand(const char*) SendGlobalGMSysMessage("DB tables `*_scripts` reloaded."); HandleReloadDbScriptStringCommand("a"); HandleReloadWpScriptsCommand("a"); - return true; + return true; } bool ChatHandler::HandleReloadAllSpellCommand(const char*) @@ -928,9 +928,9 @@ bool ChatHandler::HandleReloadWpScriptsCommand(const char* arg) if(*arg!='a') sLog.outString( "Re-Loading Scripts from `waypoint_scripts`..."); - objmgr.LoadWaypointScripts(); + objmgr.LoadWaypointScripts(); - if(*arg!='a') + if(*arg!='a') SendGlobalGMSysMessage("DB table `waypoint_scripts` reloaded."); return true; diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 7bf4c3fa83e..dd62f1e1c9f 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -1271,22 +1271,22 @@ float Map::GetHeight(float x, float y, float z, bool pUseVmaps) const float Map::GetVmapHeight(float x, float y, float z, bool useMaps) const { - float mapHeight; - float vmapHeight; - if (useMaps) - { - mapHeight = GetHeight(x, y, z, false); - if (fabs(mapHeight - z) < 0.1) - return mapHeight; - } - else - mapHeight = INVALID_HEIGHT; - VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager(); - if (vmgr->isLineOfSightCalcEnabled()) - bool result = vmgr->getObjectHitPos(GetId(), x, y, z + 2.0f, x, y, mapHeight, x, y, vmapHeight, 0); - else - return INVALID_HEIGHT; - return vmapHeight; + float mapHeight; + float vmapHeight; + if (useMaps) + { + mapHeight = GetHeight(x, y, z, false); + if (fabs(mapHeight - z) < 0.1) + return mapHeight; + } + else + mapHeight = INVALID_HEIGHT; + VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager(); + if (vmgr->isLineOfSightCalcEnabled()) + bool result = vmgr->getObjectHitPos(GetId(), x, y, z + 2.0f, x, y, mapHeight, x, y, vmapHeight, 0); + else + return INVALID_HEIGHT; + return vmapHeight; } uint16 Map::GetAreaFlag(float x, float y ) const diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index cfba9a5f7c4..a6b84d30de2 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -860,7 +860,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) missingItem = at->requiredItem2; uint32 missingKey = 0; - uint32 missingHeroicQuest = 0; + uint32 missingHeroicQuest = 0; if(GetPlayer()->GetDifficulty() == DIFFICULTY_HEROIC) { if(at->heroicKey) @@ -872,7 +872,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) else if(at->heroicKey2 && !GetPlayer()->HasItemCount(at->heroicKey2, 1)) missingKey = at->heroicKey2; - if(at->heroicQuest && !GetPlayer()->GetQuestRewardStatus(at->heroicQuest)) + if(at->heroicQuest && !GetPlayer()->GetQuestRewardStatus(at->heroicQuest)) missingHeroicQuest = at->heroicQuest; } @@ -887,7 +887,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) SendAreaTriggerMessage(GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, objmgr.GetItemPrototype(missingItem)->Name1); else if(missingKey) GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY2); - else if(missingHeroicQuest) + else if(missingHeroicQuest) SendAreaTriggerMessage(at->heroicQuestFailedText.c_str()); else if(missingQuest) SendAreaTriggerMessage(at->requiredFailedText.c_str()); diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp index d74602844a5..b5a68a19d38 100644 --- a/src/game/MotionMaster.cpp +++ b/src/game/MotionMaster.cpp @@ -178,7 +178,7 @@ void MotionMaster::MoveIdle(MovementSlot slot) void MotionMaster::MoveRandom(float spawndist) { - if(i_owner->GetTypeId()==TYPEID_UNIT) + if(i_owner->GetTypeId()==TYPEID_UNIT) { DEBUG_LOG("Creature (GUID: %u) start moving random", i_owner->GetGUIDLow() ); Mutate(new RandomMovementGenerator(spawndist), MOTION_SLOT_IDLE); @@ -402,10 +402,10 @@ void MotionMaster::Mutate(MovementGenerator *m, MovementSlot slot) void MotionMaster::MovePath(uint32 path_id, bool repeatable) { - if(!path_id) - return; - //We set waypoint movement as new default movement generator - // clear ALL movement generators (including default) + if(!path_id) + return; + //We set waypoint movement as new default movement generator + // clear ALL movement generators (including default) /*while(!empty()) { MovementGenerator *curr = top(); @@ -415,13 +415,13 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable) delete curr; }*/ - //i_owner->GetTypeId()==TYPEID_PLAYER ? - //Mutate(new WaypointMovementGenerator(path_id, repeatable)): - Mutate(new WaypointMovementGenerator(path_id, repeatable), MOTION_SLOT_IDLE); + //i_owner->GetTypeId()==TYPEID_PLAYER ? + //Mutate(new WaypointMovementGenerator(path_id, repeatable)): + Mutate(new WaypointMovementGenerator(path_id, repeatable), MOTION_SLOT_IDLE); - DEBUG_LOG("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)", - i_owner->GetTypeId()==TYPEID_PLAYER ? "Player" : "Creature", - i_owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO" ); + DEBUG_LOG("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)", + i_owner->GetTypeId()==TYPEID_PLAYER ? "Player" : "Creature", + i_owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO" ); } void MotionMaster::propagateSpeedChange() diff --git a/src/game/MotionMaster.h b/src/game/MotionMaster.h index 2822cdcd327..84057741d08 100644 --- a/src/game/MotionMaster.h +++ b/src/game/MotionMaster.h @@ -123,7 +123,7 @@ class TRINITY_DLL_SPEC MotionMaster //: private std::stack void MoveIdle(MovementSlot slot = MOTION_SLOT_ACTIVE); void MoveTargetedHome(); void MoveRandom(float spawndist = 0.0f); - void MoveFollow(Unit* target, float dist, float angle); + void MoveFollow(Unit* target, float dist, float angle); void MoveChase(Unit* target, float dist = 0.0f, float angle = 0.0f); void MoveConfused(); void MoveFleeing(Unit* enemy); @@ -131,7 +131,7 @@ class TRINITY_DLL_SPEC MotionMaster //: private std::stack void MoveCharge(float x, float y, float z); void MoveTaxiFlight(uint32 path, uint32 pathnode); void MoveDistract(uint32 time); - void MovePath(uint32 path_id, bool repeatable); + void MovePath(uint32 path_id, bool repeatable); MovementGeneratorType GetCurrentMovementGeneratorType() const; diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 181e7f2541d..1d5db0e925e 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1595,8 +1595,8 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa return NULL; } - pCreature->SetHomePosition(x, y, z, ang); - pCreature->Summon(spwtype, despwtime); + pCreature->SetHomePosition(x, y, z, ang); + pCreature->Summon(spwtype, despwtime); if(GetTypeId()==TYPEID_UNIT && ((Creature*)this)->AI()) ((Creature*)this)->AI()->JustSummoned(pCreature); @@ -1670,9 +1670,9 @@ void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y, { GetNearPoint2D(x,y,distance2d+searcher_size,absAngle); - z = GetPositionZ(); + z = GetPositionZ(); - UpdateGroundPositionZ(x,y,z); + UpdateGroundPositionZ(x,y,z); } void WorldObject::GetGroundPoint(float &x, float &y, float &z, float dist, float angle) diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 08fcc059b8b..a68b8315492 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -5112,9 +5112,9 @@ void ObjectMgr::LoadAreaTriggerTeleports() uint32 count = 0; - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 QueryResult *result = WorldDatabase.Query("SELECT id, required_level, required_item, required_item2, heroic_key, heroic_key2, heroic_required_quest_done, heroic_required_failed_quest_text, required_quest_done, required_failed_text, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport"); - if( !result ) + if( !result ) { barGoLink bar( 1 ); @@ -5201,14 +5201,14 @@ void ObjectMgr::LoadAreaTriggerTeleports() } } - if(at.heroicQuest) - { - if(!mQuestTemplates[at.heroicQuest]) - { - sLog.outErrorDb("Required Heroic Quest %u not exist for trigger %u, remove heroic quest done requirement.",at.heroicQuest,Trigger_ID); - at.heroicQuest = 0; - } - } + if(at.heroicQuest) + { + if(!mQuestTemplates[at.heroicQuest]) + { + sLog.outErrorDb("Required Heroic Quest %u not exist for trigger %u, remove heroic quest done requirement.",at.heroicQuest,Trigger_ID); + at.heroicQuest = 0; + } + } if(at.requiredQuest) { diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index a6c2ecbbdf2..7d7a419d923 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -107,7 +107,7 @@ struct AreaTrigger uint32 requiredItem2; uint32 heroicKey; uint32 heroicKey2; - uint32 heroicQuest; + uint32 heroicQuest; std::string heroicQuestFailedText; uint32 requiredQuest; std::string requiredFailedText; @@ -323,9 +323,9 @@ class ObjectMgr typedef std::vector ScriptNameMap; - UNORDERED_MAP TransportEventMap; + UNORDERED_MAP TransportEventMap; - Player* GetPlayer(const char* name) const { return ObjectAccessor::Instance().FindPlayerByName(name);} + Player* GetPlayer(const char* name) const { return ObjectAccessor::Instance().FindPlayerByName(name);} Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); } static GameObjectInfo const *GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry(id); } @@ -536,13 +536,13 @@ class ObjectMgr void LoadQuestStartScripts(); void LoadEventScripts(); void LoadSpellScripts(); - void LoadWaypointScripts(); + void LoadWaypointScripts(); - void LoadTransportEvents(); + void LoadTransportEvents(); bool LoadTrinityStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value); bool LoadTrinityStrings() { return LoadTrinityStrings(WorldDatabase,"trinity_string",MIN_TRINITY_STRING_ID,MAX_TRINITY_STRING_ID); } - void LoadDbScriptStrings(); + void LoadDbScriptStrings(); void LoadPetCreateSpells(); void LoadCreatureLocales(); void LoadCreatureTemplates(); @@ -714,7 +714,7 @@ class ObjectMgr } const char *GetTrinityString(int32 entry, int locale_idx) const; const char *GetTrinityStringForDBCLocale(int32 entry) const { return GetTrinityString(entry,DBCLocaleIndex); } - int32 GetDBCLocaleIndex() const { return DBCLocaleIndex; } + int32 GetDBCLocaleIndex() const { return DBCLocaleIndex; } void SetDBCLocaleIndex(uint32 lang) { DBCLocaleIndex = GetIndexForLocale(LocaleConstant(lang)); } void AddCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid, uint32 instance); diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 73b6650caa1..7012ea04fb6 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -547,7 +547,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x204*/ { "CMSG_DECHARGE", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x205*/ { "CMSG_GMTICKET_CREATE", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketCreateOpcode }, /*0x206*/ { "SMSG_GMTICKET_CREATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x207*/ { "CMSG_GMTICKET_UPDATETEXT", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketUpdateOpcode }, + /*0x207*/ { "CMSG_GMTICKET_UPDATETEXT", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketUpdateOpcode }, /*0x208*/ { "SMSG_GMTICKET_UPDATETEXT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x209*/ { "SMSG_ACCOUNT_DATA_TIMES", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x20A*/ { "CMSG_REQUEST_ACCOUNT_DATA", STATUS_LOGGEDIN, &WorldSession::HandleRequestAccountData }, @@ -838,7 +838,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x327*/ { "CMSG_GM_UPDATE_TICKET_STATUS", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x328*/ { "SMSG_GM_TICKET_STATUS_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x329*/ { "MSG_SET_DUNGEON_DIFFICULTY", STATUS_LOGGEDIN, &WorldSession::HandleDungeonDifficultyOpcode }, - /*0x32A*/ { "CMSG_GMSURVEY_SUBMIT", STATUS_LOGGEDIN, &WorldSession::Handle_NULL },//&WorldSession::HandleGMSurveySubmit + /*0x32A*/ { "CMSG_GMSURVEY_SUBMIT", STATUS_LOGGEDIN, &WorldSession::Handle_NULL },//&WorldSession::HandleGMSurveySubmit /*0x32B*/ { "SMSG_UPDATE_INSTANCE_OWNERSHIP", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x32C*/ { "CMSG_IGNORE_KNOCKBACK_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x32D*/ { "SMSG_CHAT_PLAYER_AMBIGUOUS", STATUS_NEVER, &WorldSession::Handle_ServerSide }, diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e1d12009afb..02e6e94f94c 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1575,15 +1575,15 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if(!InBattleGround() && mEntry->IsBattleGroundOrArena()) return false; - // 449 - Champions' Hall (Alliance) // 450 - Hall of Legends (Horde) - if(mapid == 449 && GetTeam()==HORDE) + // 449 - Champions' Hall (Alliance) // 450 - Hall of Legends (Horde) + if(mapid == 449 && GetTeam()==HORDE) { GetSession()->SendNotification(LANG_NO_ENTER_CHAMPIONS_HALL); return false; } - if(mapid == 450 && GetTeam() == ALLIANCE) - { + if(mapid == 450 && GetTeam() == ALLIANCE) + { GetSession()->SendNotification(LANG_NO_ENTER_HALL_OF_LEGENDS); return false; } @@ -15447,8 +15447,8 @@ void Player::SaveToDB() ss << ", '"; ss << m_taxi.SaveTaxiDestinationsToString(); - ss << "', '0', '"; - ss << GetSession()->GetLatency(); + ss << "', '0', '"; + ss << GetSession()->GetLatency(); ss << "' )"; CharacterDatabase.Execute( ss.str().c_str() ); @@ -18754,7 +18754,7 @@ void Player::UpdateZoneDependentAuras( uint32 newZone ) { // remove new continent flight forms if( !isGameMaster() && - GetVirtualMapForMapAndZone(GetMapId(),newZone) != 530) + GetVirtualMapForMapAndZone(GetMapId(),newZone) != 530) { RemoveSpellsCausingAura(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED); RemoveSpellsCausingAura(SPELL_AURA_FLY); diff --git a/src/game/PlayerDump.h b/src/game/PlayerDump.h index 86224d1fbca..c8335216716 100644 --- a/src/game/PlayerDump.h +++ b/src/game/PlayerDump.h @@ -75,11 +75,11 @@ enum DumpTableType enum DumpReturn { - DUMP_SUCCESS, - DUMP_FILE_OPEN_ERROR, - DUMP_TOO_MANY_CHARS, - DUMP_UNEXPECTED_END, - DUMP_FILE_BROKEN, + DUMP_SUCCESS, + DUMP_FILE_OPEN_ERROR, + DUMP_TOO_MANY_CHARS, + DUMP_UNEXPECTED_END, + DUMP_FILE_BROKEN, }; class PlayerDump diff --git a/src/game/RandomMovementGenerator.cpp b/src/game/RandomMovementGenerator.cpp index 615a8721fa8..0679d1381db 100644 --- a/src/game/RandomMovementGenerator.cpp +++ b/src/game/RandomMovementGenerator.cpp @@ -123,9 +123,9 @@ RandomMovementGenerator::Initialize(Creature &creature) if(!creature.isAlive()) return; - wander_distance = creature.GetRespawnRadius(); + wander_distance = creature.GetRespawnRadius(); - if (creature.canFly()) + if (creature.canFly()) creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); else creature.SetUnitMovementFlags(irand(0,RUNNING_CHANCE_RANDOMMV) > 0 ? MOVEMENTFLAG_WALK_MODE : MOVEMENTFLAG_NONE ); diff --git a/src/game/RandomMovementGenerator.h b/src/game/RandomMovementGenerator.h index dcc03dfa721..ed34b96f608 100644 --- a/src/game/RandomMovementGenerator.h +++ b/src/game/RandomMovementGenerator.h @@ -30,16 +30,16 @@ class TRINITY_DLL_SPEC RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovementGenerator > { public: - // Wander dist is related on db spawn dist. So what if we wanna set eandom movement on summoned creature?! - RandomMovementGenerator(float spawn_dist = 0.0f) : i_nextMoveTime(0), wander_distance(spawn_dist) {} + // Wander dist is related on db spawn dist. So what if we wanna set eandom movement on summoned creature?! + RandomMovementGenerator(float spawn_dist = 0.0f) : i_nextMoveTime(0), wander_distance(spawn_dist) {} - void _setRandomLocation(T &); + void _setRandomLocation(T &); void Initialize(T &); void Finalize(T &); void Reset(T &); bool Update(T &, const uint32 &); bool GetDestination(float &x, float &y, float &z) const; - void UpdateMapPosition(uint32 mapid, float &x ,float &y, float &z) + void UpdateMapPosition(uint32 mapid, float &x ,float &y, float &z) { i_destinationHolder.GetLocationNow(mapid, x,y,z); } @@ -49,6 +49,6 @@ class TRINITY_DLL_SPEC RandomMovementGenerator DestinationHolder< Traveller > i_destinationHolder; float wander_distance; - uint32 i_nextMove; + uint32 i_nextMove; }; #endif diff --git a/src/game/ScriptCalls.cpp b/src/game/ScriptCalls.cpp index 8c763809f63..4bd305917b2 100644 --- a/src/game/ScriptCalls.cpp +++ b/src/game/ScriptCalls.cpp @@ -58,7 +58,7 @@ bool LoadScriptingModule(char const* libName) if( !(testScript->ScriptsInit =(scriptCallScriptsInit )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ScriptsInit" )) ||!(testScript->ScriptsFree =(scriptCallScriptsFree )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ScriptsFree" )) - ||!(testScript->ScriptsVersion =(scriptCallScriptsVersion )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ScriptsVersion" )) + ||!(testScript->ScriptsVersion =(scriptCallScriptsVersion )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ScriptsVersion" )) ||!(testScript->GossipHello =(scriptCallGossipHello )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GossipHello" )) ||!(testScript->GOChooseReward =(scriptCallGOChooseReward )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GOChooseReward" )) ||!(testScript->QuestAccept =(scriptCallQuestAccept )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"QuestAccept" )) @@ -95,7 +95,7 @@ bool LoadScriptingModule(char const* libName) Script=testScript; Script->ScriptsInit(); - sWorld.SetScriptsVersion(Script->ScriptsVersion()); + sWorld.SetScriptsVersion(Script->ScriptsVersion()); return true; } diff --git a/src/game/ScriptCalls.h b/src/game/ScriptCalls.h index eb6cf09fab9..52b2f27f218 100644 --- a/src/game/ScriptCalls.h +++ b/src/game/ScriptCalls.h @@ -65,7 +65,7 @@ typedef struct { scriptCallScriptsInit ScriptsInit; scriptCallScriptsFree ScriptsFree; - scriptCallScriptsVersion ScriptsVersion; + scriptCallScriptsVersion ScriptsVersion; scriptCallGossipHello GossipHello; scriptCallGOChooseReward GOChooseReward; diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 4ee86880443..e0e3a5ba077 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2202,16 +2202,16 @@ enum ResponseCodes /// Ban function modes enum BanMode { - BAN_ACCOUNT, - BAN_CHARACTER, - BAN_IP + BAN_ACCOUNT, + BAN_CHARACTER, + BAN_IP }; /// Ban function return codes enum BanReturn { - BAN_SUCCESS, - BAN_SYNTAX_ERROR, - BAN_NOTFOUND + BAN_SUCCESS, + BAN_SYNTAX_ERROR, + BAN_NOTFOUND }; #endif diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index abdeeb275b5..d7d9446ab50 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4163,11 +4163,11 @@ uint8 Spell::CanCast(bool strict) case SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED: case SPELL_AURA_FLY: { - // not allow cast fly spells at old maps by players (all spells is self target) + // not allow cast fly spells at old maps by players (all spells is self target) if(m_caster->GetTypeId()==TYPEID_PLAYER) { if( !((Player*)m_caster)->isGameMaster() && - GetVirtualMapForMapAndZone(m_caster->GetMapId(),m_caster->GetZoneId()) != 530) + GetVirtualMapForMapAndZone(m_caster->GetMapId(),m_caster->GetZoneId()) != 530) return SPELL_FAILED_NOT_HERE; } break; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index b74f9f0a8a4..c77e84b85f5 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -888,7 +888,7 @@ void Aura::_AddAura() SetAuraSlot( slot ); } - UpdateSlotCounterAndDuration(); + UpdateSlotCounterAndDuration(); // Update Seals information if( IsSealSpell(GetSpellProto()) ) @@ -5674,13 +5674,13 @@ void Aura::PeriodicTick() int32 gain = pCaster->ModifyPower(power,gain_amount); m_target->AddThreat(pCaster, float(gain) * 0.5f, GetSpellSchoolMask(GetSpellProto()), GetSpellProto()); } - // Mark of Kaz'rogal - if(GetId() == 31447 && m_target->GetPower(power) == 0) - { - m_target->CastSpell(m_target, 31463, true, 0, this); - // Remove aura - SetAuraDuration(0); - } + // Mark of Kaz'rogal + if(GetId() == 31447 && m_target->GetPower(power) == 0) + { + m_target->CastSpell(m_target, 31463, true, 0, this); + // Remove aura + SetAuraDuration(0); + } break; } case SPELL_AURA_PERIODIC_ENERGIZE: diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index db608094426..07e5d4afef9 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1291,7 +1291,7 @@ void Spell::EffectDummy(uint32 i) return; spell_id = 20647; - bp = damage+int32(m_caster->GetPower(POWER_RAGE) * m_spellInfo->DmgMultiplier[i]); + bp = damage+int32(m_caster->GetPower(POWER_RAGE) * m_spellInfo->DmgMultiplier[i]); m_caster->SetPower(POWER_RAGE,0); break; } @@ -3385,13 +3385,13 @@ void Spell::EffectDispel(uint32 i) SpellEntry const* spellInfo = sSpellStore.LookupEntry(j->first); data << uint32(spellInfo->Id); // Spell Id data << uint8(0); // 0 - dispelled !=0 cleansed - if(spellInfo->StackAmount!= 0) - { - //Why are Aura's Removed by EffIndex? Auras should be removed as a whole..... - unitTarget->RemoveSingleAuraFromStackByDispel(spellInfo->Id); - } - else - unitTarget->RemoveAurasDueToSpellByDispel(spellInfo->Id, j->second, m_caster); + if(spellInfo->StackAmount!= 0) + { + //Why are Aura's Removed by EffIndex? Auras should be removed as a whole..... + unitTarget->RemoveSingleAuraFromStackByDispel(spellInfo->Id); + } + else + unitTarget->RemoveAurasDueToSpellByDispel(spellInfo->Id, j->second, m_caster); } m_caster->SendMessageToSet(&data, true); diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index edf41e16492..940135e2db5 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -362,27 +362,27 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket) if(!IsPositiveSpell(spellId) || (spellInfo->Attributes & SPELL_ATTR_CANT_CANCEL)) return; - // lifebloom must delete final heal effect - if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && (spellInfo->SpellFamilyFlags & 0x1000000000LL) ) - { - Unit::AuraMap::iterator iter; - while((iter = _player->m_Auras.find(Unit::spellEffectPair(spellId, 1))) != _player->m_Auras.end()) - { - _player->m_modAuras[SPELL_AURA_DUMMY].remove(iter->second); - - Aura* Aur = iter->second; - _player->m_Auras.erase(iter); - ++_player->m_removedAuras; // internal count used by unit update - - delete Aur; - - if( _player->m_Auras.empty() ) - iter = _player->m_Auras.end(); - else - iter = _player->m_Auras.begin(); - - } - } + // lifebloom must delete final heal effect + if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && (spellInfo->SpellFamilyFlags & 0x1000000000LL) ) + { + Unit::AuraMap::iterator iter; + while((iter = _player->m_Auras.find(Unit::spellEffectPair(spellId, 1))) != _player->m_Auras.end()) + { + _player->m_modAuras[SPELL_AURA_DUMMY].remove(iter->second); + + Aura* Aur = iter->second; + _player->m_Auras.erase(iter); + ++_player->m_removedAuras; // internal count used by unit update + + delete Aur; + + if( _player->m_Auras.empty() ) + iter = _player->m_Auras.end(); + else + iter = _player->m_Auras.begin(); + + } + } // channeled spell case (it currently casted then) if(IsChanneledSpell(spellInfo)) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 36d1cf391d4..435481de949 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2192,29 +2192,29 @@ void SpellMgr::LoadSpellCustomAttr() break; case 41376: // Spite case 39992: // Needle Spine - case 29576: //Multi-Shot - case 40816: //Saber Lash - case 37790: //Spread Shot - case 46771: //Flame Sear - case 45248: //Shadow Blades + case 29576: //Multi-Shot + case 40816: //Saber Lash + case 37790: //Spread Shot + case 46771: //Flame Sear + case 45248: //Shadow Blades case 41303: // Soul Drain spellInfo->MaxAffectedTargets = 3; break; - case 38310: //Multi-Shot - spellInfo->MaxAffectedTargets = 4; - break; + case 38310: //Multi-Shot + spellInfo->MaxAffectedTargets = 4; + break; case 42005: // Bloodboil - case 38296: //Spitfire Totem - case 37676: //Insidious Whisper - case 46009: //Negative Energy + case 38296: //Spitfire Totem + case 37676: //Insidious Whisper + case 46009: //Negative Energy spellInfo->MaxAffectedTargets = 5; break; - case 40827: //Sinful Beam - case 40859: //Sinister Beam - case 40860: //Vile Beam - case 40861: //Wicked Beam - spellInfo->MaxAffectedTargets = 10; - break; + case 40827: //Sinful Beam + case 40859: //Sinister Beam + case 40860: //Vile Beam + case 40861: //Wicked Beam + spellInfo->MaxAffectedTargets = 10; + break; case 8122: case 8124: case 10888: case 10890: // Psychic Scream case 12494: // Frostbite spellInfo->Attributes |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; diff --git a/src/game/TicketHandler.cpp b/src/game/TicketHandler.cpp index 23a6331b20d..5d6b1e095fa 100644 --- a/src/game/TicketHandler.cpp +++ b/src/game/TicketHandler.cpp @@ -33,158 +33,158 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data ) { - // always do a packet check + // always do a packet check CHECK_PACKET_SIZE(recv_data, 4*4+1+2*4); - uint32 map; + uint32 map; float x, y, z; std::string ticketText = ""; - std::string ticketText2 = ""; - GM_Ticket *ticket = new GM_Ticket; + std::string ticketText2 = ""; + GM_Ticket *ticket = new GM_Ticket; - WorldPacket data(SMSG_GMTICKET_CREATE, 4); + WorldPacket data(SMSG_GMTICKET_CREATE, 4); - // recv Data - //TODO: Add map coordinates to tickets. + // recv Data + //TODO: Add map coordinates to tickets. recv_data >> map; recv_data >> x; recv_data >> y; recv_data >> z; recv_data >> ticketText; - // get additional data, rarely used - recv_data >> ticketText2; + // get additional data, rarely used + recv_data >> ticketText2; - // assign values - ticket->name = GetPlayer()->GetName(); - ticket->guid = ticketmgr.GenerateTicketID(); - ticket->playerGuid = GetPlayer()->GetGUID(); - ticket->message = ticketText; - ticket->timestamp = time(NULL); - ticket->closed = 0; - ticket->assignedToGM = 0; - ticket->comment = ""; + // assign values + ticket->name = GetPlayer()->GetName(); + ticket->guid = ticketmgr.GenerateTicketID(); + ticket->playerGuid = GetPlayer()->GetGUID(); + ticket->message = ticketText; + ticket->timestamp = time(NULL); + ticket->closed = 0; + ticket->assignedToGM = 0; + ticket->comment = ""; - // remove ticket by player, shouldn't happen - ticketmgr.RemoveGMTicketByPlayer(GetPlayer()->GetGUID(), GetPlayer()->GetGUID()); + // remove ticket by player, shouldn't happen + ticketmgr.RemoveGMTicketByPlayer(GetPlayer()->GetGUID(), GetPlayer()->GetGUID()); - // add ticket - ticketmgr.AddGMTicket(ticket, false); + // add ticket + ticketmgr.AddGMTicket(ticket, false); - // Response - no errors - data << uint32(2); + // Response - no errors + data << uint32(2); - // Send ticket creation - SendPacket(&data); + // Send ticket creation + SendPacket(&data); - sWorld.SendGMText(LANG_COMMAND_TICKETNEW, ticket->name.c_str(), ticket->guid); + sWorld.SendGMText(LANG_COMMAND_TICKETNEW, ticket->name.c_str(), ticket->guid); } void WorldSession::HandleGMTicketUpdateOpcode( WorldPacket & recv_data) { - // always do a packet check - CHECK_PACKET_SIZE(recv_data,1); + // always do a packet check + CHECK_PACKET_SIZE(recv_data,1); - std::string message = ""; - time_t t = time(NULL); + std::string message = ""; + time_t t = time(NULL); - WorldPacket data(SMSG_GMTICKET_UPDATETEXT, 4); + WorldPacket data(SMSG_GMTICKET_UPDATETEXT, 4); - // recv Data - recv_data >> message; + // recv Data + recv_data >> message; - // Update Ticket - GM_Ticket *ticket = ticketmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()); + // Update Ticket + GM_Ticket *ticket = ticketmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()); - // Check if player has a GM Ticket yet - if(!ticket) - { - // Response - error couldnt find existing Ticket - data << uint32(1); + // Check if player has a GM Ticket yet + if(!ticket) + { + // Response - error couldnt find existing Ticket + data << uint32(1); - // Send packet - SendPacket(&data); - return; - } + // Send packet + SendPacket(&data); + return; + } - ticket->message = message; - ticket->timestamp = (uint32)t; + ticket->message = message; + ticket->timestamp = (uint32)t; - ticketmgr.UpdateGMTicket(ticket); + ticketmgr.UpdateGMTicket(ticket); - // Response - no errors - data << uint32(2); + // Response - no errors + data << uint32(2); - // Send packet - SendPacket(&data); + // Send packet + SendPacket(&data); - sWorld.SendGMText(LANG_COMMAND_TICKETUPDATED, GetPlayer()->GetName(), ticket->guid); + sWorld.SendGMText(LANG_COMMAND_TICKETUPDATED, GetPlayer()->GetName(), ticket->guid); } void WorldSession::HandleGMTicketDeleteOpcode( WorldPacket & /*recv_data*/) { - // NO recv_data, NO packet check size + // NO recv_data, NO packet check size - GM_Ticket* ticket = ticketmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()); + GM_Ticket* ticket = ticketmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()); - // CHeck for Ticket - if(ticket) - { - // Remove Tickets from Player + // CHeck for Ticket + if(ticket) + { + // Remove Tickets from Player - // Response - no errors - WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4); - data << uint32(9); - // Send Packet - SendPacket(&data); + // Response - no errors + WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4); + data << uint32(9); + // Send Packet + SendPacket(&data); - sWorld.SendGMText(LANG_COMMAND_TICKETPLAYERABANDON, GetPlayer()->GetName(), ticket->guid ); - ticketmgr.RemoveGMTicketByPlayer(GetPlayer()->GetGUID(), GetPlayer()->GetGUID()); - } + sWorld.SendGMText(LANG_COMMAND_TICKETPLAYERABANDON, GetPlayer()->GetName(), ticket->guid ); + ticketmgr.RemoveGMTicketByPlayer(GetPlayer()->GetGUID(), GetPlayer()->GetGUID()); + } } void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/) { - // NO recv_data NO packet size check + // NO recv_data NO packet size check - WorldPacket data(SMSG_GMTICKET_GETTICKET, 400); + WorldPacket data(SMSG_GMTICKET_GETTICKET, 400); - // get Current Ticket - GM_Ticket *ticket = ticketmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()); + // get Current Ticket + GM_Ticket *ticket = ticketmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()); - // check for existing ticket - if(!ticket) - { - data << uint32(10); - // send packet - SendPacket(&data); - return; - } + // check for existing ticket + if(!ticket) + { + data << uint32(10); + // send packet + SendPacket(&data); + return; + } - // Send current Ticket - data << uint32(6); // unk ? - data << ticket->message.c_str(); + // Send current Ticket + data << uint32(6); // unk ? + data << ticket->message.c_str(); - SendPacket(&data); + SendPacket(&data); } void WorldSession::HandleGMTicketSystemStatusOpcode( WorldPacket & /*recv_data*/) { - // NO recv_data NO packet size check + // NO recv_data NO packet size check - WorldPacket data(SMSG_GMTICKET_SYSTEMSTATUS, 4); + WorldPacket data(SMSG_GMTICKET_SYSTEMSTATUS, 4); - // Response - System is working Fine + // Response - System is working Fine - // No need for checks, ticket system is active - // in case of disactivity, this should be set to (0) + // No need for checks, ticket system is active + // in case of disactivity, this should be set to (0) - data << uint32(1); + data << uint32(1); - // Send Packet - SendPacket(&data); + // Send Packet + SendPacket(&data); } diff --git a/src/game/TicketMgr.cpp b/src/game/TicketMgr.cpp index 571a872ac2b..09d975ccf21 100644 --- a/src/game/TicketMgr.cpp +++ b/src/game/TicketMgr.cpp @@ -30,179 +30,179 @@ INSTANTIATE_SINGLETON_1( TicketMgr ); GM_Ticket* TicketMgr::GetGMTicket(uint64 ticketGuid) { - for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) - { - if((*i)->guid == ticketGuid) - { - return (*i); - } - ++i; - } - return NULL; + for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) + { + if((*i)->guid == ticketGuid) + { + return (*i); + } + ++i; + } + return NULL; } GM_Ticket* TicketMgr::GetGMTicketByPlayer(uint64 playerGuid) { - for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) - { - if((*i)->playerGuid == playerGuid && (*i)->closed == 0) - { - return (*i); - } - ++i; - } - return NULL; + for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) + { + if((*i)->playerGuid == playerGuid && (*i)->closed == 0) + { + return (*i); + } + ++i; + } + return NULL; } GM_Ticket* TicketMgr::GetGMTicketByName(const char* name) { - std::string pname = name; - if(!normalizePlayerName(pname)) - return NULL; - - Player *plr = objmgr.GetPlayer(pname.c_str()); - if(!plr) - return NULL; - - uint64 playerGuid = plr->GetGUID(); - - for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) - { - if((*i)->playerGuid == playerGuid && (*i)->closed == 0) - { - return (*i); - } - ++i; - } - return NULL; + std::string pname = name; + if(!normalizePlayerName(pname)) + return NULL; + + Player *plr = objmgr.GetPlayer(pname.c_str()); + if(!plr) + return NULL; + + uint64 playerGuid = plr->GetGUID(); + + for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) + { + if((*i)->playerGuid == playerGuid && (*i)->closed == 0) + { + return (*i); + } + ++i; + } + return NULL; } void TicketMgr::AddGMTicket(GM_Ticket *ticket, bool startup) { - ASSERT( ticket ); - GM_TicketList.push_back(ticket); + ASSERT( ticket ); + GM_TicketList.push_back(ticket); - // save - if(!startup) - SaveGMTicket(ticket); + // save + if(!startup) + SaveGMTicket(ticket); } void TicketMgr::DeleteGMTicketPermanently(uint64 ticketGuid) { - for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) - { - if((*i)->guid == ticketGuid) - { - i = GM_TicketList.erase(i); - } - else - { - ++i; - } - } - - // delete database record - CharacterDatabase.PExecute("DELETE FROM `gm_tickets` WHERE guid= '%u'", ticketGuid); + for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) + { + if((*i)->guid == ticketGuid) + { + i = GM_TicketList.erase(i); + } + else + { + ++i; + } + } + + // delete database record + CharacterDatabase.PExecute("DELETE FROM `gm_tickets` WHERE guid= '%u'", ticketGuid); } void TicketMgr::LoadGMTickets() { - InitTicketID(); - // Delete all out of object holder - GM_TicketList.clear(); - QueryResult *result = CharacterDatabase.Query( "SELECT `guid`, `playerGuid`, `name`, `message`, `timestamp`, `closed`, `assignedto`, `comment` FROM `gm_tickets`" ); - GM_Ticket *ticket; - - if(!result) - return; - - // Assign values from SQL to the object holder - do - { - Field *fields = result->Fetch(); - ticket = new GM_Ticket; - ticket->guid = fields[0].GetUInt64(); - ticket->playerGuid = fields[1].GetUInt64(); - ticket->name = fields[2].GetString(); - ticket->message = fields[3].GetString(); - ticket->timestamp = fields[4].GetUInt32(); - ticket->closed = fields[5].GetUInt16(); - ticket->assignedToGM = fields[6].GetUInt64(); - ticket->comment = fields[7].GetString(); - - AddGMTicket(ticket, true); - - } while( result->NextRow() ); - - sWorld.SendGMText(LANG_COMMAND_TICKETRELOAD, result->GetRowCount()); - - delete result; + InitTicketID(); + // Delete all out of object holder + GM_TicketList.clear(); + QueryResult *result = CharacterDatabase.Query( "SELECT `guid`, `playerGuid`, `name`, `message`, `timestamp`, `closed`, `assignedto`, `comment` FROM `gm_tickets`" ); + GM_Ticket *ticket; + + if(!result) + return; + + // Assign values from SQL to the object holder + do + { + Field *fields = result->Fetch(); + ticket = new GM_Ticket; + ticket->guid = fields[0].GetUInt64(); + ticket->playerGuid = fields[1].GetUInt64(); + ticket->name = fields[2].GetString(); + ticket->message = fields[3].GetString(); + ticket->timestamp = fields[4].GetUInt32(); + ticket->closed = fields[5].GetUInt16(); + ticket->assignedToGM = fields[6].GetUInt64(); + ticket->comment = fields[7].GetString(); + + AddGMTicket(ticket, true); + + } while( result->NextRow() ); + + sWorld.SendGMText(LANG_COMMAND_TICKETRELOAD, result->GetRowCount()); + + delete result; } void TicketMgr::RemoveGMTicket(uint64 ticketGuid, uint64 GMguid) { - for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) - { - if((*i)->guid == ticketGuid && (*i)->closed == 0) - { - (*i)->closed = GMguid; - SaveGMTicket((*i)); - } - ++i; - } + for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) + { + if((*i)->guid == ticketGuid && (*i)->closed == 0) + { + (*i)->closed = GMguid; + SaveGMTicket((*i)); + } + ++i; + } } void TicketMgr::RemoveGMTicketByPlayer(uint64 playerGuid, uint64 GMguid) { - for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) - { - if((*i)->playerGuid == playerGuid && (*i)->closed == 0) - { - (*i)->closed = GMguid; - SaveGMTicket((*i)); - } - ++i; - } + for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();) + { + if((*i)->playerGuid == playerGuid && (*i)->closed == 0) + { + (*i)->closed = GMguid; + SaveGMTicket((*i)); + } + ++i; + } } void TicketMgr::SaveGMTicket(GM_Ticket* ticket) { - std::string msg = ticket->message; + std::string msg = ticket->message; CharacterDatabase.escape_string(msg); - std::stringstream ss; - ss << "REPLACE INTO `gm_tickets` (`guid`, `playerGuid`, `name`, `message`, `timestamp`, `closed`, `assignedto`, `comment`) VALUES('"; - ss << ticket->guid << "', '"; - ss << ticket->playerGuid << "', '"; - ss << ticket->name << "', '"; - ss << msg << "', '" ; - ss << ticket->timestamp << "', '"; - ss << ticket->closed << "', '"; - ss << ticket->assignedToGM << "', '"; - ss << ticket->comment << "');"; + std::stringstream ss; + ss << "REPLACE INTO `gm_tickets` (`guid`, `playerGuid`, `name`, `message`, `timestamp`, `closed`, `assignedto`, `comment`) VALUES('"; + ss << ticket->guid << "', '"; + ss << ticket->playerGuid << "', '"; + ss << ticket->name << "', '"; + ss << msg << "', '" ; + ss << ticket->timestamp << "', '"; + ss << ticket->closed << "', '"; + ss << ticket->assignedToGM << "', '"; + ss << ticket->comment << "');"; CharacterDatabase.BeginTransaction(); - CharacterDatabase.Execute(ss.str().c_str()); - CharacterDatabase.CommitTransaction(); + CharacterDatabase.Execute(ss.str().c_str()); + CharacterDatabase.CommitTransaction(); } void TicketMgr::UpdateGMTicket(GM_Ticket *ticket) { - SaveGMTicket(ticket); + SaveGMTicket(ticket); } void TicketMgr::InitTicketID() { - QueryResult *result = CharacterDatabase.Query("SELECT MAX(guid) FROM gm_tickets"); - if(result) - { - m_ticketid = result->Fetch()[0].GetUInt64(); - delete result; - } + QueryResult *result = CharacterDatabase.Query("SELECT MAX(guid) FROM gm_tickets"); + if(result) + { + m_ticketid = result->Fetch()[0].GetUInt64(); + delete result; + } } uint64 TicketMgr::GenerateTicketID() { - return ++m_ticketid; + return ++m_ticketid; } diff --git a/src/game/TicketMgr.h b/src/game/TicketMgr.h index ea5f997f3cc..f8a0632c0ca 100644 --- a/src/game/TicketMgr.h +++ b/src/game/TicketMgr.h @@ -29,14 +29,14 @@ struct GM_Ticket { - uint64 guid; - uint64 playerGuid; - std::string name; - std::string message; - uint64 timestamp; - uint16 closed; - uint64 assignedToGM; - std::string comment; + uint64 guid; + uint64 playerGuid; + std::string name; + std::string message; + uint64 timestamp; + uint16 closed; + uint64 assignedToGM; + std::string comment; }; // Map Typedef @@ -44,31 +44,31 @@ typedef std::list GmTicketList class TicketMgr { - public: - TicketMgr(){m_ticketid = 1;} //constructor - ~TicketMgr(){} //destructor + public: + TicketMgr(){m_ticketid = 1;} //constructor + ~TicketMgr(){} //destructor - // Object Holder - GmTicketList GM_TicketList; + // Object Holder + GmTicketList GM_TicketList; - void AddGMTicket(GM_Ticket *ticket, bool startup); - void DeleteAllRemovedGMTickets(); - void DeleteGMTicketPermanently(uint64 ticketGuid); - void LoadGMTickets(); - void RemoveGMTicketByPlayer(uint64 playerGuid, uint64 GMguid); - void RemoveGMTicket(uint64 ticketGuid, uint64 GMguid); - void UpdateGMTicket(GM_Ticket *ticket); - void SaveGMTicket(GM_Ticket* ticket); + void AddGMTicket(GM_Ticket *ticket, bool startup); + void DeleteAllRemovedGMTickets(); + void DeleteGMTicketPermanently(uint64 ticketGuid); + void LoadGMTickets(); + void RemoveGMTicketByPlayer(uint64 playerGuid, uint64 GMguid); + void RemoveGMTicket(uint64 ticketGuid, uint64 GMguid); + void UpdateGMTicket(GM_Ticket *ticket); + void SaveGMTicket(GM_Ticket* ticket); - uint64 GenerateTicketID(); - void InitTicketID(); - GM_Ticket* GetGMTicket(uint64 ticketGuid); - GM_Ticket* GetGMTicketByPlayer(uint64 playerGuid); - GM_Ticket* GetGMTicketByName(const char *name); + uint64 GenerateTicketID(); + void InitTicketID(); + GM_Ticket* GetGMTicket(uint64 ticketGuid); + GM_Ticket* GetGMTicketByPlayer(uint64 playerGuid); + GM_Ticket* GetGMTicketByName(const char *name); - protected: - uint64 m_ticketid; + protected: + uint64 m_ticketid; }; #endif diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp index 42130a6d0de..b2ed69fe251 100644 --- a/src/game/Transports.cpp +++ b/src/game/Transports.cpp @@ -402,8 +402,8 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) // sLog.outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport); /* - if(keyFrames[i+1].delay > 5) - pos.delayed = true; + if(keyFrames[i+1].delay > 5) + pos.delayed = true; */ //if (teleport) m_WayPoints[t] = pos; @@ -489,9 +489,9 @@ bool Transport::RemovePassenger(Player* passenger) void Transport::CheckForEvent(uint32 entry, uint32 wp_id) { - uint32 key = entry*100+wp_id; - if(objmgr.TransportEventMap.find(key) != objmgr.TransportEventMap.end()) - sWorld.ScriptsStart(sEventScripts, objmgr.TransportEventMap[key], this, NULL); + uint32 key = entry*100+wp_id; + if(objmgr.TransportEventMap.find(key) != objmgr.TransportEventMap.end()) + sWorld.ScriptsStart(sEventScripts, objmgr.TransportEventMap[key], this, NULL); } void Transport::Update(uint32 /*p_time*/) @@ -516,25 +516,25 @@ void Transport::Update(uint32 /*p_time*/) Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z); } /* - if(m_curr->second.delayed) - { - switch (GetEntry()) - { - case 176495: - case 164871: - case 175080: - SendPlaySound(11804, false); break; // ZeppelinDocked - case 20808: - case 181646: - case 176231: - case 176244: - case 176310: - case 177233: - SendPlaySound(5495, false);break; // BoatDockingWarning - default: - SendPlaySound(5154, false); break; // ShipDocked - } - } + if(m_curr->second.delayed) + { + switch (GetEntry()) + { + case 176495: + case 164871: + case 175080: + SendPlaySound(11804, false); break; // ZeppelinDocked + case 20808: + case 181646: + case 176231: + case 176244: + case 176310: + case 177233: + SendPlaySound(5495, false);break; // BoatDockingWarning + default: + SendPlaySound(5154, false); break; // ShipDocked + } + } */ /* for(PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end();) @@ -557,8 +557,8 @@ void Transport::Update(uint32 /*p_time*/) if ((sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES)==0) sLog.outDetail("%s moved to %f %f %f %d", this->m_name.c_str(), m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid); - //Transport Event System - CheckForEvent(this->GetEntry(), m_curr->second.id); - sLog.outDetail("%s is at wp id: %u", this->m_name.c_str(), m_curr->second.id); - } + //Transport Event System + CheckForEvent(this->GetEntry(), m_curr->second.id); + sLog.outDetail("%s is at wp id: %u", this->m_name.c_str(), m_curr->second.id); + } } diff --git a/src/game/Transports.h b/src/game/Transports.h index 5fb15dbe98f..e49383ad1de 100644 --- a/src/game/Transports.h +++ b/src/game/Transports.h @@ -78,7 +78,7 @@ class Transport : private GameObject void Update(uint32 p_time); bool AddPassenger(Player* passenger); bool RemovePassenger(Player* passenger); - void CheckForEvent(uint32 entry, uint32 wp_id); + void CheckForEvent(uint32 entry, uint32 wp_id); typedef std::set PlayerSet; PlayerSet const& GetPassengers() const { return m_passengers; } @@ -95,7 +95,7 @@ class Transport : private GameObject float y; float z; bool teleport; - uint32 id; + uint32 id; }; typedef std::map WayPointMap; diff --git a/src/game/Traveller.h b/src/game/Traveller.h index 8d7dda0e055..64b9d1c310d 100644 --- a/src/game/Traveller.h +++ b/src/game/Traveller.h @@ -80,11 +80,11 @@ template<> inline void Traveller::MoveTo(float x, float y, float z, uint32 t) { //Call for creature group update - if(i_traveller.IsFormationLeader() && !i_traveller.isInCombat() && - CreatureGroupHolder.find(i_traveller.GetFormationID()) != CreatureGroupHolder.end()) - CreatureGroupHolder[i_traveller.GetFormationID()]->LeaderMovedInEvade(); + if(i_traveller.IsFormationLeader() && !i_traveller.isInCombat() && + CreatureGroupHolder.find(i_traveller.GetFormationID()) != CreatureGroupHolder.end()) + CreatureGroupHolder[i_traveller.GetFormationID()]->LeaderMovedInEvade(); - i_traveller.AI_SendMoveToPacket(x, y, z, t, i_traveller.GetUnitMovementFlags(), 0); + i_traveller.AI_SendMoveToPacket(x, y, z, t, i_traveller.GetUnitMovementFlags(), 0); } // specialization for players diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index a68c93c909c..234922f040e 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -478,9 +478,9 @@ void Unit::GetRandomContactPoint( const Unit* obj, float &x, float &y, float &z, // sLog.outError("Creature entry %u has invalid combat_reach", ((Creature*)this)->GetEntry()); combat_reach = DEFAULT_COMBAT_REACH; } - uint32 attacker_number = getAttackers().size(); + uint32 attacker_number = getAttackers().size(); if(attacker_number > 0) --attacker_number; - GetNearPoint(obj,x,y,z,obj->GetCombatReach(), distance2dMin+(distance2dMax-distance2dMin)*rand_norm() + GetNearPoint(obj,x,y,z,obj->GetCombatReach(), distance2dMin+(distance2dMax-distance2dMin)*rand_norm() , GetAngle(obj) + (attacker_number ? (M_PI/2 - M_PI * rand_norm()) * (float)attacker_number / combat_reach / 3 : 0)); } @@ -600,34 +600,34 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa //Script Event damage taken if( pVictim->GetTypeId()== TYPEID_UNIT && ((Creature *)pVictim)->AI() ) - { - ((Creature *)pVictim)->AI()->DamageTaken(this, damage); - - // Set tagging - if(!pVictim->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER) && !((Creature*)pVictim)->isPet()) - { - //Set Loot - switch(GetTypeId()) - { - case TYPEID_PLAYER: - { - ((Creature *)pVictim)->SetLootRecipient(this); - //Set tagged - ((Creature *)pVictim)->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER); - break; - } - case TYPEID_UNIT: - { - if(((Creature*)this)->isPet()) - { - ((Creature *)pVictim)->SetLootRecipient(this->GetOwner()); - ((Creature *)pVictim)->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER); - } - break; - } - } - } - } + { + ((Creature *)pVictim)->AI()->DamageTaken(this, damage); + + // Set tagging + if(!pVictim->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER) && !((Creature*)pVictim)->isPet()) + { + //Set Loot + switch(GetTypeId()) + { + case TYPEID_PLAYER: + { + ((Creature *)pVictim)->SetLootRecipient(this); + //Set tagged + ((Creature *)pVictim)->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER); + break; + } + case TYPEID_UNIT: + { + if(((Creature*)this)->isPet()) + { + ((Creature *)pVictim)->SetLootRecipient(this->GetOwner()); + ((Creature *)pVictim)->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER); + } + break; + } + } + } + } if (damagetype != NODAMAGE) { @@ -3578,7 +3578,7 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target) if(attType != BASE_ATTACK && !item ) { if(attType == RANGED_ATTACK && getClass() == CLASS_PALADIN) //hammer - return GetMaxSkillValueForLevel(); + return GetMaxSkillValueForLevel(); return 0; } @@ -4096,7 +4096,7 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_ for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) { Modifier* mod = (*i)->GetModifier(); - int32 amount = (*i)->GetModifierValue(); + int32 amount = (*i)->GetModifierValue(); if (mod->m_miscvalue == misc_value && amount < modifier) modifier = amount; } @@ -4137,9 +4137,9 @@ bool Unit::AddAura(Aura *Aur) // replace aura if next will > spell StackAmount if(aurSpellInfo->StackAmount) { - Aur->SetStackAmount(i->second->GetStackAmount()); - if(Aur->GetStackAmount() < aurSpellInfo->StackAmount) - Aur->SetStackAmount(Aur->GetStackAmount()+1); + Aur->SetStackAmount(i->second->GetStackAmount()); + if(Aur->GetStackAmount() < aurSpellInfo->StackAmount) + Aur->SetStackAmount(Aur->GetStackAmount()+1); RemoveAura(i,AURA_REMOVE_BY_STACK); } // if StackAmount==0 not allow auras from same caster @@ -4509,27 +4509,27 @@ void Unit::RemoveAurasWithDispelType( DispelType type ) void Unit::RemoveSingleAuraFromStackByDispel(uint32 spellId) { - for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); ) + for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); ) { Aura *aur = iter->second; if (aur->GetId() == spellId) { - if(iter->second->GetStackAmount() > 1) + if(iter->second->GetStackAmount() > 1) { // reapply modifier with reduced stack amount iter->second->ApplyModifier(false,true); - iter->second->SetStackAmount(iter->second->GetStackAmount()-1); + iter->second->SetStackAmount(iter->second->GetStackAmount()-1); iter->second->ApplyModifier(true,true); iter->second->UpdateSlotCounterAndDuration(); return; // not remove aura if stack amount > 1 } - else + else RemoveAura(iter,AURA_REMOVE_BY_DISPEL); - } - else - ++iter; - } + } + else + ++iter; + } } void Unit::RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex) @@ -4537,18 +4537,18 @@ void Unit::RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex) AuraMap::iterator iter = m_Auras.find(spellEffectPair(spellId, effindex)); if(iter != m_Auras.end()) { - if(iter->second->GetStackAmount() > 1) + if(iter->second->GetStackAmount() > 1) { // reapply modifier with reduced stack amount iter->second->ApplyModifier(false,true); - iter->second->SetStackAmount(iter->second->GetStackAmount()-1); + iter->second->SetStackAmount(iter->second->GetStackAmount()-1); iter->second->ApplyModifier(true,true); iter->second->UpdateSlotCounterAndDuration(); return; // not remove aura if stack amount > 1 } RemoveAura(iter); - } + } } void Unit::RemoveAurasDueToSpell(uint32 spellId, Aura* except) @@ -4704,7 +4704,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) assert(!Aur->IsInUse()); Aur->ApplyModifier(false,true); - Aur->SetStackAmount(0); + Aur->SetStackAmount(0); Aur->_RemoveAura(); @@ -8693,22 +8693,22 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 switch(spellProto->SpellFamilyName) { - case SPELLFAMILY_GENERIC: - // Siphon Essence - 0% - if(spellProto->AttributesEx == 268435456 && spellProto->SpellIconID == 2027) - { - CastingTime = 0; - } - // Goblin Rocket Launcher - 0% - else if (spellProto->SpellIconID == 184 && spellProto->Attributes == 4259840) - { - CastingTime = 0; - } - // Darkmoon Card: Vengeance - 0.1% - else if (spellProto->SpellVisual == 9850 && spellProto->SpellIconID == 2230) - { - CastingTime = 3.5; - } + case SPELLFAMILY_GENERIC: + // Siphon Essence - 0% + if(spellProto->AttributesEx == 268435456 && spellProto->SpellIconID == 2027) + { + CastingTime = 0; + } + // Goblin Rocket Launcher - 0% + else if (spellProto->SpellIconID == 184 && spellProto->Attributes == 4259840) + { + CastingTime = 0; + } + // Darkmoon Card: Vengeance - 0.1% + else if (spellProto->SpellVisual == 9850 && spellProto->SpellIconID == 2230) + { + CastingTime = 3.5; + } case SPELLFAMILY_MAGE: // Ignite - do not modify, it is (8*Rank)% damage of procing Spell if(spellProto->Id==12654) @@ -9139,7 +9139,7 @@ uint32 Unit::SpellHealingBonus(SpellEntry const *spellProto, uint32 healamount, if (spellProto->Id == 15290 || spellProto->Id == 39373 || spellProto->Id == 33778 || spellProto->Id == 379 || spellProto->Id == 38395 || spellProto->Id == 40972 || - spellProto->Id == 22845 || spellProto->Id == 33504 || + spellProto->Id == 22845 || spellProto->Id == 33504 || spellProto->Id == 34299) return healamount; @@ -9244,12 +9244,12 @@ uint32 Unit::SpellHealingBonus(SpellEntry const *spellProto, uint32 healamount, DotFactor = damagetype == DOT ? 0.705f : 1.0f; CastingTime = damagetype == DOT ? 3500 : 1010; } - // Improved Leader of the Pack - else if (spellProto->AttributesEx2 == 536870912 && spellProto->SpellIconID == 312 - && spellProto->AttributesEx3 == 33554432) - { - CastingTime = 0; - } + // Improved Leader of the Pack + else if (spellProto->AttributesEx2 == 536870912 && spellProto->SpellIconID == 312 + && spellProto->AttributesEx3 == 33554432) + { + CastingTime = 0; + } break; case SPELLFAMILY_PRIEST: // Holy Nova - 14% diff --git a/src/game/Unit.h b/src/game/Unit.h index 4edbd4eb2ac..7050121c5bb 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1105,7 +1105,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); void RemoveAura(uint32 spellId, uint32 effindex, Aura* except = NULL); void RemoveSingleAuraFromStackByDispel(uint32 spellId); - void RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex); + void RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex); void RemoveAurasDueToSpell(uint32 spellId, Aura* except = NULL); void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId); void RemoveAurasDueToCasterSpell(uint32 spellId, uint64 guid); diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp index b5a83422ef5..8a9de3849c4 100644 --- a/src/game/WaypointManager.cpp +++ b/src/game/WaypointManager.cpp @@ -29,7 +29,7 @@ WaypointStore WaypointMgr; void WaypointStore::Free() { - waypoint_map.clear(); + waypoint_map.clear(); } void WaypointStore::Load() @@ -41,10 +41,10 @@ void WaypointStore::Load() exit(1); // Stop server at loading non exited table or not accessable table } - records = (*result)[0].GetUInt32(); + records = (*result)[0].GetUInt32(); delete result; - result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` ORDER BY `id`, `point`"); + result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` ORDER BY `id`, `point`"); if(!result) { sLog.outErrorDb("The table `creature_addon` is empty or corrupted"); @@ -54,21 +54,21 @@ void WaypointStore::Load() WaypointPath* path_data; uint32 total_records = result->GetRowCount(); - barGoLink bar( total_records); + barGoLink bar( total_records); Field *fields; uint32 last_id = 0; - do + do { fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); bar.step(); WaypointData *wp = new WaypointData; - if(last_id != id) - path_data = new WaypointPath; + if(last_id != id) + path_data = new WaypointPath; - float x,y,z; + float x,y,z; x = fields[2].GetFloat(); y = fields[3].GetFloat(); z = fields[4].GetFloat(); @@ -85,14 +85,14 @@ void WaypointStore::Load() wp->event_id = fields[7].GetUInt32(); wp->event_chance = fields[8].GetUInt8(); - path_data->push_back(wp); + path_data->push_back(wp); - if(id != last_id) - waypoint_map[id] = path_data; + if(id != last_id) + waypoint_map[id] = path_data; - last_id = id; + last_id = id; - } while(result->NextRow()) ; + } while(result->NextRow()) ; delete result; @@ -101,35 +101,35 @@ void WaypointStore::Load() void WaypointStore::UpdatePath(uint32 id) { - if(waypoint_map.find(id)!= waypoint_map.end()) - waypoint_map[id]->clear(); + if(waypoint_map.find(id)!= waypoint_map.end()) + waypoint_map[id]->clear(); - QueryResult *result; + QueryResult *result; result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` WHERE id = %u ORDER BY `point`", id); - if(!result) - return; + if(!result) + return; - WaypointPath* path_data; + WaypointPath* path_data; - path_data = new WaypointPath; + path_data = new WaypointPath; - Field *fields; + Field *fields; - do + do { - fields = result->Fetch(); + fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); WaypointData *wp = new WaypointData; - float x,y,z; + float x,y,z; x = fields[2].GetFloat(); y = fields[3].GetFloat(); z = fields[4].GetFloat(); - Trinity::NormalizeMapCoord(x); + Trinity::NormalizeMapCoord(x); Trinity::NormalizeMapCoord(y); wp->id = fields[1].GetUInt32(); @@ -141,11 +141,11 @@ void WaypointStore::UpdatePath(uint32 id) wp->event_id = fields[7].GetUInt32(); wp->event_chance = fields[8].GetUInt8(); - path_data->push_back(wp); + path_data->push_back(wp); - }while (result->NextRow()); + }while (result->NextRow()); - waypoint_map[id] = path_data; + waypoint_map[id] = path_data; - delete result; + delete result; } diff --git a/src/game/WaypointManager.h b/src/game/WaypointManager.h index 023fa590961..2e1ac25c369 100644 --- a/src/game/WaypointManager.h +++ b/src/game/WaypointManager.h @@ -25,7 +25,7 @@ struct WaypointData { - uint32 id; + uint32 id; float x,y,z; bool run; uint32 delay; @@ -39,21 +39,21 @@ extern UNORDERED_MAP waypoint_map; class WaypointStore { private : - uint32 records; + uint32 records; - public: + public: void UpdatePath(uint32 id); - void Load(); + void Load(); void Free(); WaypointPath* GetPath(uint32 id) { - if(waypoint_map.find(id) != waypoint_map.end()) + if(waypoint_map.find(id) != waypoint_map.end()) return waypoint_map[id]; - else return 0; - } + else return 0; + } - inline uint32 GetRecordsCount() { return records; } + inline uint32 GetRecordsCount() { return records; } }; extern WaypointStore WaypointMgr; diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index a817c75bff1..5a3b1eee8e2 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -62,14 +62,14 @@ bool WaypointMovementGenerator::GetDestination(float &x, float &y, flo template<> bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) const { - return false; + return false; } template<> void WaypointMovementGenerator::Reset(Creature &unit) { - StopedByPlayer = true; - i_nextMoveTime.Reset(0); + StopedByPlayer = true; + i_nextMoveTime.Reset(0); } template<> @@ -78,16 +78,16 @@ void WaypointMovementGenerator::Reset(Player &unit){} template<> void WaypointMovementGenerator::InitTraveller(Creature &unit, const WaypointData &node) { - node.run ? unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE): - unit.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + node.run ? unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE): + unit.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - unit.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - unit.SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + unit.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + unit.SetUInt32Value(UNIT_FIELD_BYTES_1, 0); if(unit.canFly()) - unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); - unit.addUnitState(UNIT_STAT_ROAMING); + unit.addUnitState(UNIT_STAT_ROAMING); } template<> @@ -101,13 +101,13 @@ WaypointMovementGenerator::Initialize(Creature &u) if(!path_id) path_id = u.GetWaypointPath(); waypoints = WaypointMgr.GetPath(path_id); - i_currentNode = 0; + i_currentNode = 0; if(waypoints && waypoints->size()) { node = waypoints->front(); Traveller traveller(u); - InitTraveller(u, *node); - i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); + InitTraveller(u, *node); + i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); } else @@ -121,7 +121,7 @@ template bool WaypointMovementGenerator::Update(T &unit, const uint32 &diff) { - return false; + return false; } template<> @@ -131,84 +131,84 @@ WaypointMovementGenerator::Update(Creature &unit, const uint32 &diff) if(!&unit) return true; - if(!path_id) - return false; + if(!path_id) + return false; - // Waypoint movement can be switched on/off + // Waypoint movement can be switched on/off // This is quite handy for escort quests and other stuff - if(unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) - return true; + if(unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + return true; // Clear the generator if the path doesn't exist if(!waypoints || !waypoints->size()) return false; - Traveller traveller(unit); + Traveller traveller(unit); - i_nextMoveTime.Update(diff); + i_nextMoveTime.Update(diff); i_destinationHolder.UpdateTraveller(traveller, diff, false, true); - if(i_nextMoveTime.Passed()) - { - if(unit.IsStopped()) - { - if(StopedByPlayer) - { + if(i_nextMoveTime.Passed()) + { + if(unit.IsStopped()) + { + if(StopedByPlayer) + { assert(node); - InitTraveller(unit, *node); - i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); - i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); - StopedByPlayer = false; - return true; - } - - if(i_currentNode == waypoints->size() - 1) //If that's our last waypoint - { - if(repeating) //If the movement is repeating - i_currentNode = 0; //Start moving all over again - else - { - unit.SetHomePosition(node->x, node->y, node->z, unit.GetOrientation()); - unit.GetMotionMaster()->Initialize(); - return false; //Clear the waypoint movement - } - } - else - i_currentNode++; - - node = waypoints->at(i_currentNode); - InitTraveller(unit, *node); - i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); - i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); - } - else - { - //Determine waittime - if(node->delay) - i_nextMoveTime.Reset(node->delay); - - if(node->event_id && rand()%100 < node->event_chance) - sWorld.ScriptsStart(sWaypointScripts, node->event_id, &unit, NULL); - - MovementInform(unit); - unit.UpdateWaypointID(i_currentNode); - unit.clearUnitState(UNIT_STAT_MOVING); - unit.Relocate(node->x, node->y, node->z); - } + InitTraveller(unit, *node); + i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); + i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); + StopedByPlayer = false; + return true; + } + + if(i_currentNode == waypoints->size() - 1) //If that's our last waypoint + { + if(repeating) //If the movement is repeating + i_currentNode = 0; //Start moving all over again + else + { + unit.SetHomePosition(node->x, node->y, node->z, unit.GetOrientation()); + unit.GetMotionMaster()->Initialize(); + return false; //Clear the waypoint movement + } + } + else + i_currentNode++; + + node = waypoints->at(i_currentNode); + InitTraveller(unit, *node); + i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); + i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); + } + else + { + //Determine waittime + if(node->delay) + i_nextMoveTime.Reset(node->delay); + + if(node->event_id && rand()%100 < node->event_chance) + sWorld.ScriptsStart(sWaypointScripts, node->event_id, &unit, NULL); + + MovementInform(unit); + unit.UpdateWaypointID(i_currentNode); + unit.clearUnitState(UNIT_STAT_MOVING); + unit.Relocate(node->x, node->y, node->z); + } } - else - { - if(unit.IsStopped() && !i_destinationHolder.HasArrived()) - { - if(!StopedByPlayer) - { - i_destinationHolder.IncreaseTravelTime(STOP_TIME_FOR_PLAYER); - i_nextMoveTime.Reset(STOP_TIME_FOR_PLAYER); - StopedByPlayer = true; - } - } - } - return true; + else + { + if(unit.IsStopped() && !i_destinationHolder.HasArrived()) + { + if(!StopedByPlayer) + { + i_destinationHolder.IncreaseTravelTime(STOP_TIME_FOR_PLAYER); + i_nextMoveTime.Reset(STOP_TIME_FOR_PLAYER); + StopedByPlayer = true; + } + } + } + return true; } template void WaypointMovementGenerator::Initialize(Player &); diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h index 7f8ce929ade..b8f72bb5dbf 100644 --- a/src/game/WaypointMovementGenerator.h +++ b/src/game/WaypointMovementGenerator.h @@ -65,23 +65,23 @@ template class TRINITY_DLL_SPEC WaypointMovementGenerator : public MovementGeneratorMedium< T, WaypointMovementGenerator >, public PathMovementBase { - public: - WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : - i_nextMoveTime(0), path_id(_path_id), repeating(_repeating), StopedByPlayer(false), node(NULL) {} + public: + WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : + i_nextMoveTime(0), path_id(_path_id), repeating(_repeating), StopedByPlayer(false), node(NULL) {} - void Initialize(T &); + void Initialize(T &); void Finalize(T &); - void MovementInform(T &); - void InitTraveller(T &, const WaypointData &); - void GeneratePathId(T &); - void Reset(T &unit); + void MovementInform(T &); + void InitTraveller(T &, const WaypointData &); + void GeneratePathId(T &); + void Reset(T &unit); bool Update(T &, const uint32 &); - bool GetDestination(float &x, float &y, float &z) const; - MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; } + bool GetDestination(float &x, float &y, float &z) const; + MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; } - private: - WaypointData *node; - uint32 path_id; + private: + WaypointData *node; + uint32 path_id; TimeTrackerSmall i_nextMoveTime; WaypointPath *waypoints; bool repeating, StopedByPlayer; @@ -112,7 +112,7 @@ public PathMovementBase inline bool HasArrived() const { return (i_currentNode >= i_path.Size()); } void SetCurrentNodeAfterTeleport(); void SkipCurrentNode() { ++i_currentNode; } - bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } + bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } }; #endif diff --git a/src/game/World.cpp b/src/game/World.cpp index 95acb99fef7..e494d041b5f 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -72,7 +72,7 @@ volatile bool World::m_stopEvent = false; uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE; volatile uint32 World::m_worldLoopCounter = 0; -float World::m_MaxVisibleDistance = DEFAULT_VISIBILITY_DISTANCE; +float World::m_MaxVisibleDistance = DEFAULT_VISIBILITY_DISTANCE; float World::m_MaxVisibleDistanceForCreature = DEFAULT_VISIBILITY_DISTANCE; float World::m_MaxVisibleDistanceForPlayer = DEFAULT_VISIBILITY_DISTANCE; float World::m_MaxVisibleDistanceForObject = DEFAULT_VISIBILITY_DISTANCE; @@ -409,7 +409,7 @@ void World::LoadConfigSettings(bool reload) SetPlayerLimit( sConfig.GetIntDefault("PlayerLimit", DEFAULT_PLAYER_LIMIT), true ); SetMotd( sConfig.GetStringDefault("Motd", "Welcome to the Massive Network Game Object Server." ) ); - ///- Get string for new logins (newly created characters) + ///- Get string for new logins (newly created characters) SetNewCharString(sConfig.GetStringDefault("PlayerStart.String", "")); ///- Send server info on login? @@ -1283,10 +1283,10 @@ void World::SetInitialWorldSettings() sLog.outString( "Loading Waypoints..." ); WaypointMgr.Load(); - sLog.outString( "Loading Creature Formations..." ); - formation_mgr.LoadCreatureFormations(); + sLog.outString( "Loading Creature Formations..." ); + formation_mgr.LoadCreatureFormations(); - sLog.outString( "Loading GM tickets..."); + sLog.outString( "Loading GM tickets..."); ticketmgr.LoadGMTickets(); ///- Handle outdated emails (delete/return) @@ -1300,7 +1300,7 @@ void World::SetInitialWorldSettings() objmgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data) objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data) objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data) - objmgr.LoadWaypointScripts(); + objmgr.LoadWaypointScripts(); sLog.outString( "Loading Scripts text locales..." ); // must be after Load*Scripts calls objmgr.LoadDbScriptStrings(); @@ -1362,8 +1362,8 @@ void World::SetInitialWorldSettings() sLog.outString( "Loading Transports..." ); MapManager::Instance().LoadTransports(); - sLog.outString( "Loading Transports Events..." ); - objmgr.LoadTransportEvents(); + sLog.outString( "Loading Transports Events..." ); + objmgr.LoadTransportEvents(); sLog.outString("Deleting expired bans..." ); LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate"); @@ -1660,7 +1660,7 @@ void World::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, return; // prepare static data - uint64 sourceGUID = source ? source->GetGUID() : (uint64)0; //some script commands doesn't have source + uint64 sourceGUID = source ? source->GetGUID() : (uint64)0; //some script commands doesn't have source uint64 targetGUID = target ? target->GetGUID() : (uint64)0; uint64 ownerGUID = (source->GetTypeId()==TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0; @@ -1743,22 +1743,22 @@ void World::ScriptsProcess() source = HashMapHolder::Find(step.sourceGUID); break; case HIGHGUID_GAMEOBJECT: - source = HashMapHolder::Find(step.sourceGUID); + source = HashMapHolder::Find(step.sourceGUID); break; case HIGHGUID_CORPSE: source = HashMapHolder::Find(step.sourceGUID); break; - case HIGHGUID_MO_TRANSPORT: - for (MapManager::TransportSet::iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter) - { - if((*iter)->GetGUID() == step.sourceGUID) - { - source = reinterpret_cast(*iter); - break; - } - } - break; - default: + case HIGHGUID_MO_TRANSPORT: + for (MapManager::TransportSet::iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter) + { + if((*iter)->GetGUID() == step.sourceGUID) + { + source = reinterpret_cast(*iter); + break; + } + } + break; + default: sLog.outError("*_script source with unsupported high guid value %u",GUID_HIPART(step.sourceGUID)); break; } @@ -2300,9 +2300,9 @@ void World::ScriptsProcess() break; } - case SCRIPT_COMMAND_LOAD_PATH: - { - if(!source) + case SCRIPT_COMMAND_LOAD_PATH: + { + if(!source) { sLog.outError("SCRIPT_COMMAND_START_MOVE is tried to apply to NON-existing unit."); break; @@ -2314,98 +2314,98 @@ void World::ScriptsProcess() break; } - if(!WaypointMgr.GetPath(step.script->datalong)) - { + if(!WaypointMgr.GetPath(step.script->datalong)) + { sLog.outError("SCRIPT_COMMAND_START_MOVE source mover has an invallid path, skipping.", step.script->datalong2); break; } - dynamic_cast(source)->GetMotionMaster()->MovePath(step.script->datalong, step.script->datalong2); - break; - } - - case SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT: - { - if(!step.script->datalong || !step.script->datalong2) - { - sLog.outError("SCRIPT_COMMAND_CALLSCRIPT calls invallid db_script_id or lowguid not present: skipping."); - break; - } - //our target - Creature* target = NULL; - - if(source) //using grid searcher - { - CellPair p(Trinity::ComputeCellPair(((Unit*)source)->GetPositionX(), ((Unit*)source)->GetPositionY())); - Cell cell(p); - cell.data.Part.reserved = ALL_DISTRICT; - - //sLog.outDebug("Attempting to find Creature: Db GUID: %i", step.script->datalong); - Trinity::CreatureWithDbGUIDCheck target_check(((Unit*)source), step.script->datalong); - Trinity::CreatureSearcher checker(target,target_check); - - TypeContainerVisitor, GridTypeMapContainer > unit_checker(checker); - CellLock cell_lock(cell, p); - cell_lock->Visit(cell_lock, unit_checker, *(((Unit*)source)->GetMap())); - } - else //check hashmap holders - { - if(CreatureData const* data = objmgr.GetCreatureData(step.script->datalong)) - target = ObjectAccessor::GetObjectInWorld(data->mapid, data->posX, data->posY, MAKE_NEW_GUID(step.script->datalong, data->id, HIGHGUID_UNIT), target); - } - //sLog.outDebug("attempting to pass target..."); - if(!target) - break; - //sLog.outDebug("target passed"); - //Lets choose our ScriptMap map - ScriptMapMap *datamap = NULL; - switch(step.script->dataint) - { - case 1://QUEST END SCRIPTMAP - datamap = &sQuestEndScripts; - break; - case 2://QUEST START SCRIPTMAP - datamap = &sQuestStartScripts; - break; - case 3://SPELLS SCRIPTMAP - datamap = &sSpellScripts; - break; - case 4://GAMEOBJECTS SCRIPTMAP - datamap = &sGameObjectScripts; - break; - case 5://EVENTS SCRIPTMAP - datamap = &sEventScripts; - break; - case 6://WAYPOINTS SCRIPTMAP - datamap = &sWaypointScripts; - break; - default: - sLog.outError("SCRIPT_COMMAND_CALLSCRIPT ERROR: no scriptmap present... ignoring"); - break; - } - //if no scriptmap present... - if(!datamap) - break; - - uint32 script_id = step.script->datalong2; - //delete iter and return it to begin pos(next one) - m_scriptSchedule.erase(iter); - iter = m_scriptSchedule.begin(); - - ScriptsStart(*datamap, script_id, target, NULL); - return; - } - - case SCRIPT_COMMAND_PLAYSOUND: - { - if(!source) - break; - //datalong sound_id, datalong2 onlyself - ((WorldObject*)source)->SendPlaySound(step.script->datalong, step.script->datalong2); - break; - } - - default: + dynamic_cast(source)->GetMotionMaster()->MovePath(step.script->datalong, step.script->datalong2); + break; + } + + case SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT: + { + if(!step.script->datalong || !step.script->datalong2) + { + sLog.outError("SCRIPT_COMMAND_CALLSCRIPT calls invallid db_script_id or lowguid not present: skipping."); + break; + } + //our target + Creature* target = NULL; + + if(source) //using grid searcher + { + CellPair p(Trinity::ComputeCellPair(((Unit*)source)->GetPositionX(), ((Unit*)source)->GetPositionY())); + Cell cell(p); + cell.data.Part.reserved = ALL_DISTRICT; + + //sLog.outDebug("Attempting to find Creature: Db GUID: %i", step.script->datalong); + Trinity::CreatureWithDbGUIDCheck target_check(((Unit*)source), step.script->datalong); + Trinity::CreatureSearcher checker(target,target_check); + + TypeContainerVisitor, GridTypeMapContainer > unit_checker(checker); + CellLock cell_lock(cell, p); + cell_lock->Visit(cell_lock, unit_checker, *(((Unit*)source)->GetMap())); + } + else //check hashmap holders + { + if(CreatureData const* data = objmgr.GetCreatureData(step.script->datalong)) + target = ObjectAccessor::GetObjectInWorld(data->mapid, data->posX, data->posY, MAKE_NEW_GUID(step.script->datalong, data->id, HIGHGUID_UNIT), target); + } + //sLog.outDebug("attempting to pass target..."); + if(!target) + break; + //sLog.outDebug("target passed"); + //Lets choose our ScriptMap map + ScriptMapMap *datamap = NULL; + switch(step.script->dataint) + { + case 1://QUEST END SCRIPTMAP + datamap = &sQuestEndScripts; + break; + case 2://QUEST START SCRIPTMAP + datamap = &sQuestStartScripts; + break; + case 3://SPELLS SCRIPTMAP + datamap = &sSpellScripts; + break; + case 4://GAMEOBJECTS SCRIPTMAP + datamap = &sGameObjectScripts; + break; + case 5://EVENTS SCRIPTMAP + datamap = &sEventScripts; + break; + case 6://WAYPOINTS SCRIPTMAP + datamap = &sWaypointScripts; + break; + default: + sLog.outError("SCRIPT_COMMAND_CALLSCRIPT ERROR: no scriptmap present... ignoring"); + break; + } + //if no scriptmap present... + if(!datamap) + break; + + uint32 script_id = step.script->datalong2; + //delete iter and return it to begin pos(next one) + m_scriptSchedule.erase(iter); + iter = m_scriptSchedule.begin(); + + ScriptsStart(*datamap, script_id, target, NULL); + return; + } + + case SCRIPT_COMMAND_PLAYSOUND: + { + if(!source) + break; + //datalong sound_id, datalong2 onlyself + ((WorldObject*)source)->SendPlaySound(step.script->datalong, step.script->datalong2); + break; + } + + default: sLog.outError("Unknown script command %u called.",step.script->command); break; } diff --git a/src/game/World.h b/src/game/World.h index 63d9b52d7f2..502f403d130 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -199,7 +199,7 @@ enum WorldConfigs CONFIG_SHOW_KICK_IN_WORLD, CONFIG_INTERVAL_LOG_UPDATE, CONFIG_MIN_LOG_UPDATE, - CONFIG_ENABLE_SINFO_LOGIN, + CONFIG_ENABLE_SINFO_LOGIN, CONFIG_VALUE_COUNT }; @@ -327,9 +327,9 @@ enum RealmZone #define SCRIPT_COMMAND_ACTIVATE_OBJECT 13 // source = unit, target=GO #define SCRIPT_COMMAND_REMOVE_AURA 14 // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id #define SCRIPT_COMMAND_CAST_SPELL 15 // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id -#define SCRIPT_COMMAND_LOAD_PATH 16 // source = unit, path = datalong, repeatable datalong2 -#define SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT 17 // datalong scriptid, lowguid datalong2, dataint table -#define SCRIPT_COMMAND_PLAYSOUND 18 // datalong soundid, datalong2 play only self +#define SCRIPT_COMMAND_LOAD_PATH 16 // source = unit, path = datalong, repeatable datalong2 +#define SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT 17 // datalong scriptid, lowguid datalong2, dataint table +#define SCRIPT_COMMAND_PLAYSOUND 18 // datalong soundid, datalong2 play only self /// Storage class for commands issued for delayed execution @@ -402,7 +402,7 @@ class World /// Get the current Message of the Day const char* GetMotd() const { return m_motd.c_str(); } - /// Set the string for new characters (first login) + /// Set the string for new characters (first login) void SetNewCharString(std::string str) { m_newCharString = str; } /// Get the string for new characters (first login) const std::string& GetNewCharString() const { return m_newCharString; } @@ -552,7 +552,7 @@ class World std::multimap m_scriptSchedule; - std::string m_newCharString; + std::string m_newCharString; float rate_values[MAX_RATES]; uint32 m_configs[CONFIG_VALUE_COUNT]; diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index bd692d5d9a7..a19e0bb7376 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -201,8 +201,8 @@ class TRINITY_DLL_SPEC WorldSession // Locales LocaleConstant GetSessionDbcLocale() const { return m_sessionDbcLocale; } - int GetSessionDbLocaleIndex() const { return m_sessionDbLocaleIndex; } - const char *GetTrinityString(int32 entry) const; + int GetSessionDbLocaleIndex() const { return m_sessionDbLocaleIndex; } + const char *GetTrinityString(int32 entry) const; uint32 GetLatency() const { return m_latency; } void SetLatency(uint32 latency) { m_latency = latency; } @@ -269,12 +269,12 @@ class TRINITY_DLL_SPEC WorldSession void HandlePlayerLogoutOpcode(WorldPacket& recvPacket); void HandleLogoutCancelOpcode(WorldPacket& recvPacket); - // GM Ticket opcodes - void HandleGMTicketCreateOpcode(WorldPacket& recvPacket); - void HandleGMTicketUpdateOpcode(WorldPacket& recvPacket); - void HandleGMTicketDeleteOpcode(WorldPacket& recvPacket); - void HandleGMTicketGetTicketOpcode(WorldPacket& recvPacket); - void HandleGMTicketSystemStatusOpcode(WorldPacket& recvPacket); + // GM Ticket opcodes + void HandleGMTicketCreateOpcode(WorldPacket& recvPacket); + void HandleGMTicketUpdateOpcode(WorldPacket& recvPacket); + void HandleGMTicketDeleteOpcode(WorldPacket& recvPacket); + void HandleGMTicketGetTicketOpcode(WorldPacket& recvPacket); + void HandleGMTicketSystemStatusOpcode(WorldPacket& recvPacket); //void HandleGMSurveySubmit(WorldPacket& recvPacket); @@ -523,7 +523,7 @@ class TRINITY_DLL_SPEC WorldSession void HandleChannelRosterQuery(WorldPacket& recvPacket); void HandleChannelInfoQuery(WorldPacket& recvPacket); void HandleChannelJoinNotify(WorldPacket& recvPacket); - void HandleChannelDeclineInvite(WorldPacket& recvPacket); + void HandleChannelDeclineInvite(WorldPacket& recvPacket); void HandleCompleteCinema(WorldPacket& recvPacket); void HandleNextCinematicCamera(WorldPacket& recvPacket); diff --git a/src/shared/Common.h b/src/shared/Common.h index 8bf60d9375e..c97de30ed46 100644 --- a/src/shared/Common.h +++ b/src/shared/Common.h @@ -170,7 +170,7 @@ enum AccountTypes SEC_MODERATOR = 1, SEC_GAMEMASTER = 2, SEC_ADMINISTRATOR = 3, - SEC_CONSOLE = 4 // must be always last in list, accounts must have less security level always also + SEC_CONSOLE = 4 // must be always last in list, accounts must have less security level always also }; enum LocaleConstant diff --git a/src/shared/WheatyExceptionReport.cpp b/src/shared/WheatyExceptionReport.cpp index 5aa4a19d583..5d365639fbf 100644 --- a/src/shared/WheatyExceptionReport.cpp +++ b/src/shared/WheatyExceptionReport.cpp @@ -606,7 +606,7 @@ bool bWriteVariables, HANDLE pThreadHandle) { _tprintf( _T("\r\nCall stack:\r\n") ); - _tprintf( _T("Address Frame Function SourceFile\r\n") ); + _tprintf( _T("Address Frame Function SourceFile\r\n") ); DWORD dwMachineType = 0; // Could use SymSetOptions here to add the SYMOPT_DEFERRED_LOADS flag @@ -908,10 +908,10 @@ char* Name) // BasicType basicType = GetBasicType(children.ChildId[i], modBase ); // - // pszCurrBuffer += sprintf( pszCurrBuffer, rgBaseType[basicType]); + // pszCurrBuffer += sprintf( pszCurrBuffer, rgBaseType[basicType]); // // Emit the variable name - // pszCurrBuffer += sprintf( pszCurrBuffer, "\'%s\'", Name ); + // pszCurrBuffer += sprintf( pszCurrBuffer, "\'%s\'", Name ); pszCurrBuffer = FormatOutputValue( pszCurrBuffer, basicType, length, (PVOID)dwFinalOffset ); diff --git a/src/shared/vmap/AABSPTree.h b/src/shared/vmap/AABSPTree.h index 5107676d48e..bc33a6699d1 100644 --- a/src/shared/vmap/AABSPTree.h +++ b/src/shared/vmap/AABSPTree.h @@ -279,11 +279,11 @@ public: /** Compares centers */ class CenterComparator { public: - Vector3::Axis sortAxis; + Vector3::Axis sortAxis; - CenterComparator(Vector3::Axis a) : sortAxis(a) {} + CenterComparator(Vector3::Axis a) : sortAxis(a) {} - inline int operator()(_AABSPTree::Handle* A, const _AABSPTree::Handle* B) const { + inline int operator()(_AABSPTree::Handle* A, const _AABSPTree::Handle* B) const { float a = A->center[sortAxis]; float b = B->center[sortAxis]; @@ -294,18 +294,18 @@ public: } else { return 0; } - } + } }; /** Compares bounds for strict >, <, or overlap*/ class BoundsComparator { public: - Vector3::Axis sortAxis; + Vector3::Axis sortAxis; - BoundsComparator(Vector3::Axis a) : sortAxis(a) {} + BoundsComparator(Vector3::Axis a) : sortAxis(a) {} - inline int operator()(_AABSPTree::Handle* A, const _AABSPTree::Handle* B) const { + inline int operator()(_AABSPTree::Handle* A, const _AABSPTree::Handle* B) const { const AABox& a = A->bounds; const AABox& b = B->bounds; @@ -316,33 +316,33 @@ public: } else { return 0; } - } + } }; /** Compares bounds to the sort location */ class Comparator { public: - Vector3::Axis sortAxis; - float sortLocation; + Vector3::Axis sortAxis; + float sortLocation; - Comparator(Vector3::Axis a, float l) : sortAxis(a), sortLocation(l) {} + Comparator(Vector3::Axis a, float l) : sortAxis(a), sortLocation(l) {} - inline int operator()(_AABSPTree::Handle* /*ignore*/, const _AABSPTree::Handle* handle) const { + inline int operator()(_AABSPTree::Handle* /*ignore*/, const _AABSPTree::Handle* handle) const { const AABox& box = handle->bounds; debugAssert(ignore == NULL); - if (box.high()[sortAxis] < sortLocation) { + if (box.high()[sortAxis] < sortLocation) { // Box is strictly below the sort location return -1; - } else if (box.low()[sortAxis] > sortLocation) { + } else if (box.low()[sortAxis] > sortLocation) { // Box is strictly above the sort location - return 1; - } else { + return 1; + } else { // Box overlaps the sort location - return 0; - } - } + return 0; + } + } }; // Using System::malloc with this class provided no speed improvement. @@ -450,42 +450,42 @@ public: } } - void verifyNode(const Vector3& lo, const Vector3& hi) { - // debugPrintf("Verifying: split %d @ %f [%f, %f, %f], [%f, %f, %f]\n", - // splitAxis, splitLocation, lo.x, lo.y, lo.z, hi.x, hi.y, hi.z); + void verifyNode(const Vector3& lo, const Vector3& hi) { + // debugPrintf("Verifying: split %d @ %f [%f, %f, %f], [%f, %f, %f]\n", + // splitAxis, splitLocation, lo.x, lo.y, lo.z, hi.x, hi.y, hi.z); debugAssert(lo == splitBounds.low()); debugAssert(hi == splitBounds.high()); - for (int i = 0; i < valueArray.length(); ++i) { - const AABox& b = valueArray[i]->bounds; + for (int i = 0; i < valueArray.length(); ++i) { + const AABox& b = valueArray[i]->bounds; debugAssert(b == boundsArray[i]); - for(int axis = 0; axis < 3; ++axis) { - debugAssert(b.low()[axis] <= b.high()[axis]); - debugAssert(b.low()[axis] >= lo[axis]); - debugAssert(b.high()[axis] <= hi[axis]); - } - } + for(int axis = 0; axis < 3; ++axis) { + debugAssert(b.low()[axis] <= b.high()[axis]); + debugAssert(b.low()[axis] >= lo[axis]); + debugAssert(b.high()[axis] <= hi[axis]); + } + } - if (child[0] || child[1]) { - debugAssert(lo[splitAxis] < splitLocation); - debugAssert(hi[splitAxis] > splitLocation); - } + if (child[0] || child[1]) { + debugAssert(lo[splitAxis] < splitLocation); + debugAssert(hi[splitAxis] > splitLocation); + } - Vector3 newLo = lo; - newLo[splitAxis] = splitLocation; - Vector3 newHi = hi; - newHi[splitAxis] = splitLocation; + Vector3 newLo = lo; + newLo[splitAxis] = splitLocation; + Vector3 newHi = hi; + newHi[splitAxis] = splitLocation; - if (child[0] != NULL) { - child[0]->verifyNode(lo, newHi); - } + if (child[0] != NULL) { + child[0]->verifyNode(lo, newHi); + } - if (child[1] != NULL) { - child[1]->verifyNode(newLo, hi); - } - } + if (child[1] != NULL) { + child[1]->verifyNode(newLo, hi); + } + } #if 0 /** @@ -735,26 +735,26 @@ public: int numMeanSplits, Array<_AABSPTree::Handle * >& temp) { - Node* node = NULL; + Node* node = NULL; - if (source.size() <= valuesPerNode) { - // Make a new leaf node - node = new Node(source); + if (source.size() <= valuesPerNode) { + // Make a new leaf node + node = new Node(source); - // Set the pointers in the memberTable - for (int i = 0; i < source.size(); ++i) { - memberTable.set(Member(source[i]), node); - } + // Set the pointers in the memberTable + for (int i = 0; i < source.size(); ++i) { + memberTable.set(Member(source[i]), node); + } source.clear(); } else { - // Make a new internal node - node = new Node(); + // Make a new internal node + node = new Node(); const AABox bounds = computeBounds(source, 0, source.size() - 1); - const Vector3 extent = bounds.high() - bounds.low(); + const Vector3 extent = bounds.high() - bounds.low(); - Vector3::Axis splitAxis = extent.primaryAxis(); + Vector3::Axis splitAxis = extent.primaryAxis(); float splitLocation; @@ -846,20 +846,20 @@ public: for (int i = 0; i < node->valueArray.size(); ++i) { _AABSPTree::Handle * v = node->valueArray[i]; node->boundsArray[i] = v->bounds; - memberTable.set(Member(v), node); + memberTable.set(Member(v), node); } if (lt.size() > 0) { - node->child[0] = makeNode(lt, valuesPerNode, numMeanSplits - 1, temp); - } + node->child[0] = makeNode(lt, valuesPerNode, numMeanSplits - 1, temp); + } - if (gt.size() > 0) { - node->child[1] = makeNode(gt, valuesPerNode, numMeanSplits - 1, temp); - } + if (gt.size() > 0) { + node->child[1] = makeNode(gt, valuesPerNode, numMeanSplits - 1, temp); + } - } + } - return node; + return node; } /** @@ -1317,51 +1317,51 @@ public: BoxIntersectionIterator& operator++() { ++nextValueArrayIndex; - bool foundIntersection = false; + bool foundIntersection = false; while (! isEnd && ! foundIntersection) { - // Search for the next node if we've exhausted this one + // Search for the next node if we've exhausted this one while ((! isEnd) && (nextValueArrayIndex >= node->valueArray.length())) { - // If we entered this loop, then the iterator has exhausted the elements at - // node (possibly because it just switched to a child node with no members). - // This loop continues until it finds a node with members or reaches - // the end of the whole intersection search. - - // If the right child overlaps the box, push it onto the stack for - // processing. - if ((node->child[1] != NULL) && - (box.high()[node->splitAxis] > node->splitLocation)) { - stack.push(node->child[1]); - } - - // If the left child overlaps the box, push it onto the stack for - // processing. - if ((node->child[0] != NULL) && - (box.low()[node->splitAxis] < node->splitLocation)) { - stack.push(node->child[0]); - } - - if (stack.length() > 0) { - // Go on to the next node (which may be either one of the ones we - // just pushed, or one from farther back the tree). - node = stack.pop(); - nextValueArrayIndex = 0; - } else { - // That was the last node; we're done iterating - isEnd = true; - } - } - - // Search for the next intersection at this node until we run out of children - while (! isEnd && ! foundIntersection && (nextValueArrayIndex < node->valueArray.length())) { - if (box.intersects(node->boundsArray[nextValueArrayIndex])) { - foundIntersection = true; - } else { - ++nextValueArrayIndex; - // If we exhaust this node, we'll loop around the master loop - // to find a new node. - } - } + // If we entered this loop, then the iterator has exhausted the elements at + // node (possibly because it just switched to a child node with no members). + // This loop continues until it finds a node with members or reaches + // the end of the whole intersection search. + + // If the right child overlaps the box, push it onto the stack for + // processing. + if ((node->child[1] != NULL) && + (box.high()[node->splitAxis] > node->splitLocation)) { + stack.push(node->child[1]); + } + + // If the left child overlaps the box, push it onto the stack for + // processing. + if ((node->child[0] != NULL) && + (box.low()[node->splitAxis] < node->splitLocation)) { + stack.push(node->child[0]); + } + + if (stack.length() > 0) { + // Go on to the next node (which may be either one of the ones we + // just pushed, or one from farther back the tree). + node = stack.pop(); + nextValueArrayIndex = 0; + } else { + // That was the last node; we're done iterating + isEnd = true; + } + } + + // Search for the next intersection at this node until we run out of children + while (! isEnd && ! foundIntersection && (nextValueArrayIndex < node->valueArray.length())) { + if (box.intersects(node->boundsArray[nextValueArrayIndex])) { + foundIntersection = true; + } else { + ++nextValueArrayIndex; + // If we exhaust this node, we'll loop around the master loop + // to find a new node. + } + } } return *this; diff --git a/src/shared/vmap/ModelContainer.cpp b/src/shared/vmap/ModelContainer.cpp index 889ba4fc9bf..4d2dc2aac78 100644 --- a/src/shared/vmap/ModelContainer.cpp +++ b/src/shared/vmap/ModelContainer.cpp @@ -68,7 +68,7 @@ namespace VMAP nSubModels += pNode.valueArray.size(); for(int i=0;i* h= pNode.valueArray[i]; + G3D::_AABSPTree::Handle* h= pNode.valueArray[i]; SubModel *m = h->value; // add the internal nodes as well nNodes += m->getNNodes(); diff --git a/src/trinitycore/Master.cpp b/src/trinitycore/Master.cpp index 75fea010337..66c1c17664e 100644 --- a/src/trinitycore/Master.cpp +++ b/src/trinitycore/Master.cpp @@ -458,7 +458,7 @@ bool Master::_StartDB() ///- Clean the database before starting clearOnlineAccounts(); - ///- Insert version info into DB + ///- Insert version info into DB WorldDatabase.PExecute("UPDATE `version` SET `core_version` = '%s', `core_revision` = '%s'", _FULLVERSION, _REVISION); sWorld.LoadDBVersion(); -- cgit v1.2.3 From f385747164c3fb278c92ef46fbd6c3da6590bbf0 Mon Sep 17 00:00:00 2001 From: KingPin Date: Mon, 9 Feb 2009 14:28:01 -0500 Subject: Add newline at end of file. --HG-- branch : trunk --- contrib/vmap_extractor_v2/vmapextract/wmo.h | 2 +- sql/updates/1018_world.sql | 2 +- sql/updates/1026_world.sql | 2 +- sql/updates/1028_world_scripts.sql | 2 +- sql/updates/973_world_scripts.sql | 2 +- src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp | 2 +- .../scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp | 2 +- .../scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp | 2 +- src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp | 2 +- src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp | 2 +- .../scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h | 2 +- src/game/ObjectMgr.cpp | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/contrib/vmap_extractor_v2/vmapextract/wmo.h b/contrib/vmap_extractor_v2/vmapextract/wmo.h index b8f6439e381..c3bb4ce3ae5 100644 --- a/contrib/vmap_extractor_v2/vmapextract/wmo.h +++ b/contrib/vmap_extractor_v2/vmapextract/wmo.h @@ -104,4 +104,4 @@ public: static void reset(); }; -#endif \ No newline at end of file +#endif diff --git a/sql/updates/1018_world.sql b/sql/updates/1018_world.sql index ca298faa8f3..d231eb168b9 100644 --- a/sql/updates/1018_world.sql +++ b/sql/updates/1018_world.sql @@ -3,4 +3,4 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comm (31224, -1543, 2, 'Cloak of Shadows - Flare'), (41292, 42017, 2, 'Aura of Suffering'), (44007, -43657, 2, 'Storm Eye Safe Zone Immune'), -(44867, -46019, 2, 'Spectral Exhaustion - Teleport: Spectral Realm'); \ No newline at end of file +(44867, -46019, 2, 'Spectral Exhaustion - Teleport: Spectral Realm'); diff --git a/sql/updates/1026_world.sql b/sql/updates/1026_world.sql index 90ff7d23120..ae189469b41 100644 --- a/sql/updates/1026_world.sql +++ b/sql/updates/1026_world.sql @@ -2,4 +2,4 @@ DELETE FROM `spell_linked_spell` WHERE `spell_effect` IN ('33686', '31705'); INSERT INTO `spell_linked_spell`(`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES ('-33711','33686','0','Murmur\'s Shockwave (Normal)'), ('-38794','33686','0','Murmur\'s Shockwave (Heroic)'), -('33686','31705','0','Murmur\'s Shockwave Jump'); \ No newline at end of file +('33686','31705','0','Murmur\'s Shockwave Jump'); diff --git a/sql/updates/1028_world_scripts.sql b/sql/updates/1028_world_scripts.sql index 2023243b456..9c821c7b093 100644 --- a/sql/updates/1028_world_scripts.sql +++ b/sql/updates/1028_world_scripts.sql @@ -1 +1 @@ -UPDATE `creature_template` SET `ScriptName`='boss_the_black_stalker' WHERE `entry`='17882'; \ No newline at end of file +UPDATE `creature_template` SET `ScriptName`='boss_the_black_stalker' WHERE `entry`='17882'; diff --git a/sql/updates/973_world_scripts.sql b/sql/updates/973_world_scripts.sql index 42b970aaed6..b53219c6afe 100644 --- a/sql/updates/973_world_scripts.sql +++ b/sql/updates/973_world_scripts.sql @@ -1 +1 @@ -update creature_template set scriptname = 'npc_enraged_spirit' where entry in (21050, 21061, 21060, 21059); \ No newline at end of file +update creature_template set scriptname = 'npc_enraged_spirit' where entry in (21050, 21061, 21060, 21059); diff --git a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp index 857b682748d..529f9dbecdc 100644 --- a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp +++ b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp @@ -161,4 +161,4 @@ void AddSC_arathi_highlands() newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI; newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe; newscript->RegisterSelf(); -} \ No newline at end of file +} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp index 58228135a01..2ffc6f33497 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp @@ -402,4 +402,4 @@ void AddSC_dark_portal() newscript->pGossipHello = &GossipHello_npc_saat; newscript->pGossipSelect = &GossipSelect_npc_saat; newscript->RegisterSelf(); -} \ No newline at end of file +} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp index 16b889a122b..290c7e86470 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp @@ -379,4 +379,4 @@ void AddSC_instance_dark_portal() newscript->Name = "instance_dark_portal"; newscript->GetInstanceData = &GetInstanceData_instance_dark_portal; newscript->RegisterSelf(); -} \ No newline at end of file +} diff --git a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp index c621ebf566c..9d975a2ff02 100644 --- a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp +++ b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp @@ -307,4 +307,4 @@ void AddSC_boss_onyxia() newscript->Name="boss_onyxia"; newscript->GetAI = &GetAI_boss_onyxiaAI; newscript->RegisterSelf(); -} \ No newline at end of file +} diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp index 5c9274ca5b9..0a230e4e262 100644 --- a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp +++ b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp @@ -201,4 +201,4 @@ void AddSC_razorfen_kraul() newscript->GetAI = &GetAI_npc_willix; newscript->pQuestAccept = &QuestAccept_npc_willix; newscript->RegisterSelf(); -} \ No newline at end of file +} diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h b/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h index e765eca59d9..3c5532baf21 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h @@ -12,4 +12,4 @@ #define DATA_HORSEMAN_EVENT 5 #define GAMEOBJECT_PUMPKIN_SHRINE 6 -#endif \ No newline at end of file +#endif diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index a68b8315492..8ba8320b432 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -7597,4 +7597,4 @@ void ObjectMgr::LoadTransportEvents() sLog.outString( "\n>> Loaded %u transport events \n", result->GetRowCount() ); delete result; -} \ No newline at end of file +} -- cgit v1.2.3