Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2025-08-02 11:35:47 +08:00
71 changed files with 996 additions and 732 deletions
+53
View File
@@ -22,6 +22,7 @@
#include "CharacterCache.h"
#include "Chat.h"
#include "CommandScript.h"
#include "Common.h"
#include "GameGraveyard.h"
#include "GameTime.h"
#include "GridNotifiers.h"
@@ -57,6 +58,49 @@
constexpr auto SPELL_STUCK = 7355;
constexpr auto SPELL_FREEZE = 9454;
struct AccountFlagText
{
AccountFlag flag;
std::string text;
};
AccountFlagText const accountFlagText[MAX_ACCOUNT_FLAG] =
{
{ ACCOUNT_FLAG_GM, "ACCOUNT_FLAG_GM" },
{ ACCOUNT_FLAG_NOKICK, "ACCOUNT_FLAG_NOKICK" },
{ ACCOUNT_FLAG_COLLECTOR, "ACCOUNT_FLAG_COLLECTOR" },
{ ACCOUNT_FLAG_TRIAL, "ACCOUNT_FLAG_TRIAL" },
{ ACCOUNT_FLAG_CANCELLED, "ACCOUNT_FLAG_CANCELLED" },
{ ACCOUNT_FLAG_IGR, "ACCOUNT_FLAG_IGR" },
{ ACCOUNT_FLAG_WHOLESALER, "ACCOUNT_FLAG_WHOLESALER" },
{ ACCOUNT_FLAG_PRIVILEGED, "ACCOUNT_FLAG_PRIVILEGED" },
{ ACCOUNT_FLAG_EU_FORBID_ELV, "ACCOUNT_FLAG_EU_FORBID_ELV" },
{ ACCOUNT_FLAG_EU_FORBID_BILLING, "ACCOUNT_FLAG_EU_FORBID_BILLING" },
{ ACCOUNT_FLAG_RESTRICTED, "ACCOUNT_FLAG_RESTRICTED" },
{ ACCOUNT_FLAG_REFERRAL, "ACCOUNT_FLAG_REFERRAL" },
{ ACCOUNT_FLAG_BLIZZARD, "ACCOUNT_FLAG_BLIZZARD" },
{ ACCOUNT_FLAG_RECURRING_BILLING, "ACCOUNT_FLAG_RECURRING_BILLING" },
{ ACCOUNT_FLAG_NOELECTUP, "ACCOUNT_FLAG_NOELECTUP" },
{ ACCOUNT_FLAG_KR_CERTIFICATE, "ACCOUNT_FLAG_KR_CERTIFICATE" },
{ ACCOUNT_FLAG_EXPANSION_COLLECTOR, "ACCOUNT_FLAG_EXPANSION_COLLECTOR" },
{ ACCOUNT_FLAG_DISABLE_VOICE, "ACCOUNT_FLAG_DISABLE_VOICE" },
{ ACCOUNT_FLAG_DISABLE_VOICE_SPEAK, "ACCOUNT_FLAG_DISABLE_VOICE_SPEAK" },
{ ACCOUNT_FLAG_REFERRAL_RESURRECT, "ACCOUNT_FLAG_REFERRAL_RESURRECT" },
{ ACCOUNT_FLAG_EU_FORBID_CC, "ACCOUNT_FLAG_EU_FORBID_CC" },
{ ACCOUNT_FLAG_OPENBETA_DELL, "ACCOUNT_FLAG_OPENBETA_DELL" },
{ ACCOUNT_FLAG_PROPASS, "ACCOUNT_FLAG_PROPASS" },
{ ACCOUNT_FLAG_PROPASS_LOCK, "ACCOUNT_FLAG_PROPASS_LOCK" },
{ ACCOUNT_FLAG_PENDING_UPGRADE, "ACCOUNT_FLAG_PENDING_UPGRADE" },
{ ACCOUNT_FLAG_RETAIL_FROM_TRIAL, "ACCOUNT_FLAG_RETAIL_FROM_TRIAL" },
{ ACCOUNT_FLAG_EXPANSION2_COLLECTOR, "ACCOUNT_FLAG_EXPANSION2_COLLECTOR" },
{ ACCOUNT_FLAG_OVERMIND_LINKED, "ACCOUNT_FLAG_OVERMIND_LINKED" },
{ ACCOUNT_FLAG_DEMOS, "ACCOUNT_FLAG_DEMOS" },
{ ACCOUNT_FLAG_DEATH_KNIGHT_OK, "ACCOUNT_FLAG_DEATH_KNIGHT_OK" },
{ ACCOUNT_FLAG_S2_REQUIRE_IGR, "ACCOUNT_FLAG_S2_REQUIRE_IGR" },
{ ACCOUNT_FLAG_S2_TRIAL, "ACCOUNT_FLAG_S2_TRIAL" },
// { ACCOUNT_FLAG_S2_RESTRICTED, "ACCOUNT_FLAG_S2_RESTRICTED" }
};
std::string const GetLocalizeCreatureName(Creature* creature, LocaleConstant locale)
{
auto creatureTemplate = sObjectMgr->GetCreatureTemplate(creature->GetEntry());
@@ -2193,6 +2237,15 @@ public:
// Output V. LANG_PINFO_ACC_ACCOUNT
handler->PSendSysMessage(LANG_PINFO_ACC_ACCOUNT, userName, accId, security);
if (playerTarget)
{
uint32 accountFlags = playerTarget->GetSession()->GetAccountFlags();
handler->PSendSysMessage(LANG_ACCOUNT_FLAGS_PINFO);
for (uint8 i = 0; i < MAX_ACCOUNT_FLAG; i++)
if (accountFlags & static_cast<uint32>(accountFlagText[i].flag))
handler->PSendSysMessage(LANG_SUBCMDS_LIST_ENTRY, accountFlagText[i].text);
}
// Output VI. LANG_PINFO_ACC_LASTLOGIN
handler->PSendSysMessage(LANG_PINFO_ACC_LASTLOGIN, lastLogin, failedLogins);
@@ -692,6 +692,7 @@ public:
// Start Event
Start(true, false);
SetDespawnAtEnd(false);
SetDespawnAtFar(false);
ScheduleNextEvent(currentEvent, 9000);
break;
@@ -31,14 +31,7 @@ enum Spells
SPELL_REMOVE_MUSHROOM_POWER = 57283,
// Mushroom
SPELL_HEALTHY_MUSHROOM_POTENT_FUNGUS = 56648,
SPELL_POISONOUS_MUSHROOM_POISON_CLOUD = 57061,
SPELL_POISONOUS_MUSHROOM_VISUAL_AURA = 56741,
SPELL_POISONOUS_MUSHROOM_VISUAL_AREA = 61566, // Self
SPELL_HEALTHY_MUSHROOM_VISUAL_AURA = 56740,
SPELL_PUTRID_MUSHROOM = 31690,
SPELL_GROW = 57059,
SPELL_SHRINK = 31691,
SPELL_HEALTHY_MUSHROOM_POTENT_FUNGUS = 56648
};
enum Creatures
@@ -94,13 +87,12 @@ Position const MushroomPositions[MAX_MUSHROOMS_COUNT] =
struct boss_amanitar : public BossAI
{
boss_amanitar(Creature* creature) : BossAI(creature, DATA_AMANITAR), mushroomsSummoned(false) { }
boss_amanitar(Creature* creature) : BossAI(creature, DATA_AMANITAR) { }
void Reset() override
{
_Reset();
_mushroomsDeque.clear();
mushroomsSummoned = false;
}
void JustEngagedWith(Unit* /*attacker*/) override
@@ -110,7 +102,7 @@ struct boss_amanitar : public BossAI
}, 10s, 15s);
ScheduleTimedEvent(10s, 14s, [&] {
DoCastVictim(SPELL_BASH, false);
DoCastVictim(SPELL_BASH);
}, 15s, 20s);
ScheduleTimedEvent(15s, 20s, [&] {
@@ -153,10 +145,10 @@ struct boss_amanitar : public BossAI
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINI);
}
void SummonedCreatureDies(Creature* summon, Unit* killer) override
void SummonedCreatureDespawn(Creature* summon) override
{
_mushroomsDeque.push_back(summon->GetPosition());
BossAI::SummonedCreatureDies(summon, killer);
BossAI::SummonedCreatureDespawn(summon);
}
void EnterEvadeMode(EvadeReason why) override
@@ -167,7 +159,6 @@ struct boss_amanitar : public BossAI
private:
std::deque<Position> _mushroomsDeque;
bool mushroomsSummoned;
void SummonMushroom(Position const& pos)
{
@@ -175,98 +166,6 @@ private:
}
};
struct npc_amanitar_mushrooms : public ScriptedAI
{
npc_amanitar_mushrooms(Creature* pCreature) : ScriptedAI(pCreature)
{
me->SetCombatMovement(false);
//TODO: this prolly needs to be done in database
pCreature->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
pCreature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
pCreature->SetRegeneratingHealth(false);
}
// Disabled events
void JustEngagedWith(Unit* /*who*/) override {}
void AttackStart(Unit* /*victim*/) override {}
void EnterEvadeMode(EvadeReason /*why*/) override {}
void Reset() override
{
me->SetReactState(REACT_PASSIVE);
DoCastSelf(SPELL_PUTRID_MUSHROOM);
if (me->GetEntry() == NPC_POISONOUS_MUSHROOM)
{
DoCastSelf(SPELL_POISONOUS_MUSHROOM_VISUAL_AURA, true);
}
else
{
DoCastSelf(SPELL_HEALTHY_MUSHROOM_VISUAL_AURA, true);
}
events.ScheduleEvent(EVENT_GROW, 800ms);
if (me->GetEntry() == NPC_POISONOUS_MUSHROOM)
{
events.ScheduleEvent(EVENT_CHECK_PLAYER, 250ms);
}
}
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/) override
{
if (me->GetEntry() == NPC_HEALTHY_MUSHROOM && damage >= me->GetHealth())
{
DoCastSelf(SPELL_HEALTHY_MUSHROOM_POTENT_FUNGUS, true);
}
}
void UpdateAI(uint32 diff) override
{
if (events.Empty())
return;
events.Update(diff);
while (uint32 const eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_GROW:
{
DoCastSelf(SPELL_GROW);
break;
}
case EVENT_CHECK_PLAYER:
{
if (Player* plr = me->SelectNearestPlayer(2.0f))
{
plr->RemoveAurasDueToSpell(SPELL_HEALTHY_MUSHROOM_POTENT_FUNGUS);
DoCastSelf(SPELL_POISONOUS_MUSHROOM_VISUAL_AREA);
DoCastSelf(SPELL_POISONOUS_MUSHROOM_POISON_CLOUD);
DoCastSelf(SPELL_SHRINK);
events.ScheduleEvent(EVENT_KILLSELF, 4s);
}
else
{
events.Repeat(250ms);
}
break;
}
case EVENT_KILLSELF:
{
me->DisappearAndDie();
break;
}
}
}
}
private:
EventMap events;
};
// 57283 Remove Mushroom Power
class spell_amanitar_remove_mushroom_power : public AuraScript
{
@@ -274,8 +173,7 @@ class spell_amanitar_remove_mushroom_power : public AuraScript
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* target = GetTarget())
target->RemoveAurasDueToSpell(SPELL_HEALTHY_MUSHROOM_POTENT_FUNGUS);
GetTarget()->RemoveAurasDueToSpell(SPELL_HEALTHY_MUSHROOM_POTENT_FUNGUS);
}
void Register() override
@@ -287,8 +185,5 @@ class spell_amanitar_remove_mushroom_power : public AuraScript
void AddSC_boss_amanitar()
{
RegisterAhnKahetCreatureAI(boss_amanitar);
RegisterAhnKahetCreatureAI(npc_amanitar_mushrooms);
// Spells
RegisterSpellScript(spell_amanitar_remove_mushroom_power);
}
@@ -56,6 +56,8 @@ enum Misc
MAX_EMBRACE_DMG_H = 40000,
SUMMON_GROUP_TRIGGERS = 0,
GROUP_COMBAT_ABILITIES = 1,
};
enum Actions
@@ -64,15 +66,6 @@ enum Actions
ACTION_SPHERE,
};
enum Event
{
EVENT_PRINCE_FLAME_SPHERES = 1,
EVENT_PRINCE_VANISH,
EVENT_PRINCE_BLOODTHIRST,
EVENT_PRINCE_VANISH_RUN,
EVENT_PRINCE_RESCHEDULE,
};
enum Yells
{
//SAY_SPHERE_ACTIVATED = 0,
@@ -178,9 +171,12 @@ private:
struct boss_taldaram : public BossAI
{
boss_taldaram(Creature* pCreature) : BossAI(pCreature, DATA_PRINCE_TALDARAM),
vanishDamage(0)
boss_taldaram(Creature* pCreature) : BossAI(pCreature, DATA_PRINCE_TALDARAM), vanishDamage(0)
{
scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
}
void InitializeAI() override
@@ -193,19 +189,16 @@ struct boss_taldaram : public BossAI
me->SetImmuneToAll(true);
me->SetDisableGravity(true);
me->SetHover(true);
if (!me->HasAura(SPELL_BEAM_VISUAL))
{
DoCastSelf(SPELL_BEAM_VISUAL, true);
}
me->SummonCreatureGroup(SUMMON_GROUP_TRIGGERS);
return;
}
if (instance->GetPersistentData(DATA_TELDRAM_SPHERE1) == DONE && instance->GetPersistentData(DATA_TELDRAM_SPHERE2) == DONE)
{
DoAction(ACTION_REMOVE_PRISON_AT_RESET);
}
}
void Reset() override
@@ -213,7 +206,45 @@ struct boss_taldaram : public BossAI
_Reset();
vanishDamage = 0;
vanishTarget_GUID.Clear();
me->SetReactState(REACT_AGGRESSIVE);
ScheduleHealthCheckEvent({ 75, 50, 25 }, [&] {
scheduler.Schedule(1s, [this](TaskContext)
{
Talk(SAY_VANISH);
DoCastSelf(SPELL_VANISH);
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->Clear();
DoStopAttack();
scheduler.CancelGroup(GROUP_COMBAT_ABILITIES);
});
});
}
void OnAuraRemove(AuraApplication* auraApp, AuraRemoveMode mode) override
{
if (auraApp->GetBase()->GetId() == SPELL_VANISH && mode == AURA_REMOVE_BY_EXPIRE)
{
scheduler.Schedule(2500ms, [this](TaskContext)
{
if (Unit* vanishTarget = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
{
vanishDamage = 0;
DoCast(vanishTarget, SPELL_SHADOWSTEP);
DoCast(vanishTarget, SPELL_EMBRACE_OF_THE_VAMPYR);
}
me->m_Events.AddEventAtOffset([&] {
if (!scheduler.IsGroupScheduled(GROUP_COMBAT_ABILITIES))
{
ScheduleCombatEvents();
me->SetReactState(REACT_AGGRESSIVE);
me->ResumeChasingVictim();
}
}, 20s);
});
}
}
void DoAction(int32 action) override
@@ -256,20 +287,20 @@ struct boss_taldaram : public BossAI
}
}
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellSchoolMask /*school*/) override
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damageType, SpellSchoolMask school) override
{
if (vanishTarget_GUID)
BossAI::DamageTaken(attacker, damage, damageType, school);
if (me->FindCurrentSpellBySpellId(SPELL_EMBRACE_OF_THE_VAMPYR))
{
if (me->FindCurrentSpellBySpellId(SPELL_EMBRACE_OF_THE_VAMPYR))
vanishDamage += damage;
if (vanishDamage >= DUNGEON_MODE<uint32>(MAX_EMBRACE_DMG, MAX_EMBRACE_DMG_H))
{
vanishDamage += damage;
if (vanishDamage >= DUNGEON_MODE<uint32>(MAX_EMBRACE_DMG, MAX_EMBRACE_DMG_H))
{
ScheduleCombatEvents();
me->CastStop();
vanishTarget_GUID.Clear();
vanishDamage = 0;
}
ScheduleCombatEvents();
me->CastStop();
me->ResumeChasingVictim();
me->SetReactState(REACT_AGGRESSIVE);
vanishDamage = 0;
}
}
}
@@ -283,17 +314,9 @@ struct boss_taldaram : public BossAI
void KilledUnit(Unit* victim) override
{
if (!victim->IsPlayer())
{
return;
}
Talk(SAY_SLAY);
if (vanishTarget_GUID && victim->GetGUID() == vanishTarget_GUID)
{
vanishTarget_GUID.Clear();
vanishDamage = 0;
}
}
void JustEngagedWith(Unit* /*who*/) override
@@ -309,9 +332,7 @@ struct boss_taldaram : public BossAI
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_CONJURE_FLAME_SPHERE)
{
summons.DoAction(ACTION_SPHERE);
}
}
void JustSummoned(Creature* summon) override
@@ -324,9 +345,7 @@ struct boss_taldaram : public BossAI
case NPC_FLAME_SPHERE_3:
{
if (npc_taldaram_flamesphere* summonAI = dynamic_cast<npc_taldaram_flamesphere*>(summon->AI()))
{
summonAI->SetVictimPos(victimSperePos);
}
break;
}
@@ -338,130 +357,27 @@ struct boss_taldaram : public BossAI
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
{
return;
}
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
{
return;
}
while (uint32 const eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_PRINCE_BLOODTHIRST:
{
DoCastVictim(SPELL_BLOODTHIRST);
events.Repeat(10s);
break;
}
case EVENT_PRINCE_FLAME_SPHERES:
{
if (Unit* victim = me->GetVictim())
{
DoCast(victim, SPELL_CONJURE_FLAME_SPHERE);
victimSperePos = victim->GetPosition();
}
if (!events.GetNextEventTime(EVENT_PRINCE_VANISH))
{
events.RescheduleEvent(EVENT_PRINCE_VANISH, 14s);
}
else
{
// Make sure that Vanish won't get triggered at same time as sphere summon
events.DelayEvents(4s);
}
events.Repeat(15s);
break;
}
case EVENT_PRINCE_VANISH:
{
//Count alive players
uint8 count = 0;
std::list<HostileReference*> const t_list = me->GetThreatMgr().GetThreatList();
if (!t_list.empty())
{
for (HostileReference const* reference : t_list)
{
if (reference)
{
Unit const* pTarget = ObjectAccessor::GetUnit(*me, reference->getUnitGuid());
if (pTarget && pTarget->IsPlayer() && pTarget->IsAlive())
{
++count;
}
}
}
}
// He only vanishes if there are 3 or more alive players
if (count > 2)
{
Talk(SAY_VANISH);
DoCastSelf(SPELL_VANISH, false);
if (Unit* pEmbraceTarget = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
{
vanishTarget_GUID = pEmbraceTarget->GetGUID();
}
events.CancelEvent(EVENT_PRINCE_FLAME_SPHERES);
events.CancelEvent(EVENT_PRINCE_BLOODTHIRST);
events.ScheduleEvent(EVENT_PRINCE_VANISH_RUN, 2499ms);
}
break;
}
case EVENT_PRINCE_VANISH_RUN:
{
if (Unit* _vanishTarget = ObjectAccessor::GetUnit(*me, vanishTarget_GUID))
{
vanishDamage = 0;
DoCast(_vanishTarget, SPELL_SHADOWSTEP);
me->CastSpell(_vanishTarget, SPELL_EMBRACE_OF_THE_VAMPYR, false);
me->RemoveAura(SPELL_VANISH);
}
events.ScheduleEvent(EVENT_PRINCE_RESCHEDULE, 20s);
break;
}
case EVENT_PRINCE_RESCHEDULE:
{
ScheduleCombatEvents();
break;
}
}
if (me->HasUnitState(UNIT_STATE_CASTING))
{
return;
}
}
if (me->IsVisible())
{
DoMeleeAttackIfReady();
}
}
private:
Position victimSperePos;
ObjectGuid vanishTarget_GUID;
uint32 vanishDamage;
void ScheduleCombatEvents()
{
events.Reset();
events.RescheduleEvent(EVENT_PRINCE_FLAME_SPHERES, 10s);
events.RescheduleEvent(EVENT_PRINCE_BLOODTHIRST, 10s);
vanishTarget_GUID.Clear();
scheduler.Schedule(10s, GROUP_COMBAT_ABILITIES, [this](TaskContext context)
{
DoCastVictim(SPELL_BLOODTHIRST);
context.Repeat(15s);
}).Schedule(10s, GROUP_COMBAT_ABILITIES, [this](TaskContext context)
{
if (Unit* victim = me->GetVictim())
{
DoCast(victim, SPELL_CONJURE_FLAME_SPHERE);
victimSperePos = victim->GetPosition();
}
context.Repeat(15s);
});
vanishDamage = 0;
}
};
+31 -37
View File
@@ -74,6 +74,9 @@ enum DeathKnightSpells
SPELL_DK_UNHOLY_PRESENCE_TRIGGERED = 49772,
SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189,
SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284,
SPELL_DK_ICY_TALONS_TALENT_R1 = 50880,
SPELL_DK_CRYPT_FEVER_R1 = 50508,
SPELL_DK_EBON_PLAGUE_R1 = 51726,
// Risen Ally
SPELL_DK_RAISE_ALLY = 46619,
SPELL_DK_THRASH = 47480,
@@ -342,7 +345,7 @@ class spell_dk_death_and_decay_aura : public AuraScript
if (GetCaster() && GetTarget())
{
int32 basePoints0 = aurEff->GetAmount();
GetCaster()->CastCustomSpell(GetTarget(), SPELL_DK_DEATH_AND_DECAY_TRIGGER, &basePoints0, nullptr, nullptr, true, 0, aurEff);
GetCaster()->CastCustomSpell(GetTarget(), SPELL_DK_DEATH_AND_DECAY_TRIGGER, &basePoints0, nullptr, nullptr, false, 0, aurEff);
}
}
@@ -1746,7 +1749,8 @@ class spell_dk_pestilence : public SpellScript
{
SPELL_DK_GLYPH_OF_DISEASE,
SPELL_DK_BLOOD_PLAGUE,
SPELL_DK_FROST_FEVER
SPELL_DK_FROST_FEVER,
SPELL_DK_ICY_TALONS_TALENT_R1
});
}
@@ -1758,46 +1762,36 @@ class spell_dk_pestilence : public SpellScript
if (!target)
return;
if (target != hitUnit || caster->GetAura(SPELL_DK_GLYPH_OF_DISEASE))
// Spread on others
if (target != hitUnit)
{
// xinef: checked in target selection
//if (!m_targets.GetUnitTarget()->IsWithinLOSInMap(unitTarget))
// return;
// And spread them on target
// Blood Plague
if (Aura* disOld = target->GetAura(SPELL_DK_BLOOD_PLAGUE, caster->GetGUID()))
if (AuraEffect* effOld = disOld->GetEffect(EFFECT_0))
{
float pctMods = effOld->GetPctMods();
float crit = effOld->GetCritChance();
caster->CastSpell(hitUnit, SPELL_DK_BLOOD_PLAGUE, true);
if (Aura* disNew = hitUnit->GetAura(SPELL_DK_BLOOD_PLAGUE, caster->GetGUID()))
if (AuraEffect* effNew = disNew->GetEffect(EFFECT_0))
{
effNew->SetPctMods(pctMods);
effNew->SetCritChance(crit);
effNew->SetAmount(effNew->CalculateAmount(effNew->GetCaster()));
}
}
if (target->GetAura(SPELL_DK_BLOOD_PLAGUE, caster->GetGUID()))
caster->CastSpell(hitUnit, SPELL_DK_BLOOD_PLAGUE, true);
// Frost Fever
if (Aura* disOld = target->GetAura(SPELL_DK_FROST_FEVER, caster->GetGUID()))
if (AuraEffect* effOld = disOld->GetEffect(EFFECT_0))
{
float pctMods = effOld->GetPctMods();
float crit = effOld->GetCritChance();
caster->CastSpell(hitUnit, SPELL_DK_FROST_FEVER, true);
if (target->GetAura(SPELL_DK_FROST_FEVER, caster->GetGUID()))
caster->CastSpell(hitUnit, SPELL_DK_FROST_FEVER, true);
}
// Refresh on target
else if (caster->GetAura(SPELL_DK_GLYPH_OF_DISEASE))
{
// Blood Plague
if (Aura* disease = target->GetAura(SPELL_DK_BLOOD_PLAGUE, caster->GetGUID()))
disease->RefreshDuration();
if (Aura* disNew = hitUnit->GetAura(SPELL_DK_FROST_FEVER, caster->GetGUID()))
if (AuraEffect* effNew = disNew->GetEffect(EFFECT_0))
{
effNew->SetPctMods(pctMods);
effNew->SetCritChance(crit);
effNew->SetAmount(effNew->CalculateAmount(effNew->GetCaster()));
}
}
// Frost Fever
if (Aura* disease = target->GetAura(SPELL_DK_FROST_FEVER, caster->GetGUID()))
{
disease->RefreshDuration();
if (Aura const* talons = caster->GetAuraOfRankedSpell(SPELL_DK_ICY_TALONS_TALENT_R1))
caster->CastSpell(caster, talons->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, true);
}
if (Aura* disease = target->GetAuraOfRankedSpell(SPELL_DK_EBON_PLAGUE_R1, caster->GetGUID()))
disease->RefreshDuration();
else if (Aura* disease = target->GetAuraOfRankedSpell(SPELL_DK_CRYPT_FEVER_R1, caster->GetGUID()))
disease->RefreshDuration();
}
}
+56
View File
@@ -60,6 +60,7 @@ enum DruidSpells
SPELL_DRUID_ENRAGE = 5229,
SPELL_DRUID_ENRAGED_DEFENSE = 70725,
SPELL_DRUID_ITEM_T10_FERAL_4P_BONUS = 70726,
SPELL_DRUID_MOONGLADE_2P_BONUS = 37286
};
enum DruidIcons
@@ -1194,6 +1195,60 @@ class spell_dru_moonkin_form_passive_proc : public AuraScript
}
};
// -774 - Rejuvenation
class spell_dru_rejuvenation_moonglade_2_set : public AuraScript
{
PrepareAuraScript(spell_dru_rejuvenation_moonglade_2_set);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_MOONGLADE_2P_BONUS });
}
bool Load() override
{
_casterGUID.Clear();
return true;
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Player* caster = ObjectAccessor::FindPlayer(GetCasterGUID()))
if (caster->HasAura(SPELL_DRUID_MOONGLADE_2P_BONUS))
{
Player* target = GetTarget()->ToPlayer();
if (!target)
return;
_casterGUID = GetCasterGUID();
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DRUID_MOONGLADE_2P_BONUS);
target->ApplyRatingMod(CR_DODGE, spellInfo->Effects[EFFECT_0].CalcValue(), true); // 35 rating
}
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (_casterGUID)
{
Player* target = GetTarget()->ToPlayer();
if (!target)
return;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DRUID_MOONGLADE_2P_BONUS);
target->ApplyRatingMod(CR_DODGE, spellInfo->Effects[EFFECT_0].CalcValue(), false); // 35 rating
}
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_dru_rejuvenation_moonglade_2_set::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_rejuvenation_moonglade_2_set::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
}
private:
ObjectGuid _casterGUID;
};
void AddSC_druid_spell_scripts()
{
RegisterSpellScript(spell_dru_bear_form_passive);
@@ -1229,4 +1284,5 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_t10_restoration_4p_bonus);
RegisterSpellScript(spell_dru_wild_growth);
RegisterSpellScript(spell_dru_moonkin_form_passive_proc);
RegisterSpellScript(spell_dru_rejuvenation_moonglade_2_set);
}
+1 -1
View File
@@ -910,7 +910,7 @@ class spell_warr_heroic_strike : public SpellScript
Unit* target = GetHitUnit();
if (!target)
return;
std::list<AuraEffect*> AuraEffectList = target->GetAuraEffectsByType(SPELL_AURA_MOD_DECREASE_SPEED);
Unit::AuraEffectList const& AuraEffectList = target->GetAuraEffectsByType(SPELL_AURA_MOD_DECREASE_SPEED);
bool bonusDamage = false;
for (AuraEffect* eff : AuraEffectList)
{