Merge commit 'dbaf88566be7083408fb8324d7886dc3e0a45cc0' into 4.3.4
Conflicts: .gitattributes CONTRIBUTING.md sql/updates/world/2015_05_11_04_world.sql sql/updates/world/2015_05_27_00_world.sql sql/updates/world/2015_05_27_01_world.sql sql/updates/world/2015_06_06_01_world_335.sql src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp src/server/game/Entities/Creature/Creature.cpp src/server/game/Entities/Creature/Creature.h src/server/game/Entities/Object/ObjectGuid.h src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Player/Player.h src/server/game/Entities/Unit/Unit.cpp src/server/game/Entities/Unit/Unit.h src/server/game/Spells/Auras/SpellAuras.cpp src/server/game/Spells/Spell.cpp src/server/game/Spells/SpellMgr.cpp src/server/scripts/Commands/cs_modify.cpp src/server/scripts/Kalimdor/zone_moonglade.cpp src/server/scripts/Spells/spell_hunter.cpp src/server/scripts/Spells/spell_item.cpp src/server/scripts/Spells/spell_rogue.cpp
This commit is contained in:
commit
6dfaec3d97
119 files changed
+3776
-2162
No files matched your search
@@ -35,6 +35,7 @@
|
||||
#include "GroupMgr.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "SpellHistory.h"
|
||||
|
||||
class misc_commandscript : public CommandScript
|
||||
{
|
||||
@@ -723,7 +724,7 @@ public:
|
||||
|
||||
if (!*args)
|
||||
{
|
||||
target->RemoveAllSpellCooldown();
|
||||
target->GetSpellHistory()->ResetAllCooldowns();
|
||||
handler->PSendSysMessage(LANG_REMOVEALL_COOLDOWN, nameLink.c_str());
|
||||
}
|
||||
else
|
||||
@@ -733,14 +734,15 @@ public:
|
||||
if (!spellIid)
|
||||
return false;
|
||||
|
||||
if (!sSpellMgr->GetSpellInfo(spellIid))
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellIid);
|
||||
if (!spellInfo)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_UNKNOWN_SPELL, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
target->RemoveSpellCooldown(spellIid, true);
|
||||
target->GetSpellHistory()->ResetCooldown(spellIid, true);
|
||||
handler->PSendSysMessage(LANG_REMOVE_COOLDOWN, spellIid, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
|
||||
}
|
||||
return true;
|
||||
@@ -1453,7 +1455,7 @@ public:
|
||||
* Player %s %s (guid: %u) - I. LANG_PINFO_PLAYER
|
||||
* ** GM Mode active, Phase: -1 - II. LANG_PINFO_GM_ACTIVE (if GM)
|
||||
* ** Banned: (Type, Reason, Time, By) - III. LANG_PINFO_BANNED (if banned)
|
||||
* ** Muted: (Time, Reason, By) - IV. LANG_PINFO_MUTED (if muted)
|
||||
* ** Muted: (Reason, Time, By) - IV. LANG_PINFO_MUTED (if muted)
|
||||
* * Account: %s (id: %u), GM Level: %u - V. LANG_PINFO_ACC_ACCOUNT
|
||||
* * Last Login: %u (Failed Logins: %u) - VI. LANG_PINFO_ACC_LASTLOGIN
|
||||
* * Uses OS: %s - Latency: %u ms - VII. LANG_PINFO_ACC_OS
|
||||
@@ -1706,7 +1708,7 @@ public:
|
||||
|
||||
// Output IV. LANG_PINFO_MUTED if mute is applied
|
||||
if (muteTime > 0)
|
||||
handler->PSendSysMessage(LANG_PINFO_MUTED, secsToTimeString(muteTime - time(NULL), true).c_str(), muteReason.c_str(), muteBy.c_str());
|
||||
handler->PSendSysMessage(LANG_PINFO_MUTED, muteReason.c_str(), secsToTimeString(muteTime - time(nullptr), true).c_str(), muteBy.c_str());
|
||||
|
||||
// Output V. LANG_PINFO_ACC_ACCOUNT
|
||||
handler->PSendSysMessage(LANG_PINFO_ACC_ACCOUNT, userName.c_str(), accId, security);
|
||||
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (!target)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
@@ -165,17 +165,6 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// char* pmana = strtok((char*)args, " ");
|
||||
// if (!pmana)
|
||||
// return false;
|
||||
|
||||
// char* pmanaMax = strtok(NULL, " ");
|
||||
// if (!pmanaMax)
|
||||
// return false;
|
||||
|
||||
// int32 manam = atoi(pmanaMax);
|
||||
// int32 mana = atoi(pmana);
|
||||
|
||||
int32 energy = atoi((char*)args)*10;
|
||||
int32 energym = atoi((char*)args)*10;
|
||||
|
||||
@@ -186,7 +175,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (!target)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
@@ -216,17 +205,6 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// char* pmana = strtok((char*)args, " ");
|
||||
// if (!pmana)
|
||||
// return false;
|
||||
|
||||
// char* pmanaMax = strtok(NULL, " ");
|
||||
// if (!pmanaMax)
|
||||
// return false;
|
||||
|
||||
// int32 manam = atoi(pmanaMax);
|
||||
// int32 mana = atoi(pmana);
|
||||
|
||||
int32 rage = atoi((char*)args)*10;
|
||||
int32 ragem = atoi((char*)args)*10;
|
||||
|
||||
@@ -237,7 +215,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (!target)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
@@ -275,7 +253,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (!target)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
@@ -391,7 +369,7 @@ public:
|
||||
else
|
||||
mark = atoi(pmark);
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (target == NULL)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
@@ -946,7 +924,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (!target)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
@@ -987,7 +965,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (!target)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
@@ -1112,7 +1090,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (!target)
|
||||
{
|
||||
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
@@ -1142,7 +1120,7 @@ public:
|
||||
if (drunklevel > 100)
|
||||
drunklevel = 100;
|
||||
|
||||
if (Player* target = handler->getSelectedPlayer())
|
||||
if (Player* target = handler->getSelectedPlayerOrSelf())
|
||||
target->SetDrunkValue(drunklevel);
|
||||
|
||||
return true;
|
||||
@@ -1153,7 +1131,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (!target)
|
||||
{
|
||||
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
@@ -1306,7 +1284,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
|
||||
if (!target)
|
||||
{
|
||||
|
||||
@@ -378,28 +378,13 @@ public:
|
||||
|
||||
uint32 lowGuid = atoi((char*)guidStr);
|
||||
|
||||
Creature* creature = NULL;
|
||||
|
||||
/* FIXME: impossible without entry
|
||||
if (lowguid)
|
||||
creature = ObjectAccessor::GetCreature(*handler->GetSession()->GetPlayer(), MAKE_GUID(lowguid, HIGHGUID_UNIT));
|
||||
*/
|
||||
|
||||
// attempt check creature existence by DB data
|
||||
if (!creature)
|
||||
CreatureData const* data = sObjectMgr->GetCreatureData(lowGuid);
|
||||
if (!data)
|
||||
{
|
||||
CreatureData const* data = sObjectMgr->GetCreatureData(lowGuid);
|
||||
if (!data)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowGuid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// obtain real GUID for DB operations
|
||||
lowGuid = creature->GetDBTableGUIDLow();
|
||||
handler->PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowGuid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
int wait = waitStr ? atoi(waitStr) : 0;
|
||||
@@ -415,18 +400,6 @@ public:
|
||||
|
||||
WorldDatabase.Execute(stmt);
|
||||
|
||||
if (creature && creature->GetWaypointPath())
|
||||
{
|
||||
creature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE);
|
||||
creature->GetMotionMaster()->Initialize();
|
||||
if (creature->IsAlive()) // dead creature will reset movement generator at respawn
|
||||
{
|
||||
creature->setDeathState(JUST_DIED);
|
||||
creature->Respawn(true);
|
||||
}
|
||||
creature->SaveToDB();
|
||||
}
|
||||
|
||||
handler->SendSysMessage(LANG_WAYPOINT_ADDED);
|
||||
|
||||
return true;
|
||||
@@ -840,34 +813,22 @@ public:
|
||||
|
||||
lowguid = atoi(cId);
|
||||
|
||||
/* FIXME: impossible without entry
|
||||
if (lowguid)
|
||||
creature = ObjectAccessor::GetCreature(*handler->GetSession()->GetPlayer(), MAKE_GUID(lowguid, HIGHGUID_UNIT));
|
||||
*/
|
||||
|
||||
// Attempting creature load from DB data
|
||||
if (!creature)
|
||||
CreatureData const* data = sObjectMgr->GetCreatureData(lowguid);
|
||||
if (!data)
|
||||
{
|
||||
CreatureData const* data = sObjectMgr->GetCreatureData(lowguid);
|
||||
if (!data)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 map_id = data->mapid;
|
||||
|
||||
if (handler->GetSession()->GetPlayer()->GetMapId() != map_id)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_CREATUREATSAMEMAP, lowguid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
handler->PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
||||
uint32 map_id = data->mapid;
|
||||
|
||||
if (handler->GetSession()->GetPlayer()->GetMapId() != map_id)
|
||||
{
|
||||
lowguid = creature->GetDBTableGUIDLow();
|
||||
handler->PSendSysMessage(LANG_COMMAND_CREATUREATSAMEMAP, lowguid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void Update(uint32 /*diff*/) // correct order goes form 1-6
|
||||
virtual void Update(uint32 /*diff*/) override // correct order goes form 1-6
|
||||
{
|
||||
switch (State)
|
||||
{
|
||||
|
||||
@@ -202,7 +202,7 @@ class boss_archaedas : public CreatureScript
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied (Unit* /*killer*/)
|
||||
void JustDied (Unit* /*killer*/) override
|
||||
{
|
||||
instance->SetData(DATA_ANCIENT_DOOR, DONE); // open the vault door
|
||||
instance->SetData(DATA_MINIONS, SPECIAL); // deactivate his minions
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
|
||||
me->SetDisplayId(me->GetCreatureTemplate()->Modelid1);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
/*####
|
||||
# npc_omen
|
||||
####*/
|
||||
|
||||
@@ -377,12 +377,12 @@ public:
|
||||
void DoSummonPriestess()
|
||||
{
|
||||
// Summon 2 Elune priestess and make each of them move to a different spot
|
||||
if (Creature* priestess = me->SummonCreature(NPC_PRIESTESS_ELUNE, wingThicketLocations[0].m_positionX, wingThicketLocations[0].m_positionY, wingThicketLocations[0].m_positionZ, wingThicketLocations[0].m_orientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
if (Creature* priestess = me->SummonCreature(NPC_PRIESTESS_ELUNE, wingThicketLocations[0].m_positionX, wingThicketLocations[0].m_positionY, wingThicketLocations[0].m_positionZ, wingThicketLocations[0].GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
{
|
||||
priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[3].m_positionX, wingThicketLocations[3].m_positionY, wingThicketLocations[3].m_positionZ);
|
||||
_firstPriestessGUID = priestess->GetGUID();
|
||||
}
|
||||
if (Creature* priestess = me->SummonCreature(NPC_PRIESTESS_ELUNE, wingThicketLocations[1].m_positionX, wingThicketLocations[1].m_positionY, wingThicketLocations[1].m_positionZ, wingThicketLocations[1].m_orientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
if (Creature* priestess = me->SummonCreature(NPC_PRIESTESS_ELUNE, wingThicketLocations[1].m_positionX, wingThicketLocations[1].m_positionY, wingThicketLocations[1].m_positionZ, wingThicketLocations[1].GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
{
|
||||
// Left priestess should have a distinct move point because she is the one who starts the dialogue at point reach
|
||||
priestess->GetMotionMaster()->MovePoint(1, wingThicketLocations[4].m_positionX, wingThicketLocations[4].m_positionY, wingThicketLocations[4].m_positionZ);
|
||||
@@ -480,7 +480,7 @@ public:
|
||||
break;
|
||||
case SAY_PRIESTESS_ALTAR_13:
|
||||
// summon the Guardian of Elune
|
||||
if (Creature* guard = me->SummonCreature(NPC_GUARDIAN_ELUNE, wingThicketLocations[2].m_positionX, wingThicketLocations[2].m_positionY, wingThicketLocations[2].m_positionZ, wingThicketLocations[2].m_orientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
if (Creature* guard = me->SummonCreature(NPC_GUARDIAN_ELUNE, wingThicketLocations[2].m_positionX, wingThicketLocations[2].m_positionY, wingThicketLocations[2].m_positionZ, wingThicketLocations[2].GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
{
|
||||
guard->GetMotionMaster()->MovePoint(0, wingThicketLocations[5].m_positionX, wingThicketLocations[5].m_positionY, wingThicketLocations[5].m_positionZ);
|
||||
_guardEluneGUID = guard->GetGUID();
|
||||
|
||||
+1
-1
@@ -741,7 +741,7 @@ class boss_dreadscale : public CreatureScript
|
||||
switch (pointId)
|
||||
{
|
||||
case 0:
|
||||
instance->DoUseDoorOrButton(instance->GetGuidData(GO_MAIN_GATE_DOOR));
|
||||
instance->DoCloseDoorOrButton(instance->GetGuidData(GO_MAIN_GATE_DOOR));
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetInCombatWithZone();
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ class instance_halls_of_reflection : public InstanceMapScript
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetGameObjectEntry(uint32 /*guidLow*/, uint32 entry) override
|
||||
uint32 GetGameObjectEntry(ObjectGuid::LowType /*guidLow*/, uint32 entry) override
|
||||
{
|
||||
if (!_teamInInstance)
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "PassiveAI.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Transport.h"
|
||||
@@ -644,10 +645,10 @@ protected:
|
||||
{
|
||||
if (Instance->GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) == IN_PROGRESS &&
|
||||
!me->HasUnitState(UNIT_STATE_CASTING) && !me->HasReactState(REACT_PASSIVE) &&
|
||||
!me->HasSpellCooldown(BurningPitchId))
|
||||
!me->GetSpellHistory()->HasCooldown(BurningPitchId))
|
||||
{
|
||||
DoCastAOE(BurningPitchId, true);
|
||||
me->_AddCreatureSpellCooldown(BurningPitchId, time(NULL) + urand(3000, 4000) / IN_MILLISECONDS);
|
||||
me->GetSpellHistory()->AddCooldown(BurningPitchId, 0, std::chrono::milliseconds(urand(3000, 4000)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1469,7 +1470,7 @@ struct npc_gunship_boarding_addAI : public gunship_npc_AI
|
||||
DoCast(me, SPELL_BATTLE_EXPERIENCE, true);
|
||||
DoCast(me, SPELL_TELEPORT_TO_ENEMY_SHIP, true);
|
||||
DoCast(me, Instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE ? SPELL_MELEE_TARGETING_ON_ORGRIMS_HAMMER : SPELL_MELEE_TARGETING_ON_SKYBREAKER, true);
|
||||
me->_AddCreatureSpellCooldown(BurningPitchId, time(NULL) + 3);
|
||||
me->GetSpellHistory()->AddCooldown(BurningPitchId, 0, std::chrono::seconds(3));
|
||||
|
||||
std::list<Player*> players;
|
||||
Trinity::UnitAuraCheck check(true, Instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE ? SPELL_ON_ORGRIMS_HAMMER_DECK : SPELL_ON_SKYBREAKER_DECK);
|
||||
@@ -1698,11 +1699,11 @@ class npc_gunship_rocketeer : public CreatureScript
|
||||
return;
|
||||
|
||||
uint32 spellId = me->GetEntry() == NPC_SKYBREAKER_MORTAR_SOLDIER ? SPELL_ROCKET_ARTILLERY_A : SPELL_ROCKET_ARTILLERY_H;
|
||||
if (me->HasSpellCooldown(spellId))
|
||||
if (me->GetSpellHistory()->HasCooldown(spellId))
|
||||
return;
|
||||
|
||||
DoCastAOE(spellId, true);
|
||||
me->_AddCreatureSpellCooldown(spellId, time(NULL) + 9);
|
||||
me->GetSpellHistory()->AddCooldown(spellId, 0, std::chrono::seconds(9));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1060,8 +1060,8 @@ class spell_putricide_ooze_eruption_searcher : public SpellScriptLoader
|
||||
uint32 adhesiveId = sSpellMgr->GetSpellIdForDifficulty(SPELL_VOLATILE_OOZE_ADHESIVE, GetCaster());
|
||||
if (GetHitUnit()->HasAura(adhesiveId))
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), SPELL_OOZE_ERUPTION, true);
|
||||
GetHitUnit()->RemoveAurasDueToSpell(adhesiveId, GetCaster()->GetGUID(), 0, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
GetCaster()->CastSpell(GetHitUnit(), SPELL_OOZE_ERUPTION, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ class boss_sindragosa : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_AIR_MOVEMENT, 1);
|
||||
break;
|
||||
case POINT_AIR_PHASE:
|
||||
me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 5, 2, 6), NULL);
|
||||
me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 5, 2, 6), NULL, TRIGGERED_FULL_MASK);
|
||||
me->SetFacingTo(float(M_PI));
|
||||
events.ScheduleEvent(EVENT_AIR_MOVEMENT_FAR, 1);
|
||||
events.ScheduleEvent(EVENT_FROST_BOMB, 9000);
|
||||
@@ -491,7 +491,7 @@ class boss_sindragosa : public CreatureScript
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, FrostBeaconSelector(me)))
|
||||
{
|
||||
Talk(EMOTE_WARN_FROZEN_ORB, target);
|
||||
DoCast(target, SPELL_ICE_TOMB_DUMMY, true);
|
||||
me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, 1, nullptr, TRIGGERED_FULL_MASK);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_ICE_TOMB, urand(16000, 23000));
|
||||
break;
|
||||
@@ -1631,7 +1631,7 @@ void AddSC_boss_sindragosa()
|
||||
new spell_rimefang_icy_blast();
|
||||
new spell_frostwarden_handler_order_whelp();
|
||||
new spell_frostwarden_handler_focus_fire();
|
||||
new spell_trigger_spell_from_caster("spell_sindragosa_ice_tomb", SPELL_ICE_TOMB_DUMMY);
|
||||
new spell_trigger_spell_from_caster("spell_sindragosa_ice_tomb", SPELL_ICE_TOMB_DUMMY, TRIGGERED_IGNORE_SET_FACING);
|
||||
new spell_trigger_spell_from_caster("spell_sindragosa_ice_tomb_dummy", SPELL_FROST_BEACON);
|
||||
new at_sindragosa_lair();
|
||||
new achievement_all_you_can_eat();
|
||||
|
||||
@@ -524,14 +524,16 @@ enum AreaIds
|
||||
class spell_trigger_spell_from_caster : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_trigger_spell_from_caster(char const* scriptName, uint32 triggerId) : SpellScriptLoader(scriptName), _triggerId(triggerId) { }
|
||||
spell_trigger_spell_from_caster(char const* scriptName, uint32 triggerId, TriggerCastFlags triggerFlags = TRIGGERED_FULL_MASK)
|
||||
: SpellScriptLoader(scriptName), _triggerId(triggerId), _triggerFlags(triggerFlags) { }
|
||||
|
||||
class spell_trigger_spell_from_caster_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_trigger_spell_from_caster_SpellScript);
|
||||
|
||||
public:
|
||||
spell_trigger_spell_from_caster_SpellScript(uint32 triggerId) : SpellScript(), _triggerId(triggerId) { }
|
||||
spell_trigger_spell_from_caster_SpellScript(uint32 triggerId, TriggerCastFlags triggerFlags)
|
||||
: SpellScript(), _triggerId(triggerId), _triggerFlags(triggerFlags) { }
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
@@ -542,7 +544,7 @@ class spell_trigger_spell_from_caster : public SpellScriptLoader
|
||||
|
||||
void HandleTrigger()
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), _triggerId, true);
|
||||
GetCaster()->CastSpell(GetHitUnit(), _triggerId, _triggerFlags);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -551,15 +553,17 @@ class spell_trigger_spell_from_caster : public SpellScriptLoader
|
||||
}
|
||||
|
||||
uint32 _triggerId;
|
||||
TriggerCastFlags _triggerFlags;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_trigger_spell_from_caster_SpellScript(_triggerId);
|
||||
return new spell_trigger_spell_from_caster_SpellScript(_triggerId, _triggerFlags);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _triggerId;
|
||||
TriggerCastFlags _triggerFlags;
|
||||
};
|
||||
|
||||
template<class AI>
|
||||
|
||||
@@ -317,7 +317,7 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
}
|
||||
|
||||
// Weekly quest spawn prevention
|
||||
uint32 GetCreatureEntry(uint32 /*guidLow*/, CreatureData const* data) override
|
||||
uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) override
|
||||
{
|
||||
uint32 entry = data->id;
|
||||
switch (entry)
|
||||
@@ -372,7 +372,7 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
return entry;
|
||||
}
|
||||
|
||||
uint32 GetGameObjectEntry(uint32 /*guidLow*/, uint32 entry) override
|
||||
uint32 GetGameObjectEntry(ObjectGuid::LowType /*guidLow*/, uint32 entry) override
|
||||
{
|
||||
switch (entry)
|
||||
{
|
||||
|
||||
@@ -482,40 +482,47 @@ class boss_flame_leviathan : public CreatureScript
|
||||
if (action && action <= 4) // Tower destruction, debuff leviathan loot and reduce active tower count
|
||||
{
|
||||
if (me->HasLootMode(LOOT_MODE_DEFAULT | LOOT_MODE_HARD_MODE_1 | LOOT_MODE_HARD_MODE_2 | LOOT_MODE_HARD_MODE_3 | LOOT_MODE_HARD_MODE_4) && ActiveTowersCount == 4)
|
||||
{
|
||||
me->RemoveLootMode(LOOT_MODE_HARD_MODE_4);
|
||||
--ActiveTowersCount;
|
||||
}
|
||||
|
||||
if (me->HasLootMode(LOOT_MODE_DEFAULT | LOOT_MODE_HARD_MODE_1 | LOOT_MODE_HARD_MODE_2 | LOOT_MODE_HARD_MODE_3) && ActiveTowersCount == 3)
|
||||
{
|
||||
me->RemoveLootMode(LOOT_MODE_HARD_MODE_3);
|
||||
--ActiveTowersCount;
|
||||
}
|
||||
|
||||
if (me->HasLootMode(LOOT_MODE_DEFAULT | LOOT_MODE_HARD_MODE_1 | LOOT_MODE_HARD_MODE_2) && ActiveTowersCount == 2)
|
||||
{
|
||||
me->RemoveLootMode(LOOT_MODE_HARD_MODE_2);
|
||||
--ActiveTowersCount;
|
||||
}
|
||||
|
||||
if (me->HasLootMode(LOOT_MODE_DEFAULT | LOOT_MODE_HARD_MODE_1) && ActiveTowersCount == 1)
|
||||
{
|
||||
me->RemoveLootMode(LOOT_MODE_HARD_MODE_1);
|
||||
--ActiveTowersCount;
|
||||
}
|
||||
}
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_TOWER_OF_STORM_DESTROYED:
|
||||
towerOfStorms = false;
|
||||
if (towerOfStorms)
|
||||
{
|
||||
towerOfStorms = false;
|
||||
--ActiveTowersCount;
|
||||
}
|
||||
break;
|
||||
case ACTION_TOWER_OF_FROST_DESTROYED:
|
||||
towerOfFrost = false;
|
||||
if (towerOfFrost)
|
||||
{
|
||||
towerOfFrost = false;
|
||||
--ActiveTowersCount;
|
||||
}
|
||||
break;
|
||||
case ACTION_TOWER_OF_FLAMES_DESTROYED:
|
||||
towerOfFlames = false;
|
||||
if (towerOfFlames)
|
||||
{
|
||||
towerOfFlames = false;
|
||||
--ActiveTowersCount;
|
||||
}
|
||||
break;
|
||||
case ACTION_TOWER_OF_LIFE_DESTROYED:
|
||||
towerOfLife = false;
|
||||
if (towerOfLife)
|
||||
{
|
||||
towerOfLife = false;
|
||||
--ActiveTowersCount;
|
||||
}
|
||||
break;
|
||||
case ACTION_START_HARD_MODE: // Activate hard-mode enable all towers, apply buffs on leviathan
|
||||
ActiveTowers = true;
|
||||
|
||||
@@ -903,17 +903,15 @@ class boss_yogg_saron : public CreatureScript
|
||||
DoCast(me, SPELL_KNOCK_AWAY);
|
||||
|
||||
me->ResetLootMode();
|
||||
switch (_instance->GetData(DATA_KEEPERS_COUNT))
|
||||
{
|
||||
case 0:
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_4);
|
||||
case 1:
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_3);
|
||||
case 2:
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_2);
|
||||
case 3:
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_1);
|
||||
}
|
||||
uint32 keepersCount = _instance->GetData(DATA_KEEPERS_COUNT);
|
||||
if (keepersCount == 0)
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_4);
|
||||
if (keepersCount <= 1)
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_3);
|
||||
if (keepersCount <= 2)
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_2);
|
||||
if (keepersCount <= 3)
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_1);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
|
||||
@@ -174,7 +174,7 @@ class npc_commander_eligor_dawnbringer : public CreatureScript
|
||||
{
|
||||
if (id == 1)
|
||||
{
|
||||
me->SetFacingTo(PosTalkLocations[talkWing].m_orientation);
|
||||
me->SetFacingTo(PosTalkLocations[talkWing].GetOrientation());
|
||||
TurnAudience();
|
||||
|
||||
switch (talkWing)
|
||||
|
||||
@@ -24,53 +24,6 @@
|
||||
#include "TemporarySummon.h"
|
||||
#include "CombatAI.h"
|
||||
|
||||
/*######
|
||||
## npc_squire_david
|
||||
######*/
|
||||
|
||||
enum SquireDavid
|
||||
{
|
||||
QUEST_THE_ASPIRANT_S_CHALLENGE_H = 13680,
|
||||
QUEST_THE_ASPIRANT_S_CHALLENGE_A = 13679,
|
||||
|
||||
NPC_ARGENT_VALIANT = 33448,
|
||||
|
||||
GOSSIP_TEXTID_SQUIRE = 14407
|
||||
};
|
||||
|
||||
#define GOSSIP_SQUIRE_ITEM_1 "I am ready to fight!"
|
||||
#define GOSSIP_SQUIRE_ITEM_2 "How do the Argent Crusader raiders fight?"
|
||||
|
||||
class npc_squire_david : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_squire_david() : CreatureScript("npc_squire_david") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_THE_ASPIRANT_S_CHALLENGE_H) == QUEST_STATUS_INCOMPLETE ||
|
||||
player->GetQuestStatus(QUEST_THE_ASPIRANT_S_CHALLENGE_A) == QUEST_STATUS_INCOMPLETE)//We need more info about it.
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SQUIRE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SQUIRE_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
}
|
||||
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_SQUIRE, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
creature->SummonCreature(NPC_ARGENT_VALIANT, 8575.451f, 952.472f, 547.554f, 0.38f);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_argent_valiant
|
||||
######*/
|
||||
@@ -837,7 +790,6 @@ class npc_frostbrood_skytalon : public CreatureScript
|
||||
|
||||
void AddSC_icecrown()
|
||||
{
|
||||
new npc_squire_david;
|
||||
new npc_argent_valiant;
|
||||
new npc_guardian_pavilion;
|
||||
new npc_tournament_training_dummy;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
@@ -261,13 +261,13 @@ class OPvPCapturePointNA : public OPvPCapturePoint
|
||||
public:
|
||||
OPvPCapturePointNA(OutdoorPvP* pvp);
|
||||
|
||||
bool Update(uint32 diff);
|
||||
bool Update(uint32 diff) override;
|
||||
|
||||
void ChangeState();
|
||||
void ChangeState() override;
|
||||
|
||||
void FillInitialWorldStates(WorldPacket & data);
|
||||
void FillInitialWorldStates(WorldPacket & data) override;
|
||||
|
||||
bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go);
|
||||
bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go) override;
|
||||
|
||||
int32 HandleOpenGo(Player* player, ObjectGuid guid) override;
|
||||
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ public:
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* i_pl = i->GetSource())
|
||||
if (i_pl->IsAlive() && (dist = i_pl->IsWithinDist(me, 45)))
|
||||
if (i_pl->IsAlive() && (dist = i_pl->GetDistance(me)) < 45)
|
||||
{
|
||||
i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC);
|
||||
me->AddAura(SPELL_INHIBITMAGIC, i_pl);
|
||||
|
||||
@@ -27,6 +27,7 @@ set(scripts_STAT_SRCS
|
||||
Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
|
||||
Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
|
||||
Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
|
||||
Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp
|
||||
Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
|
||||
Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
|
||||
Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
|
||||
|
||||
+3
-3
@@ -87,11 +87,11 @@ class boss_warchief_kargath_bladefist : public CreatureScript
|
||||
resetcheck_timer = 5000;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (type == 1)
|
||||
if (action == ACTION_EXECUTIONER_TAUNT)
|
||||
{
|
||||
switch (data)
|
||||
switch (instance->GetData(DATA_TEAM_IN_INSTANCE))
|
||||
{
|
||||
case ALLIANCE:
|
||||
Talk(SAY_CALL_EXECUTIONER_A);
|
||||
|
||||
+33
-220
@@ -32,20 +32,11 @@ EndScriptData */
|
||||
#include "SpellAuras.h"
|
||||
#include "shattered_halls.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CLEAVE = 15284,
|
||||
|
||||
SPELL_EXECUTE_1 = 39288,
|
||||
SPELL_EXECUTE_2,
|
||||
SPELL_EXECUTE_3
|
||||
};
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{GO_GRAND_WARLOCK_CHAMBER_DOOR_1, DATA_NETHEKURSE, DOOR_TYPE_PASSAGE, BOUNDARY_S },
|
||||
{GO_GRAND_WARLOCK_CHAMBER_DOOR_2, DATA_NETHEKURSE, DOOR_TYPE_PASSAGE, BOUNDARY_N },
|
||||
{0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE}
|
||||
{ GO_GRAND_WARLOCK_CHAMBER_DOOR_1, DATA_NETHEKURSE, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_GRAND_WARLOCK_CHAMBER_DOOR_2, DATA_NETHEKURSE, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }
|
||||
};
|
||||
|
||||
class instance_shattered_halls : public InstanceMapScript
|
||||
@@ -77,9 +68,7 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
if (!_team)
|
||||
_team = player->GetTeam();
|
||||
|
||||
player->RemoveAurasDueToSpell(SPELL_EXECUTE_1);
|
||||
player->RemoveAurasDueToSpell(SPELL_EXECUTE_2);
|
||||
player->RemoveAurasDueToSpell(SPELL_EXECUTE_3);
|
||||
player->CastSpell(player, SPELL_REMOVE_KARGATH_EXECUTIONER, true);
|
||||
|
||||
if (!executionTimer || executionerGUID.IsEmpty())
|
||||
return;
|
||||
@@ -87,13 +76,13 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
switch (executed)
|
||||
{
|
||||
case 0:
|
||||
ex = player->AddAura(SPELL_EXECUTE_1, player);
|
||||
ex = player->AddAura(SPELL_KARGATH_EXECUTIONER_1, player);
|
||||
break;
|
||||
case 1:
|
||||
ex = player->AddAura(SPELL_EXECUTE_2, player);
|
||||
ex = player->AddAura(SPELL_KARGATH_EXECUTIONER_2, player);
|
||||
break;
|
||||
case 2:
|
||||
ex = player->AddAura(SPELL_EXECUTE_3, player);
|
||||
ex = player->AddAura(SPELL_KARGATH_EXECUTIONER_3, player);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -151,10 +140,22 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
break;
|
||||
case NPC_SHATTERED_EXECUTIONER:
|
||||
executionTimer = 55 * MINUTE * IN_MILLISECONDS;
|
||||
DoCastSpellOnPlayers(SPELL_EXECUTE_1);
|
||||
DoCastSpellOnPlayers(SPELL_KARGATH_EXECUTIONER_1);
|
||||
executionerGUID = creature->GetGUID();
|
||||
SaveToDB();
|
||||
break;
|
||||
case NPC_CAPTAIN_ALINA:
|
||||
case NPC_CAPTAIN_BONESHATTER:
|
||||
victimsGUID[0] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_ALLIANCE_VICTIM_1:
|
||||
case NPC_HORDE_VICTIM_1:
|
||||
victimsGUID[1] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_ALLIANCE_VICTIM_2:
|
||||
case NPC_HORDE_VICTIM_2:
|
||||
victimsGUID[2] = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,16 +169,14 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
case DATA_SHATTERED_EXECUTIONER:
|
||||
if (state == DONE)
|
||||
{
|
||||
DoRemoveAurasDueToSpellOnPlayers(SPELL_EXECUTE_1);
|
||||
DoRemoveAurasDueToSpellOnPlayers(SPELL_EXECUTE_2);
|
||||
DoRemoveAurasDueToSpellOnPlayers(SPELL_EXECUTE_3);
|
||||
DoCastSpellOnPlayers(SPELL_REMOVE_KARGATH_EXECUTIONER);
|
||||
executionTimer = 0;
|
||||
SaveToDB();
|
||||
}
|
||||
break;
|
||||
case DATA_KARGATH:
|
||||
if (Creature* executioner = instance->GetCreature(executionerGUID))
|
||||
executioner->AI()->Reset();
|
||||
executioner->AI()->Reset(); // trigger removal of IMMUNE_TO_PC flag
|
||||
break;
|
||||
case DATA_OMROGG:
|
||||
break;
|
||||
@@ -191,16 +190,16 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
{
|
||||
case NPC_GRAND_WARLOCK_NETHEKURSE:
|
||||
return nethekurseGUID;
|
||||
break;
|
||||
case NPC_KARGATH_BLADEFIST:
|
||||
return kargathGUID;
|
||||
break;
|
||||
case NPC_SHATTERED_EXECUTIONER:
|
||||
return executionerGUID;
|
||||
break;
|
||||
case DATA_FIRST_PRISONER:
|
||||
case DATA_SECOND_PRISONER:
|
||||
case DATA_THIRD_PRISONER:
|
||||
return victimsGUID[data - DATA_FIRST_PRISONER];
|
||||
default:
|
||||
return ObjectGuid::Empty;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,13 +252,10 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
{
|
||||
case DATA_PRISONERS_EXECUTED:
|
||||
return executed;
|
||||
break;
|
||||
case DATA_TEAM_IN_INSTANCE:
|
||||
return _team;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,27 +265,25 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
return;
|
||||
|
||||
if (executionTimer <= diff)
|
||||
{
|
||||
{
|
||||
DoCastSpellOnPlayers(SPELL_REMOVE_KARGATH_EXECUTIONER);
|
||||
switch (++executed)
|
||||
{
|
||||
case 1:
|
||||
DoRemoveAurasDueToSpellOnPlayers(SPELL_EXECUTE_1);
|
||||
DoCastSpellOnPlayers(SPELL_EXECUTE_2);
|
||||
DoCastSpellOnPlayers(SPELL_KARGATH_EXECUTIONER_2);
|
||||
executionTimer = 10 * MINUTE * IN_MILLISECONDS;
|
||||
break;
|
||||
case 2:
|
||||
DoRemoveAurasDueToSpellOnPlayers(SPELL_EXECUTE_2);
|
||||
DoCastSpellOnPlayers(SPELL_EXECUTE_3);
|
||||
DoCastSpellOnPlayers(SPELL_KARGATH_EXECUTIONER_3);
|
||||
executionTimer = 15 * MINUTE * IN_MILLISECONDS;
|
||||
break;
|
||||
default:
|
||||
DoRemoveAurasDueToSpellOnPlayers(SPELL_EXECUTE_3);
|
||||
executionTimer = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (Creature* executioner = instance->GetCreature(executionerGUID))
|
||||
executioner->AI()->SetData(1, executed);
|
||||
executioner->AI()->SetData(DATA_PRISONERS_EXECUTED, executed);
|
||||
|
||||
SaveToDB();
|
||||
}
|
||||
@@ -297,10 +291,11 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
executionTimer -= diff;
|
||||
}
|
||||
|
||||
protected:
|
||||
private:
|
||||
ObjectGuid nethekurseGUID;
|
||||
ObjectGuid kargathGUID;
|
||||
ObjectGuid executionerGUID;
|
||||
ObjectGuid victimsGUID[3];
|
||||
|
||||
uint8 executed;
|
||||
uint32 executionTimer;
|
||||
@@ -308,189 +303,7 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
};
|
||||
};
|
||||
|
||||
class at_nethekurse_exit : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_nethekurse_exit() : AreaTriggerScript("at_nethekurse_exit") { };
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const*) override
|
||||
{
|
||||
if (InstanceScript* is = player->GetInstanceScript())
|
||||
{
|
||||
if (is->instance->IsHeroic())
|
||||
{
|
||||
Creature* executioner = nullptr;
|
||||
|
||||
is->instance->LoadGrid(Executioner.GetPositionX(), Executioner.GetPositionY());
|
||||
if (Creature* kargath = ObjectAccessor::GetCreature(*player, is->GetGuidData(NPC_KARGATH_BLADEFIST)))
|
||||
{
|
||||
if (is->GetGuidData(NPC_SHATTERED_EXECUTIONER).IsEmpty())
|
||||
{
|
||||
executioner = kargath->SummonCreature(NPC_SHATTERED_EXECUTIONER, Executioner);
|
||||
kargath->AI()->SetData(1, is->GetData(DATA_TEAM_IN_INSTANCE));
|
||||
}
|
||||
}
|
||||
|
||||
if (executioner)
|
||||
for (uint8 i = 0; i < VictimCount; ++i)
|
||||
executioner->SummonCreature(executionerVictims[i](is->GetData(DATA_TEAM_IN_INSTANCE)), executionerVictims[i].GetPos());
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class boss_shattered_executioner : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_shattered_executioner() : CreatureScript("boss_shattered_executioner") { }
|
||||
|
||||
struct boss_shattered_executionerAI : public BossAI
|
||||
{
|
||||
boss_shattered_executionerAI(Creature* creature) : BossAI(creature, DATA_SHATTERED_EXECUTIONER)
|
||||
{
|
||||
Initialize();
|
||||
};
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
cleaveTimer = 500;
|
||||
me->ResetLootMode();
|
||||
switch (instance->GetData(DATA_PRISONERS_EXECUTED))
|
||||
{
|
||||
case 0:
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_3);
|
||||
case 1:
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_2);
|
||||
case 2:
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_1);
|
||||
}
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
if (instance->GetBossState(DATA_KARGATH) == DONE)
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
else
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature*) override { }
|
||||
|
||||
void JustDied(Unit*) override
|
||||
{
|
||||
_JustDied();
|
||||
Map::PlayerList const &players = instance->instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
Player* pl = itr->GetSource();
|
||||
uint32 qId = pl->GetTeam() == ALLIANCE ? QUEST_IMPRISONED_A : QUEST_IMPRISONED_H;
|
||||
if (pl->GetQuestStatus(qId) != QUEST_STATUS_NONE && pl->GetQuestStatus(qId) != QUEST_STATUS_FAILED)
|
||||
pl->CompleteQuest(qId);
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
{
|
||||
if (type == 1)
|
||||
{
|
||||
uint32 entry = executionerVictims[data - 1](instance->GetData(DATA_TEAM_IN_INSTANCE));
|
||||
if (Creature* victim = me->FindNearestCreature(entry, 30.0f, true))
|
||||
me->Kill(victim);
|
||||
|
||||
if (data == 1)
|
||||
{
|
||||
Map::PlayerList const &players = instance->instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
Player* pl = itr->GetSource();
|
||||
uint32 qId = pl->GetTeam() == ALLIANCE ? QUEST_IMPRISONED_A : QUEST_IMPRISONED_H;
|
||||
if (pl->GetQuestStatus(qId) == QUEST_STATUS_INCOMPLETE)
|
||||
pl->FailQuest(qId);
|
||||
}
|
||||
}
|
||||
|
||||
switch (data)
|
||||
{
|
||||
case 3:
|
||||
me->RemoveLootMode(LOOT_MODE_HARD_MODE_1);
|
||||
case 2:
|
||||
me->RemoveLootMode(LOOT_MODE_HARD_MODE_2);
|
||||
case 1:
|
||||
me->RemoveLootMode(LOOT_MODE_HARD_MODE_3);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (cleaveTimer <= diff)
|
||||
{
|
||||
DoCast(SPELL_CLEAVE);
|
||||
cleaveTimer = urand(5000, 7000);
|
||||
}
|
||||
else
|
||||
cleaveTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
uint32 cleaveTimer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_shattered_executionerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_kargath_executioner : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_kargath_executioner() : SpellScriptLoader("spell_kargath_executioner") { }
|
||||
|
||||
class spell_kargath_executioner_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_kargath_executioner_AuraScript);
|
||||
|
||||
bool AreaCheck(Unit* target)
|
||||
{
|
||||
if (target->GetMap()->GetId() != 540)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_kargath_executioner_AuraScript::AreaCheck);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_kargath_executioner_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_shattered_halls()
|
||||
{
|
||||
new instance_shattered_halls();
|
||||
new at_nethekurse_exit();
|
||||
new boss_shattered_executioner();
|
||||
new spell_kargath_executioner();
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "shattered_halls.h"
|
||||
|
||||
class at_nethekurse_exit : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_nethekurse_exit() : AreaTriggerScript("at_nethekurse_exit") { };
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const*) override
|
||||
{
|
||||
if (InstanceScript* is = player->GetInstanceScript())
|
||||
{
|
||||
if (is->instance->IsHeroic())
|
||||
{
|
||||
Creature* executioner = nullptr;
|
||||
|
||||
is->instance->LoadGrid(Executioner.GetPositionX(), Executioner.GetPositionY());
|
||||
if (Creature* kargath = ObjectAccessor::GetCreature(*player, is->GetGuidData(NPC_KARGATH_BLADEFIST)))
|
||||
{
|
||||
if (is->GetGuidData(NPC_SHATTERED_EXECUTIONER).IsEmpty())
|
||||
{
|
||||
executioner = kargath->SummonCreature(NPC_SHATTERED_EXECUTIONER, Executioner);
|
||||
kargath->AI()->DoAction(ACTION_EXECUTIONER_TAUNT);
|
||||
}
|
||||
}
|
||||
|
||||
if (executioner)
|
||||
for (uint8 i = 0; i < VictimCount; ++i)
|
||||
executioner->SummonCreature(executionerVictims[i](is->GetData(DATA_TEAM_IN_INSTANCE)), executionerVictims[i].GetPos());
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CLEAVE = 15284
|
||||
};
|
||||
|
||||
class boss_shattered_executioner : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_shattered_executioner() : CreatureScript("boss_shattered_executioner") { }
|
||||
|
||||
struct boss_shattered_executionerAI : public BossAI
|
||||
{
|
||||
boss_shattered_executionerAI(Creature* creature) : BossAI(creature, DATA_SHATTERED_EXECUTIONER)
|
||||
{
|
||||
Initialize();
|
||||
};
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
cleaveTimer = 500;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
|
||||
// _Reset() resets the loot mode, so we add them again, if any
|
||||
uint32 prisonersExecuted = instance->GetData(DATA_PRISONERS_EXECUTED);
|
||||
if (prisonersExecuted == 0)
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_3);
|
||||
if (prisonersExecuted <= 1)
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_2);
|
||||
if (prisonersExecuted <= 2)
|
||||
me->AddLootMode(LOOT_MODE_HARD_MODE_1);
|
||||
|
||||
if (instance->GetBossState(DATA_KARGATH) == DONE)
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
else
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature*) override { } // avoid despawn of prisoners on death/reset
|
||||
|
||||
void JustDied(Unit*) override
|
||||
{
|
||||
_JustDied();
|
||||
|
||||
if (instance->GetData(DATA_PRISONERS_EXECUTED) > 0)
|
||||
return;
|
||||
|
||||
Map::PlayerList const &players = instance->instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
Player* pl = itr->GetSource();
|
||||
uint32 qId = pl->GetTeam() == ALLIANCE ? QUEST_IMPRISONED_A : QUEST_IMPRISONED_H;
|
||||
if (pl->GetQuestStatus(qId) == QUEST_STATUS_INCOMPLETE)
|
||||
pl->CompleteQuest(qId);
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
{
|
||||
if (type == DATA_PRISONERS_EXECUTED && data <= 3)
|
||||
{
|
||||
if (Creature* victim = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FIRST_PRISONER + data - 1)))
|
||||
me->Kill(victim);
|
||||
|
||||
if (data == 1)
|
||||
{
|
||||
Map::PlayerList const &players = instance->instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
Player* pl = itr->GetSource();
|
||||
uint32 qId = pl->GetTeam() == ALLIANCE ? QUEST_IMPRISONED_A : QUEST_IMPRISONED_H;
|
||||
if (pl->GetQuestStatus(qId) == QUEST_STATUS_INCOMPLETE)
|
||||
pl->FailQuest(qId);
|
||||
}
|
||||
}
|
||||
|
||||
switch (data)
|
||||
{
|
||||
case 3:
|
||||
me->RemoveLootMode(LOOT_MODE_HARD_MODE_1);
|
||||
case 2:
|
||||
me->RemoveLootMode(LOOT_MODE_HARD_MODE_2);
|
||||
case 1:
|
||||
me->RemoveLootMode(LOOT_MODE_HARD_MODE_3);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (cleaveTimer <= diff)
|
||||
{
|
||||
DoCast(SPELL_CLEAVE);
|
||||
cleaveTimer = urand(5000, 7000);
|
||||
}
|
||||
else
|
||||
cleaveTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
uint32 cleaveTimer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<boss_shattered_executionerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_kargath_executioner : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_kargath_executioner() : SpellScriptLoader("spell_kargath_executioner") { }
|
||||
|
||||
class spell_kargath_executioner_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_kargath_executioner_AuraScript);
|
||||
|
||||
bool AreaCheck(Unit* target)
|
||||
{
|
||||
if (target->GetMap()->GetId() != 540)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_kargath_executioner_AuraScript::AreaCheck);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_kargath_executioner_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_remove_kargath_executioner : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_remove_kargath_executioner() : SpellScriptLoader("spell_remove_kargath_executioner") { }
|
||||
|
||||
class spell_remove_kargath_executioner_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_remove_kargath_executioner_SpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* target = GetCaster();
|
||||
|
||||
target->RemoveAurasDueToSpell(SPELL_KARGATH_EXECUTIONER_1);
|
||||
target->RemoveAurasDueToSpell(SPELL_KARGATH_EXECUTIONER_2);
|
||||
target->RemoveAurasDueToSpell(SPELL_KARGATH_EXECUTIONER_3);
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_remove_kargath_executioner_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_remove_kargath_executioner_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_shattered_halls()
|
||||
{
|
||||
new at_nethekurse_exit();
|
||||
new boss_shattered_executioner();
|
||||
new spell_kargath_executioner();
|
||||
new spell_remove_kargath_executioner();
|
||||
}
|
||||
@@ -33,7 +33,11 @@ enum DataTypes
|
||||
DATA_SHATTERED_EXECUTIONER = 3,
|
||||
DATA_PRISONERS_EXECUTED = 4,
|
||||
|
||||
DATA_TEAM_IN_INSTANCE = 5
|
||||
DATA_TEAM_IN_INSTANCE = 5,
|
||||
|
||||
DATA_FIRST_PRISONER,
|
||||
DATA_SECOND_PRISONER,
|
||||
DATA_THIRD_PRISONER
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
@@ -70,6 +74,20 @@ enum QuestIds
|
||||
QUEST_IMPRISONED_H = 9525
|
||||
};
|
||||
|
||||
enum InstanceSpells
|
||||
{
|
||||
SPELL_KARGATH_EXECUTIONER_1 = 39288,
|
||||
SPELL_KARGATH_EXECUTIONER_2 = 39289,
|
||||
SPELL_KARGATH_EXECUTIONER_3 = 39290,
|
||||
|
||||
SPELL_REMOVE_KARGATH_EXECUTIONER = 39291
|
||||
};
|
||||
|
||||
enum Actions
|
||||
{
|
||||
ACTION_EXECUTIONER_TAUNT = 1
|
||||
};
|
||||
|
||||
const Position Executioner = { 152.8524f, -83.63912f, 2.021005f, 0.06981317f };
|
||||
|
||||
struct FactionSpawnerHelper
|
||||
@@ -77,7 +95,7 @@ struct FactionSpawnerHelper
|
||||
FactionSpawnerHelper(uint32 allianceEntry, uint32 hordeEntry, const Position& pos) : _allianceNPC(allianceEntry), _hordeNPC(hordeEntry), _spawnPos(pos) { }
|
||||
|
||||
inline uint32 operator()(uint32 teamID) const { return teamID == ALLIANCE ? _allianceNPC : _hordeNPC; }
|
||||
inline const Position GetPos() const { return _spawnPos; }
|
||||
inline Position const& GetPos() const { return _spawnPos; }
|
||||
|
||||
private:
|
||||
const uint32 _allianceNPC;
|
||||
|
||||
@@ -420,10 +420,482 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
enum ExorcismSpells
|
||||
{
|
||||
SPELL_JULES_GOES_PRONE = 39283,
|
||||
SPELL_JULES_THREATENS_AURA = 39284,
|
||||
SPELL_JULES_GOES_UPRIGHT = 39294,
|
||||
SPELL_JULES_VOMITS_AURA = 39295,
|
||||
|
||||
SPELL_BARADAS_COMMAND = 39277,
|
||||
SPELL_BARADA_FALTERS = 39278,
|
||||
};
|
||||
|
||||
enum ExorcismTexts
|
||||
{
|
||||
SAY_BARADA_1 = 0,
|
||||
SAY_BARADA_2 = 1,
|
||||
SAY_BARADA_3 = 2,
|
||||
SAY_BARADA_4 = 3,
|
||||
SAY_BARADA_5 = 4,
|
||||
SAY_BARADA_6 = 5,
|
||||
SAY_BARADA_7 = 6,
|
||||
SAY_BARADA_8 = 7,
|
||||
|
||||
SAY_JULES_1 = 0,
|
||||
SAY_JULES_2 = 1,
|
||||
SAY_JULES_3 = 2,
|
||||
SAY_JULES_4 = 3,
|
||||
SAY_JULES_5 = 4,
|
||||
};
|
||||
|
||||
Position const exorcismPos[11] =
|
||||
{
|
||||
{ -707.123f, 2751.686f, 101.592f, 4.577416f }, //Barada Waypoint-1 0
|
||||
{ -710.731f, 2749.075f, 101.592f, 1.513286f }, //Barada Cast position 1
|
||||
{ -710.332f, 2754.394f, 102.948f, 3.207566f }, //Jules 2
|
||||
{ -714.261f, 2747.754f, 103.391f, 0.0f }, //Jules Waypoint-1 3
|
||||
{ -713.113f, 2750.194f, 103.391f, 0.0f }, //Jules Waypoint-2 4
|
||||
{ -710.385f, 2750.896f, 103.391f, 0.0f }, //Jules Waypoint-3 5
|
||||
{ -708.309f, 2750.062f, 103.391f, 0.0f }, //Jules Waypoint-4 6
|
||||
{ -707.401f, 2747.696f, 103.391f, 0.0f }, //Jules Waypoint-5 7
|
||||
{ -708.591f, 2745.266f, 103.391f, 0.0f }, //Jules Waypoint-6 8
|
||||
{ -710.597f, 2744.035f, 103.391f, 0.0f }, //Jules Waypoint-7 9
|
||||
{ -713.089f, 2745.302f, 103.391f, 0.0f }, //Jules Waypoint-8 10
|
||||
};
|
||||
|
||||
enum ExorcismMisc
|
||||
{
|
||||
NPC_DARKNESS_RELEASED = 22507,
|
||||
NPC_FOUL_PURGE = 22506,
|
||||
NPC_COLONEL_JULES = 22432,
|
||||
|
||||
BARADAS_GOSSIP_MESSAGE = 10683,
|
||||
|
||||
QUEST_THE_EXORCISM_OF_COLONEL_JULES = 10935,
|
||||
|
||||
ACTION_START_EVENT = 1,
|
||||
ACTION_JULES_HOVER = 2,
|
||||
ACTION_JULES_FLIGHT = 3,
|
||||
ACTION_JULES_MOVE_HOME = 4,
|
||||
};
|
||||
|
||||
enum ExorcismEvents
|
||||
{
|
||||
EVENT_BARADAS_TALK = 1,
|
||||
|
||||
//Colonel Jules
|
||||
EVENT_SUMMON_SKULL = 1,
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_barada
|
||||
######*/
|
||||
|
||||
class npc_barada : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_barada() : CreatureScript("npc_barada") { }
|
||||
|
||||
struct npc_baradaAI : public ScriptedAI
|
||||
{
|
||||
npc_baradaAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
step = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
events.Reset();
|
||||
Initialize();
|
||||
|
||||
playerGUID.Clear();
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch (gossipListId)
|
||||
{
|
||||
case 1:
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
me->AI()->Talk(SAY_BARADA_1);
|
||||
me->AI()->DoAction(ACTION_START_EVENT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (action == ACTION_START_EVENT)
|
||||
{
|
||||
if (Creature* jules = me->FindNearestCreature(NPC_COLONEL_JULES, 20.0f, true))
|
||||
{
|
||||
julesGUID = jules->GetGUID();
|
||||
jules->AI()->Talk(SAY_JULES_1);
|
||||
}
|
||||
|
||||
me->GetMotionMaster()->MovePoint(0, exorcismPos[1]);
|
||||
Talk(SAY_BARADA_2);
|
||||
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (id == 0)
|
||||
me->GetMotionMaster()->MovePoint(1, exorcismPos[1]);
|
||||
|
||||
if (id == 1)
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 2000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
{
|
||||
jules->AI()->DoAction(ACTION_JULES_MOVE_HOME);
|
||||
jules->RemoveAllAuras();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_BARADAS_TALK:
|
||||
switch (step)
|
||||
{
|
||||
case 0:
|
||||
me->SetFacingTo(1.513286f);
|
||||
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 3000);
|
||||
step++;
|
||||
break;
|
||||
case 1:
|
||||
DoCast(SPELL_BARADAS_COMMAND);
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 5000);
|
||||
step++;
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_BARADA_3);
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 7000);
|
||||
step++;
|
||||
break;
|
||||
case 3:
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
jules->AI()->Talk(SAY_JULES_2);
|
||||
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 18000);
|
||||
step++;
|
||||
break;
|
||||
case 4:
|
||||
DoCast(SPELL_BARADA_FALTERS);
|
||||
me->HandleEmoteCommand(EMOTE_STAND_STATE_NONE);
|
||||
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
jules->AI()->DoAction(ACTION_JULES_HOVER);
|
||||
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 11000);
|
||||
step++;
|
||||
break;
|
||||
case 5:
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
jules->AI()->Talk(SAY_JULES_3);
|
||||
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 13000);
|
||||
step++;
|
||||
break;
|
||||
case 6:
|
||||
Talk(SAY_BARADA_4);
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 5000);
|
||||
step++;
|
||||
break;
|
||||
case 7:
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
jules->AI()->Talk(SAY_JULES_3);
|
||||
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 13000);
|
||||
step++;
|
||||
break;
|
||||
case 8:
|
||||
Talk(SAY_BARADA_4);
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 12000);
|
||||
step++;
|
||||
break;
|
||||
case 9:
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
jules->AI()->Talk(SAY_JULES_4);
|
||||
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 12000);
|
||||
step++;
|
||||
break;
|
||||
case 10:
|
||||
Talk(SAY_BARADA_4);
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 5000);
|
||||
step++;
|
||||
break;
|
||||
case 11:
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
jules->AI()->DoAction(ACTION_JULES_FLIGHT);
|
||||
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 10000);
|
||||
step++;
|
||||
break;
|
||||
case 12:
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
jules->AI()->Talk(SAY_JULES_4);
|
||||
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 8000);
|
||||
step++;
|
||||
break;
|
||||
case 13:
|
||||
Talk(SAY_BARADA_5);
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 10000);
|
||||
step++;
|
||||
break;
|
||||
case 14:
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
jules->AI()->Talk(SAY_JULES_4);
|
||||
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 10000);
|
||||
step++;
|
||||
break;
|
||||
case 15:
|
||||
Talk(SAY_BARADA_6);
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 10000);
|
||||
step++;
|
||||
break;
|
||||
case 16:
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
jules->AI()->Talk(SAY_JULES_5);
|
||||
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 10000);
|
||||
step++;
|
||||
break;
|
||||
case 17:
|
||||
Talk(SAY_BARADA_7);
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 10000);
|
||||
step++;
|
||||
break;
|
||||
case 18:
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
jules->AI()->Talk(SAY_JULES_3);
|
||||
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 10000);
|
||||
step++;
|
||||
break;
|
||||
case 19:
|
||||
Talk(SAY_BARADA_7);
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 10000);
|
||||
step++;
|
||||
break;
|
||||
case 20:
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
{
|
||||
jules->AI()->DoAction(ACTION_JULES_MOVE_HOME);
|
||||
jules->RemoveAura(SPELL_JULES_VOMITS_AURA);
|
||||
}
|
||||
|
||||
events.ScheduleEvent(EVENT_BARADAS_TALK, 10000);
|
||||
step++;
|
||||
break;
|
||||
case 21:
|
||||
//End
|
||||
if (Player* player = ObjectAccessor::FindPlayer(playerGUID))
|
||||
player->KilledMonsterCredit(NPC_COLONEL_JULES, ObjectGuid::Empty);
|
||||
|
||||
if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID))
|
||||
jules->RemoveAllAuras();
|
||||
|
||||
me->RemoveAura(SPELL_BARADAS_COMMAND);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
|
||||
Talk(SAY_BARADA_8);
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
EnterEvadeMode();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
uint8 step;
|
||||
ObjectGuid julesGUID;
|
||||
ObjectGuid playerGUID;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_baradaAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_colonel_jules
|
||||
######*/
|
||||
|
||||
class npc_colonel_jules : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_colonel_jules() : CreatureScript("npc_colonel_jules") { }
|
||||
|
||||
struct npc_colonel_julesAI : public ScriptedAI
|
||||
{
|
||||
npc_colonel_julesAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
circleRounds = 0;
|
||||
point = 3;
|
||||
wpreached = false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
events.Reset();
|
||||
|
||||
summons.DespawnAll();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_JULES_HOVER:
|
||||
me->AddAura(SPELL_JULES_GOES_PRONE, me);
|
||||
me->AddAura(SPELL_JULES_THREATENS_AURA, me);
|
||||
|
||||
me->SetCanFly(true);
|
||||
me->SetSpeed(MOVE_RUN, 0.2f);
|
||||
|
||||
me->SetFacingTo(3.207566f);
|
||||
me->GetMotionMaster()->MoveJump(exorcismPos[2], 2.0f, 2.0f);
|
||||
|
||||
events.ScheduleEvent(EVENT_SUMMON_SKULL, 10000);
|
||||
break;
|
||||
case ACTION_JULES_FLIGHT:
|
||||
circleRounds++;
|
||||
|
||||
me->RemoveAura(SPELL_JULES_GOES_PRONE);
|
||||
|
||||
me->AddAura(SPELL_JULES_GOES_UPRIGHT, me);
|
||||
me->AddAura(SPELL_JULES_VOMITS_AURA, me);
|
||||
|
||||
wpreached = true;
|
||||
me->GetMotionMaster()->MovePoint(point, exorcismPos[point]);
|
||||
break;
|
||||
case ACTION_JULES_MOVE_HOME:
|
||||
wpreached = false;
|
||||
me->SetSpeed(MOVE_RUN, 1.0f);
|
||||
me->GetMotionMaster()->MovePoint(11, exorcismPos[2]);
|
||||
|
||||
events.CancelEvent(EVENT_SUMMON_SKULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->GetMotionMaster()->MoveRandom(10.0f);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (id < 10)
|
||||
wpreached = true;
|
||||
|
||||
if (id == 8)
|
||||
{
|
||||
for (uint8 i = 0; i < circleRounds; i++)
|
||||
DoSummon(NPC_FOUL_PURGE, exorcismPos[8]);
|
||||
}
|
||||
|
||||
if (id == 10)
|
||||
{
|
||||
wpreached = true;
|
||||
point = 3;
|
||||
circleRounds++;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (wpreached)
|
||||
{
|
||||
me->GetMotionMaster()->MovePoint(point, exorcismPos[point]);
|
||||
point++;
|
||||
wpreached = false;
|
||||
}
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SUMMON_SKULL:
|
||||
uint8 summonCount = urand(1,3);
|
||||
|
||||
for (uint8 i = 0; i < summonCount; i++)
|
||||
me->SummonCreature(NPC_DARKNESS_RELEASED, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 1.5f, 0, TEMPSUMMON_MANUAL_DESPAWN);
|
||||
|
||||
events.ScheduleEvent(EVENT_SUMMON_SKULL, urand(10000, 15000));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
|
||||
uint8 circleRounds;
|
||||
uint8 point;
|
||||
|
||||
bool wpreached;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_colonel_julesAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_hellfire_peninsula()
|
||||
{
|
||||
new npc_aeranas();
|
||||
new npc_ancestral_wolf();
|
||||
new npc_wounded_blood_elf();
|
||||
new npc_fel_guard_hound();
|
||||
new npc_barada();
|
||||
new npc_colonel_jules();
|
||||
}
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "Pet.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "SkillDiscovery.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Vehicle.h"
|
||||
@@ -1310,8 +1311,8 @@ class spell_gen_divine_storm_cd_reset : public SpellScriptLoader
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
if (caster->HasSpellCooldown(SPELL_DIVINE_STORM))
|
||||
caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true);
|
||||
if (caster->GetSpellHistory()->HasCooldown(SPELL_DIVINE_STORM))
|
||||
caster->GetSpellHistory()->ResetCooldown(SPELL_DIVINE_STORM, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -3318,7 +3319,7 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader
|
||||
{
|
||||
// This is only needed because spells cast from spell_linked_spell are triggered by default
|
||||
// Spell::SendSpellCooldown() skips all spells with TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD
|
||||
GetCaster()->ToPlayer()->AddSpellAndCategoryCooldowns(GetSpellInfo(), GetCastItem() ? GetCastItem()->GetEntry() : 0, GetSpell());
|
||||
GetCaster()->GetSpellHistory()->StartCooldown(GetSpellInfo(), 0, GetSpell());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
@@ -713,24 +714,20 @@ class spell_hun_readiness : public SpellScriptLoader
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
// immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath
|
||||
const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap();
|
||||
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
|
||||
GetCaster()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
|
||||
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
|
||||
|
||||
///! If spellId in cooldown map isn't valid, the above will return a null pointer.
|
||||
if (spellInfo &&
|
||||
spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER &&
|
||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER &&
|
||||
spellInfo->Id != SPELL_HUNTER_READINESS &&
|
||||
spellInfo->Id != SPELL_HUNTER_BESTIAL_WRATH &&
|
||||
spellInfo->Id != SPELL_DRAENEI_GIFT_OF_THE_NAARU &&
|
||||
spellInfo->GetRecoveryTime() > 0)
|
||||
caster->RemoveSpellCooldown((itr++)->first, true);
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SkillDiscovery.h"
|
||||
@@ -1349,7 +1350,7 @@ class spell_item_red_rider_air_rifle : public SpellScriptLoader
|
||||
caster->CastSpell(caster, SPELL_AIR_RIFLE_HOLD_VISUAL, true);
|
||||
// needed because this spell shares GCD with its triggered spells (which must not be cast with triggered flag)
|
||||
if (Player* player = caster->ToPlayer())
|
||||
player->GetGlobalCooldownMgr().CancelGlobalCooldown(GetSpellInfo());
|
||||
player->GetSpellHistory()->CancelGlobalCooldown(GetSpellInfo());
|
||||
if (urand(0, 4))
|
||||
caster->CastSpell(target, SPELL_AIR_RIFLE_SHOOT, false);
|
||||
else
|
||||
@@ -2368,7 +2369,7 @@ class spell_item_rocket_boots : public SpellScriptLoader
|
||||
if (Battleground* bg = caster->GetBattleground())
|
||||
bg->EventPlayerDroppedFlag(caster);
|
||||
|
||||
caster->RemoveSpellCooldown(SPELL_ROCKET_BOOTS_PROC);
|
||||
caster->GetSpellHistory()->ResetCooldown(SPELL_ROCKET_BOOTS_PROC);
|
||||
caster->CastSpell(caster, SPELL_ROCKET_BOOTS_PROC, true, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Pet.h"
|
||||
@@ -326,22 +327,12 @@ class spell_mage_cold_snap : public SpellScriptLoader
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
// immediately finishes the cooldown on Frost spells
|
||||
const SpellCooldowns& cm = caster->GetSpellCooldownMap();
|
||||
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
|
||||
GetCaster()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
|
||||
|
||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE &&
|
||||
(spellInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) &&
|
||||
spellInfo->Id != SPELL_MAGE_COLD_SNAP && spellInfo->GetRecoveryTime() > 0)
|
||||
{
|
||||
caster->RemoveSpellCooldown((itr++)->first, true);
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
return spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (spellInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) &&
|
||||
spellInfo->Id != SPELL_MAGE_COLD_SNAP && spellInfo->GetRecoveryTime() > 0;
|
||||
}, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "Group.h"
|
||||
|
||||
enum PaladinSpells
|
||||
@@ -122,7 +123,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader
|
||||
int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage();
|
||||
uint32 allowedHealth = victim->CountPctFromMaxHealth(35);
|
||||
// If damage kills us
|
||||
if (remainingHealth <= 0 && !victim->ToPlayer()->HasSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL))
|
||||
if (remainingHealth <= 0 && !victim->GetSpellHistory()->HasCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL))
|
||||
{
|
||||
// Cast healing spell, completely avoid damage
|
||||
absorbAmount = dmgInfo.GetDamage();
|
||||
@@ -137,7 +138,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader
|
||||
|
||||
int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense)));
|
||||
victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff);
|
||||
victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(NULL) + 120);
|
||||
victim->GetSpellHistory()->AddCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, std::chrono::minutes(2));
|
||||
}
|
||||
else if (remainingHealth < int32(allowedHealth))
|
||||
{
|
||||
|
||||
@@ -208,22 +208,23 @@ class spell_q6124_6129_apply_salve : public SpellScriptLoader
|
||||
if (GetCastItem())
|
||||
if (Creature* creatureTarget = GetHitCreature())
|
||||
{
|
||||
uint32 uiNewEntry = 0;
|
||||
uint32 newEntry = 0;
|
||||
switch (caster->GetTeam())
|
||||
{
|
||||
case HORDE:
|
||||
if (creatureTarget->GetEntry() == NPC_SICKLY_GAZELLE)
|
||||
uiNewEntry = NPC_CURED_GAZELLE;
|
||||
newEntry = NPC_CURED_GAZELLE;
|
||||
break;
|
||||
case ALLIANCE:
|
||||
if (creatureTarget->GetEntry() == NPC_SICKLY_DEER)
|
||||
uiNewEntry = NPC_CURED_DEER;
|
||||
newEntry = NPC_CURED_DEER;
|
||||
break;
|
||||
}
|
||||
if (uiNewEntry)
|
||||
if (newEntry)
|
||||
{
|
||||
creatureTarget->UpdateEntry(uiNewEntry);
|
||||
creatureTarget->UpdateEntry(newEntry);
|
||||
creatureTarget->DespawnOrUnsummon(DESPAWN_TIME);
|
||||
caster->KilledMonsterCredit(newEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -338,7 +339,7 @@ class spell_q11396_11399_scourging_crystal_controller : public SpellScriptLoader
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q11396_11399_scourging_crystal_controller_SpellScript();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// 43882 Scourging Crystal Controller Dummy
|
||||
@@ -374,7 +375,7 @@ class spell_q11396_11399_scourging_crystal_controller_dummy : public SpellScript
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// http://www.wowhead.com/quest=11515 Blood for Blood
|
||||
@@ -855,7 +856,7 @@ class spell_symbol_of_life_dummy : public SpellScriptLoader
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_symbol_of_life_dummy_SpellScript();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// http://www.wowhead.com/quest=12659 Scalps!
|
||||
@@ -898,7 +899,7 @@ class spell_q12659_ahunaes_knife : public SpellScriptLoader
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q12659_ahunaes_knife_SpellScript();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
enum StoppingTheSpread
|
||||
@@ -944,7 +945,7 @@ class spell_q9874_liquid_fire : public SpellScriptLoader
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q9874_liquid_fire_SpellScript();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
enum SalvagingLifesStength
|
||||
@@ -988,7 +989,7 @@ class spell_q12805_lifeblood_dummy : public SpellScriptLoader
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_q12805_lifeblood_dummy_SpellScript();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "Containers.h"
|
||||
|
||||
enum RogueSpells
|
||||
@@ -158,11 +159,11 @@ class spell_rog_cheat_death : public SpellScriptLoader
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
||||
{
|
||||
Player* target = GetTarget()->ToPlayer();
|
||||
if (dmgInfo.GetDamage() < target->GetHealth() || target->HasSpellCooldown(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN) || !roll_chance_i(absorbChance))
|
||||
if (dmgInfo.GetDamage() < target->GetHealth() || target->GetSpellHistory()->HasCooldown(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN) || !roll_chance_i(absorbChance))
|
||||
return;
|
||||
|
||||
target->CastSpell(target, SPELL_ROGUE_CHEAT_DEATH_COOLDOWN, true);
|
||||
target->AddSpellCooldown(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN, 0, time(NULL) + 60);
|
||||
target->GetSpellHistory()->AddCooldown(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN, 0, std::chrono::minutes(1));
|
||||
|
||||
uint32 health10 = target->CountPctFromMaxHealth(10);
|
||||
|
||||
@@ -603,20 +604,22 @@ class spell_rog_preparation : public SpellScriptLoader
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
|
||||
// immediately finishes the cooldown on certain Rogue abilities
|
||||
SpellCooldowns const& cm = caster->GetSpellCooldownMap();
|
||||
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
|
||||
Unit* caster = GetCaster();
|
||||
caster->GetSpellHistory()->ResetCooldowns([caster](SpellHistory::CooldownStorageType::iterator itr) -> bool
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
|
||||
if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE)
|
||||
{
|
||||
++itr;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
|
||||
if ((spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_SHADOWSTEP || // Shadowstep
|
||||
return (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP || // Cold Blood, Shadowstep
|
||||
spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT) || // Vanish, Evasion, Sprint
|
||||
(caster->HasAura(SPELL_ROGUE_GLYPH_OF_PREPARATION) &&
|
||||
(spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_DISMANTLE || // Dismantle
|
||||
spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_KICK || // Kick
|
||||
(spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY && // Blade Flurry
|
||||
spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_BLADE_FLURRY)));
|
||||
}, true);
|
||||
continue;
|
||||
spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG0_ROGUE_VAN_SPRINT) || // Vanish, Sprint
|
||||
// Glyph of Preparation
|
||||
(caster->HasAura(SPELL_ROGUE_GLYPH_OF_PREPARATION) &&
|
||||
@@ -624,10 +627,6 @@ class spell_rog_preparation : public SpellScriptLoader
|
||||
spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG0_ROGUE_KICK))) // Kick
|
||||
{
|
||||
caster->RemoveSpellCooldown((itr++)->first, true);
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Unit.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
@@ -310,7 +311,7 @@ class spell_sha_earth_shield : public SpellScriptLoader
|
||||
{
|
||||
//! HACK due to currenct proc system implementation
|
||||
if (Player* player = GetTarget()->ToPlayer())
|
||||
if (player->HasSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL))
|
||||
if (player->GetSpellHistory()->HasCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -323,7 +324,7 @@ class spell_sha_earth_shield : public SpellScriptLoader
|
||||
|
||||
/// @hack: due to currenct proc system implementation
|
||||
if (Player* player = GetTarget()->ToPlayer())
|
||||
player->AddSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL, 0, time(NULL) + 3);
|
||||
player->GetSpellHistory()->AddCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL, 0, std::chrono::seconds(3));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -870,7 +871,7 @@ class spell_sha_item_t10_elemental_2p_bonus : public SpellScriptLoader
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Player* target = GetTarget()->ToPlayer())
|
||||
target->ModifySpellCooldown(SPELL_SHAMAN_ELEMENTAL_MASTERY, -aurEff->GetAmount());
|
||||
target->GetSpellHistory()->ModifyCooldown(SPELL_SHAMAN_ELEMENTAL_MASTERY, -aurEff->GetAmount());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
@@ -1040,7 +1041,7 @@ class spell_warr_vigilance_trigger : public SpellScriptLoader
|
||||
|
||||
// Remove Taunt cooldown
|
||||
if (Player* target = GetHitPlayer())
|
||||
target->RemoveSpellCooldown(SPELL_WARRIOR_TAUNT, true);
|
||||
target->GetSpellHistory()->ResetCooldown(SPELL_WARRIOR_TAUNT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -53,6 +53,7 @@ EndContentData */
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "Pet.h"
|
||||
#include "CreatureTextMgr.h"
|
||||
@@ -1208,14 +1209,14 @@ public:
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (player->HasSpellCooldown(SPELL_INT) ||
|
||||
player->HasSpellCooldown(SPELL_ARM) ||
|
||||
player->HasSpellCooldown(SPELL_DMG) ||
|
||||
player->HasSpellCooldown(SPELL_RES) ||
|
||||
player->HasSpellCooldown(SPELL_STR) ||
|
||||
player->HasSpellCooldown(SPELL_AGI) ||
|
||||
player->HasSpellCooldown(SPELL_STM) ||
|
||||
player->HasSpellCooldown(SPELL_SPI))
|
||||
if (player->GetSpellHistory()->HasCooldown(SPELL_INT) ||
|
||||
player->GetSpellHistory()->HasCooldown(SPELL_ARM) ||
|
||||
player->GetSpellHistory()->HasCooldown(SPELL_DMG) ||
|
||||
player->GetSpellHistory()->HasCooldown(SPELL_RES) ||
|
||||
player->GetSpellHistory()->HasCooldown(SPELL_STR) ||
|
||||
player->GetSpellHistory()->HasCooldown(SPELL_AGI) ||
|
||||
player->GetSpellHistory()->HasCooldown(SPELL_STM) ||
|
||||
player->GetSpellHistory()->HasCooldown(SPELL_SPI))
|
||||
player->SEND_GOSSIP_MENU(7393, creature->GetGUID());
|
||||
else
|
||||
{
|
||||
@@ -1275,52 +1276,44 @@ public:
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) override
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
uint32 spellId = 0;
|
||||
switch (sender)
|
||||
{
|
||||
case GOSSIP_SENDER_MAIN:
|
||||
SendAction(player, creature, action);
|
||||
break;
|
||||
case GOSSIP_SENDER_MAIN + 1:
|
||||
creature->CastSpell(player, SPELL_DMG, false);
|
||||
player->AddSpellCooldown(SPELL_DMG, 0, time(NULL) + 7200);
|
||||
SendAction(player, creature, action);
|
||||
spellId = SPELL_DMG;
|
||||
break;
|
||||
case GOSSIP_SENDER_MAIN + 2:
|
||||
creature->CastSpell(player, SPELL_RES, false);
|
||||
player->AddSpellCooldown(SPELL_RES, 0, time(NULL) + 7200);
|
||||
SendAction(player, creature, action);
|
||||
spellId = SPELL_RES;
|
||||
break;
|
||||
case GOSSIP_SENDER_MAIN + 3:
|
||||
creature->CastSpell(player, SPELL_ARM, false);
|
||||
player->AddSpellCooldown(SPELL_ARM, 0, time(NULL) + 7200);
|
||||
SendAction(player, creature, action);
|
||||
spellId = SPELL_ARM;
|
||||
break;
|
||||
case GOSSIP_SENDER_MAIN + 4:
|
||||
creature->CastSpell(player, SPELL_SPI, false);
|
||||
player->AddSpellCooldown(SPELL_SPI, 0, time(NULL) + 7200);
|
||||
SendAction(player, creature, action);
|
||||
spellId = SPELL_SPI;
|
||||
break;
|
||||
case GOSSIP_SENDER_MAIN + 5:
|
||||
creature->CastSpell(player, SPELL_INT, false);
|
||||
player->AddSpellCooldown(SPELL_INT, 0, time(NULL) + 7200);
|
||||
SendAction(player, creature, action);
|
||||
spellId = SPELL_INT;
|
||||
break;
|
||||
case GOSSIP_SENDER_MAIN + 6:
|
||||
creature->CastSpell(player, SPELL_STM, false);
|
||||
player->AddSpellCooldown(SPELL_STM, 0, time(NULL) + 7200);
|
||||
SendAction(player, creature, action);
|
||||
spellId = SPELL_STM;
|
||||
break;
|
||||
case GOSSIP_SENDER_MAIN + 7:
|
||||
creature->CastSpell(player, SPELL_STR, false);
|
||||
player->AddSpellCooldown(SPELL_STR, 0, time(NULL) + 7200);
|
||||
SendAction(player, creature, action);
|
||||
spellId = SPELL_STR;
|
||||
break;
|
||||
case GOSSIP_SENDER_MAIN + 8:
|
||||
creature->CastSpell(player, SPELL_AGI, false);
|
||||
player->AddSpellCooldown(SPELL_AGI, 0, time(NULL) + 7200);
|
||||
SendAction(player, creature, action);
|
||||
spellId = SPELL_AGI;
|
||||
break;
|
||||
}
|
||||
|
||||
if (spellId)
|
||||
{
|
||||
creature->CastSpell(player, spellId, false);
|
||||
player->GetSpellHistory()->AddCooldown(spellId, 0, std::chrono::hours(2));
|
||||
SendAction(player, creature, action);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user