mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[6980] Add some fixes to trigger system
Allow proc from every kill Fix (and remove hack) priest 32379 and rank (backfire damage after 1 sec) Remove not need stack overflow protection Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
12753049d1
commit
a1494d29dc
7 changed files with 28 additions and 36 deletions
|
|
@ -559,10 +559,8 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||
// call kill spell proc event (before real die and combat stop to triggering auras removed at death/combat stop)
|
||||
if(player && player!=pVictim)
|
||||
{
|
||||
if(player->RewardPlayerAndGroupAtKill(pVictim))
|
||||
player->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL_AND_GET_XP, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
|
||||
else
|
||||
player->ProcDamageAndSpell(pVictim, PROC_FLAG_NONE, PROC_FLAG_KILLED,PROC_EX_NONE, 0);
|
||||
player->RewardPlayerAndGroupAtKill(pVictim);
|
||||
player->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
|
||||
}
|
||||
|
||||
DEBUG_LOG("DealDamageAttackStop");
|
||||
|
|
@ -9582,6 +9580,7 @@ bool InitTriggerAuraData()
|
|||
isTriggerAura[i]=false;
|
||||
isNonTriggerAura[i] = false;
|
||||
}
|
||||
isTriggerAura[SPELL_AURA_PERIODIC_DAMAGE] = true;
|
||||
isTriggerAura[SPELL_AURA_DUMMY] = true;
|
||||
isTriggerAura[SPELL_AURA_MOD_CONFUSE] = true;
|
||||
isTriggerAura[SPELL_AURA_MOD_THREAT] = true;
|
||||
|
|
@ -9655,18 +9654,8 @@ uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missC
|
|||
return procEx;
|
||||
}
|
||||
|
||||
static int deep = 0;
|
||||
void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage )
|
||||
{
|
||||
deep ++;
|
||||
if (deep > 5)
|
||||
{
|
||||
sLog.outError("Prevent possible stack owerflow in Unit::ProcDamageAndSpellFor");
|
||||
if (procSpell)
|
||||
sLog.outError(" Spell %u", procSpell->Id);
|
||||
deep--;
|
||||
return;
|
||||
}
|
||||
// For melee/ranged based attack need update skills and set some Aura states
|
||||
if (procFlag & MELEE_BASED_TRIGGER_MASK)
|
||||
{
|
||||
|
|
@ -9750,7 +9739,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
|||
for(AuraMap::const_iterator itr = GetAuras().begin(); itr!= GetAuras().end(); ++itr)
|
||||
{
|
||||
SpellProcEventEntry const* spellProcEvent = NULL;
|
||||
if(!IsTriggeredAtSpellProcEvent(itr->second, procSpell, procFlag, procExtra, attType, isVictim, (damage > 0), spellProcEvent))
|
||||
if(!IsTriggeredAtSpellProcEvent(pTarget, itr->second, procSpell, procFlag, procExtra, attType, isVictim, (damage > 0), spellProcEvent))
|
||||
continue;
|
||||
|
||||
procTriggered.push_back( ProcTriggeredData(spellProcEvent, itr->second) );
|
||||
|
|
@ -9928,7 +9917,6 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
|||
for(RemoveSpellList::const_iterator i = removedSpells.begin(); i != removedSpells.end();i++)
|
||||
RemoveAurasDueToSpell(*i);
|
||||
}
|
||||
deep--;
|
||||
}
|
||||
|
||||
SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const
|
||||
|
|
@ -10547,7 +10535,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
|
|||
return pet;
|
||||
}
|
||||
|
||||
bool Unit::IsTriggeredAtSpellProcEvent(Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent )
|
||||
bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent )
|
||||
{
|
||||
SpellEntry const* spellProto = aura->GetSpellProto ();
|
||||
|
||||
|
|
@ -10577,7 +10565,17 @@ bool Unit::IsTriggeredAtSpellProcEvent(Aura* aura, SpellEntry const* procSpell,
|
|||
if(!SpellMgr::IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active))
|
||||
return false;
|
||||
|
||||
// Aura added by spell can`t trogger from self (prevent drop cahres/do triggers)
|
||||
// In most cases req get honor or XP from kill
|
||||
if (EventProcFlag & PROC_FLAG_KILL && GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
bool allow = ((Player*)this)->isHonorOrXPTarget(pVictim);
|
||||
// Shadow Word: Death - can trigger from every kill
|
||||
if (aura->GetId() == 32409)
|
||||
allow = true;
|
||||
if (!allow)
|
||||
return false;
|
||||
}
|
||||
// Aura added by spell can`t trogger from self (prevent drop charges/do triggers)
|
||||
// But except periodic triggers (can triggered from self)
|
||||
if(procSpell && procSpell->Id == spellProto->Id && !(spellProto->procFlags&PROC_FLAG_ON_TAKE_PERIODIC))
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue