Also partly implement using it spell 62692.
FIXME: Some spells expected to be working for target under spell 62692 effect
not working. This need additional research and fixes.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Inspired by patch provided by darkstalker.
Client expected receive form field change at form switing including case with switch to same form.
In fact problem too good mangos optimization in part avoid send unchanged values in update fields.
* Added function Object::SendForcedObjectUpdate()
* It used in form apply code for make sure received by client non-form applied state in middle form shifting state.
* It also used for fishing code when client also expected received some update fields chnages before
animation update. New function send update to all all client instead before used code that send it to fishing player
and resend later one more time to other players and player itself as normal update.
* Update triggering source spells.
* In code overwrite wrong family mask data for spell mod.
If more cases will be maybe will better restore spell_affect table.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
* Set as expected caster channeling target to created dynamic object
at persistent aura area spell casts for channeled spell.
* Select correct caster/target for triggered spell in case channeled perioding trigger aura.
Now safe allow this casts in like way after completed convertion to ObjectGuid use.
Also simplify code in result allowed auto cast to uint64.
Please _not_ add new uint64 storages (local and in structures) for guid values.
Place spell where it belongs instead, along with other spells doing the same. Spell will add/remove the correct flags this time.
git blame: Hasty research, lack of coffee, broken brain
Signed-off-by: NoFantasy <nofantasy@nf.no>
Thanks dpedroia15 for parts of 45958.
Note: spell 45958 may be processed further with DB table spell_scripts.
Signed-off-by: NoFantasy <nofantasy@nf.no>
- Unit::CalculateSpellDuration split into two functions
- CalculateSpellDuration taking into account combo points and caster-side spell mods
- Unit::CalculateAuraDuration taking into account target-side spell mods
- Diminishing is now applied before duration reduction mods
- Implement saving per-effect periodic timers to DB (required for auras affected by haste)
Note: spell 62105 are still considered to be negative, despite explicit exception added in IsPositiveEffect and will unexpectedly put caster in combat.
Signed-off-by: NoFantasy <nofantasy@nf.no>
* Some spells have StackAmount > 255, for example 22735, 54314
* In SMSG_AURA_UPDATE maximum stack amount is limited by 255
* Move duplicate code into SpellAuraHolder::BuildUpdatePacket function
* Cleanup some weird type casts in _LoadAuras
* Fixed wrong visibility changes in some cases at .mod phase uses.
* Apply phase change to any owned units (not only pets as before).
It also will applied in more safe way for avoid unexpected lost owner at update.
* Check view point setting auras targets accessability not only at visibility change
but also at phase change.
* Replace SetVisibility(GetVisibility()) hack like calls.
* Creature/GameObject guid generators moved to Map
* For avoid wrong not converted cases generic function in ObjectMgr has been replaced by
specilized guid generation function like sObjectMgr.GeneratePlayerLowGuid().
This let catch all cases that need update in custom code or scripts.
* Drop many ObjectAcessor.h now dead code. This is also make mangos more thread safe.
* Restore one more time unix build broken in prev. commits.
Note: many cases when something not wotk in instance but work in continents
possible magicly start work after this commit. For example, some gm commands.
From large systems that need more chnages for start work in full power in instances
can be referecned pool/gamevent system. Last need just small hacks drop changes but
in will addded in independent commit.
* Pool System for correct full power work in instance need implement
MapPersistentState local pool system state for instanceable maps.
Unit this not implemented pool system must avoid creating/despawn/touch
instance map objects. Currently this work because instance map object use
dynamic generated guids and "invisible" for Pool System, with explcitly forbiden
for it spawn directly new objects. Code changes add explicit checks for preserve
this way work for time when instance object will use static guids. When local pool
state storing in persistent state this protection checks will possible drop.
Non-instanced working cases converted in local map object search calls.
* GameEvent Systems currently have code that work correctly only with objects at
non-instanced maps by same reasons as Pool System. But in different Pool System
case game event activate/deactivate expected applied to _all_ object copies in all
existed instanceable map copies. Code modified for work in expected way.
Direct spawn disabled for instanceable maps until swith to static guids.
Despawn code will make affect only for non-instanceavble maps unit swithc to static guids as-is.
This is preserve current code working result.
* Convert last case usage global creature search in aura code to map local case.
Player case also possible not need now after including caster damage/heal mods
part to aura base damage/heal. In any cases player case preserved in old way work.
NOTE: this last places dependent from global creature/gameobject guid search so look like this
make possible start direct work to switch instances use static guids instead dynamic generated