4 Commits
5 changed files with 60 additions and 3 deletions
@@ -16797,6 +16797,13 @@ void Player::SetQuestStatus(uint32 questId, QuestStatus status, bool update /*=
if (!quest->IsTurnIn())
m_QuestStatusSave[questId] = QUEST_DEFAULT_SAVE_TYPE;
//WowCommunity
// Phases before the hooks, anything a script summons inherits them. Visibility waits for the next notify, this can run inside the objective loop
if (IsInWorld() && oldStatus != status && quest->HasFlag(QUEST_FLAGS_UPDATE_PHASESHIFT))
if (PhasingHandler::OnConditionChange(this, false))
UpdateObjectVisibility(false);
//WowCommunity
sScriptMgr->OnQuestStatusChange(this, questId);
sScriptMgr->OnQuestStatusChange(this, quest, oldStatus, status);
}
@@ -17801,6 +17808,12 @@ void Player::UpdateQuestObjectiveProgress(QuestObjectiveType objectiveType, int3
if (objectiveWasComplete != objectiveIsNowComplete)
anyObjectiveChangedCompletionState = true;
//WowCommunity
// Any progress, phase conditions can ask for a partial count
if (IsInWorld() && quest->HasFlag(QUEST_FLAGS_UPDATE_PHASESHIFT))
updatePhaseShift = true;
//WowCommunity
if (objectiveIsNowComplete && objective->CompletionEffect)
{
if (objective->CompletionEffect->GameEventId)
@@ -43,7 +43,15 @@ InstanceScenario* ScenarioMgr::CreateInstanceScenarioForTeam(InstanceMap* map, T
auto dbDataItr = _scenarioDBData.find(std::make_pair(map->GetId(), map->GetDifficultyID()));
// No scenario registered for this map and difficulty in the database
if (dbDataItr == _scenarioDBData.end())
{
// Several dungeons can share a map and difficulty, each with its own scenario (Torghast wings and layers)
if (Optional<uint32> lfgDungeonsId = map->GetLfgDungeonsId())
if (LFGDungeonsEntry const* dungeon = sLFGDungeonsStore.LookupEntry(*lfgDungeonsId))
if (dungeon->ScenarioID)
return CreateInstanceScenario(map, dungeon->ScenarioID);
return nullptr;
}
uint32 scenarioID = 0;
switch (team)
+3 -3
View File
@@ -783,7 +783,7 @@ public:
#define SpellHitFn(F) HitHandler(&F)
// example: OnCalcCritChance += SpellOnCalcCritChanceFn(class::function);
// where function is: void function(Unit* victim, float& critChance)
// where function is: void function(Unit const* victim, float& critChance)
HookList<OnCalcCritChanceHandler> OnCalcCritChance;
#define SpellOnCalcCritChanceFn(F) OnCalcCritChanceHandler(&F)
@@ -1712,7 +1712,7 @@ public:
// executed when aura effect calculates amount
// example: DoEffectCalcAmount += AuraEffectCalcAmounFn(class::function, EffectIndexSpecifier, EffectAuraNameSpecifier);
// where function is: void function(AuraEffect* aurEff, int32& amount, bool& canBeRecalculated);
// where function is: void function(AuraEffect const* aurEff, SpellEffectValue& amount, bool& canBeRecalculated);
HookList<EffectCalcAmountHandler> DoEffectCalcAmount;
#define AuraEffectCalcAmountFn(F, I, N) EffectCalcAmountHandler(&F, I, N)
@@ -1730,7 +1730,7 @@ public:
// executed when aura effect calculates crit chance for dots and hots
// example: DoEffectCalcCritChance += AuraEffectCalcCritChanceFn(class::function, EffectIndexSpecifier, EffectAuraNameSpecifier);
// where function is: void function(AuraEffect const* aurEff, Unit* victim, float& critChance);
// where function is: void function(AuraEffect const* aurEff, Unit const* victim, float& critChance);
HookList<EffectCalcCritChanceHandler> DoEffectCalcCritChance;
#define AuraEffectCalcCritChanceFn(F, I, N) EffectCalcCritChanceHandler(&F, I, N)
@@ -416,7 +416,31 @@ private:
ObjectGuid _morlenGUID;
};
// 1254519 - Mark Survivor (Wake of the Darkwell, quest 92520)
// The click spell's only effect is a dummy. Marking a survivor counts as killing it for the player: its own entry,
// its KillCredit entries and its creature labels (label 5590 "Other survivors recovered") give credit. The mages then
// take the survivor away, so it leaves shortly after.
class spell_isle_of_queldanas_mark_survivor : public SpellScript
{
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* player = Object::ToPlayer(GetCaster());
Creature* survivor = GetHitCreature();
if (!player || !survivor)
return;
player->KilledMonster(survivor);
survivor->DespawnOrUnsummon(2s);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_isle_of_queldanas_mark_survivor::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
void AddSC_isle_of_queldanas()
{
RegisterCreatureAI(npc_thalorien_dawnseeker);
RegisterSpellScript(spell_isle_of_queldanas_mark_survivor);
}
+12
View File
@@ -2554,6 +2554,11 @@ class spell_dh_shattered_souls_devourer : public AuraScript
return eventInfo.GetSpellInfo()->IsAffected(SPELLFAMILY_DEMON_HUNTER, { 0x0, 0x0, 0x0, 0x40 });
}
static bool CheckConsumeProc(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo)
{
return eventInfo.GetSpellInfo()->IsAffected(SPELLFAMILY_DEMON_HUNTER, { 0x0, 0x0, 0x0, 0x2 });
}
static void HandleProc(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo)
{
spell_dh_shattered_souls_base_lesser::CreateFragments(eventInfo.GetActionTarget(), eventInfo.GetActor(), 1);
@@ -2583,13 +2588,20 @@ class spell_dh_shattered_souls_devourer : public AuraScript
}
}
static void HandleConsumeProc(AuraScript const&, AuraEffect const* aurEff, ProcEventInfo const& eventInfo)
{
spell_dh_shattered_souls_base_lesser::CreateFragments(eventInfo.GetActionTarget(), eventInfo.GetActor(), aurEff->GetAmountAsInt());
}
void Register() override
{
DoCheckEffectProc += AuraCheckEffectProcFn(spell_dh_shattered_souls_devourer::CheckProc, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckEffectProc += AuraCheckEffectProcFn(spell_dh_shattered_souls_devourer::CheckReapSoulGatheringProc, EFFECT_1, SPELL_AURA_DUMMY);
DoCheckEffectProc += AuraCheckEffectProcFn(spell_dh_shattered_souls_devourer::CheckConsumeProc, EFFECT_2, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_dh_shattered_souls_devourer::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_dh_shattered_souls_devourer::HandleSoulsGathering, EFFECT_1, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_dh_shattered_souls_devourer::HandleProc, EFFECT_2, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_dh_shattered_souls_devourer::HandleConsumeProc, EFFECT_2, SPELL_AURA_DUMMY);
}
};