Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Also pet/controlled unit global cooldown code replaced by new placed in charmInfo structure.
Thanks to nos4r2zod for testing and gcd range check implement.
* Check class considered have all info select object in world from suggested but grid walker list in some grid.
This also meaning that Check must always have focus object around that (and in same phase) fit objects must be.
* Searcher only must ask Check and know how from all objects fiting to Check select result object(s).
For this reason and for better compatibility removed first arg (searcher) form all Searcher classes.
Instead expected used Check::GetFocusObject() object if need ( by always need check and simolify Check classes
phase checked in Search classes). This also restore source code compatibilty in related lines with prev.client
version branches code.
* While focus object adding fixed possible wrong phase object selection at stealth detection and at corpse searches.
In addition add use of UNIT_DYNFLAG_TAPPED_BY_PLAYER
Added check to see if creature is tapped for isAllowedToLoot()
Signed-off-by: NoFantasy <nofantasy@nf.no>
*CORPSE_DECAY values adjusted (Rare/RareElite values are guessed) with more proper.
*RATE_CORPSE_DECAY_LOOTED is now 0.0 as default and a modifier of the creatures spawntimesecs are used for corpse decay.
Respawn time for creature is now set at death (result: database spawntimesecs are in most cases the time it takes from kill to respawn)
Overall, this will affect four things:
* corpse will stay visible longer before looted
* corpse will stay visible longer after looted, when creature has long respawn time
* creature without loot will "skip" the default decay times and then fix a "should respawn almost instant" -problem
* creature with loot and very short respawn time may respawn instantly after looted
Signed-off-by: NoFantasy <nofantasy@nf.no>
ASSERT hard use in predictable way because diff. 3rd party libs code
redefine it inf different ways and hard make sure that used in end
of mangos define version. This is real detected problem make some
expected assert checks ignored and so bugs not detected as expected from code.
In addition made related changes:
* Common.h header expected to be first include in any src/game/header except most simple cases.
* Related FILE.h header expected to be first include in FILE.cpp
* Fixed some absent includes and type forwards for safe build without PCH enabled.
* Avoid using MANGOS_ASSERT in src/framework code
Simplified the way FallGround works and death states are set in a more logical way when a mob is in fact DEAD_FALLING.
Visual will in some cases not be correct. Notes in code for details.
Thanks to Lynx fixing Map::GetHeight
It now return mapHeight as last resort, making FallGround work as expected.
This fix reveal one (known) bug, and therefore a temp hack is added in TargetedMovegen, to be sure Z is not the ground Z for a creature that are able to fly.
Other creatures will follow by the ground level Z (in other words, they will no longer follow in the air).
Table creature_model_info store creature entry to use model from (or explicit model). The selection is based on a base modelId and racemask.
Hacks for shapeshift models removed (data included in SQL update)
Dropped no longer needed creature_model_info.modelid_other_team, as creature_model_info can and should be used instead (sorry, this is what happen when author doesn't do full research :) )
Signed-off-by: NoFantasy <nofantasy@nf.no>
Also
* Fixed some amount wrong uses low guids as full player guids.
* Add private without body ObjectGuid(uint32 const&) for catch wrong assigns low guids to ObjectGuid.
In some cases need assign "0" guid, then use ObjectGuid() instead.
* Fixed .pdump commands work.
This change will:
* make it easier to use cached data directly without any modifications
* correct issues regarding invisible models
* simplify certain aspects of model selection itself and make it somehow easier to control and maintain special cases.
Two new fields added to creature_model_info, to store modelid_alternative and modelid_other_team
* _alternative holds an alt. model, for cases where gender are the same, or is not male/female.
* _other_team is generally used for totem models, but may have future use.
This commit will possibly break a few things (visually) and will require DB projects to update their creature_template models data.
It is advised to use cache data as-is, and in addition fill creature_model_info for certain models, totems in particular, for expected appearance.
Signed-off-by: NoFantasy <nofantasy@nf.no>
This finally prevents flying creatures from falling to infinity (basically instantly diappearing) in several instances,
aswell as prevent creatures from falling inside larger solid object around the world.
Default height search is untouched, needs more research on how creature AI etc. will be affected.
* 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>