fix(Scripts/IcecrownCitadel): Fix ICC buff not being reapplied after … (#15407)
This commit is contained in:
@@ -612,6 +612,35 @@ void InstanceScript::DoCastSpellOnPlayers(uint32 spell)
|
|||||||
player->CastSpell(player, spell, true);
|
player->CastSpell(player, spell, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InstanceScript::DoCastSpellOnPlayer(Player* player, uint32 spell, bool includePets /*= false*/, bool includeControlled /*= false*/)
|
||||||
|
{
|
||||||
|
if (!player)
|
||||||
|
return;
|
||||||
|
|
||||||
|
player->CastSpell(player, spell, true);
|
||||||
|
|
||||||
|
if (!includePets)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (uint8 itr2 = 0; itr2 < MAX_SUMMON_SLOT; ++itr2)
|
||||||
|
{
|
||||||
|
ObjectGuid summonGUID = player->m_SummonSlot[itr2];
|
||||||
|
if (!summonGUID.IsEmpty())
|
||||||
|
if (Creature* summon = instance->GetCreature(summonGUID))
|
||||||
|
summon->CastSpell(player, spell, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!includeControlled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (auto itr2 = player->m_Controlled.begin(); itr2 != player->m_Controlled.end(); ++itr2)
|
||||||
|
{
|
||||||
|
if (Unit* controlled = *itr2)
|
||||||
|
if (controlled->IsInWorld() && controlled->GetTypeId() == TYPEID_UNIT)
|
||||||
|
controlled->CastSpell(player, spell, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool InstanceScript::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= nullptr*/, uint32 /*miscvalue1*/ /*= 0*/)
|
bool InstanceScript::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= nullptr*/, uint32 /*miscvalue1*/ /*= 0*/)
|
||||||
{
|
{
|
||||||
LOG_ERROR("scripts.ai", "Achievement system call InstanceScript::CheckAchievementCriteriaMeet but instance script for map {} not have implementation for achievement criteria {}",
|
LOG_ERROR("scripts.ai", "Achievement system call InstanceScript::CheckAchievementCriteriaMeet but instance script for map {} not have implementation for achievement criteria {}",
|
||||||
|
|||||||
@@ -220,6 +220,9 @@ public:
|
|||||||
// Cast spell on all players in instance
|
// Cast spell on all players in instance
|
||||||
void DoCastSpellOnPlayers(uint32 spell);
|
void DoCastSpellOnPlayers(uint32 spell);
|
||||||
|
|
||||||
|
// Cast spell on player
|
||||||
|
void DoCastSpellOnPlayer(Player* player, uint32 spell, bool includePets /*= false*/, bool includeControlled /*= false*/);
|
||||||
|
|
||||||
// Return wether server allow two side groups or not
|
// Return wether server allow two side groups or not
|
||||||
bool ServerAllowsTwoSideGroups() { return sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP); }
|
bool ServerAllowsTwoSideGroups() { return sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP); }
|
||||||
|
|
||||||
|
|||||||
@@ -252,6 +252,22 @@ public:
|
|||||||
|
|
||||||
if (GetBossState(DATA_LADY_DEATHWHISPER) == DONE && GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) != DONE)
|
if (GetBossState(DATA_LADY_DEATHWHISPER) == DONE && GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) != DONE)
|
||||||
SpawnGunship();
|
SpawnGunship();
|
||||||
|
|
||||||
|
if (IsBuffAvailable)
|
||||||
|
{
|
||||||
|
SpellAreaForAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForAreaMapBounds(4812);
|
||||||
|
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
|
||||||
|
if ((itr->second->raceMask & player->getRaceMask()) && !player->HasAura(itr->second->spellId))
|
||||||
|
{
|
||||||
|
if (SpellInfo const* si = sSpellMgr->GetSpellInfo(itr->second->spellId))
|
||||||
|
{
|
||||||
|
if (si->HasAura(SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT))
|
||||||
|
{
|
||||||
|
DoCastSpellOnPlayer(player, itr->second->spellId, false, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnCreatureCreate(Creature* creature) override
|
void OnCreatureCreate(Creature* creature) override
|
||||||
@@ -1210,40 +1226,39 @@ public:
|
|||||||
IsBuffAvailable = !!data;
|
IsBuffAvailable = !!data;
|
||||||
if (!IsBuffAvailable)
|
if (!IsBuffAvailable)
|
||||||
{
|
{
|
||||||
Map::PlayerList const& plrList = instance->GetPlayers();
|
instance->DoForAllPlayers([&](Player* player)
|
||||||
for (Map::PlayerList::const_iterator itr = plrList.begin(); itr != plrList.end(); ++itr)
|
{
|
||||||
if (Player* plr = itr->GetSource())
|
player->UpdateAreaDependentAuras(player->GetAreaId());
|
||||||
|
for (Unit::ControlSet::const_iterator itr = player->m_Controlled.begin(); itr != player->m_Controlled.end(); ++itr)
|
||||||
{
|
{
|
||||||
plr->UpdateAreaDependentAuras(plr->GetAreaId());
|
Unit::AuraMap& am = (*itr)->GetOwnedAuras();
|
||||||
for (Unit::ControlSet::const_iterator itr = plr->m_Controlled.begin(); itr != plr->m_Controlled.end(); ++itr)
|
for (Unit::AuraMap::iterator itra = am.begin(); itra != am.end();)
|
||||||
{
|
switch (itra->second->GetId())
|
||||||
Unit::AuraMap& am = (*itr)->GetOwnedAuras();
|
{
|
||||||
for (Unit::AuraMap::iterator itra = am.begin(); itra != am.end();)
|
// Hellscream's Warsong
|
||||||
switch (itra->second->GetId())
|
case 73816:
|
||||||
{
|
case 73818:
|
||||||
// Hellscream's Warsong
|
case 73819:
|
||||||
case 73816:
|
case 73820:
|
||||||
case 73818:
|
case 73821:
|
||||||
case 73819:
|
case 73822:
|
||||||
case 73820:
|
|
||||||
case 73821:
|
|
||||||
case 73822:
|
|
||||||
// Strength of Wrynn
|
// Strength of Wrynn
|
||||||
case 73762:
|
case 73762:
|
||||||
case 73824:
|
case 73824:
|
||||||
case 73825:
|
case 73825:
|
||||||
case 73826:
|
case 73826:
|
||||||
case 73827:
|
case 73827:
|
||||||
case 73828:
|
case 73828:
|
||||||
(*itr)->RemoveOwnedAura(itra);
|
(*itr)->RemoveOwnedAura(itra);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
++itra;
|
++itra;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
SaveToDB();
|
||||||
break;
|
break;
|
||||||
case DATA_WEEKLY_QUEST_ID:
|
case DATA_WEEKLY_QUEST_ID:
|
||||||
for (uint8 i = 0; i < WeeklyNPCs; ++i)
|
for (uint8 i = 0; i < WeeklyNPCs; ++i)
|
||||||
@@ -1593,7 +1608,6 @@ public:
|
|||||||
ColdflameJetsState = temp ? DONE : NOT_STARTED;
|
ColdflameJetsState = temp ? DONE : NOT_STARTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
data >> temp;
|
|
||||||
data >> BloodQuickeningState;
|
data >> BloodQuickeningState;
|
||||||
data >> BloodQuickeningMinutes;
|
data >> BloodQuickeningMinutes;
|
||||||
|
|
||||||
@@ -1607,11 +1621,10 @@ public:
|
|||||||
data >> WeeklyQuestId10;
|
data >> WeeklyQuestId10;
|
||||||
data >> PutricideEventProgress;
|
data >> PutricideEventProgress;
|
||||||
PutricideEventProgress &= ~PUTRICIDE_EVENT_FLAG_TRAP_INPROGRESS;
|
PutricideEventProgress &= ~PUTRICIDE_EVENT_FLAG_TRAP_INPROGRESS;
|
||||||
data >> temp;
|
data >> LichKingHeroicAvailable;
|
||||||
LichKingHeroicAvailable = !!temp;
|
|
||||||
data >> BloodPrinceTrashCount;
|
data >> BloodPrinceTrashCount;
|
||||||
data >> temp;
|
data >> IsBuffAvailable;
|
||||||
SetData(DATA_BUFF_AVAILABLE, !!temp);
|
SetData(DATA_BUFF_AVAILABLE, IsBuffAvailable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteSaveDataMore(std::ostringstream& data) override
|
void WriteSaveDataMore(std::ostringstream& data) override
|
||||||
|
|||||||
Reference in New Issue
Block a user