diff options
| author | kaelima <kaelima@live.se> | 2012-05-30 08:01:02 +0200 |
|---|---|---|
| committer | kaelima <kaelima@live.se> | 2012-05-30 08:01:02 +0200 |
| commit | 3d14384c32971096b49f88ff785d92879480af76 (patch) | |
| tree | c1ade41c9d04583a717a705132ca09dde7a8ad56 /src/server/scripts/EasternKingdoms | |
| parent | bdf6cf5146b884591e3a033a31ca5b729fdff0ff (diff) | |
Merge git://github.com/TrinityCore/TrinityCore into 4.x
Conflicts:
dep/PackageList.txt
sql/base/auth_database.sql
src/server/authserver/Server/AuthSocket.cpp
src/server/game/Battlegrounds/BattlegroundMgr.cpp
src/server/game/Chat/Commands/Level1.cpp
src/server/game/Chat/Commands/Level3.cpp
src/server/game/DataStores/DBCEnums.h
src/server/game/DataStores/DBCStores.cpp
src/server/game/DataStores/DBCStores.h
src/server/game/DataStores/DBCStructure.h
src/server/game/DataStores/DBCfmt.h
src/server/game/Entities/Corpse/Corpse.cpp
src/server/game/Entities/Creature/Creature.cpp
src/server/game/Entities/DynamicObject/DynamicObject.cpp
src/server/game/Entities/GameObject/GameObject.cpp
src/server/game/Entities/Item/Item.cpp
src/server/game/Entities/Object/Object.cpp
src/server/game/Entities/Object/Updates/UpdateData.h
src/server/game/Entities/Pet/Pet.cpp
src/server/game/Entities/Player/Player.cpp
src/server/game/Entities/Player/Player.h
src/server/game/Entities/Transport/Transport.cpp
src/server/game/Entities/Unit/Unit.cpp
src/server/game/Globals/ObjectMgr.cpp
src/server/game/Globals/ObjectMgr.h
src/server/game/Guilds/Guild.cpp
src/server/game/Handlers/CharacterHandler.cpp
src/server/game/Handlers/MiscHandler.cpp
src/server/game/Handlers/MovementHandler.cpp
src/server/game/Handlers/QuestHandler.cpp
src/server/game/Loot/LootMgr.cpp
src/server/game/Miscellaneous/SharedDefines.h
src/server/game/Quests/QuestDef.cpp
src/server/game/Server/Protocol/Opcodes.cpp
src/server/game/Server/Protocol/Opcodes.h
src/server/game/Server/WorldSession.cpp
src/server/game/Server/WorldSocket.cpp
src/server/game/Spells/Auras/SpellAuraEffects.cpp
src/server/game/Spells/Spell.cpp
src/server/game/Spells/Spell.h
src/server/game/Spells/SpellEffects.cpp
src/server/game/Tickets/TicketMgr.cpp
src/server/scripts/Commands/cs_gps.cpp
src/server/scripts/Commands/cs_modify.cpp
src/server/shared/Database/Implementation/CharacterDatabase.cpp
src/server/shared/Logging/Log.h
src/tools/map_extractor/CMakeLists.txt
src/tools/map_extractor/System.cpp
src/tools/map_extractor/mpq_libmpq04.h
src/tools/vmap4_extractor/CMakeLists.txt
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
147 files changed, 1726 insertions, 1500 deletions
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index 1292cdaee17..93de16fc80b 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -139,7 +139,7 @@ public: summons.Summon(summoned); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { summons.DespawnAll(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 7ef11e5256a..9375cc33f27 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -126,11 +126,11 @@ public: InstanceScript* instance; - uint8 EventPhase; + uint8 EventPhase; uint32 Event_Timer; - uint8 MobSpawnId; - uint8 MobCount; + uint8 MobSpawnId; + uint8 MobCount; uint32 MobDeath_Timer; uint64 RingMobGUID[4]; @@ -142,16 +142,16 @@ public: { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - EventPhase = 0; - Event_Timer = 1000; + EventPhase = 0; + Event_Timer = 1000; - MobCount = 0; - MobDeath_Timer = 0; + MobCount = 0; + MobDeath_Timer = 0; for (uint8 i = 0; i < MAX_MOB_AMOUNT; ++i) RingMobGUID[i] = 0; - RingBossGUID = 0; + RingBossGUID = 0; CanWalk = false; } @@ -177,39 +177,39 @@ public: MobDeath_Timer = 2500; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 0: - DoScriptText(SCRIPT_TEXT1, me);//2 - CanWalk = false; - Event_Timer = 5000; - break; - case 1: - DoScriptText(SCRIPT_TEXT2, me);//4 - CanWalk = false; - Event_Timer = 5000; - break; - case 2: - CanWalk = false; - break; - case 3: - DoScriptText(SCRIPT_TEXT3, me);//5 - break; - case 4: - DoScriptText(SCRIPT_TEXT4, me);//6 - CanWalk = false; - Event_Timer = 5000; - break; - case 5: - if (instance) - { - instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me); - instance->SetData(TYPE_RING_OF_LAW, DONE); - sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_grimstone: event reached end and set complete."); - } - break; + case 0: + DoScriptText(SCRIPT_TEXT1, me);//2 + CanWalk = false; + Event_Timer = 5000; + break; + case 1: + DoScriptText(SCRIPT_TEXT2, me);//4 + CanWalk = false; + Event_Timer = 5000; + break; + case 2: + CanWalk = false; + break; + case 3: + DoScriptText(SCRIPT_TEXT3, me);//5 + break; + case 4: + DoScriptText(SCRIPT_TEXT4, me);//6 + CanWalk = false; + Event_Timer = 5000; + break; + case 5: + if (instance) + { + instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me); + instance->SetData(TYPE_RING_OF_LAW, DONE); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_grimstone: event reached end and set complete."); + } + break; } } @@ -227,16 +227,16 @@ public: { if (MobDeath_Timer <= diff) { - MobDeath_Timer = 2500; + MobDeath_Timer = 2500; if (RingBossGUID) { Creature* boss = Unit::GetCreature(*me, RingBossGUID); if (boss && !boss->isAlive() && boss->isDead()) { - RingBossGUID = 0; - Event_Timer = 5000; - MobDeath_Timer = 0; + RingBossGUID = 0; + Event_Timer = 5000; + MobDeath_Timer = 0; return; } return; @@ -247,7 +247,7 @@ public: Creature* mob = Unit::GetCreature(*me, RingMobGUID[i]); if (mob && !mob->isAlive() && mob->isDead()) { - RingMobGUID[i] = 0; + RingMobGUID[i] = 0; --MobCount; //seems all are gone, so set timer to continue and discontinue this @@ -355,7 +355,7 @@ public: struct mob_phalanxAI : public ScriptedAI { - mob_phalanxAI(Creature* c) : ScriptedAI(c) {} + mob_phalanxAI(Creature* creature) : ScriptedAI(creature) {} uint32 ThunderClap_Timer; uint32 FireballVolley_Timer; @@ -363,9 +363,9 @@ public: void Reset() { - ThunderClap_Timer = 12000; - FireballVolley_Timer = 0; - MightyBlow_Timer = 15000; + ThunderClap_Timer = 12000; + FireballVolley_Timer = 0; + MightyBlow_Timer = 15000; } void UpdateAI(const uint32 diff) @@ -426,7 +426,7 @@ class npc_kharan_mighthammer : public CreatureScript public: npc_kharan_mighthammer() : CreatureScript("npc_kharan_mighthammer") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -520,7 +520,7 @@ class npc_lokhtos_darkbargainer : public CreatureScript public: npc_lokhtos_darkbargainer() : CreatureScript("npc_lokhtos_darkbargainer") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF + 1) @@ -564,7 +564,6 @@ enum DughalQuests QUEST_JAIL_BREAK = 4322 }; -// DELETE THIS IF IT IS NOT NEEDED! #define SAY_DUGHAL_FREE "Thank you, $N! I'm free!!!" #define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!" @@ -585,7 +584,7 @@ public: return dughal_stormwingAI; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF + 1) @@ -610,20 +609,24 @@ public: struct npc_dughal_stormwingAI : public npc_escortAI { - npc_dughal_stormwingAI(Creature* c) : npc_escortAI(c) {} + npc_dughal_stormwingAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 0:me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 1:instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 2: - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); - break; + case 0: + me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_OBJECTIVE_COMPLETED); + break; + case 2: + me->SetVisible(false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); + break; } } @@ -634,7 +637,7 @@ public: { if (IsBeingEscorted && killer == me) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); @@ -646,13 +649,13 @@ public: if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } else { - me->SetVisibility(VISIBILITY_ON); + me->SetVisible(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -713,78 +716,85 @@ public: bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == 4322) - {PlayerStart = player; + { + PlayerStart = player; if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) { - CAST_AI(npc_escort::npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); - instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS); - creature->setFaction(11); - } + CAST_AI(npc_escort::npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); + instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS); + creature->setFaction(11); } + } return false; } struct npc_marshal_windsorAI : public npc_escortAI { - npc_marshal_windsorAI(Creature* c) : npc_escortAI(c) + npc_marshal_windsorAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 1: - me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 10: - me->setFaction(534); - break; - case 12: - me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); - instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); - break; - case 13: - me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 14: - instance->SetData(DATA_GATE_SR, 0); - me->setFaction(11); - break; - case 16: - me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); - break; - case 17: - me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 18: - instance->SetData(DATA_GATE_SC, 0); - break; - case 19: - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61f, -51.71f, -63.92f, 3.600434f, TEMPSUMMON_DEAD_DESPAWN, 0); - instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED); - break; + case 1: + me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold = true; + break; + case 10: + me->setFaction(534); + break; + case 12: + me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); + instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); + break; + case 13: + me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 14: + instance->SetData(DATA_GATE_SR, 0); + me->setFaction(11); + break; + case 16: + me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); + break; + case 17: + me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 18: + instance->SetData(DATA_GATE_SC, 0); + break; + case 19: + me->SetVisible(false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61f, -51.71f, -63.92f, 3.600434f, TEMPSUMMON_DEAD_DESPAWN, 0); + instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED); + break; } } void EnterCombat(Unit* who) - { + { switch (urand(0, 2)) { - case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; - case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; - case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; - } + case 0: + me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); + break; + case 2: + me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); + break; } + } void Reset() {} @@ -795,28 +805,31 @@ public: void UpdateAI(const uint32 diff) { - if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) + return; + if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false); + if (!instance->GetData(DATA_GATE_D) && instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED) - { + { me->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START); - } + } if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) - { + { me->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); - } + } if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } else { - me->SetVisibility(VISIBILITY_ON); + me->SetVisible(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -897,65 +910,65 @@ public: struct npc_marshal_reginald_windsorAI : public npc_escortAI { - npc_marshal_reginald_windsorAI(Creature* c) : npc_escortAI(c) + npc_marshal_reginald_windsorAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - wp=i; - switch (i) + wp = waypointId; + switch (waypointId) { - case 0: - me->setFaction(11); - me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 1: - me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 8: - me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 11: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 12: - me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 13: - me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 20: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 21: - me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 23: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 24: - me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 31: - me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 32: - me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); - PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me); - instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); - break; + case 0: + me->setFaction(11); + me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 8: + me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 11: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 12: + me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 13: + me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 20: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 21: + me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 23: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 24: + me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 31: + me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 32: + me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); + PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me); + instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); + break; } } @@ -979,14 +992,20 @@ public: } void EnterCombat(Unit* who) - { + { switch (urand(0, 2)) { - case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; - case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; - case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; - } + case 0: + me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); + break; + case 2: + me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); + break; } + } void Reset() {} void JustDied(Unit* slayer) @@ -996,47 +1015,49 @@ public: void UpdateAI(const uint32 diff) { - if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) + return; + if (wp == 7) - { + { if (!instance->GetData(DATA_GATE_J) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED) - { - instance->SetData(DATA_CREATURE_JAZ, 1); - instance->SetData(DATA_JAZ, ENCOUNTER_STATE_IN_PROGRESS); - } + { + instance->SetData(DATA_CREATURE_JAZ, 1); + instance->SetData(DATA_JAZ, ENCOUNTER_STATE_IN_PROGRESS); + } if (instance->GetData(DATA_CREATURE_JAZ) && instance->GetData(DATA_CREATURE_OGRABISI) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS) - { - SetEscortPaused(false); - instance->SetData(DATA_JAZ, ENCOUNTER_STATE_ENDED); - } + { + SetEscortPaused(false); + instance->SetData(DATA_JAZ, ENCOUNTER_STATE_ENDED); } + } else if (wp == 11) - { + { if (!instance->GetData(DATA_GATE_S) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED) - { - instance->SetData(DATA_CREATURE_SHILL, 1); - instance->SetData(DATA_SHILL, ENCOUNTER_STATE_IN_PROGRESS); - } + { + instance->SetData(DATA_CREATURE_SHILL, 1); + instance->SetData(DATA_SHILL, ENCOUNTER_STATE_IN_PROGRESS); + } if (instance->GetData(DATA_CREATURE_SHILL) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS) - { - instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); - SetEscortPaused(false); - } + { + instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); + SetEscortPaused(false); } + } else if (wp == 20) - { + { if (!instance->GetData(DATA_GATE_C) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED) - { - instance->SetData(DATA_CREATURE_CREST, 1); - me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID); - instance->SetData(DATA_CREST, ENCOUNTER_STATE_IN_PROGRESS); - } + { + instance->SetData(DATA_CREATURE_CREST, 1); + me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID); + instance->SetData(DATA_CREST, ENCOUNTER_STATE_IN_PROGRESS); + } if (instance->GetData(DATA_CREATURE_CREST) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS) - { - SetEscortPaused(false); - instance->SetData(DATA_CREST, ENCOUNTER_STATE_ENDED); - } + { + SetEscortPaused(false); + instance->SetData(DATA_CREST, ENCOUNTER_STATE_ENDED); } + } if (instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false); npc_escortAI::UpdateAI(diff); } @@ -1046,6 +1067,7 @@ public: // npc_tobias_seecher #define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!" + /* class npc_tobias_seecher : public CreatureScript { @@ -1065,7 +1087,7 @@ public: return tobias_seecherAI; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF + 1) @@ -1090,7 +1112,7 @@ public: struct npc_tobias_seecherAI : public npc_escortAI { - npc_tobias_seecherAI(Creature* c) :npc_escortAI(c) {} + npc_tobias_seecherAI(Creature* creature) : npc_escortAI(creature) {} void EnterCombat(Unit* who) {} void Reset() {} @@ -1099,41 +1121,46 @@ public: { if (IsBeingEscorted && killer == me) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED); } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 0:me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 2: - instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 4: - me->SetVisibility(VISIBILITY_OFF); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED); - break; + case 0: + me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); + break; + case 2: + instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED); + break; + case 4: + me->SetVisible(false); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED); + break; } } void UpdateAI(const uint32 diff) { - if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) + return; + if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } else { - me->SetVisibility(VISIBILITY_ON); + me->SetVisible(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -1217,8 +1244,8 @@ public: if (HasEscortState(STATE_ESCORT_ESCORTING)) return; - BreakKeg_Timer = 0; - BreakDoor_Timer = 0; + BreakKeg_Timer = 0; + BreakDoor_Timer = 0; } void DoGo(uint32 id, uint32 state) @@ -1227,29 +1254,29 @@ public: go->SetGoState((GOState)state); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { if (!instance) return; - switch (i) + switch (waypointId) { - case 1: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 2: - me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); - break; - case 3: - me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); - break; - case 4: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 5: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - BreakKeg_Timer = 2000; - break; + case 1: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 2: + me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); + break; + case 3: + me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); + break; + case 4: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 5: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + BreakKeg_Timer = 2000; + break; } } @@ -1263,8 +1290,8 @@ public: if (BreakKeg_Timer <= diff) { DoGo(DATA_GO_BAR_KEG, 0); - BreakKeg_Timer = 0; - BreakDoor_Timer = 1000; + BreakKeg_Timer = 0; + BreakDoor_Timer = 1000; } else BreakKeg_Timer -= diff; } diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp index 2e8dc029d44..ff0f1a4cedd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp @@ -42,8 +42,8 @@ public: void Reset() { - FireBlast_Timer = 2000; - Spirit_Timer = 24000; + FireBlast_Timer = 2000; + Spirit_Timer = 24000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp index b4a4c416693..2585796e28e 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp @@ -49,11 +49,11 @@ public: void Reset() { - ShadowBolt_Timer = 7000; - CurseOfTongues_Timer = 24000; - CurseOfWeakness_Timer = 12000; - DemonArmor_Timer = 3000; - EnvelopingWeb_Timer = 16000; + ShadowBolt_Timer = 7000; + CurseOfTongues_Timer = 24000; + CurseOfWeakness_Timer = 12000; + DemonArmor_Timer = 3000; + EnvelopingWeb_Timer = 16000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp index e894fd35bd1..073c4fde82a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -55,9 +55,9 @@ public: void Reset() { - HandOfThaurissan_Timer = 4000; - AvatarOfFlame_Timer = 25000; - //Counter = 0; + HandOfThaurissan_Timer = 4000; + AvatarOfFlame_Timer = 25000; + //Counter= 0; } void EnterCombat(Unit* /*who*/) @@ -71,7 +71,7 @@ public: DoScriptText(SAY_SLAY, me); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Moira = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(DATA_MOIRA) : 0)) { @@ -100,7 +100,7 @@ public: //else //{ HandOfThaurissan_Timer = 5000; - //Counter = 0; + //Counter = 0; //} } else HandOfThaurissan_Timer -= diff; diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp index 69808386423..703f684cc9f 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp @@ -47,11 +47,11 @@ public: void Reset() { - MightyBlow_Timer = 8000; - HamString_Timer = 12000; - Cleave_Timer = 16000; - Adds_Timer = 0; - Medics = false; + MightyBlow_Timer = 8000; + HamString_Timer = 12000; + Cleave_Timer = 16000; + Adds_Timer = 0; + Medics = false; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp index 883c601709e..b2c93d949c2 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp @@ -43,8 +43,8 @@ public: void Reset() { - WhirlWind_Timer = 12000; - MortalStrike_Timer = 22000; + WhirlWind_Timer = 12000; + MortalStrike_Timer = 22000; } void EnterCombat(Unit* /*who*/) diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp index 7686ece3c2e..63d945ade90 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp @@ -43,8 +43,8 @@ public: void Reset() { - GroundTremor_Timer = 12000; - Frenzy_Timer = 0; + GroundTremor_Timer = 12000; + Frenzy_Timer =0; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp index 26e2bc80eb2..f4f245be4be 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp @@ -47,10 +47,10 @@ public: void Reset() { - ShadowWordPain_Timer = 4000; - ManaBurn_Timer = 14000; - PsychicScream_Timer = 32000; - ShadowShield_Timer = 8000; + ShadowWordPain_Timer = 4000; + ManaBurn_Timer = 14000; + PsychicScream_Timer = 32000; + ShadowShield_Timer = 8000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp index 141b8307b7b..3d2cc627145 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp @@ -48,8 +48,8 @@ public: void Reset() { - FieryBurst_Timer = 5000; - WarStomp_Timer = 0; + FieryBurst_Timer = 5000; + WarStomp_Timer =0; } void EnterCombat(Unit* /*who*/) {} @@ -80,9 +80,9 @@ public: DoMeleeAttackIfReady(); } // When he die open door to last chamber - void JustDied(Unit* who) + void JustDied(Unit* killer) { - if (InstanceScript* instance = who->GetInstanceScript()) + if (InstanceScript* instance = killer->GetInstanceScript()) instance->HandleGameObject(instance->GetData64(DATA_THRONE_DOOR), true); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp index 72a60daea2d..e6f65ab4252 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp @@ -49,10 +49,10 @@ public: void Reset() { - Heal_Timer = 12000; // These times are probably wrong - MindBlast_Timer = 16000; - ShadowWordPain_Timer = 2000; - Smite_Timer = 8000; + Heal_Timer = 12000; //These times are probably wrong + MindBlast_Timer = 16000; + ShadowWordPain_Timer = 2000; + Smite_Timer = 8000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp index 3c8d5fc4fa8..211930e4f1a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp @@ -45,7 +45,7 @@ class boss_gloomrel : public CreatureScript public: boss_gloomrel() : CreatureScript("boss_gloomrel") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -104,7 +104,7 @@ class boss_doomrel : public CreatureScript public: boss_doomrel() : CreatureScript("boss_doomrel") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -156,11 +156,11 @@ public: void Reset() { - ShadowVolley_Timer = 10000; - Immolate_Timer = 18000; - CurseOfWeakness_Timer = 5000; - DemonArmor_Timer = 16000; - Voidwalkers = false; + ShadowVolley_Timer = 10000; + Immolate_Timer = 18000; + CurseOfWeakness_Timer = 5000; + DemonArmor_Timer = 16000; + Voidwalkers = false; me->setFaction(FACTION_FRIEND); @@ -193,7 +193,7 @@ public: instance->SetData64(DATA_EVENSTARTER, 0); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_GHOSTKILL, 1); diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp index 2ef3ef48ecb..03cb077936b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp @@ -115,57 +115,57 @@ public: { memset(&encounter, 0, sizeof(encounter)); - EmperorGUID = 0; - PhalanxGUID = 0; - MagmusGUID = 0; - MoiraGUID = 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; - GoSFSGUID = 0; - GoSFNGUID = 0; - GoGolemNGUID = 0; - GoGolemSGUID = 0; - GoThroneGUID = 0; - GoChestGUID = 0; - GoSpectralChaliceGUID = 0; - - BarAleCount = 0; - GhostKillCount = 0; - TombEventStarterGUID = 0; + EmperorGUID = 0; + PhalanxGUID = 0; + MagmusGUID = 0; + MoiraGUID = 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; + GoSFSGUID = 0; + GoSFNGUID = 0; + GoGolemNGUID = 0; + GoGolemSGUID = 0; + GoThroneGUID = 0; + GoChestGUID = 0; + GoSpectralChaliceGUID = 0; + + BarAleCount = 0; + GhostKillCount = 0; + TombEventStarterGUID = 0; TombTimer = TIMER_TOMBOFTHESEVEN; - TombEventCounter = 0; + TombEventCounter = 0; for (uint8 i = 0; i < 7; ++i) - TombBossGUIDs[i] = 0; + TombBossGUIDs[i] = 0; } void OnCreatureCreate(Creature* creature) { switch (creature->GetEntry()) { - case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break; - case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break; - case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break; - case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break; - case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break; - case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break; - case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break; - case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break; - case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break; - case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break; + case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break; + case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break; + case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break; + case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break; + case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break; + case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break; + case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break; + case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break; + case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break; + case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break; case NPC_MAGMUS: MagmusGUID = creature->GetGUID(); if (!creature->isAlive()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h index e51c6b9130d..0af2af948d3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h @@ -33,7 +33,8 @@ enum Data DATA_WARCHIEF_REND_BLACKHAND, DATA_GYTH, DATA_THE_BEAST, - DATA_GENERAL_DRAKKISATH + DATA_GENERAL_DRAKKISATH, + DATA_DRAGONSPIRE_ROOM, }; enum Npc { @@ -51,17 +52,51 @@ enum Npc NPC_GYTH = 10339, NPC_THE_BEAST = 10430, NPC_GENERAL_DRAKKISATH = 10363, + NPC_BLACKHAND_DREADWEAVER = 9817, + NPC_BLACKHAND_SUMMONER = 9818, + NPC_BLACKHAND_VETERAN = 9819, }; enum AdditionalData { SPELL_SUMMON_ROOKERY_WHELP = 15745, MAX_ENCOUNTER = 14, + MAX_DRAGONSPIRE_HALL_RUNES = 7, + EVENT_PYROGUARD_EMBERSEER = 4884, + AREATRIGGER_ENTER_UBRS = 2046, + AREATRIGGER_STADIUM = 2026, }; enum GameObjects { - GO_WHELP_SPAWNER = 175622, //trap spawned by go id 175124 + GO_WHELP_SPAWNER = 175622, // trap spawned by go id 175124 + + // Doors + GO_EMBERSEER_IN = 175244, // First door to Pyroguard Emberseer + GO_DOORS = 175705, // Second door to Pyroguard Emberseer + GO_EMBERSEER_OUT = 175153, // Door after Pyroguard Emberseer event + GO_GYTH_ENTRY_DOOR = 164726, + GO_GYTH_COMBAT_DOOR = 175185, + GO_GYTH_EXIT_DOOR = 175186, + GO_DRAKKISATH_DOOR_1 = 175946, + GO_DRAKKISATH_DOOR_2 = 175947, + + // Runes + GO_ROOM_1_RUNE = 175197, + GO_ROOM_2_RUNE = 175199, + GO_ROOM_3_RUNE = 175195, + GO_ROOM_4_RUNE = 175200, + GO_ROOM_5_RUNE = 175198, + GO_ROOM_6_RUNE = 175196, + GO_ROOM_7_RUNE = 175194, + + GO_EMBERSEER_RUNE_1 = 175266, + GO_EMBERSEER_RUNE_2 = 175267, + GO_EMBERSEER_RUNE_3 = 175268, + GO_EMBERSEER_RUNE_4 = 175269, + GO_EMBERSEER_RUNE_5 = 175270, + GO_EMBERSEER_RUNE_6 = 175271, + GO_EMBERSEER_RUNE_7 = 175272, }; #endif diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp index ff17e989cd9..ff40094debd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp @@ -64,7 +64,7 @@ public: events.ScheduleEvent(EVENT_THUNDERCLAP, 17 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index 0d8cabcf89c..214ce4e02f3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -79,7 +79,7 @@ public: events.ScheduleEvent(EVENT_AGGRO, 60 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } @@ -117,7 +117,7 @@ public: // Interrupt any spell casting me->InterruptNonMeleeSpells(false); // Gyth model - me->SetDisplayId(me->GetCreatureInfo()->Modelid1); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); me->SummonCreature(NPC_WARCHIEF_REND_BLACKHAND, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_CORROSIVE_ACID, 8 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_FREEZE, 11 * IN_MILLISECONDS); diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp index a944ee6daf8..c5d566c51cb 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp @@ -63,7 +63,7 @@ public: events.ScheduleEvent(EVENT_MIGHTY_BLOW, 14 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp index bc9de52d91d..027952dc74a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp @@ -73,7 +73,7 @@ public: events.ScheduleEvent(EVENT_SLOW, 24 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp index 973ffe7e53b..c455b1d404d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp @@ -59,7 +59,7 @@ public: events.ScheduleEvent(EVENT_MOTHERS_MILK, 10 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp index b7492998d56..0c23f55bd39 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp @@ -77,7 +77,7 @@ public: events.ScheduleEvent(EVENT_KNOCK_AWAY, 12 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index d76d0d7f47c..0279f3e2834 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -20,11 +20,24 @@ #include "ScriptedCreature.h" #include "blackrock_spire.h" +enum Text +{ + EMOTE_ONE_STACK = 0, + EMOTE_TEN_STACK = 1, + EMOTE_FREE_OF_BONDS = 2, + YELL_FREE_OF_BONDS = 3, +}; + enum Spells { - SPELL_FIRENOVA = 23462, - SPELL_FLAMEBUFFET = 23341, - SPELL_PYROBLAST = 17274, + SPELL_ENCAGED_EMBERSEER = 15282, // Self on spawn + SPELL_FIRE_SHIELD_TRIGGER = 13377, // Self on spawn missing from 335 dbc + SPELL_FREEZE_ANIM = 16245, // Self on event start + SPELL_EMBERSEER_GROWING = 16048, // Self on event start + SPELL_EMBERSEER_FULL_STRENGTH = 16047, // Emberseer Full Strength + SPELL_FIRENOVA = 23462, // Combat + SPELL_FLAMEBUFFET = 23341, // Combat + SPELL_PYROBLAST = 17274, // Combat }; enum Events @@ -51,6 +64,12 @@ public: void Reset() { + if(instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS) + OpenDoors(false); + instance->SetBossState(DATA_PYROGAURD_EMBERSEER,NOT_STARTED); + // respawn any dead Blackhand Incarcerators + DoCast(me, SPELL_ENCAGED_EMBERSEER); + //DoCast(me, SPELL_FIRE_SHIELD_TRIGGER); _Reset(); } @@ -62,14 +81,28 @@ public: events.ScheduleEvent(EVENT_PYROBLAST, 14 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { + instance->SetBossState(DATA_PYROGAURD_EMBERSEER,DONE); + OpenDoors(true); _JustDied(); } + void OpenDoors(bool Boss_Killed) + { + if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_IN))) + door1->SetGoState(GO_STATE_ACTIVE); + if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetData64(GO_DOORS))) + door2->SetGoState(GO_STATE_ACTIVE); + if (Boss_Killed) + if (GameObject* door3 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_OUT))) + door3->SetGoState(GO_STATE_ACTIVE); + } + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) + return; events.Update(diff); diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp index 4fb7e513f5d..d1eb60fbb71 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp @@ -60,7 +60,7 @@ public: events.ScheduleEvent(EVENT_STUN_BOMB, 16 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp index ce19a03571a..1f7e3697a6d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp @@ -61,7 +61,7 @@ public: events.ScheduleEvent(EVENT_THUNDERCLAP, 9 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp index f93466cbece..99e87dc617b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp @@ -62,7 +62,7 @@ public: events.ScheduleEvent(EVENT_CLEAVE, 14 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp index 88a09d57138..843679b460d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp @@ -61,7 +61,7 @@ public: events.ScheduleEvent(EVENT_TERRIFYING_ROAR, 23 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp index 2dc05799e51..a3891ef8590 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp @@ -70,7 +70,7 @@ public: events.ScheduleEvent(EVENT_THROW_AXE, 1 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp index ff97984fa09..fdb73fe1196 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp @@ -49,6 +49,12 @@ public: uint64 Gyth; uint64 TheBeast; uint64 GeneralDrakkisath; + uint64 go_emberseerin; + uint64 go_doors; + uint64 go_emberseerout; + uint64 go_roomrunes[MAX_DRAGONSPIRE_HALL_RUNES]; + uint8 Runemaxprotectors[MAX_DRAGONSPIRE_HALL_RUNES]; + uint8 Runeprotectorsdead[MAX_DRAGONSPIRE_HALL_RUNES]; void Initialize() { @@ -67,6 +73,9 @@ public: Gyth = 0; TheBeast = 0; GeneralDrakkisath = 0; + go_emberseerin = 0; + go_doors = 0; + go_emberseerout = 0; } bool IsEncounterInProgress() const @@ -125,7 +134,11 @@ public: case NPC_GENERAL_DRAKKISATH: GeneralDrakkisath = creature->GetGUID(); break; - } + case NPC_BLACKHAND_DREADWEAVER: + case NPC_BLACKHAND_SUMMONER: + case NPC_BLACKHAND_VETERAN: + break; + } } void OnGameObjectCreate(GameObject* go) @@ -135,6 +148,36 @@ public: case GO_WHELP_SPAWNER: go->CastSpell(NULL, SPELL_SUMMON_ROOKERY_WHELP); break; + case GO_EMBERSEER_IN: + go_emberseerin = go->GetGUID(); + break; + case GO_DOORS: + go_doors = go->GetGUID(); + break; + case GO_EMBERSEER_OUT: + go_emberseerout = go->GetGUID(); + break; + case GO_ROOM_1_RUNE: + go_roomrunes[0] = go->GetGUID(); + break; + case GO_ROOM_2_RUNE: + go_roomrunes[1] = go->GetGUID(); + break; + case GO_ROOM_3_RUNE: + go_roomrunes[2] = go->GetGUID(); + break; + case GO_ROOM_4_RUNE: + go_roomrunes[3] = go->GetGUID(); + break; + case GO_ROOM_5_RUNE: + go_roomrunes[4] = go->GetGUID(); + break; + case GO_ROOM_6_RUNE: + go_roomrunes[5] = go->GetGUID(); + break; + case GO_ROOM_7_RUNE: + go_roomrunes[6] = go->GetGUID(); + break; } } @@ -167,6 +210,18 @@ public: return true; } + void ProcessEvent(WorldObject* /*gameObject*/, uint32 eventId) + { + switch (eventId) + { + case EVENT_PYROGUARD_EMBERSEER: + SetBossState(DATA_PYROGAURD_EMBERSEER,IN_PROGRESS); + break; + default: + break; + } + } + uint64 GetData64(uint32 type) { switch (type) @@ -199,6 +254,26 @@ public: return TheBeast; case DATA_GENERAL_DRAKKISATH: return GeneralDrakkisath; + case GO_EMBERSEER_IN: + return go_emberseerin; + case GO_DOORS: + return go_doors; + case GO_EMBERSEER_OUT: + return go_emberseerout; + case GO_ROOM_1_RUNE: + return go_roomrunes[0]; + case GO_ROOM_2_RUNE: + return go_roomrunes[1]; + case GO_ROOM_3_RUNE: + return go_roomrunes[2]; + case GO_ROOM_4_RUNE: + return go_roomrunes[3]; + case GO_ROOM_5_RUNE: + return go_roomrunes[4]; + case GO_ROOM_6_RUNE: + return go_roomrunes[5]; + case GO_ROOM_7_RUNE: + return go_roomrunes[6]; } return 0; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp index 7a4ba5777d1..af0dfd38ae8 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -59,10 +59,10 @@ public: void Reset() { - Cleave_Timer = 8000; // These times are probably wrong - BlastWave_Timer = 12000; - MortalStrike_Timer = 20000; - KnockBack_Timer = 30000; + Cleave_Timer = 8000; // These times are probably wrong + BlastWave_Timer = 12000; + MortalStrike_Timer = 20000; + KnockBack_Timer = 30000; } void EnterCombat(Unit* /*who*/) diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp index 818dcace078..a3eb0cea5ad 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp @@ -245,7 +245,7 @@ public: Unit* unit; if ((*i) && (*i)->getSource()) { - unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit) { //Cast affliction diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index c4e0d6ea715..5d4cc442a49 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp @@ -92,15 +92,15 @@ public: void Reset() { - ShadowFlame_Timer = 12000; // These times are probably wrong - BellowingRoar_Timer = 30000; - VeilOfShadow_Timer = 15000; - Cleave_Timer = 7000; - TailLash_Timer = 10000; - ClassCall_Timer = 35000; // 35-40 seconds + ShadowFlame_Timer = 12000; // These times are probably wrong + BellowingRoar_Timer = 30000; + VeilOfShadow_Timer = 15000; + Cleave_Timer = 7000; + TailLash_Timer = 10000; + ClassCall_Timer = 35000; // 35-40 seconds Phase3 = false; - DespawnTimer = 5000; + DespawnTimer = 5000; } void KilledUnit(Unit* Victim) @@ -111,7 +111,7 @@ public: DoScriptText(SAY_SLAY, me, Victim); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp index a4fb4ad22a3..24fc74cc7cb 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp @@ -75,7 +75,7 @@ public: DoZoneInCombat(); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp index 4a72bd0ca38..eaa8c118f19 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp @@ -51,20 +51,20 @@ class boss_vaelastrasz : public CreatureScript public: boss_vaelastrasz() : CreatureScript("boss_vaelastrasz") { } - void SendDefaultMenu(Player* player, Creature* creature, uint32 Action) + void SendDefaultMenu(Player* player, Creature* creature, uint32 action) { - if (Action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time { player->CLOSE_GOSSIP_MENU(); CAST_AI(boss_vaelastrasz::boss_vaelAI, creature->AI())->BeginSpeech(player); } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 Action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (Sender == GOSSIP_SENDER_MAIN) - SendDefaultMenu(player, creature, Action); + if (sender == GOSSIP_SENDER_MAIN) + SendDefaultMenu(player, creature, action); return true; } @@ -108,17 +108,17 @@ public: void Reset() { - PlayerGUID = 0; - SpeechTimer = 0; - SpeechNum = 0; - Cleave_Timer = 8000; //These times are probably wrong - FlameBreath_Timer = 11000; - BurningAdrenalineCaster_Timer = 15000; - BurningAdrenalineTank_Timer = 45000; - FireNova_Timer = 5000; - TailSwipe_Timer = 20000; - HasYelled = false; - DoingSpeech = false; + PlayerGUID = 0; + SpeechTimer = 0; + SpeechNum = 0; + Cleave_Timer = 8000; // These times are probably wrong + FlameBreath_Timer = 11000; + BurningAdrenalineCaster_Timer = 15000; + BurningAdrenalineTank_Timer = 45000; + FireNova_Timer = 5000; + TailSwipe_Timer = 20000; + HasYelled = false; + DoingSpeech = false; } void BeginSpeech(Unit* target) @@ -176,9 +176,9 @@ public: break; case 2: me->setFaction(103); - if (PlayerGUID && Unit::GetUnit((*me), PlayerGUID)) + if (PlayerGUID && Unit::GetUnit(*me, PlayerGUID)) { - AttackStart(Unit::GetUnit((*me), PlayerGUID)); + AttackStart(Unit::GetUnit(*me, PlayerGUID)); DoCast(me, SPELL_ESSENCEOFTHERED); } SpeechTimer = 0; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp index 2c7cd73c604..668b84d38dd 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -83,10 +83,10 @@ class boss_victor_nefarius : public CreatureScript public: boss_victor_nefarius() : CreatureScript("boss_victor_nefarius") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 Action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (Action) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -220,13 +220,13 @@ public: void Reset() { - SpawnedAdds = 0; - AddSpawnTimer = 10000; - ShadowBoltTimer = 5000; - FearTimer = 8000; - ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier - NefarianGUID = 0; - NefCheckTime = 2000; + SpawnedAdds = 0; + AddSpawnTimer = 10000; + ShadowBoltTimer = 5000; + FearTimer = 8000; + ResetTimer = 900000; // On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier + NefarianGUID = 0; + NefCheckTime = 2000; me->SetUInt32Value(UNIT_NPC_FLAGS, 1); me->setFaction(35); diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 5af9dd2f23e..5dc3b52dec1 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -84,7 +84,6 @@ set(scripts_STAT_SRCS EasternKingdoms/MoltenCore/instance_molten_core.cpp EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp EasternKingdoms/MoltenCore/boss_magmadar.cpp - EasternKingdoms/MoltenCore/molten_core.cpp EasternKingdoms/MoltenCore/boss_shazzrah.cpp EasternKingdoms/Stratholme/boss_baroness_anastari.cpp EasternKingdoms/Stratholme/boss_nerubenkan.cpp diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp index 9830563ac87..4885d8620b0 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -127,7 +127,7 @@ public: DoCastAOE(SPELL_SMITE_STOMP, false); SetCombatMovement(false); if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_SMITE_CHEST))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_SMITE_CHEST))) { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ()); @@ -158,7 +158,6 @@ public: me->GetMotionMaster()->MoveChase(me->getVictim(), me->m_CombatDistance); uiPhase = 0; break; - } } else uiTimer -= uiDiff; } @@ -174,9 +173,7 @@ public: uiTimer = 1500; uiPhase = 1; } - }; - }; void AddSC_boss_mr_smite() diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp index fffd8d41264..6c6b0647c5f 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp @@ -45,17 +45,16 @@ public: player->GetSession()->SendNotification("Instance script not initialized"); return true; } - if (instance->GetData(EVENT_STATE)!= CANNON_NOT_USED) + + if (instance->GetData(EVENT_STATE) != CANNON_NOT_USED) return false; + if (targets.GetGOTarget() && targets.GetGOTarget()->GetEntry() == GO_DEFIAS_CANNON) - { instance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED); - } player->DestroyItemCount(item->GetEntry(), 1, true); return true; } - }; void AddSC_deadmines() diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h index 55726fb2a8e..419af40ee36 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h @@ -47,4 +47,3 @@ enum GameObjects GO_MR_SMITE_CHEST = 144111 }; #endif - diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index 1b037be8afa..46e84481fee 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -156,7 +156,7 @@ class instance_deadmines : public InstanceMapScript void MoveCreatureInside(Creature* creature) { - creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + creature->SetWalk(false); creature->GetMotionMaster()->MovePoint(0, -102.7f, -655.9f, creature->GetPositionZ()); } diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index cd5566007ee..b5a7984d945 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -95,10 +95,10 @@ public: return new npc_blastmaster_emi_shortfuseAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { if (npc_escortAI* pEscortAI = CAST_AI(npc_blastmaster_emi_shortfuse::npc_blastmaster_emi_shortfuseAI, creature->AI())) pEscortAI->Start(true, false, player->GetGUID()); @@ -189,11 +189,11 @@ public: if (bBool) { if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) instance->HandleGameObject(0, false, go); }else if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) instance->HandleGameObject(0, false, go); } @@ -204,10 +204,10 @@ public: if (bBool) { - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) me->SetFacingToObject(go); }else - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) me->SetFacingToObject(go); } @@ -216,10 +216,10 @@ public: if (!instance) return; - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) instance->HandleGameObject(0, false, go); - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) instance->HandleGameObject(0, false, go); if (!GoSummonList.empty()) @@ -266,14 +266,14 @@ public: } } - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { //just in case if (GetPlayerForEscort()) if (me->getFaction() != GetPlayerForEscort()->getFaction()) me->setFaction(GetPlayerForEscort()->getFaction()); - switch (uiPoint) + switch (waypointId) { case 3: SetEscortPaused(true); @@ -445,7 +445,7 @@ public: DoScriptText(SAY_BLASTMASTER_5, me); Summon(1); if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) instance->HandleGameObject(0, true, go); NextStep(3000, true); break; @@ -491,7 +491,7 @@ public: DoScriptText(SAY_BLASTMASTER_23, me); SetInFace(false); if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) instance->HandleGameObject(0, true, go); NextStep(2000, true); break; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp index b1fa4d54eb6..96bda019f6a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp @@ -55,7 +55,7 @@ public: struct boss_curatorAI : public ScriptedAI { - boss_curatorAI(Creature* c) : ScriptedAI(c) {} + boss_curatorAI(Creature* creature) : ScriptedAI(creature) {} uint32 AddTimer; uint32 HatefulBoltTimer; @@ -80,7 +80,7 @@ public: DoScriptText(RAND(SAY_KILL1, SAY_KILL2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp index 66de84abbc2..e19efc7c4e5 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp @@ -51,7 +51,7 @@ public: struct boss_maiden_of_virtueAI : public ScriptedAI { - boss_maiden_of_virtueAI(Creature* c) : ScriptedAI(c) {} + boss_maiden_of_virtueAI(Creature* creature) : ScriptedAI(creature) {} uint32 Repentance_Timer; uint32 Holyfire_Timer; @@ -78,7 +78,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 65b758b55e7..2bba875ad1f 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -58,7 +58,7 @@ public: struct boss_attumenAI : public ScriptedAI { - boss_attumenAI(Creature* c) : ScriptedAI(c) + boss_attumenAI(Creature* creature) : ScriptedAI(creature) { Phase = 1; @@ -89,7 +89,7 @@ public: DoScriptText(RAND(SAY_KILL1, SAY_KILL2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); if (Unit* pMidnight = Unit::GetUnit(*me, Midnight)) @@ -119,7 +119,7 @@ public: struct boss_midnightAI : public ScriptedAI { - boss_midnightAI(Creature* c) : ScriptedAI(c) {} + boss_midnightAI(Creature* creature) : ScriptedAI(creature) {} uint64 Attumen; uint8 Phase; @@ -185,7 +185,7 @@ public: pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim()); pAttumen->SetTarget(pAttumen->getVictim()->GetGUID()); } - pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X, 1); + pAttumen->SetObjectScale(1); } } else Mount_Timer -= diff; } @@ -203,16 +203,16 @@ public: pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); float angle = me->GetAngle(pAttumen); float distance = me->GetDistance2d(pAttumen); - float newX = me->GetPositionX() + cos(angle)*(distance/2) ; - float newY = me->GetPositionY() + sin(angle)*(distance/2) ; + float newX = me->GetPositionX() + cos(angle)*(distance/2); + float newY = me->GetPositionY() + sin(angle)*(distance/2); float newZ = 50; //me->Relocate(newX, newY, newZ, angle); //me->SendMonsterMove(newX, newY, newZ, 0, true, 1000); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(0, newX, newY, newZ); distance += 10; - newX = me->GetPositionX() + cos(angle)*(distance/2) ; - newY = me->GetPositionY() + sin(angle)*(distance/2) ; + newX = me->GetPositionX() + cos(angle)*(distance/2); + newY = me->GetPositionY() + sin(angle)*(distance/2); pAttumen->GetMotionMaster()->Clear(); pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ); //pAttumen->Relocate(newX, newY, newZ, -angle); @@ -244,8 +244,8 @@ void boss_attumen::boss_attumenAI::UpdateAI(const uint32 diff) Midnight = 0; me->SetVisible(false); me->Kill(me); - } - } else ResetTimer -= diff; + } else ResetTimer -= diff; + } //Return since we have no target if (!UpdateVictim()) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 484515be0f8..f69cecdb4c3 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -72,13 +72,12 @@ public: struct boss_moroesAI : public ScriptedAI { - boss_moroesAI(Creature* c) : ScriptedAI(c) + boss_moroesAI(Creature* creature) : ScriptedAI(creature) { for (uint8 i = 0; i < 4; ++i) - { AddId[i] = 0; - } - instance = c->GetInstanceScript(); + + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -136,7 +135,7 @@ public: DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2, SAY_KILL_3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -202,7 +201,7 @@ public: void DeSpawnAdds() { - for (uint8 i = 0; i < 4 ; ++i) + for (uint8 i = 0; i < 4; ++i) { Creature* Temp = NULL; if (AddGUID[i]) @@ -322,12 +321,12 @@ struct boss_moroes_guestAI : public ScriptedAI uint64 GuestGUID[4]; - boss_moroes_guestAI(Creature* c) : ScriptedAI(c) + boss_moroes_guestAI(Creature* creature) : ScriptedAI(creature) { for (uint8 i = 0; i < 4; ++i) GuestGUID[i] = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } void Reset() @@ -359,7 +358,7 @@ struct boss_moroes_guestAI : public ScriptedAI uint64 TempGUID = GuestGUID[rand()%4]; if (TempGUID) { - Unit* unit = Unit::GetUnit((*me), TempGUID); + Unit* unit = Unit::GetUnit(*me, TempGUID); if (unit && unit->isAlive()) return unit; } @@ -417,7 +416,7 @@ public: struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI { //Shadow Priest - boss_baroness_dorothea_millstipeAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_baroness_dorothea_millstipeAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 ManaBurn_Timer; uint32 MindFlay_Timer; @@ -481,7 +480,7 @@ public: struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI { //Retr Pally - boss_baron_rafe_dreugerAI(Creature* c) : boss_moroes_guestAI(c){} + boss_baron_rafe_dreugerAI(Creature* creature) : boss_moroes_guestAI(creature){} uint32 HammerOfJustice_Timer; uint32 SealOfCommand_Timer; @@ -539,7 +538,7 @@ public: struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI { //Holy Priest - boss_lady_catriona_von_indiAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lady_catriona_von_indiAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 DispelMagic_Timer; uint32 GreaterHeal_Timer; @@ -610,7 +609,7 @@ public: struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI { //Holy Pally - boss_lady_keira_berrybuckAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lady_keira_berrybuckAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 Cleanse_Timer; uint32 GreaterBless_Timer; @@ -685,7 +684,7 @@ public: struct boss_lord_robin_darisAI : public boss_moroes_guestAI { //Arms Warr - boss_lord_robin_darisAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lord_robin_darisAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 Hamstring_Timer; uint32 MortalStrike_Timer; @@ -742,7 +741,7 @@ public: struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI { //Arms Warr - boss_lord_crispin_ferenceAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lord_crispin_ferenceAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 Disarm_Timer; uint32 HeroicStrike_Timer; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp index c1fe9c9c56c..f89abca76cf 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp @@ -70,9 +70,9 @@ public: struct boss_netherspiteAI : public ScriptedAI { - boss_netherspiteAI(Creature* c) : ScriptedAI(c) + boss_netherspiteAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); for (int i=0; i<3; ++i) { diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 728446aa833..ded5e6903a5 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -70,9 +70,9 @@ public: struct boss_nightbaneAI : public ScriptedAI { - boss_nightbaneAI(Creature* c) : ScriptedAI(c) + boss_nightbaneAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Intro = true; } @@ -121,8 +121,8 @@ public: MovePhase = 0; me->SetSpeed(MOVE_RUN, 2.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetDisableGravity(true); + me->SetWalk(false); me->setActive(true); if (instance) @@ -240,7 +240,7 @@ public: me->InterruptSpell(CURRENT_GENERIC_SPELL); me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); (*me).GetMotionMaster()->Clear(false); (*me).GetMotionMaster()->MovePoint(0, IntroWay[2][0], IntroWay[2][1], IntroWay[2][2]); @@ -263,7 +263,7 @@ public: { if (MovePhase >= 7) { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]); } @@ -277,7 +277,7 @@ public: { if (MovePhase >= 7) { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 14add92fd16..4700ad71fab 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -108,7 +108,7 @@ public: struct netherspite_infernalAI : public ScriptedAI { - netherspite_infernalAI(Creature* c) : ScriptedAI(c), + netherspite_infernalAI(Creature* creature) : ScriptedAI(creature), HellfireTimer(0), CleanupTimer(0), malchezaar(0), point(NULL) {} uint32 HellfireTimer; @@ -183,9 +183,9 @@ public: struct boss_malchezaarAI : public ScriptedAI { - boss_malchezaarAI(Creature* c) : ScriptedAI(c) + boss_malchezaarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -243,7 +243,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -297,7 +297,7 @@ public: SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); //damage - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg); me->UpdateDamagePhysical(BASE_ATTACK); @@ -420,7 +420,7 @@ public: SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE); //damage - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg); me->UpdateDamagePhysical(BASE_ATTACK); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 119cb7d9de6..d95b4aa3ae1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -24,7 +24,6 @@ SDCategory: Karazhan EndScriptData */ #include "ScriptPCH.h" -#include "ScriptedSimpleAI.h" #include "karazhan.h" #include "GameObject.h" @@ -93,9 +92,9 @@ public: struct boss_aranAI : public ScriptedAI { - boss_aranAI(Creature* c) : ScriptedAI(c) + boss_aranAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -162,7 +161,7 @@ public: DoScriptText(RAND(SAY_KILL1, SAY_KILL2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -523,7 +522,7 @@ public: struct water_elementalAI : public ScriptedAI { - water_elementalAI(Creature* c) : ScriptedAI(c) {} + water_elementalAI(Creature* creature) : ScriptedAI(creature) {} uint32 CastTimer; @@ -549,33 +548,8 @@ public: }; -// CONVERT TO ACID -class mob_shadow_of_aran : public CreatureScript -{ -public: - mob_shadow_of_aran() : CreatureScript("mob_shadow_of_aran") { } - - CreatureAI* GetAI(Creature* creature) const - { - sLog->outString("TSCR: Convert simpleAI script for Creature Entry %u to ACID", creature->GetEntry()); - SimpleAI* ai = new SimpleAI (creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO; - ai->Spell[0].Cooldown = 5000; - ai->Spell[0].First_Cast = 1000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->EnterEvadeMode(); - - return ai; - } - -}; - void AddSC_boss_shade_of_aran() { new boss_shade_of_aran(); - new mob_shadow_of_aran(); new mob_aran_elemental(); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index 15750c5b9c5..2f19d2c7fc1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -68,9 +68,9 @@ public: struct mob_kilrekAI : public ScriptedAI { - mob_kilrekAI(Creature* c) : ScriptedAI(c) + mob_kilrekAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -94,14 +94,14 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { uint64 TerestianGUID = instance->GetData64(DATA_TERESTIAN); if (TerestianGUID) { - Unit* Terestian = Unit::GetUnit((*me), TerestianGUID); + Unit* Terestian = Unit::GetUnit(*me, TerestianGUID); if (Terestian && Terestian->isAlive()) DoCast(Terestian, SPELL_BROKEN_PACT, true); } @@ -140,7 +140,7 @@ public: struct mob_demon_chainAI : public ScriptedAI { - mob_demon_chainAI(Creature* c) : ScriptedAI(c) {} + mob_demon_chainAI(Creature* creature) : ScriptedAI(creature) {} uint64 SacrificeGUID; @@ -157,7 +157,7 @@ public: { if (SacrificeGUID) { - Unit* Sacrifice = Unit::GetUnit((*me), SacrificeGUID); + Unit* Sacrifice = Unit::GetUnit(*me, SacrificeGUID); if (Sacrifice) Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE); } @@ -178,7 +178,7 @@ public: struct mob_fiendish_portalAI : public PassiveAI { - mob_fiendish_portalAI(Creature* c) : PassiveAI(c), summons(me){} + mob_fiendish_portalAI(Creature* creature) : PassiveAI(creature), summons(me){} SummonList summons; @@ -215,7 +215,7 @@ public: struct mob_fiendish_impAI : public ScriptedAI { - mob_fiendish_impAI(Creature* c) : ScriptedAI(c) {} + mob_fiendish_impAI(Creature* creature) : ScriptedAI(creature) {} uint32 FireboltTimer; @@ -258,11 +258,11 @@ public: struct boss_terestianAI : public ScriptedAI { - boss_terestianAI(Creature* c) : ScriptedAI(c) + boss_terestianAI(Creature* creature) : ScriptedAI(creature) { for (uint8 i = 0; i < 2; ++i) PortalGUID[i] = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index b15cb7d3da1..6f8121ef5b6 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -114,9 +114,9 @@ public: struct boss_dorotheeAI : public ScriptedAI { - boss_dorotheeAI(Creature* c) : ScriptedAI(c) + boss_dorotheeAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -229,7 +229,7 @@ public: struct mob_titoAI : public ScriptedAI { - mob_titoAI(Creature* c) : ScriptedAI(c) {} + mob_titoAI(Creature* creature) : ScriptedAI(creature) {} uint64 DorotheeGUID; uint32 YipTimer; @@ -296,9 +296,9 @@ public: struct boss_strawmanAI : public ScriptedAI { - boss_strawmanAI(Creature* c) : ScriptedAI(c) + boss_strawmanAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -411,9 +411,9 @@ public: struct boss_tinheadAI : public ScriptedAI { - boss_tinheadAI(Creature* c) : ScriptedAI(c) + boss_tinheadAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -521,9 +521,9 @@ public: struct boss_roarAI : public ScriptedAI { - boss_roarAI(Creature* c) : ScriptedAI(c) + boss_roarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -630,9 +630,9 @@ public: struct boss_croneAI : public ScriptedAI { - boss_croneAI(Creature* c) : ScriptedAI(c) + boss_croneAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -712,7 +712,7 @@ public: struct mob_cycloneAI : public ScriptedAI { - mob_cycloneAI(Creature* c) : ScriptedAI(c) {} + mob_cycloneAI(Creature* creature) : ScriptedAI(creature) {} uint32 MoveTimer; @@ -769,10 +769,10 @@ class npc_grandmother : public CreatureScript public: npc_grandmother() : CreatureScript("npc_grandmother") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { if (Creature* pBigBadWolf = creature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS)) pBigBadWolf->AI()->AttackStart(player); @@ -805,9 +805,9 @@ public: struct boss_bigbadwolfAI : public ScriptedAI { - boss_bigbadwolfAI(Creature* c) : ScriptedAI(c) + boss_bigbadwolfAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -886,7 +886,7 @@ public: { IsChasing = false; - if (Unit* target = Unit::GetUnit((*me), HoodGUID)) + if (Unit* target = Unit::GetUnit(*me, HoodGUID)) { HoodGUID = 0; if (DoGetThreat(target)) @@ -1004,9 +1004,9 @@ public: struct boss_julianneAI : public ScriptedAI { - boss_julianneAI(Creature* c) : ScriptedAI(c) + boss_julianneAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); EntryYellTimer = 1000; AggroYellTimer = 10000; IsFakingDeath = false; @@ -1127,9 +1127,9 @@ public: struct boss_romuloAI : public ScriptedAI { - boss_romuloAI(Creature* c) : ScriptedAI(c) + boss_romuloAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); EntryYellTimer = 8000; AggroYellTimer = 15000; } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 056a2e95448..b37f6913b8d 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -109,11 +109,11 @@ public: struct npc_barnesAI : public npc_escortAI { - npc_barnesAI(Creature* c) : npc_escortAI(c) + npc_barnesAI(Creature* creature) : npc_escortAI(creature) { RaidWiped = false; m_uiEventId = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -158,12 +158,12 @@ public: void EnterCombat(Unit* /*who*/) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { if (!instance) return; - switch (i) + switch (waypointId) { case 0: DoCast(me, SPELL_TUXEDO, false); @@ -324,12 +324,12 @@ public: } }; - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); npc_barnesAI* pBarnesAI = CAST_AI(npc_barnes::npc_barnesAI, creature->AI()); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -414,10 +414,10 @@ class npc_berthold : public CreatureScript public: npc_berthold() : CreatureScript("npc_berthold") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CastSpell(player, SPELL_TELEPORT, true); player->CLOSE_GOSSIP_MENU(); @@ -474,9 +474,9 @@ public: struct npc_image_of_medivhAI : public ScriptedAI { - npc_image_of_medivhAI(Creature* c) : ScriptedAI(c) + npc_image_of_medivhAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -527,7 +527,7 @@ public: if (!Arcanagos) return; ArcanagosGUID = Arcanagos->GetGUID(); - Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Arcanagos->SetDisableGravity(true); (*Arcanagos).GetMotionMaster()->MovePoint(0, ArcanagosPos[0], ArcanagosPos[1], ArcanagosPos[2]); Arcanagos->SetOrientation(ArcanagosPos[3]); me->SetOrientation(MedivPos[3]); @@ -536,7 +536,7 @@ public: uint32 NextStep(uint32 Step) { - Unit* arca = Unit::GetUnit((*me), ArcanagosGUID); + Unit* arca = Unit::GetUnit(*me, ArcanagosGUID); Map* map = me->GetMap(); switch (Step) { @@ -625,7 +625,7 @@ public: if (Step >= 7 && Step <= 12) { - Unit* arca = Unit::GetUnit((*me), ArcanagosGUID); + Unit* arca = Unit::GetUnit(*me, ArcanagosGUID); if (FireArcanagosTimer <= diff) { diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index dd37f659eec..c53793b6e30 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -89,9 +89,9 @@ public: struct boss_felblood_kaelthasAI : public ScriptedAI { - boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c) + boss_felblood_kaelthasAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -154,14 +154,18 @@ public: if (!instance) return; - instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), true); // Open the encounter door + instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), true); + + // Enable the Translocation Orb Exit + if (GameObject* escapeOrb = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_ESCAPE_ORB))) + escapeOrb->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); } void DamageTaken(Unit* /*done_by*/, uint32 &damage) { if (damage > me->GetHealth()) - RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air. + RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air. } void EnterCombat(Unit* /*who*/) @@ -169,8 +173,8 @@ public: if (!instance) return; + //Close the encounter door, open it in JustDied/Reset instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), false); - //Close the encounter door, open it in JustDied/Reset } void MoveInLineOfSight(Unit* who) @@ -193,7 +197,7 @@ public: std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && unit->isAlive()) { float threat = me->getThreatManager().getThreat(unit); @@ -211,7 +215,7 @@ public: std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) unit->CastSpell(unit, SPELL_TELEPORT_CENTER, true); } @@ -223,7 +227,7 @@ public: std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) // Knockback into the air unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID()); @@ -235,7 +239,7 @@ public: std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { // Also needs an exception in spell system. @@ -254,7 +258,7 @@ public: std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); @@ -439,7 +443,7 @@ public: struct mob_felkael_flamestrikeAI : public ScriptedAI { - mob_felkael_flamestrikeAI(Creature* c) : ScriptedAI(c) + mob_felkael_flamestrikeAI(Creature* creature) : ScriptedAI(creature) { } @@ -481,9 +485,9 @@ public: struct mob_felkael_phoenixAI : public ScriptedAI { - mob_felkael_phoenixAI(Creature* c) : ScriptedAI(c) + mob_felkael_phoenixAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -495,7 +499,7 @@ public: void Reset() { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); DoCast(me, SPELL_PHOENIX_BURN, true); BurnTimer = 2000; Death_Timer = 3000; @@ -542,7 +546,7 @@ public: } - void JustDied(Unit* /*slayer*/) + void JustDied(Unit* /*killer*/) { me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); } @@ -601,7 +605,7 @@ public: struct mob_felkael_phoenix_eggAI : public ScriptedAI { - mob_felkael_phoenix_eggAI(Creature* c) : ScriptedAI(c) {} + mob_felkael_phoenix_eggAI(Creature* creature) : ScriptedAI(creature) {} uint32 HatchTimer; @@ -638,7 +642,7 @@ public: struct mob_arcane_sphereAI : public ScriptedAI { - mob_arcane_sphereAI(Creature* c) : ScriptedAI(c) { Reset(); } + mob_arcane_sphereAI(Creature* creature) : ScriptedAI(creature) { Reset(); } uint32 DespawnTimer; uint32 ChangeTargetTimer; @@ -649,7 +653,7 @@ public: ChangeTargetTimer = urand(6000, 12000); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->setFaction(14); DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true); } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index b9d4f600329..883932fdb9b 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -99,9 +99,9 @@ public: struct boss_priestess_delrissaAI : public ScriptedAI { - boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c) + boss_priestess_delrissaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID)); LackeyEntryList.clear(); } @@ -341,9 +341,9 @@ enum eHealingPotion //all 8 possible lackey use this common struct boss_priestess_lackey_commonAI : public ScriptedAI { - boss_priestess_lackey_commonAI(Creature* c) : ScriptedAI(c) + boss_priestess_lackey_commonAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); memset(&m_auiLackeyGUIDs, 0, sizeof(m_auiLackeyGUIDs)); AcquireGUIDs(); } @@ -495,7 +495,7 @@ public: struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI { //Rogue - boss_kagani_nightstrikeAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_kagani_nightstrikeAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Gouge_Timer; uint32 Kick_Timer; @@ -600,7 +600,7 @@ public: struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI { //Warlock - boss_ellris_duskhallowAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_ellris_duskhallowAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Immolate_Timer; uint32 Shadow_Bolt_Timer; @@ -692,7 +692,7 @@ public: struct boss_eramas_brightblazeAI : public boss_priestess_lackey_commonAI { //Monk - boss_eramas_brightblazeAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_eramas_brightblazeAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Knockdown_Timer; uint32 Snap_Kick_Timer; @@ -754,7 +754,7 @@ public: struct boss_yazzaiAI : public boss_priestess_lackey_commonAI { //Mage - boss_yazzaiAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_yazzaiAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} bool HasIceBlocked; @@ -885,7 +885,7 @@ public: struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI { //Warrior - boss_warlord_salarisAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_warlord_salarisAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Intercept_Stun_Timer; uint32 Disarm_Timer; @@ -1006,7 +1006,10 @@ public: struct boss_garaxxasAI : public boss_priestess_lackey_commonAI { //Hunter - boss_garaxxasAI(Creature* c) : boss_priestess_lackey_commonAI(c) { m_uiPetGUID = 0; } + boss_garaxxasAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) + { + m_uiPetGUID = 0; + } uint64 m_uiPetGUID; @@ -1126,7 +1129,7 @@ public: struct boss_apokoAI : public boss_priestess_lackey_commonAI { //Shaman - boss_apokoAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_apokoAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Totem_Timer; uint8 Totem_Amount; @@ -1225,7 +1228,7 @@ public: struct boss_zelfanAI : public boss_priestess_lackey_commonAI { //Engineer - boss_zelfanAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_zelfanAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Goblin_Dragon_Gun_Timer; uint32 Rocket_Launch_Timer; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index fa97e4eefc0..af7deda4545 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -63,9 +63,9 @@ public: struct boss_selin_fireheartAI : public ScriptedAI { - boss_selin_fireheartAI(Creature* c) : ScriptedAI(c) + boss_selin_fireheartAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Crystals.clear(); //GUIDs per instance is static, so we only need to load them once. @@ -171,7 +171,7 @@ public: float x, y, z; // coords that we move to, close to the crystal. CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->GetMotionMaster()->MovePoint(1, x, y, z); DrainingCrystal = true; } @@ -333,7 +333,7 @@ public: struct mob_fel_crystalAI : public ScriptedAI { - mob_fel_crystalAI(Creature* c) : ScriptedAI(c) {} + mob_fel_crystalAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index 5f3716d9dea..327c611b2d6 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -71,9 +71,9 @@ public: struct boss_vexallusAI : public ScriptedAI { - boss_vexallusAI(Creature* c) : ScriptedAI(c) + boss_vexallusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -101,7 +101,7 @@ public: DoScriptText(SAY_KILL, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_VEXALLUS_EVENT, DONE); @@ -206,7 +206,7 @@ public: struct mob_pure_energyAI : public ScriptedAI { - mob_pure_energyAI(Creature* c) : ScriptedAI(c) {} + mob_pure_energyAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index 642f7955b2e..aa43cb3702f 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -35,6 +35,25 @@ EndScriptData */ 3 - Kael'thas Sunstrider */ +enum Creatures +{ + NPC_SELIN = 24723, + NPC_DELRISSA = 24560, + NPC_FELCRYSTALS = 24722 +}; + +enum GameObjects +{ + GO_VEXALLUS_DOOR = 187896, + GO_SELIN_DOOR = 187979, + GO_SELIN_ENCOUNTER_DOOR = 188065, + GO_DELRISSA_DOOR = 187770, + GO_KAEL_DOOR = 188064, + GO_KAEL_STATUE_1 = 188165, + GO_KAEL_STATUE_2 = 188166, + GO_ESCAPE_ORB = 188173 +}; + class instance_magisters_terrace : public InstanceMapScript { public: @@ -49,7 +68,7 @@ public: { instance_magisters_terrace_InstanceMapScript(Map* map) : InstanceScript(map) {} - uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 Encounter[MAX_ENCOUNTER]; uint32 DelrissaDeathCount; std::list<uint64> FelCrystals; @@ -63,12 +82,13 @@ public: uint64 DelrissaDoorGUID; uint64 KaelDoorGUID; uint64 KaelStatue[2]; + uint64 EscapeOrbGUID; bool InitializedItr; void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&Encounter, 0, sizeof(Encounter)); FelCrystals.clear(); @@ -83,6 +103,7 @@ public: KaelDoorGUID = 0; KaelStatue[0] = 0; KaelStatue[1] = 0; + EscapeOrbGUID = 0; InitializedItr = false; } @@ -90,7 +111,7 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) + if (Encounter[i] == IN_PROGRESS) return true; return false; } @@ -99,12 +120,18 @@ public: { switch (identifier) { - case DATA_SELIN_EVENT: return m_auiEncounter[0]; - case DATA_VEXALLUS_EVENT: return m_auiEncounter[1]; - case DATA_DELRISSA_EVENT: return m_auiEncounter[2]; - case DATA_KAELTHAS_EVENT: return m_auiEncounter[3]; - case DATA_DELRISSA_DEATH_COUNT: return DelrissaDeathCount; - case DATA_FEL_CRYSTAL_SIZE: return FelCrystals.size(); + case DATA_SELIN_EVENT: + return Encounter[0]; + case DATA_VEXALLUS_EVENT: + return Encounter[1]; + case DATA_DELRISSA_EVENT: + return Encounter[2]; + case DATA_KAELTHAS_EVENT: + return Encounter[3]; + case DATA_DELRISSA_DEATH_COUNT: + return DelrissaDeathCount; + case DATA_FEL_CRYSTAL_SIZE: + return FelCrystals.size(); } return 0; } @@ -113,21 +140,24 @@ public: { switch (identifier) { - case DATA_SELIN_EVENT: m_auiEncounter[0] = data; break; + case DATA_SELIN_EVENT: + Encounter[0] = data; + break; case DATA_VEXALLUS_EVENT: if (data == DONE) DoUseDoorOrButton(VexallusDoorGUID); - m_auiEncounter[1] = data; + Encounter[1] = data; break; case DATA_DELRISSA_EVENT: if (data == DONE) DoUseDoorOrButton(DelrissaDoorGUID); if (data == IN_PROGRESS) DelrissaDeathCount = 0; - m_auiEncounter[2] = data; + Encounter[2] = data; + break; + case DATA_KAELTHAS_EVENT: + Encounter[3] = data; break; - case DATA_KAELTHAS_EVENT: m_auiEncounter[3] = data; break; - case DATA_DELRISSA_DEATH_COUNT: if (data == SPECIAL) ++DelrissaDeathCount; @@ -141,9 +171,15 @@ public: { switch (creature->GetEntry()) { - case 24723: SelinGUID = creature->GetGUID(); break; - case 24560: DelrissaGUID = creature->GetGUID(); break; - case 24722: FelCrystals.push_back(creature->GetGUID()); break; + case NPC_SELIN: + SelinGUID = creature->GetGUID(); + break; + case NPC_DELRISSA: + DelrissaGUID = creature->GetGUID(); + break; + case NPC_FELCRYSTALS: + FelCrystals.push_back(creature->GetGUID()); + break; } } @@ -151,15 +187,30 @@ public: { switch (go->GetEntry()) { - case 187896: VexallusDoorGUID = go->GetGUID(); break; - //SunwellRaid Gate 02 - case 187979: SelinDoorGUID = go->GetGUID(); break; - //Assembly Chamber Door - case 188065: SelinEncounterDoorGUID = go->GetGUID(); break; - case 187770: DelrissaDoorGUID = go->GetGUID(); break; - case 188064: KaelDoorGUID = go->GetGUID(); break; - case 188165: KaelStatue[0] = go->GetGUID(); break; - case 188166: KaelStatue[1] = go->GetGUID(); break; + case GO_VEXALLUS_DOOR: + VexallusDoorGUID = go->GetGUID(); + break; + case GO_SELIN_DOOR: + SelinDoorGUID = go->GetGUID(); + break; + case GO_SELIN_ENCOUNTER_DOOR: + SelinEncounterDoorGUID = go->GetGUID(); + break; + case GO_DELRISSA_DOOR: + DelrissaDoorGUID = go->GetGUID(); + break; + case GO_KAEL_DOOR: + KaelDoorGUID = go->GetGUID(); + break; + case GO_KAEL_STATUE_1: + KaelStatue[0] = go->GetGUID(); + break; + case GO_KAEL_STATUE_2: + KaelStatue[1] = go->GetGUID(); + break; + case GO_ESCAPE_ORB: + EscapeOrbGUID = go->GetGUID(); + break; } } @@ -167,15 +218,26 @@ public: { switch (identifier) { - case DATA_SELIN: return SelinGUID; - case DATA_DELRISSA: return DelrissaGUID; - case DATA_VEXALLUS_DOOR: return VexallusDoorGUID; - case DATA_SELIN_DOOR: return SelinDoorGUID; - case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID; - case DATA_DELRISSA_DOOR: return DelrissaDoorGUID; - case DATA_KAEL_DOOR: return KaelDoorGUID; - case DATA_KAEL_STATUE_LEFT: return KaelStatue[0]; - case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1]; + case DATA_SELIN: + return SelinGUID; + case DATA_DELRISSA: + return DelrissaGUID; + case DATA_VEXALLUS_DOOR: + return VexallusDoorGUID; + case DATA_SELIN_DOOR: + return SelinDoorGUID; + case DATA_SELIN_ENCOUNTER_DOOR: + return SelinEncounterDoorGUID; + case DATA_DELRISSA_DOOR: + return DelrissaDoorGUID; + case DATA_KAEL_DOOR: + return KaelDoorGUID; + case DATA_KAEL_STATUE_LEFT: + return KaelStatue[0]; + case DATA_KAEL_STATUE_RIGHT: + return KaelStatue[1]; + case DATA_ESCAPE_ORB: + return EscapeOrbGUID; case DATA_FEL_CRYSTAL: { diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp index 679db023b63..ccaaa0ec68d 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp @@ -56,10 +56,10 @@ class npc_kalecgos : public CreatureScript public: npc_kalecgos() : CreatureScript("npc_kalecgos") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h index dcea4424bf5..78aa14b9102 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h @@ -19,27 +19,31 @@ #ifndef DEF_MAGISTERS_TERRACE_H #define DEF_MAGISTERS_TERRACE_H -#define DATA_SELIN_EVENT 1 -#define DATA_VEXALLUS_EVENT 2 -#define DATA_DELRISSA_EVENT 3 -#define DATA_KAELTHAS_EVENT 4 +#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy." +#endif -#define DATA_SELIN 5 -#define DATA_FEL_CRYSTAL 6 -#define DATA_FEL_CRYSTAL_SIZE 7 +enum Data +{ + DATA_SELIN_EVENT = 0, + DATA_VEXALLUS_EVENT = 1, + DATA_DELRISSA_EVENT = 2, + DATA_KAELTHAS_EVENT = 3, -#define DATA_VEXALLUS_DOOR 8 -#define DATA_SELIN_DOOR 9 -#define DATA_DELRISSA 10 -#define DATA_DELRISSA_DOOR 11 -#define DATA_SELIN_ENCOUNTER_DOOR 12 + DATA_SELIN = 4, + DATA_FEL_CRYSTAL = 5, + DATA_FEL_CRYSTAL_SIZE = 6, -#define DATA_KAEL_DOOR 13 -#define DATA_KAEL_STATUE_LEFT 14 -#define DATA_KAEL_STATUE_RIGHT 15 + DATA_VEXALLUS_DOOR = 7, + DATA_SELIN_DOOR = 8, + DATA_DELRISSA = 9, + DATA_DELRISSA_DOOR = 10, + DATA_SELIN_ENCOUNTER_DOOR = 11, -#define DATA_DELRISSA_DEATH_COUNT 16 + DATA_KAEL_DOOR = 12, + DATA_KAEL_STATUE_LEFT = 13, + DATA_KAEL_STATUE_RIGHT = 14, -#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy." -#endif + DATA_DELRISSA_DEATH_COUNT = 15, + DATA_ESCAPE_ORB = 16 +}; diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp index 862a980394a..f085e15fcb7 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp @@ -200,7 +200,7 @@ class boss_majordomo : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 /*uiAction*/) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) { player->CLOSE_GOSSIP_MENU(); creature->AI()->DoAction(ACTION_START_RAGNAROS); diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp index 47d50925d56..0160f35f143 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp @@ -316,12 +316,12 @@ class mob_son_of_flame : public CreatureScript struct mob_son_of_flameAI : public ScriptedAI //didnt work correctly in EAI for me... { - mob_son_of_flameAI(Creature* c) : ScriptedAI(c) + mob_son_of_flameAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_RAGNAROS_ADDS, 1); diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp index 9f511c1394a..343298d29fe 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp @@ -103,7 +103,7 @@ class boss_sulfuron : public CreatureScript { std::list<Creature*> healers = DoFindFriendlyMissingBuff(45.0f, SPELL_INSPIRE); if (!healers.empty()) - DoCast(SelectRandomContainerElement(healers), SPELL_INSPIRE); + DoCast(Trinity::Containers::SelectRandomContainerElement(healers), SPELL_INSPIRE); DoCast(me, SPELL_INSPIRE); events.ScheduleEvent(EVENT_INSPIRE, urand(20000, 26000)); diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp deleted file mode 100644 index 801a11fbfc8..00000000000 --- a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * - * 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. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/* ScriptData -SDName: Molten_Core -SD%Complete: 100 -SDComment: -SDCategory: Molten Core -EndScriptData */ - -/* ContentData -mob_ancient_core_hound -EndContentData */ - -#include "ScriptPCH.h" -#include "ScriptedSimpleAI.h" - -enum Spells -{ - SPELL_CONE_OF_FIRE = 19630, - SPELL_BITE = 19771, - - //Random Debuff (each hound has only one of these) - SPELL_GROUND_STOMP = 19364, - SPELL_ANCIENT_DREAD = 19365, - SPELL_CAUTERIZING_FLAMES = 19366, - SPELL_WITHERING_HEAT = 19367, - SPELL_ANCIENT_DESPAIR = 19369, - SPELL_ANCIENT_HYSTERIA = 19372 -}; - -class mob_ancient_core_hound : public CreatureScript -{ -public: - mob_ancient_core_hound() : CreatureScript("mob_ancient_core_hound") { } - - CreatureAI* GetAI(Creature* creature) const - { - SimpleAI* ai = new SimpleAI(creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_CONE_OF_FIRE; - ai->Spell[0].Cooldown = 7000; - ai->Spell[0].First_Cast = 10000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - uint32 RandDebuff = RAND(SPELL_GROUND_STOMP, SPELL_ANCIENT_DREAD, SPELL_CAUTERIZING_FLAMES, - SPELL_WITHERING_HEAT, SPELL_ANCIENT_DESPAIR, SPELL_ANCIENT_HYSTERIA); - - ai->Spell[1].Enabled = true; - ai->Spell[1].Spell_Id = RandDebuff; - ai->Spell[1].Cooldown = 24000; - ai->Spell[1].First_Cast = 15000; - ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->Spell[2].Enabled = true; - ai->Spell[2].Spell_Id = SPELL_BITE; - ai->Spell[2].Cooldown = 6000; - ai->Spell[2].First_Cast = 4000; - ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->EnterEvadeMode(); - - return ai; - } -}; - -void AddSC_molten_core() -{ - new mob_ancient_core_hound(); -} diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index a2c8a890feb..bf887bec164 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -102,13 +102,13 @@ public: struct npc_unworthy_initiateAI : public ScriptedAI { - npc_unworthy_initiateAI(Creature* c) : ScriptedAI(c) + npc_unworthy_initiateAI(Creature* creature) : ScriptedAI(creature) { me->SetReactState(REACT_PASSIVE); if (!me->GetEquipmentId()) if (const CreatureTemplate* info = sObjectMgr->GetCreatureTemplate(28406)) if (info->equipmentId) - const_cast<CreatureTemplate*>(me->GetCreatureInfo())->equipmentId = info->equipmentId; + const_cast<CreatureTemplate*>(me->GetCreatureTemplate())->equipmentId = info->equipmentId; } uint64 playerGUID; @@ -293,7 +293,7 @@ public: struct npc_unworthy_initiate_anchorAI : public PassiveAI { - npc_unworthy_initiate_anchorAI(Creature* c) : PassiveAI(c), prisonerGUID(0) {} + npc_unworthy_initiate_anchorAI(Creature* creature) : PassiveAI(creature), prisonerGUID(0) {} uint64 prisonerGUID; @@ -303,9 +303,11 @@ public: prisonerGUID = guid; } - uint64 GetGUID(int32 /*id*/) { return prisonerGUID; } + uint64 GetGUID(int32 /*id*/) + { + return prisonerGUID; + } }; - }; class go_acherus_soul_prison : public GameObjectScript @@ -362,10 +364,10 @@ class npc_death_knight_initiate : public CreatureScript public: npc_death_knight_initiate() : CreatureScript("npc_death_knight_initiate") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); @@ -531,7 +533,7 @@ public: struct npc_dark_rider_of_acherusAI : public ScriptedAI { - npc_dark_rider_of_acherusAI(Creature* c) : ScriptedAI(c) {} + npc_dark_rider_of_acherusAI(Creature* creature) : ScriptedAI(creature) {} uint32 PhaseTimer; uint32 Phase; @@ -587,7 +589,7 @@ public: return; TargetGUID = who->GetGUID(); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->SetSpeed(MOVE_RUN, 0.4f); me->GetMotionMaster()->MoveChase(who); me->SetTarget(TargetGUID); @@ -623,7 +625,7 @@ public: struct npc_salanar_the_horsemanAI : public ScriptedAI { - npc_salanar_the_horsemanAI(Creature* c) : ScriptedAI(c) {} + npc_salanar_the_horsemanAI(Creature* creature) : ScriptedAI(creature) {} void SpellHit(Unit* caster, const SpellInfo* spell) { @@ -662,7 +664,7 @@ public: { CAST_PLR(charmer)->GroupEventHappens(12687, me); charmer->RemoveAurasDueToSpell(SPELL_EFFECT_OVERTAKE); - CAST_CRE(who)->ForcedDespawn(); + CAST_CRE(who)->DespawnOrUnsummon(); //CAST_CRE(who)->Respawn(true); } @@ -692,7 +694,7 @@ public: struct npc_ros_dark_riderAI : public ScriptedAI { - npc_ros_dark_riderAI(Creature* c) : ScriptedAI(c) {} + npc_ros_dark_riderAI(Creature* creature) : ScriptedAI(creature) {} void EnterCombat(Unit* /*who*/) { @@ -702,7 +704,9 @@ public: void Reset() { Creature* deathcharger = me->FindNearestCreature(28782, 30); - if (!deathcharger) return; + if (!deathcharger) + return; + deathcharger->RestoreFaction(); deathcharger->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); deathcharger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -713,7 +717,9 @@ public: void JustDied(Unit* killer) { Creature* deathcharger = me->FindNearestCreature(28782, 30); - if (!deathcharger) return; + if (!deathcharger) + return; + if (killer->GetTypeId() == TYPEID_PLAYER && deathcharger->GetTypeId() == TYPEID_UNIT && deathcharger->IsVehicle()) { deathcharger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); @@ -743,7 +749,7 @@ public: struct npc_dkc1_gothikAI : public ScriptedAI { - npc_dkc1_gothikAI(Creature* c) : ScriptedAI(c) {} + npc_dkc1_gothikAI(Creature* creature) : ScriptedAI(creature) {} void MoveInLineOfSight(Unit* who) { @@ -761,7 +767,7 @@ public: //Todo: Creatures must not be removed, but, must instead // stand next to Gothik and be commanded into the pit // and dig into the ground. - CAST_CRE(who)->ForcedDespawn(); + CAST_CRE(who)->DespawnOrUnsummon(); if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE) owner->RemoveAllMinionsByEntry(GHOULS); @@ -785,7 +791,7 @@ public: struct npc_scarlet_ghoulAI : public ScriptedAI { - npc_scarlet_ghoulAI(Creature* c) : ScriptedAI(c) + npc_scarlet_ghoulAI(Creature* creature) : ScriptedAI(creature) { // Ghouls should display their Birth Animation // Crawling out of the ground @@ -803,11 +809,11 @@ public: { for (std::list<Creature*>::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr) { - if (CAST_CRE(*itr)->GetOwner()->GetGUID() == me->GetOwner()->GetGUID()) + if ((*itr)->GetOwner()->GetGUID() == me->GetOwner()->GetGUID()) { - if (CAST_CRE(*itr)->isInCombat() && CAST_CRE(*itr)->getAttackerForHelper()) + if ((*itr)->isInCombat() && (*itr)->getAttackerForHelper()) { - AttackStart(CAST_CRE(*itr)->getAttackerForHelper()); + AttackStart((*itr)->getAttackerForHelper()); } } } @@ -820,16 +826,13 @@ public: { if (Unit* owner = me->GetOwner()) { - if (owner->GetTypeId() == TYPEID_PLAYER && CAST_PLR(owner)->isInCombat()) + Player* plrOwner = owner->ToPlayer(); + if (plrOwner && plrOwner->isInCombat()) { - if (CAST_PLR(owner)->getAttackerForHelper() && CAST_PLR(owner)->getAttackerForHelper()->GetEntry() == GHOSTS) - { - AttackStart(CAST_PLR(owner)->getAttackerForHelper()); - } + if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == GHOSTS) + AttackStart(plrOwner->getAttackerForHelper()); else - { FindMinions(owner); - } } } } @@ -868,17 +871,17 @@ class npc_scarlet_miner_cart : public CreatureScript public: npc_scarlet_miner_cart() : CreatureScript("npc_scarlet_miner_cart") { } - CreatureAI* GetAI(Creature* _Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new npc_scarlet_miner_cartAI(_Creature); + return new npc_scarlet_miner_cartAI(creature); } struct npc_scarlet_miner_cartAI : public PassiveAI { - npc_scarlet_miner_cartAI(Creature* c) : PassiveAI(c), minerGUID(0) + npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature), minerGUID(0) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->SetDisplayId(me->GetCreatureInfo()->Modelid1); // Modelid2 is a horse. + me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); // Modelid2 is a horse. } uint64 minerGUID; @@ -892,7 +895,7 @@ public: { if (Creature* miner = Unit::GetCreature(*me, minerGUID)) { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); //Not 100% correct, but movement is smooth. Sometimes miner walks faster //than normal, this speed is fast enough to keep up at those times. @@ -924,14 +927,14 @@ class npc_scarlet_miner : public CreatureScript public: npc_scarlet_miner() : CreatureScript("npc_scarlet_miner") { } - CreatureAI* GetAI(Creature* _Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new npc_scarlet_minerAI(_Creature); + return new npc_scarlet_minerAI(creature); } struct npc_scarlet_minerAI : public npc_escortAI { - npc_scarlet_minerAI(Creature* c) : npc_escortAI(c) + npc_scarlet_minerAI(Creature* creature) : npc_escortAI(creature) { me->SetReactState(REACT_PASSIVE); } @@ -988,9 +991,9 @@ public: SetDespawnAtFar(false); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { case 1: if (Unit* car = Unit::GetCreature(*me, carGUID)) @@ -1057,7 +1060,7 @@ class go_inconspicuous_mine_car : public GameObjectScript public: go_inconspicuous_mine_car() : GameObjectScript("go_inconspicuous_mine_car") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestStatus(12701) == QUEST_STATUS_INCOMPLETE) { diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 4583a33a196..1c17e6afa9b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -111,12 +111,33 @@ public: switch (uiSpeech_counter) { - case 1: DoScriptText(SAY_PERSUADED1, me); uiSpeech_timer = 8000; break; - case 2: DoScriptText(SAY_PERSUADED2, me); uiSpeech_timer = 8000; break; - case 3: DoScriptText(SAY_PERSUADED3, me); uiSpeech_timer = 8000; break; - case 4: DoScriptText(SAY_PERSUADED4, me); uiSpeech_timer = 8000; break; - case 5: DoScriptText(SAY_PERSUADED5, player); uiSpeech_timer = 8000; break; - case 6: DoScriptText(SAY_PERSUADED6, me); + case 1: + DoScriptText(SAY_PERSUADED1, me); + uiSpeech_timer = 8000; + break; + + case 2: + DoScriptText(SAY_PERSUADED2, me); + uiSpeech_timer = 8000; + break; + + case 3: + DoScriptText(SAY_PERSUADED3, me); + uiSpeech_timer = 8000; + break; + + case 4: + DoScriptText(SAY_PERSUADED4, me); + uiSpeech_timer = 8000; + break; + + case 5: + DoScriptText(SAY_PERSUADED5, player); + uiSpeech_timer = 8000; + break; + + case 6: + DoScriptText(SAY_PERSUADED6, me); player->Kill(me); //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -218,9 +239,9 @@ public: } } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 0: DoScriptText(SAY_BREAKOUT1, me); @@ -256,9 +277,7 @@ public: void JustSummoned(Creature* summoned) { if (Player* player = GetPlayerForEscort()) - { summoned->AI()->AttackStart(player); - } if (summoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) m_uiValrothGUID = summoned->GetGUID(); @@ -400,7 +419,7 @@ public: switch (uiStage) { case 1: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f)) { DoScriptText(SAY_TREE1, me); @@ -608,48 +627,48 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } - bool MeetQuestCondition(Unit* player) + bool MeetQuestCondition(Player* player) { switch (me->GetEntry()) { case 29061: // Ellen Stanbridge - if (CAST_PLR(player)->GetQuestStatus(12742) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12742) == QUEST_STATUS_INCOMPLETE) return true; break; case 29072: // Kug Ironjaw - if (CAST_PLR(player)->GetQuestStatus(12748) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12748) == QUEST_STATUS_INCOMPLETE) return true; break; case 29067: // Donovan Pulfrost - if (CAST_PLR(player)->GetQuestStatus(12744) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12744) == QUEST_STATUS_INCOMPLETE) return true; break; case 29065: // Yazmina Oakenthorn - if (CAST_PLR(player)->GetQuestStatus(12743) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12743) == QUEST_STATUS_INCOMPLETE) return true; break; case 29071: // Antoine Brack - if (CAST_PLR(player)->GetQuestStatus(12750) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12750) == QUEST_STATUS_INCOMPLETE) return true; break; case 29032: // Malar Bravehorn - if (CAST_PLR(player)->GetQuestStatus(12739) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12739) == QUEST_STATUS_INCOMPLETE) return true; break; case 29068: // Goby Blastenheimer - if (CAST_PLR(player)->GetQuestStatus(12745) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12745) == QUEST_STATUS_INCOMPLETE) return true; break; case 29073: // Iggy Darktusk - if (CAST_PLR(player)->GetQuestStatus(12749) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12749) == QUEST_STATUS_INCOMPLETE) return true; break; case 29074: // Lady Eonys - if (CAST_PLR(player)->GetQuestStatus(12747) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12747) == QUEST_STATUS_INCOMPLETE) return true; break; case 29070: // Valok the Righteous - if (CAST_PLR(player)->GetQuestStatus(12746) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12746) == QUEST_STATUS_INCOMPLETE) return true; break; } @@ -662,7 +681,7 @@ public: if (PlayerGUID || who->GetTypeId() != TYPEID_PLAYER || !who->IsWithinDist(me, INTERACTION_DISTANCE)) return; - if (MeetQuestCondition(who)) + if (MeetQuestCondition(who->ToPlayer())) PlayerGUID = who->GetGUID(); } @@ -704,7 +723,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -732,7 +753,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -760,7 +783,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -788,7 +813,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -816,7 +843,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -844,7 +873,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -872,7 +903,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -900,7 +933,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -928,7 +963,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -956,7 +993,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -978,7 +1017,6 @@ public: } } }; - }; void AddSC_the_scarlet_enclave_c2() diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 81c4b1261ef..8cee23fab1c 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -287,10 +287,10 @@ class npc_highlord_darion_mograine : public CreatureScript public: npc_highlord_darion_mograine() : CreatureScript("npc_highlord_darion_mograine") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -497,17 +497,16 @@ public: SetEscortPaused(bOnHold); } - void WaypointReached(uint32 wpId) + void WaypointReached(uint32 waypointId) { - switch (wpId) + switch (waypointId) { case 0: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); SetHoldState(true); break; case 1: SetHoldState(true); - SpawnNPC(); if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) DoScriptText(SAY_LIGHT_OF_DAWN07, temp); @@ -537,7 +536,7 @@ public: bIsBattle = true; break; case 2: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); DoCast(me, SPELL_THE_LIGHT_OF_DAWN); break; case 3: @@ -551,34 +550,35 @@ public: { if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z); } if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) { if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z); } if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10].x, LightofDawnLoc[10].y, LightofDawnLoc[10].z); } if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z); } if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z); } JumpToNextStep(10000); - } break; + } + break; case 4: DoScriptText(SAY_LIGHT_OF_DAWN27, me); me->SetStandState(UNIT_STAND_STATE_KNEEL); @@ -664,7 +664,7 @@ public: if (uiSummon_counter < ENCOUNTER_GHOUL_NUMBER) { Unit* temp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiGhoulGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -682,7 +682,7 @@ public: if (uiSummon_counter < ENCOUNTER_ABOMINATION_NUMBER) { Unit* temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiAbominationGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -700,7 +700,7 @@ public: if (uiSummon_counter < ENCOUNTER_WARRIOR_NUMBER) { Unit* temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiWarriorGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -718,7 +718,7 @@ public: if (uiSummon_counter < ENCOUNTER_BEHEMOTH_NUMBER) { Unit* temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiBehemothGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -739,17 +739,17 @@ public: SetHoldState(false); if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) { - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } if (Creature* temp = Unit::GetCreature(*me, uiOrbazGUID)) { - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) { - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) @@ -824,7 +824,7 @@ public: if (Unit* temp = me->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { DoScriptText(SAY_LIGHT_OF_DAWN35, temp); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); uiDarionGUID = temp->GetGUID(); } JumpToNextStep(4000); @@ -938,9 +938,9 @@ public: case 33: // Darion supports to jump to lich king here if (Unit::GetCreature(*me, uiLichKingGUID)) DoCast(me, SPELL_MOGRAINE_CHARGE); // jumping charge - // doesn't make it looks well, so workarounds, Darion charges, looks better + // doesn't make it looks well, so workarounds, Darion charges, looks better me->SetSpeed(MOVE_RUN, 3.0f); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); SetHoldState(false); JumpToNextStep(0); break; @@ -1010,10 +1010,9 @@ public: if (fLichPositionX && fLichPositionY) { - Unit* temp; - temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + Unit* temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->setFaction(me->getFaction()); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -1021,7 +1020,7 @@ public: temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->setFaction(me->getFaction()); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -1030,7 +1029,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) { temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); DoScriptText(SAY_LIGHT_OF_DAWN50, temp); @@ -1038,7 +1037,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) { temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -1046,7 +1045,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) { temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); } @@ -1111,7 +1110,7 @@ public: case 46: // Darion stand up, "not today" me->SetSpeed(MOVE_RUN, 1.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->SetStandState(UNIT_STAND_STATE_STAND); DoScriptText(SAY_LIGHT_OF_DAWN53, me); SetHoldState(false); // Darion throws sword @@ -1171,7 +1170,7 @@ public: temp->CastSpell(temp, SPELL_TIRION_CHARGE, false); // jumping charge temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); temp->SetSpeed(MOVE_RUN, 3.0f); // workarounds, make Tirion still running - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2].x, LightofDawnLoc[2].y, LightofDawnLoc[2].z); if (Creature* lktemp = Unit::GetCreature(*me, uiLichKingGUID)) lktemp->Relocate(LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z); // workarounds, he should kick back by Tirion, but here we relocate him @@ -1189,7 +1188,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) { temp->SetSpeed(MOVE_RUN, 1.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29].x, LightofDawnLoc[29].y, LightofDawnLoc[29].z); // 26 } JumpToNextStep(4000); @@ -1249,7 +1248,7 @@ public: case 62: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7].x, LightofDawnLoc[7].y, LightofDawnLoc[7].z); } JumpToNextStep(5500); @@ -1309,7 +1308,6 @@ public: case 71: //if (GameObject* go = me->GetMap()->GetGameObject(uiDawnofLightGUID)) // Turn off dawn of light // go->SetPhaseMask(0, true); - { Map* map = me->GetMap(); // search players with in 50 yards for quest credit Map::PlayerList const &PlayerList = map->GetPlayers(); @@ -1438,7 +1436,7 @@ public: me->DeleteThreatList(); me->CombatStop(true); me->InterruptNonMeleeSpells(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) DespawnNPC(uiDefenderGUID[i]); @@ -1460,7 +1458,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9].x, LightofDawnLoc[9].y, LightofDawnLoc[9].z); } @@ -1471,7 +1469,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12].x, LightofDawnLoc[12].y, LightofDawnLoc[12].z); } @@ -1482,7 +1480,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15].x, LightofDawnLoc[15].y, LightofDawnLoc[15].z); } DespawnNPC(uiRayneGUID); @@ -1494,7 +1492,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18].x, LightofDawnLoc[18].y, LightofDawnLoc[18].z); temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); } @@ -1509,7 +1507,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20].x, LightofDawnLoc[20].y, LightofDawnLoc[20].z); temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp index 9512d66b6eb..0ef2dddda8d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp @@ -35,7 +35,7 @@ public: struct npc_valkyr_battle_maidenAI : public PassiveAI { - npc_valkyr_battle_maidenAI(Creature* c) : PassiveAI(c) {} + npc_valkyr_battle_maidenAI(Creature* creature) : PassiveAI(creature) {} uint32 FlyBackTimer; float x, y, z; @@ -46,7 +46,7 @@ public: me->setActive(true); me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetFlying(true); + me->SetCanFly(true); FlyBackTimer = 500; phase = 0; @@ -74,7 +74,7 @@ public: switch (phase) { case 0: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED); FlyBackTimer = 500; break; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 77099f2e2d7..813c43288d0 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -296,8 +296,11 @@ public: if (spell->Id == SPELL_FLYING_HEAD) { - if (Phase < 3) ++Phase; - else Phase = 3; + if (Phase < 3) + ++Phase; + else + Phase = 3; + withbody = false; if (!bodyGUID) bodyGUID = caster->GetGUID(); @@ -319,7 +322,8 @@ public: if (wait <= diff) { wait = 1000; - if (!me->getVictim()) return; + if (!me->getVictim()) + return; me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveFleeing(me->getVictim()); } @@ -344,7 +348,7 @@ public: if (wait <= diff) { die = false; - if (Unit* body = Unit::GetUnit((*me), bodyGUID)) + if (Unit* body = Unit::GetUnit(*me, bodyGUID)) body->Kill(body); me->Kill(me); } @@ -429,7 +433,7 @@ public: { me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); me->SetSpeed(MOVE_WALK, 5.0f, true); wp_reached = false; count = 0; @@ -462,7 +466,7 @@ public: instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject break; case 19: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); break; case 20: { @@ -471,7 +475,7 @@ public: wp_reached = false; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); SaySound(SAY_ENTRANCE); - if (Unit* player = Unit::GetUnit((*me), PlayerGUID)) + if (Unit* player = Unit::GetUnit(*me, PlayerGUID)) DoStartMovement(player); break; } @@ -485,12 +489,18 @@ public: instance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS); DoZoneInCombat(); } - void AttackStart(Unit* who) {ScriptedAI::AttackStart(who);} + + void AttackStart(Unit* who) + { + ScriptedAI::AttackStart(who); + } + void MoveInLineOfSight(Unit* who) { if (withhead && Phase != 0) ScriptedAI::MoveInLineOfSight(who); } + void KilledUnit(Unit* player) { if (player->GetTypeId() == TYPEID_PLAYER) @@ -576,7 +586,7 @@ public: std::list<HostileReference*>::const_iterator itr; for (itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && unit->isAlive() && unit != caster) me->AddThreat(unit, caster->getThreatManager().getThreat(unit)); } @@ -595,7 +605,8 @@ public: if (!headGUID) headGUID = DoSpawnCreature(HEAD, float(rand()%6), float(rand()%6), 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)->GetGUID(); - Unit* Head = Unit::GetUnit((*me), headGUID); + + Unit* Head = Unit::GetUnit(*me, headGUID); if (Head && Head->isAlive()) { Head->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -803,14 +814,22 @@ public: void Despawn() { - if (!debuffGUID) return; - Unit* debuff = Unit::GetUnit((*me), debuffGUID); + if (!debuffGUID) + return; + + Unit* debuff = Unit::GetUnit(*me, debuffGUID); if (debuff) + { debuff->SetVisible(false); debuffGUID = 0; + } } - void JustDied(Unit* /*killer*/) { if (!sprouted) Despawn(); } + void JustDied(Unit* /*killer*/) + { + if (!sprouted) + Despawn(); + } void MoveInLineOfSight(Unit* who) { diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp index 16b90f89bb5..58c21d86a2f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -152,7 +152,12 @@ public: uint32 Start_Timer; void Reset() {} - void WaypointReached(uint32 /*point*/) {} + + void WaypointReached(uint32 /*waypointId*/) + { + + } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp index a64636a4223..1989c318c84 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -66,9 +66,15 @@ public: Sleep_Timer = 30000; Dispel_Timer = 20000; PowerWordShield = false; + me->SetStandState(UNIT_STAND_STATE_DEAD); + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 7); } - void EnterCombat(Unit* /*who*/) {} + void EnterCombat(Unit* /*who*/) + { + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + } void UpdateAI(const uint32 diff) { diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index 058c688641f..fd978136339 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -78,12 +78,12 @@ public: DoScriptText(SAY_KILL, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (!instance) return; - //Any other actions to do with vorrel? setStandState? + //Any other Actions to do with vorrel? setStandState? if (Unit* vorrel = Unit::GetUnit(*me, instance->GetData64(DATA_VORREL))) DoScriptText(SAY_TRIGGER_VORREL, vorrel); } diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp index ec6ac34b0bb..8d813bfe502 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -132,7 +132,7 @@ public: return; //On first death, fake death and open door, as well as initiate whitemane if exist - if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE))) + if (Unit* Whitemane = Unit::GetUnit(*me, instance->GetData64(DATA_WHITEMANE))) { instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); @@ -181,7 +181,7 @@ public: if (_bHasDied && !_bHeal && instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) { //On ressurection, stop fake death and heal whitemane and resume fight - if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE))) + if (Unit* Whitemane = Unit::GetUnit(*me, instance->GetData64(DATA_WHITEMANE))) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_STAND); @@ -292,7 +292,7 @@ public: //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out if (instance && Wait_Timer <= diff) { - if (Unit* Mograine = Unit::GetUnit((*me), instance->GetData64(DATA_MOGRAINE))) + if (Unit* Mograine = Unit::GetUnit(*me, instance->GetData64(DATA_MOGRAINE))) { DoCast(Mograine, SPELL_SCARLETRESURRECTION); DoScriptText(SAY_WH_RESSURECT, me); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index 4ddc240a03c..2bc0320b81d 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -62,7 +62,7 @@ public: struct boss_darkmaster_gandlingAI : public ScriptedAI { - boss_darkmaster_gandlingAI(Creature* c) : ScriptedAI(c) + boss_darkmaster_gandlingAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp index 693cad06bd5..967f771fe7a 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp @@ -37,7 +37,7 @@ public: struct boss_death_knight_darkreaverAI : public ScriptedAI { - boss_death_knight_darkreaverAI(Creature* c) : ScriptedAI(c) {} + boss_death_knight_darkreaverAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp index 05d662c4fe3..82f4dc85060 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp @@ -45,7 +45,7 @@ public: struct boss_theolenkrastinovAI : public ScriptedAI { - boss_theolenkrastinovAI(Creature* c) : ScriptedAI(c) {} + boss_theolenkrastinovAI(Creature* creature) : ScriptedAI(creature) {} uint32 m_uiRend_Timer; uint32 m_uiBackhand_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp index 92f0fcd25c4..e438ae56a2b 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp @@ -43,7 +43,7 @@ public: struct boss_illuciabarovAI : public ScriptedAI { - boss_illuciabarovAI(Creature* c) : ScriptedAI(c) {} + boss_illuciabarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 CurseOfAgony_Timer; uint32 ShadowShock_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp index 295d9440d2e..498e6596b06 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp @@ -44,7 +44,7 @@ public: struct boss_instructormaliciaAI : public ScriptedAI { - boss_instructormaliciaAI(Creature* c) : ScriptedAI(c) {} + boss_instructormaliciaAI(Creature* creature) : ScriptedAI(creature) {} uint32 CallOfGraves_Timer; uint32 Corruption_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp index 48bf000745c..064faa5643d 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp @@ -43,7 +43,7 @@ public: struct boss_jandicebarovAI : public ScriptedAI { - boss_jandicebarovAI(Creature* c) : ScriptedAI(c) {} + boss_jandicebarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 CurseOfBlood_Timer; uint32 Illusion_Timer; @@ -165,7 +165,7 @@ public: struct mob_illusionofjandicebarovAI : public ScriptedAI { - mob_illusionofjandicebarovAI(Creature* c) : ScriptedAI(c) {} + mob_illusionofjandicebarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 Cleave_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp index 7c279e726a6..5fd5a96d605 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp @@ -40,7 +40,7 @@ public: struct boss_kormokAI : public ScriptedAI { - boss_kormokAI(Creature* c) : ScriptedAI(c) {} + boss_kormokAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowVolley_Timer; uint32 BoneShield_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp index 5109e6e1468..327c1df921d 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp @@ -41,7 +41,7 @@ public: struct boss_lordalexeibarovAI : public ScriptedAI { - boss_lordalexeibarovAI(Creature* c) : ScriptedAI(c) {} + boss_lordalexeibarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 Immolate_Timer; uint32 VeilofShadow_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp index 754640bff9e..1919a1ba099 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp @@ -43,7 +43,7 @@ public: struct boss_lorekeeperpolkeltAI : public ScriptedAI { - boss_lorekeeperpolkeltAI(Creature* c) : ScriptedAI(c) {} + boss_lorekeeperpolkeltAI(Creature* creature) : ScriptedAI(creature) {} uint32 VolatileInfection_Timer; uint32 Darkplague_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp index 902838da152..fd10c6374a6 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp @@ -44,7 +44,7 @@ public: struct boss_rasfrostAI : public ScriptedAI { - boss_rasfrostAI(Creature* c) : ScriptedAI(c) {} + boss_rasfrostAI(Creature* creature) : ScriptedAI(creature) {} uint32 IceArmor_Timer; uint32 Frostbolt_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp index 13fa450f5ee..a28cecf3772 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp @@ -43,7 +43,7 @@ public: struct boss_theravenianAI : public ScriptedAI { - boss_theravenianAI(Creature* c) : ScriptedAI(c) {} + boss_theravenianAI(Creature* creature) : ScriptedAI(creature) {} uint32 Trample_Timer; uint32 Cleave_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp index 657b458e148..f5f453c30bd 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp @@ -45,7 +45,7 @@ public: struct boss_vectusAI : public ScriptedAI { - boss_vectusAI(Creature* c) : ScriptedAI(c) {} + boss_vectusAI(Creature* creature) : ScriptedAI(creature) {} uint32 m_uiFireShield_Timer; uint32 m_uiBlastWave_Timer; diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index dded75e193c..63e753a18ba 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -63,10 +63,10 @@ public: return new npc_shadowfang_prisonerAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); @@ -90,18 +90,18 @@ public: struct npc_shadowfang_prisonerAI : public npc_escortAI { - npc_shadowfang_prisonerAI(Creature* c) : npc_escortAI(c) + npc_shadowfang_prisonerAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); - uiNpcEntry = c->GetEntry(); + instance = creature->GetInstanceScript(); + uiNpcEntry = creature->GetEntry(); } InstanceScript* instance; uint32 uiNpcEntry; - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { - switch (uiPoint) + switch (waypointId) { case 0: if (uiNpcEntry == NPC_ASH) @@ -175,10 +175,7 @@ public: if (uiDarkOffering <= uiDiff) { if (Creature* pFriend = me->FindNearestCreature(me->GetEntry(), 25.0f, true)) - { - if (pFriend) - DoCast(pFriend, SPELL_DARK_OFFERING); - } + DoCast(pFriend, SPELL_DARK_OFFERING); else DoCast(me, SPELL_DARK_OFFERING); uiDarkOffering = urand(4400, 12500); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index 0c659117f5d..85faa14900b 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -89,7 +89,7 @@ public: struct boss_baron_rivendareAI : public ScriptedAI { - boss_baron_rivendareAI(Creature* c) : ScriptedAI(c) + boss_baron_rivendareAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -126,7 +126,7 @@ public: summoned->AI()->AttackStart(target); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_BARON, DONE); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp index a01846cb862..106719d654f 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp @@ -43,7 +43,7 @@ public: struct boss_baroness_anastariAI : public ScriptedAI { - boss_baroness_anastariAI(Creature* c) : ScriptedAI(c) + boss_baroness_anastariAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -67,7 +67,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_BARONESS, IN_PROGRESS); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp index d84bd489dab..01299ae06b6 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp @@ -88,7 +88,7 @@ public: struct boss_cannon_master_willeyAI : public ScriptedAI { - boss_cannon_master_willeyAI(Creature* c) : ScriptedAI(c) {} + boss_cannon_master_willeyAI(Creature* creature) : ScriptedAI(creature) {} uint32 KnockAway_Timer; uint32 Pummel_Timer; @@ -103,7 +103,7 @@ public: SummonRifleman_Timer = 15000; } - void JustDied(Unit* /*Victim*/) + void JustDied(Unit* /*killer*/) { me->SummonCreature(11054, ADD_1X, ADD_1Y, ADD_1Z, ADD_1O, TEMPSUMMON_TIMED_DESPAWN, 240000); me->SummonCreature(11054, ADD_2X, ADD_2Y, ADD_2Z, ADD_2O, TEMPSUMMON_TIMED_DESPAWN, 240000); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp index 8a14f1e2401..21e3e19d890 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp @@ -77,7 +77,7 @@ public: struct boss_dathrohan_balnazzarAI : public ScriptedAI { - boss_dathrohan_balnazzarAI(Creature* c) : ScriptedAI(c) {} + boss_dathrohan_balnazzarAI(Creature* creature) : ScriptedAI(creature) {} uint32 m_uiCrusadersHammer_Timer; uint32 m_uiCrusaderStrike_Timer; @@ -105,7 +105,7 @@ public: me->UpdateEntry(NPC_DATHROHAN); } - void JustDied(Unit* /*Victim*/) + void JustDied(Unit* /*killer*/) { static uint32 uiCount = sizeof(m_aSummonPoint)/sizeof(SummonDef); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp index 48b1fc2acc7..37e0bd5757f 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp @@ -46,7 +46,7 @@ public: struct boss_magistrate_barthilasAI : public ScriptedAI { - boss_magistrate_barthilasAI(Creature* c) : ScriptedAI(c) {} + boss_magistrate_barthilasAI(Creature* creature) : ScriptedAI(creature) {} uint32 DrainingBlow_Timer; uint32 CrowdPummel_Timer; @@ -75,7 +75,7 @@ public: ScriptedAI::MoveInLineOfSight(who); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { me->SetDisplayId(MODEL_HUMAN); } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp index 1dc22a20d08..f8a10f06155 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp @@ -43,7 +43,7 @@ public: struct boss_maleki_the_pallidAI : public ScriptedAI { - boss_maleki_the_pallidAI(Creature* c) : ScriptedAI(c) + boss_maleki_the_pallidAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -65,7 +65,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_PALLID, IN_PROGRESS); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp index a7c91c3636d..c9a43edb66d 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp @@ -43,7 +43,7 @@ public: struct boss_nerubenkanAI : public ScriptedAI { - boss_nerubenkanAI(Creature* c) : ScriptedAI(c) + boss_nerubenkanAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -67,7 +67,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_NERUB, IN_PROGRESS); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp index 3393b9e5797..ebeda248331 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp @@ -54,9 +54,9 @@ public: struct boss_silver_hand_bossesAI : public ScriptedAI { - boss_silver_hand_bossesAI(Creature* c) : ScriptedAI(c) + boss_silver_hand_bossesAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -96,30 +96,34 @@ public: { } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (instance) + if (!instance) + return; + + switch (me->GetEntry()) { - switch (me->GetEntry()) - { - case SH_AELMAR: - instance->SetData(TYPE_SH_AELMAR, 2); - break; - case SH_CATHELA: - instance->SetData(TYPE_SH_CATHELA, 2); - break; - case SH_GREGOR: - instance->SetData(TYPE_SH_GREGOR, 2); - break; - case SH_NEMAS: - instance->SetData(TYPE_SH_NEMAS, 2); - break; - case SH_VICAR: - instance->SetData(TYPE_SH_VICAR, 2); - break; - } - if (instance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT, 0); + case SH_AELMAR: + instance->SetData(TYPE_SH_AELMAR, 2); + break; + case SH_CATHELA: + instance->SetData(TYPE_SH_CATHELA, 2); + break; + case SH_GREGOR: + instance->SetData(TYPE_SH_GREGOR, 2); + break; + case SH_NEMAS: + instance->SetData(TYPE_SH_NEMAS, 2); + break; + case SH_VICAR: + instance->SetData(TYPE_SH_VICAR, 2); + break; + } + + if (instance->GetData(TYPE_SH_QUEST)) + { + if (Player* player = killer->ToPlayer()) + player->KilledMonsterCredit(SH_QUEST_CREDIT, 0); } } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp index 869a82011ad..cf8b10a2ee5 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp @@ -48,7 +48,7 @@ public: struct boss_postmaster_malownAI : public ScriptedAI { - boss_postmaster_malownAI(Creature* c) : ScriptedAI(c) {} + boss_postmaster_malownAI(Creature* creature) : ScriptedAI(creature) {} uint32 WailingDead_Timer; uint32 Backhand_Timer; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp index f35bcc05ec2..3bb1ce7959d 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp @@ -43,7 +43,7 @@ public: struct boss_ramstein_the_gorgerAI : public ScriptedAI { - boss_ramstein_the_gorgerAI(Creature* c) : ScriptedAI(c) + boss_ramstein_the_gorgerAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -63,7 +63,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { for (uint8 i = 0; i < 30; ++i) { diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp index 405527ab383..a281c1b59c6 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp @@ -41,7 +41,7 @@ public: struct boss_timmy_the_cruelAI : public ScriptedAI { - boss_timmy_the_cruelAI(Creature* c) : ScriptedAI(c) {} + boss_timmy_the_cruelAI(Creature* creature) : ScriptedAI(creature) {} uint32 RavenousClaw_Timer; bool HasYelled; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 5b2b2fd46c1..7e167093e07 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -99,7 +99,7 @@ public: struct mob_freed_soulAI : public ScriptedAI { - mob_freed_soulAI(Creature* c) : ScriptedAI(c) {} + mob_freed_soulAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -133,7 +133,7 @@ public: struct mob_restless_soulAI : public ScriptedAI { - mob_restless_soulAI(Creature* c) : ScriptedAI(c) {} + mob_restless_soulAI(Creature* creature) : ScriptedAI(creature) {} uint64 Tagger; uint32 Die_Timer; @@ -165,7 +165,7 @@ public: summoned->CastSpell(summoned, SPELL_SOUL_FREED, false); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (Tagged) me->SummonCreature(ENTRY_FREED, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 300000); @@ -211,7 +211,7 @@ public: struct mobs_spectral_ghostly_citizenAI : public ScriptedAI { - mobs_spectral_ghostly_citizenAI(Creature* c) : ScriptedAI(c) {} + mobs_spectral_ghostly_citizenAI(Creature* creature) : ScriptedAI(creature) {} uint32 Die_Timer; bool Tagged; @@ -230,7 +230,7 @@ public: Tagged = true; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (Tagged) { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 1404fd14e91..43c94f8a57d 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -78,9 +78,9 @@ public: struct boss_brutallusAI : public ScriptedAI { - boss_brutallusAI(Creature* c) : ScriptedAI(c) + boss_brutallusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Intro = true; } @@ -132,7 +132,7 @@ public: DoScriptText(RAND(YELL_KILL1, YELL_KILL2, YELL_KILL3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(YELL_DEATH, me); @@ -216,7 +216,7 @@ public: break; case 3: DoCast(me, SPELL_INTRO_FROST_BLAST); - Madrigosa->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Madrigosa->SetDisableGravity(true); me->AttackStop(); Madrigosa->AttackStop(); IntroFrostBoltTimer = 3000; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index 56d7909336c..03486a644a2 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -97,9 +97,9 @@ public: struct boss_sacrolashAI : public ScriptedAI { - boss_sacrolashAI(Creature* c) : ScriptedAI(c) + boss_sacrolashAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -120,7 +120,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_ALYTHESS)); if (Temp) { if (Temp->isDead()) @@ -152,7 +152,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_ALYTHESS)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) CAST_CRE(Temp)->AI()->AttackStart(who); } @@ -167,7 +167,7 @@ public: DoScriptText(RAND(YELL_SAC_KILL_1, YELL_SAC_KILL_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { // only if ALY death if (SisterDeath) @@ -231,7 +231,7 @@ public: if (instance) { Unit* Temp = NULL; - Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS)); + Temp = Unit::GetUnit(*me, instance->GetData64(DATA_ALYTHESS)); if (Temp && Temp->isDead()) { DoScriptText(YELL_SISTER_ALYTHESS_DEAD, me); @@ -355,9 +355,9 @@ public: struct boss_alythessAI : public Scripted_NoMovementAI { - boss_alythessAI(Creature* c) : Scripted_NoMovementAI(c) + boss_alythessAI(Creature* creature) : Scripted_NoMovementAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); IntroStepCounter = 10; } @@ -382,7 +382,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_SACROLASH)); if (Temp) { if (Temp->isDead()) @@ -415,7 +415,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) CAST_CRE(Temp)->AI()->AttackStart(who); } @@ -462,7 +462,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (SisterDeath) { @@ -567,7 +567,7 @@ public: if (instance) { Unit* Temp = NULL; - Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH)); + Temp = Unit::GetUnit(*me, instance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isDead()) { DoScriptText(YELL_SISTER_SACROLASH_DEAD, me); @@ -684,7 +684,7 @@ public: struct mob_shadow_imageAI : public ScriptedAI { - mob_shadow_imageAI(Creature* c) : ScriptedAI(c) {} + mob_shadow_imageAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowfuryTimer; uint32 KillTimer; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index c65ce2c8f98..72ad1100752 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -115,9 +115,9 @@ public: struct boss_felmystAI : public ScriptedAI { - boss_felmystAI(Creature* c) : ScriptedAI(c) + boss_felmystAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -137,7 +137,7 @@ public: uiFlightCount = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); @@ -184,7 +184,7 @@ public: DoScriptText(YELL_BIRTH, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(YELL_DEATH, me); @@ -254,7 +254,7 @@ public: events.ScheduleEvent(EVENT_FLIGHT, 60000); break; case PHASE_FLIGHT: - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1000); uiFlightCount = 0; uiBreathCount = 0; @@ -391,7 +391,7 @@ public: } break; case 10: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); EnterPhase(PHASE_GROUND); AttackStart(SelectTarget(SELECT_TARGET_TOPAGGRO)); @@ -522,7 +522,7 @@ public: struct mob_felmyst_vaporAI : public ScriptedAI { - mob_felmyst_vaporAI(Creature* c) : ScriptedAI(c) + mob_felmyst_vaporAI(Creature* creature) : ScriptedAI(creature) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetSpeed(MOVE_RUN, 0.8f); @@ -555,7 +555,7 @@ public: struct mob_felmyst_trailAI : public ScriptedAI { - mob_felmyst_trailAI(Creature* c) : ScriptedAI(c) + mob_felmyst_trailAI(Creature* creature) : ScriptedAI(creature) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); DoCast(me, SPELL_TRAIL_TRIGGER, true); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index d7c90732a80..f783fcc1eb5 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -115,9 +115,9 @@ public: struct boss_kalecgosAI : public ScriptedAI { - boss_kalecgosAI(Creature* c) : ScriptedAI(c) + boss_kalecgosAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); SathGUID = 0; DoorGUID = 0; bJustReset = false; @@ -159,7 +159,7 @@ public: if (!bJustReset) //first reset at create { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->SetVisible(true); me->SetStandState(UNIT_STAND_STATE_SLEEP); } @@ -231,7 +231,7 @@ public: if (ResetTimer <= diff) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->SetVisible(true); me->SetStandState(UNIT_STAND_STATE_SLEEP); ResetTimer = 10000; @@ -400,7 +400,7 @@ public: TalkTimer = 10000; break; case 3: - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(0, FLY_X, FLY_Y, FLY_Z); TalkTimer = 600000; break; @@ -418,7 +418,7 @@ public: TalkTimer = 3000; break; case 2: - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(0, FLY_X, FLY_Y, FLY_Z); TalkTimer = 15000; break; @@ -456,9 +456,9 @@ public: bool isEnraged; // if demon is enraged - boss_kalecAI(Creature* c) : ScriptedAI(c) + boss_kalecAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } void Reset() @@ -575,9 +575,9 @@ public: struct boss_sathrovarrAI : public ScriptedAI { - boss_sathrovarrAI(Creature* c) : ScriptedAI(c) + boss_sathrovarrAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); KalecGUID = 0; KalecgosGUID = 0; } @@ -676,7 +676,9 @@ public: void TeleportAllPlayersBack() { Map* map = me->GetMap(); - if (!map->IsDungeon()) return; + if (!map->IsDungeon()) + return; + Map::PlayerList const &PlayerList = map->GetPlayers(); for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 337eea13438..8a64d45abcb 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -251,9 +251,9 @@ public: struct boss_kalecgos_kjAI : public ScriptedAI { - boss_kalecgos_kjAI(Creature* c) : ScriptedAI(c) + boss_kalecgos_kjAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -264,7 +264,7 @@ public: { OrbsEmpowered = 0; EmpowerCount = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->setActive(true); @@ -406,9 +406,9 @@ public: struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI { - mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), summons(me) + mob_kiljaeden_controllerAI(Creature* creature) : Scripted_NoMovementAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -434,8 +434,9 @@ public: { phase = PHASE_DECEIVERS; - if (Creature* pKalecKJ = Unit::GetCreature((*me), instance->GetData64(DATA_KALECGOS_KJ))) - CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs(); + if (instance) + if (Creature* pKalecKJ = Unit::GetCreature((*me), instance->GetData64(DATA_KALECGOS_KJ))) + CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs(); deceiverDeathCount = 0; bSummonedDeceivers = false; bKiljaedenDeath = false; @@ -451,7 +452,7 @@ public: summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false); break; case CREATURE_ANVEENA: - summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); break; @@ -506,9 +507,9 @@ public: struct boss_kiljaedenAI : public Scripted_NoMovementAI { - boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), summons(me) + boss_kiljaedenAI(Creature* creature) : Scripted_NoMovementAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -660,17 +661,9 @@ public: DoScriptText(RAND(SAY_KJ_REFLECTION1, SAY_KJ_REFLECTION2), me); for (uint8 i = 0; i < 4; ++i) { - float x, y, z; - Unit* target = NULL; - for (uint8 i = 0; i < 6; ++i) - { - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!target || !target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, 0)) - break; - } - - if (target) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, -SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT)) { + float x, y, z; target->GetPosition(x, y, z); if (Creature* pSinisterReflection = me->SummonCreature(CREATURE_SINISTER_REFLECTION, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0)) { @@ -922,9 +915,9 @@ public: struct mob_hand_of_the_deceiverAI : public ScriptedAI { - mob_hand_of_the_deceiverAI(Creature* c) : ScriptedAI(c) + mob_hand_of_the_deceiverAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -1023,7 +1016,7 @@ public: struct mob_felfire_portalAI : public Scripted_NoMovementAI { - mob_felfire_portalAI(Creature* c) : Scripted_NoMovementAI(c) {} + mob_felfire_portalAI(Creature* creature) : Scripted_NoMovementAI(creature) {} uint32 uiSpawnFiendTimer; @@ -1068,7 +1061,7 @@ public: struct mob_volatile_felfire_fiendAI : public ScriptedAI { - mob_volatile_felfire_fiendAI(Creature* c) : ScriptedAI(c) {} + mob_volatile_felfire_fiendAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiExplodeTimer; @@ -1126,7 +1119,7 @@ public: struct mob_armageddonAI : public Scripted_NoMovementAI { - mob_armageddonAI(Creature* c) : Scripted_NoMovementAI(c) {} + mob_armageddonAI(Creature* creature) : Scripted_NoMovementAI(creature) {} uint8 spell; uint32 uiTimer; @@ -1181,9 +1174,9 @@ public: struct mob_shield_orbAI : public ScriptedAI { - mob_shield_orbAI(Creature* c) : ScriptedAI(c) + mob_shield_orbAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -1196,7 +1189,7 @@ public: void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); bPointReached = true; uiTimer = urand(500, 1000); uiCheckTimer = 1000; @@ -1269,7 +1262,7 @@ public: struct mob_sinster_reflectionAI : public ScriptedAI { - mob_sinster_reflectionAI(Creature* c) : ScriptedAI(c) {} + mob_sinster_reflectionAI(Creature* creature) : ScriptedAI(creature) {} uint8 victimClass; uint32 uiTimer[3]; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 9b5d941589b..66030a1c78c 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -113,9 +113,9 @@ public: struct boss_entropiusAI : public ScriptedAI { - boss_entropiusAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_entropiusAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -213,9 +213,9 @@ public: struct boss_muruAI : public Scripted_NoMovementAI { - boss_muruAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me) + boss_muruAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -378,9 +378,9 @@ public: struct npc_muru_portalAI : public Scripted_NoMovementAI { - npc_muru_portalAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me) + npc_muru_portalAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -462,7 +462,7 @@ public: struct npc_dark_fiendAI : public ScriptedAI { - npc_dark_fiendAI(Creature* c) : ScriptedAI(c) {} + npc_dark_fiendAI(Creature* creature) : ScriptedAI(creature) {} uint32 WaitTimer; bool InAction; @@ -525,7 +525,7 @@ public: struct npc_void_sentinelAI : public ScriptedAI { - npc_void_sentinelAI(Creature* c) : ScriptedAI(c){} + npc_void_sentinelAI(Creature* creature) : ScriptedAI(creature){} uint32 PulseTimer; uint32 VoidBlastTimer; @@ -581,9 +581,9 @@ public: struct npc_blackholeAI : public ScriptedAI { - npc_blackholeAI(Creature* c) : ScriptedAI(c) + npc_blackholeAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 0872ac9adca..7a946e9d5bf 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -153,7 +153,7 @@ class boss_archaedas : public CreatureScript // wake a wall minion if (uiWallMinionTimer <= uiDiff) { - instance->SetData (DATA_MINIONS, IN_PROGRESS); + instance->SetData(DATA_MINIONS, IN_PROGRESS); uiWallMinionTimer = 10000; } else uiWallMinionTimer -= uiDiff; @@ -232,7 +232,7 @@ class mob_archaedas_minions : public CreatureScript struct mob_archaedas_minionsAI : public ScriptedAI { - mob_archaedas_minionsAI(Creature* c) : ScriptedAI(c) + mob_archaedas_minionsAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -394,7 +394,7 @@ class go_altar_of_archaedas : public GameObjectScript { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { InstanceScript* instance = player->GetInstanceScript(); if (!instance) diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp index 60d17a7e5d2..fea64c55377 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -184,8 +184,8 @@ class instance_uldaman : public InstanceMapScript return; // only want the first one we find } // if we get this far than all four are dead so open the door - SetData (DATA_ALTAR_DOORS, DONE); - SetDoor (uiArchaedasTempleDoor, true); //open next the door too + SetData(DATA_ALTAR_DOORS, DONE); + SetDoor(uiArchaedasTempleDoor, true); //open next the door too } void ActivateWallMinions() @@ -320,7 +320,7 @@ class instance_uldaman : public InstanceMapScript uiIronayaSealDoorTimer -= diff; } - void SetData (uint32 type, uint32 data) + void SetData(uint32 type, uint32 data) { switch (type) { @@ -386,7 +386,7 @@ class instance_uldaman : public InstanceMapScript } } - void SetData64 (uint32 type, uint64 data) + void SetData64(uint32 type, uint64 data) { // Archaedas if (type == 0) @@ -425,7 +425,8 @@ class instance_uldaman : public InstanceMapScript void OnCreatureCreate(Creature* creature) { - switch (creature->GetEntry()) { + switch (creature->GetEntry()) + { case 4857: // Stone Keeper SetFrozenState (creature); vStoneKeeper.push_back(creature->GetGUID()); @@ -458,10 +459,10 @@ class instance_uldaman : public InstanceMapScript uiArchaedasGUID = creature->GetGUID(); break; - } // end switch - } // end OnCreatureCreate + } + } - uint64 GetData64 (uint32 identifier) + uint64 GetData64(uint32 identifier) { if (identifier == 0) return uiWhoWokeuiArchaedasGUID; if (identifier == 1) return vVaultWalker[0]; // VaultWalker1 diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index eee6b08d834..a715dbfce9d 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -72,9 +72,9 @@ class boss_akilzon : public CreatureScript struct boss_akilzonAI : public ScriptedAI { - boss_akilzonAI(Creature* c) : ScriptedAI(c) + boss_akilzonAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -131,7 +131,7 @@ class boss_akilzon : public CreatureScript instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); DoPlaySoundToSet(me, SOUND_ONDEATH); @@ -209,9 +209,7 @@ class boss_akilzon : public CreatureScript for (std::list<Unit*>::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) { if (!Cloud->IsWithinDist(*i, 6, false)) - { Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, me->GetGUID()); - } } // visual float x, y, z; @@ -311,7 +309,8 @@ class boss_akilzon : public CreatureScript isRaining = true; } - if (ElectricalStorm_Timer <= diff) { + if (ElectricalStorm_Timer <= diff) + { Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true); if (!target) { @@ -324,16 +323,16 @@ class boss_akilzon : public CreatureScript target->GetPosition(x, y, z); if (target) { - target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + target->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); target->MonsterMoveWithSpeed(x, y, me->GetPositionZ()+15, 0); } Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000); if (Cloud) { CloudGUID = Cloud->GetGUID(); - Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + Cloud->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); Cloud->StopMoving(); - Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + Cloud->SetObjectScale(1.0f); Cloud->setFaction(35); Cloud->SetMaxHealth(9999999); Cloud->SetHealth(9999999); @@ -390,15 +389,11 @@ class boss_akilzon : public CreatureScript class mob_akilzon_eagle : public CreatureScript { public: - - mob_akilzon_eagle() - : CreatureScript("mob_akilzon_eagle") - { - } + mob_akilzon_eagle() : CreatureScript("mob_akilzon_eagle") { } struct mob_akilzon_eagleAI : public ScriptedAI { - mob_akilzon_eagleAI(Creature* c) : ScriptedAI(c) {} + mob_akilzon_eagleAI(Creature* creature) : ScriptedAI(creature) { } uint32 EagleSwoop_Timer; bool arrived; @@ -409,10 +404,13 @@ class mob_akilzon_eagle : public CreatureScript EagleSwoop_Timer = urand(5000, 10000); arrived = true; TargetGUID = 0; - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); } - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void MoveInLineOfSight(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index db0e201298c..3baa6ebdf62 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -83,9 +83,9 @@ class boss_halazzi : public CreatureScript struct boss_halazziAI : public ScriptedAI { - boss_halazziAI(Creature* c) : ScriptedAI(c) + boss_halazziAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -324,7 +324,7 @@ class boss_halazzi : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_HALAZZIEVENT, DONE); @@ -352,7 +352,7 @@ class mob_halazzi_lynx : public CreatureScript struct mob_halazzi_lynxAI : public ScriptedAI { - mob_halazzi_lynxAI(Creature* c) : ScriptedAI(c) {} + mob_halazzi_lynxAI(Creature* creature) : ScriptedAI(creature) {} uint32 FrenzyTimer; uint32 shredder_timer; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index 5efd4af55ea..b5698d851f8 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -179,14 +179,17 @@ struct boss_hexlord_addAI : public ScriptedAI { InstanceScript* instance; - boss_hexlord_addAI(Creature* c) : ScriptedAI(c) + boss_hexlord_addAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } void Reset() {} - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void UpdateAI(const uint32 /*diff*/) { @@ -211,9 +214,9 @@ class boss_hexlord_malacrass : public CreatureScript struct boss_hex_lord_malacrassAI : public ScriptedAI { - boss_hex_lord_malacrassAI(Creature* c) : ScriptedAI(c) + boss_hex_lord_malacrassAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); SelectAddEntry(); for (uint8 i = 0; i < 4; ++i) AddGUID[i] = 0; @@ -264,7 +267,7 @@ class boss_hexlord_malacrass : public CreatureScript for (uint8 i = 0; i < 4; ++i) { - Unit* Temp = Unit::GetUnit((*me), AddGUID[i]); + Unit* Temp = Unit::GetUnit(*me, AddGUID[i]); if (Temp && Temp->isAlive()) CAST_CRE(Temp)->AI()->AttackStart(me->getVictim()); else @@ -290,7 +293,7 @@ class boss_hexlord_malacrass : public CreatureScript } } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_HEXLORDEVENT, DONE); @@ -298,9 +301,9 @@ class boss_hexlord_malacrass : public CreatureScript me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0); DoPlaySoundToSet(me, SOUND_YELL_DEATH); - for (uint8 i = 0; i < 4 ; ++i) + for (uint8 i = 0; i < 4; ++i) { - Unit* Temp = Unit::GetUnit((*me), AddGUID[i]); + Unit* Temp = Unit::GetUnit(*me, AddGUID[i]); if (Temp && Temp->isAlive()) Temp->DealDamage(Temp, Temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } @@ -488,7 +491,7 @@ class boss_thurg : public CreatureScript struct boss_thurgAI : public boss_hexlord_addAI { - boss_thurgAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_thurgAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 bloodlust_timer; uint32 cleave_timer; @@ -548,7 +551,7 @@ class boss_alyson_antille : public CreatureScript struct boss_alyson_antilleAI : public boss_hexlord_addAI { //Holy Priest - boss_alyson_antilleAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_alyson_antilleAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 flashheal_timer; uint32 dispelmagic_timer; @@ -637,7 +640,7 @@ class boss_alyson_antille : public CreatureScript struct boss_gazakrothAI : public boss_hexlord_addAI { - boss_gazakrothAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_gazakrothAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 firebolt_timer; @@ -691,7 +694,7 @@ class boss_lord_raadan : public CreatureScript struct boss_lord_raadanAI : public boss_hexlord_addAI { - boss_lord_raadanAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_lord_raadanAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 flamebreath_timer; uint32 thunderclap_timer; @@ -744,7 +747,7 @@ class boss_darkheart : public CreatureScript struct boss_darkheartAI : public boss_hexlord_addAI { - boss_darkheartAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_darkheartAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 psychicwail_timer; @@ -787,7 +790,7 @@ class boss_slither : public CreatureScript struct boss_slitherAI : public boss_hexlord_addAI { - boss_slitherAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_slitherAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 venomspit_timer; @@ -847,7 +850,7 @@ class boss_fenstalker : public CreatureScript struct boss_fenstalkerAI : public boss_hexlord_addAI { - boss_fenstalkerAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_fenstalkerAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 volatileinf_timer; @@ -894,7 +897,7 @@ class boss_koragg : public CreatureScript struct boss_koraggAI : public boss_hexlord_addAI { - boss_koraggAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_koraggAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 coldstare_timer; uint32 mightyblow_timer; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 21245209e45..a2125c45689 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -113,9 +113,9 @@ class boss_janalai : public CreatureScript struct boss_janalaiAI : public ScriptedAI { - boss_janalaiAI(Creature* c) : ScriptedAI(c) + boss_janalaiAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -159,7 +159,7 @@ class boss_janalai : public CreatureScript HatchAllEggs(1); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -221,12 +221,13 @@ class boss_janalai : public CreatureScript dy = float(irand(-area_dy/2, area_dy/2)); Creature* bomb = DoSpawnCreature(MOB_FIRE_BOMB, dx, dy, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); - if (bomb) FireBombGUIDs[i] = bomb->GetGUID(); + if (bomb) + FireBombGUIDs[i] = bomb->GetGUID(); } BombCount = 0; } - bool HatchAllEggs(uint32 uiAction) //1: reset, 2: isHatching all + bool HatchAllEggs(uint32 action) //1: reset, 2: isHatching all { std::list<Creature*> templist; float x, y, z; @@ -251,9 +252,9 @@ class boss_janalai : public CreatureScript for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i) { - if (uiAction == 1) + if (action == 1) (*i)->SetDisplayId(10056); - else if (uiAction == 2 &&(*i)->GetDisplayId() != 11686) + else if (action == 2 &&(*i)->GetDisplayId() != 11686) (*i)->CastSpell(*i, SPELL_HATCH_EGG, false); } return true; @@ -288,7 +289,7 @@ class boss_janalai : public CreatureScript { if (BombCount < 40) { - if (Unit* FireBomb = Unit::GetUnit((*me), FireBombGUIDs[BombCount])) + if (Unit* FireBomb = Unit::GetUnit(*me, FireBombGUIDs[BombCount])) { FireBomb->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); DoCast(FireBomb, SPELL_FIRE_BOMB_THROW, true); @@ -374,7 +375,9 @@ class boss_janalai : public CreatureScript //Teleport every Player into the middle Map* map = me->GetMap(); - if (!map->IsDungeon()) return; + if (!map->IsDungeon()) + return; + Map::PlayerList const &PlayerList = map->GetPlayers(); for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) if (Player* i_pl = i->getSource()) @@ -448,7 +451,7 @@ class mob_janalai_firebomb : public CreatureScript struct mob_janalai_firebombAI : public ScriptedAI { - mob_janalai_firebombAI(Creature* c) : ScriptedAI(c){} + mob_janalai_firebombAI(Creature* creature) : ScriptedAI(creature){} void Reset() {} @@ -484,9 +487,9 @@ class mob_janalai_hatcher : public CreatureScript struct mob_janalai_hatcherAI : public ScriptedAI { - mob_janalai_hatcherAI(Creature* c) : ScriptedAI(c) + mob_janalai_hatcherAI(Creature* creature) : ScriptedAI(creature) { - instance =c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -501,7 +504,7 @@ class mob_janalai_hatcher : public CreatureScript void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); side =(me->GetPositionY() < 1150); waypoint = 0; isHatching = false; @@ -616,9 +619,9 @@ class mob_janalai_hatchling : public CreatureScript struct mob_janalai_hatchlingAI : public ScriptedAI { - mob_janalai_hatchlingAI(Creature* c) : ScriptedAI(c) + mob_janalai_hatchlingAI(Creature* creature) : ScriptedAI(creature) { - instance =c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -632,7 +635,7 @@ class mob_janalai_hatchling : public CreatureScript else me->GetMotionMaster()->MovePoint(0, hatcherway[1][3][0]+rand()%4-2, 1150.0f+rand()%4-2, hatcherway[1][3][2]); - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); } void EnterCombat(Unit* /*who*/) {/*DoZoneInCombat();*/} diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index 954f232f786..48a406f22a4 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -101,11 +101,11 @@ class boss_nalorakk : public CreatureScript struct boss_nalorakkAI : public ScriptedAI { - boss_nalorakkAI(Creature* c) : ScriptedAI(c) + boss_nalorakkAI(Creature* creature) : ScriptedAI(creature) { MoveEvent = true; MovePhase = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -136,7 +136,7 @@ class boss_nalorakk : public CreatureScript inMove = false; waitTimer = 0; me->SetSpeed(MOVE_RUN, 2); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); }else { (*me).GetMotionMaster()->MovePoint(0, NalorakkWay[7][0], NalorakkWay[7][1], NalorakkWay[7][2]); @@ -276,7 +276,7 @@ class boss_nalorakk : public CreatureScript DoZoneInCombat(); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_NALORAKKEVENT, DONE); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index b5130630d05..2df202af088 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -151,9 +151,9 @@ class boss_zuljin : public CreatureScript struct boss_zuljinAI : public ScriptedAI { - boss_zuljinAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_zuljinAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -252,7 +252,7 @@ class boss_zuljin : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_ZULJINEVENT, DONE); @@ -604,7 +604,7 @@ class mob_zuljin_vortex : public CreatureScript struct mob_zuljin_vortexAI : public ScriptedAI { - mob_zuljin_vortexAI(Creature* c) : ScriptedAI(c) {} + mob_zuljin_vortexAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index ac1554bd00e..884fe109785 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -109,7 +109,8 @@ class instance_zulaman : public InstanceMapScript bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } @@ -188,7 +189,9 @@ class instance_zulaman : public InstanceMapScript void Load(const char* load) { - if (!load) return; + if (!load) + return; + std::istringstream ss(load); //sLog->outError("TSCR: Zul'aman loaded, %s.", ss.str().c_str()); char dataHead; // S diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index bf951dd186c..bfb22483b09 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -49,9 +49,9 @@ class npc_forest_frog : public CreatureScript struct npc_forest_frogAI : public ScriptedAI { - npc_forest_frogAI(Creature* c) : ScriptedAI(c) + npc_forest_frogAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -120,24 +120,29 @@ static uint32 ChestEntry[] = {186648, 187021, 186672, 186667}; class npc_zulaman_hostage : public CreatureScript { public: - - npc_zulaman_hostage() - : CreatureScript("npc_zulaman_hostage") - { - } + npc_zulaman_hostage() : CreatureScript("npc_zulaman_hostage") { } struct npc_zulaman_hostageAI : public ScriptedAI { - npc_zulaman_hostageAI(Creature* c) : ScriptedAI(c) {IsLoot = false;} + npc_zulaman_hostageAI(Creature* creature) : ScriptedAI(creature) + { + IsLoot = false; + } + bool IsLoot; uint64 PlayerGUID; + void Reset() {} + void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*who*/) + + void JustDied(Unit* /*killer*/) { Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player) player->SendLoot(me->GetGUID(), LOOT_CORPSE); + if (player) + player->SendLoot(me->GetGUID(), LOOT_CORPSE); } + void UpdateAI(const uint32 /*diff*/) { if (IsLoot) @@ -157,14 +162,16 @@ class npc_zulaman_hostage : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CLOSE_GOSSIP_MENU(); if (!creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) return true; + creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); InstanceScript* instance = creature->GetInstanceScript(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 27ddc215543..4ba0c187973 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -61,10 +61,10 @@ class boss_arlokk : public CreatureScript { boss_arlokkAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiShadowWordPain_Timer; uint32 m_uiGouge_Timer; @@ -110,8 +110,8 @@ class boss_arlokk : public CreatureScript void JustReachedHome() { - if (m_instance) - m_instance->SetData(DATA_ARLOKK, NOT_STARTED); + if (instance) + instance->SetData(DATA_ARLOKK, NOT_STARTED); //we should be summoned, so despawn me->DespawnOrUnsummon(); @@ -124,8 +124,8 @@ class boss_arlokk : public CreatureScript me->SetDisplayId(MODEL_ID_NORMAL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (m_instance) - m_instance->SetData(DATA_ARLOKK, DONE); + if (instance) + instance->SetData(DATA_ARLOKK, DONE); } void DoSummonPhanters() @@ -237,7 +237,7 @@ class boss_arlokk : public CreatureScript me->SetDisplayId(MODEL_ID_PANTHER); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); @@ -271,12 +271,12 @@ class go_gong_of_bethekk : public GameObjectScript bool OnGossipHello(Player* /*player*/, GameObject* go) { - if (InstanceScript* m_instance = go->GetInstanceScript()) + if (InstanceScript* instance = go->GetInstanceScript()) { - if (m_instance->GetData(DATA_ARLOKK) == DONE || m_instance->GetData(DATA_ARLOKK) == IN_PROGRESS) + if (instance->GetData(DATA_ARLOKK) == DONE || instance->GetData(DATA_ARLOKK) == IN_PROGRESS) return true; - m_instance->SetData(DATA_ARLOKK, IN_PROGRESS); + instance->SetData(DATA_ARLOKK, IN_PROGRESS); return true; } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index a944a857f74..ce2fd0848f9 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -32,15 +32,11 @@ EndScriptData */ class boss_gahzranka : public CreatureScript { public: - - boss_gahzranka() - : CreatureScript("boss_gahzranka") - { - } + boss_gahzranka() : CreatureScript("boss_gahzranka") { } struct boss_gahzrankaAI : public ScriptedAI { - boss_gahzrankaAI(Creature* c) : ScriptedAI(c) {} + boss_gahzrankaAI(Creature* creature) : ScriptedAI(creature) { } uint32 Frostbreath_Timer; uint32 MassiveGeyser_Timer; uint32 Slam_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp index 68ae6dbbf0c..cdd45a3fa0d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -32,15 +32,11 @@ EndScriptData */ class boss_grilek : public CreatureScript { public: - - boss_grilek() - : CreatureScript("boss_grilek") - { - } + boss_grilek() : CreatureScript("boss_grilek") { } struct boss_grilekAI : public ScriptedAI { - boss_grilekAI(Creature* c) : ScriptedAI(c) {} + boss_grilekAI(Creature* creature) : ScriptedAI(creature) { } uint32 Avartar_Timer; uint32 GroundTremor_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index 6a1309983c3..9edd82c39b0 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -55,12 +55,12 @@ class boss_hakkar : public CreatureScript struct boss_hakkarAI : public ScriptedAI { - boss_hakkarAI(Creature* c) : ScriptedAI(c) + boss_hakkarAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 BloodSiphon_Timer; uint32 CorruptedBlood_Timer; @@ -156,9 +156,9 @@ class boss_hakkar : public CreatureScript //Checking if Jeklik is dead. If not we cast her Aspect if (CheckJeklik_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_JEKLIK) != DONE) + if (instance->GetData(DATA_JEKLIK) != DONE) { if (AspectOfJeklik_Timer <= diff) { @@ -173,9 +173,9 @@ class boss_hakkar : public CreatureScript //Checking if Venoxis is dead. If not we cast his Aspect if (CheckVenoxis_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_VENOXIS) != DONE) + if (instance->GetData(DATA_VENOXIS) != DONE) { if (AspectOfVenoxis_Timer <= diff) { @@ -190,9 +190,9 @@ class boss_hakkar : public CreatureScript //Checking if Marli is dead. If not we cast her Aspect if (CheckMarli_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_MARLI) != DONE) + if (instance->GetData(DATA_MARLI) != DONE) { if (AspectOfMarli_Timer <= diff) { @@ -208,9 +208,9 @@ class boss_hakkar : public CreatureScript //Checking if Thekal is dead. If not we cast his Aspect if (CheckThekal_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_THEKAL) != DONE) + if (instance->GetData(DATA_THEKAL) != DONE) { if (AspectOfThekal_Timer <= diff) { @@ -225,9 +225,9 @@ class boss_hakkar : public CreatureScript //Checking if Arlokk is dead. If yes we cast her Aspect if (CheckArlokk_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_ARLOKK) != DONE) + if (instance->GetData(DATA_ARLOKK) != DONE) { if (AspectOfArlokk_Timer <= diff) { diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp index 69a4f5dbab5..27c46b8e0f2 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp @@ -40,7 +40,7 @@ class boss_hazzarah : public CreatureScript struct boss_hazzarahAI : public ScriptedAI { - boss_hazzarahAI(Creature* c) : ScriptedAI(c) {} + boss_hazzarahAI(Creature* creature) : ScriptedAI(creature) {} uint32 ManaBurn_Timer; uint32 Sleep_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index d2ac4f3bceb..7d2215f8311 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -54,12 +54,12 @@ class boss_jeklik : public CreatureScript struct boss_jeklikAI : public ScriptedAI { - boss_jeklikAI(Creature* c) : ScriptedAI(c) + boss_jeklikAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 Charge_Timer; uint32 SonicBurst_Timer; @@ -94,12 +94,12 @@ class boss_jeklik : public CreatureScript DoCast(me, SPELL_BAT_FORM); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(DATA_JEKLIK, DONE); + if (instance) + instance->SetData(DATA_JEKLIK, DONE); } void UpdateAI(const uint32 diff) @@ -236,12 +236,12 @@ class mob_batrider : public CreatureScript struct mob_batriderAI : public ScriptedAI { - mob_batriderAI(Creature* c) : ScriptedAI(c) + mob_batriderAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 Bomb_Timer; uint32 Check_Timer; @@ -274,9 +274,9 @@ class mob_batrider : public CreatureScript //Check_Timer if (Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_JEKLIK) == DONE) + if (instance->GetData(DATA_JEKLIK) == DONE) { me->setDeathState(JUST_DIED); me->RemoveCorpse(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 132812c932a..f4a17da56fb 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -52,7 +52,7 @@ class boss_jindo : public CreatureScript struct boss_jindoAI : public ScriptedAI { - boss_jindoAI(Creature* c) : ScriptedAI(c) {} + boss_jindoAI(Creature* creature) : ScriptedAI(creature) {} uint32 BrainWashTotem_Timer; uint32 HealingWard_Timer; @@ -187,9 +187,9 @@ class mob_healing_ward : public CreatureScript struct mob_healing_wardAI : public ScriptedAI { - mob_healing_wardAI(Creature* c) : ScriptedAI(c) + mob_healing_wardAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 Heal_Timer; @@ -212,7 +212,7 @@ class mob_healing_ward : public CreatureScript { if (instance) { - Unit* pJindo = Unit::GetUnit((*me), instance->GetData64(DATA_JINDO)); + Unit* pJindo = Unit::GetUnit(*me, instance->GetData64(DATA_JINDO)); if (pJindo) DoCast(pJindo, SPELL_HEAL); } @@ -241,7 +241,7 @@ class mob_shade_of_jindo : public CreatureScript struct mob_shade_of_jindoAI : public ScriptedAI { - mob_shade_of_jindoAI(Creature* c) : ScriptedAI(c) {} + mob_shade_of_jindoAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowShock_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 10708cd7f95..cbe1178e6c4 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -55,9 +55,9 @@ class boss_mandokir : public CreatureScript struct boss_mandokirAI : public ScriptedAI { - boss_mandokirAI(Creature* c) : ScriptedAI(c) + boss_mandokirAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 KillCount; @@ -72,7 +72,7 @@ class boss_mandokir : public CreatureScript float targetY; float targetZ; - InstanceScript* m_instance; + InstanceScript* instance; bool endWatch; bool someWatched; @@ -116,9 +116,9 @@ class boss_mandokir : public CreatureScript { DoScriptText(SAY_DING_KILL, me); - if (m_instance) + if (instance) { - uint64 JindoGUID = m_instance->GetData64(DATA_JINDO); + uint64 JindoGUID = instance->GetData64(DATA_JINDO); if (JindoGUID) { if (Unit* jTemp = Unit::GetUnit(*me, JindoGUID)) @@ -256,9 +256,9 @@ class boss_mandokir : public CreatureScript //Checking if Ohgan is dead. If yes Mandokir will enrage. if (Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_OHGAN) == DONE) + if (instance->GetData(DATA_OHGAN) == DONE) { if (!RaptorDead) { @@ -294,13 +294,13 @@ class mob_ohgan : public CreatureScript struct mob_ohganAI : public ScriptedAI { - mob_ohganAI(Creature* c) : ScriptedAI(c) + mob_ohganAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 SunderArmor_Timer; - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { @@ -309,10 +309,10 @@ class mob_ohgan : public CreatureScript void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { - if (m_instance) - m_instance->SetData(DATA_OHGAN, DONE); + if (instance) + instance->SetData(DATA_OHGAN, DONE); } void UpdateAI (const uint32 diff) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index 38d9be78f2a..44ab5d851f5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -51,12 +51,12 @@ class boss_marli : public CreatureScript struct boss_marliAI : public ScriptedAI { - boss_marliAI(Creature* c) : ScriptedAI(c) + boss_marliAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 SpawnStartSpiders_Timer; uint32 PoisonVolley_Timer; @@ -88,11 +88,11 @@ class boss_marli : public CreatureScript DoScriptText(SAY_AGGRO, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(DATA_MARLI, DONE); + if (instance) + instance->SetData(DATA_MARLI, DONE); } void UpdateAI(const uint32 diff) @@ -156,7 +156,7 @@ class boss_marli : public CreatureScript { DoScriptText(SAY_TRANSFORM, me); DoCast(me, SPELL_SPIDER_FORM); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); @@ -196,7 +196,7 @@ class boss_marli : public CreatureScript if (TransformBack_Timer <= diff) { me->SetDisplayId(15220); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); me->UpdateDamagePhysical(BASE_ATTACK); @@ -230,7 +230,7 @@ class mob_spawn_of_marli : public CreatureScript struct mob_spawn_of_marliAI : public ScriptedAI { - mob_spawn_of_marliAI(Creature* c) : ScriptedAI(c) {} + mob_spawn_of_marliAI(Creature* creature) : ScriptedAI(creature) {} uint32 LevelUp_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp index f988d0df77a..81260c28d73 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp @@ -42,7 +42,7 @@ class boss_renataki : public CreatureScript struct boss_renatakiAI : public ScriptedAI { - boss_renatakiAI(Creature* c) : ScriptedAI(c) {} + boss_renatakiAI(Creature* creature) : ScriptedAI(creature) {} uint32 Invisible_Timer; uint32 Ambush_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 4185ba2f3e7..3da74d16dc3 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -66,9 +66,9 @@ class boss_thekal : public CreatureScript struct boss_thekalAI : public ScriptedAI { - boss_thekalAI(Creature* c) : ScriptedAI(c) + boss_thekalAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 MortalCleave_Timer; @@ -81,7 +81,7 @@ class boss_thekal : public CreatureScript uint32 Check_Timer; uint32 Resurrect_Timer; - InstanceScript* m_instance; + InstanceScript* instance; bool Enraged; bool PhaseTwo; bool WasDead; @@ -108,17 +108,17 @@ class boss_thekal : public CreatureScript DoScriptText(SAY_AGGRO, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(DATA_THEKAL, DONE); + if (instance) + instance->SetData(DATA_THEKAL, DONE); } void JustReachedHome() { - if (m_instance) - m_instance->SetData(DATA_THEKAL, NOT_STARTED); + if (instance) + instance->SetData(DATA_THEKAL, NOT_STARTED); } void UpdateAI(const uint32 diff) @@ -129,26 +129,26 @@ class boss_thekal : public CreatureScript //Check_Timer for the death of LorKhan and Zath. if (!WasDead && Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_LORKHAN) == SPECIAL) + if (instance->GetData(DATA_LORKHAN) == SPECIAL) { //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit((*me), m_instance->GetData64(DATA_LORKHAN))) + if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->setFaction(14); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pLorKhan->SetFullHealth(); - m_instance->SetData(DATA_LORKHAN, DONE); + instance->SetData(DATA_LORKHAN, DONE); } } - if (m_instance->GetData(DATA_ZATH) == SPECIAL) + if (instance->GetData(DATA_ZATH) == SPECIAL) { //Resurrect Zath - Unit* pZath = Unit::GetUnit((*me), m_instance->GetData64(DATA_ZATH)); + Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)); if (pZath) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); @@ -156,7 +156,7 @@ class boss_thekal : public CreatureScript pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pZath->SetFullHealth(); - m_instance->SetData(DATA_ZATH, DONE); + instance->SetData(DATA_ZATH, DONE); } } } @@ -185,8 +185,8 @@ class boss_thekal : public CreatureScript me->SetStandState(UNIT_STAND_STATE_SLEEP); me->AttackStop(); - if (m_instance) - m_instance->SetData(DATA_THEKAL, SPECIAL); + if (instance) + instance->SetData(DATA_THEKAL, SPECIAL); WasDead=true; } @@ -197,11 +197,11 @@ class boss_thekal : public CreatureScript if (Resurrect_Timer <= diff) { DoCast(me, SPELL_TIGER_FORM); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); + me->SetObjectScale(2.00f); me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFullHealth(); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); me->UpdateDamagePhysical(BASE_ATTACK); @@ -277,9 +277,9 @@ class mob_zealot_lorkhan : public CreatureScript struct mob_zealot_lorkhanAI : public ScriptedAI { - mob_zealot_lorkhanAI(Creature* c) : ScriptedAI(c) + mob_zealot_lorkhanAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 Shield_Timer; @@ -290,7 +290,7 @@ class mob_zealot_lorkhan : public CreatureScript bool FakeDeath; - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { @@ -302,8 +302,8 @@ class mob_zealot_lorkhan : public CreatureScript FakeDeath = false; - if (m_instance) - m_instance->SetData(DATA_LORKHAN, NOT_STARTED); + if (instance) + instance->SetData(DATA_LORKHAN, NOT_STARTED); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -335,10 +335,10 @@ class mob_zealot_lorkhan : public CreatureScript //Casting Greaterheal to Thekal or Zath if they are in meele range. if (GreaterHeal_Timer <= diff) { - if (m_instance) + if (instance) { - Unit* pThekal = Unit::GetUnit((*me), m_instance->GetData64(DATA_THEKAL)); - Unit* pZath = Unit::GetUnit((*me), m_instance->GetData64(DATA_ZATH)); + Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL)); + Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)); if (!pThekal || !pZath) return; @@ -369,12 +369,12 @@ class mob_zealot_lorkhan : public CreatureScript //Check_Timer for the death of LorKhan and Zath. if (!FakeDeath && Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_THEKAL) == SPECIAL) + if (instance->GetData(DATA_THEKAL) == SPECIAL) { //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit((*me), m_instance->GetData64(DATA_THEKAL))) + if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -383,10 +383,10 @@ class mob_zealot_lorkhan : public CreatureScript } } - if (m_instance->GetData(DATA_ZATH) == SPECIAL) + if (instance->GetData(DATA_ZATH) == SPECIAL) { //Resurrect Zath - if (Unit* pZath = Unit::GetUnit((*me), m_instance->GetData64(DATA_ZATH))) + if (Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH))) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -409,8 +409,8 @@ class mob_zealot_lorkhan : public CreatureScript me->setFaction(35); me->AttackStop(); - if (m_instance) - m_instance->SetData(DATA_LORKHAN, SPECIAL); + if (instance) + instance->SetData(DATA_LORKHAN, SPECIAL); FakeDeath = true; } @@ -437,9 +437,9 @@ class mob_zealot_zath : public CreatureScript struct mob_zealot_zathAI : public ScriptedAI { - mob_zealot_zathAI(Creature* c) : ScriptedAI(c) + mob_zealot_zathAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 SweepingStrikes_Timer; @@ -451,7 +451,7 @@ class mob_zealot_zath : public CreatureScript bool FakeDeath; - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { @@ -464,8 +464,8 @@ class mob_zealot_zath : public CreatureScript FakeDeath = false; - if (m_instance) - m_instance->SetData(DATA_ZATH, NOT_STARTED); + if (instance) + instance->SetData(DATA_ZATH, NOT_STARTED); me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -522,12 +522,12 @@ class mob_zealot_zath : public CreatureScript //Check_Timer for the death of LorKhan and Zath. if (!FakeDeath && Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_LORKHAN) == SPECIAL) + if (instance->GetData(DATA_LORKHAN) == SPECIAL) { //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit((*me), m_instance->GetData64(DATA_LORKHAN))) + if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -536,10 +536,10 @@ class mob_zealot_zath : public CreatureScript } } - if (m_instance->GetData(DATA_THEKAL) == SPECIAL) + if (instance->GetData(DATA_THEKAL) == SPECIAL) { //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit((*me), m_instance->GetData64(DATA_THEKAL))) + if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -562,8 +562,8 @@ class mob_zealot_zath : public CreatureScript me->setFaction(35); me->AttackStop(); - if (m_instance) - m_instance->SetData(DATA_ZATH, SPECIAL); + if (instance) + instance->SetData(DATA_ZATH, SPECIAL); FakeDeath = true; } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index bd6f6ec4748..06448032dff 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -186,7 +186,7 @@ class boss_venoxis : public CreatureScript events.ScheduleEvent(EVENT_THRASH, urand(10000, 20000)); break; - // troll form spells and actions (first part) + // troll form spells and Actions (first part) case EVENT_DISPEL_MAGIC: DoCast(me, SPELL_DISPEL_MAGIC); events.ScheduleEvent(EVENT_DISPEL_MAGIC, urand(15000, 20000), 0, PHASE_ONE); @@ -198,7 +198,7 @@ class boss_venoxis : public CreatureScript case EVENT_HOLY_NOVA: _inMeleeRange = 0; - for (uint8 i = 0; i < 10 ; ++i) + for (uint8 i = 0; i < 10; ++i) { if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, i)) // check if target is within melee-distance @@ -224,7 +224,7 @@ class boss_venoxis : public CreatureScript break; // - // snake form spells and actions + // snake form spells and Actions // case EVENT_VENOM_SPIT: diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp index 702a69207ba..b22630f51bb 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp @@ -40,7 +40,7 @@ class boss_wushoolay : public CreatureScript struct boss_wushoolayAI : public ScriptedAI { - boss_wushoolayAI(Creature* c) : ScriptedAI(c) {} + boss_wushoolayAI(Creature* creature) : ScriptedAI(creature) {} uint32 LightningCloud_Timer; uint32 LightningWave_Timer; diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index 82b09b9dc18..d4d35b107b2 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -62,38 +62,44 @@ class npc_professor_phizzlethorpe : public CreatureScript struct npc_professor_phizzlethorpeAI : public npc_escortAI { - npc_professor_phizzlethorpeAI(Creature* c) : npc_escortAI(c) {} + npc_professor_phizzlethorpeAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (uiPointId) + switch (waypointId) { - case 4:Talk(SAY_PROGRESS_2, player->GetGUID());break; - case 5:Talk(SAY_PROGRESS_3, player->GetGUID());break; - case 8:Talk(EMOTE_PROGRESS_4);break; - case 9: - { - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - break; - } - case 10:Talk(SAY_PROGRESS_5, player->GetGUID());break; - case 11: - Talk(SAY_PROGRESS_6, player->GetGUID()); - SetRun(); - break; - case 19:Talk(SAY_PROGRESS_7, player->GetGUID()); break; - case 20: - Talk(EMOTE_PROGRESS_8); - Talk(SAY_PROGRESS_9, player->GetGUID()); - if (player) - CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); - break; + case 4: + Talk(SAY_PROGRESS_2, player->GetGUID()); + break; + case 5: + Talk(SAY_PROGRESS_3, player->GetGUID()); + break; + case 8: + Talk(EMOTE_PROGRESS_4); + break; + case 9: + me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + case 10: + Talk(SAY_PROGRESS_5, player->GetGUID()); + break; + case 11: + Talk(SAY_PROGRESS_6, player->GetGUID()); + SetRun(); + break; + case 19: + Talk(SAY_PROGRESS_7, player->GetGUID()); + break; + case 20: + Talk(EMOTE_PROGRESS_8); + Talk(SAY_PROGRESS_9, player->GetGUID()); + player->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); + break; } } diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/blasted_lands.cpp index 2ad03f8b504..2042e5313c3 100644 --- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp +++ b/src/server/scripts/EasternKingdoms/blasted_lands.cpp @@ -44,10 +44,10 @@ class npc_deathly_usher : public CreatureScript public: npc_deathly_usher() : CreatureScript("npc_deathly_usher") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true); @@ -65,7 +65,6 @@ public: return true; } - }; void AddSC_blasted_lands() diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp index 126f55838b9..8749c943a6f 100644 --- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp +++ b/src/server/scripts/EasternKingdoms/boss_kruul.cpp @@ -45,7 +45,7 @@ public: struct boss_kruulAI : public ScriptedAI { - boss_kruulAI(Creature* c) : ScriptedAI(c) {} + boss_kruulAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowVolley_Timer; uint32 Cleave_Timer; @@ -151,7 +151,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_kruul() diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp index 1d2725b10ee..b526246f670 100644 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp @@ -51,10 +51,10 @@ class npc_ragged_john : public CreatureScript public: npc_ragged_john() : CreatureScript("npc_ragged_john") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -127,7 +127,7 @@ public: struct npc_ragged_johnAI : public ScriptedAI { - npc_ragged_johnAI(Creature* c) : ScriptedAI(c) {} + npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} @@ -147,7 +147,6 @@ public: void EnterCombat(Unit* /*who*/) {} }; - }; void AddSC_burning_steppes() diff --git a/src/server/scripts/EasternKingdoms/duskwood.cpp b/src/server/scripts/EasternKingdoms/duskwood.cpp index 5d04489bbca..10cb5987ce5 100644 --- a/src/server/scripts/EasternKingdoms/duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/duskwood.cpp @@ -60,7 +60,6 @@ public: } return false; }; - }; /*###### @@ -83,7 +82,7 @@ public: struct boss_twilight_corrupterAI : public ScriptedAI { - boss_twilight_corrupterAI(Creature* c) : ScriptedAI(c) {} + boss_twilight_corrupterAI(Creature* creature) : ScriptedAI(creature) {} uint32 SoulCorruption_Timer; uint32 CreatureOfNightmare_Timer; @@ -133,7 +132,6 @@ public: DoMeleeAttackIfReady(); }; }; - }; void AddSC_duskwood() diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp index 2b4bb61c603..0519ce94b32 100644 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp @@ -32,35 +32,30 @@ EndContentData */ #include "ScriptPCH.h" -//id8530 - cannibal ghoul -//id8531 - gibbering ghoul -//id8532 - diseased flayer - class mobs_ghoul_flayer : public CreatureScript { public: mobs_ghoul_flayer() : CreatureScript("mobs_ghoul_flayer") { } - CreatureAI* GetAI(Creature* creature) const - { - return new mobs_ghoul_flayerAI (creature); - } - struct mobs_ghoul_flayerAI : public ScriptedAI { - mobs_ghoul_flayerAI(Creature* c) : ScriptedAI(c) {} + mobs_ghoul_flayerAI(Creature* creature) : ScriptedAI(creature) { } void Reset() {} void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (Killer->GetTypeId() == TYPEID_PLAYER) + if (killer->GetTypeId() == TYPEID_PLAYER) me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); } }; + CreatureAI* GetAI(Creature* creature) const + { + return new mobs_ghoul_flayerAI (creature); + } }; /*###### @@ -72,10 +67,10 @@ class npc_augustus_the_touched : public CreatureScript public: npc_augustus_the_touched() : CreatureScript("npc_augustus_the_touched") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; } @@ -91,7 +86,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -120,7 +114,7 @@ public: struct npc_darrowshire_spiritAI : public ScriptedAI { - npc_darrowshire_spiritAI(Creature* c) : ScriptedAI(c) {} + npc_darrowshire_spiritAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -129,9 +123,7 @@ public: } void EnterCombat(Unit* /*who*/) {} - }; - }; /*###### @@ -148,10 +140,10 @@ class npc_tirion_fordring : public CreatureScript public: npc_tirion_fordring() : CreatureScript("npc_tirion_fordring") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -185,7 +177,6 @@ public: return true; } - }; void AddSC_eastern_plaguelands() diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index 4797774ef49..8ae72e142c8 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -124,7 +124,6 @@ public: void Reset() { - timer = 2000; questPhase = 0; summonerGuid = 0; @@ -248,7 +247,7 @@ public: CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL); } - void JustDied(Unit* Killer); + void JustDied(Unit* killer); }; }; @@ -294,7 +293,7 @@ public: struct master_kelerun_bloodmournAI : public ScriptedAI { - master_kelerun_bloodmournAI(Creature* c) : ScriptedAI(c) {} + master_kelerun_bloodmournAI(Creature* creature) : ScriptedAI(creature) {} uint8 questPhase; uint8 paladinPhase; @@ -366,10 +365,8 @@ public: void StartEvent() { - if (questPhase == 1) { // no player check, quest can be finished as group, so no complex PlayerGUID/group search code - for (uint8 i = 0; i < 4; ++i) if (Creature* summoned = DoSpawnCreature(PaladinEntry[i], SpawnPosition[i].x, SpawnPosition[i].y, SpawnPosition[i].z, SpawnPosition[i].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 180000)) paladinGuid[i] = summoned->GetGUID(); @@ -420,15 +417,14 @@ class go_second_trial : public GameObjectScript public: go_second_trial() : GameObjectScript("go_second_trial") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { // find spawn :: master_kelerun_bloodmourn - if (Creature* creature = pGO->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f)) + if (Creature* creature = go->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f)) CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->StartEvent(); return true; } - }; /*###### @@ -461,7 +457,7 @@ public: struct npc_apprentice_mirvedaAI : public ScriptedAI { - npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(me) {} + npc_apprentice_mirvedaAI(Creature* creature) : ScriptedAI(creature), Summons(me) {} uint32 KillCount; uint64 PlayerGUID; @@ -494,14 +490,14 @@ public: { if (PlayerGUID) if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - CAST_PLR(player)->FailQuest(QUEST_UNEXPECTED_RESULT); + player->FailQuest(QUEST_UNEXPECTED_RESULT); } void UpdateAI(const uint32 /*diff*/) { if (KillCount >= 3 && PlayerGUID) if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - CAST_PLR(player)->CompleteQuest(QUEST_UNEXPECTED_RESULT); + player->CompleteQuest(QUEST_UNEXPECTED_RESULT); if (Summon) { @@ -512,7 +508,6 @@ public: } } }; - }; /*###### @@ -552,7 +547,7 @@ public: struct npc_infused_crystalAI : public Scripted_NoMovementAI { - npc_infused_crystalAI(Creature* c) : Scripted_NoMovementAI(c) {} + npc_infused_crystalAI(Creature* creature) : Scripted_NoMovementAI(creature) {} uint32 EndTimer; uint32 WaveTimer; @@ -621,7 +616,6 @@ public: } else WaveTimer -= diff; } }; - }; void AddSC_eversong_woods() diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 412613572f1..e40a2f785e6 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -44,10 +44,10 @@ class npc_budd_nedreck : public CreatureScript public: npc_budd_nedreck() : CreatureScript("npc_budd_nedreck") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, 42540, false); @@ -66,7 +66,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -78,10 +77,10 @@ class npc_rathis_tomber : public CreatureScript public: npc_rathis_tomber() : CreatureScript("npc_rathis_tomber") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; } @@ -100,7 +99,6 @@ public: return true; } - }; /*###### @@ -130,61 +128,63 @@ public: struct npc_ranger_lilathaAI : public npc_escortAI { - npc_ranger_lilathaAI(Creature* c) : npc_escortAI(c) {} + npc_ranger_lilathaAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 0: - { - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) - Cage->SetGoState(GO_STATE_ACTIVE); - DoScriptText(SAY_START, me, player); - break; - } - case 5: - DoScriptText(SAY_PROGRESS1, me, player); - case 11: - DoScriptText(SAY_PROGRESS2, me, player); - me->SetOrientation(4.762841f); - break; - case 18: - { - DoScriptText(SAY_PROGRESS3, me, player); - Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0); - Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Summ1 && Summ2) - { - Summ1->Attack(me, true); - Summ2->Attack(player, true); - } - me->AI()->AttackStart(Summ1); - break; - } - case 19: me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break; - case 25: me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); break; - case 30: - if (player && player->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); - break; - case 32: - me->SetOrientation(2.978281f); - DoScriptText(SAY_END1, me, player); - break; - case 33: - me->SetOrientation(5.858011f); - DoScriptText(SAY_END2, me, player); - Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); - if (CaptainHelios) - DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); - break; + case 0: + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) + Cage->SetGoState(GO_STATE_ACTIVE); + DoScriptText(SAY_START, me, player); + break; + case 5: + DoScriptText(SAY_PROGRESS1, me, player); + break; + case 11: + DoScriptText(SAY_PROGRESS2, me, player); + me->SetOrientation(4.762841f); + break; + case 18: + { + DoScriptText(SAY_PROGRESS3, me, player); + Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0); + Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0); + if (Summ1 && Summ2) + { + Summ1->Attack(me, true); + Summ2->Attack(player, true); + } + me->AI()->AttackStart(Summ1); + } + break; + case 19: + me->SetWalk(false); + break; + case 25: + me->SetWalk(true); + break; + case 30: + if (player->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); + break; + case 32: + me->SetOrientation(2.978281f); + DoScriptText(SAY_END1, me, player); + break; + case 33: + me->SetOrientation(5.858011f); + DoScriptText(SAY_END2, me, player); + Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); + if (CaptainHelios) + DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); + break; } } diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index 7021deeae75..8de895cb51f 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -87,9 +87,9 @@ public: void Reset() { } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 26: DoScriptText(SAY_OOX_AMBUSH, me); @@ -146,7 +146,6 @@ public: summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); } }; - }; /*###### @@ -273,18 +272,17 @@ public: void JustSummoned(Creature* summoned) { - summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + summoned->SetWalk(false); summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (uiPointId) + switch (waypointId) { case 1: DoScriptText(SAY_RIN_FREE, me, player); @@ -315,7 +313,7 @@ public: { m_uiPostEventTimer = 3000; - if (Unit* player = GetPlayerForEscort()) + if (Player* player = GetPlayerForEscort()) { switch (m_uiPostEventCount) { @@ -345,7 +343,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_hinterlands() diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp index 5a0ee3c5630..93a8d7423c9 100644 --- a/src/server/scripts/EasternKingdoms/ironforge.cpp +++ b/src/server/scripts/EasternKingdoms/ironforge.cpp @@ -44,10 +44,10 @@ class npc_royal_historian_archesonus : public CreatureScript public: npc_royal_historian_archesonus() : CreatureScript("npc_royal_historian_archesonus") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -88,7 +88,6 @@ public: return true; } - }; void AddSC_ironforge() diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp index f2095de49c3..27d8ea3e51c 100644 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp @@ -51,7 +51,7 @@ public: struct npc_converted_sentryAI : public ScriptedAI { - npc_converted_sentryAI(Creature* c) : ScriptedAI(c) {} + npc_converted_sentryAI(Creature* creature) : ScriptedAI(creature) {} bool Credit; uint32 Timer; @@ -85,7 +85,6 @@ public: } } }; - }; /*###### @@ -109,7 +108,7 @@ public: struct npc_greengill_slaveAI : public ScriptedAI { - npc_greengill_slaveAI(Creature* c) : ScriptedAI(c) {} + npc_greengill_slaveAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; @@ -130,8 +129,8 @@ public: PlayerGUID = caster->GetGUID(); if (PlayerGUID) { - Unit* player = Unit::GetUnit((*me), PlayerGUID); - if (player && CAST_PLR(player)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (player && player->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) DoCast(player, 45110, true); } DoCast(me, ENRAGE); @@ -149,7 +148,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_isle_of_queldanas() diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp index 9ce9de4381a..7ea8a62a5bd 100644 --- a/src/server/scripts/EasternKingdoms/loch_modan.cpp +++ b/src/server/scripts/EasternKingdoms/loch_modan.cpp @@ -47,10 +47,10 @@ class npc_mountaineer_pebblebitty : public CreatureScript public: npc_mountaineer_pebblebitty() : CreatureScript("npc_mountaineer_pebblebitty") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -95,7 +95,6 @@ public: return true; } - }; void AddSC_loch_modan() diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp index d7b00af33e8..3ade1da4a19 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -76,17 +76,16 @@ public: uiShieldBashTimer = 8000; } - void WaypointReached(uint32 uiI) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - if (uiI >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + if (waypointId >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) + me->SetWalk(false); - switch (uiI) + switch (waypointId) { case 39: SetEscortPaused(true); @@ -94,7 +93,7 @@ public: uiPhase = 1; break; case 65: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); break; case 115: player->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION); @@ -164,7 +163,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_redridge_mountains() diff --git a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp index 8d04e92b9b8..e6595a83b66 100644 --- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp @@ -53,7 +53,7 @@ public: struct npc_blood_knight_stillbladeAI : public ScriptedAI { - npc_blood_knight_stillbladeAI(Creature* c) : ScriptedAI(c) {} + npc_blood_knight_stillbladeAI(Creature* creature) : ScriptedAI(creature) {} uint32 lifeTimer; bool spellHit; @@ -100,7 +100,6 @@ public: } } }; - }; void AddSC_silvermoon_city() diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index 4d897c4f3b8..bc3110878de 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -64,37 +64,46 @@ public: struct npc_deathstalker_erlandAI : public npc_escortAI { - npc_deathstalker_erlandAI(Creature* c) : npc_escortAI(c) {} + npc_deathstalker_erlandAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 1: DoScriptText(SAY_START, me, player);break; - case 13: - DoScriptText(SAY_LAST, me, player); - player->GroupEventHappens(QUEST_ESCORTING, me); break; - case 14: DoScriptText(SAY_THANKS, me, player); break; - case 15: { - Unit* Rane = me->FindNearestCreature(NPC_RANE, 20); - if (Rane) + case 1: + DoScriptText(SAY_START, me, player); + break; + case 13: + DoScriptText(SAY_LAST, me, player); + player->GroupEventHappens(QUEST_ESCORTING, me); + break; + case 14: + DoScriptText(SAY_THANKS, me, player); + break; + case 15: + if (Unit* Rane = me->FindNearestCreature(NPC_RANE, 20)) DoScriptText(SAY_RANE, Rane); - break;} - case 16: DoScriptText(SAY_ANSWER, me); break; - case 17: DoScriptText(SAY_MOVE_QUINN, me); break; - case 24: DoScriptText(SAY_GREETINGS, me); break; - case 25: { - Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20); - if (Quinn) + break; + case 16: + DoScriptText(SAY_ANSWER, me); + break; + case 17: + DoScriptText(SAY_MOVE_QUINN, me); + break; + case 24: + DoScriptText(SAY_GREETINGS, me); + break; + case 25: + if (Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20)) DoScriptText(SAY_QUINN, Quinn); - break;} - case 26: DoScriptText(SAY_ON_BYE, me, NULL); break; - + break; + case 26: + DoScriptText(SAY_ON_BYE, me, NULL); + break; } } @@ -123,7 +132,6 @@ public: { return new npc_deathstalker_erlandAI(creature); } - }; /*###### @@ -177,7 +185,7 @@ public: struct pyrewood_ambushAI : public ScriptedAI { - pyrewood_ambushAI(Creature* c) : ScriptedAI(c), Summons(me) + pyrewood_ambushAI(Creature* creature) : ScriptedAI(creature), Summons(me) { QuestInProgress = false; } @@ -309,7 +317,6 @@ public: ++Phase; //prepare next phase } }; - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index a4eca1950f8..96ad1da725d 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -47,10 +47,10 @@ class npc_archmage_malin : public CreatureScript public: npc_archmage_malin() : CreatureScript("npc_archmage_malin") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, 42711, true); @@ -71,7 +71,6 @@ public: return true; } - }; /*###### @@ -106,9 +105,9 @@ public: struct npc_bartlebyAI : public ScriptedAI { - npc_bartlebyAI(Creature* c) : ScriptedAI(c) + npc_bartlebyAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormalFaction = c->getFaction(); + m_uiNormalFaction = creature->getFaction(); } uint32 m_uiNormalFaction; @@ -143,7 +142,6 @@ public: } } }; - }; /*###### @@ -160,10 +158,10 @@ class npc_lady_katrana_prestor : public CreatureScript public: npc_lady_katrana_prestor() : CreatureScript("npc_lady_katrana_prestor") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -197,7 +195,6 @@ public: return true; } - }; /*###### @@ -271,9 +268,9 @@ public: } } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 14: SetEscortPaused(true); @@ -370,7 +367,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -391,7 +387,7 @@ public: { npc_marzon_silent_bladeAI(Creature* creature) : ScriptedAI(creature) { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); } void Reset() @@ -407,7 +403,7 @@ public: { if (Unit* summoner = me->ToTempSummon()->GetSummoner()) { - if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive() && !summoner->isInCombat()) + if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive() && !summoner->isInCombat()) summoner->ToCreature()->AI()->AttackStart(who); } } @@ -421,7 +417,7 @@ public: { if (Unit* summoner = me->ToTempSummon()->GetSummoner()) { - if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive()) + if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive()) summoner->ToCreature()->DisappearAndDie(); } } @@ -457,7 +453,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -502,9 +497,9 @@ public: uiPhase = 0; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 1: SetEscortPaused(true); @@ -606,7 +601,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -636,7 +630,6 @@ public: } return false; } - }; void AddSC_stormwind_city() diff --git a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp index a6effe29ff7..03f92ce6d61 100644 --- a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp @@ -45,7 +45,7 @@ public: struct mob_yennikuAI : public ScriptedAI { - mob_yennikuAI(Creature* c) : ScriptedAI(c) + mob_yennikuAI(Creature* creature) : ScriptedAI(creature) { bReset = false; } @@ -114,7 +114,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp index ef6fccd8bde..6507ec911c0 100644 --- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp +++ b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp @@ -106,24 +106,24 @@ public: } } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { - case 0: - if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID)) - pCage->ResetDoorOrButton(); - break; - case 20: - if (Player* player = GetPlayerForEscort()) - { - me->SetFacingToObject(player); - DoScriptText(SAY_QUEST_COMPLETE, me, player); - DoScriptText(EMOTE_WHISPER, me, player); - player->GroupEventHappens(QUEST_GALENS_ESCAPE, me); - } - SetRun(true); - break; + case 0: + if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID)) + pCage->ResetDoorOrButton(); + break; + case 20: + if (Player* player = GetPlayerForEscort()) + { + me->SetFacingToObject(player); + DoScriptText(SAY_QUEST_COMPLETE, me, player); + DoScriptText(EMOTE_WHISPER, me, player); + player->GroupEventHappens(QUEST_GALENS_ESCAPE, me); + } + SetRun(true); + break; } } diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp index 0d72ab6fb2f..4687fa3630f 100644 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp @@ -150,7 +150,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -185,7 +184,6 @@ public: return false; } - }; class go_mausoleum_trigger : public GameObjectScript @@ -207,7 +205,6 @@ public: return false; } - }; void AddSC_tirisfal_glades() diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index fe9c40e6dbd..a9b627ded34 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -47,7 +47,15 @@ enum Sylvanas SPELL_HIGHBORNE_AURA = 37090, SPELL_SYLVANAS_CAST = 36568, - SPELL_RIBBON_OF_SOULS = 34432, //the real one to use might be 37099 + SPELL_RIBBON_OF_SOULS = 34432, // the real one to use might be 37099 + + // Combat spells + SPELL_BLACK_ARROW = 59712, + SPELL_FADE = 20672, + SPELL_FADE_BLINK = 29211, + SPELL_MULTI_SHOT = 59713, + SPELL_SHOT = 59710, + SPELL_SUMMON_SKELETON = 59711 }; float HighborneLoc[4][3]= @@ -88,17 +96,29 @@ public: struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI { - npc_lady_sylvanas_windrunnerAI(Creature* c) : ScriptedAI(c) {} + npc_lady_sylvanas_windrunnerAI(Creature* creature) : ScriptedAI(creature) {} - uint32 LamentEvent_Timer; + uint32 LamentEventTimer; bool LamentEvent; uint64 targetGUID; + uint32 FadeTimer; + uint32 SummonSkeletonTimer; + uint32 BlackArrowTimer; + uint32 ShotTimer; + uint32 MultiShotTimer; + void Reset() { - LamentEvent_Timer = 5000; + LamentEventTimer = 5000; LamentEvent = false; targetGUID = 0; + + FadeTimer = 30000; + SummonSkeletonTimer = 20000; + BlackArrowTimer = 15000; + ShotTimer = 8000; + MultiShotTimer = 10000; } void EnterCombat(Unit* /*who*/) {} @@ -114,7 +134,7 @@ public: summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); } - summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + summoned->SetDisableGravity(true); targetGUID = summoned->GetGUID(); } } @@ -123,27 +143,73 @@ public: { if (LamentEvent) { - if (LamentEvent_Timer <= diff) + if (LamentEventTimer <= diff) { DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN); - LamentEvent_Timer = 2000; + LamentEventTimer = 2000; if (!me->HasAura(SPELL_SYLVANAS_CAST)) { DoScriptText(SAY_LAMENT_END, me); DoScriptText(EMOTE_LAMENT_END, me); LamentEvent = false; } - } else LamentEvent_Timer -= diff; + } else LamentEventTimer -= diff; } if (!UpdateVictim()) return; + // Combat spells + + if (FadeTimer <= diff) + { + DoCast(me, SPELL_FADE); + // add a blink to simulate a stealthed movement and reappearing elsewhere + DoCast(me, SPELL_FADE_BLINK); + FadeTimer = 30000 + rand()%5000; + // if the victim is out of melee range she cast multi shot + if (Unit* victim = me->getVictim()) + if (me->GetDistance(victim) > 10.0f) + DoCast(victim, SPELL_MULTI_SHOT); + } else FadeTimer -= diff; + + if (SummonSkeletonTimer <= diff) + { + DoCast(me, SPELL_SUMMON_SKELETON); + SummonSkeletonTimer = 20000 + rand()%10000; + } else SummonSkeletonTimer -= diff; + + if (BlackArrowTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(victim, SPELL_BLACK_ARROW); + BlackArrowTimer = 15000 + rand()%5000; + } + } else BlackArrowTimer -= diff; + + if (ShotTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(victim, SPELL_SHOT); + ShotTimer = 8000 + rand()%2000; + } + } else ShotTimer -= diff; + + if (MultiShotTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(victim, SPELL_MULTI_SHOT); + MultiShotTimer = 10000 + rand()%3000; + } + } else MultiShotTimer -= diff; + DoMeleeAttackIfReady(); } }; - }; /*###### @@ -162,17 +228,17 @@ public: struct npc_highborne_lamenterAI : public ScriptedAI { - npc_highborne_lamenterAI(Creature* c) : ScriptedAI(c) {} + npc_highborne_lamenterAI(Creature* creature) : ScriptedAI(creature) {} - uint32 EventMove_Timer; - uint32 EventCast_Timer; + uint32 EventMoveTimer; + uint32 EventCastTimer; bool EventMove; bool EventCast; void Reset() { - EventMove_Timer = 10000; - EventCast_Timer = 17500; + EventMoveTimer = 10000; + EventCastTimer = 17500; EventMove = true; EventCast = true; } @@ -183,25 +249,24 @@ public: { if (EventMove) { - if (EventMove_Timer <= diff) + if (EventMoveTimer <= diff) { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f)); me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation()); EventMove = false; - } else EventMove_Timer -= diff; + } else EventMoveTimer -= diff; } if (EventCast) { - if (EventCast_Timer <= diff) + if (EventCastTimer <= diff) { DoCast(me, SPELL_HIGHBORNE_AURA); EventCast = false; - } else EventCast_Timer -= diff; + } else EventCastTimer -= diff; } } }; - }; /*###### @@ -219,15 +284,15 @@ class npc_parqual_fintallas : public CreatureScript public: npc_parqual_fintallas() : CreatureScript("npc_parqual_fintallas") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_MARK_OF_SHAME, false); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { player->CLOSE_GOSSIP_MENU(); player->AreaExploredOrEventHappens(6628); @@ -252,7 +317,6 @@ public: return true; } - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index a04a94f73b1..0057c01b882 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -49,10 +49,10 @@ class npcs_dithers_and_arbington : public CreatureScript public: npcs_dithers_and_arbington() : CreatureScript("npcs_dithers_and_arbington") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -85,6 +85,7 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); @@ -95,12 +96,12 @@ public: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); player->SEND_GOSSIP_MENU(3985, creature->GetGUID()); - }else + } + else player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -121,10 +122,10 @@ class npc_myranda_the_hag : public CreatureScript public: npc_myranda_the_hag() : CreatureScript("npc_myranda_the_hag") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->CLOSE_GOSSIP_MENU(); player->CastSpell(player, SPELL_SCARLET_ILLUSION, false); @@ -149,7 +150,6 @@ public: return true; } - }; /*###### @@ -168,7 +168,7 @@ public: struct npc_the_scourge_cauldronAI : public ScriptedAI { - npc_the_scourge_cauldronAI(Creature* c) : ScriptedAI(c) {} + npc_the_scourge_cauldronAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} @@ -229,7 +229,6 @@ public: } } }; - }; /*###### @@ -253,7 +252,7 @@ public: struct npc_andorhal_towerAI : public Scripted_NoMovementAI { - npc_andorhal_towerAI(Creature* c) : Scripted_NoMovementAI(c) {} + npc_andorhal_towerAI(Creature* creature) : Scripted_NoMovementAI(creature) {} void MoveInLineOfSight(Unit* who) { @@ -264,7 +263,6 @@ public: CAST_PLR(who)->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); } }; - }; /*###### @@ -330,10 +328,11 @@ public: summoned->AI()->AttackStart(me); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - switch (i) + + switch (waypointId) { case 8: DoScriptText(SAY_WP_0, me); @@ -359,7 +358,7 @@ public: break; case 23: Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - Ughost->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Ughost->SetDisableGravity(true); DoScriptText(SAY_WP_4, Ughost, me); m_uiChatTimer = 4000; break; @@ -382,8 +381,7 @@ public: void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); - if (player) + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_TOMB_LIGHTBRINGER); } @@ -395,7 +393,6 @@ public: m_uiChatTimer = 6000; } }; - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp index 271e1d99d63..46f1526c5bf 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/westfall.cpp @@ -85,9 +85,15 @@ public: { switch (uiWPHolder) { - case 7: DoScriptText(SAY_DS_DOWN_1, me); break; - case 8: DoScriptText(SAY_DS_DOWN_2, me); break; - case 9: DoScriptText(SAY_DS_DOWN_3, me); break; + case 7: + DoScriptText(SAY_DS_DOWN_1, me); + break; + case 8: + DoScriptText(SAY_DS_DOWN_2, me); + break; + case 9: + DoScriptText(SAY_DS_DOWN_3, me); + break; } } else @@ -96,16 +102,15 @@ public: uiShootTimer = 0; } - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - uiWPHolder = uiPoint; + uiWPHolder = waypointId; - switch (uiPoint) + switch (waypointId) { case 4: SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); @@ -185,7 +190,6 @@ public: } else uiShootTimer -= diff; } }; - }; /*###### @@ -225,16 +229,15 @@ public: struct npc_defias_traitorAI : public npc_escortAI { - npc_defias_traitorAI(Creature* c) : npc_escortAI(c) { Reset(); } + npc_defias_traitorAI(Creature* creature) : npc_escortAI(creature) { Reset(); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 35: SetRun(false); @@ -244,13 +247,11 @@ public: break; case 44: DoScriptText(SAY_END, me, player); - { - if (player) - player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); - } + player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); break; } } + void EnterCombat(Unit* who) { DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2), me, who); @@ -258,7 +259,6 @@ public: void Reset() {} }; - }; void AddSC_westfall() diff --git a/src/server/scripts/EasternKingdoms/wetlands.cpp b/src/server/scripts/EasternKingdoms/wetlands.cpp index 3b196720242..bf28d9838a4 100644 --- a/src/server/scripts/EasternKingdoms/wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/wetlands.cpp @@ -67,14 +67,13 @@ public: m_bFriendSummoned = false; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 2: if (me->HasStealthAura()) me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); - SetRun(); me->setFaction(FACTION_ENEMY); break; @@ -132,7 +131,6 @@ public: } } }; - }; /*###### @@ -161,7 +159,6 @@ public: } return false; } - }; /*###### |
