diff --git a/src/game/BattleGround/BattleGround.cpp b/src/game/BattleGround/BattleGround.cpp index 43b7d3e01..7ba25fa9d 100644 --- a/src/game/BattleGround/BattleGround.cpp +++ b/src/game/BattleGround/BattleGround.cpp @@ -184,7 +184,7 @@ void BattleGround::BroadcastWorker(Do& _do) _do(plr); } -BattleGround::BattleGround(): m_BuffChange(false), m_ArenaBuffSpawned(false), m_StartDelayTime(0), m_startMaxDist(0) +BattleGround::BattleGround() { m_TypeID = BattleGroundTypeId(0); m_Status = STATUS_NONE; @@ -197,7 +197,6 @@ BattleGround::BattleGround(): m_BuffChange(false), m_ArenaBuffSpawned(false), m_ m_IsArena = false; m_Winner = TEAM_NONE; m_StartTime = 0; - m_validStartPositionTimer = 0; m_CountdownTimer = 0; m_Events = 0; m_IsRated = false; @@ -370,31 +369,26 @@ void BattleGround::Update(uint32 diff) if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize()) { - float maxDist = GetStartMaxDist(); - if (maxDist > 0.0f) - { - if (m_validStartPositionTimer < diff) - { - for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) - { - if (Player* player = sObjectMgr.GetPlayer(itr->first)) - { - float x, y, z, o; - GetTeamStartLoc(player->GetTeam(), x, y, z, o); - if (!player->IsWithinDist3d(x, y, z, maxDist)) - { - player->TeleportTo(GetMapId(), x, y, z, o); - } - } - } - m_validStartPositionTimer = CHECK_PLAYER_POSITION_INVERVAL; - } - else - m_validStartPositionTimer -= diff; - } - ModifyStartDelayTime(diff); + if (m_CountdownTimer >= 10000) + { + uint32 countdownMaxForBGType = isArena() ? ARENA_COUNTDOWN_MAX : BATTLEGROUND_COUNTDOWN_MAX; + + WorldPacket data(SMSG_START_TIMER, 4+4+4); + data << uint32(0); + data << uint32(countdownMaxForBGType - (m_StartTime / 1000)); + data << uint32(countdownMaxForBGType); + + for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) + if (Player* player = sObjectMgr.GetPlayer(itr->first)) + player->GetSession()->SendPacket(&data); + + m_CountdownTimer = 0; + } + else + m_CountdownTimer += diff; + if (!(m_Events & BG_STARTING_EVENT_1)) { m_Events |= BG_STARTING_EVENT_1; diff --git a/src/game/BattleGround/BattleGround.h b/src/game/BattleGround/BattleGround.h index aeb6a896c..ea92d045e 100644 --- a/src/game/BattleGround/BattleGround.h +++ b/src/game/BattleGround/BattleGround.h @@ -110,7 +110,6 @@ enum BattleGroundSpells enum BattleGroundTimeIntervals { - CHECK_PLAYER_POSITION_INVERVAL = 1000, // ms RESURRECTION_INTERVAL = 30000, // ms INVITATION_REMIND_TIME = 20000, // ms INVITE_ACCEPT_WAIT_TIME = 60000, // ms @@ -423,9 +422,6 @@ class BattleGround return m_Map; } - void SetStartMaxDist(float startMaxDist) { m_startMaxDist = startMaxDist; } - float GetStartMaxDist() const { return m_startMaxDist; } - void SetTeamStartLoc(Team team, float X, float Y, float Z, float O); void GetTeamStartLoc(Team team, float& X, float& Y, float& Z, float& O) const { @@ -616,7 +612,6 @@ class BattleGround uint32 m_StartTime; uint32 m_CountdownTimer; bool m_ArenaBuffSpawned; // to cache if arenabuff event is started (cause bool is faster than checking IsActiveEvent) - uint32 m_validStartPositionTimer; int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself BattleGroundBracketId m_BracketId; ArenaType m_ArenaType; // 2=2v2, 3=3v3, 5=5v5 @@ -665,7 +660,6 @@ class BattleGround float m_TeamStartLocY[PVP_TEAM_COUNT]; float m_TeamStartLocZ[PVP_TEAM_COUNT]; float m_TeamStartLocO[PVP_TEAM_COUNT]; - float m_startMaxDist; }; // helper functions for world state list fill diff --git a/src/game/BattleGround/BattleGroundMgr.cpp b/src/game/BattleGround/BattleGroundMgr.cpp index 8f7de89b2..9f958f244 100644 --- a/src/game/BattleGround/BattleGroundMgr.cpp +++ b/src/game/BattleGround/BattleGroundMgr.cpp @@ -1821,7 +1821,7 @@ BattleGround* BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeId } // used to create the BG templates -uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsArena, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char const* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO, float StartMaxDist) +uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsArena, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char const* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO) { // Create the BG BattleGround* bg = NULL; @@ -1853,7 +1853,6 @@ uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsA bg->SetName(BattleGroundName); bg->SetTeamStartLoc(ALLIANCE, Team1StartLocX, Team1StartLocY, Team1StartLocZ, Team1StartLocO); bg->SetTeamStartLoc(HORDE, Team2StartLocX, Team2StartLocY, Team2StartLocZ, Team2StartLocO); - bg->SetStartMaxDist(StartMaxDist); bg->SetLevelRange(LevelMin, LevelMax); // add bg to update list @@ -1867,8 +1866,8 @@ void BattleGroundMgr::CreateInitialBattleGrounds() { uint32 count = 0; - // 0 1 2 3 4 5 6 7 - QueryResult* result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO,StartMaxDist FROM battleground_template"); + // 0 1 2 3 4 5 6 + QueryResult* result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO FROM battleground_template"); if (!result) { @@ -1965,10 +1964,8 @@ void BattleGroundMgr::CreateInitialBattleGrounds() continue; } - float startMaxDist = fields[7].GetFloat(); - // sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl); - if (!CreateBattleGround(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, bl->minLevel, bl->maxLevel, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3], startMaxDist)) + if (!CreateBattleGround(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, bl->minLevel, bl->maxLevel, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3])) continue; ++count; diff --git a/src/game/BattleGround/BattleGroundMgr.h b/src/game/BattleGround/BattleGroundMgr.h index fdd9a472a..b4e1bb4eb 100644 --- a/src/game/BattleGround/BattleGroundMgr.h +++ b/src/game/BattleGround/BattleGroundMgr.h @@ -216,7 +216,7 @@ class BattleGroundMgr BattleGround* GetBattleGroundTemplate(BattleGroundTypeId bgTypeId); BattleGround* CreateNewBattleGround(BattleGroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, ArenaType arenaType, bool isRated); - uint32 CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsArena, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char const* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO, float StartMaxDist); + uint32 CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsArena, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char const* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO); void AddBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId, BattleGround* BG) { m_BattleGrounds[bgTypeId][InstanceID] = BG; }; void RemoveBattleGround(uint32 instanceID, BattleGroundTypeId bgTypeId) { m_BattleGrounds[bgTypeId].erase(instanceID); } diff --git a/src/game/Object/Unit.h b/src/game/Object/Unit.h index c14030a7e..bc6d61ced 100644 --- a/src/game/Object/Unit.h +++ b/src/game/Object/Unit.h @@ -2401,7 +2401,22 @@ class Unit : public WorldObject bool isPassiveToHostile() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); } virtual bool IsInWater() const; + /** + * Is this \ref Unit under water? + * @return true if the \ref Unit is under water, false otherwise + * \see Object::GetTerrain + * \see TerrainInfo::IsUnderWater + */ virtual bool IsUnderWater() const; + /** + * Can the given \ref Creature access this \ref Unit in some way? If this \ref Unit is in + * water we check if the \ref Creature can swim, if so it's accessible, otherwise it's not. + * If we're not in water the \ref Creature should be able to walk or fly and then we're + * accessible. + * @param c The \ref Creature to check accessibility for + * @return true if this \ref Unit is accessible to the \ref Creature given, false otherwise + * \todo Rename to IsInAccessablePlaceFor to follow standards? + */ bool IsInAccessablePlaceFor(Creature const* c) const; void SendHealSpellLog(Unit* pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, bool critical = false, uint32 absorb = 0); diff --git a/src/modules/SD3/CMakeLists.txt b/src/modules/SD3/CMakeLists.txt index 0a2c690c1..a70b2d6af 100644 --- a/src/modules/SD3/CMakeLists.txt +++ b/src/modules/SD3/CMakeLists.txt @@ -531,6 +531,19 @@ file(GLOB sources_raid_nr_eoe scripts/northrend/nexus/eye_of_eternity/*.cpp scri file(GLOB sources_raid_nr_uld scripts/northrend/ulduar/ulduar/*.cpp scripts/northrend/ulduar/ulduar/*.h) LIST(APPEND mangosscript_LIB_SRCS ${sources_raid_nr_uld}) source_group("Northrend Scripts\\Raids\\Ulduar" FILES ${sources_raid_nr_uld}) + +# --- THREE ONLY --- +if ("${MANGOS_EXP}" STREQUAL "CATA") +#Maelstrom Scripts +file(GLOB sources_maelstrom scripts/maelstrom/*.cpp scripts/maelstrom/*.h) + LIST(APPEND mangosscript_LIB_SRCS ${sources_maelstrom}) + source_group("Maelstrom Scripts" FILES ${sources_maelstrom}) +#Instance: Stonecore +file(GLOB sources_instance_m_sc scripts/maelstrom/stonecore/*.cpp scripts/maelstrom/stonecore/*.h) + LIST(APPEND mangosscript_LIB_SRCS ${sources_instance_m_sc}) + source_group("Eastern Kingdoms Scripts\\Instances\\Stonecore" FILES ${sources_instance_m_sc}) +endif() +# --- END IF --- #WorldScript: Scarlet Enclave file(GLOB sources_world_scarlet_enclave scripts/eastern_kingdoms/scarlet_enclave/*.cpp scripts/eastern_kingdoms/scarlet_enclave/*.h) diff --git a/src/modules/SD3/README.md b/src/modules/SD3/README.md index f70465c0e..d6053f9d5 100644 --- a/src/modules/SD3/README.md +++ b/src/modules/SD3/README.md @@ -1,5 +1,8 @@ # ScriptDev3 -New EventAI engine for all MaNGOS cores. Developed from the old ScriptDev2. +New Script engine for all MaNGOS cores. Developed from the old ScriptDev2. + +The same code library is used unchanged as a submodule between each of the cores. +- Special directives lock down specific core code to the required version . diff --git a/src/modules/SD3/base/escort_ai.cpp b/src/modules/SD3/base/escort_ai.cpp index 5db895290..f2ed0ce1f 100644 --- a/src/modules/SD3/base/escort_ai.cpp +++ b/src/modules/SD3/base/escort_ai.cpp @@ -144,7 +144,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* pWho) return false; } - // unit state prevents (similar check is done in CanInitiateAttack which also include checking UnitFlags. We skip those here) + // unit state prevents (similar check is done in CanInitiateAttack which also include checking unit_flags. We skip those here) if (m_creature->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_DIED)) { return false; @@ -629,7 +629,7 @@ void npc_escortAI::Start(bool bRun, const Player* pPlayer, const Quest* pQuest, debug_log("SD3: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); } - // disable NpcFlagss + // disable npcflags m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); debug_log("SD3: EscortAI started with " SIZEFMTD " waypoints. Run = %d, PlayerGuid = %s", WaypointList.size(), m_bIsRunning, m_playerGuid.GetString().c_str()); diff --git a/src/modules/SD3/base/follower_ai.cpp b/src/modules/SD3/base/follower_ai.cpp index 12fef1361..16581afdc 100644 --- a/src/modules/SD3/base/follower_ai.cpp +++ b/src/modules/SD3/base/follower_ai.cpp @@ -82,7 +82,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* pWho) return false; } - // unit state prevents (similar check is done in CanInitiateAttack which also include checking UnitFlags. We skip those here) + // unit state prevents (similar check is done in CanInitiateAttack which also include checking unit_flags. We skip those here) if (m_creature->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_DIED)) { return false; diff --git a/src/modules/SD3/include/sc_creature.cpp b/src/modules/SD3/include/sc_creature.cpp index 625da696f..6b207caad 100644 --- a/src/modules/SD3/include/sc_creature.cpp +++ b/src/modules/SD3/include/sc_creature.cpp @@ -58,8 +58,9 @@ bool ScriptedAI::IsVisible(Unit* pWho) const { return false; } - - return m_creature->IsWithinDist(pWho, VISIBLE_RANGE) && pWho->IsVisibleForOrDetect(m_creature, m_creature, true); + + // return m_creature->IsWithinDist(pWho, VISIBLE_RANGE) && pWho->IsVisibleForOrDetect(m_creature, m_creature, true); 166.0f + return m_creature->IsWithinDist(pWho, 166.0f) && pWho->IsVisibleForOrDetect(m_creature, m_creature, true); } /** diff --git a/src/modules/SD3/scripts/battlegrounds/battleground.cpp b/src/modules/SD3/scripts/battlegrounds/battleground.cpp index dc69c4d82..25df146f3 100644 --- a/src/modules/SD3/scripts/battlegrounds/battleground.cpp +++ b/src/modules/SD3/scripts/battlegrounds/battleground.cpp @@ -123,12 +123,10 @@ struct npc_spirit_guide : public CreatureScript #endif }; -#if defined (TBC) || defined (WOTLK) || defined (CATA) CreatureAI* GetAI(Creature* pCreature) override { return new npc_spirit_guideAI(pCreature); } -#endif }; void AddSC_battleground() diff --git a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_depths/blackrock_depths.cpp b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_depths/blackrock_depths.cpp index cf494ef24..1e6246bfc 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_depths/blackrock_depths.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_depths/blackrock_depths.cpp @@ -28,7 +28,7 @@ * ScriptData * SDName: Blackrock_Depths * SD%Complete: 80 - * SDComment: Quest support: 4001, 4322, 4342, 7604, 9015. + * SDComment: Quest support: 4322, 7604, 9015. * SDCategory: Blackrock Depths * EndScriptData */ @@ -39,7 +39,6 @@ * go_relic_coffer_door * at_ring_of_law * npc_grimstone - * npc_kharan_mighthammer * npc_marshal_windsor * npc_dughal_stormwing * npc_tobias_seecher @@ -516,114 +515,6 @@ struct spell_banner_of_provocation : public SpellScript } }; -/*###### -## npc_kharan_mighthammer -######*/ -enum -{ - QUEST_WHAT_IS_GOING_ON = 4001, - QUEST_KHARANS_TALE = 4342 -}; - -#define GOSSIP_ITEM_KHARAN_1 "I need to know where the princess are, Kharan!" -#define GOSSIP_ITEM_KHARAN_2 "All is not lost, Kharan!" - -#define GOSSIP_ITEM_KHARAN_3 "Gor'shak is my friend, you can trust me." -#define GOSSIP_ITEM_KHARAN_4 "Not enough, you need to tell me more." -#define GOSSIP_ITEM_KHARAN_5 "So what happened?" -#define GOSSIP_ITEM_KHARAN_6 "Continue..." -#define GOSSIP_ITEM_KHARAN_7 "So you suspect that someone on the inside was involved? That they were tipped off?" -#define GOSSIP_ITEM_KHARAN_8 "Continue with your story please." -#define GOSSIP_ITEM_KHARAN_9 "Indeed." -#define GOSSIP_ITEM_KHARAN_10 "The door is open, Kharan. You are a free man." - -struct npc_kharan_mighthammer : public CreatureScript -{ - npc_kharan_mighthammer() : CreatureScript("npc_kharan_mighthammer") {} - - bool OnGossipHello(Player* pPlayer, Creature* pCreature) - { - if (pCreature->IsQuestGiver()) - { - pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid()); - } - - if (pPlayer->GetQuestStatus(QUEST_WHAT_IS_GOING_ON) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - } - - if (pPlayer->GetQuestStatus(QUEST_KHARANS_TALE) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - } - - if (pPlayer->GetTeam() == HORDE) - { - pPlayer->SEND_GOSSIP_MENU(2473, pCreature->GetObjectGuid()); - } - else - { - pPlayer->SEND_GOSSIP_MENU(2474, pCreature->GetObjectGuid()); - } - - return true; - } - - bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) - { - pPlayer->PlayerTalkClass->ClearMenus(); - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF + 1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(2475, pCreature->GetObjectGuid()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(2476, pCreature->GetObjectGuid()); - break; - - case GOSSIP_ACTION_INFO_DEF + 3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(2477, pCreature->GetObjectGuid()); - break; - case GOSSIP_ACTION_INFO_DEF + 4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - pPlayer->SEND_GOSSIP_MENU(2478, pCreature->GetObjectGuid()); - break; - case GOSSIP_ACTION_INFO_DEF + 5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - pPlayer->SEND_GOSSIP_MENU(2479, pCreature->GetObjectGuid()); - break; - case GOSSIP_ACTION_INFO_DEF + 6: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - pPlayer->SEND_GOSSIP_MENU(2480, pCreature->GetObjectGuid()); - break; - case GOSSIP_ACTION_INFO_DEF + 7: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); - pPlayer->SEND_GOSSIP_MENU(2481, pCreature->GetObjectGuid()); - break; - case GOSSIP_ACTION_INFO_DEF + 8: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); - pPlayer->SEND_GOSSIP_MENU(2482, pCreature->GetObjectGuid()); - break; - case GOSSIP_ACTION_INFO_DEF + 9: - pPlayer->CLOSE_GOSSIP_MENU(); - if (pPlayer->GetTeam() == HORDE) - { - pPlayer->AreaExploredOrEventHappens(QUEST_WHAT_IS_GOING_ON); - } - else - { - pPlayer->AreaExploredOrEventHappens(QUEST_KHARANS_TALE); - } - break; - } - return true; - } -}; - /*###### ## npc_rocknot ######*/ @@ -1254,10 +1145,6 @@ void AddSC_blackrock_depths() s = new npc_grimstone(); s->RegisterSelf(); - s = new npc_kharan_mighthammer(); - s->RegisterSelf(); - s = new npc_kharan_mighthammer(); - s->RegisterSelf(); s = new npc_rocknot(); s->RegisterSelf(); s = new npc_marshal_windsor(); @@ -1294,12 +1181,6 @@ void AddSC_blackrock_depths() //pNewScript->pEffectDummyNPC = &EffectDummyCreature_spell_banner_of_provocation; //pNewScript->RegisterSelf(); - //pNewScript = new Script; - //pNewScript->Name = "npc_kharan_mighthammer"; - //pNewScript->pGossipHello = &GossipHello_npc_kharan_mighthammer; - //pNewScript->pGossipSelect = &GossipSelect_npc_kharan_mighthammer; - //pNewScript->RegisterSelf(); - //pNewScript = new Script; //pNewScript->Name = "npc_rocknot"; //pNewScript->GetAI = &GetAI_npc_rocknot; diff --git a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_spire/blackrock_spire.h b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_spire/blackrock_spire.h index a40c61c6a..0816d19c2 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_spire/blackrock_spire.h +++ b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_spire/blackrock_spire.h @@ -69,7 +69,7 @@ enum GO_DRAKKISATH_DOOR_2 = 175947, -#if defined (TBC) || defined (WOTLK) || defined (CATA) +#if defined (CLASSIC) // upper spire entrance GO_DRAGONSPINE = 164725, GO_BRAZIER_1 = 175528, @@ -98,7 +98,7 @@ enum GO_EMBERSEER_RUNE_6 = 175271, GO_EMBERSEER_RUNE_7 = 175272, -#if defined (TBC) || defined (WOTLK) || defined (CATA) +#if defined (CLASSIC) ITEM_SEAL_OF_ASCENSION = 12344, #endif diff --git a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_spire/instance_blackrock_spire.cpp b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_spire/instance_blackrock_spire.cpp index e8344ebac..d228b5968 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_spire/instance_blackrock_spire.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_spire/instance_blackrock_spire.cpp @@ -109,8 +109,9 @@ struct is_blackrock_spire : public InstanceScript m_uiFlamewreathWaveCount(0), m_uiStadiumEventTimer(0), m_uiStadiumWaves(0), -#if defined (TBC) || defined(WOTLK) +#if defined (CLASSIC) m_uiStadiumMobsAlive(0), + m_uiDragonspineDoorTimer(0), m_uiDragonspineGoCount(0), m_bUpperDoorOpened(false) @@ -161,7 +162,7 @@ struct is_blackrock_spire : public InstanceScript } break; -#if defined (TBC) || defined(WOTLK) +#if defined (CLASSIC) case GO_BRAZIER_1: case GO_BRAZIER_2: case GO_BRAZIER_3: @@ -494,7 +495,7 @@ struct is_blackrock_spire : public InstanceScript } break; } -#if defined (TBC) || defined(WOTLK) +#if defined (CLASSIC) case MAX_ENCOUNTER: if (Player* pPlayer = instance->GetPlayer(ObjectGuid(guid))) DoOpenUpperDoorIfCan(pPlayer); @@ -532,7 +533,7 @@ struct is_blackrock_spire : public InstanceScript #endif } -#if defined (TBC) || defined(WOTLK) +#if defined (CLASSIC) void DoOpenUpperDoorIfCan(Player* pPlayer) { if (m_bUpperDoorOpened) @@ -545,7 +546,7 @@ struct is_blackrock_spire : public InstanceScript m_bUpperDoorOpened = true; } } -#endif +#endif void Update(uint32 uiDiff) override { @@ -575,7 +576,7 @@ struct is_blackrock_spire : public InstanceScript } } -#if defined (TBC) || defined(WOTLK) +#if defined (CLASSIC) // unlock dragon spine door if (m_uiDragonspineDoorTimer) { @@ -891,7 +892,7 @@ struct is_blackrock_spire : public InstanceScript uint8 m_uiStadiumWaves; uint8 m_uiStadiumMobsAlive; -#if defined (TBC) || defined(WOTLK) +#if defined (CLASSIC) bool m_bUpperDoorOpened; uint32 m_uiDragonspineGoCount; uint32 m_uiDragonspineDoorTimer; @@ -926,7 +927,7 @@ struct at_blackrock_spire : public AreaTriggerScript if (InstanceData* pInstance = pPlayer->GetInstanceData()) { pInstance->SetData(MAX_ENCOUNTER, DO_SORT_MOBS); -#if defined (TBC) || defined(WOTLK) +#if defined (CLASSIC) pInstance->SetData64(MAX_ENCOUNTER, pPlayer->GetObjectGuid().GetRawValue()); #endif } diff --git a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/boss_garr.cpp b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/boss_garr.cpp index 45f0e91a6..a8b35378d 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/boss_garr.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/boss_garr.cpp @@ -43,14 +43,11 @@ enum SPELL_MAGMASHACKLES = 19496, SPELL_ERUPTION_TRIGGER = 20482, // target script, dispel and permanent immune to banish anywhere on map SPELL_ENRAGE_TRIGGER = 19515, // target script, effect dummy anywhere on map - SPELL_ENRAGE = 19516, // Add spells - SPELL_THRASH = 8876, - SPELL_IMMOLATE = 15733, SPELL_ERUPTION = 19497, SPELL_MASSIVE_ERUPTION = 20483, // TODO possible on death - SPELL_SEPARATION_ANXIETY_BOSSGARR = 23492, // Used if separated too far from Garr + SPELL_IMMOLATE = 20294, }; struct boss_garr : public CreatureScript @@ -187,10 +184,6 @@ struct mob_firesworn : public CreatureScript mob_fireswornAI(Creature* pCreature) : ScriptedAI(pCreature) { m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - Reset(); - - DoCastSpellIfCan(m_creature, SPELL_THRASH, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); - DoCastSpellIfCan(m_creature, SPELL_IMMOLATE, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); } ScriptedInstance* m_pInstance; @@ -206,12 +199,6 @@ struct mob_firesworn : public CreatureScript m_bExploding = false; } - void JustReachedHome() override - { - DoCastSpellIfCan(m_creature, SPELL_THRASH, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); - DoCastSpellIfCan(m_creature, SPELL_IMMOLATE, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); - } - void DamageTaken(Unit* /*pDealer*/, uint32& uiDamage) override { if (!m_bExploding && m_creature->HealthBelowPctDamaged(10, uiDamage)) diff --git a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/boss_golemagg.cpp b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/boss_golemagg.cpp index 66c245d45..68077154a 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/boss_golemagg.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/boss_golemagg.cpp @@ -43,11 +43,9 @@ enum SPELL_EARTHQUAKE = 19798, SPELL_ENRAGE = 19953, SPELL_GOLEMAGG_TRUST = 20553, - SPELL_DOUBLE_ATTACK = 18943, // Core Rager EMOTE_LOW_HP = -1409002, - SPELL_THRASH = 12787, SPELL_MANGLE = 19820 }; @@ -62,7 +60,6 @@ struct boss_golemagg : public CreatureScript m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); #if defined (WOTLK) || defined (CATA) DoCastSpellIfCan(m_creature, SPELL_MAGMA_SPLASH, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); - DoCastSpellIfCan(m_creature, SPELL_DOUBLE_ATTACK, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); #endif } @@ -188,9 +185,6 @@ struct mob_core_rager : public CreatureScript mob_core_ragerAI(Creature* pCreature) : ScriptedAI(pCreature) { m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - Reset(); - - DoCastSpellIfCan(m_creature, SPELL_THRASH, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); } ScriptedInstance* m_pInstance; @@ -214,11 +208,6 @@ struct mob_core_rager : public CreatureScript } } - void JustReachedHome() override - { - DoCastSpellIfCan(m_creature, SPELL_THRASH, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); - } - void UpdateAI(const uint32 uiDiff) override { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) diff --git a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/instance_molten_core.cpp b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/instance_molten_core.cpp index 9b98acfe8..12e3760e8 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/instance_molten_core.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/instance_molten_core.cpp @@ -212,72 +212,20 @@ struct is_molten_core : public InstanceScript } // no break here! case TYPE_LUCIFRON: - m_auiEncounter[uiType] = uiData; - break; case TYPE_MAGMADAR: - m_auiEncounter[uiType] = uiData; -#if defined (WOTLK) || defined (CATA) - if (uiData == DONE) - { DoUseDoorOrButton(GO_RUNE_KRESS); } -#endif - break; case TYPE_GEHENNAS: - m_auiEncounter[uiType] = uiData; -#if defined (WOTLK) || defined (CATA) - if (uiData == DONE) - { DoUseDoorOrButton(GO_RUNE_MOHN); } -#endif - break; case TYPE_GARR: - m_auiEncounter[uiType] = uiData; -#if defined (WOTLK) || defined (CATA) - if (uiData == DONE) - { DoUseDoorOrButton(GO_RUNE_BLAZ); } -#endif - break; case TYPE_SHAZZRAH: - m_auiEncounter[uiType] = uiData; -#if defined (WOTLK) || defined (CATA) - if (uiData == DONE) - { DoUseDoorOrButton(GO_RUNE_MAZJ); } -#endif - break; case TYPE_GEDDON: - m_auiEncounter[uiType] = uiData; -#if defined (WOTLK) || defined (CATA) - if (uiData == DONE) - { DoUseDoorOrButton(GO_RUNE_ZETH); } -#endif - break; case TYPE_GOLEMAGG: - m_auiEncounter[uiType] = uiData; -#if defined (WOTLK) || defined (CATA) - if (uiData == DONE) - { DoUseDoorOrButton(GO_RUNE_THERI); } -#endif - break; case TYPE_SULFURON: case TYPE_RAGNAROS: m_auiEncounter[uiType] = uiData; -#if defined (WOTLK) || defined (CATA) - if (uiData == DONE) - { DoUseDoorOrButton(GO_RUNE_KORO); } -#endif break; - case TYPE_FLAME_DOSED: - if (sRuneEncounters const *rstr = GetRuneStructForTrapEntry(uiData)) - { - m_auiRuneState[rstr->getRuneType()] = DONE; - save = true; - if (GameObject *trap = GetSingleGameObjectFromStorage(rstr->m_uiTrapEntry)) - { - trap->SetGoState(GO_STATE_ACTIVE); - trap->SetLootState(GO_JUST_DEACTIVATED); //TODO fix GameObject::Use for traps - } - if (GameObject *rune = GetSingleGameObjectFromStorage(rstr->m_uiRuneEntry)) - rune->SetGoState(GO_STATE_READY); - DoSpawnMajordomoIfCan(false); - } + case TYPE_FLAME_DOUSED: + save = true; + SetRuneDoused(GetRuneStructForTrapEntry(uiData)); + DoSpawnMajordomoIfCan(false); break; case TYPE_DO_FREE_GARR_ADDS: for (std::set::const_iterator it = m_sFireswornGUID.begin(); it != m_sFireswornGUID.end(); ++it) @@ -291,31 +239,24 @@ struct is_molten_core : public InstanceScript return; } - // Check if Majordomo can be summoned -#if defined (CLASSIC) || defined (TBC) - if (uiType < MAX_ENCOUNTER && uiData == DONE) // a boss just killed + // if a rune boss is done, then: pre-WOTLK: allow to use the rune GO; WOTLK and later: set the rune as doused + if (uiType > TYPE_LUCIFRON && uiType < TYPE_MAJORDOMO && uiData == DONE) { +#if defined (CLASSIC) || defined (TBC) if (sRuneEncounters const *rstr = GetRuneStructForBoss(uiType)) { m_auiRuneState[rstr->getRuneType()] = SPECIAL; if (GameObject *trap = GetSingleGameObjectFromStorage(rstr->m_uiTrapEntry)) trap->SetGoState(GO_STATE_READY); } - } #endif #if defined (WOTLK) || defined (CATA) - if (uiData == DONE) - { + SetRuneDoused(GetRuneStructForBoss(uiType)); DoSpawnMajordomoIfCan(false); +#endif } -#endif -#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) if (save) -#endif -#if defined (WOTLK) || defined (CATA) - if (uiData == DONE) -#endif { OUT_SAVE_INST_DATA; @@ -416,12 +357,7 @@ struct is_molten_core : public InstanceScript // Check if all rune bosses are done for (uint8 i = TYPE_MAGMADAR; i < TYPE_MAJORDOMO; ++i) { -#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) - if (m_auiEncounter[i] != SPECIAL) -#endif -#if defined (WOTLK) || defined (CATA) - if (m_auiEncounter[i] != DONE) -#endif + if (m_auiEncounter[i] != DONE || m_auiRuneState[i - TYPE_MAGMADAR] != DONE) { return; } @@ -477,6 +413,21 @@ struct is_molten_core : public InstanceScript return NULL; } + void SetRuneDoused(sRuneEncounters const* rstr) + { + if (rstr) + { + m_auiRuneState[rstr->getRuneType()] = DONE; + if (GameObject *trap = GetSingleGameObjectFromStorage(rstr->m_uiTrapEntry)) + { + trap->SetGoState(GO_STATE_ACTIVE); + trap->SetLootState(GO_JUST_DEACTIVATED); //TODO fix GameObject::Use for traps + } + if (GameObject *rune = GetSingleGameObjectFromStorage(rstr->m_uiRuneEntry)) + rune->SetGoState(GO_STATE_READY); + } + } + std::string m_strInstData; uint32 m_auiEncounter[MAX_ENCOUNTER]; uint32 m_auiRuneState[MAX_MOLTEN_RUNES]; diff --git a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.cpp b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.cpp index 69a60de17..5cac04c6f 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.cpp @@ -42,11 +42,8 @@ */ #include "precompiled.h" -#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) || defined (CATA) +#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) #include "molten_core.h" -#endif - -#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) || defined (CATA) /*###### ## go_molten_core_rune @@ -67,7 +64,7 @@ struct go_molten_core_rune : public GameObjectScript if (pInstance->GetData(pGo->GetGOInfo()->button.linkedTrapId) == SPECIAL) { - pInstance->SetData(TYPE_FLAME_DOSED, pGo->GetGOInfo()->button.linkedTrapId); + pInstance->SetData(TYPE_FLAME_DOUSED, pGo->GetGOInfo()->button.linkedTrapId); return false; // this path allows the spell to have effect } @@ -77,7 +74,7 @@ struct go_molten_core_rune : public GameObjectScript #endif void AddSC_molten_core() { -#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) || defined (CATA) +#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) Script* s; s = new go_molten_core_rune(); s->RegisterSelf(); diff --git a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.h b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.h index a5ed787b2..f64775fc0 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.h +++ b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.h @@ -41,7 +41,7 @@ enum TYPE_SULFURON = 7, // do not change order: end TYPE_MAJORDOMO = 8, TYPE_RAGNAROS = 9, - TYPE_FLAME_DOSED = MAX_ENCOUNTER, + TYPE_FLAME_DOUSED = MAX_ENCOUNTER, TYPE_DO_FREE_GARR_ADDS = MAX_ENCOUNTER+1, MAX_MOLTEN_RUNES = 7, diff --git a/src/modules/SD3/scripts/eastern_kingdoms/burning_steppes.cpp b/src/modules/SD3/scripts/eastern_kingdoms/burning_steppes.cpp index 999a7c6ed..2b4a3470d 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/burning_steppes.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/burning_steppes.cpp @@ -28,14 +28,13 @@ * ScriptData * SDName: Burning_Steppes * SD%Complete: 100 - * SDComment: Quest support: 4121, 4122, 4224, 4866. + * SDComment: Quest support: 4121, 4122, 4866. * SDCategory: Burning Steppes * EndScriptData */ /** * ContentData - * npc_ragged_john * npc_grark_lorkrub * EndContentData */ diff --git a/src/modules/SD3/scripts/eastern_kingdoms/gilneas.cpp b/src/modules/SD3/scripts/eastern_kingdoms/gilneas.cpp new file mode 100644 index 000000000..e0b87487a --- /dev/null +++ b/src/modules/SD3/scripts/eastern_kingdoms/gilneas.cpp @@ -0,0 +1,49 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: Gilneas + * SD%Complete: 0 Work in progress... + * SDComment: Placeholder + * SDCategory: Gilneas + * EndScriptData + */ + +/** + * ContentData + * EndContentData + */ + +#include "precompiled.h" + +/*###### +# +######*/ + +void AddSC_gilneas() +{ +} diff --git a/src/modules/SD3/scripts/eastern_kingdoms/gilneas_city.cpp b/src/modules/SD3/scripts/eastern_kingdoms/gilneas_city.cpp new file mode 100644 index 000000000..037b95c31 --- /dev/null +++ b/src/modules/SD3/scripts/eastern_kingdoms/gilneas_city.cpp @@ -0,0 +1,452 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: Gilneas City + * SD%Complete: 0 Work in progress... + * SDComment: + * SDCategory: Gilneas City + * EndScriptData + */ + +/** + * ContentData + * npc_prince_liam_greymane_phase1 - Fully Scripted + * npc_prince_liam_greymane_phase2 - Fully Scripted + * rampaging_worgen - Enrage Spell Scripted + * frightened_citizen_quest + * EndContentData + */ + +#include "precompiled.h" +#include "escort_ai.h" +#include + +/*###### +# npc_prince_liam_greymane_phase1 +######*/ + +enum { + SAY_STORYLINE1 = -1654001, + SAY_STORYLINE2 = -1654002, + SAY_STORYLINE3 = -1654003 +}; + +struct npc_prince_liam_greymane_phase1 : public CreatureScript +{ + npc_prince_liam_greymane_phase1() : CreatureScript("npc_prince_liam_greymane_phase1") {} + + struct npc_prince_liam_greymane_phase1AI : public ScriptedAI + { + npc_prince_liam_greymane_phase1AI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNpcFlags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS); + Reset(); + } + + ObjectGuid m_casterGuid; + uint32 m_uiNpcFlags; + uint32 m_uiSayStoryDelay; + uint32 m_uiSayStoryTimer; + int m_uiSayStoryLast; + + bool m_bCanSayStory; + + void Reset() override + { + m_casterGuid.Clear(); + + m_uiSayStoryDelay = 15000; + m_uiSayStoryTimer = m_uiSayStoryDelay; + m_uiSayStoryLast = 0; + + m_bCanSayStory = true; + + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_uiNpcFlags); + } + + void UpdateAI(const uint32 uiDiff) override + { + if (m_bCanSayStory) + { + m_uiSayStoryTimer = m_uiSayStoryDelay; + + // Random switch between 3 texts + switch (m_uiSayStoryLast) + { + case 0: DoScriptText(SAY_STORYLINE1, m_creature); m_uiSayStoryLast++; break; + case 1: DoScriptText(SAY_STORYLINE2, m_creature); m_uiSayStoryLast++; break; + case 2: DoScriptText(SAY_STORYLINE3, m_creature); m_uiSayStoryLast = 0; m_uiSayStoryTimer = 60000; break; + //case 3: DoScriptText(SAY_HELP4, m_creature); break; + } + + m_bCanSayStory = false; + } + + if (m_uiSayStoryTimer < uiDiff) + { + m_bCanSayStory = true; + m_uiSayStoryTimer = m_uiSayStoryDelay; + } + else m_uiSayStoryTimer -= uiDiff; + } + + }; + + CreatureAI* GetAI(Creature* pCreature) override + { + return new npc_prince_liam_greymane_phase1AI(pCreature); + } +}; + + + + + + + +/*###### +# npc_prince_liam_greymane_phase2 +######*/ + +enum { + SAY_STORYLINE4 = -1654004, + SAY_STORYLINE5 = -1654005, + SAY_STORYLINE6 = -1654006, + SAY_STORYLINE7 = -1654007, + SAY_STORYLINE8 = -1654008, + + SAY_STORY_DELAY = 30000, + SPELL_SHOOT = 50092, + SPELL_CNOCKING = 67869, + + QUEST_EVAQUATE_THE_MERCHANT_SQUARE = 14098 +}; + +struct npc_prince_liam_greymane_phase2 : public CreatureScript +{ + npc_prince_liam_greymane_phase2() : CreatureScript("npc_prince_liam_greymane_phase2") {} + + struct npc_prince_liam_greymane_phase2AI : public ScriptedAI + { + npc_prince_liam_greymane_phase2AI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint32 m_uiNpcFlags; + uint32 m_uiSayStoryTimer; + + Unit* lastVictim; + + int m_uiSayStoryLast; + + bool m_bCanSayStory; + bool IsSelfRooted; + + void Reset() override + { + m_uiSayStoryTimer = SAY_STORY_DELAY; + m_uiSayStoryLast = 0; + lastVictim = NULL; + + m_bCanSayStory = true; + IsSelfRooted = false; + + } + + void Aggro(Unit* who) override + { + if (!m_creature->CanReachWithMeleeAttack(who) && !m_creature->CanUseEquippedWeapon(RANGED_ATTACK)) + { + IsSelfRooted = true; + } + } + + void AttackedBy(Unit* pAttacker) override + { + // Check if Liam is attacking who attack he and don't jump on multiple attackers + if (m_creature->getVictim() && (m_creature->getVictim() == pAttacker || lastVictim == pAttacker)) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + lastVictim = pAttacker; + AttackStart(pAttacker); + } + + void UpdateAI(const uint32 uiDiff) override + { + // Ready to say emote + if (m_bCanSayStory) + { + m_uiSayStoryTimer = SAY_STORY_DELAY; + + // Sequence switch between 3 texts + switch (m_uiSayStoryLast) + { + case 0: DoScriptText(SAY_STORYLINE4, m_creature); m_uiSayStoryLast++; break; + case 1: DoScriptText(SAY_STORYLINE5, m_creature); m_uiSayStoryLast++; break; + case 2: DoScriptText(SAY_STORYLINE6, m_creature); m_uiSayStoryLast++; break; + case 3: DoScriptText(SAY_STORYLINE7, m_creature); m_uiSayStoryLast++; break; + case 4: DoScriptText(SAY_STORYLINE8, m_creature); m_uiSayStoryLast = 0; break; + //case 3: DoScriptText(SAY_HELP4, m_creature); break; + } + + m_bCanSayStory = false; + } + + if (m_uiSayStoryTimer < uiDiff) + { + m_bCanSayStory = true; + m_uiSayStoryTimer = SAY_STORY_DELAY; + } + else m_uiSayStoryTimer -= uiDiff; + + + // Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Equipped ranged weapon usable and not close to victim + if (m_creature->GetCombatDistance(m_creature->getVictim(), false) > 0 && m_creature->CanUseEquippedWeapon(RANGED_ATTACK) ) + { + // Make sure our attack is ready + if (m_creature->isAttackReady(RANGED_ATTACK)){ + // Use spell instead of normal ranged attack that seem not working. TODO: check ranged attack! + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHOOT); + //m_creature->AttackerStateUpdate(m_creature->getVictim(),RANGED_ATTACK); + m_creature->resetAttackTimer(RANGED_ATTACK); + } + + } + else if (m_creature->CanReachWithMeleeAttack(m_creature->getVictim())) + { + // If we are within range melee the target + // Make sure our attack is ready + if (m_creature->isAttackReady()) + { + printf("---> %s melee is ready %s! \n",m_creature->GetName(), m_creature->getVictim()->GetName()); + m_creature->AttackerStateUpdate(m_creature->getVictim()); + + m_creature->resetAttackTimer(); + } + + } + else if (IsSelfRooted) + { + // Cancel our current spell and then allow movement again + m_creature->InterruptNonMeleeSpells(false); + IsSelfRooted = false; + } + + } + + }; + + CreatureAI* GetAI(Creature* pCreature) override + { + return new npc_prince_liam_greymane_phase2AI(pCreature); + } +}; + + +/*###### +# rampaging_worgen +######*/ + + +enum { + SPELL_ENRAGE = 8599, + SPELL_ENRAGE_DELAY = 120000 +}; + +struct rampaging_worgen : public CreatureScript +{ + rampaging_worgen() : CreatureScript("rampaging_worgen") {} + + struct rampaging_worgenAI : public ScriptedAI + { + rampaging_worgenAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 spellCooldown; // This variable acts like the global cooldown that players have (2 minute) + bool IsSelfRooted; + + void Reset() override + { + spellCooldown = 0; + IsSelfRooted = false; + } + + void Aggro(Unit* who) override + { + if (!m_creature->CanReachWithMeleeAttack(who)) + { + IsSelfRooted = true; + } + } + + void UpdateAI(const uint32 diff) override + { + // Always decrease our spell cooldown first + if (spellCooldown > diff) + spellCooldown -= diff; + else spellCooldown = 0; + + // Enrage timer (only enrage when we are alive and in combat) + if (m_creature->IsInCombat() && m_creature->IsAlive()) + { + // Cast enrage spell if less than 70% hp ONLY and not casted already + if (m_creature->GetHealthPercent() < 70.0f && !spellCooldown) { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + spellCooldown = SPELL_ENRAGE_DELAY; + } + + } + + // Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Return if we already cast a spell + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + // If we are within range melee the target + if (m_creature->CanReachWithMeleeAttack(m_creature->getVictim())) + { + // Make sure our attack is ready + if (m_creature->isAttackReady()) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + + m_creature->resetAttackTimer(); + } + } + else if (IsSelfRooted) + { + // Cancel our current spell and then allow movement again + m_creature->InterruptNonMeleeSpells(false); + IsSelfRooted = false; + } + + } + + }; + + CreatureAI* GetAI(Creature* pCreature) override + { + return new rampaging_worgenAI(pCreature); + } +}; + + +/*###### +## creature_frightened_citizen_quest +######*/ +enum { + SAY_ON_ESCAPE1 = -1654009, + SAY_ON_ESCAPE2 = -1654010, + SAY_ON_ESCAPE3 = -1654011, + SAY_ON_ESCAPE4 = -1654012, + SAY_ON_ESCAPE5 = -1654013, + SAY_ON_ESCAPE6 = -1654014, + SAY_ON_ESCAPE7 = -1654015, + SAY_ON_ESCAPE_DELAY = 12000 +}; + + +struct frightened_citizen_quest : public CreatureScript +{ + frightened_citizen_quest() : CreatureScript("frightened_citizen_quest") {} + + struct frightened_citizen_questAI : public ScriptedAI + { + frightened_citizen_questAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 m_uiSayOnEscapeTimer; + bool m_bCanSayOnEscape; + + void Reset() override + { + m_uiSayOnEscapeTimer = SAY_ON_ESCAPE_DELAY; + m_bCanSayOnEscape = true; + } + + + void UpdateAI(const uint32 uiDiff) override + { + // Ready to say emote + if (m_bCanSayOnEscape) + { + m_uiSayOnEscapeTimer = SAY_ON_ESCAPE_DELAY; + + // switch between 7 texts randomly + switch (urand(0, 6)) + { + case 0: DoScriptText(SAY_ON_ESCAPE1, m_creature); break; + case 1: DoScriptText(SAY_ON_ESCAPE2, m_creature); break; + case 2: DoScriptText(SAY_ON_ESCAPE3, m_creature); break; + case 3: DoScriptText(SAY_ON_ESCAPE4, m_creature); break; + case 4: DoScriptText(SAY_ON_ESCAPE5, m_creature); break; + case 5: DoScriptText(SAY_ON_ESCAPE6, m_creature); break; + case 6: DoScriptText(SAY_ON_ESCAPE7, m_creature); break; + } + + m_bCanSayOnEscape = false; + } + + if (m_uiSayOnEscapeTimer < uiDiff) + { + m_bCanSayOnEscape = true; + m_uiSayOnEscapeTimer = SAY_ON_ESCAPE_DELAY; + } + else m_uiSayOnEscapeTimer -= uiDiff; + + } + + }; + + CreatureAI* GetAI(Creature* pCreature) override + { + return new frightened_citizen_questAI(pCreature); + } +}; + +void AddSC_gilneas_city() +{ + Script* s; + s = new npc_prince_liam_greymane_phase1(); + s->RegisterSelf(); + s = new npc_prince_liam_greymane_phase2(); + s->RegisterSelf(); + s = new rampaging_worgen(); + s->RegisterSelf(); + s = new frightened_citizen_quest(); + s->RegisterSelf(); +} diff --git a/src/modules/SD3/scripts/eastern_kingdoms/loch_modan.cpp b/src/modules/SD3/scripts/eastern_kingdoms/loch_modan.cpp index a6d9c84f2..461403c48 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/loch_modan.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/loch_modan.cpp @@ -60,7 +60,7 @@ struct npc_mountaineer_pebblebitty : public CreatureScript //TODO localisation if (!pPlayer->GetQuestRewardStatus(3181) == 1) { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Open the gate please, i need to get to Searing Gorge", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Open the gate please, I need to get to Searing Gorge", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); } pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetObjectGuid()); @@ -74,7 +74,7 @@ struct npc_mountaineer_pebblebitty : public CreatureScript //TODO localisation switch (uiAction) { case GOSSIP_ACTION_INFO_DEF + 1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "But i need to get there, now open the gate!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "But I need to get there, now open the gate!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); pPlayer->SEND_GOSSIP_MENU(1833, pCreature->GetObjectGuid()); break; case GOSSIP_ACTION_INFO_DEF + 2: @@ -82,7 +82,7 @@ struct npc_mountaineer_pebblebitty : public CreatureScript //TODO localisation pPlayer->SEND_GOSSIP_MENU(1834, pCreature->GetObjectGuid()); break; case GOSSIP_ACTION_INFO_DEF + 3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Doesn't matter, i'm invulnerable.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Doesn't matter, I'm invulnerable.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); pPlayer->SEND_GOSSIP_MENU(1835, pCreature->GetObjectGuid()); break; case GOSSIP_ACTION_INFO_DEF + 4: @@ -90,7 +90,7 @@ struct npc_mountaineer_pebblebitty : public CreatureScript //TODO localisation pPlayer->SEND_GOSSIP_MENU(1836, pCreature->GetObjectGuid()); break; case GOSSIP_ACTION_INFO_DEF + 5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ok, i'll try to remember that.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ok, I'll try to remember that.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); pPlayer->SEND_GOSSIP_MENU(1837, pCreature->GetObjectGuid()); break; case GOSSIP_ACTION_INFO_DEF + 6: diff --git a/src/modules/SD3/scripts/eastern_kingdoms/scholomance/scholomance.cpp b/src/modules/SD3/scripts/eastern_kingdoms/scholomance/scholomance.cpp new file mode 100644 index 000000000..5f4513120 --- /dev/null +++ b/src/modules/SD3/scripts/eastern_kingdoms/scholomance/scholomance.cpp @@ -0,0 +1,139 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: Scholomance + * SD%Complete: 100 + * SDComment: + * SDCategory: Scholomance + * EndScriptData + */ + +#include "precompiled.h" + +/*###### +## npc_spectral_tutor +######*/ + +enum +{ + SPELL_IMAGE_PROJECTION = 17651, + SPELL_IMAGE_PROJECTION_HEAL = 17652, + SPELL_IMAGE_PROJECTION_SUMMON = 17653, + SPELL_MANA_BURN = 17630, + SPELL_SILENCE = 12528, +}; + + +struct npc_spectral_tutor : public CreatureScript +{ + npc_spectral_tutor() : CreatureScript("npc_spectral_tutor") {} + + struct npc_spectral_tutorAI : public ScriptedAI + { + npc_spectral_tutorAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 m_uiManaBurnTimer; + uint32 m_uiSilenceTimer; + uint32 m_uiProjectionTimer; + uint32 m_uiProjEndTimer; + + void Reset() override + { + m_uiProjEndTimer = 0; + m_uiManaBurnTimer = urand(4000, 19000); + m_uiSilenceTimer = urand(0, 3000); + m_uiProjectionTimer = urand(12000, 13000); + } + + void UpdateAI(const uint32 uiDiff) override + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiProjEndTimer) + { + if (m_uiProjEndTimer <= uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_IMAGE_PROJECTION_HEAL) == CAST_OK) + m_uiProjEndTimer = 0; + } + else + m_uiProjEndTimer -= uiDiff; + + // no other actions during Image Projection + return; + } + + if (m_uiManaBurnTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_MANA_BURN) == CAST_OK) + m_uiManaBurnTimer = urand(9000, 26000); + } + else + m_uiManaBurnTimer -= uiDiff; + + if (m_uiSilenceTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_SILENCE) == CAST_OK) + m_uiSilenceTimer = urand(12000, 26000); + } + else + m_uiSilenceTimer -= uiDiff; + + if (m_uiProjectionTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_IMAGE_PROJECTION) == CAST_OK) + { + DoCastSpellIfCan(m_creature, SPELL_IMAGE_PROJECTION_SUMMON, CAST_TRIGGERED); + m_uiProjEndTimer = 1000; + m_uiProjectionTimer = urand(18000, 25000); + } + } + else + m_uiProjectionTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + + }; + + CreatureAI* GetAI(Creature* pCreature) override + { + return new npc_spectral_tutorAI(pCreature); + } +}; + + +void AddSC_scholomance() +{ + Script* s; + + s = new npc_spectral_tutor(); + s->RegisterSelf(); + +} diff --git a/src/modules/SD3/scripts/eastern_kingdoms/stormwind_city.cpp b/src/modules/SD3/scripts/eastern_kingdoms/stormwind_city.cpp index 36c0ce89f..09f0a2618 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/stormwind_city.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/stormwind_city.cpp @@ -348,7 +348,7 @@ struct npc_squire_rowe : public CreatureScript } // Summoned npc has escort and this can trigger twice if escort state is not checked - if (uiPointId && HasEscortState(STATE_ESCORT_PAUSED)) + if (HasEscortState(STATE_ESCORT_PAUSED)) { StartNextDialogueText(NPC_WINDSOR); } @@ -444,6 +444,8 @@ struct npc_squire_rowe : public CreatureScript bool OnGossipHello(Player* pPlayer, Creature* pCreature) override { + pPlayer->PlayerTalkClass->ClearMenus(); + // Allow gossip if quest 6402 is completed but not yet rewarded or 6402 is rewarded but 6403 isn't yet completed if ((pPlayer->GetQuestStatus(QUEST_STORMWIND_RENDEZVOUS) == QUEST_STATUS_COMPLETE && !pPlayer->GetQuestRewardStatus(QUEST_STORMWIND_RENDEZVOUS)) || (pPlayer->GetQuestRewardStatus(QUEST_STORMWIND_RENDEZVOUS) && pPlayer->GetQuestStatus(QUEST_THE_GREAT_MASQUERADE) != QUEST_STATUS_COMPLETE)) @@ -653,13 +655,11 @@ struct npc_reginald_windsor : public CreatureScript struct npc_reginald_windsorAI : public npc_escortAI, private DialogueHelper { - npc_reginald_windsorAI(Creature* m_creature) : npc_escortAI(m_creature), - DialogueHelper(aMasqueradeDialogue) + npc_reginald_windsorAI(Creature* m_creature) : npc_escortAI(m_creature), DialogueHelper(aMasqueradeDialogue) { m_pScriptedMap = (ScriptedMap*)m_creature->GetInstanceData(); - // Npc flag is controlled by script - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); InitializeDialogueHelper(m_pScriptedMap); + Reset(); } ScriptedMap* m_pScriptedMap; @@ -678,6 +678,7 @@ struct npc_reginald_windsor : public CreatureScript void Reset() override { + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); m_uiGuardCheckTimer = 0; m_bIsKeepReady = false; m_bCanGuardSalute = false; @@ -782,14 +783,17 @@ struct npc_reginald_windsor : public CreatureScript void JustDidDialogueStep(int32 iEntry) override { - if (!m_pScriptedMap) - { - return; - } + if (!m_pScriptedMap) return; switch (iEntry) { - // Set orientation and prepare the npcs for the next event + case SAY_WINDSOR_QUEST_ACCEPT: + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGuid)) + { + Start(false, pPlayer); + } + break; + // Set orientation and prepare the npcs for the next event case SAY_WINDSOR_GET_READY: m_creature->SetFacingTo(0.6f); break; @@ -882,6 +886,7 @@ struct npc_reginald_windsor : public CreatureScript break; case SAY_WINDSOR_BEFORE_KEEP: m_bIsKeepReady = true; + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); break; case NPC_GUARD_CITY: @@ -1136,6 +1141,8 @@ struct npc_reginald_windsor : public CreatureScript { bool bIsEventReady = false; + pPlayer->PlayerTalkClass->ClearMenus(); + if (npc_reginald_windsorAI* pReginaldAI = dynamic_cast(pCreature->AI())) { bIsEventReady = pReginaldAI->IsKeepEventReady(); @@ -1162,7 +1169,6 @@ struct npc_reginald_windsor : public CreatureScript bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) override { - pPlayer->PlayerTalkClass->ClearMenus(); if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) { if (npc_reginald_windsorAI* pReginaldAI = dynamic_cast(pCreature->AI())) diff --git a/src/modules/SD3/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp b/src/modules/SD3/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp index b5c1935cc..9581112b7 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp @@ -50,7 +50,8 @@ static const EventLocation aStratholmeLocation[] = { 3969.357f, -3391.871f, 119.116f, 5.91f }, // Skeletons summon loc { 4033.044f, -3431.031f, 119.055f, 0.0f }, // Skeletons move loc { 4032.602f, -3378.506f, 119.752f, 4.74f }, // Guards summon loc - { 4042.575f, -3337.929f, 115.059f, 0.0f }, // Ysida move loc + { 4044.78f, -3333.68f, 117.26f, 4.15f}, // Ysida summon loc + { 4041.9f, -3337.6f, 115.06f, 3.82f}, // Ysida move/death loc { 3713.681f, -3427.814f, 131.198f, 6.2f } // The Unforgiven spawn area }; @@ -105,6 +106,7 @@ struct is_stratholme : public InstanceScript switch (pCreature->GetEntry()) { case NPC_BARON: + case NPC_YSIDA: case NPC_YSIDA_TRIGGER: case NPC_BARTHILAS: case NPC_PALADIN_QUEST_CREDIT: @@ -222,7 +224,13 @@ struct is_stratholme : public InstanceScript break; } - DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_START, NPC_BARON); + // Baron ultimatum starts: summon Ysida in the case + // Baron ultimatum starts: summon Ysida in the cage + if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON)) + { + DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_START, NPC_BARON); + pBaron->SummonCreature(NPC_YSIDA, aStratholmeLocation[7].m_fX, aStratholmeLocation[7].m_fY, aStratholmeLocation[7].m_fZ, aStratholmeLocation[7].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0); + } m_uiBaronRunTimer = 45 * MINUTE * IN_MILLISECONDS; debug_log("SD3: Instance Stratholme: Baron run in progress."); @@ -355,11 +363,7 @@ struct is_stratholme : public InstanceScript case TYPE_BARON: if (uiData == IN_PROGRESS) { - // Reached the Baron within time-limit - if (m_auiEncounter[TYPE_BARON_RUN] == IN_PROGRESS) - { - SetData(TYPE_BARON_RUN, DONE); - } + // Close Slaughterhouse door if needed if (m_auiEncounter[uiType] == FAIL) @@ -369,8 +373,12 @@ struct is_stratholme : public InstanceScript } if (uiData == DONE) { - if (m_auiEncounter[TYPE_BARON_RUN] == DONE) + // Players successfully engaged Baron within the time-limit of his ultimatum + // Note: UpdateAI() prevents TYPE_BARON_RUN to be marked as FAILED if the + // Baron is already engaged (in progress) when the ultimatum timer expires + if (m_auiEncounter[TYPE_BARON_RUN] == IN_PROGRESS) { + SetData(TYPE_BARON_RUN, DONE); Map::PlayerList const& players = instance->GetPlayers(); for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) @@ -385,19 +393,19 @@ struct is_stratholme : public InstanceScript if (pPlayer->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE) { pPlayer->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA); + + // Argent Dawn reputation reward + pPlayer->CastSpell(pPlayer, SPELL_YSIDA_FREED, true); } } } - // Open cage and finish rescue event - if (Creature* pYsidaT = GetSingleCreatureFromStorage(NPC_YSIDA_TRIGGER)) + // Open cage, finish rescue event + if (Creature* pYsida = GetSingleCreatureFromStorage(NPC_YSIDA)) { - 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, aStratholmeLocation[7].m_fX, aStratholmeLocation[7].m_fY, aStratholmeLocation[7].m_fZ); - } + DoScriptText(SAY_EPILOGUE, pYsida); DoUseDoorOrButton(GO_YSIDA_CAGE); + pYsida->GetMotionMaster()->MovePoint(0, aStratholmeLocation[8].m_fX, aStratholmeLocation[8].m_fY, aStratholmeLocation[8].m_fZ, aStratholmeLocation[8].m_fO); } } @@ -556,6 +564,20 @@ struct is_stratholme : public InstanceScript m_auiEncounter[TYPE_PALLID] = SPECIAL; } +// Baron ultimatum succeed: summon Ysida outside the cage alive + if (m_auiEncounter[TYPE_BARON_RUN] == DONE) + { + if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON)) + pBaron->SummonCreature(NPC_YSIDA, aStratholmeLocation[9].m_fX, aStratholmeLocation[9].m_fY, aStratholmeLocation[9].m_fZ, aStratholmeLocation[9].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0); + } + // Baron ultimatum failed: summon Ysida outside the cage dead + if (m_auiEncounter[TYPE_BARON_RUN] == FAIL) + { + if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON)) + if (Creature* pYsida = pBaron->SummonCreature(NPC_YSIDA, aStratholmeLocation[9].m_fX, aStratholmeLocation[9].m_fY, aStratholmeLocation[9].m_fZ, aStratholmeLocation[9].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0)) + pYsida->DealDamage(pYsida, pYsida->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, nullptr, false); + } + OUT_LOAD_INST_DATA_COMPLETE; } @@ -575,8 +597,9 @@ struct is_stratholme : public InstanceScript case NPC_RAMSTEIN: SetData(TYPE_RAMSTEIN, IN_PROGRESS); break; - // TODO - uncomment when proper working within core! case NPC_BARON: SetData(TYPE_BARON, IN_PROGRESS); break; - + case NPC_BARON: + SetData(TYPE_BARON, IN_PROGRESS); + break; case NPC_ABOM_BILE: case NPC_ABOM_VENOM: // Start Slaughterhouse Event @@ -607,8 +630,9 @@ struct is_stratholme : public InstanceScript case NPC_RAMSTEIN: SetData(TYPE_RAMSTEIN, FAIL); break; - // TODO - uncomment when proper working within core! case NPC_BARON: SetData(TYPE_BARON, FAIL); break; - + case NPC_BARON: + SetData(TYPE_BARON, FAIL); + break; case NPC_ABOM_BILE: case NPC_ABOM_VENOM: // Fail in Slaughterhouse Event before Ramstein @@ -718,7 +742,8 @@ struct is_stratholme : public InstanceScript } } - if (m_uiBaronRunTimer) + // Check changes for Baron ultimatum timer only if Baron is not already in combat + if (m_uiBaronRunTimer && GetData(TYPE_BARON) != IN_PROGRESS) { if (m_uiYellCounter == 0 && m_uiBaronRunTimer <= 10 * MINUTE * IN_MILLISECONDS) { @@ -731,14 +756,41 @@ struct is_stratholme : public InstanceScript ++m_uiYellCounter; } + // Used to create a delay of 10s between Baron speech and Ysida's answer + else if (m_uiYellCounter == 2 && m_uiBaronRunTimer <= (5 * MINUTE - 10) * IN_MILLISECONDS) + { + DoOrSimulateScriptTextForThisInstance(YSIDA_SAY_RUN_5_MIN, NPC_YSIDA); + ++m_uiYellCounter; + } + if (m_uiBaronRunTimer <= uiDiff) { - SetData(TYPE_BARON_RUN, FAIL); + if (GetData(TYPE_BARON_RUN) != FAIL) + { + SetData(TYPE_BARON_RUN, FAIL); - DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_FAIL, NPC_BARON); + // Open the cage and let Ysida face her doom + if (Creature* pYsida = GetSingleCreatureFromStorage(NPC_YSIDA)) + { + pYsida->GetMotionMaster()->MovePoint(0, aStratholmeLocation[8].m_fX, aStratholmeLocation[8].m_fY, aStratholmeLocation[8].m_fZ, aStratholmeLocation[8].m_fO); + DoUseDoorOrButton(GO_YSIDA_CAGE); + } + DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_FAIL, NPC_BARON); - m_uiBaronRunTimer = 0; - debug_log("SD3: Instance Stratholme: Baron run event reached end. Event has state %u.", GetData(TYPE_BARON_RUN)); + m_uiBaronRunTimer = 8000; // We reset the timer so the speech of Ysida is not said at the same time than the Baron's one + } + else + { + // Baron ultimatum failed: let the Baron kill her + if (Creature* pYsida = GetSingleCreatureFromStorage(NPC_YSIDA)) + if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON)) + pBaron->CastSpell(pYsida, SPELL_BARON_SOUL_DRAIN, true); + + DoOrSimulateScriptTextForThisInstance(YSIDA_SAY_RUN_FAIL, NPC_YSIDA); + + m_uiBaronRunTimer = 0; // event done for good, no more speech + debug_log("SD2: Instance Stratholme: Baron run event reached end. Event has state %u.", GetData(TYPE_BARON_RUN)); + } } else { diff --git a/src/modules/SD3/scripts/eastern_kingdoms/stratholme/stratholme.h b/src/modules/SD3/scripts/eastern_kingdoms/stratholme/stratholme.h index edfd01cc5..e5b46f68b 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/stratholme/stratholme.h +++ b/src/modules/SD3/scripts/eastern_kingdoms/stratholme/stratholme.h @@ -87,7 +87,9 @@ enum GO_YSIDA_CAGE = 181071, // Cage to open after baron event is done QUEST_DEAD_MAN_PLEA = 8945, - SPELL_BARON_ULTIMATUM = 27861, + SPELL_BARON_ULTIMATUM = 27861, // Aura for player during the run (visual icon) + SPELL_BARON_SOUL_DRAIN = 27640, // Used by the Baron to kill Ysida + SPELL_YSIDA_FREED = 27773, // Argent Dawn extra-reputation reward on successful Baron run SPELL_SUMMON_POSTMASTER = 24627, SAY_ANNOUNCE_ZIGGURAT_1 = -1329004, @@ -99,7 +101,9 @@ enum SAY_ANNOUNCE_RUN_START = -1329009, SAY_ANNOUNCE_RUN_10_MIN = -1329010, SAY_ANNOUNCE_RUN_5_MIN = -1329011, + YSIDA_SAY_RUN_5_MIN = -1329019, SAY_ANNOUNCE_RUN_FAIL = -1329012, + YSIDA_SAY_RUN_FAIL = -1329020, SAY_ANNOUNCE_RAMSTEIN = -1329013, SAY_UNDEAD_DEFEAT = -1329014, SAY_EPILOGUE = -1329015, diff --git a/src/modules/SD3/scripts/eastern_kingdoms/twilight_highlands.cpp b/src/modules/SD3/scripts/eastern_kingdoms/twilight_highlands.cpp new file mode 100644 index 000000000..06e5b3748 --- /dev/null +++ b/src/modules/SD3/scripts/eastern_kingdoms/twilight_highlands.cpp @@ -0,0 +1,49 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: Twilight Highlands + * SD%Complete: 0 + * SDComment: Placeholder + * SDCategory: Twilight Highlands + * EndScriptData + */ + +/** + * ContentData + * EndContentData + */ + +#include "precompiled.h" + +/*###### +# +######*/ + +void AddSC_twilight_highlands() +{ +} diff --git a/src/modules/SD3/scripts/eastern_kingdoms/vashjir.cpp b/src/modules/SD3/scripts/eastern_kingdoms/vashjir.cpp new file mode 100644 index 000000000..59419b0e7 --- /dev/null +++ b/src/modules/SD3/scripts/eastern_kingdoms/vashjir.cpp @@ -0,0 +1,51 @@ + + +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: Vashjir + * SD%Complete: 0 + * SDComment: Placeholder + * SDCategory: Vashjir + * EndScriptData + */ + +/** + * ContentData + * EndContentData + */ + +#include "precompiled.h" + +/*###### +# +######*/ + +void AddSC_vashjir() +{ +} diff --git a/src/modules/SD3/scripts/kalimdor/darkshore.cpp b/src/modules/SD3/scripts/kalimdor/darkshore.cpp index 10c57ea59..4ef7c21f5 100644 --- a/src/modules/SD3/scripts/kalimdor/darkshore.cpp +++ b/src/modules/SD3/scripts/kalimdor/darkshore.cpp @@ -367,12 +367,7 @@ enum SAY_AT_CLOSE = -1000326, QUEST_GYROMAST_REV = 2078, NPC_GELKAK = 6667, - FACTION_HOSTILE = 14, - - TEXT_ID_THRESH_DEFAULT = 718, - TEXT_ID_KEY_READY = 758, - - GOSSIP_ITEM_TURN_KEY = -3000115, + FACTION_HOSTILE = 14 }; #define GOSSIP_ITEM_INSERT_KEY "[PH] Insert key" @@ -421,12 +416,10 @@ struct npc_threshwackonator : public CreatureScript { if (pPlayer->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE) { - pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TURN_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(TEXT_ID_KEY_READY, pCreature->GetObjectGuid()); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); } - else - pPlayer->SEND_GOSSIP_MENU(TEXT_ID_THRESH_DEFAULT, pCreature->GetObjectGuid()); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetObjectGuid()); return true; } diff --git a/src/modules/SD3/scripts/kalimdor/durotar.cpp b/src/modules/SD3/scripts/kalimdor/durotar.cpp index 2af0596b9..fe5150b69 100644 --- a/src/modules/SD3/scripts/kalimdor/durotar.cpp +++ b/src/modules/SD3/scripts/kalimdor/durotar.cpp @@ -171,6 +171,10 @@ struct spell_lazy_peon_awake : public SpellScript if (uiSpellId == SPELL_AWAKEN_PEON && uiEffIndex == EFFECT_INDEX_0) { Creature* pCreatureTarget = pTarget->ToCreature(); + if (!pCreatureTarget) + { + return true; + } if (!pCreatureTarget->HasAura(SPELL_PEON_SLEEP) || pCaster->GetTypeId() != TYPEID_PLAYER || pCreatureTarget->GetEntry() != NPC_SLEEPING_PEON) { return true; diff --git a/src/modules/SD3/scripts/kalimdor/felwood.cpp b/src/modules/SD3/scripts/kalimdor/felwood.cpp index 3d7afe03e..31b8ed056 100644 --- a/src/modules/SD3/scripts/kalimdor/felwood.cpp +++ b/src/modules/SD3/scripts/kalimdor/felwood.cpp @@ -92,7 +92,7 @@ struct npc_kitten : public CreatureScript void MoveInLineOfSight(Unit* pWho) override { - // should not have NpcFlags by default, so set when expected + // should not have npcflag by default, so set when expected if (!m_creature->getVictim() && !m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP) && HasFollowState(STATE_FOLLOW_INPROGRESS) && pWho->GetEntry() == NPC_WINNA) { if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE)) @@ -460,7 +460,7 @@ struct event_npc_kroshius : public MapEventScript { event_npc_kroshius() : MapEventScript("event_npc_kroshius") {} - bool ProcessEventId_npc_kroshius(uint32 uiEventId, Object* pSource, Object* /*pTarget*/, bool /*bIsStart*/) + bool OnReceived(uint32 uiEventId, Object* pSource, Object* /*pTarget*/, bool /*bIsStart*/) override { if (uiEventId == EVENT_KROSHIUS_REVIVE) { diff --git a/src/modules/SD3/scripts/kalimdor/mount_hyjal.cpp b/src/modules/SD3/scripts/kalimdor/mount_hyjal.cpp new file mode 100644 index 000000000..dfd8c7c6b --- /dev/null +++ b/src/modules/SD3/scripts/kalimdor/mount_hyjal.cpp @@ -0,0 +1,49 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: Mount Hyjal + * SD%Complete: 0 + * SDComment: Placeholder + * SDCategory: Mount Hyjal + * EndScriptData + */ + +/** + * ContentData + * EndContentData + */ + +#include "precompiled.h" + +/*###### +# +######*/ + +void AddSC_mount_hyjal() +{ +} diff --git a/src/modules/SD3/scripts/kalimdor/the_barrens.cpp b/src/modules/SD3/scripts/kalimdor/the_barrens.cpp index f42166ee1..9345b391b 100644 --- a/src/modules/SD3/scripts/kalimdor/the_barrens.cpp +++ b/src/modules/SD3/scripts/kalimdor/the_barrens.cpp @@ -817,17 +817,6 @@ struct npc_regthar_deathgate : public CreatureScript std::list lSpawnListHorde; std::list::iterator itrh; - void Reset() - { - } - - - void JustRespawned() - { - FinishEvent(); - Reset(); - } - uint64 m_uiPlayerGUID; uint64 m_uiEventTimer; uint32 m_uiSummonCountInvader; @@ -841,24 +830,35 @@ struct npc_regthar_deathgate : public CreatureScript uint32 m_uiPhaseCount; bool m_bEventStarted; + void Reset() {} + + void JustRespawned() + { + FinishEvent(); + Reset(); + } + void StartEvent(uint64 uiPlayerGUID) { - m_uiPlayerGUID = uiPlayerGUID; - m_bEventStarted = true; - m_uiEventTimer = 1200000; - m_uiSummonCountInvader = 0; - m_uiSummonCountStormseer = 0; - m_uiSummonCountHorde = 0; - m_uiWaitSummonTimer = 0; - m_uiWaitSummonTimerHorde = 0; - m_uiSpawnPosition = 0; - m_uiKillCount = 0; - m_uiCreatureCount = 0; - m_uiPhaseCount = 1; - lCreatureList.clear(); - lSpawnList.clear(); - lCreatureListHorde.clear(); - lSpawnListHorde.clear(); + if (!m_bEventStarted) + { + m_bEventStarted = true; + m_uiPlayerGUID = uiPlayerGUID; + m_uiEventTimer = 1200000; + m_uiSummonCountInvader = 0; + m_uiSummonCountStormseer = 0; + m_uiSummonCountHorde = 0; + m_uiWaitSummonTimer = 0; + m_uiWaitSummonTimerHorde = 0; + m_uiSpawnPosition = 0; + m_uiKillCount = 0; + m_uiCreatureCount = 0; + m_uiPhaseCount = 1; + lCreatureList.clear(); + lSpawnList.clear(); + lCreatureListHorde.clear(); + lSpawnListHorde.clear(); + } } void FinishEvent() @@ -986,8 +986,6 @@ struct npc_regthar_deathgate : public CreatureScript if (pKilled->GetEntry() == NPC_WARLORD_KROMZAR) { DoScriptText(YELL_RETREAT, m_creature); - pKilled->SummonGameObject(164690, pKilled->GetPositionX(), pKilled->GetPositionY(), pKilled->GetPositionZ(), - 4.12f, 60000); m_uiPhaseCount = 4; } @@ -1158,17 +1156,16 @@ struct npc_regthar_deathgate : public CreatureScript bool OnGossipHello(Player* pPlayer, Creature* pCreature) override { + pPlayer->PlayerTalkClass->ClearMenus(); if (pCreature->IsQuestGiver()) pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid()); - if (pPlayer->GetQuestStatus(QUEST_COUNTERATTACK) == QUEST_STATUS_INCOMPLETE) + if (npc_regthar_deathgateAI* pRegtharAI = dynamic_cast(pCreature->AI())) { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Where is warlord Krom'zar?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(2533, pCreature->GetObjectGuid()); - return true; + if (!pRegtharAI->m_bEventStarted && (pPlayer->GetQuestStatus(QUEST_COUNTERATTACK) == QUEST_STATUS_INCOMPLETE)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Where is warlord Krom'zar?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); } - else - pPlayer->SEND_GOSSIP_MENU(2533, pCreature->GetObjectGuid()); + pPlayer->SEND_GOSSIP_MENU(2533, pCreature->GetObjectGuid()); return true; } diff --git a/src/modules/SD3/scripts/kalimdor/uldum.cpp b/src/modules/SD3/scripts/kalimdor/uldum.cpp new file mode 100644 index 000000000..d832b5824 --- /dev/null +++ b/src/modules/SD3/scripts/kalimdor/uldum.cpp @@ -0,0 +1,49 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: Uldum + * SD%Complete: 0 + * SDComment: Placeholder + * SDCategory: Uldum + * EndScriptData + */ + +/** + * ContentData + * EndContentData + */ + +#include "precompiled.h" + +/*###### +# +######*/ + +void AddSC_uldum() +{ +} diff --git a/src/modules/SD3/scripts/maelstrom/deepholm.cpp b/src/modules/SD3/scripts/maelstrom/deepholm.cpp new file mode 100644 index 000000000..d7d61a4df --- /dev/null +++ b/src/modules/SD3/scripts/maelstrom/deepholm.cpp @@ -0,0 +1,49 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: Deepholm + * SD%Complete: 0 + * SDComment: Placeholder + * SDCategory: Deepholm + * EndScriptData + */ + +/** + * ContentData + * EndContentData + */ + +#include "precompiled.h" + +/*###### +# +######*/ + +void AddSC_deepholm() +{ +} diff --git a/src/modules/SD3/scripts/maelstrom/kezan.cpp b/src/modules/SD3/scripts/maelstrom/kezan.cpp new file mode 100644 index 000000000..ecc6ff41a --- /dev/null +++ b/src/modules/SD3/scripts/maelstrom/kezan.cpp @@ -0,0 +1,35 @@ +/* Copyright (C) 2006 - 2013 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: Kezan +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Kezan +EndScriptData */ + +/* ContentData +EndContentData */ + +#include "precompiled.h" + +/*###### +# +######*/ + +void AddSC_kezan() +{ +} diff --git a/src/modules/SD3/scripts/maelstrom/lost_isles.cpp b/src/modules/SD3/scripts/maelstrom/lost_isles.cpp new file mode 100644 index 000000000..fa68c53bc --- /dev/null +++ b/src/modules/SD3/scripts/maelstrom/lost_isles.cpp @@ -0,0 +1,49 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: Lost Isles + * SD%Complete: 0 + * SDComment: Placeholder + * SDCategory: Lost Isles + * EndScriptData + */ + +/** + * ContentData + * EndContentData + */ + +#include "precompiled.h" + +/*###### +# +######*/ + +void AddSC_lost_isles() +{ +} diff --git a/src/modules/SD3/scripts/maelstrom/stonecore/boss_corborus.cpp b/src/modules/SD3/scripts/maelstrom/stonecore/boss_corborus.cpp new file mode 100644 index 000000000..b21f39d99 --- /dev/null +++ b/src/modules/SD3/scripts/maelstrom/stonecore/boss_corborus.cpp @@ -0,0 +1,40 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: boss_corborus + * SD%Complete: 0 + * SDComment: Placeholder + * SDCategory: boss_corborus + * EndScriptData + */ + +#include "precompiled.h" + +void AddSC_boss_corborus() +{ +} diff --git a/src/modules/SD3/scripts/maelstrom/stonecore/boss_ozruk.cpp b/src/modules/SD3/scripts/maelstrom/stonecore/boss_ozruk.cpp new file mode 100644 index 000000000..34089e859 --- /dev/null +++ b/src/modules/SD3/scripts/maelstrom/stonecore/boss_ozruk.cpp @@ -0,0 +1,40 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: boss_ozruk + * SD%Complete: 0 + * SDComment: Placeholder + * SDCategory: boss_ozruk + * EndScriptData + */ + +#include "precompiled.h" + +void AddSC_boss_ozruk() +{ +} diff --git a/src/modules/SD3/scripts/maelstrom/stonecore/boss_priestess_azil.cpp b/src/modules/SD3/scripts/maelstrom/stonecore/boss_priestess_azil.cpp new file mode 100644 index 000000000..6b282a958 --- /dev/null +++ b/src/modules/SD3/scripts/maelstrom/stonecore/boss_priestess_azil.cpp @@ -0,0 +1,40 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: boss_priestess_azil + * SD%Complete: 0 + * SDComment: Placeholder + * SDCategory: boss_priestess_azil + * EndScriptData + */ + +#include "precompiled.h" + +void AddSC_priestess_azil() +{ +} diff --git a/src/modules/SD3/scripts/maelstrom/stonecore/boss_slabhide.cpp b/src/modules/SD3/scripts/maelstrom/stonecore/boss_slabhide.cpp new file mode 100644 index 000000000..13cbb5cbb --- /dev/null +++ b/src/modules/SD3/scripts/maelstrom/stonecore/boss_slabhide.cpp @@ -0,0 +1,40 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: boss_slabhide + * SD%Complete: 0 + * SDComment: Placeholder + * SDCategory: boss_slabhide + * EndScriptData + */ + +#include "precompiled.h" + +void AddSC_boss_slabhide() +{ +} diff --git a/src/modules/SD3/scripts/maelstrom/stonecore/instance_stonecore.cpp b/src/modules/SD3/scripts/maelstrom/stonecore/instance_stonecore.cpp new file mode 100644 index 000000000..1dece07b1 --- /dev/null +++ b/src/modules/SD3/scripts/maelstrom/stonecore/instance_stonecore.cpp @@ -0,0 +1,45 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + +/** + * ScriptData + * SDName: instance_stonecore + * SD%Complete: 0 + * SDComment: Placeholder + * SDCategory: instance_stonecore + * EndScriptData + */ + +/** + * ContentData + * EndContentData + */ + +#include "precompiled.h" + +void AddSC_instance_stonecore() +{ +} diff --git a/src/modules/SD3/scripts/maelstrom/stonecore/stonecore.h b/src/modules/SD3/scripts/maelstrom/stonecore/stonecore.h new file mode 100644 index 000000000..5bd968bbc --- /dev/null +++ b/src/modules/SD3/scripts/maelstrom/stonecore/stonecore.h @@ -0,0 +1,27 @@ +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * + * 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 + * + * World of Warcraft, and all World of Warcraft or Warcraft art, images, + * and lore are copyrighted by Blizzard Entertainment, Inc. + */ + + diff --git a/src/modules/SD3/scripts/northrend/borean_tundra.cpp b/src/modules/SD3/scripts/northrend/borean_tundra.cpp index dcb0a62f8..8e51c8ab6 100644 --- a/src/modules/SD3/scripts/northrend/borean_tundra.cpp +++ b/src/modules/SD3/scripts/northrend/borean_tundra.cpp @@ -33,7 +33,6 @@ npc_captured_beryl_sorcerer npc_nexus_drake_hatchling npc_scourged_flamespitter npc_bonker_togglevolt -npc_jenny EndContentData */ #include "precompiled.h" @@ -1129,119 +1128,6 @@ struct npc_bonker_togglevolt : public CreatureScript } }; -/*###### -## npc_jenny -######*/ - -enum -{ - SPELL_CREATES_CARRIED = 46340, - SPELL_DROP_CRATE = 46342, - SPELL_JENNY_CREDIT = 46358, - - NPC_FEZZIX = 25849, - - QUEST_ID_LOADER_UP = 11881, -}; - -struct npc_jenny : public CreatureScript -{ - npc_jenny() : CreatureScript("npc_jenny") {} - - struct npc_jennyAI : public FollowerAI - { - npc_jennyAI(Creature* pCreature) : FollowerAI(pCreature) - { - m_bFollowStarted = false; - m_bEventComplete = false; - Reset(); - } - - bool m_bEventComplete; - bool m_bFollowStarted; - - uint32 m_uiDropDelayTimer; - - void Reset() override - { - m_uiDropDelayTimer = 0; - } - - void AttackedBy(Unit* pAttacker) override - { - if (!m_uiDropDelayTimer) - { - if (DoCastSpellIfCan(m_creature, SPELL_DROP_CRATE) == CAST_OK) - { - m_creature->RemoveAuraHolderFromStack(SPELL_CREATES_CARRIED); - m_uiDropDelayTimer = 10000; - - // check if all crates are dropped - if (!m_creature->HasAura(SPELL_CREATES_CARRIED)) - { - FollowerAI::JustDied(pAttacker); - m_creature->ForcedDespawn(); - } - } - } - } - - void AttackStart(Unit* pWho) override { } - - void MoveInLineOfSight(Unit* pWho) override - { - if (m_bEventComplete) - return; - - if (pWho->GetEntry() == NPC_FEZZIX && m_creature->IsWithinDistInMap(pWho, 10.0f)) - { - if (DoCastSpellIfCan(m_creature, SPELL_JENNY_CREDIT) == CAST_OK) - { - SetFollowComplete(true); - - float fX, fY, fZ; - pWho->GetContactPoint(m_creature, fX, fY, fZ); - m_creature->GetMotionMaster()->MovePoint(0, fX, fY, fZ); - m_creature->ForcedDespawn(15000); - - m_bEventComplete = true; - } - } - } - - void UpdateFollowerAI(const uint32 uiDiff) - { - if (!m_bFollowStarted) - { - if (Player* pSummoner = m_creature->GetCharmerOrOwnerPlayerOrPlayerItself()) - { - StartFollow(pSummoner, pSummoner->getFaction(), GetQuestTemplateStore(QUEST_ID_LOADER_UP)); - - if (DoCastSpellIfCan(m_creature, SPELL_CREATES_CARRIED) == CAST_OK) - m_bFollowStarted = true; - } - } - - if (m_uiDropDelayTimer) - { - if (m_uiDropDelayTimer <= uiDiff) - m_uiDropDelayTimer = 0; - else - m_uiDropDelayTimer -= uiDiff; - } - - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - } - - }; - - CreatureAI* GetAI(Creature* pCreature) override - { - return new npc_jennyAI(pCreature); - } -}; - void AddSC_borean_tundra() { Script* s; @@ -1260,8 +1146,6 @@ void AddSC_borean_tundra() s->RegisterSelf(); s = new npc_bonker_togglevolt(); s->RegisterSelf(); - s = new npc_jenny(); - s->RegisterSelf(); s = new spell_throw_wolf_batt(); s->RegisterSelf(); diff --git a/src/modules/SD3/scripts/northrend/naxxramas/boss_anubrekhan.cpp b/src/modules/SD3/scripts/northrend/naxxramas/boss_anubrekhan.cpp index 1446b7a80..ea1b18888 100644 --- a/src/modules/SD3/scripts/northrend/naxxramas/boss_anubrekhan.cpp +++ b/src/modules/SD3/scripts/northrend/naxxramas/boss_anubrekhan.cpp @@ -43,7 +43,6 @@ enum EMOTE_INSECT_SWARM = -1533154, EMOTE_CORPSE_SCARABS = -1533155, - SPELL_DOUBLE_ATTACK = 18943, SPELL_IMPALE = 28783, // May be wrong spell id. Causes more dmg than I expect SPELL_IMPALE_H = 56090, SPELL_LOCUSTSWARM = 28785, // This is a self buff that triggers the dmg debuff @@ -83,9 +82,6 @@ struct boss_anubrekhan : public CreatureScript m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); m_introDialogue.InitializeDialogueHelper(m_pInstance); m_bHasTaunted = false; - Reset(); - - DoCastSpellIfCan(m_creature, SPELL_DOUBLE_ATTACK, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); } ScriptedInstance* m_pInstance; @@ -139,8 +135,6 @@ struct boss_anubrekhan : public CreatureScript { if (m_pInstance) m_pInstance->SetData(TYPE_ANUB_REKHAN, FAIL); - - DoCastSpellIfCan(m_creature, SPELL_DOUBLE_ATTACK, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); } void MoveInLineOfSight(Unit* pWho) override diff --git a/src/modules/SD3/scripts/northrend/naxxramas/boss_gluth.cpp b/src/modules/SD3/scripts/northrend/naxxramas/boss_gluth.cpp index 06fd3f3d3..debab90fc 100644 --- a/src/modules/SD3/scripts/northrend/naxxramas/boss_gluth.cpp +++ b/src/modules/SD3/scripts/northrend/naxxramas/boss_gluth.cpp @@ -32,8 +32,7 @@ enum EMOTE_ZOMBIE = -1533119, EMOTE_BOSS_GENERIC_ENRAGED = -1000006, EMOTE_DECIMATE = -1533152, - - SPELL_DOUBLE_ATTACK = 19818, + SPELL_MORTALWOUND = 54378, // old vanilla spell was 25646, SPELL_DECIMATE = 28374, SPELL_DECIMATE_H = 54426, @@ -67,9 +66,6 @@ struct boss_gluth : public CreatureScript { m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); - Reset(); - - DoCastSpellIfCan(m_creature, SPELL_DOUBLE_ATTACK, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); } ScriptedInstance* m_pInstance; @@ -122,8 +118,6 @@ struct boss_gluth : public CreatureScript { if (m_pInstance) m_pInstance->SetData(TYPE_GLUTH, FAIL); - - DoCastSpellIfCan(m_creature, SPELL_DOUBLE_ATTACK, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); } void JustSummoned(Creature* pSummoned) override diff --git a/src/modules/SD3/scripts/northrend/naxxramas/boss_maexxna.cpp b/src/modules/SD3/scripts/northrend/naxxramas/boss_maexxna.cpp index 6c37c9ad2..ebcd5914d 100644 --- a/src/modules/SD3/scripts/northrend/naxxramas/boss_maexxna.cpp +++ b/src/modules/SD3/scripts/northrend/naxxramas/boss_maexxna.cpp @@ -34,8 +34,6 @@ enum EMOTE_SPRAY = -1533148, EMOTE_BOSS_GENERIC_FRENZY = -1000005, - SPELL_DOUBLE_ATTACK = 19818, - SPELL_WEBWRAP = 28622, SPELL_WEBWRAP_2 = 28673, // purpose unknown @@ -168,9 +166,6 @@ struct boss_maexxna : public CreatureScript { m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); - Reset(); - - DoCastSpellIfCan(m_creature, SPELL_DOUBLE_ATTACK, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); } ScriptedInstance* m_pInstance; @@ -209,8 +204,6 @@ struct boss_maexxna : public CreatureScript { if (m_pInstance) m_pInstance->SetData(TYPE_MAEXXNA, FAIL); - - DoCastSpellIfCan(m_creature, SPELL_DOUBLE_ATTACK, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); } void JustSummoned(Creature* pSummoned) override diff --git a/src/modules/SD3/scripts/northrend/ulduar/ulduar/boss_freya.cpp b/src/modules/SD3/scripts/northrend/ulduar/ulduar/boss_freya.cpp index 2325f7dc4..8e480dcc5 100644 --- a/src/modules/SD3/scripts/northrend/ulduar/ulduar/boss_freya.cpp +++ b/src/modules/SD3/scripts/northrend/ulduar/ulduar/boss_freya.cpp @@ -211,7 +211,6 @@ struct boss_freya : public CreatureScript uint32 m_uiEpilogueTimer; uint32 m_uiBerserkTimer; - uint32 m_uiDrainEldersTimer; uint32 m_uiAlliesNatureTimer; uint8 m_uiAlliesWaveCount; @@ -245,7 +244,6 @@ struct boss_freya : public CreatureScript m_uiUnstableEnergyTimer = 0; m_uiIronRootsTimer = 0; m_uiGroundTremorTimer = 0; - m_uiDrainEldersTimer = 0; // make the spawn spells random std::random_shuffle(spawnSpellsVector.begin(), spawnSpellsVector.end()); @@ -294,26 +292,17 @@ struct boss_freya : public CreatureScript if (Creature* pElder = m_pInstance->GetSingleCreatureFromStorage(NPC_ELDER_BRIGHTLEAF)) { if (pElder->IsAlive()) - { pElder->AI()->EnterEvadeMode(); - pElder->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } } if (Creature* pElder = m_pInstance->GetSingleCreatureFromStorage(NPC_ELDER_IRONBRACH)) { if (pElder->IsAlive()) - { pElder->AI()->EnterEvadeMode(); - pElder->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } } if (Creature* pElder = m_pInstance->GetSingleCreatureFromStorage(NPC_ELDER_STONEBARK)) { if (pElder->IsAlive()) - { pElder->AI()->EnterEvadeMode(); - pElder->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } } } } @@ -479,7 +468,7 @@ struct boss_freya : public CreatureScript { if (pElder->IsAlive()) { - pElder->CastSpell(pElder, m_bIsRegularMode ? SPELL_BRIGHTLEAF_ESSENCE_CHANNEL : SPELL_BRIGHTLEAF_ESSENCE_CHANNEL_H, false, NULL, NULL, m_creature->GetObjectGuid()); + pElder->CastSpell(pElder, m_bIsRegularMode ? SPELL_BRIGHTLEAF_ESSENCE_CHANNEL : SPELL_BRIGHTLEAF_ESSENCE_CHANNEL_H, true); pElder->CastSpell(pElder, SPELL_FULL_HEAL, true); m_uiUnstableEnergyTimer = 25000; @@ -490,7 +479,7 @@ struct boss_freya : public CreatureScript { if (pElder->IsAlive()) { - pElder->CastSpell(pElder, m_bIsRegularMode ? SPELL_IRONBRANCH_ESSENCE_CHANNEL : SPELL_IRONBRANCH_ESSENCE_CHANNEL_H, false, NULL, NULL, m_creature->GetObjectGuid()); + pElder->CastSpell(pElder, m_bIsRegularMode ? SPELL_IRONBRANCH_ESSENCE_CHANNEL : SPELL_IRONBRANCH_ESSENCE_CHANNEL_H, true); pElder->CastSpell(pElder, SPELL_FULL_HEAL, true); m_uiIronRootsTimer = 60000; @@ -501,7 +490,7 @@ struct boss_freya : public CreatureScript { if (pElder->IsAlive()) { - pElder->CastSpell(pElder, m_bIsRegularMode ? SPELL_STONEBARK_ESSEMCE_CHANNEL : SPELL_STONEBARK_ESSEMCE_CHANNEL_H, false, NULL, NULL, m_creature->GetObjectGuid()); + pElder->CastSpell(pElder, m_bIsRegularMode ? SPELL_STONEBARK_ESSEMCE_CHANNEL : SPELL_STONEBARK_ESSEMCE_CHANNEL_H, true); pElder->CastSpell(pElder, SPELL_FULL_HEAL, true); m_uiGroundTremorTimer = 10000; @@ -518,38 +507,6 @@ struct boss_freya : public CreatureScript DoScriptText(SAY_AGGRO, m_creature); } - // Function that will drain elders after aggro - void DoDrainElders() - { - if (!m_pInstance) - return; - - if (Creature* pElder = m_pInstance->GetSingleCreatureFromStorage(NPC_ELDER_BRIGHTLEAF)) - { - if (pElder->IsAlive()) - { - pElder->CastSpell(pElder, SPELL_DRAINED_OF_POWER, true); - pElder->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - } - if (Creature* pElder = m_pInstance->GetSingleCreatureFromStorage(NPC_ELDER_IRONBRACH)) - { - if (pElder->IsAlive()) - { - pElder->CastSpell(pElder, SPELL_DRAINED_OF_POWER, true); - pElder->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - } - if (Creature* pElder = m_pInstance->GetSingleCreatureFromStorage(NPC_ELDER_STONEBARK)) - { - if (pElder->IsAlive()) - { - pElder->CastSpell(pElder, SPELL_DRAINED_OF_POWER, true); - pElder->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - } - } - void UpdateAI(const uint32 uiDiff) override { if (m_uiEpilogueTimer) @@ -583,18 +540,6 @@ struct boss_freya : public CreatureScript m_uiBerserkTimer -= uiDiff; } - // Drain elders after hard mode aggro - if (m_uiDrainEldersTimer) - { - if (m_uiDrainEldersTimer <= uiDiff) - { - DoDrainElders(); - m_uiDrainEldersTimer = 0; - } - else - m_uiDrainEldersTimer -= uiDiff; - } - if (m_uiThreeAlliesTimer) { if (m_uiThreeAlliesTimer <= uiDiff) diff --git a/src/modules/SD3/scripts/outland/hellfire_peninsula.cpp b/src/modules/SD3/scripts/outland/hellfire_peninsula.cpp index 6579bb357..871e859ea 100644 --- a/src/modules/SD3/scripts/outland/hellfire_peninsula.cpp +++ b/src/modules/SD3/scripts/outland/hellfire_peninsula.cpp @@ -179,12 +179,9 @@ struct npc_ancestral_wolf : public CreatureScript void Reset() override { - DoCastSpellIfCan(m_creature, SPELL_ANCESTRAL_WOLF_BUFF); + m_creature->CastSpell(m_creature, SPELL_ANCESTRAL_WOLF_BUFF, true); } - void AttackStart(Unit* /*pWho*/) override { } - void MoveInLineOfSight(Unit* /*pWho*/) override { } - void WaypointReached(uint32 uiPointId) override { switch (uiPointId) diff --git a/src/modules/SD3/scripts/outland/nagrand.cpp b/src/modules/SD3/scripts/outland/nagrand.cpp index 4c3c77a22..c81f85c74 100644 --- a/src/modules/SD3/scripts/outland/nagrand.cpp +++ b/src/modules/SD3/scripts/outland/nagrand.cpp @@ -102,7 +102,7 @@ struct mob_lump : public CreatureScript m_creature->DeleteThreatList(); m_creature->CombatStop(true); - // should get UnitFlags UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE at faction change, but unclear why/for what reason, skipped (no flags expected as default) + // should get unit_flags UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE at faction change, but unclear why/for what reason, skipped (no flags expected as default) m_creature->SetFactionTemporary(FACTION_FRIENDLY, TEMPFACTION_RESTORE_REACH_HOME); m_creature->SetStandState(UNIT_STAND_STATE_SIT); diff --git a/src/modules/SD3/scripts/outland/netherstorm.cpp b/src/modules/SD3/scripts/outland/netherstorm.cpp index 132344617..56a1b53eb 100644 --- a/src/modules/SD3/scripts/outland/netherstorm.cpp +++ b/src/modules/SD3/scripts/outland/netherstorm.cpp @@ -1774,16 +1774,6 @@ void AddSC_netherstorm() s = new npc_drijya(); s->RegisterSelf(); -#if defined (WOTLK) || defined (CATA) - s = new npc_dimensius(); - s->RegisterSelf(); - - /*pNewScript = new Script; - pNewScript->Name = "npc_dimensius"; - pNewScript->GetAI = &GetAI_npc_dimensius; - pNewScript->RegisterSelf();*/ -#endif - //pNewScript = new Script; //pNewScript->Name = "go_manaforge_control_console"; //pNewScript->pGOUse = &GOUse_go_manaforge_control_console; @@ -1837,4 +1827,14 @@ void AddSC_netherstorm() //pNewScript->GetAI = &GetAI_npc_drijya; //pNewScript->pQuestAcceptNPC = &QuestAccept_npc_drijya; //pNewScript->RegisterSelf(); + +#if defined (WOTLK) + s = new npc_dimensius(); + s->RegisterSelf(); + + /*pNewScript = new Script; + pNewScript->Name = "npc_dimensius"; + pNewScript->GetAI = &GetAI_npc_dimensius; + pNewScript->RegisterSelf();*/ +#endif } diff --git a/src/modules/SD3/scripts/outland/shadowmoon_valley.cpp b/src/modules/SD3/scripts/outland/shadowmoon_valley.cpp index 895f302d6..eef58b187 100644 --- a/src/modules/SD3/scripts/outland/shadowmoon_valley.cpp +++ b/src/modules/SD3/scripts/outland/shadowmoon_valley.cpp @@ -472,6 +472,8 @@ struct npc_dragonmaw_peon : public CreatureScript m_uiPoisonTimer -= uiDiff; } } + + DoMeleeAttackIfReady(); } }; @@ -1626,7 +1628,7 @@ struct spell_totem_of_spirits : public SpellScript } }; -#if defined (TBC) || defined (WOTLK) || defined (CATA) +#if defined (TBC) || defined (WOTLK) struct aura_elemental_sieve : public AuraScript { aura_elemental_sieve() : AuraScript("aura_elemental_sieve") {} @@ -2331,7 +2333,7 @@ void AddSC_shadowmoon_valley() s->RegisterSelf(); s = new spell_totem_of_spirits(); s->RegisterSelf(); -#if defined (TBC) || defined (WOTLK) || defined (CATA) +#if defined (TBC) || defined (WOTLK) s = new aura_elemental_sieve(); s->RegisterSelf(); #endif diff --git a/src/modules/SD3/scripts/world/npcs_special.cpp b/src/modules/SD3/scripts/world/npcs_special.cpp index 3b21dcf15..9511a4030 100644 --- a/src/modules/SD3/scripts/world/npcs_special.cpp +++ b/src/modules/SD3/scripts/world/npcs_special.cpp @@ -1213,9 +1213,9 @@ struct npc_guardian : public CreatureScript # npc_innkeeper #########*/ -// Script applied to all innkeepers by NpcFlags. +// Script applied to all innkeepers by npcflag. // Are there any known innkeepers that does not hape the options in the below? -// (remember gossipHello is not called unless NpcFlags|1 is present) +// (remember gossipHello is not called unless npcflag|1 is present) enum { diff --git a/src/modules/SD3/scripts/world/spell_scripts.cpp b/src/modules/SD3/scripts/world/spell_scripts.cpp index 3f81bcb49..1005fa5ff 100644 --- a/src/modules/SD3/scripts/world/spell_scripts.cpp +++ b/src/modules/SD3/scripts/world/spell_scripts.cpp @@ -608,12 +608,12 @@ struct spell_apply_salve : public SpellScript { if (uiSpellId == SPELL_APPLY_SALVE && uiEffIndex == EFFECT_INDEX_0) { - if (pCaster->GetTypeId() != TYPEID_PLAYER) + Creature *pCreatureTarget = pTarget->ToCreature(); + if (pCaster->GetTypeId() != TYPEID_PLAYER || !pCreatureTarget) { return true; } - Creature *pCreatureTarget = pTarget->ToCreature(); if (pCreatureTarget->GetEntry() != NPC_SICKLY_DEER && pCreatureTarget->GetEntry() != NPC_SICKLY_GAZELLE) { return true; @@ -638,7 +638,7 @@ struct spell_sacred_cleansing : public SpellScript { if (uiSpellId == SPELL_SACRED_CLEANSING && uiEffIndex == EFFECT_INDEX_1) { - if (pTarget->ToCreature() && pTarget->GetEntry() != NPC_MORBENT) + if (!pTarget->ToCreature() || pTarget->GetEntry() != NPC_MORBENT) { return true; } @@ -657,7 +657,7 @@ struct spell_melodious_rapture : public SpellScript if (uiSpellId == SPELL_MELODIOUS_RAPTURE && uiEffIndex == EFFECT_INDEX_0) { Creature *pCreatureTarget = pTarget->ToCreature(); - if (pCaster->GetTypeId() != TYPEID_PLAYER && pCreatureTarget->GetEntry() != NPC_DEEPRUN_RAT) + if (pCaster->GetTypeId() != TYPEID_PLAYER || !pCreatureTarget || (pCreatureTarget->GetEntry() != NPC_DEEPRUN_RAT)) { return true; } @@ -910,6 +910,9 @@ struct spell_orb_of_murloc_control : public SpellScript bool EffectDummy(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Object* pTarget, ObjectGuid /*originalCasterGuid*/) override //SPELL_ORB_OF_MURLOC_CONTROL { Creature* pCreatureTarget = pTarget->ToCreature(); + if (!pCreatureTarget) + return true; + pCreatureTarget->CastSpell(pCaster, SPELL_GREENGILL_SLAVE_FREED, true); // Freed Greengill Slave @@ -928,6 +931,9 @@ struct spell_fumping : public SpellScript bool EffectDummy(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Object* pTarget, ObjectGuid /*originalCasterGuid*/) override { Creature *pCreatureTarget = pTarget->ToCreature(); + if (!pCreatureTarget) + return true; + if (uiSpellId == SPELL_FUMPING && uiEffIndex == EFFECT_INDEX_2) { switch (urand(0, 2)) @@ -1030,6 +1036,9 @@ struct spell_throw_gordawg_boulder : public SpellScript bool EffectDummy(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Object* pTarget, ObjectGuid /*originalCasterGuid*/) override { Creature *pCreatureTarget = pTarget->ToCreature(); + if (!pCreatureTarget) + return true; + if (uiSpellId == SPELL_THROW_GORDAWG_BOULDER && uiEffIndex == EFFECT_INDEX_0) { for (int i = 0; i < 3; ++i) @@ -1161,7 +1170,7 @@ struct spell_throw_ice : public SpellScript if (uiEffIndex == EFFECT_INDEX_0) { Creature *pCreatureTarget = pTarget->ToCreature(); - if (pCreatureTarget->GetEntry() != NPC_SMOLDERING_SCRAP_BUNNY) + if (!pCreatureTarget || pCreatureTarget->GetEntry() != NPC_SMOLDERING_SCRAP_BUNNY) return true; if (GameObject* pScrap = GetClosestGameObjectWithEntry(pCreatureTarget, GO_SMOLDERING_SCRAP, 5.0f)) diff --git a/src/modules/SD3/system/ScriptDevMgr.cpp b/src/modules/SD3/system/ScriptDevMgr.cpp index d3c7f5f69..69af44e60 100644 --- a/src/modules/SD3/system/ScriptDevMgr.cpp +++ b/src/modules/SD3/system/ScriptDevMgr.cpp @@ -601,11 +601,14 @@ bool SD3::AuraDummy(Aura const* pAura, bool bApply) InstanceData* SD3::CreateInstanceData(Map* pMap) { Script* pTempScript = m_scripts[pMap->GetScriptId()]; - - if (!pTempScript || !pTempScript->ToInstanceScript()) - { + if (!pTempScript) return NULL; - } - return pTempScript->ToInstanceScript()->GetInstanceData(pMap); + if (pTempScript->ToInstanceScript()) + return pTempScript->ToInstanceScript()->GetInstanceData(pMap); + + if (pTempScript->ToZoneScript()) + return pTempScript->ToZoneScript()->GetInstanceData(pMap); + + return NULL; } diff --git a/src/modules/SD3/system/ScriptDevMgr.h b/src/modules/SD3/system/ScriptDevMgr.h index 045103218..79beb45c6 100644 --- a/src/modules/SD3/system/ScriptDevMgr.h +++ b/src/modules/SD3/system/ScriptDevMgr.h @@ -30,6 +30,7 @@ #include "Common.h" #include "DBCStructure.h" #include "ScriptMgr.h" +#include "QuestDef.h" class Player; class Creature; @@ -171,7 +172,7 @@ struct CreatureScript : public Script virtual bool OnGossipHello(Player*, Creature*) { return false; } virtual bool OnGossipSelect(Player*, Creature*, uint32, uint32) { return false; } virtual bool OnGossipSelectWithCode(Player*, Creature*, uint32, uint32, const char*) { return false; } - virtual uint32 OnDialogEnd(Player*, Creature*) { return 0; } + virtual uint32 OnDialogEnd(Player*, Creature*) { return DIALOG_STATUS_UNDEFINED; } virtual bool OnQuestAccept(Player*, Creature*, Quest const*) { return false; } virtual bool OnQuestRewarded(Player*, Creature*, Quest const*) { return false; } #if defined (WOTLK) || defined (CATA) @@ -188,7 +189,7 @@ struct GameObjectScript : public Script virtual bool OnGossipHello(Player*, GameObject*) { return false; } virtual bool OnGossipSelect(Player*, GameObject*, uint32, uint32) { return false; } virtual bool OnGossipSelectWithCode(Player*, GameObject*, uint32, uint32, const char*) { return false; } - virtual uint32 OnDialogEnd(Player*, GameObject*) { return 0; } + virtual uint32 OnDialogEnd(Player*, GameObject*) { return DIALOG_STATUS_UNDEFINED; } virtual bool OnQuestAccept(Player*, GameObject*, Quest const*) { return false; } virtual bool OnQuestRewarded(Player*, GameObject*, Quest const*) { return false; } virtual bool OnUse(Player*, GameObject*) { return false; } diff --git a/src/modules/SD3/system/ScriptLoader.cpp b/src/modules/SD3/system/ScriptLoader.cpp index 4880b967f..e0177bc72 100644 --- a/src/modules/SD3/system/ScriptLoader.cpp +++ b/src/modules/SD3/system/ScriptLoader.cpp @@ -226,6 +226,14 @@ void AddSC_western_plaguelands(); void AddSC_westfall(); void AddSC_wetlands(); +// Cata zones +#if defined (CATA) +void AddSC_gilneas(); +void AddSC_gilneas_city(); +void AddSC_twilight_highlands(); +void AddSC_vashjir(); +#endif + void AddEasternKingdomsScripts() { AddSC_blackrock_depths(); // blackrock_depths @@ -426,6 +434,13 @@ void AddEasternKingdomsScripts() AddSC_western_plaguelands(); AddSC_westfall(); AddSC_wetlands(); + +// Cata zones +#if defined (CATA) + AddSC_gilneas(); + AddSC_gilneas_city(); +#endif + } // kalimdor @@ -510,6 +525,12 @@ void AddSC_thunder_bluff(); void AddSC_ungoro_crater(); void AddSC_winterspring(); +// Cata zones +#if defined (CATA) +void AddSC_uldum(); +void AddSC_mount_hyjal(); +#endif + void AddKalimdorScripts() { AddSC_instance_blackfathom_deeps(); // blackfathom deeps @@ -592,6 +613,12 @@ void AddKalimdorScripts() AddSC_thunder_bluff(); AddSC_ungoro_crater(); AddSC_winterspring(); + +// Cata zones +#if defined (CATA) + AddSC_uldum(); + AddSC_mount_hyjal(); +#endif } #if defined (WOTLK) || defined (CATA) @@ -748,7 +775,6 @@ void AddSC_boss_exarch_maladaar(); // auchindoun, auchenai_cry void AddSC_boss_shirrak(); void AddSC_boss_nexusprince_shaffar(); // auchindoun, mana_tombs void AddSC_boss_pandemonius(); -void AddSC_mana_tombs(); void AddSC_boss_anzu(); // auchindoun, sethekk_halls void AddSC_boss_darkweaver_syth(); void AddSC_boss_talon_king_ikiss();