mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[10010] Use schoolmask enum in struct SpellNonMeleeDamage, some indents fix.
This commit is contained in:
parent
b23fd66aa6
commit
59cf9c1dbd
5 changed files with 52 additions and 52 deletions
|
|
@ -7562,7 +7562,7 @@ void Aura::PeriodicTick()
|
||||||
|
|
||||||
SpellEntry const* spellProto = GetSpellProto();
|
SpellEntry const* spellProto = GetSpellProto();
|
||||||
// maybe has to be sent different to client, but not by SMSG_PERIODICAURALOG
|
// maybe has to be sent different to client, but not by SMSG_PERIODICAURALOG
|
||||||
SpellNonMeleeDamage damageInfo(pCaster, m_target, spellProto->Id, spellProto->SchoolMask);
|
SpellNonMeleeDamage damageInfo(pCaster, m_target, spellProto->Id, SpellSchoolMask(spellProto->SchoolMask));
|
||||||
pCaster->CalculateSpellDamage(&damageInfo, gain, spellProto);
|
pCaster->CalculateSpellDamage(&damageInfo, gain, spellProto);
|
||||||
|
|
||||||
damageInfo.target->CalculateAbsorbResistBlock(pCaster, &damageInfo, spellProto);
|
damageInfo.target->CalculateAbsorbResistBlock(pCaster, &damageInfo, spellProto);
|
||||||
|
|
|
||||||
|
|
@ -454,43 +454,43 @@ SpellEntry const* GetSpellEntryByDifficulty(uint32 id, Difficulty difficulty);
|
||||||
// Spell proc event related declarations (accessed using SpellMgr functions)
|
// Spell proc event related declarations (accessed using SpellMgr functions)
|
||||||
enum ProcFlags
|
enum ProcFlags
|
||||||
{
|
{
|
||||||
PROC_FLAG_NONE = 0x00000000,
|
PROC_FLAG_NONE = 0x00000000,
|
||||||
|
|
||||||
PROC_FLAG_KILLED = 0x00000001, // 00 Killed by agressor
|
PROC_FLAG_KILLED = 0x00000001, // 00 Killed by aggressor
|
||||||
PROC_FLAG_KILL = 0x00000002, // 01 Kill target (in most cases need XP/Honor reward)
|
PROC_FLAG_KILL = 0x00000002, // 01 Kill target (in most cases need XP/Honor reward)
|
||||||
|
|
||||||
PROC_FLAG_SUCCESSFUL_MELEE_HIT = 0x00000004, // 02 Successful melee auto attack
|
PROC_FLAG_SUCCESSFUL_MELEE_HIT = 0x00000004, // 02 Successful melee auto attack
|
||||||
PROC_FLAG_TAKEN_MELEE_HIT = 0x00000008, // 03 Taken damage from melee auto attack hit
|
PROC_FLAG_TAKEN_MELEE_HIT = 0x00000008, // 03 Taken damage from melee auto attack hit
|
||||||
|
|
||||||
PROC_FLAG_SUCCESSFUL_MELEE_SPELL_HIT = 0x00000010, // 04 Successful attack by Spell that use melee weapon
|
PROC_FLAG_SUCCESSFUL_MELEE_SPELL_HIT = 0x00000010, // 04 Successful attack by Spell that use melee weapon
|
||||||
PROC_FLAG_TAKEN_MELEE_SPELL_HIT = 0x00000020, // 05 Taken damage by Spell that use melee weapon
|
PROC_FLAG_TAKEN_MELEE_SPELL_HIT = 0x00000020, // 05 Taken damage by Spell that use melee weapon
|
||||||
|
|
||||||
PROC_FLAG_SUCCESSFUL_RANGED_HIT = 0x00000040, // 06 Successful Ranged auto attack
|
PROC_FLAG_SUCCESSFUL_RANGED_HIT = 0x00000040, // 06 Successful Ranged auto attack
|
||||||
PROC_FLAG_TAKEN_RANGED_HIT = 0x00000080, // 07 Taken damage from ranged auto attack
|
PROC_FLAG_TAKEN_RANGED_HIT = 0x00000080, // 07 Taken damage from ranged auto attack
|
||||||
|
|
||||||
PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT = 0x00000100, // 08 Successful Ranged attack by Spell that use ranged weapon
|
PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT = 0x00000100, // 08 Successful Ranged attack by Spell that use ranged weapon
|
||||||
PROC_FLAG_TAKEN_RANGED_SPELL_HIT = 0x00000200, // 09 Taken damage by Spell that use ranged weapon
|
PROC_FLAG_TAKEN_RANGED_SPELL_HIT = 0x00000200, // 09 Taken damage by Spell that use ranged weapon
|
||||||
|
|
||||||
PROC_FLAG_SUCCESSFUL_POSITIVE_AOE_HIT = 0x00000400, // 10 Successful AoE (not 100% shure unused)
|
PROC_FLAG_SUCCESSFUL_POSITIVE_AOE_HIT = 0x00000400, // 10 Successful AoE (not 100% shure unused)
|
||||||
PROC_FLAG_TAKEN_POSITIVE_AOE = 0x00000800, // 11 Taken AoE (not 100% shure unused)
|
PROC_FLAG_TAKEN_POSITIVE_AOE = 0x00000800, // 11 Taken AoE (not 100% shure unused)
|
||||||
|
|
||||||
PROC_FLAG_SUCCESSFUL_AOE_SPELL_HIT = 0x00001000, // 12 Successful AoE damage spell hit (not 100% shure unused)
|
PROC_FLAG_SUCCESSFUL_AOE_SPELL_HIT = 0x00001000, // 12 Successful AoE damage spell hit (not 100% shure unused)
|
||||||
PROC_FLAG_TAKEN_AOE_SPELL_HIT = 0x00002000, // 13 Taken AoE damage spell hit (not 100% shure unused)
|
PROC_FLAG_TAKEN_AOE_SPELL_HIT = 0x00002000, // 13 Taken AoE damage spell hit (not 100% shure unused)
|
||||||
|
|
||||||
PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL = 0x00004000, // 14 Successful cast positive spell (by default only on healing)
|
PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL = 0x00004000, // 14 Successful cast positive spell (by default only on healing)
|
||||||
PROC_FLAG_TAKEN_POSITIVE_SPELL = 0x00008000, // 15 Taken positive spell hit (by default only on healing)
|
PROC_FLAG_TAKEN_POSITIVE_SPELL = 0x00008000, // 15 Taken positive spell hit (by default only on healing)
|
||||||
|
|
||||||
PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT = 0x00010000, // 16 Successful negative spell cast (by default only on damage)
|
PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT = 0x00010000, // 16 Successful negative spell cast (by default only on damage)
|
||||||
PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT = 0x00020000, // 17 Taken negative spell (by default only on damage)
|
PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT = 0x00020000, // 17 Taken negative spell (by default only on damage)
|
||||||
|
|
||||||
PROC_FLAG_ON_DO_PERIODIC = 0x00040000, // 18 Successful do periodic (damage / healing, determined from 14-17 flags)
|
PROC_FLAG_ON_DO_PERIODIC = 0x00040000, // 18 Successful do periodic (damage / healing, determined from 14-17 flags)
|
||||||
PROC_FLAG_ON_TAKE_PERIODIC = 0x00080000, // 19 Taken spell periodic (damage / healing, determined from 14-17 flags)
|
PROC_FLAG_ON_TAKE_PERIODIC = 0x00080000, // 19 Taken spell periodic (damage / healing, determined from 14-17 flags)
|
||||||
|
|
||||||
PROC_FLAG_TAKEN_ANY_DAMAGE = 0x00100000, // 20 Taken any damage
|
PROC_FLAG_TAKEN_ANY_DAMAGE = 0x00100000, // 20 Taken any damage
|
||||||
PROC_FLAG_ON_TRAP_ACTIVATION = 0x00200000, // 21 On trap activation
|
PROC_FLAG_ON_TRAP_ACTIVATION = 0x00200000, // 21 On trap activation
|
||||||
|
|
||||||
PROC_FLAG_TAKEN_OFFHAND_HIT = 0x00400000, // 22 Taken off-hand melee attacks(not used)
|
PROC_FLAG_TAKEN_OFFHAND_HIT = 0x00400000, // 22 Taken off-hand melee attacks(not used)
|
||||||
PROC_FLAG_SUCCESSFUL_OFFHAND_HIT = 0x00800000 // 23 Successful off-hand melee attacks
|
PROC_FLAG_SUCCESSFUL_OFFHAND_HIT = 0x00800000 // 23 Successful off-hand melee attacks
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MELEE_BASED_TRIGGER_MASK (PROC_FLAG_SUCCESSFUL_MELEE_HIT | \
|
#define MELEE_BASED_TRIGGER_MASK (PROC_FLAG_SUCCESSFUL_MELEE_HIT | \
|
||||||
|
|
@ -510,25 +510,25 @@ enum ProcFlags
|
||||||
|
|
||||||
enum ProcFlagsEx
|
enum ProcFlagsEx
|
||||||
{
|
{
|
||||||
PROC_EX_NONE = 0x0000000, // If none can tigger on Hit/Crit only (passive spells MUST defined by SpellFamily flag)
|
PROC_EX_NONE = 0x0000000, // If none can tigger on Hit/Crit only (passive spells MUST defined by SpellFamily flag)
|
||||||
PROC_EX_NORMAL_HIT = 0x0000001, // If set only from normal hit (only damage spells)
|
PROC_EX_NORMAL_HIT = 0x0000001, // If set only from normal hit (only damage spells)
|
||||||
PROC_EX_CRITICAL_HIT = 0x0000002,
|
PROC_EX_CRITICAL_HIT = 0x0000002,
|
||||||
PROC_EX_MISS = 0x0000004,
|
PROC_EX_MISS = 0x0000004,
|
||||||
PROC_EX_RESIST = 0x0000008,
|
PROC_EX_RESIST = 0x0000008,
|
||||||
PROC_EX_DODGE = 0x0000010,
|
PROC_EX_DODGE = 0x0000010,
|
||||||
PROC_EX_PARRY = 0x0000020,
|
PROC_EX_PARRY = 0x0000020,
|
||||||
PROC_EX_BLOCK = 0x0000040,
|
PROC_EX_BLOCK = 0x0000040,
|
||||||
PROC_EX_EVADE = 0x0000080,
|
PROC_EX_EVADE = 0x0000080,
|
||||||
PROC_EX_IMMUNE = 0x0000100,
|
PROC_EX_IMMUNE = 0x0000100,
|
||||||
PROC_EX_DEFLECT = 0x0000200,
|
PROC_EX_DEFLECT = 0x0000200,
|
||||||
PROC_EX_ABSORB = 0x0000400,
|
PROC_EX_ABSORB = 0x0000400,
|
||||||
PROC_EX_REFLECT = 0x0000800,
|
PROC_EX_REFLECT = 0x0000800,
|
||||||
PROC_EX_INTERRUPT = 0x0001000, // Melee hit result can be Interrupt (not used)
|
PROC_EX_INTERRUPT = 0x0001000, // Melee hit result can be Interrupt (not used)
|
||||||
PROC_EX_FULL_BLOCK = 0x0002000, // block al attack damage
|
PROC_EX_FULL_BLOCK = 0x0002000, // block al attack damage
|
||||||
PROC_EX_RESERVED2 = 0x0004000,
|
PROC_EX_RESERVED2 = 0x0004000,
|
||||||
PROC_EX_RESERVED3 = 0x0008000,
|
PROC_EX_RESERVED3 = 0x0008000,
|
||||||
PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always ( no matter another flags) used for drop charges
|
PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always ( no matter another flags) used for drop charges
|
||||||
PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000 // If set trigger always but only one time (not used)
|
PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000 // If set trigger always but only one time (not used)
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SpellProcEventEntry
|
struct SpellProcEventEntry
|
||||||
|
|
|
||||||
|
|
@ -1180,7 +1180,7 @@ void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, boo
|
||||||
uint32 Unit::SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage)
|
uint32 Unit::SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage)
|
||||||
{
|
{
|
||||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellID);
|
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellID);
|
||||||
SpellNonMeleeDamage damageInfo(this, pVictim, spellInfo->Id, spellInfo->SchoolMask);
|
SpellNonMeleeDamage damageInfo(this, pVictim, spellInfo->Id, SpellSchoolMask(spellInfo->SchoolMask));
|
||||||
CalculateSpellDamage(&damageInfo, damage, spellInfo);
|
CalculateSpellDamage(&damageInfo, damage, spellInfo);
|
||||||
damageInfo.target->CalculateAbsorbResistBlock(this, &damageInfo, spellInfo);
|
damageInfo.target->CalculateAbsorbResistBlock(this, &damageInfo, spellInfo);
|
||||||
DealDamageMods(damageInfo.target,damageInfo.damage,&damageInfo.absorb);
|
DealDamageMods(damageInfo.target,damageInfo.damage,&damageInfo.absorb);
|
||||||
|
|
@ -1191,7 +1191,7 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage
|
||||||
|
|
||||||
void Unit::CalculateSpellDamage(SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType)
|
void Unit::CalculateSpellDamage(SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType)
|
||||||
{
|
{
|
||||||
SpellSchoolMask damageSchoolMask = SpellSchoolMask(damageInfo->schoolMask);
|
SpellSchoolMask damageSchoolMask = damageInfo->schoolMask;
|
||||||
Unit *pVictim = damageInfo->target;
|
Unit *pVictim = damageInfo->target;
|
||||||
|
|
||||||
if (damage < 0)
|
if (damage < 0)
|
||||||
|
|
@ -1304,7 +1304,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
|
||||||
|
|
||||||
// Call default DealDamage (send critical in hit info for threat calculation)
|
// Call default DealDamage (send critical in hit info for threat calculation)
|
||||||
CleanDamage cleanDamage(0, BASE_ATTACK, damageInfo->HitInfo & SPELL_HIT_TYPE_CRIT ? MELEE_HIT_CRIT : MELEE_HIT_NORMAL);
|
CleanDamage cleanDamage(0, BASE_ATTACK, damageInfo->HitInfo & SPELL_HIT_TYPE_CRIT ? MELEE_HIT_CRIT : MELEE_HIT_NORMAL);
|
||||||
DealDamage(pVictim, damageInfo->damage, &cleanDamage, SPELL_DIRECT_DAMAGE, SpellSchoolMask(damageInfo->schoolMask), spellProto, durabilityLoss);
|
DealDamage(pVictim, damageInfo->damage, &cleanDamage, SPELL_DIRECT_DAMAGE, damageInfo->schoolMask, spellProto, durabilityLoss);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO for melee need create structure as in
|
//TODO for melee need create structure as in
|
||||||
|
|
@ -12481,7 +12481,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
||||||
case SPELL_AURA_PROC_TRIGGER_DAMAGE:
|
case SPELL_AURA_PROC_TRIGGER_DAMAGE:
|
||||||
{
|
{
|
||||||
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", auraModifier->m_amount, spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
|
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", auraModifier->m_amount, spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
|
||||||
SpellNonMeleeDamage damageInfo(this, pTarget, spellInfo->Id, spellInfo->SchoolMask);
|
SpellNonMeleeDamage damageInfo(this, pTarget, spellInfo->Id, SpellSchoolMask(spellInfo->SchoolMask));
|
||||||
CalculateSpellDamage(&damageInfo, auraModifier->m_amount, spellInfo);
|
CalculateSpellDamage(&damageInfo, auraModifier->m_amount, spellInfo);
|
||||||
damageInfo.target->CalculateAbsorbResistBlock(this, &damageInfo, spellInfo);
|
damageInfo.target->CalculateAbsorbResistBlock(this, &damageInfo, spellInfo);
|
||||||
DealDamageMods(damageInfo.target,damageInfo.damage,&damageInfo.absorb);
|
DealDamageMods(damageInfo.target,damageInfo.damage,&damageInfo.absorb);
|
||||||
|
|
|
||||||
|
|
@ -878,7 +878,7 @@ struct CalcDamageInfo
|
||||||
|
|
||||||
// Spell damage info structure based on structure sending in SMSG_SPELLNONMELEEDAMAGELOG opcode
|
// Spell damage info structure based on structure sending in SMSG_SPELLNONMELEEDAMAGELOG opcode
|
||||||
struct SpellNonMeleeDamage{
|
struct SpellNonMeleeDamage{
|
||||||
SpellNonMeleeDamage(Unit *_attacker, Unit *_target, uint32 _SpellID, uint32 _schoolMask)
|
SpellNonMeleeDamage(Unit *_attacker, Unit *_target, uint32 _SpellID, SpellSchoolMask _schoolMask)
|
||||||
: target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), overkill(0), schoolMask(_schoolMask),
|
: target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), overkill(0), schoolMask(_schoolMask),
|
||||||
absorb(0), resist(0), physicalLog(false), unused(false), blocked(0), HitInfo(0)
|
absorb(0), resist(0), physicalLog(false), unused(false), blocked(0), HitInfo(0)
|
||||||
{}
|
{}
|
||||||
|
|
@ -888,7 +888,7 @@ struct SpellNonMeleeDamage{
|
||||||
uint32 SpellID;
|
uint32 SpellID;
|
||||||
uint32 damage;
|
uint32 damage;
|
||||||
uint32 overkill;
|
uint32 overkill;
|
||||||
uint32 schoolMask;
|
SpellSchoolMask schoolMask;
|
||||||
uint32 absorb;
|
uint32 absorb;
|
||||||
uint32 resist;
|
uint32 resist;
|
||||||
bool physicalLog;
|
bool physicalLog;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10009"
|
#define REVISION_NR "10010"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue