Core/Spells: Fix hunter "Serpent Sting" for 4.3.4
This commit is contained in:
1 parent
dee93dcc5d
commit
7ec31a7a42
1 file changed
+7
-62
@@ -35,9 +35,7 @@ enum HunterSpells
|
||||
SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET = 61669,
|
||||
SPELL_HUNTER_ASPECT_OF_THE_VIPER_ENERGIZE = 34075,
|
||||
SPELL_HUNTER_BESTIAL_WRATH = 19574,
|
||||
SPELL_HUNTER_CHIMERA_SHOT_SERPENT = 53353,
|
||||
SPELL_HUNTER_CHIMERA_SHOT_VIPER = 53358,
|
||||
SPELL_HUNTER_CHIMERA_SHOT_SCORPID = 53359,
|
||||
SPELL_HUNTER_CHIMERA_SHOT_HEAL = 53353,
|
||||
SPELL_HUNTER_GLYPH_OF_ASPECT_OF_THE_VIPER = 56851,
|
||||
SPELL_HUNTER_IMPROVED_MEND_PET = 24406,
|
||||
SPELL_HUNTER_INVIGORATION_TRIGGERED = 53398,
|
||||
@@ -51,6 +49,7 @@ enum HunterSpells
|
||||
SPELL_HUNTER_PET_CARRION_FEEDER_TRIGGERED = 54045,
|
||||
SPELL_HUNTER_RAPID_RECUPERATION = 58883,
|
||||
SPELL_HUNTER_READINESS = 23989,
|
||||
SPELL_HUNTER_SERPENT_STING = 1978,
|
||||
SPELL_HUNTER_SNIPER_TRAINING_R1 = 53302,
|
||||
SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 = 64418,
|
||||
SPELL_HUNTER_STEADY_SHOT_FOCUS = 77443,
|
||||
@@ -163,7 +162,8 @@ class spell_hun_chimera_shot : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_CHIMERA_SHOT_SERPENT) || !sSpellMgr->GetSpellInfo(SPELL_HUNTER_CHIMERA_SHOT_VIPER) || !sSpellMgr->GetSpellInfo(SPELL_HUNTER_CHIMERA_SHOT_SCORPID))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_CHIMERA_SHOT_HEAL) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_HUNTER_SERPENT_STING))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -171,65 +171,10 @@ class spell_hun_chimera_shot : public SpellScriptLoader
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
{
|
||||
uint32 spellId = 0;
|
||||
int32 basePoint = 0;
|
||||
Unit::AuraApplicationMap& Auras = unitTarget->GetAppliedAuras();
|
||||
for (Unit::AuraApplicationMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
|
||||
{
|
||||
Aura* aura = i->second->GetBase();
|
||||
if (aura->GetCasterGUID() != caster->GetGUID())
|
||||
continue;
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_HUNTER_CHIMERA_SHOT_HEAL, true);
|
||||
|
||||
// Search only Serpent Sting, Viper Sting, Scorpid Sting auras
|
||||
flag96 familyFlag = aura->GetSpellInfo()->SpellFamilyFlags;
|
||||
if (!(familyFlag[1] & 0x00000080 || familyFlag[0] & 0x0000C000))
|
||||
continue;
|
||||
if (AuraEffect const* aurEff = aura->GetEffect(0))
|
||||
{
|
||||
// Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
|
||||
if (familyFlag[0] & 0x4000)
|
||||
{
|
||||
int32 TickCount = aurEff->GetTotalTicks();
|
||||
spellId = SPELL_HUNTER_CHIMERA_SHOT_SERPENT;
|
||||
basePoint = caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount());
|
||||
ApplyPct(basePoint, TickCount * 40);
|
||||
basePoint = unitTarget->SpellDamageBonusTaken(caster, aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount());
|
||||
}
|
||||
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
|
||||
else if (familyFlag[1] & 0x00000080)
|
||||
{
|
||||
int32 TickCount = aura->GetEffect(0)->GetTotalTicks();
|
||||
spellId = SPELL_HUNTER_CHIMERA_SHOT_VIPER;
|
||||
|
||||
// Amount of one aura tick
|
||||
basePoint = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount()));
|
||||
int32 casterBasePoint = aurEff->GetAmount() * unitTarget->GetMaxPower(POWER_MANA) / 50; /// @todo WTF? caster uses unitTarget?
|
||||
if (basePoint > casterBasePoint)
|
||||
basePoint = casterBasePoint;
|
||||
ApplyPct(basePoint, TickCount * 60);
|
||||
}
|
||||
// Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
|
||||
else if (familyFlag[0] & 0x00008000)
|
||||
spellId = SPELL_HUNTER_CHIMERA_SHOT_SCORPID;
|
||||
// ?? nothing say in spell desc (possibly need addition check)
|
||||
//if (familyFlag & 0x0000010000000000LL || // dot
|
||||
// familyFlag & 0x0000100000000000LL) // stun
|
||||
//{
|
||||
// spellId = 53366; // 53366 Chimera Shot - Wyvern
|
||||
//}
|
||||
|
||||
// Refresh aura duration
|
||||
aura->RefreshDuration();
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (spellId)
|
||||
caster->CastCustomSpell(unitTarget, spellId, &basePoint, 0, 0, true);
|
||||
if (spellId == SPELL_HUNTER_CHIMERA_SHOT_SCORPID && caster->ToPlayer()) // Scorpid Sting - Add 1 minute cooldown
|
||||
caster->ToPlayer()->AddSpellCooldown(spellId, 0, uint32(time(NULL) + 60));
|
||||
}
|
||||
if (Aura* aur = GetHitUnit()->GetAura(SPELL_HUNTER_SERPENT_STING))
|
||||
aur->SetDuration(aur->GetSpellInfo()->GetMaxDuration(), true);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
|
||||
Reference in new issue
Block a user