From 8e9d2cdf01929f513e37eccbfdea952aa04e78f6 Mon Sep 17 00:00:00 2001 From: QAston Date: Sun, 10 Jan 2010 01:23:15 +0100 Subject: 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 --- sql/updates/6932_characters_character_aura.sql | 5 +++++ sql/updates/6932_characters_pet_aura.sql | 5 +++++ sql/updates/6932_world_spell_proc_event.sql | 1 + 3 files changed, 11 insertions(+) create mode 100644 sql/updates/6932_characters_character_aura.sql create mode 100644 sql/updates/6932_characters_pet_aura.sql create mode 100644 sql/updates/6932_world_spell_proc_event.sql (limited to 'sql/updates') diff --git a/sql/updates/6932_characters_character_aura.sql b/sql/updates/6932_characters_character_aura.sql new file mode 100644 index 00000000000..9cf36f0143c --- /dev/null +++ b/sql/updates/6932_characters_character_aura.sql @@ -0,0 +1,5 @@ +ALTER TABLE `character_aura` + ADD COLUMN `base_amount0` INT(11) NOT NULL DEFAULT '0' AFTER `amount2`, + ADD COLUMN `base_amount1` INT(11) NOT NULL DEFAULT '0' AFTER `base_amount0`, + ADD COLUMN `base_amount2` INT(11) NOT NULL DEFAULT '0' AFTER `base_amount1`, + ADD COLUMN `recalculate_mask` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `effect_mask`; diff --git a/sql/updates/6932_characters_pet_aura.sql b/sql/updates/6932_characters_pet_aura.sql new file mode 100644 index 00000000000..fe386e7a85b --- /dev/null +++ b/sql/updates/6932_characters_pet_aura.sql @@ -0,0 +1,5 @@ +ALTER TABLE `pet_aura` DROP PRIMARY KEY, + ADD COLUMN `base_amount0` INT(11) NOT NULL DEFAULT '0' AFTER `amount2`, + ADD COLUMN `base_amount1` INT(11) NOT NULL DEFAULT '0' AFTER `base_amount0`, + ADD COLUMN `base_amount2` INT(11) NOT NULL DEFAULT '0' AFTER `base_amount1`, + ADD COLUMN `recalculate_mask` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `effect_mask`; diff --git a/sql/updates/6932_world_spell_proc_event.sql b/sql/updates/6932_world_spell_proc_event.sql new file mode 100644 index 00000000000..8b4dfcad1ce --- /dev/null +++ b/sql/updates/6932_world_spell_proc_event.sql @@ -0,0 +1 @@ +DELETE FROM spell_proc_event WHERE procEx & 0x6000; -- cgit v1.2.3