mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 10:37:06 +00:00
[8579] Really make talent 51685 and ranks work, some cleanups
* Talent have spell family GENERIC, move code to correct case * Not use caster for spells that expected self applied, avoid caster search without need in Aura::PeriodicDummyTick
This commit is contained in:
parent
cedc62bd40
commit
97c54acd92
2 changed files with 239 additions and 245 deletions
|
|
@ -6759,7 +6759,6 @@ void Aura::PeriodicTick()
|
||||||
|
|
||||||
void Aura::PeriodicDummyTick()
|
void Aura::PeriodicDummyTick()
|
||||||
{
|
{
|
||||||
Unit *caster = GetCaster();
|
|
||||||
SpellEntry const* spell = GetSpellProto();
|
SpellEntry const* spell = GetSpellProto();
|
||||||
switch (spell->SpellFamilyName)
|
switch (spell->SpellFamilyName)
|
||||||
{
|
{
|
||||||
|
|
@ -6981,6 +6980,21 @@ void Aura::PeriodicDummyTick()
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// Prey on the Weak
|
||||||
|
if (spell->SpellIconID == 2983)
|
||||||
|
{
|
||||||
|
Unit *target=m_target->getVictim();
|
||||||
|
if (target && (m_target->GetHealth() * 100 / m_target->GetMaxHealth() > target->GetHealth() * 100 / target->GetMaxHealth()))
|
||||||
|
{
|
||||||
|
if(!m_target->HasAura(58670))
|
||||||
|
{
|
||||||
|
int32 basepoints = GetBasePoints();
|
||||||
|
m_target->CastCustomSpell(m_target, 58670, &basepoints, 0, 0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_target->RemoveAurasDueToSpell(58670);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SPELLFAMILY_MAGE:
|
case SPELLFAMILY_MAGE:
|
||||||
{
|
{
|
||||||
|
|
@ -7026,7 +7040,7 @@ void Aura::PeriodicDummyTick()
|
||||||
// Killing Spree
|
// Killing Spree
|
||||||
case 51690:
|
case 51690:
|
||||||
{
|
{
|
||||||
if (caster->hasUnitState(UNIT_STAT_STUNNED) || caster->HasAuraType(SPELL_AURA_MOD_FEAR))
|
if (m_target->hasUnitState(UNIT_STAT_STUNNED) || m_target->HasAuraType(SPELL_AURA_MOD_FEAR))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::list<Unit*> targets;
|
std::list<Unit*> targets;
|
||||||
|
|
@ -7034,20 +7048,20 @@ void Aura::PeriodicDummyTick()
|
||||||
// eff_radius ==0
|
// eff_radius ==0
|
||||||
float radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(spell->rangeIndex));
|
float radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(spell->rangeIndex));
|
||||||
|
|
||||||
CellPair p(MaNGOS::ComputeCellPair(caster->GetPositionX(),caster->GetPositionY()));
|
CellPair p(MaNGOS::ComputeCellPair(m_target->GetPositionX(),m_target->GetPositionY()));
|
||||||
Cell cell(p);
|
Cell cell(p);
|
||||||
cell.data.Part.reserved = ALL_DISTRICT;
|
cell.data.Part.reserved = ALL_DISTRICT;
|
||||||
|
|
||||||
MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck u_check(caster, caster, radius);
|
MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck u_check(m_target, m_target, radius);
|
||||||
MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck> checker(caster,targets, u_check);
|
MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck> checker(m_target, targets, u_check);
|
||||||
|
|
||||||
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
|
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
|
||||||
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
|
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
|
||||||
|
|
||||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||||
|
|
||||||
cell_lock->Visit(cell_lock, grid_object_checker, *caster->GetMap(), *caster, radius);
|
cell_lock->Visit(cell_lock, grid_object_checker, *m_target->GetMap(), *m_target, radius);
|
||||||
cell_lock->Visit(cell_lock, world_object_checker, *caster->GetMap(), *caster, radius);
|
cell_lock->Visit(cell_lock, world_object_checker, *m_target->GetMap(), *m_target, radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(targets.empty())
|
if(targets.empty())
|
||||||
|
|
@ -7057,32 +7071,12 @@ void Aura::PeriodicDummyTick()
|
||||||
std::advance(itr, rand()%targets.size());
|
std::advance(itr, rand()%targets.size());
|
||||||
Unit* target = *itr;
|
Unit* target = *itr;
|
||||||
|
|
||||||
caster->CastSpell(target, 57840, true);
|
m_target->CastSpell(target, 57840, true);
|
||||||
caster->CastSpell(target, 57841, true);
|
m_target->CastSpell(target, 57841, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
// Master of Subtlety
|
break;
|
||||||
// case 31666: break;
|
|
||||||
// Overkill
|
|
||||||
// case 58428: break;
|
|
||||||
// default:
|
|
||||||
// break;
|
|
||||||
}
|
|
||||||
// Prey on the Weak
|
|
||||||
if (spell->SpellIconID == 2983)
|
|
||||||
{
|
|
||||||
Unit *target=caster->getVictim();
|
|
||||||
if (target && (caster->GetHealth() * 100 / caster->GetMaxHealth() > target->GetHealth() * 100 / target->GetMaxHealth()))
|
|
||||||
{
|
|
||||||
if(!caster->HasAura(58670))
|
|
||||||
{
|
|
||||||
int32 basepoints = GetBasePoints();
|
|
||||||
caster->CastCustomSpell(caster, 58670, &basepoints, 0, 0, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
caster->RemoveAurasDueToSpell(58670);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -7131,7 +7125,7 @@ void Aura::PeriodicDummyTick()
|
||||||
// Death and Decay
|
// Death and Decay
|
||||||
if (spell->SpellFamilyFlags & UI64LIT(0x0000000000000020))
|
if (spell->SpellFamilyFlags & UI64LIT(0x0000000000000020))
|
||||||
{
|
{
|
||||||
if (caster)
|
if (Unit *caster = GetCaster())
|
||||||
caster->CastCustomSpell(m_target, 52212, &m_modifier.m_amount, NULL, NULL, true, NULL, this);
|
caster->CastCustomSpell(m_target, 52212, &m_modifier.m_amount, NULL, NULL, true, NULL, this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8578"
|
#define REVISION_NR "8579"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue