diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b77bcc..569bf59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,22 +54,22 @@ if(PCH) ) endif() -add_library(mangosscript SHARED +add_library(mangosscriptR2 SHARED ${mangosscript_SRCS} ) if(WIN32) - target_link_libraries(mangosscript + target_link_libraries(mangosscriptR2 mangosd # FIXME: could this be done for unix? because unix won't generate exe.libs ${ACE_LIBRARIES} debug ${WIN_DEBUGLIBS} ) endif() -add_dependencies(mangosscript revision.h) +add_dependencies(mangosscriptR2 revision.h) if(NOT ACE_USE_EXTERNAL) - add_dependencies(mangosscript ACE_Project) -# add_dependencies(mangosscript ace) + add_dependencies(mangosscriptR2 ACE_Project) +# add_dependencies(mangosscriptR2 ace) endif() if(UNIX) @@ -92,7 +92,7 @@ if(UNIX) BUILD_WITH_INSTALL_RPATH OFF ) - set_target_properties(mangosscript PROPERTIES + set_target_properties(mangosscriptR2 PROPERTIES LINK_FLAGS ${mangosscript_LINK_FLAGS} ${mangosscript_PROPERTIES} ) @@ -100,7 +100,7 @@ endif() # Because size for linker is to big - seriously ?! if(WIN32) - set_target_properties(mangosscript PROPERTIES + set_target_properties(mangosscriptR2 PROPERTIES LINK_FLAGS_DEBUG "/DEBUG /INCREMENTAL:NO" ) endif() @@ -128,14 +128,14 @@ if(PCH) if(MSVC) set(mangosscript_pch "${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.cpp") endif() - add_native_precompiled_header(mangosscript ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h) + add_native_precompiled_header(mangosscriptR2 ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h) elseif(CMAKE_COMPILER_IS_GNUCXX) - add_precompiled_header(mangosscript ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h) + add_precompiled_header(mangosscriptR2 ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h) endif() endif() # LIBRARY = dyld / so, RUNTIME = dll -install(TARGETS mangosscript +install(TARGETS mangosscriptR2 LIBRARY DESTINATION ${LIBS_DIR} RUNTIME DESTINATION ${LIBS_DIR} ) diff --git a/ScriptMgr.cpp b/ScriptMgr.cpp index 261f200..ea27fc6 100644 --- a/ScriptMgr.cpp +++ b/ScriptMgr.cpp @@ -113,7 +113,8 @@ void InitScriptLibrary() outstring_log(" MM M M MMMM"); outstring_log("MM M M M "); outstring_log(" MMM MMM http://www.scriptdev2.com"); - outstring_log(""); + outstring_log("R2 modifications included (https://github.com/mangosR2/scriptdev2)"); + outstring_log(_VERSION); // Get configuration file if (!SD2Config.SetSource(_SCRIPTDEV2_CONFIG)) diff --git a/VC100/100ScriptDev2.vcxproj b/VC100/100ScriptDev2.vcxproj index d6e0df8..82044a8 100644 --- a/VC100/100ScriptDev2.vcxproj +++ b/VC100/100ScriptDev2.vcxproj @@ -87,10 +87,10 @@ AllRules.ruleset - mangosscript - mangosscript - mangosscript - mangosscript + mangosscriptR2 + mangosscriptR2 + mangosscriptR2 + mangosscriptR2 @@ -116,7 +116,7 @@ false - $(OutDir)mangosscript.lib + $(OutDir)mangosscriptR2.lib MachineX86 @@ -147,7 +147,7 @@ false - $(OutDir)mangosscript.lib + $(OutDir)mangosscriptR2.lib MachineX64 @@ -176,7 +176,7 @@ false - $(OutDir)mangosscript.lib + $(OutDir)mangosscriptR2.lib @@ -206,7 +206,7 @@ false - $(OutDir)mangosscript.lib + $(OutDir)mangosscriptR2.lib @@ -221,6 +221,7 @@ + diff --git a/VC90/90ScriptDev2.vcproj b/VC90/90ScriptDev2.vcproj index a75ff19..1ecd3fd 100644 --- a/VC90/90ScriptDev2.vcproj +++ b/VC90/90ScriptDev2.vcproj @@ -69,15 +69,15 @@ + + +/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ #include "precompiled.h" @@ -153,7 +153,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget switch (pSpell->m_CastTarget) { - case DO_NOTHING: + case DO_NOTHING: result = CAST_OK; break; @@ -191,7 +191,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget break; case APPLY_AURA_TARGET: - if (!pTarget || !pTarget->IsInMap(m_creature)) + if (!pTarget || !pTarget->IsInMap(m_creature)) { result = CAST_FAIL_OTHER; break; @@ -231,7 +231,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget pTarget = itr->getSource(); if (pTarget && pTarget->isAlive() && pTarget->IsWithinDistInMap(m_creature, pSpell->LocData.x)) { - if (!pSpell->m_IsBugged) + if (!pSpell->m_IsBugged) { m_creature->CastSpell(pTarget, pSpell->m_uiSpellEntry[currentDifficulty], false); } @@ -258,7 +258,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget case CAST_ON_RANDOM_POINT: if (!pTarget) pTarget = m_creature; - if (pSpell->LocData.z <= 1.0f) + if (pSpell->LocData.z <= 1.0f) { float fPosX, fPosY, fPosZ; if (!pTarget->IsPositionValid() || !pTarget->IsInMap(m_creature)) @@ -510,7 +510,7 @@ Unit* BSWScriptedAI::_doSummon(uint8 m_uiSpellIdx, TempSummonType summontype, ui debug_log("BSW: Summoning creature number %u type %u despawn delay %u",pSpell->m_uiSpellEntry[currentDifficulty], pSpell->m_CastTarget, delay); - if (pSpell->LocData.z <= 1.0f) + if (pSpell->LocData.z <= 1.0f) { float fPosX, fPosY, fPosZ; if (!m_creature->IsPositionValid()) @@ -529,7 +529,7 @@ Unit* BSWScriptedAI::_doSummonAtPosition(uint8 m_uiSpellIdx, float fPosX, float { BSWRecord* pSpell = &m_BSWRecords[m_uiSpellIdx]; - switch (pSpell->m_CastTarget) + switch (pSpell->m_CastTarget) { case SUMMON_NORMAL: return _doSummonAtPosition(pSpell->m_uiSpellEntry[currentDifficulty], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 0, fPosX, fPosY, fPosZ); @@ -749,7 +749,7 @@ bool BSWScriptedAI::_doAura(uint32 SpellID, Unit* pTarget, SpellEffectIndex inde if (isStack) holder->ModStackAmount(1); } - else + else { aura = CreateAura(spell, index, &_basepoint, holder, pTarget); holder->SetAuraDuration(aura->GetAuraMaxDuration()); diff --git a/base/BSW_ai.h b/base/BSW_ai.h index c9f2c57..030e0e7 100644 --- a/base/BSW_ai.h +++ b/base/BSW_ai.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 - 2010 by /dev/rsa for ScriptDev2 +/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/base/BSW_instance.cpp b/base/BSW_instance.cpp index 8eed586..0ca2b0f 100644 --- a/base/BSW_instance.cpp +++ b/base/BSW_instance.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 - 2010 by /dev/rsa for ScriptDev2 +/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/base/BSW_instance.h b/base/BSW_instance.h index 9c8f85e..c742b48 100644 --- a/base/BSW_instance.h +++ b/base/BSW_instance.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 - 2010 by /dev/rsa for ScriptDev2 +/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/base/escort_ai.cpp b/base/escort_ai.cpp index e7471fa..81e9b41 100644 --- a/base/escort_ai.cpp +++ b/base/escort_ai.cpp @@ -363,11 +363,7 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) { debug_log("SD2: EscortAI has returned to original position before combat"); - if (m_bIsRunning && m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE)) - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); - else if (!m_bIsRunning && !m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE)) - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); - + m_creature->SetWalk(!m_bIsRunning); RemoveEscortState(STATE_ESCORT_RETURNING); if (!m_uiWPWaitTimer) @@ -425,23 +421,27 @@ void npc_escortAI::FillPointMovementListForCreature() void npc_escortAI::SetCurrentWaypoint(uint32 uiPointId) { - if (!(HasEscortState(STATE_ESCORT_PAUSED))) // only when paused - return; - - if (uiPointId >= WaypointList.size()) // too high number + if (!(HasEscortState(STATE_ESCORT_PAUSED))) // Only when paused return; - if (uiPointId == CurrentWP->uiId) // already here + if (uiPointId == CurrentWP->uiId) // Already here return; - CurrentWP = WaypointList.begin(); // set to begin (can't -- backwards in itr list) - - while(uiPointId != CurrentWP->uiId) + bool bFoundWaypoint = false; + for (std::list::iterator itr = WaypointList.begin(); itr != WaypointList.end(); ++itr) { - ++CurrentWP; - - if (CurrentWP == WaypointList.end()) + if (itr->uiId == uiPointId) + { + CurrentWP = itr; // Set to found itr + bFoundWaypoint = true; break; + } + } + + if (!bFoundWaypoint) + { + debug_log("SD2: EscortAI current waypoint tried to set to id %u, but doesn't exist in WaypointList", uiPointId); + return; } m_uiWPWaitTimer = 1; @@ -454,14 +454,14 @@ void npc_escortAI::SetRun(bool bRun) if (bRun) { if (!m_bIsRunning) - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); else debug_log("SD2: EscortAI attempt to set run mode, but is already running."); } else { if (m_bIsRunning) - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); else debug_log("SD2: EscortAI attempt to set walk mode, but is already walking."); } @@ -521,8 +521,7 @@ void npc_escortAI::Start(bool bRun, const Player* pPlayer, const Quest* pQuest, CurrentWP = WaypointList.begin(); //Set initial speed - if (m_bIsRunning) - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(!m_bIsRunning); AddEscortState(STATE_ESCORT_ESCORTING); diff --git a/base/follower_ai.cpp b/base/follower_ai.cpp index 846bd05..2413617 100644 --- a/base/follower_ai.cpp +++ b/base/follower_ai.cpp @@ -308,7 +308,7 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const m_creature->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - debug_log("SD2: FollowerAI start follow %s (Guid %s)", pLeader->GetName(), m_leaderGuid.GetString().c_str()); + debug_log("SD2: FollowerAI start follow %s (%u)", pLeader ? pLeader->GetName() : "", m_leaderGuid.GetCounter()); } Player* FollowerAI::GetLeaderForFollower() diff --git a/config.h b/config.h index 8e75e1b..800d917 100644 --- a/config.h +++ b/config.h @@ -22,6 +22,7 @@ #include "Platform/CompilerDefs.h" #include "revision.h" #include "sd2_revision_nr.h" +#include "sd2_revision_R2.h" // Format is YYYYMMDDRR where RR is the change in the conf file // for that day. @@ -36,7 +37,7 @@ #endif #ifndef _VERSION - #define _VERSION "Revision [" SD2_REVISION_NR "] (" REVISION_ID ") " REVISION_DATE " " REVISION_TIME " /dev/rsa branch" + #define _VERSION "Revision [" SD2_REVISION_NR "] Revision R2 [" SD2_REVISION_R2 "] (" REVISION_ID ") " REVISION_DATE " " REVISION_TIME #endif // The path to config files diff --git a/include/sc_creature.cpp b/include/sc_creature.cpp index 16c6770..4a1a6d2 100644 --- a/include/sc_creature.cpp +++ b/include/sc_creature.cpp @@ -20,11 +20,13 @@ ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature), m_uiEvadeCheckCooldown(2500) {} +/// This function shows if combat movement is enabled, overwrite for more info void ScriptedAI::GetAIInformation(ChatHandler& reader) { reader.PSendSysMessage("ScriptedAI, combat movement is %s", reader.GetOnOffStr(m_bCombatMovement)); } +/// Return if the creature can "see" pWho bool ScriptedAI::IsVisible(Unit* pWho) const { if (!pWho) @@ -33,6 +35,15 @@ bool ScriptedAI::IsVisible(Unit* pWho) const return m_creature->IsWithinDist(pWho, VISIBLE_RANGE) && pWho->isVisibleForOrDetect(m_creature, m_creature, true); } +/** + * This function triggers the creature attacking pWho, depending on conditions like: + * - Can the creature start an attack? + * - Is pWho hostile to the creature? + * - Can the creature reach pWho? + * - Is pWho in aggro-range? + * If the creature can attack pWho, it will if it has no victim. + * Inside dungeons, the creature will get into combat with pWho, even if it has already a victim + */ void ScriptedAI::MoveInLineOfSight(Unit* pWho) { if (m_creature->CanInitiateAttack() && pWho->isTargetableForAttack() && @@ -57,9 +68,13 @@ void ScriptedAI::MoveInLineOfSight(Unit* pWho) } } +/** + * This function sets the TargetGuid for the creature if required + * Also it will handle the combat movement (chase movement), depending on SetCombatMovement(bool) + */ void ScriptedAI::AttackStart(Unit* pWho) { - if (pWho && m_creature->Attack(pWho, true)) + if (pWho && m_creature->Attack(pWho, true)) // The Attack function also uses basic checks if pWho can be attacked { m_creature->AddThreat(pWho); m_creature->SetInCombatWith(pWho); @@ -70,16 +85,21 @@ void ScriptedAI::AttackStart(Unit* pWho) } } +/** + * This function only calls Aggro, which is to be used for scripting purposes + */ void ScriptedAI::EnterCombat(Unit* pEnemy) { if (pEnemy) Aggro(pEnemy); } -void ScriptedAI::Aggro(Unit* pEnemy) -{ -} - +/** + * Main update function, by default let the creature behave as expected by a mob (threat management and melee dmg) + * Always handle here threat-management with m_creature->SelectHostileTarget() + * Handle (if required) melee attack with DoMeleeAttackIfReady() + * This is usally overwritten to support timers for ie spells + */ void ScriptedAI::UpdateAI(const uint32 uiDiff) { //Check if we have a current target @@ -89,6 +109,16 @@ void ScriptedAI::UpdateAI(const uint32 uiDiff) DoMeleeAttackIfReady(); } +/** + * This function cleans up the combat state if the creature evades + * It will: + * - Drop Auras + * - Drop all threat + * - Stop combat + * - Move the creature home + * - Clear tagging for loot + * - call Reset() + */ void ScriptedAI::EnterEvadeMode() { m_creature->RemoveAllAuras(); @@ -104,6 +134,7 @@ void ScriptedAI::EnterEvadeMode() Reset(); } +/// This function calls Reset() to reset variables as expected void ScriptedAI::JustRespawned() { Reset(); diff --git a/include/sc_creature.h b/include/sc_creature.h index b63560d..fc031f8 100644 --- a/include/sc_creature.h +++ b/include/sc_creature.h @@ -40,135 +40,184 @@ enum SCEquip EQUIP_UNEQUIP = 0 }; +/// Documentation of CreatureAI functions can be found in MaNGOS source +// Only list them here again to ensure that the interface between SD2 and the core is not changed unnoticed struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI { - explicit ScriptedAI(Creature* pCreature); - ~ScriptedAI() {} + public: + explicit ScriptedAI(Creature* pCreature); + ~ScriptedAI() {} - //************* - //CreatureAI Functions - //************* + // ************* + // CreatureAI Functions + // ************* - void GetAIInformation(ChatHandler& reader); + // == Information about AI ======================== + // Get information about the AI + void GetAIInformation(ChatHandler& reader) override; + + // == Reactions At ================================= + + // Called if IsVisible(Unit* pWho) is true at each relative pWho move + void MoveInLineOfSight(Unit* pWho) override; + + // Called for reaction at enter to combat if not in combat yet (enemy can be NULL) + void EnterCombat(Unit* pEnemy) override; + + // Called at stoping attack by any attacker + void EnterEvadeMode() override; + + // Called when reached home after MoveTargetHome (in evade) + void JustReachedHome() override {} + + // Called at any heal cast/item used (call non implemented in mangos) + // void HealBy(Unit* pHealer, uint32 uiAmountHealed) override {} + + // Called at any Damage to any victim (before damage apply) + void DamageDeal(Unit* pDoneTo, uint32& uiDamage) override {} + + // Called at any Damage from any attacker (before damage apply) + void DamageTaken(Unit* pDealer, uint32& uiDamage) override {} + + // Called at creature death + void JustDied(Unit* pKiller) override {} + + // Called when the corpse of this creature gets removed + void CorpseRemoved(uint32& uiRespawnDelay) override {} + + // Called when a summoned creature is killed + void SummonedCreatureJustDied(Creature* pSummoned) {} + + // Called at creature killing another unit + void KilledUnit(Unit* pVictim) override {} - //Called if IsVisible(Unit *who) is true at each *who move - void MoveInLineOfSight(Unit*); + // Called when owner of m_creature (if m_creature is PROTECTOR_PET) kills a unit + void OwnerKilledUnit(Unit* pVictim) override {} - //Called at each attack of m_creature by any victim - void AttackStart(Unit*); + // Called when the creature successfully summons a creature + void JustSummoned(Creature* pSummoned) override {} - // Called for reaction at enter to combat if not in combat yet (enemy can be NULL) - void EnterCombat(Unit*); + // Called when the creature successfully summons a gameobject + void JustSummoned(GameObject* pGo) override {} - //Called at stoping attack by any attacker - void EnterEvadeMode(); + // Called when a summoned creature gets TemporarySummon::UnSummon ed + void SummonedCreatureDespawn(Creature* pSummoned) override {} - //Called at any heal cast/item used (call non implemented in mangos) - void HealBy(Unit* pHealer, uint32 uiAmountHealed) {} + // Called when hit by a spell + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) override {} - // Called at any Damage to any victim (before damage apply) - void DamageDeal(Unit* pDoneTo, uint32& uiDamage) {} + // Called when spell hits creature's target + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) override {} - // Called at any Damage from any attacker (before damage apply) - void DamageTaken(Unit* pDoneBy, uint32& uiDamage) {} + // Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc) + /// This will by default result in reattacking, if the creature has no victim + void AttackedBy(Unit* pAttacker) override { CreatureAI::AttackedBy(pAttacker); } - //Is unit visible for MoveInLineOfSight - bool IsVisible(Unit* pWho) const; + // Called when creature is respawned (for reseting variables) + void JustRespawned() override; - //Called at World update tick - void UpdateAI(const uint32); + // Called at waypoint reached or point movement finished + void MovementInform(uint32 uiMovementType, uint32 uiData) override {} - //Called at creature death - void JustDied(Unit*) {} + // Called if a temporary summoned of m_creature reach a move point + void SummonedMovementInform(Creature* pSummoned, uint32 uiMotionType, uint32 uiData) override {} - //Called at creature killing another unit - void KilledUnit(Unit*) {} + // Called at text emote receive from player + void ReceiveEmote(Player* pPlayer, uint32 uiEmote) override {} - // Called when the creature summon successfully other creature - void JustSummoned(Creature*) {} + // Called at each attack of m_creature by any victim + void AttackStart(Unit* pWho) override; - // Called when a summoned creature is despawned - void SummonedCreatureDespawn(Creature*) {} + // Called at World update tick + void UpdateAI(const uint32) override; - // Called when hit by a spell - void SpellHit(Unit*, const SpellEntry*) {} + // == State checks ================================= - // Called when creature is spawned or respawned (for reseting variables) - void JustRespawned(); + // Check if unit is visible for MoveInLineOfSight + bool IsVisible(Unit* pWho) const override; - //Called at waypoint reached or PointMovement end - void MovementInform(uint32, uint32) {} + // Called when victim entered water and creature can not enter water + bool canReachByRangeAttack(Unit* pWho) override { return CreatureAI::canReachByRangeAttack(pWho); } - //************* - // Variables - //************* + // ************* + // Variables + // ************* - //************* - //Pure virtual functions - //************* + // ************* + // Pure virtual functions + // ************* - //Called at creature reset either by death or evade - virtual void Reset() = 0; + /** + * This is a SD2 internal function, that every AI must implement + * Usally used to reset combat variables + * Called by default on creature evade and respawn + * In most scripts also called in the constructor of the AI + */ + virtual void Reset() = 0; - //Called at creature EnterCombat - virtual void Aggro(Unit*); + /// Called at creature EnterCombat with an enemy + /** + * This is a SD2 internal function + * Called by default on creature EnterCombat with an enemy + */ + virtual void Aggro(Unit*) {} - //************* - //AI Helper Functions - //************* + // ************* + // AI Helper Functions + // ************* - //Start movement toward victim - void DoStartMovement(Unit* pVictim, float fDistance = 0, float fAngle = 0); + // Start movement toward victim + void DoStartMovement(Unit* pVictim, float fDistance = 0, float fAngle = 0); - //Start no movement on victim - void DoStartNoMovement(Unit* pVictim); + // Start no movement on victim + void DoStartNoMovement(Unit* pVictim); - //Stop attack of current victim - void DoStopAttack(); + // Stop attack of current victim + void DoStopAttack(); - //Cast spell by Id - void DoCast(Unit* pTarget, uint32 uiSpellId, bool bTriggered = false); + // Cast spell by Id + void DoCast(Unit* pTarget, uint32 uiSpellId, bool bTriggered = false); - //Cast spell by spell info - void DoCastSpell(Unit* pTarget, SpellEntry const* pSpellInfo, bool bTriggered = false); + // Cast spell by spell info + void DoCastSpell(Unit* pTarget, SpellEntry const* pSpellInfo, bool bTriggered = false); - //Plays a sound to all nearby players - void DoPlaySoundToSet(WorldObject* pSource, uint32 uiSoundId); + // Plays a sound to all nearby players + void DoPlaySoundToSet(WorldObject* pSource, uint32 uiSoundId); - //Drops all threat to 0%. Does not remove players from the threat list - void DoResetThreat(); + // Drops all threat to 0%. Does not remove enemies from the threat list + void DoResetThreat(); - //Teleports a player without dropping threat (only teleports to same map) - void DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, float fO); + // Teleports a player without dropping threat (only teleports to same map) + void DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, float fO); - //Returns friendly unit with the most amount of hp missing from max hp - Unit* DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff = 1); + // Returns friendly unit with the most amount of hp missing from max hp + Unit* DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff = 1); - //Returns a list of friendly CC'd units within range - std::list DoFindFriendlyCC(float fRange); + // Returns a list of friendly CC'd units within range + std::list DoFindFriendlyCC(float fRange); - //Returns a list of all friendly units missing a specific buff within range - std::list DoFindFriendlyMissingBuff(float fRange, uint32 uiSpellId); + // Returns a list of all friendly units missing a specific buff within range + std::list DoFindFriendlyMissingBuff(float fRange, uint32 uiSpellId); - //Return a player with at least minimumRange from m_creature - Player* GetPlayerAtMinimumRange(float fMinimumRange); + // Return a player with at least minimumRange from m_creature + Player* GetPlayerAtMinimumRange(float fMinimumRange); - //Spawns a creature relative to m_creature - Creature* DoSpawnCreature(uint32 uiId, float fX, float fY, float fZ, float fAngle, uint32 uiType, uint32 uiDespawntime); + // Spawns a creature relative to m_creature + Creature* DoSpawnCreature(uint32 uiId, float fX, float fY, float fZ, float fAngle, uint32 uiType, uint32 uiDespawntime); - //Returns spells that meet the specified criteria from the creatures spell list - SpellEntry const* SelectSpell(Unit* pTarget, int32 uiSchool, int32 uiMechanic, SelectTarget selectTargets, uint32 uiPowerCostMin, uint32 uiPowerCostMax, float fRangeMin, float fRangeMax, SelectEffect selectEffect); + // Returns spells that meet the specified criteria from the creatures spell list + SpellEntry const* SelectSpell(Unit* pTarget, int32 uiSchool, int32 uiMechanic, SelectTarget selectTargets, uint32 uiPowerCostMin, uint32 uiPowerCostMax, float fRangeMin, float fRangeMax, SelectEffect selectEffect); - //Checks if you can cast the specified spell - bool CanCast(Unit* pTarget, SpellEntry const* pSpell, bool bTriggered = false); + // Checks if you can cast the specified spell + bool CanCast(Unit* pTarget, SpellEntry const* pSpell, bool bTriggered = false); - void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE); + void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE); - //Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures does not chase victims - void SetCombatMovement(bool bCombatMove); - bool IsCombatMovement() { return m_bCombatMovement; } + // Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures do not chase victims + void SetCombatMovement(bool bCombatMove); + bool IsCombatMovement() { return m_bCombatMovement; } - bool EnterEvadeIfOutOfCombatArea(const uint32 uiDiff); + bool EnterEvadeIfOutOfCombatArea(const uint32 uiDiff); private: bool m_bCombatMovement; @@ -181,8 +230,8 @@ struct MANGOS_DLL_DECL Scripted_NoMovementAI : public ScriptedAI void GetAIInformation(ChatHandler& reader); - //Called at each attack of m_creature by any victim - void AttackStart(Unit*); + // Called at each attack of m_creature by any victim + void AttackStart(Unit* pWho); }; #endif diff --git a/include/sc_gossip.h b/include/sc_gossip.h index f9b863f..da7e43b 100644 --- a/include/sc_gossip.h +++ b/include/sc_gossip.h @@ -140,7 +140,9 @@ extern uint32 GetSkillLevel(Player* pPlayer, uint32 uiSkill); #define ADD_GOSSIP_ITEM_ID(uiIcon, iTextId, uiSender, uiOptionId) PlayerTalkClass->GetGossipMenu().AddMenuItem(uiIcon, iTextId, uiSender, uiOptionId, 0, 0) #define ADD_GOSSIP_ITEM_EXTENDED(uiIcon, chrText, uiSender, uiOptionId, chrBoxMessage, uiBoxMoney, bCode) PlayerTalkClass->GetGossipMenu().AddMenuItem(uiIcon, chrText, uiSender, uiOptionId, chrBoxMessage, uiBoxMoney, bCode) -// This fuction Sends the current menu to show to client, uiTextId - NPCTEXTID(uint32) , uiGuid - npc guid(ObjectGuid) +// This fuction Sends the current menu to show to client +// uiTextId - NPCTEXTID (uint32) +// guid - npc guid (ObjectGuid) #define SEND_GOSSIP_MENU(uiTextId, guid) PlayerTalkClass->SendGossipMenu(uiTextId, guid) // This fuction shows POI(point of interest) to client. @@ -155,34 +157,25 @@ extern uint32 GetSkillLevel(Player* pPlayer, uint32 uiSkill); // Closes the Menu #define CLOSE_GOSSIP_MENU() PlayerTalkClass->CloseGossip() -// Fuction to tell to client the details -// a - quest object -// b - npc guid(uint64) -// c - Activate accept(bool) -#define SEND_QUEST_DETAILS(a, b, c) PlayerTalkClass->SendQuestDetails(a, b, c) - -// Fuction to tell to client the requested items to complete quest -// a - quest object -// b - npc guid(uint64) -// c - Iscompletable(bool) -// d - close at cancel(bool) - in case single incomplite ques -#define SEND_REQUESTEDITEMS(a, b, c, d) PlayerTalkClass->SendRequestedItems(a, b, c, d) - -// Fuctions to send NPC lists, a - is always the npc guid(uint64) +// Fuctions to send NPC lists +// a - is always the npc guid (ObjectGuid) #define SEND_VENDORLIST(a) GetSession()->SendListInventory(a) #define SEND_TRAINERLIST(a) GetSession()->SendTrainerList(a) #define SEND_BANKERLIST(a) GetSession()->SendShowBank(a) #define SEND_TABARDLIST(a) GetSession()->SendTabardVendorActivate(a) #define SEND_TAXILIST(a) GetSession()->SendTaxiStatus(a) -// Function to send the Auction List, a - npc guid(uint64), b - pointer to npc(Creature*) -#define SEND_AUCTIONLIST(a, b) GetSession()->SendAuctionHello(a, b) +// Function to send the Auction List +// a - pointer to unit (Unit*) +#define SEND_AUCTIONLIST(a) GetSession()->SendAuctionHello(a) // Ressurect's the player if is dead. #define SEND_SPRESURRECT() GetSession()->SendSpiritResurrect() -// ----------------------------------- - -// defined fuctions to use with Creature +// Function to send the Quest Dialogue Status +// a - pointer to player (Player*) +// b - pointer to questgiver (Object*) +// c - defstatus (uint32) #define QUEST_DIALOG_STATUS(a, b, c) GetSession()->getDialogStatus(a, b, c) + #endif diff --git a/include/sc_grid_searchers.cpp b/include/sc_grid_searchers.cpp index b97c117..eca0f0a 100644 --- a/include/sc_grid_searchers.cpp +++ b/include/sc_grid_searchers.cpp @@ -4,6 +4,17 @@ #include "precompiled.h" + +//return closest attackable Unit in grid, with range from pSource +Unit* GetClosestAttackableUnit(Unit* pSource, float fMaxSearchRange) +{ + Unit* pTarget = NULL; + MaNGOS::NearestAttackableUnitInObjectRangeCheck unit_check(pSource, pSource, fMaxSearchRange); + MaNGOS::UnitLastSearcher searcher(pTarget, unit_check); + Cell::VisitAllObjects(pSource, searcher, fMaxSearchRange); + return pTarget; +} + //return closest GO in grid, with range from pSource GameObject* GetClosestGameObjectWithEntry(WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange) { diff --git a/include/sc_grid_searchers.h b/include/sc_grid_searchers.h index c6f0336..da617de 100644 --- a/include/sc_grid_searchers.h +++ b/include/sc_grid_searchers.h @@ -37,6 +37,7 @@ struct ObjectDistanceOrderReversed : public std::binary_functionGetPlayers(); + + if (!lPlayers.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + if (pPlayer->GetItemCount(uiItemId,true) > 0) + pPlayer->DestroyItemCount(uiItemId,pPlayer->GetItemCount(uiItemId),true); + } + } + else + error_log("SD2: DestroyItemFromAllPlayers attempt to remove item: %u but no players in map.", uiItemId); +} diff --git a/include/sc_instance.h b/include/sc_instance.h index 95c9e92..dd54ff9 100644 --- a/include/sc_instance.h +++ b/include/sc_instance.h @@ -50,6 +50,9 @@ class MANGOS_DLL_DECL ScriptedInstance : public InstanceData // Get a Player from map Player* GetPlayerInMap(bool bOnlyAlive = false, bool bCanBeGamemaster = true); + // destroys an item from all players in this instance (encounters like Vashj, Najentus....) + void DestroyItemFromAllPlayers(uint32 uiItemId); + /// Wrapper for simulating map-wide text in this instance. It is expected that the Creature is stored in m_mNpcEntryGuidStore if loaded. void DoOrSimulateScriptTextForThisInstance(int32 iTextEntry, uint32 uiCreatureEntry) { diff --git a/revision.h b/revision.h index fa9c2eb..3dee36c 100644 --- a/revision.h +++ b/revision.h @@ -1,6 +1,6 @@ #ifndef __REVISION_H__ #define __REVISION_H__ - #define REVISION_ID "148 at /dev/rsa branch" + #define REVISION_ID "148" #define REVISION_DATE "2011-08-05" #define REVISION_TIME "15:46:38" #endif // __REVISION_H__ diff --git a/scripts/custom/teleguy.cpp b/scripts/custom/teleguy.cpp index 411e226..c4da7d6 100644 --- a/scripts/custom/teleguy.cpp +++ b/scripts/custom/teleguy.cpp @@ -4,34 +4,37 @@ int costo; bool GossipHello_mob_teleguy(Player *player, Creature *_Creature) { - if ( player->GetTeam() == ALLIANCE ) { - player->ADD_GOSSIP_ITEM( 5, "Darnassus. 5 Silver" , GOSSIP_SENDER_MAIN, 1203); - player->ADD_GOSSIP_ITEM( 5, "Exodar. 5 Silver" , GOSSIP_SENDER_MAIN, 1216); - player->ADD_GOSSIP_ITEM( 5, "Stormwind. 5 Silver" , GOSSIP_SENDER_MAIN, 1206); - player->ADD_GOSSIP_ITEM( 5, "Ironforge. 5 Silver" , GOSSIP_SENDER_MAIN, 1224); - player->ADD_GOSSIP_ITEM( 5, "Gnomeregan. 5 Silver" , GOSSIP_SENDER_MAIN, 1222); + if (player->GetTeam() == ALLIANCE ) { + player->ADD_GOSSIP_ITEM( 5, "Darnassus. 5 Silver" , GOSSIP_SENDER_MAIN, 1203); + player->ADD_GOSSIP_ITEM( 5, "Exodar. 5 Silver" , GOSSIP_SENDER_MAIN, 1216); + player->ADD_GOSSIP_ITEM( 5, "Stormwind. 5 Silver" , GOSSIP_SENDER_MAIN, 1206); + player->ADD_GOSSIP_ITEM( 5, "Ironforge. 5 Silver" , GOSSIP_SENDER_MAIN, 1224); + player->ADD_GOSSIP_ITEM( 5, "Gnomeregan. 5 Silver" , GOSSIP_SENDER_MAIN, 1222); player->ADD_GOSSIP_ITEM( 5, "Shattrath City. 5 Silver" , GOSSIP_SENDER_MAIN, 1287); - player->ADD_GOSSIP_ITEM( 5, "Dalaran. 5 Silver" , GOSSIP_SENDER_MAIN, 1205); + player->ADD_GOSSIP_ITEM( 5, "Dalaran. 5 Silver" , GOSSIP_SENDER_MAIN, 1205); player->ADD_GOSSIP_ITEM( 5, "Isle Of Quel'Danas. 5 Silver" , GOSSIP_SENDER_MAIN, 1288); - player->ADD_GOSSIP_ITEM( 7, "[Instances] ->" , GOSSIP_SENDER_MAIN, 5550); - player->ADD_GOSSIP_ITEM( 7, "[Instances WotLK] ->" , GOSSIP_SENDER_MAIN, 5554); - } else { - player->ADD_GOSSIP_ITEM( 5, "Orgrimmar. 5 Silver" , GOSSIP_SENDER_MAIN, 1215); - player->ADD_GOSSIP_ITEM( 5, "Silvermoon. 5 Silver" , GOSSIP_SENDER_MAIN, 1217); - player->ADD_GOSSIP_ITEM( 5, "Undercity. 5 Silver" , GOSSIP_SENDER_MAIN, 1213); - player->ADD_GOSSIP_ITEM( 5, "Thunder Bluff. 5 Silver" , GOSSIP_SENDER_MAIN, 1225); - player->ADD_GOSSIP_ITEM( 5, "Gnomeregan. 5 Silver" , GOSSIP_SENDER_MAIN, 1222); + player->ADD_GOSSIP_ITEM( 7, "[Instances Normal] ->" , GOSSIP_SENDER_MAIN, 5550); + player->ADD_GOSSIP_ITEM( 7, "[Instances BC] ->" , GOSSIP_SENDER_MAIN, 5553); + player->ADD_GOSSIP_ITEM( 7, "[Instances WotLK] ->" , GOSSIP_SENDER_MAIN, 5554); + player->ADD_GOSSIP_ITEM( 7, "[Raids WotLK] ->" , GOSSIP_SENDER_MAIN, 5555); + } else { + player->ADD_GOSSIP_ITEM( 5, "Orgrimmar. 5 Silver" , GOSSIP_SENDER_MAIN, 1215); + player->ADD_GOSSIP_ITEM( 5, "Silvermoon. 5 Silver" , GOSSIP_SENDER_MAIN, 1217); + player->ADD_GOSSIP_ITEM( 5, "Undercity. 5 Silver" , GOSSIP_SENDER_MAIN, 1213); + player->ADD_GOSSIP_ITEM( 5, "Thunder Bluff. 5 Silver" , GOSSIP_SENDER_MAIN, 1225); + player->ADD_GOSSIP_ITEM( 5, "Gnomeregan. 5 Silver" , GOSSIP_SENDER_MAIN, 1222); player->ADD_GOSSIP_ITEM( 5, "Shattrath City. 5 Silver" , GOSSIP_SENDER_MAIN, 1287); - player->ADD_GOSSIP_ITEM( 5, "Dalaran. 5 Silver" , GOSSIP_SENDER_MAIN, 1205); + player->ADD_GOSSIP_ITEM( 5, "Dalaran. 5 Silver" , GOSSIP_SENDER_MAIN, 1205); player->ADD_GOSSIP_ITEM( 5, "Isle Of Quel'Danas. 5 Silver" , GOSSIP_SENDER_MAIN, 1288); - player->ADD_GOSSIP_ITEM( 7, "[Instances] ->" , GOSSIP_SENDER_MAIN, 5550); - player->ADD_GOSSIP_ITEM( 7, "[Instances WotLK] ->" , GOSSIP_SENDER_MAIN, 5554); + player->ADD_GOSSIP_ITEM( 7, "[Instances Normal] ->" , GOSSIP_SENDER_MAIN, 5550); + player->ADD_GOSSIP_ITEM( 7, "[Instances BC] ->" , GOSSIP_SENDER_MAIN, 5553); + player->ADD_GOSSIP_ITEM( 7, "[Instances WotLK] ->" , GOSSIP_SENDER_MAIN, 5554); + player->ADD_GOSSIP_ITEM( 7, "[Raids WotLK] ->" , GOSSIP_SENDER_MAIN, 5555); } - player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); + player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); return true; } - void SendDefaultMenu_mob_teleguy(Player *player, Creature *_Creature, uint32 action ) { if(!player->getAttackers().empty()) @@ -41,7 +44,7 @@ void SendDefaultMenu_mob_teleguy(Player *player, Creature *_Creature, uint32 act return; } - if( player->getLevel() < 8 ) + if(player->getLevel() < 8 ) { player->CLOSE_GOSSIP_MENU(); _Creature->MonsterSay("You must be lvl 8+", LANG_UNIVERSAL); @@ -51,7 +54,7 @@ void SendDefaultMenu_mob_teleguy(Player *player, Creature *_Creature, uint32 act money = player-> GetMoney(); costo = 500; - if (money < costo ) + if (money < costo ) { player->CLOSE_GOSSIP_MENU(); _Creature->MonsterSay("You haven't enough money", LANG_UNIVERSAL); @@ -60,106 +63,115 @@ void SendDefaultMenu_mob_teleguy(Player *player, Creature *_Creature, uint32 act switch(action) { - case 5550: //Instances - player->ADD_GOSSIP_ITEM( 5, "Ragefire Chasm. 10 Silver" , GOSSIP_SENDER_MAIN, 1248); + case 5550: //Normal Instances + if (player->GetTeam() == ALLIANCE ) { + player->ADD_GOSSIP_ITEM( 5, "The Stockade. 10 Silver" , GOSSIP_SENDER_MAIN, 1253); + } else { + player->ADD_GOSSIP_ITEM( 5, "Ragefire Chasm. 10 Silver" , GOSSIP_SENDER_MAIN, 1248); + } player->ADD_GOSSIP_ITEM( 5, "The Wailing Caverns. 10 Silver" , GOSSIP_SENDER_MAIN, 1249); - player->ADD_GOSSIP_ITEM( 5, "The Stockade. 10 Silver" , GOSSIP_SENDER_MAIN, 1253); player->ADD_GOSSIP_ITEM( 5, "Deadmines. 10 Silver" , GOSSIP_SENDER_MAIN, 1250); player->ADD_GOSSIP_ITEM( 5, "Shadowfang Keep. 10 Silver" , GOSSIP_SENDER_MAIN, 1251); player->ADD_GOSSIP_ITEM( 5, "Blackfathom Deeps. 10 Silver" , GOSSIP_SENDER_MAIN, 1252); player->ADD_GOSSIP_ITEM( 5, "Razorfen Kraul. 20 Silver" , GOSSIP_SENDER_MAIN, 1254); player->ADD_GOSSIP_ITEM( 5, "Razorfen Downs. 20 Silver" , GOSSIP_SENDER_MAIN, 1256); player->ADD_GOSSIP_ITEM( 5, "Scarlet Monastery. 20 Silver" , GOSSIP_SENDER_MAIN, 1257); - player->ADD_GOSSIP_ITEM( 7, "[More] ->" , GOSSIP_SENDER_MAIN, 5551); - player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]" , GOSSIP_SENDER_MAIN, 5552); + player->ADD_GOSSIP_ITEM( 7, "[More] ->" , GOSSIP_SENDER_MAIN, 5551); + player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]" , GOSSIP_SENDER_MAIN, 5552); + player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); - break; - case 5551: //More Instances + break; + + case 5551: //More Normal Instances player->ADD_GOSSIP_ITEM( 5, "Uldaman. 30 Silver" , GOSSIP_SENDER_MAIN, 1258); player->ADD_GOSSIP_ITEM( 5, "Zul'Farrak. 30 Silver" , GOSSIP_SENDER_MAIN, 1259); player->ADD_GOSSIP_ITEM( 5, "Maraudon. 40 Silver" , GOSSIP_SENDER_MAIN, 1260); - player->ADD_GOSSIP_ITEM( 5, "Maraudon. 40 Silver" , GOSSIP_SENDER_MAIN, 1260); - player->ADD_GOSSIP_ITEM( 5, "The Sunken Temple. 40 Silver" , GOSSIP_SENDER_MAIN, 1261); + player->ADD_GOSSIP_ITEM( 5, "The Sunken Temple. 40 Silver" , GOSSIP_SENDER_MAIN, 1261); player->ADD_GOSSIP_ITEM( 5, "Blackrock Depths. 40 Silver" , GOSSIP_SENDER_MAIN, 1262); player->ADD_GOSSIP_ITEM( 5, "Dire Maul. 50 Silver" , GOSSIP_SENDER_MAIN, 1263); player->ADD_GOSSIP_ITEM( 5, "Blackrock Spire. 50 Silver" , GOSSIP_SENDER_MAIN, 1264); player->ADD_GOSSIP_ITEM( 5, "Stratholme. 50 Silver" , GOSSIP_SENDER_MAIN, 1265); player->ADD_GOSSIP_ITEM( 5, "Scholomance. 50 Silver" , GOSSIP_SENDER_MAIN, 1266); - player->ADD_GOSSIP_ITEM( 7, "[More] ->" , GOSSIP_SENDER_MAIN, 5553); - player->ADD_GOSSIP_ITEM( 7, "<- [Back]" , GOSSIP_SENDER_MAIN, 5550); - player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]" , GOSSIP_SENDER_MAIN, 5552); - player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); - break; - -case 5553: //Instances 60-70 -player->ADD_GOSSIP_ITEM( 5, "Karazhan. 1 Gold" , GOSSIP_SENDER_MAIN, 4007); -player->ADD_GOSSIP_ITEM( 5, "Gruul's Lair. 1 Gold" , GOSSIP_SENDER_MAIN, 4008); -player->ADD_GOSSIP_ITEM( 5, "Hellfire Citadel. 1 Gold" , GOSSIP_SENDER_MAIN, 4009); -player->ADD_GOSSIP_ITEM( 5, "Coilfang Reservoir. 1 Gold" , GOSSIP_SENDER_MAIN, 4010); -player->ADD_GOSSIP_ITEM( 5, "Tempest Keep. 1 Gold" , GOSSIP_SENDER_MAIN, 4011); -player->ADD_GOSSIP_ITEM( 5, "Caverns of Time. 1 Gold" , GOSSIP_SENDER_MAIN, 4012); -player->ADD_GOSSIP_ITEM( 5, "Zul'Aman. 1 Gold" , GOSSIP_SENDER_MAIN, 4016); -player->ADD_GOSSIP_ITEM( 5, "Black Temple. 1 Gold" , GOSSIP_SENDER_MAIN, 4013); -player->ADD_GOSSIP_ITEM( 5, "Magister's Terrace. 2 Gold" , GOSSIP_SENDER_MAIN, 4017); -player->ADD_GOSSIP_ITEM( 5, "Sunwell Plateau. 2 Gold" , GOSSIP_SENDER_MAIN, 4018); -player->ADD_GOSSIP_ITEM( 7, "<- [Back]" , GOSSIP_SENDER_MAIN, 5550); -player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]" , GOSSIP_SENDER_MAIN, 5552); - - -player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); - -break; - -case 5554: //Instances 75-80 NORTHREND -player->ADD_GOSSIP_ITEM( 5, "Utgarde Keep. 20 Gold" , GOSSIP_SENDER_MAIN, 4019); -player->ADD_GOSSIP_ITEM( 5, "The Nexus. 20 Gold" , GOSSIP_SENDER_MAIN, 4020); -player->ADD_GOSSIP_ITEM( 5, "Azjol-Nerub. 20 Gold" , GOSSIP_SENDER_MAIN, 4021); -player->ADD_GOSSIP_ITEM( 5, "Ahn'kahet: The Old Kingdom. 20 Gold" , GOSSIP_SENDER_MAIN, 4022); -player->ADD_GOSSIP_ITEM( 5, "Drak'Tharon Keep. 20 Gold" , GOSSIP_SENDER_MAIN, 4023); -player->ADD_GOSSIP_ITEM( 5, "The Violet Hold. 20 Gold" , GOSSIP_SENDER_MAIN, 4024); -player->ADD_GOSSIP_ITEM( 5, "Gun' Drak. 20 Gold" , GOSSIP_SENDER_MAIN, 4025); -player->ADD_GOSSIP_ITEM( 5, "Utgarde Pinnacle. 20 Gold" , GOSSIP_SENDER_MAIN, 4026); -player->ADD_GOSSIP_ITEM( 5, "Ulduar. 20 Gold" , GOSSIP_SENDER_MAIN, 4027); -player->ADD_GOSSIP_ITEM( 5, "The Obsidian Sanctum. 20 Gold" , GOSSIP_SENDER_MAIN, 4028); -player->ADD_GOSSIP_ITEM( 5, "Naxxramas. 20 Gold" , GOSSIP_SENDER_MAIN, 4029); -player->ADD_GOSSIP_ITEM( 7, "<- [Back]" , GOSSIP_SENDER_MAIN, 5550); -player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]" , GOSSIP_SENDER_MAIN, 5552); - - -player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); + player->ADD_GOSSIP_ITEM( 7, "<- [Back]" , GOSSIP_SENDER_MAIN, 5550); + player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]" , GOSSIP_SENDER_MAIN, 5552); + player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); + break; + +case 5553: //Instances 60-70 BC + player->ADD_GOSSIP_ITEM( 5, "Auchindoun. 1 Gold" , GOSSIP_SENDER_MAIN, 4006); + player->ADD_GOSSIP_ITEM( 5, "Karazhan. 1 Gold" , GOSSIP_SENDER_MAIN, 4007); + player->ADD_GOSSIP_ITEM( 5, "Gruul's Lair. 1 Gold" , GOSSIP_SENDER_MAIN, 4008); + player->ADD_GOSSIP_ITEM( 5, "Hellfire Citadel. 1 Gold" , GOSSIP_SENDER_MAIN, 4009); + player->ADD_GOSSIP_ITEM( 5, "Coilfang Reservoir. 1 Gold" , GOSSIP_SENDER_MAIN, 4010); + player->ADD_GOSSIP_ITEM( 5, "Tempest Keep. 1 Gold" , GOSSIP_SENDER_MAIN, 4011); + player->ADD_GOSSIP_ITEM( 5, "Zul'Aman. 1 Gold" , GOSSIP_SENDER_MAIN, 4016); + player->ADD_GOSSIP_ITEM( 5, "Black Temple. 1 Gold" , GOSSIP_SENDER_MAIN, 4013); + player->ADD_GOSSIP_ITEM( 5, "Magister's Terrace. 2 Gold" , GOSSIP_SENDER_MAIN, 4017); + player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]" , GOSSIP_SENDER_MAIN, 5552); + + player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); +break; + +case 5554: //Instances 70-80 WotLK + player->ADD_GOSSIP_ITEM( 5, "Caverns of Time. 20 Gold" , GOSSIP_SENDER_MAIN, 4012); + player->ADD_GOSSIP_ITEM( 5, "Utgarde Keep. 20 Gold" , GOSSIP_SENDER_MAIN, 4019); + player->ADD_GOSSIP_ITEM( 5, "Azjol-Nerub. 20 Gold" , GOSSIP_SENDER_MAIN, 4021); + player->ADD_GOSSIP_ITEM( 5, "The Old Kingdom. 20 Gold" , GOSSIP_SENDER_MAIN, 4022); + player->ADD_GOSSIP_ITEM( 5, "Drak'Tharon Keep. 20 Gold" , GOSSIP_SENDER_MAIN, 4023); + player->ADD_GOSSIP_ITEM( 5, "Gundrak. 20 Gold" , GOSSIP_SENDER_MAIN, 4025); + player->ADD_GOSSIP_ITEM( 5, "Utgarde Pinnacle. 20 Gold" , GOSSIP_SENDER_MAIN, 4026); + player->ADD_GOSSIP_ITEM( 5, "Halls of Stone. 20 Gold" , GOSSIP_SENDER_MAIN, 4032); + player->ADD_GOSSIP_ITEM( 5, "Halls of Lightning. 20 Gold" , GOSSIP_SENDER_MAIN, 4033); + player->ADD_GOSSIP_ITEM( 5, "Frozen Halls. 20 Gold" , GOSSIP_SENDER_MAIN, 4034); + player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]" , GOSSIP_SENDER_MAIN, 5552); + + player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); +break; + +case 5555: //Raids 80 WotLK + player->ADD_GOSSIP_ITEM( 5, "The Nexus. 20 Gold" , GOSSIP_SENDER_MAIN, 4020); + player->ADD_GOSSIP_ITEM( 5, "Coliseum Vanguard. 20 Gold" , GOSSIP_SENDER_MAIN, 4024); + player->ADD_GOSSIP_ITEM( 5, "Ulduar. 20 Gold" , GOSSIP_SENDER_MAIN, 4027); + player->ADD_GOSSIP_ITEM( 5, "Wyrmrest Temple. 20 Gold" , GOSSIP_SENDER_MAIN, 4028); + player->ADD_GOSSIP_ITEM( 5, "Naxxramas. 20 Gold" , GOSSIP_SENDER_MAIN, 4029); + player->ADD_GOSSIP_ITEM( 5, "Icecrown Citadel. 20 Gold" , GOSSIP_SENDER_MAIN, 4030); + player->ADD_GOSSIP_ITEM( 5, "Vault of Archavon. 20 Gold" , GOSSIP_SENDER_MAIN, 4031); + player->ADD_GOSSIP_ITEM( 5, "Onyxia's Lair. 20 Gold" , GOSSIP_SENDER_MAIN, 4035); + player->ADD_GOSSIP_ITEM( 7, "<- [Main Menu]" , GOSSIP_SENDER_MAIN, 5552); + + player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); break; - + case 5552: //Back To Main Menu - if ( player->GetTeam() == ALLIANCE ) { -player->ADD_GOSSIP_ITEM( 5, "Darnassus. 5 Silver" , GOSSIP_SENDER_MAIN, 1203); -player->ADD_GOSSIP_ITEM( 5, "Exodar. 5 Silver" , GOSSIP_SENDER_MAIN, 1216); -player->ADD_GOSSIP_ITEM( 5, "Stormwind. 5 Silver" , GOSSIP_SENDER_MAIN, 1206); -player->ADD_GOSSIP_ITEM( 5, "Ironforge. 5 Silver" , GOSSIP_SENDER_MAIN, 1224); -player->ADD_GOSSIP_ITEM( 5, "Gnomeregan. 5 Silver" , GOSSIP_SENDER_MAIN, 1222); -player->ADD_GOSSIP_ITEM( 5, "Shattrath City. 5 Silver" , GOSSIP_SENDER_MAIN, 1287); -player->ADD_GOSSIP_ITEM( 5, "Dalaran. 5 Silver" , GOSSIP_SENDER_MAIN, 1205); -player->ADD_GOSSIP_ITEM( 5, "Isle Of Quel'Danas. 5 Silver" , GOSSIP_SENDER_MAIN, 1288); -player->ADD_GOSSIP_ITEM( 7, "[Instances] ->" , GOSSIP_SENDER_MAIN, 5550); -player->ADD_GOSSIP_ITEM( 7, "[Instances WotLK] ->" , GOSSIP_SENDER_MAIN, 5554); - - } else { - - -player->ADD_GOSSIP_ITEM( 5, "Orgrimmar. 5 Silver" , GOSSIP_SENDER_MAIN, 1215); -player->ADD_GOSSIP_ITEM( 5, "Silvermoon. 5 Silver" , GOSSIP_SENDER_MAIN, 1217); -player->ADD_GOSSIP_ITEM( 5, "Undercity. 5 Silver" , GOSSIP_SENDER_MAIN, 1213); -player->ADD_GOSSIP_ITEM( 5, "Thunder Bluff. 5 Silver" , GOSSIP_SENDER_MAIN, 1225); -player->ADD_GOSSIP_ITEM( 5, "Gnomeregan. 5 Silver" , GOSSIP_SENDER_MAIN, 1222); -player->ADD_GOSSIP_ITEM( 5, "Shattrath City. 5 Silver" , GOSSIP_SENDER_MAIN, 1287); -player->ADD_GOSSIP_ITEM( 5, "Dalaran. 5 Silver" , GOSSIP_SENDER_MAIN, 1205); -player->ADD_GOSSIP_ITEM( 5, "Isle Of Quel'Danas. 5 Silver" , GOSSIP_SENDER_MAIN, 1288); -player->ADD_GOSSIP_ITEM( 7, "[Instances] ->" , GOSSIP_SENDER_MAIN, 5550); -player->ADD_GOSSIP_ITEM( 7, "[Instances WotLK] ->" , GOSSIP_SENDER_MAIN, 5554); - } - -player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); - + if (player->GetTeam() == ALLIANCE ) { + player->ADD_GOSSIP_ITEM( 5, "Darnassus. 5 Silver" , GOSSIP_SENDER_MAIN, 1203); + player->ADD_GOSSIP_ITEM( 5, "Exodar. 5 Silver" , GOSSIP_SENDER_MAIN, 1216); + player->ADD_GOSSIP_ITEM( 5, "Stormwind. 5 Silver" , GOSSIP_SENDER_MAIN, 1206); + player->ADD_GOSSIP_ITEM( 5, "Ironforge. 5 Silver" , GOSSIP_SENDER_MAIN, 1224); + player->ADD_GOSSIP_ITEM( 5, "Gnomeregan. 5 Silver" , GOSSIP_SENDER_MAIN, 1222); + player->ADD_GOSSIP_ITEM( 5, "Shattrath City. 5 Silver" , GOSSIP_SENDER_MAIN, 1287); + player->ADD_GOSSIP_ITEM( 5, "Dalaran. 5 Silver" , GOSSIP_SENDER_MAIN, 1205); + player->ADD_GOSSIP_ITEM( 5, "Isle Of Quel'Danas. 5 Silver" , GOSSIP_SENDER_MAIN, 1288); + player->ADD_GOSSIP_ITEM( 7, "[Instances Normal] ->" , GOSSIP_SENDER_MAIN, 5550); + player->ADD_GOSSIP_ITEM( 7, "[Instances BC] ->" , GOSSIP_SENDER_MAIN, 5553); + player->ADD_GOSSIP_ITEM( 7, "[Instances WotLK] ->" , GOSSIP_SENDER_MAIN, 5554); + player->ADD_GOSSIP_ITEM( 7, "[Raids WotLK] ->" , GOSSIP_SENDER_MAIN, 5555); + } else { + player->ADD_GOSSIP_ITEM( 5, "Orgrimmar. 5 Silver" , GOSSIP_SENDER_MAIN, 1215); + player->ADD_GOSSIP_ITEM( 5, "Silvermoon. 5 Silver" , GOSSIP_SENDER_MAIN, 1217); + player->ADD_GOSSIP_ITEM( 5, "Undercity. 5 Silver" , GOSSIP_SENDER_MAIN, 1213); + player->ADD_GOSSIP_ITEM( 5, "Thunder Bluff. 5 Silver" , GOSSIP_SENDER_MAIN, 1225); + player->ADD_GOSSIP_ITEM( 5, "Gnomeregan. 5 Silver" , GOSSIP_SENDER_MAIN, 1222); + player->ADD_GOSSIP_ITEM( 5, "Shattrath City. 5 Silver" , GOSSIP_SENDER_MAIN, 1287); + player->ADD_GOSSIP_ITEM( 5, "Dalaran. 5 Silver" , GOSSIP_SENDER_MAIN, 1205); + player->ADD_GOSSIP_ITEM( 5, "Isle Of Quel'Danas. 5 Silver" , GOSSIP_SENDER_MAIN, 1288); + player->ADD_GOSSIP_ITEM( 7, "[Instances Normal] ->" , GOSSIP_SENDER_MAIN, 5550); + player->ADD_GOSSIP_ITEM( 7, "[Instances BC] ->" , GOSSIP_SENDER_MAIN, 5553); + player->ADD_GOSSIP_ITEM( 7, "[Instances WotLK] ->" , GOSSIP_SENDER_MAIN, 5554); + player->ADD_GOSSIP_ITEM( 7, "[Raids WotLK] ->" , GOSSIP_SENDER_MAIN, 5555); + } + player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid()); break; case 1203: // Teleport to Darnassus @@ -187,7 +199,6 @@ case 1213: player->CLOSE_GOSSIP_MENU(); player->TeleportTo(0, 1819.71f, 238.79f, 60.5321f, 0.0f); player->ModifyMoney(-1*costo); - break; // Teleport to Orgrimmar @@ -209,14 +220,12 @@ case 1217: player->CLOSE_GOSSIP_MENU(); player->TeleportTo(530, 9338.74f, -7277.27f, 13.7895f, 0.0f); player->ModifyMoney(-1*costo); - break; case 1222://teleport player to Gnomeregan player->CLOSE_GOSSIP_MENU(); player->TeleportTo(0, -5163.43f,660.40f,348.28f,4.65f); player->ModifyMoney(-1*costo); - break; // Teleport to Ironforge @@ -224,366 +233,314 @@ case 1224: player->CLOSE_GOSSIP_MENU(); player->TeleportTo(0, -4924.07f, -951.95f, 501.55f, 5.40f); player->ModifyMoney(-1*costo); - break; -// Teleport to Thunder Bluff +// Thunder Bluff case 1225: player->CLOSE_GOSSIP_MENU(); -player->TeleportTo(1, -1280.19f,127.21f,131.35f,5.16f); +player->TeleportTo(1, -1280.19f,127.21f,131.35f,5.16f); player->ModifyMoney(-1*costo); - break; -case 1248://teleport player to Ragefire Chasm - -if( player->getLevel() >= 8) - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(1, 1800.53f,-4394.68f,-17.93f,5.49f); - player->ModifyMoney(-2*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 8!", LANG_UNIVERSAL); - } - +case 1248:// Ragefire Chasm +if(player->getLevel() >= 8) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(1, 1800.53f,-4394.68f,-17.93f,5.49f); + player->ModifyMoney(-2*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 8!", LANG_UNIVERSAL); + } break; -case 1249://teleport player to the Wailing Caverns - +case 1249:// Wailing Caverns if (player->getLevel() >= 10) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(1, -722.53f,-2226.30f,16.94f,2.71f); - player->ModifyMoney(-2*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 10!", LANG_UNIVERSAL); - } - + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(1, -722.53f,-2226.30f,16.94f,2.71f); + player->ModifyMoney(-2*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 10!", LANG_UNIVERSAL); + } break; -case 1250://teleport player to the Deadmines - +case 1250:// Deadmines if (player->getLevel() >= 10) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(0, -11212.04f,1658.58f,25.67f,1.45f); - player->ModifyMoney(-2*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 10!", LANG_UNIVERSAL); - } - + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(0, -11212.04f,1658.58f,25.67f,1.45f); + player->ModifyMoney(-2*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 10!", LANG_UNIVERSAL); + } break; -case 1251://teleport player to Shadowfang Keep - - if (player->getLevel() >= 15) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(0, -254.47f,1524.68f,76.89f,1.56f); - player->ModifyMoney(-2*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 15!", LANG_UNIVERSAL); - } - +case 1251:// Shadowfang Keep + if (player->getLevel() >= 14) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(0, -254.47f,1524.68f,76.89f,1.56f); + player->ModifyMoney(-2*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 14!", LANG_UNIVERSAL); + } break; -case 1252://teleport player to Blackfathom Deeps - - if (player->getLevel() >= 15) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(1, 4254.58f,664.74f,-29.04f,1.97f); - player->ModifyMoney(-2*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 15!", LANG_UNIVERSAL); - } - +case 1252:// Blackfathom Deeps + if (player->getLevel() >= 15) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(1, 4254.58f,664.74f,-29.04f,1.97f); + player->ModifyMoney(-2*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 15!", LANG_UNIVERSAL); + } break; -case 1253://teleport player to the Stockade - - if (player->getLevel() >= 20) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(0, -8769.76f,813.08f,97.63f,2.26f); - player->ModifyMoney(-2*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 20!", LANG_UNIVERSAL); - } - +case 1253:// The Stockade + if (player->getLevel() >= 15) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(0, -8769.76f,813.08f,97.63f,2.26f); + player->ModifyMoney(-2*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 15!", LANG_UNIVERSAL); + } break; -case 1254://teleport player to Razorfen Kraul - - if (player->getLevel() >= 24) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(1, -4484.04f,-1739.40f,86.47f,1.23f); - player->ModifyMoney(-4*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 24!", LANG_UNIVERSAL); - } - +case 1254:// Razorfen Kraul + if (player->getLevel() >= 17) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(1, -4484.04f,-1739.40f,86.47f,1.23f); + player->ModifyMoney(-4*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 17!", LANG_UNIVERSAL); + } break; -case 1255://teleport player to Gnomeregan - - if (player->getLevel() >= 20) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(0, -5162.62f,667.81f,248.05f,1.48f); - player->ModifyMoney(-4*costo); - - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 20!", LANG_UNIVERSAL); - } - +case 1255:// Gnomeregan + if (player->getLevel() >= 20) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(0, -5162.62f,667.81f,248.05f,1.48f); + player->ModifyMoney(-4*costo); + + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 20!", LANG_UNIVERSAL); + } break; -case 1256://teleport player to Razorfen Downs - - if (player->getLevel() >= 25) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(1, -4645.08f,-2470.85f,85.53f,4.39f); - player->ModifyMoney(-4*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 25!", LANG_UNIVERSAL); - } - +case 1256:// Razorfen Downs + if (player->getLevel() >= 25) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(1, -4645.08f,-2470.85f,85.53f,4.39f); + player->ModifyMoney(-4*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 25!", LANG_UNIVERSAL); + } break; -case 1257://teleport player to the Scarlet Monastery - - if (player->getLevel() >= 25) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(0, 2843.89f,-693.74f,139.32f,5.11f); - player->ModifyMoney(-4*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 25!", LANG_UNIVERSAL); - } - +case 1257:// Scarlet Monastery + if (player->getLevel() >= 20) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(0, 2843.89f,-693.74f,139.32f,5.11f); + player->ModifyMoney(-4*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 20!", LANG_UNIVERSAL); + } break; -case 1258://teleport player to Uldaman - - if (player->getLevel() >= 35) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(0, -6119.70f,-2957.30f,204.11f,0.03f); - player->ModifyMoney(-6*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 35!", LANG_UNIVERSAL); - } - +case 1258:// Uldaman + if (player->getLevel() >= 30) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(0, -6119.70f,-2957.30f,204.11f,0.03f); + player->ModifyMoney(-6*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 30!", LANG_UNIVERSAL); + } break; -case 1259://teleport player to Zul'Farrak - - if (player->getLevel() >= 35) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(1, -6839.39f,-2911.03f,8.87f,0.41f); - player->ModifyMoney(-6*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 35!", LANG_UNIVERSAL); - } - +case 1259:// Zul'Farrak + if (player->getLevel() >= 35) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(1, -6839.39f,-2911.03f,8.87f,0.41f); + player->ModifyMoney(-6*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 35!", LANG_UNIVERSAL); + } break; - -case 1260://teleport player to Maraudon - - if (player->getLevel() >= 40) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(1, -1433.33f,2955.34f,96.21f,4.82f); - player->ModifyMoney(-8*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 40!", LANG_UNIVERSAL); - } - +case 1260:// Maraudon + if (player->getLevel() >= 30) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(1, -1433.33f,2955.34f,96.21f,4.82f); + player->ModifyMoney(-8*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 30!", LANG_UNIVERSAL); + } break; -case 1261://teleport player to the Sunken Temple - - if (player->getLevel() >= 45) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(0, -10346.92f,-3851.90f,-43.41f,6.09f); - player->ModifyMoney(-8*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 45!", LANG_UNIVERSAL); - } - +case 1261:// Sunken Temple + if (player->getLevel() >= 45) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(0, -10346.92f,-3851.90f,-43.41f,6.09f); + player->ModifyMoney(-8*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 45!", LANG_UNIVERSAL); + } break; -case 1262://teleport player to Blackrock Depths - - if (player->getLevel() >= 45) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(0, -7301.03f,-913.19f,165.37f,0.08f); - player->ModifyMoney(-8*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 45!", LANG_UNIVERSAL); - } - +case 1262:// Blackrock Dephts + if (player->getLevel() >= 45) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(0, -7301.03f,-913.19f,165.37f,0.08f); + player->ModifyMoney(-8*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 45!", LANG_UNIVERSAL); + } break; - -case 1263://teleport player to Dire Maul - - if (player->getLevel() >= 50) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(1, -3982.47f,1127.79f,161.02f,0.05f); - player->ModifyMoney(-10*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 50!", LANG_UNIVERSAL); - } - + +case 1263:// Dire Maul + if (player->getLevel() >= 45) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(1, -3982.47f,1127.79f,161.02f,0.05f); + player->ModifyMoney(-10*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 45!", LANG_UNIVERSAL); + } break; -case 1264://teleport player to Blackrock Spire - - if (player->getLevel() >= 50) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(0, -7535.43f,-1212.04f,285.45f,5.29f); - player->ModifyMoney(-10*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 50!", LANG_UNIVERSAL); - } - +case 1264:// Blackrock Spire + if (player->getLevel() >= 45) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(0, -7535.43f,-1212.04f,285.45f,5.29f); + player->ModifyMoney(-10*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 45!", LANG_UNIVERSAL); + } break; -case 1265://teleport player to Stratholme - - if (player->getLevel() >= 50) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(0, 3263.54f,-3379.46f,143.59f,0.00f); - player->ModifyMoney(-10*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 50!", LANG_UNIVERSAL); - } - +case 1265:// Stratholme + if (player->getLevel() >= 45) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(0, 3263.54f,-3379.46f,143.59f,0.00f); + player->ModifyMoney(-10*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 45!", LANG_UNIVERSAL); + } break; -case 1266://teleport player to Scholomance - - if (player->getLevel() >= 50) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(0, 1219.01f,-2604.66f,85.61f,0.50f); - player->ModifyMoney(-10*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 50!", LANG_UNIVERSAL); - } - +case 1266:// Scholomance + if (player->getLevel() >= 45) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(0, 1219.01f,-2604.66f,85.61f,0.50f); + player->ModifyMoney(-10*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 45!", LANG_UNIVERSAL); + } break; case 1287:// Shattrath City - -if( player->getLevel() >= 58) +if(player->getLevel() >= 58) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(530, -1850.209961f, 5435.821777f, -10.961435f, 3.403913f); player->ModifyMoney(-1*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); _Creature->MonsterSay("You must be at least level 58!", LANG_UNIVERSAL); } - break; -case 1288://teleport player to Isle Of Quel'Danas - - if (player->getLevel() >= 65) - +case 1288:// Isle Of Quel'Danas + if (player->getLevel() >= 70) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(530, 12947.4f,-6893.31f,5.68398f,3.09154f); player->ModifyMoney(-1*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 65!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 70!", LANG_UNIVERSAL); } - break; -case 4007:// Karazhan +case 4006:// Auchindoun + if (player->getLevel() >= 58) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(530, -3304.64f, 4916.23f, -105.125f, 2.53837f); + player->ModifyMoney(-40*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 58!", LANG_UNIVERSAL); + } +break; - if (player->getLevel() >= 70) - +case 4007:// Karazhan + if (player->getLevel() >= 68) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(0, -11118.8f, -2010.84f, 47.0807f, 0.0f); player->ModifyMoney(-20*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 70!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 68!", LANG_UNIVERSAL); } - break; case 4008:// Gruul's Lair - if (player->getLevel() >= 65) - { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(530, 3539.007568f, 5082.357910f, 1.691071f, 0.0f); player->ModifyMoney(-20*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); _Creature->MonsterSay("You must be at least level 65!", LANG_UNIVERSAL); } - break; case 4009:// Hellfire Citadel -player->CLOSE_GOSSIP_MENU(); -player->TeleportTo(530, -305.816223f, 3056.401611f, -2.473183f, 2.01f); -player->ModifyMoney(-20*costo); + if (player->getLevel() >= 58) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(530, -305.816223f, 3056.401611f, -2.473183f, 2.01f); + player->ModifyMoney(-20*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 58!", LANG_UNIVERSAL); + } break; case 4010:// Coilfang Reservoir @@ -593,254 +550,267 @@ player->ModifyMoney(-20*costo); break; case 4011:// Tempest Keep - - if (player->getLevel() >= 70) - + if (player->getLevel() >= 67) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(530, 3089.579346f, 1399.046509f, 187.653458f, 4.794070f); player->ModifyMoney(-20*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 70!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 67!", LANG_UNIVERSAL); } - break; case 4012:// Caverns of Time - if (player->getLevel() >= 66) - { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(1, -8173.66f, -4746.36f, 33.8423f, 4.93989f); player->ModifyMoney(-20*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); _Creature->MonsterSay("You must be at least level 66!", LANG_UNIVERSAL); } - break; case 4016:// Zul'Aman - - if (player->getLevel() >= 70) - + if (player->getLevel() >= 68) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(530, 6846.95f, -7954.5f, 170.028f, 4.61501f); player->ModifyMoney(-20*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 70!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 68!", LANG_UNIVERSAL); } - break; case 4013:// Black Temple - if (player->getLevel() >= 70) - { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(530, -3610.719482f, 324.987579f, 37.400028f, 3.282981f); player->ModifyMoney(-20*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); _Creature->MonsterSay("You must be at least level 70!", LANG_UNIVERSAL); } - break; -case 4017:// magistrate - - if (player->getLevel() >= 70) - +case 4017:// Magisters' Terrace + if (player->getLevel() >= 68) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(530, 12884.6f, -7317.69f, 65.5023f, 4.799f); player->ModifyMoney(-40*costo); - } else { - player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 70!", LANG_UNIVERSAL); - } - -break; - -case 4018:// sunwell - - if (player->getLevel() >= 70) - - { - player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(530, 12574.1f, -6774.81f, 15.0904f, 3.13788f); - player->ModifyMoney(-40*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 70!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 68!", LANG_UNIVERSAL); } - break; case 4019:// Utgarde Keep - - if (player->getLevel() >= 80) - + if (player->getLevel() >= 68) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(571, 1219.720f, -4865.28f, 41.25f, 0.31f); player->ModifyMoney(-400*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 68!", LANG_UNIVERSAL); } - break; case 4020:// The Nexus - - if (player->getLevel() >= 80) - + if (player->getLevel() >= 68) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(571, 3776.950f, 6953.80f, 105.05f, 0.345f); player->ModifyMoney(-400*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 68!", LANG_UNIVERSAL); } - break; case 4021:// Azjol-Nerub - - if (player->getLevel() >= 80) - + if (player->getLevel() >= 67) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(571, 3675.430f, 2169.00f, 35.90f, 2.29f); player->ModifyMoney(-400*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 67!", LANG_UNIVERSAL); } - break; -case 4022:// Ahn'kahet: The Old Kingdom - - if (player->getLevel() >= 80) - +case 4022:// The Old Kingdom + if (player->getLevel() >= 68) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(571, 3646.760f, 2045.17f, 1.79f, 4.37f); player->ModifyMoney(-400*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 68!", LANG_UNIVERSAL); } - break; case 4023:// Drak'Tharon Keep - - if (player->getLevel() >= 80) - + if (player->getLevel() >= 69) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(571, 4450.860f, -2045.25f, 162.83f, 0.00f); player->ModifyMoney(-400*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 69!", LANG_UNIVERSAL); } - break; -case 4024:// The Violet Hold - - if (player->getLevel() >= 80) - +case 4024:// Coliseum Vanguard + if (player->getLevel() >= 75) { player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(571, 5679.820f, 486.80f, 652.40f, 4.08f); + player->TeleportTo(571, 8551.76f, 635.458f, 548.063f, 3.557f); player->ModifyMoney(-400*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 75!", LANG_UNIVERSAL); } - break; -case 4025:// Gun' Drak - - if (player->getLevel() >= 80) - +case 4025:// Gundrak + if (player->getLevel() >= 71) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(571, 6937.540f, -4455.98f, 450.68f, 1.00f); player->ModifyMoney(-400*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 71!", LANG_UNIVERSAL); } - break; case 4026:// Utgarde Pinnacle - - if (player->getLevel() >= 80) - + if (player->getLevel() >= 75) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(571, 1245.690f, -4856.59f, 216.86f, 3.45f); player->ModifyMoney(-400*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); - _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); + _Creature->MonsterSay("You must be at least level 75!", LANG_UNIVERSAL); } - break; case 4027:// Ulduar - if (player->getLevel() >= 80) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(571, 8976.240f, -1281.33f, 1059.01f, 0.58f); player->ModifyMoney(-400*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); } break; -case 4028:// The Obsidian Sanctum - +case 4028:// Wyrmrest Temple if (player->getLevel() >= 80) { player->CLOSE_GOSSIP_MENU(); player->TeleportTo(571, 3625.780f, 280.40f, -120.14f, 3.25f); player->ModifyMoney(-400*costo); - } else { + } else { player->CLOSE_GOSSIP_MENU(); _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); } break; case 4029:// Naxxramas + if (player->getLevel() >= 80) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(571, 3668.719f, -1262.460f, 243.63f, 5.03f); + player->ModifyMoney(-400*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); + } +break; + +case 4030:// Icecrown Citadel + if (player->getLevel() >= 80) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(571, 5809.48f, 2080.53f, 636.064f, 3.599f); + player->ModifyMoney(-400*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); + } +break; +case 4031:// Vault of Archavon if (player->getLevel() >= 80) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(571, 5321.13f, 2843.42f, 409.283f, 6.255f); + player->ModifyMoney(-400*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); + } +break; +case 4032:// Halls of Stone + if (player->getLevel() >= 72) { player->CLOSE_GOSSIP_MENU(); - player->TeleportTo(571, 3668.719f, -1262.460f, 243.63f, 5.03f); + player->TeleportTo(571, 8923.37f, -1036.56f, 1039.81f, 1.592f); player->ModifyMoney(-400*costo); - } else { + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 72!", LANG_UNIVERSAL); + } +break; + +case 4033:// Halls of Lightning + if (player->getLevel() >= 75) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(571, 9121.08f, -1330.12f, 1060.32f, 5.577f); + player->ModifyMoney(-400*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 75!", LANG_UNIVERSAL); + } +break; + +case 4034:// Frozen Halls + if (player->getLevel() >= 75) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(571, 5635.59f, 2052.15f, 798.045f, 4.580f); + player->ModifyMoney(-400*costo); + } else { + player->CLOSE_GOSSIP_MENU(); + _Creature->MonsterSay("You must be at least level 75!", LANG_UNIVERSAL); + } +break; + +case 4035:// Onyxia's Lair + if (player->getLevel() >= 80) + { + player->CLOSE_GOSSIP_MENU(); + player->TeleportTo(1, -4640.93f, -3623.18f, 39.461f, 4.474f); + player->ModifyMoney(-400*costo); + } else { player->CLOSE_GOSSIP_MENU(); _Creature->MonsterSay("You must be at least level 80!", LANG_UNIVERSAL); } - break; } diff --git a/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp b/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp index 4e35134..4459c14 100644 --- a/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp +++ b/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp @@ -23,6 +23,7 @@ EndScriptData */ /* ContentData go_shadowforge_brazier +go_relic_coffer_door at_ring_of_law npc_grimstone mob_phalanx @@ -50,6 +51,22 @@ bool GOUse_go_shadowforge_brazier(Player* pPlayer, GameObject* pGo) return false; } +/*###### +## go_relic_coffer_door +######*/ + +bool GOUse_go_relic_coffer_door(Player* pPlayer, GameObject* pGo) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData()) + { + // check if the event is already done + if (pInstance->GetData(TYPE_VAULT) != DONE && pInstance->GetData(TYPE_VAULT) != IN_PROGRESS) + pInstance->SetData(TYPE_VAULT, SPECIAL); + } + + return false; +} + /*###### ## npc_grimstone ######*/ @@ -796,6 +813,11 @@ void AddSC_blackrock_depths() pNewScript->pGOUse = &GOUse_go_shadowforge_brazier; pNewScript->RegisterSelf(); + pNewScript = new Script; + pNewScript->Name = "go_relic_coffer_door"; + pNewScript->pGOUse = &GOUse_go_relic_coffer_door; + pNewScript->RegisterSelf(); + pNewScript = new Script; pNewScript->Name = "at_ring_of_law"; pNewScript->pAreaTrigger = &AreaTrigger_at_ring_of_law; diff --git a/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h b/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h index 9a60bbe..929bad4 100644 --- a/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h +++ b/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h @@ -8,6 +8,8 @@ enum { MAX_ENCOUNTER = 6, + MAX_RELIC_DOORS = 12, + TYPE_RING_OF_LAW = 1, TYPE_VAULT = 2, TYPE_BAR = 3, @@ -25,6 +27,8 @@ enum NPC_SEETHREL = 9038, // NPC_DOOMREL = 9039, NPC_DOPEREL = 9040, + NPC_WATCHER_DOOMGRIP = 9476, + NPC_WARBRINGER_CONST = 8905, // Four of them in Relict Vault are related to Doomgrip summon event GO_ARENA_1 = 161525, GO_ARENA_2 = 161522, @@ -48,6 +52,9 @@ enum GO_SPECTRAL_CHALICE = 164869, GO_CHEST_SEVEN = 169243, GO_ARENA_SPOILS = 181074, + GO_SECRET_DOOR = 174553, + + SPELL_STONED = 10255, // Aura of Warbringer Constructs in Relict Vault }; enum ArenaNPCs @@ -88,6 +95,9 @@ static const uint32 aArenaNPCs[] = NPC_GOROSH, NPC_GRIZZLE, NPC_EVISCERATOR, NPC_OKTHOR, NPC_ANUBSHIAH, NPC_HEDRUM }; +// Used to summon Watcher Doomgrip +static const float aVaultPositions[4] = {821.905f, -338.382f, -50.134f, 3.78736f}; + class MANGOS_DLL_DECL instance_blackrock_depths : public ScriptedInstance { public: @@ -97,6 +107,7 @@ class MANGOS_DLL_DECL instance_blackrock_depths : public ScriptedInstance void Initialize(); void OnCreatureCreate(Creature* pCreature); + void OnCreatureDeath(Creature* pCreature); void OnObjectCreate(GameObject* pGo); void SetData(uint32 uiType, uint32 uiData); @@ -115,8 +126,11 @@ class MANGOS_DLL_DECL instance_blackrock_depths : public ScriptedInstance std::string m_strInstData; uint32 m_uiBarAleCount; + uint8 m_uiCofferDoorsOpened; float m_fArenaCenterX, m_fArenaCenterY, m_fArenaCenterZ; + + GUIDSet m_sVaultNpcGuids; }; #endif diff --git a/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp b/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp index 2798518..24f3833 100644 --- a/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp +++ b/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp @@ -26,6 +26,7 @@ EndScriptData */ instance_blackrock_depths::instance_blackrock_depths(Map* pMap) : ScriptedInstance(pMap), m_uiBarAleCount(0), + m_uiCofferDoorsOpened(0), m_fArenaCenterX(0.0f), m_fArenaCenterY(0.0f), @@ -54,6 +55,17 @@ void instance_blackrock_depths::OnCreatureCreate(Creature* pCreature) case NPC_DOPEREL: m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid(); break; + + case NPC_WARBRINGER_CONST: + // Golems not in the Relict Vault? + if (std::abs(pCreature->GetPositionZ() - aVaultPositions[2]) > 1.0f || !pCreature->IsWithinDist2d(aVaultPositions[0], aVaultPositions[1], 20.0f)) + break; + // Golems in Relict Vault need to have a stoned aura, set manually to prevent reapply when reached home + pCreature->CastSpell(pCreature, SPELL_STONED, true); + // Store the Relict Vault Golems into m_sVaultNpcGuids + case NPC_WATCHER_DOOMGRIP: + m_sVaultNpcGuids.insert(pCreature->GetObjectGuid()); + break; } } @@ -81,6 +93,7 @@ void instance_blackrock_depths::OnObjectCreate(GameObject* pGo) case GO_SPECTRAL_CHALICE: case GO_CHEST_SEVEN: case GO_ARENA_SPOILS: + case GO_SECRET_DOOR: break; default: @@ -100,6 +113,34 @@ void instance_blackrock_depths::SetData(uint32 uiType, uint32 uiData) m_auiEncounter[0] = uiData; break; case TYPE_VAULT: + if (uiData == SPECIAL) + { + ++m_uiCofferDoorsOpened; + + if (m_uiCofferDoorsOpened == MAX_RELIC_DOORS) + { + SetData(TYPE_VAULT, IN_PROGRESS); + + Creature* pConstruct = NULL; + + // Activate vault constructs + for (GUIDSet::const_iterator itr = m_sVaultNpcGuids.begin(); itr != m_sVaultNpcGuids.end(); ++itr) + { + if (pConstruct = instance->GetCreature(*itr)) + pConstruct->RemoveAurasDueToSpell(SPELL_STONED); + } + + if (!pConstruct) + return; + + // Summon doomgrip + pConstruct->SummonCreature(NPC_WATCHER_DOOMGRIP, aVaultPositions[0], aVaultPositions[1], aVaultPositions[2], aVaultPositions[3], TEMPSUMMON_DEAD_DESPAWN, 0); + } + // No need to store in this case + return; + } + if (uiData == DONE) + DoUseDoorOrButton(GO_SECRET_DOOR); m_auiEncounter[1] = uiData; break; case TYPE_BAR: @@ -115,7 +156,7 @@ void instance_blackrock_depths::SetData(uint32 uiType, uint32 uiData) DoUseDoorOrButton(GO_TOMB_ENTER); break; case FAIL: - if (m_auiEncounter[3] == IN_PROGRESS)//prevent use more than one time + if (m_auiEncounter[3] == IN_PROGRESS) // Prevent use more than one time DoUseDoorOrButton(GO_TOMB_ENTER); break; case DONE: @@ -230,6 +271,24 @@ void instance_blackrock_depths::OnCreatureEvade(Creature* pCreature) } } +void instance_blackrock_depths::OnCreatureDeath(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_WARBRINGER_CONST: + case NPC_WATCHER_DOOMGRIP: + if (GetData(TYPE_VAULT) == IN_PROGRESS) + { + m_sVaultNpcGuids.erase(pCreature->GetObjectGuid()); + + // If all event npcs dead then set event to done + if (m_sVaultNpcGuids.empty()) + SetData(TYPE_VAULT, DONE); + } + break; + } +} + InstanceData* GetInstanceData_instance_blackrock_depths(Map* pMap) { return new instance_blackrock_depths(pMap); diff --git a/scripts/eastern_kingdoms/blackwing_lair/blackwing_lair.h b/scripts/eastern_kingdoms/blackwing_lair/blackwing_lair.h index de3fe7f..dac1ff7 100644 --- a/scripts/eastern_kingdoms/blackwing_lair/blackwing_lair.h +++ b/scripts/eastern_kingdoms/blackwing_lair/blackwing_lair.h @@ -27,6 +27,7 @@ enum NPC_CHROMAGGUS = 14020, NPC_NEFARIAN = 11583, NPC_LORD_NEFARIAN = 10162, + NPC_BLACKWING_TECHNICIAN = 13996, // Flees at Vael intro event GO_DOOR_RAZORGORE_ENTER = 176964, GO_DOOR_RAZORGORE_EXIT = 176965, @@ -35,9 +36,12 @@ enum GO_DOOR_CHROMAGGUS_SIDE = 179116, GO_DOOR_CHROMAGGUS_EXIT = 179117, GO_DOOR_VAELASTRASZ = 179364, - GO_DOOR_LASHLAYER = 179365 + GO_DOOR_LASHLAYER = 179365, }; +// Coords used to spawn Nefarius at the throne +static const float aNefariusSpawnLoc[4] = {-7466.16f, -1040.80f, 412.053f, 2.14675f}; + class MANGOS_DLL_DECL instance_blackwing_lair : public ScriptedInstance { public: @@ -47,6 +51,7 @@ class MANGOS_DLL_DECL instance_blackwing_lair : public ScriptedInstance void Initialize(); bool IsEncounterInProgress() const; + void OnCreatureCreate(Creature* pCreature); void OnObjectCreate(GameObject* pGo); void SetData(uint32 uiType, uint32 uiData); @@ -58,6 +63,8 @@ class MANGOS_DLL_DECL instance_blackwing_lair : public ScriptedInstance protected: std::string m_strInstData; uint32 m_auiEncounter[MAX_ENCOUNTER]; + + GUIDList m_lTechnicianGuids; }; #endif diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp index 473b60c..9e3b8c8 100644 --- a/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp @@ -135,10 +135,10 @@ struct MANGOS_DLL_DECL boss_nefarianAI : public ScriptedAI DoScriptText(SAY_AGGRO, m_creature); // Remove flying in case Nefarian aggroes before his combat point was reached - if (m_creature->HasSplineFlag(SPLINEFLAG_FLYING)) + if (m_creature->IsLevitating()) { m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, 0); - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); } DoCastSpellIfCan(m_creature, SPELL_SHADOWFLAME_INITIAL); diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp index e444072..0ec44c6 100644 --- a/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp @@ -31,17 +31,30 @@ enum SAY_LINE_3 = -1469028, SAY_HALFLIFE = -1469029, SAY_KILLTARGET = -1469030, - SAY_NEFARIUS_CORRUPT = -1469006, //when he corrupts Vaelastrasz; possible to start the event by arrea trigger id = 3626 + SAY_NEFARIUS_CORRUPT_1 = -1469006, // When he corrupts Vaelastrasz + SAY_NEFARIUS_CORRUPT_2 = -1469032, + SAY_TECHNICIAN_RUN = -1469034, SPELL_ESSENCE_OF_THE_RED = 23513, SPELL_FLAME_BREATH = 23461, SPELL_FIRE_NOVA = 23462, SPELL_TAIL_SWEEP = 15847, SPELL_BURNING_ADRENALINE = 23620, - SPELL_CLEAVE = 20684 // Chain cleave is most likely named something different and contains a dummy effect -}; + SPELL_CLEAVE = 20684, // Chain cleave is most likely named something different and contains a dummy effect + + SPELL_NEFARIUS_CORRUPTION = 23642, -#define GOSSIP_ITEM "Start Event " + GOSSIP_ITEM_VAEL_1 = -3469003, + GOSSIP_ITEM_VAEL_2 = -3469004, + // Vael Gossip texts might be 7156 and 7256; At the moment are missing from DB + // For the moment add the default values + GOSSIP_TEXT_VAEL_1 = 384, + GOSSIP_TEXT_VAEL_2 = 384, + + FACTION_HOSTILE = 14, + + AREATRIGGER_VAEL_INTRO = 3626, +}; struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI { @@ -50,15 +63,20 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); Reset(); - // TODO Research what actually is supposed to happen here - pCreature->setFaction(35); + // Set stand state to dead before the intro event + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); } ScriptedInstance* m_pInstance; + ObjectGuid m_nefariusGuid; + uint32 m_uiIntroTimer; + uint8 m_uiIntroPhase; + ObjectGuid m_playerGuid; - uint32 m_uiSpeachTimer; - uint32 m_uiSpeachNum; + uint32 m_uiSpeechTimer; + uint8 m_uiSpeechNum; + uint32 m_uiCleaveTimer; uint32 m_uiFlameBreathTimer; uint32 m_uiFireNovaTimer; @@ -66,14 +84,15 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI uint32 m_uiBurningAdrenalineTankTimer; uint32 m_uiTailSweepTimer; bool m_bHasYelled; - bool mbIsDoingSpeach; void Reset() { m_playerGuid.Clear(); - m_uiSpeachTimer = 0; - m_uiSpeachNum = 0; + m_uiIntroTimer = 0; + m_uiIntroPhase = 0; + m_uiSpeechTimer = 0; + m_uiSpeechNum = 0; m_uiCleaveTimer = 8000; // These times are probably wrong m_uiFlameBreathTimer = 11000; m_uiBurningAdrenalineCasterTimer = 15000; @@ -81,20 +100,33 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI m_uiFireNovaTimer = 5000; m_uiTailSweepTimer = 20000; m_bHasYelled = false; - mbIsDoingSpeach = false; + + // Creature should have only 1/3 of hp + m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.3)); } - void BeginSpeach(Unit* target) + void BeginIntro() + { + // Start Intro delayed + m_uiIntroTimer = 1000; + + if (m_pInstance) + m_pInstance->SetData(TYPE_VAELASTRASZ, SPECIAL); + } + + void BeginSpeech(Player* pTarget) { // Stand up and begin speach - m_playerGuid = target->GetObjectGuid(); + m_playerGuid = pTarget->GetObjectGuid(); // 10 seconds DoScriptText(SAY_LINE_1, m_creature); - m_uiSpeachTimer = 10000; - m_uiSpeachNum = 0; - mbIsDoingSpeach = true; + // Make boss stand + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + m_uiSpeechTimer = 10000; + m_uiSpeechNum = 0; } void KilledUnit(Unit* pVictim) @@ -110,6 +142,7 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI if (m_pInstance) m_pInstance->SetData(TYPE_VAELASTRASZ, IN_PROGRESS); + // Buff players on aggro DoCastSpellIfCan(m_creature, SPELL_ESSENCE_OF_THE_RED); } @@ -125,45 +158,85 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI m_pInstance->SetData(TYPE_VAELASTRASZ, FAIL); } + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_LORD_NEFARIAN) + { + // Set not selectable, so players won't interact with it + pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_nefariusGuid = pSummoned->GetObjectGuid(); + } + } + void UpdateAI(const uint32 uiDiff) { - // Speach - if (mbIsDoingSpeach) + if (m_uiIntroTimer) + { + if (m_uiIntroTimer <= uiDiff) + { + switch (m_uiIntroPhase) + { + case 0: + m_creature->SummonCreature(NPC_LORD_NEFARIAN, aNefariusSpawnLoc[0], aNefariusSpawnLoc[1], aNefariusSpawnLoc[2], aNefariusSpawnLoc[3], TEMPSUMMON_TIMED_DESPAWN, 25000); + m_uiIntroTimer = 1000; + break; + case 1: + if (Creature* pNefarius = m_creature->GetMap()->GetCreature(m_nefariusGuid)) + { + pNefarius->CastSpell(m_creature, SPELL_NEFARIUS_CORRUPTION, true); + DoScriptText(SAY_NEFARIUS_CORRUPT_1, pNefarius); + } + m_uiIntroTimer = 16000; + break; + case 2: + if (Creature* pNefarius = m_creature->GetMap()->GetCreature(m_nefariusGuid)) + DoScriptText(SAY_NEFARIUS_CORRUPT_2, pNefarius); + + // Set npc flags now + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_uiIntroTimer = 0; + break; + } + ++m_uiIntroPhase; + } + else + m_uiIntroTimer -= uiDiff; + } + + // Speech + if (m_uiSpeechTimer) { - if (m_uiSpeachTimer < uiDiff) + if (m_uiSpeechTimer <= uiDiff) { - switch (m_uiSpeachNum) + switch (m_uiSpeechNum) { case 0: // 16 seconds till next line DoScriptText(SAY_LINE_2, m_creature); - m_uiSpeachTimer = 16000; - ++m_uiSpeachNum; + m_uiSpeechTimer = 16000; + ++m_uiSpeechNum; break; case 1: // This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!" DoScriptText(SAY_LINE_3, m_creature); - m_uiSpeachTimer = 10000; - ++m_uiSpeachNum; + m_uiSpeechTimer = 10000; + ++m_uiSpeechNum; break; case 2: - m_creature->setFaction(103); - m_creature->SetHealth(int(m_creature->GetMaxHealth()*.3)); + m_creature->setFaction(FACTION_HOSTILE); if (m_playerGuid) { if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGuid)) AttackStart(pPlayer); - - DoCastSpellIfCan(m_creature, SPELL_ESSENCE_OF_THE_RED); } - m_uiSpeachTimer = 0; - mbIsDoingSpeach = false; + m_uiSpeechTimer = 0; break; } } else - m_uiSpeachTimer -= uiDiff; + m_uiSpeechTimer -= uiDiff; } // Return since we have no target @@ -198,20 +271,24 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI // Burning Adrenaline Caster Timer if (m_uiBurningAdrenalineCasterTimer < uiDiff) { - Unit* pTarget = NULL; + std::vector vManaPlayers; - // TODO Target Selection must be improved! - int i = 0 ; - while (i < 3) // max 3 tries to get a random target with power_mana + // Scan for mana targets in threat list + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + vManaPlayers.reserve(tList.size()); + for (ThreatList::const_iterator iter = tList.begin();iter != tList.end(); ++iter) { - ++i; - pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); - if (pTarget) - if (pTarget->getPowerType() == POWER_MANA) - i=3; + Unit* pTempTarget = m_creature->GetMap()->GetUnit((*iter)->getUnitGuid()); + + if (pTempTarget && pTempTarget->getPowerType() == POWER_MANA && pTempTarget->GetTypeId() == TYPEID_PLAYER) + vManaPlayers.push_back(pTempTarget); } - if (pTarget) // cast on self (see below) - pTarget->CastSpell(pTarget, SPELL_BURNING_ADRENALINE, true); + + if (vManaPlayers.empty()) + return; + + Unit* pTarget = vManaPlayers[urand(0, vManaPlayers.size() - 1)]; + pTarget->CastSpell(pTarget, SPELL_BURNING_ADRENALINE, true, NULL, NULL, m_creature->GetObjectGuid()); m_uiBurningAdrenalineCasterTimer = 15000; } @@ -223,7 +300,7 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI { // have the victim cast the spell on himself otherwise the third effect aura will be applied // to Vael instead of the player - m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_BURNING_ADRENALINE, true); + m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_BURNING_ADRENALINE, true, NULL, NULL, m_creature->GetObjectGuid()); m_uiBurningAdrenalineTankTimer = 45000; } @@ -254,12 +331,17 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI bool GossipSelect_boss_vaelastrasz(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) { - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) // Fight time + switch (uiAction) { - pPlayer->CLOSE_GOSSIP_MENU(); - - if (boss_vaelastraszAI* pVaelAI = dynamic_cast(pCreature->AI())) - pVaelAI->BeginSpeach((Unit*)pPlayer); + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VAEL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_VAEL_2, pCreature->GetObjectGuid()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->CLOSE_GOSSIP_MENU(); + if (boss_vaelastraszAI* pVaelAI = dynamic_cast(pCreature->AI())) + pVaelAI->BeginSpeech(pPlayer); + break; } return true; @@ -270,8 +352,8 @@ bool GossipHello_boss_vaelastrasz(Player* pPlayer, Creature* pCreature) if (pCreature->isQuestGiver()) pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid()); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetObjectGuid()); + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VAEL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_VAEL_1, pCreature->GetObjectGuid()); return true; } @@ -281,6 +363,30 @@ CreatureAI* GetAI_boss_vaelastrasz(Creature* pCreature) return new boss_vaelastraszAI(pCreature); } +bool AreaTrigger_at_vaelastrasz(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (pAt->id == AREATRIGGER_VAEL_INTRO) + { + if (pPlayer->isGameMaster() || pPlayer->isDead()) + return false; + + if (instance_blackwing_lair* pInstance = (instance_blackwing_lair*)pPlayer->GetInstanceData()) + { + // Handle intro event + if (pInstance->GetData(TYPE_VAELASTRASZ) == NOT_STARTED) + { + if (Creature* pVaelastrasz = pInstance->GetSingleCreatureFromStorage(NPC_VAELASTRASZ)) + if (boss_vaelastraszAI* pVaelAI = dynamic_cast(pVaelastrasz->AI())) + pVaelAI->BeginIntro(); + } + + // ToDo: make goblins flee + } + } + + return false; +} + void AddSC_boss_vaelastrasz() { Script* pNewScript; @@ -291,4 +397,9 @@ void AddSC_boss_vaelastrasz() pNewScript->pGossipHello = &GossipHello_boss_vaelastrasz; pNewScript->pGossipSelect = &GossipSelect_boss_vaelastrasz; pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_vaelastrasz"; + pNewScript->pAreaTrigger = &AreaTrigger_at_vaelastrasz; + pNewScript->RegisterSelf(); } diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp index 35eebc3..a334705 100644 --- a/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp @@ -148,11 +148,11 @@ struct MANGOS_DLL_DECL boss_victor_nefariusAI : public ScriptedAI { if (pSummoned->GetEntry() == NPC_NEFARIAN) { - pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSummoned->SetWalk(false); // see boss_onyxia (also note the removal of this in boss_nefarian) pSummoned->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); - pSummoned->AddSplineFlag(SPLINEFLAG_FLYING); + pSummoned->SetLevitate(true); // Let Nefarian fly towards combat area pSummoned->GetMotionMaster()->MovePoint(1, aNefarianLocs[4].m_fX, aNefarianLocs[4].m_fY, aNefarianLocs[4].m_fZ); diff --git a/scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp b/scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp index e9c0ca4..33fbba3 100644 --- a/scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp +++ b/scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp @@ -44,6 +44,21 @@ bool instance_blackwing_lair::IsEncounterInProgress() const return false; } +void instance_blackwing_lair::OnCreatureCreate(Creature* pCreature) +{ + switch (pCreature->GetEntry()) + { + case NPC_BLACKWING_TECHNICIAN: + // Sort creatures so we can get only the ones near Vaelastrasz + if (pCreature->IsWithinDist2d(aNefariusSpawnLoc[0], aNefariusSpawnLoc[1], 50.0f)) + m_lTechnicianGuids.push_back(pCreature->GetObjectGuid()); + break; + case NPC_VAELASTRASZ: + m_mNpcEntryGuidStore[NPC_VAELASTRASZ] = pCreature->GetObjectGuid(); + break; + } +} + void instance_blackwing_lair::OnObjectCreate(GameObject* pGo) { switch(pGo->GetEntry()) @@ -89,8 +104,9 @@ void instance_blackwing_lair::SetData(uint32 uiType, uint32 uiData) break; case TYPE_VAELASTRASZ: m_auiEncounter[uiType] = uiData; - // Prevent the players from running back to the first room - DoUseDoorOrButton(GO_DOOR_RAZORGORE_EXIT); + // Prevent the players from running back to the first room; use if the encounter is not special + if (uiData != SPECIAL) + DoUseDoorOrButton(GO_DOOR_RAZORGORE_EXIT); if (uiData == DONE) DoUseDoorOrButton(GO_DOOR_VAELASTRASZ); break; diff --git a/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp b/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp index ae31c9a..64c1f1f 100644 --- a/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp +++ b/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp @@ -172,13 +172,13 @@ void instance_deadmines::Update(uint32 uiDiff) // should be static spawns, fetch the closest ones at the pier if (Creature* pi1 = GetClosestCreatureWithEntry(pDoor, NPC_PIRATE, 40.0f)) { - pi1->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pi1->SetWalk(false); pi1->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ()); } if (Creature* pi2 = GetClosestCreatureWithEntry(pDoor, NPC_SQUALLSHAPER, 40.0f)) { - pi2->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pi2->SetWalk(false); pi2->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ()); } } diff --git a/scripts/eastern_kingdoms/hinterlands.cpp b/scripts/eastern_kingdoms/hinterlands.cpp index a5d4809..0994175 100644 --- a/scripts/eastern_kingdoms/hinterlands.cpp +++ b/scripts/eastern_kingdoms/hinterlands.cpp @@ -232,7 +232,7 @@ struct MANGOS_DLL_DECL npc_rinjiAI : public npc_escortAI void JustSummoned(Creature* pSummoned) { - pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); pSummoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); } diff --git a/scripts/eastern_kingdoms/ironforge.cpp b/scripts/eastern_kingdoms/ironforge.cpp index 1dca0c6..ec935fc 100644 --- a/scripts/eastern_kingdoms/ironforge.cpp +++ b/scripts/eastern_kingdoms/ironforge.cpp @@ -23,6 +23,8 @@ EndScriptData */ /* ContentData npc_royal_historian_archesonus +King Magni Bronzebeard +High Tinker Mekkatorque EndContentData */ #include "precompiled.h" @@ -81,6 +83,155 @@ bool GossipSelect_npc_royal_historian_archesonus(Player* pPlayer, Creature* pCre return true; } +/*###### +## King Magni Bronzebeard +######*/ + +enum +{ + SPELL_AVATAR = 19135, + SPELL_KNOCK_AWAY = 20686, + SPELL_STORM_BOLT = 20685, + //SPELL_MOTRAL_STRIKE = 13737, + //SPELL_STRONG_CLEAVE = 8255, + //SPELL_RAMPAGE = 8285, + //SPELL_CONCUSSION_BLOW = 12809 +}; + +struct MANGOS_DLL_DECL boss_king_magni_bronzebreardAI : public ScriptedAI +{ + boss_king_magni_bronzebreardAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiAvatarTimer; + uint32 m_uiKnockAwayTimer; + uint32 m_uiStormboltTimer; + + void Reset() + { + m_uiAvatarTimer = 15000; + m_uiKnockAwayTimer = 8000; + m_uiStormboltTimer = 10000; + } + + void Aggro(Unit *who) + { + m_creature->CallForHelp(100); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiAvatarTimer < uiDiff) + { + DoCast(m_creature, SPELL_AVATAR); + m_uiAvatarTimer = urand(15000, 12000); + } + else + m_uiAvatarTimer -= uiDiff; + + if (m_uiKnockAwayTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); + m_uiKnockAwayTimer = urand(8000, 12000); + } + else + m_uiKnockAwayTimer -= uiDiff; + + if (m_uiStormboltTimer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_STORM_BOLT); + m_uiStormboltTimer = 10000; + } + else + m_uiStormboltTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_king_magni_bronzebreard(Creature* pCreature) +{ + return new boss_king_magni_bronzebreardAI(pCreature); +} + +/*###### +## High Tinker Mekkatorque +######*/ + +enum +{ + SPELL_BOMB = 9143, + SPELL_GOBLIN_DRAGON_GUN = 22739, + SPELL_SUPER_SHRINK_RAY = 22742, + + //SPELL_IRON_GRENADE = 4068, + //SPELL_HI_EXP_BOMB = 12543, + //SPELL_MITHRIL_FRAG_BOMB = 12421, + //SPELL_BIG_IRON_BOMB = 4069 +}; + +struct MANGOS_DLL_DECL boss_high_tinker_mekkatorqueAI : public ScriptedAI +{ + boss_high_tinker_mekkatorqueAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiBombTimer; + uint32 m_uiGoblinDragonGunTimer; + uint32 m_uiSuperShrinkRayTimer; + + void Reset() + { + m_uiBombTimer = 10000; + m_uiGoblinDragonGunTimer = 15000; + m_uiSuperShrinkRayTimer = 15000; + } + + void Aggro(Unit *who) + { + m_creature->CallForHelp(100); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiBombTimer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_BOMB); + m_uiBombTimer = urand(8000, 15000); + } + else + m_uiBombTimer -= uiDiff; + + if (m_uiGoblinDragonGunTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN); + m_uiGoblinDragonGunTimer = urand(15000, 20000); + } + else + m_uiGoblinDragonGunTimer -= uiDiff; + + if (m_uiSuperShrinkRayTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_SUPER_SHRINK_RAY); + m_uiSuperShrinkRayTimer = urand(15000, 20000); + } + else + m_uiSuperShrinkRayTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_high_tinker_mekkatorque(Creature* pCreature) +{ + return new boss_high_tinker_mekkatorqueAI(pCreature); +} + void AddSC_ironforge() { Script *newscript; @@ -90,4 +241,14 @@ void AddSC_ironforge() newscript->pGossipHello = &GossipHello_npc_royal_historian_archesonus; newscript->pGossipSelect = &GossipSelect_npc_royal_historian_archesonus; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_king_magni_bronzebreard"; + newscript->GetAI = &GetAI_boss_king_magni_bronzebreard; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_high_tinker_mekkatorque"; + newscript->GetAI = &GetAI_boss_high_tinker_mekkatorque; + newscript->RegisterSelf(); } diff --git a/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp b/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp index fd23dc9..fe6ab3d 100644 --- a/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp +++ b/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp @@ -120,7 +120,7 @@ struct MANGOS_DLL_DECL boss_selin_fireheartAI : public ScriptedAI float x, y, z; // coords that we move to, close to the crystal. pCrystalChosen->GetClosePoint(x, y, z, m_creature->GetObjectBoundingRadius(), CONTACT_DISTANCE); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_creature->GetMotionMaster()->MovePoint(1, x, y, z); m_bDrainingCrystal = true; } diff --git a/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp b/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp index f3a9023..7d2a422 100644 --- a/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp +++ b/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp @@ -245,20 +245,19 @@ struct MANGOS_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI if (m_uiHammerTimer < uiDiff) { // Select a target with mana-bar - std::list lValidTargets; + std::vector vValidTargets; ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + vValidTargets.reserve(tList.size()); for (ThreatList::const_iterator iter = tList.begin(); iter != tList.end(); ++iter) { Unit* pTempTarget = m_creature->GetMap()->GetUnit((*iter)->getUnitGuid()); if (pTempTarget && pTempTarget->getPowerType() == POWER_MANA) - lValidTargets.push_back(pTempTarget); + vValidTargets.push_back(pTempTarget); } - if (!lValidTargets.empty()) + if (!vValidTargets.empty()) { - std::list::const_iterator itr = lValidTargets.begin(); - advance(itr, urand(0, lValidTargets.size() - 1)); - if (DoCastSpellIfCan(*itr, SPELL_MIGHT_OF_RAGNAROS) == CAST_OK) + if (DoCastSpellIfCan(vValidTargets[urand(0, vValidTargets.size() -1)], SPELL_MIGHT_OF_RAGNAROS) == CAST_OK) { DoScriptText(SAY_HAMMER, m_creature); m_uiHammerTimer = 11000; diff --git a/scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp b/scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp index 03d8478..9b1925c 100644 --- a/scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp +++ b/scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp @@ -1,4 +1,5 @@ /* Copyright (C) 2006 - 2011 ScriptDev2 + Copyright (C) 2011 MangosR2_ScriptDev2 * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -16,8 +17,9 @@ /* ScriptData SDName: Ebon_Hold -SD%Complete: 85 -SDComment: Quest support: 12848, 12733, 12739(and 12742 to 12750), 12727, 12698. +SD%Complete: 95% ---- still a few minor bugs here and there +SDComment: Quest support: 12641, 12701, 12848, 12733, 12739(and 12742 to 12750), 12720, 12727, 12698. Special Npc (npc_valkyr_battle_maiden) +ToDo: SDCategory: Ebon Hold EndScriptData */ @@ -27,12 +29,27 @@ npc_death_knight_initiate npc_unworthy_initiate_anchor npc_unworthy_initiate go_acherus_soul_prison +npc_koltira_deathweaver +Mob scarlet miner +npc_scarlet_miner mob_scarlet_ghoul +Gothik +npc_eye_of_acherus +npc_mine_cart +scourge_gryphon +npc_valkyr_battle_maiden +npc_crusade_persuaded EndContentData */ #include "precompiled.h" #include "escort_ai.h" #include "ObjectMgr.h" +#include "TemporarySummon.h" +#include "WorldPacket.h" +#include "Vehicle.h" +// not inuse yet but will be +//#define LESS_LAG // if you do not have a good server and do not want it to be laggy as hell -- uncomment this if you do + /*###### ## npc_a_special_surprise @@ -510,6 +527,11 @@ enum SPELL_DUEL_VICTORY = 52994, SPELL_DUEL_FLAG = 52991, + SPELL_BLOOD_STRIKE_DUEL = 52374, + SPELL_DEATH_COIL_DUEL = 52375, + SPELL_ICY_TOUCH_DUEL = 52372, + SPELL_PLAGUE_STRIKE_DUEL = 52373, + QUEST_DEATH_CHALLENGE = 12733, FACTION_HOSTILE = 2068 }; @@ -528,6 +550,10 @@ struct MANGOS_DLL_DECL npc_death_knight_initiateAI : public ScriptedAI ObjectGuid m_duelerGuid; uint32 m_uiDuelTimer; bool m_bIsDuelInProgress; + uint32 m_uiBloodStrike_Timer; + uint32 m_uiDeathCoil_Timer; + uint32 m_uiIcyTouch_Timer; + uint32 m_uiPlagueStrike_Timer; void Reset() { @@ -539,6 +565,10 @@ struct MANGOS_DLL_DECL npc_death_knight_initiateAI : public ScriptedAI m_duelerGuid.Clear(); m_uiDuelTimer = 5000; m_bIsDuelInProgress = false; + m_uiBloodStrike_Timer = 4000; + m_uiDeathCoil_Timer = 6000; + m_uiIcyTouch_Timer = 2000; + m_uiPlagueStrike_Timer = 5000; } void AttackedBy(Unit* pAttacker) @@ -594,7 +624,37 @@ struct MANGOS_DLL_DECL npc_death_knight_initiateAI : public ScriptedAI return; } - // TODO: spells + if (m_uiBloodStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BLOOD_STRIKE_DUEL); + m_uiBloodStrike_Timer = 9000; + } + else + m_uiBloodStrike_Timer -= uiDiff; + + if (m_uiDeathCoil_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_DEATH_COIL_DUEL); + m_uiDeathCoil_Timer = 8000; + } + else + m_uiDeathCoil_Timer -= uiDiff; + + if (m_uiIcyTouch_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ICY_TOUCH_DUEL); + m_uiIcyTouch_Timer = 8000; + } + else + m_uiIcyTouch_Timer -= uiDiff; + + if (m_uiPlagueStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_PLAGUE_STRIKE_DUEL); + m_uiPlagueStrike_Timer = 8000; + } + else + m_uiPlagueStrike_Timer -= uiDiff; DoMeleeAttackIfReady(); } @@ -659,14 +719,13 @@ enum eKoltira SPELL_KOLTIRA_TRANSFORM = 52899, SPELL_ANTI_MAGIC_ZONE = 52894, - QUEST_BREAKOUT = 12727, + QUEST_BLOODY_BREAKOUT = 12727, NPC_CRIMSON_ACOLYTE = 29007, NPC_HIGH_INQUISITOR_VALROTH = 29001, NPC_KOLTIRA_ALT = 28447, + NPC_KOLTIRA = 28912, - //not sure about this id - //NPC_DEATH_KNIGHT_MOUNT = 29201, MODEL_DEATH_KNIGHT_MOUNT = 25278 }; @@ -684,6 +743,7 @@ struct MANGOS_DLL_DECL npc_koltira_deathweaverAI : public npc_escortAI { m_uiWave = 0; m_uiWave_Timer = 3000; + m_creature->UpdateEntry(NPC_KOLTIRA); // needs to go back to regular entry at reset m_valrothGuid.Clear(); } } @@ -700,14 +760,13 @@ struct MANGOS_DLL_DECL npc_koltira_deathweaverAI : public npc_escortAI break; case 2: m_creature->SetStandState(UNIT_STAND_STATE_STAND); - //m_creature->UpdateEntry(NPC_KOLTIRA_ALT); //unclear if we must update or not - DoCastSpellIfCan(m_creature, SPELL_KOLTIRA_TRANSFORM); + DoCast(m_creature, SPELL_KOLTIRA_TRANSFORM); // spell to show graphic changes break; case 3: - SetEscortPaused(true); + SetEscortPaused(true); // needs to pause wp movement m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); DoScriptText(SAY_BREAKOUT2, m_creature); - DoCastSpellIfCan(m_creature, SPELL_ANTI_MAGIC_ZONE); // cast again that makes bubble up + m_creature->UpdateEntry(NPC_KOLTIRA_ALT); // actual change // used to update to npc w antimagic zone template aura read sql for more notes break; case 4: SetRun(true); @@ -740,33 +799,41 @@ struct MANGOS_DLL_DECL npc_koltira_deathweaverAI : public npc_escortAI { if (HasEscortState(STATE_ESCORT_PAUSED)) { + if(m_uiWave < 4 && !m_creature->HasAura(SPELL_ANTI_MAGIC_ZONE)) + DoCast(m_creature, SPELL_ANTI_MAGIC_ZONE, true); + if (m_uiWave_Timer < uiDiff) { switch(m_uiWave) { case 0: + SetCombatMovement(false); // needed or he moves and doesnt stay in place DoScriptText(SAY_BREAKOUT3, m_creature); SummonAcolyte(3); m_uiWave_Timer = 20000; break; case 1: + SetCombatMovement(false); // needed or he moves and doesnt stay in place DoScriptText(SAY_BREAKOUT4, m_creature); SummonAcolyte(3); m_uiWave_Timer = 20000; break; case 2: + SetCombatMovement(false); // needed or he moves and doesnt stay in place DoScriptText(SAY_BREAKOUT5, m_creature); SummonAcolyte(4); m_uiWave_Timer = 20000; break; case 3: + SetCombatMovement(false); // needed or he moves and doesnt stay in place DoScriptText(SAY_BREAKOUT6, m_creature); m_creature->SummonCreature(NPC_HIGH_INQUISITOR_VALROTH, 1642.329f, -6045.818f, 127.583f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); m_uiWave_Timer = 1000; break; + // missing script text 7 = SAY_BREAKOUT7 case 4: { - Creature* pTemp = m_creature->GetMap()->GetCreature(m_valrothGuid); + Creature* pTemp = m_creature->GetMap()->GetCreature(m_valrothGuid); // var to get valroth 's guid if (!pTemp || !pTemp->isAlive()) { @@ -782,12 +849,13 @@ struct MANGOS_DLL_DECL npc_koltira_deathweaverAI : public npc_escortAI } case 5: DoScriptText(SAY_BREAKOUT9, m_creature); - m_creature->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); + SetCombatMovement(true); // OK,OK deathweaver do your thing + m_creature->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); // this will remove the aura before he takes off m_uiWave_Timer = 2500; break; case 6: DoScriptText(SAY_BREAKOUT10, m_creature); - SetEscortPaused(false); + SetEscortPaused(false); // moving on wp is ok now break; } @@ -811,7 +879,7 @@ CreatureAI* GetAI_npc_koltira_deathweaver(Creature* pCreature) bool QuestAccept_npc_koltira_deathweaver(Player* pPlayer, Creature* pCreature, const Quest* pQuest) { - if (pQuest->GetQuestId() == QUEST_BREAKOUT) + if (pQuest->GetQuestId() == QUEST_BLOODY_BREAKOUT) { pCreature->SetStandState(UNIT_STAND_STATE_STAND); @@ -822,7 +890,7 @@ bool QuestAccept_npc_koltira_deathweaver(Player* pPlayer, Creature* pCreature, c } /*###### -## +## npc_unworthy_initiate_anchor ######*/ enum @@ -879,10 +947,6 @@ DisplayToSpell m_aDisplayToSpell[] = {25373, 51551} // belf M }; -/*###### -## npc_unworthy_initiate_anchor -######*/ - struct MANGOS_DLL_DECL npc_unworthy_initiate_anchorAI : public ScriptedAI { npc_unworthy_initiate_anchorAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } @@ -1174,7 +1238,7 @@ struct MANGOS_DLL_DECL npc_eye_of_acherusAI : public ScriptedAI m_isActive = false; } - void AttackStart(Unit *) + void AttackStart(Unit *pWho) { } @@ -1216,14 +1280,14 @@ struct MANGOS_DLL_DECL npc_eye_of_acherusAI : public ScriptedAI { m_creature->CastSpell(m_creature, SPELL_EYE_PHASEMASK, true); m_creature->CastSpell(m_creature, SPELL_EYE_VISUAL, true); - m_creature->CastSpell(m_creature, SPELL_EYE_FL_BOOST_FLY, true); + //m_creature->CastSpell(m_creature, SPELL_EYE_FL_BOOST_FLY, true); + //m_creature->SetLevitate(true); // will be uncommented if any troubles with flying inhabit 4 + m_creature->SetSpeedRate(MOVE_RUN, 5.0f); DoScriptText(TEXT_EYE_LAUNCHED, m_creature); m_creature->GetMotionMaster()->MovePoint(0,1750.8276f, -5873.788f, 147.2266f); m_isActive = true; } - } - else - m_creature->ForcedDespawn(); + } else m_creature->ForcedDespawn(); } }; @@ -1232,6 +1296,62 @@ CreatureAI* GetAI_npc_eye_of_acherus(Creature* pCreature) return new npc_eye_of_acherusAI(pCreature); } +/*###### +## Mob scarlet miner +######*/ +enum scarletminer +{ + QUEST_GIFT_THAT_KEEPS_GIVING = 12698, + SPELL_GIFT_OF_THE_HARVESTER_MISSILE = 52481, + SPELL_SUMMOM_GHOUL = 52490, + SPELL_SUMMON_GHOST = 52505, +}; + +struct MANGOS_DLL_DECL mob_scarlet_minerAI : public ScriptedAI +{ + mob_scarlet_minerAI(Creature *pCreature) : ScriptedAI(pCreature) + { + // NEEDS CORRECTED/OR SUPPORT IN CORE SO HACK CAN BE REMOVED + // hack spell 52481 + // 35% chance to summon ghoul + SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_GIFT_OF_THE_HARVESTER_MISSILE); + if (TempSpell && TempSpell->EffectImplicitTargetB[0] != 16) + { + TempSpell->EffectImplicitTargetB[0] = 16; + TempSpell->EffectImplicitTargetB[1] = 87; + TempSpell->EffectImplicitTargetB[2] = 16; + } + } + + void Reset() {} + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pCaster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && pSpell->Id == SPELL_GIFT_OF_THE_HARVESTER_MISSILE) + { + if(((Player*)pCaster)->GetQuestStatus(QUEST_GIFT_THAT_KEEPS_GIVING) == QUEST_STATUS_INCOMPLETE) + { + if (rand()%100 < 35) //35% chance to summon ghoul + { + pCaster->CastSpell(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),SPELL_SUMMOM_GHOUL, true); + } + else + { + pCaster->CastSpell(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),SPELL_SUMMON_GHOST, true); + } + + m_creature->SetDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + } + } + } +}; + +CreatureAI* GetAI_mob_scarlet_miner(Creature* pCreature) +{ + return new mob_scarlet_minerAI (pCreature); +}; + /*###### ## mob_scarlet_ghoul ######*/ @@ -1261,8 +1381,8 @@ struct MANGOS_DLL_DECL mob_scarlet_ghoulAI : public ScriptedAI { m_bIsSpawned = false; fDist = (float)urand(1, 5); - m_uiCreatorGuid = m_creature->GetCreatorGuid(); - if (Player* pOwner = m_creature->GetMap()->GetPlayer(m_uiCreatorGuid) ) + m_creatorGuid = m_creature->GetCreatorGuid(); + if (Player* pOwner = m_creature->GetMap()->GetPlayer(m_creatorGuid) ) fAngle = m_creature->GetAngle(pOwner); Reset(); @@ -1271,9 +1391,9 @@ struct MANGOS_DLL_DECL mob_scarlet_ghoulAI : public ScriptedAI Unit* pTarget; - ObjectGuid m_uiCreatorGuid; - ObjectGuid m_uiTargetGUID; - ObjectGuid m_uiHarvesterGUID; + ObjectGuid m_creatorGuid; + ObjectGuid m_targetGUID; + ObjectGuid m_harvesterGUID; uint32 m_uiWaitForThrowTimer; @@ -1288,15 +1408,18 @@ struct MANGOS_DLL_DECL mob_scarlet_ghoulAI : public ScriptedAI m_uiWaitForThrowTimer = 3000; m_bWaitForThrow = false; pTarget = NULL; + //m_creatorGuid.Clear(); + m_targetGUID.Clear(); + m_harvesterGUID.Clear(); } void MoveInLineOfSight(Unit *pWho) { if (!m_bWaitForThrow && pWho->GetEntry() == ENTRY_GOTHIK && m_creature->GetDistance(pWho) < 15.0f) { - m_uiHarvesterGUID = pWho->GetObjectGuid(); + m_harvesterGUID = pWho->GetObjectGuid(); - if (Player* pOwner = m_creature->GetMap()->GetPlayer(m_uiCreatorGuid) ) + if (Player* pOwner = m_creature->GetMap()->GetPlayer(m_creatorGuid) ) { pOwner->KilledMonsterCredit(m_creature->GetEntry(), m_creature->GetObjectGuid() ); // this will execute if m_creature survived Harvester's wrath @@ -1323,7 +1446,7 @@ struct MANGOS_DLL_DECL mob_scarlet_ghoulAI : public ScriptedAI { if (m_uiWaitForThrowTimer <= uiDiff) { - if (Creature* pGothik = m_creature->GetMap()->GetCreature(m_uiHarvesterGUID) ) + if (Creature* pGothik = m_creature->GetMap()->GetCreature(m_harvesterGUID) ) { if (pGothik->AI()->DoCastSpellIfCan(m_creature, roll_chance_i(50) ? 52519 : 52521) == CAST_OK) DoScriptText(SAY_SCARLET_GOTHIK1 - urand(0, 4), pGothik); @@ -1338,7 +1461,7 @@ struct MANGOS_DLL_DECL mob_scarlet_ghoulAI : public ScriptedAI return; } - Player* pOwner = m_creature->GetMap()->GetPlayer(m_uiCreatorGuid); + Player* pOwner = m_creature->GetMap()->GetPlayer(m_creatorGuid); if (!pOwner || !pOwner->IsInWorld()) { m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); @@ -1379,6 +1502,16 @@ void UpdateWorldState(Map *map, uint32 id, uint32 state) enum mograine { +/*#ifdef LESS_LAG + ENCOUNTER_DK_NUMBER = 5, // how many player queue to start the quest , or - + ENCOUNTER_DK_TIMER = 10, // *every 5 minutes. These have to be done in instance data + ENCOUNTER_DEFENDER_NUMBER = 10, // how many of defender + ENCOUNTER_EARTHSHATTER_NUMBER = 10, // how many of earthshatter + ENCOUNTER_ABOMINATION_NUMBER = 2, // how many of abomination + ENCOUNTER_BEHEMOTH_NUMBER = 1, // how many of behemoth + ENCOUNTER_GHOUL_NUMBER = 5, // how many of ghoul + ENCOUNTER_WARRIOR_NUMBER = 1, // how many of warrior +#else*/ ENCOUNTER_DK_NUMBER = 5, // how many player queue to start the quest , or - ENCOUNTER_DK_TIMER = 10, // *every 5 minutes. These have to be done in instance data ENCOUNTER_DEFENDER_NUMBER = 20, // how many of defender @@ -1387,6 +1520,8 @@ enum mograine ENCOUNTER_BEHEMOTH_NUMBER = 2, // how many of behemoth ENCOUNTER_GHOUL_NUMBER = 10, // how many of ghoul ENCOUNTER_WARRIOR_NUMBER = 2, // how many of warrior +//#endif + ENCOUNTER_TOTAL_DAWN = 300, // Total number ENCOUNTER_TOTAL_SCOURGE = 10000, @@ -1797,7 +1932,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI switch(i) { case 0: - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); SetEscortPaused(true); break; case 1: @@ -1838,7 +1973,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI bIsBattle = true; break; case 2: - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); DoCast(m_creature, SPELL_THE_LIGHT_OF_DAWN); break; case 3: @@ -1852,30 +1987,30 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI { if (pTemp->HasAura(SPELL_THE_LIGHT_OF_DAWN)) pTemp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z); } if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiThassarianGUID)) { if (pTemp->HasAura(SPELL_THE_LIGHT_OF_DAWN)) pTemp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z); } if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKorfaxGUID)) { - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10].x, LightofDawnLoc[10].y, LightofDawnLoc[10].z); } if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiMaxwellGUID)) { - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z); } if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiEligorGUID)) { - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z); } JumpToNextStep(10000); @@ -1960,7 +2095,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI { if (Creature* pTemp = m_creature->SummonCreature(NPC_ACHERUS_GHOUL, (m_creature->GetPositionX()-20)+rand()%40, (m_creature->GetPositionY()-20)+rand()%40, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->setFaction(2084); uiGhoulGUID[uiSummon_counter] = pTemp->GetObjectGuid(); uiSummon_counter++; @@ -1980,7 +2115,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI { if (Creature* pTemp = m_creature->SummonCreature(NPC_RAMPAGING_ABOMINATION, (m_creature->GetPositionX()-20)+rand()%40, (m_creature->GetPositionY()-20)+rand()%40, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->setFaction(2084); uiAbominationGUID[uiSummon_counter] = pTemp->GetObjectGuid(); uiSummon_counter++; @@ -2000,7 +2135,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI { if (Creature* pTemp = m_creature->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (m_creature->GetPositionX()-20)+rand()%40, (m_creature->GetPositionY()-20)+rand()%40, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->setFaction(2084); uiWarriorGUID[uiSummon_counter] = pTemp->GetObjectGuid(); uiSummon_counter++; @@ -2020,7 +2155,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI { if (Creature* pTemp = m_creature->SummonCreature(NPC_FLESH_BEHEMOTH, (m_creature->GetPositionX()-20)+rand()%40, (m_creature->GetPositionY()-20)+rand()%40, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->setFaction(2084); uiBehemothGUID[uiSummon_counter] = pTemp->GetObjectGuid(); uiSummon_counter++; @@ -2042,17 +2177,17 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI SetEscortPaused(false); if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKoltiraGUID)) { - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiOrbazGUID)) { - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiThassarianGUID)) { - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } for(uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) @@ -2127,7 +2262,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI if (Creature* pTemp = m_creature->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { DoScriptText(SAY_LIGHT_OF_DAWN35, pTemp); - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); uiDarionGUID = pTemp->GetObjectGuid(); } JumpToNextStep(4000); @@ -2243,7 +2378,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI // because mangos DoCast(m_creature, SPELL_MOGRAINE_CHARGE); // jumping charge // doesn't make it looks well, so workarounds, Darion charges, looks better m_creature->SetSpeedRate(MOVE_RUN, 3.0f); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); SetEscortPaused(false); JumpToNextStep(0); break; @@ -2315,7 +2450,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI if (pTemp = m_creature->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000)) { pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->SetSpeedRate(MOVE_RUN, 2.0f); pTemp->setFaction(m_creature->getFaction()); pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -2325,7 +2460,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI if (pTemp = m_creature->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000)) { pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->SetSpeedRate(MOVE_RUN, 2.0f); pTemp->setFaction(m_creature->getFaction()); pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -2335,7 +2470,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiMaxwellGUID)) { pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->SetSpeedRate(MOVE_RUN, 2.0f); pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); DoScriptText(SAY_LIGHT_OF_DAWN50, pTemp); @@ -2343,7 +2478,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKorfaxGUID)) { pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->SetSpeedRate(MOVE_RUN, 2.0f); pTemp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED); pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -2351,7 +2486,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiEligorGUID)) { pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->SetSpeedRate(MOVE_RUN, 2.0f); pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); } @@ -2416,7 +2551,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI case 46: // Darion stand up, "not today" m_creature->SetSpeedRate(MOVE_RUN, 1.0f); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); ((Unit*)m_creature)->SetStandState(UNIT_STAND_STATE_STAND); DoScriptText(SAY_LIGHT_OF_DAWN53, m_creature); SetEscortPaused(false); // Darion throws sword @@ -2475,10 +2610,10 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI pTemp->CastSpell(pTemp, SPELL_TIRION_CHARGE, false); // jumping charge pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); pTemp->SetSpeedRate(MOVE_RUN, 3.0f); // workarounds, make Tirion still running - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2].x, LightofDawnLoc[2].y, LightofDawnLoc[2].z); if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) - pTemp->GetMap()->CreatureRelocation(pTemp, LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z, 0.0f); // workarounds, he should kick back by Tirion, but here we relocate him + pTemp->GetMap()->CreatureRelocation(pTemp, LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z, 0.0f); // workarounds, he should kick back by Tirion, but here we relocate him } JumpToNextStep(1500); break; @@ -2493,7 +2628,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) { pTemp->SetSpeedRate(MOVE_RUN, 1.0f); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29].x, LightofDawnLoc[29].y, LightofDawnLoc[29].z); // 26 } JumpToNextStep(4000); @@ -2553,7 +2688,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI case 62: if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) { - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7].x, LightofDawnLoc[7].y, LightofDawnLoc[7].z); } JumpToNextStep(5500); @@ -2743,7 +2878,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI m_creature->DeleteThreatList(); m_creature->CombatStop(true); m_creature->InterruptNonMeleeSpells(false); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); for(uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) DespawnNPC(uiDefenderGUID[i]); @@ -2765,7 +2900,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI pTemp->CombatStop(true); pTemp->AttackStop(); pTemp->setFaction(m_creature->getFaction()); - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9].x, LightofDawnLoc[9].y, LightofDawnLoc[9].z); } @@ -2776,7 +2911,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI pTemp->CombatStop(true); pTemp->AttackStop(); pTemp->setFaction(m_creature->getFaction()); - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12].x, LightofDawnLoc[12].y, LightofDawnLoc[12].z); } @@ -2787,7 +2922,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI pTemp->CombatStop(true); pTemp->AttackStop(); pTemp->setFaction(m_creature->getFaction()); - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15].x, LightofDawnLoc[15].y, LightofDawnLoc[15].z); } DespawnNPC(uiRayneGUID); @@ -2799,7 +2934,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI pTemp->CombatStop(true); pTemp->AttackStop(); pTemp->setFaction(m_creature->getFaction()); - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18].x, LightofDawnLoc[18].y, LightofDawnLoc[18].z); pTemp->CastSpell(pTemp, SPELL_THE_LIGHT_OF_DAWN, false); } @@ -2814,7 +2949,7 @@ struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI pTemp->CombatStop(true); pTemp->AttackStop(); pTemp->setFaction(m_creature->getFaction()); - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20].x, LightofDawnLoc[20].y, LightofDawnLoc[20].z); pTemp->CastSpell(pTemp, SPELL_THE_LIGHT_OF_DAWN, false); } @@ -2996,7 +3131,7 @@ struct MANGOS_DLL_DECL npc_the_lich_king_tirion_dawnAI : public ScriptedAI ## npc orbaz, koltira, tassarian ######*/ struct MANGOS_DLL_DECL npc_minibosses_dawn_of_lightAI : public ScriptedAI -{ +{ npc_minibosses_dawn_of_lightAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } uint32 uiIcyTouchTimer; @@ -3136,6 +3271,93 @@ struct MANGOS_DLL_DECL mob_acherus_ghoulAI : public ScriptedAI } }; +/*###### +## npc_valkyr_battle_maiden +######*/ + +enum +{ + SPELL_REVIVE = 51918, +}; + +#define REVIVE_WHISPER "It is not yet your time, champion. Rise! Rise and fight once more!" + +struct MANGOS_DLL_DECL npc_valkyr_battle_maidenAI : ScriptedAI +{ + npc_valkyr_battle_maidenAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + float x, y, z; + + uint32 m_uiPhase; + uint32 m_uiPhaseTimer; + ObjectGuid m_summonerGuid; + + void Reset() + { + m_summonerGuid.Clear(); + + if (m_summonerGuid = (dynamic_cast(m_creature))->GetSummonerGuid()) + if(Unit* pUnit = m_creature->GetMap()->GetUnit(m_summonerGuid)) + if(pUnit->GetTypeId() != TYPEID_PLAYER) + m_summonerGuid.Clear(); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetLevitate(true); + m_uiPhase = 0; + m_uiPhaseTimer = 0; + } + + void UpdateAI(const uint32 uiDiff) + { + Player* pPlayer = NULL; + if (!(pPlayer = (Player*)m_creature->GetMap()->GetUnit(m_summonerGuid))) + m_uiPhase = 3; + + if (m_uiPhaseTimer <= uiDiff) + { + switch (m_uiPhase) + { + case 0: + pPlayer->GetClosePoint(x, y, z, m_creature->GetObjectBoundingRadius()); + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMap()->CreatureRelocation(m_creature, x-2.0f , y-1.5f, z+2.5f, 0); + m_creature->SetFacingToObject(pPlayer); + m_creature->SetVisibility(VISIBILITY_ON); + m_uiPhase++; + break; + case 1: + m_creature->SetGuidValue(UNIT_FIELD_TARGET, pPlayer->GetObjectGuid()); + m_uiPhase++; + break; + case 2: + DoCast(pPlayer, SPELL_REVIVE, true); + m_creature->MonsterWhisper(REVIVE_WHISPER, pPlayer); + // cause 51918 has cast time of 2 seconds + m_uiPhaseTimer = 3000; + m_uiPhase++; + break; + case 3: + m_creature->ForcedDespawn(); + default: + break; + } + } + else + m_uiPhaseTimer -= uiDiff; + } +}; + + +CreatureAI* GetAI_npc_valkyr_battle_maiden(Creature* pCreature) +{ + return new npc_valkyr_battle_maidenAI(pCreature); +}; + /*###### ## mob_warrior_of_the_frozen_wastes (53631) ######*/ @@ -3217,10 +3439,585 @@ struct MANGOS_DLL_DECL mob_warrior_of_the_frozen_wastesAI : public ScriptedAI } }; +/*###### +## npc_mine_car +######*/ + +struct MANGOS_DLL_DECL npc_mine_carAI : public ScriptedAI +{ + npc_mine_carAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + Reset(); + } + + ObjectGuid m_scarletMinerGuid; + + void Reset() + { + m_scarletMinerGuid.Clear(); + } + + void MoveInLineOfSight(Unit* /*pUnit*/) + { + return; + } + + void EnterCombat(Unit* /*pUnit*/) + { + return; + } + + void AttackStart(Unit* /*pUnit*/) + { + return; + } + + void SetScarletMinerGuid(const ObjectGuid &guid) + { + m_scarletMinerGuid = guid; + } + + void FollowMiner() + { + if(Creature* pMiner = m_creature->GetMap()->GetCreature(m_scarletMinerGuid)) + { + // buggy sometimes... + m_creature->SetSpeedRate(MOVE_WALK, 1.5f, true); + m_creature->SetSpeedRate(MOVE_RUN, 1.5f, true); + m_creature->SetWalk(false); + + m_creature->GetMotionMaster()->MoveFollow(pMiner, 1.0f, 0); + } + } + + void ExitMineCar() + { + if (Creature* pMiner = m_creature->GetMap()->GetCreature(m_scarletMinerGuid)) + pMiner->ForcedDespawn(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_creature->GetVehicleKit()->HasEmptySeat(0)) + { + m_creature->ForcedDespawn(); + } + } +}; + +/*###### +## npc_scarlet_miner +######*/ + +enum +{ + SPELL_CAR_DRAG = 52465, + SPELL_CAR_CHECK = 54173 +}; + +#define SAY_SCARLET_MINER1 "Where'd this come from? I better get this down to the ships before the foreman sees it!" +#define SAY_SCARLET_MINER2 "Now I can have a rest!" + +struct MANGOS_DLL_DECL npc_scarlet_minerAI : public npc_escortAI +{ + npc_scarlet_minerAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Reset(); + } + + uint32 m_uiMonoTimer; + uint32 m_uiMonoPhase; + + ObjectGuid m_mineCarGuid; + ObjectGuid m_playerGuid; + + bool m_bReachedShip; + uint32 m_uiShipDelay; + + void Reset() + { + m_uiMonoTimer = 0; + m_uiMonoPhase = 0; + + m_mineCarGuid.Clear(); + m_playerGuid.Clear(); + + m_bReachedShip = false; + m_uiShipDelay = 3000; + } + + void StartCarEvent(Player *pPlayer) + { + if (pPlayer->GetVehicle()) + { + m_mineCarGuid = pPlayer->GetVehicle()->GetBase()->GetObjectGuid(); + m_playerGuid = pPlayer->GetObjectGuid(); + Start(false, pPlayer); + } + } + + void WaypointReached(uint32 uiWp) + { + switch(uiWp) + { + case 0: + if (Unit* pMineCar = m_creature->GetMap()->GetCreature(m_mineCarGuid)) + m_creature->SetInFront(pMineCar); + + SetRun(true); + m_uiMonoTimer = 4000; + m_uiMonoPhase = 1; + break; + case 17: + m_bReachedShip = true; + break; + default: + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiMonoPhase) + { + if (m_uiMonoTimer <= uiDiff) + { + if (m_uiMonoPhase == 1) + { + m_creature->MonsterSay(SAY_SCARLET_MINER1,LANG_UNIVERSAL, NULL); + + if (Creature *pMineCar = m_creature->GetMap()->GetCreature(m_mineCarGuid)) + DoCast(pMineCar, SPELL_CAR_DRAG); + + m_uiMonoTimer = 800; + m_uiMonoPhase = 2; + } + else + { + if (Creature *pMineCar = m_creature->GetMap()->GetCreature(m_mineCarGuid)) + { + if(npc_mine_carAI* pMineCarAI = dynamic_cast(pMineCar->AI())) + { + pMineCarAI->FollowMiner(); + } + m_uiMonoPhase = 0; + } + } + } + else + m_uiMonoTimer -= uiDiff; + } + + if (m_bReachedShip) + { + if (m_uiShipDelay <= uiDiff) + { + if (Creature *pMineCar = m_creature->GetMap()->GetCreature(m_mineCarGuid)) + { + m_creature->SetInFront(pMineCar); + m_creature->MonsterSay(SAY_SCARLET_MINER2,LANG_UNIVERSAL, NULL); + pMineCar->Relocate(pMineCar->GetPositionX(), pMineCar->GetPositionY(), pMineCar->GetPositionZ() + 1); + pMineCar->GetMotionMaster()->MovementExpired(); + pMineCar->StopMoving(); + pMineCar->RemoveAurasDueToSpell(SPELL_CAR_DRAG); + + if (Player *pPlayer = m_creature->GetMap()->GetPlayer(ObjectGuid(m_playerGuid))) + { + if (pPlayer->GetVehicle()) + pPlayer->ExitVehicle(); + } + + if (npc_mine_carAI* pMineCarAI = dynamic_cast(pMineCar->AI())) + { + pMineCarAI->ExitMineCar(); + } + + m_bReachedShip = false; + } + } + else + m_uiShipDelay -= uiDiff; + } + npc_escortAI::UpdateAI(uiDiff); + } +}; + +/*###### +## go_inconspicous_mine_car +######*/ + +enum +{ + QUEST_MASSACRE_AT_LIGHTS_POINT = 12701, + + ENTRY_SCARLET_MINER = 28841, + ENTRY_MINE_CAR = 28817, + + SPELL_MINE_CAR_SUMM = 52463 +}; + +bool GOUse_go_inconspicous_mine_car(Player* pPlayer, GameObject* /*pGo*/) +{ + if (pPlayer->GetQuestStatus(QUEST_MASSACRE_AT_LIGHTS_POINT) == QUEST_STATUS_INCOMPLETE) + { + if (pPlayer->GetVehicle()) + return false; + + if (Creature* pMiner = pPlayer->SummonCreature(ENTRY_SCARLET_MINER, 2383.869f, -5900.312f, 107.996f, pPlayer->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN, 1)) + { + pPlayer->CastSpell(pPlayer, SPELL_MINE_CAR_SUMM, true); + if (Creature* pMineCar = (Creature*)pPlayer->GetVehicle()->GetBase()) + { + if (npc_mine_carAI* pMineCarAI = dynamic_cast(pMineCar->AI())) + { + pMineCarAI->SetScarletMinerGuid(pMiner->GetObjectGuid()); + if (npc_scarlet_minerAI* pMinerAI = dynamic_cast(pMiner->AI())) + { + pMinerAI->StartCarEvent(pPlayer); + } + } + } + } + } + return true; +} + +/*###### +## npc_scourge_gryphon +######*/ + +enum +{ + RIDE_VEHICLE_HARDCODED = 46598 +}; + +struct MANGOS_DLL_DECL npc_scourge_gryphonAI : public npc_escortAI +{ + npc_scourge_gryphonAI(Creature* pCreature) : npc_escortAI(pCreature) + { + //m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Reset(); + } + + void Reset() + { + } + + void SpellHit(Unit* pUnit, const SpellEntry* pSpell) + { + if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) + { + if (pSpell->Id == RIDE_VEHICLE_HARDCODED) + { + FlyToDeathsBreach((Player*)pUnit); + } + } + } + + void FlyToDeathsBreach(Player* pPlayer) + { + pPlayer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + // Need to be set here. If flag is applied earlier, the Spell Immune Mask + // makes the vehicle mount spell (ID - 46598 Ride Vehicle Hardcoded) disfunctional + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetLevitate(true); + + Start(true, pPlayer); + } + + void WaypointReached(uint32 uiWp) + { + switch(uiWp) + { + case 0: + SetRun(); + break; + case 4: + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_creature->ForcedDespawn(); // should be enough to remove players just take the vehicle away 8) + return; + default: + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + npc_escortAI::UpdateAI(uiDiff); + } +}; + +/*###### +## quest How To Win Friends And Influence Enemies && replaces EventAI for these npcs overall +######*/ +enum win_friends +{ + QUEST_HOW_TO_WIN_FRIENDS = 12720, + + NPC_PREACHER = 28939, + SPELL_HOLY_FURY_OOC = 34809, + SPELL_HOLY_SMITE = 15498, + + NPC_MARKSMEN = 28610, + SPELL_RAPTOR_STRIKE = 32915, + + SAY_PERSUADE1 = -1609101, + SAY_PERSUADE2 = -1609102, + SAY_PERSUADE3 = -1609103, + SAY_PERSUADE4 = -1609104, + SAY_PERSUADE5 = -1609105, + SAY_PERSUADE6 = -1609106, + SAY_PERSUADE7 = -1609107, + SAY_CRUSADER1 = -1609108, + SAY_CRUSADER2 = -1609109, + SAY_CRUSADER3 = -1609110, + SAY_CRUSADER4 = -1609111, + SAY_CRUSADER5 = -1609112, + SAY_CRUSADER6 = -1609113, + SAY_PERSUADED1 = -1609114, + SAY_PERSUADED2 = -1609115, + SAY_PERSUADED3 = -1609116, + SAY_PERSUADED4 = -1609117, + SAY_PERSUADED5 = -1609118, + SAY_PERSUADED6 = -1609119, + + SPELL_PERSUASIVE_STRIKE = 52781 +}; + +struct MANGOS_DLL_DECL npc_crusade_persuadedAI : public ScriptedAI +{ + npc_crusade_persuadedAI(Creature *pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + ObjectGuid m_playerGUID; + uint32 m_uiSpeech_timer; + uint32 m_uiSpeech_counter; + uint32 m_uiCrusade_faction; + + uint32 m_uiHOLYFURYTimer; + uint32 m_uiHOLYSMITETimer; + uint32 m_uiRATORSTRIKETimer; + + void Reset() + { + m_uiSpeech_timer = 0; + m_uiSpeech_counter = 0; + m_uiCrusade_faction = 0; + m_playerGUID.Clear(); + + m_uiHOLYFURYTimer = 60000; + m_uiHOLYSMITETimer = 5500; + + m_uiRATORSTRIKETimer = 4500; + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == SPELL_PERSUASIVE_STRIKE && m_uiSpeech_counter == 0) + { + if(((Player*)caster)->GetQuestStatus(QUEST_HOW_TO_WIN_FRIENDS) == QUEST_STATUS_INCOMPLETE) + { + if (rand()%100 > 90) // chance + { + m_playerGUID = ((Player*)caster)->GetObjectGuid(); + m_uiCrusade_faction = m_creature->getFaction(); + m_uiSpeech_timer = 1000; + m_uiSpeech_counter = 1; + m_creature->setFaction(35); + } + else if (m_uiSpeech_counter == 0) + { + switch(rand()%6) + { + case 0: DoScriptText(SAY_PERSUADE1, caster);break; + case 1: DoScriptText(SAY_PERSUADE2, caster);break; + case 2: DoScriptText(SAY_PERSUADE3, caster);break; + case 3: DoScriptText(SAY_PERSUADE4, caster);break; + case 4: DoScriptText(SAY_PERSUADE5, caster);break; + case 5: DoScriptText(SAY_PERSUADE6, caster);break; + case 6: DoScriptText(SAY_PERSUADE7, caster);break; + } + switch(rand()%5) + { + case 0: DoScriptText(SAY_CRUSADER1, m_creature);break; + case 1: DoScriptText(SAY_CRUSADER2, m_creature);break; + case 2: DoScriptText(SAY_CRUSADER3, m_creature);break; + case 3: DoScriptText(SAY_CRUSADER4, m_creature);break; + case 4: DoScriptText(SAY_CRUSADER5, m_creature);break; + case 5: DoScriptText(SAY_CRUSADER6, m_creature);break; + } + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if (m_uiSpeech_counter >= 1 && m_uiSpeech_counter <= 6) + if (m_uiSpeech_timer < diff) + { + m_creature->CombatStop(true); + m_creature->StopMoving(); + Unit* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGUID); + + switch(m_uiSpeech_counter) + { + case 1: DoScriptText(SAY_PERSUADED1, m_creature); m_uiSpeech_timer = 8000; m_uiSpeech_counter++; break; + case 2: DoScriptText(SAY_PERSUADED2, m_creature); m_uiSpeech_timer = 8000; m_uiSpeech_counter++; break; + case 3: DoScriptText(SAY_PERSUADED3, m_creature); m_uiSpeech_timer = 8000; m_uiSpeech_counter++; break; + case 4: DoScriptText(SAY_PERSUADED4, m_creature); m_uiSpeech_timer = 8000; m_uiSpeech_counter++; break; + case 5: DoScriptText(SAY_PERSUADED5, pPlayer); m_uiSpeech_timer = 8000; m_uiSpeech_counter++; break; + case 6: + DoScriptText(SAY_PERSUADED6, m_creature); + m_creature->setFaction(m_uiCrusade_faction); + m_uiSpeech_timer = 0; + m_uiCrusade_faction = 0; + m_uiSpeech_counter++; + AttackStart(pPlayer); + if(((Player*)pPlayer)->GetQuestStatus(QUEST_HOW_TO_WIN_FRIENDS) == QUEST_STATUS_INCOMPLETE) + ((Player*)pPlayer)->AreaExploredOrEventHappens(QUEST_HOW_TO_WIN_FRIENDS); + break; + } + }else m_uiSpeech_timer -= diff; + else + if (m_creature->GetEntry() == NPC_PREACHER) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiHOLYSMITETimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HOLY_SMITE); + m_uiHOLYSMITETimer = 5500 + rand()%1400; + }else m_uiHOLYSMITETimer -= diff; + + if (m_uiHOLYFURYTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_HOLY_FURY_OOC); + m_uiHOLYFURYTimer = 1000 + rand()%90000; + }else m_uiHOLYFURYTimer -= diff; + + DoMeleeAttackIfReady(); + } + else + { + if (m_creature->GetEntry() == NPC_MARKSMEN) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiRATORSTRIKETimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_RAPTOR_STRIKE); + m_uiRATORSTRIKETimer = 4500 + rand()%1400; + }else m_uiRATORSTRIKETimer -= diff; + DoMeleeAttackIfReady(); + } + } + } +}; + +//Scarlet courier +enum ScarletCourierEnum +{ + SAY_TREE1 = -1609531, + SAY_TREE2 = -1609532, + GO_INCONSPICUOUS_TREE = 191144, + NPC_SCARLET_COURIER = 29076 +}; + +struct MANGOS_DLL_DECL mob_scarlet_courierAI : ScriptedAI +{ + mob_scarlet_courierAI(Creature *pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint8 m_uiStage; + uint32 m_uiStageTimer; + + void Reset() + { + m_creature->Mount(14338); // not sure about this id + m_uiStage = 1; + m_uiStageTimer = 3*IN_MILLISECONDS; + } + + void EnterCombat(Unit* pWho) + { + DoScriptText(SAY_TREE2, m_creature); + m_creature->Unmount(); + m_uiStage = 0; + } + + void MovementInform(uint32 m_uiType, uint32 m_uiId) + { + if (m_uiType != POINT_MOTION_TYPE) + return; + + if (m_uiId == 1) + m_uiStage = 2; + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiStage && !m_creature->isInCombat()) + { + if (m_uiStageTimer <= uiDiff) + { + switch(m_uiStage) + { + case 1: + m_creature->SetWalk(true); + if (GameObject* tree = GetClosestGameObjectWithEntry(m_creature,GO_INCONSPICUOUS_TREE, 40.0f)) + { + DoScriptText(SAY_TREE1, m_creature); + float x, y, z; + tree->GetContactPoint(m_creature, x, y, z); + m_creature->GetMotionMaster()->MovePoint(1, x, y, z); + } + break; + case 2: + if (GameObject* tree = GetClosestGameObjectWithEntry(m_creature,GO_INCONSPICUOUS_TREE, 40.0f)) + if (Unit *unit = tree->GetOwner()) + AttackStart(unit); + break; + default: + break; + } + + m_uiStageTimer = 3*IN_MILLISECONDS; + m_uiStage = 0; + } + else + m_uiStageTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_scarlet_courier(Creature* pCreature) +{ + return new mob_scarlet_courierAI(pCreature); +}; + +CreatureAI* GetAI_npc_crusade_persuaded(Creature* pCreature) +{ + return new npc_crusade_persuadedAI(pCreature); +}; + CreatureAI* GetAI_npc_highlord_darion_mograine(Creature* pCreature) -{ +{ return new npc_highlord_darion_mograineAI(pCreature); -} +}; CreatureAI* GetAI_npc_the_lich_king_tirion_dawn(Creature* pCreature) { @@ -3228,20 +4025,35 @@ CreatureAI* GetAI_npc_the_lich_king_tirion_dawn(Creature* pCreature) }; CreatureAI* GetAI_npc_minibosses_dawn_of_light(Creature* pCreature) -{ +{ return new npc_minibosses_dawn_of_lightAI (pCreature); -} +}; CreatureAI* GetAI_mob_warrior_of_the_frozen_wastes(Creature* pCreature) { return new mob_warrior_of_the_frozen_wastesAI(pCreature); -} +}; CreatureAI* GetAI_mob_acherus_ghoul(Creature* pCreature) { return new mob_acherus_ghoulAI(pCreature); }; +CreatureAI* GetAI_npc_mine_car(Creature* pCreature) +{ + return new npc_mine_carAI(pCreature); +}; + +CreatureAI* GetAI_npc_scarlet_miner(Creature* pCreature) +{ + return new npc_scarlet_minerAI(pCreature); +}; + +CreatureAI* GetAI_npc_scourge_gryphon(Creature* pCreature) +{ + return new npc_scourge_gryphonAI(pCreature); +}; + void AddSC_ebon_hold() { Script* pNewScript; @@ -3284,6 +4096,11 @@ void AddSC_ebon_hold() pNewScript->GetAI = &GetAI_npc_eye_of_acherus; pNewScript->RegisterSelf(); + pNewScript = new Script; + pNewScript->Name = "mob_scarlet_miner"; + pNewScript->GetAI = &GetAI_mob_scarlet_miner; + pNewScript->RegisterSelf(); + pNewScript = new Script; pNewScript->Name = "mob_scarlet_ghoul"; pNewScript->GetAI = &GetAI_mob_scarlet_ghoul; @@ -3292,7 +4109,7 @@ void AddSC_ebon_hold() pNewScript = new Script; pNewScript->Name = "npc_highlord_darion_mograine"; pNewScript->GetAI = &GetAI_npc_highlord_darion_mograine; - pNewScript->pGossipHello = &GossipHello_npc_highlord_darion_mograine; + pNewScript->pGossipHello = &GossipHello_npc_highlord_darion_mograine; pNewScript->pGossipSelect = &GossipSelect_npc_highlord_darion_mograine; pNewScript->RegisterSelf(); @@ -3311,9 +4128,43 @@ void AddSC_ebon_hold() pNewScript->GetAI = &GetAI_mob_acherus_ghoul; pNewScript->RegisterSelf(); + pNewScript = new Script; + pNewScript->Name = "npc_mine_car"; + pNewScript->GetAI = &GetAI_npc_mine_car; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_scarlet_miner"; + pNewScript->GetAI = &GetAI_npc_scarlet_miner; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_inconspicous_mine_car"; + pNewScript->pGOUse = &GOUse_go_inconspicous_mine_car; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_scourge_gryphon"; + pNewScript->GetAI = &GetAI_npc_scourge_gryphon; + pNewScript->RegisterSelf(); + pNewScript = new Script; pNewScript->Name = "mob_warrior_of_the_frozen_wastes"; pNewScript->GetAI = &GetAI_mob_warrior_of_the_frozen_wastes; pNewScript->RegisterSelf(); + pNewScript = new Script; + pNewScript->Name= "npc_valkyr_battle_maiden"; + pNewScript->GetAI = &GetAI_npc_valkyr_battle_maiden; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_crusade_persuaded"; + pNewScript->GetAI = &GetAI_npc_crusade_persuaded; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name= "mob_scarlet_courier"; + pNewScript->GetAI = &GetAI_mob_scarlet_courier; + pNewScript->RegisterSelf(); } diff --git a/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp b/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp index 8e1698b..4c421d5 100644 --- a/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp +++ b/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp @@ -54,7 +54,7 @@ struct MANGOS_DLL_DECL boss_azshir_the_sleeplessAI : public ScriptedAI if (SoulSiphon_Timer < diff) { DoCastSpellIfCan(m_creature->getVictim(),SPELL_SOULSIPHON); - return; + // return; // Why was this return here? SoulSiphon_Timer = 20000; }else SoulSiphon_Timer -= diff; diff --git a/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp b/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp index e069928..d1a7a4b 100644 --- a/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp +++ b/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp @@ -216,7 +216,7 @@ struct MANGOS_DLL_DECL mob_arugal_voidwalkerAI : public ScriptedAI void Reset() { - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_uiDarkOffering = urand(4400, 12500); m_bWPDone = true; diff --git a/scripts/eastern_kingdoms/silvermoon_city.cpp b/scripts/eastern_kingdoms/silvermoon_city.cpp index 3d34625..41c1be5 100644 --- a/scripts/eastern_kingdoms/silvermoon_city.cpp +++ b/scripts/eastern_kingdoms/silvermoon_city.cpp @@ -23,6 +23,7 @@ EndScriptData */ /* ContentData npc_blood_knight_stillblade +Lor'themar Theron EndContentData */ #include "precompiled.h" @@ -88,6 +89,83 @@ CreatureAI* GetAI_npc_blood_knight_stillblade(Creature* pCreature) return new npc_blood_knight_stillbladeAI(pCreature); } +/*####### +# boss_lorthemar_theron +#######*/ + +enum +{ + SPELL_ARCANE_SHOCK = 59715, + SPELL_CLEAVE_LORTHEMAR = 15284, + SPELL_MANA_BURN = 33385, + SPELL_MASS_CHARM = 33384, +}; + +struct MANGOS_DLL_DECL boss_lorthemar_theronAI : public ScriptedAI +{ + boss_lorthemar_theronAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiArcaneShockTimer; + uint32 m_uiCleaveTimer; + uint32 m_uiManaBurnTimer; + uint32 m_uiMassCharmTimer; + + void Reset() + { + m_uiArcaneShockTimer = 9000; + m_uiCleaveTimer = 5000; + m_uiManaBurnTimer = 12000; + m_uiMassCharmTimer = 16000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiArcaneShockTimer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_ARCANE_SHOCK); + m_uiArcaneShockTimer = urand(9000, 11000); + } + else + m_uiArcaneShockTimer -= uiDiff; + + if (m_uiCleaveTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE_LORTHEMAR); + m_uiCleaveTimer = urand(5000, 7000); + } + else + m_uiCleaveTimer -= uiDiff; + + if (m_uiManaBurnTimer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_MANA_BURN); + m_uiManaBurnTimer = urand(12000, 15000); + } + else + m_uiManaBurnTimer -= uiDiff; + + if (m_uiMassCharmTimer < uiDiff) + { + DoCast(m_creature, SPELL_MASS_CHARM); + m_uiMassCharmTimer = urand(16000, 20000); + } + else + m_uiMassCharmTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_lorthemar_theron(Creature* pCreature) +{ + return new boss_lorthemar_theronAI(pCreature); +} + void AddSC_silvermoon_city() { Script *newscript; @@ -95,4 +173,9 @@ void AddSC_silvermoon_city() newscript->Name = "npc_blood_knight_stillblade"; newscript->GetAI = &GetAI_npc_blood_knight_stillblade; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lorthemar_theron"; + newscript->GetAI = &GetAI_boss_lorthemar_theron; + newscript->RegisterSelf(); } diff --git a/scripts/eastern_kingdoms/stormwind_city.cpp b/scripts/eastern_kingdoms/stormwind_city.cpp index 3b8b479..d3d11e4 100644 --- a/scripts/eastern_kingdoms/stormwind_city.cpp +++ b/scripts/eastern_kingdoms/stormwind_city.cpp @@ -26,6 +26,7 @@ npc_archmage_malin npc_bartleby npc_dashel_stonefist npc_lady_katrana_prestor +King Varian EndContentData */ #include "precompiled.h" @@ -238,6 +239,62 @@ bool GossipSelect_npc_lady_katrana_prestor(Player* pPlayer, Creature* pCreature, return true; } +/*###### + ## King Varian + ######*/ + +enum +{ + SPELL_HEROIC_LEAP = 59688, + SPELL_WHIRLWIND = 41056, + SPELL_WHIRLWIND_TRIG = 41057, +}; + +struct MANGOS_DLL_DECL boss_king_varian_wrynnAI : public ScriptedAI +{ + boss_king_varian_wrynnAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiHeroicLeapTimer; + uint32 m_uiWhirlwind; + + void Reset() + { + m_uiHeroicLeapTimer = 6000; + m_uiWhirlwind = 15000; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiWhirlwind < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); + m_uiWhirlwind = urand(15000, 18000); + } + else + m_uiWhirlwind -= uiDiff; + + if (m_uiHeroicLeapTimer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_HEROIC_LEAP); + m_uiHeroicLeapTimer = urand(6000, 9000); + } + else + m_uiHeroicLeapTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_king_varian_wrynn(Creature* pCreature) +{ + return new boss_king_varian_wrynnAI(pCreature); +} + void AddSC_stormwind_city() { Script *newscript; @@ -265,4 +322,9 @@ void AddSC_stormwind_city() newscript->pGossipHello = &GossipHello_npc_lady_katrana_prestor; newscript->pGossipSelect = &GossipSelect_npc_lady_katrana_prestor; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_king_varian_wrynn"; + newscript->GetAI = &GetAI_boss_king_varian_wrynn; + newscript->RegisterSelf(); } diff --git a/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp b/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp index 3032b35..1392300 100644 --- a/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp +++ b/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp @@ -78,6 +78,14 @@ void instance_stratholme::OnCreatureCreate(Creature* pCreature) case NPC_THUZADIN_ACOLYTE: m_luiAcolyteGUIDs.push_back(pCreature->GetObjectGuid()); break; + case NPC_CRIMSON_INITIATE: + case NPC_CRIMSON_GALLANT: + case NPC_CRIMSON_GUARDSMAN: + case NPC_CRIMSON_CONJURER: + // Only store those in the yard + if (pCreature->IsWithinDist2d(aTimmyLocation[1].m_fX, aTimmyLocation[1].m_fY, 40.0f)) + m_suiCrimsonLowGuids.insert(pCreature->GetGUIDLow()); + break; } } @@ -215,8 +223,8 @@ void instance_stratholme::SetData(uint32 uiType, uint32 uiData) if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON)) { DoScriptText(SAY_ANNOUNCE_RAMSTEIN, pBaron); - if (Creature* pRamstein = pBaron->SummonCreature(NPC_RAMSTEIN, sStratholmeLocation[2].m_fX, sStratholmeLocation[2].m_fY, sStratholmeLocation[2].m_fZ, sStratholmeLocation[2].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0)) - pRamstein->GetMotionMaster()->MovePoint(0, sStratholmeLocation[3].m_fX, sStratholmeLocation[3].m_fY, sStratholmeLocation[3].m_fZ); + if (Creature* pRamstein = pBaron->SummonCreature(NPC_RAMSTEIN, aStratholmeLocation[2].m_fX, aStratholmeLocation[2].m_fY, aStratholmeLocation[2].m_fZ, aStratholmeLocation[2].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0)) + pRamstein->GetMotionMaster()->MovePoint(0, aStratholmeLocation[3].m_fX, aStratholmeLocation[3].m_fY, aStratholmeLocation[3].m_fZ); debug_log("SD2: Instance Stratholme - Slaugther event: Ramstein spawned."); } @@ -242,8 +250,8 @@ void instance_stratholme::SetData(uint32 uiType, uint32 uiData) for(uint8 i = 0; i < 5; ++i) { float fX, fY, fZ; - pBaron->GetRandomPoint(sStratholmeLocation[6].m_fX, sStratholmeLocation[6].m_fY, sStratholmeLocation[6].m_fZ, 5.0f, fX, fY, fZ); - if (Creature* pTemp = pBaron->SummonCreature(NPC_BLACK_GUARD, sStratholmeLocation[6].m_fX, sStratholmeLocation[6].m_fY, sStratholmeLocation[6].m_fZ, sStratholmeLocation[6].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0)) + pBaron->GetRandomPoint(aStratholmeLocation[6].m_fX, aStratholmeLocation[6].m_fY, aStratholmeLocation[6].m_fZ, 5.0f, fX, fY, fZ); + if (Creature* pTemp = pBaron->SummonCreature(NPC_BLACK_GUARD, aStratholmeLocation[6].m_fX, aStratholmeLocation[6].m_fY, aStratholmeLocation[6].m_fZ, aStratholmeLocation[6].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0)) m_luiGuardGUIDs.push_back(pTemp->GetObjectGuid()); } @@ -302,7 +310,7 @@ void instance_stratholme::SetData(uint32 uiType, uint32 uiData) if (Creature* pYsida = pYsidaT->SummonCreature(NPC_YSIDA, pYsidaT->GetPositionX(), pYsidaT->GetPositionY(), pYsidaT->GetPositionZ(), pYsidaT->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 1800000)) { DoScriptText(SAY_EPILOGUE, pYsida); - pYsida->GetMotionMaster()->MovePoint(0, sStratholmeLocation[7].m_fX, sStratholmeLocation[7].m_fY, sStratholmeLocation[7].m_fZ); + pYsida->GetMotionMaster()->MovePoint(0, aStratholmeLocation[7].m_fX, aStratholmeLocation[7].m_fY, aStratholmeLocation[7].m_fZ); } DoUseDoorOrButton(GO_YSIDA_CAGE); } @@ -323,8 +331,8 @@ void instance_stratholme::SetData(uint32 uiType, uint32 uiData) if (pBarthilas && pBarthilas->isAlive() && !pBarthilas->isInCombat()) { DoScriptText(SAY_WARN_BARON, pBarthilas); - pBarthilas->RemoveSplineFlag(SPLINEFLAG_WALKMODE); - pBarthilas->GetMotionMaster()->MovePoint(0, sStratholmeLocation[0].m_fX, sStratholmeLocation[0].m_fY, sStratholmeLocation[0].m_fZ); + pBarthilas->SetWalk(false); + pBarthilas->GetMotionMaster()->MovePoint(0, aStratholmeLocation[0].m_fX, aStratholmeLocation[0].m_fY, aStratholmeLocation[0].m_fZ); m_uiBarthilasRunTimer = 8000; } @@ -606,7 +614,7 @@ void instance_stratholme::OnCreatureDeath(Creature* pCreature) if (pGuard && pGuard->isAlive() && !pGuard->isInCombat()) { float fX, fY, fZ; - pGuard->GetRandomPoint(sStratholmeLocation[5].m_fX, sStratholmeLocation[5].m_fY, sStratholmeLocation[5].m_fZ, 10.0f, fX, fY, fZ); + pGuard->GetRandomPoint(aStratholmeLocation[5].m_fX, aStratholmeLocation[5].m_fY, aStratholmeLocation[5].m_fZ, 10.0f, fX, fY, fZ); pGuard->GetMotionMaster()->MovePoint(0, fX, fY, fZ); } } @@ -618,6 +626,21 @@ void instance_stratholme::OnCreatureDeath(Creature* pCreature) SetData(TYPE_BLACK_GUARDS, DONE); break; + + // Timmy spawn support + case NPC_CRIMSON_INITIATE: + case NPC_CRIMSON_GALLANT: + case NPC_CRIMSON_GUARDSMAN: + case NPC_CRIMSON_CONJURER: + if (m_suiCrimsonLowGuids.find(pCreature->GetGUIDLow()) != m_suiCrimsonLowGuids.end()) + { + m_suiCrimsonLowGuids.erase(pCreature->GetGUIDLow()); + + // If all courtyard mobs are dead then summon Timmy + if (m_suiCrimsonLowGuids.empty()) + pCreature->SummonCreature(NPC_TIMMY_THE_CRUEL, aTimmyLocation[0].m_fX, aTimmyLocation[0].m_fY, aTimmyLocation[0].m_fZ, aTimmyLocation[0].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0); + } + break; } } @@ -657,7 +680,7 @@ void instance_stratholme::Update(uint32 uiDiff) { Creature* pBarthilas = GetSingleCreatureFromStorage(NPC_BARTHILAS); if (pBarthilas && pBarthilas->isAlive() && !pBarthilas->isInCombat()) - pBarthilas->NearTeleportTo(sStratholmeLocation[1].m_fX, sStratholmeLocation[1].m_fY, sStratholmeLocation[1].m_fZ, sStratholmeLocation[1].m_fO); + pBarthilas->NearTeleportTo(aStratholmeLocation[1].m_fX, aStratholmeLocation[1].m_fY, aStratholmeLocation[1].m_fZ, aStratholmeLocation[1].m_fO); SetData(TYPE_BARTHILAS_RUN, DONE); m_uiBarthilasRunTimer = 0; @@ -701,10 +724,10 @@ void instance_stratholme::Update(uint32 uiDiff) if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON)) { // Summon mindless skeletons and move them to random point in the center of the square - if (Creature* pTemp = pBaron->SummonCreature(NPC_MINDLESS_UNDEAD, sStratholmeLocation[4].m_fX, sStratholmeLocation[4].m_fY, sStratholmeLocation[4].m_fZ, sStratholmeLocation[4].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0)) + if (Creature* pTemp = pBaron->SummonCreature(NPC_MINDLESS_UNDEAD, aStratholmeLocation[4].m_fX, aStratholmeLocation[4].m_fY, aStratholmeLocation[4].m_fZ, aStratholmeLocation[4].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0)) { float fX, fY, fZ; - pBaron->GetRandomPoint(sStratholmeLocation[5].m_fX, sStratholmeLocation[5].m_fY, sStratholmeLocation[5].m_fZ, 20.0f, fX, fY, fZ); + pBaron->GetRandomPoint(aStratholmeLocation[5].m_fX, aStratholmeLocation[5].m_fY, aStratholmeLocation[5].m_fZ, 20.0f, fX, fY, fZ); pTemp->GetMotionMaster()->MovePoint(0, fX, fY, fZ); m_luiUndeadGUIDs.push_back(pTemp->GetObjectGuid()); ++m_uiMindlessCount; diff --git a/scripts/eastern_kingdoms/stratholme/stratholme.h b/scripts/eastern_kingdoms/stratholme/stratholme.h index 455efeb..055765e 100644 --- a/scripts/eastern_kingdoms/stratholme/stratholme.h +++ b/scripts/eastern_kingdoms/stratholme/stratholme.h @@ -28,33 +28,38 @@ enum TYPE_SH_VICAR = 24, TYPE_SH_AELMAR = 25, + NPC_TIMMY_THE_CRUEL = 10808, NPC_BARTHILAS = 10435, NPC_BARONESS_ANASTARI = 10436, NPC_NERUBENKAN = 10437, NPC_MALEKI_THE_PALLID = 10438, NPC_RAMSTEIN = 10439, NPC_BARON = 10440, - NPC_CRYSTAL = 10415, // three ziggurat crystals - NPC_THUZADIN_ACOLYTE = 10399, // acolytes in ziggurats + NPC_CRYSTAL = 10415, // Three ziggurat crystals + NPC_THUZADIN_ACOLYTE = 10399, // Acolytes in ziggurats NPC_ABOM_BILE = 10416, NPC_ABOM_VENOM = 10417, - NPC_MINDLESS_UNDEAD = 11030, // zombies summoned after ramstein - NPC_BLACK_GUARD = 10394, // zombies summoned after ramstein + NPC_MINDLESS_UNDEAD = 11030, // Zombies summoned after Ramstein + NPC_BLACK_GUARD = 10394, // Zombies summoned after Ramstein NPC_YSIDA = 16031, NPC_YSIDA_TRIGGER = 16100, + NPC_CRIMSON_INITIATE = 10420, // A couple of them related to spawn Timmy + NPC_CRIMSON_GALLANT = 10424, + NPC_CRIMSON_GUARDSMAN = 10418, + NPC_CRIMSON_CONJURER = 10419, GO_SERVICE_ENTRANCE = 175368, GO_GAUNTLET_GATE1 = 175357, - GO_PORT_SLAUGHTER_GATE = 175358, //port used at the undeads event - GO_ZIGGURAT_DOOR_1 = 175380, //baroness - GO_ZIGGURAT_DOOR_2 = 175379, //nerub'enkan - GO_ZIGGURAT_DOOR_3 = 175381, //maleki - GO_ZIGGURAT_DOOR_4 = 175405, //rammstein - GO_ZIGGURAT_DOOR_5 = 175796, //baron - GO_PORT_GAUNTLET = 175374, //port from gauntlet to slaugther - GO_PORT_SLAUGTHER = 175373, //port at slaugther - GO_PORT_ELDERS = 175377, //port at elders square - GO_YSIDA_CAGE = 181071, // cage to open after baron event is done + GO_PORT_SLAUGHTER_GATE = 175358, // Port used at the undeads event + GO_ZIGGURAT_DOOR_1 = 175380, // Baroness + GO_ZIGGURAT_DOOR_2 = 175379, // Nerub'enkan + GO_ZIGGURAT_DOOR_3 = 175381, // Maleki + GO_ZIGGURAT_DOOR_4 = 175405, // Ramstein + GO_ZIGGURAT_DOOR_5 = 175796, // Baron + GO_PORT_GAUNTLET = 175374, // Port from gauntlet to slaugther + GO_PORT_SLAUGTHER = 175373, // Port at slaugther + GO_PORT_ELDERS = 175377, // Port at elders square + GO_YSIDA_CAGE = 181071, // Cage to open after baron event is done QUEST_DEAD_MAN_PLEA = 8945, SPELL_BARON_ULTIMATUM = 27861, @@ -74,21 +79,27 @@ enum SAY_EPILOGUE = -1329015, }; -struct sEventLocation +struct EventLocation { float m_fX, m_fY, m_fZ, m_fO; }; -static sEventLocation sStratholmeLocation[] = +static const EventLocation aStratholmeLocation[] = { - {3725.577f, -3599.484f, 142.367f}, // barthilas door run - {4068.284f, -3535.678f, 122.771f, 2.50f}, // barthilas tele - {4032.643f, -3378.546f, 119.752f, 4.74f}, // ramstein summon loc - {4032.843f, -3390.246f, 119.732f}, // ramstein move loc - {3969.357f, -3391.871f, 119.116f, 5.91f}, // skeletons summon loc - {4033.044f, -3431.031f, 119.055f}, // skeletons move loc - {4032.602f, -3378.506f, 119.752f, 4.74f}, // guards summon loc - {4042.575f, -3337.929f, 115.059f} // ysida move loc + {3725.577f, -3599.484f, 142.367f}, // Barthilas door run + {4068.284f, -3535.678f, 122.771f, 2.50f}, // Barthilas tele + {4032.643f, -3378.546f, 119.752f, 4.74f}, // Ramstein summon loc + {4032.843f, -3390.246f, 119.732f}, // Ramstein move loc + {3969.357f, -3391.871f, 119.116f, 5.91f}, // Skeletons summon loc + {4033.044f, -3431.031f, 119.055f}, // Skeletons move loc + {4032.602f, -3378.506f, 119.752f, 4.74f}, // Guards summon loc + {4042.575f, -3337.929f, 115.059f} // Ysida move loc +}; + +static const EventLocation aTimmyLocation[] = +{ + {3696.851f, -3152.736f, 127.661f, 4.024f}, // Timmy spawn loc + {3668.603f, -3183.314f, 126.215f} // Courtyard mobs sort point }; struct ZigguratStore @@ -140,6 +151,7 @@ class MANGOS_DLL_DECL instance_stratholme : public ScriptedInstance ZigguratStore m_zigguratStorage[MAX_ZIGGURATS]; + std::set m_suiCrimsonLowGuids; GUIDList m_luiCrystalGUIDs; GUIDSet m_sAbomnationGUID; GUIDList m_luiAcolyteGUIDs; diff --git a/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp b/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp index 4ba4fe2..462a211 100644 --- a/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp +++ b/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp @@ -16,13 +16,558 @@ /* ScriptData SDName: boss_eredar_twins -SD%Complete: -SDComment: +SD%Complete: 75 +SDComment: A few spells are not working proper yet SDCategory: Sunwell Plateau EndScriptData */ #include "precompiled.h" +#include "sunwell_plateau.h" + +enum +{ + SAY_INTRO_1 = -1580044, + SAY_INTRO_2 = -1580045, + SAY_INTRO_3 = -1580046, + SAY_INTRO_4 = -1580047, + SAY_INTRO_5 = -1580048, + SAY_INTRO_6 = -1580049, + SAY_INTRO_7 = -1580050, + SAY_INTRO_8 = -1580051, + + SAY_SACROLASH_SHADOW_NOVA = -1580052, + SAY_SACROLASH_EMPOWER = -1580053, + SAY_SACROLASH_KILL_1 = -1580054, + SAY_SACROLASH_KILL_2 = -1580055, + SAY_SACROLASH_DEAD = -1580056, + SAY_SACROLASH_BERSERK = -1580057, + + SAY_ALYTHESS_CANFLAGRATION = -1580058, + SAY_ALYTHESS_EMPOWER = -1580059, + SAY_ALYTHESS_KILL_1 = -1580060, + SAY_ALYTHESS_KILL_2 = -1580061, + SAY_ALYTHESS_DEAD = -1580062, + SAY_ALYTHESS_BERSERK = -1580063, + + // Shared spells + SPELL_TWINS_ENRAGE = 46587, + SPELL_EMPOWER = 45366, // Cast on self when the twin sister dies + SPELL_DARK_FLAME = 45345, + + // Sacrolash spells + SPELL_DARK_TOUCHED = 45347, // TODO NYI - Player debuff; removed by shadow damage + SPELL_SHADOW_BLADES = 45248, // 10 secs + SPELL_DARK_STRIKE = 45271, + SPELL_SHADOW_NOVA = 45329, // 30-35 secs + SPELL_CONFOUNDING_BLOW = 45256, // Daze; 25 secs + SPELL_SHADOW_NOVA_UNK = 45332, // Unknown + + // Shadow Image spells + NPC_SHADOW_IMAGE = 25214, + SPELL_SHADOWFURY = 45270, + SPELL_IMAGE_VISUAL = 45263, + + // Alythess spells + SPELL_PYROGENICS = 45230, // Self buff; 15secs + SPELL_FLAME_TOUCHED = 45348, // TODO NYI - Player debuff; removed by shadow damage + SPELL_CONFLAGRATION = 45342, // 30-35 secs + SPELL_BLAZE = 45235, // On main target every 3 secs; should trigger 45236 which leaves a fire on the ground + SPELL_FLAME_SEAR = 46771, // A few random targets debuff + SPELL_CONFLAGRATION_UNK = 45333, // Unknown +}; + +static const DialogueEntry aIntroDialogue[] = +{ + {SAY_INTRO_1, NPC_SACROLASH, 1000}, + {SAY_INTRO_2, NPC_ALYTHESS, 1000}, + {SAY_INTRO_3, NPC_SACROLASH, 1000}, + {SAY_INTRO_4, NPC_ALYTHESS, 1000}, + {SAY_INTRO_5, NPC_SACROLASH, 1000}, + {SAY_INTRO_6, NPC_ALYTHESS, 1000}, + {SAY_INTRO_7, NPC_SACROLASH, 3000}, + {SAY_INTRO_8, NPC_ALYTHESS, 0}, + {0, 0, 0}, +}; + +struct MANGOS_DLL_DECL boss_alythessAI : public ScriptedAI +{ + boss_alythessAI(Creature* pCreature) : ScriptedAI(pCreature), + m_introDialogue(aIntroDialogue) + { + m_pInstance = ((instance_sunwell_plateau*)pCreature->GetInstanceData()); + m_introDialogue.InitializeDialogueHelper(m_pInstance); + Reset(); + } + + ScriptedInstance* m_pInstance; + DialogueHelper m_introDialogue; + + uint32 m_uiEnrageTimer; + uint32 m_uiPyrogenicsTimer; + uint32 m_uiFlameTouchedTimer; + uint32 m_uiConflagrationTimer; + uint32 m_uiBlazeTimer; + uint32 m_uiFlameSearTimer; + bool m_bDidIntro; + + void Reset() + { + m_uiEnrageTimer = 6*MINUTE*IN_MILLISECONDS; + m_uiPyrogenicsTimer = 20000; + m_uiFlameTouchedTimer = 30000; + m_uiConflagrationTimer = urand(25000, 30000); + m_uiBlazeTimer = 1000; + m_uiFlameSearTimer = 5000; + m_bDidIntro = false; + } + + void JustReachedHome() + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_EREDAR_TWINS) != FAIL) + m_pInstance->SetData(TYPE_EREDAR_TWINS, FAIL); + + // Respawn dead sister + if (Creature* pSister = m_pInstance->GetSingleCreatureFromStorage(NPC_SACROLASH)) + { + if (!pSister->isAlive()) + pSister->Respawn(); + } + } + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_EREDAR_TWINS) != IN_PROGRESS) + m_pInstance->SetData(TYPE_EREDAR_TWINS, IN_PROGRESS); + } + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + // Only range attack + m_creature->GetMotionMaster()->MoveChase(pWho, 10.0f); + } + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_ALYTHESS_KILL_1 : SAY_ALYTHESS_KILL_2, m_creature); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + { + if (Creature* pSacrolash = m_pInstance->GetSingleCreatureFromStorage(NPC_SACROLASH)) + { + if (!pSacrolash->isAlive()) + { + m_pInstance->SetData(TYPE_EREDAR_TWINS, DONE); + DoScriptText(SAY_ALYTHESS_DEAD, m_creature); + } + else + { + // Remove loot flag and cast empower + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + DoScriptText(SAY_SACROLASH_EMPOWER, pSacrolash); + pSacrolash->InterruptNonMeleeSpells(true); + pSacrolash->CastSpell(pSacrolash, SPELL_EMPOWER, false); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_pInstance && m_pInstance->GetData(TYPE_EREDAR_TWINS) == SPECIAL) + { + if (!m_bDidIntro) + { + m_introDialogue.StartNextDialogueText(SAY_INTRO_1); + m_bDidIntro = true; + } + m_introDialogue.DialogueUpdate(uiDiff); + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiEnrageTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_TWINS_ENRAGE) == CAST_OK) + { + DoScriptText(SAY_ALYTHESS_BERSERK, m_creature); + m_uiEnrageTimer = 6*MINUTE*IN_MILLISECONDS; + } + } + else + m_uiEnrageTimer -= uiDiff; + + if (m_uiPyrogenicsTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_PYROGENICS) == CAST_OK) + m_uiPyrogenicsTimer = urand(25000, 30000); + } + else + m_uiPyrogenicsTimer -= uiDiff; + + /* // Spell needs research of fix; it shoudn't be cast on self + if (m_uiFlameTouchedTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_FLAME_TOUCHED) == CAST_OK) + m_uiFlameTouchedTimer = urand(10000, 13000); + } + else + m_uiFlameTouchedTimer -= uiDiff; + */ + + if (m_uiConflagrationTimer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 3); + if (!pTarget) + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + if (DoCastSpellIfCan(pTarget, SPELL_CONFLAGRATION) == CAST_OK) + { + DoScriptText(SAY_ALYTHESS_CANFLAGRATION, m_creature); + m_uiConflagrationTimer = urand(20000, 25000); + } + } + else + m_uiConflagrationTimer -= uiDiff; + + if (m_uiFlameSearTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_FLAME_SEAR) == CAST_OK) + m_uiFlameSearTimer = 10000; + } + else + m_uiFlameSearTimer -= uiDiff; + + if (m_uiBlazeTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_BLAZE) == CAST_OK) + m_uiBlazeTimer = 3000; + } + else + m_uiBlazeTimer -= uiDiff; + } +}; + +struct MANGOS_DLL_DECL boss_sacrolashAI : public ScriptedAI +{ + boss_sacrolashAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = ((instance_sunwell_plateau*)pCreature->GetInstanceData()); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiEnrageTimer; + uint32 m_uiDarkTouchedTimer; + uint32 m_uiShadowNovaTimer; + uint32 m_uiConfoundingBlowTimer; + uint32 m_uiShadowBladesTimer; + uint32 m_uiSummonShadowImage; + + void Reset() + { + m_uiEnrageTimer = 6*MINUTE*IN_MILLISECONDS; + m_uiDarkTouchedTimer = 30000; + m_uiShadowNovaTimer = 15000; + m_uiConfoundingBlowTimer = 30000; + m_uiShadowBladesTimer = 15000; + m_uiSummonShadowImage = 10000; + } + + void JustReachedHome() + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_EREDAR_TWINS) != FAIL) + m_pInstance->SetData(TYPE_EREDAR_TWINS, FAIL); + + // Respawn dead sister + if (Creature* pSister = m_pInstance->GetSingleCreatureFromStorage(NPC_ALYTHESS)) + { + if (!pSister->isAlive()) + pSister->Respawn(); + } + } + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_EREDAR_TWINS) != IN_PROGRESS) + m_pInstance->SetData(TYPE_EREDAR_TWINS, IN_PROGRESS); + } + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_SACROLASH_KILL_1 : SAY_SACROLASH_KILL_2, m_creature); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + { + if (Creature* pAlythess = m_pInstance->GetSingleCreatureFromStorage(NPC_ALYTHESS)) + { + if (!pAlythess->isAlive()) + { + m_pInstance->SetData(TYPE_EREDAR_TWINS, DONE); + DoScriptText(SAY_SACROLASH_DEAD, m_creature); + } + else + { + // Remove loot flag and cast empower + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + DoScriptText(SAY_ALYTHESS_EMPOWER, pAlythess); + pAlythess->InterruptNonMeleeSpells(true); + pAlythess->CastSpell(pAlythess, SPELL_EMPOWER, false); + } + } + } + } + + // Return a random target which it's not in range of 10 yards of boss + Unit* GetRandomTargetAtDist(float fDist) + { + std::vector m_vRangeTargets; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator iter = tList.begin();iter != tList.end(); ++iter) + { + if (Unit* pTempTarget = m_creature->GetMap()->GetUnit((*iter)->getUnitGuid())) + { + if (!pTempTarget->IsWithinDistInMap(m_creature, fDist)) + m_vRangeTargets.push_back(pTempTarget); + } + } + + if (!m_vRangeTargets.empty()) + return m_vRangeTargets[urand(0, m_vRangeTargets.size() - 1)]; + else + return m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_SHADOW_IMAGE) + { + pSummoned->CastSpell(pSummoned, SPELL_IMAGE_VISUAL, false); + // Attack random range target + if (Unit* pTarget = GetRandomTargetAtDist(10.0f)) + pSummoned->AI()->AttackStart(pTarget); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiEnrageTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_TWINS_ENRAGE) == CAST_OK) + { + DoScriptText(SAY_SACROLASH_BERSERK, m_creature); + m_uiEnrageTimer = 6*MINUTE*IN_MILLISECONDS; + } + } + else + m_uiEnrageTimer -= uiDiff; + + /* // Spell needs research of fix; it shoudn't be cast on self + if (m_uiDarkTouchedTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_DARK_TOUCHED) == CAST_OK) + m_uiDarkTouchedTimer = urand(10000, 13000); + } + else + m_uiDarkTouchedTimer -= uiDiff; + */ + + if (m_uiShadowBladesTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_SHADOW_BLADES) == CAST_OK) + m_uiShadowBladesTimer = urand(13000, 15000); + } + else + m_uiShadowBladesTimer -= uiDiff; + + if (m_uiShadowNovaTimer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 2); + if (!pTarget) + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + if (DoCastSpellIfCan(pTarget, SPELL_SHADOW_NOVA) == CAST_OK) + { + DoScriptText(SAY_SACROLASH_SHADOW_NOVA, m_creature); + m_uiShadowNovaTimer = urand(30000, 35000); + } + } + else + m_uiShadowNovaTimer -= uiDiff; + + if (m_uiConfoundingBlowTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CONFOUNDING_BLOW) == CAST_OK) + { + // Reset threat + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(), -100); + + m_uiConfoundingBlowTimer = urand(25000, 30000); + } + } + else + m_uiConfoundingBlowTimer -= uiDiff; + + if (m_uiSummonShadowImage < uiDiff) + { + // Summon 3 shadow images at the boss position + for(uint8 i = 0; i < 3; ++i) + m_creature->SummonCreature(NPC_SHADOW_IMAGE, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + + m_uiSummonShadowImage = urand(10000, 12000); + } + else + m_uiSummonShadowImage -= uiDiff; + + // Overwrite the melee attack in order to apply the dark strike + if (m_creature->CanReachWithMeleeAttack(m_creature->getVictim())) + { + // Make sure our attack is ready and we aren't currently casting + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DARK_STRIKE); + + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + } + } +}; + +struct MANGOS_DLL_DECL npc_shadow_imageAI : public ScriptedAI +{ + npc_shadow_imageAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 m_uiChosenAbility; + uint32 m_uiSuicideTimer; + uint32 m_uiAbilityTimer; + uint8 m_uiDarkStrikes; + + void Reset() + { + // Choose only one spell for attack + m_uiChosenAbility = urand(0, 1) ? SPELL_DARK_STRIKE : SPELL_SHADOWFURY; + m_uiAbilityTimer = 500; + m_uiDarkStrikes = 0; + m_uiSuicideTimer = 0; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Suicide on timer; this is needed because of the cast time + if (m_uiSuicideTimer) + { + if (m_uiSuicideTimer <= uiDiff) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + else + m_uiSuicideTimer -= uiDiff; + } + else + { + // Do chosen ability + switch (m_uiChosenAbility) + { + case SPELL_SHADOWFURY: + if (m_uiAbilityTimer < uiDiff) + { + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), INTERACTION_DISTANCE)) + { + if (DoCastSpellIfCan(m_creature, SPELL_SHADOWFURY) == CAST_OK) + m_uiSuicideTimer = 1000; + } + } + else + m_uiAbilityTimer -= uiDiff; + break; + case SPELL_DARK_STRIKE: + if (m_uiAbilityTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_DARK_STRIKE) == CAST_OK) + { + ++m_uiDarkStrikes; + // kill itself after 2 strikes + if (m_uiDarkStrikes == 2) + m_uiSuicideTimer = 1000; + else + m_uiAbilityTimer = 1000; + } + } + else + m_uiAbilityTimer -= uiDiff; + break; + } + } + } +}; + +CreatureAI* GetAI_boss_alythess(Creature* pCreature) +{ + return new boss_alythessAI (pCreature); +} + +CreatureAI* GetAI_boss_sacrolash(Creature* pCreature) +{ + return new boss_sacrolashAI (pCreature); +} + +CreatureAI* GetAI_npc_shadow_image(Creature* pCreature) +{ + return new npc_shadow_imageAI (pCreature); +} void AddSC_boss_eredar_twins() { + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_alythess"; + pNewScript->GetAI = &GetAI_boss_alythess; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "boss_sacrolash"; + pNewScript->GetAI = &GetAI_boss_sacrolash; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_shadow_image"; + pNewScript->GetAI = &GetAI_npc_shadow_image; + pNewScript->RegisterSelf(); } diff --git a/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp b/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp index 2fd1b1e..3e4f971 100644 --- a/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp +++ b/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp @@ -22,6 +22,19 @@ SDCategory: Sunwell Plateau EndScriptData */ #include "precompiled.h" +#include "sunwell_plateau.h" + +enum +{ + SAY_INTRO = -1580036, + SAY_KILL_1 = -1580037, + SAY_KILL_2 = -1580038, + SAY_DEATH = -1580042, + SAY_TAKEOFF = -1580040, + SAY_BREATH = -1580039, + SAY_BERSERK = -1580041, + SAY_KALECGOS_OUTRO = -1580043, +}; void AddSC_boss_felmyst() { diff --git a/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp b/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp index e14d4f1..a243fb2 100644 --- a/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp +++ b/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp @@ -22,6 +22,42 @@ SDCategory: Sunwell Plateau EndScriptData */ #include "precompiled.h" +#include "sunwell_plateau.h" + +enum +{ + SAY_ORDER_1 = -1580064, + SAY_ORDER_2 = -1580065, + SAY_ORDER_3 = -1580066, + SAY_ORDER_4 = -1580067, + SAY_ORDER_5 = -1580068, + SAY_EMERGE = -1580069, + SAY_SLAY_1 = -1580070, + SAY_SLAY_2 = -1580071, + SAY_REFLECTION_1 = -1580072, + SAY_REFLECTION_2 = -1580073, + SAY_DARKNESS_1 = -1580074, + SAY_DARKNESS_2 = -1580075, + SAY_DARKNESS_3 = -1580076, + SAY_PHASE_3 = -1580077, + SAY_PHASE_4 = -1580078, + SAY_PHASE_5 = -1580079, + SAY_KALECGOS_INTRO = -1580080, + SAY_KALECGOS_AWAKE_1 = -1580081, + SAY_ANVEENA_IMPRISONED = -1580082, + SAY_KALECGOS_AWAKE_2 = -1580083, + SAY_ANVEENA_LOST = -1580084, + SAY_KALECGOS_AWAKE_4 = -1580085, + SAY_ANVEENA_AWAKE = -1580086, + SAY_KALECGOS_AWAKE_5 = -1580087, + SAY_ANVEENA_SACRIFICE = -1580088, + SAY_KALECGOS_GOODBYE = -1580089, + SAY_KALECGOS_ENCOURAGE = -1580090, + SAY_KALECGOS_ORB_1 = -1580091, + SAY_KALECGOS_ORB_2 = -1580092, + SAY_KALECGOS_ORB_3 = -1580093, + SAY_KALECGOS_ORB_4 = -1580094, +}; void AddSC_boss_kiljaeden() { diff --git a/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp b/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp index 8639c02..1ebf535 100644 --- a/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp +++ b/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp @@ -280,6 +280,22 @@ InstanceData* GetInstanceData_instance_sunwell_plateau(Map* pMap) return new instance_sunwell_plateau(pMap); } +bool AreaTrigger_at_sunwell_plateau(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (pAt->id == AREATRIGGER_TWINS) + { + if (pPlayer->isGameMaster() || pPlayer->isDead()) + return false; + + instance_sunwell_plateau* pInstance = (instance_sunwell_plateau*)pPlayer->GetInstanceData(); + + if (pInstance && pInstance->GetData(TYPE_EREDAR_TWINS) == NOT_STARTED) + pInstance->SetData(TYPE_EREDAR_TWINS, SPECIAL); + } + + return false; +} + void AddSC_instance_sunwell_plateau() { Script* pNewScript; @@ -288,4 +304,9 @@ void AddSC_instance_sunwell_plateau() pNewScript->Name = "instance_sunwell_plateau"; pNewScript->GetInstanceData = &GetInstanceData_instance_sunwell_plateau; pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_sunwell_plateau"; + pNewScript->pAreaTrigger = &AreaTrigger_at_sunwell_plateau; + pNewScript->RegisterSelf(); } diff --git a/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h b/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h index 3f06cc3..4403f6f 100644 --- a/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h +++ b/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h @@ -43,6 +43,10 @@ enum GO_MURU_EXIT_GATE = 188118, GO_THIRD_GATE = 187765, // door after muru; why another? + SAY_TWINS_INTRO = -1580044, + + AREATRIGGER_TWINS = 4937, + // spells related to kalecgos event SPELL_SPECTRAL_REALM = 46021, SPELL_TELEPORT_NORMAL_REALM = 46020, diff --git a/scripts/eastern_kingdoms/undercity.cpp b/scripts/eastern_kingdoms/undercity.cpp index 105afb5..719f6cc 100644 --- a/scripts/eastern_kingdoms/undercity.cpp +++ b/scripts/eastern_kingdoms/undercity.cpp @@ -33,16 +33,24 @@ EndContentData */ ## npc_lady_sylvanas_windrunner ######*/ -#define SAY_LAMENT_END -1000196 -#define EMOTE_LAMENT_END -1000197 - -#define SOUND_CREDIT 10896 -#define ENTRY_HIGHBORNE_LAMENTER 21628 -#define ENTRY_HIGHBORNE_BUNNY 21641 - -#define SPELL_HIGHBORNE_AURA 37090 -#define SPELL_SYLVANAS_CAST 36568 -#define SPELL_RIBBON_OF_SOULS 34432 //the real one to use might be 37099 +enum +{ + SAY_LAMENT_END = -1000196, + EMOTE_LAMENT_END = -1000197, + + SOUND_CREDIT = 10896, + ENTRY_HIGHBORNE_LAMENTER = 21628, + ENTRY_HIGHBORNE_BUNNY = 21641, + + SPELL_HIGHBORNE_AURA = 37090, + SPELL_SYLVANAS_CAST = 36568, + SPELL_RIBBON_OF_SOULS = 34432, //the real one to use might be 37099 + SPELL_BLACK_ARROW = 59712, + SPELL_FADE = 20672, + SPELL_MULTI_SHOT = 59713, + SPELL_SHOOT_SYLVANAS = 59710, + SPELL_SUMMON_SKELETON = 59711, +}; float HighborneLoc[4][3]= { @@ -66,6 +74,12 @@ struct MANGOS_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI float myY; float myZ; + uint32 m_uiBlackArrowTimer; + uint32 m_uiMultiShotTimer; + uint32 m_uiFadeTimer; + uint32 m_uiShootTimer; + uint32 m_uiSummonSkeletonTimer; + void Reset() { myX = m_creature->GetPositionX(); @@ -75,6 +89,12 @@ struct MANGOS_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI LamentEvent_Timer = 5000; LamentEvent = false; m_targetGuid.Clear(); + + m_uiBlackArrowTimer = 15000; + m_uiMultiShotTimer = 11000; + m_uiFadeTimer = 15000; + m_uiShootTimer = 5000; + m_uiSummonSkeletonTimer = 17000; } void JustSummoned(Creature *summoned) @@ -91,11 +111,11 @@ struct MANGOS_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI } } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (LamentEvent) { - if (LamentEvent_Timer < diff) + if (LamentEvent_Timer < uiDiff) { float raX = myX; float raY = myY; @@ -111,12 +131,54 @@ struct MANGOS_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI DoScriptText(EMOTE_LAMENT_END, m_creature); LamentEvent = false; } - }else LamentEvent_Timer -= diff; + }else LamentEvent_Timer -= uiDiff; } if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; + if (m_uiBlackArrowTimer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_BLACK_ARROW); + m_uiBlackArrowTimer = urand(15000, 25000); + } + else + m_uiBlackArrowTimer -= uiDiff; + + if (m_uiMultiShotTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT); + m_uiMultiShotTimer = urand(11000, 14000); + } + else + m_uiMultiShotTimer -= uiDiff; + + if (m_uiFadeTimer < uiDiff) + { + DoCast(m_creature, SPELL_FADE); + m_uiFadeTimer = urand(15000, 20000); + } + else + m_uiFadeTimer -= uiDiff; + + if (m_uiShootTimer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_SHOOT_SYLVANAS); + m_uiShootTimer = urand(6000, 9000); + } + else + m_uiShootTimer -= uiDiff; + + if (m_uiSummonSkeletonTimer < uiDiff) + { + DoCast(m_creature, SPELL_SUMMON_SKELETON); + m_uiSummonSkeletonTimer = urand(17000, 23000); + } + else + m_uiSummonSkeletonTimer -= uiDiff; + DoMeleeAttackIfReady(); } }; @@ -171,9 +233,8 @@ struct MANGOS_DLL_DECL npc_highborne_lamenterAI : public ScriptedAI { if (EventMove_Timer < diff) { - m_creature->AddSplineFlag(SPLINEFLAG_NO_SPLINE); - m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,5000); - m_creature->GetMap()->CreatureRelocation(m_creature,m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,m_creature->GetOrientation()); + m_creature->SetLevitate(true); + m_creature->MonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,3.f); EventMove = false; }else EventMove_Timer -= diff; } diff --git a/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp b/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp index 6d5b154..127e2da 100644 --- a/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp +++ b/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp @@ -257,9 +257,7 @@ struct MANGOS_DLL_DECL mob_soaring_eagleAI : public ScriptedAI float fX, fY, fZ; pAzkil->GetRandomPoint(pAzkil->GetPositionX(), pAzkil->GetPositionY(), pAzkil->GetPositionZ()+15.0f, 30.0f, fX, fY, fZ); - if (m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE)) - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); - + m_creature->SetWalk(false); m_creature->GetMotionMaster()->MovePoint(POINT_ID_RANDOM, fX, fY, fZ); m_bCanMoveToRandom = false; diff --git a/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp b/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp index b94109f..d7c1cd0 100644 --- a/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp +++ b/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp @@ -603,9 +603,7 @@ struct MANGOS_DLL_DECL npc_amanishi_hatcherAI : public ScriptedAI m_uiHatchlingCount = 1; m_bCanMoveNext = false; m_bWaypointEnd = false; - - if (m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE)) - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); } void MoveInLineOfSight(Unit* pWho) {} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp b/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp index 96a16f8..6fd7534 100644 --- a/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp +++ b/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp @@ -256,7 +256,7 @@ struct MANGOS_DLL_DECL boss_mandokirAI : public ScriptedAI if (!m_bMandokirDownstairs && m_pInstance && (m_pInstance->GetData(TYPE_OHGAN) == SPECIAL || m_pInstance->GetData(TYPE_OHGAN) == FAIL)) { m_bMandokirDownstairs = true; - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_creature->GetMotionMaster()->MovePoint(POINT_DOWNSTAIRS, aMandokirDownstairsPos.fX, aMandokirDownstairsPos.fY, aMandokirDownstairsPos.fZ); } diff --git a/scripts/kalimdor/azuremyst_isle.cpp b/scripts/kalimdor/azuremyst_isle.cpp index f7e69f2..1d8194d 100644 --- a/scripts/kalimdor/azuremyst_isle.cpp +++ b/scripts/kalimdor/azuremyst_isle.cpp @@ -27,6 +27,7 @@ npc_engineer_spark_overgrind npc_injured_draenei npc_magwin npc_susurrus +boss_prophet_velen EndContentData */ #include "precompiled.h" @@ -103,7 +104,7 @@ struct MANGOS_DLL_DECL npc_draenei_survivorAI : public ScriptedAI void SpellHit(Unit* pCaster, const SpellEntry* pSpell) { - if (pSpell->IsFitToFamilyMask(UI64LIT(0x0000000000000000), 0x080000000)) + if (pSpell->SpellFamilyFlags.test()) { m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); m_creature->SetStandState(UNIT_STAND_STATE_STAND); @@ -426,9 +427,84 @@ bool GossipSelect_npc_susurrus(Player* pPlayer, Creature* pCreature, uint32 uiSe } /*###### -## +##boss_prophet_velen ######*/ +enum +{ + SPELL_HOLY_BLAST = 59700, + SPELL_HOLY_NOVA = 59701, + SPELL_HOLY_SMITE = 59703, + //SPELL_PRAYER_OF_HEALING = 59698, //on friendly + SPELL_STAFF_STRIKE = 33542, +}; + +struct MANGOS_DLL_DECL boss_prophet_velenAI : public ScriptedAI +{ + boss_prophet_velenAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiHolyBlastTimer; + uint32 m_uiHolyNovaTimer; + uint32 m_uiHolySmiteTimer; + uint32 m_uiStaffStrikeTimer; + //uint32 m_uiPrayerOfHealingTimer; + + void Reset() + { + m_uiHolyBlastTimer = 7000; + m_uiHolyNovaTimer = 12000; + m_uiHolySmiteTimer = 9000; + m_uiStaffStrikeTimer = 5000; + //m_uiPrayerOfHealingTimer= 10000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiHolyBlastTimer < uiDiff) + { + Unit* pTarget = (m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)); + DoCast(pTarget, SPELL_HOLY_BLAST); + m_uiHolyBlastTimer = urand(7000, 11000); + } + else + m_uiHolyBlastTimer -= uiDiff; + + if (m_uiHolyNovaTimer < uiDiff) + { + DoCast(m_creature, SPELL_HOLY_NOVA); + m_uiHolyNovaTimer = urand(12000, 17000); + } + else + m_uiHolyNovaTimer -= uiDiff; + + if (m_uiHolySmiteTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_HOLY_SMITE); + m_uiHolySmiteTimer = urand(8000, 12000); + } + else + m_uiHolySmiteTimer -= uiDiff; + + if (m_uiStaffStrikeTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_STAFF_STRIKE); + m_uiStaffStrikeTimer = urand(5000, 8000); + } + else + m_uiStaffStrikeTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_prophet_velen(Creature* pCreature) +{ + return new boss_prophet_velenAI(pCreature); +} + void AddSC_azuremyst_isle() { Script *newscript; @@ -461,4 +537,9 @@ void AddSC_azuremyst_isle() newscript->pGossipHello = &GossipHello_npc_susurrus; newscript->pGossipSelect = &GossipSelect_npc_susurrus; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_prophet_velen"; + newscript->GetAI = &GetAI_boss_prophet_velen; + newscript->RegisterSelf(); } diff --git a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_lord_epoch.cpp b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_lord_epoch.cpp index 7b739ce..0579083 100644 --- a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_lord_epoch.cpp +++ b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_lord_epoch.cpp @@ -59,7 +59,6 @@ struct MANGOS_DLL_DECL boss_lord_epochAI : public ScriptedAI uint32 Warp_Timer; uint32 Stop_Timer; uint32 Course_Timer; - uint64 m_uiArthasGUID; void Reset() { diff --git a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_malganis.cpp b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_malganis.cpp index 23a3155..afd663f 100644 --- a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_malganis.cpp +++ b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_malganis.cpp @@ -46,7 +46,8 @@ enum SPELL_MIND_BLAST_H = 58850, SPELL_SLEEP_N = 52721, SPELL_SLEEP_H = 58849, - SPELL_VAMPIRE = 52723 + SPELL_VAMPIRE = 52723, + SPELL_ACHIEV_CHECK = 58630 }; struct MANGOS_DLL_DECL boss_malganisAI : public ScriptedAI @@ -121,7 +122,7 @@ struct MANGOS_DLL_DECL boss_malganisAI : public ScriptedAI { KillCreditMalganis(); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (Creature* pArthas = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_ARTHAS))) + if (Creature* pArthas = m_pInstance->GetSingleCreatureFromStorage(NPC_ARTHAS)) m_creature->SetInCombatWith(pArthas); } else @@ -220,6 +221,7 @@ struct MANGOS_DLL_DECL boss_malganisAI : public ScriptedAI { m_pInstance->SetData(TYPE_PHASE, 10); m_pInstance->SetData(TYPE_MALGANIS, DONE); + DoCastSpellIfCan(m_creature, SPELL_ACHIEV_CHECK, CAST_TRIGGERED); EnterEvadeMode(); } diff --git a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp index f4d6576..38d9576 100644 --- a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp +++ b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp @@ -93,8 +93,8 @@ enum SAY_PHASE605 = -1594164, //Arthas mall start SAY_PHASE606 = -1594188, - SAY_MALGANIS_ESCAPE02 = -1594180, - SAY_MALGANIS_ESCAPE01 = -1594187, + SAY_MALGANIS_ESCAPE02 = -1594180, + SAY_MALGANIS_ESCAPE01 = -1594187, SAY_MALGANIS_OUTRO = -1594182, SAY_ARTHAS_OUTRO01 = -1594181, SAY_ARTHAS_OUTRO02 = -1594183, @@ -136,20 +136,18 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI ScriptedInstance* m_pInstance; bool m_bIsHeroic; - uint64 m_uiUtherGUID; - uint64 m_uiJainaGUID; - uint64 m_uiPeople01GUID; - uint64 m_uiPeople02GUID; - uint64 m_uiMalganisGUID; - uint64 m_uiMarine01GUID; - uint64 m_uiMarine02GUID; - uint64 m_uiMarine03GUID; - uint64 m_uiMarine04GUID; - uint64 m_uiPriest01GUID; - uint64 m_uiPriest02GUID; - uint64 m_uiHuman01GUID; - uint64 m_uiHuman02GUID; - uint64 m_uiHuman03GUID; + ObjectGuid m_uiPeople01GUID; + ObjectGuid m_uiPeople02GUID; + ObjectGuid m_uiMalganisGUID; + ObjectGuid m_uiMarine01GUID; + ObjectGuid m_uiMarine02GUID; + ObjectGuid m_uiMarine03GUID; + ObjectGuid m_uiMarine04GUID; + ObjectGuid m_uiPriest01GUID; + ObjectGuid m_uiPriest02GUID; + ObjectGuid m_uiHuman01GUID; + ObjectGuid m_uiHuman02GUID; + ObjectGuid m_uiHuman03GUID; uint32 culling_faction; uint32 m_uiStep; @@ -235,9 +233,9 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI void SummonPeople() { if(Creature* Cityman = m_creature->SummonCreature(NPC_CITYMAN,2091.977f,1275.021f,140.757f,0.558f,TEMPSUMMON_CORPSE_TIMED_DESPAWN,30000)) - m_uiPeople01GUID = Cityman->GetGUID(); + m_uiPeople01GUID = Cityman->GetObjectGuid(); if(Creature* Crazyman = m_creature->SummonCreature(NPC_CRAZYMAN,2093.514f,1275.842f,140.408f,3.801f,TEMPSUMMON_CORPSE_TIMED_DESPAWN,30000)) - m_uiPeople02GUID = Crazyman->GetGUID(); + m_uiPeople02GUID = Crazyman->GetObjectGuid(); } void StartAI() @@ -342,18 +340,18 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI ResetStep(2000); if(Unit* Cityman = m_creature->GetMap()->GetUnit( m_uiPeople01GUID)) { - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Cityman->GetGUID()); - Cityman->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, Cityman->GetObjectGuid()); + Cityman->SetGuidValue(UNIT_FIELD_TARGET, m_creature->GetObjectGuid()); Cityman->GetMotionMaster()->MovePoint(0, 2088.625f,1279.191f,140.743f); } break; case 14: if(Creature* Human01 = m_creature->SummonCreature(NPC_CITY,2397.308f,1207.565f,134.038f,5.593f,TEMPSUMMON_CORPSE_TIMED_DESPAWN,30000)) - m_uiHuman01GUID = Human01->GetGUID(); + m_uiHuman01GUID = Human01->GetObjectGuid(); if(Creature* Human02 = m_creature->SummonCreature(NPC_CITY,2400.770f,1207.362f,134.038f,3.454f,TEMPSUMMON_CORPSE_TIMED_DESPAWN,30000)) - m_uiHuman02GUID = Human02->GetGUID(); + m_uiHuman02GUID = Human02->GetObjectGuid(); if(Creature* Human03 = m_creature->SummonCreature(NPC_CITY,2400.547f,1204.892f,134.038f,2.479f,TEMPSUMMON_CORPSE_TIMED_DESPAWN,30000)) - m_uiHuman03GUID = Human03->GetGUID(); + m_uiHuman03GUID = Human03->GetObjectGuid(); break; case 20: SetEscortPaused(true); @@ -402,8 +400,8 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI DoScriptText(SAY_PHASE514, m_creature); break; case 37: - if(GameObject* pGate = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(GO_SHKAF_GATE))) - pGate->SetGoState(GO_STATE_ACTIVE); + if(GameObject* pGate = m_pInstance->GetSingleGameObjectFromStorage(GO_SHKAF_GATE)) + pGate->SetGoState(GO_STATE_ACTIVE); SetRun(true); DoScriptText(SAY_PHASE515, m_creature); break; @@ -426,7 +424,7 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI m_creature->GetMotionMaster()->MovementExpired(false); m_creature->setFaction(FACTION); DoScriptText(SAY_PHASE605, m_creature); - if(Creature* Malganis = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_MALGANIS))) + if(Creature* Malganis = m_pInstance->GetSingleCreatureFromStorage(NPC_MALGANIS)) { m_pInstance->SetData(TYPE_MALGANIS, IN_PROGRESS); Malganis->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -448,20 +446,20 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI //Marine Close Left if(Creature* pEscort01 = GetClosestCreatureWithEntry(m_creature, NPC_MARINE, 50.0f)) { - m_uiMarine01GUID = pEscort01->GetGUID(); + m_uiMarine01GUID = pEscort01->GetObjectGuid(); pEscort01->UpdateEntry(NPC_CITYMAN); if(Creature* pEscort02 = GetClosestCreatureWithEntry(m_creature, NPC_MARINE, 50.0f)) { - m_uiMarine02GUID = pEscort02->GetGUID(); + m_uiMarine02GUID = pEscort02->GetObjectGuid(); pEscort02->UpdateEntry(NPC_CITYMAN); // Right marine 2 if(Creature* pEscort03 = GetClosestCreatureWithEntry(m_creature, NPC_MARINE, 50.0f)) { - m_uiMarine03GUID = pEscort03->GetGUID(); + m_uiMarine03GUID = pEscort03->GetObjectGuid(); pEscort03->UpdateEntry(NPC_CITYMAN); if(Creature* pEscort04 = GetClosestCreatureWithEntry(m_creature, NPC_MARINE, 50.0f)) { - m_uiMarine04GUID = pEscort04->GetGUID(); + m_uiMarine04GUID = pEscort04->GetObjectGuid(); pEscort01->UpdateEntry(NPC_MARINE); pEscort02->UpdateEntry(NPC_MARINE); pEscort03->UpdateEntry(NPC_MARINE); @@ -472,11 +470,11 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI if(Creature* pEscort05 = GetClosestCreatureWithEntry(m_creature, NPC_PRIEST, 50.0f)) { - m_uiPriest01GUID = pEscort05->GetGUID(); + m_uiPriest01GUID = pEscort05->GetObjectGuid(); pEscort05->UpdateEntry(NPC_CITYMAN); if(Creature* pEscort06 = GetClosestCreatureWithEntry(m_creature, NPC_PRIEST, 50.0f)) { - m_uiPriest02GUID = pEscort06->GetGUID(); + m_uiPriest02GUID = pEscort06->GetObjectGuid(); pEscort05->UpdateEntry(NPC_PRIEST); } } @@ -497,23 +495,21 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI JumpNextStep(2000); break; case 1: - m_uiUtherGUID = m_pInstance->GetData64(NPC_UTHER); - m_uiJainaGUID = m_pInstance->GetData64(NPC_JAINA); - if(Creature* pUther = m_pInstance->instance->GetCreature(m_uiUtherGUID)) + if(Creature* pUther = m_pInstance->GetSingleCreatureFromStorage(NPC_UTHER)) DoScriptText(SAY_INTRO02, pUther); JumpNextStep(8000); break; case 2: - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); DoScriptText(SAY_INTRO03, m_creature); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); m_creature->GetMotionMaster()->MovePoint(0, 1908.334f, 1315.354f, 149.551f); - if(Creature* pUther = m_pInstance->instance->GetCreature(m_uiUtherGUID)) + if(Creature* pUther = m_pInstance->instance->GetCreature(NPC_UTHER)) pUther->GetMotionMaster()->MovePoint(0, 1903.600f, 1296.678f, 143.383f); JumpNextStep(2000); break; case 3: - if(Creature* pJaina = m_pInstance->instance->GetCreature(m_uiJainaGUID)) + if(Creature* pJaina = m_pInstance->instance->GetCreature(NPC_JAINA)) pJaina->GetMotionMaster()->MovePoint(0, 1899.641f, 1298.684f, 143.831f); JumpNextStep(7000); break; @@ -527,18 +523,18 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI JumpNextStep(10000); break; case 6: - if(Creature* pUther = m_pInstance->instance->GetCreature(m_uiUtherGUID)) + if(Creature* pUther = m_pInstance->instance->GetCreature(NPC_UTHER)) DoScriptText(SAY_INTRO05, pUther); JumpNextStep(1000); break; case 7: - if(Creature* pUther = m_pInstance->instance->GetCreature(m_uiUtherGUID)) - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pUther->GetGUID()); + if(Creature* pUther = m_pInstance->instance->GetCreature(NPC_UTHER)) + m_creature->SetGuidValue(UNIT_FIELD_TARGET, pUther->GetObjectGuid()); DoScriptText(SAY_INTRO06, m_creature); JumpNextStep(4000); break; case 8: - if(Creature* pUther = m_pInstance->instance->GetCreature(m_uiUtherGUID)) + if(Creature* pUther = m_pInstance->instance->GetCreature(NPC_UTHER)) DoScriptText(SAY_INTRO07, pUther); JumpNextStep(6000); break; @@ -547,7 +543,7 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI JumpNextStep(4000); break; case 10: - if(Creature* pUther = m_pInstance->instance->GetCreature(m_uiUtherGUID)) + if(Creature* pUther = m_pInstance->instance->GetCreature(NPC_UTHER)) DoScriptText(SAY_INTRO09, pUther); JumpNextStep(8000); break; @@ -556,7 +552,7 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI JumpNextStep(4000); break; case 12: - if(Creature* pUther = m_pInstance->instance->GetCreature(m_uiUtherGUID)) + if(Creature* pUther = m_pInstance->instance->GetCreature(NPC_UTHER)) DoScriptText(SAY_INTRO11, pUther); JumpNextStep(4000); break; @@ -565,7 +561,7 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI JumpNextStep(11000); break; case 14: - if(Creature* pJaina = m_pInstance->instance->GetCreature(m_uiJainaGUID)) + if(Creature* pJaina = m_pInstance->instance->GetCreature(NPC_JAINA)) DoScriptText(SAY_INTRO13, pJaina); JumpNextStep(3000); break; @@ -574,14 +570,14 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI JumpNextStep(9000); break; case 16: - if(Creature* pUther = m_pInstance->instance->GetCreature(m_uiUtherGUID)) + if(Creature* pUther = m_pInstance->instance->GetCreature(NPC_UTHER)) DoScriptText(SAY_INTRO15, pUther); JumpNextStep(5000); break; case 17: - if(Creature* pJaina = m_pInstance->instance->GetCreature(m_uiJainaGUID)) + if(Creature* pJaina = m_pInstance->instance->GetCreature(NPC_JAINA)) { - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pJaina->GetGUID()); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, pJaina->GetObjectGuid()); pJaina->GetMotionMaster()->MovePoint(0, 1794.357f,1272.183f,140.558f); } JumpNextStep(1000); @@ -591,12 +587,12 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI JumpNextStep(1000); break; case 19: - if(Creature* pJaina = m_pInstance->instance->GetCreature(m_uiJainaGUID)) + if(Creature* pJaina = m_pInstance->instance->GetCreature(NPC_JAINA)) DoScriptText(SAY_INTRO17, pJaina); JumpNextStep(3000); break; case 20: - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); ((npc_arthasAI*)m_creature->AI())->Start(false); JumpNextStep(3000); break; @@ -629,8 +625,8 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI if(Unit* Crazyman = m_creature->GetMap()->GetUnit( m_uiPeople02GUID)) { DoScriptText(SAY_ENTER05, Crazyman); - Crazyman->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Crazyman->GetGUID()); + Crazyman->SetGuidValue(UNIT_FIELD_TARGET, m_creature->GetObjectGuid()); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, Crazyman->GetObjectGuid()); m_creature->GetMotionMaster()->MovePoint(0, 2092.154f,1276.645f,140.52f); } JumpNextStep(3000); @@ -645,7 +641,7 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI JumpNextStep(1000); break; case 6: - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); m_creature->GetMotionMaster()->MovePoint(0, 2091.179f,1278.065f,140.476f); DoScriptText(SAY_ENTER06, m_creature); JumpNextStep(3000); @@ -659,10 +655,10 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI m_pInstance->SetData(TYPE_ENCOUNTER, IN_PROGRESS); if(Creature* TempMalganis = m_creature->SummonCreature(NPC_MALGANIS_INTRO,2117.349f,1288.624f,136.271f,1.37f,TEMPSUMMON_TIMED_DESPAWN,29000)) { - m_uiMalganisGUID = TempMalganis->GetGUID(); + m_uiMalganisGUID = TempMalganis->GetObjectGuid(); DoScriptText(SAY_ENTER07, TempMalganis); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, TempMalganis->GetGUID()); - TempMalganis->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, TempMalganis->GetObjectGuid()); + TempMalganis->SetGuidValue(UNIT_FIELD_TARGET, m_creature->GetObjectGuid()); TempMalganis->setFaction(35); } JumpNextStep(11000); @@ -677,7 +673,7 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI JumpNextStep(7000); break; case 11: - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); DoScriptText(SAY_ENTER10, m_creature); JumpNextStep(12000); break; @@ -742,7 +738,7 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI if(Creature* pMeathook = m_creature->SummonCreature(NPC_MEATHOOK,2272.773f, 1331.824f, 124.171f, 3.12f,TEMPSUMMON_CORPSE_TIMED_DESPAWN,29000)) { DoScriptText(SAY_MEATHOOK_SPAWN, pMeathook); - pMeathook->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pMeathook->SetWalk(false); pMeathook->GetMotionMaster()->MovePoint(0, 2196.036f, 1328.818f, 129.997f); } break; @@ -782,7 +778,7 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI if(Creature* pSalramm = m_creature->SummonCreature(NPC_SALRAMM,2196.036f, 1328.818f, 129.997f, 3.12f,TEMPSUMMON_CORPSE_TIMED_DESPAWN,29000)) { DoScriptText(SAY_SALRAMM_SPAWN, pSalramm); - pSalramm->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSalramm->SetWalk(false); pSalramm->GetMotionMaster()->MovePoint(0, 2196.036f, 1328.818f, 129.997f); } break; @@ -796,8 +792,8 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI case 0: if(Creature* Human = m_pInstance->instance->GetCreature(m_uiHuman01GUID)) { - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Human->GetGUID()); - Human->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, Human->GetObjectGuid()); + Human->SetGuidValue(UNIT_FIELD_TARGET, m_creature->GetObjectGuid()); DoScriptText(SAY_PHASE503, Human); } JumpNextStep(4000); @@ -821,10 +817,10 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI JumpNextStep(6000); break; case 5: - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); if(Creature* Human = m_pInstance->instance->GetCreature(m_uiHuman01GUID)) { - Human->SetUInt64Value(UNIT_FIELD_TARGET, 0); + Human->SetGuidValue(UNIT_FIELD_TARGET, 0); Human->UpdateEntry(NPC_INFINITE_ADVERSARY); } if(Creature* Human2 = m_pInstance->instance->GetCreature(m_uiHuman02GUID)) @@ -862,7 +858,7 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI { pEpoch->setFaction(35); DoScriptText(SAY_EPOCH_INTRO, pEpoch); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pEpoch->GetGUID()); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, pEpoch->GetObjectGuid()); } JumpNextStep(20000); break; @@ -895,18 +891,18 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI case 0: m_creature->setFaction(35); m_creature->GetMotionMaster()->MovePoint(0, 2302.326f, 1491.386f, 128.362f); - if(Creature* Malganis = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_MALGANIS))) + if(Creature* Malganis = m_pInstance->GetSingleCreatureFromStorage(NPC_MALGANIS)) { DoScriptText(SAY_MALGANIS_ESCAPE01, Malganis); Malganis->InterruptNonMeleeSpells(false); Malganis->GetMotionMaster()->MovePoint(0, 2296.665f,1502.362f,128.362f); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Malganis->GetGUID()); - Malganis->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, Malganis->GetObjectGuid()); + Malganis->SetGuidValue(UNIT_FIELD_TARGET, m_creature->GetObjectGuid()); } JumpNextStep(10000); break; case 1: - if(Creature* Malganis = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_MALGANIS))) + if(Creature* Malganis = m_pInstance->GetSingleCreatureFromStorage(NPC_MALGANIS)) DoScriptText(SAY_MALGANIS_ESCAPE02, Malganis); JumpNextStep(10000); break; @@ -915,18 +911,18 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI JumpNextStep(5000); break; case 3: - if(Creature* Malganis = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_MALGANIS))) + if(Creature* Malganis = m_pInstance->GetSingleCreatureFromStorage(NPC_MALGANIS)) DoScriptText(SAY_MALGANIS_OUTRO, Malganis); JumpNextStep(20000); break; case 4: - if(Creature* Malganis = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_MALGANIS))) + if(Creature* Malganis = m_pInstance->GetSingleCreatureFromStorage(NPC_MALGANIS)) { Malganis->SetVisibility(VISIBILITY_OFF); m_creature->GetMotionMaster()->MovePoint(0, Malganis->GetPositionX(), Malganis->GetPositionY(), Malganis->GetPositionZ()); } - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); + m_creature->SetWalk(false); JumpNextStep(3000); break; case 5: @@ -996,7 +992,7 @@ struct MANGOS_DLL_DECL npc_arthasAI : public npc_escortAI } else m_uiMoveTimer -= uiDiff; } - + if(m_pInstance->GetData(TYPE_PHASE) == 3) { if(m_uiSummonTimer < uiDiff) @@ -1095,14 +1091,13 @@ struct MANGOS_DLL_DECL npc_utherAI : public npc_escortAI ScriptedInstance* m_pInstance; - uint64 m_uiArthasGUID; uint32 m_uiStep; uint32 m_uiStepTimer; bool StartEvent; - uint64 m_uiKnightGUID01; - uint64 m_uiKnightGUID02; - uint64 m_uiKnightGUID03; + ObjectGuid m_uiKnightGUID01; + ObjectGuid m_uiKnightGUID02; + ObjectGuid m_uiKnightGUID03; void Reset() { @@ -1120,22 +1115,22 @@ struct MANGOS_DLL_DECL npc_utherAI : public npc_escortAI if(Creature* Knight01 = m_creature->SummonCreature(NPC_KNIGHT,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,110000)) { - m_uiKnightGUID01 = Knight01->GetGUID(); - Knight01->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_uiKnightGUID01 = Knight01->GetObjectGuid(); + Knight01->SetWalk(false); Knight01->GetMotionMaster()->MoveFollow(m_creature,PET_FOLLOW_DIST,M_PI_F/2); } if(Creature* Knight02 = m_creature->SummonCreature(NPC_KNIGHT,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,110000)) { - m_uiKnightGUID02 = Knight02->GetGUID(); - Knight02->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_uiKnightGUID02 = Knight02->GetObjectGuid(); + Knight02->SetWalk(false); Knight02->GetMotionMaster()->MoveFollow(m_creature,PET_FOLLOW_DIST,M_PI_F/4); } if(Creature* Knight03 = m_creature->SummonCreature(NPC_KNIGHT,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,110000)) { - m_uiKnightGUID03 = Knight03->GetGUID(); - Knight03->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_uiKnightGUID03 = Knight03->GetObjectGuid(); + Knight03->SetWalk(false); Knight03->GetMotionMaster()->MoveFollow(m_creature,PET_FOLLOW_DIST,M_PI_F/3); } } @@ -1145,23 +1140,21 @@ struct MANGOS_DLL_DECL npc_utherAI : public npc_escortAI switch(uiPointId) { case 3: - m_uiArthasGUID = m_pInstance->GetData64(NPC_ARTHAS); - if(Creature* pArthas = m_pInstance->instance->GetCreature(m_uiArthasGUID)) + if(Creature* pArthas = m_pInstance->GetSingleCreatureFromStorage(NPC_ARTHAS)) { - pArthas->RemoveSplineFlag(SPLINEFLAG_WALKMODE); - pArthas->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + pArthas->SetWalk(false); + pArthas->SetGuidValue(UNIT_FIELD_TARGET, m_creature->GetObjectGuid()); pArthas->GetMotionMaster()->MovePoint(0, 1902.974f, 1291.635f, 143.337f); } break; case 4: SetRun(false); - if(Creature *pArthas = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_ARTHAS))) + if(Creature *pArthas = m_pInstance->GetSingleCreatureFromStorage(NPC_ARTHAS)) ((npc_arthasAI*)pArthas->AI())->StartAI(); break; case 6: m_creature->SetVisibility(VISIBILITY_OFF); - uint64 m_uiJainaGUID = m_pInstance->GetData64(NPC_JAINA); - if(Creature* pJaina = m_pInstance->instance->GetCreature(m_uiJainaGUID)) + if(Creature* pJaina = m_pInstance->GetSingleCreatureFromStorage(NPC_JAINA)) pJaina->SetVisibility(VISIBILITY_OFF); break; } @@ -1197,15 +1190,15 @@ enum bool GossipHello_npc_chromi_middle(Player* pPlayer, Creature* pCreature) { if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid()); //if (pPlayer->GetQuestStatus(QUEST_ROYAL_ESCORT) == QUEST_STATUS_INCOMPLETE) return true; - ScriptedInstance* pInstance = ((ScriptedInstance*)pCreature->GetInstanceData()); - if(pInstance && pInstance->GetData(TYPE_INTRO) == NOT_STARTED) + ScriptedInstance* pInstance = ((ScriptedInstance*)pCreature->GetInstanceData()); + if(pInstance && pInstance->GetData(TYPE_INTRO) == NOT_STARTED) pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHROMI1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI1, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI1, pCreature->GetObjectGuid()); return true; } @@ -1215,34 +1208,34 @@ bool GossipSelect_npc_chromi_middle(Player* pPlayer, Creature* pCreature, uint32 if(ScriptedInstance* m_pInstance = ((ScriptedInstance*)pCreature->GetInstanceData())) if(m_pInstance->GetData(TYPE_INTRO) != NOT_STARTED) return true; - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHROMI2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHROMI2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI2, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI2, pCreature->GetObjectGuid()); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHROMI3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHROMI3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI3, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI3, pCreature->GetObjectGuid()); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+3) + if (uiAction == GOSSIP_ACTION_INFO_DEF+3) { if(ScriptedInstance* m_pInstance = ((ScriptedInstance*)pCreature->GetInstanceData())) { m_pInstance->DoUpdateWorldState(WORLD_STATE_COS_CRATE_ON, 0); m_pInstance->SetData(TYPE_INTRO, IN_PROGRESS); - if (Creature *pUther = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_UTHER))) + if (Creature *pUther = m_pInstance->GetSingleCreatureFromStorage(NPC_UTHER)) ((npc_utherAI*)pUther->AI())->StartAI(); } - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI4, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI4, pCreature->GetObjectGuid()); } - return true; + return true; } struct MANGOS_DLL_DECL npc_chromi_middleAI : public ScriptedAI @@ -1270,7 +1263,7 @@ struct MANGOS_DLL_DECL npc_chromi_middleAI : public ScriptedAI { m_pInstance->DoUpdateWorldState(WORLD_STATE_COS_CRATE_ON, 0); m_pInstance->SetData(TYPE_INTRO, IN_PROGRESS); - if (Creature *pUther = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_UTHER))) + if (Creature *pUther = m_pInstance->GetSingleCreatureFromStorage(NPC_UTHER)) ((npc_utherAI*)pUther->AI())->StartAI(); m_bUtherHere = true; } @@ -1299,33 +1292,33 @@ enum bool GossipHello_npc_arthas(Player* pPlayer, Creature* pCreature) { - ScriptedInstance* pInstance = ((ScriptedInstance*)pCreature->GetInstanceData()); + ScriptedInstance* pInstance = ((ScriptedInstance*)pCreature->GetInstanceData()); - if(pInstance && pInstance->GetData(TYPE_PHASE) == 0) + if(pInstance && pInstance->GetData(TYPE_PHASE) == 0) { pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_1, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_1, pCreature->GetObjectGuid()); } if(pInstance && pInstance->GetData(TYPE_PHASE) == 5) { pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_2, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_2, pCreature->GetObjectGuid()); } if(pInstance && pInstance->GetData(TYPE_PHASE) == 8) { pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_3, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_3, pCreature->GetObjectGuid()); } if(pInstance && pInstance->GetData(TYPE_PHASE) == 9) { pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_4, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_4, pCreature->GetObjectGuid()); } - return true; + return true; } bool GossipSelect_npc_arthas(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) @@ -1358,12 +1351,12 @@ bool GossipSelect_npc_arthas(Player* pPlayer, Creature* pCreature, uint32 uiSend ((npc_arthasAI*)pCreature->AI())->RemoveGossip(); if(Creature* pMalganis = pCreature->SummonCreature(NPC_MALGANIS,2296.665f,1502.362f,128.362f,4.961f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000)) { - m_pInstance->SetData64(NPC_MALGANIS, pMalganis->GetGUID()); + m_pInstance->SetData64(NPC_MALGANIS, pMalganis->GetObjectGuid()); pMalganis->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } } - return true; + return true; } /*### @@ -1387,7 +1380,7 @@ struct MANGOS_DLL_DECL npc_arthas_priestAI : public ScriptedAI uint32 m_uiSmiteTimer; uint32 m_uiHealTimer; - void Reset() + void Reset() { m_uiSmiteTimer = 100; m_uiHealTimer = 1000; @@ -1490,10 +1483,10 @@ struct MANGOS_DLL_DECL npc_arthas_marineAI : public ScriptedAI float LastX; float LastY; float LastZ; - + uint32 m_uiHealTimer; - void Reset() + void Reset() { m_uiHealTimer = 3000; } @@ -1624,7 +1617,7 @@ bool Conversion; uint32 m_uiStep; uint32 m_uiStepTimer; - void Reset() + void Reset() { m_creature->setFaction(35); Conversion = false; @@ -1648,7 +1641,7 @@ uint32 m_uiStepTimer; float g = 19.23f;// seems that physic constant g(earth's gravity) in world of warcraft is about 2 times larger than real float dh = verticalSpeed*verticalSpeed / (2*g); // maximum parabola height float time = sqrtf(dh/(0.124976 * verticalSpeed)); //full move time in seconds // should be time = 2*Vert_speed/g, but.. - + float dis = time * horizontalSpeed; float fx = ox + dis * vcos; float fy = oy + dis * vsin; @@ -1656,17 +1649,16 @@ uint32 m_uiStepTimer; m_creature->UpdateGroundPositionZ(fx, fy, fz); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_creature->GetMotionMaster()->MovePoint(0, fx, fy, fz); } - + void DarkConversion(bool Move) { m_creature->UpdateEntry(NPC_ZOMBIE); if(Move == true) { - uint64 m_uiArthasGUID = m_pInstance->GetData64(NPC_ARTHAS); - if(Creature* pArthas = m_pInstance->instance->GetCreature(m_uiArthasGUID)) + if(Creature* pArthas = m_pInstance->GetSingleCreatureFromStorage(NPC_ARTHAS)) m_creature->GetMotionMaster()->MovePoint(0, pArthas->GetPositionX(), pArthas->GetPositionY(), pArthas->GetPositionZ()); } } diff --git a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholmeai.cpp b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholmeai.cpp index b354281..8f12452 100644 --- a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholmeai.cpp +++ b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholmeai.cpp @@ -46,13 +46,13 @@ enum bool GossipHello_npc_chromi_start(Player* pPlayer, Creature* pCreature) { if(pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid()); ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); if (pPlayer && pPlayer->GetQuestStatus(QUEST_DISPELLING_ILLUSIONS) == QUEST_STATUS_COMPLETE && pInstance && pInstance->GetData(TYPE_QUEST) == NOT_STARTED) pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHROMI1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI1, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI1, pCreature->GetObjectGuid()); return true; } @@ -63,14 +63,14 @@ bool GossipSelect_npc_chromi_start(Player* pPlayer, Creature* pCreature, uint32 { pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHROMI2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI2, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI2, pCreature->GetObjectGuid()); } if (uiAction == GOSSIP_ACTION_INFO_DEF+2) { pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHROMI3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI3, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI3, pCreature->GetObjectGuid()); } if (uiAction == GOSSIP_ACTION_INFO_DEF+3) @@ -86,7 +86,7 @@ bool GossipSelect_npc_chromi_start(Player* pPlayer, Creature* pCreature, uint32 if (Item* pItem = pPlayer->StoreNewItemInInventorySlot(ITEM_ARCANE_DISRUPTOR, 1)) pPlayer->SendNewItem(pItem, 1, true, false); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI4, pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_CHROMI4, pCreature->GetObjectGuid()); } return true; @@ -128,16 +128,16 @@ struct MANGOS_DLL_DECL npc_chromi_startAI : public ScriptedAI enum { - SAY_MIKE01 = -1557270, - SAY_FORRESTER02 = -1557271, - SAY_JAMES03 = -1557272, - SAY_SIABI04 = -1557273, - SAY_MIKE05 = -1557274, - SAY_CORICKS06 = -1557275, - SAY_GRIAN07 = -1557276, - SAY_CORICKS08 = -1557277, - SAY_JAMES09 = -1557278, - SAY_FORRESTER10 = -1557279, + SAY_MIKE01 = -1597270, + SAY_FORRESTER02 = -1597271, + SAY_JAMES03 = -1597272, + SAY_SIABI04 = -1597273, + SAY_MIKE05 = -1597274, + SAY_CORICKS06 = -1597275, + SAY_GRIAN07 = -1597276, + SAY_CORICKS08 = -1597277, + SAY_JAMES09 = -1597278, + SAY_FORRESTER10 = -1597279, EMOTE_SHOT = 5, EMOTE_TALK = 1, @@ -161,12 +161,6 @@ struct MANGOS_DLL_DECL npc_mikeAI : public ScriptedAI uint32 m_uiStepTimer; uint32 m_uiPhase; - uint64 m_uiForesterGUID; - uint64 m_uiJamesGUID; - uint64 m_uiSiabiGUID; - uint64 m_uiCorricksGUID; - uint64 m_uiGryanGUID; - void Reset() { if(m_uiPhase != 2) @@ -186,7 +180,7 @@ struct MANGOS_DLL_DECL npc_mikeAI : public ScriptedAI if (who->GetTypeId() == TYPEID_PLAYER && m_creature->GetDistance2d(who) <= 15 && who->GetPositionZ() > 99.50f && m_uiPhase == 0) { - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, who->GetGUID()); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, who->GetObjectGuid()); m_uiPhase = 1; } } @@ -200,29 +194,26 @@ struct MANGOS_DLL_DECL npc_mikeAI : public ScriptedAI m_uiStepTimer = 4000; break; case 1: - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); m_uiStepTimer = 5000; break; case 2: - m_uiForesterGUID = m_pInstance->GetData64(NPC_FORRESTER); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiForesterGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_FORRESTER)) DoScriptText(SAY_FORRESTER02, pTemp); m_uiStepTimer = 6000; break; case 3: - m_uiJamesGUID = m_pInstance->GetData64(NPC_JAMES); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiJamesGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_JAMES)) DoScriptText(SAY_JAMES03, pTemp); m_uiStepTimer = 5000; break; case 4: - m_uiSiabiGUID = m_pInstance->GetData64(NPC_FRAS_FRASIABI); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiSiabiGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_FRAS_FRASIABI)) DoScriptText(SAY_SIABI04, pTemp); m_uiStepTimer = 2000; break; case 5: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiSiabiGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_FRAS_FRASIABI)) pTemp->HandleEmoteCommand(EMOTE_SHOT); m_uiStepTimer = 5000; break; @@ -231,7 +222,7 @@ struct MANGOS_DLL_DECL npc_mikeAI : public ScriptedAI m_uiStepTimer = 3000; break; case 7: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiSiabiGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_FRAS_FRASIABI)) pTemp->HandleEmoteCommand(EMOTE_LAUGH); m_uiStepTimer = 3000; break; @@ -244,37 +235,35 @@ struct MANGOS_DLL_DECL npc_mikeAI : public ScriptedAI m_uiStepTimer = 1000; break; case 10: - m_uiCorricksGUID = m_pInstance->GetData64(NPC_MAL_CORICS); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiCorricksGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MAL_CORICS)) DoScriptText(SAY_CORICKS06, pTemp); m_uiStepTimer = 4000; break; case 11: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiCorricksGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MAL_CORICS)) pTemp->HandleEmoteCommand(EMOTE_TALK); - m_uiGryanGUID = m_pInstance->GetData64(NPC_GRIAN_STONE); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiGryanGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_GRIAN_STONE)) DoScriptText(SAY_GRIAN07, pTemp); m_uiStepTimer = 11000; break; case 12: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiCorricksGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MAL_CORICS)) DoScriptText(SAY_CORICKS08, pTemp); m_creature->GetMotionMaster()->MovePoint(0, 1549.609f, 575.544f, 100.052f); m_uiStepTimer = 2000; break; case 13: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiJamesGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_JAMES)) DoScriptText(SAY_JAMES09, pTemp); m_uiStepTimer = 2000; break; case 14: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiJamesGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_JAMES)) pTemp->HandleEmoteCommand(EMOTE_TALK); m_uiStepTimer = 5000; break; case 15: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiForesterGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_FORRESTER)) DoScriptText(SAY_FORRESTER10, pTemp); m_uiPhase = 2; break; @@ -303,10 +292,10 @@ struct MANGOS_DLL_DECL npc_mikeAI : public ScriptedAI enum { - SAY_ROGER01 = -1557280, - SAY_ROGER02 = -1557281, - SAY_ROGER03 = -1557282, - SAY_ROGER04 = -1557283, + SAY_ROGER01 = -1597280, + SAY_ROGER02 = -1597281, + SAY_ROGER03 = -1597282, + SAY_ROGER04 = -1597283, }; struct MANGOS_DLL_DECL npc_rogerAI : public ScriptedAI @@ -415,7 +404,7 @@ struct MANGOS_DLL_DECL npc_rogerAI : public ScriptedAI { unit->GetMotionMaster()->MovementExpired(false); unit->GetMap()->CreatureRelocation(unit, X, Y, Z, unit->GetOrientation()); - unit->SendMonsterMove(X, Y, Z, SPLINETYPE_NORMAL , unit->GetSplineFlags(), Timer); + unit->MonsterMoveWithSpeed(X, Y, Z, 26); } void UpdateAI(const uint32 uiDiff) @@ -440,13 +429,13 @@ struct MANGOS_DLL_DECL npc_rogerAI : public ScriptedAI enum { - SAY_MORIGAN01 = -1557284, - SAY_PERELLI02 = -1557285, - SAY_MORIGAN03 = -1557286, - SAY_PERELLI04 = -1557287, - SAY_MORIGAN05 = -1557288, - SAY_PERELLI06 = -1557289, - SAY_MORIGAN07 = -1557290, + SAY_MORIGAN01 = -1597284, + SAY_PERELLI02 = -1597285, + SAY_MORIGAN03 = -1597286, + SAY_PERELLI04 = -1597287, + SAY_MORIGAN05 = -1597288, + SAY_PERELLI06 = -1597289, + SAY_MORIGAN07 = -1597290, }; struct MANGOS_DLL_DECL npc_moriganAI : public ScriptedAI @@ -460,7 +449,6 @@ struct MANGOS_DLL_DECL npc_moriganAI : public ScriptedAI ScriptedInstance* m_pInstance; - uint64 m_uiPerelliGUID; uint32 m_uiStep; uint32 m_uiStepTimer; uint32 m_uiPhase; @@ -489,8 +477,7 @@ struct MANGOS_DLL_DECL npc_moriganAI : public ScriptedAI m_uiStepTimer = 6000; break; case 1: - m_uiPerelliGUID = m_pInstance->GetData64(NPC_PERELLI); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiPerelliGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_PERELLI)) DoScriptText(SAY_PERELLI02, pTemp); m_uiStepTimer = 2000; break; @@ -517,15 +504,15 @@ struct MANGOS_DLL_DECL npc_moriganAI : public ScriptedAI break; case 7: m_creature->SetStandState(UNIT_STAND_STATE_STAND); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiPerelliGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_PERELLI)) { - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pTemp->GetGUID()); - pTemp->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, pTemp->GetObjectGuid()); + pTemp->SetGuidValue(UNIT_FIELD_TARGET, m_creature->GetObjectGuid()); } m_uiStepTimer = 3000; break; case 8: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiPerelliGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_PERELLI)) DoScriptText(SAY_PERELLI04, pTemp); m_uiStepTimer = 3000; break; @@ -534,7 +521,7 @@ struct MANGOS_DLL_DECL npc_moriganAI : public ScriptedAI m_uiStepTimer = 9000; break; case 10: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiPerelliGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_PERELLI)) DoScriptText(SAY_PERELLI06, pTemp); m_uiStepTimer = 6000; break; @@ -543,9 +530,9 @@ struct MANGOS_DLL_DECL npc_moriganAI : public ScriptedAI m_uiStepTimer = 4000; break; case 12: - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiPerelliGUID)) - pTemp->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_PERELLI)) + pTemp->SetGuidValue(UNIT_FIELD_TARGET, 0); MoveToPoint(m_creature, 1576.119f, 657.675f, 102.09f, 5000); m_uiStepTimer = 4900; break; @@ -567,7 +554,7 @@ struct MANGOS_DLL_DECL npc_moriganAI : public ScriptedAI void MoveToPoint(Creature* unit, float X, float Y, float Z, uint32 Timer) { unit->GetMap()->CreatureRelocation(unit, X, Y, Z, unit->GetOrientation()); - unit->SendMonsterMove(X, Y, Z, SPLINETYPE_NORMAL , unit->GetSplineFlags(), Timer); + unit->MonsterMoveWithSpeed(X, Y, Z, 26); } void UpdateAI(const uint32 uiDiff) @@ -592,11 +579,11 @@ struct MANGOS_DLL_DECL npc_moriganAI : public ScriptedAI enum { - SAY_JENA01 = -1557291, - SAY_MARTHA02 = -1557292, - SAY_JENA03 = -1557293, - SAY_JENA04 = -1557294, - SAY_MARTHA05 = -1557295, + SAY_JENA01 = -1597291, + SAY_MARTHA02 = -1597292, + SAY_JENA03 = -1597293, + SAY_JENA04 = -1597294, + SAY_MARTHA05 = -1597295, }; @@ -611,7 +598,6 @@ struct MANGOS_DLL_DECL npc_jenaAI : public ScriptedAI ScriptedInstance* m_pInstance; - uint64 m_uiMarthaGUID; uint32 m_uiStep; uint32 m_uiStepTimer; uint32 m_uiPhase; @@ -656,14 +642,13 @@ struct MANGOS_DLL_DECL npc_jenaAI : public ScriptedAI m_uiStepTimer = 4000; break; case 4: - m_uiMarthaGUID = m_pInstance->GetData64(NPC_MARTHA); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiMarthaGUID)) - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pTemp->GetGUID()); + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MARTHA)) + m_creature->SetGuidValue(UNIT_FIELD_TARGET, pTemp->GetObjectGuid()); DoScriptText(SAY_JENA01, m_creature); m_uiStepTimer = 3000; break; case 5: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiMarthaGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MARTHA)) { pTemp->RemoveAurasDueToSpell(58925); pTemp->GetMotionMaster()->MovePoint(0, 1635.918f, 724.357f, 113.561f); @@ -671,16 +656,16 @@ struct MANGOS_DLL_DECL npc_jenaAI : public ScriptedAI m_uiStepTimer = 1000; break; case 6: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiMarthaGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MARTHA)) { pTemp->GetMotionMaster()->MovementExpired(false); pTemp->GetMotionMaster()->MovePoint(0, 1636.721f, 725.88f, 113.561f); - pTemp->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + pTemp->SetGuidValue(UNIT_FIELD_TARGET, m_creature->GetObjectGuid()); } m_uiStepTimer = 1000; break; case 7: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiMarthaGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MARTHA)) DoScriptText(SAY_MARTHA02, pTemp); m_uiStepTimer = 4000; break; @@ -689,28 +674,28 @@ struct MANGOS_DLL_DECL npc_jenaAI : public ScriptedAI m_uiStepTimer = 3000; break; case 9: - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); m_creature->GetMotionMaster()->MovePoint(0, 1629.278f, 727.894f, 112.636f); m_uiStepTimer = 1500; break; case 10: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiMarthaGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MARTHA)) { - pTemp->SetUInt64Value(UNIT_FIELD_TARGET, 0); + pTemp->SetGuidValue(UNIT_FIELD_TARGET, 0); pTemp->GetMap()->CreatureRelocation(pTemp, 1640.089f, 725.766f, 113.561f, 4.77f); - pTemp->SendMonsterMove(1640.089f, 725.766f, 113.561f, SPLINETYPE_NORMAL , pTemp->GetSplineFlags(), 1500); + pTemp->MonsterMoveWithSpeed(1640.089f, 725.766f, 113.561f, 26); } m_creature->GetMotionMaster()->MovementExpired(false); m_creature->GetMotionMaster()->MovePoint(0, 1629.452f, 729.416f, 112.712f); m_uiStepTimer = 1000; break; case 11: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiMarthaGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MARTHA)) pTemp->GetMotionMaster()->MovePoint(0, 1640.103f, 725.522f, 113.561f); m_uiStepTimer = 500; break; case 12: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiMarthaGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MARTHA)) pTemp->CastSpell(pTemp, 58925, false); m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); m_uiStepTimer = 1500; @@ -720,19 +705,19 @@ struct MANGOS_DLL_DECL npc_jenaAI : public ScriptedAI m_uiStepTimer = 1000; break; case 14: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiMarthaGUID)) - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pTemp->GetGUID()); + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MARTHA)) + m_creature->SetGuidValue(UNIT_FIELD_TARGET, pTemp->GetObjectGuid()); DoScriptText(SAY_JENA04, m_creature); m_uiStepTimer = 3000; break; case 15: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiMarthaGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_MARTHA)) { pTemp->RemoveAurasDueToSpell(58925); DoScriptText(SAY_MARTHA05, pTemp); MoveToPoint(pTemp, 1638.196f, 726.171f, 113.561f, 1000); } - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); MoveToPoint(m_creature, 1615.590f, 719.509f, 110.311f, 2000); m_uiStepTimer = 2000; break; @@ -754,7 +739,7 @@ struct MANGOS_DLL_DECL npc_jenaAI : public ScriptedAI void MoveToPoint(Creature* unit, float X, float Y, float Z, uint32 Timer) { unit->GetMap()->CreatureRelocation(unit, X, Y, Z, unit->GetOrientation()); - unit->SendMonsterMove(X, Y, Z, SPLINETYPE_NORMAL , unit->GetSplineFlags(), Timer); + unit->MonsterMoveWithSpeed(X, Y, Z, 26); } void UpdateAI(const uint32 uiDiff) @@ -783,10 +768,10 @@ enum SOUND_ID_DOG_HOWL = 1018, EMOTE_DOG_HOWL = 393, - SAY_MALCOLM01 = -1557296, - SAY_MALCOLM02 = -1557297, - SAY_MALCOLM03 = -1557298, - SAY_MALCOLM04 = -1557299, + SAY_MALCOLM01 = -1597296, + SAY_MALCOLM02 = -1597297, + SAY_MALCOLM03 = -1597298, + SAY_MALCOLM04 = -1597299, }; struct MANGOS_DLL_DECL npc_malcolmAI : public ScriptedAI @@ -800,7 +785,6 @@ struct MANGOS_DLL_DECL npc_malcolmAI : public ScriptedAI ScriptedInstance* m_pInstance; - uint64 m_uiDogGUID; uint32 m_uiStep; uint32 m_uiStepTimer; uint32 m_uiPhase; @@ -826,48 +810,47 @@ struct MANGOS_DLL_DECL npc_malcolmAI : public ScriptedAI { case 0: MoveToPoint(m_creature, 1614.066f, 796.722f, 121.739f, 5500); - m_uiDogGUID = m_pInstance->GetData64(NPC_DOG); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiDogGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_DOG)) MoveToPoint(pTemp, 1611.459f, 793.274f, 121.928f, 5500); m_uiStepTimer = 5400; break; case 1: DoScriptText(SAY_MALCOLM01, m_creature); MoveToPoint(m_creature, 1622.820f, 798.816f, 120.570f, 3500); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiDogGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_DOG)) MoveToPoint(pTemp, 1621.467f, 794.323f, 120.323f, 3500); m_uiStepTimer = 3400; break; case 2: MoveToPoint(m_creature, 1626.574f, 806.781f, 120.270f, 3500); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiDogGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_DOG)) MoveToPoint(pTemp, 1629.232f, 803.629f, 120.011f, 3500); m_uiStepTimer = 3400; break; case 3: MoveToPoint(m_creature, 1622.782f, 808.533f, 121.249f, 1500); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiDogGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_DOG)) MoveToPoint(pTemp, 1629.265f, 805.245f, 120.070f, 300); m_uiStepTimer = 300; break; case 4: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiDogGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_DOG)) pTemp->PlayDirectSound(SOUND_ID_DOG_GROWL); m_uiStepTimer = 500; break; case 5: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiDogGUID)) - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pTemp->GetGUID()); + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_DOG)) + m_creature->SetGuidValue(UNIT_FIELD_TARGET, pTemp->GetObjectGuid()); DoScriptText(SAY_MALCOLM02, m_creature); m_uiStepTimer = 2000; break; case 6: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiDogGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_DOG)) MoveToPoint(pTemp, 1629.163f, 809.738f, 120.369f, 1500); m_uiStepTimer = 2000; break; case 7: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiDogGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_DOG)) { pTemp->HandleEmoteCommand(EMOTE_DOG_HOWL); pTemp->PlayDirectSound(SOUND_ID_DOG_HOWL); @@ -875,7 +858,7 @@ struct MANGOS_DLL_DECL npc_malcolmAI : public ScriptedAI m_uiStepTimer = 4000; break; case 8: - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); MoveToPoint(m_creature, 1629.922f, 807.799f, 120.122f, 3000); m_uiStepTimer = 2900; break; @@ -894,20 +877,20 @@ struct MANGOS_DLL_DECL npc_malcolmAI : public ScriptedAI break; case 12: m_creature->SetStandState(UNIT_STAND_STATE_STAND); - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiDogGUID)) - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pTemp->GetGUID()); + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_DOG)) + m_creature->SetGuidValue(UNIT_FIELD_TARGET, pTemp->GetObjectGuid()); DoScriptText(SAY_MALCOLM04, m_creature); m_uiStepTimer = 7000; break; case 13: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiDogGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_DOG)) MoveToPoint(pTemp, 1630.692f, 808.011f, 120.083f, 400); m_uiStepTimer = 600; break; case 14: - if(Creature* pTemp = m_pInstance->instance->GetCreature(m_uiDogGUID)) + if(Creature* pTemp = m_pInstance->GetSingleCreatureFromStorage(NPC_DOG)) pTemp->SetStandState(UNIT_STAND_STATE_SIT); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetGuidValue(UNIT_FIELD_TARGET, 0); MoveToPoint(m_creature, 1641.452f, 812.600f, 119.948f, 4000); m_uiStepTimer = 3900; break; @@ -945,7 +928,7 @@ struct MANGOS_DLL_DECL npc_malcolmAI : public ScriptedAI void MoveToPoint(Creature* unit, float X, float Y, float Z, uint32 Timer) { unit->GetMap()->CreatureRelocation(unit, X, Y, Z, unit->GetOrientation()); - unit->SendMonsterMove(X, Y, Z, SPLINETYPE_NORMAL , unit->GetSplineFlags(), Timer); + unit->MonsterMoveWithSpeed(X, Y, Z, 26); } void UpdateAI(const uint32 uiDiff) @@ -970,11 +953,11 @@ struct MANGOS_DLL_DECL npc_malcolmAI : public ScriptedAI enum { - SAY_BARTLEBY01 = -1557300, - SAY_BARTLEBY02 = -1557301, - SAY_BARTLEBY03 = -1557302, - SAY_BARTLEBY04 = -1557303, - SAY_BARTLEBY05 = -1557304, + SAY_BARTLEBY01 = -1597300, + SAY_BARTLEBY02 = -1597301, + SAY_BARTLEBY03 = -1597302, + SAY_BARTLEBY04 = -1597303, + SAY_BARTLEBY05 = -1597304, }; struct MANGOS_DLL_DECL npc_bartleby_csAI : public ScriptedAI @@ -1092,7 +1075,7 @@ struct MANGOS_DLL_DECL npc_bartleby_csAI : public ScriptedAI void MoveToPoint(Creature* unit, float X, float Y, float Z, uint32 Timer) { unit->GetMap()->CreatureRelocation(unit, X, Y, Z, unit->GetOrientation()); - unit->SendMonsterMove(X, Y, Z, SPLINETYPE_NORMAL , unit->GetSplineFlags(), Timer); + unit->MonsterMoveWithSpeed(X, Y, Z, 26); } void UpdateAI(const uint32 uiDiff) @@ -1154,7 +1137,7 @@ struct MANGOS_DLL_DECL npc_stratholme_cratesAI : public ScriptedAI if(m_creature->HasAura(SPELL_LIGHT) && Active != true) { - if(Creature* pRoger = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_ROGER))) + if(Creature* pRoger = m_pInstance->GetSingleCreatureFromStorage(NPC_ROGER)) { if(m_creature->GetDistance2d(pRoger->GetPositionX(), pRoger->GetPositionY()) < 50.0f) { @@ -1170,7 +1153,7 @@ struct MANGOS_DLL_DECL npc_stratholme_cratesAI : public ScriptedAI } } - if(Creature* pJena = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_JENA))) + if(Creature* pJena = m_pInstance->GetSingleCreatureFromStorage(NPC_JENA)) { if(m_creature->GetDistance2d(pJena->GetPositionX(), pJena->GetPositionY()) < 50.0f) { @@ -1178,7 +1161,7 @@ struct MANGOS_DLL_DECL npc_stratholme_cratesAI : public ScriptedAI } } - if(Creature* pMalcolm = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_MALCOLM))) + if(Creature* pMalcolm = m_pInstance->GetSingleCreatureFromStorage(NPC_MALCOLM)) { if(m_creature->GetDistance2d(pMalcolm->GetPositionX(), pMalcolm->GetPositionY()) < 50.0f) { @@ -1186,7 +1169,7 @@ struct MANGOS_DLL_DECL npc_stratholme_cratesAI : public ScriptedAI } } - if(Creature* pBartleby = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_BARTLEBY))) + if(Creature* pBartleby = m_pInstance->GetSingleCreatureFromStorage(NPC_BARTLEBY)) { if(m_creature->GetDistance2d(pBartleby->GetPositionX(), pBartleby->GetPositionY()) < 50.0f) { diff --git a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/trash_culling_of_stratholme.cpp b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/trash_culling_of_stratholme.cpp index c1d144d..509b9c8 100644 --- a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/trash_culling_of_stratholme.cpp +++ b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/trash_culling_of_stratholme.cpp @@ -54,7 +54,7 @@ struct MANGOS_DLL_DECL npc_cs_gnoulAI : public ScriptedAI void Reset() { - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); MoveTimer = (urand(100, 5000)); m_uiFleshTimer = (urand(3000, 10000)); WaypointId = 1; @@ -235,7 +235,7 @@ struct MANGOS_DLL_DECL npc_cs_necromancerAI : public ScriptedAI void Reset() { - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); MoveTimer = (urand(100, 5000)); m_uiCourseTimer = (urand(7000, 17000)); m_uiShadowBoltTimer = (urand(3000, 10000)); @@ -429,7 +429,7 @@ struct MANGOS_DLL_DECL npc_cs_fieldAI : public ScriptedAI void Reset() { - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); MoveTimer = (urand(100, 5000)); m_uiBlowTimer = (urand(7000, 17000)); m_uiScarabTimer = (urand(3000, 10000)); @@ -625,7 +625,7 @@ struct MANGOS_DLL_DECL npc_cs_acolyteAI : public ScriptedAI void Reset() { - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); MoveTimer = (urand(100, 5000)); m_uiColdTimer = (urand(7000, 17000)); m_uiFireTimer = (urand(3000, 10000)); @@ -835,7 +835,7 @@ struct MANGOS_DLL_DECL npc_cs_butcherAI : public ScriptedAI void Reset() { DoCast(m_creature, SPELL_CLOUD); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); MoveTimer = (urand(100, 5000)); WaypointId = 1; } @@ -1007,7 +1007,7 @@ struct MANGOS_DLL_DECL npc_time_riftCSAI : public ScriptedAI switch(Step) { case 1: - if (Creature* pArthas = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_ARTHAS))) + if (Creature* pArthas = m_pInstance->GetSingleCreatureFromStorage(NPC_ARTHAS)) { Drakonian01 = m_creature->SummonCreature(NPC_INFINITE_ADVERSARY,(m_creature->GetPositionX()-2)+rand()%4, (m_creature->GetPositionY()-2)+rand()%4, m_creature->GetPositionZ(),3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000); Drakonian01->GetMotionMaster()->MovePoint(0, pArthas->GetPositionX(), pArthas->GetPositionY(), pArthas->GetPositionZ()); diff --git a/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp b/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp index 0455d1e..9eadf38 100644 --- a/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp +++ b/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp @@ -38,7 +38,7 @@ enum SPELL_TIME_STOP = 31422, SPELL_ENRAGE = 37605, SPELL_SAND_BREATH = 31473, - H_SPELL_SAND_BREATH = 39049 + SPELL_SAND_BREATH_H = 39049 }; struct MANGOS_DLL_DECL boss_aeonusAI : public ScriptedAI @@ -106,7 +106,7 @@ struct MANGOS_DLL_DECL boss_aeonusAI : public ScriptedAI //Sand Breath if (SandBreath_Timer < diff) { - DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SAND_BREATH : H_SPELL_SAND_BREATH); + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SAND_BREATH : SPELL_SAND_BREATH_H); SandBreath_Timer = urand(15000, 25000); }else SandBreath_Timer -= diff; diff --git a/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp index 03b31a8..ee4f3e5 100644 --- a/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp +++ b/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp @@ -32,9 +32,9 @@ EndScriptData */ #define SAY_DEATH -1269011 #define SPELL_ARCANE_BLAST 31457 -#define H_SPELL_ARCANE_BLAST 38538 +#define SPELL_ARCANE_BLAST_H 38538 #define SPELL_ARCANE_DISCHARGE 31472 -#define H_SPELL_ARCANE_DISCHARGE 38539 +#define SPELL_ARCANE_DISCHARGE_H 38539 #define SPELL_TIME_LAPSE 31467 #define SPELL_ATTRACTION 38540 //Not Implemented (Heroic mode) @@ -105,7 +105,7 @@ struct MANGOS_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI //Arcane Blast if (ArcaneBlast_Timer < diff) { - DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_ARCANE_BLAST : H_SPELL_ARCANE_BLAST); + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_ARCANE_BLAST : SPELL_ARCANE_BLAST_H); ArcaneBlast_Timer = urand(15000, 25000); }else ArcaneBlast_Timer -= diff; @@ -113,7 +113,7 @@ struct MANGOS_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI if (ArcaneDischarge_Timer < diff) { if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_ARCANE_DISCHARGE : H_SPELL_ARCANE_DISCHARGE); + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_ARCANE_DISCHARGE : SPELL_ARCANE_DISCHARGE_H); ArcaneDischarge_Timer = urand(20000, 30000); }else ArcaneDischarge_Timer -= diff; diff --git a/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp b/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp index 8af500f..467e677 100644 --- a/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp +++ b/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp @@ -34,7 +34,7 @@ EndScriptData */ #define SPELL_HASTE 31458 #define SPELL_MORTAL_WOUND 31464 #define SPELL_WING_BUFFET 31475 -#define H_SPELL_WING_BUFFET 38593 +#define SPELL_WING_BUFFET_H 38593 #define SPELL_REFLECT 38592 //Not Implemented (Heroic mod) struct MANGOS_DLL_DECL boss_temporusAI : public ScriptedAI @@ -118,7 +118,7 @@ struct MANGOS_DLL_DECL boss_temporusAI : public ScriptedAI //Wing ruffet if (WingBuffet_Timer < diff) { - DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_WING_BUFFET : H_SPELL_WING_BUFFET); + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_WING_BUFFET : SPELL_WING_BUFFET_H); WingBuffet_Timer = urand(20000, 30000); }else WingBuffet_Timer -= diff; diff --git a/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp b/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp index 191d4ef..d5bd17e 100644 --- a/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp +++ b/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp @@ -188,8 +188,7 @@ void hyjalAI::SpawnCreatureForWave(uint32 uiMobEntry) } if (pSpawn) - if (Creature* pTemp = m_creature->SummonCreature(uiMobEntry, pSpawn->m_fX, pSpawn->m_fY, pSpawn->m_fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) - pTemp->SetRespawnTime(360000); + m_creature->SummonCreature(uiMobEntry, pSpawn->m_fX, pSpawn->m_fY, pSpawn->m_fZ, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); } void hyjalAI::JustSummoned(Creature* pSummoned) @@ -219,7 +218,7 @@ void hyjalAI::JustSummoned(Creature* pSummoned) float fX, fY, fZ; pSummoned->GetRandomPoint(pMove->m_fX, pMove->m_fY, pMove->m_fZ, 10.0f, fX, fY, fZ); - pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSummoned->SetWalk(false); pSummoned->GetMotionMaster()->MovePoint(0, fX, fY, fZ); } @@ -403,7 +402,7 @@ void hyjalAI::UpdateAI(const uint32 uiDiff) if (!pTemp->isAlive() || pTemp->getVictim()) continue; - pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(false); pTemp->GetMotionMaster()->MovePoint(1, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); } } diff --git a/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp index 7f2dd69..ff0ebb7 100644 --- a/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp +++ b/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp @@ -431,11 +431,8 @@ struct MANGOS_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI // trigger taretha to run down outside if (Creature* pTaretha = m_pInstance->GetTaretha()) { - if (Player* pPlayer = GetPlayerForEscort()) - { - if (npc_tarethaAI* pTarethaAI = dynamic_cast(pTaretha->AI())) - pTarethaAI->Start(true, pPlayer); - } + if (npc_tarethaAI* pTarethaAI = dynamic_cast(pTaretha->AI())) + pTarethaAI->Start(true, GetPlayerForEscort()); } // kill credit creature for quest diff --git a/scripts/kalimdor/dustwallow_marsh.cpp b/scripts/kalimdor/dustwallow_marsh.cpp index 274c5eb..fc1ab2c 100644 --- a/scripts/kalimdor/dustwallow_marsh.cpp +++ b/scripts/kalimdor/dustwallow_marsh.cpp @@ -31,6 +31,7 @@ npc_nat_pagle npc_ogron npc_private_hendel npc_cassa_crimsonwing +Lady Jaina Proudmoore EndContentData */ #include "precompiled.h" @@ -218,41 +219,6 @@ bool GossipHello_npc_deserter_agitator(Player* pPlayer, Creature* pCreature) return true; } -/*###### -## npc_lady_jaina_proudmoore -######*/ - -enum -{ - QUEST_JAINAS_AUTOGRAPH = 558, - SPELL_JAINAS_AUTOGRAPH = 23122 -}; - -#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph." - -bool GossipHello_npc_lady_jaina_proudmoore(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid()); - - if (pPlayer->GetQuestStatus(QUEST_JAINAS_AUTOGRAPH) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetObjectGuid()); - - return true; -} - -bool GossipSelect_npc_lady_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_SENDER_INFO) - { - pPlayer->SEND_GOSSIP_MENU(7012, pCreature->GetObjectGuid()); - pPlayer->CastSpell(pPlayer, SPELL_JAINAS_AUTOGRAPH, false); - } - return true; -} - /*###### ## npc_morokk ######*/ @@ -833,6 +799,124 @@ bool AreaTrigger_at_nats_landing(Player* pPlayer, const AreaTriggerEntry* pAt) return true; } +/*###### +## Lady Jaina Proudmoore +######*/ + +enum +{ + SPELL_BLIZZARD = 20680, + SPELL_FIRE_BLAST = 20679, + SPELL_FIREBALL = 20692, + SPELL_SUMMON_WATER_ELEMENT = 20681, + SPELL_TELEPORT = 20682, + + QUEST_JAINAS_AUTOGRAPH = 558, + SPELL_JAINAS_AUTOGRAPH = 23122 +}; + +struct MANGOS_DLL_DECL boss_lady_jaina_proudmooreAI : public ScriptedAI +{ + boss_lady_jaina_proudmooreAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiBlizzardTimer; + uint32 m_uiFireBlastTimer; + uint32 m_uiFireballTimer; + uint32 m_uiTeleportTimer; + uint32 m_uiWaterElementTimer; + + void Reset() + { + m_uiBlizzardTimer = 15000; + m_uiFireBlastTimer = 5000; + m_uiFireballTimer = 7000; + m_uiTeleportTimer = 17000; + m_uiWaterElementTimer = 20000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiBlizzardTimer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_BLIZZARD); + m_uiBlizzardTimer = urand(15000, 18000); + } + else + m_uiBlizzardTimer -= uiDiff; + + if (m_uiFireBlastTimer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_FIRE_BLAST); + m_uiFireBlastTimer = urand(5000, 8000); + } + else + m_uiFireBlastTimer -= uiDiff; + + if (m_uiFireballTimer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_FIREBALL); + m_uiFireballTimer = urand(7000, 10000); + } + else + m_uiFireballTimer -= uiDiff; + + if (m_uiTeleportTimer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_TELEPORT); + m_uiTeleportTimer = urand(17000, 25000); + } + else + m_uiTeleportTimer -= uiDiff; + + if (m_uiWaterElementTimer < uiDiff) + { + DoCast(m_creature, SPELL_SUMMON_WATER_ELEMENT); + m_uiWaterElementTimer = urand(20000, 30000); + } + else + m_uiWaterElementTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph." + +bool GossipHello_boss_lady_jaina_proudmoore(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid()); + + if (pPlayer->GetQuestStatus(QUEST_JAINAS_AUTOGRAPH) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetObjectGuid()); + + return true; +} + +bool GossipSelect_boss_lady_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_SENDER_INFO) + { + pPlayer->SEND_GOSSIP_MENU(7012, pCreature->GetObjectGuid()); + pPlayer->CastSpell(pPlayer, SPELL_JAINAS_AUTOGRAPH, false); + } + return true; +} + +CreatureAI* GetAI_boss_lady_jaina_proudmoore(Creature* pCreature) +{ + return new boss_lady_jaina_proudmooreAI(pCreature); +} + void AddSC_dustwallow_marsh() { Script* pNewScript; @@ -853,12 +937,6 @@ void AddSC_dustwallow_marsh() pNewScript->pGossipHello = &GossipHello_npc_deserter_agitator; pNewScript->RegisterSelf(); - pNewScript = new Script; - pNewScript->Name = "npc_lady_jaina_proudmoore"; - pNewScript->pGossipHello = &GossipHello_npc_lady_jaina_proudmoore; - pNewScript->pGossipSelect = &GossipSelect_npc_lady_jaina_proudmoore; - pNewScript->RegisterSelf(); - pNewScript = new Script; pNewScript->Name = "npc_morokk"; pNewScript->GetAI = &GetAI_npc_morokk; @@ -893,4 +971,11 @@ void AddSC_dustwallow_marsh() pNewScript->Name = "at_nats_landing"; pNewScript->pAreaTrigger = &AreaTrigger_at_nats_landing; pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "boss_lady_jaina_proudmoore"; + pNewScript->GetAI = &GetAI_boss_lady_jaina_proudmoore; + pNewScript->pGossipHello = &GossipHello_boss_lady_jaina_proudmoore; + pNewScript->pGossipSelect = &GossipSelect_boss_lady_jaina_proudmoore; + pNewScript->RegisterSelf(); } diff --git a/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp b/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp index 07011a5..5f26edb 100644 --- a/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp +++ b/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp @@ -77,7 +77,7 @@ enum PHASE_BREATH_POST = 5 }; -struct sOnyxMove +struct OnyxiaMove { uint32 uiLocId; uint32 uiLocIdEnd; @@ -85,7 +85,7 @@ struct sOnyxMove float fX, fY, fZ; }; -static sOnyxMove aMoveData[]= +static OnyxiaMove aMoveData[]= { {0, 4, SPELL_BREATH_NORTH_TO_SOUTH, 22.8763f, -217.152f, -60.0548f}, //north {1, 5, SPELL_BREATH_NE_TO_SW, 10.2191f, -247.912f, -60.896f}, //north-east @@ -97,7 +97,7 @@ static sOnyxMove aMoveData[]= {7, 3, SPELL_BREATH_NW_TO_SE, 6.8951f, -180.246f, -60.896f}, //north-west }; -static float afSpawnLocations[4][3]= +static const float afSpawnLocations[3][3]= { {-30.127f, -254.463f, -89.440f}, // whelps {-30.817f, -177.106f, -89.258f}, // whelps @@ -110,7 +110,7 @@ struct MANGOS_DLL_DECL boss_onyxiaAI : public ScriptedAI { m_pInstance = (instance_onyxias_lair*)pCreature->GetInstanceData(); m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); - m_uiMaxBreathPositions = sizeof(aMoveData)/sizeof(sOnyxMove); + m_uiMaxBreathPositions = sizeof(aMoveData)/sizeof(OnyxiaMove); Reset(); } @@ -127,7 +127,7 @@ struct MANGOS_DLL_DECL boss_onyxiaAI : public ScriptedAI uint32 m_uiMovePoint; uint32 m_uiMovementTimer; - sOnyxMove* m_pPointData; + OnyxiaMove* m_pPointData; uint32 m_uiFireballTimer; uint32 m_uiSummonWhelpsTimer; @@ -177,7 +177,7 @@ struct MANGOS_DLL_DECL boss_onyxiaAI : public ScriptedAI void JustReachedHome() { // in case evade in phase 2, see comments for hack where phase 2 is set - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); m_creature->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0); if (m_pInstance) @@ -192,13 +192,31 @@ struct MANGOS_DLL_DECL boss_onyxiaAI : public ScriptedAI void JustSummoned(Creature* pSummoned) { - pSummoned->GetMotionMaster()->MovePoint(0, afSpawnLocations[3][0], afSpawnLocations[3][1], afSpawnLocations[3][2]); - pSummoned->SetInCombatWithZone(); + if (!m_pInstance) + return; + + if (Creature* pTrigger = m_pInstance->GetSingleCreatureFromStorage(NPC_ONYXIA_TRIGGER)) + { + // Get some random point near the center + float fX, fY, fZ; + pSummoned->GetRandomPoint(pTrigger->GetPositionX(), pTrigger->GetPositionY(), pTrigger->GetPositionZ(), 20.0f, fX, fY, fZ); + pSummoned->GetMotionMaster()->MovePoint(1, fX, fY, fZ); + } + else + pSummoned->SetInCombatWithZone(); if (pSummoned->GetEntry() == NPC_ONYXIA_WHELP) ++m_uiSummonCount; } + void SummonedMovementInform(Creature* pSummoned, uint32 uiMoveType, uint32 uiPointId) + { + if (uiMoveType != POINT_MOTION_TYPE || uiPointId != 1 || !m_creature->getVictim()) + return; + + pSummoned->SetInCombatWithZone(); + } + void KilledUnit(Unit* pVictim) { DoScriptText(SAY_KILL, m_creature); @@ -215,21 +233,13 @@ struct MANGOS_DLL_DECL boss_onyxiaAI : public ScriptedAI pSpell->Id == SPELL_BREATH_SOUTH_TO_NORTH || pSpell->Id == SPELL_BREATH_NORTH_TO_SOUTH) { + // This was sent with SendMonsterMove - which resulted in better speed than now if (m_pPointData = GetMoveData()) - { - if (!m_pInstance) - return; - - if (Creature* pTrigger = m_pInstance->GetSingleCreatureFromStorage(NPC_ONYXIA_TRIGGER)) - { - m_creature->GetMap()->CreatureRelocation(m_creature, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ, m_creature->GetAngle(pTrigger)); - m_creature->SendMonsterMove(m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ, SPLINETYPE_FACINGTARGET, m_creature->GetSplineFlags(), 1, NULL, pTrigger->GetObjectGuid().GetRawValue()); - } - } + m_creature->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ); } } - sOnyxMove* GetMoveData() + OnyxiaMove* GetMoveData() { for (uint32 i = 0; i < m_uiMaxBreathPositions; ++i) { @@ -313,7 +323,7 @@ struct MANGOS_DLL_DECL boss_onyxiaAI : public ScriptedAI // sort of a hack, it is unclear how this really work but the values appear to be valid m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); if (m_pPointData) m_creature->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ); @@ -336,7 +346,7 @@ struct MANGOS_DLL_DECL boss_onyxiaAI : public ScriptedAI // undo flying m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, 0); - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); SetCombatMovement(true); m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); @@ -393,8 +403,8 @@ struct MANGOS_DLL_DECL boss_onyxiaAI : public ScriptedAI { if (m_uiWhelpTimer < uiDiff) { - m_creature->SummonCreature(NPC_ONYXIA_WHELP, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - m_creature->SummonCreature(NPC_ONYXIA_WHELP, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + m_creature->SummonCreature(NPC_ONYXIA_WHELP, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, MINUTE*IN_MILLISECONDS); + m_creature->SummonCreature(NPC_ONYXIA_WHELP, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, MINUTE*IN_MILLISECONDS); m_uiWhelpTimer = 500; } else @@ -404,7 +414,7 @@ struct MANGOS_DLL_DECL boss_onyxiaAI : public ScriptedAI { m_bIsSummoningWhelps = false; m_uiSummonCount = 0; - m_uiSummonWhelpsTimer = 80000; // 90s -10s for summoning + m_uiSummonWhelpsTimer = 80000; // 90s - 10s for summoning } } else diff --git a/scripts/kalimdor/orgrimmar.cpp b/scripts/kalimdor/orgrimmar.cpp index 4e2fa27..245a553 100644 --- a/scripts/kalimdor/orgrimmar.cpp +++ b/scripts/kalimdor/orgrimmar.cpp @@ -25,6 +25,7 @@ EndScriptData */ npc_neeru_fireblade npc_text + gossip options text missing npc_shenthul npc_thrall_warchief +boss_voljin EndContentData */ #include "precompiled.h" @@ -249,6 +250,95 @@ bool GossipSelect_npc_thrall_warchief(Player* pPlayer, Creature* pCreature, uint return true; } +/*###### +## boss_voljin +######*/ + +enum +{ + SPELL_HEX = 16097, + SPELL_SHADOW_SHOCK = 17289, + SPELL_SHADOW_WORD_PAIN = 17146, + SPELL_SHOOT_VOLJIN = 20463, + SPELL_VEIL_OF_SHADOW = 17820, +}; + +struct MANGOS_DLL_DECL boss_voljinAI : public ScriptedAI +{ + boss_voljinAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiHexTimer; + uint32 m_uiShadowShockTimer; + uint32 m_uiShadowWordPainTimer; + uint32 m_uiShootTimer; + uint32 m_uiVeilOfShadowTimer; + + void Reset() + { + m_uiHexTimer = 20000; + m_uiShadowShockTimer = 12000; + m_uiShadowWordPainTimer = 8000; + m_uiShootTimer = 6000; + m_uiVeilOfShadowTimer = 15000; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiHexTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_HEX); + m_uiHexTimer = urand(15000, 20000); + } + else + m_uiHexTimer -= uiDiff; + + if (m_uiShadowShockTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_SHADOW_SHOCK); + m_uiShadowShockTimer = urand(11000, 14000); + } + else + m_uiShadowShockTimer -= uiDiff; + + if (m_uiShadowWordPainTimer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + DoCast(pTarget, SPELL_SHADOW_WORD_PAIN); + m_uiShadowWordPainTimer = 8000; + } + else + m_uiShadowWordPainTimer -= uiDiff; + + if (m_uiShootTimer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + DoCast(pTarget, SPELL_SHOOT_VOLJIN); + m_uiShootTimer = urand(6000, 9000); + } + else + m_uiShootTimer -= uiDiff; + + if (m_uiVeilOfShadowTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_VEIL_OF_SHADOW); + m_uiVeilOfShadowTimer = urand(15000, 17000); + } + else + m_uiVeilOfShadowTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_voljin(Creature* pCreature) +{ + return new boss_voljinAI(pCreature); +} + void AddSC_orgrimmar() { Script *newscript; @@ -271,4 +361,9 @@ void AddSC_orgrimmar() newscript->pGossipHello = &GossipHello_npc_thrall_warchief; newscript->pGossipSelect = &GossipSelect_npc_thrall_warchief; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_voljin"; + newscript->GetAI = &GetAI_boss_voljin; + newscript->RegisterSelf(); } diff --git a/scripts/kalimdor/teldrassil.cpp b/scripts/kalimdor/teldrassil.cpp index 11a57c5..6211030 100644 --- a/scripts/kalimdor/teldrassil.cpp +++ b/scripts/kalimdor/teldrassil.cpp @@ -23,6 +23,8 @@ EndScriptData */ /* ContentData npc_mist +Tyrande Whisperwind +Archdruid Fandral Staghelm EndContentData */ #include "precompiled.h" @@ -101,6 +103,154 @@ bool QuestAccept_npc_mist(Player* pPlayer, Creature* pCreature, const Quest* pQu return true; } +/*#### +# Tyrande Whisperwind +####*/ + +enum +{ + SPELL_CLEAVE_TYRANDE = 20691, + SPELL_MOONFIRE = 20690, + SPELL_SEARING_ARROW = 20688, + SPELL_STARFALL = 20687, +}; + +struct MANGOS_DLL_DECL boss_tyrande_whisperwindAI : public ScriptedAI +{ + boss_tyrande_whisperwindAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiCleaveTimer; + uint32 m_uiMoonfireTimer; + uint32 m_uiStarfallTimer; + uint32 m_uiSearingArrowTimer; + + void Reset() + { + m_uiCleaveTimer = 5000; + m_uiMoonfireTimer = 12000; + m_uiStarfallTimer = 15000; + m_uiSearingArrowTimer = 8000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiCleaveTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE_TYRANDE); + m_uiCleaveTimer = urand(5000, 8000); + } + else + m_uiCleaveTimer -= uiDiff; + + if (m_uiMoonfireTimer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + DoCast(pTarget, SPELL_MOONFIRE); + m_uiMoonfireTimer = urand(11000, 15000); + } + else + m_uiMoonfireTimer -= uiDiff; + + if (m_uiStarfallTimer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + DoCast(pTarget, SPELL_STARFALL); + m_uiStarfallTimer = urand(15000, 19000); + } + else + m_uiStarfallTimer -= uiDiff; + + if (m_uiSearingArrowTimer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + DoCast(pTarget, SPELL_SEARING_ARROW); + m_uiSearingArrowTimer = 8000; + } + else + m_uiSearingArrowTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_tyrande_whisperwind(Creature* pCreature) +{ + return new boss_tyrande_whisperwindAI(pCreature); +} + +/*#### +# Archdruid Fandral Staghelm +####*/ + +enum +{ + SPELL_ENTANGLING_ROOTS = 20699, + // SPELL_REJUVENATION = 20701, + SPELL_SUMMON_TREANTS = 20702, + SPELL_WRATH = 20698, + NPC_TREANT = 31802, +}; + +struct MANGOS_DLL_DECL boss_fandral_staghelmAI : public ScriptedAI +{ + boss_fandral_staghelmAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiEntanglingTimer; + uint32 m_uiWrathTimer; + uint32 m_uiSummonAlyTimer; + //uint32 m_uiRejuvinationTimer; + + void Reset() + { + m_uiEntanglingTimer = 7000; + m_uiWrathTimer = 5000; + m_uiSummonAlyTimer = 15000; + //m_uiRejuvinationTimer = 10000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiEntanglingTimer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + DoCast(pTarget, SPELL_ENTANGLING_ROOTS); + m_uiEntanglingTimer = urand(7000, 11000); + } + else + m_uiEntanglingTimer -= uiDiff; + + if (m_uiWrathTimer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + DoCast(m_creature, SPELL_WRATH); + m_uiWrathTimer = urand(5000, 8000); + } + else + m_uiWrathTimer -= uiDiff; + + if (m_uiSummonAlyTimer < uiDiff) + { + DoCast(m_creature, SPELL_SUMMON_TREANTS); + m_uiSummonAlyTimer = urand(25000, 30000); + } + else + m_uiSummonAlyTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_fandral_staghelm(Creature* pCreature) +{ + return new boss_fandral_staghelmAI(pCreature); +} + void AddSC_teldrassil() { Script *newscript; @@ -110,4 +260,14 @@ void AddSC_teldrassil() newscript->GetAI = &GetAI_npc_mist; newscript->pQuestAcceptNPC = &QuestAccept_npc_mist; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_tyrande_whisperwind"; + newscript->GetAI = &GetAI_boss_tyrande_whisperwind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_fandral_staghelm"; + newscript->GetAI = &GetAI_boss_fandral_staghelm; + newscript->RegisterSelf(); } diff --git a/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp b/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp index 23faaf4..ae2ebf0 100644 --- a/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp +++ b/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp @@ -137,8 +137,7 @@ struct MANGOS_DLL_DECL boss_ouroAI : public ScriptedAI { if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) { - m_creature->GetMap()->CreatureRelocation(m_creature, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f); - m_creature->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), SPLINETYPE_NORMAL, SPLINEFLAG_WALKMODE, 1); + m_creature->MonsterMoveWithSpeed(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 28.f); } m_uiChangeTargetTimer = urand(10000, 20000); diff --git a/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp b/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp index de5583c..67a2820 100644 --- a/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp +++ b/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp @@ -159,8 +159,8 @@ struct MANGOS_DLL_DECL boss_sarturaAI : public ScriptedAI // If she is 20% enrage if (!m_bIsEnraged && m_creature->GetHealthPercent() <= 20.0f) - { - if (DoCastSpellIfCan(m_creature, SPELL_ENRAGE, m_bIsWhirlWind ? CAST_TRIGGERED : 0) == CAST_OK) + { + if (DoCastSpellIfCan(m_creature, SPELL_ENRAGE, m_bIsWhirlWind ? CAST_TRIGGERED : 0) == CAST_OK) m_bIsEnraged = true; } diff --git a/scripts/kalimdor/the_barrens.cpp b/scripts/kalimdor/the_barrens.cpp index cdf7efa..0e0037c 100644 --- a/scripts/kalimdor/the_barrens.cpp +++ b/scripts/kalimdor/the_barrens.cpp @@ -467,13 +467,7 @@ CreatureAI* GetAI_npc_twiggy_flathead(Creature* pCreature) bool AreaTrigger_at_twiggy_flathead(Player* pPlayer, AreaTriggerEntry const* pAt) { - - if (pPlayer->GetQuestStatus(QUEST_AFFRAY) == QUEST_STATUS_FAILED) - { - //we don't want player to start event if failed already. - return true; - } - else if (!pPlayer->isDead() && pPlayer->GetQuestStatus(QUEST_AFFRAY) == QUEST_STATUS_INCOMPLETE) + if (!pPlayer->isDead() && pPlayer->GetQuestStatus(QUEST_AFFRAY) == QUEST_STATUS_INCOMPLETE) { Creature* pCreature = GetClosestCreatureWithEntry(pPlayer, NPC_TWIGGY, 30.0f); diff --git a/scripts/kalimdor/thunder_bluff.cpp b/scripts/kalimdor/thunder_bluff.cpp index d4938dc..1dbaf82 100644 --- a/scripts/kalimdor/thunder_bluff.cpp +++ b/scripts/kalimdor/thunder_bluff.cpp @@ -27,11 +27,15 @@ EndScriptData */ # npc_cairne_bloodhoof ######*/ -#define SPELL_BERSERKER_CHARGE 16636 -#define SPELL_CLEAVE 16044 -#define SPELL_MORTAL_STRIKE 16856 -#define SPELL_THUNDERCLAP 23931 -#define SPELL_UPPERCUT 22916 +enum +{ + SPELL_BERSERKER_CHARGE = 16636, + SPELL_CLEAVE = 16044, + SPELL_MORTAL_STRIKE = 16856, + SPELL_THUNDERCLAP = 23931, + SPELL_UPPERCUT = 22916, + SPELL_WAR_STOMP = 59705, +}; //TODO: verify abilities/timers struct MANGOS_DLL_DECL npc_cairne_bloodhoofAI : public ScriptedAI @@ -43,6 +47,7 @@ struct MANGOS_DLL_DECL npc_cairne_bloodhoofAI : public ScriptedAI uint32 MortalStrike_Timer; uint32 Thunderclap_Timer; uint32 Uppercut_Timer; + uint32 m_uiWarStompTimer; void Reset() { @@ -51,44 +56,56 @@ struct MANGOS_DLL_DECL npc_cairne_bloodhoofAI : public ScriptedAI MortalStrike_Timer = 10000; Thunderclap_Timer = 15000; Uppercut_Timer = 10000; + m_uiWarStompTimer = 25000; + } + + void Aggro(Unit* pWho) + { + m_creature->CallForHelp(100); } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; - if (BerserkerCharge_Timer < diff) + if (BerserkerCharge_Timer < uiDiff) { Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); if (target) DoCastSpellIfCan(target,SPELL_BERSERKER_CHARGE); BerserkerCharge_Timer = 25000; - }else BerserkerCharge_Timer -= diff; + }else BerserkerCharge_Timer -= uiDiff; - if (Uppercut_Timer < diff) + if (Uppercut_Timer < uiDiff) { DoCastSpellIfCan(m_creature->getVictim(),SPELL_UPPERCUT); Uppercut_Timer = 20000; - }else Uppercut_Timer -= diff; + }else Uppercut_Timer -= uiDiff; - if (Thunderclap_Timer < diff) + if (Thunderclap_Timer < uiDiff) { DoCastSpellIfCan(m_creature->getVictim(),SPELL_THUNDERCLAP); Thunderclap_Timer = 15000; - }else Thunderclap_Timer -= diff; + }else Thunderclap_Timer -= uiDiff; - if (MortalStrike_Timer < diff) + if (MortalStrike_Timer < uiDiff) { DoCastSpellIfCan(m_creature->getVictim(),SPELL_MORTAL_STRIKE); MortalStrike_Timer = 15000; - }else MortalStrike_Timer -= diff; + }else MortalStrike_Timer -= uiDiff; - if (Cleave_Timer < diff) + if (Cleave_Timer < uiDiff) { DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); Cleave_Timer = 7000; - }else Cleave_Timer -= diff; + }else Cleave_Timer -= uiDiff; + + if (m_uiWarStompTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_WAR_STOMP); + m_uiWarStompTimer = urand(20000, 25000); + }else m_uiWarStompTimer -= uiDiff; DoMeleeAttackIfReady(); } @@ -131,4 +148,4 @@ void AddSC_thunder_bluff() newscript->pGossipHello = &GossipHello_npc_cairne_bloodhoof; newscript->pGossipSelect = &GossipSelect_npc_cairne_bloodhoof; newscript->RegisterSelf(); -} +} \ No newline at end of file diff --git a/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp b/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp index 9fa7cc4..f4b1002 100644 --- a/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp +++ b/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp @@ -152,7 +152,7 @@ struct MANGOS_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI Reset(); // Remove running - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); } else npc_escortAI::EnterEvadeMode(); @@ -380,7 +380,7 @@ struct MANGOS_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI break; case 11: SetEscortPaused(false); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); SetRun(); // Send them flying somewhere outside of the room if (Creature* pNaralex = m_pInstance->GetSingleCreatureFromStorage(NPC_NARALEX)) @@ -390,8 +390,8 @@ struct MANGOS_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI pNaralex->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); // Set to flying - pNaralex->AddSplineFlag(SPLINEFLAG_FLYING); - pNaralex->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pNaralex->SetLevitate(true); + pNaralex->SetWalk(false); // Set following pNaralex->GetMotionMaster()->MoveFollow(m_creature, 5.0f, 0); diff --git a/scripts/northrend/azjol-nerub/ahnkahet/boss_taldaram.cpp b/scripts/northrend/azjol-nerub/ahnkahet/boss_taldaram.cpp index 3f13b98..c0c3232 100644 --- a/scripts/northrend/azjol-nerub/ahnkahet/boss_taldaram.cpp +++ b/scripts/northrend/azjol-nerub/ahnkahet/boss_taldaram.cpp @@ -286,7 +286,7 @@ struct MANGOS_DLL_DECL mob_taldaram_flame_orbAI : public ScriptedAI m_bIsFlying = false; //hack to set model invisible m_creature->SetDisplayId(10045); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); DoCast(m_creature, SPELL_FLAME_ORB_VISUAL); DoCast(m_creature, SPELL_FLAME_ORB_SPAWN_EFFECT); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); diff --git a/scripts/northrend/borean_tundra.cpp b/scripts/northrend/borean_tundra.cpp index 8312b85..4e52c1c 100644 --- a/scripts/northrend/borean_tundra.cpp +++ b/scripts/northrend/borean_tundra.cpp @@ -17,7 +17,7 @@ /* ScriptData SDName: Borean_Tundra SD%Complete: 100 -SDComment: Quest support: 11570, 11590, 11692, 11676, 11708, 11919, 11940, 11961. Taxi vendors. +SDComment: Quest support: 11570, 11590, 11608, 11676, 11692, 11708, 11919, 11940, 11961. Taxi vendors. SDCategory: Borean Tundra EndScriptData */ @@ -34,6 +34,7 @@ npc_lurgglbr npc_nexus_drake go_scourge_cage npc_beryl_sorcerer +npc_seaforium_depth_charge EndContentData */ #include "precompiled.h" @@ -377,7 +378,7 @@ bool EffectDummyCreature_npc_oil_stained_wolf(Unit* pCaster, uint32 uiSpellId, S if (uiEffIndex == EFFECT_INDEX_0 && pCreatureTarget->getFaction() != FACTION_MONSTER && !pCreatureTarget->HasAura(SPELL_HAS_EATEN)) { pCreatureTarget->SetFactionTemporary(FACTION_MONSTER); - pCreatureTarget->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pCreatureTarget->SetWalk(false); pCreatureTarget->GetMotionMaster()->MoveIdle(); @@ -763,6 +764,9 @@ enum NPC_RAELORASZ = 26117, DRAKE_HUNT_KILL_CREDIT = 26175, + SPELL_INTANGIBLE_PRESENCE = 36513, + SPELL_NETHERBREATH = 36631, + QUEST_DRAKE_HUNT = 11919, QUEST_DRAKE_HUNT_D = 11940 @@ -771,22 +775,26 @@ enum struct MANGOS_DLL_DECL npc_nexus_drakeAI : public FollowerAI { npc_nexus_drakeAI(Creature* pCreature) : FollowerAI(pCreature) { Reset(); } - + uint64 uiHarpoonerGUID; bool bWithRedDragonBlood; bool bIsFollowing; + uint32 SPELL_INTANGIBLE_PRESENCE_Timer; + uint32 SPELL_NETHERBREATH_Timer; void Reset() { bWithRedDragonBlood = false; bIsFollowing = false; + SPELL_INTANGIBLE_PRESENCE_Timer = 16600; + SPELL_NETHERBREATH_Timer = 4600; } void EnterCombat(Unit* pWho) { AttackStart(pWho); } - + void SpellHit(Unit* pCaster, SpellEntry const* pSpell) { if (pSpell->Id == SPELL_DRAKE_HARPOON && pCaster->GetTypeId() == TYPEID_PLAYER) @@ -807,17 +815,17 @@ struct MANGOS_DLL_DECL npc_nexus_drakeAI : public FollowerAI { if (Player *pHarpooner = m_creature->GetMap()->GetPlayer(uiHarpoonerGUID)) { - + pHarpooner->KilledMonsterCredit(DRAKE_HUNT_KILL_CREDIT,m_creature->GetGUID()); pHarpooner->RemoveAurasByCasterSpell(SPELL_DRAKE_HATCHLING_SUBDUED,uiHarpoonerGUID); SetFollowComplete(); uiHarpoonerGUID = 0; m_creature->ForcedDespawn(1000); } - + } } - + void UpdateAI(const uint32 uidiff) { if (bWithRedDragonBlood && uiHarpoonerGUID && !m_creature->HasAura(SPELL_RED_DRAGONBLOOD)) @@ -840,9 +848,25 @@ struct MANGOS_DLL_DECL npc_nexus_drakeAI : public FollowerAI m_creature->ForcedDespawn(1000); } - if (!m_creature->getVictim()) + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; + if (SPELL_NETHERBREATH_Timer < uidiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_NETHERBREATH); + SPELL_NETHERBREATH_Timer = 4600; + } + else + SPELL_NETHERBREATH_Timer -= uidiff; + + if (SPELL_INTANGIBLE_PRESENCE_Timer < uidiff) + { + DoCastSpellIfCan(m_creature,SPELL_INTANGIBLE_PRESENCE); + SPELL_INTANGIBLE_PRESENCE_Timer = 16600; + } + else + SPELL_INTANGIBLE_PRESENCE_Timer -= uidiff; + DoMeleeAttackIfReady(); } }; @@ -885,6 +909,9 @@ enum eBerylSorcerer NPC_CAPTURED_BERLY_SORCERER = 25474, NPC_LIBRARIAN_DONATHAN = 25262, + SPELL_FROST_BOLT = 9672, + SPELL_BLINK = 50648, + SPELL_ARCANE_CHAINS = 45611, SPELL_COSMETIC_CHAINS = 54324, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF = 45631 @@ -892,19 +919,24 @@ enum eBerylSorcerer struct MANGOS_DLL_DECL npc_beryl_sorcererAI : public FollowerAI { - npc_beryl_sorcererAI(Creature* pCreature) : FollowerAI(pCreature) { + npc_beryl_sorcererAI(Creature* pCreature) : FollowerAI(pCreature) { m_uiNormalFaction = pCreature->getFaction(); - Reset(); + Reset(); } bool bEnslaved; uint64 uiChainerGUID; uint32 m_uiNormalFaction; + uint32 SPELL_FROST_BOLT_Timer; + uint32 SPELL_BLINK_Timer; + void Reset() { m_creature->setFaction(m_uiNormalFaction); bEnslaved = false; + SPELL_FROST_BOLT_Timer = 5400; + SPELL_BLINK_Timer = 15000; } void EnterCombat(Unit* pWho) { @@ -923,7 +955,6 @@ struct MANGOS_DLL_DECL npc_beryl_sorcererAI : public FollowerAI StartFollow(pChainer, 35, NULL); m_creature->UpdateEntry(NPC_CAPTURED_BERLY_SORCERER); DoCast(m_creature, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF, true); - bEnslaved = true; } } @@ -945,8 +976,21 @@ struct MANGOS_DLL_DECL npc_beryl_sorcererAI : public FollowerAI } void UpdateAI(const uint32 uiDiff) { - if (!m_creature->getVictim()) - return; + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + /// Frost_bolt needs to be casted more after blink + if (SPELL_FROST_BOLT_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROST_BOLT); + SPELL_FROST_BOLT_Timer = 5400 + rand()%1400; + }else SPELL_FROST_BOLT_Timer -= uiDiff; + + if (SPELL_BLINK_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_BLINK); + SPELL_BLINK_Timer = 15000 + rand()%3000; + }else SPELL_BLINK_Timer -= uiDiff; DoMeleeAttackIfReady(); } @@ -958,6 +1002,51 @@ CreatureAI* GetAI_npc_beryl_sorcerer(Creature* pCreature) return new npc_beryl_sorcererAI(pCreature); } +/*###### +##Bury Those Cockroaches! +######*/ +enum +{ + QUEST_BURY_THOSE_COCKROACHES = 11608, + SPELL_SEAFORIUM_DEPTH_CHARGE_EXPLOSION = 45502 + + +}; +struct npc_seaforium_depth_chargeAI : public ScriptedAI +{ + npc_seaforium_depth_chargeAI(Creature *pCreature) : ScriptedAI(pCreature) {} + + uint32 uiExplosionTimer; + void Reset() + { + uiExplosionTimer = urand(5000,10000); + } + void UpdateAI(const uint32 uiDiff) + { + if (uiExplosionTimer < uiDiff) + { + DoCast(m_creature, SPELL_SEAFORIUM_DEPTH_CHARGE_EXPLOSION); + for(uint8 i = 0; i < 4; ++i) + { + if(Creature* cCredit = GetClosestCreatureWithEntry(m_creature, 25402 + i, 10.0f))//25402-25405 credit markers + { + if(Player *pPlayer = m_creature->GetMap()->GetPlayer(m_creature->GetCreatorGuid())) + { + if(pPlayer->GetQuestStatus(QUEST_BURY_THOSE_COCKROACHES) == QUEST_STATUS_INCOMPLETE) + pPlayer->KilledMonsterCredit(cCredit->GetEntry(),cCredit->GetObjectGuid()); + } + } + } + m_creature->ForcedDespawn(1000); + } else uiExplosionTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_npc_seaforium_depth_charge(Creature* pCreature) +{ + return new npc_seaforium_depth_chargeAI(pCreature); +} + void AddSC_borean_tundra() { Script* pNewScript; @@ -1034,4 +1123,9 @@ void AddSC_borean_tundra() pNewScript->Name = "npc_beryl_sorcerer"; pNewScript->GetAI = &GetAI_npc_beryl_sorcerer; pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_seaforium_depth_charge"; + pNewScript->GetAI = &GetAI_npc_seaforium_depth_charge; + pNewScript->RegisterSelf(); } diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp index bdacd79..a85d71d 100644 --- a/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp @@ -84,7 +84,7 @@ struct MANGOS_DLL_DECL boss_eadricAI : public ScriptedAI m_uiBerserk_Timer = m_bIsRegularMode ? 300000 : 180000; HammerTarget = 0; m_creature->GetMotionMaster()->MovePoint(0, 746, 614, m_creature->GetPositionZ()); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); } void Aggro(Unit* pWho) @@ -188,7 +188,7 @@ struct MANGOS_DLL_DECL boss_paletressAI : public ScriptedAI summoned = false; shielded = false; m_creature->GetMotionMaster()->MovePoint(0, 746, 614, m_creature->GetPositionZ()); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); } void JustSummoned(Creature* _summoned) diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp index ee36cf5..611b406 100644 --- a/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp @@ -155,7 +155,7 @@ struct MANGOS_DLL_DECL boss_black_knightAI : public ScriptedAI phase3 = false; ghoul = false; m_creature->GetMotionMaster()->MovePoint(0, 746, 614, m_creature->GetPositionZ()); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); } diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp index 726d842..00260fd 100644 --- a/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp @@ -92,7 +92,7 @@ struct MANGOS_DLL_DECL mob_toc5_warriorAI : public ScriptedAI Intercept_Cooldown = 0; intercept_check = 1000; m_creature->GetMotionMaster()->MovePoint(0, 746, 614, m_creature->GetPositionZ()); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); } @@ -216,7 +216,7 @@ struct MANGOS_DLL_DECL mob_toc5_mageAI : public ScriptedAI m_uiBerserk_Timer = m_bIsRegularMode ? 300000 : 180000; Polymorph_Timer = m_bIsRegularMode ? 12000 : 10000; m_creature->GetMotionMaster()->MovePoint(0, 746, 614, m_creature->GetPositionZ()); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); } void Aggro(Unit* pWho) @@ -335,7 +335,7 @@ struct MANGOS_DLL_DECL mob_toc5_shamanAI : public ScriptedAI m_uiBerserk_Timer = m_bIsRegularMode ? 300000 : 180000; Hex_Timer = m_bIsRegularMode ? 15000 : 10000; m_creature->GetMotionMaster()->MovePoint(0, 746, 614, m_creature->GetPositionZ()); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); } @@ -500,7 +500,7 @@ struct MANGOS_DLL_DECL mob_toc5_hunterAI : public ScriptedAI enemy_check = 1000; disengage_check; m_creature->GetMotionMaster()->MovePoint(0, 746, 614, m_creature->GetPositionZ()); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); } @@ -636,7 +636,7 @@ struct MANGOS_DLL_DECL mob_toc5_rogueAI : public ScriptedAI m_uiBerserk_Timer = m_bIsRegularMode ? 300000 : 180000; Poison_Timer = m_bIsRegularMode ? 12000 : 5000; m_creature->GetMotionMaster()->MovePoint(0, 746, 614, m_creature->GetPositionZ()); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); } void Aggro(Unit* pWho) diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_anubarak_trial.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_anubarak_trial.cpp index 5560089..b638b76 100644 --- a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_anubarak_trial.cpp +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_anubarak_trial.cpp @@ -335,7 +335,7 @@ struct MANGOS_DLL_DECL mob_frost_sphereAI : public BSWScriptedAI { m_creature->SetRespawnDelay(DAY); m_creature->SetSpeedRate(MOVE_RUN, 0.1f); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->GetMotionMaster()->MoveRandom(); } diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_twin_valkyr.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_twin_valkyr.cpp index 2715913..5bd8504 100644 --- a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_twin_valkyr.cpp +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_twin_valkyr.cpp @@ -399,7 +399,7 @@ struct MANGOS_DLL_DECL mob_light_essenceAI : public ScriptedAI void Reset() { m_creature->SetRespawnDelay(DAY); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->GetMotionMaster()->MoveRandom(); } @@ -452,7 +452,7 @@ struct MANGOS_DLL_DECL mob_dark_essenceAI : public ScriptedAI void Reset() { m_creature->SetRespawnDelay(DAY); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->GetMotionMaster()->MoveRandom(); } diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.cpp index 82231d6..a2fa5ed 100644 --- a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.cpp +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.cpp @@ -294,7 +294,7 @@ switch(uiAction) { pCreature->SummonCreature(NPC_ANUBARAK, SpawnLoc[19].x, SpawnLoc[19].y, SpawnLoc[19].z, 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); if (pTemp) { pTemp->GetMotionMaster()->MovePoint(0, SpawnLoc[20].x, SpawnLoc[20].y, SpawnLoc[20].z); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->SetInCombatWithZone(); } pInstance->SetData(TYPE_STAGE,9); @@ -371,7 +371,7 @@ struct MANGOS_DLL_DECL boss_lich_king_tocAI : public ScriptedAI AddWaypoint(0, SpawnLoc[2].x, SpawnLoc[2].y, SpawnLoc[2].z); AddWaypoint(1, SpawnLoc[17].x, SpawnLoc[17].y, SpawnLoc[17].z); AddWaypoint(2, SpawnLoc[18].x, SpawnLoc[18].y, SpawnLoc[18].z); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); WayPoint = WayPointList.begin(); MovementStarted = true; IsWalking = true; @@ -458,7 +458,7 @@ struct MANGOS_DLL_DECL boss_lich_king_tocAI : public ScriptedAI m_creature->SummonCreature(NPC_ANUBARAK, SpawnLoc[19].x, SpawnLoc[19].y, SpawnLoc[19].z, 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); if (Creature* pTemp = pInstance->GetSingleCreatureFromStorage(NPC_ANUBARAK)) { pTemp->GetMotionMaster()->MovePoint(0, SpawnLoc[20].x, SpawnLoc[20].y, SpawnLoc[20].z); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->SetInCombatWithZone(); } pInstance->SetData(TYPE_STAGE,9); @@ -684,7 +684,7 @@ struct MANGOS_DLL_DECL npc_tirion_tocAI : public ScriptedAI m_creature->SummonCreature(NPC_GORMOK, SpawnLoc[26].x, SpawnLoc[26].y, SpawnLoc[26].z, 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); if (Creature* pTemp = pInstance->GetSingleCreatureFromStorage(NPC_GORMOK)) { pTemp->GetMotionMaster()->MovePoint(0, SpawnLoc[1].x, SpawnLoc[1].y, SpawnLoc[1].z); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->SetInCombatWithZone(); } } @@ -713,12 +713,12 @@ struct MANGOS_DLL_DECL npc_tirion_tocAI : public ScriptedAI m_creature->SummonCreature(NPC_ACIDMAW, SpawnLoc[4].x, SpawnLoc[4].y, SpawnLoc[4].z, 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); if (Creature* pTemp = pInstance->GetSingleCreatureFromStorage(NPC_DREADSCALE)) { pTemp->GetMotionMaster()->MovePoint(0, SpawnLoc[1].x, SpawnLoc[1].y, SpawnLoc[1].z); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->SetInCombatWithZone(); } if (Creature* pTemp = pInstance->GetSingleCreatureFromStorage(NPC_ACIDMAW)) { pTemp->GetMotionMaster()->MovePoint(0, SpawnLoc[1].x, SpawnLoc[1].y, SpawnLoc[1].z); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->SetInCombatWithZone(); } } @@ -741,7 +741,7 @@ struct MANGOS_DLL_DECL npc_tirion_tocAI : public ScriptedAI m_creature->SummonCreature(NPC_ICEHOWL, SpawnLoc[26].x, SpawnLoc[26].y, SpawnLoc[26].z, 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); if (Creature* pTemp = pInstance->GetSingleCreatureFromStorage(NPC_ICEHOWL)) { pTemp->GetMotionMaster()->MovePoint(0, SpawnLoc[1].x, SpawnLoc[1].y, SpawnLoc[1].z); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->SetInCombatWithZone(); } } @@ -946,7 +946,7 @@ struct MANGOS_DLL_DECL npc_tirion_tocAI : public ScriptedAI m_creature->SummonCreature(crusader[i], SpawnLoc[i+2].x, SpawnLoc[i+2].y, SpawnLoc[i+2].z, 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); if (Creature* pTemp = pInstance->GetSingleCreatureFromStorage(crusader[i])) { pTemp->GetMotionMaster()->MovePoint(0, SpawnLoc[1].x, SpawnLoc[1].y, SpawnLoc[1].z); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); } } pInstance->SetData(TYPE_CRUSADERS_COUNT,crusaderscount); @@ -1095,7 +1095,7 @@ struct MANGOS_DLL_DECL npc_tirion_tocAI : public ScriptedAI m_creature->SummonCreature(crusader[i], SpawnLoc[i+2].x, SpawnLoc[i+2].y, SpawnLoc[i+2].z, 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); if (Creature* pTemp = pInstance->GetSingleCreatureFromStorage(crusader[i])) { pTemp->GetMotionMaster()->MovePoint(0, SpawnLoc[1].x, SpawnLoc[1].y, SpawnLoc[1].z); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); } } pInstance->SetData(TYPE_CRUSADERS_COUNT,crusaderscount); @@ -1130,13 +1130,13 @@ struct MANGOS_DLL_DECL npc_tirion_tocAI : public ScriptedAI m_creature->SummonCreature(NPC_LIGHTBANE, SpawnLoc[3].x, SpawnLoc[3].y, SpawnLoc[3].z, 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); if (Creature* pTemp = pInstance->GetSingleCreatureFromStorage(NPC_LIGHTBANE)) { pTemp->GetMotionMaster()->MovePoint(0, SpawnLoc[1].x, SpawnLoc[1].y, SpawnLoc[1].z); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->SetInCombatWithZone(); } m_creature->SummonCreature(NPC_DARKBANE, SpawnLoc[4].x, SpawnLoc[4].y, SpawnLoc[4].z, 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); if (Creature* pTemp = pInstance->GetSingleCreatureFromStorage(NPC_DARKBANE)) { pTemp->GetMotionMaster()->MovePoint(0, SpawnLoc[1].x, SpawnLoc[1].y, SpawnLoc[1].z); - pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetWalk(true); pTemp->SetInCombatWithZone(); } UpdateTimer = 10000; diff --git a/scripts/northrend/dragonblight.cpp b/scripts/northrend/dragonblight.cpp index 58b2314..65d424d 100644 --- a/scripts/northrend/dragonblight.cpp +++ b/scripts/northrend/dragonblight.cpp @@ -17,7 +17,7 @@ /* ScriptData SDName: Dragonblight SD%Complete: 100 -SDComment: Quest support: 12166, 12261, 12499/12500(end sequenze). Taxi paths Wyrmrest temple. +SDComment: Quest support: 12499/12500(end sequenze) 12161, 12266, 12470 . Taxi paths Wyrmrest temple. SDCategory: Dragonblight EndScriptData */ @@ -27,6 +27,7 @@ npc_alexstrasza_wr_gate npc_destructive_ward npc_tariolstrasz npc_torastrasza +npc_hourglass_of_eternity EndContentData */ #include "precompiled.h" @@ -326,6 +327,89 @@ bool GossipSelect_npc_torastrasza(Player* pPlayer, Creature* pCreature, uint32 u return true; } + +/*###### +## npc_hourglass_of_eternity +######*/ +/*Support for 'Future you' is currently missing*/ +enum +{ + + NPC_INFINITE_CHRONO_MAGUS = 27898, + NPC_INFINITE_ASSAILANT = 27896, + NPC_INFINITE_DESTROYER = 27897, + NPC_INFINITE_TIMERENDER = 27900, + QUEST_MYSTERY_OF_INFINITE = 12470 +}; + +struct MANGOS_DLL_DECL npc_hourglassAI : public ScriptedAI +{ + npc_hourglassAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); SetCombatMovement(false); } + + uint32 uiWaveTimer; + uint32 uiWaveCounter; + + void Reset() + { + uiWaveTimer = 5000; + uiWaveCounter = 0; + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* pKiller) + { + if(Player *pPlayer = m_creature->GetMap()->GetPlayer(m_creature->GetOwnerGuid())) + { + pPlayer->FailQuest(QUEST_MYSTERY_OF_INFINITE); + } + } + + void SummonWave() + { + switch(uiWaveCounter) + { + case 0: m_creature->SummonCreature(NPC_INFINITE_CHRONO_MAGUS, m_creature->GetPositionX()+5,m_creature->GetPositionY(),m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_creature->SummonCreature(NPC_INFINITE_ASSAILANT, m_creature->GetPositionX()-5,m_creature->GetPositionY(),m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + case 1: m_creature->SummonCreature(NPC_INFINITE_CHRONO_MAGUS, m_creature->GetPositionX()+5,m_creature->GetPositionY(),m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_creature->SummonCreature(NPC_INFINITE_CHRONO_MAGUS, m_creature->GetPositionX()-5,m_creature->GetPositionY(),m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + case 2: m_creature->SummonCreature(NPC_INFINITE_CHRONO_MAGUS, m_creature->GetPositionX()+5,m_creature->GetPositionY(),m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_creature->SummonCreature(NPC_INFINITE_ASSAILANT, m_creature->GetPositionX()-5,m_creature->GetPositionY(),m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_creature->SummonCreature(NPC_INFINITE_DESTROYER, m_creature->GetPositionX()+5,m_creature->GetPositionY()+5 ,m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + case 3: m_creature->SummonCreature(NPC_INFINITE_CHRONO_MAGUS, m_creature->GetPositionX()+5,m_creature->GetPositionY(),m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_creature->SummonCreature(NPC_INFINITE_ASSAILANT, m_creature->GetPositionX()-5,m_creature->GetPositionY(),m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_creature->SummonCreature(NPC_INFINITE_DESTROYER, m_creature->GetPositionX()+5,m_creature->GetPositionY()+5 ,m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + case 4: m_creature->SummonCreature(NPC_INFINITE_TIMERENDER, m_creature->GetPositionX()+5,m_creature->GetPositionY(),m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (uiWaveTimer <= uiDiff) + { + if(uiWaveCounter<=4) + { + SummonWave(); + uiWaveTimer = 15000; + uiWaveCounter++; + } + else m_creature->ForcedDespawn(); + } else uiWaveTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_npc_hourglass(Creature* pCreature) +{ + return new npc_hourglassAI(pCreature); +} + void AddSC_dragonblight() { Script* pNewScript; @@ -358,4 +442,9 @@ void AddSC_dragonblight() pNewScript->pGossipHello = &GossipHello_npc_torastrasza; pNewScript->pGossipSelect = &GossipSelect_npc_torastrasza; pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_hourglass"; + pNewScript->GetAI = &GetAI_npc_hourglass; + pNewScript->RegisterSelf(); } diff --git a/scripts/northrend/draktharon_keep/boss_dred.cpp b/scripts/northrend/draktharon_keep/boss_dred.cpp index 86b779c..5ad73ef 100644 --- a/scripts/northrend/draktharon_keep/boss_dred.cpp +++ b/scripts/northrend/draktharon_keep/boss_dred.cpp @@ -101,28 +101,36 @@ struct MANGOS_DLL_DECL boss_dredAI : public ScriptedAI { DoCast(m_creature->getVictim(), SPELL_PIERCING_SLASH, true); PiercingSlash_Timer = urand(20000, 25000); - }else PiercingSlash_Timer -= uiDiff; + } + else + PiercingSlash_Timer -= uiDiff; //Mangling Slash if (ManglingSlash_Timer < uiDiff) { DoCast(m_creature->getVictim(), SPELL_MANGLING_SLASH, true); ManglingSlash_Timer = urand(20000, 25000); - }else ManglingSlash_Timer -= uiDiff; + } + else + ManglingSlash_Timer -= uiDiff; //Grievous Bite if (GrievousBite_Timer < uiDiff) { DoCast(m_creature->getVictim(), SPELL_GRIEVOUS_BITE, true); GrievousBite_Timer = urand(20000, 25000); - }else GrievousBite_Timer -= uiDiff; - + } + else + GrievousBite_Timer -= uiDiff; + //Bellowing Roar if (BellowingRoar_Timer < uiDiff) { DoCast(m_creature, SPELL_BELLOWING_ROAR); BellowingRoar_Timer = 60000; - }else BellowingRoar_Timer -= uiDiff; + } + else + BellowingRoar_Timer -= uiDiff; //Call For Raptor - spell if (CallForRaptor_Timer < uiDiff) @@ -131,7 +139,9 @@ struct MANGOS_DLL_DECL boss_dredAI : public ScriptedAI m_creature->CastSpell(m_creature, SAY_CALL_FOR_RAPTOR, true); CallForRaptor_Timer = 25000; CallForRaptorSpawnCheck(); - }else CallForRaptor_Timer -= uiDiff; + } + else + CallForRaptor_Timer -= uiDiff; //Call For Raptor - spawn if (CallForRaptorSpawn_Timer < uiDiff && CallForRaptorSpawn_Check == 1) @@ -150,7 +160,9 @@ struct MANGOS_DLL_DECL boss_dredAI : public ScriptedAI } } CallForRaptorSpawn_Check = 0; - }else CallForRaptorSpawn_Timer -= uiDiff; + } + else + CallForRaptorSpawn_Timer -= uiDiff; DoMeleeAttackIfReady(); } @@ -163,10 +175,10 @@ CreatureAI* GetAI_boss_dred(Creature* pCreature) void AddSC_boss_dred() { - Script *newscript; + Script *pNewscript; - newscript = new Script; - newscript->Name = "boss_dred"; - newscript->GetAI = &GetAI_boss_dred; - newscript->RegisterSelf(); -} \ No newline at end of file + pNewscript = new Script; + pNewscript->Name = "boss_dred"; + pNewscript->GetAI = &GetAI_boss_dred; + pNewscript->RegisterSelf(); +} diff --git a/scripts/northrend/draktharon_keep/boss_tharonja.cpp b/scripts/northrend/draktharon_keep/boss_tharonja.cpp index 71e3090..89a64cc 100644 --- a/scripts/northrend/draktharon_keep/boss_tharonja.cpp +++ b/scripts/northrend/draktharon_keep/boss_tharonja.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2010 ScriptDev2 +/* Copyright (C) 2006 - 2011 ScriptDev2 * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -50,7 +50,7 @@ enum SPELL_GIFT_OF_THARONJA = 52509, SPELL_LIGHTNING_BREATH = 49537, - H_SPELL_LIGHTNING_BREATH = 59963, + H_SPELL_LIGHTNING_BREATH = 59936, SPELL_EYE_BEAM = 49544, H_SPELL_EYE_BEAM = 59965, @@ -59,6 +59,8 @@ enum SPELL_RETURN_FLESH = 53463, //not working + SPELL_ACHIEV_CHECK = 61863, + //achie hacks ACHIEVEMENT_NORMAL = 482, ACHIEVEMENT_HEROIC = 493 @@ -68,18 +70,19 @@ enum //Phasses enum Phase { - PHASE_SKELETON = 0, - PHASE_INTOFLESH = 1, - PHASE_FLESH = 2, - PHASE_INTOSKELETON = 3 + PHASE_SKELETON = 0, + PHASE_INTOFLESH = 1, + PHASE_FLESH = 2, + PHASE_INTOSKELETON = 3 }; enum PhaseChangeTimer { PHASE_CHANGE_SKELETON = 12000, - PHASE_CHANGE_REAL = 4000, - PHASE_CHANGE_FLESH = 20000 + PHASE_CHANGE_REAL = 6000, + PHASE_CHANGE_FLESH = 20000 }; + /*###### ## boss_tharonja ######*/ @@ -104,7 +107,6 @@ struct MANGOS_DLL_DECL boss_tharonjaAI : public ScriptedAI void Reset() { - m_creature->SetDisplayId(27072); PhaseChangeTimer = PHASE_CHANGE_SKELETON; Phase = PHASE_SKELETON; SkeletonSpells_Timer = urand (5000, 10000); @@ -127,11 +129,15 @@ struct MANGOS_DLL_DECL boss_tharonjaAI : public ScriptedAI void JustDied(Unit* pKiller) { DoScriptText(SAY_DEATH, m_creature); + DoCastSpellIfCan(pKiller, SPELL_ACHIEV_CHECK, CAST_TRIGGERED); if (m_pInstance) { m_pInstance->SetData(TYPE_THARONJA, DONE); - m_bIsRegularMode ? m_pInstance->DoCompleteAchievement(ACHIEVEMENT_NORMAL) : m_pInstance->DoCompleteAchievement(ACHIEVEMENT_HEROIC); + if (m_bIsRegularMode) + m_pInstance->DoCompleteAchievement(ACHIEVEMENT_NORMAL); + else + m_pInstance->DoCompleteAchievement(ACHIEVEMENT_HEROIC); } } diff --git a/scripts/northrend/draktharon_keep/boss_trollgore.cpp b/scripts/northrend/draktharon_keep/boss_trollgore.cpp index 7d47dda..fe654c7 100644 --- a/scripts/northrend/draktharon_keep/boss_trollgore.cpp +++ b/scripts/northrend/draktharon_keep/boss_trollgore.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2010 ScriptDev2 +/* Copyright (C) 2006 - 2011 ScriptDev2 * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/scripts/northrend/howling_fjord.cpp b/scripts/northrend/howling_fjord.cpp index dafaa35..1479176 100644 --- a/scripts/northrend/howling_fjord.cpp +++ b/scripts/northrend/howling_fjord.cpp @@ -192,7 +192,7 @@ struct MANGOS_DLL_DECL npc_daegarnAI : public ScriptedAI { if (pPlayer->isAlive()) { - pSummon->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSummon->SetWalk(false); pSummon->GetMotionMaster()->MovePoint(0, afCenter[0], afCenter[1], afCenter[2]); return; } @@ -503,7 +503,7 @@ struct MANGOS_DLL_DECL npc_silvermoon_harryAI : public ScriptedAI if (m_uiBlastWaveTimer < uiDiff) { DoCastSpellIfCan(m_creature, SPELL_BLAST_WAVE); - m_uiBlastWaveTimer = 50*IN_MILLISECONDS; + m_uiBlastWaveTimer = 40*IN_MILLISECONDS; } else m_uiBlastWaveTimer -= uiDiff; @@ -571,6 +571,222 @@ bool GossipSelect_npc_silvermoon_harry(Player* pPlayer, Creature* pCreature, uin return true; } +/*###### +## quest_jack_likes_his_drink +######*/ + +enum +{ + SAY_OLGA_0 = -1999818, // whisper + SAY_OLGA_1 = -1999817, + SAY_JACK_ADAMS_2 = -1999816, + SAY_OLGA_3 = -1999815, + SAY_JACK_ADAMS_4 = -1999814, + SAY_JACK_ADAMS_5 = -1999813, // faint + SAY_JACK_ADAMS_6 = -1999812, // wakeup + + NPC_TEXT_OLGA_1 = 12180, + NPC_JACK_ADAMS = 24788, + + SPELL_VOMIT = 41995, + ITEM_JACK_ADAMS_DEBT = 34116, + QUEST_JACK_LIKES_HIS_DRINK = 11466, +}; + +float OlgaWaypoints[2][4] = +{ + {0.0f, -91.81f, -3532.70f, 7.71f}, + {1.0f, -87.23f, -3544.23f, 7.71f} +}; + +#define GOSSIP_ITEM_OLGA_1 "I'd like to buy Jack a drink. Perhaps something... extra strong." +#define GOSSIP_ITEM_OLGA_2 "Here's a gold, buy yourself something nice." +#define GOSSIP_ITEM_OLGA_3 "Do you really want to bribe Olga?" +#define GOSSIP_ITEM_JACK_ADAMS_1 "" + +struct MANGOS_DLL_DECL npc_olgaAI : public ScriptedAI +{ + npc_olgaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + bool bEventInProgress; + bool bInRightPoint; + + uint8 subevent; + uint32 m_uiEventTimer; + uint32 m_uiResetJackTimer; + ObjectGuid JackAdamsGUID; + + void Reset() + { + bEventInProgress = false; + bInRightPoint = true; + subevent = 0; + m_uiEventTimer = 5000; + m_uiResetJackTimer = 30000; + // restore DB flags (GOSSIP) + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_creature->GetCreatureInfo()->npcflag); + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE) + return; + + if (uiPointId == OlgaWaypoints[1][0] || uiPointId == OlgaWaypoints[0][0]) + bInRightPoint = true; + } + + void UpdateAI(const uint32 uiDiff) + { + // if not event in progress and Jack is unconscous lets awake him after certain amount of time + if (!bEventInProgress) + { + if (m_uiResetJackTimer <= uiDiff) + { + Creature* pJack = m_creature->GetMap()->GetCreature(JackAdamsGUID); + if (pJack && pJack->isAlive() && pJack->GetByteValue(UNIT_FIELD_BYTES_1,0) == UNIT_STAND_STATE_DEAD) + pJack->SetByteValue(UNIT_FIELD_BYTES_1,0,UNIT_STAND_STATE_STAND); + m_uiResetJackTimer = 30000; + }else m_uiResetJackTimer -= uiDiff; + } + + if(bEventInProgress && bInRightPoint) + { + if (m_uiEventTimer <= uiDiff) + { + // if there is no Jack around or he is dead there is no point to continue + Creature* pJack = m_creature->GetMap()->GetCreature(JackAdamsGUID); + if (!pJack || !pJack->isAlive()) + { + m_creature->AI()->EnterEvadeMode(); + return; + } + + switch(subevent) + { + case 0: + DoScriptText(SAY_OLGA_1,m_creature); + m_creature->GetMotionMaster()->MovePoint(OlgaWaypoints[1][0],OlgaWaypoints[1][1],OlgaWaypoints[1][2],OlgaWaypoints[1][3]); + m_uiEventTimer = 3000; + break; + case 1: + DoScriptText(SAY_JACK_ADAMS_2,pJack,m_creature); + m_uiEventTimer = 1000; + bInRightPoint = false; + break; + case 2: + m_creature->SetFacingToObject(pJack); + m_uiEventTimer = 2000; + break; + case 3: + DoScriptText(SAY_OLGA_3,m_creature,pJack); + m_uiEventTimer = 7000; + break; + case 4: + pJack->SetByteValue(UNIT_FIELD_BYTES_1,0,UNIT_STAND_STATE_KNEEL); + DoScriptText(SAY_JACK_ADAMS_4,pJack,m_creature); + m_uiEventTimer = 5000; + break; + case 5: + pJack->SetByteValue(UNIT_FIELD_BYTES_1,0,UNIT_STAND_STATE_STAND); + m_uiEventTimer = 3000; + break; + case 6: + pJack->CastSpell(pJack,SPELL_VOMIT,false); + m_uiEventTimer = 3000; + break; + case 7: + DoScriptText(SAY_JACK_ADAMS_5,pJack,m_creature); + pJack->SetByteValue(UNIT_FIELD_BYTES_1,0,UNIT_STAND_STATE_DEAD); + pJack->SetUInt32Value(UNIT_NPC_FLAGS, m_creature->GetCreatureInfo()->npcflag); + m_uiEventTimer = 3000; + case 8: + m_creature->GetMotionMaster()->MovePoint(OlgaWaypoints[0][0],OlgaWaypoints[0][1],OlgaWaypoints[0][2],OlgaWaypoints[0][3]); + bInRightPoint = false; + break; + case 9: + m_creature->SetFacingToObject(pJack); + Reset(); + return; + default: break; + } + ++ subevent; + }else m_uiEventTimer -= uiDiff; + } + } +}; + + +bool GossipHello_npc_olga(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_JACK_LIKES_HIS_DRINK) == QUEST_STATUS_INCOMPLETE && pPlayer->GetMoney() >= 10000) + { + Creature* pJack = GetClosestCreatureWithEntry(pCreature,NPC_JACK_ADAMS,20.0f); + if (pJack && pJack->isAlive() && pJack->GetByteValue(UNIT_FIELD_BYTES_1,0) == UNIT_STAND_STATE_STAND) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_OLGA_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + ((npc_olgaAI*)pCreature->AI())->JackAdamsGUID = pJack->GetObjectGuid(); + } + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetObjectGuid()); + return true; +} + +bool GossipSelect_npc_olga(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_CHAT, GOSSIP_ITEM_OLGA_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2,GOSSIP_ITEM_OLGA_3, 10000,false); + pPlayer->SEND_GOSSIP_MENU(NPC_TEXT_OLGA_1, pCreature->GetObjectGuid()); + break; + + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + DoScriptText(SAY_OLGA_0,pCreature,pPlayer); + pCreature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + pPlayer->ModifyMoney(-10000); + ((npc_olgaAI*)pCreature->AI())->bEventInProgress = true; + break; + } + return true; +} + +bool GossipHello_npc_jack_adams(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_JACK_LIKES_HIS_DRINK) == QUEST_STATUS_INCOMPLETE && pPlayer->GetItemCount(ITEM_JACK_ADAMS_DEBT,false) < 1) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JACK_ADAMS_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetObjectGuid()); + return true; +} + +bool GossipSelect_npc_jack_adams(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + ItemPosCountVec dest; + uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_JACK_ADAMS_DEBT, 1, false); + if (msg == EQUIP_ERR_OK) + pPlayer->StoreNewItem(dest, ITEM_JACK_ADAMS_DEBT, 1, true); + pCreature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + // 50% chance that jack standup immediately + if (urand(0, 1) == 0) + { + pCreature->SetByteValue(UNIT_FIELD_BYTES_1,0,UNIT_STAND_STATE_STAND); + DoScriptText(SAY_JACK_ADAMS_6,pCreature,pPlayer); + } + } + return true; +} + +CreatureAI* GetAI_npc_olga(Creature* pCreature) +{ + return new npc_olgaAI(pCreature); +} + void AddSC_howling_fjord() { Script* pNewScript; @@ -615,4 +831,17 @@ void AddSC_howling_fjord() pNewScript->pGossipHello = &GossipHello_npc_silvermoon_harry; pNewScript->pGossipSelect = &GossipSelect_npc_silvermoon_harry; pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_olga"; + pNewScript->GetAI = &GetAI_npc_olga; + pNewScript->pGossipHello = &GossipHello_npc_olga; + pNewScript->pGossipSelect = &GossipSelect_npc_olga; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_jack_adams"; + pNewScript->pGossipHello = &GossipHello_npc_jack_adams; + pNewScript->pGossipSelect = &GossipSelect_npc_jack_adams; + pNewScript->RegisterSelf(); } diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/forge_of_souls.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/forge_of_souls.cpp index 08a84a7..97bb6ad 100644 --- a/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/forge_of_souls.cpp +++ b/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/forge_of_souls.cpp @@ -268,7 +268,7 @@ uint32 uiSummon_counter; { case 0: m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_creature->GetMotionMaster()->MovePoint(0, 5653.337f, 2496.407f, 708.829f); uiSummon_counter = 0; StepTimer = 400; diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_falric.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_falric.cpp index 4117fcf..3db5220 100644 --- a/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_falric.cpp +++ b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_falric.cpp @@ -64,18 +64,18 @@ struct MANGOS_DLL_DECL boss_falricAI : public BSWScriptedAI void Reset() { - SummonCount = 0; - m_bIsCall = false; - m_uiSummonTimer = 11000; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetVisibility(VISIBILITY_OFF); + SummonCount = 0; + m_bIsCall = false; + m_uiSummonTimer = 11000; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetVisibility(VISIBILITY_OFF); } void Aggro(Unit* pVictim) { - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); - DoScriptText(SAY_FALRIC_AGGRO, m_creature); - DoCast(m_creature, SPELL_HOPELESSNESS); + m_creature->SetWalk(false); + DoScriptText(SAY_FALRIC_AGGRO, m_creature); + DoCast(m_creature, SPELL_HOPELESSNESS); } void KilledUnit(Unit* pVictim) diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_lich_king.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_lich_king.cpp index 25ec230..018af62 100644 --- a/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_lich_king.cpp +++ b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_lich_king.cpp @@ -162,7 +162,7 @@ struct MANGOS_DLL_DECL boss_lich_king_hrAI : public npc_escortAI if (Creature* pNewLeader = m_creature->SummonCreature(newLeader,WallLoc[6].x,WallLoc[6].y,WallLoc[6].z,WallLoc[6].o,TEMPSUMMON_MANUAL_DESPAWN,0,true)) { - pNewLeader->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pNewLeader->SetWalk(false); pNewLeader->SetSpeedRate(MOVE_RUN, 1.0f, true); pNewLeader->SetRespawnDelay(DAY); pNewLeader->SetHealth(pNewLeader->GetMaxHealth()/10); @@ -186,8 +186,8 @@ struct MANGOS_DLL_DECL boss_lich_king_hrAI : public npc_escortAI if (Creature* pLider = m_pInstance->GetSingleCreatureFromStorage(m_pInstance->GetData(DATA_ESCAPE_LIDER))) { pLider->CastSpell(pLider, SPELL_SILENCE, false); - pLider->AddSplineFlag(SPLINEFLAG_FLYING); - pLider->SendMonsterMove(pLider->GetPositionX(), pLider->GetPositionY(), pLider->GetPositionZ() + 4, SPLINETYPE_NORMAL , pLider->GetSplineFlags(), 3000); + pLider->SetLevitate(true); + pLider->MonsterMoveWithSpeed(pLider->GetPositionX(), pLider->GetPositionY(), pLider->GetPositionZ() + 4, 26); } m_pInstance->SetData(TYPE_PHASE, 6); m_pInstance->SetNextEvent(610,GetLeader(),5000); @@ -438,7 +438,7 @@ struct MANGOS_DLL_DECL boss_lich_king_hrAI : public npc_escortAI NonFight = true; m_creature->AttackStop(); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->SetSpeedRate(MOVE_WALK, 2.7f, true); if (boss_lich_king_hrAI* pEscortAI = dynamic_cast(m_creature->AI())) pEscortAI->Start(); @@ -575,7 +575,7 @@ struct MANGOS_DLL_DECL boss_lich_king_intro_horAI : public ScriptedAI break; case 37: m_creature->GetMotionMaster()->MovementExpired(false); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_creature->GetMotionMaster()->MovePoint(0, 5443.880f, 2147.095f, 707.695f); if (GetLeader() == NPC_JAINA) DoScriptText(SAY_LICH_KING_A_21, m_creature); diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_marwyn.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_marwyn.cpp index 73472d4..fec0dfc 100644 --- a/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_marwyn.cpp +++ b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_marwyn.cpp @@ -163,7 +163,7 @@ struct MANGOS_DLL_DECL boss_marwynAI : public BSWScriptedAI void Aggro(Unit* pVictim) { if (!m_pInstance) return; - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); DoScriptText(SAY_MARWYN_AGGRO, m_creature); } diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/halls_of_reflection.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/halls_of_reflection.cpp index 17b4261..a1a41e3 100644 --- a/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/halls_of_reflection.cpp +++ b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/halls_of_reflection.cpp @@ -198,7 +198,7 @@ struct MANGOS_DLL_DECL npc_jaina_and_sylvana_HRintroAI : public ScriptedAI m_pInstance->SetNextEvent(4,m_creature->GetEntry(),500); break; case 4: - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_creature->GetMotionMaster()->MovePoint(0, 5307.031f, 1997.920f, 709.341f); m_pInstance->SetNextEvent(5,m_creature->GetEntry(),10000); break; @@ -764,7 +764,7 @@ struct MANGOS_DLL_DECL npc_jaina_and_sylvana_HRextroAI : public npc_escortAI switch(m_pInstance->GetEvent(m_creature->GetEntry())) { case 100: - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); if (Creature* pLichKing = m_pInstance->GetSingleCreatureFromStorage(BOSS_LICH_KING)) { if (m_creature->GetEntry() == NPC_SYLVANA_OUTRO) @@ -862,9 +862,9 @@ struct MANGOS_DLL_DECL npc_jaina_and_sylvana_HRextroAI : public npc_escortAI if (GameObject* pCave = m_pInstance->GetSingleGameObjectFromStorage(GO_CAVE)) pCave->SetGoState(GO_STATE_READY); m_creature->RemoveAurasDueToSpell(SPELL_SILENCE); - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); m_creature->CastSpell(m_creature, SPELL_SHIELD_DISRUPTION,false); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_creature->GetMotionMaster()->MovePoint(0, 5258.911328f,1652.112f,784.295166f); DoScriptText(SAY_ESCAPE_01, m_creature); m_pInstance->SetNextEvent(612,m_creature->GetEntry(),10000); @@ -1295,7 +1295,7 @@ struct MANGOS_DLL_DECL npc_queldelar_horAI : public ScriptedAI pNewLeader->setFaction(35); pNewLeader->SetPhaseMask(65535, true); pNewLeader->GetMotionMaster()->MovePoint(0, WallLoc[5].x,WallLoc[5].y,WallLoc[5].z); - pNewLeader->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pNewLeader->SetWalk(false); pNewLeader->SetSpeedRate(MOVE_RUN, 1.0f, true); pNewLeader->SetRespawnDelay(DAY); } diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/blood_prince_council.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/blood_prince_council.cpp index 004b551..2a715e2 100644 --- a/scripts/northrend/icecrown_citadel/icecrown_citadel/blood_prince_council.cpp +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/blood_prince_council.cpp @@ -628,7 +628,7 @@ struct MANGOS_DLL_DECL mob_ball_of_flamesAI : public ScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); SetCombatMovement(false); m_creature->GetPosition(fPosX, fPosY, fPosZ); m_creature->GetRandomPoint(fPosX, fPosY, fPosZ, urand(40, 60), fPosX, fPosY, fPosZ); @@ -709,7 +709,7 @@ struct MANGOS_DLL_DECL mob_kinetic_bombAI : public ScriptedAI m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); m_creature->SetSpeedRate(MOVE_RUN, 0.2f); m_creature->SetSpeedRate(MOVE_WALK, 0.2f); SetCombatMovement(false); diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_blood_queen_lanathel.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_blood_queen_lanathel.cpp index 1f43223..51aa2ed 100644 --- a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_blood_queen_lanathel.cpp +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_blood_queen_lanathel.cpp @@ -216,7 +216,7 @@ struct MANGOS_DLL_DECL boss_blood_queen_lanathelAI : public BSWScriptedAI StartMovement(1); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); stage = 2; break; case 2: @@ -240,7 +240,7 @@ struct MANGOS_DLL_DECL boss_blood_queen_lanathelAI : public BSWScriptedAI m_creature->AttackStop(); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 0); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); StartMovement(0); stage = 5; break; diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lord_marrowgar.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lord_marrowgar.cpp index 9dfc09e..3c4da52 100644 --- a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lord_marrowgar.cpp +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lord_marrowgar.cpp @@ -62,7 +62,7 @@ struct MANGOS_DLL_DECL boss_lord_marrowgarAI : public BSWScriptedAI resetTimers(); m_creature->SetSpeedRate(MOVE_RUN, 1); m_creature->SetSpeedRate(MOVE_WALK, 1); -// m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); +// m_creature->SetWalk(true); } void MoveInLineOfSight(Unit* pWho) @@ -174,7 +174,7 @@ struct MANGOS_DLL_DECL boss_lord_marrowgarAI : public BSWScriptedAI setStage(2); DoScriptText(-1631002,m_creature); DoResetThreat(); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_creature->SetSpeedRate(MOVE_RUN, 3); m_creature->SetSpeedRate(MOVE_WALK, 3); break; @@ -206,7 +206,7 @@ struct MANGOS_DLL_DECL boss_lord_marrowgarAI : public BSWScriptedAI pInstance->SetData(DATA_DIRECTION, 0); m_creature->SetSpeedRate(MOVE_RUN, 1); m_creature->SetSpeedRate(MOVE_WALK, 1); -// m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); +// m_creature->SetWalk(true); setStage(0); break; default: diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_professor_putricide.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_professor_putricide.cpp index 082650c..dc68633 100644 --- a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_professor_putricide.cpp +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_professor_putricide.cpp @@ -432,7 +432,7 @@ struct MANGOS_DLL_DECL mob_icc_gas_cloudAI : public BSWScriptedAI void Reset() { m_creature->SetRespawnDelay(7*DAY); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->SetSpeedRate(MOVE_WALK, 0.5f); m_creature->SetSpeedRate(MOVE_RUN, 0.2f); pTarget = NULL; @@ -517,7 +517,7 @@ struct MANGOS_DLL_DECL mob_icc_volatile_oozeAI : public BSWScriptedAI void Reset() { m_creature->SetRespawnDelay(7*DAY); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->SetSpeedRate(MOVE_WALK, 0.5f); m_creature->SetSpeedRate(MOVE_RUN, 0.2f); pTarget = NULL; diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_rotface.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_rotface.cpp index 0836006..24e8b4c 100644 --- a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_rotface.cpp +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_rotface.cpp @@ -205,7 +205,7 @@ struct MANGOS_DLL_DECL mob_small_oozeAI : public BSWScriptedAI resetTimers(); m_creature->SetRespawnDelay(7*DAY); doCast(SPELL_RADIATING_OOZE); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->SetSpeedRate(MOVE_RUN, 0.5); m_creature->SetSpeedRate(MOVE_WALK, 0.5); } @@ -251,7 +251,7 @@ struct MANGOS_DLL_DECL mob_big_oozeAI : public BSWScriptedAI resetTimers(); m_creature->SetRespawnDelay(7*DAY); doCast(SPELL_UNSTABLE_OOZE); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->SetSpeedRate(MOVE_RUN, 0.5); m_creature->SetSpeedRate(MOVE_WALK, 0.5); exploded = false; diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_sindragosa.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_sindragosa.cpp index d4e343e..c340d58 100644 --- a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_sindragosa.cpp +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_sindragosa.cpp @@ -151,7 +151,7 @@ struct MANGOS_DLL_DECL boss_sindragosaAI : public BSWScriptedAI m_creature->RemoveAurasDueToSpell(SPELL_FLY); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 0); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); ScriptedAI::EnterEvadeMode(); } @@ -269,7 +269,7 @@ struct MANGOS_DLL_DECL boss_sindragosaAI : public BSWScriptedAI m_creature->CastSpell(m_creature,SPELL_FLY, true); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); m_creature->GetMotionMaster()->MovePoint(1, SpawnLoc[1].x, SpawnLoc[1].y, SpawnLoc[1].z); m_creature->HandleEmoteCommand(EMOTE_ONESHOT_FLY_SIT_GROUND_UP); break; @@ -319,7 +319,7 @@ struct MANGOS_DLL_DECL boss_sindragosaAI : public BSWScriptedAI m_creature->RemoveAurasDueToSpell(SPELL_FLY); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 0); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); }; break; diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_the_lich_king.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_the_lich_king.cpp index 0003f70..620d2d8 100644 --- a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_the_lich_king.cpp +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_the_lich_king.cpp @@ -774,7 +774,7 @@ struct MANGOS_DLL_DECL boss_tirion_iccAI : public ScriptedAI pInstance->SetData(TYPE_EVENT,12052); break; case 12052: - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); StartMovement(3,12053); break; case 12053: @@ -796,7 +796,7 @@ struct MANGOS_DLL_DECL boss_tirion_iccAI : public ScriptedAI pInstance->SetData(TYPE_EVENT,13131); break; case 13131: - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); StartMovement(2,13132); break; case 13132: @@ -964,7 +964,7 @@ struct MANGOS_DLL_DECL mob_ice_sphere_iccAI : public BSWScriptedAI { resetTimers(); doCast(SPELL_ICE_SPHERE_VISUAL); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); } @@ -1114,7 +1114,7 @@ struct MANGOS_DLL_DECL mob_vile_spiritAI : public BSWScriptedAI } SetCombatMovement(false); movementstarted = false; - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); } diff --git a/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp b/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp index 14cac2c..974bdce 100644 --- a/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp +++ b/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp @@ -1,18 +1,18 @@ /* Copyright (C) 2006 - 2011 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ /* ScriptData SDName: Boss_Malygos @@ -29,144 +29,144 @@ EndScriptData */ enum { // ******************************** SPELLS ******************************** // - SPELL_BERSERK = 64238, + SPELL_BERSERK = 64238, //////////////// PHASE 0 //////////////// - SPELL_PORTAL_BEAM = 56046, + SPELL_PORTAL_BEAM = 56046, //////////////// PHASE 1 //////////////// - SPELL_ARCANE_BREATH = 56272, - SPELL_ARCANE_BREATH_H = 60072, - SPELL_ARCANE_STORM = 61693, - SPELL_ARCANE_STORM_H = 61694, - SPELL_VORTEX = 56105, - SPELL_VORTEX_DMG_AURA = 56266, // on 10 sec, deal 2000 damage all player around caster - SPELL_VORTEX_VISUAL = 55873, // visual effect around platform. summon trigger - SPELL_VORTEX_CHANNEL = 56237, // Malygos Channel Effect - SPELL_POWER_SPARK = 56152, // if spark reach malygos then buff him - SPELL_POWER_SPARK_PLAYERS = 55852, // if spark is killed - buff players in area - SPELL_POWER_SPARK_VISUAL = 55845, + SPELL_ARCANE_BREATH = 56272, + SPELL_ARCANE_BREATH_H = 60072, + SPELL_ARCANE_STORM = 61693, + SPELL_ARCANE_STORM_H = 61694, + SPELL_VORTEX = 56105, + SPELL_VORTEX_DMG_AURA = 56266, // on 10 sec, deal 2000 damage all player around caster + SPELL_VORTEX_VISUAL = 55873, // visual effect around platform. summon trigger + SPELL_VORTEX_CHANNEL = 56237, // Malygos Channel Effect + SPELL_POWER_SPARK = 56152, // if spark reach malygos then buff him + SPELL_POWER_SPARK_PLAYERS = 55852, // if spark is killed - buff players in area + SPELL_POWER_SPARK_VISUAL = 55845, //////////////// PHASE 2 //////////////// - SPELL_ARCANE_BOMB_MISSILE = 56430, - SPELL_ARCANE_BOMB_DAMAGE = 56431, // cast by arcane overload - SPELL_ARCANE_OVERLOAD = 56432, // cast this on arcane overload NPCs - SPELL_SURGE_OF_POWER_BREATH = 56505, // omfg, they say deep breath, but its this! - SPELL_DESTROY_PLATFORM_PRE = 58842, // lights all over the platform - SPELL_DESTROY_PLATFORM_BOOM = 59084, // Big Blue boom + SPELL_ARCANE_BOMB_MISSILE = 56430, + SPELL_ARCANE_BOMB_DAMAGE = 56431, // cast by arcane overload + SPELL_ARCANE_OVERLOAD = 56432, // cast this on arcane overload NPCs + SPELL_SURGE_OF_POWER_BREATH = 56505, // omfg, they say deep breath, but its this! + SPELL_DESTROY_PLATFORM_PRE = 58842, // lights all over the platform + SPELL_DESTROY_PLATFORM_BOOM = 59084, // Big Blue boom //NPCs spells - SPELL_ARCANE_SHOCK = 57058, - SPELL_ARCANE_SHOCK_H = 60073, - SPELL_HASTE = 57060, - SPELL_ARCANE_BARRAGE = 50804, // hack, right spell is 56397 + SPELL_ARCANE_SHOCK = 57058, + SPELL_ARCANE_SHOCK_H = 60073, + SPELL_HASTE = 57060, + SPELL_ARCANE_BARRAGE = 50804, // hack, right spell is 56397 //////////////// PHASE 3 //////////////// - SPELL_STATIC_FIELD_MISSILE = 57430, - SPELL_STATIC_FIELD = 57428, - SPELL_SURGE_OF_POWER = 57407, // this is on one target - SPELL_SURGE_OF_POWER_H = 60936, // this is on unlimited tagets, must limit it in mangos - SPELL_ARCANE_PULSE = 57432, + SPELL_STATIC_FIELD_MISSILE = 57430, + SPELL_STATIC_FIELD = 57428, + SPELL_SURGE_OF_POWER = 57407, // this is on one target + SPELL_SURGE_OF_POWER_H = 60936, // this is on unlimited tagets, must limit it in mangos + SPELL_ARCANE_PULSE = 57432, - SPELL_ALEXSTRASZAS_GIFT_BEAM = 61028, - SPELL_ALEXSTRASZAS_GIFT_VISUAL = 61023, + SPELL_ALEXSTRASZAS_GIFT_BEAM = 61028, + SPELL_ALEXSTRASZAS_GIFT_VISUAL = 61023, // ******************************** Items, NPCs & GameObjects ******************************** // - ITEM_KEY_TO_FOCUSING_IRIS = 44582, - ITEM_KEY_TO_FOCUSING_IRIS_H = 44581, + ITEM_KEY_TO_FOCUSING_IRIS = 44582, + ITEM_KEY_TO_FOCUSING_IRIS_H = 44581, //////////////// PHASE 1 //////////////// - NPC_VORTEX = 30090, - NPC_POWER_SPARK = 30084, - NPC_SPARK_PORTAL = 30118, // for power sparks - VEHICLE_VORTEX = 168, + NPC_VORTEX = 30090, + NPC_POWER_SPARK = 30084, + NPC_SPARK_PORTAL = 30118, // for power sparks + VEHICLE_VORTEX = 168, //////////////// PHASE 2 //////////////// - NPC_HOVER_DISK = 30248, - NPC_NEXUS_LORD = 30245, // 2 (normal) and 4 (heroic) of them are spawned on beginning of phase 2 - NPC_SCION_OF_ETERNITY = 30249, // 4 (normal) and 8 (heroic) of them are spawned on beginning of phase 2 - NPC_ARCANE_OVERLOAD = 30282, - NPC_SURGE_OF_POWER = 30334, + NPC_HOVER_DISK = 30248, + NPC_NEXUS_LORD = 30245, // 2 (normal) and 4 (heroic) of them are spawned on beginning of phase 2 + NPC_SCION_OF_ETERNITY = 30249, // 4 (normal) and 8 (heroic) of them are spawned on beginning of phase 2 + NPC_ARCANE_OVERLOAD = 30282, + NPC_SURGE_OF_POWER = 30334, //////////////// PHASE 3 //////////////// - NPC_STATIC_FIELD = 30592, // trigger for that spell - NPC_WYRMREST_SKYTALON = 30161, // dragon vehicle in 3-d Phase - NPC_ALEXSTRASZA = 32295, - NPC_ALEXSTRASZAS_GIFT = 32448, - - SPELL_CALL_SKYTALON = 58846, - SPELL_CALL_SKYTALON_0 = 56070, - SPELL_VEHICLE_HARDCODED = 46598, - - SAY_INTRO1 = -1616000, - SAY_INTRO2 = -1616001, - SAY_INTRO3 = -1616002, - SAY_INTRO4 = -1616003, - SAY_INTRO5 = -1616004, - SAY_INTRO_PHASE3 = -1616018, - SAY_AGGRO1 = -1616005, - SAY_AGGRO2 = -1616013, - SAY_AGGRO3 = -1616019, - SAY_VORTEX = -1616006, - SAY_POWER_SPARK = -1616035, - SAY_POWER_SPARK_BUFF = -1616007, - SAY_KILL1_1 = -1616008, - SAY_KILL1_2 = -1616009, - SAY_KILL1_3 = -1616010, - SAY_KILL2_1 = -1616020, - SAY_KILL2_2 = -1616021, - SAY_KILL2_3 = -1616022, - SAY_KILL3_1 = -1616023, - SAY_KILL3_2 = -1616024, - SAY_KILL3_3 = -1616025, - SAY_END_PHASE1 = -1616012, - SAY_END_PHASE2 = -1616017, - SAY_ARCANE_PULSE = -1616014, - SAY_ARCANE_PULSE_WARN = -1616015, - SAY_ARCANE_OVERLOAD = -1616016, - SAY_SURGE_OF_POWER = -1616026, - SAY_CAST_SPELL1 = -1616027, - SAY_CAST_SPELL2 = -1616028, - SAY_CAST_SPELL3 = -1616029, - SAY_DEATH = -1616030, + NPC_STATIC_FIELD = 30592, // trigger for that spell + NPC_WYRMREST_SKYTALON = 30161, // dragon vehicle in 3-d Phase + NPC_ALEXSTRASZA = 32295, + NPC_ALEXSTRASZAS_GIFT = 32448, + + SPELL_CALL_SKYTALON = 58846, + SPELL_CALL_SKYTALON_0 = 56070, + SPELL_VEHICLE_HARDCODED = 46598, + + SAY_INTRO1 = -1616000, + SAY_INTRO2 = -1616001, + SAY_INTRO3 = -1616002, + SAY_INTRO4 = -1616003, + SAY_INTRO5 = -1616004, + SAY_INTRO_PHASE3 = -1616018, + SAY_AGGRO1 = -1616005, + SAY_AGGRO2 = -1616013, + SAY_AGGRO3 = -1616019, + SAY_VORTEX = -1616006, + SAY_POWER_SPARK = -1616035, + SAY_POWER_SPARK_BUFF = -1616007, + SAY_KILL1_1 = -1616008, + SAY_KILL1_2 = -1616009, + SAY_KILL1_3 = -1616010, + SAY_KILL2_1 = -1616020, + SAY_KILL2_2 = -1616021, + SAY_KILL2_3 = -1616022, + SAY_KILL3_1 = -1616023, + SAY_KILL3_2 = -1616024, + SAY_KILL3_3 = -1616025, + SAY_END_PHASE1 = -1616012, + SAY_END_PHASE2 = -1616017, + SAY_ARCANE_PULSE = -1616014, + SAY_ARCANE_PULSE_WARN = -1616015, + SAY_ARCANE_OVERLOAD = -1616016, + SAY_SURGE_OF_POWER = -1616026, + SAY_CAST_SPELL1 = -1616027, + SAY_CAST_SPELL2 = -1616028, + SAY_CAST_SPELL3 = -1616029, + SAY_DEATH = -1616030, // Alexstrasza - SAY_OUTRO1 = -1616031, - SAY_OUTRO2 = -1616032, - SAY_OUTRO3 = -1616033, - SAY_OUTRO4 = -1616034, - - PLATFORM_MIN_X = 722, - PLATFORM_MAX_X = 768, - PLATFORM_MIN_Y = 1290, - PLATFORM_MAX_Y = 1339, - - NEXUS_LORD_COUNT = 2, - NEXUS_LORD_COUNT_H = 4, - SCION_OF_ETERNITY_COUNT = 4, - SCION_OF_ETERNITY_COUNT_H = 8, - - PHASE_INTRO = 0, - PHASE_FLOOR = 1, - SUBPHASE_VORTEX = 11, - PHASE_ADDS = 2, - SUBPHASE_TALK = 21, - SUBPHASE_DEEP_BREATH = 22, - PHASE_DRAGONS = 3, + SAY_OUTRO1 = -1616031, + SAY_OUTRO2 = -1616032, + SAY_OUTRO3 = -1616033, + SAY_OUTRO4 = -1616034, + + PLATFORM_MIN_X = 722, + PLATFORM_MAX_X = 768, + PLATFORM_MIN_Y = 1290, + PLATFORM_MAX_Y = 1339, + + NEXUS_LORD_COUNT = 2, + NEXUS_LORD_COUNT_H = 4, + SCION_OF_ETERNITY_COUNT = 4, + SCION_OF_ETERNITY_COUNT_H = 8, + + PHASE_INTRO = 0, + PHASE_FLOOR = 1, + SUBPHASE_VORTEX = 11, + PHASE_ADDS = 2, + SUBPHASE_TALK = 21, + SUBPHASE_DEEP_BREATH = 22, + PHASE_DRAGONS = 3, SUBPHASE_DESTROY_PLATFORM_1 = 31, SUBPHASE_DESTROY_PLATFORM_2 = 32, SUBPHASE_DESTROY_PLATFORM_3 = 33, SUBPHASE_DESTROY_PLATFORM_4 = 34, - SUBPHASE_SURGE_OF_POWER = 35, + SUBPHASE_SURGE_OF_POWER = 35, - POINT_ID_WAYPOINT = 1, - POINT_ID_LAND = 2, - POINT_ID_VORTEX_AIR = 3, - POINT_ID_PHASE_2_WP = 4, - POINT_ID_DEEP_BREATH = 5, + POINT_ID_WAYPOINT = 1, + POINT_ID_LAND = 2, + POINT_ID_VORTEX_AIR = 3, + POINT_ID_PHASE_2_WP = 4, + POINT_ID_DEEP_BREATH = 5, //hacks - SPELL_FLIGHT = 59553, - MODEL_ID_INVISIBLE = 11686 + SPELL_FLIGHT = 59553, + MODEL_ID_INVISIBLE = 11686 }; struct LocationsXY @@ -208,16 +208,16 @@ static LocationsXY VortexLoc[]= {728, 1312}, }; -#define MAX_VORTEX 21 +#define MAX_VORTEX 21 -#define CENTER_X 754.50f -#define CENTER_Y 1301.76f -#define FLOOR_Z 266.17f -#define AIR_Z 296.17f -#define VORTEX_FARSIGHT_X 749.00f -#define VORTEX_FARSIGHT_Y 1244.00f -#define VORTEX_FARSIGHT_Z 332.00f -#define VORTEX_FARSIGHT_O 1.54f +#define CENTER_X 754.50f +#define CENTER_Y 1301.76f +#define FLOOR_Z 266.17f +#define AIR_Z 296.17f +#define VORTEX_FARSIGHT_X 749.00f +#define VORTEX_FARSIGHT_Y 1244.00f +#define VORTEX_FARSIGHT_Z 332.00f +#define VORTEX_FARSIGHT_O 1.54f /*###### ## boss_malygos @@ -296,7 +296,7 @@ struct MANGOS_DLL_DECL boss_malygosAI : public ScriptedAI m_creature->SetSpeedRate(MOVE_FLIGHT, 2.0f); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); m_creature->GetMotionMaster()->Clear(); DespawnCreatures(NPC_POWER_SPARK); @@ -337,7 +337,7 @@ struct MANGOS_DLL_DECL boss_malygosAI : public ScriptedAI DespawnCreatures(NPC_STATIC_FIELD); m_creature->SummonCreature(NPC_ALEXSTRASZA, CENTER_X+20.0f, CENTER_Y+20.0f, AIR_Z, 0, TEMPSUMMON_DEAD_DESPAWN, 0); m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), FLOOR_Z-500.0f, 0); - m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), FLOOR_Z-400.0f, SPLINETYPE_NORMAL , m_creature->GetSplineFlags(), 10000); + m_creature->MonsterMoveWithSpeed(m_creature->GetPositionX(), m_creature->GetPositionY(), FLOOR_Z-400.0f, 26); } void KilledUnit(Unit* pVictim) @@ -395,7 +395,7 @@ struct MANGOS_DLL_DECL boss_malygosAI : public ScriptedAI { if (Creature* pDisk = pSummoned->SummonCreature(NPC_HOVER_DISK, pSummoned->GetPositionX(), pSummoned->GetPositionY(), pSummoned->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0)) { - pDisk->SetSplineFlags(SPLINEFLAG_FLYING); + pDisk->SetLevitate(true); pDisk->CastSpell(pDisk, SPELL_FLIGHT, true); if (uiEntry == NPC_NEXUS_LORD) pDisk->SetSpeedRate(MOVE_WALK, 1.5f); @@ -472,7 +472,7 @@ struct MANGOS_DLL_DECL boss_malygosAI : public ScriptedAI pTargetSparkPortal->Respawn(); m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, 0); - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_uiPhase = PHASE_FLOOR; m_creature->SetInCombatWithZone(); @@ -698,7 +698,7 @@ struct MANGOS_DLL_DECL boss_malygosAI : public ScriptedAI else if (m_uiVortexPhase == MAX_VORTEX+9) { m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, 0); - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); m_uiSubPhase = 0; m_creature->GetMotionMaster()->Clear(); if (Unit* pTarget = m_creature->getVictim()) @@ -753,7 +753,7 @@ struct MANGOS_DLL_DECL boss_malygosAI : public ScriptedAI if (m_uiVortexTimer <= uiDiff) { m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); SetCombatMovement(false); m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MovePoint(POINT_ID_VORTEX_AIR, CENTER_X, CENTER_Y, AIR_Z); @@ -778,7 +778,7 @@ struct MANGOS_DLL_DECL boss_malygosAI : public ScriptedAI m_uiPhase = PHASE_ADDS; m_uiSubPhase = SUBPHASE_TALK; m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); SetCombatMovement(false); m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, AIR_Z); @@ -789,7 +789,7 @@ struct MANGOS_DLL_DECL boss_malygosAI : public ScriptedAI m_uiTimer = 2000; } else - m_uiTimer -= uiDiff; + m_uiTimer -= uiDiff; } else if (m_uiPhase == PHASE_ADDS) { @@ -1066,7 +1066,7 @@ struct MANGOS_DLL_DECL npc_power_sparkAI : public ScriptedAI m_uiCheckTimer = 0; SetCombatMovement(false); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); m_creature->CastSpell(m_creature, SPELL_POWER_SPARK_VISUAL, false); } @@ -1092,7 +1092,7 @@ struct MANGOS_DLL_DECL npc_power_sparkAI : public ScriptedAI m_creature->CastSpell(m_creature, SPELL_POWER_SPARK_PLAYERS, true); m_creature->GetMotionMaster()->Clear(); m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), FLOOR_Z+1.5f, 0); - m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), FLOOR_Z+1.5f, SPLINETYPE_NORMAL , m_creature->GetSplineFlags(), 1000); + m_creature->MonsterMoveWithSpeed(m_creature->GetPositionX(), m_creature->GetPositionY(), FLOOR_Z+1.5f,26); m_creature->ForcedDespawn(60000); } } @@ -1227,7 +1227,7 @@ struct MANGOS_DLL_DECL npc_nexus_lordAI : public ScriptedAI DoMeleeAttackIfReady(); } -}; +}; /*###### ## npc_scion_of_eternity @@ -1271,7 +1271,7 @@ struct MANGOS_DLL_DECL npc_scion_of_eternityAI : public ScriptedAI DoMeleeAttackIfReady(); } -}; +}; /*###### ## npc_hover_disk @@ -1296,7 +1296,7 @@ struct MANGOS_DLL_DECL npc_hover_diskAI : public ScriptedAI m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->setFaction(35); m_creature->CastSpell(m_creature, SPELL_FLIGHT, true); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); } void AttackStart(Unit *pWho) @@ -1320,7 +1320,7 @@ struct MANGOS_DLL_DECL npc_hover_diskAI : public ScriptedAI m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), FLOOR_Z+1.5f, 0); - m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), FLOOR_Z+1.5f, SPLINETYPE_NORMAL , m_creature->GetSplineFlags(), 4000); + m_creature->MonsterMoveWithSpeed(m_creature->GetPositionX(), m_creature->GetPositionY(), FLOOR_Z+1.5f, 26); m_bMoved = true; m_bPassengerHere = false; } @@ -1351,7 +1351,7 @@ struct MANGOS_DLL_DECL npc_alexstraszaAI : public ScriptedAI m_uiTimer = 9500; m_uiCount = 0; m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); if (m_pInstance) if (Creature* pMalygos = m_pInstance->GetSingleCreatureFromStorage(NPC_MALYGOS)) m_creature->SetFacingToObject(pMalygos); @@ -1444,17 +1444,17 @@ CreatureAI* GetAI_npc_power_spark(Creature* pCreature) CreatureAI* GetAI_npc_nexus_lord(Creature* pCreature) { return new npc_nexus_lordAI(pCreature); -} +} CreatureAI* GetAI_npc_scion_of_eternity(Creature* pCreature) { return new npc_scion_of_eternityAI(pCreature); -} +} CreatureAI* GetAI_npc_hover_disk(Creature* pCreature) { return new npc_hover_diskAI(pCreature); -} +} CreatureAI* GetAI_npc_alexstrasza(Creature* pCreature) { @@ -1485,7 +1485,7 @@ struct MANGOS_DLL_DECL npc_whyrmrest_skytalonAI : public ScriptedAI SeatTimer = 2000; ownerGUID = m_creature->GetCreatorGuid(); m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); } void AttackStart(Unit *) {} @@ -1604,4 +1604,4 @@ void AddSC_boss_malygos() newscript->Name = "go_focusing_iris"; newscript->pGOUse = &GOHello_go_focusing_iris; newscript->RegisterSelf(); -} +} \ No newline at end of file diff --git a/scripts/northrend/nexus/oculus/boss_drakos.cpp b/scripts/northrend/nexus/oculus/boss_drakos.cpp index 71c809e..f871719 100644 --- a/scripts/northrend/nexus/oculus/boss_drakos.cpp +++ b/scripts/northrend/nexus/oculus/boss_drakos.cpp @@ -176,7 +176,7 @@ struct MANGOS_DLL_DECL npc_unstable_sphereAI : public ScriptedAI void Reset() { - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); m_creature->GetMotionMaster()->MovePoint(0, (CENTER_X-35)+rand()%70, (CENTER_Y-35)+rand()%70, m_creature->GetPositionZ()); m_creature->SetSpeedRate(MOVE_RUN, 2, true); m_creature->setFaction(14); diff --git a/scripts/northrend/nexus/oculus/boss_eregos.cpp b/scripts/northrend/nexus/oculus/boss_eregos.cpp index 2a048af..20709eb 100644 --- a/scripts/northrend/nexus/oculus/boss_eregos.cpp +++ b/scripts/northrend/nexus/oculus/boss_eregos.cpp @@ -91,7 +91,7 @@ struct MANGOS_DLL_DECL boss_eregosAI : public ScriptedAI } } - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); uiArcaneBarrageTimer = 12000; @@ -137,7 +137,7 @@ struct MANGOS_DLL_DECL boss_eregosAI : public ScriptedAI void JustDied(Unit* killer) { m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()-100.0f, 0); - m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()-100.0f, SPLINETYPE_NORMAL , m_creature->GetSplineFlags(), 6000); + // m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()-100.0f, SPLINETYPE_NORMAL , m_creature->GetSplineFlags(), 6000); DoScriptText(SAY_DEATH, m_creature); if (m_pInstance) m_pInstance->SetData(TYPE_EREGOS, DONE); @@ -270,7 +270,7 @@ struct MANGOS_DLL_DECL npc_planar_anomalyAI : public ScriptedAI { m_creature->SetDisplayId(11686); m_creature->SetObjectScale(2.0f); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); m_creature->SetSpeedRate(MOVE_RUN, 1.5, true); m_creature->setFaction(14); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); diff --git a/scripts/northrend/nexus/oculus/boss_urom.cpp b/scripts/northrend/nexus/oculus/boss_urom.cpp index a16ad62..f450fd7 100644 --- a/scripts/northrend/nexus/oculus/boss_urom.cpp +++ b/scripts/northrend/nexus/oculus/boss_urom.cpp @@ -151,7 +151,7 @@ struct MANGOS_DLL_DECL boss_uromAI : public BSWScriptedAI void TeleportBoss(float X, float Y, float Z, float O) { m_creature->GetMap()->CreatureRelocation(m_creature, X, Y, Z, O); - m_creature->SendMonsterMove(X, Y, Z, SPLINETYPE_NORMAL, SPLINEFLAG_DONE, 0); + m_creature->MonsterMoveWithSpeed(X, Y, Z, 44, false ,true); m_creature->Relocate(X, Y, Z, O); } @@ -332,7 +332,7 @@ struct MANGOS_DLL_DECL boss_uromAI : public BSWScriptedAI if(m_uiRelocateTimer < uiDiff) { m_bIsTeleported = true; - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->MoveIdle(); m_creature->StopMoving(); @@ -354,7 +354,7 @@ struct MANGOS_DLL_DECL boss_uromAI : public BSWScriptedAI if(m_uiBackTimer < uiDiff) { TeleportBoss((m_creature->getVictim())->GetPositionX(),(m_creature->getVictim())->GetPositionY(),(m_creature->getVictim())->GetPositionZ(),(m_creature->getVictim())->GetOrientation()); - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); if(m_creature->getVictim()) m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); m_uiBackTimer = m_bIsRegularMode ? 9500 : 7500; diff --git a/scripts/northrend/nexus/oculus/boss_varos.cpp b/scripts/northrend/nexus/oculus/boss_varos.cpp index 39572ea..b938c4e 100644 --- a/scripts/northrend/nexus/oculus/boss_varos.cpp +++ b/scripts/northrend/nexus/oculus/boss_varos.cpp @@ -167,7 +167,7 @@ struct MANGOS_DLL_DECL boss_varosAI : public ScriptedAI if(Creature* Dragon = m_creature->SummonCreature(NPC_AZURE_CAPTAIN, (m_creature->GetPositionX()-45)+rand()%90, (m_creature->GetPositionY()-45)+rand()%90, m_creature->GetPositionZ() + 30.0f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100)) { - Dragon->AddSplineFlag(SPLINEFLAG_FLYING); + Dragon->SetLevitate(true); Dragon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_uiAzureDrakeGUID = Dragon->GetObjectGuid(); } diff --git a/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp b/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp index fe668f2..3d0a9c8 100644 --- a/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp +++ b/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp @@ -364,8 +364,8 @@ struct MANGOS_DLL_DECL boss_sartharionAI : public ScriptedAI { ++uiCountFetchableDragons; pTene->CastSpell(pTene, SPELL_POWER_OF_TENEBRON, false); - pTene->AddSplineFlag(SPLINEFLAG_FLYING); - pTene->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTene->SetLevitate(true); + pTene->SetWalk(false); pTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aTene[0].m_fX, m_aTene[0].m_fY, m_aTene[0].m_fZ); if (!pTene->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) @@ -376,8 +376,8 @@ struct MANGOS_DLL_DECL boss_sartharionAI : public ScriptedAI { ++uiCountFetchableDragons; pShad->CastSpell(pShad, SPELL_POWER_OF_SHADRON, false); - pShad->AddSplineFlag(SPLINEFLAG_FLYING); - pShad->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pShad->SetLevitate(true); + pShad->SetWalk(false); pShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aShad[0].m_fX, m_aShad[0].m_fY, m_aShad[0].m_fZ); if (!pShad->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) @@ -388,8 +388,8 @@ struct MANGOS_DLL_DECL boss_sartharionAI : public ScriptedAI { ++uiCountFetchableDragons; pVesp->CastSpell(pVesp, SPELL_POWER_OF_VESPERON, false); - pVesp->AddSplineFlag(SPLINEFLAG_FLYING); - pVesp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pVesp->SetLevitate(true); + pVesp->SetWalk(false); pVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aVesp[0].m_fX, m_aVesp[0].m_fY, m_aVesp[0].m_fZ); if (!pVesp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) @@ -811,7 +811,7 @@ struct MANGOS_DLL_DECL dummy_dragonAI : public ScriptedAI void JustReachedHome() { - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); } void MovementInform(uint32 uiType, uint32 uiPointId) @@ -833,7 +833,7 @@ struct MANGOS_DLL_DECL dummy_dragonAI : public ScriptedAI { m_creature->GetMotionMaster()->Clear(); m_bCanMoveFree = false; - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); m_creature->SetInCombatWithZone(); return; } @@ -1790,7 +1790,7 @@ struct MANGOS_DLL_DECL mob_flame_tsunamiAI : public ScriptedAI m_creature->SetDisplayId(11686); DoCast(m_creature, SPELL_FLAME_TSUNAMI_DMG_AURA,true); m_creature->setFaction(19); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); m_uiMovementStartTimer = 4000; } diff --git a/scripts/northrend/ruby_sanctum/boss_halion.cpp b/scripts/northrend/ruby_sanctum/boss_halion.cpp index 12e4aa5..bf3ffe3 100644 --- a/scripts/northrend/ruby_sanctum/boss_halion.cpp +++ b/scripts/northrend/ruby_sanctum/boss_halion.cpp @@ -1048,7 +1048,7 @@ struct MANGOS_DLL_DECL mob_orb_carrierAI : public BSWScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); MovementStarted = false; - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_creature->SetSpeedRate(MOVE_RUN, 6.0f); } diff --git a/scripts/northrend/ruby_sanctum/boss_saviana.cpp b/scripts/northrend/ruby_sanctum/boss_saviana.cpp index 620b946..8cc0c9d 100644 --- a/scripts/northrend/ruby_sanctum/boss_saviana.cpp +++ b/scripts/northrend/ruby_sanctum/boss_saviana.cpp @@ -98,13 +98,13 @@ struct MANGOS_DLL_DECL boss_ragefireAI : public BSWScriptedAI m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); m_creature->HandleEmoteCommand(EMOTE_ONESHOT_FLY_SIT_GROUND_UP); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); } else { m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 0); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); } } diff --git a/scripts/northrend/ruby_sanctum/ruby_sanctum.cpp b/scripts/northrend/ruby_sanctum/ruby_sanctum.cpp index 0f4e36f..d7289ab 100644 --- a/scripts/northrend/ruby_sanctum/ruby_sanctum.cpp +++ b/scripts/northrend/ruby_sanctum/ruby_sanctum.cpp @@ -56,7 +56,7 @@ struct MANGOS_DLL_DECL mob_xerestraszaAI : public ScriptedAI m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); pInstance->SetData(TYPE_XERESTRASZA, NOT_STARTED); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->SetSpeedRate(MOVE_WALK, 0.8f); m_creature->SetRespawnDelay(7*DAY); } diff --git a/scripts/northrend/sholazar_basin.cpp b/scripts/northrend/sholazar_basin.cpp index c775123..fdf03d5 100644 --- a/scripts/northrend/sholazar_basin.cpp +++ b/scripts/northrend/sholazar_basin.cpp @@ -17,7 +17,7 @@ /* ScriptData SDName: Sholazar_Basin SD%Complete: 100 -SDComment: Quest support: 12573, 12570, 12580, 12688 +SDComment: Quest support: 12573, 12570, 12580, 12644, 12645, 12688, SDCategory: Sholazar Basin EndScriptData */ @@ -26,6 +26,15 @@ npc_helice npc_injured_rainspeaker npc_mosswalker_victim npc_vekjik - TODO, can be moved to database (already exist) +NPC_HEMET_NESINGWAY +NPC_HADRIUS_HARLOWE +NPC_TAMARA_WOBBLESPROCKET +Tipsy McManus +GO_BARREL_OF_ORANGES +GO_BARREL_OF_PAPAYAS +GO_BARREL_OF_BANANAS +GO_PRESSURE_VALVE +GO_BRAZIER EndContentData */ #include "precompiled.h" @@ -243,6 +252,7 @@ struct MANGOS_DLL_DECL npc_injured_rainspeakerAI : public npc_escortAI if (Player* pPlayer = GetPlayerForEscort()) { DoScriptText(SAY_END_1, m_creature, pPlayer); + pPlayer->AreaExploredOrEventHappens(QUEST_FORTUNATE_MISUNDERSTAND); DoCastSpellIfCan(m_creature, SPELL_ORACLE_INTRO); } break; @@ -463,6 +473,306 @@ bool GossipSelect_npc_vekjik(Player* pPlayer, Creature* pCreature, uint32 uiSend return true; } +/*###################### +# Quest The Taste Test # +######################*/ + +enum TasteTest +{ + SPELL_OFFER_JUNGLE_PUNCH = 51962, + + NPC_HEMET_NESINGWAY = 27986, + NPC_HADRIUS_HARLOWE = 28047, + NPC_TAMARA_WOBBLESPROCKET = 28568 +}; + +int32 HemetText[3] = {-1999791, -1999790, -1999789}; +int32 HadriusText[3] = {-1999788, -1999787, -1999786}; +int32 TamaraText[3] = {-1999785, -1999784, -1999783}; + +struct MANGOS_DLL_DECL mob_taste_testAI : public ScriptedAI +{ + mob_taste_testAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + bool bTasteing; + uint8 Phase; + uint32 m_uiEventTimer; + ObjectGuid m_playersGUID; + + void Reset() + { + bTasteing = false; + Phase = 0; + m_playersGUID.Clear(); + m_uiEventTimer = 5000; + } + + void UpdateAI (const uint32 uiDiff) + { + if (bTasteing) + { + if (m_uiEventTimer <= uiDiff) + { + switch(m_creature->GetEntry()) + { + case NPC_HEMET_NESINGWAY: DoScriptText(HemetText[Phase], m_creature); break; + case NPC_HADRIUS_HARLOWE: DoScriptText(HadriusText[Phase], m_creature); break; + case NPC_TAMARA_WOBBLESPROCKET: DoScriptText(TamaraText[Phase], m_creature); break; + default: break; + } + if (Phase == 2) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playersGUID)) + pPlayer->KilledMonsterCredit(m_creature->GetEntry(), m_creature->GetObjectGuid()); + Reset(); + return; + } + ++Phase; + m_uiEventTimer = 5000; + } else m_uiEventTimer -= uiDiff; + } + } +}; + +bool EffectDummyNPC_mob_taste_test(Unit *pCaster, uint32 spellId, SpellEffectIndex effIndex, Creature *pCreatureTarget) +{ + if (spellId == SPELL_OFFER_JUNGLE_PUNCH && effIndex == EFFECT_INDEX_1 && pCaster->GetTypeId() == TYPEID_PLAYER && pCreatureTarget) + { + if (pCreatureTarget->AI()) + { + ((mob_taste_testAI*)pCreatureTarget->AI())->bTasteing = true; + ((mob_taste_testAI*)pCreatureTarget->AI())->m_playersGUID = pCaster->GetObjectGuid(); + } + } + return true; +} + +CreatureAI* GetAI_mob_taste_test(Creature* pCreature) +{ + return new mob_taste_testAI(pCreature); +} + +/*################################## +#Quest Still at it - Tipsy McManus # +###################################*/ +enum +{ + QUEST_STILL_AT_IT = 12644, + SAY_EVENT_STARTED = -1760000, + SAY_ADD_BANNANAS = -1760001, + SAY_ADD_PAPAYA = -1760002, + SAY_GOOD_JOB_1 = -1760003, + SAY_BRAZIER = -1760004, + SAY_GOOD_JOB_2 = -1760005, + SAY_OPEN_VALVE = -1760006, + SAY_GOOD_JOB_3 = -1760007, + SAY_GOOD_JOB_4 = -1760008, + SAY_EVENT_END = -1760009, + SAY_ADD_ORANGE = -1760010, + SAY_FAIL = -1760011, + GO_JUNGLE_PUNCH = 190643 +}; +#define GOSSIP_TIPSY_MCMANUS "I am ready to start the event." + +int32 GoogJobText[4] = {SAY_GOOD_JOB_1,SAY_GOOD_JOB_2,SAY_GOOD_JOB_3,SAY_GOOD_JOB_4}; + +struct MANGOS_DLL_DECL npc_tipsy_mcmanusAI : public ScriptedAI +{ + npc_tipsy_mcmanusAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + bool bEventCanBeStarted; + bool bEventStarted; + uint32 m_uiStepTimer; + uint32 m_uiEventStartTimer; + uint32 uiPhase; + uint32 uiObjectToClick; + uint32 uiCurrentClickedObject; + uint32 uiPhaseCounter; + /* + banana = 1 + orange = 2 + papaya = 3 + pressure valve = 4 + brazier = 5 + + */ + void Reset() + { + bEventCanBeStarted = false; + bEventStarted = false; + m_uiStepTimer = 10000; + m_uiEventStartTimer = 5000; + uiPhase = 0; + uiObjectToClick = 0; + uiCurrentClickedObject = 0; + uiPhaseCounter = 0; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + bool CheckClickedObject(uint32 uiObjectToClick) + { + if(uiObjectToClick == uiCurrentClickedObject) + return true; + + else return false; + + } + void SayEventText(uint32 uiTextIdentifier) + { + switch(uiTextIdentifier) + { + case 1: DoScriptText(SAY_ADD_BANNANAS, m_creature); break; + case 2: DoScriptText(SAY_ADD_ORANGE, m_creature); break; + case 3: DoScriptText(SAY_ADD_PAPAYA, m_creature); break; + case 4: DoScriptText(SAY_OPEN_VALVE, m_creature); break; + case 5: DoScriptText(SAY_BRAZIER, m_creature); break; + default: break; + } + } + + void UpdateAI (uint32 const uiDiff) + { + if (bEventCanBeStarted) + { + if (m_uiEventStartTimer <= uiDiff && !bEventStarted) + { + uiObjectToClick = urand(1,3); + SayEventText(uiObjectToClick); + m_uiEventStartTimer = 0; + bEventStarted = true; + uiPhase++; + } + else m_uiEventStartTimer -= uiDiff; + + if(bEventStarted) + { + if (m_uiStepTimer <=uiDiff) + { + switch(uiPhase) + { + case 1: + if(CheckClickedObject(uiObjectToClick)) + { + DoScriptText(GoogJobText[urand(0,3)] , m_creature); + uiObjectToClick = urand(1,3); + SayEventText(uiObjectToClick); + + uiPhaseCounter++; + if(uiPhaseCounter == 3){ uiPhase++; uiPhaseCounter=0;} + } + else {Reset(); DoScriptText(SAY_FAIL, m_creature);} + break; + + case 2: + if(CheckClickedObject(uiObjectToClick)) + { + DoScriptText(GoogJobText[urand(0,3)] , m_creature); + uiObjectToClick = urand(4,5); + SayEventText(uiObjectToClick); + uiPhase++; + } + else {Reset(); DoScriptText(SAY_FAIL, m_creature);} + break; + case 3: + if(CheckClickedObject(uiObjectToClick)) + { + DoScriptText(GoogJobText[urand(0,3)] , m_creature); + uiObjectToClick = urand(1,5); + SayEventText(uiObjectToClick); + uiPhaseCounter++; + if(uiPhaseCounter == 6)uiPhase++; + } + else {Reset(); DoScriptText(SAY_FAIL, m_creature);} + break; + case 4: + DoScriptText(SAY_EVENT_END , m_creature); + if(GameObject* pGo = GetClosestGameObjectWithEntry(m_creature, GO_JUNGLE_PUNCH, 15.0f)) + { + pGo->SetRespawnTime(3*MINUTE); //despawn object in ? seconds + pGo->Respawn(); + + Reset(); + } + break; + + default: break; + + } + m_uiStepTimer=5000; + } + else m_uiStepTimer -=uiDiff; + + } + } + } +}; + +CreatureAI* GetAI_npc_tipsy_mcmanus(Creature* pCreature) +{ + return new npc_tipsy_mcmanusAI(pCreature); +}; + +bool GossipHello_npc_tipsy_mcmanus(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_STILL_AT_IT) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TIPSY_MCMANUS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetObjectGuid()); + return true; +} + +bool GossipSelect_npc_tipsy_mcmanus(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + if (npc_tipsy_mcmanusAI* pTipsyAI = dynamic_cast(pCreature->AI())) + { + pTipsyAI->bEventCanBeStarted=true; + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoScriptText(SAY_EVENT_STARTED, pCreature); + } + } + return true; +} + +/*################################ +#Quest Still at it - gameobjects # +#################################*/ +enum +{ + GO_BARREL_OF_ORANGES = 190637, + GO_BARREL_OF_PAPAYAS = 190639, + GO_BARREL_OF_BANANAS = 190638, + GO_PRESSURE_VALVE = 190635, + GO_BRAZIER = 190636, + NPC_TIPSY_MCMANUS = 28566, +}; + +bool GOUse_go_still_at_it_quest(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestStatus(QUEST_STILL_AT_IT) == QUEST_STATUS_INCOMPLETE) + { + if(Creature* pTipsy = GetClosestCreatureWithEntry(pPlayer, NPC_TIPSY_MCMANUS, 30.0f)) + { + if (npc_tipsy_mcmanusAI* pTipsyAI = dynamic_cast(pTipsy->AI())) + { + switch (pGo->GetEntry()) + { + case GO_BARREL_OF_ORANGES: pTipsyAI->uiCurrentClickedObject = 2; break; + case GO_BARREL_OF_PAPAYAS: pTipsyAI->uiCurrentClickedObject = 3; break; + case GO_BARREL_OF_BANANAS: pTipsyAI->uiCurrentClickedObject = 1; break; + case GO_PRESSURE_VALVE: pTipsyAI->uiCurrentClickedObject = 4; break; + case GO_BRAZIER: pTipsyAI->uiCurrentClickedObject = 5; break; + + break; + } + } + } + } + return false; +}; + void AddSC_sholazar_basin() { Script* pNewScript; @@ -491,5 +801,23 @@ void AddSC_sholazar_basin() pNewScript->Name = "npc_vekjik"; pNewScript->pGossipHello = &GossipHello_npc_vekjik; pNewScript->pGossipSelect = &GossipSelect_npc_vekjik; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mob_taste_test"; + pNewScript->GetAI = &GetAI_mob_taste_test; + pNewScript->pEffectDummyNPC = &EffectDummyNPC_mob_taste_test; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_still_at_it_quest"; + pNewScript->pGOUse = &GOUse_go_still_at_it_quest; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_tipsy_mcmanus"; + pNewScript->GetAI = &GetAI_npc_tipsy_mcmanus; + pNewScript->pGossipHello = &GossipHello_npc_tipsy_mcmanus; + pNewScript->pGossipSelect = &GossipSelect_npc_tipsy_mcmanus; pNewScript->RegisterSelf(); } diff --git a/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp b/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp index 6cebe8f..59d727d 100644 --- a/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp +++ b/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp @@ -280,7 +280,7 @@ bool EffectDummyCreature_npc_volkhan_anvil(Unit* pCaster, uint32 uiSpellId, Spel if (pCaster->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) pCaster->GetMotionMaster()->MovementExpired(); - ((Creature*)pCaster)->MonsterMove(fX, fY, fZ, 1); + ((Creature*)pCaster)->MonsterMoveWithSpeed(fX, fY, fZ, 28, true); pCreatureTarget->CastSpell(pCaster, SPELL_TEMPER_DUMMY, false); diff --git a/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp b/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp index 67ec769..f539929 100644 --- a/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp +++ b/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp @@ -111,7 +111,7 @@ struct MANGOS_DLL_DECL boss_sjonnirAI : public ScriptedAI if(m_pInstance) m_pInstance->SetData(TYPE_GRIEF, IN_PROGRESS); -// pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE); +// pSummoned->SetWalk(false); // pSummoned->GetMotionMaster()->MovePoint(0, fX, fY, fZ); } diff --git a/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp b/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp index 0a0436c..234d39c 100644 --- a/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp +++ b/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp @@ -198,12 +198,12 @@ struct MANGOS_DLL_DECL mob_tribuna_controllerAI : public ScriptedAI if (uiPositionCounter == 0) { c->GetMap()->CreatureRelocation((*itr), 927.265f, 333.200f, 218.780f, (*itr)->GetOrientation()); - c->MonsterMove(927.265f, 333.200f, 218.780f, 1); + c->MonsterMoveWithSpeed(927.265f, 333.200f, 218.780f, 24, true); } else { c->GetMap()->CreatureRelocation((*itr), 921.745f, 328.076f, 218.780f, (*itr)->GetOrientation()); - c->MonsterMove(921.745f, 328.076f, 218.780f, 1); + c->MonsterMoveWithSpeed(921.745f, 328.076f, 218.780f, 24, true); } } ++uiPositionCounter; diff --git a/scripts/northrend/ulduar/ulduar/boss_algalon.cpp b/scripts/northrend/ulduar/ulduar/boss_algalon.cpp index 7aa00dc..e6dd773 100644 --- a/scripts/northrend/ulduar/ulduar/boss_algalon.cpp +++ b/scripts/northrend/ulduar/ulduar/boss_algalon.cpp @@ -297,7 +297,7 @@ struct MANGOS_DLL_DECL boss_algalonAI : public ScriptedAI if (m_creature->Attack(pWho, true)) { - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_creature->AddThreat(pWho); m_creature->SetInCombatWith(pWho); pWho->SetInCombatWith(m_creature); @@ -574,8 +574,6 @@ struct MANGOS_DLL_DECL boss_algalonAI : public ScriptedAI m_uiOutroTimer = 5000; break; case 3: - // make boss kneel - m_creature->SetSplineFlags(SPLINEFLAG_UNKNOWN12); if(m_bIsDespawned) { DoScriptText(SAY_DESPAWN1, m_creature); diff --git a/scripts/northrend/ulduar/ulduar/boss_iron_council.cpp b/scripts/northrend/ulduar/ulduar/boss_iron_council.cpp index a8e18ef..094184d 100644 --- a/scripts/northrend/ulduar/ulduar/boss_iron_council.cpp +++ b/scripts/northrend/ulduar/ulduar/boss_iron_council.cpp @@ -426,14 +426,16 @@ struct MANGOS_DLL_DECL boss_brundirAI : public ScriptedAI DoCast(m_creature, m_bIsRegularMode ? SPELL_LIGHTNING_TENDRILS : SPELL_LIGHTNING_TENDRILS_H,true); SetCombatMovement(false); m_creature->GetMotionMaster()->Clear(false); - m_creature->SetHover(true); + m_creature->SetLevitate(true); if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM_PLAYER, 0)) m_creature->GetMotionMaster()->MoveChase(pTarget); m_bIsTendrils = true; m_creature->SetSpeedRate(MOVE_RUN, 0.8f); m_uiTendrils_end_Timer = 40000; m_uiTendrils_Change = 4000; - }else m_uiTendrils_start_Timer -= uiDiff; + } + else + m_uiTendrils_start_Timer -= uiDiff; DoCastSpellIfCan(m_creature, SPELL_STORMSHIELD, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); } diff --git a/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp b/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp index 23aa9a5..12f2760 100644 --- a/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp +++ b/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp @@ -305,7 +305,8 @@ struct MANGOS_DLL_DECL boss_kologarnAI : public ScriptedAI { pRightArm->SetCreatorGuid(m_creature->GetObjectGuid()); pRightArm->EnterVehicle(vehicle, RIGHT_ARM_SLOT); - pRightArm->SendHeartBeat(false); + pRightArm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + pRightArm->SendHeartBeat(); m_uiRightArmGuid = pRightArm->GetObjectGuid(); } } @@ -322,7 +323,8 @@ struct MANGOS_DLL_DECL boss_kologarnAI : public ScriptedAI { pLeftArm->SetCreatorGuid(m_creature->GetObjectGuid()); pLeftArm->EnterVehicle(vehicle, LEFT_ARM_SLOT); - pLeftArm->SendHeartBeat(false); + pLeftArm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + pLeftArm->SendHeartBeat(); m_uiLeftArmGuid = pLeftArm->GetObjectGuid(); } } diff --git a/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp b/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp index 72e8351..55d3379 100644 --- a/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp +++ b/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp @@ -869,8 +869,8 @@ struct MANGOS_DLL_DECL boss_aerial_command_unitAI : public ScriptedAI m_bMustRepair = false; - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 0); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + // m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 0); + // m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); if(m_pInstance) @@ -897,12 +897,14 @@ struct MANGOS_DLL_DECL boss_aerial_command_unitAI : public ScriptedAI { if(m_pInstance->GetData(TYPE_MIMIRON_PHASE) == PHASE_AERIAL) { - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); - m_creature->GetMotionMaster()->MoveIdle(); - SetCombatMovement(false); - m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 7, 0.0f); - m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 7, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); + // m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); + // m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); + // m_creature->GetMotionMaster()->MoveIdle(); + // SetCombatMovement(false); + m_creature->SetLevitate(true); + + //m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 7, 0.0f); + //m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 7, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); } } @@ -963,12 +965,13 @@ struct MANGOS_DLL_DECL boss_aerial_command_unitAI : public ScriptedAI // get the boss down by the magnetic core void SetToGround() { - m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), CENTER_Z, 0); - m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), CENTER_Z, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); + //m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), CENTER_Z, 0); + //m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), CENTER_Z, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); m_bIsGrounded = true; + m_creature->SetLevitate(false); // make boss land - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 0); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + //m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 0); + //m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); m_uiGroundTimer = 20000; } @@ -999,12 +1002,13 @@ struct MANGOS_DLL_DECL boss_aerial_command_unitAI : public ScriptedAI if (m_uiGroundTimer < uiDiff && m_bIsGrounded) { - m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 7, 0.0f); - m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 7, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); + //m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 7, 0.0f); + //m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 7, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); m_bIsGrounded = false; + m_creature->SetLevitate(true); // make boss fly - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); + //m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); + //m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); m_creature->InterruptNonMeleeSpells(true); DoCast(m_creature, SPELL_BOMB_BOT_SUMMON); }else m_uiGroundTimer -= uiDiff; diff --git a/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp index d8dce3a..035058d 100644 --- a/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp +++ b/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -174,7 +174,7 @@ struct MANGOS_DLL_DECL npc_expedition_commanderAI : public ScriptedAI void BeginRazorscaleEvent(Player* pPlayer) { - m_uiPlayerGUID = pPlayer->GetGUID(); + m_uiPlayerGUID = pPlayer->GetObjectGuid(); m_bIsIntro = true; m_uiSpeech_Timer = 3000; m_uiIntro_Phase = 0; @@ -231,7 +231,7 @@ bool GossipHello_npc_expedition_commander(Player* pPlayer, Creature* pCreature) if(pInstance->GetData(TYPE_RAZORSCALE) != DONE) pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetObjectGuid()); return true; } @@ -504,11 +504,9 @@ struct MANGOS_DLL_DECL boss_razorscaleAI : public ScriptedAI uint32 m_uiFlame_Breath_Timer; uint32 m_uiWave_spawn; uint32 m_uiBerserk_Timer; - uint32 m_uiGrounded_Timer; // 8 secs after ground fase is over, adds come - uint32 m_uiGround_Cast; - uint32 m_uiGround_Knockback; + uint32 m_uiGroundStepTimer; + uint32 m_uiGroundStepCount; uint32 m_uiRepairHarpoonTimer; - uint32 m_uiStun_Timer; uint8 m_uiHarpoonsRepaired; uint8 m_uiMaxHarpoons; @@ -539,16 +537,13 @@ struct MANGOS_DLL_DECL boss_razorscaleAI : public ScriptedAI m_uiFlyNo = 0; m_uiHarpoonsUsed = 0; m_uiScorchedDwarves = 0; + m_creature->SetWalk(true); + SetCombatMovement(false); + // make boss fly + m_creature->SetLevitate(true); + m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); - if(m_creature->GetPositionZ() < 435.0f) - { - m_creature->GetMap()->CreatureRelocation(m_creature, PositionLoc[4].x, PositionLoc[4].y, PositionLoc[4].z, 0.0f); - m_creature->SendMonsterMove(PositionLoc[4].x, PositionLoc[4].y, PositionLoc[4].z, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); - } - - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); - m_creature->GetMotionMaster()->MoveConfused(); + m_creature->GetMotionMaster()->MoveIdle(); if (Creature* pCommander = m_pInstance->GetSingleCreatureFromStorage(NPC_COMMANDER)) pCommander->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); @@ -566,11 +561,7 @@ struct MANGOS_DLL_DECL boss_razorscaleAI : public ScriptedAI { if (m_pInstance) m_pInstance->SetData(TYPE_RAZORSCALE, IN_PROGRESS); - - SetCombatMovement(false); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->GetMap()->CreatureRelocation(m_creature, PositionLoc[4].x, PositionLoc[4].y, PositionLoc[4].z, 0.0f); - m_creature->SendMonsterMove(PositionLoc[4].x, PositionLoc[4].y, PositionLoc[4].z, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); + m_creature->MonsterMoveWithSpeed(PositionLoc[4].x, PositionLoc[4].y, PositionLoc[4].z, 28); } void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) @@ -672,36 +663,34 @@ struct MANGOS_DLL_DECL boss_razorscaleAI : public ScriptedAI if(Creature* pCommander = m_pInstance->GetSingleCreatureFromStorage(NPC_COMMANDER)) DoScriptText(SAY_GROUND, pCommander); - m_creature->GetMap()->CreatureRelocation(m_creature, PositionLoc[3].x, PositionLoc[3].y, PositionLoc[3].z, 1.5); - m_creature->SendMonsterMove(PositionLoc[3].x, PositionLoc[3].y, PositionLoc[3].z, SPLINETYPE_FACINGSPOT, m_creature->GetSplineFlags(), 1); + // make boss land + m_creature->SetLevitate(false); + m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, 0); + + // ground position + m_creature->MonsterMoveWithSpeed(PositionLoc[3].x, PositionLoc[3].y, PositionLoc[3].z, 40.0f, false, true); // timers m_uiHarpoonsUsed = 0; + m_uiGroundStepTimer = 2000; + m_uiGroundStepCount = 0; m_uiRazorscalePhase = PHASE_GROUND; - m_uiGrounded_Timer = 90000; - m_uiGround_Cast = 90000; - m_uiStun_Timer = 2000; - m_uiGround_Knockback= 90000; - // make boss land - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 0); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); } void SetToAirPhase() { if(Creature* pCommander = m_pInstance->GetSingleCreatureFromStorage(NPC_COMMANDER)) DoScriptText(SAY_FIRES_EXTINGUISH, pCommander); - m_creature->GetMap()->CreatureRelocation(m_creature, PositionLoc[4].x, PositionLoc[4].y, PositionLoc[4].z, 0.0f); - m_creature->SendMonsterMove(PositionLoc[4].x, PositionLoc[4].y, PositionLoc[4].z, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); + // make boss fly + m_creature->SetLevitate(true); + m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); m_uiRazorscalePhase = PHASE_AIR; m_uiFireball_Timer = 10000; m_uiDevouring_Flame_Timer = 18000; m_uiWave_spawn = urand(5000, 10000); m_uiRepairHarpoonTimer = 50000; m_uiHarpoonsRepaired = 0; - // make boss fly - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); + // achiev counter m_uiFlyNo++; if (m_uiFlyNo > 1) @@ -724,16 +713,14 @@ struct MANGOS_DLL_DECL boss_razorscaleAI : public ScriptedAI m_uiFlame_Breath_Timer = 6000; //every 14 SetCombatMovement(true); BreakHarpoons(); - - // make boss land - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 0); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + // make boss land + m_creature->SetLevitate(false); + m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, 0); } void UpdateAI(const uint32 uiDiff) { - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; // make boss land at 50% hp @@ -756,8 +743,7 @@ struct MANGOS_DLL_DECL boss_razorscaleAI : public ScriptedAI // air position check (sometimes it falls to the ground like a rock if(m_creature->GetPositionZ() < 440.0f) { - m_creature->GetMap()->CreatureRelocation(m_creature, PositionLoc[4].x, PositionLoc[4].y, PositionLoc[4].z, 0.0f); - m_creature->SendMonsterMove(PositionLoc[4].x, PositionLoc[4].y, PositionLoc[4].z, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); + m_creature->MonsterMoveWithSpeed(PositionLoc[4].x, PositionLoc[4].y, PositionLoc[4].z, 28); } // air spells @@ -766,62 +752,67 @@ struct MANGOS_DLL_DECL boss_razorscaleAI : public ScriptedAI if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) DoCast(target, m_bIsRegularMode ? SPELL_FIREBALL : SPELL_FIREBALL_H); m_uiFireball_Timer = 2000; - }else m_uiFireball_Timer -= uiDiff; + }else + m_uiFireball_Timer -= uiDiff; if (m_uiDevouring_Flame_Timer < uiDiff) { if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) DoCast(target, DEVOURING_FLAME_VISUAL); m_uiDevouring_Flame_Timer = 12000; - }else m_uiDevouring_Flame_Timer -= uiDiff; + }else + m_uiDevouring_Flame_Timer -= uiDiff; // repair harpoons if (m_uiRepairHarpoonTimer < uiDiff && m_uiHarpoonsRepaired <= m_uiMaxHarpoons) { RepairHarpoons(); - m_uiHarpoonsRepaired += 1; + ++m_uiHarpoonsRepaired; DoScriptText(EMOTE_HARPOON, m_creature); m_uiRepairHarpoonTimer = 20000; } - else m_uiRepairHarpoonTimer -= uiDiff; + else + m_uiRepairHarpoonTimer -= uiDiff; break; } case PHASE_GROUND: - { - // Switch from Ground to Air Phase - if (m_uiGrounded_Timer < uiDiff) - { - SetToAirPhase(); - return; - - }else m_uiGrounded_Timer -= uiDiff; - - if (m_uiStun_Timer < uiDiff) - { - DoCast(m_creature, SPELL_STUN, true); - m_uiStun_Timer = 90000; - m_uiGround_Cast = 33000; - }else m_uiStun_Timer -= uiDiff; - - if (m_uiGround_Cast < uiDiff) - { - if (Creature* pCommander = m_pInstance->GetSingleCreatureFromStorage(NPC_COMMANDER)) - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pCommander->GetGUID()); - m_creature->RemoveAurasDueToSpell(SPELL_STUN); - DoScriptText(EMOTE_DEEP_BREATH, m_creature); - DoCast(m_creature, m_bIsRegularMode ? SPELL_FLAME_BREATH : SPELL_FLAME_BREATH_H); - m_uiGround_Cast = 90000; - m_uiGround_Knockback = 7000; - }else m_uiGround_Cast -= uiDiff; - - if (m_uiGround_Knockback < uiDiff) + { + if (m_uiGroundStepTimer < uiDiff) { - DoCast(m_creature, SPELL_WING_BUFFET); - BreakHarpoons(); - m_uiGround_Knockback = 90000; - m_uiGrounded_Timer = 4000; - }else m_uiGround_Knockback -= uiDiff; + switch (m_uiGroundStepCount) + { + case 0: + DoCast(m_creature, SPELL_STUN, true); + m_uiGroundStepTimer = 33000; + break; + case 1: + if (Creature* pCommander = m_pInstance->GetSingleCreatureFromStorage(NPC_COMMANDER)) + m_creature->SetFacingToObject(pCommander); + m_creature->RemoveAurasDueToSpell(SPELL_STUN); + DoScriptText(EMOTE_DEEP_BREATH, m_creature); + DoCast(m_creature, m_bIsRegularMode ? SPELL_FLAME_BREATH : SPELL_FLAME_BREATH_H); + m_uiGroundStepTimer = 7000; + break; + case 2: + DoCast(m_creature, SPELL_WING_BUFFET); + BreakHarpoons(); + m_uiGroundStepTimer = 4000; + break; + case 3: + SetToAirPhase(); + m_uiGroundStepTimer = 4000; + break; + default: // debug next action Fly + m_uiGroundStepCount = 2; + m_creature->RemoveAurasDueToSpell(SPELL_STUN); + m_uiGroundStepTimer = 4000; + break; + } + ++m_uiGroundStepCount; + } + else + m_uiGroundStepTimer -= uiDiff; break; } @@ -831,26 +822,34 @@ struct MANGOS_DLL_DECL boss_razorscaleAI : public ScriptedAI { DoCast(m_creature->getVictim(), DEVOURING_FLAME_VISUAL); m_uiDevouring_Flame_Timer = 12000; - }else m_uiDevouring_Flame_Timer -= uiDiff; + } + else + m_uiDevouring_Flame_Timer -= uiDiff; if (m_uiFuse_Armor_Timer < uiDiff) { DoCast(m_creature->getVictim(), SPELL_FUSE_ARMOR, true); m_uiFuse_Armor_Timer = 13000; - } else m_uiFuse_Armor_Timer -= uiDiff; + } + else + m_uiFuse_Armor_Timer -= uiDiff; if (m_uiFlame_Buffet_Timer < uiDiff) { DoCast(m_creature, m_bIsRegularMode ? SPELL_FLAME_BUFFET : SPELL_FLAME_BUFFET_H , true); m_uiFlame_Buffet_Timer = 13000; - }else m_uiFlame_Buffet_Timer -= uiDiff; + } + else + m_uiFlame_Buffet_Timer -= uiDiff; if (m_uiFlame_Breath_Timer < uiDiff) { DoCast(m_creature, m_bIsRegularMode ? SPELL_FLAME_BREATH : SPELL_FLAME_BREATH_H); DoScriptText(EMOTE_DEEP_BREATH, m_creature); m_uiFlame_Breath_Timer = 14000; - }else m_uiFlame_Breath_Timer -= uiDiff; + } + else + m_uiFlame_Breath_Timer -= uiDiff; DoMeleeAttackIfReady(); @@ -872,14 +871,17 @@ struct MANGOS_DLL_DECL boss_razorscaleAI : public ScriptedAI molAI->m_bIsSentinel = true; } m_uiWave_spawn = urand(40000, 50000); - }else m_uiWave_spawn -= uiDiff; + } + else + m_uiWave_spawn -= uiDiff; // berserk if (m_uiBerserk_Timer < uiDiff) { - DoCast(m_creature, SPELL_BERSERK,true); - m_uiBerserk_Timer = 9999999; - }else m_uiBerserk_Timer -= uiDiff; + DoCastSpellIfCan(m_creature, SPELL_BERSERK, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + } + else + m_uiBerserk_Timer -= uiDiff; if (m_creature->GetDistance2d(HOME_X, HOME_Y) > 100) EnterEvadeMode(); diff --git a/scripts/northrend/ulduar/ulduar/boss_thorim.cpp b/scripts/northrend/ulduar/ulduar/boss_thorim.cpp index 1fed1d0..ed208a3 100644 --- a/scripts/northrend/ulduar/ulduar/boss_thorim.cpp +++ b/scripts/northrend/ulduar/ulduar/boss_thorim.cpp @@ -924,7 +924,7 @@ struct MANGOS_DLL_DECL boss_thorimAI : public ScriptedAI Sif->setFaction(14); DoScriptText(SAY_SIF_EVENT, Sif); Sif->SetInCombatWithZone(); - Sif->MonsterJump(2134.719f, -263.148f, 419.846f, 0, 30, 30); + Sif->MonsterMoveJump(2134.719f, -263.148f, 419.846f, 0, 30, 30); if (m_pInstance) m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_SIFFED, true); } @@ -942,7 +942,6 @@ struct MANGOS_DLL_DECL boss_thorimAI : public ScriptedAI if(m_uiJumpTimer < uiDiff && m_bIsPhaseOneEnd) { m_creature->GetMap()->CreatureRelocation(m_creature, 2134.719f, -263.148f, 419.846f, 0); - m_creature->SendMonsterMove(2134.719f, -263.148f, 419.846f, SPLINETYPE_NORMAL, SPLINEFLAG_DONE, 0); m_creature->Relocate(2134.719f, -263.148f, 419.846f, 0); m_creature->GetMotionMaster()->MovePoint(0, 2134.719f, -263.148f, 419.846f, false); m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); diff --git a/scripts/northrend/ulduar/ulduar/boss_vezax.cpp b/scripts/northrend/ulduar/ulduar/boss_vezax.cpp index eb6fe03..e6e518d 100644 --- a/scripts/northrend/ulduar/ulduar/boss_vezax.cpp +++ b/scripts/northrend/ulduar/ulduar/boss_vezax.cpp @@ -164,7 +164,7 @@ struct MANGOS_DLL_DECL boss_vezaxAI : public ScriptedAI (*iter)->RemoveAllAuras(); (*iter)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); (*iter)->SetSpeedRate(MOVE_RUN, 3.0f); - (*iter)->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + (*iter)->SetWalk(false); (*iter)->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); } } diff --git a/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp b/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp index 983852c..25732e3 100644 --- a/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp +++ b/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp @@ -1399,9 +1399,8 @@ struct MANGOS_DLL_DECL boss_saraAI : public ScriptedAI m_creature->SetHealth(m_creature->GetMaxHealth()); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); - m_creature->SetSplineFlags(SPLINEFLAG_FLYING); - m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), 329.397f, 5.9f); - m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), 329.397f, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); + m_creature->SetLevitate(true); + m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), 329.397f); } void KilledUnit(Unit* pVictim) @@ -1538,7 +1537,6 @@ struct MANGOS_DLL_DECL boss_saraAI : public ScriptedAI m_creature->GetMotionMaster()->MoveIdle(); SetCombatMovement(false); m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), 329.397f, 5.9f); - m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), 329.397f, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); ++m_uiIntro_Phase; m_uiSpeech_Timer = 8000; break; @@ -1657,7 +1655,7 @@ struct MANGOS_DLL_DECL boss_saraAI : public ScriptedAI DoCast(m_creature, SPELL_SHADOWY_BARRIER); m_creature->SetHealth(m_creature->GetMaxHealth()); m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 10, 5.9f); - m_creature->SendMonsterMove(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 10, SPLINETYPE_NORMAL, m_creature->GetSplineFlags(), 1); + m_creature->GetMotionMaster()->MovePoint(0,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 10, false); if(Creature* pYogg = m_pInstance->GetSingleCreatureFromStorage(NPC_YOGGSARON)) ((boss_yogg_saronAI*)pYogg->AI())->StartSecondPhase(); m_uiPhaseYellTimer = 30000 + urand(5000, 10000); diff --git a/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp index 1adc2cb..ac16a2a 100644 --- a/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp +++ b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp @@ -128,9 +128,7 @@ struct MANGOS_DLL_DECL boss_svalaAI : public ScriptedAI void Aggro(Unit* pWho) { - if (m_creature->HasSplineFlag(SPLINEFLAG_FLYING)) - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); - + m_creature->SetLevitate(false); DoScriptText(SAY_AGGRO, m_creature); } @@ -184,10 +182,8 @@ struct MANGOS_DLL_DECL boss_svalaAI : public ScriptedAI float fX, fZ, fY; m_creature->GetRespawnCoord(fX, fY, fZ); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); - - m_creature->SendMonsterMoveWithSpeed(fX, fY, fZ + 5.0f, m_uiIntroTimer); - m_creature->GetMap()->CreatureRelocation(m_creature, fX, fY, fZ + 5.0f, m_creature->GetOrientation()); + m_creature->SetLevitate(true); + m_creature->GetMotionMaster()->MovePoint(0, fX, fY, fZ + 5.0f); } void UpdateAI(const uint32 uiDiff) diff --git a/scripts/northrend/violet_hold/boss_erekem.cpp b/scripts/northrend/violet_hold/boss_erekem.cpp index 1a73ddc..3728450 100644 --- a/scripts/northrend/violet_hold/boss_erekem.cpp +++ b/scripts/northrend/violet_hold/boss_erekem.cpp @@ -154,7 +154,7 @@ struct MANGOS_DLL_DECL boss_erekemAI : public ScriptedAI void StartMovement(uint32 id) { m_creature->GetMotionMaster()->MovePoint(id, PortalLoc[id].x, PortalLoc[id].y, PortalLoc[id].z); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetInCombatWithZone(); @@ -323,7 +323,7 @@ struct MANGOS_DLL_DECL mob_erekem_guardAI : public ScriptedAI void StartMovement(uint32 id) { m_creature->GetMotionMaster()->MovePoint(id, PortalLoc[id].x, PortalLoc[id].y, PortalLoc[id].z); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); MovementStarted = true; diff --git a/scripts/northrend/violet_hold/boss_ichoron.cpp b/scripts/northrend/violet_hold/boss_ichoron.cpp index 616afbf..0f7ec66 100644 --- a/scripts/northrend/violet_hold/boss_ichoron.cpp +++ b/scripts/northrend/violet_hold/boss_ichoron.cpp @@ -189,7 +189,7 @@ struct MANGOS_DLL_DECL boss_ichoronAI : public ScriptedAI void StartMovement(uint32 id) { m_creature->GetMotionMaster()->MovePoint(id, PortalLoc[id].x, PortalLoc[id].y, PortalLoc[id].z); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); MovementStarted = true; diff --git a/scripts/northrend/violet_hold/boss_lavanthor.cpp b/scripts/northrend/violet_hold/boss_lavanthor.cpp index 7ae55d8..42aa2bc 100644 --- a/scripts/northrend/violet_hold/boss_lavanthor.cpp +++ b/scripts/northrend/violet_hold/boss_lavanthor.cpp @@ -106,7 +106,7 @@ struct MANGOS_DLL_DECL boss_lavanthorAI : public ScriptedAI void StartMovement(uint32 id) { m_creature->GetMotionMaster()->MovePoint(id, PortalLoc[id].x, PortalLoc[id].y, PortalLoc[id].z); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); MovementStarted = true; diff --git a/scripts/northrend/violet_hold/boss_moragg.cpp b/scripts/northrend/violet_hold/boss_moragg.cpp index 6cf1d00..361da20 100644 --- a/scripts/northrend/violet_hold/boss_moragg.cpp +++ b/scripts/northrend/violet_hold/boss_moragg.cpp @@ -103,7 +103,7 @@ struct MANGOS_DLL_DECL boss_moraggAI : public ScriptedAI void StartMovement(uint32 id) { m_creature->GetMotionMaster()->MovePoint(id, PortalLoc[id].x, PortalLoc[id].y, PortalLoc[id].z); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); MovementStarted = true; diff --git a/scripts/northrend/violet_hold/boss_xevozz.cpp b/scripts/northrend/violet_hold/boss_xevozz.cpp index 713b341..70d86e0 100644 --- a/scripts/northrend/violet_hold/boss_xevozz.cpp +++ b/scripts/northrend/violet_hold/boss_xevozz.cpp @@ -151,7 +151,7 @@ struct MANGOS_DLL_DECL boss_xevozzAI : public ScriptedAI void StartMovement(uint32 id) { m_creature->GetMotionMaster()->MovePoint(id, PortalLoc[id].x, PortalLoc[id].y, PortalLoc[id].z); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); MovementStarted = true; diff --git a/scripts/northrend/violet_hold/boss_zuramat.cpp b/scripts/northrend/violet_hold/boss_zuramat.cpp index 548a5b8..2f383a5 100644 --- a/scripts/northrend/violet_hold/boss_zuramat.cpp +++ b/scripts/northrend/violet_hold/boss_zuramat.cpp @@ -151,7 +151,7 @@ struct MANGOS_DLL_DECL boss_zuramatAI : public ScriptedAI void StartMovement(uint32 id) { m_creature->GetMotionMaster()->MovePoint(id, PortalLoc[id].x, PortalLoc[id].y, PortalLoc[id].z); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); MovementStarted = true; diff --git a/scripts/northrend/violet_hold/violet_hold.cpp b/scripts/northrend/violet_hold/violet_hold.cpp index 7863822..6b13cad 100644 --- a/scripts/northrend/violet_hold/violet_hold.cpp +++ b/scripts/northrend/violet_hold/violet_hold.cpp @@ -196,7 +196,7 @@ struct MANGOS_DLL_DECL mob_vh_dragonsAI : public ScriptedAI } WayPoint = WayPointList.begin(); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); IsWalking = true; MovementStarted = true; } @@ -299,7 +299,7 @@ struct MANGOS_DLL_DECL mob_vh_dragonsAI : public ScriptedAI IsWalking = false; WayPointList.clear(); m_creature->GetMotionMaster()->Clear(false); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); DoCast(pDoorSeal2, SPELL_CORRUPT); m_pInstance->SetData(TYPE_DOOR,SPECIAL); } @@ -962,7 +962,7 @@ struct MANGOS_DLL_DECL npc_azure_saboteurAI : public ScriptedAI m_bIsActiving = false; m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_uiDisruptionCounter = 0; m_uiDisruptionsCount = 0; m_uiDisruption_Timer = 1000; diff --git a/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp b/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp index bf900b3..ca0c766 100644 --- a/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp +++ b/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp @@ -35,9 +35,9 @@ EndScriptData */ #define EMOTE_DARK_SHELL -1557014 #define SPELL_VOID_BLAST 32325 -#define H_SPELL_VOID_BLAST 38760 +#define SPELL_VOID_BLAST_H 38760 #define SPELL_DARK_SHELL 32358 -#define H_SPELL_DARK_SHELL 38759 +#define SPELL_DARK_SHELL_H 38759 struct MANGOS_DLL_DECL boss_pandemoniusAI : public ScriptedAI { @@ -89,7 +89,7 @@ struct MANGOS_DLL_DECL boss_pandemoniusAI : public ScriptedAI { if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) { - DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_VOID_BLAST : H_SPELL_VOID_BLAST); + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_VOID_BLAST : SPELL_VOID_BLAST_H); VoidBlast_Timer = 500; ++VoidBlast_Counter; } @@ -110,7 +110,7 @@ struct MANGOS_DLL_DECL boss_pandemoniusAI : public ScriptedAI DoScriptText(EMOTE_DARK_SHELL, m_creature); - DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_DARK_SHELL : H_SPELL_DARK_SHELL); + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_DARK_SHELL : SPELL_DARK_SHELL_H); DarkShell_Timer = 20000; }else DarkShell_Timer -= diff; } diff --git a/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp index f32459e..bb6a2ea 100644 --- a/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp +++ b/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp @@ -23,37 +23,38 @@ EndScriptData */ #include "precompiled.h" -#define SAY_SUMMON -1556000 - -#define SAY_AGGRO_1 -1556001 -#define SAY_AGGRO_2 -1556002 -#define SAY_AGGRO_3 -1556003 - -#define SAY_SLAY_1 -1556004 -#define SAY_SLAY_2 -1556005 - -#define SAY_DEATH -1556006 - -#define SPELL_FROST_SHOCK 37865 -#define SPELL_FLAME_SHOCK 34354 -#define SPELL_SHADOW_SHOCK 30138 -#define SPELL_ARCANE_SHOCK 37132 - -#define SPELL_CHAIN_LIGHTNING 39945 - -#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 -#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 -#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 -#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 - -#define SPELL_FLAME_BUFFET 33526 -#define H_SPELL_FLAME_BUFFET 38141 -#define SPELL_ARCANE_BUFFET 33527 -#define H_SPELL_ARCANE_BUFFET 38138 -#define SPELL_FROST_BUFFET 33528 -#define H_SPELL_FROST_BUFFET 38142 -#define SPELL_SHADOW_BUFFET 33529 -#define H_SPELL_SHADOW_BUFFET 38143 +enum +{ + SAY_SUMMON = -1556000, + SAY_AGGRO_1 = -1556001, + SAY_AGGRO_2 = -1556002, + SAY_AGGRO_3 = -1556003, + SAY_SLAY_1 = -1556004, + SAY_SLAY_2 = -1556005, + SAY_DEATH = -1556006, + + // TODO Heroic spells (shock, chain lightning) missing, unknown if IDs are correct + SPELL_FROST_SHOCK = 37865, + SPELL_FLAME_SHOCK = 34354, + SPELL_SHADOW_SHOCK = 30138, + SPELL_ARCANE_SHOCK = 37132, + + SPELL_CHAIN_LIGHTNING = 39945, + + SPELL_SUMMON_SYTH_FIRE = 33537, // Spawns 19203 + SPELL_SUMMON_SYTH_ARCANE = 33538, // Spawns 19205 + SPELL_SUMMON_SYTH_FROST = 33539, // Spawns 19204 + SPELL_SUMMON_SYTH_SHADOW = 33540, // Spawns 19206 + + SPELL_FLAME_BUFFET = 33526, + SPELL_FLAME_BUFFET_H = 38141, + SPELL_ARCANE_BUFFET = 33527, + SPELL_ARCANE_BUFFET_H = 38138, + SPELL_FROST_BUFFET = 33528, + SPELL_FROST_BUFFET_H = 38142, + SPELL_SHADOW_BUFFET = 33529, + SPELL_SHADOW_BUFFET_H = 38143, +}; struct MANGOS_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI { @@ -238,7 +239,7 @@ struct MANGOS_DLL_DECL mob_syth_fireAI : public ScriptedAI if (flamebuffet_timer < diff) { if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) - DoCastSpellIfCan(target, m_bIsRegularMode ? H_SPELL_FLAME_BUFFET : SPELL_FLAME_BUFFET); + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_FLAME_BUFFET : SPELL_FLAME_BUFFET_H); flamebuffet_timer = 5000; @@ -288,7 +289,7 @@ struct MANGOS_DLL_DECL mob_syth_arcaneAI : public ScriptedAI if (arcanebuffet_timer < diff) { if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) - DoCastSpellIfCan(target, m_bIsRegularMode ? H_SPELL_ARCANE_BUFFET : SPELL_ARCANE_BUFFET); + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_ARCANE_BUFFET : SPELL_ARCANE_BUFFET_H); arcanebuffet_timer = 5000; }else arcanebuffet_timer -= diff; @@ -337,7 +338,7 @@ struct MANGOS_DLL_DECL mob_syth_frostAI : public ScriptedAI if (frostbuffet_timer < diff) { if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) - DoCastSpellIfCan(target, m_bIsRegularMode ? H_SPELL_FROST_BUFFET : SPELL_FROST_BUFFET); + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_FROST_BUFFET : SPELL_FROST_BUFFET_H); frostbuffet_timer = 5000; }else frostbuffet_timer -= diff; @@ -386,7 +387,7 @@ struct MANGOS_DLL_DECL mob_syth_shadowAI : public ScriptedAI if (shadowbuffet_timer < diff) { if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) - DoCastSpellIfCan(target, m_bIsRegularMode ? H_SPELL_SHADOW_BUFFET : SPELL_SHADOW_BUFFET); + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_SHADOW_BUFFET : SPELL_SHADOW_BUFFET_H); shadowbuffet_timer = 5000; }else shadowbuffet_timer -= diff; diff --git a/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp index 688c3ce..dfb9ec5 100644 --- a/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp +++ b/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp @@ -24,32 +24,35 @@ EndScriptData */ #include "precompiled.h" #include "shadow_labyrinth.h" -#define SPELL_INCITE_CHAOS 33676 -#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party -#define SPELL_CHARGE 33709 -#define SPELL_WAR_STOMP 33707 - -#define SAY_INTRO1 -1555008 -#define SAY_INTRO2 -1555009 -#define SAY_INTRO3 -1555010 -#define SAY_AGGRO1 -1555011 -#define SAY_AGGRO2 -1555012 -#define SAY_AGGRO3 -1555013 -#define SAY_SLAY1 -1555014 -#define SAY_SLAY2 -1555015 -#define SAY_HELP -1555016 -#define SAY_DEATH -1555017 - -#define SAY2_INTRO1 -1555018 -#define SAY2_INTRO2 -1555019 -#define SAY2_INTRO3 -1555020 -#define SAY2_AGGRO1 -1555021 -#define SAY2_AGGRO2 -1555022 -#define SAY2_AGGRO3 -1555023 -#define SAY2_SLAY1 -1555024 -#define SAY2_SLAY2 -1555025 -#define SAY2_HELP -1555026 -#define SAY2_DEATH -1555027 +enum +{ + SPELL_INCITE_CHAOS = 33676, + SPELL_INCITE_CHAOS_B = 33684, // Debuff applied to each member of party + SPELL_CHARGE = 33709, + SPELL_WAR_STOMP = 33707, + + SAY_INTRO1 = -1555008, + SAY_INTRO2 = -1555009, + SAY_INTRO3 = -1555010, + SAY_AGGRO1 = -1555011, + SAY_AGGRO2 = -1555012, + SAY_AGGRO3 = -1555013, + SAY_SLAY1 = -1555014, + SAY_SLAY2 = -1555015, + SAY_HELP = -1555016, + SAY_DEATH = -1555017, + + SAY2_INTRO1 = -1555018, + SAY2_INTRO2 = -1555019, + SAY2_INTRO3 = -1555020, + SAY2_AGGRO1 = -1555021, + SAY2_AGGRO2 = -1555022, + SAY2_AGGRO3 = -1555023, + SAY2_SLAY1 = -1555024, + SAY2_SLAY2 = -1555025, + SAY2_HELP = -1555026, + SAY2_DEATH = -1555027, +}; struct MANGOS_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI { @@ -61,30 +64,28 @@ struct MANGOS_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI ScriptedInstance* m_pInstance; - bool InciteChaos; - uint32 InciteChaos_Timer; - uint32 InciteChaosWait_Timer; - uint32 Charge_Timer; - uint32 Knockback_Timer; + bool m_bInciteChaos; + uint32 m_uiInciteChaosTimer; + uint32 m_uiInciteChaosWaitTimer; + uint32 m_uiChargeTimer; + uint32 m_uiKnockbackTimer; void Reset() { - InciteChaos = false; - InciteChaos_Timer = 20000; - InciteChaosWait_Timer = 15000; - Charge_Timer = 5000; - Knockback_Timer = 15000; - - if (m_pInstance) - m_pInstance->SetData(TYPE_INCITER, NOT_STARTED); + m_bInciteChaos = false; + m_uiInciteChaosTimer = 20000; + m_uiInciteChaosWaitTimer = 15000; + m_uiChargeTimer = 5000; + m_uiKnockbackTimer = 15000; + SetCombatMovement(true); } - void KilledUnit(Unit *victim) + void KilledUnit(Unit* pVictim) { DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); } - void JustDied(Unit *victim) + void JustDied(Unit* pKiller) { DoScriptText(SAY_DEATH, m_creature); @@ -92,7 +93,7 @@ struct MANGOS_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI m_pInstance->SetData(TYPE_INCITER, DONE); } - void Aggro(Unit *who) + void Aggro(Unit* pWho) { switch(urand(0, 2)) { @@ -105,57 +106,77 @@ struct MANGOS_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI m_pInstance->SetData(TYPE_INCITER, IN_PROGRESS); } - void UpdateAI(const uint32 diff) + void JustReachedHome() + { + + if (m_pInstance) + m_pInstance->SetData(TYPE_INCITER, FAIL); + } + + void UpdateAI(const uint32 uiDiff) { - //Return since we have no target + // Return since we have no pTarget if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; - if (InciteChaos) + if (m_bInciteChaos) { - if (InciteChaosWait_Timer < diff) + if (m_uiInciteChaosWaitTimer < uiDiff) { - InciteChaos = false; - InciteChaosWait_Timer = 15000; - }else InciteChaosWait_Timer -= diff; + m_bInciteChaos = false; + m_uiInciteChaosWaitTimer = 15000; + SetCombatMovement(true); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + else + m_uiInciteChaosWaitTimer -= uiDiff; return; } - if (InciteChaos_Timer < diff) + if (m_uiInciteChaosTimer < uiDiff) { - DoCastSpellIfCan(m_creature, SPELL_INCITE_CHAOS); - - std::vector vGuids; - m_creature->FillGuidsListFromThreatList(vGuids); - for (std::vector::const_iterator itr = vGuids.begin();itr != vGuids.end(); ++itr) + if (DoCastSpellIfCan(m_creature, SPELL_INCITE_CHAOS) == CAST_OK) { - Unit* target = m_creature->GetMap()->GetUnit(*itr); - - if (target && target->GetTypeId() == TYPEID_PLAYER) - target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); + std::vector vGuids; + m_creature->FillGuidsListFromThreatList(vGuids); + for (std::vector::const_iterator itr = vGuids.begin();itr != vGuids.end(); ++itr) + { + Unit* pTarget = m_creature->GetMap()->GetUnit(*itr); + + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + pTarget->CastSpell(pTarget, SPELL_INCITE_CHAOS_B, true, NULL, NULL, m_creature->GetObjectGuid()); + } + + DoResetThreat(); + m_bInciteChaos = true; + m_uiInciteChaosTimer = 40000; + SetCombatMovement(false); + m_creature->StopMoving(); + return; } + } + else + m_uiInciteChaosTimer -= uiDiff; - DoResetThreat(); - InciteChaos = true; - InciteChaos_Timer = 40000; - return; - }else InciteChaos_Timer -= diff; - - //Charge_Timer - if (Charge_Timer < diff) + // Charge Timer + if (m_uiChargeTimer < uiDiff) { - if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - DoCastSpellIfCan(target, SPELL_CHARGE); - Charge_Timer = urand(15000, 25000); - }else Charge_Timer -= diff; + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (pTarget && DoCastSpellIfCan(pTarget, SPELL_CHARGE) == CAST_OK) + m_uiChargeTimer = urand(15000, 25000); + } + else + m_uiChargeTimer -= uiDiff; - //Knockback_Timer - if (Knockback_Timer < diff) + // Knockback Timer + if (m_uiKnockbackTimer < uiDiff) { - DoCastSpellIfCan(m_creature, SPELL_WAR_STOMP); - Knockback_Timer = urand(18000, 24000); - }else Knockback_Timer -= diff; + if (DoCastSpellIfCan(m_creature, SPELL_WAR_STOMP) == CAST_OK) + m_uiKnockbackTimer = urand(18000, 24000); + } + else + m_uiKnockbackTimer -= uiDiff; DoMeleeAttackIfReady(); } diff --git a/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp index 12ac2e2..2b8d4ee 100644 --- a/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ b/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -43,8 +43,8 @@ EndScriptData */ #define SPELL_SUMMON_VOIDWALKER_D 33585 #define SPELL_SUMMON_VOIDWALKER_E 33586 #define SPELL_RAIN_OF_FIRE 33617 -#define H_SPELL_RAIN_OF_FIRE 39363 -#define H_SPELL_BANISH 38791 +#define SPELL_RAIN_OF_FIRE_H 39363 +#define SPELL_BANISH_H 38791 #define ENTRY_VOID_PORTAL 19224 #define ENTRY_VOID_TRAVELER 19226 @@ -170,7 +170,7 @@ struct MANGOS_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI } Teleport = false; - DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_RAIN_OF_FIRE : H_SPELL_RAIN_OF_FIRE); + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_RAIN_OF_FIRE : SPELL_RAIN_OF_FIRE_H); Teleport_Timer = 1000; }else Teleport_Timer -= diff; @@ -210,7 +210,7 @@ struct MANGOS_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI if (Banish_Timer < diff) { if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) - DoCastSpellIfCan(target,H_SPELL_BANISH); + DoCastSpellIfCan(target,SPELL_BANISH_H); Banish_Timer = 35000; }else Banish_Timer -= diff; } diff --git a/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp index 9a1e070..fde1d5d 100644 --- a/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ b/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -67,7 +67,8 @@ void instance_shadow_labyrinth::OnCreatureCreate(Creature* pCreature) switch(pCreature->GetEntry()) { case NPC_VORPIL: - m_mNpcEntryGuidStore[NPC_VORPIL] = pCreature->GetObjectGuid(); + case NPC_HELLMAW: + m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid(); break; case NPC_FEL_OVERSEER: ++m_uiFelOverseerCount; // TODO should actually only count alive ones @@ -103,6 +104,14 @@ void instance_shadow_labyrinth::SetData(uint32 uiType, uint32 uiData) } else { + if (Creature* pHellmaw = GetSingleCreatureFromStorage(NPC_HELLMAW)) + { + // yell intro and remove banish aura + DoScriptText(SAY_HELLMAW_INTRO, pHellmaw); + if (pHellmaw->HasAura(SPELL_BANISH)) + pHellmaw->RemoveAurasDueToSpell(SPELL_BANISH); + } + m_auiEncounter[1] = DONE; debug_log("SD2: Shadow Labyrinth: TYPE_OVERSEER == DONE"); } @@ -166,9 +175,11 @@ void instance_shadow_labyrinth::Load(const char* chrIn) std::istringstream loadStream(chrIn); loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { if (m_auiEncounter[i] == IN_PROGRESS) m_auiEncounter[i] = NOT_STARTED; + } OUT_LOAD_INST_DATA_COMPLETE; } diff --git a/scripts/outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h b/scripts/outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h index 79a9f33..d262313 100644 --- a/scripts/outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h +++ b/scripts/outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h @@ -15,11 +15,16 @@ enum TYPE_VORPIL = 4, TYPE_MURMUR = 5, + NPC_HELLMAW = 18731, NPC_VORPIL = 18732, NPC_FEL_OVERSEER = 18796, GO_REFECTORY_DOOR = 183296, //door opened when blackheart the inciter dies - GO_SCREAMING_HALL_DOOR = 183295 //door opened when grandmaster vorpil dies + GO_SCREAMING_HALL_DOOR = 183295, //door opened when grandmaster vorpil dies + + SAY_HELLMAW_INTRO = -1555000, + + SPELL_BANISH = 30231, }; class MANGOS_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance diff --git a/scripts/outland/black_temple/boss_illidan.cpp b/scripts/outland/black_temple/boss_illidan.cpp index 9dc44a5..26dfc5b 100644 --- a/scripts/outland/black_temple/boss_illidan.cpp +++ b/scripts/outland/black_temple/boss_illidan.cpp @@ -354,7 +354,7 @@ struct MANGOS_DLL_DECL demonfireAI : public ScriptedAI { m_illidanGuid = m_pInstance->GetGuid(NPC_ILLIDAN_STORMRAGE); - if (!pIllidan->HasSplineFlag(SPLINEFLAG_NO_SPLINE)) + if (!pIllidan->IsLevitating()) m_creature->SetDeathState(JUST_DIED); } } @@ -494,7 +494,7 @@ struct MANGOS_DLL_DECL npc_akama_illidanAI : public ScriptedAI m_bIsReturningToIllidan = true; WayPoint = WayPointList.begin(); m_creature->SetSpeedRate(MOVE_RUN, 2.0f); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_bIsWalking = true; } @@ -681,7 +681,7 @@ struct MANGOS_DLL_DECL npc_akama_illidanAI : public ScriptedAI m_bIsWalking = true; WayPoint = WayPointList.begin(); std::advance(WayPoint, 9); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); break; } } @@ -773,7 +773,7 @@ struct MANGOS_DLL_DECL npc_akama_illidanAI : public ScriptedAI } WayPoint = WayPointList.begin(); - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->GetMotionMaster()->MovePoint(WayPoint->id, WayPoint->x, WayPoint->y, WayPoint->z); m_bIsWalking = true; break; @@ -986,7 +986,7 @@ struct MANGOS_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI // Unequip warglaives if needed SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - m_creature->RemoveSplineFlag(SPLINEFLAG_NO_SPLINE); + m_creature->SetLevitate(false); m_bIsTalking = false; @@ -1284,7 +1284,7 @@ struct MANGOS_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // We now hover! - m_creature->AddSplineFlag(SPLINEFLAG_NO_SPLINE); + m_creature->SetLevitate(true); m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z); for(uint8 i = 0; i < 2; ++i) @@ -1753,7 +1753,7 @@ struct MANGOS_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI // anndddd touchdown! m_creature->HandleEmote(EMOTE_ONESHOT_LAND); - m_creature->RemoveSplineFlag(SPLINEFLAG_NO_SPLINE); + m_creature->SetLevitate(false); m_uiPhase = PHASE_NORMAL_2; // We should let the raid fight us =) diff --git a/scripts/outland/black_temple/boss_shade_of_akama.cpp b/scripts/outland/black_temple/boss_shade_of_akama.cpp index 3065e82..0c75fb8 100644 --- a/scripts/outland/black_temple/boss_shade_of_akama.cpp +++ b/scripts/outland/black_temple/boss_shade_of_akama.cpp @@ -206,7 +206,7 @@ struct MANGOS_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI m_afSpawnLoc[uiRand].m_fX, m_afSpawnLoc[uiRand].m_fY, m_afSpawnLoc[uiRand].m_fZ, m_afSpawnLoc[uiRand].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0)) { - pSorcerer->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSorcerer->SetWalk(false); pSorcerer->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); pSorcerer->SetTargetGuid(m_creature->GetObjectGuid()); @@ -226,7 +226,7 @@ struct MANGOS_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI m_afSpawnLoc[uiRand].m_fX, m_afSpawnLoc[uiRand].m_fY, m_afSpawnLoc[uiRand].m_fZ, m_afSpawnLoc[uiRand].m_fO, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000)) { - pSpawn->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSpawn->SetWalk(false); pSpawn->GetMotionMaster()->MovePoint(0, LOC_RAND_TO_CENTER_X, LOC_RAND_TO_CENTER_Y, LOC_RAND_TO_CENTER_Z); } } @@ -553,7 +553,7 @@ struct MANGOS_DLL_DECL npc_akamaAI : public ScriptedAI { m_bIsShadeDead = true; m_uiWayPointId = 0; - m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(true); m_creature->GetMotionMaster()->MovePoint(m_uiWayPointId, m_afAkamaWP[0].m_fX, m_afAkamaWP[0].m_fY, m_afAkamaWP[0].m_fZ); } } diff --git a/scripts/outland/coilfang_reservoir/steam_vault/boss_hydromancer_thespia.cpp b/scripts/outland/coilfang_reservoir/steam_vault/boss_hydromancer_thespia.cpp index 115b5fc..a0e80b1 100644 --- a/scripts/outland/coilfang_reservoir/steam_vault/boss_hydromancer_thespia.cpp +++ b/scripts/outland/coilfang_reservoir/steam_vault/boss_hydromancer_thespia.cpp @@ -135,7 +135,7 @@ struct MANGOS_DLL_DECL boss_thespiaAI : public ScriptedAI }; #define SPELL_WATER_BOLT_VOLLEY 34449 -#define H_SPELL_WATER_BOLT_VOLLEY 37924 +#define SPELL_WATER_BOLT_VOLLEY_H 37924 struct MANGOS_DLL_DECL mob_coilfang_waterelementalAI : public ScriptedAI { @@ -160,7 +160,7 @@ struct MANGOS_DLL_DECL mob_coilfang_waterelementalAI : public ScriptedAI if (WaterBoltVolley_Timer < diff) { - DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_WATER_BOLT_VOLLEY : H_SPELL_WATER_BOLT_VOLLEY); + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_WATER_BOLT_VOLLEY : SPELL_WATER_BOLT_VOLLEY_H); WaterBoltVolley_Timer = urand(7000, 12000); }else WaterBoltVolley_Timer -= diff; diff --git a/scripts/outland/coilfang_reservoir/steam_vault/boss_mekgineer_steamrigger.cpp b/scripts/outland/coilfang_reservoir/steam_vault/boss_mekgineer_steamrigger.cpp index c00f240..675df0d 100644 --- a/scripts/outland/coilfang_reservoir/steam_vault/boss_mekgineer_steamrigger.cpp +++ b/scripts/outland/coilfang_reservoir/steam_vault/boss_mekgineer_steamrigger.cpp @@ -42,7 +42,7 @@ EndContentData */ #define SPELL_SUPER_SHRINK_RAY 31485 #define SPELL_SAW_BLADE 31486 #define SPELL_ELECTRIFIED_NET 35107 -#define H_SPELL_ENRAGE 1 //corrent enrage spell not known +#define SPELL_ENRAGE_H 1 //corrent enrage spell not known #define ENTRY_STREAMRIGGER_MECHANIC 17951 @@ -192,7 +192,7 @@ CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature* pCreature) #define SPELL_DISPEL_MAGIC 17201 #define SPELL_REPAIR 31532 -#define H_SPELL_REPAIR 37936 +#define SPELL_REPAIR_H 37936 #define MAX_REPAIR_RANGE (13.0f) //we should be at least at this range for repair #define MIN_REPAIR_RANGE (7.0f) //we can stop movement at this range to repair but not required @@ -238,7 +238,7 @@ struct MANGOS_DLL_DECL mob_steamrigger_mechanicAI : public ScriptedAI //m_creature->GetMotionMaster()->MovementExpired(); //m_creature->GetMotionMaster()->MoveIdle(); - DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_REPAIR : H_SPELL_REPAIR, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_REPAIR : SPELL_REPAIR_H, CAST_TRIGGERED); } Repair_Timer = 5000; } diff --git a/scripts/outland/hellfire_citadel/blood_furnace/blood_furnace.h b/scripts/outland/hellfire_citadel/blood_furnace/blood_furnace.h index 8ad92bb..fb31525 100644 --- a/scripts/outland/hellfire_citadel/blood_furnace/blood_furnace.h +++ b/scripts/outland/hellfire_citadel/blood_furnace/blood_furnace.h @@ -16,8 +16,10 @@ enum // NPC_THE_MAKER = 17381, NPC_BROGGOK = 17380, - // NPC_KELIDAN_THE_BREAKER = 17377, + NPC_KELIDAN_THE_BREAKER = 17377, NPC_NASCENT_FEL_ORC = 17398, // Used in the Broggok event + NPC_MAGTHERIDON = 21174, + NPC_SHADOWMOON_CHANNELER = 17653, GO_DOOR_FINAL_EXIT = 181766, GO_DOOR_MAKER_FRONT = 181811, @@ -72,6 +74,8 @@ class MANGOS_DLL_DECL instance_blood_furnace : public ScriptedInstance void GetMovementDistanceForIndex(uint32 uiIndex, float& dx, float& dy); + void GetKelidanAddList(GUIDList& lList) { lList = m_lChannelersGuids; m_lChannelersGuids.clear(); } + private: void DoSortBroggokOrcs(); void DoNextBroggokEventPhase(); @@ -84,7 +88,8 @@ class MANGOS_DLL_DECL instance_blood_furnace : public ScriptedInstance uint32 m_uiBroggokEventTimer; // Timer for opening the event cages; only on heroic mode = 30 secs uint32 m_uiBroggokEventPhase; - GUIDList m_luiNascentOrcGUIDs; + GUIDList m_luiNascentOrcGuids; + GUIDList m_lChannelersGuids; }; #endif diff --git a/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp index c31f14a..1fab940 100644 --- a/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp +++ b/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp @@ -16,8 +16,8 @@ /* ScriptData SDName: Boss_Kelidan_The_Breaker -SD%Complete: 60 -SDComment: Event with channeleres vs. boss not implemented yet +SD%Complete: 100 +SDComment: SDCategory: Hellfire Citadel, Blood Furnace EndScriptData */ @@ -31,6 +31,9 @@ EndContentData */ enum { + MAX_ADDS = 5, + + SAY_MAGTHERIDON_INTRO = -1542016, // Yell by Magtheridon SAY_WAKE = -1542000, SAY_ADD_AGGRO_1 = -1542001, SAY_ADD_AGGRO_2 = -1542002, @@ -41,53 +44,84 @@ enum SAY_DIE = -1542007, SPELL_CORRUPTION = 30938, - SPELL_EVOCATION = 30935, // Aura channeled by the boss + SPELL_EVOCATION = 30935, SPELL_FIRE_NOVA = 33132, - H_SPELL_FIRE_NOVA = 37371, + SPELL_FIRE_NOVA_H = 37371, SPELL_SHADOW_BOLT_VOLLEY = 28599, - H_SPELL_SHADOW_BOLT_VOLLEY = 40070, + SPELL_SHADOW_BOLT_VOLLEY_H = 40070, SPELL_BURNING_NOVA = 30940, - SPELL_VORTEX = 37370 + SPELL_VORTEX = 37370, + + SPELL_CHANNELING = 39123, +}; + +struct SortByAngle +{ + SortByAngle(WorldObject const* pRef): m_pRef(pRef) {} + bool operator()(WorldObject* pLeft, WorldObject* pRight) + { + return m_pRef->GetAngle(pLeft) < m_pRef->GetAngle(pRight); + } + WorldObject const* m_pRef; }; struct MANGOS_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI { boss_kelidan_the_breakerAI(Creature* pCreature) : ScriptedAI(pCreature) { - m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_pInstance = (instance_blood_furnace*)pCreature->GetInstanceData(); m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + m_uiSetupAddsTimer = 100; + m_bDidMagtheridonYell = false; + DoCastSpellIfCan(m_creature, SPELL_EVOCATION); Reset(); } - ScriptedInstance* m_pInstance; + instance_blood_furnace* m_pInstance; bool m_bIsRegularMode; - uint32 ShadowVolley_Timer; - uint32 BurningNova_Timer; - uint32 Firenova_Timer; - uint32 Corruption_Timer; - bool Firenova; + uint32 m_uiShadowVolleyTimer; + uint32 m_uiBurningNovaTimer; + uint32 m_uiFirenovaTimer; + uint32 m_uiCorruptionTimer; + uint32 m_uiSetupAddsTimer; + uint8 m_uiKilledAdds; + bool m_bDidMagtheridonYell; + + GUIDVector m_vAddGuids; void Reset() { - ShadowVolley_Timer = 1000; - BurningNova_Timer = 15000; - Corruption_Timer = 5000; - Firenova = false; + m_uiShadowVolleyTimer = 1000; + m_uiBurningNovaTimer = 15000; + m_uiCorruptionTimer = 5000; + m_uiFirenovaTimer = 0; + m_uiKilledAdds = 0; + } - DoCastSpellIfCan(m_creature, SPELL_EVOCATION); + void MoveInLineOfSight(Unit* pWho) + { + if (!m_bDidMagtheridonYell && pWho->GetTypeId() == TYPEID_PLAYER && !((Player*)pWho)->isGameMaster() && m_creature->_IsWithinDist(pWho, 73.0f, false)) + { + if (m_pInstance) + m_pInstance->DoOrSimulateScriptTextForThisInstance(SAY_MAGTHERIDON_INTRO, NPC_MAGTHERIDON); + + m_bDidMagtheridonYell = true; + } + + ScriptedAI::MoveInLineOfSight(pWho); } - void Aggro(Unit *who) + void Aggro(Unit* pWho) { DoScriptText(SAY_WAKE, m_creature); } - void KilledUnit(Unit* victim) + void KilledUnit(Unit* pVictim) { if (urand(0, 1)) return; @@ -95,59 +129,153 @@ struct MANGOS_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI DoScriptText(urand(0, 1) ? SAY_KILL_1 : SAY_KILL_2, m_creature); } - void JustDied(Unit* Killer) + void JustDied(Unit* pKiller) { DoScriptText(SAY_DIE, m_creature); if (m_pInstance) - m_pInstance->SetData(TYPE_KELIDAN_EVENT,DONE); + m_pInstance->SetData(TYPE_KELIDAN_EVENT, DONE); } - void UpdateAI(const uint32 diff) + void JustReachedHome() { - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + if (m_pInstance) + m_pInstance->SetData(TYPE_KELIDAN_EVENT, FAIL); + + DoCastSpellIfCan(m_creature, SPELL_EVOCATION); + m_uiSetupAddsTimer = 2000; + } + + void DoSetupAdds() + { + m_uiSetupAddsTimer = 0; + + if (!m_pInstance) return; - if (Firenova) + GUIDList lAddGuids; + m_pInstance->GetKelidanAddList(lAddGuids); + + // Sort Adds to vector if not already done + if (!lAddGuids.empty()) { - if (Firenova_Timer < diff) + m_vAddGuids.reserve(lAddGuids.size()); + std::list lAdds; + for (GUIDList::const_iterator itr = lAddGuids.begin(); itr != lAddGuids.end(); ++itr) { - DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_FIRE_NOVA : H_SPELL_FIRE_NOVA); - Firenova = false; - ShadowVolley_Timer = 2000; - }else Firenova_Timer -=diff; + if (Creature* pAdd = m_pInstance->instance->GetCreature(*itr)) + lAdds.push_back(pAdd); + } + // Sort them by angle + lAdds.sort(SortByAngle(m_creature)); + for (std::list::const_iterator itr = lAdds.begin(); itr != lAdds.end(); ++itr) + m_vAddGuids.push_back((*itr)->GetObjectGuid()); + } - return; + // Respawn killed adds and reset counter + m_uiKilledAdds = 0; + for (GUIDVector::const_iterator itr = m_vAddGuids.begin(); itr != m_vAddGuids.end(); ++itr) + { + Creature* pAdd = m_pInstance->instance->GetCreature(*itr); + if (pAdd && !pAdd->isAlive()) + pAdd->Respawn(); + } + + // Cast pentagram + uint8 s = m_vAddGuids.size(); + for (uint8 i = 0; i < s; ++i) + { + Creature* pCaster = m_pInstance->instance->GetCreature(m_vAddGuids[i]); + Creature* pTarget = m_pInstance->instance->GetCreature(m_vAddGuids[(i + 2) % s]); + if (pCaster && pTarget) + pCaster->CastSpell(pTarget, SPELL_CHANNELING, false); + } + } + + void AddJustAggroed(Unit* pWho) + { + // Let all adds attack + for (GUIDVector::const_iterator itr = m_vAddGuids.begin(); itr != m_vAddGuids.end(); ++itr) + { + Creature* pAdd = m_creature->GetMap()->GetCreature(*itr); + if (pAdd && !pAdd->getVictim()) + pAdd->AI()->AttackStart(pWho); + } + } + + void AddJustReachedHome() + { + m_uiSetupAddsTimer = 2000; + } + + void AddJustDied(Unit* pKiller) + { + ++m_uiKilledAdds; + if (m_uiKilledAdds == MAX_ADDS) + { + m_creature->InterruptNonMeleeSpells(true); + AttackStart(pKiller); } + } - if (ShadowVolley_Timer < diff) + void UpdateAI(const uint32 uiDiff) + { + if (m_uiSetupAddsTimer) { - DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SHADOW_BOLT_VOLLEY : H_SPELL_SHADOW_BOLT_VOLLEY); - ShadowVolley_Timer = urand(5000, 13000); - }else ShadowVolley_Timer -=diff; + if (m_uiSetupAddsTimer <= uiDiff) + DoSetupAdds(); + else + m_uiSetupAddsTimer -= uiDiff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; - if (Corruption_Timer < diff) + if (m_uiFirenovaTimer) { - DoCastSpellIfCan(m_creature,SPELL_CORRUPTION); - Corruption_Timer = urand(30000, 50000); - }else Corruption_Timer -=diff; + if (m_uiFirenovaTimer <= uiDiff) + { + if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_FIRE_NOVA : SPELL_FIRE_NOVA_H) == CAST_OK) + { + m_uiFirenovaTimer = 0; + m_uiShadowVolleyTimer = 2000; + } + } + else + m_uiFirenovaTimer -=uiDiff; + } - if (BurningNova_Timer < diff) + if (m_uiShadowVolleyTimer < uiDiff) { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); + if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SHADOW_BOLT_VOLLEY : SPELL_SHADOW_BOLT_VOLLEY_H) == CAST_OK) + m_uiShadowVolleyTimer = urand(5000, 13000); + } + else + m_uiShadowVolleyTimer -=uiDiff; - DoScriptText(SAY_NOVA, m_creature); + if (m_uiCorruptionTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_CORRUPTION) == CAST_OK) + m_uiCorruptionTimer = urand(30000, 50000); + } + else + m_uiCorruptionTimer -=uiDiff; - if (!m_bIsRegularMode) - DoCastSpellIfCan(m_creature, SPELL_VORTEX); + if (m_uiBurningNovaTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_BURNING_NOVA, CAST_TRIGGERED) == CAST_OK) + { + DoScriptText(SAY_NOVA, m_creature); - DoCastSpellIfCan(m_creature,SPELL_BURNING_NOVA); + if (!m_bIsRegularMode) + DoCastSpellIfCan(m_creature, SPELL_VORTEX, CAST_TRIGGERED); - BurningNova_Timer = urand(20000, 28000); - Firenova_Timer= 5000; - Firenova = true; - }else BurningNova_Timer -=diff; + m_uiBurningNovaTimer = urand(20000, 28000); + m_uiFirenovaTimer = 5000; + } + } + else + m_uiBurningNovaTimer -= uiDiff; DoMeleeAttackIfReady(); } @@ -165,12 +293,10 @@ CreatureAI* GetAI_boss_kelidan_the_breaker(Creature* pCreature) enum { SPELL_SHADOW_BOLT = 12739, - H_SPELL_SHADOW_BOLT = 15472, + SPELL_SHADOW_BOLT_H = 15472, SPELL_MARK_OF_SHADOW = 30937, - - SPELL_CHANNELING = 0 //initial spell channeling boss/each other not known -}; //when engaged all channelers must stop, trigger yell (SAY_ADD_AGGRO_*), and engage. +}; struct MANGOS_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI { @@ -184,37 +310,86 @@ struct MANGOS_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI ScriptedInstance* m_pInstance; bool m_bIsRegularMode; - uint32 ShadowBolt_Timer; - uint32 MarkOfShadow_Timer; + uint32 m_uiShadowBoltTimer; + uint32 m_uiMarkOfShadowTimer; void Reset() { - ShadowBolt_Timer = urand(1000, 2000); - MarkOfShadow_Timer = urand(5000, 7000); + m_uiShadowBoltTimer = urand(1000, 2000); + m_uiMarkOfShadowTimer = urand(5000, 7000); } - void Aggro(Unit* who) + void Aggro(Unit* pWho) { - //trigger boss to yell + m_creature->InterruptNonMeleeSpells(false); + + switch(urand(0, 2)) + { + case 0: + DoScriptText(SAY_ADD_AGGRO_1, m_creature); + break; + case 1: + DoScriptText(SAY_ADD_AGGRO_2, m_creature); + break; + case 2: + DoScriptText(SAY_ADD_AGGRO_3, m_creature); + break; + } + + if (!m_pInstance) + return; + + if (Creature* pKelidan = m_pInstance->GetSingleCreatureFromStorage(NPC_KELIDAN_THE_BREAKER)) + if (boss_kelidan_the_breakerAI* pKelidanAI = dynamic_cast (pKelidan->AI())) + pKelidanAI->AddJustAggroed(pWho); + } + + void JustDied(Unit* pKiller) + { + if (!m_pInstance) + return; + + if (Creature* pKelidan = m_pInstance->GetSingleCreatureFromStorage(NPC_KELIDAN_THE_BREAKER)) + if (boss_kelidan_the_breakerAI* pKelidanAI = dynamic_cast (pKelidan->AI())) + pKelidanAI->AddJustDied(pKiller); + } + + void JustReachedHome() + { + if (!m_pInstance) + return; + + if (Creature* pKelidan = m_pInstance->GetSingleCreatureFromStorage(NPC_KELIDAN_THE_BREAKER)) + if (boss_kelidan_the_breakerAI* pKelidanAI = dynamic_cast (pKelidan->AI())) + pKelidanAI->AddJustReachedHome(); } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; - if (MarkOfShadow_Timer < diff) + if (m_uiMarkOfShadowTimer < uiDiff) { - if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - DoCastSpellIfCan(target,SPELL_MARK_OF_SHADOW); - MarkOfShadow_Timer = urand(15000, 20000); - }else MarkOfShadow_Timer -=diff; + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (DoCastSpellIfCan(pTarget, SPELL_MARK_OF_SHADOW) == CAST_OK) + m_uiMarkOfShadowTimer = urand(15000, 20000); + } + } + else + m_uiMarkOfShadowTimer -=uiDiff; - if (ShadowBolt_Timer < diff) + if (m_uiShadowBoltTimer < uiDiff) { - DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SHADOW_BOLT : H_SPELL_SHADOW_BOLT); - ShadowBolt_Timer = urand(5000, 6000); - }else ShadowBolt_Timer -=diff; + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT_H) == CAST_OK) + m_uiShadowBoltTimer = urand(5000, 6000); + } + } + else + m_uiShadowBoltTimer -=uiDiff; DoMeleeAttackIfReady(); } @@ -227,15 +402,15 @@ CreatureAI* GetAI_mob_shadowmoon_channeler(Creature* pCreature) void AddSC_boss_kelidan_the_breaker() { - Script *newscript; + Script* pNewScript; - newscript = new Script; - newscript->Name = "boss_kelidan_the_breaker"; - newscript->GetAI = &GetAI_boss_kelidan_the_breaker; - newscript->RegisterSelf(); + pNewScript = new Script; + pNewScript->Name = "boss_kelidan_the_breaker"; + pNewScript->GetAI = &GetAI_boss_kelidan_the_breaker; + pNewScript->RegisterSelf(); - newscript = new Script; - newscript->Name = "mob_shadowmoon_channeler"; - newscript->GetAI = &GetAI_mob_shadowmoon_channeler; - newscript->RegisterSelf(); + pNewScript = new Script; + pNewScript->Name = "mob_shadowmoon_channeler"; + pNewScript->GetAI = &GetAI_mob_shadowmoon_channeler; + pNewScript->RegisterSelf(); } diff --git a/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp index 75ea524..e05214c 100644 --- a/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp +++ b/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp @@ -35,7 +35,7 @@ enum SPELL_ACID_SPRAY = 38153, // heroic 38973 ??? 38153 SPELL_EXPLODING_BREAKER = 30925, - H_SPELL_EXPLODING_BREAKER = 40059, + SPELL_EXPLODING_BREAKER_H = 40059, SPELL_KNOCKDOWN = 20276, SPELL_DOMINATION = 25772 // ??? }; @@ -111,7 +111,7 @@ struct MANGOS_DLL_DECL boss_the_makerAI : public ScriptedAI if (ExplodingBreaker_Timer < diff) { if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) - DoCastSpellIfCan(target, m_bIsRegularMode ? H_SPELL_EXPLODING_BREAKER : SPELL_EXPLODING_BREAKER); + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_EXPLODING_BREAKER : SPELL_EXPLODING_BREAKER_H); ExplodingBreaker_Timer = urand(4000, 12000); }else ExplodingBreaker_Timer -=diff; diff --git a/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp index e747bad..afb4b85 100644 --- a/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp +++ b/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp @@ -41,11 +41,15 @@ void instance_blood_furnace::OnCreatureCreate(Creature* pCreature) switch (pCreature->GetEntry()) { case NPC_BROGGOK: + case NPC_KELIDAN_THE_BREAKER: m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid(); break; case NPC_NASCENT_FEL_ORC: - m_luiNascentOrcGUIDs.push_back(pCreature->GetObjectGuid()); + m_luiNascentOrcGuids.push_back(pCreature->GetObjectGuid()); + break; + case NPC_SHADOWMOON_CHANNELER: + m_lChannelersGuids.push_back(pCreature->GetObjectGuid()); break; } } @@ -187,7 +191,7 @@ void instance_blood_furnace::DoNextBroggokEventPhase() if (Creature* pBroggok = GetSingleCreatureFromStorage(NPC_BROGGOK)) { - pBroggok->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pBroggok->SetWalk(false); pBroggok->GetMotionMaster()->MovePoint(0, dx, dy, pBroggok->GetPositionZ()); } } @@ -208,7 +212,7 @@ void instance_blood_furnace::DoNextBroggokEventPhase() pOrc->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); // Move them out of the cages - pOrc->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pOrc->SetWalk(false); pOrc->GetMotionMaster()->MovePoint(0, pOrc->GetPositionX() + dx, pOrc->GetPositionY() + dy, pOrc->GetPositionZ()); } } @@ -310,7 +314,7 @@ void instance_blood_furnace::Load(const char* chrIn) // Sort all nascent orcs in the instance in order to get only those near broggok doors void instance_blood_furnace::DoSortBroggokOrcs() { - for (GUIDList::const_iterator itr = m_luiNascentOrcGUIDs.begin(); itr != m_luiNascentOrcGUIDs.end(); ++itr) + for (GUIDList::const_iterator itr = m_luiNascentOrcGuids.begin(); itr != m_luiNascentOrcGuids.end(); ++itr) { if (Creature* pOrc = instance->GetCreature(*itr)) { diff --git a/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp index 0a5bd40..49d0341 100644 --- a/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp +++ b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp @@ -16,8 +16,8 @@ /* ScriptData SDName: Boss_Nazan_And_Vazruden -SD%Complete: 30 -SDComment: Encounter is not complete. TODO: re-check script when MovementInform call from core work as expected. +SD%Complete: 95 +SDComment: Bellowing Roar Timer (heroic) needs some love SDCategory: Hellfire Citadel, Hellfire Ramparts EndScriptData */ @@ -39,16 +39,21 @@ enum SPELL_SUMMON_VAZRUDEN = 30717, //vazruden - SPELL_REVENGE = 40392, + SPELL_REVENGE = 19130, + SPELL_REVENGE_H = 40392, //nazan - SPELL_FIREBALL = 30691, // TODO: IDs not verified - SPELL_FIREBALL_H = 36920, + SPELL_FIREBALL = 30691, // This and the next while flying (dmg values will change in cata) + SPELL_FIREBALL_B = 33793, + SPELL_FIREBALL_H = 32491, + SPELL_FIREBALL_B_H = 33794, + SPELL_FIREBALL_LAND = 34653, // While landed + SPELL_FIREBALL_LAND_H = 36920, SPELL_CONE_OF_FIRE = 30926, - SPELL_H_CONE_OF_FIRE = 36921, + SPELL_CONE_OF_FIRE_H = 36921, - SPELL_H_BELLOW_ROAR = 39427, + SPELL_BELLOW_ROAR_H = 39427, //misc POINT_ID_CENTER = 100, @@ -73,11 +78,13 @@ struct MANGOS_DLL_DECL boss_vazrudenAI : public ScriptedAI ScriptedInstance* m_pInstance; bool m_bIsRegularMode; + uint32 m_uiRevengeTimer; bool m_bHealthBelow; void Reset() { m_bHealthBelow = false; + m_uiRevengeTimer = urand(5500, 8400); } void Aggro(Unit* pWho) @@ -113,11 +120,8 @@ struct MANGOS_DLL_DECL boss_vazrudenAI : public ScriptedAI { if (Creature* pHerald = m_pInstance->GetSingleCreatureFromStorage(NPC_VAZRUDEN_HERALD)) { - if (pHerald->HasSplineFlag(SPLINEFLAG_WALKMODE)) - pHerald->RemoveSplineFlag(SPLINEFLAG_WALKMODE); - + pHerald->SetWalk(false); pHerald->GetMotionMaster()->MovePoint(POINT_ID_COMBAT, afCombatPos[0], afCombatPos[1], afCombatPos[2]); - DoScriptText(EMOTE_DESCEND, pHerald); } } @@ -135,6 +139,14 @@ struct MANGOS_DLL_DECL boss_vazrudenAI : public ScriptedAI m_bHealthBelow = true; } + if (m_uiRevengeTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_REVENGE : SPELL_REVENGE_H) == CAST_OK) + m_uiRevengeTimer = urand(11400, 14300); + } + else + m_uiRevengeTimer -= uiDiff; + DoMeleeAttackIfReady(); } }; @@ -163,6 +175,9 @@ struct MANGOS_DLL_DECL boss_vazruden_heraldAI : public ScriptedAI bool m_bIsEventInProgress; uint32 m_uiMovementTimer; uint32 m_uiFireballTimer; + uint32 m_uiFireballBTimer; + uint32 m_uiConeOfFireTimer; + uint32 m_uiBellowingRoarTimer; ObjectGuid m_lastSeenPlayerGuid; ObjectGuid m_vazrudenGuid; @@ -179,11 +194,14 @@ struct MANGOS_DLL_DECL boss_vazruden_heraldAI : public ScriptedAI m_lastSeenPlayerGuid.Clear(); m_vazrudenGuid.Clear(); m_uiFireballTimer = 0; + m_uiFireballBTimer = 2100; + m_uiConeOfFireTimer = urand(8100, 19700); + m_uiBellowingRoarTimer = 100; // TODO Guesswork, though such an AoE fear soon after landing seems fitting // see boss_onyxia // sort of a hack, it is unclear how this really work but the values appear to be valid m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); } void MoveInLineOfSight(Unit* pWho) @@ -229,21 +247,25 @@ struct MANGOS_DLL_DECL boss_vazruden_heraldAI : public ScriptedAI { m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_pInstance->SetData(TYPE_NAZAN, IN_PROGRESS); + m_creature->SetInCombatWithZone(); // Landing // undo flying m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, 0); - m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(false); Player* pPlayer = m_creature->GetMap()->GetPlayer(m_lastSeenPlayerGuid); if (pPlayer && pPlayer->isAlive()) AttackStart(pPlayer); + // Initialize for combat + m_uiFireballTimer = urand(5200, 16500); + break; } case POINT_ID_FLYING: if (m_bIsEventInProgress) // Additional check for wipe case, while nazan is flying to this point - m_uiFireballTimer = 3000; + m_uiFireballTimer = 1; break; } } @@ -333,17 +355,64 @@ struct MANGOS_DLL_DECL boss_vazruden_heraldAI : public ScriptedAI if (Creature* pVazruden = m_creature->GetMap()->GetCreature(m_vazrudenGuid)) { if (Unit* pEnemy = pVazruden->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - DoCastSpellIfCan(pEnemy, m_bIsRegularMode ? SPELL_FIREBALL : SPELL_FIREBALL_H, 0, pVazruden->GetObjectGuid()); + { + if (DoCastSpellIfCan(pEnemy, m_bIsRegularMode ? SPELL_FIREBALL : SPELL_FIREBALL_H, 0, pVazruden->GetObjectGuid()) == CAST_OK) + m_uiFireballTimer = urand(2100, 7300); + } } - m_uiFireballTimer = urand(4000, 8000); } else m_uiFireballTimer -= uiDiff; + + if (m_uiFireballBTimer < uiDiff) + { + if (Creature* pVazruden = m_creature->GetMap()->GetCreature(m_vazrudenGuid)) + { + if (Unit* pEnemy = pVazruden->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (DoCastSpellIfCan(pEnemy, m_bIsRegularMode ? SPELL_FIREBALL_B : SPELL_FIREBALL_B_H, 0, pVazruden->GetObjectGuid()) == CAST_OK) + m_uiFireballBTimer = 15700; + } + } + } + else + m_uiFireballBTimer -= uiDiff; } return; } + // In Combat + if (m_uiFireballTimer < uiDiff) + { + if (Unit* pEnemy = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (DoCastSpellIfCan(pEnemy, m_bIsRegularMode ? SPELL_FIREBALL_LAND : SPELL_FIREBALL_LAND_H) == CAST_OK) + m_uiFireballTimer = urand(7300, 13200); + } + } + else + m_uiFireballTimer -= uiDiff; + + if (m_uiConeOfFireTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_CONE_OF_FIRE : SPELL_CONE_OF_FIRE_H) == CAST_OK) + m_uiConeOfFireTimer = urand(7300, 13200); + } + else + m_uiConeOfFireTimer -= uiDiff; + + if (!m_bIsRegularMode) + { + if (m_uiBellowingRoarTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_BELLOW_ROAR_H) == CAST_OK) + m_uiBellowingRoarTimer = urand(8000, 12000); // TODO Guesswork, 8s cooldown + } + else + m_uiBellowingRoarTimer -= uiDiff; + } + DoMeleeAttackIfReady(); } }; diff --git a/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp index b4521e2..e7d45f5 100644 --- a/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp +++ b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp @@ -23,23 +23,26 @@ EndScriptData */ #include "precompiled.h" -#define SAY_AGGRO_1 -1543009 -#define SAY_AGGRO_2 -1543010 -#define SAY_AGGRO_3 -1543011 -#define SAY_SUMMON -1543012 -#define SAY_CURSE -1543013 -#define SAY_KILL_1 -1543014 -#define SAY_DIE -1543015 -#define SAY_WIPE -1543016 - -#define SPELL_ORBITAL_STRIKE 30637 -#define SPELL_SHADOW_WHIP 30638 -#define SPELL_TREACHEROUS_AURA 30695 -#define H_SPELL_BANE_OF_TREACHERY 37566 -#define SPELL_DEMONIC_SHIELD 31901 -#define SPELL_SHADOW_BOLT 30686 -#define H_SPELL_SHADOW_BOLT 39297 -#define SPELL_SUMMON_FIENDISH_HOUND 30707 +enum +{ + SAY_AGGRO_1 = -1543009, + SAY_AGGRO_2 = -1543010, + SAY_AGGRO_3 = -1543011, + SAY_SUMMON = -1543012, + SAY_CURSE = -1543013, + SAY_KILL_1 = -1543014, + SAY_DIE = -1543015, + SAY_WIPE = -1543016, + + SPELL_ORBITAL_STRIKE = 30637, + SPELL_SHADOW_WHIP = 30638, + SPELL_TREACHEROUS_AURA = 30695, + SPELL_BANE_OF_TREACHERY_H = 37566, + SPELL_DEMONIC_SHIELD = 31901, + SPELL_SHADOW_BOLT = 30686, + SPELL_SHADOW_BOLT_H = 39297, + SPELL_SUMMON_FIENDISH_HOUND = 30707, +}; struct MANGOS_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI { @@ -52,32 +55,30 @@ struct MANGOS_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI bool m_bIsRegularMode; - uint32 OrbitalStrike_Timer; - uint32 ShadowWhip_Timer; - uint32 Aura_Timer; - uint32 DemonicShield_Timer; - uint32 Shadowbolt_Timer; - uint32 Summon_Timer; - uint32 SummonedCount; + uint32 m_uiOrbitalStrikeTimer; + uint32 m_uiShadowWhipTimer; + uint32 m_uiAuraTimer; + uint32 m_uiDemonicShieldTimer; + uint32 m_uiShadowboltTimer; + uint32 m_uiSummonTimer; ObjectGuid m_playerGuid; - bool CanPullBack; + bool m_bCanPullBack; void Reset() { DoScriptText(SAY_WIPE, m_creature); - OrbitalStrike_Timer = 25000; - ShadowWhip_Timer = 2000; - Aura_Timer = 10000; - DemonicShield_Timer = 1000; - Shadowbolt_Timer = 2000; - Summon_Timer = 10000; - SummonedCount = 0; + m_uiOrbitalStrikeTimer = 25000; + m_uiShadowWhipTimer = 2000; + m_uiAuraTimer = urand(12300, 23300); + m_uiDemonicShieldTimer = 1000; + m_uiShadowboltTimer = urand(6600, 8900); + m_uiSummonTimer = urand(19600, 23100); m_playerGuid.Clear(); - CanPullBack = false; + m_bCanPullBack = false; } - void Aggro(Unit *who) + void Aggro(Unit* pWho) { switch(urand(0, 2)) { @@ -87,7 +88,7 @@ struct MANGOS_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI } } - void KilledUnit(Unit* victim) + void KilledUnit(Unit* pVictim) { if (urand(0, 1)) return; @@ -95,103 +96,108 @@ struct MANGOS_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI DoScriptText(SAY_KILL_1, m_creature); } - void JustSummoned(Creature* summoned) + void JustSummoned(Creature* pSummoned) { DoScriptText(SAY_SUMMON, m_creature); - if (Unit* random = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(random); - - ++SummonedCount; + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); } - void JustDied(Unit* Killer) + void JustDied(Unit* pKiller) { DoScriptText(SAY_DIE, m_creature); } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; - //only two may be wrong, perhaps increase timer and spawn periodically instead. - if (SummonedCount < 2) + if (m_uiSummonTimer < uiDiff) { - if (Summon_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCastSpellIfCan(m_creature,SPELL_SUMMON_FIENDISH_HOUND); - Summon_Timer = urand(15000, 30000); - }else Summon_Timer -= diff; + if (DoCastSpellIfCan(m_creature, SPELL_SUMMON_FIENDISH_HOUND) == CAST_OK) + m_uiSummonTimer = urand(24100, 26900); } + else + m_uiSummonTimer -= uiDiff; - if (CanPullBack) + if (m_bCanPullBack) { - if (ShadowWhip_Timer < diff) + if (m_uiShadowWhipTimer < uiDiff) { if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGuid)) { //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted) if (pPlayer->HasMovementFlag(MOVEFLAG_FALLING)) - { - m_creature->InterruptNonMeleeSpells(false); - DoCastSpellIfCan(pPlayer,SPELL_SHADOW_WHIP); - } + DoCastSpellIfCan(pPlayer, SPELL_SHADOW_WHIP, CAST_INTERRUPT_PREVIOUS); } m_playerGuid.Clear(); - ShadowWhip_Timer = 2000; - CanPullBack = false; - }else ShadowWhip_Timer -= diff; + m_uiShadowWhipTimer = 2000; + m_bCanPullBack = false; + } + else + m_uiShadowWhipTimer -= uiDiff; } - else if (OrbitalStrike_Timer < diff) + else if (m_uiOrbitalStrikeTimer < uiDiff) { - Unit* temp = NULL; + Unit* pTemp = NULL; if (m_creature->CanReachWithMeleeAttack(m_creature->getVictim())) - temp = m_creature->getVictim(); - else temp = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + pTemp = m_creature->getVictim(); + else + pTemp = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); - if (temp && temp->GetTypeId() == TYPEID_PLAYER) + if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER) { - DoCastSpellIfCan(temp,SPELL_ORBITAL_STRIKE); - OrbitalStrike_Timer = urand(14000, 16000); - m_playerGuid = temp->GetObjectGuid(); + if (DoCastSpellIfCan(pTemp, SPELL_ORBITAL_STRIKE) == CAST_OK) + { + m_uiOrbitalStrikeTimer = urand(14000, 16000); + m_playerGuid = pTemp->GetObjectGuid(); - CanPullBack = true; + m_bCanPullBack = true; + } } - }else OrbitalStrike_Timer -= diff; + } + else + m_uiOrbitalStrikeTimer -= uiDiff; if (m_creature->GetHealthPercent() < 20.0f) { - if (DemonicShield_Timer < diff) + if (m_uiDemonicShieldTimer < uiDiff) { - DoCastSpellIfCan(m_creature,SPELL_DEMONIC_SHIELD); - DemonicShield_Timer = 15000; - }else DemonicShield_Timer -= diff; + if (DoCastSpellIfCan(m_creature, SPELL_DEMONIC_SHIELD) == CAST_OK) + m_uiDemonicShieldTimer = 15000; + } + else + m_uiDemonicShieldTimer -= uiDiff; } - if (Aura_Timer < diff) + if (m_uiAuraTimer < uiDiff) { - DoScriptText(SAY_CURSE, m_creature); - - if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) { - DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_TREACHEROUS_AURA : H_SPELL_BANE_OF_TREACHERY); - Aura_Timer = urand(8000, 16000); + if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_TREACHEROUS_AURA : SPELL_BANE_OF_TREACHERY_H) == CAST_OK) + { + m_uiAuraTimer = urand(8000, 16000); + DoScriptText(SAY_CURSE, m_creature); + } } - }else Aura_Timer -= diff; + } + else + m_uiAuraTimer -= uiDiff; - if (Shadowbolt_Timer < diff) + if (m_uiShadowboltTimer < uiDiff) { - if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) { - if (target) - target = m_creature->getVictim(); - - DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_SHADOW_BOLT : H_SPELL_SHADOW_BOLT); - Shadowbolt_Timer = urand(4000, 6500); + if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT_H) == CAST_OK) + m_uiShadowboltTimer = urand(4200, 7300); } - }else Shadowbolt_Timer -= diff; + else + m_uiShadowboltTimer = 2000; + } + else + m_uiShadowboltTimer -= uiDiff; DoMeleeAttackIfReady(); } @@ -204,10 +210,10 @@ CreatureAI* GetAI_boss_omor_the_unscarredAI(Creature* pCreature) void AddSC_boss_omor_the_unscarred() { - Script *newscript; + Script* pNewScript; - newscript = new Script; - newscript->Name = "boss_omor_the_unscarred"; - newscript->GetAI = &GetAI_boss_omor_the_unscarredAI; - newscript->RegisterSelf(); + pNewScript = new Script; + pNewScript->Name = "boss_omor_the_unscarred"; + pNewScript->GetAI = &GetAI_boss_omor_the_unscarredAI; + pNewScript->RegisterSelf(); } diff --git a/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp index 2b3f04f..7ccfd89 100644 --- a/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp +++ b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp @@ -17,26 +17,30 @@ /* ScriptData SDName: Boss_Watchkeeper_Gargolmar SD%Complete: 80 -SDComment: Missing adds to heal him. Surge should be used on target furthest away, not random. +SDComment: Missing adds to heal him. Surge should be used on pTarget furthest away, not random. SDCategory: Hellfire Citadel, Hellfire Ramparts EndScriptData */ #include "precompiled.h" -#define SAY_TAUNT -1543000 -#define SAY_HEAL -1543001 -#define SAY_SURGE -1543002 -#define SAY_AGGRO_1 -1543003 -#define SAY_AGGRO_2 -1543004 -#define SAY_AGGRO_3 -1543005 -#define SAY_KILL_1 -1543006 -#define SAY_KILL_2 -1543007 -#define SAY_DIE -1543008 - -#define SPELL_MORTAL_WOUND 30641 -#define H_SPELL_MORTAL_WOUND 36814 -#define SPELL_SURGE 34645 -#define SPELL_RETALIATION 22857 +enum +{ + SAY_TAUNT = -1543000, + SAY_HEAL = -1543001, + SAY_SURGE = -1543002, + SAY_AGGRO_1 = -1543003, + SAY_AGGRO_2 = -1543004, + SAY_AGGRO_3 = -1543005, + SAY_KILL_1 = -1543006, + SAY_KILL_2 = -1543007, + SAY_DIE = -1543008, + + SPELL_MORTAL_WOUND = 30641, + SPELL_MORTAL_WOUND_H = 36814, + SPELL_SURGE = 34645, + SPELL_RETALIATION = 22857, + SPELL_OVERPOWER = 32154, +}; struct MANGOS_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI { @@ -48,24 +52,26 @@ struct MANGOS_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI bool m_bIsRegularMode; - uint32 Surge_Timer; - uint32 MortalWound_Timer; - uint32 Retaliation_Timer; + uint32 m_uiSurgeTimer; + uint32 m_uiMortalWoundTimer; + uint32 m_uiRetaliationTimer; + uint32 m_uiOverpowerTimer; - bool HasTaunted; - bool YelledForHeal; + bool m_bHasTaunted; + bool m_bYelledForHeal; void Reset() { - Surge_Timer = 5000; - MortalWound_Timer = 4000; - Retaliation_Timer = 0; + m_uiSurgeTimer = urand(2400, 6100); + m_uiMortalWoundTimer = urand(3500, 14400); + m_uiRetaliationTimer = 0; + m_uiOverpowerTimer = urand(3600, 14800); - HasTaunted = false; - YelledForHeal = false; + m_bHasTaunted = false; + m_bYelledForHeal = false; } - void Aggro(Unit *who) + void Aggro(Unit* pWho) { switch(urand(0, 2)) { @@ -75,73 +81,79 @@ struct MANGOS_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI } } - void MoveInLineOfSight(Unit* who) + void MoveInLineOfSight(Unit* pWho) { - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessablePlaceFor(m_creature)) + if (!m_bHasTaunted && m_creature->IsWithinDistInMap(pWho, 60.0f)) { - if (!m_creature->CanFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - { - who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f)) - { - DoScriptText(SAY_TAUNT, m_creature); - HasTaunted = true; - } + DoScriptText(SAY_TAUNT, m_creature); + m_bHasTaunted = true; } + + ScriptedAI::MoveInLineOfSight(pWho); } - void KilledUnit(Unit* victim) + void KilledUnit(Unit* pVictim) { DoScriptText(urand(0, 1) ? SAY_KILL_1 : SAY_KILL_2, m_creature); } - void JustDied(Unit* Killer) + void JustDied(Unit* pKiller) { DoScriptText(SAY_DIE, m_creature); } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; - if (MortalWound_Timer < diff) + if (m_uiMortalWoundTimer < uiDiff) { - DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_MORTAL_WOUND : H_SPELL_MORTAL_WOUND); - MortalWound_Timer = urand(5000, 13000); - }else MortalWound_Timer -= diff; + if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_MORTAL_WOUND : SPELL_MORTAL_WOUND_H) == CAST_OK) + m_uiMortalWoundTimer = urand(6100, 12200); + } + else + m_uiMortalWoundTimer -= uiDiff; - if (Surge_Timer < diff) + if (m_uiSurgeTimer < uiDiff) { - DoScriptText(SAY_SURGE, m_creature); - - if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) - DoCastSpellIfCan(target,SPELL_SURGE); - - Surge_Timer = urand(5000, 12000); - }else Surge_Timer -= diff; + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (DoCastSpellIfCan(pTarget, SPELL_SURGE) == CAST_OK) + { + DoScriptText(SAY_SURGE, m_creature); + m_uiSurgeTimer = urand(12100, 21700); + } + } + } + else + m_uiSurgeTimer -= uiDiff; if (m_creature->GetHealthPercent() < 20.0f) { - if (Retaliation_Timer < diff) + if (m_uiRetaliationTimer < uiDiff) { - DoCastSpellIfCan(m_creature,SPELL_RETALIATION); - Retaliation_Timer = 30000; - }else Retaliation_Timer -= diff; + if (DoCastSpellIfCan(m_creature,SPELL_RETALIATION) == CAST_OK) + m_uiRetaliationTimer = 30000; + } + else + m_uiRetaliationTimer -= uiDiff; } - if (!YelledForHeal) + if (m_uiOverpowerTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_OVERPOWER) == CAST_OK) + m_uiOverpowerTimer = urand(18100, 33700); + } + else + m_uiOverpowerTimer -= uiDiff; + + if (!m_bYelledForHeal) { if (m_creature->GetHealthPercent() < 40.0f) { DoScriptText(SAY_HEAL, m_creature); - YelledForHeal = true; + m_bYelledForHeal = true; } } @@ -156,9 +168,10 @@ CreatureAI* GetAI_boss_watchkeeper_gargolmarAI(Creature* pCreature) void AddSC_boss_watchkeeper_gargolmar() { - Script *newscript; - newscript = new Script; - newscript->Name = "boss_watchkeeper_gargolmar"; - newscript->GetAI = &GetAI_boss_watchkeeper_gargolmarAI; - newscript->RegisterSelf(); + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_watchkeeper_gargolmar"; + pNewScript->GetAI = &GetAI_boss_watchkeeper_gargolmarAI; + pNewScript->RegisterSelf(); } diff --git a/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp index ff1ef38..1489403 100644 --- a/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp +++ b/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp @@ -69,7 +69,7 @@ enum SPELL_SHADOW_FISSURE = 30496, // Summon the ShadowFissure NPC SPELL_SHADOW_CLEAVE = 30495, - H_SPELL_SHADOW_SLAM = 35953, + SPELL_SHADOW_SLAM_H = 35953, SPELL_HEMORRHAGE = 30478, @@ -309,7 +309,7 @@ struct MANGOS_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI if (m_uiCleaveTimer < uiDiff) { - DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SHADOW_CLEAVE : H_SPELL_SHADOW_SLAM); + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SHADOW_CLEAVE : SPELL_SHADOW_SLAM_H); m_uiCleaveTimer = urand(6000, 8500); } else diff --git a/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp b/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp index b68fe31..c5d42f2 100644 --- a/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp +++ b/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp @@ -40,7 +40,7 @@ enum SPELL_THUNDERCLAP = 30633, SPELL_BURNING_MAUL = 30598, - H_SPELL_BURNING_MAUL = 36056, + SPELL_BURNING_MAUL_H = 36056, NPC_LEFT_HEAD = 19523, NPC_RIGHT_HEAD = 19524 @@ -347,7 +347,7 @@ struct MANGOS_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI if (m_uiBurningMaul_Timer < uiDiff) { DoScriptText(EMOTE_ENRAGE, m_creature); - DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_BURNING_MAUL : H_SPELL_BURNING_MAUL); + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_BURNING_MAUL : SPELL_BURNING_MAUL_H); m_uiBurningMaul_Timer = 40000; m_uiBlastWave_Timer = 16000; m_uiBlastCount = 1; diff --git a/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp index c080e30..faad9bd 100644 --- a/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp +++ b/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp @@ -1,296 +1,301 @@ -/* Copyright (C) 2006 - 2011 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warchief_Kargath_Bladefist -SD%Complete: 90 -SDComment: -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -/* ContentData -boss_warchief_kargath_bladefist -EndContentData */ - -#include "precompiled.h" - -#define SAY_AGGRO1 -1540042 -#define SAY_AGGRO2 -1540043 -#define SAY_AGGRO3 -1540044 -#define SAY_SLAY1 -1540045 -#define SAY_SLAY2 -1540046 -#define SAY_DEATH -1540047 - -#define SPELL_BLADE_DANCE 30739 -#define H_SPELL_CHARGE 25821 - -#define TARGET_NUM 5 - -#define MOB_SHATTERED_ASSASSIN 17695 -#define MOB_HEARTHEN_GUARD 17621 -#define MOB_SHARPSHOOTER_GUARD 17622 -#define MOB_REAVER_GUARD 17623 - -float AssassEntrance[3] = {275.136f, -84.29f, 2.3f}; // y -8 -float AssassExit[3] = {184.233f, -84.29f, 2.3f}; // y -8 -float AddsEntrance[3] = {306.036f, -84.29f, 1.93f}; - -struct MANGOS_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI -{ - boss_warchief_kargath_bladefistAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); - Reset(); - } - - ScriptedInstance* m_pInstance; - bool m_bIsRegularMode; - - GUIDVector adds; - GUIDVector assassins; - - uint32 Charge_timer; - uint32 Blade_Dance_Timer; - uint32 Summon_Assistant_Timer; - uint32 resetcheck_timer; - uint32 Wait_Timer; - - uint32 Assassins_Timer; - - uint32 summoned; - bool InBlade; - - uint32 target_num; - - void Reset() - { - removeAdds(); - - m_creature->SetSpeedRate(MOVE_RUN, 2.0f); - - summoned = 2; - InBlade = false; - Wait_Timer = 0; - - Charge_timer = 0; - Blade_Dance_Timer = 45000; - Summon_Assistant_Timer = 30000; - Assassins_Timer = 5000; - resetcheck_timer = 5000; - } - - void Aggro(Unit *who) - { - switch(urand(0, 2)) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - switch(summoned->GetEntry()) - { - case MOB_HEARTHEN_GUARD: - case MOB_SHARPSHOOTER_GUARD: - case MOB_REAVER_GUARD: - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(pTarget); - - adds.push_back(summoned->GetObjectGuid()); - break; - case MOB_SHATTERED_ASSASSIN: - assassins.push_back(summoned->GetObjectGuid()); - break; - } - } - - void KilledUnit(Unit *victim) - { - if (victim->GetTypeId() == TYPEID_PLAYER) - DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - removeAdds(); - } - - void MovementInform(uint32 type, uint32 id) - { - if (InBlade) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id != 1) - return; - - if (target_num > 0) // to prevent loops - { - Wait_Timer = 1; - DoCastSpellIfCan(m_creature, SPELL_BLADE_DANCE, CAST_TRIGGERED); - --target_num; - } - } - } - - void removeAdds() - { - if (!m_pInstance) - return; - - for(GUIDVector::const_iterator itr = adds.begin(); itr != adds.end(); ++itr) - { - if (Creature* pTemp = m_pInstance->instance->GetCreature(*itr)) - pTemp->ForcedDespawn(); - } - - adds.clear(); - - for(GUIDVector::const_iterator itr = assassins.begin(); itr != assassins.end(); ++itr) - { - if (Creature* pTemp = m_pInstance->instance->GetCreature(*itr)) - pTemp->ForcedDespawn(); - } - - assassins.clear(); - } - - void SpawnAssassin() - { - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - if (Assassins_Timer) - if (Assassins_Timer <= diff) - { - SpawnAssassin(); - Assassins_Timer = 0; - }else Assassins_Timer -= diff; - - if (InBlade) - { - if (Wait_Timer) - if (Wait_Timer <= diff) - { - if (target_num <= 0) - { - // stop bladedance - InBlade = false; - m_creature->SetSpeedRate(MOVE_RUN, 2.0f); - (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim()); - Wait_Timer = 0; - if (!m_bIsRegularMode) - Charge_timer = 5000; - } - else - { - //move in bladedance - float x,y,randx,randy; - randx = (rand()%40); - randy = (rand()%40); - x = 210+ randx ; - y = -60- randy ; - (*m_creature).GetMotionMaster()->MovePoint(1,x,y,m_creature->GetPositionZ()); - Wait_Timer = 0; - } - }else Wait_Timer -= diff; - } - else - { - if (Blade_Dance_Timer < diff) - { - target_num = TARGET_NUM; - Wait_Timer = 1; - InBlade = true; - Blade_Dance_Timer = 30000; - m_creature->SetSpeedRate(MOVE_RUN, 4.0f); - return; - }else Blade_Dance_Timer -= diff; - - if (Charge_timer) - if (Charge_timer <= diff) - { - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) - DoCastSpellIfCan(pTarget, H_SPELL_CHARGE); - - Charge_timer = 0; - }else Charge_timer -= diff; - - if (Summon_Assistant_Timer < diff) - { - Unit* target = NULL; - - for(uint32 i = 0; i < summoned; ++i) - { - switch(urand(0, 2)) - { - case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - case 2: m_creature->SummonCreature(MOB_REAVER_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - } - } - - if (!urand(0, 4)) - ++summoned; - - Summon_Assistant_Timer = urand(25000, 35000); - } - else Summon_Assistant_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - if (resetcheck_timer < diff) - { - uint32 tempx,tempy; - tempx = uint32(m_creature->GetPositionX()); - tempy = uint32(m_creature->GetPositionY()); - if (tempx > 255 || tempx < 205) - { - EnterEvadeMode(); - } - resetcheck_timer = 5000; - }else resetcheck_timer -= diff; - } -}; - -CreatureAI* GetAI_boss_warchief_kargath_bladefist(Creature* pCreature) -{ - return new boss_warchief_kargath_bladefistAI(pCreature); -} - -void AddSC_boss_warchief_kargath_bladefist() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_warchief_kargath_bladefist"; - newscript->GetAI = &GetAI_boss_warchief_kargath_bladefist; - newscript->RegisterSelf(); -} +/* Copyright (C) 2006 - 2011 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warchief_Kargath_Bladefist +SD%Complete: 90 +SDComment: +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +boss_warchief_kargath_bladefist +EndContentData */ + +#include "precompiled.h" + +#define SAY_AGGRO1 -1540042 +#define SAY_AGGRO2 -1540043 +#define SAY_AGGRO3 -1540044 +#define SAY_SLAY1 -1540045 +#define SAY_SLAY2 -1540046 +#define SAY_DEATH -1540047 + +#define SPELL_BLADE_DANCE 30739 +#define SPELL_CHARGE_H 25821 + +#define TARGET_NUM 5 + +#define MOB_SHATTERED_ASSASSIN 17695 +#define MOB_HEARTHEN_GUARD 17621 +#define MOB_SHARPSHOOTER_GUARD 17622 +#define MOB_REAVER_GUARD 17623 + +float AssassEntrance[3] = {275.136f, -84.29f, 2.3f}; // y -8 +float AssassExit[3] = {184.233f, -84.29f, 2.3f}; // y -8 +float AddsEntrance[3] = {306.036f, -84.29f, 1.93f}; + +struct MANGOS_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI +{ + boss_warchief_kargath_bladefistAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + GUIDVector adds; + GUIDVector assassins; + + uint32 Charge_timer; + uint32 Blade_Dance_Timer; + uint32 Summon_Assistant_Timer; + uint32 resetcheck_timer; + uint32 Wait_Timer; + + uint32 Assassins_Timer; + + uint32 summoned; + bool InBlade; + + uint32 target_num; + + void Reset() + { + removeAdds(); + + m_creature->SetSpeedRate(MOVE_RUN, 2.0f); + + summoned = 2; + InBlade = false; + Wait_Timer = 0; + + Charge_timer = 0; + Blade_Dance_Timer = 45000; + Summon_Assistant_Timer = 30000; + Assassins_Timer = 5000; + resetcheck_timer = 5000; + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + switch(summoned->GetEntry()) + { + case MOB_HEARTHEN_GUARD: + case MOB_SHARPSHOOTER_GUARD: + case MOB_REAVER_GUARD: + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(pTarget); + + adds.push_back(summoned->GetObjectGuid()); + break; + case MOB_SHATTERED_ASSASSIN: + assassins.push_back(summoned->GetObjectGuid()); + break; + } + } + + void KilledUnit(Unit *victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + removeAdds(); + + if (Creature * Executioner = m_creature->GetClosestCreatureWithEntry(m_creature, 17301, 60.0f)) + { + Executioner->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_PASSIVE); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (InBlade) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id != 1) + return; + + if (target_num > 0) // to prevent loops + { + Wait_Timer = 1; + DoCastSpellIfCan(m_creature, SPELL_BLADE_DANCE, CAST_TRIGGERED); + --target_num; + } + } + } + + void removeAdds() + { + if (!m_pInstance) + return; + + for(GUIDVector::const_iterator itr = adds.begin(); itr != adds.end(); ++itr) + { + if (Creature* pTemp = m_pInstance->instance->GetCreature(*itr)) + pTemp->ForcedDespawn(); + } + + adds.clear(); + + for(GUIDVector::const_iterator itr = assassins.begin(); itr != assassins.end(); ++itr) + { + if (Creature* pTemp = m_pInstance->instance->GetCreature(*itr)) + pTemp->ForcedDespawn(); + } + + assassins.clear(); + } + + void SpawnAssassin() + { + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Assassins_Timer) + if (Assassins_Timer <= diff) + { + SpawnAssassin(); + Assassins_Timer = 0; + }else Assassins_Timer -= diff; + + if (InBlade) + { + if (Wait_Timer) + if (Wait_Timer <= diff) + { + if (target_num <= 0) + { + // stop bladedance + InBlade = false; + m_creature->SetSpeedRate(MOVE_RUN, 2.0f); + (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim()); + Wait_Timer = 0; + if (!m_bIsRegularMode) + Charge_timer = 5000; + } + else + { + //move in bladedance + float x,y,randx,randy; + randx = (rand()%40); + randy = (rand()%40); + x = 210+ randx ; + y = -60- randy ; + (*m_creature).GetMotionMaster()->MovePoint(1,x,y,m_creature->GetPositionZ()); + Wait_Timer = 0; + } + }else Wait_Timer -= diff; + } + else + { + if (Blade_Dance_Timer < diff) + { + target_num = TARGET_NUM; + Wait_Timer = 1; + InBlade = true; + Blade_Dance_Timer = 30000; + m_creature->SetSpeedRate(MOVE_RUN, 4.0f); + return; + }else Blade_Dance_Timer -= diff; + + if (Charge_timer) + if (Charge_timer <= diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget, SPELL_CHARGE_H); + + Charge_timer = 0; + }else Charge_timer -= diff; + + if (Summon_Assistant_Timer < diff) + { + Unit* target = NULL; + + for(uint32 i = 0; i < summoned; ++i) + { + switch(urand(0, 2)) + { + case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 2: m_creature->SummonCreature(MOB_REAVER_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + } + } + + if (!urand(0, 4)) + ++summoned; + + Summon_Assistant_Timer = urand(25000, 35000); + } + else Summon_Assistant_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + if (resetcheck_timer < diff) + { + uint32 tempx,tempy; + tempx = uint32(m_creature->GetPositionX()); + tempy = uint32(m_creature->GetPositionY()); + if (tempx > 255 || tempx < 205) + { + EnterEvadeMode(); + } + resetcheck_timer = 5000; + }else resetcheck_timer -= diff; + } +}; + +CreatureAI* GetAI_boss_warchief_kargath_bladefist(Creature* pCreature) +{ + return new boss_warchief_kargath_bladefistAI(pCreature); +} + +void AddSC_boss_warchief_kargath_bladefist() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_warchief_kargath_bladefist"; + newscript->GetAI = &GetAI_boss_warchief_kargath_bladefist; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp b/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp index 26c6e15..d7e2250 100644 --- a/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp +++ b/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp @@ -56,8 +56,20 @@ void instance_shattered_halls::OnObjectCreate(GameObject* pGo) void instance_shattered_halls::OnCreatureCreate(Creature* pCreature) { - if (pCreature->GetEntry() == NPC_NETHEKURSE) - m_mNpcEntryGuidStore[NPC_NETHEKURSE] = pCreature->GetObjectGuid(); + switch(pCreature->GetEntry()) + { + case NPC_NETHEKURSE: + case NPC_DRISELLA: + case NPC_RANDY_WHIZZLESPROCKET: + case NPC_SCOUT_ORGARR: + case NPC_KORAG_PROUDMANE: + case NPC_CAPTAINBONESHATTER: + case NPC_PRIVATE_JACINT: + case NPC_RIFLEMAN_BROWNBEARD: + case NPC_CAPTAIN_ALINA: + m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid(); + break; + } } void instance_shattered_halls::SetData(uint32 uiType, uint32 uiData) @@ -124,6 +136,81 @@ InstanceData* GetInstanceData_instance_shattered_halls(Map* pMap) return new instance_shattered_halls(pMap); } +enum +{ + QUEST_IMPRISONED_IN_THE_CITADEL_A = 9524, + QUEST_IMPRISONED_IN_THE_CITADEL_H = 9525, + + AREATRIGGER_ENTER_1 = 4183, + AREATRIGGER_ENTER_2 = 4182, + AREATRIGGER_AFTER_NETHEKURSE = 4524, + + SPELL_KARGATHS_EXECUTIONER_1 = 39288, //55min + SPELL_KARGATHS_EXECUTIONER_2 = 39289, //10min + SPELL_KARGATHS_EXECUTIONER_3 = 39290, //15min +}; + +bool AreaTrigger_at_shattered_halls(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (instance_shattered_halls* pInstance = (instance_shattered_halls*)pPlayer->GetInstanceData()) + { + if (!pInstance->instance->IsRegularDifficulty()) + { + if (pPlayer->isGameMaster() || pPlayer->isDead()) + return false; + + if (pInstance->GetData(TYPE_NETHEKURSE) == DONE) + { + if (pPlayer->GetQuestStatus(QUEST_IMPRISONED_IN_THE_CITADEL_A) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(QUEST_IMPRISONED_IN_THE_CITADEL_H) == QUEST_STATUS_INCOMPLETE) + { + if (pAt->id == AREATRIGGER_AFTER_NETHEKURSE) + { + if (!pPlayer->HasAura(SPELL_KARGATHS_EXECUTIONER_1) || !pPlayer->HasAura(SPELL_KARGATHS_EXECUTIONER_2) || !pPlayer->HasAura(SPELL_KARGATHS_EXECUTIONER_3)) + { + pPlayer->CastSpell(pPlayer, SPELL_KARGATHS_EXECUTIONER_1, true); + if (pInstance->GetSingleCreatureFromStorage(NPC_SCOUT_ORGARR) || pInstance->GetSingleCreatureFromStorage(NPC_KORAG_PROUDMANE) || pInstance->GetSingleCreatureFromStorage(NPC_CAPTAINBONESHATTER) || pInstance->GetSingleCreatureFromStorage(NPC_PRIVATE_JACINT) || pInstance->GetSingleCreatureFromStorage(NPC_RIFLEMAN_BROWNBEARD) || pInstance->GetSingleCreatureFromStorage(NPC_CAPTAIN_ALINA)) + return false; + + if (pPlayer->GetTeam() == HORDE) + { + pPlayer->SummonCreature(NPC_SCOUT_ORGARR, 151.040f, -91.558f, 1.936f, 1.559f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 24*HOUR*IN_MILLISECONDS); + pPlayer->SummonCreature(NPC_KORAG_PROUDMANE, 150.669f, -77.015f, 1.933f, 4.705f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 24*HOUR*IN_MILLISECONDS); + pPlayer->SummonCreature(NPC_CAPTAINBONESHATTER, 138.241f, -84.198f, 1.907f, 0.055f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 24*HOUR*IN_MILLISECONDS); + } + if (pPlayer->GetTeam() == ALLIANCE) + { + pPlayer->SummonCreature(NPC_PRIVATE_JACINT, 151.040f, -91.558f, 1.936f, 1.559f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 24*HOUR*IN_MILLISECONDS); + pPlayer->SummonCreature(NPC_RIFLEMAN_BROWNBEARD, 150.669f, -77.015f, 1.933f, 4.705f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 24*HOUR*IN_MILLISECONDS); + pPlayer->SummonCreature(NPC_CAPTAIN_ALINA, 138.241f, -84.198f, 1.907f, 0.055f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 24*HOUR*IN_MILLISECONDS); + } + return false; + } + } + } + } + + if (pAt->id == AREATRIGGER_ENTER_1 || AREATRIGGER_ENTER_2) + { + if (pInstance->GetSingleCreatureFromStorage(NPC_DRISELLA) || pInstance->GetSingleCreatureFromStorage(NPC_RANDY_WHIZZLESPROCKET)) + return false; + + if (pPlayer->GetTeam() == HORDE) + { + pPlayer->SummonCreature(NPC_DRISELLA, 119.609f, 256.127f, -45.254f, 5.133f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 24*HOUR*IN_MILLISECONDS); + } + if (pPlayer->GetTeam() == ALLIANCE) + { + pPlayer->SummonCreature(NPC_RANDY_WHIZZLESPROCKET, 131.106f, 254.520f, -45.236f, 3.951f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 24*HOUR*IN_MILLISECONDS); + } + return false; + } + return false; + } + return false; + } + return false; +}; + void AddSC_instance_shattered_halls() { Script* pNewScript; @@ -132,4 +219,9 @@ void AddSC_instance_shattered_halls() pNewScript->Name = "instance_shattered_halls"; pNewScript->GetInstanceData = &GetInstanceData_instance_shattered_halls; pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_shattered_halls"; + pNewScript->pAreaTrigger = &AreaTrigger_at_shattered_halls; + pNewScript->RegisterSelf(); } diff --git a/scripts/outland/hellfire_citadel/shattered_halls/shattered_halls.h b/scripts/outland/hellfire_citadel/shattered_halls/shattered_halls.h index bc342ff..65ea45f 100644 --- a/scripts/outland/hellfire_citadel/shattered_halls/shattered_halls.h +++ b/scripts/outland/hellfire_citadel/shattered_halls/shattered_halls.h @@ -14,6 +14,14 @@ enum TYPE_BLADEFIST = 2, // TODO Currently unhandled NPC_NETHEKURSE = 16807, + NPC_DRISELLA = 17294, + NPC_RANDY_WHIZZLESPROCKET = 17288, + NPC_SCOUT_ORGARR = 17297, + NPC_KORAG_PROUDMANE = 17295, + NPC_CAPTAINBONESHATTER = 17296, + NPC_PRIVATE_JACINT = 17292, + NPC_RIFLEMAN_BROWNBEARD = 17289, + NPC_CAPTAIN_ALINA = 17290, GO_NETHEKURSE_DOOR = 182540, GO_NETHERKURSE_ENTER_DOOR = 182539, // TODO Currently unhandled diff --git a/scripts/outland/nagrand.cpp b/scripts/outland/nagrand.cpp index 529522d..070d38d 100644 --- a/scripts/outland/nagrand.cpp +++ b/scripts/outland/nagrand.cpp @@ -515,7 +515,7 @@ struct MANGOS_DLL_DECL npc_maghar_captiveAI : public npc_escortAI if (pSummoned->IsTotem()) return; - pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSummoned->SetWalk(false); pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); } diff --git a/scripts/outland/shadowmoon_valley.cpp b/scripts/outland/shadowmoon_valley.cpp index 7055cbf..83bd7f8 100644 --- a/scripts/outland/shadowmoon_valley.cpp +++ b/scripts/outland/shadowmoon_valley.cpp @@ -17,7 +17,7 @@ /* ScriptData SDName: Shadowmoon_Valley SD%Complete: 100 -SDComment: Quest support: 10519, 10583, 10601, 10781, 10814, 10804, 10854, 11082, 10458, 10480, 10481. Vendor Drake Dealer Hurlunk. +SDComment: Quest support: 10519, 10583, 10601, 10781, 10814, 10804, 10854, 11082, 10458, 10480, 10481, 11020. Vendor Drake Dealer Hurlunk. SDCategory: Shadowmoon Valley EndScriptData */ @@ -386,7 +386,7 @@ struct MANGOS_DLL_DECL npc_dragonmaw_peonAI : public ScriptedAI float fX, fY, fZ; pMutton->GetContactPoint(m_creature, fX, fY, fZ, CONTACT_DISTANCE); - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); m_creature->GetMotionMaster()->MovePoint(POINT_DEST, fX, fY, fZ); } } diff --git a/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp b/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp index 80691a8..cfe1a17 100644 --- a/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp +++ b/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp @@ -1,1524 +1,1522 @@ -/* Copyright (C) 2006 - 2011 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Kaelthas -SD%Complete: 60 -SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/uninterruptible), phoenix spawn location & animation, phoenix behaviour & spawn during gravity lapse -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "precompiled.h" -#include "the_eye.h" -#include "WorldPacket.h" - -enum -{ - //kael'thas Speech - SAY_INTRO = -1550016, - SAY_INTRO_CAPERNIAN = -1550017, - SAY_INTRO_TELONICUS = -1550018, - SAY_INTRO_THALADRED = -1550019, - SAY_INTRO_SANGUINAR = -1550020, - SAY_PHASE2_WEAPON = -1550021, - SAY_PHASE3_ADVANCE = -1550022, - SAY_PHASE4_INTRO2 = -1550023, - SAY_PHASE5_NUTS = -1550024, - SAY_SLAY1 = -1550025, - SAY_SLAY2 = -1550026, - SAY_SLAY3 = -1550027, - SAY_MINDCONTROL1 = -1550028, - SAY_MINDCONTROL2 = -1550029, - SAY_GRAVITYLAPSE1 = -1550030, - SAY_GRAVITYLAPSE2 = -1550031, - SAY_SUMMON_PHOENIX1 = -1550032, - SAY_SUMMON_PHOENIX2 = -1550033, - SAY_DEATH = -1550034, - - //Thaladred the Darkener speech - SAY_THALADRED_AGGRO = -1550035, - SAY_THALADRED_DEATH = -1550036, - EMOTE_THALADRED_GAZE = -1550037, - - //Lord Sanguinar speech - SAY_SANGUINAR_AGGRO = -1550038, - SAY_SANGUINAR_DEATH = -1550039, - - //Grand Astromancer Capernian speech - SAY_CAPERNIAN_AGGRO = -1550040, - SAY_CAPERNIAN_DEATH = -1550041, - - //Master Engineer Telonicus speech - SAY_TELONICUS_AGGRO = -1550042, - SAY_TELONICUS_DEATH = -1550043, - - //Phase 2 spells - SPELL_SUMMON_WEAPONS = 36976, - SPELL_SUMMON_WEAPONA = 36958, - SPELL_SUMMON_WEAPONB = 36959, - SPELL_SUMMON_WEAPONC = 36960, - SPELL_SUMMON_WEAPOND = 36961, - SPELL_SUMMON_WEAPONE = 36962, - SPELL_SUMMON_WEAPONF = 36963, - SPELL_SUMMON_WEAPONG = 36964, - SPELL_RES_VISUAL = 24171, - - //Phase 4 spells - SPELL_FIREBALL = 22088, //wrong but works with CastCustomSpell - SPELL_PYROBLAST = 36819, - SPELL_FLAME_STRIKE = 36735, // summons - SPELL_FLAME_STRIKE_DUMMY = 36730, - SPELL_ARCANE_DISRUPTION = 36834, - SPELL_SHOCK_BARRIER = 36815, - SPELL_PHOENIX_ANIMATION = 36723, - SPELL_MIND_CONTROL = 32830, - - //Phase 5 spells - SPELL_EXPLODE = 36092, - SPELL_FULLPOWER = 36187, - SPELL_KNOCKBACK = 11027, - SPELL_GRAVITY_LAPSE = 34480, - SPELL_GRAVITY_LAPSE_AURA = 39432, - SPELL_NETHER_BEAM = 35873, - - //Thaladred the Darkener spells - SPELL_PSYCHIC_BLOW = 10689, - SPELL_SILENCE = 30225, - //Lord Sanguinar spells - SPELL_BELLOWING_ROAR = 40636, - //Grand Astromancer Capernian spells - - SPELL_CAPERNIAN_FIREBALL = 36971, - SPELL_CONFLAGRATION = 37018, - SPELL_ARCANE_EXPLOSION = 36970, - //Master Engineer Telonicus spells - SPELL_BOMB = 37036, - SPELL_REMOTE_TOY = 37027, - //Nether Vapor spell - SPELL_NETHER_VAPOR = 35859, - //Phoenix spell - SPELL_BURN = 36720, - SPELL_EMBER_BLAST = 34341, - SPELL_REBIRTH = 41587, - - //Creature IDs - NPC_FLAME_STRIKE_TRIGGER = 21369, - NPC_PHOENIX = 21362, - NPC_PHOENIX_EGG = 21364, - - //Phoenix egg and phoenix model - MODEL_ID_PHOENIX = 19682, - MODEL_ID_PHOENIX_EGG = 20245, - - MAX_ADVISORS = 4 -}; - -static const uint32 aAdvisors[MAX_ADVISORS] = {NPC_THALADRED, NPC_SANGUINAR, NPC_CAPERNIAN, NPC_TELONICUS}; - -uint32 m_auiSpellSummonWeapon[]= -{ - SPELL_SUMMON_WEAPONA, SPELL_SUMMON_WEAPONB, SPELL_SUMMON_WEAPONC, SPELL_SUMMON_WEAPOND, - SPELL_SUMMON_WEAPONE, SPELL_SUMMON_WEAPONF, SPELL_SUMMON_WEAPONG -}; - -const float CAPERNIAN_DISTANCE = 20.0f; //she casts away from the target -const float KAEL_VISIBLE_RANGE = 50.0f; - -const float afGravityPos[3] = {795.0f, 0.0f, 70.0f}; - -#define TIME_PHASE_2_3 120000 -#define TIME_PHASE_3_4 180000 - -//Base AI for Advisors -struct MANGOS_DLL_DECL advisorbase_ai : public ScriptedAI -{ - advisorbase_ai(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - m_bDoubled_Health = false; - Reset(); - } - protected: - uint32 m_uiAdvisor_Speech; - - public: - ScriptedInstance* m_pInstance; - bool m_bFakeDeath; - bool m_bDoubled_Health; - uint32 m_uiDelayRes_Timer; - ObjectGuid m_delayResTargetGuid; - - void Reset() - { - if (m_bDoubled_Health) - { - m_creature->SetMaxHealth(m_creature->GetMaxHealth() / 2); - m_bDoubled_Health = false; - } - - m_bFakeDeath = false; - m_uiDelayRes_Timer = 0; - m_delayResTargetGuid.Clear(); - - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - //reset encounter - if (m_pInstance && (m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_1_ADVISOR || m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_3_ADVISOR_ALL)) - { - if (Creature* pKaelthas = m_pInstance->GetSingleCreatureFromStorage(NPC_KAELTHAS)) - pKaelthas->AI()->EnterEvadeMode(); - } - } - - void MoveInLineOfSight(Unit* pWho) - { - if (!pWho || m_bFakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(pWho); - } - - void AttackStart(Unit* pWho) - { - if (!pWho || m_bFakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(pWho); - } - - void Revive(Unit* Target) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // double health for phase 3 - m_creature->SetMaxHealth(m_creature->GetMaxHealth() * 2); - m_bDoubled_Health = true; - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - - DoCastSpellIfCan(m_creature, SPELL_RES_VISUAL); - m_uiDelayRes_Timer = 2000; - } - - void JustDied(Unit* pKiller) - { - if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_3_ADVISOR_ALL) - DoScriptText(m_uiAdvisor_Speech, m_creature); - } - - void DamageTaken(Unit* pKiller, uint32 &damage) - { - if (damage < m_creature->GetHealth()) - return; - - //Prevent glitch if in fake death - if (m_bFakeDeath && m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) != PHASE_0_NOT_BEGUN) - { - damage = 0; - return; - } - - //Don't really die in phase 1 & 3, only die after that - if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) != PHASE_0_NOT_BEGUN) - { - //prevent death - damage = 0; - m_bFakeDeath = true; - - m_creature->InterruptNonMeleeSpells(false); - m_creature->SetHealth(0); - m_creature->StopMoving(); - m_creature->ClearComboPointHolders(); - m_creature->RemoveAllAurasOnDeath(); - m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); - m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->ClearAllReactives(); - m_creature->SetTargetGuid(ObjectGuid()); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - JustDied(pKiller); - - if (m_creature->getVictim()) - m_delayResTargetGuid = m_creature->getVictim()->GetObjectGuid(); - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (m_uiDelayRes_Timer) - { - if (m_uiDelayRes_Timer <= uiDiff) - { - m_uiDelayRes_Timer = 0; - m_bFakeDeath = false; - - Unit* pTarget = m_creature->GetMap()->GetUnit(m_delayResTargetGuid); - - if (!pTarget || !pTarget->isAlive()) - pTarget = m_creature->getVictim(); - - if (!pTarget) - return; - - DoResetThreat(); - AttackStart(pTarget); - // In case of same target as before, AttackStart and Attack won't set the target guid. - m_creature->SetTargetGuid(pTarget->GetObjectGuid()); - - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(pTarget); - } - else - m_uiDelayRes_Timer -= uiDiff; - } - } - -}; - -//Kael'thas AI -struct MANGOS_DLL_DECL boss_kaelthasAI : public ScriptedAI -{ - boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - Reset(); - } - - ScriptedInstance* m_pInstance; - - uint32 m_uiFireball_Timer; - uint32 m_uiArcaneDisruption_Timer; - uint32 m_uiPhoenix_Timer; - uint32 m_uiShockBarrier_Timer; - uint32 m_uiGravityLapse_Timer; - uint32 m_uiGravityLapse_Phase; - uint32 m_uiNetherBeam_Timer; - uint32 m_uiNetherVapor_Timer; - uint32 m_uiFlameStrike_Timer; - uint32 m_uiMindControl_Timer; - uint32 m_uiPhase; - uint32 m_uiPhaseSubphase; //generic - uint32 m_uiPhase_Timer; //generic timer - uint32 m_uiPyrosCasted; - - bool m_bInGravityLapse; - bool m_bIsCastingFireball; - bool m_bChainPyros; - - void Reset() - { - m_uiFireball_Timer = urand(5000, 15000); - m_uiArcaneDisruption_Timer = 45000; - m_uiMindControl_Timer = 40000; - m_uiPhoenix_Timer = 50000; - m_uiShockBarrier_Timer = 60000; - m_uiFlameStrike_Timer = 30000; - m_uiGravityLapse_Timer = 20000; - m_uiGravityLapse_Phase = 0; - m_uiNetherBeam_Timer = 8000; - m_uiNetherVapor_Timer = 10000; - m_uiPyrosCasted = 0; - m_uiPhase = 0; - m_bInGravityLapse = false; - m_bIsCastingFireball = false; - m_bChainPyros = false; - - if (m_creature->isInCombat()) - PrepareAdvisors(); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (m_pInstance) - m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_0_NOT_BEGUN); - } - - void PrepareAdvisors() - { - if (!m_pInstance) - return; - - for(uint8 i = 0; i < MAX_ADVISORS; ++i) - { - if (Creature* pCreature = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[i])) - { - pCreature->Respawn(); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pCreature->setFaction(m_creature->getFaction()); - pCreature->AI()->EnterEvadeMode(); - } - } - } - - void StartEvent() - { - if (!m_pInstance) - return; - - bool bAdivsorsFound = true; - for (uint8 i = 0; i < MAX_ADVISORS; ++i) - { - if (!m_pInstance->GetSingleCreatureFromStorage(aAdvisors[i])) - bAdivsorsFound = false; - } - - if (!bAdivsorsFound) - { - error_log("SD2: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); - - DoScriptText(SAY_PHASE4_INTRO2, m_creature); - - m_uiPhase = PHASE_4_SOLO; - - m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_4_SOLO); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - AttackStart(pTarget); - - } - else - { - PrepareAdvisors(); - - DoScriptText(SAY_INTRO, m_creature); - - m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_1_ADVISOR); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - m_uiPhaseSubphase = 0; - m_uiPhase_Timer = 23000; - m_uiPhase = PHASE_1_ADVISOR; - } - } - - void MoveInLineOfSight(Unit* pWho) - { - if (pWho->isTargetableForAttack() && - m_creature->IsHostileTo(pWho) && pWho->isInAccessablePlaceFor(m_creature)) - { - if (!m_creature->CanFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(pWho); - if (m_creature->IsWithinDistInMap(pWho, attackRadius) && m_creature->IsWithinLOSInMap(pWho)) - { - if (!m_creature->getVictim() && m_uiPhase >= PHASE_4_SOLO) - { - pWho->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(pWho); - } - else if (m_creature->GetMap()->IsDungeon()) - { - if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_0_NOT_BEGUN && !m_uiPhase) - StartEvent(); - - pWho->SetInCombatWith(m_creature); - m_creature->AddThreat(pWho); - } - } - } - } - - void Aggro(Unit* pWho) - { - if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_0_NOT_BEGUN && !m_uiPhase) - StartEvent(); - } - - void KilledUnit(Unit* pUnit) - { - switch(urand(0, 2)) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustSummoned(Creature* pSummoned) - { - if (pSummoned->GetEntry() == NPC_FLAME_STRIKE_TRIGGER) - { - pSummoned->CastSpell(pSummoned, SPELL_FLAME_STRIKE_DUMMY, false, NULL, NULL, m_creature->GetObjectGuid()); - return; - } - - if (pSummoned->GetEntry() == NPC_PHOENIX) - { - return; - } - - // if not phoenix or trigger, then it's one of the 7 weapons - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - pSummoned->AI()->AttackStart(pTarget); - } - - void JustDied(Unit* pKiller) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - DoScriptText(SAY_DEATH, m_creature); - - if (m_pInstance) - { - m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_6_COMPLETE); - - for (uint8 i = 0; i < MAX_ADVISORS; ++i) - { - if (Creature* pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[i])) - pAdvisor->DealDamage(pAdvisor, pAdvisor->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Phase 1 - switch (m_uiPhase) - { - case PHASE_1_ADVISOR: - { - Unit* pTarget = NULL; - Creature* pAdvisor = NULL; - - //Subphase switch - switch(m_uiPhaseSubphase) - { - //Subphase 1 - Start - case 0: - if (m_uiPhase_Timer < uiDiff) - { - DoScriptText(SAY_INTRO_THALADRED, m_creature); - - //start advisor within 7 seconds - m_uiPhase_Timer = 7000; - ++m_uiPhaseSubphase; - } - else - m_uiPhase_Timer -= uiDiff; - - break; - - //Subphase 1 - Unlock advisor - case 1: - if (m_uiPhase_Timer < uiDiff) - { - if (m_pInstance) - pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[0]); - - if (pAdvisor) - { - pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pAdvisor->setFaction(m_creature->getFaction()); - - pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); - if (pTarget) - pAdvisor->AI()->AttackStart(pTarget); - } - - ++m_uiPhaseSubphase; - } - else - m_uiPhase_Timer -= uiDiff; - - break; - - //Subphase 2 - Start - case 2: - if (m_pInstance) - pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[0]); - - if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_SANGUINAR, m_creature); - - //start advisor within 12.5 seconds - m_uiPhase_Timer = 12500; - ++m_uiPhaseSubphase; - } - break; - - //Subphase 2 - Unlock advisor - case 3: - if (m_uiPhase_Timer < uiDiff) - { - if (m_pInstance) - pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[1]); - - if (pAdvisor) - { - pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pAdvisor->setFaction(m_creature->getFaction()); - - pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); - if (pTarget) - pAdvisor->AI()->AttackStart(pTarget); - } - - ++m_uiPhaseSubphase; - } - else - m_uiPhase_Timer -= uiDiff; - - break; - - //Subphase 3 - Start - case 4: - if (m_pInstance) - pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[1]); - - if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_CAPERNIAN, m_creature); - - //start advisor within 7 seconds - m_uiPhase_Timer = 7000; - ++m_uiPhaseSubphase; - } - break; - - //Subphase 3 - Unlock advisor - case 5: - if (m_uiPhase_Timer < uiDiff) - { - if (m_pInstance) - pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[2]); - - if (pAdvisor) - { - pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pAdvisor->setFaction(m_creature->getFaction()); - - pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); - if (pTarget) - pAdvisor->AI()->AttackStart(pTarget); - } - - ++m_uiPhaseSubphase; - } - else - m_uiPhase_Timer -= uiDiff; - - break; - - //Subphase 4 - Start - case 6: - if (m_pInstance) - pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[2]); - - if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_TELONICUS, m_creature); - - //start advisor within 8.4 seconds - m_uiPhase_Timer = 8400; - ++m_uiPhaseSubphase; - } - break; - - //Subphase 4 - Unlock advisor - case 7: - if (m_uiPhase_Timer < uiDiff) - { - if (m_pInstance) - pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[3]); - - if (pAdvisor) - { - pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pAdvisor->setFaction(m_creature->getFaction()); - - pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); - if (pTarget) - pAdvisor->AI()->AttackStart(pTarget); - } - - m_uiPhase_Timer = 3000; - ++m_uiPhaseSubphase; - }else m_uiPhase_Timer -= uiDiff; - break; - - //End of phase 1 - case 8: - if (m_pInstance) - pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[3]); - - if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - m_uiPhase = PHASE_2_WEAPON; - m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_2_WEAPON); - - DoScriptText(SAY_PHASE2_WEAPON, m_creature); - - m_uiPhaseSubphase = 0; - m_uiPhase_Timer = 3500; - DoCastSpellIfCan(m_creature, SPELL_SUMMON_WEAPONS); - } - break; - } - - break; - } - - case PHASE_2_WEAPON: - { - if (m_uiPhaseSubphase == 0) - { - if (m_uiPhase_Timer < uiDiff) - { - m_uiPhaseSubphase = 1; - }else m_uiPhase_Timer -= uiDiff; - } - - //Spawn weapons - if (m_uiPhaseSubphase == 1) - { - m_creature->CastSpell(m_creature, SPELL_SUMMON_WEAPONS, false); - - uint8 uiMaxWeapon = sizeof(m_auiSpellSummonWeapon)/sizeof(uint32); - - for (uint32 i = 0; i < uiMaxWeapon; ++i) - m_creature->CastSpell(m_creature,m_auiSpellSummonWeapon[i],true); - - m_uiPhaseSubphase = 2; - m_uiPhase_Timer = TIME_PHASE_2_3; - } - - if (m_uiPhaseSubphase == 2) - { - if (m_uiPhase_Timer < uiDiff) - { - DoScriptText(SAY_PHASE3_ADVANCE, m_creature); - m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_3_ADVISOR_ALL); - m_uiPhase = PHASE_3_ADVISOR_ALL; - m_uiPhaseSubphase = 0; - } - else - m_uiPhase_Timer -= uiDiff; - } - - break; - } - - case PHASE_3_ADVISOR_ALL: - { - if (m_uiPhaseSubphase == 0) - { - //Respawn advisors - Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); - - for (uint32 i = 0; i < MAX_ADVISORS; ++i) - { - if (m_pInstance) - { - if (Creature* pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[i])) - { - if (advisorbase_ai* pAdvisorAI = dynamic_cast(pAdvisor->AI())) - pAdvisorAI->Revive(pTarget); - } - } - } - - m_uiPhaseSubphase = 1; - m_uiPhase_Timer = TIME_PHASE_3_4; - } - - if (m_uiPhase_Timer < uiDiff) - { - DoScriptText(SAY_PHASE4_INTRO2, m_creature); - m_uiPhase = PHASE_4_SOLO; - - m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_4_SOLO); - - // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael. - DoResetThreat(); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - AttackStart(pTarget); - - m_uiPhase_Timer = 30000; - } - else - m_uiPhase_Timer -= uiDiff; - - break; - } - - case PHASE_4_SOLO: - case 5: - case 6: - { - //Return since we have no target - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - //m_uiFireball_Timer - if (!m_bInGravityLapse && !m_bChainPyros && m_uiPhase != 5) - { - if (m_uiFireball_Timer < uiDiff) - { - if (!m_bIsCastingFireball) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - //interruptable - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); - int32 uiDmg = irand(20000, 25000); - m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_FIREBALL, &uiDmg, 0, 0, false); - m_bIsCastingFireball = true; - m_uiFireball_Timer = 2500; - } - } - else - { - //apply resistance - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); - m_bIsCastingFireball = false; - m_uiFireball_Timer = urand(5000, 15000); - } - } - else - m_uiFireball_Timer -= uiDiff; - - //m_uiArcaneDisruption_Timer - if (m_uiArcaneDisruption_Timer < uiDiff) - { - DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCANE_DISRUPTION, CAST_TRIGGERED); - m_uiArcaneDisruption_Timer = 60000; - } - else - m_uiArcaneDisruption_Timer -= uiDiff; - - //m_uiFlameStrike_Timer - if (m_uiFlameStrike_Timer < uiDiff) - { - if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - DoCastSpellIfCan(pUnit, SPELL_FLAME_STRIKE); - - m_uiFlameStrike_Timer = 30000; - } - else - m_uiFlameStrike_Timer -= uiDiff; - - if (m_uiMindControl_Timer < uiDiff) - { - if (m_creature->getThreatManager().getThreatList().size() >= 2) - for (uint32 i = 0; i < 3; ++i) - { - debug_log("SD2: Kael'Thas mind control not supported."); - //DoCastSpellIfCan(pUnit, SPELL_MIND_CONTROL); - } - - m_uiMindControl_Timer = 60000; - } - else - m_uiMindControl_Timer -= uiDiff; - } - - // Summon Phoenix - if (m_uiPhoenix_Timer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_PHOENIX_ANIMATION) == CAST_OK) - { - DoScriptText(urand(0, 1) ? SAY_SUMMON_PHOENIX1 : SAY_SUMMON_PHOENIX2, m_creature); - m_uiPhoenix_Timer = 60000; - } - } - else - m_uiPhoenix_Timer -= uiDiff; - - //Phase 4 specific spells - if (m_uiPhase == PHASE_4_SOLO) - { - if (m_creature->GetHealthPercent() < 50.0f) - { - m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_5_GRAVITY); - m_uiPhase = PHASE_5_GRAVITY; - m_uiPhase_Timer = 10000; - - DoScriptText(SAY_PHASE5_NUTS, m_creature); - - m_creature->StopMoving(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - - m_creature->NearTeleportTo(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0.0f); - - m_creature->InterruptNonMeleeSpells(false); - DoCastSpellIfCan(m_creature, SPELL_FULLPOWER); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - //m_uiShockBarrier_Timer - if (m_uiShockBarrier_Timer < uiDiff) - { - DoCastSpellIfCan(m_creature, SPELL_SHOCK_BARRIER); - m_bChainPyros = true; - m_uiPyrosCasted = 0; - m_uiShockBarrier_Timer = 60000; - } - else - m_uiShockBarrier_Timer -= uiDiff; - - //Chain Pyros (3 of them max) - if (m_bChainPyros && !m_creature->IsNonMeleeSpellCasted(false)) - { - if (m_uiPyrosCasted < 3) - { - DoCastSpellIfCan(m_creature->getVictim(), SPELL_PYROBLAST); - ++m_uiPyrosCasted; - } - else - { - m_bChainPyros = false; - m_uiFireball_Timer = 2500; - m_uiArcaneDisruption_Timer = 60000; - } - } - } - - if (m_uiPhase == PHASE_5_GRAVITY) - { - if (m_uiPhase_Timer < uiDiff) - { - m_creature->InterruptNonMeleeSpells(false); - m_creature->RemoveAurasDueToSpell(SPELL_FULLPOWER); - - DoCastSpellIfCan(m_creature, SPELL_EXPLODE); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_uiPhase = 6; - AttackStart(m_creature->getVictim()); - } - else - m_uiPhase_Timer -= uiDiff; - } - - //Phase 5 - if (m_uiPhase == 6) - { - - //m_uiGravityLapse_Timer - if (m_uiGravityLapse_Timer < uiDiff) - { - switch(m_uiGravityLapse_Phase) - { - case 0: - { - m_creature->StopMoving(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - - m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0.0f); - m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], SPLINETYPE_NORMAL, SPLINEFLAG_NONE, 1); - - // 1) Kael'thas will portal the whole raid right into his body - std::vector vGuids; - m_creature->FillGuidsListFromThreatList(vGuids); - for (std::vector::const_iterator i = vGuids.begin();i != vGuids.end(); ++i) - { - Unit* pUnit = m_creature->GetMap()->GetUnit(*i); - - if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) - { - //Use work around packet to prevent player from being dropped from combat - DoTeleportPlayer(pUnit, afGravityPos[0], afGravityPos[1], afGravityPos[2], pUnit->GetOrientation()); - } - } - - m_uiGravityLapse_Timer = 500; - ++m_uiGravityLapse_Phase; - m_bInGravityLapse = true; - m_uiShockBarrier_Timer = 1000; - m_uiNetherBeam_Timer = 5000; - break; - } - case 1: - { - DoScriptText(urand(0, 1) ? SAY_GRAVITYLAPSE1 : SAY_GRAVITYLAPSE2, m_creature); - - // 2) At that point he will put a Gravity Lapse debuff on everyone - std::vector vGuids; - m_creature->FillGuidsListFromThreatList(vGuids); - for (std::vector::const_iterator i = vGuids.begin();i != vGuids.end(); ++i) - { - if (Unit* pUnit = m_creature->GetMap()->GetUnit(*i)) - { - m_creature->CastSpell(pUnit, SPELL_KNOCKBACK, true); - //Gravity lapse - needs an exception in Spell system to work - - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, NULL, NULL, m_creature->GetObjectGuid()); - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, NULL, NULL, m_creature->GetObjectGuid()); - } - } - m_uiGravityLapse_Timer = 10000; - ++m_uiGravityLapse_Phase; - break; - } - case 2: - //Cast nether vapor aura on self - m_creature->InterruptNonMeleeSpells(false); - DoCastSpellIfCan(m_creature, SPELL_NETHER_VAPOR); - - m_uiGravityLapse_Timer = 20000; - ++m_uiGravityLapse_Phase; - break; - - case 3: - { - //Remove flight - m_creature->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR); - m_bInGravityLapse = false; - m_uiGravityLapse_Timer = 60000; - m_uiGravityLapse_Phase = 0; - AttackStart(m_creature->getVictim()); - break; - } - } - } - else - m_uiGravityLapse_Timer -= uiDiff; - - if (m_bInGravityLapse) - { - //m_uiShockBarrier_Timer - if (m_uiShockBarrier_Timer < uiDiff) - { - DoCastSpellIfCan(m_creature, SPELL_SHOCK_BARRIER); - m_uiShockBarrier_Timer = 20000; - } - else - m_uiShockBarrier_Timer -= uiDiff; - - //m_uiNetherBeam_Timer - if (m_uiNetherBeam_Timer < uiDiff) - { - if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - DoCastSpellIfCan(pUnit, SPELL_NETHER_BEAM); - - m_uiNetherBeam_Timer = 4000; - } - else - m_uiNetherBeam_Timer -= uiDiff; - } - } - - if (!m_bInGravityLapse) - DoMeleeAttackIfReady(); - } - } - } -}; - -//Thaladred the Darkener AI -struct MANGOS_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai -{ - boss_thaladred_the_darkenerAI(Creature* pCreature) : advisorbase_ai(pCreature) - { - m_uiAdvisor_Speech = SAY_THALADRED_DEATH; - } - - uint32 m_uiGaze_Timer; - uint32 m_uiSilence_Timer; - uint32 m_uiPsychicBlow_Timer; - - void Reset() - { - m_uiGaze_Timer = 100; - m_uiSilence_Timer = 20000; - m_uiPsychicBlow_Timer = 10000; - - advisorbase_ai::Reset(); - } - - void Aggro(Unit* pWho) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!pWho || m_bFakeDeath) - return; - - DoScriptText(SAY_THALADRED_AGGRO, m_creature); - m_creature->AddThreat(pWho, 5000000.0f); - } - - void UpdateAI(const uint32 uiDiff) - { - advisorbase_ai::UpdateAI(uiDiff); - - //Faking death, don't do anything - if (m_bFakeDeath) - return; - - //Return since we have no target - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - //m_uiGaze_Timer - if (m_uiGaze_Timer < uiDiff) - { - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - { - DoResetThreat(); - m_creature->AddThreat(pTarget, 5000000.0f); - DoScriptText(EMOTE_THALADRED_GAZE, m_creature, pTarget); - } - m_uiGaze_Timer = 8500; - } - else - m_uiGaze_Timer -= uiDiff; - - //m_uiSilence_Timer - if (m_uiSilence_Timer < uiDiff) - { - DoCastSpellIfCan(m_creature->getVictim(), SPELL_SILENCE); - m_uiSilence_Timer = 20000; - } - else - m_uiSilence_Timer -= uiDiff; - - //m_uiPsychicBlow_Timer - if (m_uiPsychicBlow_Timer < uiDiff) - { - DoCastSpellIfCan(m_creature->getVictim(), SPELL_PSYCHIC_BLOW); - m_uiPsychicBlow_Timer = urand(20000, 25000); - } - else - m_uiPsychicBlow_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -//Lord Sanguinar AI -struct MANGOS_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai -{ - boss_lord_sanguinarAI(Creature* pCreature) : advisorbase_ai(pCreature) - { - m_uiAdvisor_Speech = SAY_SANGUINAR_DEATH; - } - - uint32 m_uiFear_Timer; - - void Reset() - { - m_uiFear_Timer = 20000; - advisorbase_ai::Reset(); - } - - void Aggro(Unit* pWho) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!pWho || m_bFakeDeath) - return; - - DoScriptText(SAY_SANGUINAR_AGGRO, m_creature); - } - - void UpdateAI(const uint32 uiDiff) - { - advisorbase_ai::UpdateAI(uiDiff); - - //Faking death, don't do anything - if (m_bFakeDeath) - return; - - //Return since we have no target - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - //m_uiFear_Timer - if (m_uiFear_Timer < uiDiff) - { - DoCastSpellIfCan(m_creature->getVictim(), SPELL_BELLOWING_ROAR); - m_uiFear_Timer = urand(25000, 35000); //approximately every 30 seconds - } - else - m_uiFear_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -//Grand Astromancer Capernian AI -struct MANGOS_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_ai -{ - boss_grand_astromancer_capernianAI(Creature* pCreature) : advisorbase_ai(pCreature) - { - m_uiAdvisor_Speech = SAY_CAPERNIAN_DEATH; - } - - uint32 m_uiFireball_Timer; - uint32 m_uiConflagration_Timer; - uint32 m_uiArcaneExplosion_Timer; - uint32 m_uiYell_Timer; - bool m_bYell; - - void Reset() - { - m_uiFireball_Timer = 2000; - m_uiConflagration_Timer = 20000; - m_uiArcaneExplosion_Timer = 5000; - m_uiYell_Timer = 2000; - m_bYell = false; - - advisorbase_ai::Reset(); - } - - void AttackStart(Unit* pWho) - { - if (!pWho || m_bFakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (m_creature->Attack(pWho, true)) - { - m_creature->AddThreat(pWho); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - m_creature->GetMotionMaster()->MoveChase(pWho, CAPERNIAN_DISTANCE); - } - } - - void Aggro(Unit *pWho) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!pWho || m_bFakeDeath) - return; - } - - void UpdateAI(const uint32 uiDiff) - { - advisorbase_ai::UpdateAI(uiDiff); - - //Faking Death, don't do anything - if (m_bFakeDeath) - return; - - //Return since we have no target - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - //m_uiYell_Timer - if (!m_bYell) - { - if (m_uiYell_Timer < uiDiff) - { - DoScriptText(SAY_CAPERNIAN_AGGRO, m_creature); - m_bYell = true; - } - else - m_uiYell_Timer -= uiDiff; - } - - //m_uiFireball_Timer - if (m_uiFireball_Timer < uiDiff) - { - DoCastSpellIfCan(m_creature->getVictim(), SPELL_CAPERNIAN_FIREBALL); - m_uiFireball_Timer = 4000; - } - else - m_uiFireball_Timer -= uiDiff; - - //m_uiConflagration_Timer - if (m_uiConflagration_Timer < uiDiff) - { - Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); - - if (pTarget && m_creature->IsWithinDistInMap(pTarget, 30.0f)) - DoCastSpellIfCan(pTarget, SPELL_CONFLAGRATION); - else - DoCastSpellIfCan(m_creature->getVictim(), SPELL_CONFLAGRATION); - - m_uiConflagration_Timer = urand(10000, 15000); - } - else - m_uiConflagration_Timer -= uiDiff; - - //m_uiArcaneExplosion_Timer - if (m_uiArcaneExplosion_Timer < uiDiff) - { - bool m_bInMeleeRange = false; - Unit* pTarget = NULL; - ThreatList const& tList = m_creature->getThreatManager().getThreatList(); - for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) - { - Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); - - //if in melee range - if (pUnit && m_creature->CanReachWithMeleeAttack(pUnit)) - { - m_bInMeleeRange = true; - pTarget = pUnit; - break; - } - } - - if (m_bInMeleeRange) - DoCastSpellIfCan(pTarget, SPELL_ARCANE_EXPLOSION); - - m_uiArcaneExplosion_Timer = urand(4000, 6000); - } - else - m_uiArcaneExplosion_Timer -= uiDiff; - - //Do NOT deal any melee damage. - } -}; - -//Master Engineer Telonicus AI -struct MANGOS_DLL_DECL boss_master_engineer_telonicusAI : public advisorbase_ai -{ - boss_master_engineer_telonicusAI(Creature* pCreature) : advisorbase_ai(pCreature) - { - m_uiAdvisor_Speech = SAY_TELONICUS_DEATH; - } - - uint32 m_uiBomb_Timer; - uint32 m_uiRemoteToy_Timer; - - void Reset() - { - m_uiBomb_Timer = 10000; - m_uiRemoteToy_Timer = 5000; - - advisorbase_ai::Reset(); - } - - void Aggro(Unit *pWho) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!pWho || m_bFakeDeath) - return; - - DoScriptText(SAY_TELONICUS_AGGRO, m_creature); - } - - void UpdateAI(const uint32 uiDiff) - { - advisorbase_ai::UpdateAI(uiDiff); - - //Faking Death, do nothing - if (m_bFakeDeath) - return; - - //Return since we have no target - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - //m_uiBomb_Timer - if (m_uiBomb_Timer < uiDiff) - { - DoCastSpellIfCan(m_creature->getVictim(), SPELL_BOMB); - m_uiBomb_Timer = 25000; - } - else - m_uiBomb_Timer -= uiDiff; - - //m_uiRemoteToy_Timer - if (m_uiRemoteToy_Timer < uiDiff) - { - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - DoCastSpellIfCan(pTarget, SPELL_REMOTE_TOY); - - m_uiRemoteToy_Timer = urand(10000, 15000); - } - else - m_uiRemoteToy_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -//Phoenix AI -struct MANGOS_DLL_DECL mob_phoenix_tkAI : public ScriptedAI -{ - mob_phoenix_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} - - uint32 m_uiCycle_Timer; - - void Reset() - { - m_uiCycle_Timer = 2000; - m_creature->CastSpell(m_creature,SPELL_BURN,true); - } - - void JustDied(Unit* pKiller) - { - //is this spell in use anylonger? - //m_creature->CastSpell(m_creature,SPELL_EMBER_BLAST,true); - m_creature->SummonCreature(NPC_PHOENIX_EGG,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,16000); - } - - void UpdateAI(const uint32 uiDiff) - { - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - if (m_uiCycle_Timer < uiDiff) - { - //spell Burn should possible do this, but it doesn't, so do this for now. - uint32 uiDmg = urand(4500,5500); - - if (m_creature->GetHealth() > uiDmg) - m_creature->SetHealth(uint32(m_creature->GetHealth()-uiDmg)); - - m_uiCycle_Timer = 2000; - } - else - m_uiCycle_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -//Phoenix Egg AI -struct MANGOS_DLL_DECL mob_phoenix_egg_tkAI : public ScriptedAI -{ - mob_phoenix_egg_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} - - uint32 m_uiRebirth_Timer; - - void Reset() - { - m_uiRebirth_Timer = 15000; - } - - //ignore any - void MoveInLineOfSight(Unit* pWho) { return; } - - void AttackStart(Unit* pWho) - { - if (m_creature->Attack(pWho, false)) - { - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - DoStartNoMovement(pWho); - } - } - - void JustSummoned(Creature* pSummoned) - { - pSummoned->AddThreat(m_creature->getVictim()); - pSummoned->CastSpell(pSummoned,SPELL_REBIRTH,false); - } - - void UpdateAI(const uint32 uiDiff) - { - if (!m_uiRebirth_Timer) - return; - - if (m_uiRebirth_Timer <= uiDiff) - { - m_creature->SummonCreature(NPC_PHOENIX,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,5000); - m_uiRebirth_Timer = 0; - } - else - m_uiRebirth_Timer -= uiDiff; - } -}; - -CreatureAI* GetAI_boss_kaelthas(Creature* pCreature) -{ - return new boss_kaelthasAI(pCreature); -} - -CreatureAI* GetAI_boss_thaladred_the_darkener(Creature* pCreature) -{ - return new boss_thaladred_the_darkenerAI(pCreature); -} - -CreatureAI* GetAI_boss_lord_sanguinar(Creature* pCreature) -{ - return new boss_lord_sanguinarAI(pCreature); -} - -CreatureAI* GetAI_boss_grand_astromancer_capernian(Creature* pCreature) -{ - return new boss_grand_astromancer_capernianAI(pCreature); -} - -CreatureAI* GetAI_boss_master_engineer_telonicus(Creature* pCreature) -{ - return new boss_master_engineer_telonicusAI(pCreature); -} - -CreatureAI* GetAI_mob_phoenix_tk(Creature* pCreature) -{ - return new mob_phoenix_tkAI(pCreature); -} - -CreatureAI* GetAI_mob_phoenix_egg_tk(Creature* pCreature) -{ - return new mob_phoenix_egg_tkAI(pCreature); -} - -void AddSC_boss_kaelthas() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_kaelthas"; - newscript->GetAI = &GetAI_boss_kaelthas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_thaladred_the_darkener"; - newscript->GetAI = &GetAI_boss_thaladred_the_darkener; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_lord_sanguinar"; - newscript->GetAI = &GetAI_boss_lord_sanguinar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_grand_astromancer_capernian"; - newscript->GetAI = &GetAI_boss_grand_astromancer_capernian; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_master_engineer_telonicus"; - newscript->GetAI = &GetAI_boss_master_engineer_telonicus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_phoenix_tk"; - newscript->GetAI = &GetAI_mob_phoenix_tk; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_phoenix_egg_tk"; - newscript->GetAI = &GetAI_mob_phoenix_egg_tk; - newscript->RegisterSelf(); -} +/* Copyright (C) 2006 - 2011 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kaelthas +SD%Complete: 60 +SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/uninterruptible), phoenix spawn location & animation, phoenix behaviour & spawn during gravity lapse +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "the_eye.h" +#include "WorldPacket.h" + +enum +{ + //kael'thas Speech + SAY_INTRO = -1550016, + SAY_INTRO_CAPERNIAN = -1550017, + SAY_INTRO_TELONICUS = -1550018, + SAY_INTRO_THALADRED = -1550019, + SAY_INTRO_SANGUINAR = -1550020, + SAY_PHASE2_WEAPON = -1550021, + SAY_PHASE3_ADVANCE = -1550022, + SAY_PHASE4_INTRO2 = -1550023, + SAY_PHASE5_NUTS = -1550024, + SAY_SLAY1 = -1550025, + SAY_SLAY2 = -1550026, + SAY_SLAY3 = -1550027, + SAY_MINDCONTROL1 = -1550028, + SAY_MINDCONTROL2 = -1550029, + SAY_GRAVITYLAPSE1 = -1550030, + SAY_GRAVITYLAPSE2 = -1550031, + SAY_SUMMON_PHOENIX1 = -1550032, + SAY_SUMMON_PHOENIX2 = -1550033, + SAY_DEATH = -1550034, + + //Thaladred the Darkener speech + SAY_THALADRED_AGGRO = -1550035, + SAY_THALADRED_DEATH = -1550036, + EMOTE_THALADRED_GAZE = -1550037, + + //Lord Sanguinar speech + SAY_SANGUINAR_AGGRO = -1550038, + SAY_SANGUINAR_DEATH = -1550039, + + //Grand Astromancer Capernian speech + SAY_CAPERNIAN_AGGRO = -1550040, + SAY_CAPERNIAN_DEATH = -1550041, + + //Master Engineer Telonicus speech + SAY_TELONICUS_AGGRO = -1550042, + SAY_TELONICUS_DEATH = -1550043, + + //Phase 2 spells + SPELL_SUMMON_WEAPONS = 36976, + SPELL_SUMMON_WEAPONA = 36958, + SPELL_SUMMON_WEAPONB = 36959, + SPELL_SUMMON_WEAPONC = 36960, + SPELL_SUMMON_WEAPOND = 36961, + SPELL_SUMMON_WEAPONE = 36962, + SPELL_SUMMON_WEAPONF = 36963, + SPELL_SUMMON_WEAPONG = 36964, + SPELL_RES_VISUAL = 24171, + + //Phase 4 spells + SPELL_FIREBALL = 22088, //wrong but works with CastCustomSpell + SPELL_PYROBLAST = 36819, + SPELL_FLAME_STRIKE = 36735, // summons + SPELL_FLAME_STRIKE_DUMMY = 36730, + SPELL_ARCANE_DISRUPTION = 36834, + SPELL_SHOCK_BARRIER = 36815, + SPELL_PHOENIX_ANIMATION = 36723, + SPELL_MIND_CONTROL = 32830, + + //Phase 5 spells + SPELL_EXPLODE = 36092, + SPELL_FULLPOWER = 36187, + SPELL_KNOCKBACK = 11027, + SPELL_GRAVITY_LAPSE = 34480, + SPELL_GRAVITY_LAPSE_AURA = 39432, + SPELL_NETHER_BEAM = 35873, + + //Thaladred the Darkener spells + SPELL_PSYCHIC_BLOW = 10689, + SPELL_SILENCE = 30225, + //Lord Sanguinar spells + SPELL_BELLOWING_ROAR = 40636, + //Grand Astromancer Capernian spells + + SPELL_CAPERNIAN_FIREBALL = 36971, + SPELL_CONFLAGRATION = 37018, + SPELL_ARCANE_EXPLOSION = 36970, + //Master Engineer Telonicus spells + SPELL_BOMB = 37036, + SPELL_REMOTE_TOY = 37027, + //Nether Vapor spell + SPELL_NETHER_VAPOR = 35859, + //Phoenix spell + SPELL_BURN = 36720, + SPELL_EMBER_BLAST = 34341, + SPELL_REBIRTH = 41587, + + //Creature IDs + NPC_FLAME_STRIKE_TRIGGER = 21369, + NPC_PHOENIX = 21362, + NPC_PHOENIX_EGG = 21364, + + //Phoenix egg and phoenix model + MODEL_ID_PHOENIX = 19682, + MODEL_ID_PHOENIX_EGG = 20245, + + MAX_ADVISORS = 4 +}; + +static const uint32 aAdvisors[MAX_ADVISORS] = {NPC_THALADRED, NPC_SANGUINAR, NPC_CAPERNIAN, NPC_TELONICUS}; + +uint32 m_auiSpellSummonWeapon[]= +{ + SPELL_SUMMON_WEAPONA, SPELL_SUMMON_WEAPONB, SPELL_SUMMON_WEAPONC, SPELL_SUMMON_WEAPOND, + SPELL_SUMMON_WEAPONE, SPELL_SUMMON_WEAPONF, SPELL_SUMMON_WEAPONG +}; + +const float CAPERNIAN_DISTANCE = 20.0f; //she casts away from the target +const float KAEL_VISIBLE_RANGE = 50.0f; + +const float afGravityPos[3] = {795.0f, 0.0f, 70.0f}; + +#define TIME_PHASE_2_3 120000 +#define TIME_PHASE_3_4 180000 + +//Base AI for Advisors +struct MANGOS_DLL_DECL advisorbase_ai : public ScriptedAI +{ + advisorbase_ai(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bDoubled_Health = false; + Reset(); + } + protected: + uint32 m_uiAdvisor_Speech; + + public: + ScriptedInstance* m_pInstance; + bool m_bFakeDeath; + bool m_bDoubled_Health; + uint32 m_uiDelayRes_Timer; + ObjectGuid m_delayResTargetGuid; + + void Reset() + { + if (m_bDoubled_Health) + { + m_creature->SetMaxHealth(m_creature->GetMaxHealth() / 2); + m_bDoubled_Health = false; + } + + m_bFakeDeath = false; + m_uiDelayRes_Timer = 0; + m_delayResTargetGuid.Clear(); + + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + //reset encounter + if (m_pInstance && (m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_1_ADVISOR || m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_3_ADVISOR_ALL)) + { + if (Creature* pKaelthas = m_pInstance->GetSingleCreatureFromStorage(NPC_KAELTHAS)) + pKaelthas->AI()->EnterEvadeMode(); + } + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!pWho || m_bFakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void AttackStart(Unit* pWho) + { + if (!pWho || m_bFakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(pWho); + } + + void Revive(Unit* Target) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // double health for phase 3 + m_creature->SetMaxHealth(m_creature->GetMaxHealth() * 2); + m_bDoubled_Health = true; + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + DoCastSpellIfCan(m_creature, SPELL_RES_VISUAL); + m_uiDelayRes_Timer = 2000; + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_3_ADVISOR_ALL) + DoScriptText(m_uiAdvisor_Speech, m_creature); + } + + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (damage < m_creature->GetHealth()) + return; + + //Prevent glitch if in fake death + if (m_bFakeDeath && m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) != PHASE_0_NOT_BEGUN) + { + damage = 0; + return; + } + + //Don't really die in phase 1 & 3, only die after that + if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) != PHASE_0_NOT_BEGUN) + { + //prevent death + damage = 0; + m_bFakeDeath = true; + + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetHealth(0); + m_creature->StopMoving(); + m_creature->ClearComboPointHolders(); + m_creature->RemoveAllAurasOnDeath(); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->ClearAllReactives(); + m_creature->SetTargetGuid(ObjectGuid()); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + JustDied(pKiller); + + if (m_creature->getVictim()) + m_delayResTargetGuid = m_creature->getVictim()->GetObjectGuid(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiDelayRes_Timer) + { + if (m_uiDelayRes_Timer <= uiDiff) + { + m_uiDelayRes_Timer = 0; + m_bFakeDeath = false; + + Unit* pTarget = m_creature->GetMap()->GetUnit(m_delayResTargetGuid); + + if (!pTarget || !pTarget->isAlive()) + pTarget = m_creature->getVictim(); + + if (!pTarget) + return; + + DoResetThreat(); + AttackStart(pTarget); + // In case of same target as before, AttackStart and Attack won't set the target guid. + m_creature->SetTargetGuid(pTarget->GetObjectGuid()); + + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(pTarget); + } + else + m_uiDelayRes_Timer -= uiDiff; + } + } + +}; + +//Kael'thas AI +struct MANGOS_DLL_DECL boss_kaelthasAI : public ScriptedAI +{ + boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiFireball_Timer; + uint32 m_uiArcaneDisruption_Timer; + uint32 m_uiPhoenix_Timer; + uint32 m_uiShockBarrier_Timer; + uint32 m_uiGravityLapse_Timer; + uint32 m_uiGravityLapse_Phase; + uint32 m_uiNetherBeam_Timer; + uint32 m_uiNetherVapor_Timer; + uint32 m_uiFlameStrike_Timer; + uint32 m_uiMindControl_Timer; + uint32 m_uiPhase; + uint32 m_uiPhaseSubphase; //generic + uint32 m_uiPhase_Timer; //generic timer + uint32 m_uiPyrosCasted; + + bool m_bInGravityLapse; + bool m_bIsCastingFireball; + bool m_bChainPyros; + + void Reset() + { + m_uiFireball_Timer = urand(5000, 15000); + m_uiArcaneDisruption_Timer = 45000; + m_uiMindControl_Timer = 40000; + m_uiPhoenix_Timer = 50000; + m_uiShockBarrier_Timer = 60000; + m_uiFlameStrike_Timer = 30000; + m_uiGravityLapse_Timer = 20000; + m_uiGravityLapse_Phase = 0; + m_uiNetherBeam_Timer = 8000; + m_uiNetherVapor_Timer = 10000; + m_uiPyrosCasted = 0; + m_uiPhase = 0; + m_bInGravityLapse = false; + m_bIsCastingFireball = false; + m_bChainPyros = false; + + if (m_creature->isInCombat()) + PrepareAdvisors(); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_0_NOT_BEGUN); + } + + void PrepareAdvisors() + { + if (!m_pInstance) + return; + + for(uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Creature* pCreature = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[i])) + { + pCreature->Respawn(); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->setFaction(m_creature->getFaction()); + pCreature->AI()->EnterEvadeMode(); + } + } + } + + void StartEvent() + { + if (!m_pInstance) + return; + + bool bAdivsorsFound = true; + for (uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (!m_pInstance->GetSingleCreatureFromStorage(aAdvisors[i])) + bAdivsorsFound = false; + } + + if (!bAdivsorsFound) + { + error_log("SD2: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); + + DoScriptText(SAY_PHASE4_INTRO2, m_creature); + + m_uiPhase = PHASE_4_SOLO; + + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_4_SOLO); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + AttackStart(pTarget); + + } + else + { + PrepareAdvisors(); + + DoScriptText(SAY_INTRO, m_creature); + + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_1_ADVISOR); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_uiPhaseSubphase = 0; + m_uiPhase_Timer = 23000; + m_uiPhase = PHASE_1_ADVISOR; + } + } + + void MoveInLineOfSight(Unit* pWho) + { + if (pWho->isTargetableForAttack() && + m_creature->IsHostileTo(pWho) && pWho->isInAccessablePlaceFor(m_creature)) + { + if (!m_creature->CanFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(pWho); + if (m_creature->IsWithinDistInMap(pWho, attackRadius) && m_creature->IsWithinLOSInMap(pWho)) + { + if (!m_creature->getVictim() && m_uiPhase >= PHASE_4_SOLO) + { + pWho->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(pWho); + } + else if (m_creature->GetMap()->IsDungeon()) + { + if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_0_NOT_BEGUN && !m_uiPhase) + StartEvent(); + + pWho->SetInCombatWith(m_creature); + m_creature->AddThreat(pWho); + } + } + } + } + + void Aggro(Unit* pWho) + { + if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_0_NOT_BEGUN && !m_uiPhase) + StartEvent(); + } + + void KilledUnit(Unit* pUnit) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_FLAME_STRIKE_TRIGGER) + { + pSummoned->CastSpell(pSummoned, SPELL_FLAME_STRIKE_DUMMY, false, NULL, NULL, m_creature->GetObjectGuid()); + return; + } + + if (pSummoned->GetEntry() == NPC_PHOENIX) + { + return; + } + + // if not phoenix or trigger, then it's one of the 7 weapons + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + } + + void JustDied(Unit* pKiller) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + { + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_6_COMPLETE); + + for (uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Creature* pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[i])) + pAdvisor->DealDamage(pAdvisor, pAdvisor->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Phase 1 + switch (m_uiPhase) + { + case PHASE_1_ADVISOR: + { + Unit* pTarget = NULL; + Creature* pAdvisor = NULL; + + //Subphase switch + switch(m_uiPhaseSubphase) + { + //Subphase 1 - Start + case 0: + if (m_uiPhase_Timer < uiDiff) + { + DoScriptText(SAY_INTRO_THALADRED, m_creature); + + //start advisor within 7 seconds + m_uiPhase_Timer = 7000; + ++m_uiPhaseSubphase; + } + else + m_uiPhase_Timer -= uiDiff; + + break; + + //Subphase 1 - Unlock advisor + case 1: + if (m_uiPhase_Timer < uiDiff) + { + if (m_pInstance) + pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[0]); + + if (pAdvisor) + { + pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAdvisor->setFaction(m_creature->getFaction()); + + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (pTarget) + pAdvisor->AI()->AttackStart(pTarget); + } + + ++m_uiPhaseSubphase; + } + else + m_uiPhase_Timer -= uiDiff; + + break; + + //Subphase 2 - Start + case 2: + if (m_pInstance) + pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[0]); + + if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_SANGUINAR, m_creature); + + //start advisor within 12.5 seconds + m_uiPhase_Timer = 12500; + ++m_uiPhaseSubphase; + } + break; + + //Subphase 2 - Unlock advisor + case 3: + if (m_uiPhase_Timer < uiDiff) + { + if (m_pInstance) + pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[1]); + + if (pAdvisor) + { + pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAdvisor->setFaction(m_creature->getFaction()); + + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (pTarget) + pAdvisor->AI()->AttackStart(pTarget); + } + + ++m_uiPhaseSubphase; + } + else + m_uiPhase_Timer -= uiDiff; + + break; + + //Subphase 3 - Start + case 4: + if (m_pInstance) + pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[1]); + + if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_CAPERNIAN, m_creature); + + //start advisor within 7 seconds + m_uiPhase_Timer = 7000; + ++m_uiPhaseSubphase; + } + break; + + //Subphase 3 - Unlock advisor + case 5: + if (m_uiPhase_Timer < uiDiff) + { + if (m_pInstance) + pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[2]); + + if (pAdvisor) + { + pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAdvisor->setFaction(m_creature->getFaction()); + + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (pTarget) + pAdvisor->AI()->AttackStart(pTarget); + } + + ++m_uiPhaseSubphase; + } + else + m_uiPhase_Timer -= uiDiff; + + break; + + //Subphase 4 - Start + case 6: + if (m_pInstance) + pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[2]); + + if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_TELONICUS, m_creature); + + //start advisor within 8.4 seconds + m_uiPhase_Timer = 8400; + ++m_uiPhaseSubphase; + } + break; + + //Subphase 4 - Unlock advisor + case 7: + if (m_uiPhase_Timer < uiDiff) + { + if (m_pInstance) + pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[3]); + + if (pAdvisor) + { + pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAdvisor->setFaction(m_creature->getFaction()); + + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (pTarget) + pAdvisor->AI()->AttackStart(pTarget); + } + + m_uiPhase_Timer = 3000; + ++m_uiPhaseSubphase; + }else m_uiPhase_Timer -= uiDiff; + break; + + //End of phase 1 + case 8: + if (m_pInstance) + pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[3]); + + if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + m_uiPhase = PHASE_2_WEAPON; + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_2_WEAPON); + + DoScriptText(SAY_PHASE2_WEAPON, m_creature); + + m_uiPhaseSubphase = 0; + m_uiPhase_Timer = 3500; + DoCastSpellIfCan(m_creature, SPELL_SUMMON_WEAPONS); + } + break; + } + + break; + } + + case PHASE_2_WEAPON: + { + if (m_uiPhaseSubphase == 0) + { + if (m_uiPhase_Timer < uiDiff) + { + m_uiPhaseSubphase = 1; + }else m_uiPhase_Timer -= uiDiff; + } + + //Spawn weapons + if (m_uiPhaseSubphase == 1) + { + m_creature->CastSpell(m_creature, SPELL_SUMMON_WEAPONS, false); + + uint8 uiMaxWeapon = sizeof(m_auiSpellSummonWeapon)/sizeof(uint32); + + for (uint32 i = 0; i < uiMaxWeapon; ++i) + m_creature->CastSpell(m_creature,m_auiSpellSummonWeapon[i],true); + + m_uiPhaseSubphase = 2; + m_uiPhase_Timer = TIME_PHASE_2_3; + } + + if (m_uiPhaseSubphase == 2) + { + if (m_uiPhase_Timer < uiDiff) + { + DoScriptText(SAY_PHASE3_ADVANCE, m_creature); + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_3_ADVISOR_ALL); + m_uiPhase = PHASE_3_ADVISOR_ALL; + m_uiPhaseSubphase = 0; + } + else + m_uiPhase_Timer -= uiDiff; + } + + break; + } + + case PHASE_3_ADVISOR_ALL: + { + if (m_uiPhaseSubphase == 0) + { + //Respawn advisors + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + for (uint32 i = 0; i < MAX_ADVISORS; ++i) + { + if (m_pInstance) + { + if (Creature* pAdvisor = m_pInstance->GetSingleCreatureFromStorage(aAdvisors[i])) + { + if (advisorbase_ai* pAdvisorAI = dynamic_cast(pAdvisor->AI())) + pAdvisorAI->Revive(pTarget); + } + } + } + + m_uiPhaseSubphase = 1; + m_uiPhase_Timer = TIME_PHASE_3_4; + } + + if (m_uiPhase_Timer < uiDiff) + { + DoScriptText(SAY_PHASE4_INTRO2, m_creature); + m_uiPhase = PHASE_4_SOLO; + + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_4_SOLO); + + // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael. + DoResetThreat(); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + AttackStart(pTarget); + + m_uiPhase_Timer = 30000; + } + else + m_uiPhase_Timer -= uiDiff; + + break; + } + + case PHASE_4_SOLO: + case 5: + case 6: + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiFireball_Timer + if (!m_bInGravityLapse && !m_bChainPyros && m_uiPhase != 5) + { + if (m_uiFireball_Timer < uiDiff) + { + if (!m_bIsCastingFireball) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + //interruptable + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); + int32 uiDmg = irand(20000, 25000); + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_FIREBALL, &uiDmg, 0, 0, false); + m_bIsCastingFireball = true; + m_uiFireball_Timer = 2500; + } + } + else + { + //apply resistance + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); + m_bIsCastingFireball = false; + m_uiFireball_Timer = urand(5000, 15000); + } + } + else + m_uiFireball_Timer -= uiDiff; + + //m_uiArcaneDisruption_Timer + if (m_uiArcaneDisruption_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCANE_DISRUPTION, CAST_TRIGGERED); + m_uiArcaneDisruption_Timer = 60000; + } + else + m_uiArcaneDisruption_Timer -= uiDiff; + + //m_uiFlameStrike_Timer + if (m_uiFlameStrike_Timer < uiDiff) + { + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pUnit, SPELL_FLAME_STRIKE); + + m_uiFlameStrike_Timer = 30000; + } + else + m_uiFlameStrike_Timer -= uiDiff; + + if (m_uiMindControl_Timer < uiDiff) + { + if (m_creature->getThreatManager().getThreatList().size() >= 2) + for (uint32 i = 0; i < 3; ++i) + { + debug_log("SD2: Kael'Thas mind control not supported."); + //DoCastSpellIfCan(pUnit, SPELL_MIND_CONTROL); + } + + m_uiMindControl_Timer = 60000; + } + else + m_uiMindControl_Timer -= uiDiff; + } + + // Summon Phoenix + if (m_uiPhoenix_Timer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_PHOENIX_ANIMATION) == CAST_OK) + { + DoScriptText(urand(0, 1) ? SAY_SUMMON_PHOENIX1 : SAY_SUMMON_PHOENIX2, m_creature); + m_uiPhoenix_Timer = 60000; + } + } + else + m_uiPhoenix_Timer -= uiDiff; + + //Phase 4 specific spells + if (m_uiPhase == PHASE_4_SOLO) + { + if (m_creature->GetHealthPercent() < 50.0f) + { + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_5_GRAVITY); + m_uiPhase = PHASE_5_GRAVITY; + m_uiPhase_Timer = 10000; + + DoScriptText(SAY_PHASE5_NUTS, m_creature); + + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_creature->NearTeleportTo(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0.0f); + + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature, SPELL_FULLPOWER); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + //m_uiShockBarrier_Timer + if (m_uiShockBarrier_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SHOCK_BARRIER); + m_bChainPyros = true; + m_uiPyrosCasted = 0; + m_uiShockBarrier_Timer = 60000; + } + else + m_uiShockBarrier_Timer -= uiDiff; + + //Chain Pyros (3 of them max) + if (m_bChainPyros && !m_creature->IsNonMeleeSpellCasted(false)) + { + if (m_uiPyrosCasted < 3) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PYROBLAST); + ++m_uiPyrosCasted; + } + else + { + m_bChainPyros = false; + m_uiFireball_Timer = 2500; + m_uiArcaneDisruption_Timer = 60000; + } + } + } + + if (m_uiPhase == PHASE_5_GRAVITY) + { + if (m_uiPhase_Timer < uiDiff) + { + m_creature->InterruptNonMeleeSpells(false); + m_creature->RemoveAurasDueToSpell(SPELL_FULLPOWER); + + DoCastSpellIfCan(m_creature, SPELL_EXPLODE); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_uiPhase = 6; + AttackStart(m_creature->getVictim()); + } + else + m_uiPhase_Timer -= uiDiff; + } + + //Phase 5 + if (m_uiPhase == 6) + { + + //m_uiGravityLapse_Timer + if (m_uiGravityLapse_Timer < uiDiff) + { + switch(m_uiGravityLapse_Phase) + { + case 0: + { + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->MonsterMoveWithSpeed(afGravityPos[0], afGravityPos[1], afGravityPos[2], 28.f); + + // 1) Kael'thas will portal the whole raid right into his body + std::vector vGuids; + m_creature->FillGuidsListFromThreatList(vGuids); + for (std::vector::const_iterator i = vGuids.begin();i != vGuids.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit(*i); + + if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) + { + //Use work around packet to prevent player from being dropped from combat + DoTeleportPlayer(pUnit, afGravityPos[0], afGravityPos[1], afGravityPos[2], pUnit->GetOrientation()); + } + } + + m_uiGravityLapse_Timer = 500; + ++m_uiGravityLapse_Phase; + m_bInGravityLapse = true; + m_uiShockBarrier_Timer = 1000; + m_uiNetherBeam_Timer = 5000; + break; + } + case 1: + { + DoScriptText(urand(0, 1) ? SAY_GRAVITYLAPSE1 : SAY_GRAVITYLAPSE2, m_creature); + + // 2) At that point he will put a Gravity Lapse debuff on everyone + std::vector vGuids; + m_creature->FillGuidsListFromThreatList(vGuids); + for (std::vector::const_iterator i = vGuids.begin();i != vGuids.end(); ++i) + { + if (Unit* pUnit = m_creature->GetMap()->GetUnit(*i)) + { + m_creature->CastSpell(pUnit, SPELL_KNOCKBACK, true); + //Gravity lapse - needs an exception in Spell system to work + + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, NULL, NULL, m_creature->GetObjectGuid()); + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, NULL, NULL, m_creature->GetObjectGuid()); + } + } + m_uiGravityLapse_Timer = 10000; + ++m_uiGravityLapse_Phase; + break; + } + case 2: + //Cast nether vapor aura on self + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature, SPELL_NETHER_VAPOR); + + m_uiGravityLapse_Timer = 20000; + ++m_uiGravityLapse_Phase; + break; + + case 3: + { + //Remove flight + m_creature->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR); + m_bInGravityLapse = false; + m_uiGravityLapse_Timer = 60000; + m_uiGravityLapse_Phase = 0; + AttackStart(m_creature->getVictim()); + break; + } + } + } + else + m_uiGravityLapse_Timer -= uiDiff; + + if (m_bInGravityLapse) + { + //m_uiShockBarrier_Timer + if (m_uiShockBarrier_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SHOCK_BARRIER); + m_uiShockBarrier_Timer = 20000; + } + else + m_uiShockBarrier_Timer -= uiDiff; + + //m_uiNetherBeam_Timer + if (m_uiNetherBeam_Timer < uiDiff) + { + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pUnit, SPELL_NETHER_BEAM); + + m_uiNetherBeam_Timer = 4000; + } + else + m_uiNetherBeam_Timer -= uiDiff; + } + } + + if (!m_bInGravityLapse) + DoMeleeAttackIfReady(); + } + } + } +}; + +//Thaladred the Darkener AI +struct MANGOS_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai +{ + boss_thaladred_the_darkenerAI(Creature* pCreature) : advisorbase_ai(pCreature) + { + m_uiAdvisor_Speech = SAY_THALADRED_DEATH; + } + + uint32 m_uiGaze_Timer; + uint32 m_uiSilence_Timer; + uint32 m_uiPsychicBlow_Timer; + + void Reset() + { + m_uiGaze_Timer = 100; + m_uiSilence_Timer = 20000; + m_uiPsychicBlow_Timer = 10000; + + advisorbase_ai::Reset(); + } + + void Aggro(Unit* pWho) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!pWho || m_bFakeDeath) + return; + + DoScriptText(SAY_THALADRED_AGGRO, m_creature); + m_creature->AddThreat(pWho, 5000000.0f); + } + + void UpdateAI(const uint32 uiDiff) + { + advisorbase_ai::UpdateAI(uiDiff); + + //Faking death, don't do anything + if (m_bFakeDeath) + return; + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiGaze_Timer + if (m_uiGaze_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoResetThreat(); + m_creature->AddThreat(pTarget, 5000000.0f); + DoScriptText(EMOTE_THALADRED_GAZE, m_creature, pTarget); + } + m_uiGaze_Timer = 8500; + } + else + m_uiGaze_Timer -= uiDiff; + + //m_uiSilence_Timer + if (m_uiSilence_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SILENCE); + m_uiSilence_Timer = 20000; + } + else + m_uiSilence_Timer -= uiDiff; + + //m_uiPsychicBlow_Timer + if (m_uiPsychicBlow_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PSYCHIC_BLOW); + m_uiPsychicBlow_Timer = urand(20000, 25000); + } + else + m_uiPsychicBlow_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Lord Sanguinar AI +struct MANGOS_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai +{ + boss_lord_sanguinarAI(Creature* pCreature) : advisorbase_ai(pCreature) + { + m_uiAdvisor_Speech = SAY_SANGUINAR_DEATH; + } + + uint32 m_uiFear_Timer; + + void Reset() + { + m_uiFear_Timer = 20000; + advisorbase_ai::Reset(); + } + + void Aggro(Unit* pWho) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!pWho || m_bFakeDeath) + return; + + DoScriptText(SAY_SANGUINAR_AGGRO, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + advisorbase_ai::UpdateAI(uiDiff); + + //Faking death, don't do anything + if (m_bFakeDeath) + return; + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiFear_Timer + if (m_uiFear_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BELLOWING_ROAR); + m_uiFear_Timer = urand(25000, 35000); //approximately every 30 seconds + } + else + m_uiFear_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Grand Astromancer Capernian AI +struct MANGOS_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_ai +{ + boss_grand_astromancer_capernianAI(Creature* pCreature) : advisorbase_ai(pCreature) + { + m_uiAdvisor_Speech = SAY_CAPERNIAN_DEATH; + } + + uint32 m_uiFireball_Timer; + uint32 m_uiConflagration_Timer; + uint32 m_uiArcaneExplosion_Timer; + uint32 m_uiYell_Timer; + bool m_bYell; + + void Reset() + { + m_uiFireball_Timer = 2000; + m_uiConflagration_Timer = 20000; + m_uiArcaneExplosion_Timer = 5000; + m_uiYell_Timer = 2000; + m_bYell = false; + + advisorbase_ai::Reset(); + } + + void AttackStart(Unit* pWho) + { + if (!pWho || m_bFakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, CAPERNIAN_DISTANCE); + } + } + + void Aggro(Unit *pWho) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!pWho || m_bFakeDeath) + return; + } + + void UpdateAI(const uint32 uiDiff) + { + advisorbase_ai::UpdateAI(uiDiff); + + //Faking Death, don't do anything + if (m_bFakeDeath) + return; + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiYell_Timer + if (!m_bYell) + { + if (m_uiYell_Timer < uiDiff) + { + DoScriptText(SAY_CAPERNIAN_AGGRO, m_creature); + m_bYell = true; + } + else + m_uiYell_Timer -= uiDiff; + } + + //m_uiFireball_Timer + if (m_uiFireball_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CAPERNIAN_FIREBALL); + m_uiFireball_Timer = 4000; + } + else + m_uiFireball_Timer -= uiDiff; + + //m_uiConflagration_Timer + if (m_uiConflagration_Timer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + if (pTarget && m_creature->IsWithinDistInMap(pTarget, 30.0f)) + DoCastSpellIfCan(pTarget, SPELL_CONFLAGRATION); + else + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CONFLAGRATION); + + m_uiConflagration_Timer = urand(10000, 15000); + } + else + m_uiConflagration_Timer -= uiDiff; + + //m_uiArcaneExplosion_Timer + if (m_uiArcaneExplosion_Timer < uiDiff) + { + bool m_bInMeleeRange = false; + Unit* pTarget = NULL; + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + //if in melee range + if (pUnit && m_creature->CanReachWithMeleeAttack(pUnit)) + { + m_bInMeleeRange = true; + pTarget = pUnit; + break; + } + } + + if (m_bInMeleeRange) + DoCastSpellIfCan(pTarget, SPELL_ARCANE_EXPLOSION); + + m_uiArcaneExplosion_Timer = urand(4000, 6000); + } + else + m_uiArcaneExplosion_Timer -= uiDiff; + + //Do NOT deal any melee damage. + } +}; + +//Master Engineer Telonicus AI +struct MANGOS_DLL_DECL boss_master_engineer_telonicusAI : public advisorbase_ai +{ + boss_master_engineer_telonicusAI(Creature* pCreature) : advisorbase_ai(pCreature) + { + m_uiAdvisor_Speech = SAY_TELONICUS_DEATH; + } + + uint32 m_uiBomb_Timer; + uint32 m_uiRemoteToy_Timer; + + void Reset() + { + m_uiBomb_Timer = 10000; + m_uiRemoteToy_Timer = 5000; + + advisorbase_ai::Reset(); + } + + void Aggro(Unit *pWho) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!pWho || m_bFakeDeath) + return; + + DoScriptText(SAY_TELONICUS_AGGRO, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + advisorbase_ai::UpdateAI(uiDiff); + + //Faking Death, do nothing + if (m_bFakeDeath) + return; + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiBomb_Timer + if (m_uiBomb_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BOMB); + m_uiBomb_Timer = 25000; + } + else + m_uiBomb_Timer -= uiDiff; + + //m_uiRemoteToy_Timer + if (m_uiRemoteToy_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_REMOTE_TOY); + + m_uiRemoteToy_Timer = urand(10000, 15000); + } + else + m_uiRemoteToy_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Phoenix AI +struct MANGOS_DLL_DECL mob_phoenix_tkAI : public ScriptedAI +{ + mob_phoenix_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiCycle_Timer; + + void Reset() + { + m_uiCycle_Timer = 2000; + m_creature->CastSpell(m_creature,SPELL_BURN,true); + } + + void JustDied(Unit* pKiller) + { + //is this spell in use anylonger? + //m_creature->CastSpell(m_creature,SPELL_EMBER_BLAST,true); + m_creature->SummonCreature(NPC_PHOENIX_EGG,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,16000); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiCycle_Timer < uiDiff) + { + //spell Burn should possible do this, but it doesn't, so do this for now. + uint32 uiDmg = urand(4500,5500); + + if (m_creature->GetHealth() > uiDmg) + m_creature->SetHealth(uint32(m_creature->GetHealth()-uiDmg)); + + m_uiCycle_Timer = 2000; + } + else + m_uiCycle_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Phoenix Egg AI +struct MANGOS_DLL_DECL mob_phoenix_egg_tkAI : public ScriptedAI +{ + mob_phoenix_egg_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiRebirth_Timer; + + void Reset() + { + m_uiRebirth_Timer = 15000; + } + + //ignore any + void MoveInLineOfSight(Unit* pWho) { return; } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, false)) + { + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + DoStartNoMovement(pWho); + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AddThreat(m_creature->getVictim()); + pSummoned->CastSpell(pSummoned,SPELL_REBIRTH,false); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_uiRebirth_Timer) + return; + + if (m_uiRebirth_Timer <= uiDiff) + { + m_creature->SummonCreature(NPC_PHOENIX,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,5000); + m_uiRebirth_Timer = 0; + } + else + m_uiRebirth_Timer -= uiDiff; + } +}; + +CreatureAI* GetAI_boss_kaelthas(Creature* pCreature) +{ + return new boss_kaelthasAI(pCreature); +} + +CreatureAI* GetAI_boss_thaladred_the_darkener(Creature* pCreature) +{ + return new boss_thaladred_the_darkenerAI(pCreature); +} + +CreatureAI* GetAI_boss_lord_sanguinar(Creature* pCreature) +{ + return new boss_lord_sanguinarAI(pCreature); +} + +CreatureAI* GetAI_boss_grand_astromancer_capernian(Creature* pCreature) +{ + return new boss_grand_astromancer_capernianAI(pCreature); +} + +CreatureAI* GetAI_boss_master_engineer_telonicus(Creature* pCreature) +{ + return new boss_master_engineer_telonicusAI(pCreature); +} + +CreatureAI* GetAI_mob_phoenix_tk(Creature* pCreature) +{ + return new mob_phoenix_tkAI(pCreature); +} + +CreatureAI* GetAI_mob_phoenix_egg_tk(Creature* pCreature) +{ + return new mob_phoenix_egg_tkAI(pCreature); +} + +void AddSC_boss_kaelthas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_kaelthas"; + newscript->GetAI = &GetAI_boss_kaelthas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_thaladred_the_darkener"; + newscript->GetAI = &GetAI_boss_thaladred_the_darkener; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lord_sanguinar"; + newscript->GetAI = &GetAI_boss_lord_sanguinar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_grand_astromancer_capernian"; + newscript->GetAI = &GetAI_boss_grand_astromancer_capernian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_master_engineer_telonicus"; + newscript->GetAI = &GetAI_boss_master_engineer_telonicus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phoenix_tk"; + newscript->GetAI = &GetAI_mob_phoenix_tk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phoenix_egg_tk"; + newscript->GetAI = &GetAI_mob_phoenix_egg_tk; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp index b44d62b..3807b95 100644 --- a/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp +++ b/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp @@ -1,136 +1,136 @@ -/* Copyright (C) 2006 - 2011 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Gatewatcher_Ironhand -SD%Complete: 75 -SDComment: -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO_1 -1554006 -#define SAY_HAMMER_1 -1554007 -#define SAY_HAMMER_2 -1554008 -#define SAY_SLAY_1 -1554009 -#define SAY_SLAY_2 -1554010 -#define SAY_DEATH_1 -1554011 -#define EMOTE_HAMMER -1554012 - -#define SPELL_SHADOW_POWER 35322 -#define H_SPELL_SHADOW_POWER 39193 -#define SPELL_HAMMER_PUNCH 35326 -#define SPELL_JACKHAMMER 35327 -#define H_SPELL_JACKHAMMER 39194 -#define SPELL_STREAM_OF_MACHINE_FLUID 35311 - -struct MANGOS_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI -{ - boss_gatewatcher_iron_handAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); - Reset(); - } - - ScriptedInstance* m_pInstance; - bool m_bIsRegularMode; - - uint32 Shadow_Power_Timer; - uint32 Jackhammer_Timer; - uint32 Stream_of_Machine_Fluid_Timer; - - void Reset() - { - Shadow_Power_Timer = 25000; - Jackhammer_Timer = 45000; - Stream_of_Machine_Fluid_Timer = 55000; - } - - void Aggro(Unit *who) - { - DoScriptText(SAY_AGGRO_1, m_creature); - } - - void KilledUnit(Unit* victim) - { - if (urand(0, 1)) - return; - - DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH_1, m_creature); - - if (!m_pInstance) - return; - - //TODO: Add door check/open code - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - //Shadow Power - if (Shadow_Power_Timer < diff) - { - DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SHADOW_POWER : H_SPELL_SHADOW_POWER); - Shadow_Power_Timer = urand(20000, 28000); - }else Shadow_Power_Timer -= diff; - - //Jack Hammer - if (Jackhammer_Timer < diff) - { - //TODO: expect cast this about 5 times in a row (?), announce it by emote only once - DoScriptText(EMOTE_HAMMER, m_creature); - DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_JACKHAMMER : H_SPELL_JACKHAMMER); - - //chance to yell, but not same time as emote (after spell in fact casted) - if (urand(0, 4)) - DoScriptText(urand(0, 1) ? SAY_HAMMER_1 : SAY_HAMMER_2, m_creature); - - Jackhammer_Timer = 30000; - }else Jackhammer_Timer -= diff; - - //Stream of Machine Fluid - if (Stream_of_Machine_Fluid_Timer < diff) - { - DoCastSpellIfCan(m_creature->getVictim(),SPELL_STREAM_OF_MACHINE_FLUID); - Stream_of_Machine_Fluid_Timer = urand(35000, 50000); - }else Stream_of_Machine_Fluid_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature* pCreature) -{ - return new boss_gatewatcher_iron_handAI(pCreature); -} - -void AddSC_boss_gatewatcher_iron_hand() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_gatewatcher_iron_hand"; - newscript->GetAI = &GetAI_boss_gatewatcher_iron_hand; - newscript->RegisterSelf(); -} +/* Copyright (C) 2006 - 2011 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gatewatcher_Ironhand +SD%Complete: 75 +SDComment: +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1554006 +#define SAY_HAMMER_1 -1554007 +#define SAY_HAMMER_2 -1554008 +#define SAY_SLAY_1 -1554009 +#define SAY_SLAY_2 -1554010 +#define SAY_DEATH_1 -1554011 +#define EMOTE_HAMMER -1554012 + +#define SPELL_SHADOW_POWER 35322 +#define SPELL_SHADOW_POWER_H 39193 +#define SPELL_HAMMER_PUNCH 35326 +#define SPELL_JACKHAMMER 35327 +#define SPELL_JACKHAMMER_H 39194 +#define SPELL_STREAM_OF_MACHINE_FLUID 35311 + +struct MANGOS_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI +{ + boss_gatewatcher_iron_handAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 Shadow_Power_Timer; + uint32 Jackhammer_Timer; + uint32 Stream_of_Machine_Fluid_Timer; + + void Reset() + { + Shadow_Power_Timer = 25000; + Jackhammer_Timer = 45000; + Stream_of_Machine_Fluid_Timer = 55000; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO_1, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (urand(0, 1)) + return; + + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH_1, m_creature); + + if (!m_pInstance) + return; + + //TODO: Add door check/open code + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Shadow Power + if (Shadow_Power_Timer < diff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SHADOW_POWER : SPELL_SHADOW_POWER_H); + Shadow_Power_Timer = urand(20000, 28000); + }else Shadow_Power_Timer -= diff; + + //Jack Hammer + if (Jackhammer_Timer < diff) + { + //TODO: expect cast this about 5 times in a row (?), announce it by emote only once + DoScriptText(EMOTE_HAMMER, m_creature); + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_JACKHAMMER : SPELL_JACKHAMMER_H); + + //chance to yell, but not same time as emote (after spell in fact casted) + if (urand(0, 4)) + DoScriptText(urand(0, 1) ? SAY_HAMMER_1 : SAY_HAMMER_2, m_creature); + + Jackhammer_Timer = 30000; + }else Jackhammer_Timer -= diff; + + //Stream of Machine Fluid + if (Stream_of_Machine_Fluid_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_STREAM_OF_MACHINE_FLUID); + Stream_of_Machine_Fluid_Timer = urand(35000, 50000); + }else Stream_of_Machine_Fluid_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature* pCreature) +{ + return new boss_gatewatcher_iron_handAI(pCreature); +} + +void AddSC_boss_gatewatcher_iron_hand() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gatewatcher_iron_hand"; + newscript->GetAI = &GetAI_boss_gatewatcher_iron_hand; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp index 9285647..57231e1 100644 --- a/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp +++ b/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp @@ -1,247 +1,247 @@ -/* Copyright (C) 2006 - 2011 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Nethermancer_Sepethrea -SD%Complete: 90 -SDComment: Need adjustments to initial summons -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "precompiled.h" -#include "mechanar.h" - -#define SAY_AGGRO -1554013 -#define SAY_SUMMON -1554014 -#define SAY_DRAGONS_BREATH_1 -1554015 -#define SAY_DRAGONS_BREATH_2 -1554016 -#define SAY_SLAY1 -1554017 -#define SAY_SLAY2 -1554018 -#define SAY_DEATH -1554019 - -#define SPELL_SUMMON_RAGIN_FLAMES 35275 - -#define SPELL_FROST_ATTACK 35263 -#define SPELL_ARCANE_BLAST 35314 -#define SPELL_DRAGONS_BREATH 35250 -#define SPELL_KNOCKBACK 37317 -#define SPELL_SOLARBURN 35267 - -struct MANGOS_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI -{ - boss_nethermancer_sepethreaAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); - Reset(); - } - - ScriptedInstance* m_pInstance; - bool m_bIsRegularMode; - - uint32 frost_attack_Timer; - uint32 arcane_blast_Timer; - uint32 dragons_breath_Timer; - uint32 knockback_Timer; - uint32 solarburn_Timer; - - void Reset() - { - frost_attack_Timer = urand(7000, 10000); - arcane_blast_Timer = urand(12000, 18000); - dragons_breath_Timer = urand(18000, 22000); - knockback_Timer = urand(22000, 28000); - solarburn_Timer = 30000; - } - - void Aggro(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - - //Summon two guards, three in heroic - uint8 am = (m_bIsRegularMode ? 2 : 1); - for(int i = 0; i < am; ++i) - { - DoCastSpellIfCan(who,SPELL_SUMMON_RAGIN_FLAMES); - } - - DoScriptText(SAY_SUMMON, m_creature); - } - - void KilledUnit(Unit* victim) - { - DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_SEPETHREA, DONE); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - //Frost Attack - if (frost_attack_Timer < diff) - { - DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROST_ATTACK); - frost_attack_Timer = urand(7000, 10000); - }else frost_attack_Timer -= diff; - - //Arcane Blast - if (arcane_blast_Timer < diff) - { - DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANE_BLAST); - arcane_blast_Timer = 15000; - }else arcane_blast_Timer -= diff; - - //Dragons Breath - if (dragons_breath_Timer < diff) - { - DoCastSpellIfCan(m_creature->getVictim(),SPELL_DRAGONS_BREATH); - - if (urand(0, 1)) - DoScriptText(urand(0, 1) ? SAY_DRAGONS_BREATH_1 : SAY_DRAGONS_BREATH_2, m_creature); - - dragons_breath_Timer = urand(12000, 22000); - }else dragons_breath_Timer -= diff; - - //Check for Knockback - if (knockback_Timer < diff) - { - DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKBACK); - knockback_Timer = urand(15000, 25000); - }else knockback_Timer -= diff; - - //Check for Solarburn - if (solarburn_Timer < diff) - { - DoCastSpellIfCan(m_creature->getVictim(),SPELL_SOLARBURN); - solarburn_Timer = 30000; - }else solarburn_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature* pCreature) -{ - return new boss_nethermancer_sepethreaAI(pCreature); -} - -#define SPELL_INFERNO 35268 -#define H_SPELL_INFERNO 39346 -#define SPELL_FIRE_TAIL 35278 - -struct MANGOS_DLL_DECL mob_ragin_flamesAI : public ScriptedAI -{ - mob_ragin_flamesAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); - Reset(); - } - - ScriptedInstance* m_pInstance; - bool m_bIsRegularMode; - - uint32 inferno_Timer; - uint32 flame_timer; - uint32 Check_Timer; - - bool onlyonce; - - void Reset() - { - inferno_Timer = 10000; - flame_timer = 500; - Check_Timer = 2000; - onlyonce = false; - m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); - m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - if (!onlyonce) - { - if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) - m_creature->GetMotionMaster()->MoveChase(target); - onlyonce = true; - } - - if (inferno_Timer < diff) - { - DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_INFERNO : H_SPELL_INFERNO); - - m_creature->TauntApply(m_creature->getVictim()); - - inferno_Timer = 10000; - }else inferno_Timer -= diff; - - if (flame_timer < diff) - { - DoCastSpellIfCan(m_creature,SPELL_FIRE_TAIL); - flame_timer = 500; - }else flame_timer -=diff; - - //Check_Timer - if (Check_Timer < diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_SEPETHREA) == DONE) - { - //remove - m_creature->SetDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - return; - } - } - - Check_Timer = 1000; - }else Check_Timer -= diff; - - DoMeleeAttackIfReady(); - } - -}; -CreatureAI* GetAI_mob_ragin_flames(Creature* pCreature) -{ - return new mob_ragin_flamesAI(pCreature); -} -void AddSC_boss_nethermancer_sepethrea() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_nethermancer_sepethrea"; - newscript->GetAI = &GetAI_boss_nethermancer_sepethrea; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ragin_flames"; - newscript->GetAI = &GetAI_mob_ragin_flames; - newscript->RegisterSelf(); -} +/* Copyright (C) 2006 - 2011 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Nethermancer_Sepethrea +SD%Complete: 90 +SDComment: Need adjustments to initial summons +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" +#include "mechanar.h" + +#define SAY_AGGRO -1554013 +#define SAY_SUMMON -1554014 +#define SAY_DRAGONS_BREATH_1 -1554015 +#define SAY_DRAGONS_BREATH_2 -1554016 +#define SAY_SLAY1 -1554017 +#define SAY_SLAY2 -1554018 +#define SAY_DEATH -1554019 + +#define SPELL_SUMMON_RAGIN_FLAMES 35275 + +#define SPELL_FROST_ATTACK 35263 +#define SPELL_ARCANE_BLAST 35314 +#define SPELL_DRAGONS_BREATH 35250 +#define SPELL_KNOCKBACK 37317 +#define SPELL_SOLARBURN 35267 + +struct MANGOS_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI +{ + boss_nethermancer_sepethreaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 frost_attack_Timer; + uint32 arcane_blast_Timer; + uint32 dragons_breath_Timer; + uint32 knockback_Timer; + uint32 solarburn_Timer; + + void Reset() + { + frost_attack_Timer = urand(7000, 10000); + arcane_blast_Timer = urand(12000, 18000); + dragons_breath_Timer = urand(18000, 22000); + knockback_Timer = urand(22000, 28000); + solarburn_Timer = 30000; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + //Summon two guards, three in heroic + uint8 am = (m_bIsRegularMode ? 2 : 1); + for(int i = 0; i < am; ++i) + { + DoCastSpellIfCan(who,SPELL_SUMMON_RAGIN_FLAMES); + } + + DoScriptText(SAY_SUMMON, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_SEPETHREA, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Frost Attack + if (frost_attack_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROST_ATTACK); + frost_attack_Timer = urand(7000, 10000); + }else frost_attack_Timer -= diff; + + //Arcane Blast + if (arcane_blast_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANE_BLAST); + arcane_blast_Timer = 15000; + }else arcane_blast_Timer -= diff; + + //Dragons Breath + if (dragons_breath_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_DRAGONS_BREATH); + + if (urand(0, 1)) + DoScriptText(urand(0, 1) ? SAY_DRAGONS_BREATH_1 : SAY_DRAGONS_BREATH_2, m_creature); + + dragons_breath_Timer = urand(12000, 22000); + }else dragons_breath_Timer -= diff; + + //Check for Knockback + if (knockback_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKBACK); + knockback_Timer = urand(15000, 25000); + }else knockback_Timer -= diff; + + //Check for Solarburn + if (solarburn_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SOLARBURN); + solarburn_Timer = 30000; + }else solarburn_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature* pCreature) +{ + return new boss_nethermancer_sepethreaAI(pCreature); +} + +#define SPELL_INFERNO 35268 +#define SPELL_INFERNO_H 39346 +#define SPELL_FIRE_TAIL 35278 + +struct MANGOS_DLL_DECL mob_ragin_flamesAI : public ScriptedAI +{ + mob_ragin_flamesAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 inferno_Timer; + uint32 flame_timer; + uint32 Check_Timer; + + bool onlyonce; + + void Reset() + { + inferno_Timer = 10000; + flame_timer = 500; + Check_Timer = 2000; + onlyonce = false; + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!onlyonce) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + m_creature->GetMotionMaster()->MoveChase(target); + onlyonce = true; + } + + if (inferno_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_INFERNO : SPELL_INFERNO_H); + + m_creature->TauntApply(m_creature->getVictim()); + + inferno_Timer = 10000; + }else inferno_Timer -= diff; + + if (flame_timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_FIRE_TAIL); + flame_timer = 500; + }else flame_timer -=diff; + + //Check_Timer + if (Check_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_SEPETHREA) == DONE) + { + //remove + m_creature->SetDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + return; + } + } + + Check_Timer = 1000; + }else Check_Timer -= diff; + + DoMeleeAttackIfReady(); + } + +}; +CreatureAI* GetAI_mob_ragin_flames(Creature* pCreature) +{ + return new mob_ragin_flamesAI(pCreature); +} +void AddSC_boss_nethermancer_sepethrea() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_nethermancer_sepethrea"; + newscript->GetAI = &GetAI_boss_nethermancer_sepethrea; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ragin_flames"; + newscript->GetAI = &GetAI_mob_ragin_flames; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp index 0cc9f53..fd41f0f 100644 --- a/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp +++ b/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp @@ -1,239 +1,239 @@ -/* Copyright (C) 2006 - 2011 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss Pathaleon the Calculator -SD%Complete: 50 -SDComment: Event missing. Script for himself 99% blizzlike. -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1554020 -#define SAY_DOMINATION_1 -1554021 -#define SAY_DOMINATION_2 -1554022 -#define SAY_SUMMON -1554023 -#define SAY_ENRAGE -1554024 -#define SAY_SLAY_1 -1554025 -#define SAY_SLAY_2 -1554026 -#define SAY_DEATH -1554027 - -// Spells to be casted -#define SPELL_MANA_TAP 36021 -#define SPELL_ARCANE_TORRENT 36022 -#define SPELL_DOMINATION 35280 -#define H_SPELL_ARCANE_EXPLOSION 15453 -#define SPELL_FRENZY 36992 - -#define SPELL_SUMMON_NETHER_WRAITH_1 35285 //Spells work, but not implemented -#define SPELL_SUMMON_NETHER_WRAITH_2 35286 -#define SPELL_SUMMON_NETHER_WRAITH_3 35287 -#define SPELL_SUMMON_NETHER_WRAITH_4 35288 - -// Add Spells -#define SPELL_DETONATION 35058 -#define SPELL_ARCANE_MISSILES 35034 - -struct MANGOS_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI -{ - boss_pathaleon_the_calculatorAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); - Reset(); - } - - bool m_bIsRegularMode; - - uint32 Summon_Timer; - uint32 ManaTap_Timer; - uint32 ArcaneTorrent_Timer; - uint32 Domination_Timer; - uint32 ArcaneExplosion_Timer; - bool Enraged; - - uint32 Counter; - - void Reset() - { - Summon_Timer = 30000; - ManaTap_Timer = urand(12000, 20000); - ArcaneTorrent_Timer = urand(16000, 25000); - Domination_Timer = urand(25000, 40000); - ArcaneExplosion_Timer = urand(8000, 13000); - - Enraged = false; - Counter = 0; - } - - void Aggro(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit* victim) - { - DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - if (Summon_Timer < diff) - { - for(int i = 0; i < 3; ++i) - { - Unit* target = NULL; - target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); - Creature* Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - if (target && Wraith) - Wraith->AI()->AttackStart(target); - } - - DoScriptText(SAY_SUMMON, m_creature); - - Summon_Timer = urand(30000, 45000); - }else Summon_Timer -= diff; - - if (ManaTap_Timer < diff) - { - DoCastSpellIfCan(m_creature->getVictim(),SPELL_MANA_TAP); - ManaTap_Timer = urand(14000, 22000); - }else ManaTap_Timer -= diff; - - if (ArcaneTorrent_Timer < diff) - { - DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANE_TORRENT); - ArcaneTorrent_Timer = urand(12000, 18000); - }else ArcaneTorrent_Timer -= diff; - - if (Domination_Timer < diff) - { - if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) - { - DoScriptText(urand(0, 1) ? SAY_DOMINATION_1 : SAY_DOMINATION_2, m_creature); - DoCastSpellIfCan(target,SPELL_DOMINATION); - } - - Domination_Timer = urand(25000, 30000); - }else Domination_Timer -= diff; - - //Only casting if Heroic Mode is used - if (!m_bIsRegularMode) - { - if (ArcaneExplosion_Timer < diff) - { - DoCastSpellIfCan(m_creature->getVictim(),H_SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = urand(10000, 14000); - }else ArcaneExplosion_Timer -= diff; - } - - if (!Enraged && m_creature->GetHealthPercent() < 21.0f) - { - DoCastSpellIfCan(m_creature, SPELL_FRENZY); - DoScriptText(SAY_ENRAGE, m_creature); - Enraged = true; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature) -{ - return new boss_pathaleon_the_calculatorAI(pCreature); -} - -struct MANGOS_DLL_DECL mob_nether_wraithAI : public ScriptedAI -{ - mob_nether_wraithAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} - - ScriptedInstance* m_pInstance; - - uint32 ArcaneMissiles_Timer; - uint32 Detonation_Timer; - uint32 Die_Timer; - bool Detonation; - - void Reset() - { - ArcaneMissiles_Timer = urand(1000, 4000); - Detonation_Timer = 20000; - Die_Timer = 2200; - Detonation = false; - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - if (ArcaneMissiles_Timer < diff) - { - if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) - DoCastSpellIfCan(target,SPELL_ARCANE_MISSILES); - else - DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANE_MISSILES); - - ArcaneMissiles_Timer = urand(5000, 10000); - }else ArcaneMissiles_Timer -=diff; - - if (!Detonation) - { - if (Detonation_Timer < diff) - { - DoCastSpellIfCan(m_creature,SPELL_DETONATION); - Detonation = true; - }else Detonation_Timer -= diff; - } - - if (Detonation) - { - if (Die_Timer < diff) - { - m_creature->SetDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - }else Die_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature) -{ - return new mob_nether_wraithAI(pCreature); -} - -void AddSC_boss_pathaleon_the_calculator() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_pathaleon_the_calculator"; - newscript->GetAI = &GetAI_boss_pathaleon_the_calculator; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_nether_wraith"; - newscript->GetAI = &GetAI_mob_nether_wraith; - newscript->RegisterSelf(); -} +/* Copyright (C) 2006 - 2011 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Pathaleon the Calculator +SD%Complete: 50 +SDComment: Event missing. Script for himself 99% blizzlike. +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1554020 +#define SAY_DOMINATION_1 -1554021 +#define SAY_DOMINATION_2 -1554022 +#define SAY_SUMMON -1554023 +#define SAY_ENRAGE -1554024 +#define SAY_SLAY_1 -1554025 +#define SAY_SLAY_2 -1554026 +#define SAY_DEATH -1554027 + +// Spells to be casted +#define SPELL_MANA_TAP 36021 +#define SPELL_ARCANE_TORRENT 36022 +#define SPELL_DOMINATION 35280 +#define SPELL_ARCANE_EXPLOSION_H 15453 +#define SPELL_FRENZY 36992 + +#define SPELL_SUMMON_NETHER_WRAITH_1 35285 //Spells work, but not implemented +#define SPELL_SUMMON_NETHER_WRAITH_2 35286 +#define SPELL_SUMMON_NETHER_WRAITH_3 35287 +#define SPELL_SUMMON_NETHER_WRAITH_4 35288 + +// Add Spells +#define SPELL_DETONATION 35058 +#define SPELL_ARCANE_MISSILES 35034 + +struct MANGOS_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI +{ + boss_pathaleon_the_calculatorAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + + uint32 Summon_Timer; + uint32 ManaTap_Timer; + uint32 ArcaneTorrent_Timer; + uint32 Domination_Timer; + uint32 ArcaneExplosion_Timer; + bool Enraged; + + uint32 Counter; + + void Reset() + { + Summon_Timer = 30000; + ManaTap_Timer = urand(12000, 20000); + ArcaneTorrent_Timer = urand(16000, 25000); + Domination_Timer = urand(25000, 40000); + ArcaneExplosion_Timer = urand(8000, 13000); + + Enraged = false; + Counter = 0; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Summon_Timer < diff) + { + for(int i = 0; i < 3; ++i) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + Creature* Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + if (target && Wraith) + Wraith->AI()->AttackStart(target); + } + + DoScriptText(SAY_SUMMON, m_creature); + + Summon_Timer = urand(30000, 45000); + }else Summon_Timer -= diff; + + if (ManaTap_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MANA_TAP); + ManaTap_Timer = urand(14000, 22000); + }else ManaTap_Timer -= diff; + + if (ArcaneTorrent_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANE_TORRENT); + ArcaneTorrent_Timer = urand(12000, 18000); + }else ArcaneTorrent_Timer -= diff; + + if (Domination_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + { + DoScriptText(urand(0, 1) ? SAY_DOMINATION_1 : SAY_DOMINATION_2, m_creature); + DoCastSpellIfCan(target,SPELL_DOMINATION); + } + + Domination_Timer = urand(25000, 30000); + }else Domination_Timer -= diff; + + //Only casting if Heroic Mode is used + if (!m_bIsRegularMode) + { + if (ArcaneExplosion_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANE_EXPLOSION_H); + ArcaneExplosion_Timer = urand(10000, 14000); + }else ArcaneExplosion_Timer -= diff; + } + + if (!Enraged && m_creature->GetHealthPercent() < 21.0f) + { + DoCastSpellIfCan(m_creature, SPELL_FRENZY); + DoScriptText(SAY_ENRAGE, m_creature); + Enraged = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature) +{ + return new boss_pathaleon_the_calculatorAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_nether_wraithAI : public ScriptedAI +{ + mob_nether_wraithAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + ScriptedInstance* m_pInstance; + + uint32 ArcaneMissiles_Timer; + uint32 Detonation_Timer; + uint32 Die_Timer; + bool Detonation; + + void Reset() + { + ArcaneMissiles_Timer = urand(1000, 4000); + Detonation_Timer = 20000; + Die_Timer = 2200; + Detonation = false; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (ArcaneMissiles_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + DoCastSpellIfCan(target,SPELL_ARCANE_MISSILES); + else + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANE_MISSILES); + + ArcaneMissiles_Timer = urand(5000, 10000); + }else ArcaneMissiles_Timer -=diff; + + if (!Detonation) + { + if (Detonation_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_DETONATION); + Detonation = true; + }else Detonation_Timer -= diff; + } + + if (Detonation) + { + if (Die_Timer < diff) + { + m_creature->SetDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + }else Die_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature) +{ + return new mob_nether_wraithAI(pCreature); +} + +void AddSC_boss_pathaleon_the_calculator() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_pathaleon_the_calculator"; + newscript->GetAI = &GetAI_boss_pathaleon_the_calculator; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_nether_wraith"; + newscript->GetAI = &GetAI_mob_nether_wraith; + newscript->RegisterSelf(); +} diff --git a/scripts/world/bosses_emerald_dragons.cpp b/scripts/world/bosses_emerald_dragons.cpp index 351b4c4..f0247af 100644 --- a/scripts/world/bosses_emerald_dragons.cpp +++ b/scripts/world/bosses_emerald_dragons.cpp @@ -116,7 +116,7 @@ struct MANGOS_DLL_DECL boss_emerald_dragonAI : public ScriptedAI { DoCastSpellIfCan(m_creature, SPELL_SEEPING_FOG_R, CAST_TRIGGERED); DoCastSpellIfCan(m_creature, SPELL_SEEPING_FOG_L, CAST_TRIGGERED); - m_uiSeepingFogTimer = urand(8000, 16000); + m_uiSeepingFogTimer = urand(120000, 150000); // Rather Guesswork, but one Fog has 2min duration, hence a bit longer } else m_uiSeepingFogTimer -= uiDiff; diff --git a/scripts/world/go_scripts.cpp b/scripts/world/go_scripts.cpp index 15fc90d..4c0dee7 100644 --- a/scripts/world/go_scripts.cpp +++ b/scripts/world/go_scripts.cpp @@ -39,6 +39,7 @@ go_tele_to_violet_stand go_andorhal_tower go_scourge_enclosure go_lab_work_reagents +go_hand_of_iruxos_crystal EndContentData */ #include "precompiled.h" diff --git a/scripts/world/item_scripts.cpp b/scripts/world/item_scripts.cpp index aa7bfe3..aafbd55 100644 --- a/scripts/world/item_scripts.cpp +++ b/scripts/world/item_scripts.cpp @@ -25,6 +25,7 @@ EndScriptData */ item_arcane_charges Prevent use if player is not flying (cannot cast while on ground) item_flying_machine(i34060,i34061) Engineering crafted flying machines item_gor_dreks_ointment(i30175) Protecting Our Own(q10488) +Item_jungle_punch_offer EndContentData */ #include "precompiled.h" @@ -127,6 +128,30 @@ bool ItemUse_item_petrov_cluster_bombs(Player* pPlayer, Item* pItem, const Spell return false; } +/*#### +# jungle_punch_ +####*/ + +enum +{ + SPELL_OFFER_JUNGLE_PUNCH = 51962 +}; + +bool ItemUse_item_jungle_punch_sample(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets) +{ + Unit* pTarget = pPlayer->GetMap()->GetUnit(pPlayer->GetTargetGuid()); + if (pTarget && pTarget->GetTypeId() == TYPEID_UNIT) + { + pPlayer->CastSpell(pTarget, SPELL_OFFER_JUNGLE_PUNCH, false); + return true; + } + else + { + pPlayer->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + return true; + } +} + void AddSC_item_scripts() { Script *newscript; @@ -150,4 +175,9 @@ void AddSC_item_scripts() newscript->Name = "item_petrov_cluster_bombs"; newscript->pItemUse = &ItemUse_item_petrov_cluster_bombs; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "item_jungle_punch_sample"; + newscript->pItemUse = &ItemUse_item_jungle_punch_sample; + newscript->RegisterSelf(); } diff --git a/scripts/world/npcs_special.cpp b/scripts/world/npcs_special.cpp index 54f5114..2e84ad3 100644 --- a/scripts/world/npcs_special.cpp +++ b/scripts/world/npcs_special.cpp @@ -584,7 +584,7 @@ struct MANGOS_DLL_DECL npc_injured_patientAI : public ScriptedAI case 2: DoScriptText(SAY_DOC3,m_creature); break; } - m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetWalk(false); uint32 mobId = m_creature->GetEntry(); @@ -2037,7 +2037,7 @@ struct MANGOS_DLL_DECL npc_death_knight_gargoyle : public ScriptedAI m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_0, 50331648); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 50331648); - m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetLevitate(true); inCombat = false; m_uiGargoyleStrikeTimer = urand(3000, 5000); diff --git a/sd2_revision_nr.h b/sd2_revision_nr.h index 36b6727..eada819 100644 --- a/sd2_revision_nr.h +++ b/sd2_revision_nr.h @@ -1,4 +1,4 @@ #ifndef __SD2_REVISION_NR_H__ #define __SD2_REVISION_NR_H__ - #define SD2_REVISION_NR "2225" + #define SD2_REVISION_NR "2261" #endif // __SD2_REVISION_NR_H__ diff --git a/sql/Updates/r2227_mangos.sql b/sql/Updates/r2227_mangos.sql new file mode 100644 index 0000000..fe4df60 --- /dev/null +++ b/sql/Updates/r2227_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_crystal_channel_target' WHERE entry=26712; diff --git a/sql/Updates/r2229_mangos.sql b/sql/Updates/r2229_mangos.sql new file mode 100644 index 0000000..44d66d2 --- /dev/null +++ b/sql/Updates/r2229_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_relic_coffer_door' WHERE entry IN (174554, 174555, 174556, 174557, 174558, 174559, 174560, 174561, 174562, 174563, 174564, 174566); diff --git a/sql/Updates/r2235_mangos.sql b/sql/Updates/r2235_mangos.sql new file mode 100644 index 0000000..0d2d8c7 --- /dev/null +++ b/sql/Updates/r2235_mangos.sql @@ -0,0 +1,2 @@ +DELETE FROM scripted_areatrigger WHERE entry=3626; +INSERT INTO scripted_areatrigger VALUES (3626, 'at_vaelastrasz'); diff --git a/sql/Updates/r2235_scriptdev2.sql b/sql/Updates/r2235_scriptdev2.sql new file mode 100644 index 0000000..c138d9d --- /dev/null +++ b/sql/Updates/r2235_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1469034; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1469034,'Run! They are coming.',0,1,0,0,'blackwing technician SAY_TECHNICIAN_RUN'); diff --git a/sql/Updates/r2239_scriptdev2.sql b/sql/Updates/r2239_scriptdev2.sql new file mode 100644 index 0000000..e24c053 --- /dev/null +++ b/sql/Updates/r2239_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 11720+) '; diff --git a/sql/Updates/r2242_scriptdev2.sql b/sql/Updates/r2242_scriptdev2.sql new file mode 100644 index 0000000..643ecc4 --- /dev/null +++ b/sql/Updates/r2242_scriptdev2.sql @@ -0,0 +1,32 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1580063 AND -1580036; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1580036,'Glory to Kil\'jaeden! Death to all who oppose!',12477,1,0,0,'felmyst SAY_INTRO'), +(-1580037,'I kill for the master!',12480,1,0,0,'felmyst SAY_KILL_1'), +(-1580038,'The end has come! ',12481,1,0,0,'felmyst SAY_KILL_2'), +(-1580039,'Choke on your final breath! ',12478,1,0,0,'felmyst SAY_BREATH'), +(-1580040,'I am stronger than ever before! ',12479,1,0,0,'felmyst SAY_TAKEOFF'), +(-1580041,'No more hesitation! Your fates are written! ',12482,1,0,0,'felmyst SAY_BERSERK'), +(-1580042,'Kil\'jaeden... will... prevail... ',12483,1,0,0,'felmyst SAY_DEATH'), +(-1580043,'Madrigosa deserved a far better fate. You did what had to be done, but this battle is far from over.',12439,1,0,0,'kalecgos SAY_KALECGOS_OUTRO'), + +(-1580044,'Misery...',12484,1,0,0,'sacrolash SAY_INTRO_1'), +(-1580045,'Depravity...',0,1,0,0,'alythess SAY_INTRO_2'), +(-1580046,'Confusion...',0,1,0,0,'sacrolash SAY_INTRO_3'), +(-1580047,'Hatred...',0,1,0,0,'alythess SAY_INTRO_4'), +(-1580048,'Mistrust...',0,1,0,0,'sacrolash SAY_INTRO_5'), +(-1580049,'Chaos...',0,1,0,0,'alythess SAY_INTRO_6'), +(-1580050,'These are the hallmarks...',0,1,0,0,'sacrolash SAY_INTRO_7'), +(-1580051,'These are the pillars...',0,1,0,0,'alythess SAY_INTRO_8'), + +(-1580052,'Shadow to the aid of fire!',12485,1,0,0,'sacrolash SAY_SACROLASH_SHADOW_NOVA'), +(-1580053,'Alythess! Your fire burns within me!',12488,1,0,0,'sacrolash SAY_SACROLASH_EMPOWER'), +(-1580054,'Shadows, engulf!',12486,1,0,0,'sacrolash SAY_SACROLASH_KILL_1'), +(-1580055,'Ee-nok Kryul!',12487,1,0,0,'sacrolash SAY_SACROLASH_KILL_2'), +(-1580056,'I... fade.',12399,1,0,0,'sacrolash SAY_SACROLASH_DEAD'), +(-1580057,'Time is a luxury you no longer possess!',0,1,0,0,'sacrolash SAY_SACROLASH_BERSERK'), +(-1580058,'Fire to the aid of shadow!',12489,1,0,0,'alythess SAY_ALYTHESS_CANFLAGRATION'), +(-1580059,'Sacrolash!',12492,1,0,0,'alythess SAY_ALYTHESS_EMPOWER'), +(-1580060,'Fire, consume!',12490,1,0,0,'alythess SAY_ALYTHESS_KILL_1'), +(-1580061,'Ed-ir Halach!',12491,1,0,0,'alythess SAY_ALYTHESS_KILL_2'), +(-1580062,'De-ek Anur!',12494,1,0,0,'alythess SAY_ALYTHESS_DEAD'), +(-1580063,'Your luck has run its course!',12493,1,0,0,'alythess SAY_ALYTHESS_BERSERK'); diff --git a/sql/Updates/r2243_scriptdev2.sql b/sql/Updates/r2243_scriptdev2.sql new file mode 100644 index 0000000..a8cd9d9 --- /dev/null +++ b/sql/Updates/r2243_scriptdev2.sql @@ -0,0 +1,33 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1580094 AND -1580064; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1580064,'All my plans have led to this!',12495,1,0,0,'kiljaeden SAY_ORDER_1'), +(-1580065,'Stay on task! Do not waste time!',12496,1,0,0,'kiljaeden SAY_ORDER_2'), +(-1580066,'I have waited long enough!',12497,1,0,0,'kiljaeden SAY_ORDER_3'), +(-1580067,'Fail me and suffer for eternity!',12498,1,0,0,'kiljaeden SAY_ORDER_4'), +(-1580068,'Drain the girl! Drain her power until there is nothing but a vacant shell!',12499,1,0,0,'kiljaeden SAY_ORDER_5'), +(-1580069,'The expendible have perished... So be it! Now I shall succeed where Sargeras could not! I will bleed this wretched world and secure my place as the true master of the Burning Legion. The end has come! Let the unraveling of this world commence!',12500,1,0,0,'kiljaeden SAY_EMERGE'), +(-1580070,'Another step towards destruction!',12501,1,0,0,'kiljaeden SAY_SLAY_1'), +(-1580071,'Anukh-Kyrie!',12502,1,0,0,'kiljaeden SAY_SLAY_2'), +(-1580072,'Who can you trust?',12503,1,0,0,'kiljaeden SAY_REFLECTION_1'), +(-1580073,'The enemy is among you.',12504,1,0,0,'kiljaeden SAY_REFLECTION_2'), +(-1580074,'Chaos!',12505,1,0,0,'kiljaeden SAY_DARKNESS_1'), +(-1580075,'Destruction!',12506,1,0,0,'kiljaeden SAY_DARKNESS_2'), +(-1580076,'Oblivion!',12507,1,0,0,'kiljaeden SAY_DARKNESS_3'), +(-1580077,'I will not be denied! This world shall fall!',12508,1,0,0,'kiljaeden SAY_PHASE_3'), +(-1580078,'Do not harbor false hope. You cannot win!',12509,1,0,0,'kiljaeden SAY_PHASE_4'), +(-1580079,'Aggghh! The powers of the Sunwell... turn... against me! What have you done? What have you done???',12510,1,0,0,'kiljaeden SAY_PHASE_5'), +(-1580080,'You are not alone. The Blue Dragonflight shall help you vanquish the Deceiver.',12438,1,0,0,'kalecgos SAY_KALECGOS_INTRO'), +(-1580081,'Anveena, you must awaken, this world needs you!',12445,1,0,0,'kalecgos SAY_KALECGOS_AWAKE_1'), +(-1580082,'I serve only the Master now.',12511,1,0,0,'anveena SAY_ANVEENA_IMPRISONED'), +(-1580083,'You must let go! You must become what you were always meant to be! The time is now, Anveena!',12446,1,0,0,'kalecgos SAY_KALECGOS_AWAKE_2'), +(-1580084,'But I\'m... lost. I cannot find my way back.',12512,1,0,0,'anveena SAY_ANVEENA_LOST'), +(-1580085,'Anveena, I love you! Focus on my voice, come back for me now! Only you can cleanse the Sunwell!',12447,1,0,0,'kalecgos SAY_KALECGOS_AWAKE_4'), +(-1580086,'Kalec... Kalec?',12513,1,0,0,'anveena SAY_ANVEENA_AWAKE'), +(-1580087,'Yes, Anveena! Let fate embrace you now!',12448,1,0,0,'kalecgos SAY_KALECGOS_AWAKE_5'), +(-1580088,'The nightmare is over, the spell is broken! Goodbye, Kalec, my love!',12514,1,0,0,'anveena SAY_ANVEENA_SACRIFICE'), +(-1580089,'Goodbye, Anveena, my love. Few will remember your name, yet this day you change the course of destiny. What was once corrupt is now pure. Heroes, do not let her sacrifice be in vain.',12450,1,0,0,'kalecgos SAY_KALECGOS_GOODBYE'), +(-1580090,'Strike now, heroes, while he is weakened! Vanquish the Deceiver!',12449,1,0,0,'kalecgos SAY_KALECGOS_ENCOURAGE'), +(-1580091,'I will channel my power into the orbs, be ready!',12440,1,0,0,'kalecgos SAY_KALECGOS_ORB_1'), +(-1580092,'I have empowered another orb! Use it quickly!',12441,1,0,0,'kalecgos SAY_KALECGOS_ORB_2'), +(-1580093,'Another orb is ready! Make haste!',12442,1,0,0,'kalecgos SAY_KALECGOS_ORB_3'), +(-1580094,'I have channeled all I can! The power is in your hands!',12443,1,0,0,'kalecgos SAY_KALECGOS_ORB_4'); diff --git a/sql/Updates/r2245_scriptdev2.sql b/sql/Updates/r2245_scriptdev2.sql new file mode 100644 index 0000000..eea7f95 --- /dev/null +++ b/sql/Updates/r2245_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1542016; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1542016,'How long do you beleive your pathetic sorcery can hold me?',0,6,0,0,'magtheridon SAY_MAGTHERIDON_WARN'); diff --git a/sql/Updates/r2246_scriptdev2.sql b/sql/Updates/r2246_scriptdev2.sql new file mode 100644 index 0000000..a8c5c53 --- /dev/null +++ b/sql/Updates/r2246_scriptdev2.sql @@ -0,0 +1,208 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1631192 AND -1631001; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1631001,'This is the beginning AND the end, mortals. None may enter the master\'s sanctum!',16950,1,0,0,'marrowgar SAY_INTRO'), +(-1631002,'The Scourge will wash over this world as a swarm of death and destruction!',16941,1,0,0,'marrowgar SAY_AGGRO'), +(-1631003,'BONE STORM!',16946,1,0,0,'marrowgar SAY_BONE_STORM'), +(-1631004,'Bound by bone!',16947,1,0,0,'marrowgar SAY_BONE_SPIKE_1'), +(-1631005,'Stick Around!',16948,1,0,0,'marrowgar SAY_BONE_SPIKE_2'), +(-1631006,'The only escape is death!',16949,1,0,0,'marrowgar SAY_BONE_SPIKE_3'), +(-1631007,'More bones for the offering!',16942,1,0,0,'marrowgar SAY_SLAY_1'), +(-1631008,'Languish in damnation!',16943,1,0,0,'marrowgar SAY_SLAY_2'), +(-1631009,'I see... only darkness...',16944,1,0,0,'marrowgar SAY_DEATH'), +(-1631010,'THE MASTER\'S RAGE COURSES THROUGH ME!',16945,1,0,0,'marrowgar SAY_BERSERK'), + +(-1631011,'You have found your way here, because you are among the few gifted with true vision in a world cursed with blindness.',17272,1,0,0,'deathwhisper SAY_SPEECH_1'), +(-1631012,'You can see through the fog that hangs over this world like a shroud, and grasp where true power lies.',17273,1,0,0,'deathwhisper SAY_SPEECH_2'), +(-1631013,'Fix your eyes upon your crude hands: the sinew, the soft meat, the dark blood coursing within.',16878,1,0,0,'deathwhisper SAY_SPEECH_3'), +(-1631014,'It is a weakness; a crippling flaw.... A joke played by the Creators upon their own creations.',17268,1,0,0,'deathwhisper SAY_SPEECH_4'), +(-1631015,'The sooner you come to accept your condition as a defect, the sooner you will find yourselves in a position to transcend it.',17269,1,0,0,'deathwhisper SAY_SPEECH_5'), +(-1631016,'Through our Master, all things are possible. His power is without limit, and his will unbending.',17270,1,0,0,'deathwhisper SAY_SPEECH_6'), +(-1631017,'Those who oppose him will be destroyed utterly, and those who serve -- who serve wholly, unquestioningly, with utter devotion of mind and soul -- elevated to heights beyond your ken.',17271,1,0,0,'deathwhisper SAY_SPEECH_7'), +(-1631018,'What is this disturbance?! You dare trespass upon this hallowed ground? This shall be your final resting place.',16868,1,0,0,'deathwhisper SAY_AGGRO'), +(-1631019,'Enough! I see I must take matters into my own hands!',16877,1,0,0,'deathwhisper SAY_PHASE_TWO'), +(-1631020,'Take this blessing and show these intruders a taste of our master\'s power.',16873,1,0,0,'deathwhisper SAY_DARK_EMPOWERMENT'), +(-1631021,'I release you from the curse of flesh!',16874,1,0,0,'deathwhisper SAY_DARK_TRANSFORMATION'), +(-1631022,'Arise and exalt in your pure form!',16875,1,0,0,'deathwhisper SAY_ANIMATE_DEAD'), +(-1631023,'You are weak, powerless to resist my will!',16876,1,0,0,'deathwhisper SAY_DOMINATE_MIND'), +(-1631024,'This charade has gone on long enough.',16872,1,0,0,'deathwhisper SAY_BERSERK'), +(-1631025,'All part of the masters plan! Your end is... inevitable!',16871,1,0,0,'deathwhisper SAY_DEATH'), +(-1631026,'Do you yet grasp of the futility of your actions?',16869,1,0,0,'deathwhisper SAY_SLAY_1'), +(-1631027,'Embrace the darkness... Darkness eternal!',16870,1,0,0,'deathwhisper SAY_SLAY_2'), + +(-1631028,'BY THE MIGHT OF THE LICH KING!',16694,1,0,0,'saurfang SAY_AGGRO'), +(-1631029,'The ground runs red with your blood!',16699,1,0,0,'saurfang SAY_FALLENCHAMPION'), +(-1631030,'Feast, my minions!',16700,1,0,0,'saurfang SAY_BLOODBEASTS'), +(-1631031,'You are nothing!',16695,1,0,0,'saurfang SAY_SLAY_1'), +(-1631032,'Your soul will find no redemption here!',16696,1,0,0,'saurfang SAY_SLAY_2'), +(-1631033,'I have become...DEATH!',16698,1,0,0,'saurfang SAY_BERSERK'), +(-1631034,'I... Am... Released.',16697,1,0,0,'saurfang SAY_DEATH'), +(-1631035,'Let\'s get a move on then! Move ou...',16974,1,0,0,'bronzebeard SAY_INTRO_ALLY_0'), +(-1631036,'For every Horde soldier that you killed, for every Alliance dog that fell, the Lich King\'s armies grew. Even now the Val\'kyr work to raise your fallen... As Scourge.',16701,1,0,0,'saurfang SAY_INTRO_ALLY_1'), +(-1631037,'Things are about to get much worse. Come, taste the power that the Lich King has bestowed upon me!',16702,1,0,0,'saurfang SAY_INTRO_ALLY_2'), +(-1631038,'A lone orc, against the might of the Alliance?',16970,1,0,0,'bronzebeard SAY_INTRO_ALLY_3'), +(-1631039,'Charge!',16971,1,0,0,'bronzebeard SAY_INTRO_ALLY_4'), +(-1631040,'Hahahaha! Dwarves...',16703,1,0,0,'saurfang SAY_INTRO_ALLY_5'), +(-1631041,'Kor\'kron, move out! Champions, watch your backs. The Scourge have been..',17103,1,0,0,'overlord SAY_INTRO_HORDE_1'), +(-1631042,'Join me, father. Join me and we will crush this world in the name of the Scourge -- for the glory of the Lich King!',16704,1,0,0,'saurfang SAY_INTRO_HORDE_2'), +(-1631043,'My boy died at the Wrath Gate. I am here only to collect his body.',17097,0,0,0,'overlord SAY_INTRO_HORDE_3'), +(-1631044,'Stubborn and old. What chance do you have? I am stronger, and more powerful than you ever were.',16705,1,0,0,'saurfang SAY_INTRO_HORDE_4'), +(-1631045,'We named him Dranosh. It means "Heart of Draenor" in orcish. I would not let the warlocks take him. My boy would be safe, hidden away by the elders of Garadar.',17098,0,0,0,'overlord SAY_INTRO_HORDE_5'), +(-1631046,'I made a promise to his mother before she died; that I would cross the Dark Portal alone - whether I lived or died, my son would be safe. Untainted...',17099,0,0,0,'overlord SAY_INTRO_HORDE_6'), +(-1631047,'Today, I fulfill that promise.',17100,0,0,0,'overlord SAY_INTRO_HORDE_7'), +(-1631048,'High Overlord Saurfang charges!',17104,2,0,0,'overlord SAY_INTRO_HORDE_8'), +(-1631049,'Pathetic old orc. Come then heroes. Come and face the might of the Scourge!',16706,1,0,0,'saurfang SAY_INTRO_HORDE_9'), +(-1631050,'%s gasps for air',16975,2,0,0,'bronzebeard SAY_OUTRO_ALLY_1'), +(-1631051,'That was Saurfang\'s boy - the Horde commander at the Wrath Gate. Such a tragic end...',16976,0,0,0,'bronzebeard SAY_OUTRO_ALLY_2'), +(-1631052,'What in the... There, in the distance!',16977,0,0,0,'bronzebeard SAY_OUTRO_ALLY_3'), +(-1631053,'Soldiers, fall in! Looks like the Horde are comin\' in to take another shot!',16978,1,0,0,'bronzebeard SAY_OUTRO_ALLY_4'), +(-1631054,'Don\'t force my hand, orc. We can\'t let you pass.',16972,0,0,0,'bronzebeard SAY_OUTRO_ALLY_5'), +(-1631055,'Behind you lies the body of my only son. Nothing will keep me from him.',17094,0,0,0,'overlord SAY_OUTRO_ALLY_6'), +(-1631056,'He... I can\'t do it. Get back on your ship and we\'ll spare your life.',16973,0,0,0,'bronzebeard SAY_OUTRO_ALLY_7'), +(-1631057,'Stand down, Muradin. Let a grieving father pass.',16690,0,0,0,'varian SAY_OUTRO_ALLY_8'), +(-1631058,'No\'ku kil zil\'nok ha tar.',17096,0,1,0,'overlord SAY_OUTRO_ALLY_9'), +(-1631059,'I will not forget this kindess. I thank you, highness.',17095,0,0,0,'overlord SAY_OUTRO_ALLY_10'), +(-1631060,'I... I was not at the Wrathgate. But the soldiers who survived told me much of what happened. Your son fought with honor. He died a hero\'s death. He deserves a hero\'s burial.',16691,0,0,0,'varian SAY_OUTRO_ALLY_11'), +(-1631061,'%s cries.',16651,2,0,0,'proudmore SAY_OUTRO_ALLY_12'), +(-1631062,'Jaina, why are you crying?',16692,0,0,0,'varian SAY_OUTRO_ALLY_13'), +(-1631063,'It was nothing, your majesty. Just... I\'m proud of my king.',16652,0,0,0,'proudmore SAY_OUTRO_ALLY_14'), +(-1631064,'Bah! Muradin, secure the deck and prepare our soldiers for an assault on the upper citadel. I\'ll send out another regiment from Stormwind.',16693,0,0,0,'varian SAY_OUTRO_ALLY_15'), +(-1631065,'Right away, yer majesty!',16979,0,0,0,'bronzebeard SAY_OUTRO_ALLY_16'), +(-1631066,'%s coughs.',17105,2,0,0,'overlord SAY_OUTRO_HORDE_1'), +(-1631067,'%s weeps over the corpse of his son.',17106,2,0,0,'overlord SAY_OUTRO_HORDE_2'), +(-1631068,'You will have a proper ceremony in Nagrand next to the pyres of your mother and ancestors.',17101,0,0,0,'overlord SAY_OUTRO_HORDE_3'), +(-1631069,'Honor, young heroes... no matter how dire the battle... Never forsake it!',17102,0,0,0,'overlord SAY_OUTRO_HORDE_4'), + +(-1631070,'What? Precious? Noooooooooo!!!',16993,6,0,0,'rotface SAY_PRECIOUS_DIES'), +(-1631071,'WEEEEEE!',16986,1,0,0,'rotface SAY_AGGRO'), +(-1631072,'Icky sticky.',16991,1,0,0,'rotface SAY_SLIME_SPRAY'), +(-1631073,'I think I made an angry poo-poo. It gonna blow!',16992,1,0,0,'rotface SAY_OOZE_EXPLODE'), +(-1631074,'Great news, everyone! The slime is flowing again!',17126,1,0,0,'putricide SAY_SLIME_FLOW_1'), +(-1631075,'Good news, everyone! I\'ve fixed the poison slime pipes!',17123,1,0,0,'putricide SAY_SLIME_FLOW_2'), +(-1631076,'Daddy make toys out of you!',16987,1,0,0,'rotface SAY_SLAY_1'), +(-1631077,'I brokes-ded it...',16988,1,0,0,'rotface SAY_SLAY_2'), +(-1631078,'Sleepy Time!',16990,1,0,0,'rotface SAY_BERSERK'), +(-1631079,'Bad news daddy.',16989,1,0,0,'rotface SAY_DEATH'), +(-1631080,'Terrible news, everyone, Rotface is dead! But great news everyone, he left behind plenty of ooze for me to use! Whaa...? I\'m a poet, and I didn\'t know it? Astounding!',17146,6,0,0,'putricide SAY_ROTFACE_DEATH'), + +(-1631081,'NOOOO! You kill Stinky! You pay!',16907,6,0,0,'festergut SAY_STINKY_DIES'), +(-1631082,'Fun time!',16901,1,0,0,'festergut SAY_AGGRO'), +(-1631083,'Just an ordinary gas cloud. But watch out, because that\'s no ordinary gas cloud! ',17119,1,0,0,'putricide SAY_BLIGHT'), +(-1631084,'%s farts.',16911,2,0,0,'festergut SAY_SPORE'), +(-1631085,'Gyah! Uhhh, I not feel so good...',16906,1,0,0,'festergut SAY_PUNGUENT_BLIGHT'), +(-1631086,'%s vomits',0,2,0,0,'festergut SAY_PUNGUENT_BLIGHT_EMOTE'), +(-1631087,'Daddy, I did it',16902,1,0,0,'festergut SAY_SLAY_1'), +(-1631088,'Dead, dead, dead!',16903,1,0,0,'festergut SAY_SLAY_2'), +(-1631089,'Fun time over!',16905,1,0,0,'festergut SAY_BERSERK'), +(-1631090,'Da ... Ddy...',16904,1,0,0,'festergut SAY_DEATH'), +(-1631091,'Oh, Festergut. You were always my favorite. Next to Rotface. The good news is you left behind so much gas, I can practically taste it!',17124,6,0,0,'putricide SAY_FESTERGUT_DEATH'), + +(-1631092,'Good news, everyone! I think I perfected a plague that will destroy all life on Azeroth!',17114,1,0,0,'putricide SAY_AGGRO'), +(-1631093,'You can\'t come in here all dirty like that! You need that nasty flesh scrubbed off first!',17125,1,0,0,'putricide SAY_AIRLOCK'), +(-1631094,'Two oozes, one room! So many delightful possibilities...',17122,1,0,0,'putricide SAY_PHASE_CHANGE'), +(-1631095,'Hmm. I don\'t feel a thing. Whaa...? Where\'d those come from?',17120,1,0,0,'putricide SAY_TRANSFORM_1'), +(-1631096,'Tastes like... Cherry! Oh! Excuse me!',17121,1,0,0,'putricide SAY_TRANSFORM_2'), +(-1631097,'Hmm... Interesting...',17115,1,0,0,'putricide SAY_SLAY_1'), +(-1631098,'That was unexpected!',17116,1,0,0,'putricide SAY_SLAY_2'), +(-1631099,'Great news, everyone!',17118,1,0,0,'putricide SAY_BERSERK'), +(-1631100,'Bad news, everyone! I don\'t think I\'m going to make it',17117,1,0,0,'putricide SAY_DEATH'), + +(-1631101,'Foolish mortals. You thought us defeated so easily? The San\'layn are the Lich King\'s immortal soldiers! Now you shall face their might combined!',16795,6,0,0,'lanathel SAY_COUNCIL_INTRO_1'), +(-1631102,'Rise up, brothers, and destroy our enemies',16796,6,0,0,'lanathel SAY_COUNCIL_INTRO_2'), + +(-1631103,'Such wondrous power! The Darkfallen Orb has made me INVINCIBLE!',16727,1,0,0,'keleseth SAY_KELESETH_INVOCATION'), +(-1631104,'Blood will flow!',16728,1,0,0,'keleseth SAY_KELESETH_SPECIAL'), +(-1631105,'Were you ever a threat?',16723,1,0,0,'keleseth SAY_KELESETH_SLAY_1'), +(-1631106,'Truth is found in death.',16724,1,0,0,'keleseth SAY_SKELESETH_SLAY_2'), +(-1631107,'%s cackles maniacally!',16726,2,0,0,'keleseth SAY_KELESETH_BERSERK'), +(-1631108,'My queen... they come...',16725,1,0,0,'keleseth SAY_KELESETH_DEATH'), + +(-1631109,'Tremble before Taldaram, mortals, for the power of the orb flows through me!',16857,1,0,0,'taldaram SAY_TALDARAM_INVOCATION'), +(-1631110,'Delight in the pain!',16858,1,0,0,'taldaram SAY_TALDARAM_SPECIAL'), +(-1631111,'Worm food.',16853,1,0,0,'taldaram SAY_TALDARAM_SLAY_1'), +(-1631112,'Beg for mercy!',16854,1,0,0,'taldaram SAY_TALDARAM_SLAY_2'), +(-1631113,'%s laughs.',16856,2,0,0,'taldaram SAY_TALDARAM_BERSERK'), +(-1631114,'%s gurgles and dies.',16855,2,0,0,'taldaram SAY_TALDARAM_DEATH'), + +(-1631115,'Naxxanar was merely a setback! With the power of the orb, Valanar will have his vengeance!',16685,1,0,0,'valanar SAY_VALANAR_INVOCATION'), +(-1631116,'My cup runneth over.',16686,1,0,0,'valanar SAY_VALANAR_SPECIAL'), +(-1631117,'Dinner... is served.',16681,1,0,0,'valanar SAY_VALANAR_SLAY_1'), +(-1631118,'Dinner... is served.',16682,1,0,0,'valanar SAY_VALANAR_SLAY_2'), +(-1631119,'BOW DOWN BEFORE THE SAN\'LAYN!',16684,1,0,0,'valanar SAY_VALANAR_BERSERK'), +(-1631120,'...why...?',16683,1,0,0,'valanar SAY_VALANAR_DEATH'), + +(-1631121,'You have made an... unwise... decision.',16782,1,0,0,'blood_queen SAY_AGGRO'), +(-1631122,'Just a taste...',16783,1,0,0,'blood_queen SAY_BITE_1'), +(-1631123,'Know my hunger!',16784,1,0,0,'blood_queen SAY_BITE_2'), +(-1631124,'SUFFER!',16786,1,0,0,'blood_queen SAY_SHADOWS'), +(-1631125,'Can you handle this?',16787,1,0,0,'blood_queen SAY_PACT'), +(-1631126,'Yes... feed my precious one! You\'re mine now!',16790,1,0,0,'blood_queen SAY_MC'), +(-1631127,'Here it comes.',16788,1,0,0,'blood_queen SAY_AIR_PHASE'), +(-1631128,'THIS ENDS NOW!',16793,1,0,0,'blood_queen SAY_BERSERK'), +(-1631129,'But... we were getting along... so well...',16794,1,0,0,'blood_queen SAY_DEATH'), + +(-1631130,'Ready your arms, my Argent Brothers. The Vrykul will protect the Frost Queen with their lives.',16819,1,0,0,'scourgebane SAY_SVALNA_EVENT_1'), +(-1631131,'Even dying here beats spending another day collecting reagents for that madman, Finklestein.',16585,1,0,0,'arnath SAY_SVALNA_EVENT_2'), +(-1631132,'Enough idle banter! Our champions have arrived - support them as we push our way through the hall!',16820,1,0,0,'scourgebane SAY_SVALNA_EVENT_3'), +(-1631133,'You may have once fought beside me, Crok, but now you are nothing more than a traitor. Come, your second death approaches!',17017,1,0,0,'svalna SAY_SVALNA_EVENT_4'), +(-1631134,'Miserable creatures, Die!',17018,1,0,0,'svalna SAY_KILLING_CRUSADERS'), +(-1631135,'Foolish Crok, you brought my reinforcements with you! Arise Argent Champions and serve the Lich King in death!',17019,1,0,0,'svalna SAY_RESSURECT'), +(-1631136,'Come Scourgebane, I\'ll show the Lich King which one of us is truly worthy of the title, champion!',17020,1,0,0,'svalna SAY_SVALNA_AGGRO'), +(-1631137,'What? They died so easily? No matter.',17022,1,0,0,'svalna SAY_KILL_CAPTAIN'), +(-1631138,'What a pitiful choice of an ally Crok.',17021,1,0,0,'svalna SAY_KILL_PLAYER'), +(-1631139,'Perhaps... you were right... Crok, you must not approach the Frost Queen, quickly, stop them!',17023,1,0,0,'svalna SAY_DEATH'), + +(-1631140,'Heroes, lend me your aid! I... I cannot hold them off much longer! You must heal my wounds!',17064,1,0,0,'dreamwalker SAY_AGGRO'), +(-1631141,'I have opened a portal into the Dream. Your salvation lies within, heroes.',17068,1,0,0,'dreamwalker SAY_PORTAL'), +(-1631142,'My strength is returning! Press on, heroes!',17070,1,0,0,'dreamwalker SAY_75_HEALTH'), +(-1631143,'I will not last much longer!',17069,1,0,0,'dreamwalker SAY_25_HEALTH'), +(-1631144,'Forgive me for what I do! I... cannot... stop... ONLY NIGHTMARES REMAIN!',17072,1,0,0,'dreamwalker SAY_0_HEALTH'), +(-1631145,'A tragic loss...',17066,1,0,0,'dreamwalker SAY_PLAYER_DIES'), +(-1631146,'FAILURES!',17067,1,0,0,'dreamwalker SAY_BERSERK'), +(-1631147,'I am renewed! Ysera grants me the favor to lay these foul creatures to rest!',17071,1,0,0,'dreamwalker SAY_VICTORY'), + +(-1631148,'You are fools who have come to this place! The icy winds of Northrend will consume your souls!',17007,1,0,0,'sindragosa SAY_AGGRO'), +(-1631149,'Suffer, mortals, as your pathetic magic betrays you!',17014,1,0,0,'sindragosa SAY_UNCHAINED_MAGIC'), +(-1631150,'Can you feel the cold hand of death upon your heart?',17013,1,0,0,'sindragosa SAY_BLISTERING_COLD'), +(-1631151,'Aaah! It burns! What sorcery is this?!',17015,1,0,0,'sindragosa SAY_RESPIRE'), +(-1631152,'Your incursion ends here! None shall survive!',17012,1,0,0,'sindragosa SAY_TAKEOFF'), +(-1631153,'Now feel my master\'s limitless power and despair!',17016,1,0,0,'sindragosa SAY_PHASE_3'), +(-1631154,'Perish!',17008,1,0,0,'sindragosa SAY_SLAY_1'), +(-1631155,'A flaw of mortality...',17009,1,0,0,'sindragosa SAY_SLAY_2'), +(-1631156,'Enough! I tire of these games!',17011,1,0,0,'sindragosa SAY_BERSERK'), +(-1631157,'Free...at last...',17010,1,0,0,'sindragosa SAY_DEATH'), + +(-1631158,'So...the Light\'s vaunted justice has finally arrived. Shall I lay down Frostmourne and throw myself at your mercy, Fordring?',17349,1,0,0,'lich_king SAY_INTRO_1'), +(-1631159,'We will grant you a swift death, Arthas. More than can be said for the thousands you\'ve tortured and slain.',17390,1,0,0,'tirion SAY_INTRO_2'), +(-1631160,'You will learn of that first hand. When my work is complete, you will beg for mercy -- and I will deny you. Your anguished cries will be testament to my unbridled power.',17350,1,0,0,'lich_king SAY_INTRO_3'), +(-1631161,'So be it. Champions, attack!',17391,1,0,0,'tirion SAY_INTRO_4'), +(-1631162,'I\'ll keep you alive to witness the end, Fordring. I would not want the Light\'s greatest champion to miss seeing this wretched world remade in my image.',17351,1,0,0,'lich_king SAY_INTRO_5'), +(-1631163,'Come then champions, feed me your rage!',17352,1,0,0,'lich_king SAY_AGGRO'), +(-1631164,'I will freeze you from within until all that remains is an icy husk!',17369,1,0,0,'lich_king SAY_REMORSELESS_WINTER'), +(-1631165,'Watch as the world around you collapses!',17370,1,0,0,'lich_king SAY_SHATTER_ARENA'), +(-1631166,'Val\'kyr, your master calls!',17373,1,0,0,'lich_king SAY_SUMMON_VALKYR'), +(-1631167,'Frostmourne hungers...',17366,1,0,0,'lich_king SAY_HARVEST_SOUL'), +(-1631168,'You have come to bring Arthas to justice? To see the Lich King destroyed?',17394,1,0,0,'terenas SAY_FM_TERENAS_AID_1'), +(-1631169,'First, you must escape Frostmourne\'s hold, or be damned as I am; trapped within this cursed blade for all eternity.',17395,1,0,0,'terenas SAY_FM_TERENAS_AID_2'), +(-1631170,'Aid me in destroying these tortured souls! Together we will loosen Frostmourne\'s hold and weaken the Lich King from within!',17396,1,0,0,'terenas SAY_FM_TERENAS_AID_3'), +(-1631171,'Argh... Frostmourne, obey me!',17367,1,0,0,'lich_king SAY_FM_PLAYER_ESCAPE'), +(-1631172,'Frostmourne feeds on the soul of your fallen ally!',17368,1,0,0,'lich_king SAY_FM_PLAYER_DEATH'), +(-1631173,'Apocalypse!',17371,1,0,0,'lich_king SAY_SPECIAL_1'), +(-1631174,'Bow down before your lord and master!',17372,1,0,0,'lich_king SAY_SPECIAL_2'), +(-1631175,'You gnats actually hurt me! Perhaps I\'ve toyed with you long enough, now taste the vengeance of the grave!',17359,1,0,0,'lich_king SAY_LAST_PHASE'), +(-1631176,'Hope wanes!',17363,1,0,0,'lich_king SAY_SLAY_1'), +(-1631177,'The end has come!',17364,1,0,0,'lich_king SAY_SLAY_2'), +(-1631178,'Face now your tragic end!',17365,1,0,0,'lich_king SAY_ENRAGE'), +(-1631179,'No question remains unanswered. No doubts linger. You are Azeroth\'s greatest champions! You overcame every challenge I laid before you. My mightiest servants have fallen before your relentless onslaught, your unbridled fury...',17353,1,0,0,'lich_king SAY_OUTRO_1'), +(-1631180,'Is it truly righteousness that drives you? I wonder',17354,1,0,0,'lich_king SAY_OUTRO_2'), +(-1631181,'You trained them well, Fordring. You delivered the greatest fighting force this world has ever known... right into my hands -- exactly as I intended. You shall be rewarded for your unwitting sacrifice.',17355,1,0,0,'lich_king SAY_OUTRO_3'), +(-1631182,'Watch now as I raise them from the dead to become masters of the Scourge. They will shroud this world in chaos and destruction. Azeroth\'s fall will come at their hands -- and you will be the first to die.',17356,1,0,0,'lich_king SAY_OUTRO_4'), +(-1631183,'I delight in the irony.',17357,1,0,0,'lich_king SAY_OUTRO_5'), +(-1631184,'LIGHT, GRANT ME ONE FINAL BLESSING. GIVE ME THE STRENGTH... TO SHATTER THESE BONDS!',17392,1,0,0,'tirion SAY_OUTRO_6'), +(-1631185,'Impossible...',17358,1,0,0,'lich_king SAY_OUTRO_7'), +(-1631186,'No more, Arthas! No more lives will be consumed by your hatred!',17393,1,0,0,'tirion SAY_OUTRO_8'), +(-1631187,'Free at last! It is over, my son. This is the moment of reckoning.',17397,1,0,0,'terenas SAY_OUTRO_9'), +(-1631188,'Rise up, champions of the Light!',17398,1,0,0,'terenas SAY_OUTRO_10'), +(-1631189,'THE LICH KING...MUST...FALL!',17389,1,0,0,'tirion SAY_OUTRO_11'), +(-1631190,'Now I stand, the lion before the lambs... and they do not fear.',17361,1,0,0,'lich_king SAY_OUTRO_12'), +(-1631191,'They cannot fear.',17362,1,0,0,'lich_king SAY_OUTRO_13'), +(-1631192,'%s dies',17374,2,0,0,'lich_king SAY_OUTRO_14'); diff --git a/sql/Updates/r2247_scriptdev2.sql b/sql/Updates/r2247_scriptdev2.sql new file mode 100644 index 0000000..372e84b --- /dev/null +++ b/sql/Updates/r2247_scriptdev2.sql @@ -0,0 +1,37 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1616034 AND -1616000; +INSERT INTO script_texts (entry,content_default,sound,type,LANGUAGE,emote,comment) VALUES +(-1616000,'Lesser beings, intruding here! A shame that your excess courage does not compensate for your stupidity!',14512,1,0,0,'malygos SAY_INTRO_1'), +(-1616001,'None but the blue dragonflight are welcome here! Perhaps this is the work of Alexstrasza? Well then, she has sent you to your deaths.',14513,1,0,0,'malygos SAY_INTRO_2'), +(-1616002,'What could you hope to accomplish, to storm brazenly into my domain? To employ MAGIC? Against ME? ',14514,1,0,0,'malygos SAY_INTRO_3'), +(-1616003,'I am without limits here... the rules of your cherished reality do not apply... In this realm, I am in control...',14515,1,0,0,'malygos SAY_INTRO_4'), +(-1616004,'I give you one chance. Pledge fealty to me, and perhaps I won''t slaughter you for your insolence!',14516,1,0,0,'malygos SAY_INTRO_5'), +(-1616005,'My patience has reached its limit, I WILL BE RID OF YOU!',14517,1,0,0,'malygos SAY_AGGRO'), +(-1616006,'Watch helplessly as your hopes are swept away...',14525,1,0,0,'malygos SAY_VORTEX'), +(-1616007,'I AM UNSTOPPABLE!',14533,1,0,0,'malygos SAY_SPARK_BUFF'), +(-1616008,'Your stupidity has finally caught up to you!',14519,1,0,0,'malygos SAY_SLAY_1_A'), +(-1616009,'More artifacts to confiscate...',14520,1,0,0,'malygos SAY_SLAY_1_B'), +(-1616010,' How very... naive...',14521,1,0,0,'malygos SAY_SLAY_1_C'), +(-1616011,'I had hoped to end your lives quickly, but you have proven more...resilient then I had anticipated. Nonetheless, your efforts are in vain, it is you reckless, careless mortals who are to blame for this war! I do what I must...And if it means your...extinction...THEN SO BE IT!',14522,1,0,0,'malygos SAY_END_PHASE_1'), +(-1616012,'Few have experienced the pain I will now inflict upon you!',14523,1,0,0,'malygos SAY_START_PHASE_2'), +(-1616013,'YOU WILL NOT SUCCEED WHILE I DRAW BREATH!',14518,1,0,0,'malygos SAY_DEEP_BREATH'), +(-1616014,'I will teach you IGNORANT children just how little you know of magic...',14524,1,0,0,'malygos SAY_SHELL'), +(-1616015,'Your energy will be put to good use!',14526,1,0,0,'malygos SAY_SLAY_2_A'), +(-1616016,'I am the spell-weaver! My power is infinite!',14527,1,0,0,'malygos SAY_SLAY_2_B'), +(-1616017,'Your spirit will linger here forever!',14528,1,0,0, 'malygos SAY_SLAY_2_C'), +(-1616018,'ENOUGH! If you intend to reclaim Azeroth\'s magic, then you shall have it...',14529,1,0,0,'malygos SAY_END_PHASE_2'), +(-1616019,'Now your benefactors make their appearance...But they are too late. The powers contained here are sufficient to destroy the world ten times over! What do you think they will do to you?',14530,1,0,0,'malygos SAY_INTRO_PHASE_3'), +(-1616020,'SUBMIT!',14531,1,0,0,'malygos SAY_START_PHASE_3'), +(-1616021,'Alexstrasza! Another of your brood falls!',14534,1,0,0,'malygos SAY_SLAY_3_A'), +(-1616022,'Little more then gnats!',14535,1,0,0,'malygos SAY_SLAY_3_B'), +(-1616023,'Your red allies will share your fate...',14536,1,0,1,'malygos SAY_SLAY_3_C'), +(-1616024,'The powers at work here exceed anything you could possibly imagine!',14532,1,0,0,'malygos SAY_SURGE'), +(-1616025,'Still standing? Not for long...',14537,1,0,0,'malygos SAY_SPELL_1'), +(-1616026,'Your cause is lost!',14538,1,0,0,'malygos SAY_SPELL_2'), +(-1616027,'Your fragile mind will be shattered!',14539,1,0,0,'malygos SAY_SPELL_3'), +(-1616028,'UNTHINKABLE! The mortals will destroy... e-everything... my sister... what have you-',14540,1,0,0,'malygos SAY_DEATH'), +(-1616029,'I did what I had to, brother. You gave me no alternative.',14406,1,0,1,'alextrasza SAY_OUTRO_1'), +(-1616030,'And so ends the Nexus War.',14407,1,0,1,'alextrasza SAY_OUTRO_2'), +(-1616031,'This resolution pains me deeply, but the destruction, the monumental loss of life had to end. Regardless of Malygos\' recent transgressions, I will mourn his loss. He was once a guardian, a protector. This day, one of the world\'s mightiest has fallen.',14408,1,0,1,'alextrasza SAY_OUTRO_3'), +(-1616032,'The red dragonflight will take on the burden of mending the devastation wrought on Azeroth. Return home to your people and rest. Tomorrow will bring you new challenges, and you must be ready to face them. Life...goes on.',14409,1,0,1,'alextrasza SAY_OUTRO_4'), +(-1616033,'A Power Spark forms from a nearby rift!',0,3,0,0,'malygos SAY_EMOTE_SPARK'), +(-1616034,'%s takes a deep breath...',0,3,0,0,'malygos SAY_EMOTE_BREATH'); diff --git a/sql/Updates/r2248_scriptdev2.sql b/sql/Updates/r2248_scriptdev2.sql new file mode 100644 index 0000000..17d9f58 --- /dev/null +++ b/sql/Updates/r2248_scriptdev2.sql @@ -0,0 +1,5 @@ +UPDATE script_texts SET content_default='Your forces are nearly marshalled to strike back against your enemies, my liege.', type=6 WHERE entry = -1533084; +UPDATE script_texts SET content_default='Soon we will eradicate the Alliance and Horde, then the rest of Azeroth will fall before the might of my army.', type=6, sound=14768, comment='lich_king SAY_SAPP_DIALOG2_LICH' WHERE entry = -1533085; +UPDATE script_texts SET content_default='Yes, Master. The time of their ultimate demise grows close...What is this?', type=6 WHERE entry = -1533086; +UPDATE script_texts SET content_default='Invaders...here?! DESTROY them, Kel\'Thuzad! Naxxramas must not fall!', type=6, sound=14769, comment='lich_king SAY_SAPP_DIALOG4_LICH' WHERE entry = -1533087; +UPDATE script_texts SET content_default='As you command, Master!', type=6 WHERE entry = -1533088; diff --git a/sql/Updates/r2249_scriptdev2.sql b/sql/Updates/r2249_scriptdev2.sql new file mode 100644 index 0000000..ea5786d --- /dev/null +++ b/sql/Updates/r2249_scriptdev2.sql @@ -0,0 +1,2 @@ +UPDATE script_texts SET content_default='Impudent whelps! You\'ve rushed headlong to your own deaths! See now, the master stirs!' WHERE entry=-1409024; +UPDATE script_texts SET content_default='I give you one chance. Pledge fealty to me, and perhaps I won\'t slaughter you for your insolence!' WHERE entry=-1616004; diff --git a/sql/Updates/r2250_mangos.sql b/sql/Updates/r2250_mangos.sql new file mode 100644 index 0000000..8ea3fd9 --- /dev/null +++ b/sql/Updates/r2250_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_barrett_ramsey' WHERE entry IN (34816, 35035, 35766, 35770, 35771); diff --git a/sql/Updates/r2250_scriptdev2.sql b/sql/Updates/r2250_scriptdev2.sql new file mode 100644 index 0000000..1f16702 --- /dev/null +++ b/sql/Updates/r2250_scriptdev2.sql @@ -0,0 +1,18 @@ +UPDATE script_texts SET comment='varian SAY_VARIAN_PVP_H_INTRO_2' WHERE entry=-1649024; +UPDATE script_texts SET comment='garrosh SAY_GARROSH_PVP_A_INTRO_2' WHERE entry=-1649025; +UPDATE script_texts SET content_default='GLORY TO THE ALLIANCE!' WHERE entry=-1649026; +UPDATE script_texts SET content_default='Ahhh, our guests have arrived, just as the master promised.' WHERE entry=-1649038; + +UPDATE gossip_texts SET comment='barrett GOSSIP_ITEM_BEAST_INIT' WHERE entry=-3649000; +DELETE FROM gossip_texts WHERE entry BETWEEN -3649010 AND -3649001; +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3649001,'Bring forth the first challenge!','barrett GOSSIP_ITEM_BEAST_START'), +(-3649002,'We want another shot at those beasts!','barrett GOSSIP_ITEM_BEAST_WIPE_INIT'), +(-3649003,'What new challenge awaits us?','barrett GOSSIP_ITEM_JARAXXUS_INIT'), +(-3649004,'We\'re ready to fight the sorceror again.','barrett GOSSIP_ITEM_JARAXXUS_WIPE_INIT'), +(-3649005,'Of course!','barrett GOSSIP_ITEM_PVP_INIT'), +(-3649006,'Give the signal! We\'re ready to go!','barrett GOSSIP_ITEM_PVP_START'), +(-3649007,'That tough, huh?','barrett GOSSIP_ITEM_TWINS_INIT'), +(-3649008,'Val\'kyr? We\'re ready for them','barrett GOSSIP_ITEM_TWINS_START'), +(-3649009,'Your words of praise are appreciated, Coliseum Master.','barrett GOSSIP_ITEM_ANUB_INIT'), +(-3649010,'That is strange...','barrett GOSSIP_ITEM_ANUB_START'); diff --git a/sql/Updates/r2252_mangos.sql b/sql/Updates/r2252_mangos.sql new file mode 100644 index 0000000..87a7855 --- /dev/null +++ b/sql/Updates/r2252_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_beast_combat_stalker' WHERE entry=36549; diff --git a/sql/Updates/r2254_scriptdev2.sql b/sql/Updates/r2254_scriptdev2.sql new file mode 100644 index 0000000..53dc1f6 --- /dev/null +++ b/sql/Updates/r2254_scriptdev2.sql @@ -0,0 +1 @@ +DELETE FROM script_waypoint WHERE entry=18731; diff --git a/sql/Updates/r2255_mangos.sql b/sql/Updates/r2255_mangos.sql new file mode 100644 index 0000000..e49bd9d --- /dev/null +++ b/sql/Updates/r2255_mangos.sql @@ -0,0 +1,6 @@ +DELETE FROM scripted_areatrigger WHERE entry=4937; +INSERT INTO scripted_areatrigger VALUES (4937, 'at_sunwell_plateau'); + +UPDATE creature_template SET ScriptName='boss_alythess' WHERE entry=25166; +UPDATE creature_template SET ScriptName='boss_sacrolash' WHERE entry=25165; +UPDATE creature_template SET ScriptName='npc_shadow_image' WHERE entry=25214; diff --git a/sql/custom/ready for DB/mangos_ulduar_loot.sql b/sql/custom/ready for DB/mangos_ulduar_loot.sql index 7b0c6e0..f89a127 100644 --- a/sql/custom/ready for DB/mangos_ulduar_loot.sql +++ b/sql/custom/ready for DB/mangos_ulduar_loot.sql @@ -120,11 +120,11 @@ INSERT INTO creature_loot_template VALUES (33271, 46014, 0, 2, 1, 1, 0, 0, 0), (33271, 45997, 0, 2, 1, 1, 0, 0, 0), (33271, 45996, 0, 2, 1, 1, 0, 0, 0), -(33271, 45869, 0, 3, 1, 1, 18, 603, 44), -(33271, 45867, 0, 3, 1, 1, 18, 603, 44), -(33271, 45871, 0, 3, 1, 1, 18, 603, 44), -(33271, 45868, 0, 3, 1, 1, 18, 603, 44), -(33271, 45870, 0, 3, 1, 1, 18, 603, 44), +(33271, 46032, 0, 3, 1, 1, 18, 603, 44), +(33271, 46033, 0, 3, 1, 1, 18, 603, 44), +(33271, 46034, 0, 3, 1, 1, 18, 603, 44), +(33271, 46035, 0, 3, 1, 1, 18, 603, 44), +(33271, 46036, 0, 3, 1, 1, 18, 603, 44), -- Yogg-Saron (33288) -- has NPC hard-mode loot (1-3 'tables') (33288, 45087, 30, 0, 1, 3, 0, 0, 0), -- Runed Orb diff --git a/sql/mangos_scriptname_full.sql b/sql/mangos_scriptname_full.sql index be6e295..bc67a56 100644 --- a/sql/mangos_scriptname_full.sql +++ b/sql/mangos_scriptname_full.sql @@ -46,6 +46,10 @@ DELETE FROM scripted_areatrigger WHERE entry IN (3958, 3960); INSERT INTO scripted_areatrigger VALUES (3958, 'at_zulgurub'), (3960, 'at_zulgurub'); +DELETE FROM scripted_areatrigger WHERE entry=3626; +INSERT INTO scripted_areatrigger VALUES (3626, 'at_vaelastrasz'); +DELETE FROM scripted_areatrigger WHERE entry=4937; +INSERT INTO scripted_areatrigger VALUES (4937, 'at_sunwell_plateau'); /* BATTLEGROUNDS */ @@ -141,7 +145,16 @@ UPDATE creature_template SET ScriptName='npc_locksmith' WHERE entry IN (29665,29 -- UPDATE creature_template SET ScriptName='npc_innkeeper' WHERE npcflag=npcflag|65536; /* SPELL */ -UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry IN (16880,1200,26616,26643,16518,25793,25758,25752,25792,25753,26421,26841,27808,27122,28068,12298,12296,24918,17157,17326,17654,16847,18879,26270,26268,30146,25084,25085,32149,22105,29330,29338,29329,28465,28600,29327,29319,28053,28054,28093); +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry IN ( +-- eastern kingdoms +1200, +-- kalimdor +12296,12298, +-- outland +16880,16518,16847,17157,17326,17654,18879,22105,24918,25084,25085, +-- northrend +25752,25753,25758,25792,25793,26268,26270,26421,26616,26643,26841,27122,27808,28053,28054,28068,28093,28465,28600,29319,29327,29329,29330,29338,30146,32149); + UPDATE gameobject_template SET ScriptName='spell_dummy_go' WHERE entry IN (181616,186949); /* */ @@ -304,6 +317,7 @@ UPDATE creature_template SET ScriptName='npc_lokhtos_darkbargainer' WHERE entry= UPDATE creature_template SET ScriptName='npc_kharan_mighthammer' WHERE entry=9021; UPDATE creature_template SET ScriptName='npc_rocknot' WHERE entry=9503; UPDATE gameobject_template SET ScriptName='go_shadowforge_brazier' WHERE entry IN (174744, 174745); +UPDATE gameobject_template SET ScriptName='go_relic_coffer_door' WHERE entry IN (174554, 174555, 174556, 174557, 174558, 174559, 174560, 174561, 174562, 174563, 174564, 174566); /* BLACKROCK SPIRE */ UPDATE instance_template SET ScriptName='instance_blackrock_spire' WHERE map=229; @@ -458,6 +472,8 @@ UPDATE creature_template SET ScriptName='boss_the_lurker_below' WHERE entry=2121 /* TRIAL OF THE CRUSADER */ UPDATE instance_template SET ScriptName='instance_trial_of_the_crusader' WHERE map=649; +UPDATE creature_template SET ScriptName='npc_barrett_ramsey' WHERE entry IN (34816, 35035, 35766, 35770, 35771); +UPDATE creature_template SET ScriptName='npc_beast_combat_stalker' WHERE entry=36549; UPDATE creature_template SET ScriptName='boss_gormok' WHERE entry=34796; UPDATE creature_template SET ScriptName='boss_acidmaw' WHERE entry=35144; UPDATE creature_template SET ScriptName='boss_dreadscale' WHERE entry=34799; @@ -504,6 +520,7 @@ UPDATE creature_template SET ScriptName='npc_torastrasza' WHERE entry=26949; /* DRAK'THARON KEEP */ UPDATE creature_template SET ScriptName='boss_novos' WHERE entry=26631; +UPDATE creature_template SET ScriptName='npc_crystal_channel_target' WHERE entry=26712; UPDATE creature_template SET ScriptName='boss_tharonja' WHERE entry=26632; UPDATE creature_template SET ScriptName='boss_trollgore' WHERE entry=26630; UPDATE instance_template SET ScriptName='instance_draktharon_keep' WHERE map=600; @@ -521,7 +538,7 @@ UPDATE creature_template SET ScriptName='npc_narm_faulk' WHERE entry=6177; /* DUSTWALLOW MARSH */ UPDATE creature_template SET ScriptName='mobs_risen_husk_spirit' WHERE entry IN (23554,23555); UPDATE creature_template SET ScriptName='npc_deserter_agitator' WHERE entry=23602; -UPDATE creature_template SET ScriptName='npc_lady_jaina_proudmoore' WHERE entry=4968; +-- UPDATE creature_template SET ScriptName='npc_lady_jaina_proudmoore' WHERE entry=4968; UPDATE creature_template SET ScriptName='npc_ogron' WHERE entry=4983; UPDATE creature_template SET ScriptName='npc_morokk' WHERE entry=4500; UPDATE creature_template SET ScriptName='npc_nat_pagle' WHERE entry=12919; @@ -1064,6 +1081,9 @@ UPDATE creature_template SET ScriptName='boss_sathrovarr' WHERE entry=24892; UPDATE gameobject_template SET ScriptName='go_spectral_rift' WHERE entry=187055; DELETE FROM scripted_areatrigger WHERE entry=4853; INSERT INTO scripted_areatrigger VALUES (4853,'at_madrigosa'); +UPDATE creature_template SET ScriptName='boss_alythess' WHERE entry=25166; +UPDATE creature_template SET ScriptName='boss_sacrolash' WHERE entry=25165; +UPDATE creature_template SET ScriptName='npc_shadow_image' WHERE entry=25214; /* SWAMP OF SORROWS */ UPDATE creature_template SET ScriptName='npc_galen_goodward' WHERE entry=5391; diff --git a/sql/scriptdev2_script_full.sql b/sql/scriptdev2_script_full.sql index f272e4d..8f71e14 100644 --- a/sql/scriptdev2_script_full.sql +++ b/sql/scriptdev2_script_full.sql @@ -3,7 +3,7 @@ -- DELETE FROM sd2_db_version; -INSERT INTO sd2_db_version (version) VALUES ('ScriptDev2 (for MaNGOS 11590+) '); +INSERT INTO sd2_db_version (version) VALUES ('ScriptDev2 (for MaNGOS 11720+) '); -- -- Below contains data for table `script_texts` mainly used in C++ parts. @@ -1087,7 +1087,7 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen (-1409021,'I go now to summon the lord whos house this is. Should you seek an audiance with him your paltry lives will surly be forfit. Nevertheless seek out his lair if you dare!',0,1,0,0,'majordomo SAY_DEFEAT_3'), (-1409022,'My flame! Please don\'t take away my flame... ',8042,1,0,0,'ragnaros SAY_ARRIVAL4_MAJ'), (-1409023,'Very well, $N.',0,0,0,0,'majordomo SAY_SUMMON_0'), -(-1409024,'Impudent whelps! You''ve rushed headlong to your own deaths! See now, the master stirs!',0,1,0,0,'majordomo SAY_SUMMON_1'); +(-1409024,'Impudent whelps! You\'ve rushed headlong to your own deaths! See now, the master stirs!',0,1,0,0,'majordomo SAY_SUMMON_1'); -- -1 429 000 DIRE MAUL INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES @@ -1139,7 +1139,9 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen (-1469032,'Get up, little red wyrm...and destroy them!',0,1,0,1,'victor_nefarius SAY_NEFARIUS_CORRUPT_2'), -(-1469033,'%s flee as the controlling power of the orb is drained.',0,2,0,0,'razorgore EMOTE_TROOPS_FLEE'); +(-1469033,'%s flee as the controlling power of the orb is drained.',0,2,0,0,'razorgore EMOTE_TROOPS_FLEE'), + +(-1469034,'Run! They are coming.',0,1,0,0,'blackwing technician SAY_TECHNICIAN_RUN'); -- -1 509 000 RUINS OF AHN'QIRAJ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES @@ -1428,11 +1430,11 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen (-1533082,'%s takes in a deep breath...',0,3,0,0,'sapphiron EMOTE_BREATH'), (-1533083,'%s resumes his attacks!',0,3,0,0,'sapphiron EMOTE_GROUND'), -(-1533084,'Our preparations continue as planned, master.',14467,1,0,0,'kelthuzad SAY_SAPP_DIALOG1'), -(-1533085,'It is good that you serve me so faithfully. Soon, all will serve the Lich King and in the end, you shall be rewarded...so long as you do not falter.',8881,1,0,0,'kelthuzad SAY_SAPP_DIALOG2_LICH'), -(-1533086,'I see no complications... Wait... What is this?',14468,1,0,0,'kelthuzad SAY_SAPP_DIALOG3'), -(-1533087,'Your security measures have failed! See to this interruption immediately!',8882,1,0,0,'kelthuzad SAY_SAPP_DIALOG4_LICH'), -(-1533088,'Yes, master!',14469,1,0,0,'kelthuzad SAY_SAPP_DIALOG5'), +(-1533084,'Your forces are nearly marshalled to strike back against your enemies, my liege.',14467,6,0,0,'kelthuzad SAY_SAPP_DIALOG1'), +(-1533085,'Soon we will eradicate the Alliance and Horde, then the rest of Azeroth will fall before the might of my army.',14768,6,0,0,'lich_king SAY_SAPP_DIALOG2_LICH'), +(-1533086,'Yes, Master. The time of their ultimate demise grows close...What is this?',14468,6,0,0,'kelthuzad SAY_SAPP_DIALOG3'), +(-1533087,'Invaders...here?! DESTROY them, Kel\'Thuzad! Naxxramas must not fall!',14769,6,0,0,'lich_king SAY_SAPP_DIALOG4_LICH'), +(-1533088,'As you command, Master!',14469,6,0,0,'kelthuzad SAY_SAPP_DIALOG5'), (-1533089,'No!!! A curse upon you, interlopers! The armies of the Lich King will hunt you down. You will not escape your fate...',14484,6,0,0,'kelthuzad SAY_CAT_DIED'), (-1533090,'Who dares violate the sanctity of my domain? Be warned, all who trespass here are doomed.',14463,6,0,0,'kelthuzad SAY_TAUNT1'), (-1533091,'Fools, you think yourselves triumphant? You have only taken one step closer to the abyss! ',14464,6,0,0,'kelthuzad SAY_TAUNT2'), @@ -1627,7 +1629,9 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen (-1542013,'It is pointless to resist.',10290,1,0,0,'the_maker SAY_KILL_2'), (-1542014,'Stay away from... me.',10291,1,0,0,'the_maker SAY_DIE'), -(-1542015,'Kill them!',0,1,0,0,'broggok SAY_BROGGOK_INTRO'); +(-1542015,'Kill them!',0,1,0,0,'broggok SAY_BROGGOK_INTRO'), + +(-1542016,'How long do you beleive your pathetic sorcery can hold me?',0,6,0,0,'magtheridon SAY_MAGTHERIDON_WARN'); -- -1 543 000 HELLFIRE RAMPARTS INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES @@ -2494,7 +2498,70 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen (-1580032,'Where is Anveena, demon? What has become of Kalec?',12473,1,0,0,'madrigosa YELL_MADR_INTRO'), (-1580033,'You will tell me where they are!',12474,1,0,0,'madrigosa YELL_MADR_ICE_BLOCK'), (-1580034,'Speak, I grow weary of asking!',12475,1,0,0,'madrigosa YELL_MADR_TRAP'), -(-1580035,'Malygos, my lord! I did my best!',12476,1,0,0,'madrigosa YELL_MADR_DEATH'); +(-1580035,'Malygos, my lord! I did my best!',12476,1,0,0,'madrigosa YELL_MADR_DEATH'), + +(-1580036,'Glory to Kil\'jaeden! Death to all who oppose!',12477,1,0,0,'felmyst SAY_INTRO'), +(-1580037,'I kill for the master!',12480,1,0,0,'felmyst SAY_KILL_1'), +(-1580038,'The end has come! ',12481,1,0,0,'felmyst SAY_KILL_2'), +(-1580039,'Choke on your final breath! ',12478,1,0,0,'felmyst SAY_BREATH'), +(-1580040,'I am stronger than ever before! ',12479,1,0,0,'felmyst SAY_TAKEOFF'), +(-1580041,'No more hesitation! Your fates are written! ',12482,1,0,0,'felmyst SAY_BERSERK'), +(-1580042,'Kil\'jaeden... will... prevail... ',12483,1,0,0,'felmyst SAY_DEATH'), +(-1580043,'Madrigosa deserved a far better fate. You did what had to be done, but this battle is far from over.',12439,1,0,0,'kalecgos SAY_KALECGOS_OUTRO'), + +(-1580044,'Misery...',12484,1,0,0,'sacrolash SAY_INTRO_1'), +(-1580045,'Depravity...',0,1,0,0,'alythess SAY_INTRO_2'), +(-1580046,'Confusion...',0,1,0,0,'sacrolash SAY_INTRO_3'), +(-1580047,'Hatred...',0,1,0,0,'alythess SAY_INTRO_4'), +(-1580048,'Mistrust...',0,1,0,0,'sacrolash SAY_INTRO_5'), +(-1580049,'Chaos...',0,1,0,0,'alythess SAY_INTRO_6'), +(-1580050,'These are the hallmarks...',0,1,0,0,'sacrolash SAY_INTRO_7'), +(-1580051,'These are the pillars...',0,1,0,0,'alythess SAY_INTRO_8'), + +(-1580052,'Shadow to the aid of fire!',12485,1,0,0,'sacrolash SAY_SACROLASH_SHADOW_NOVA'), +(-1580053,'Alythess! Your fire burns within me!',12488,1,0,0,'sacrolash SAY_SACROLASH_EMPOWER'), +(-1580054,'Shadows, engulf!',12486,1,0,0,'sacrolash SAY_SACROLASH_KILL_1'), +(-1580055,'Ee-nok Kryul!',12487,1,0,0,'sacrolash SAY_SACROLASH_KILL_2'), +(-1580056,'I... fade.',12399,1,0,0,'sacrolash SAY_SACROLASH_DEAD'), +(-1580057,'Time is a luxury you no longer possess!',0,1,0,0,'sacrolash SAY_SACROLASH_BERSERK'), +(-1580058,'Fire to the aid of shadow!',12489,1,0,0,'alythess SAY_ALYTHESS_CANFLAGRATION'), +(-1580059,'Sacrolash!',12492,1,0,0,'alythess SAY_ALYTHESS_EMPOWER'), +(-1580060,'Fire, consume!',12490,1,0,0,'alythess SAY_ALYTHESS_KILL_1'), +(-1580061,'Ed-ir Halach!',12491,1,0,0,'alythess SAY_ALYTHESS_KILL_2'), +(-1580062,'De-ek Anur!',12494,1,0,0,'alythess SAY_ALYTHESS_DEAD'), +(-1580063,'Your luck has run its course!',12493,1,0,0,'alythess SAY_ALYTHESS_BERSERK'), + +(-1580064,'All my plans have led to this!',12495,1,0,0,'kiljaeden SAY_ORDER_1'), +(-1580065,'Stay on task! Do not waste time!',12496,1,0,0,'kiljaeden SAY_ORDER_2'), +(-1580066,'I have waited long enough!',12497,1,0,0,'kiljaeden SAY_ORDER_3'), +(-1580067,'Fail me and suffer for eternity!',12498,1,0,0,'kiljaeden SAY_ORDER_4'), +(-1580068,'Drain the girl! Drain her power until there is nothing but a vacant shell!',12499,1,0,0,'kiljaeden SAY_ORDER_5'), +(-1580069,'The expendible have perished... So be it! Now I shall succeed where Sargeras could not! I will bleed this wretched world and secure my place as the true master of the Burning Legion. The end has come! Let the unraveling of this world commence!',12500,1,0,0,'kiljaeden SAY_EMERGE'), +(-1580070,'Another step towards destruction!',12501,1,0,0,'kiljaeden SAY_SLAY_1'), +(-1580071,'Anukh-Kyrie!',12502,1,0,0,'kiljaeden SAY_SLAY_2'), +(-1580072,'Who can you trust?',12503,1,0,0,'kiljaeden SAY_REFLECTION_1'), +(-1580073,'The enemy is among you.',12504,1,0,0,'kiljaeden SAY_REFLECTION_2'), +(-1580074,'Chaos!',12505,1,0,0,'kiljaeden SAY_DARKNESS_1'), +(-1580075,'Destruction!',12506,1,0,0,'kiljaeden SAY_DARKNESS_2'), +(-1580076,'Oblivion!',12507,1,0,0,'kiljaeden SAY_DARKNESS_3'), +(-1580077,'I will not be denied! This world shall fall!',12508,1,0,0,'kiljaeden SAY_PHASE_3'), +(-1580078,'Do not harbor false hope. You cannot win!',12509,1,0,0,'kiljaeden SAY_PHASE_4'), +(-1580079,'Aggghh! The powers of the Sunwell... turn... against me! What have you done? What have you done???',12510,1,0,0,'kiljaeden SAY_PHASE_5'), +(-1580080,'You are not alone. The Blue Dragonflight shall help you vanquish the Deceiver.',12438,1,0,0,'kalecgos SAY_KALECGOS_INTRO'), +(-1580081,'Anveena, you must awaken, this world needs you!',12445,1,0,0,'kalecgos SAY_KALECGOS_AWAKE_1'), +(-1580082,'I serve only the Master now.',12511,1,0,0,'anveena SAY_ANVEENA_IMPRISONED'), +(-1580083,'You must let go! You must become what you were always meant to be! The time is now, Anveena!',12446,1,0,0,'kalecgos SAY_KALECGOS_AWAKE_2'), +(-1580084,'But I\'m... lost. I cannot find my way back.',12512,1,0,0,'anveena SAY_ANVEENA_LOST'), +(-1580085,'Anveena, I love you! Focus on my voice, come back for me now! Only you can cleanse the Sunwell!',12447,1,0,0,'kalecgos SAY_KALECGOS_AWAKE_4'), +(-1580086,'Kalec... Kalec?',12513,1,0,0,'anveena SAY_ANVEENA_AWAKE'), +(-1580087,'Yes, Anveena! Let fate embrace you now!',12448,1,0,0,'kalecgos SAY_KALECGOS_AWAKE_5'), +(-1580088,'The nightmare is over, the spell is broken! Goodbye, Kalec, my love!',12514,1,0,0,'anveena SAY_ANVEENA_SACRIFICE'), +(-1580089,'Goodbye, Anveena, my love. Few will remember your name, yet this day you change the course of destiny. What was once corrupt is now pure. Heroes, do not let her sacrifice be in vain.',12450,1,0,0,'kalecgos SAY_KALECGOS_GOODBYE'), +(-1580090,'Strike now, heroes, while he is weakened! Vanquish the Deceiver!',12449,1,0,0,'kalecgos SAY_KALECGOS_ENCOURAGE'), +(-1580091,'I will channel my power into the orbs, be ready!',12440,1,0,0,'kalecgos SAY_KALECGOS_ORB_1'), +(-1580092,'I have empowered another orb! Use it quickly!',12441,1,0,0,'kalecgos SAY_KALECGOS_ORB_2'), +(-1580093,'Another orb is ready! Make haste!',12442,1,0,0,'kalecgos SAY_KALECGOS_ORB_3'), +(-1580094,'I have channeled all I can! The power is in your hands!',12443,1,0,0,'kalecgos SAY_KALECGOS_ORB_4'); -- -1 585 000 MAGISTER'S TERRACE INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES @@ -3222,6 +3289,42 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen (-1615042,'%s begins to open a Twilight Portal!',0,5,0,0,'sartharion drake WHISPER_OPEN_PORTAL'); -- -1 616 000 EYE OF ETERNITY +INSERT INTO script_texts (entry,content_default,sound,type,LANGUAGE,emote,comment) VALUES +(-1616000,'Lesser beings, intruding here! A shame that your excess courage does not compensate for your stupidity!',14512,1,0,0,'malygos SAY_INTRO_1'), +(-1616001,'None but the blue dragonflight are welcome here! Perhaps this is the work of Alexstrasza? Well then, she has sent you to your deaths.',14513,1,0,0,'malygos SAY_INTRO_2'), +(-1616002,'What could you hope to accomplish, to storm brazenly into my domain? To employ MAGIC? Against ME? ',14514,1,0,0,'malygos SAY_INTRO_3'), +(-1616003,'I am without limits here... the rules of your cherished reality do not apply... In this realm, I am in control...',14515,1,0,0,'malygos SAY_INTRO_4'), +(-1616004,'I give you one chance. Pledge fealty to me, and perhaps I won\'t slaughter you for your insolence!',14516,1,0,0,'malygos SAY_INTRO_5'), +(-1616005,'My patience has reached its limit, I WILL BE RID OF YOU!',14517,1,0,0,'malygos SAY_AGGRO'), +(-1616006,'Watch helplessly as your hopes are swept away...',14525,1,0,0,'malygos SAY_VORTEX'), +(-1616007,'I AM UNSTOPPABLE!',14533,1,0,0,'malygos SAY_SPARK_BUFF'), +(-1616008,'Your stupidity has finally caught up to you!',14519,1,0,0,'malygos SAY_SLAY_1_A'), +(-1616009,'More artifacts to confiscate...',14520,1,0,0,'malygos SAY_SLAY_1_B'), +(-1616010,' How very... naive...',14521,1,0,0,'malygos SAY_SLAY_1_C'), +(-1616011,'I had hoped to end your lives quickly, but you have proven more...resilient then I had anticipated. Nonetheless, your efforts are in vain, it is you reckless, careless mortals who are to blame for this war! I do what I must...And if it means your...extinction...THEN SO BE IT!',14522,1,0,0,'malygos SAY_END_PHASE_1'), +(-1616012,'Few have experienced the pain I will now inflict upon you!',14523,1,0,0,'malygos SAY_START_PHASE_2'), +(-1616013,'YOU WILL NOT SUCCEED WHILE I DRAW BREATH!',14518,1,0,0,'malygos SAY_DEEP_BREATH'), +(-1616014,'I will teach you IGNORANT children just how little you know of magic...',14524,1,0,0,'malygos SAY_SHELL'), +(-1616015,'Your energy will be put to good use!',14526,1,0,0,'malygos SAY_SLAY_2_A'), +(-1616016,'I am the spell-weaver! My power is infinite!',14527,1,0,0,'malygos SAY_SLAY_2_B'), +(-1616017,'Your spirit will linger here forever!',14528,1,0,0, 'malygos SAY_SLAY_2_C'), +(-1616018,'ENOUGH! If you intend to reclaim Azeroth\'s magic, then you shall have it...',14529,1,0,0,'malygos SAY_END_PHASE_2'), +(-1616019,'Now your benefactors make their appearance...But they are too late. The powers contained here are sufficient to destroy the world ten times over! What do you think they will do to you?',14530,1,0,0,'malygos SAY_INTRO_PHASE_3'), +(-1616020,'SUBMIT!',14531,1,0,0,'malygos SAY_START_PHASE_3'), +(-1616021,'Alexstrasza! Another of your brood falls!',14534,1,0,0,'malygos SAY_SLAY_3_A'), +(-1616022,'Little more then gnats!',14535,1,0,0,'malygos SAY_SLAY_3_B'), +(-1616023,'Your red allies will share your fate...',14536,1,0,1,'malygos SAY_SLAY_3_C'), +(-1616024,'The powers at work here exceed anything you could possibly imagine!',14532,1,0,0,'malygos SAY_SURGE'), +(-1616025,'Still standing? Not for long...',14537,1,0,0,'malygos SAY_SPELL_1'), +(-1616026,'Your cause is lost!',14538,1,0,0,'malygos SAY_SPELL_2'), +(-1616027,'Your fragile mind will be shattered!',14539,1,0,0,'malygos SAY_SPELL_3'), +(-1616028,'UNTHINKABLE! The mortals will destroy... e-everything... my sister... what have you-',14540,1,0,0,'malygos SAY_DEATH'), +(-1616029,'I did what I had to, brother. You gave me no alternative.',14406,1,0,1,'alextrasza SAY_OUTRO_1'), +(-1616030,'And so ends the Nexus War.',14407,1,0,1,'alextrasza SAY_OUTRO_2'), +(-1616031,'This resolution pains me deeply, but the destruction, the monumental loss of life had to end. Regardless of Malygos\' recent transgressions, I will mourn his loss. He was once a guardian, a protector. This day, one of the world\'s mightiest has fallen.',14408,1,0,1,'alextrasza SAY_OUTRO_3'), +(-1616032,'The red dragonflight will take on the burden of mending the devastation wrought on Azeroth. Return home to your people and rest. Tomorrow will bring you new challenges, and you must be ready to face them. Life...goes on.',14409,1,0,1,'alextrasza SAY_OUTRO_4'), +(-1616033,'A Power Spark forms from a nearby rift!',0,3,0,0,'malygos SAY_EMOTE_SPARK'), +(-1616034,'%s takes a deep breath...',0,3,0,0,'malygos SAY_EMOTE_BREATH'); -- -1 619 000 AHN'KAHET INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES @@ -3270,6 +3373,213 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen (-1619039,' ',14049,1,0,0,'volazj SAY_DEATH_2'); -- -1 631 000 ICC: ICECROWN CITADEL +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1631001,'This is the beginning AND the end, mortals. None may enter the master\'s sanctum!',16950,1,0,0,'marrowgar SAY_INTRO'), +(-1631002,'The Scourge will wash over this world as a swarm of death and destruction!',16941,1,0,0,'marrowgar SAY_AGGRO'), +(-1631003,'BONE STORM!',16946,1,0,0,'marrowgar SAY_BONE_STORM'), +(-1631004,'Bound by bone!',16947,1,0,0,'marrowgar SAY_BONE_SPIKE_1'), +(-1631005,'Stick Around!',16948,1,0,0,'marrowgar SAY_BONE_SPIKE_2'), +(-1631006,'The only escape is death!',16949,1,0,0,'marrowgar SAY_BONE_SPIKE_3'), +(-1631007,'More bones for the offering!',16942,1,0,0,'marrowgar SAY_SLAY_1'), +(-1631008,'Languish in damnation!',16943,1,0,0,'marrowgar SAY_SLAY_2'), +(-1631009,'I see... only darkness...',16944,1,0,0,'marrowgar SAY_DEATH'), +(-1631010,'THE MASTER\'S RAGE COURSES THROUGH ME!',16945,1,0,0,'marrowgar SAY_BERSERK'), + +(-1631011,'You have found your way here, because you are among the few gifted with true vision in a world cursed with blindness.',17272,1,0,0,'deathwhisper SAY_SPEECH_1'), +(-1631012,'You can see through the fog that hangs over this world like a shroud, and grasp where true power lies.',17273,1,0,0,'deathwhisper SAY_SPEECH_2'), +(-1631013,'Fix your eyes upon your crude hands: the sinew, the soft meat, the dark blood coursing within.',16878,1,0,0,'deathwhisper SAY_SPEECH_3'), +(-1631014,'It is a weakness; a crippling flaw.... A joke played by the Creators upon their own creations.',17268,1,0,0,'deathwhisper SAY_SPEECH_4'), +(-1631015,'The sooner you come to accept your condition as a defect, the sooner you will find yourselves in a position to transcend it.',17269,1,0,0,'deathwhisper SAY_SPEECH_5'), +(-1631016,'Through our Master, all things are possible. His power is without limit, and his will unbending.',17270,1,0,0,'deathwhisper SAY_SPEECH_6'), +(-1631017,'Those who oppose him will be destroyed utterly, and those who serve -- who serve wholly, unquestioningly, with utter devotion of mind and soul -- elevated to heights beyond your ken.',17271,1,0,0,'deathwhisper SAY_SPEECH_7'), +(-1631018,'What is this disturbance?! You dare trespass upon this hallowed ground? This shall be your final resting place.',16868,1,0,0,'deathwhisper SAY_AGGRO'), +(-1631019,'Enough! I see I must take matters into my own hands!',16877,1,0,0,'deathwhisper SAY_PHASE_TWO'), +(-1631020,'Take this blessing and show these intruders a taste of our master\'s power.',16873,1,0,0,'deathwhisper SAY_DARK_EMPOWERMENT'), +(-1631021,'I release you from the curse of flesh!',16874,1,0,0,'deathwhisper SAY_DARK_TRANSFORMATION'), +(-1631022,'Arise and exalt in your pure form!',16875,1,0,0,'deathwhisper SAY_ANIMATE_DEAD'), +(-1631023,'You are weak, powerless to resist my will!',16876,1,0,0,'deathwhisper SAY_DOMINATE_MIND'), +(-1631024,'This charade has gone on long enough.',16872,1,0,0,'deathwhisper SAY_BERSERK'), +(-1631025,'All part of the masters plan! Your end is... inevitable!',16871,1,0,0,'deathwhisper SAY_DEATH'), +(-1631026,'Do you yet grasp of the futility of your actions?',16869,1,0,0,'deathwhisper SAY_SLAY_1'), +(-1631027,'Embrace the darkness... Darkness eternal!',16870,1,0,0,'deathwhisper SAY_SLAY_2'), + +(-1631028,'BY THE MIGHT OF THE LICH KING!',16694,1,0,0,'saurfang SAY_AGGRO'), +(-1631029,'The ground runs red with your blood!',16699,1,0,0,'saurfang SAY_FALLENCHAMPION'), +(-1631030,'Feast, my minions!',16700,1,0,0,'saurfang SAY_BLOODBEASTS'), +(-1631031,'You are nothing!',16695,1,0,0,'saurfang SAY_SLAY_1'), +(-1631032,'Your soul will find no redemption here!',16696,1,0,0,'saurfang SAY_SLAY_2'), +(-1631033,'I have become...DEATH!',16698,1,0,0,'saurfang SAY_BERSERK'), +(-1631034,'I... Am... Released.',16697,1,0,0,'saurfang SAY_DEATH'), +(-1631035,'Let\'s get a move on then! Move ou...',16974,1,0,0,'bronzebeard SAY_INTRO_ALLY_0'), +(-1631036,'For every Horde soldier that you killed, for every Alliance dog that fell, the Lich King\'s armies grew. Even now the Val\'kyr work to raise your fallen... As Scourge.',16701,1,0,0,'saurfang SAY_INTRO_ALLY_1'), +(-1631037,'Things are about to get much worse. Come, taste the power that the Lich King has bestowed upon me!',16702,1,0,0,'saurfang SAY_INTRO_ALLY_2'), +(-1631038,'A lone orc, against the might of the Alliance?',16970,1,0,0,'bronzebeard SAY_INTRO_ALLY_3'), +(-1631039,'Charge!',16971,1,0,0,'bronzebeard SAY_INTRO_ALLY_4'), +(-1631040,'Hahahaha! Dwarves...',16703,1,0,0,'saurfang SAY_INTRO_ALLY_5'), +(-1631041,'Kor\'kron, move out! Champions, watch your backs. The Scourge have been..',17103,1,0,0,'overlord SAY_INTRO_HORDE_1'), +(-1631042,'Join me, father. Join me and we will crush this world in the name of the Scourge -- for the glory of the Lich King!',16704,1,0,0,'saurfang SAY_INTRO_HORDE_2'), +(-1631043,'My boy died at the Wrath Gate. I am here only to collect his body.',17097,0,0,0,'overlord SAY_INTRO_HORDE_3'), +(-1631044,'Stubborn and old. What chance do you have? I am stronger, and more powerful than you ever were.',16705,1,0,0,'saurfang SAY_INTRO_HORDE_4'), +(-1631045,'We named him Dranosh. It means "Heart of Draenor" in orcish. I would not let the warlocks take him. My boy would be safe, hidden away by the elders of Garadar.',17098,0,0,0,'overlord SAY_INTRO_HORDE_5'), +(-1631046,'I made a promise to his mother before she died; that I would cross the Dark Portal alone - whether I lived or died, my son would be safe. Untainted...',17099,0,0,0,'overlord SAY_INTRO_HORDE_6'), +(-1631047,'Today, I fulfill that promise.',17100,0,0,0,'overlord SAY_INTRO_HORDE_7'), +(-1631048,'High Overlord Saurfang charges!',17104,2,0,0,'overlord SAY_INTRO_HORDE_8'), +(-1631049,'Pathetic old orc. Come then heroes. Come and face the might of the Scourge!',16706,1,0,0,'saurfang SAY_INTRO_HORDE_9'), +(-1631050,'%s gasps for air',16975,2,0,0,'bronzebeard SAY_OUTRO_ALLY_1'), +(-1631051,'That was Saurfang\'s boy - the Horde commander at the Wrath Gate. Such a tragic end...',16976,0,0,0,'bronzebeard SAY_OUTRO_ALLY_2'), +(-1631052,'What in the... There, in the distance!',16977,0,0,0,'bronzebeard SAY_OUTRO_ALLY_3'), +(-1631053,'Soldiers, fall in! Looks like the Horde are comin\' in to take another shot!',16978,1,0,0,'bronzebeard SAY_OUTRO_ALLY_4'), +(-1631054,'Don\'t force my hand, orc. We can\'t let you pass.',16972,0,0,0,'bronzebeard SAY_OUTRO_ALLY_5'), +(-1631055,'Behind you lies the body of my only son. Nothing will keep me from him.',17094,0,0,0,'overlord SAY_OUTRO_ALLY_6'), +(-1631056,'He... I can\'t do it. Get back on your ship and we\'ll spare your life.',16973,0,0,0,'bronzebeard SAY_OUTRO_ALLY_7'), +(-1631057,'Stand down, Muradin. Let a grieving father pass.',16690,0,0,0,'varian SAY_OUTRO_ALLY_8'), +(-1631058,'No\'ku kil zil\'nok ha tar.',17096,0,1,0,'overlord SAY_OUTRO_ALLY_9'), +(-1631059,'I will not forget this kindess. I thank you, highness.',17095,0,0,0,'overlord SAY_OUTRO_ALLY_10'), +(-1631060,'I... I was not at the Wrathgate. But the soldiers who survived told me much of what happened. Your son fought with honor. He died a hero\'s death. He deserves a hero\'s burial.',16691,0,0,0,'varian SAY_OUTRO_ALLY_11'), +(-1631061,'%s cries.',16651,2,0,0,'proudmore SAY_OUTRO_ALLY_12'), +(-1631062,'Jaina, why are you crying?',16692,0,0,0,'varian SAY_OUTRO_ALLY_13'), +(-1631063,'It was nothing, your majesty. Just... I\'m proud of my king.',16652,0,0,0,'proudmore SAY_OUTRO_ALLY_14'), +(-1631064,'Bah! Muradin, secure the deck and prepare our soldiers for an assault on the upper citadel. I\'ll send out another regiment from Stormwind.',16693,0,0,0,'varian SAY_OUTRO_ALLY_15'), +(-1631065,'Right away, yer majesty!',16979,0,0,0,'bronzebeard SAY_OUTRO_ALLY_16'), +(-1631066,'%s coughs.',17105,2,0,0,'overlord SAY_OUTRO_HORDE_1'), +(-1631067,'%s weeps over the corpse of his son.',17106,2,0,0,'overlord SAY_OUTRO_HORDE_2'), +(-1631068,'You will have a proper ceremony in Nagrand next to the pyres of your mother and ancestors.',17101,0,0,0,'overlord SAY_OUTRO_HORDE_3'), +(-1631069,'Honor, young heroes... no matter how dire the battle... Never forsake it!',17102,0,0,0,'overlord SAY_OUTRO_HORDE_4'), + +(-1631070,'What? Precious? Noooooooooo!!!',16993,6,0,0,'rotface SAY_PRECIOUS_DIES'), +(-1631071,'WEEEEEE!',16986,1,0,0,'rotface SAY_AGGRO'), +(-1631072,'Icky sticky.',16991,1,0,0,'rotface SAY_SLIME_SPRAY'), +(-1631073,'I think I made an angry poo-poo. It gonna blow!',16992,1,0,0,'rotface SAY_OOZE_EXPLODE'), +(-1631074,'Great news, everyone! The slime is flowing again!',17126,1,0,0,'putricide SAY_SLIME_FLOW_1'), +(-1631075,'Good news, everyone! I\'ve fixed the poison slime pipes!',17123,1,0,0,'putricide SAY_SLIME_FLOW_2'), +(-1631076,'Daddy make toys out of you!',16987,1,0,0,'rotface SAY_SLAY_1'), +(-1631077,'I brokes-ded it...',16988,1,0,0,'rotface SAY_SLAY_2'), +(-1631078,'Sleepy Time!',16990,1,0,0,'rotface SAY_BERSERK'), +(-1631079,'Bad news daddy.',16989,1,0,0,'rotface SAY_DEATH'), +(-1631080,'Terrible news, everyone, Rotface is dead! But great news everyone, he left behind plenty of ooze for me to use! Whaa...? I\'m a poet, and I didn\'t know it? Astounding!',17146,6,0,0,'putricide SAY_ROTFACE_DEATH'), + +(-1631081,'NOOOO! You kill Stinky! You pay!',16907,6,0,0,'festergut SAY_STINKY_DIES'), +(-1631082,'Fun time!',16901,1,0,0,'festergut SAY_AGGRO'), +(-1631083,'Just an ordinary gas cloud. But watch out, because that\'s no ordinary gas cloud! ',17119,1,0,0,'putricide SAY_BLIGHT'), +(-1631084,'%s farts.',16911,2,0,0,'festergut SAY_SPORE'), +(-1631085,'Gyah! Uhhh, I not feel so good...',16906,1,0,0,'festergut SAY_PUNGUENT_BLIGHT'), +(-1631086,'%s vomits',0,2,0,0,'festergut SAY_PUNGUENT_BLIGHT_EMOTE'), +(-1631087,'Daddy, I did it',16902,1,0,0,'festergut SAY_SLAY_1'), +(-1631088,'Dead, dead, dead!',16903,1,0,0,'festergut SAY_SLAY_2'), +(-1631089,'Fun time over!',16905,1,0,0,'festergut SAY_BERSERK'), +(-1631090,'Da ... Ddy...',16904,1,0,0,'festergut SAY_DEATH'), +(-1631091,'Oh, Festergut. You were always my favorite. Next to Rotface. The good news is you left behind so much gas, I can practically taste it!',17124,6,0,0,'putricide SAY_FESTERGUT_DEATH'), + +(-1631092,'Good news, everyone! I think I perfected a plague that will destroy all life on Azeroth!',17114,1,0,0,'putricide SAY_AGGRO'), +(-1631093,'You can\'t come in here all dirty like that! You need that nasty flesh scrubbed off first!',17125,1,0,0,'putricide SAY_AIRLOCK'), +(-1631094,'Two oozes, one room! So many delightful possibilities...',17122,1,0,0,'putricide SAY_PHASE_CHANGE'), +(-1631095,'Hmm. I don\'t feel a thing. Whaa...? Where\'d those come from?',17120,1,0,0,'putricide SAY_TRANSFORM_1'), +(-1631096,'Tastes like... Cherry! Oh! Excuse me!',17121,1,0,0,'putricide SAY_TRANSFORM_2'), +(-1631097,'Hmm... Interesting...',17115,1,0,0,'putricide SAY_SLAY_1'), +(-1631098,'That was unexpected!',17116,1,0,0,'putricide SAY_SLAY_2'), +(-1631099,'Great news, everyone!',17118,1,0,0,'putricide SAY_BERSERK'), +(-1631100,'Bad news, everyone! I don\'t think I\'m going to make it',17117,1,0,0,'putricide SAY_DEATH'), + +(-1631101,'Foolish mortals. You thought us defeated so easily? The San\'layn are the Lich King\'s immortal soldiers! Now you shall face their might combined!',16795,6,0,0,'lanathel SAY_COUNCIL_INTRO_1'), +(-1631102,'Rise up, brothers, and destroy our enemies',16796,6,0,0,'lanathel SAY_COUNCIL_INTRO_2'), + +(-1631103,'Such wondrous power! The Darkfallen Orb has made me INVINCIBLE!',16727,1,0,0,'keleseth SAY_KELESETH_INVOCATION'), +(-1631104,'Blood will flow!',16728,1,0,0,'keleseth SAY_KELESETH_SPECIAL'), +(-1631105,'Were you ever a threat?',16723,1,0,0,'keleseth SAY_KELESETH_SLAY_1'), +(-1631106,'Truth is found in death.',16724,1,0,0,'keleseth SAY_SKELESETH_SLAY_2'), +(-1631107,'%s cackles maniacally!',16726,2,0,0,'keleseth SAY_KELESETH_BERSERK'), +(-1631108,'My queen... they come...',16725,1,0,0,'keleseth SAY_KELESETH_DEATH'), + +(-1631109,'Tremble before Taldaram, mortals, for the power of the orb flows through me!',16857,1,0,0,'taldaram SAY_TALDARAM_INVOCATION'), +(-1631110,'Delight in the pain!',16858,1,0,0,'taldaram SAY_TALDARAM_SPECIAL'), +(-1631111,'Worm food.',16853,1,0,0,'taldaram SAY_TALDARAM_SLAY_1'), +(-1631112,'Beg for mercy!',16854,1,0,0,'taldaram SAY_TALDARAM_SLAY_2'), +(-1631113,'%s laughs.',16856,2,0,0,'taldaram SAY_TALDARAM_BERSERK'), +(-1631114,'%s gurgles and dies.',16855,2,0,0,'taldaram SAY_TALDARAM_DEATH'), + +(-1631115,'Naxxanar was merely a setback! With the power of the orb, Valanar will have his vengeance!',16685,1,0,0,'valanar SAY_VALANAR_INVOCATION'), +(-1631116,'My cup runneth over.',16686,1,0,0,'valanar SAY_VALANAR_SPECIAL'), +(-1631117,'Dinner... is served.',16681,1,0,0,'valanar SAY_VALANAR_SLAY_1'), +(-1631118,'Dinner... is served.',16682,1,0,0,'valanar SAY_VALANAR_SLAY_2'), +(-1631119,'BOW DOWN BEFORE THE SAN\'LAYN!',16684,1,0,0,'valanar SAY_VALANAR_BERSERK'), +(-1631120,'...why...?',16683,1,0,0,'valanar SAY_VALANAR_DEATH'), + +(-1631121,'You have made an... unwise... decision.',16782,1,0,0,'blood_queen SAY_AGGRO'), +(-1631122,'Just a taste...',16783,1,0,0,'blood_queen SAY_BITE_1'), +(-1631123,'Know my hunger!',16784,1,0,0,'blood_queen SAY_BITE_2'), +(-1631124,'SUFFER!',16786,1,0,0,'blood_queen SAY_SHADOWS'), +(-1631125,'Can you handle this?',16787,1,0,0,'blood_queen SAY_PACT'), +(-1631126,'Yes... feed my precious one! You\'re mine now!',16790,1,0,0,'blood_queen SAY_MC'), +(-1631127,'Here it comes.',16788,1,0,0,'blood_queen SAY_AIR_PHASE'), +(-1631128,'THIS ENDS NOW!',16793,1,0,0,'blood_queen SAY_BERSERK'), +(-1631129,'But... we were getting along... so well...',16794,1,0,0,'blood_queen SAY_DEATH'), + +(-1631130,'Ready your arms, my Argent Brothers. The Vrykul will protect the Frost Queen with their lives.',16819,1,0,0,'scourgebane SAY_SVALNA_EVENT_1'), +(-1631131,'Even dying here beats spending another day collecting reagents for that madman, Finklestein.',16585,1,0,0,'arnath SAY_SVALNA_EVENT_2'), +(-1631132,'Enough idle banter! Our champions have arrived - support them as we push our way through the hall!',16820,1,0,0,'scourgebane SAY_SVALNA_EVENT_3'), +(-1631133,'You may have once fought beside me, Crok, but now you are nothing more than a traitor. Come, your second death approaches!',17017,1,0,0,'svalna SAY_SVALNA_EVENT_4'), +(-1631134,'Miserable creatures, Die!',17018,1,0,0,'svalna SAY_KILLING_CRUSADERS'), +(-1631135,'Foolish Crok, you brought my reinforcements with you! Arise Argent Champions and serve the Lich King in death!',17019,1,0,0,'svalna SAY_RESSURECT'), +(-1631136,'Come Scourgebane, I\'ll show the Lich King which one of us is truly worthy of the title, champion!',17020,1,0,0,'svalna SAY_SVALNA_AGGRO'), +(-1631137,'What? They died so easily? No matter.',17022,1,0,0,'svalna SAY_KILL_CAPTAIN'), +(-1631138,'What a pitiful choice of an ally Crok.',17021,1,0,0,'svalna SAY_KILL_PLAYER'), +(-1631139,'Perhaps... you were right... Crok, you must not approach the Frost Queen, quickly, stop them!',17023,1,0,0,'svalna SAY_DEATH'), + +(-1631140,'Heroes, lend me your aid! I... I cannot hold them off much longer! You must heal my wounds!',17064,1,0,0,'dreamwalker SAY_AGGRO'), +(-1631141,'I have opened a portal into the Dream. Your salvation lies within, heroes.',17068,1,0,0,'dreamwalker SAY_PORTAL'), +(-1631142,'My strength is returning! Press on, heroes!',17070,1,0,0,'dreamwalker SAY_75_HEALTH'), +(-1631143,'I will not last much longer!',17069,1,0,0,'dreamwalker SAY_25_HEALTH'), +(-1631144,'Forgive me for what I do! I... cannot... stop... ONLY NIGHTMARES REMAIN!',17072,1,0,0,'dreamwalker SAY_0_HEALTH'), +(-1631145,'A tragic loss...',17066,1,0,0,'dreamwalker SAY_PLAYER_DIES'), +(-1631146,'FAILURES!',17067,1,0,0,'dreamwalker SAY_BERSERK'), +(-1631147,'I am renewed! Ysera grants me the favor to lay these foul creatures to rest!',17071,1,0,0,'dreamwalker SAY_VICTORY'), + +(-1631148,'You are fools who have come to this place! The icy winds of Northrend will consume your souls!',17007,1,0,0,'sindragosa SAY_AGGRO'), +(-1631149,'Suffer, mortals, as your pathetic magic betrays you!',17014,1,0,0,'sindragosa SAY_UNCHAINED_MAGIC'), +(-1631150,'Can you feel the cold hand of death upon your heart?',17013,1,0,0,'sindragosa SAY_BLISTERING_COLD'), +(-1631151,'Aaah! It burns! What sorcery is this?!',17015,1,0,0,'sindragosa SAY_RESPIRE'), +(-1631152,'Your incursion ends here! None shall survive!',17012,1,0,0,'sindragosa SAY_TAKEOFF'), +(-1631153,'Now feel my master\'s limitless power and despair!',17016,1,0,0,'sindragosa SAY_PHASE_3'), +(-1631154,'Perish!',17008,1,0,0,'sindragosa SAY_SLAY_1'), +(-1631155,'A flaw of mortality...',17009,1,0,0,'sindragosa SAY_SLAY_2'), +(-1631156,'Enough! I tire of these games!',17011,1,0,0,'sindragosa SAY_BERSERK'), +(-1631157,'Free...at last...',17010,1,0,0,'sindragosa SAY_DEATH'), + +(-1631158,'So...the Light\'s vaunted justice has finally arrived. Shall I lay down Frostmourne and throw myself at your mercy, Fordring?',17349,1,0,0,'lich_king SAY_INTRO_1'), +(-1631159,'We will grant you a swift death, Arthas. More than can be said for the thousands you\'ve tortured and slain.',17390,1,0,0,'tirion SAY_INTRO_2'), +(-1631160,'You will learn of that first hand. When my work is complete, you will beg for mercy -- and I will deny you. Your anguished cries will be testament to my unbridled power.',17350,1,0,0,'lich_king SAY_INTRO_3'), +(-1631161,'So be it. Champions, attack!',17391,1,0,0,'tirion SAY_INTRO_4'), +(-1631162,'I\'ll keep you alive to witness the end, Fordring. I would not want the Light\'s greatest champion to miss seeing this wretched world remade in my image.',17351,1,0,0,'lich_king SAY_INTRO_5'), +(-1631163,'Come then champions, feed me your rage!',17352,1,0,0,'lich_king SAY_AGGRO'), +(-1631164,'I will freeze you from within until all that remains is an icy husk!',17369,1,0,0,'lich_king SAY_REMORSELESS_WINTER'), +(-1631165,'Watch as the world around you collapses!',17370,1,0,0,'lich_king SAY_SHATTER_ARENA'), +(-1631166,'Val\'kyr, your master calls!',17373,1,0,0,'lich_king SAY_SUMMON_VALKYR'), +(-1631167,'Frostmourne hungers...',17366,1,0,0,'lich_king SAY_HARVEST_SOUL'), +(-1631168,'You have come to bring Arthas to justice? To see the Lich King destroyed?',17394,1,0,0,'terenas SAY_FM_TERENAS_AID_1'), +(-1631169,'First, you must escape Frostmourne\'s hold, or be damned as I am; trapped within this cursed blade for all eternity.',17395,1,0,0,'terenas SAY_FM_TERENAS_AID_2'), +(-1631170,'Aid me in destroying these tortured souls! Together we will loosen Frostmourne\'s hold and weaken the Lich King from within!',17396,1,0,0,'terenas SAY_FM_TERENAS_AID_3'), +(-1631171,'Argh... Frostmourne, obey me!',17367,1,0,0,'lich_king SAY_FM_PLAYER_ESCAPE'), +(-1631172,'Frostmourne feeds on the soul of your fallen ally!',17368,1,0,0,'lich_king SAY_FM_PLAYER_DEATH'), +(-1631173,'Apocalypse!',17371,1,0,0,'lich_king SAY_SPECIAL_1'), +(-1631174,'Bow down before your lord and master!',17372,1,0,0,'lich_king SAY_SPECIAL_2'), +(-1631175,'You gnats actually hurt me! Perhaps I\'ve toyed with you long enough, now taste the vengeance of the grave!',17359,1,0,0,'lich_king SAY_LAST_PHASE'), +(-1631176,'Hope wanes!',17363,1,0,0,'lich_king SAY_SLAY_1'), +(-1631177,'The end has come!',17364,1,0,0,'lich_king SAY_SLAY_2'), +(-1631178,'Face now your tragic end!',17365,1,0,0,'lich_king SAY_ENRAGE'), +(-1631179,'No question remains unanswered. No doubts linger. You are Azeroth\'s greatest champions! You overcame every challenge I laid before you. My mightiest servants have fallen before your relentless onslaught, your unbridled fury...',17353,1,0,0,'lich_king SAY_OUTRO_1'), +(-1631180,'Is it truly righteousness that drives you? I wonder',17354,1,0,0,'lich_king SAY_OUTRO_2'), +(-1631181,'You trained them well, Fordring. You delivered the greatest fighting force this world has ever known... right into my hands -- exactly as I intended. You shall be rewarded for your unwitting sacrifice.',17355,1,0,0,'lich_king SAY_OUTRO_3'), +(-1631182,'Watch now as I raise them from the dead to become masters of the Scourge. They will shroud this world in chaos and destruction. Azeroth\'s fall will come at their hands -- and you will be the first to die.',17356,1,0,0,'lich_king SAY_OUTRO_4'), +(-1631183,'I delight in the irony.',17357,1,0,0,'lich_king SAY_OUTRO_5'), +(-1631184,'LIGHT, GRANT ME ONE FINAL BLESSING. GIVE ME THE STRENGTH... TO SHATTER THESE BONDS!',17392,1,0,0,'tirion SAY_OUTRO_6'), +(-1631185,'Impossible...',17358,1,0,0,'lich_king SAY_OUTRO_7'), +(-1631186,'No more, Arthas! No more lives will be consumed by your hatred!',17393,1,0,0,'tirion SAY_OUTRO_8'), +(-1631187,'Free at last! It is over, my son. This is the moment of reckoning.',17397,1,0,0,'terenas SAY_OUTRO_9'), +(-1631188,'Rise up, champions of the Light!',17398,1,0,0,'terenas SAY_OUTRO_10'), +(-1631189,'THE LICH KING...MUST...FALL!',17389,1,0,0,'tirion SAY_OUTRO_11'), +(-1631190,'Now I stand, the lion before the lambs... and they do not fear.',17361,1,0,0,'lich_king SAY_OUTRO_12'), +(-1631191,'They cannot fear.',17362,1,0,0,'lich_king SAY_OUTRO_13'), +(-1631192,'%s dies',17374,2,0,0,'lich_king SAY_OUTRO_14'); -- -1 632 000 ICC: FORGE OF SOULS INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES @@ -3330,9 +3640,9 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen (-1649021,'The Horde demands justice! We challenge the Alliance. Allow us to battle in place of your knights, paladin. We will show these dogs what it means to insult the Horde!',16023,1,0,0,'garrosh SAY_GARROSH_PVP_A_INTRO_1'), (-1649022,'Our honor has been besmirched! They make wild claims and false accusations against us. I demand justice! Allow my champions to fight in place of your knights, Tirion. We challenge the Horde!',16066,1,0,0,'varian SAY_VARIAN_PVP_H_INTRO_1'), (-1649023,'Very well, I will allow it. Fight with honor!',16048,1,0,0,'tirion SAY_TIRION_PVP_INTRO_2'), -(-1649024,'Fight for the glory of the Alliance, heroes! Honor your king and your people!',16065,1,0,0,'varian SAY_VARIAN_PVP_A_INTRO_2'), -(-1649025,'Show them no mercy, Horde champions! LOK\'TAR OGAR!',16022,1,0,0,'garrosh SAY_GARROSH_PVP_H_INTRO_2'), -(-1649026,'Glory to the alliance.',16067,1,0,0,'varian SAY_VARIAN_PVP_A_WIN'), +(-1649024,'Fight for the glory of the Alliance, heroes! Honor your king and your people!',16065,1,0,0,'varian SAY_VARIAN_PVP_H_INTRO_2'), +(-1649025,'Show them no mercy, Horde champions! LOK\'TAR OGAR!',16022,1,0,0,'garrosh SAY_GARROSH_PVP_A_INTRO_2'), +(-1649026,'GLORY TO THE ALLIANCE!',16067,1,0,0,'varian SAY_VARIAN_PVP_A_WIN'), (-1649027,'That was just a taste of what the future brings. FOR THE HORDE!',16024,1,0,0,'garrosh SAY_GARROSH_PVP_H_WIN'), (-1649028,'A shallow and tragic victory. We are weaker as a whole from the losses suffered today. Who but the Lich King could benefit from such foolishness? Great warriors have lost their lives. And for what? The true threat looms ahead - the Lich King awaits us all in death.',16049,1,0,0,'tirion SAY_TIRION_PVP_WIN'), @@ -3346,7 +3656,7 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen (-1649035,'Arthas! You are hopelessly outnumbered! Lay down Frostmourne and I will grant you a just death.',16052,1,0,0,'tirion SAY_TIRION_ABUN_INTRO_1'), (-1649036,'The Nerubians built an empire beneath the frozen wastes of Northrend. An empire that you so foolishly built your structures upon. MY EMPIRE.',16322,1,0,0,'lich_king SAY_LKING_ANUB_INTRO_2'), (-1649037,'The souls of your fallen champions will be mine, Fordring.',16323,1,0,0,'lich_king SAY_LKING_ANUB_INTRO_3'), -(-1649038,'Ahhh... Our guests arrived, just as the master promised.',16235,1,0,0,'anubarak SAY_ANUB_ANUB_INTRO_1'), +(-1649038,'Ahhh, our guests have arrived, just as the master promised.',16235,1,0,0,'anubarak SAY_ANUB_ANUB_INTRO_1'), (-1649039,'%s glares at $N and lets out a bellowing roar!',0,3,0,0,'icehowl EMOTE_MASSIVE_CRASH'), @@ -3634,7 +3944,18 @@ INSERT INTO gossip_texts (entry,content_default,comment) VALUES -- -3 649 000 TRIAL OF CRUSADER INSERT INTO gossip_texts (entry,content_default,comment) VALUES -(-3649000,'Yes. We are prepared for the challenges ahead of us.','barrett GOSSIP_ITEM_START_EVENT1'); +(-3649000,'Yes. We are prepared for the challenges ahead of us.','barrett GOSSIP_ITEM_BEAST_INIT'), +(-3649001,'Bring forth the first challenge!','barrett GOSSIP_ITEM_BEAST_START'), +(-3649002,'We want another shot at those beasts!','barrett GOSSIP_ITEM_BEAST_WIPE_INIT'), +(-3649003,'What new challenge awaits us?','barrett GOSSIP_ITEM_JARAXXUS_INIT'), +(-3649004,'We\'re ready to fight the sorceror again.','barrett GOSSIP_ITEM_JARAXXUS_WIPE_INIT'), +(-3649005,'Of course!','barrett GOSSIP_ITEM_PVP_INIT'), +(-3649006,'Give the signal! We\'re ready to go!','barrett GOSSIP_ITEM_PVP_START'), +(-3649007,'That tough, huh?','barrett GOSSIP_ITEM_TWINS_INIT'), +(-3649008,'Val\'kyr? We\'re ready for them','barrett GOSSIP_ITEM_TWINS_START'), +(-3649009,'Your words of praise are appreciated, Coliseum Master.','barrett GOSSIP_ITEM_ANUB_INIT'), +(-3649010,'That is strange...','barrett GOSSIP_ITEM_ANUB_START'); + -- -- Below just for beautiful view in table, run at own desire @@ -4844,18 +5165,6 @@ INSERT INTO script_waypoint VALUES (18210, 18, -1324.803589, 8510.688477, 13.050, 0, ''), (18210, 19, -1312.075439, 8492.709961, 14.235, 0, ''); -DELETE FROM script_waypoint WHERE entry=18731; -INSERT INTO script_waypoint VALUES -(18731, 0, -157.366, 2.177, 8.073, 0, ''), -(18731, 1, -172.266, -18.280, 8.073, 0, ''), -(18731, 2, -171.051, -38.748, 8.073, 0, ''), -(18731, 3, -170.718, -59.436, 8.073, 0, ''), -(18731, 4, -156.659, -72.118, 8.073, 0, ''), -(18731, 5, -142.292, -59.423, 8.073, 0, ''), -(18731, 6, -141.779, -38.972, 8.073, 0, ''), -(18731, 7, -142.922, -18.950, 8.073, 0, ''), -(18731, 8, -157.366, 2.177, 8.073, 0, ''); - DELETE FROM script_waypoint WHERE entry=18887; INSERT INTO script_waypoint VALUES (18887, 0, 2650.06, 665.473, 61.9305, 0, ''), diff --git a/system/ScriptLoader.cpp b/system/ScriptLoader.cpp index 3a92651..6a5ad5b 100644 --- a/system/ScriptLoader.cpp +++ b/system/ScriptLoader.cpp @@ -6,6 +6,7 @@ // battlegrounds extern void AddSC_battleground(); +extern void AddSC_battlegroundSA(); // custom extern void AddSC_custom_cybernetic(); @@ -537,6 +538,7 @@ void AddScripts() { // battlegrounds AddSC_battleground(); + AddSC_battlegroundSA(); // custom AddSC_custom_cybernetic();