diff options
Diffstat (limited to 'src/server/scripts')
73 files changed, 1451 insertions, 1557 deletions
diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index d34b1b8c3c3..d43cce45c00 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -112,6 +112,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Grids/Notifiers ${CMAKE_SOURCE_DIR}/src/server/game/Groups ${CMAKE_SOURCE_DIR}/src/server/game/Guilds + ${CMAKE_SOURCE_DIR}/src/server/game/Handlers ${CMAKE_SOURCE_DIR}/src/server/game/Instances ${CMAKE_SOURCE_DIR}/src/server/game/LookingForGroup ${CMAKE_SOURCE_DIR}/src/server/game/Loot @@ -130,7 +131,6 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Scripting ${CMAKE_SOURCE_DIR}/src/server/game/Server ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol - ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol/Handlers ${CMAKE_SOURCE_DIR}/src/server/game/Skills ${CMAKE_SOURCE_DIR}/src/server/game/Spells ${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index b69f800327e..9b9d1cfd146 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -26,6 +26,7 @@ EndScriptData */ #include "ObjectMgr.h" #include "Chat.h" #include "AccountMgr.h" +#include "World.h" class gm_commandscript : public CommandScript { @@ -155,7 +156,7 @@ public: static bool HandleGMListFullCommand(ChatHandler* handler, char const* /*args*/) { ///- Get the accounts with GM Level >0 - QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u", SEC_MODERATOR); + QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u AND (aa.realmid = -1 OR aa.realmid = %u)", SEC_MODERATOR, realmID); if (result) { handler->SendSysMessage(LANG_GMLIST); diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 2fb6c3f0d10..74b8272201b 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -97,7 +97,7 @@ public: // Activate object->SetLootState(GO_READY); - object->UseDoorOrButton(10000); + object->UseDoorOrButton(10000, false, handler->GetSession()->GetPlayer()); handler->PSendSysMessage("Object activated!"); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 54dac404f03..57932ef56c6 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -130,7 +130,7 @@ public: { uint32 tguid = chr->GetTransport()->AddNPCPassenger(0, id, chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO()); if (tguid > 0) - WorldDatabase.PQuery("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO()); + WorldDatabase.PExecute("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO()); return true; } @@ -679,7 +679,7 @@ public: if (target->GetTransport()) if (target->GetGUIDTransport()) - WorldDatabase.PQuery("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport()); + WorldDatabase.PExecute("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport()); target->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote); @@ -1036,15 +1036,14 @@ public: } if (/*creature->GetMotionMaster()->empty() ||*/ - creature->GetMotionMaster()->GetCurrentMovementGeneratorType () != TARGETED_MOTION_TYPE) + creature->GetMotionMaster()->GetCurrentMovementGeneratorType () != FOLLOW_MOTION_TYPE) { handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName()); handler->SetSentErrorMessage(true); return false; } - TargetedMovementGenerator<Creature> const* mgen - = static_cast<TargetedMovementGenerator<Creature> const*>((creature->GetMotionMaster()->top())); + FollowMovementGenerator<Creature> const* mgen = static_cast<FollowMovementGenerator<Creature> const*>((creature->GetMotionMaster()->top())); if (mgen->GetTarget() != player) { diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 4d8ce4ef4ed..363f7645f6f 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -404,113 +404,116 @@ public: if (!*args) return false; - uint32 entry = (uint32) atoi((char*)args); - QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry); - if (!result) - { - handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry); - handler->SetSentErrorMessage(true); - return false; - } - - CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry); - if (!cInfo) - { - handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry); - handler->SetSentErrorMessage(true); - return false; - } + Tokens entries(std::string(args), ' '); - sLog->outString("Reloading creature template entry %u", entry); - - Field* fields = result->Fetch(); - - const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->KillCredit[0] = fields[3].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->KillCredit[1] = fields[4].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->Modelid1 = fields[5].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->Modelid2 = fields[6].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->Modelid3 = fields[7].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->Modelid4 = fields[8].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->Name = fields[9].GetString(); - const_cast<CreatureTemplate*>(cInfo)->SubName = fields[10].GetString(); - const_cast<CreatureTemplate*>(cInfo)->IconName = fields[11].GetString(); - const_cast<CreatureTemplate*>(cInfo)->GossipMenuId = fields[12].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->minlevel = fields[13].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->maxlevel = fields[14].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->expansion = fields[15].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->faction_A = fields[16].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->faction_H = fields[17].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->npcflag = fields[18].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->speed_walk = fields[19].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->speed_run = fields[20].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->scale = fields[21].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->rank = fields[22].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->mindmg = fields[23].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->maxdmg = fields[24].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->dmgschool = fields[25].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->attackpower = fields[26].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->dmg_multiplier = fields[27].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->baseattacktime = fields[28].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->rangeattacktime = fields[29].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->unit_class = fields[30].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->unit_flags = fields[31].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->dynamicflags = fields[32].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->family = fields[33].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->trainer_type = fields[34].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->trainer_spell = fields[35].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->trainer_class = fields[36].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->trainer_race = fields[37].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->minrangedmg = fields[38].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->maxrangedmg = fields[39].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->rangedattackpower = fields[40].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->type = fields[41].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->type_flags = fields[42].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->lootid = fields[43].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->pickpocketLootId = fields[44].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->SkinLootId = fields[45].GetUInt32(); - - for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) + for (Tokens::const_iterator itr = entries.begin(); itr != entries.end(); ++itr) { - const_cast<CreatureTemplate*>(cInfo)->resistance[i] = fields[46 + i -1].GetUInt32(); + uint32 entry = uint32(atoi(*itr)); + QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry); + if (!result) + { + handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry); + continue; + } + + CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry); + if (!cInfo) + { + handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry); + continue; + } + + sLog->outString("Reloading creature template entry %u", entry); + + Field* fields = result->Fetch(); + + const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->KillCredit[0] = fields[3].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->KillCredit[1] = fields[4].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->Modelid1 = fields[5].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->Modelid2 = fields[6].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->Modelid3 = fields[7].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->Modelid4 = fields[8].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->Name = fields[9].GetString(); + const_cast<CreatureTemplate*>(cInfo)->SubName = fields[10].GetString(); + const_cast<CreatureTemplate*>(cInfo)->IconName = fields[11].GetString(); + const_cast<CreatureTemplate*>(cInfo)->GossipMenuId = fields[12].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->minlevel = fields[13].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->maxlevel = fields[14].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->expansion = fields[15].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->faction_A = fields[16].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->faction_H = fields[17].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->npcflag = fields[18].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->speed_walk = fields[19].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->speed_run = fields[20].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->scale = fields[21].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->rank = fields[22].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->mindmg = fields[23].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->maxdmg = fields[24].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->dmgschool = fields[25].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->attackpower = fields[26].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->dmg_multiplier = fields[27].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->baseattacktime = fields[28].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->rangeattacktime = fields[29].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->unit_class = fields[30].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->unit_flags = fields[31].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->dynamicflags = fields[32].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->family = fields[33].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->trainer_type = fields[34].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->trainer_spell = fields[35].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->trainer_class = fields[36].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->trainer_race = fields[37].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->minrangedmg = fields[38].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->maxrangedmg = fields[39].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->rangedattackpower = fields[40].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->type = fields[41].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->type_flags = fields[42].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->lootid = fields[43].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->pickpocketLootId = fields[44].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->SkinLootId = fields[45].GetUInt32(); + + for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) + { + const_cast<CreatureTemplate*>(cInfo)->resistance[i] = fields[46 + i -1].GetUInt32(); + } + + const_cast<CreatureTemplate*>(cInfo)->spells[0] = fields[52].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[1] = fields[53].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[2] = fields[54].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[3] = fields[55].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[4] = fields[56].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[5] = fields[57].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[6] = fields[58].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->spells[7] = fields[59].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->PetSpellDataId = fields[60].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->VehicleId = fields[61].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->mingold = fields[62].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->maxgold = fields[63].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->AIName = fields[64].GetString(); + const_cast<CreatureTemplate*>(cInfo)->MovementType = fields[65].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->InhabitType = fields[66].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->ModHealth = fields[67].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->ModMana = fields[68].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->ModArmor = fields[69].GetFloat(); + const_cast<CreatureTemplate*>(cInfo)->RacialLeader = fields[70].GetBool(); + const_cast<CreatureTemplate*>(cInfo)->questItems[0] = fields[71].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->questItems[1] = fields[72].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->questItems[2] = fields[73].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->questItems[3] = fields[74].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->questItems[4] = fields[75].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->questItems[5] = fields[76].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->movementId = fields[77].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->RegenHealth = fields[78].GetBool(); + const_cast<CreatureTemplate*>(cInfo)->equipmentId = fields[79].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->MechanicImmuneMask = fields[80].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->flags_extra = fields[81].GetUInt32(); + const_cast<CreatureTemplate*>(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString()); + + sObjectMgr->CheckCreatureTemplate(cInfo); } - const_cast<CreatureTemplate*>(cInfo)->spells[0] = fields[52].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[1] = fields[53].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[2] = fields[54].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[3] = fields[55].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[4] = fields[56].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[5] = fields[57].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[6] = fields[58].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->spells[7] = fields[59].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->PetSpellDataId = fields[60].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->VehicleId = fields[61].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->mingold = fields[62].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->maxgold = fields[63].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->AIName = fields[64].GetString(); - const_cast<CreatureTemplate*>(cInfo)->MovementType = fields[65].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->InhabitType = fields[66].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->ModHealth = fields[67].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->ModMana = fields[68].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->ModArmor = fields[69].GetFloat(); - const_cast<CreatureTemplate*>(cInfo)->RacialLeader = fields[70].GetBool(); - const_cast<CreatureTemplate*>(cInfo)->questItems[0] = fields[71].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->questItems[1] = fields[72].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->questItems[2] = fields[73].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->questItems[3] = fields[74].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->questItems[4] = fields[75].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->questItems[5] = fields[76].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->movementId = fields[77].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->RegenHealth = fields[78].GetBool(); - const_cast<CreatureTemplate*>(cInfo)->equipmentId = fields[79].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->MechanicImmuneMask = fields[80].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->flags_extra = fields[81].GetUInt32(); - const_cast<CreatureTemplate*>(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString()); - - sObjectMgr->CheckCreatureTemplate(cInfo); - handler->SendGlobalGMSysMessage("Creature template reloaded."); return true; } @@ -989,7 +992,7 @@ public: return true; } - static bool HandleReloadWpCommand(ChatHandler* handler, const char* args) + static bool HandleReloadWpCommand(ChatHandler* /*handler*/, const char* args) { if (*args != 'a') sLog->outString("Re-Loading Waypoints data from 'waypoints_data'"); diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp index a2e41f1af70..7a4ba5777d1 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -24,14 +24,19 @@ SDCategory: Blackwing Lair EndScriptData */ #include "ScriptPCH.h" +enum Say +{ + SAY_AGGRO = -1469000, + SAY_LEASH = -1469001 +}; -#define SAY_AGGRO -1469000 -#define SAY_LEASH -1469001 - -#define SPELL_CLEAVE 26350 -#define SPELL_BLASTWAVE 23331 -#define SPELL_MORTALSTRIKE 24573 -#define SPELL_KNOCKBACK 25778 +enum Spells +{ + SPELL_CLEAVE = 26350, + SPELL_BLASTWAVE = 23331, + SPELL_MORTALSTRIKE = 24573, + SPELL_KNOCKBACK = 25778 +}; class boss_broodlord : public CreatureScript { @@ -45,7 +50,7 @@ public: struct boss_broodlordAI : public ScriptedAI { - boss_broodlordAI(Creature* c) : ScriptedAI(c) {} + boss_broodlordAI(Creature* creature) : ScriptedAI(creature) {} uint32 Cleave_Timer; uint32 BlastWave_Timer; @@ -54,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*/) @@ -108,7 +113,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_broodlord() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp index 50bda73cfc6..818dcace078 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp @@ -71,7 +71,7 @@ public: struct boss_chromaggusAI : public ScriptedAI { - boss_chromaggusAI(Creature* c) : ScriptedAI(c) + boss_chromaggusAI(Creature* creature) : ScriptedAI(creature) { //Select the 2 breaths that we are going to use until despawned //5 possiblities for the first breath, 4 for the second, 20 total possiblites @@ -197,9 +197,7 @@ public: Enraged = false; } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) { @@ -297,7 +295,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_chromaggus() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp index 09dd0138db8..c91e0fb3303 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp @@ -42,7 +42,7 @@ public: struct boss_ebonrocAI : public ScriptedAI { - boss_ebonrocAI(Creature* c) : ScriptedAI(c) {} + boss_ebonrocAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowFlame_Timer; uint32 WingBuffet_Timer; @@ -100,7 +100,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_ebonroc() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp index 133d61422b2..c2a2350c0e8 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp @@ -41,7 +41,7 @@ public: struct boss_firemawAI : public ScriptedAI { - boss_firemawAI(Creature* c) : ScriptedAI(c) {} + boss_firemawAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowFlame_Timer; uint32 WingBuffet_Timer; @@ -91,7 +91,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_firemaw() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp index b71249dc3a3..41bcb6c5427 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp @@ -25,11 +25,17 @@ EndScriptData */ #include "ScriptPCH.h" -#define EMOTE_FRENZY -1469031 +enum Emotes +{ + EMOTE_FRENZY = -1469031 +}; -#define SPELL_SHADOWFLAME 22539 -#define SPELL_WINGBUFFET 23339 -#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova +enum Spells +{ + SPELL_SHADOWFLAME = 22539, + SPELL_WINGBUFFET = 23339, + SPELL_FRENZY = 23342 //This spell periodically triggers fire nova +}; class boss_flamegor : public CreatureScript { @@ -43,7 +49,7 @@ public: struct boss_flamegorAI : public ScriptedAI { - boss_flamegorAI(Creature* c) : ScriptedAI(c) {} + boss_flamegorAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowFlame_Timer; uint32 WingBuffet_Timer; @@ -94,7 +100,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_flamegor() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index 506189697fe..c4e0d6ea715 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp @@ -25,40 +25,46 @@ EndScriptData */ #include "ScriptPCH.h" -#define SAY_AGGRO -1469007 -#define SAY_XHEALTH -1469008 -#define SAY_SHADOWFLAME -1469009 -#define SAY_RAISE_SKELETONS -1469010 -#define SAY_SLAY -1469011 -#define SAY_DEATH -1469012 - -#define SAY_MAGE -1469013 -#define SAY_WARRIOR -1469014 -#define SAY_DRUID -1469015 -#define SAY_PRIEST -1469016 -#define SAY_PALADIN -1469017 -#define SAY_SHAMAN -1469018 -#define SAY_WARLOCK -1469019 -#define SAY_HUNTER -1469020 -#define SAY_ROGUE -1469021 - -#define SPELL_SHADOWFLAME_INITIAL 22972 -#define SPELL_SHADOWFLAME 22539 -#define SPELL_BELLOWINGROAR 22686 -#define SPELL_VEILOFSHADOW 7068 -#define SPELL_CLEAVE 20691 -#define SPELL_TAILLASH 23364 -#define SPELL_BONECONTRUST 23363 //23362, 23361 - -#define SPELL_MAGE 23410 //wild magic -#define SPELL_WARRIOR 23397 //beserk -#define SPELL_DRUID 23398 // cat form -#define SPELL_PRIEST 23401 // corrupted healing -#define SPELL_PALADIN 23418 //syphon blessing -#define SPELL_SHAMAN 23425 //totems -#define SPELL_WARLOCK 23427 //infernals -#define SPELL_HUNTER 23436 //bow broke -#define SPELL_ROGUE 23414 //Paralise +enum Say +{ + SAY_AGGRO = -1469007, + SAY_XHEALTH = -1469008, + SAY_SHADOWFLAME = -1469009, + SAY_RAISE_SKELETONS = -1469010, + SAY_SLAY = -1469011, + SAY_DEATH = -1469012, + + SAY_MAGE = -1469013, + SAY_WARRIOR = -1469014, + SAY_DRUID = -1469015, + SAY_PRIEST = -1469016, + SAY_PALADIN = -1469017, + SAY_SHAMAN = -1469018, + SAY_WARLOCK = -1469019, + SAY_HUNTER = -1469020, + SAY_ROGUE = -1469021 +}; + +enum Spells +{ + SPELL_SHADOWFLAME_INITIAL = 22972, + SPELL_SHADOWFLAME = 22539, + SPELL_BELLOWINGROAR = 22686, + SPELL_VEILOFSHADOW = 7068, + SPELL_CLEAVE = 20691, + SPELL_TAILLASH = 23364, + SPELL_BONECONTRUST = 23363, //23362, 23361 + + SPELL_MAGE = 23410, //wild magic + SPELL_WARRIOR = 23397, //beserk + SPELL_DRUID = 23398, // cat form + SPELL_PRIEST = 23401, // corrupted healing + SPELL_PALADIN = 23418, //syphon blessing + SPELL_SHAMAN = 23425, //totems + SPELL_WARLOCK = 23427, //infernals + SPELL_HUNTER = 23436, //bow broke + SPELL_ROGUE = 23414 //Paralise +}; class boss_nefarian : public CreatureScript { @@ -72,7 +78,7 @@ public: struct boss_nefarianAI : public ScriptedAI { - boss_nefarianAI(Creature* c) : ScriptedAI(c) {} + boss_nefarianAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowFlame_Timer; uint32 BellowingRoar_Timer; @@ -86,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) @@ -227,7 +233,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_nefarian() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp index b643139a71e..a4fb4ad22a3 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp @@ -27,15 +27,21 @@ EndScriptData */ //Razorgore Phase 2 Script -#define SAY_EGGS_BROKEN1 -1469022 -#define SAY_EGGS_BROKEN2 -1469023 -#define SAY_EGGS_BROKEN3 -1469024 -#define SAY_DEATH -1469025 +enum Say +{ + SAY_EGGS_BROKEN1 = -1469022, + SAY_EGGS_BROKEN2 = -1469023, + SAY_EGGS_BROKEN3 = -1469024, + SAY_DEATH = -1469025 +}; -#define SPELL_CLEAVE 22540 -#define SPELL_WARSTOMP 24375 -#define SPELL_FIREBALLVOLLEY 22425 -#define SPELL_CONFLAGRATION 23023 +enum Spells +{ + SPELL_CLEAVE = 22540, + SPELL_WARSTOMP = 24375, + SPELL_FIREBALLVOLLEY = 22425, + SPELL_CONFLAGRATION = 23023 +}; class boss_razorgore : public CreatureScript { @@ -49,7 +55,7 @@ public: struct boss_razorgoreAI : public ScriptedAI { - boss_razorgoreAI(Creature* c) : ScriptedAI(c) {} + boss_razorgoreAI(Creature* creature) : ScriptedAI(creature) {} uint32 Cleave_Timer; uint32 WarStomp_Timer; @@ -120,7 +126,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_razorgore() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp index 4961d253a26..4a72bd0ca38 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp @@ -25,40 +25,46 @@ EndScriptData */ #include "ScriptPCH.h" -#define SAY_LINE1 -1469026 -#define SAY_LINE2 -1469027 -#define SAY_LINE3 -1469028 -#define SAY_HALFLIFE -1469029 -#define SAY_KILLTARGET -1469030 +enum Says +{ + SAY_LINE1 = -1469026, + SAY_LINE2 = -1469027, + SAY_LINE3 = -1469028, + SAY_HALFLIFE = -1469029, + SAY_KILLTARGET = -1469030 +}; #define GOSSIP_ITEM "Start Event <Needs Gossip Text>" -#define SPELL_ESSENCEOFTHERED 23513 -#define SPELL_FLAMEBREATH 23461 -#define SPELL_FIRENOVA 23462 -#define SPELL_TAILSWIPE 15847 -#define SPELL_BURNINGADRENALINE 23620 -#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect +enum Spells +{ + SPELL_ESSENCEOFTHERED = 23513, + SPELL_FLAMEBREATH = 23461, + SPELL_FIRENOVA = 23462, + SPELL_TAILSWIPE = 15847, + SPELL_BURNINGADRENALINE = 23620, + SPELL_CLEAVE = 20684 //Chain cleave is most likely named something different and contains a dummy effect +}; class boss_vaelastrasz : public CreatureScript { public: boss_vaelastrasz() : CreatureScript("boss_vaelastrasz") { } - void SendDefaultMenu(Player* player, Creature* creature, uint32 uiAction) + void SendDefaultMenu(Player* player, Creature* creature, uint32 Action) { - if (uiAction == 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 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 Action) { player->PlayerTalkClass->ClearMenus(); - if (uiSender == GOSSIP_SENDER_MAIN) - SendDefaultMenu(player, creature, uiAction); + if (Sender == GOSSIP_SENDER_MAIN) + SendDefaultMenu(player, creature, Action); return true; } @@ -81,11 +87,11 @@ public: struct boss_vaelAI : public ScriptedAI { - boss_vaelAI(Creature* c) : ScriptedAI(c) + boss_vaelAI(Creature* creature) : ScriptedAI(creature) { - c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - c->setFaction(35); - c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + creature->setFaction(35); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } uint64 PlayerGUID; @@ -102,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) @@ -213,7 +219,7 @@ public: Unit* target = NULL; uint8 i = 0; - while (i < 3) // max 3 tries to get a random target with power_mana + while (i < 3) // max 3 tries to get a random target with power_mana { ++i; target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader @@ -258,7 +264,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_vael() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp index 89b34aada66..5222270df1a 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -25,40 +25,49 @@ EndScriptData */ #include "ScriptPCH.h" -#define SAY_GAMESBEGIN_1 -1469004 -#define SAY_GAMESBEGIN_2 -1469005 -#define SAY_VAEL_INTRO -1469006 //when he corrupts Vaelastrasz +enum Says +{ + SAY_GAMESBEGIN_1 = -1469004, + SAY_GAMESBEGIN_2 = -1469005, + SAY_VAEL_INTRO = -1469006 //when he corrupts Vaelastrasz +}; #define GOSSIP_ITEM_1 "I've made no mistakes." #define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles." #define GOSSIP_ITEM_3 "Please do." -#define CREATURE_BRONZE_DRAKANOID 14263 -#define CREATURE_BLUE_DRAKANOID 14261 -#define CREATURE_RED_DRAKANOID 14264 -#define CREATURE_GREEN_DRAKANOID 14262 -#define CREATURE_BLACK_DRAKANOID 14265 - -#define CREATURE_CHROMATIC_DRAKANOID 14302 -#define CREATURE_NEFARIAN 11583 +enum Creatures +{ + CREATURE_BRONZE_DRAKANOID = 14263, + CREATURE_BLUE_DRAKANOID = 14261, + CREATURE_RED_DRAKANOID = 14264, + CREATURE_GREEN_DRAKANOID = 14262, + CREATURE_BLACK_DRAKANOID = 14265, + + CREATURE_CHROMATIC_DRAKANOID = 14302, + CREATURE_NEFARIAN = 11583 +}; -#define ADD_X1 -7591.151855f -#define ADD_X2 -7514.598633f -#define ADD_Y1 -1204.051880f -#define ADD_Y2 -1150.448853f -#define ADD_Z1 476.800476f -#define ADD_Z2 476.796570f +#define ADD_X1 -7591.151855f +#define ADD_X2 -7514.598633f +#define ADD_Y1 -1204.051880f +#define ADD_Y2 -1150.448853f +#define ADD_Z1 476.800476f +#define ADD_Z2 476.796570f -#define NEF_X -7445 -#define NEF_Y -1332 -#define NEF_Z 536 +#define NEF_X -7445 +#define NEF_Y -1332 +#define NEF_Z 536 -#define HIDE_X -7592 -#define HIDE_Y -1264 -#define HIDE_Z 481 +#define HIDE_X -7592 +#define HIDE_Y -1264 +#define HIDE_Z 481 -#define SPELL_SHADOWBOLT 21077 -#define SPELL_FEAR 26070 +enum Spells +{ + SPELL_SHADOWBOLT = 21077, + SPELL_FEAR = 26070 +}; //This script is complicated //Instead of morphing Victor Nefarius we will have him control phase 1 @@ -74,10 +83,10 @@ class boss_victor_nefarius : public CreatureScript public: boss_victor_nefarius() : CreatureScript("boss_victor_nefarius") { } - 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_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -110,7 +119,7 @@ public: struct boss_victor_nefariusAI : public ScriptedAI { - boss_victor_nefariusAI(Creature* c) : ScriptedAI(c) + boss_victor_nefariusAI(Creature* creature) : ScriptedAI(creature) { NefarianGUID = 0; switch (urand(0, 19)) @@ -211,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); @@ -378,7 +387,6 @@ public: } } }; - }; void AddSC_boss_victor_nefarius() diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp index 54c0855512f..8a9b930aa09 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp @@ -24,4 +24,3 @@ SDCategory: Blackwing Lair EndScriptData */ #include "ScriptPCH.h" - diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index ecb909480c5..728446aa833 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -186,7 +186,7 @@ public: void MovementInform(uint32 type, uint32 id) { if (type != POINT_MOTION_TYPE) - return; + return; if (Intro) { diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp index eafe55d3821..801a11fbfc8 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp @@ -30,16 +30,19 @@ EndContentData */ #include "ScriptPCH.h" #include "ScriptedSimpleAI.h" -#define SPELL_CONE_OF_FIRE 19630 -#define SPELL_BITE 19771 +enum Spells +{ + SPELL_CONE_OF_FIRE = 19630, + SPELL_BITE = 19771, -//Random Debuff (each hound has only one of these) -#define SPELL_GROUND_STOMP 19364 -#define SPELL_ANCIENT_DREAD 19365 -#define SPELL_CAUTERIZING_FLAMES 19366 -#define SPELL_WITHERING_HEAT 19367 -#define SPELL_ANCIENT_DESPAIR 19369 -#define SPELL_ANCIENT_HYSTERIA 19372 + //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 { @@ -75,7 +78,6 @@ public: return ai; } - }; void AddSC_molten_core() diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 999f3fda2e4..a7d1c3ad8ba 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -1009,7 +1009,7 @@ public: me->SetInFront(car); me->SendMovementFlagUpdate(); car->Relocate(car->GetPositionX(), car->GetPositionY(), me->GetPositionZ() + 1); - car->SendMonsterStop(); + car->StopMoving(); car->RemoveAura(SPELL_CART_DRAG); } me->MonsterSay(SAY_SCARLET_MINER2, LANG_UNIVERSAL, 0); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp index b3102f2dde7..e5886cc39d4 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp @@ -49,7 +49,7 @@ public: struct boss_arcanist_doanAI : public ScriptedAI { - boss_arcanist_doanAI(Creature* c) : ScriptedAI(c) {} + boss_arcanist_doanAI(Creature* creature) : ScriptedAI(creature) {} uint32 Polymorph_Timer; uint32 AoESilence_Timer; @@ -105,26 +105,28 @@ public: DoCast(target, SPELL_POLYMORPH); Polymorph_Timer = 20000; - } else Polymorph_Timer -= diff; + } + else Polymorph_Timer -= diff; //AoESilence_Timer if (AoESilence_Timer <= diff) { DoCast(me->getVictim(), SPELL_AOESILENCE); AoESilence_Timer = urand(15000, 20000); - } else AoESilence_Timer -= diff; + } + else AoESilence_Timer -= diff; //ArcaneExplosion_Timer if (ArcaneExplosion_Timer <= diff) { DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION); ArcaneExplosion_Timer = 8000; - } else ArcaneExplosion_Timer -= diff; + } + else ArcaneExplosion_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_arcanist_doan() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp index 36beecb2029..30105cc7315 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp @@ -25,9 +25,12 @@ EndScriptData */ #include "ScriptPCH.h" -#define SPELL_CALLOFTHEGRAVE 17831 -#define SPELL_TERRIFY 7399 -#define SPELL_SOULSIPHON 7290 +enum Spells +{ + SPELL_CALLOFTHEGRAVE = 17831, + SPELL_TERRIFY = 7399, + SPELL_SOULSIPHON = 7290 +}; class boss_azshir_the_sleepless : public CreatureScript { @@ -41,7 +44,7 @@ public: struct boss_azshir_the_sleeplessAI : public ScriptedAI { - boss_azshir_the_sleeplessAI(Creature* c) : ScriptedAI(c) {} + boss_azshir_the_sleeplessAI(Creature* creature) : ScriptedAI(creature) {} uint32 SoulSiphon_Timer; uint32 CallOftheGrave_Timer; @@ -54,9 +57,7 @@ public: Terrify_Timer = 20000; } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) { @@ -73,7 +74,8 @@ public: return; //SoulSiphon_Timer = 20000; - } else SoulSiphon_Timer -= diff; + } + else SoulSiphon_Timer -= diff; } //CallOfTheGrave_Timer @@ -81,19 +83,20 @@ public: { DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE); CallOftheGrave_Timer = 30000; - } else CallOftheGrave_Timer -= diff; + } + else CallOftheGrave_Timer -= diff; //Terrify_Timer if (Terrify_Timer <= diff) { DoCast(me->getVictim(), SPELL_TERRIFY); Terrify_Timer = 20000; - } else Terrify_Timer -= diff; + } + else Terrify_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_azshir_the_sleepless() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp index 794a686a550..466f940621d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp @@ -49,7 +49,7 @@ public: struct boss_bloodmage_thalnosAI : public ScriptedAI { - boss_bloodmage_thalnosAI(Creature* c) : ScriptedAI(c) {} + boss_bloodmage_thalnosAI(Creature* creature) : ScriptedAI(creature) {} bool HpYell; uint32 FlameShock_Timer; @@ -93,33 +93,36 @@ public: { DoCast(me->getVictim(), SPELL_FLAMESHOCK); FlameShock_Timer = urand(10000, 15000); - } else FlameShock_Timer -= diff; + } + else FlameShock_Timer -= diff; //FlameSpike_Timer if (FlameSpike_Timer <= diff) { DoCast(me->getVictim(), SPELL_FLAMESPIKE); FlameSpike_Timer = 30000; - } else FlameSpike_Timer -= diff; + } + else FlameSpike_Timer -= diff; //FireNova_Timer if (FireNova_Timer <= diff) { DoCast(me->getVictim(), SPELL_FIRENOVA); FireNova_Timer = 40000; - } else FireNova_Timer -= diff; + } + else FireNova_Timer -= diff; //ShadowBolt_Timer if (ShadowBolt_Timer <= diff) { DoCast(me->getVictim(), SPELL_SHADOWBOLT); ShadowBolt_Timer = 2000; - } else ShadowBolt_Timer -= diff; + } + else ShadowBolt_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_bloodmage_thalnos() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 14b21504be5..77099f2e2d7 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -28,59 +28,66 @@ EndScriptData */ #include "scarlet_monastery.h" //this texts are already used by 3975 and 3976 -#define SAY_ENTRANCE -1189001 -#define SAY_REJOINED -1189002 -#define SAY_LOST_HEAD -1189003 -#define SAY_CONFLAGRATION -1189004 -#define SAY_SPROUTING_PUMPKINS -1189005 -#define SAY_PLAYER_DEATH -1189006 -#define SAY_DEATH -1189007 +enum Says +{ + SAY_ENTRANCE = -1189001, + SAY_REJOINED = -1189002, + SAY_LOST_HEAD = -1189003, + SAY_CONFLAGRATION = -1189004, + SAY_SPROUTING_PUMPKINS = -1189005, + SAY_PLAYER_DEATH = -1189006, + SAY_DEATH = -1189007 +}; uint32 RandomLaugh[] = {11965, 11975, 11976}; - // Entryes -#define HH_MOUNTED 23682 -#define HH_UNHORSED 23800 -#define HEAD 23775 -#define PULSING_PUMPKIN 23694 -#define PUMPKIN_FIEND 23545 -#define HELPER 23686 -#define WISP_INVIS 24034 - - //Spells -#define SPELL_CLEAVE 42587 -#define SPELL_CONFLAGRATION 42380 //Phase 2, can't find real spell(Dim Fire?) -//#define SPELL_CONFL_SPEED 22587 //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell? -#define SPELL_SUMMON_PUMPKIN 42394 - -#define SPELL_WHIRLWIND 43116 -#define SPELL_IMMUNE 42556 -#define SPELL_BODY_REGEN 42403 -#define SPELL_CONFUSE 43105 - -#define SPELL_FLYING_HEAD 42399 //visual flying head -#define SPELL_HEAD 42413 //visual buff, "head" -#define SPELL_HEAD_IS_DEAD 42428 //at killing head, Phase 3 - -#define SPELL_PUMPKIN_AURA 42280 -#define SPELL_PUMPKIN_AURA_GREEN 42294 -#define SPELL_SQUASH_SOUL 42514 -#define SPELL_SPROUTING 42281 -#define SPELL_SPROUT_BODY 42285 +enum Entry +{ + HH_MOUNTED = 23682, + HH_DISMOUNTED = 23800, // unhorsed?? wtf type of engrish was that? + HEAD = 23775, + PULSING_PUMPKIN = 23694, + PUMPKIN_FIEND = 23545, + HELPER = 23686, + WISP_INVIS = 24034 +}; + +enum Spells +{ + SPELL_CLEAVE = 42587, + SPELL_CONFLAGRATION = 42380, //Phase 2, can't find real spell(Dim Fire?) + // SPELL_CONFL_SPEED = 22587, //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell? + SPELL_SUMMON_PUMPKIN = 42394, + + SPELL_WHIRLWIND = 43116, + SPELL_IMMUNE = 42556, + SPELL_BODY_REGEN = 42403, + SPELL_CONFUSE = 43105, + + SPELL_FLYING_HEAD = 42399, //visual flying head + SPELL_HEAD = 42413, //visual buff, "head" + SPELL_HEAD_IS_DEAD = 42428, //at killing head, Phase 3 + + SPELL_PUMPKIN_AURA = 42280, + SPELL_PUMPKIN_AURA_GREEN = 42294, + SPELL_SQUASH_SOUL = 42514, + SPELL_SPROUTING = 42281, + SPELL_SPROUT_BODY = 42285, //Effects -#define SPELL_RHYME_BIG 42909 -//#define SPELL_RHYME_SMALL 42910 -#define SPELL_HEAD_SPEAKS 43129 -#define SPELL_HEAD_LANDS 42400 -#define SPELL_BODY_FLAME 42074 -#define SPELL_HEAD_FLAME 42971 -//#define SPELL_ENRAGE_VISUAL 42438 // he uses this spell? -#define SPELL_WISP_BLUE 42821 -#define SPELL_WISP_FLIGHT_PORT 42818 -//#define SPELL_WISP_INVIS 42823 -#define SPELL_SMOKE 42355 -#define SPELL_DEATH 42566 //not correct spell + SPELL_RHYME_BIG = 42909, + // SPELL_RHYME_SMALL = 42910, + SPELL_HEAD_SPEAKS = 43129, + SPELL_HEAD_LANDS = 42400, + SPELL_BODY_FLAME = 42074, + SPELL_HEAD_FLAME = 42971, + // SPELL_ENRAGE_VISUAL = 42438, // he uses this spell? + SPELL_WISP_BLUE = 42821, + SPELL_WISP_FLIGHT_PORT = 42818, + // SPELL_WISP_INVIS = 42823, + SPELL_SMOKE = 42355, + SPELL_DEATH = 42566 //not correct spell +}; struct Locations { @@ -114,7 +121,7 @@ static Locations FlightPoint[]= static Locations Spawn[]= { - {1776.27f, 1348.74f, 19.20f}, //spawn point for pumpkin shrine mob + {1776.27f, 1348.74f, 19.20f}, //spawn point for pumpkin shrine mob {1765.28f, 1347.46f, 17.55f} //spawn point for smoke }; @@ -126,7 +133,7 @@ static const char* Text[]= "Now, know demise!" }; -#define EMOTE_LAUGHS "Headless Horseman laughs" +#define EMOTE_LAUGHS "Headless Horseman laughs" // needs assigned to db. class mob_wisp_invis : public CreatureScript { @@ -140,7 +147,7 @@ public: struct mob_wisp_invisAI : public ScriptedAI { - mob_wisp_invisAI(Creature* c) : ScriptedAI(c) + mob_wisp_invisAI(Creature* creature) : ScriptedAI(creature) { Creaturetype = delay = spell = spell2 = 0; } @@ -149,8 +156,8 @@ public: uint32 delay; uint32 spell; uint32 spell2; - void Reset(){} - void EnterCombat(Unit* /*who*/){} + void Reset() {} + void EnterCombat(Unit* /*who*/) {} void SetType(uint32 _type) { switch (Creaturetype = _type) @@ -205,7 +212,6 @@ public: } } }; - }; class mob_head : public CreatureScript @@ -220,7 +226,7 @@ public: struct mob_headAI : public ScriptedAI { - mob_headAI(Creature* c) : ScriptedAI(c) {} + mob_headAI(Creature* creature) : ScriptedAI(creature) {} uint64 bodyGUID; @@ -316,7 +322,8 @@ public: if (!me->getVictim()) return; me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveFleeing(me->getVictim()); - } else wait -= diff; + } + else wait -= diff; if (laugh <= diff) { @@ -327,7 +334,8 @@ public: if (speaker) speaker->CastSpell(speaker, SPELL_HEAD_SPEAKS, false); me->MonsterTextEmote(EMOTE_LAUGHS, 0); - } else laugh -= diff; + } + else laugh -= diff; } else { @@ -339,12 +347,12 @@ public: if (Unit* body = Unit::GetUnit((*me), bodyGUID)) body->Kill(body); me->Kill(me); - } else wait -= diff; + } + else wait -= diff; } } } }; - }; class boss_headless_horseman : public CreatureScript @@ -359,9 +367,9 @@ public: struct boss_headless_horsemanAI : public ScriptedAI { - boss_headless_horsemanAI(Creature* c) : ScriptedAI(c) + boss_headless_horsemanAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -636,7 +644,8 @@ public: break; } ++count; - } else say_timer -= diff; + } + else say_timer -= diff; } else { @@ -657,7 +666,8 @@ public: if (Creature* flame = me->SummonCreature(HELPER, Spawn[0].x, Spawn[0].y, Spawn[0].z, 0, TEMPSUMMON_TIMED_DESPAWN, 17000)) CAST_AI(mob_wisp_invis::mob_wisp_invisAI, flame->AI())->SetType(2); burned = true; - } else burn -= diff; + } + else burn -= diff; break; case 2: if (conflagrate <= diff) @@ -665,7 +675,8 @@ public: if (Unit* player = SelectRandomPlayer(30.0f)) DoCast(player, SPELL_CONFLAGRATION, false); conflagrate = urand(10000, 16000); - } else conflagrate -= diff; + } + else conflagrate -= diff; break; case 3: if (summonadds <= diff) @@ -674,7 +685,8 @@ public: DoCast(me, SPELL_SUMMON_PUMPKIN); SaySound(SAY_SPROUTING_PUMPKINS); summonadds = urand(25000, 35000); - } else summonadds -= diff; + } + else summonadds -= diff; break; } @@ -683,7 +695,8 @@ public: laugh = urand(11000, 22000); me->MonsterTextEmote(EMOTE_LAUGHS, 0); DoPlaySoundToSet(me, RandomLaugh[rand()%3]); - } else laugh -= diff; + } + else laugh -= diff; if (UpdateVictim()) { @@ -692,7 +705,8 @@ public: { DoCast(me->getVictim(), SPELL_CLEAVE); cleave = urand(2000, 6000); //1 cleave per 2.0f-6.0fsec - } else cleave -= diff; + } + else cleave -= diff; } } else @@ -725,13 +739,14 @@ public: me->RemoveAurasDueToSpell(SPELL_CONFUSE); DoCast(me, SPELL_WHIRLWIND, true); DoCast(me, SPELL_CONFUSE); - } else + } + else me->RemoveAurasDueToSpell(SPELL_WHIRLWIND); - } else whirlwind -= diff; + } + else whirlwind -= diff; } } }; - }; class mob_pulsing_pumpkin : public CreatureScript @@ -746,7 +761,7 @@ public: struct mob_pulsing_pumpkinAI : public ScriptedAI { - mob_pulsing_pumpkinAI(Creature* c) : ScriptedAI(c) {} + mob_pulsing_pumpkinAI(Creature* creature) : ScriptedAI(creature) {} bool sprouted; uint64 debuffGUID; @@ -771,7 +786,7 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); } - void EnterCombat(Unit* /*who*/){} + void EnterCombat(Unit* /*who*/) {} void SpellHit(Unit* /*caster*/, const SpellInfo* spell) { @@ -813,7 +828,6 @@ public: DoMeleeAttackIfReady(); } }; - }; class go_loosely_turned_soil : public GameObjectScript @@ -846,13 +860,13 @@ public: //} return true; } - }; void mob_head::mob_headAI::Disappear() { if (withbody) return; + if (bodyGUID) { Creature* body = Unit::GetCreature((*me), bodyGUID); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp index d99aabd60e8..16b90f89bb5 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -26,19 +26,32 @@ EndScriptData */ #include "ScriptPCH.h" #include "ScriptedEscortAI.h" -#define SAY_AGGRO -1189000 -#define SAY_WHIRLWIND -1189001 -#define SAY_ENRAGE -1189002 -#define SAY_KILL -1189003 -#define EMOTE_ENRAGE -1189004 +enum Says +{ + SAY_AGGRO = -1189000, + SAY_WHIRLWIND = -1189001, + SAY_ENRAGE = -1189002, + SAY_KILL = -1189003 +}; -#define SPELL_RUSHINGCHARGE 8260 -#define SPELL_CLEAVE 15496 -#define SPELL_WHIRLWIND 8989 -#define SPELL_FRENZY 8269 +enum Emotes +{ + EMOTE_ENRAGE = -1189004 +}; -#define ENTRY_SCARLET_TRAINEE 6575 -#define ENTRY_SCARLET_MYRMIDON 4295 +enum Spells +{ + SPELL_RUSHINGCHARGE = 8260, + SPELL_CLEAVE = 15496, + SPELL_WHIRLWIND = 8989, + SPELL_FRENZY = 8269 +}; + +enum Entry +{ + ENTRY_SCARLET_TRAINEE = 6575, + ENTRY_SCARLET_MYRMIDON = 4295 +}; class boss_herod : public CreatureScript { @@ -52,7 +65,7 @@ public: struct boss_herodAI : public ScriptedAI { - boss_herodAI(Creature* c) : ScriptedAI(c) {} + boss_herodAI(Creature* creature) : ScriptedAI(creature) {} bool Enrage; @@ -102,7 +115,8 @@ public: { DoCast(me->getVictim(), SPELL_CLEAVE); Cleave_Timer = 12000; - } else Cleave_Timer -= diff; + } + else Cleave_Timer -= diff; // Whirlwind_Timer if (Whirlwind_Timer <= diff) @@ -110,12 +124,12 @@ public: DoScriptText(SAY_WHIRLWIND, me); DoCast(me->getVictim(), SPELL_WHIRLWIND); Whirlwind_Timer = 30000; - } else Whirlwind_Timer -= diff; + } + else Whirlwind_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; class mob_scarlet_trainee : public CreatureScript @@ -130,7 +144,7 @@ public: struct mob_scarlet_traineeAI : public npc_escortAI { - mob_scarlet_traineeAI(Creature* c) : npc_escortAI(c) + mob_scarlet_traineeAI(Creature* creature) : npc_escortAI(creature) { Start_Timer = urand(1000, 6000); } @@ -138,7 +152,7 @@ public: uint32 Start_Timer; void Reset() {} - void WaypointReached(uint32 /*uiPoint*/) {} + void WaypointReached(uint32 /*point*/) {} void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) @@ -155,7 +169,6 @@ public: npc_escortAI::UpdateAI(diff); } }; - }; void AddSC_boss_herod() 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 327c84327c5..a64636a4223 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -47,7 +47,7 @@ public: struct boss_high_inquisitor_fairbanksAI : public ScriptedAI { - boss_high_inquisitor_fairbanksAI(Creature* c) : ScriptedAI(c) {} + boss_high_inquisitor_fairbanksAI(Creature* creature) : ScriptedAI(creature) {} uint32 CurseOfBlood_Timer; uint32 DispelMagic_Timer; @@ -68,9 +68,7 @@ public: PowerWordShield = false; } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) { @@ -82,7 +80,8 @@ public: { DoCast(me, SPELL_HEAL); Heal_Timer = 30000; - } else Heal_Timer -= diff; + } + else Heal_Timer -= diff; //Fear_Timer if (Fear_Timer <= diff) @@ -91,7 +90,8 @@ public: DoCast(target, SPELL_FEAR); Fear_Timer = 40000; - } else Fear_Timer -= diff; + } + else Fear_Timer -= diff; //Sleep_Timer if (Sleep_Timer <= diff) @@ -100,7 +100,8 @@ public: DoCast(target, SPELL_SLEEP); Sleep_Timer = 30000; - } else Sleep_Timer -= diff; + } + else Sleep_Timer -= diff; //PowerWordShield_Timer if (!PowerWordShield && !HealthAbovePct(25)) @@ -116,19 +117,20 @@ public: DoCast(target, SPELL_DISPELMAGIC); DispelMagic_Timer = 30000; - } else DispelMagic_Timer -= diff; + } + else DispelMagic_Timer -= diff; //CurseOfBlood_Timer if (CurseOfBlood_Timer <= diff) { DoCast(me->getVictim(), SPELL_CURSEOFBLOOD); CurseOfBlood_Timer = 25000; - } else CurseOfBlood_Timer -= diff; + } + else CurseOfBlood_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_high_inquisitor_fairbanks() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp index b070a31d6ee..f311da401d4 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp @@ -44,7 +44,7 @@ public: struct boss_houndmaster_lokseyAI : public ScriptedAI { - boss_houndmaster_lokseyAI(Creature* c) : ScriptedAI(c) {} + boss_houndmaster_lokseyAI(Creature* creature) : ScriptedAI(creature) {} uint32 BloodLust_Timer; @@ -67,12 +67,12 @@ public: { DoCast(me, SPELL_BLOODLUST); BloodLust_Timer = 20000; - } else BloodLust_Timer -= diff; + } + else BloodLust_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_houndmaster_loksey() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index 28c9b7ea434..058c688641f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -26,15 +26,18 @@ EndScriptData */ #include "ScriptPCH.h" #include "scarlet_monastery.h" -enum eEnums +enum Says { SAY_AGGRO = -1189011, SAY_HEALTH1 = -1189012, SAY_HEALTH2 = -1189013, SAY_KILL = -1189014, - SAY_TRIGGER_VORREL = -1189015, + SAY_TRIGGER_VORREL = -1189015 +}; - SPELL_SHADOWWORDPAIN = 2767, +enum Spells +{ + SPELL_SHADOWWORDPAIN = 2767 }; class boss_interrogator_vishas : public CreatureScript @@ -49,7 +52,7 @@ public: struct boss_interrogator_vishasAI : public ScriptedAI { - boss_interrogator_vishasAI(Creature* c) : ScriptedAI(c) + boss_interrogator_vishasAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -108,12 +111,12 @@ public: { DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); ShadowWordPain_Timer = urand(5000, 15000); - } else ShadowWordPain_Timer -= diff; + } + else ShadowWordPain_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_interrogator_vishas() 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 7e2d3cb6788..ec6ac34b0bb 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -26,7 +26,7 @@ EndScriptData */ #include "ScriptPCH.h" #include "scarlet_monastery.h" -enum eEnums +enum Says { //Mograine says SAY_MO_AGGRO = -1189005, @@ -37,7 +37,10 @@ enum eEnums SAY_WH_INTRO = -1189008, SAY_WH_KILL = -1189009, SAY_WH_RESSURECT = -1189010, +}; +enum Spells +{ //Mograine Spells SPELL_CRUSADERSTRIKE = 14518, SPELL_HAMMEROFJUSTICE = 5589, @@ -67,43 +70,43 @@ public: { boss_scarlet_commander_mograineAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; - uint32 m_uiCrusaderStrike_Timer; - uint32 m_uiHammerOfJustice_Timer; + uint32 CrusaderStrike_Timer; + uint32 HammerOfJustice_Timer; - bool m_bHasDied; - bool m_bHeal; - bool m_bFakeDeath; + bool _bHasDied; + bool _bHeal; + bool _bFakeDeath; void Reset() { - m_uiCrusaderStrike_Timer = 10000; - m_uiHammerOfJustice_Timer = 10000; + CrusaderStrike_Timer = 10000; + HammerOfJustice_Timer = 10000; //Incase wipe during phase that mograine fake death me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_STAND); - if (m_instance) + if (instance) if (me->isAlive()) - m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); - m_bHasDied = false; - m_bHeal = false; - m_bFakeDeath = false; + _bHasDied = false; + _bHeal = false; + _bFakeDeath = false; } void JustReachedHome() { - if (m_instance) + if (instance) { - if (m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED) - m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); + if (instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED) + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); } } @@ -120,18 +123,18 @@ public: DoScriptText(SAY_MO_KILL, me); } - void DamageTaken(Unit* /*pDoneBy*/, uint32 &uiDamage) + void DamageTaken(Unit* /*doneBy*/, uint32 &damage) { - if (uiDamage < me->GetHealth() || m_bHasDied || m_bFakeDeath) + if (damage < me->GetHealth() || _bHasDied || _bFakeDeath) return; - if (!m_instance) + if (!instance) return; //On first death, fake death and open door, as well as initiate whitemane if exist - if (Unit* Whitemane = Unit::GetUnit((*me), m_instance->GetData64(DATA_WHITEMANE))) + if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE))) { - m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f); @@ -150,72 +153,73 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_DEAD); - m_bHasDied = true; - m_bFakeDeath = true; + _bHasDied = true; + _bFakeDeath = true; - uiDamage = 0; + damage = 0; } } - void SpellHit(Unit* /*who*/, const SpellInfo* pSpell) + void SpellHit(Unit* /*who*/, const SpellInfo* spell) { //When hit with ressurection say text - if (pSpell->Id == SPELL_SCARLETRESURRECTION) + if (spell->Id == SPELL_SCARLETRESURRECTION) { DoScriptText(SAY_MO_RESSURECTED, me); - m_bFakeDeath = false; + _bFakeDeath = false; - if (m_instance) - m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); + if (instance) + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); } } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; - if (m_bHasDied && !m_bHeal && m_instance && m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) + 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), m_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); DoCast(Whitemane, SPELL_LAYONHANDS); - m_uiCrusaderStrike_Timer = 10000; - m_uiHammerOfJustice_Timer = 10000; + CrusaderStrike_Timer = 10000; + HammerOfJustice_Timer = 10000; if (me->getVictim()) me->GetMotionMaster()->MoveChase(me->getVictim()); - m_bHeal = true; + _bHeal = true; } } //This if-check to make sure mograine does not attack while fake death - if (m_bFakeDeath) + if (_bFakeDeath) return; - //m_uiCrusaderStrike_Timer - if (m_uiCrusaderStrike_Timer <= uiDiff) + //CrusaderStrike_Timer + if (CrusaderStrike_Timer <= diff) { DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE); - m_uiCrusaderStrike_Timer = 10000; - } else m_uiCrusaderStrike_Timer -= uiDiff; + CrusaderStrike_Timer = 10000; + } + else CrusaderStrike_Timer -= diff; - //m_uiHammerOfJustice_Timer - if (m_uiHammerOfJustice_Timer <= uiDiff) + //HammerOfJustice_Timer + if (HammerOfJustice_Timer <= diff) { DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE); - m_uiHammerOfJustice_Timer = 60000; - } else m_uiHammerOfJustice_Timer -= uiDiff; + HammerOfJustice_Timer = 60000; + } + else HammerOfJustice_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; class boss_high_inquisitor_whitemane : public CreatureScript @@ -232,37 +236,37 @@ public: { boss_high_inquisitor_whitemaneAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; - uint32 m_uiHeal_Timer; - uint32 m_uiPowerWordShield_Timer; - uint32 m_uiHolySmite_Timer; - uint32 m_uiWait_Timer; + uint32 Heal_Timer; + uint32 PowerWordShield_Timer; + uint32 HolySmite_Timer; + uint32 Wait_Timer; - bool m_bCanResurrectCheck; - bool m_bCanResurrect; + bool _bCanResurrectCheck; + bool _bCanResurrect; void Reset() { - m_uiWait_Timer = 7000; - m_uiHeal_Timer = 10000; - m_uiPowerWordShield_Timer = 15000; - m_uiHolySmite_Timer = 6000; + Wait_Timer = 7000; + Heal_Timer = 10000; + PowerWordShield_Timer = 15000; + HolySmite_Timer = 6000; - m_bCanResurrectCheck = false; - m_bCanResurrect = false; + _bCanResurrectCheck = false; + _bCanResurrect = false; - if (m_instance) + if (instance) if (me->isAlive()) - m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); } void AttackStart(Unit* who) { - if (m_instance && m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) + if (instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) return; ScriptedAI::AttackStart(who); @@ -278,84 +282,86 @@ public: DoScriptText(SAY_WH_KILL, me); } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; - if (m_bCanResurrect) + if (_bCanResurrect) { //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out - if (m_instance && m_uiWait_Timer <= uiDiff) + if (instance && Wait_Timer <= diff) { - if (Unit* Mograine = Unit::GetUnit((*me), m_instance->GetData64(DATA_MOGRAINE))) + if (Unit* Mograine = Unit::GetUnit((*me), instance->GetData64(DATA_MOGRAINE))) { DoCast(Mograine, SPELL_SCARLETRESURRECTION); DoScriptText(SAY_WH_RESSURECT, me); - m_bCanResurrect = false; + _bCanResurrect = false; } } - else m_uiWait_Timer -= uiDiff; + else Wait_Timer -= diff; } //Cast Deep sleep when health is less than 50% - if (!m_bCanResurrectCheck && !HealthAbovePct(50)) + if (!_bCanResurrectCheck && !HealthAbovePct(50)) { if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); DoCast(me->getVictim(), SPELL_DEEPSLEEP); - m_bCanResurrectCheck = true; - m_bCanResurrect = true; + _bCanResurrectCheck = true; + _bCanResurrect = true; return; } //while in "resurrect-mode", don't do anything - if (m_bCanResurrect) + if (_bCanResurrect) return; //If we are <75% hp cast healing spells at self or Mograine - if (m_uiHeal_Timer <= uiDiff) + if (Heal_Timer <= diff) { Creature* target = NULL; if (!HealthAbovePct(75)) target = me; - if (m_instance) + if (instance) { - if (Creature* pMograine = Unit::GetCreature((*me), m_instance->GetData64(DATA_MOGRAINE))) + if (Creature* mograine = Unit::GetCreature((*me), instance->GetData64(DATA_MOGRAINE))) { - // checking m_bCanResurrectCheck prevents her healing Mograine while he is "faking death" - if (m_bCanResurrectCheck && pMograine->isAlive() && !pMograine->HealthAbovePct(75)) - target = pMograine; + // checking _bCanResurrectCheck prevents her healing Mograine while he is "faking death" + if (_bCanResurrectCheck && mograine->isAlive() && !mograine->HealthAbovePct(75)) + target = mograine; } } if (target) DoCast(target, SPELL_HEAL); - m_uiHeal_Timer = 13000; - } else m_uiHeal_Timer -= uiDiff; + Heal_Timer = 13000; + } + else Heal_Timer -= diff; - //m_uiPowerWordShield_Timer - if (m_uiPowerWordShield_Timer <= uiDiff) + //PowerWordShield_Timer + if (PowerWordShield_Timer <= diff) { DoCast(me, SPELL_POWERWORDSHIELD); - m_uiPowerWordShield_Timer = 15000; - } else m_uiPowerWordShield_Timer -= uiDiff; + PowerWordShield_Timer = 15000; + } + else PowerWordShield_Timer -= diff; - //m_uiHolySmite_Timer - if (m_uiHolySmite_Timer <= uiDiff) + //HolySmite_Timer + if (HolySmite_Timer <= diff) { DoCast(me->getVictim(), SPELL_HOLYSMITE); - m_uiHolySmite_Timer = 6000; - } else m_uiHolySmite_Timer -= uiDiff; + HolySmite_Timer = 6000; + } + else HolySmite_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_mograine_and_whitemane() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp index dc10cb4d60f..8035adfc33f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp @@ -25,10 +25,13 @@ EndScriptData */ #include "ScriptPCH.h" -#define SPELL_LICHSLAP 28873 -#define SPELL_FROSTBOLTVOLLEY 8398 -#define SPELL_MINDFLAY 17313 -#define SPELL_FROSTNOVA 15531 +enum Spells +{ + SPELL_LICHSLAP = 28873, + SPELL_FROSTBOLTVOLLEY = 8398, + SPELL_MINDFLAY = 17313, + SPELL_FROSTNOVA = 15531 +}; class boss_scorn : public CreatureScript { @@ -42,7 +45,7 @@ public: struct boss_scornAI : public ScriptedAI { - boss_scornAI(Creature* c) : ScriptedAI(c) {} + boss_scornAI(Creature* creature) : ScriptedAI(creature) {} uint32 LichSlap_Timer; uint32 FrostboltVolley_Timer; @@ -57,9 +60,7 @@ public: FrostNova_Timer = 30000; } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) { @@ -71,33 +72,36 @@ public: { DoCast(me->getVictim(), SPELL_LICHSLAP); LichSlap_Timer = 45000; - } else LichSlap_Timer -= diff; + } + else LichSlap_Timer -= diff; //FrostboltVolley_Timer if (FrostboltVolley_Timer <= diff) { DoCast(me->getVictim(), SPELL_FROSTBOLTVOLLEY); FrostboltVolley_Timer = 20000; - } else FrostboltVolley_Timer -= diff; + } + else FrostboltVolley_Timer -= diff; //MindFlay_Timer if (MindFlay_Timer <= diff) { DoCast(me->getVictim(), SPELL_MINDFLAY); MindFlay_Timer = 20000; - } else MindFlay_Timer -= diff; + } + else MindFlay_Timer -= diff; //FrostNova_Timer if (FrostNova_Timer <= diff) { DoCast(me->getVictim(), SPELL_FROSTNOVA); FrostNova_Timer = 15000; - } else FrostNova_Timer -= diff; + } + else FrostNova_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_scorn() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index f1cddb08a69..ba0b854754e 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -26,10 +26,13 @@ EndScriptData */ #include "ScriptPCH.h" #include "scarlet_monastery.h" -#define ENTRY_PUMPKIN_SHRINE 186267 -#define ENTRY_HORSEMAN 23682 -#define ENTRY_HEAD 23775 -#define ENTRY_PUMPKIN 23694 +enum Entry +{ + ENTRY_PUMPKIN_SHRINE = 186267, + ENTRY_HORSEMAN = 23682, + ENTRY_HEAD = 23775, + ENTRY_PUMPKIN = 23694 +}; #define MAX_ENCOUNTER 2 @@ -57,11 +60,11 @@ public: uint64 VorrelGUID; uint64 DoorHighInquisitorGUID; - uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 encounter[MAX_ENCOUNTER]; void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&encounter, 0, sizeof(encounter)); PumpkinShrineGUID = 0; HorsemanGUID = 0; @@ -106,13 +109,13 @@ public: if (data == FAIL) DoUseDoorOrButton(DoorHighInquisitorGUID); - m_auiEncounter[0] = data; + encounter[0] = data; break; case GAMEOBJECT_PUMPKIN_SHRINE: HandleGameObject(PumpkinShrineGUID, false); break; case DATA_HORSEMAN_EVENT: - m_auiEncounter[1] = data; + encounter[1] = data; if (data == DONE) { for (std::set<uint64>::const_iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr) @@ -146,13 +149,12 @@ public: uint32 GetData(uint32 type) { if (type == TYPE_MOGRAINE_AND_WHITE_EVENT) - return m_auiEncounter[0]; + return encounter[0]; if (type == DATA_HORSEMAN_EVENT) - return m_auiEncounter[1]; + return encounter[1]; return 0; } }; - }; void AddSC_instance_scarlet_monastery() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h index ca6bd1d185a..70b18919704 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h @@ -19,14 +19,17 @@ #ifndef DEF_SCARLET_M #define DEF_SCARLET_M -#define TYPE_MOGRAINE_AND_WHITE_EVENT 1 -#define DATA_MOGRAINE 2 -#define DATA_WHITEMANE 3 -#define DATA_DOOR_WHITEMANE 4 +enum eEnums +{ + TYPE_MOGRAINE_AND_WHITE_EVENT = 1, -#define DATA_HORSEMAN_EVENT 5 -#define GAMEOBJECT_PUMPKIN_SHRINE 6 + DATA_MOGRAINE = 2, + DATA_WHITEMANE = 3, + DATA_DOOR_WHITEMANE = 4, -#define DATA_VORREL 7 -#endif + DATA_HORSEMAN_EVENT = 5, + GAMEOBJECT_PUMPKIN_SHRINE = 6, + DATA_VORREL = 7 +}; +#endif diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index d04d7af5c80..eee6b08d834 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -325,7 +325,7 @@ class boss_akilzon : public CreatureScript if (target) { target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - target->SendMonsterMove(x, y, me->GetPositionZ()+15, 0); + target->MonsterMoveWithSpeed(x, y, me->GetPositionZ()+15, 0); } Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000); if (Cloud) diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index e166013a4b2..4d897c4f3b8 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -19,12 +19,11 @@ /* ScriptData SDName: Silverpine_Forest SD%Complete: 100 -SDComment: Quest support: 1886, 435, 452 +SDComment: Quest support: 435, 452 SDCategory: Silverpine Forest EndScriptData */ /* ContentData -npc_astor_hadren npc_deathstalker_erland pyrewood_ambush EndContentData */ @@ -33,73 +32,6 @@ EndContentData */ #include "ScriptedEscortAI.h" /*###### -## npc_astor_hadren -######*/ - -#define GOSSIP_HAH "You're Astor Hadren, right?" -#define GOSSIP_SAH "You've got something I need, Astor. And I'll be taking it now." - -class npc_astor_hadren : public CreatureScript -{ -public: - npc_astor_hadren() : CreatureScript("npc_astor_hadren") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_astor_hadrenAI(creature); - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF + 1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SAH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(624, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->CLOSE_GOSSIP_MENU(); - creature->setFaction(21); - if (player) - CAST_AI(npc_astor_hadren::npc_astor_hadrenAI, creature->AI())->AttackStart(player); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(1886) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HAH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - player->SEND_GOSSIP_MENU(623, creature->GetGUID()); - - return true; - } - - struct npc_astor_hadrenAI : public ScriptedAI - { - npc_astor_hadrenAI(Creature* c) : ScriptedAI(c) {} - - void Reset() - { - me->setFaction(68); - } - - void EnterCombat(Unit* /*who*/) - { - } - - void JustDied(Unit* /*who*/) - { - me->setFaction(68); - } - }; - -}; - -/*###### ## npc_deathstalker_erland ######*/ @@ -386,7 +318,6 @@ public: void AddSC_silverpine_forest() { - new npc_astor_hadren(); new npc_deathstalker_erland(); new pyrewood_ambush(); } diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index 4d43e4adefe..a4eca1950f8 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -26,7 +26,6 @@ EndScriptData */ /* ContentData npc_archmage_malin npc_bartleby -npc_dashel_stonefist npc_lady_katrana_prestor npc_tyrion npc_tyrion_spybot @@ -148,78 +147,6 @@ public: }; /*###### -## npc_dashel_stonefist -######*/ - -enum eDashel -{ - QUEST_MISSING_DIPLO_PT8 = 1447, - FACTION_HOSTILE = 168 -}; - -class npc_dashel_stonefist : public CreatureScript -{ -public: - npc_dashel_stonefist() : CreatureScript("npc_dashel_stonefist") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT8) - { - creature->setFaction(FACTION_HOSTILE); - CAST_AI(npc_dashel_stonefist::npc_dashel_stonefistAI, creature->AI())->AttackStart(player); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_dashel_stonefistAI(creature); - } - - struct npc_dashel_stonefistAI : public ScriptedAI - { - npc_dashel_stonefistAI(Creature* c) : ScriptedAI(c) - { - m_uiNormalFaction = c->getFaction(); - } - - uint32 m_uiNormalFaction; - - void Reset() - { - if (me->getFaction() != m_uiNormalFaction) - me->setFaction(m_uiNormalFaction); - } - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim()) - return; - - if (me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage)) - { - uiDamage = 0; - - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_MISSING_DIPLO_PT8); - - EnterEvadeMode(); - } - } - }; - -}; - -/*###### ## npc_lady_katrana_prestor ######*/ @@ -716,7 +643,6 @@ void AddSC_stormwind_city() { new npc_archmage_malin(); new npc_bartleby(); - new npc_dashel_stonefist(); new npc_lady_katrana_prestor(); new npc_tyrion(); new npc_tyrion_spybot(); diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index f1c0fba2e29..fe9c40e6dbd 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -109,7 +109,7 @@ public: { if (Creature* target = Unit::GetCreature(*summoned, targetGUID)) { - target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0); + target->MonsterMoveWithSpeed(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0); target->SetPosition(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f); summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); } @@ -186,7 +186,7 @@ public: if (EventMove_Timer <= diff) { me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SendMonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, 5000); + 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; diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index 29029803369..878116ad476 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -43,7 +43,6 @@ public: player->AddAura(SPELL_BLESSING_OF_BLACKFATHOM, player); return true; } - }; class go_blackfathom_fire : public GameObjectScript @@ -64,7 +63,6 @@ public: } return false; } - }; class npc_blackfathom_deeps_event : public CreatureScript @@ -92,9 +90,9 @@ public: InstanceScript* instance; - uint32 uiRavageTimer; - uint32 uiFrostNovaTimer; - uint32 uiFrostBoltVolleyTimer; + uint32 ravageTimer; + uint32 frostNovaTimer; + uint32 frostBoltVolleyTimer; bool bFlee; @@ -102,9 +100,9 @@ public: { bFlee = false; - uiRavageTimer = urand(5000, 8000); - uiFrostNovaTimer = urand(9000, 12000); - uiFrostBoltVolleyTimer = urand(2000, 4000); + ravageTimer = urand(5000, 8000); + frostNovaTimer = urand(9000, 12000); + frostBoltVolleyTimer = urand(2000, 4000); } void AttackPlayer() @@ -131,7 +129,7 @@ public: } } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; @@ -140,11 +138,11 @@ public: { case NPC_AKU_MAI_SNAPJAW: { - if (uiRavageTimer <= uiDiff) + if (ravageTimer <= diff) { DoCast(me->getVictim(), SPELL_RAVAGE); - uiRavageTimer = urand(9000, 14000); - } else uiRavageTimer -= uiDiff; + ravageTimer = urand(9000, 14000); + } else ravageTimer -= diff; break; } case NPC_MURKSHALLOW_SOFTSHELL: @@ -159,20 +157,23 @@ public: } case NPC_AKU_MAI_SERVANT: { - if (uiFrostBoltVolleyTimer <= uiDiff) + if (frostBoltVolleyTimer <= diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { if (target) DoCast(target, SPELL_FROST_BOLT_VOLLEY); } - uiFrostBoltVolleyTimer = urand(5000, 8000); - } else uiFrostBoltVolleyTimer -= uiDiff; - if (uiFrostNovaTimer <= uiDiff) + frostBoltVolleyTimer = urand(5000, 8000); + } + else frostBoltVolleyTimer -= diff; + + if (frostNovaTimer <= diff) { DoCastAOE(SPELL_FROST_NOVA, false); - uiFrostNovaTimer = urand(25000, 30000); - } else uiFrostNovaTimer -= uiDiff; + frostNovaTimer = urand(25000, 30000); + } + else frostNovaTimer -= diff; break; } } @@ -187,7 +188,6 @@ public: instance->SetData(DATA_EVENT, instance->GetData(DATA_EVENT) + 1); } }; - }; enum eMorridune @@ -201,12 +201,12 @@ class npc_morridune : public CreatureScript public: npc_morridune() : CreatureScript("npc_morridune") { } - 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: + case GOSSIP_ACTION_INFO_DEF + 1: player->TeleportTo(1, 9952.239f, 2284.277f, 1341.394f, 1.595f); player->CLOSE_GOSSIP_MENU(); break; @@ -216,7 +216,7 @@ public: bool OnGossipHello(Player* player, Creature* creature) { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MORRIDUNE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MORRIDUNE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; @@ -250,7 +250,6 @@ public: } } }; - }; void AddSC_blackfathom_deeps() diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp index 87e8478532d..32a6bcbde77 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp @@ -36,19 +36,19 @@ public: struct boss_aku_maiAI : public ScriptedAI { - boss_aku_maiAI(Creature* c) : ScriptedAI(c) + boss_aku_maiAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - uint32 uiPoisonCloudTimer; + uint32 poisonCloudTimer; bool bIsEnraged; InstanceScript* instance; void Reset() { - uiPoisonCloudTimer = urand(5000, 9000); + poisonCloudTimer = urand(5000, 9000); bIsEnraged = false; if (instance) instance->SetData(TYPE_AKU_MAI, NOT_STARTED); @@ -71,11 +71,11 @@ public: if (!UpdateVictim()) return; - if (uiPoisonCloudTimer < diff) + if (poisonCloudTimer < diff) { DoCastVictim(SPELL_POISON_CLOUD); - uiPoisonCloudTimer = urand(25000, 50000); - } else uiPoisonCloudTimer -= diff; + poisonCloudTimer = urand(25000, 50000); + } else poisonCloudTimer -= diff; if (!bIsEnraged && HealthBelowPct(30)) { @@ -86,7 +86,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_aku_mai() diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp index e7822a6edb3..5a60a849b75 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp @@ -35,18 +35,18 @@ public: struct boss_gelihastAI : public ScriptedAI { - boss_gelihastAI(Creature* c) : ScriptedAI(c) + boss_gelihastAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - uint32 uiNetTimer; + uint32 netTimer; InstanceScript* instance; void Reset() { - uiNetTimer = urand(2000, 4000); + netTimer = urand(2000, 4000); if (instance) instance->SetData(TYPE_GELIHAST, NOT_STARTED); } @@ -68,16 +68,15 @@ public: if (!UpdateVictim()) return; - if (uiNetTimer < diff) + if (netTimer < diff) { DoCastVictim(SPELL_NET); - uiNetTimer = urand(4000, 7000); - } else uiNetTimer -= diff; + netTimer = urand(4000, 7000); + } else netTimer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_gelihast() diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp index 5823ed15ed5..7ee17172102 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp @@ -44,20 +44,20 @@ public: struct boss_kelrisAI : public ScriptedAI { - boss_kelrisAI(Creature* c) : ScriptedAI(c) + boss_kelrisAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - uint32 uiMindBlastTimer; - uint32 uiSleepTimer; + uint32 mindBlastTimer; + uint32 sleepTimer; InstanceScript* instance; void Reset() { - uiMindBlastTimer = urand(2000, 5000); - uiSleepTimer = urand(9000, 12000); + mindBlastTimer = urand(2000, 5000); + sleepTimer = urand(9000, 12000); if (instance) instance->SetData(TYPE_KELRIS, NOT_STARTED); } @@ -81,26 +81,25 @@ public: if (!UpdateVictim()) return; - if (uiMindBlastTimer < diff) + if (mindBlastTimer < diff) { DoCastVictim(SPELL_MIND_BLAST); - uiMindBlastTimer = urand(7000, 9000); - } else uiMindBlastTimer -= diff; + mindBlastTimer = urand(7000, 9000); + } else mindBlastTimer -= diff; - if (uiSleepTimer < diff) + if (sleepTimer < diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) { DoScriptText(SAY_SLEEP, me); DoCast(target, SPELL_SLEEP); } - uiSleepTimer = urand(15000, 20000); - } else uiSleepTimer -= diff; + sleepTimer = urand(15000, 20000); + } else sleepTimer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_kelris() diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp index 8dd4e60f281..ea33499a960 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp @@ -65,33 +65,33 @@ public: { instance_blackfathom_deeps_InstanceMapScript(Map* map) : InstanceScript(map) {} - uint64 m_uiTwilightLordKelrisGUID; - uint64 m_uiShrine1GUID; - uint64 m_uiShrine2GUID; - uint64 m_uiShrine3GUID; - uint64 m_uiShrine4GUID; - uint64 m_uiShrineOfGelihastGUID; - uint64 m_uiAltarOfTheDeepsGUID; - uint64 m_uiMainDoorGUID; + uint64 twilightLordKelrisGUID; + uint64 shrine1GUID; + uint64 shrine2GUID; + uint64 shrine3GUID; + uint64 shrine4GUID; + uint64 shrineOfGelihastGUID; + uint64 altarOfTheDeepsGUID; + uint64 mainDoorGUID; - uint8 m_auiEncounter[MAX_ENCOUNTER]; - uint8 m_uiCountFires; - uint8 uiDeathTimes; + uint8 encounter[MAX_ENCOUNTER]; + uint8 countFires; + uint8 deathTimes; void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&encounter, 0, sizeof(encounter)); - m_uiTwilightLordKelrisGUID = 0; - m_uiShrine1GUID = 0; - m_uiShrine2GUID = 0; - m_uiShrine3GUID = 0; - m_uiShrine4GUID = 0; - m_uiShrineOfGelihastGUID = 0; - m_uiAltarOfTheDeepsGUID = 0; - m_uiMainDoorGUID = 0; - m_uiCountFires = 0; - uiDeathTimes = 0; + twilightLordKelrisGUID = 0; + shrine1GUID = 0; + shrine2GUID = 0; + shrine3GUID = 0; + shrine4GUID = 0; + shrineOfGelihastGUID = 0; + altarOfTheDeepsGUID = 0; + mainDoorGUID = 0; + countFires = 0; + deathTimes = 0; } void OnCreatureCreate(Creature* creature) @@ -99,7 +99,7 @@ public: switch (creature->GetEntry()) { case NPC_TWILIGHT_LORD_KELRIS: - m_uiTwilightLordKelrisGUID = creature->GetGUID(); + twilightLordKelrisGUID = creature->GetGUID(); break; case NPC_LORGUS_JETT: creature->SetHomePosition(LorgusPosition[urand(0, 3)]); @@ -112,150 +112,149 @@ public: switch (go->GetEntry()) { case GO_FIRE_OF_AKU_MAI_1: - m_uiShrine1GUID = go->GetGUID(); + shrine1GUID = go->GetGUID(); break; case GO_FIRE_OF_AKU_MAI_2: - m_uiShrine2GUID = go->GetGUID(); + shrine2GUID = go->GetGUID(); break; case GO_FIRE_OF_AKU_MAI_3: - m_uiShrine3GUID = go->GetGUID(); + shrine3GUID = go->GetGUID(); break; case GO_FIRE_OF_AKU_MAI_4: - m_uiShrine4GUID = go->GetGUID(); + shrine4GUID = go->GetGUID(); break; case GO_SHRINE_OF_GELIHAST: - m_uiShrineOfGelihastGUID = go->GetGUID(); - if (m_auiEncounter[0] != DONE) + shrineOfGelihastGUID = go->GetGUID(); + if (encounter[0] != DONE) go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); break; case GO_ALTAR_OF_THE_DEEPS: - m_uiAltarOfTheDeepsGUID = go->GetGUID(); - if (m_auiEncounter[3] != DONE) + altarOfTheDeepsGUID = go->GetGUID(); + if (encounter[3] != DONE) go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); break; case GO_AKU_MAI_DOOR: - if (m_auiEncounter[2] == DONE) + if (encounter[2] == DONE) HandleGameObject(0, true, go); - m_uiMainDoorGUID = go->GetGUID(); + mainDoorGUID = go->GetGUID(); break; } } - void SetData(uint32 uiType, uint32 uiData) + void SetData(uint32 type, uint32 data) { - switch (uiType) + switch (type) { case TYPE_GELIHAST: - m_auiEncounter[0] = uiData; - if (uiData == DONE) - if (GameObject* go = instance->GetGameObject(m_uiShrineOfGelihastGUID)) + encounter[0] = data; + if (data == DONE) + if (GameObject* go = instance->GetGameObject(shrineOfGelihastGUID)) go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); break; case TYPE_AKU_MAI: - m_auiEncounter[3] = uiData; - if (uiData == DONE) - if (GameObject* go = instance->GetGameObject(m_uiAltarOfTheDeepsGUID)) + encounter[3] = data; + if (data == DONE) + if (GameObject* go = instance->GetGameObject(altarOfTheDeepsGUID)) { go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); go->SummonCreature(NPC_MORRIDUNE, SpawnsLocation[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); } break; case DATA_FIRE: - m_uiCountFires = uiData; - switch (m_uiCountFires) + countFires = data; + switch (countFires) { case 1: - if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID)) + if (GameObject* go = instance->GetGameObject(shrine1GUID)) { - pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); } break; case 2: - if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID)) + if (GameObject* go = instance->GetGameObject(shrine1GUID)) { for (uint8 i = 0; i < 2; ++i) { - pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); } } break; case 3: - if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID)) + if (GameObject* go = instance->GetGameObject(shrine1GUID)) { - pGO->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); } break; case 4: - if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID)) + if (GameObject* go = instance->GetGameObject(shrine1GUID)) { - pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); } break; } break; case DATA_EVENT: - uiDeathTimes = uiData; - if (uiDeathTimes == 18) - HandleGameObject(m_uiMainDoorGUID, true); + deathTimes = data; + if (deathTimes == 18) + HandleGameObject(mainDoorGUID, true); break; } } - uint32 GetData(uint32 uiType) + uint32 GetData(uint32 type) { - switch (uiType) + switch (type) { case TYPE_GELIHAST: - return m_auiEncounter[0]; + return encounter[0]; case TYPE_KELRIS: - return m_auiEncounter[1]; + return encounter[1]; case TYPE_SHRINE: - return m_auiEncounter[2]; + return encounter[2]; case TYPE_AKU_MAI: - return m_auiEncounter[3]; + return encounter[3]; case DATA_FIRE: - return m_uiCountFires; + return countFires; case DATA_EVENT: - return uiDeathTimes; + return deathTimes; } return 0; } - uint64 GetData64(uint32 uiData) + uint64 GetData64(uint32 data) { - switch (uiData) + switch (data) { case DATA_TWILIGHT_LORD_KELRIS: - return m_uiTwilightLordKelrisGUID; + return twilightLordKelrisGUID; case DATA_SHRINE1: - return m_uiShrine1GUID; + return shrine1GUID; case DATA_SHRINE2: - return m_uiShrine2GUID; + return shrine2GUID; case DATA_SHRINE3: - return m_uiShrine3GUID; + return shrine3GUID; case DATA_SHRINE4: - return m_uiShrine4GUID; + return shrine4GUID; case DATA_SHRINE_OF_GELIHAST: - return m_uiShrineOfGelihastGUID; + return shrineOfGelihastGUID; case DATA_MAINDOOR: - return m_uiMainDoorGUID; + return mainDoorGUID; } return 0; } }; - }; void AddSC_instance_blackfathom_deeps() diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index ad0a36da84e..6cdb794bf5e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -234,53 +234,53 @@ public: bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - npc_arthasAI* pAI = CAST_AI(npc_arthas::npc_arthasAI, creature->AI()); + npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI()); - if (!pAI) + if (!ai) return false; switch (action) { case GOSSIP_ACTION_INFO_DEF: - pAI->Start(true, true, player->GetGUID(), 0, false, false); - pAI->SetDespawnAtEnd(false); - pAI->bStepping = false; - pAI->uiStep = 1; + ai->Start(true, true, player->GetGUID(), 0, false, false); + ai->SetDespawnAtEnd(false); + ai->bStepping = false; + ai->uiStep = 1; break; case GOSSIP_ACTION_INFO_DEF+1: - pAI->bStepping = true; - pAI->uiStep = 24; + ai->bStepping = true; + ai->uiStep = 24; break; case GOSSIP_ACTION_INFO_DEF+2: - pAI->SetHoldState(false); - pAI->bStepping = false; - pAI->uiStep = 61; + ai->SetHoldState(false); + ai->bStepping = false; + ai->uiStep = 61; break; case GOSSIP_ACTION_INFO_DEF+3: - pAI->SetHoldState(false); + ai->SetHoldState(false); break; case GOSSIP_ACTION_INFO_DEF+4: - pAI->bStepping = true; - pAI->uiStep = 84; + ai->bStepping = true; + ai->uiStep = 84; break; case GOSSIP_ACTION_INFO_DEF+5: - pAI->bStepping = true; - pAI->uiStep = 85; + ai->bStepping = true; + ai->uiStep = 85; break; } player->CLOSE_GOSSIP_MENU(); - pAI->SetDespawnAtFar(true); + ai->SetDespawnAtFar(true); creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); return true; } bool OnGossipHello(Player* player, Creature* creature) { - npc_arthasAI* pAI = CAST_AI(npc_arthas::npc_arthasAI, creature->AI()); + npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI()); - if (pAI && pAI->bStepping == false) + if (ai && ai->bStepping == false) { - switch (pAI->uiGossipStep) + switch (ai->uiGossipStep) { case 0: //This one is a workaround since the very beggining of the script is wrong. { diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp index 0010db68673..74e7a919263 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -25,9 +25,12 @@ EndScriptData */ #include "ScriptPCH.h" -#define SPELL_WRATH 21807 -#define SPELL_ENTANGLINGROOTS 12747 -#define SPELL_CORRUPT_FORCES 21968 +enum Spells +{ + SPELL_WRATH = 21807, + SPELL_ENTANGLINGROOTS = 12747, + SPELL_CORRUPT_FORCES = 21968 +}; class celebras_the_cursed : public CreatureScript { @@ -41,7 +44,7 @@ public: struct celebras_the_cursedAI : public ScriptedAI { - celebras_the_cursedAI(Creature* c) : ScriptedAI(c) {} + celebras_the_cursedAI(Creature* creature) : ScriptedAI(creature) {} uint32 Wrath_Timer; uint32 EntanglingRoots_Timer; @@ -74,14 +77,16 @@ public: if (target) DoCast(target, SPELL_WRATH); Wrath_Timer = 8000; - } else Wrath_Timer -= diff; + } + else Wrath_Timer -= diff; //EntanglingRoots if (EntanglingRoots_Timer <= diff) { DoCast(me->getVictim(), SPELL_ENTANGLINGROOTS); EntanglingRoots_Timer = 20000; - } else EntanglingRoots_Timer -= diff; + } + else EntanglingRoots_Timer -= diff; //CorruptForces if (CorruptForces_Timer <= diff) @@ -89,12 +94,12 @@ public: me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_CORRUPT_FORCES); CorruptForces_Timer = 20000; - } else CorruptForces_Timer -= diff; + } + else CorruptForces_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_celebras_the_cursed() diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp index fdb5207acd5..418bf3a09ce 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp @@ -25,9 +25,12 @@ EndScriptData */ #include "ScriptPCH.h" -#define SPELL_KNOCKAWAY 18670 -#define SPELL_TRAMPLE 5568 -#define SPELL_LANDSLIDE 21808 +enum Spells +{ + SPELL_KNOCKAWAY = 18670, + SPELL_TRAMPLE = 5568, + SPELL_LANDSLIDE = 21808 +}; class boss_landslide : public CreatureScript { @@ -41,7 +44,7 @@ public: struct boss_landslideAI : public ScriptedAI { - boss_landslideAI(Creature* c) : ScriptedAI(c) {} + boss_landslideAI(Creature* creature) : ScriptedAI(creature) {} uint32 KnockAway_Timer; uint32 Trample_Timer; @@ -68,14 +71,16 @@ public: { DoCast(me->getVictim(), SPELL_KNOCKAWAY); KnockAway_Timer = 15000; - } else KnockAway_Timer -= diff; + } + else KnockAway_Timer -= diff; //Trample_Timer if (Trample_Timer <= diff) { DoCast(me, SPELL_TRAMPLE); Trample_Timer = 8000; - } else Trample_Timer -= diff; + } + else Trample_Timer -= diff; //Landslide if (HealthBelowPct(50)) @@ -85,13 +90,13 @@ public: me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_LANDSLIDE); Landslide_Timer = 60000; - } else Landslide_Timer -= diff; + } + else Landslide_Timer -= diff; } DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_landslide() diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp index 2d4c817ffe2..0e3ee5dc52b 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp @@ -24,9 +24,11 @@ SDCategory: Maraudon EndScriptData */ #include "ScriptPCH.h" - -#define SPELL_TOXICVOLLEY 21687 -#define SPELL_UPPERCUT 22916 +enum Spells +{ + SPELL_TOXICVOLLEY = 21687, + SPELL_UPPERCUT = 22916 +}; class boss_noxxion : public CreatureScript { @@ -40,7 +42,7 @@ public: struct boss_noxxionAI : public ScriptedAI { - boss_noxxionAI(Creature* c) : ScriptedAI(c) {} + boss_noxxionAI(Creature* creature) : ScriptedAI(creature) {} uint32 ToxicVolley_Timer; uint32 Uppercut_Timer; @@ -78,7 +80,8 @@ public: me->SetDisplayId(11172); Invisible = false; //me->m_canMove = true; - } else if (Invisible) + } + else if (Invisible) { Invisible_Timer -= diff; //Do nothing while invisible @@ -94,14 +97,16 @@ public: { DoCast(me->getVictim(), SPELL_TOXICVOLLEY); ToxicVolley_Timer = 9000; - } else ToxicVolley_Timer -= diff; + } + else ToxicVolley_Timer -= diff; //Uppercut_Timer if (Uppercut_Timer <= diff) { DoCast(me->getVictim(), SPELL_UPPERCUT); Uppercut_Timer = 12000; - } else Uppercut_Timer -= diff; + } + else Uppercut_Timer -= diff; //Adds_Timer if (!Invisible && Adds_Timer <= diff) @@ -122,12 +127,12 @@ public: Invisible_Timer = 15000; Adds_Timer = 40000; - } else Adds_Timer -= diff; + } + else Adds_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_noxxion() diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp index cb2c7b320e0..bade5655f36 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp @@ -25,10 +25,13 @@ EndScriptData */ #include "ScriptPCH.h" -#define SPELL_DUSTFIELD 21909 -#define SPELL_BOULDER 21832 -#define SPELL_THRASH 3391 -#define SPELL_REPULSIVEGAZE 21869 +enum Spells +{ + SPELL_DUSTFIELD = 21909, + SPELL_BOULDER = 21832, + SPELL_THRASH = 3391, + SPELL_REPULSIVEGAZE = 21869 +}; class boss_princess_theradras : public CreatureScript { @@ -42,7 +45,7 @@ public: struct boss_ptheradrasAI : public ScriptedAI { - boss_ptheradrasAI(Creature* c) : ScriptedAI(c) {} + boss_ptheradrasAI(Creature* creature) : ScriptedAI(creature) {} uint32 Dustfield_Timer; uint32 Boulder_Timer; @@ -57,9 +60,7 @@ public: RepulsiveGaze_Timer = 23000; } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void JustDied(Unit* /*killer*/) { @@ -76,7 +77,8 @@ public: { DoCast(me, SPELL_DUSTFIELD); Dustfield_Timer = 14000; - } else Dustfield_Timer -= diff; + } + else Dustfield_Timer -= diff; //Boulder_Timer if (Boulder_Timer <= diff) @@ -86,26 +88,28 @@ public: if (target) DoCast(target, SPELL_BOULDER); Boulder_Timer = 10000; - } else Boulder_Timer -= diff; + } + else Boulder_Timer -= diff; //RepulsiveGaze_Timer if (RepulsiveGaze_Timer <= diff) { DoCast(me->getVictim(), SPELL_REPULSIVEGAZE); RepulsiveGaze_Timer = 20000; - } else RepulsiveGaze_Timer -= diff; + } + else RepulsiveGaze_Timer -= diff; //Thrash_Timer if (Thrash_Timer <= diff) { DoCast(me, SPELL_THRASH); Thrash_Timer = 18000; - } else Thrash_Timer -= diff; + } + else Thrash_Timer -= diff; DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_ptheradras() diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index e27d7287179..5d26653a1a8 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -35,34 +35,42 @@ EndContentData */ # npc_torek ####*/ -#define SAY_READY -1000106 -#define SAY_MOVE -1000107 -#define SAY_PREPARE -1000108 -#define SAY_WIN -1000109 -#define SAY_END -1000110 +enum TorekSays +{ + SAY_READY = 0, + SAY_MOVE = 1, + SAY_PREPARE = 2, + SAY_WIN = 3, + SAY_END = 4, +}; -#define SPELL_REND 11977 -#define SPELL_THUNDERCLAP 8078 +enum TorekSpells +{ + SPELL_REND = 11977, + SPELL_THUNDERCLAP = 8078, +}; -#define QUEST_TOREK_ASSULT 6544 +enum TorekMisc +{ + QUEST_TOREK_ASSULT = 6544, -#define ENTRY_SPLINTERTREE_RAIDER 12859 -#define ENTRY_DURIEL 12860 -#define ENTRY_SILVERWING_SENTINEL 12896 -#define ENTRY_SILVERWING_WARRIOR 12897 + ENTRY_SPLINTERTREE_RAIDER = 12859, + ENTRY_DURIEL = 12860, + ENTRY_SILVERWING_SENTINEL = 12896, + ENTRY_SILVERWING_WARRIOR = 12897, +}; class npc_torek : public CreatureScript { public: - npc_torek() - : CreatureScript("npc_torek") + npc_torek() : CreatureScript("npc_torek") { } struct npc_torekAI : public npc_escortAI { - npc_torekAI(Creature* c) : npc_escortAI(c) {} + npc_torekAI(Creature* creature) : npc_escortAI(creature) {} uint32 Rend_Timer; uint32 Thunderclap_Timer; @@ -78,10 +86,10 @@ class npc_torek : public CreatureScript switch (i) { case 1: - DoScriptText(SAY_MOVE, me, player); + Talk(SAY_MOVE, player->GetGUID()); break; case 8: - DoScriptText(SAY_PREPARE, me, player); + Talk(SAY_PREPARE, player->GetGUID()); break; case 19: //TODO: verify location and creatures amount. @@ -96,7 +104,7 @@ class npc_torek : public CreatureScript player->GroupEventHappens(QUEST_TOREK_ASSULT, me); break; case 21: - DoScriptText(SAY_END, me, player); + Talk(SAY_END, player->GetGUID()); break; } } @@ -148,7 +156,7 @@ class npc_torek : public CreatureScript if (quest->GetQuestId() == QUEST_TOREK_ASSULT) { //TODO: find companions, make them follow Torek, at any time (possibly done by core/database in future?) - DoScriptText(SAY_READY, creature, player); + creature->AI()->Talk(SAY_READY, player->GetGUID()); creature->setFaction(113); if (npc_escortAI* pEscortAI = CAST_AI(npc_torekAI, creature->AI())) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index bc6145252d2..d3d92375d39 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -122,6 +122,11 @@ const Position SphereSpawn[6] = { 706.6383f, 161.5266f, 155.6701f, 0 }, }; +enum MovementPoints +{ + POINT_FALL_GROUND = 1 +}; + class boss_anubarak_trial : public CreatureScript { public: @@ -553,72 +558,68 @@ public: class mob_frost_sphere : public CreatureScript { -public: - mob_frost_sphere() : CreatureScript("mob_frost_sphere") { } + public: + mob_frost_sphere() : CreatureScript("mob_frost_sphere") { } - CreatureAI* GetAI(Creature* creature) const - { - return new mob_frost_sphereAI(creature); - }; - - struct mob_frost_sphereAI : public ScriptedAI - { - mob_frost_sphereAI(Creature* creature) : ScriptedAI(creature) + struct mob_frost_sphereAI : public ScriptedAI { - } - - bool m_bFall; - float x, y, z; + mob_frost_sphereAI(Creature* creature) : ScriptedAI(creature) + { + } - void Reset() - { - m_bFall = false; - me->SetReactState(REACT_PASSIVE); - me->SetFlying(true); - me->SetDisplayId(25144); - me->SetSpeed(MOVE_RUN, 0.5f, false); - me->GetMotionMaster()->MoveRandom(20.0f); - DoCast(SPELL_FROST_SPHERE); - } + void Reset() + { + _isFalling = false; + me->SetReactState(REACT_PASSIVE); + me->SetFlying(true); + me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetSpeed(MOVE_RUN, 0.5f, false); + me->GetMotionMaster()->MoveRandom(20.0f); + DoCast(SPELL_FROST_SPHERE); + } - void DamageTaken(Unit* /*who*/, uint32& uiDamage) - { - if (me->GetHealth() < uiDamage) + void DamageTaken(Unit* /*who*/, uint32& damage) { - uiDamage = 0; - if (!m_bFall) + if (me->GetHealth() <= damage) { - m_bFall = true; - me->GetMotionMaster()->MoveIdle(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //At hit the ground - me->GetPosition(x, y, z); - z = me->GetMap()->GetHeight(x, y, z, true, 50); - me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); - me->GetMotionMaster()->MoveFall(z, 0); - //me->FallGround(); //need correct vmap use (i believe it isn't working properly right now) + damage = 0; + if (!_isFalling) + { + _isFalling = true; + me->GetMotionMaster()->MoveIdle(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //At hit the ground + me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); + me->GetMotionMaster()->MoveFall(POINT_FALL_GROUND); + } } } - } - - void MovementInform(uint32 uiType, uint32 uiId) - { - if (uiType != POINT_MOTION_TYPE) return; - switch (uiId) + void MovementInform(uint32 type, uint32 pointId) { - case 0: - me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE); - me->SetDisplayId(11686); - me->Relocate(x, y, z, me->GetOrientation()); - DoCast(SPELL_PERMAFROST_VISUAL); - DoCast(SPELL_PERMAFROST); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); - break; + if (type != EFFECT_MOTION_TYPE) + return; + + switch (pointId) + { + case POINT_FALL_GROUND: + me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE); + me->SetDisplayId(me->GetCreatureInfo()->Modelid1); + DoCast(SPELL_PERMAFROST_VISUAL); + DoCast(SPELL_PERMAFROST); + me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); + break; + } } - } - }; + private: + bool _isFalling; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new mob_frost_sphereAI(creature); + }; }; class mob_anubarak_spike : public CreatureScript diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index bc06a92ef07..a0d6f04f44c 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -67,6 +67,7 @@ class boss_bronjahm : public CreatureScript { boss_bronjahmAI(Creature* creature) : BossAI(creature, DATA_BRONJAHM) { + DoCast(me, SPELL_SOULSTORM_CHANNEL, true); } void InitializeAI() @@ -82,14 +83,17 @@ class boss_bronjahm : public CreatureScript events.Reset(); events.SetPhase(PHASE_1); events.ScheduleEvent(EVENT_SHADOW_BOLT, 2000); - events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 15000)); + events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 20000)); events.ScheduleEvent(EVENT_CORRUPT_SOUL, urand(25000, 35000), 0, PHASE_1); - me->CastSpell(me, SPELL_SOULSTORM_CHANNEL, true); - instance->SetBossState(DATA_BRONJAHM, NOT_STARTED); } + void JustReachedHome() + { + DoCast(me, SPELL_SOULSTORM_CHANNEL, true); + } + void EnterCombat(Unit* /*who*/) { DoScriptText(SAY_AGGRO, me); @@ -118,7 +122,7 @@ class boss_bronjahm : public CreatureScript events.SetPhase(PHASE_2); DoCast(me, SPELL_TELEPORT); events.ScheduleEvent(EVENT_FEAR, urand(12000, 16000), 0, PHASE_2); - events.ScheduleEvent(EVENT_SOULSTORM, 700, 0, PHASE_2); + events.ScheduleEvent(EVENT_SOULSTORM, 100, 0, PHASE_2); } } @@ -147,7 +151,7 @@ class boss_bronjahm : public CreatureScript { case EVENT_MAGIC_BANE: DoCastVictim(SPELL_MAGIC_S_BANE); - events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 15000)); + events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 20000)); break; case EVENT_SHADOW_BOLT: if (!me->IsWithinMeleeRange(me->getVictim())) @@ -201,7 +205,7 @@ class mob_corrupted_soul_fragment : public CreatureScript void MovementInform(uint32 type, uint32 id) { - if (type != TARGETED_MOTION_TYPE) + if (type != CHASE_MOTION_TYPE) return; if (instance) diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index 8180a686e0e..fb39019fb84 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -306,6 +306,7 @@ class boss_devourer_of_souls : public CreatureScript if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { me->SetOrientation(me->GetAngle(target)); + me->SendMovementFlagUpdate(); DoCast(me, SPELL_WAILING_SOULS_BEAM); } @@ -332,6 +333,7 @@ class boss_devourer_of_souls : public CreatureScript case EVENT_WAILING_SOULS_TICK: beamAngle += beamAngleDiff; me->SetOrientation(beamAngle); + me->SendMovementFlagUpdate(); me->StopMoving(); DoCast(me, SPELL_WAILING_SOULS); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 3b15bba5c5d..94a3da2672b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -1159,7 +1159,7 @@ class npc_ball_of_flame : public CreatureScript void MovementInform(uint32 type, uint32 id) { - if (type == TARGETED_MOTION_TYPE && id == GUID_LOPART(_chaseGUID) && _chaseGUID) + if (type == CHASE_MOTION_TYPE && id == GUID_LOPART(_chaseGUID) && _chaseGUID) { me->RemoveAurasDueToSpell(SPELL_BALL_OF_FLAMES_PERIODIC); DoCast(me, SPELL_FLAMES); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 8396b6e6c85..31b3786a360 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -608,7 +608,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->SendMovementFlagUpdate(); me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); - me->SendMonsterMove(me->GetPositionX(), me->GetPositionY(), 539.2917f, SPLINEFLAG_FALLING, 0, 0.0f); + me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) (*itr)->AI()->DoAction(ACTION_DESPAWN); break; @@ -815,7 +815,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->SendMovementFlagUpdate(); me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); - me->SendMonsterMove(me->GetPositionX(), me->GetPositionY(), 539.2917f, SPLINEFLAG_FALLING, 0, 0.0f); + me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) (*itr)->AI()->DoAction(ACTION_DESPAWN); break; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 25610341a2f..3d3eaa1cc87 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -268,7 +268,7 @@ class boss_sindragosa : public CreatureScript void MovementInform(uint32 type, uint32 point) { - if (type != POINT_MOTION_TYPE) + if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE) return; switch (point) @@ -638,7 +638,7 @@ class npc_spinestalker : public CreatureScript float moveTime = me->GetExactDist(&SpinestalkerFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f); me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, SpinestalkerLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250)); me->SetDefaultMovementType(IDLE_MOTION_TYPE); - me->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE); + me->GetMotionMaster()->MoveIdle(); me->StopMoving(); me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, SpinestalkerFlyPos); } @@ -646,7 +646,7 @@ class npc_spinestalker : public CreatureScript void MovementInform(uint32 type, uint32 point) { - if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND) + if (type != EFFECT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND) return; me->setActive(false); @@ -753,7 +753,7 @@ class npc_rimefang : public CreatureScript float moveTime = me->GetExactDist(&RimefangFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f); me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, RimefangLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250)); me->SetDefaultMovementType(IDLE_MOTION_TYPE); - me->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE); + me->GetMotionMaster()->MoveIdle(); me->StopMoving(); me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, RimefangFlyPos); } @@ -761,7 +761,7 @@ class npc_rimefang : public CreatureScript void MovementInform(uint32 type, uint32 point) { - if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND) + if (type != EFFECT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND) return; me->setActive(false); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 1fbdb7f4677..5029dbcceee 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -508,7 +508,7 @@ class boss_the_lich_king : public CreatureScript if (fabs(ground_Z - z) < 0.1f) return; - me->GetMotionMaster()->MoveFall(ground_Z); + me->GetMotionMaster()->MoveFall(); } void EnterCombat(Unit* target) @@ -801,7 +801,7 @@ class boss_the_lich_king : public CreatureScript events.ScheduleEvent(EVENT_INTRO_TALK_1, 9000, 0, PHASE_INTRO); break; case POINT_CENTER_1: - me->SetFacing(0.0f); + me->SetFacingTo(0.0f); Talk(SAY_LK_REMORSELESS_WINTER); SendMusicToPlayers(MUSIC_SPECIAL); me->SetReactState(REACT_PASSIVE); @@ -818,7 +818,7 @@ class boss_the_lich_king : public CreatureScript events.ScheduleEvent(EVENT_SOUL_REAPER, 94000, 0, PHASE_TWO); break; case POINT_CENTER_2: - me->SetFacing(0.0f); + me->SetFacingTo(0.0f); Talk(SAY_LK_REMORSELESS_WINTER); SendMusicToPlayers(MUSIC_SPECIAL); me->SetReactState(REACT_PASSIVE); @@ -1047,14 +1047,14 @@ class boss_the_lich_king : public CreatureScript break; case EVENT_OUTRO_TALK_3: if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING))) - me->SetFacing(0.0f, tirion); + me->SetFacingToObject(tirion); Talk(SAY_LK_OUTRO_3); break; case EVENT_OUTRO_MOVE_CENTER: me->GetMotionMaster()->MovePoint(POINT_LK_OUTRO_1, CenterPosition); break; case EVENT_OUTRO_TALK_4: - me->SetFacing(0.01745329f); + me->SetFacingTo(0.01745329f); Talk(SAY_LK_OUTRO_4); break; case EVENT_OUTRO_RAISE_DEAD: @@ -1070,7 +1070,7 @@ class boss_the_lich_king : public CreatureScript case EVENT_OUTRO_TALK_6: Talk(SAY_LK_OUTRO_6); if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING))) - tirion->SetFacing(0.0f, me); + tirion->SetFacingToObject(me); me->ClearUnitState(UNIT_STAT_CASTING); DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE_3); SetEquipmentSlots(false, EQUIP_UNEQUIP); @@ -1222,7 +1222,7 @@ class npc_tirion_fordring_tft : public CreatureScript void SpellHit(Unit* /*caster*/, SpellInfo const* spell) { if (spell->Id == SPELL_ICE_LOCK) - me->SetFacing(3.085098f); + me->SetFacingTo(3.085098f); else if (spell->Id == SPELL_BROKEN_FROSTMOURNE_KNOCK) SetEquipmentSlots(true); // remove glow on ashbringer } @@ -1285,7 +1285,7 @@ class npc_tirion_fordring_tft : public CreatureScript SetEquipmentSlots(false, EQUIP_ASHBRINGER_GLOWING); if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING))) { - me->SetFacing(0.0f, lichKing); + me->SetFacingToObject(lichKing); lichKing->AI()->DoAction(ACTION_PLAY_MUSIC); } break; @@ -1621,7 +1621,7 @@ class npc_strangulate_vehicle : public CreatureScript void IsSummonedBy(Unit* summoner) { - me->SetFacing(0.0f, summoner); + me->SetFacingToObject(summoner); DoCast(summoner, SPELL_HARVEST_SOUL_VEHICLE); _events.Reset(); _events.ScheduleEvent(EVENT_MOVE_TO_LICH_KING, 2000); @@ -1656,7 +1656,8 @@ class npc_strangulate_vehicle : public CreatureScript switch (eventId) { case EVENT_TELEPORT: - me->GetMotionMaster()->MoveIdle(MOTION_SLOT_ACTIVE); + me->GetMotionMaster()->Clear(false); + me->GetMotionMaster()->MoveIdle(); if (TempSummon* summ = me->ToTempSummon()) { if (Unit* summoner = summ->GetSummoner()) @@ -1788,7 +1789,7 @@ class npc_terenas_menethil : public CreatureScript _events.Reset(); _events.SetPhase(PHASE_OUTRO); if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING))) - me->SetFacing(0.0f, lichKing); + me->SetFacingToObject(lichKing); _events.ScheduleEvent(EVENT_OUTRO_TERENAS_TALK_1, 2000, 0, PHASE_OUTRO); _events.ScheduleEvent(EVENT_OUTRO_TERENAS_TALK_2, 14000, 0, PHASE_OUTRO); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index ab3046806db..6bd8f3cba7d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1264,7 +1264,7 @@ struct npc_argent_captainAI : public ScriptedAI void EnterEvadeMode() { // not yet following - if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != TARGETED_MOTION_TYPE || IsUndead) + if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != CHASE_MOTION_TYPE || IsUndead) { ScriptedAI::EnterEvadeMode(); return; diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 8e995a9b260..052fa3ba4a5 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -838,7 +838,7 @@ public: return; } - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) me->GetMotionMaster()->MoveFollow(malygos, 0.0f, 0.0f); } } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index 194c2a36862..1fc724c8b6c 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -243,7 +243,7 @@ public: { if (m_uiPause_Timer <= uiDiff) { - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) if (me->getVictim()) me->GetMotionMaster()->MoveChase(me->getVictim()); @@ -421,7 +421,7 @@ public: // me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //Set in DB if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); m_bIsFrozen = true; } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index 4ee71367b55..d1aba800094 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -174,7 +174,7 @@ public: bIsSlam = false; //and correct movement, if not already - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) { if (me->getVictim()) me->GetMotionMaster()->MoveChase(me->getVictim()); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index 68435fffb1b..2c7532fcf70 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -634,7 +634,7 @@ class boss_stormcaller_brundir : public CreatureScript // Prevent to have Brundir somewhere in the air when he die in Air phase if (me->GetPositionZ() > FLOOR_Z) - me->GetMotionMaster()->MoveFall(FLOOR_Z); + me->GetMotionMaster()->MoveFall(); } void KilledUnit(Unit* /*who*/) diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index ea84502c16d..0c59097a9ec 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -18,7 +18,7 @@ /* ScriptData SDName: Boss_Ingvar_The_Plunderer SD%Complete: 95 -SDComment: Some Problems with Annhylde Movement, Blizzlike Timers +SDComment: Some Problems with Annhylde Movement, Blizzlike Timers (just shadow axe summon needs a new timer) SDCategory: Udgarde Keep EndScriptData */ @@ -45,16 +45,32 @@ enum Creatures MOB_INGVAR_UNDEAD = 23980, }; +enum Events +{ + EVENT_CLEAVE = 1, + EVENT_SMASH, + EVENT_STAGGERING_ROAR, + EVENT_ENRAGE, + + EVENT_DARK_SMASH, + EVENT_DREADFUL_ROAR, + EVENT_WOE_STRIKE, + EVENT_SHADOW_AXE +}; + +enum Phases +{ + PHASE_HUMAN = 1, + PHASE_UNDEAD, +}; + enum Spells { //Ingvar Spells human form SPELL_CLEAVE = 42724, SPELL_SMASH = 42669, - H_SPELL_SMASH = 59706, SPELL_STAGGERING_ROAR = 42708, - H_SPELL_STAGGERING_ROAR = 59708, SPELL_ENRAGE = 42705, - H_SPELL_ENRAGE = 59707, SPELL_INGVAR_FEIGN_DEATH = 42795, SPELL_SUMMON_BANSHEE = 42912, @@ -63,9 +79,7 @@ enum Spells //Ingvar Spells undead form SPELL_DARK_SMASH = 42723, SPELL_DREADFUL_ROAR = 42729, - H_SPELL_DREADFUL_ROAR = 59734, SPELL_WOE_STRIKE = 42730, - H_SPELL_WOE_STRIKE = 59735, ENTRY_THROW_TARGET = 23996, SPELL_SHADOW_AXE_SUMMON = 42749 @@ -83,9 +97,9 @@ public: struct boss_ingvar_the_plundererAI : public ScriptedAI { - boss_ingvar_the_plundererAI(Creature* c) : ScriptedAI(c) + boss_ingvar_the_plundererAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -93,10 +107,6 @@ public: bool bIsUndead; bool bEventInProgress; - uint32 uiCleaveTimer; - uint32 uiSmashTimer; - uint32 uiEnrageTimer; - uint32 uiRoarTimer; uint32 uiSpawnResTimer; void Reset() @@ -110,10 +120,18 @@ public: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); me->SetStandState(UNIT_STAND_STATE_STAND); - uiCleaveTimer = 2000; - uiSmashTimer = 5000; - uiEnrageTimer = 10000; - uiRoarTimer = 15000; + events.Reset(); + events.SetPhase(PHASE_HUMAN); + + events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN); + + events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD); uiSpawnResTimer = 3000; @@ -138,6 +156,7 @@ public: bEventInProgress = true; bIsUndead = true; + events.SetPhase(PHASE_UNDEAD); DoScriptText(YELL_DEAD_1, me); } @@ -208,70 +227,60 @@ public: return; } - if (uiCleaveTimer <= diff) - { - if (!me->HasUnitState(UNIT_STAT_CASTING)) - { - if (bIsUndead) - DoCast(me->getVictim(), SPELL_WOE_STRIKE); - else - DoCast(me->getVictim(), SPELL_CLEAVE); - uiCleaveTimer = rand()%5000 + 2000; - } - } else uiCleaveTimer -= diff; + events.Update(diff); - if (uiSmashTimer <= diff) - { - if (!me->HasUnitState(UNIT_STAT_CASTING)) - { - if (bIsUndead) - DoCast(me->getVictim(), SPELL_DARK_SMASH); - else - DoCast(me->getVictim(), SPELL_SMASH); - uiSmashTimer = 10000; - } - } else uiSmashTimer -= diff; + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; - if (!bIsUndead) - { - if (uiEnrageTimer <= diff) - { - DoCast(me, SPELL_ENRAGE); - uiEnrageTimer = 10000; - } else uiEnrageTimer -= diff; - } else // In Undead form used to summon weapon + while (uint32 eventId = events.ExecuteEvent()) { - if (uiEnrageTimer <= diff) + switch (eventId) { - if (!me->HasUnitState(UNIT_STAT_CASTING)) - { - // Spawn target for Axe - Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); - if (target) + // PHASE ONE + case EVENT_CLEAVE: + DoCastVictim(SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN); + break; + case EVENT_STAGGERING_ROAR: + DoCast(me, SPELL_STAGGERING_ROAR); + events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_HUMAN); + break; + case EVENT_ENRAGE: + DoCast(me, SPELL_ENRAGE); + events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN); + break; + case EVENT_SMASH: + DoCastVictim(SPELL_SMASH); + events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN); + break; + // PHASE TWO + case EVENT_DARK_SMASH: + DoCastVictim(SPELL_DARK_SMASH); + events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + break; + case EVENT_DREADFUL_ROAR: + DoCast(me, SPELL_DREADFUL_ROAR); + events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + break; + case EVENT_WOE_STRIKE: + DoCastVictim(SPELL_WOE_STRIKE); + events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + break; + case EVENT_SHADOW_AXE: + if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1)) { me->SummonCreature(ENTRY_THROW_TARGET, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2000); - DoCast(me, SPELL_SHADOW_AXE_SUMMON); } - uiEnrageTimer = 30000; - } - } else uiEnrageTimer -= diff; - } - - if (uiRoarTimer <= diff) - { - if (!me->HasUnitState(UNIT_STAT_CASTING)) - { - if (bIsUndead) - DoCast(me, SPELL_DREADFUL_ROAR); - else - DoCast(me, SPELL_STAGGERING_ROAR); - uiRoarTimer = 10000; + events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD); + break; } - } else uiRoarTimer -= diff; + } DoMeleeAttackIfReady(); } + private: + EventMap events; }; }; @@ -381,8 +390,9 @@ public: { ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY); - if (boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI* pAI = CAST_AI(boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI, ingvar->AI())) - pAI->StartZombiePhase(); + if (ingvar->getVictim()) + if (boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI* ai = CAST_AI(boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI, ingvar->AI())) + ai->StartZombiePhase(); me->GetMotionMaster()->MovePoint(2, x+1, y, z+30); ++uiResurectPhase; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index dc93917f2e5..94a133c78a6 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -17,354 +17,323 @@ /* ScriptData SDName: Boss_Prince_Keleseth -SD%Complete: 90 -SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells +SD%Complete: 100 +SDComment: SDCategory: Utgarde Keep EndScriptData */ #include "ScriptPCH.h" #include "utgarde_keep.h" -enum eEnums +enum KelsethEncounter { - ACHIEVEMENT_ON_THE_ROCKS = 1919, - SPELL_SHADOWBOLT = 43667, - SPELL_SHADOWBOLT_HEROIC = 59389, SPELL_FROST_TOMB = 48400, + SPELL_FROST_TOMB_STUN = 42672, SPELL_FROST_TOMB_SUMMON = 42714, + + SPELL_SHADOW_FISSURE = 50657, + SPELL_FULL_HEAL = 17683, SPELL_DECREPIFY = 42702, - SPELL_SCOURGE_RESSURRECTION = 42704, - CREATURE_FROSTTOMB = 23965, - CREATURE_SKELETON = 23970, - - SAY_AGGRO = -1574000, - SAY_FROST_TOMB = -1574001, - SAY_SKELETONS = -1574002, - SAY_KILL = -1574003, - SAY_DEATH = -1574004 + SPELL_BONE_ARMOR = 59386, + + NPC_FROSTTOMB = 23965, + NPC_SKELETON = 23970, + + SAY_START_COMBAT = 1, + SAY_SUMMON_SKELETONS, + SAY_FROST_TOMB, + SAY_FROST_TOMB_EMOTE, + SAY_DEATH, + + EVENT_SHADOWBOLT = 1, + EVENT_FROST_TOMB, + EVENT_SUMMON_SKELETONS, + + EVENT_DECREPIFY, + EVENT_FULL_HEAL, + EVENT_SHADOW_FISSURE, + EVENT_RESURRECT, + + DATA_ON_THE_ROCKS }; #define SKELETONSPAWN_Z 42.8668f -float SkeletonSpawnPoint[5][5]= +float const SkeletonSpawnPoint[1][2] = { {156.2559f, 259.2093f}, - {156.2559f, 259.2093f}, - {156.2559f, 259.2093f}, - {156.2559f, 259.2093f}, - {156.2559f, 259.2093f}, }; -float AttackLoc[3]={197.636f, 194.046f, 40.8164f}; +float AttackLoc[3]= {197.636f, 194.046f, 40.8164f}; -bool ShatterFrostTomb; // needed for achievement: On The Rocks(1919) - -class mob_frost_tomb : public CreatureScript +class npc_frost_tomb : public CreatureScript { public: - mob_frost_tomb() : CreatureScript("mob_frost_tomb") { } + npc_frost_tomb() : CreatureScript("npc_frost_tomb") {} CreatureAI* GetAI(Creature* creature) const { - return new mob_frost_tombAI(creature); + return new npc_frost_tombAI(creature); } - struct mob_frost_tombAI : public ScriptedAI + struct npc_frost_tombAI : public ScriptedAI { - mob_frost_tombAI(Creature* c) : ScriptedAI(c) + npc_frost_tombAI(Creature* creature) : ScriptedAI(creature) { - FrostTombGUID = 0; - } - - uint64 FrostTombGUID; + if (me->isSummon()) + if (Unit* summon = me->ToTempSummon()->GetSummoner()) + DoCast(summon, SPELL_FROST_TOMB, true); - void SetPrisoner(Unit* uPrisoner) - { - FrostTombGUID = uPrisoner->GetGUID(); + instance = creature->GetInstanceScript(); } - void Reset(){ FrostTombGUID = 0; } - void EnterCombat(Unit* /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 /*diff*/) {} - void JustDied(Unit* killer) + void JustDied(Unit* /*killer*/) { - if (killer->GetGUID() != me->GetGUID()) - ShatterFrostTomb = true; - - if (FrostTombGUID) - { - Unit* FrostTomb = Unit::GetUnit((*me), FrostTombGUID); - if (FrostTomb) - FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB); - } + if (instance) + if (Unit* boss = me->GetUnit(*me, instance->GetData64(DATA_PRINCEKELESETH))) + if (boss->ToCreature() && boss->ToCreature()->AI()) + boss->ToCreature()->AI()->SetData(DATA_ON_THE_ROCKS, false); } - void UpdateAI(const uint32 /*diff*/) - { - Unit* temp = Unit::GetUnit((*me), FrostTombGUID); - if ((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp) - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } + private: + InstanceScript* instance; }; - }; class boss_keleseth : public CreatureScript { public: - boss_keleseth() : CreatureScript("boss_keleseth") { } + boss_keleseth() : CreatureScript("boss_keleseth") {} CreatureAI* GetAI(Creature* creature) const { return new boss_kelesethAI (creature); } - struct boss_kelesethAI : public ScriptedAI + struct boss_kelesethAI : public BossAI { - boss_kelesethAI(Creature* c) : ScriptedAI(c) + boss_kelesethAI(Creature* creature) : BossAI(creature, DATA_PRINCEKELESETH_EVENT) { - instance = c->GetInstanceScript(); + creature->SetReactState(REACT_DEFENSIVE); } - InstanceScript* instance; - - uint32 FrostTombTimer; - uint32 SummonSkeletonsTimer; - uint32 RespawnSkeletonsTimer; - uint32 ShadowboltTimer; - uint64 SkeletonGUID[5]; - bool Skeletons; - bool RespawnSkeletons; - void Reset() { - ShadowboltTimer = 0; - Skeletons = false; + instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED); - ShatterFrostTomb = false; + events.Reset(); + events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SUMMON_SKELETONS, 6*IN_MILLISECONDS); - ResetTimer(); + summons.DespawnAll(); - if (instance) - instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED); + onTheRocks = true; } - void KilledUnit(Unit* victim) + void EnterCombat(Unit* /*who*/) { - if (victim == me) - return; - - DoScriptText(SAY_KILL, me); + me->SetInCombatWithZone(); + instance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS); + Talk(SAY_START_COMBAT); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); - - if (IsHeroic() && !ShatterFrostTomb) - { - AchievementEntry const* AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS); - if (AchievOnTheRocks) - { - Map* map = me->GetMap(); - if (map && map->IsDungeon()) - { - Map::PlayerList const &players = map->GetPlayers(); - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievOnTheRocks); - } - } - } - - if (instance) - instance->SetData(DATA_PRINCEKELESETH_EVENT, DONE); + instance->SetData(DATA_PRINCEKELESETH_EVENT, DONE); + summons.DespawnAll(); + Talk(SAY_DEATH); } - void EnterCombat(Unit* /*who*/) + void SetData(uint32 data, uint32 value) { - DoScriptText(SAY_AGGRO, me); - DoZoneInCombat(); - - if (instance) - instance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS); + if (data == DATA_ON_THE_ROCKS) + onTheRocks = value; } - void ResetTimer(uint32 inc = 0) + uint32 GetData(uint32 data) { - SummonSkeletonsTimer = 5000 + inc; - FrostTombTimer = 28000 + inc; + if (data == DATA_ON_THE_ROCKS) + return onTheRocks; + + return 0; } - void UpdateAI(const uint32 diff) + void ExecuteEvent(uint32 const eventId) { - if (!UpdateVictim()) - return; - - if (ShadowboltTimer <= diff) + switch (eventId) { - Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0); - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - me->CastSpell(target, DUNGEON_MODE(SPELL_SHADOWBOLT, SPELL_SHADOWBOLT_HEROIC), true); - ShadowboltTimer = 10000; - } else ShadowboltTimer -= diff; - - if (!Skeletons) - { - if ((SummonSkeletonsTimer <= diff)) - { - Creature* Skeleton; - DoScriptText(SAY_SKELETONS, me); - for (uint8 i = 0; i < 5; ++i) + case EVENT_SUMMON_SKELETONS: + Talk(SAY_SUMMON_SKELETONS); + SummonSkeletons(); + break; + case EVENT_SHADOWBOLT: + DoCastVictim(SPELL_SHADOWBOLT); + events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS); + break; + case EVENT_FROST_TOMB: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, -SPELL_FROST_TOMB)) { - Skeleton = me->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1], SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); - if (Skeleton) - { - Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - Skeleton->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); - Skeleton->AddThreat(me->getVictim(), 0.0f); - DoZoneInCombat(Skeleton); - } - } - Skeletons = true; - } else SummonSkeletonsTimer -= diff; - } + Talk(SAY_FROST_TOMB); + Talk(SAY_FROST_TOMB_EMOTE, target->GetGUID()); - if (FrostTombTimer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - if (target->isAlive()) - { - //DoCast(target, SPELL_FROST_TOMB_SUMMON, true); - if (Creature* pChains = me->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000)) - { - CAST_AI(mob_frost_tomb::mob_frost_tombAI, pChains->AI())->SetPrisoner(target); - pChains->CastSpell(target, SPELL_FROST_TOMB, true); - - DoScriptText(SAY_FROST_TOMB, me); - } + DoCast(target, SPELL_FROST_TOMB_STUN, true); + // checked from sniffs - the player casts the spell + target->CastSpell(target, SPELL_FROST_TOMB_SUMMON, true); } - FrostTombTimer = 15000; - } else FrostTombTimer -= diff; + events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS); + break; + } + } - DoMeleeAttackIfReady(); + void SummonSkeletons() + { + // I could not found any spell casted for this + for (uint8 i = 0; i < 4; ++i) + me->SummonCreature(NPC_SKELETON, SkeletonSpawnPoint[0][0], SkeletonSpawnPoint[0][1], SKELETONSPAWN_Z, 0); } + private: + bool onTheRocks; }; - }; -class mob_vrykul_skeleton : public CreatureScript +class npc_vrykul_skeleton : public CreatureScript { public: - mob_vrykul_skeleton() : CreatureScript("mob_vrykul_skeleton") { } + npc_vrykul_skeleton() : CreatureScript("npc_vrykul_skeleton") {} CreatureAI* GetAI(Creature* creature) const { - return new mob_vrykul_skeletonAI (creature); + return new npc_vrykul_skeletonAI (creature); } - struct mob_vrykul_skeletonAI : public ScriptedAI + struct npc_vrykul_skeletonAI : public ScriptedAI { - mob_vrykul_skeletonAI(Creature* c) : ScriptedAI(c) - { - instance = c->GetInstanceScript(); - } - - InstanceScript* instance; - uint32 Respawn_Time; - uint64 Target_Guid; - uint32 Decrepify_Timer; - - bool isDead; + npc_vrykul_skeletonAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { - Respawn_Time = 12000; - Decrepify_Timer = urand(10000, 20000); - isDead = false; + events.Reset(); + events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS); + + DoCast(SPELL_BONE_ARMOR); } - void EnterCombat(Unit* /*who*/){} - void DamageTaken(Unit* done_by, uint32 &damage) + void DamageTaken(Unit* /*done_by*/, uint32 &damage) { - if (done_by->GetGUID() == me->GetGUID()) - return; - if (damage >= me->GetHealth()) { - PretendToDie(); damage = 0; - } - } - void PretendToDie() - { - isDead = true; - me->InterruptNonMeleeSpells(true); - me->RemoveAllAuras(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->GetMotionMaster()->MovementExpired(false); - me->GetMotionMaster()->MoveIdle(); - me->SetStandState(UNIT_STAND_STATE_DEAD); - }; + // There are some issues with pets + // they will still attack. I would say it is a PetAI bug + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + { + // from sniffs + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); - void Resurrect() - { - isDead = false; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetStandState(UNIT_STAND_STATE_STAND); - DoCast(me, SPELL_SCOURGE_RESSURRECTION, true); + events.Reset(); + events.ScheduleEvent(EVENT_RESURRECT, urand(18,22)*IN_MILLISECONDS); - if (me->getVictim()) - { - me->GetMotionMaster()->MoveChase(me->getVictim()); - me->AI()->AttackStart(me->getVictim()); + me->GetMotionMaster()->MovementExpired(false); + me->GetMotionMaster()->MoveIdle(); + } } - else - me->GetMotionMaster()->Initialize(); - }; + } void UpdateAI(const uint32 diff) { - if (instance && instance->GetData(DATA_PRINCEKELESETH_EVENT) == IN_PROGRESS) + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) { - if (isDead) + switch (eventId) { - if (Respawn_Time <= diff) - { - Resurrect(); - Respawn_Time = 12000; - } else Respawn_Time -= diff; + case EVENT_DECREPIFY: + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_DECREPIFY), SPELL_DECREPIFY); + events.ScheduleEvent(EVENT_DECREPIFY, urand(1,5)*IN_MILLISECONDS); + break; + case EVENT_RESURRECT: + events.ScheduleEvent(EVENT_FULL_HEAL, 1*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SHADOW_FISSURE, 1*IN_MILLISECONDS); + break; + case EVENT_FULL_HEAL: + DoCast(me, SPELL_FULL_HEAL, true); + break; + case EVENT_SHADOW_FISSURE: + DoCast(me, SPELL_SHADOW_FISSURE, true); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); + me->GetMotionMaster()->MoveChase(me->getVictim()); + events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS); + break; } - else - { - if (!UpdateVictim()) - return; + } - if (Decrepify_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DECREPIFY); - Decrepify_Timer = 30000; - } else Decrepify_Timer -= diff; + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + DoMeleeAttackIfReady(); + } - DoMeleeAttackIfReady(); - } - }else + private: + EventMap events; + }; +}; + +class spell_frost_tomb : public SpellScriptLoader +{ + public: + spell_frost_tomb() : SpellScriptLoader("spell_frost_tomb") {} + + class spell_frost_tomb_AuraScript : public AuraScript + { + PrepareAuraScript(spell_frost_tomb_AuraScript); + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (me->isAlive()) - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH) + if (Unit* caster = GetCaster()) + if (caster->ToCreature() && caster->isAlive()) + caster->ToCreature()->DespawnOrUnsummon(1000); } + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_frost_tomb_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_frost_tomb_AuraScript(); } - }; +}; + + +class achievement_on_the_rocks : public AchievementCriteriaScript +{ + public: + achievement_on_the_rocks() : AchievementCriteriaScript("achievement_on_the_rocks") {} + bool OnCheck(Player* /*source*/, Unit* target) + { + return target && target->IsAIEnabled && target->GetAI()->GetData(DATA_ON_THE_ROCKS); + } }; void AddSC_boss_keleseth() { new boss_keleseth(); - new mob_frost_tomb(); - new mob_vrykul_skeleton(); + new npc_frost_tomb(); + new npc_vrykul_skeleton(); + new spell_frost_tomb(); + new achievement_on_the_rocks(); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 1bedd7e19e9..d5cd79b25f1 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -288,7 +288,7 @@ public: me->Dismount(); if (Creature* pGrauf = me->SummonCreature(CREATURE_GRAUF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3*IN_MILLISECONDS)) { - pGrauf->GetMotionMaster()->MoveFall(0); + pGrauf->GetMotionMaster()->MoveFall(); pGrauf->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); } me->GetMotionMaster()->MoveJump(Location[4].GetPositionX(), Location[4].GetPositionY(), Location[4].GetPositionZ(), 5.0f, 10.0f); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 9cab1de197c..5c1ec15030c 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -94,6 +94,11 @@ enum SvalaPhase SVALADEAD }; +enum SvalaPoint +{ + POINT_FALL_GROUND = 1, +}; + #define DATA_INCREDIBLE_HULK 2043 static const float spectatorWP[2][3] = @@ -249,38 +254,29 @@ public: if (Phase == SACRIFICING) SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - me->GetPosition(x, y, z); - z = me->GetMap()->GetHeight(x, y, z, true, 50); + damage = 0; + Phase = SVALADEAD; + me->InterruptNonMeleeSpells(true); + me->RemoveAllAuras(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetHealth(1); - if (me->GetPositionZ() > z) - { - damage = 0; - Phase = SVALADEAD; - me->InterruptNonMeleeSpells(true); - me->RemoveAllAuras(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetHealth(1); - - SetCombatMovement(false); - me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); - me->GetMotionMaster()->MoveFall(z, 1); - } + SetCombatMovement(false); + me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); + me->GetMotionMaster()->MoveFall(POINT_FALL_GROUND); } } void MovementInform(uint32 motionType, uint32 pointId) { - if (motionType != POINT_MOTION_TYPE) + if (motionType != EFFECT_MOTION_TYPE) return; - if (pointId == 1) - { - me->Relocate(x, y, z, me->GetOrientation()); + if (pointId == POINT_FALL_GROUND) me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } } - void JustDied(Unit* killer) + void JustDied(Unit* /*killer*/) { summons.DespawnAll(); @@ -289,15 +285,15 @@ public: Talk(SAY_DEATH); } - - void SpellHitTarget(Unit* target, const SpellInfo* spell) + + void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) { if (spell->Id == SPELL_RITUAL_STRIKE_EFF_1 && Phase != NORMAL && Phase != SVALADEAD) { Phase = NORMAL; SetCombatMovement(true); - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 300, true)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 300.0f, true)) me->GetMotionMaster()->MoveChase(target); } } @@ -339,7 +335,7 @@ public: { std::list<Creature*> lspectatorList; GetCreatureListWithEntryInGrid(lspectatorList, me, CREATURE_SPECTATOR, 100.0f); - for(std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr) + for (std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr) { if ((*itr)->isAlive()) { @@ -406,7 +402,8 @@ public: Phase = NORMAL; break; } - } else introTimer -= diff; + } + else introTimer -= diff; return; } diff --git a/src/server/scripts/Northrend/dalaran.cpp b/src/server/scripts/Northrend/dalaran.cpp index 57007a93fa7..cd3cbf29d0d 100644 --- a/src/server/scripts/Northrend/dalaran.cpp +++ b/src/server/scripts/Northrend/dalaran.cpp @@ -32,7 +32,12 @@ Script Data End */ enum Spells { SPELL_TRESPASSER_A = 54028, - SPELL_TRESPASSER_H = 54029 + SPELL_TRESPASSER_H = 54029, + + SPELL_SUNREAVER_DISGUISE_FEMALE = 70973, + SPELL_SUNREAVER_DISGUISE_MALE = 70974, + SPELL_SILVER_COVENANT_DISGUISE_FEMALE = 70971, + SPELL_SILVER_COVENANT_DISGUISE_MALE = 70972, }; enum NPCs // All outdoor guards are within 35.0f of these NPCs @@ -71,8 +76,10 @@ public: Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself(); - // If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass - if (!player || player->isGameMaster() || player->IsBeingTeleported() || player->HasAura(70973) || player->HasAura(70971)) + if (!player || player->isGameMaster() || player->IsBeingTeleported() || + // If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass + player->HasAura(SPELL_SUNREAVER_DISGUISE_FEMALE) || player->HasAura(SPELL_SUNREAVER_DISGUISE_MALE) || + player->HasAura(SPELL_SILVER_COVENANT_DISGUISE_FEMALE) || player->HasAura(SPELL_SILVER_COVENANT_DISGUISE_MALE)) return; switch (me->GetEntry()) diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index de0c6a909ad..9eb73463795 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -16,115 +16,9 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Grizzly_Hills -SD%Complete: 80 -SDComment: Quest support: 12231, 12247 -SDCategory: Grizzly Hills -EndScriptData */ - -/* ContentData -npc_orsonn_and_kodian -EndContentData */ - #include "ScriptPCH.h" #include "ScriptedEscortAI.h" -#define GOSSIP_ITEM1 "You're free to go Orsonn, but first tell me what's wrong with the furbolg." -#define GOSSIP_ITEM2 "What happened then?" -#define GOSSIP_ITEM3 "Thank you, Son of Ursoc. I'll see what can be done." -#define GOSSIP_ITEM4 "Who was this stranger?" -#define GOSSIP_ITEM5 "Thank you, Kodian. I'll do what I can." - -enum eEnums -{ - GOSSIP_TEXTID_ORSONN1 = 12793, - GOSSIP_TEXTID_ORSONN2 = 12794, - GOSSIP_TEXTID_ORSONN3 = 12796, - - GOSSIP_TEXTID_KODIAN1 = 12797, - GOSSIP_TEXTID_KODIAN2 = 12798, - - NPC_ORSONN = 27274, - NPC_KODIAN = 27275, - - //trigger creatures - NPC_ORSONN_CREDIT = 27322, - NPC_KODIAN_CREDIT = 27321, - - QUEST_CHILDREN_OF_URSOC = 12247, - QUEST_THE_BEAR_GODS_OFFSPRING = 12231 -}; - -class npc_orsonn_and_kodian : public CreatureScript -{ -public: - npc_orsonn_and_kodian() : CreatureScript("npc_orsonn_and_kodian") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_CHILDREN_OF_URSOC) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_THE_BEAR_GODS_OFFSPRING) == QUEST_STATUS_INCOMPLETE) - { - switch (creature->GetEntry()) - { - case NPC_ORSONN: - if (!player->GetReqKillOrCastCurrentCount(QUEST_CHILDREN_OF_URSOC, NPC_ORSONN_CREDIT) || !player->GetReqKillOrCastCurrentCount(QUEST_THE_BEAR_GODS_OFFSPRING, NPC_ORSONN_CREDIT)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN1, creature->GetGUID()); - return true; - } - break; - case NPC_KODIAN: - if (!player->GetReqKillOrCastCurrentCount(QUEST_CHILDREN_OF_URSOC, NPC_KODIAN_CREDIT) || !player->GetReqKillOrCastCurrentCount(QUEST_THE_BEAR_GODS_OFFSPRING, NPC_KODIAN_CREDIT)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_KODIAN1, creature->GetGUID()); - return true; - } - break; - } - } - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN2, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN3, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->CLOSE_GOSSIP_MENU(); - player->TalkedToCreature(NPC_ORSONN_CREDIT, creature->GetGUID()); - break; - - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_KODIAN2, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->CLOSE_GOSSIP_MENU(); - player->TalkedToCreature(NPC_KODIAN_CREDIT, creature->GetGUID()); - break; - } - - return true; - } -}; - /*###### ## Quest 12027: Mr. Floppy's Perilous Adventure ######*/ @@ -801,7 +695,6 @@ public: void AddSC_grizzly_hills() { - new npc_orsonn_and_kodian; new npc_emily; new npc_mrfloppy; new npc_outhouse_bunny; diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp index 28384455616..91522503d65 100644 --- a/src/server/scripts/Northrend/icecrown.cpp +++ b/src/server/scripts/Northrend/icecrown.cpp @@ -115,38 +115,6 @@ public: }; /*###### -## npc_dame_evniki_kapsalis -######*/ - -enum eDameEnvikiKapsalis -{ - TITLE_CRUSADER = 123 -}; - -class npc_dame_evniki_kapsalis : public CreatureScript -{ -public: - npc_dame_evniki_kapsalis() : CreatureScript("npc_dame_evniki_kapsalis") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->HasTitle(TITLE_CRUSADER)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) - { - player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - return true; - } -}; - -/*###### ## npc_squire_david ######*/ @@ -276,65 +244,6 @@ public: }; /*###### -## npc_alorah_and_grimmin -######*/ - -enum ealorah_and_grimmin -{ - SPELL_CHAIN = 68341, - NPC_FJOLA_LIGHTBANE = 36065, - NPC_EYDIS_DARKBANE = 36066, - NPC_PRIESTESS_ALORAH = 36101, - NPC_PRIEST_GRIMMIN = 36102 -}; - -class npc_alorah_and_grimmin : public CreatureScript -{ -public: - npc_alorah_and_grimmin() : CreatureScript("npc_alorah_and_grimmin") { } - - struct npc_alorah_and_grimminAI : public ScriptedAI - { - npc_alorah_and_grimminAI(Creature* creature) : ScriptedAI(creature) {} - - bool uiCast; - - void Reset() - { - uiCast = false; - } - - void UpdateAI(const uint32 /*uiDiff*/) - { - if (uiCast) - return; - uiCast = true; - Creature* target = NULL; - - switch (me->GetEntry()) - { - case NPC_PRIESTESS_ALORAH: - target = me->FindNearestCreature(NPC_EYDIS_DARKBANE, 10.0f); - break; - case NPC_PRIEST_GRIMMIN: - target = me->FindNearestCreature(NPC_FJOLA_LIGHTBANE, 10.0f); - break; - } - if (target) - DoCast(target, SPELL_CHAIN); - - if (!UpdateVictim()) - return; - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_alorah_and_grimminAI(creature); - } -}; - -/*###### ## npc_guardian_pavilion ######*/ @@ -429,10 +338,8 @@ public: void AddSC_icecrown() { new npc_arete; - new npc_dame_evniki_kapsalis; new npc_squire_david; new npc_argent_valiant; - new npc_alorah_and_grimmin; new npc_guardian_pavilion; new npc_vereth_the_cunning; } diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp index 81211b6e3d9..aa63f1adf18 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp @@ -187,7 +187,7 @@ public: //expire movement, will prevent from running right back to victim after cast //(but should MoveChase be used again at a certain time or should he not move?) - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); DoCast(me, SPELL_BLINK); diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index b23b7bcd1ac..c17b6d5baf3 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1982,7 +1982,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence() Akama->GetMotionMaster()->Clear(false); // Akama->GetMotionMaster()->MoveIdle(); Akama->SetPosition(x, y, z, 0.0f); - Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0); // Illidan must not die until Akama arrives. + Akama->MonsterMoveWithSpeed(x, y, z, 0); // Illidan must not die until Akama arrives. Akama->GetMotionMaster()->MoveChase(me); } diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index 33196b1213a..b7604c41794 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -151,7 +151,7 @@ public: m_bPerformingGroundSlam = false; //and correct movement, if not already - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) { if (me->getVictim()) me->GetMotionMaster()->MoveChase(me->getVictim()); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 974d81ef914..a45576f8884 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -820,7 +820,7 @@ class boss_kaelthas : public CreatureScript me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); - me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0); + me->MonsterMoveWithSpeed(afGravityPos[0], afGravityPos[1], afGravityPos[2], 1); me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_FULLPOWER); @@ -887,7 +887,7 @@ class boss_kaelthas : public CreatureScript me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); - me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0); + me->MonsterMoveWithSpeed(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); // 1) Kael'thas will portal the whole raid right into his body for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp index 070c107e61d..ed818fb13be 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp @@ -17,6 +17,9 @@ //! TODO - Boss not scripted, just ported required spellscript from core +#include "ScriptMgr.h" +#include "SpellScript.h" + enum Spells { SPELL_POSITIVE_CHARGE = 39090, diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index 78acd88c894..db95f60f556 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -38,19 +38,18 @@ EndContentData */ enum eMillhouseSays { - SAY_INTRO_1 = -1552010, - SAY_INTRO_2 = -1552011, - SAY_WATER = -1552012, - SAY_BUFFS = -1552013, - SAY_DRINK = -1552014, - SAY_READY = -1552015, - SAY_KILL_1 = -1552016, - SAY_KILL_2 = -1552017, - SAY_PYRO = -1552018, - SAY_ICEBLOCK = -1552019, - SAY_LOWHP = -1552020, - SAY_DEATH = -1552021, - SAY_COMPLETE = -1552022, + SAY_INTRO_1 = 0, + SAY_INTRO_2 = 1, + SAY_WATER = 2, + SAY_BUFFS = 3, + SAY_DRINK = 4, + SAY_READY = 5, + SAY_KILL = 6, + SAY_PYRO = 7, + SAY_ICEBLOCK = 8, + SAY_LOWHP = 9, + SAY_DEATH = 10, + SAY_COMPLETE = 11, }; enum eMillhouseSpells @@ -107,7 +106,7 @@ class npc_millhouse_manastorm : public CreatureScript Init = true; if (instance->GetData(TYPE_HARBINGERSKYRISS) == DONE) - DoScriptText(SAY_COMPLETE, me); + Talk(SAY_COMPLETE); } } @@ -126,12 +125,12 @@ class npc_millhouse_manastorm : public CreatureScript void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); + Talk(SAY_KILL); } void JustDied(Unit* /*victim*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); /*for questId 10886 (heroic mode only) if (instance && instance->GetData(TYPE_HARBINGERSKYRISS) != DONE) @@ -149,30 +148,30 @@ class npc_millhouse_manastorm : public CreatureScript switch (Phase) { case 1: - DoScriptText(SAY_INTRO_1, me); + Talk(SAY_INTRO_1); EventProgress_Timer = 18000; break; case 2: - DoScriptText(SAY_INTRO_2, me); + Talk(SAY_INTRO_2); EventProgress_Timer = 18000; break; case 3: - DoScriptText(SAY_WATER, me); + Talk(SAY_WATER); DoCast(me, SPELL_CONJURE_WATER); EventProgress_Timer = 7000; break; case 4: - DoScriptText(SAY_BUFFS, me); + Talk(SAY_BUFFS); DoCast(me, SPELL_ICE_ARMOR); EventProgress_Timer = 7000; break; case 5: - DoScriptText(SAY_DRINK, me); + Talk(SAY_DRINK); DoCast(me, SPELL_ARCANE_INTELLECT); EventProgress_Timer = 7000; break; case 6: - DoScriptText(SAY_READY, me); + Talk(SAY_READY); EventProgress_Timer = 6000; break; case 7: @@ -192,7 +191,7 @@ class npc_millhouse_manastorm : public CreatureScript return; if (!LowHp && HealthBelowPct(20)) { - DoScriptText(SAY_LOWHP, me); + Talk(SAY_LOWHP); LowHp = true; } @@ -201,7 +200,7 @@ class npc_millhouse_manastorm : public CreatureScript if (me->IsNonMeleeSpellCasted(false)) return; - DoScriptText(SAY_PYRO, me); + Talk(SAY_PYRO); DoCast(me->getVictim(), SPELL_PYROBLAST); Pyroblast_Timer = 40000; @@ -232,14 +231,14 @@ class npc_millhouse_manastorm : public CreatureScript enum eWardenSays { - YELL_INTRO1 = -1552023, - YELL_INTRO2 = -1552024, - YELL_RELEASE1 = -1552025, - YELL_RELEASE2A = -1552026, - YELL_RELEASE2B = -1552027, - YELL_RELEASE3 = -1552028, - YELL_RELEASE4 = -1552029, - YELL_WELCOME = -1552030, + YELL_INTRO1 = 0, + YELL_INTRO2 = 1, + YELL_RELEASE1 = 2, + YELL_RELEASE2A = 3, + YELL_RELEASE2B = 4, + YELL_RELEASE3 = 5, + YELL_RELEASE4 = 6, + YELL_WELCOME = 7, }; enum eWardenUnits @@ -274,10 +273,10 @@ class npc_warden_mellichar : public CreatureScript { public: - npc_warden_mellichar() - : CreatureScript("npc_warden_mellichar") + npc_warden_mellichar() : CreatureScript("npc_warden_mellichar") { } + struct npc_warden_mellicharAI : public ScriptedAI { npc_warden_mellicharAI(Creature* creature) : ScriptedAI(creature) @@ -330,7 +329,7 @@ class npc_warden_mellichar : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(YELL_INTRO1, me); + Talk(YELL_INTRO1); DoCast(me, SPELL_BUBBLE_VISUAL); if (instance) @@ -437,7 +436,7 @@ class npc_warden_mellichar : public CreatureScript me->SummonCreature(ENTRY_MILLHOUSE, 413.292f, -148.378f, 42.56f, 6.27f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); break; case 4: - DoScriptText(YELL_RELEASE2B, me); + Talk(YELL_RELEASE2B); break; case 5: switch (urand(0, 1)) @@ -463,7 +462,7 @@ class npc_warden_mellichar : public CreatureScript break; case 7: me->SummonCreature(ENTRY_SKYRISS, 445.763f, -191.639f, 44.64f, 1.60f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - DoScriptText(YELL_WELCOME, me); + Talk(YELL_WELCOME); break; } CanSpawn = false; @@ -474,17 +473,17 @@ class npc_warden_mellichar : public CreatureScript switch (Phase) { case 1: - DoScriptText(YELL_INTRO2, me); + Talk(YELL_INTRO2); EventProgress_Timer = 10000; ++Phase; break; case 2: - DoScriptText(YELL_RELEASE1, me); + Talk(YELL_RELEASE1); DoPrepareForPhase(); EventProgress_Timer = 7000; break; case 3: - DoScriptText(YELL_RELEASE2A, me); + Talk(YELL_RELEASE2A); DoPrepareForPhase(); EventProgress_Timer = 10000; break; @@ -493,12 +492,12 @@ class npc_warden_mellichar : public CreatureScript EventProgress_Timer = 15000; break; case 5: - DoScriptText(YELL_RELEASE3, me); + Talk(YELL_RELEASE3); DoPrepareForPhase(); EventProgress_Timer = 15000; break; case 6: - DoScriptText(YELL_RELEASE4, me); + Talk(YELL_RELEASE4); DoPrepareForPhase(); EventProgress_Timer = 15000; break; @@ -524,14 +523,16 @@ class npc_warden_mellichar : public CreatureScript # mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0') #####*/ -#define SPELL_VOID_ZONE_DAMAGE 36120 +enum ZerekethSpell +{ + SPELL_VOID_ZONE_DAMAGE = 36120, +}; class mob_zerekethvoidzone : public CreatureScript { public: - mob_zerekethvoidzone() - : CreatureScript("mob_zerekethvoidzone") + mob_zerekethvoidzone() : CreatureScript("mob_zerekethvoidzone") { } struct mob_zerekethvoidzoneAI : public ScriptedAI @@ -555,10 +556,10 @@ class mob_zerekethvoidzone : public CreatureScript return new mob_zerekethvoidzoneAI(creature); } }; + void AddSC_arcatraz() { new npc_millhouse_manastorm(); new npc_warden_mellichar(); new mob_zerekethvoidzone(); } - diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 38e5771ccca..2b31a50510d 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1445,7 +1445,17 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader if (GetUnitOwner()->GetTypeId() != TYPEID_PLAYER) return; - LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*(sLFGMgr->GetSelectedDungeons(GetUnitOwner()->GetGUID()).begin())); + const LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(GetUnitOwner()->GetGUID()); + LfgDungeonSet::const_iterator itr = dungeons.begin(); + + if (itr == dungeons.end()) + { + Remove(AURA_REMOVE_BY_DEFAULT); + return; + } + + + LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*itr); Group* group = GetUnitOwner()->ToPlayer()->GetGroup(); Map const* map = GetUnitOwner()->GetMap(); if (group && group->isLFGGroup()) @@ -1471,6 +1481,82 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader } }; +enum DalaranDisguiseSpells +{ + SPELL_SUNREAVER_DISGUISE_TRIGGER = 69672, + SPELL_SUNREAVER_DISGUISE_FEMALE = 70973, + SPELL_SUNREAVER_DISGUISE_MALE = 70974, + + SPELL_SILVER_COVENANT_DISGUISE_TRIGGER = 69673, + SPELL_SILVER_COVENANT_DISGUISE_FEMALE = 70971, + SPELL_SILVER_COVENANT_DISGUISE_MALE = 70972, +}; + +class spell_gen_dalaran_disguise : public SpellScriptLoader +{ + public: + spell_gen_dalaran_disguise(const char* name) : SpellScriptLoader(name) {} + + class spell_gen_dalaran_disguise_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_dalaran_disguise_SpellScript); + bool Validate(SpellInfo const* spellEntry) + { + switch (spellEntry->Id) + { + case SPELL_SUNREAVER_DISGUISE_TRIGGER: + if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE)) + return false; + break; + case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER: + if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE)) + return false; + break; + } + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + + if (Player* player = GetHitPlayer()) + { + uint8 gender = player->getGender(); + + uint32 spellId = GetSpellInfo()->Id; + + switch (spellId) + { + case SPELL_SUNREAVER_DISGUISE_TRIGGER: + spellId = gender ? SPELL_SUNREAVER_DISGUISE_FEMALE : SPELL_SUNREAVER_DISGUISE_MALE; + break; + case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER: + spellId = gender ? SPELL_SILVER_COVENANT_DISGUISE_FEMALE : SPELL_SILVER_COVENANT_DISGUISE_MALE; + break; + default: + break; + } + + GetCaster()->CastSpell(player, spellId, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_dalaran_disguise_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_dalaran_disguise_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -1504,4 +1590,6 @@ void AddSC_generic_spell_scripts() new spell_gen_oracle_wolvar_reputation(); new spell_gen_damage_reduction_aura(); new spell_gen_luck_of_the_draw(); + new spell_gen_dalaran_disguise("spell_gen_sunreaver_disguise"); + new spell_gen_dalaran_disguise("spell_gen_silver_covenant_disguise"); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 5a0ffbd2c90..b40879d500e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1128,6 +1128,51 @@ class spell_magic_eater_food : public SpellScriptLoader } }; +enum Refocus +{ + SPELL_AIMED_SHOT = 19434, + SPELL_MULTISHOT = 2643, + SPELL_VOLLEY = 42243, +}; + +class spell_item_refocus : public SpellScriptLoader +{ + public: + spell_item_refocus() : SpellScriptLoader("spell_item_refocus") { } + + class spell_item_refocus_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_refocus_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + + if (!caster || caster->getClass() != CLASS_HUNTER) + return; + + if (caster->HasSpellCooldown(SPELL_AIMED_SHOT)) + caster->RemoveSpellCooldown(SPELL_AIMED_SHOT, true); + + if (caster->HasSpellCooldown(SPELL_MULTISHOT)) + caster->RemoveSpellCooldown(SPELL_MULTISHOT, true); + + if (caster->HasSpellCooldown(SPELL_VOLLEY)) + caster->RemoveSpellCooldown(SPELL_VOLLEY, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_refocus_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_refocus_SpellScript(); + } +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -1160,4 +1205,5 @@ void AddSC_item_spell_scripts() new spell_item_ashbringer(); new spell_magic_eater_food(); + new spell_item_refocus(); } diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp index d562542a7d7..9bc511931b9 100644 --- a/src/server/scripts/World/guards.cpp +++ b/src/server/scripts/World/guards.cpp @@ -179,7 +179,7 @@ public: globalCooldown = GENERIC_CREATURE_COOLDOWN; } //If no spells available and we arn't moving run to target - else if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + else if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) { //Cancel our current spell and then mutate new movement generator me->InterruptNonMeleeSpells(false); |