* At every change to model or scale, the related data (bounding_radius/combat_reach) is now updated accordingly (note that player combat_reach are not changed like creature).
* UpdateModelData is called from within SetDisplayId while changes to scale has explicit call to UpdateModelData after new scale is set (mostly for aura scale)
* The updated values are calculated by (scale*bounding_radius)/(scale*combat_reach)
* Database values for bounding_radius/combat_reach are expected to be relative to scale like 1.0
Signed-off-by: NoFantasy <nofantasy@nf.no>
also isActiveObject check moved to WorldObject - all worldobjects are inactive by default, excluding players
this is a final part of cameras implementation
(based on commit efc9623)
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Also remove template-way code selection for object for Map::AddToActive/Map::RemoveFromActive.
This simplify function use from not Map code.
* Use proper stop packet as expected. In case 0 trevel time used before move packet
can generate infinity move forward (at client side).
* Avoid reset top movegen before add idle in pet stay command.
* Avoid assign random move to player owned creatures as default movegen.
* Finish follow movegen init including need-stay case.
creature_template of difficulty_entry_N then only need equipment_id when equipment should be different from the normal creature entry.
Signed-off-by: NoFantasy <nofantasy@nf.no>
npc_vendor.ExtandedCost can be negative now that meaning:
price excluded default item BuyPrice and use only abs(ExtandedCost) items).
For example expected used for item 36908.
* Restore work with money loot.
* Old code sometime generate empty loot windows for normal loot and sometime skip its.
Code changed to be more consistent. Added new option Corpse.EmptyLootShow that control
show empty normal loot window in some cases enabled by default:
- if creature expected to be lootable but loot generated empty by some reasons.
- if creature can be skinnable
If option disabled thne code attempt avoid empty normal loot windows for empty cases.
* Possible fixed case instant despawn non-skinable creature after normal loot complete.
* Show skinning tooltip only after creature loot
(when creature can be explcitly skinned).
* Allow reopen skinning loot if still have not looted items.
* damage - different direct damage calculation tracing
* combat - combat state updates, roll attack result and etc
* spell_cast - spell cast progress and aura apply
* If player tap creature in group and leave then group will have access to creature loot if not disbanded
* If player tap creature and after join to group then creature loot will accesable only by player
* Also RewardPlayerAndGroupAtKill divided to simgle player and group reward versions used for group tap
and single player tap cases.
* Changes include (in fact as part cleanup) fix got NeedBeforeGreed locked item after expire roll timer
suggested by somedruid@mangos.lighthouseapp.com.
* Added cancel rolling at creatuer corpse remove.
* For NeedBeforeGreed and GroupLoot sued common code for prepare item roll.
This allow independent rate of walk vs run speed. Existing field renamed to explicit speed_walk.
Note that default database rate for run is a result of the most common value seen, 8.0/7.0
Signed-off-by: NoFantasy <nofantasy@nf.no>
Using creature_template.MovementType as default. For normal spawned creatures, data from creature table will still apply and override _template.
Radius is 5.0 as default, but may be changed in real-time from ai scripts using function.
Signed-off-by: NoFantasy <nofantasy@nf.no>
Updated creature will now have the same amount of health (in percent) as the original creature after update.
For cases where full restoration of health is expected, function have option to disable preservation.
Signed-off-by: NoFantasy <nofantasy@nf.no>
* Drop delayed moves list in Map code
* Apply movement coords update always at call including movement to different cell/grid.
* Instead removed functionality mark creature as need move notify broadcast at next tick, do it.
This must resolve porblesm with CreatureRelocation in past not always update position to new expected at call
And in resul next code fail or work in strange way. Mark creature for notifier call at next Update
let safe main part remopved functionality implemented in another way: prevent cascade (or infinity chain)
in move updates. In fiture possible implement move notify call not at each tick for save time.
* Move movegen Interrupt/Reset calls from CreatureRelocation that called and from another movegens.
* Add this called to NearTeleportTo creature case and new MonsterMove* functions that considered
as special moves similar instant movegens.
* NearTeleportTo/MonsterMove functions recomended used instead explicit use CreatureReolcation+SendMosterMOve pairs
for proper reaction at movement from creature movement generators.
This let solve problem with not despawned creature/gameobject at pool update in case when related grid not loaded.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
* This must repolve problem with loot.
Before if some mob killed by group member and then leader changed
then group members can't loot this mob body.
* Possible resolve crashes at loot. Now group storage content not dependent from leader changes.
* It was wasting CPU power as cell-level locking is not needed.
* Future multithreading will be on map-level.
* CellLock was just a 'proxy' between Cell and CellPair and in some cases carried redundant data.
* Some minor cleanup in Cell::Visit/Map::Visit.
* This allow pet use own speed (and all speed affects appiedto pet itself) in combat.
* Apply this speed synhronization to minipets/guardians also.
* Also rename Unit::SetSpeed to SetSpeedRate as more close to real functionality.