Update aura system:
* Change system logic - unify Auras, AreaAuras and PersistentAreaAuras: * Aura has now its owner - which is the WorldObject, which applies aura (creates AuraApplication object) dependant on aura radius, and effect type * Owner can be Dynobj (DynObjAura class) for PersistentAreaAuras, or Unit (UnitAura class) for Area and nonArea auras * Aura data is shared for all units which have AuraApplication of the Aura * Because of that AuraEffect handlers , and periodic tick functions can't modify AuraEffect object (they are const now) * Remove spell source and AreaAuraEffect classes * Add AuraEffect::UpdatePeriodic function, to allow periodic aura object modification (target independant) * Add AuraEffect::CalculateAmount and AuraEffect::CalculateSpellMod function, to allow non-default amount calculation * AreaAura updates are done in owner _UpdateSpells cycle * Since now you don't need to wait an aura update cycle to get area aura applied on it's correct target list * And you can access area aura target list * Add basic support for aura amount recalculation * Save recalculation state and base amount of auras to db * Add AuraEffect::CalculatePeriodic function to determine if aura is periodic, and to set correct tick number after aura is loaded from db * Add ChangeAmount function in addition to SetAmount function, to allow easy reapplication of AuraEffect handlers on all targets * Sort aura effect handlers in SpellAuras.cpp and .h by their use * Add check for already existing aura of that type to some AuraEffect handlers, to prevent incorrect effect removal * SPELL_AURA_CONVERT_RUNE and MOD_POWER_REGEN and MOD_REGEN hacky handlers are now implemented correctly * Send aura application client update only once per unit update - prevent unnecesary packet spam * Fix ByteBuffer::appendPackGUID function - it added additionall 0s at the end of the packet * Fix memory leak at player creation (not deleted auras) * Updated some naming conventions (too many to mention) * Added Unit::GetAuraOfRankedSpell() function * Remove procflags on aura remove, use Aura::HandleAuraSpecificMods instead * Added functions to maintain owned auras (GetOwnedAuras, GetOwnedAura, RemoveOwnedAura, etc) * Implement AURA_INTERRUPT_FLAG_LANDING * Implement EffectPlayerNotification (thanks to Spp) * Remove wrong aura 304 handler * Add better handler for death runes * Remove unnecesary variables from DynamicObject class, and cleanup related code, link dynobj duration with aura * Add GetAuraEffectTriggerTarget function in CreatureAi for special target selection for periodic trigger auras used in a script * Add many assert() procection from idiots using some functions in wrong way * I am to lazy to write here anything more Thanks to Visagalis for testing this patch PS: Do not make patches like this, please --HG-- branch : trunk
This commit is contained in:
+9
-4
@@ -111,7 +111,7 @@ struct SpellModifier
|
||||
int32 value;
|
||||
flag96 mask;
|
||||
uint32 spellId;
|
||||
Aura *const ownerAura;
|
||||
Aura * const ownerAura;
|
||||
};
|
||||
|
||||
typedef UNORDERED_MAP<uint32, PlayerTalent*> PlayerTalentMap;
|
||||
@@ -297,6 +297,7 @@ struct RuneInfo
|
||||
uint8 BaseRune;
|
||||
uint8 CurrentRune;
|
||||
uint8 Cooldown;
|
||||
AuraEffect const * ConvertAura;
|
||||
};
|
||||
|
||||
struct Runes
|
||||
@@ -1924,8 +1925,8 @@ class TRINITY_DLL_SPEC Player : public Unit, public GridObject<Player>
|
||||
void _RemoveAllStatBonuses();
|
||||
|
||||
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply);
|
||||
void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply);
|
||||
void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply);
|
||||
void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect const * aura, bool apply);
|
||||
void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, AuraEffect const * aura, bool apply);
|
||||
|
||||
void _ApplyItemMods(Item *item,uint8 slot,bool apply);
|
||||
void _RemoveAllItemMods();
|
||||
@@ -2259,6 +2260,10 @@ class TRINITY_DLL_SPEC Player : public Unit, public GridObject<Player>
|
||||
void SetBaseRune(uint8 index, RuneType baseRune) { m_runes->runes[index].BaseRune = baseRune; }
|
||||
void SetCurrentRune(uint8 index, RuneType currentRune) { m_runes->runes[index].CurrentRune = currentRune; }
|
||||
void SetRuneCooldown(uint8 index, uint8 cooldown) { m_runes->runes[index].Cooldown = cooldown; m_runes->SetRuneState(index, (cooldown == 0) ? true : false); }
|
||||
void SetRuneConvertAura(uint8 index, AuraEffect const * aura) { m_runes->runes[index].ConvertAura = aura; }
|
||||
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const * aura) { SetRuneConvertAura(index, aura); ConvertRune(index, newType); }
|
||||
void RemoveRunesByAuraEffect(AuraEffect const * aura);
|
||||
void RestoreBaseRune(uint8 index);
|
||||
void ConvertRune(uint8 index, RuneType newType);
|
||||
void ResyncRunes(uint8 count);
|
||||
void AddRunePower(uint8 index);
|
||||
@@ -2594,6 +2599,7 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
|
||||
|
||||
if(!IsAffectedBySpellmod(spellInfo,mod,spell))
|
||||
continue;
|
||||
|
||||
if (mod->type == SPELLMOD_FLAT)
|
||||
totalflat += mod->value;
|
||||
else if (mod->type == SPELLMOD_PCT)
|
||||
@@ -2611,7 +2617,6 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
|
||||
|
||||
DropModCharge(mod, spell);
|
||||
}
|
||||
|
||||
float diff = (float)basevalue*(float)totalpct/100.0f + (float)totalflat;
|
||||
basevalue = T((float)basevalue + diff);
|
||||
return T(diff);
|
||||
|
||||
Reference in New Issue
Block a user