Merge pull request #71 from H0zen/develop21

Various fixes - Gnomish Ray.
This commit is contained in:
Antz 2016-02-08 22:06:05 +00:00
commit 2cb1c7fc97
4 changed files with 102 additions and 8 deletions

View File

@ -676,6 +676,16 @@ bool IsExplicitNegativeTarget(uint32 targetA)
bool IsPositiveEffect(SpellEntry const* spellproto, SpellEffectIndex effIndex) bool IsPositiveEffect(SpellEntry const* spellproto, SpellEffectIndex effIndex)
{ {
//fast returns in some special cases
switch (spellproto->Id)
{
case 13003:
case 13010:
return false;
default:
break;
}
switch (spellproto->Effect[effIndex]) switch (spellproto->Effect[effIndex])
{ {
case SPELL_EFFECT_DUMMY: case SPELL_EFFECT_DUMMY:
@ -1994,6 +2004,10 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
if (spellInfo_1->HasAttribute(SPELL_ATTR_PASSIVE) != spellInfo_2->HasAttribute(SPELL_ATTR_PASSIVE)) if (spellInfo_1->HasAttribute(SPELL_ATTR_PASSIVE) != spellInfo_2->HasAttribute(SPELL_ATTR_PASSIVE))
{ return false; } { return false; }
// Gnomish Death Ray
if (spellInfo_1->Id == 13278 || spellInfo_2->Id == 13278)
{ return false; }
// Specific spell family spells // Specific spell family spells
switch (spellInfo_1->SpellFamilyName) switch (spellInfo_1->SpellFamilyName)
{ {

View File

@ -444,7 +444,9 @@ void Spell::FillTargetMap()
{ {
case TARGET_NONE: // Fill Target based on A only case TARGET_NONE: // Fill Target based on A only
// Arcane Missiles have strange targeting for auras // Arcane Missiles have strange targeting for auras
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000800)) // Gnomish Death Ray triggered 13280
if ((m_spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000800)) ||
(m_spellInfo->Id == 13280))
{ {
if (m_caster->GetTypeId() == TYPEID_PLAYER) if (m_caster->GetTypeId() == TYPEID_PLAYER)
if (Unit* target = ObjectAccessor::Instance().GetUnit(*m_caster, ((Player*)m_caster)->GetSelectionGuid())) if (Unit* target = ObjectAccessor::Instance().GetUnit(*m_caster, ((Player*)m_caster)->GetSelectionGuid()))
@ -1183,6 +1185,8 @@ void Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool isReflected)
case 9901: case 9901:
case 8955: case 8955:
case 2908: case 2908:
// Gnomish Mind Control Cap
case 13180:
break; break;
default: default:
{ {
@ -3973,7 +3977,20 @@ void Spell::CastTriggerSpells()
{ {
for (SpellInfoList::const_iterator si = m_TriggerSpells.begin(); si != m_TriggerSpells.end(); ++si) for (SpellInfoList::const_iterator si = m_TriggerSpells.begin(); si != m_TriggerSpells.end(); ++si)
{ {
Spell* spell = new Spell(m_caster, (*si), true, m_originalCasterGUID); bool _triggered = true;
// ignore triggered status for certain spells
switch ((*si)->Id)
{
case 13181: // Gnomish MC cap
case 20578: // Cannibalize healing effect
_triggered = false;
break;
default:
break;
}
Spell* spell = new Spell(m_caster, (*si), _triggered, m_originalCasterGUID);
spell->prepare(&m_targets); // use original spell original targets spell->prepare(&m_targets); // use original spell original targets
} }
} }
@ -4258,6 +4275,10 @@ SpellCastResult Spell::CheckCast(bool strict)
m_caster == target) m_caster == target)
{ return SPELL_FAILED_BAD_TARGETS; } { return SPELL_FAILED_BAD_TARGETS; }
// Gnomish Death Ray self cast forbidden
if (m_spellInfo->Id == 13278 && m_caster == target)
{ return SPELL_FAILED_BAD_TARGETS; }
m_targets.setUnitTarget(target); m_targets.setUnitTarget(target);
} }
} }

View File

@ -4751,11 +4751,6 @@ void Aura::PeriodicTick()
// eating anim // eating anim
target->HandleEmoteCommand(EMOTE_ONESHOT_EAT); target->HandleEmoteCommand(EMOTE_ONESHOT_EAT);
} }
else if (GetId() == 20577)
{
// cannibalize anim
target->HandleEmoteCommand(EMOTE_STATE_CANNIBALIZE);
}
// Anger Management // Anger Management
// amount = 1+ 16 = 17 = 3,4*5 = 10,2*5/3 // amount = 1+ 16 = 17 = 3,4*5 = 10,2*5/3

View File

@ -508,6 +508,70 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
m_caster->CastSpell(unitTarget, spell_id, true, NULL); m_caster->CastSpell(unitTarget, spell_id, true, NULL);
return; return;
} }
case 13006: // Gnomish Shrink Ray
{
if (!unitTarget)
{ return; }
uint32 roll = urand(0,99);
uint32 inner_roll = urand(1,3);
if (roll < 5) // 5% negative backfire
{
switch (inner_roll)
{
case 1:
m_caster->CastSpell(m_caster, 13003, true, m_CastItem); // -250 AP + shrink caster
break;
case 2:
m_caster->CastSpell(m_caster, 13010, true, m_CastItem); // -250AP + shrink all caster's party
break;
default:
unitTarget->CastSpell(unitTarget, 13004, true, NULL); // +250AP + grow victim
break;
}
}
else if (roll < 25) // 20% positive backfire
{ m_caster->CastSpell(m_caster, 13004, true, m_CastItem); } // +250AP + grow caster's party
else
{ m_caster->CastSpell(unitTarget, 13003, true, m_CastItem); } // -250AP + shrink victim
return;
}
case 13180: // Gnomish mind control cap
{
if (!unitTarget)
{ return; }
uint32 roll = urand(0,99);
if (roll < 5) // 5% victim MC the caster (off-like chance unknown)
{ unitTarget->CastSpell(m_caster, 13181, true, NULL); }
else if (roll < 35) // 30% fail (off-like chance unknown)
{ return; }
else // 65% caster MC the victim (off-like chance unknown)
{ AddTriggeredSpell(13181); }
return;
}
case 13278: // Gnomish Death Ray charging
{
if (unitTarget)
{ m_caster->CastSpell(m_caster, 13493, true, NULL); }
return;
}
case 13280: // Gnomish Death Ray ending charge
{
if (unitTarget)
{
uint32 roll = urand(0,7);
int32 dmg[8] = {900, 1200, 1500, 1800, 2100, 2400, 2700, 3000};
m_caster->CastCustomSpell(unitTarget, 13279, &dmg[roll], NULL, NULL, true);
}
return;
}
case 13535: // Tame Beast case 13535: // Tame Beast
{ {
if (!m_originalCaster || m_originalCaster->GetTypeId() != TYPEID_PLAYER) if (!m_originalCaster || m_originalCaster->GetTypeId() != TYPEID_PLAYER)
@ -742,7 +806,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
case 20577: // Cannibalize case 20577: // Cannibalize
{ {
if (unitTarget) if (unitTarget)
{ m_caster->CastSpell(m_caster, 20578, true, NULL); } { AddTriggeredSpell(20578); }
return; return;
} }
case 21147: // Arcane Vacuum case 21147: // Arcane Vacuum