mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 22:26:22 +00:00
More hooks for Scripts/Modules (#270)
This commit is contained in:
@@ -680,7 +680,10 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
||||
if (attacker && attacker->IsAIEnabled)
|
||||
attacker->GetAI()->DamageDealt(victim, damage, damagetype);
|
||||
}
|
||||
|
||||
|
||||
// Hook for OnDamage Event
|
||||
sScriptMgr->OnDamage(attacker, victim, damage);
|
||||
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && attacker != victim)
|
||||
{
|
||||
// Signal to pets that their owner was attacked
|
||||
@@ -1181,7 +1184,10 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Script Hook For CalculateSpellDamageTaken -- Allow scripts to change the Damage post class mitigation calculations
|
||||
sScriptMgr->ModifySpellDamageTaken(damageInfo->target, damageInfo->attacker, damage);
|
||||
|
||||
// Calculate absorb resist
|
||||
if (damage > 0)
|
||||
{
|
||||
@@ -1277,7 +1283,10 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
// Add melee damage bonus
|
||||
damage = MeleeDamageBonusDone(damageInfo->target, damage, damageInfo->attackType);
|
||||
damage = damageInfo->target->MeleeDamageBonusTaken(this, damage, damageInfo->attackType);
|
||||
|
||||
|
||||
// Script Hook For CalculateMeleeDamage -- Allow scripts to change the Damage pre class mitigation calculations
|
||||
sScriptMgr->ModifyMeleeDamage(damageInfo->target, damageInfo->attacker, damage);
|
||||
|
||||
// Calculate armor reduction
|
||||
if (IsDamageReducedByArmor((SpellSchoolMask)(damageInfo->damageSchoolMask)))
|
||||
{
|
||||
@@ -9943,7 +9952,10 @@ int32 Unit::DealHeal(Unit* healer, Unit* victim, uint32 addhealth)
|
||||
|
||||
if (addhealth)
|
||||
gain = victim->ModifyHealth(int32(addhealth));
|
||||
|
||||
|
||||
// Hook for OnHeal Event
|
||||
sScriptMgr->OnHeal(healer, victim, (uint32&)gain);
|
||||
|
||||
Unit* unit = healer;
|
||||
|
||||
if (healer && healer->GetTypeId() == TYPEID_UNIT && healer->ToCreature()->IsTotem())
|
||||
@@ -10209,7 +10221,9 @@ int32 Unit::HealBySpell(Unit* victim, SpellInfo const* spellInfo, uint32 addHeal
|
||||
uint32 absorb = 0;
|
||||
// calculate heal absorb and reduce healing
|
||||
CalcHealAbsorb(victim, spellInfo, addHealth, absorb);
|
||||
|
||||
|
||||
sScriptMgr->ModifyHealRecieved(this, victim, addHealth);
|
||||
|
||||
int32 gain = Unit::DealHeal(this, victim, addHealth);
|
||||
SendHealSpellLog(victim, spellInfo->Id, addHealth, uint32(addHealth - gain), absorb, critical);
|
||||
return gain;
|
||||
|
||||
Reference in New Issue
Block a user