Commit graph

207 commits

Author SHA1 Message Date
zerg
2fa5fa43bd [10594] Use equal_range instead of lower_bound/upper_bound pairs
(based on zergtmn's repo commit 0499169)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-10-09 01:37:57 +04:00
darkstalker
3a8ad26a5e [10526] Implement server side global cooldown check.
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.
2010-09-24 06:07:26 +04:00
VladimirMangos
b0edd807d7 [10513] Clear grid *Check/*Searcher clases use
* 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.
2010-09-22 06:25:21 +04:00
NoFantasy
d7994c1df4 [10480] Fix a bug causing creature dynamic flags to be removed at normal loot preparation.
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>
2010-09-13 10:34:53 +02:00
NoFantasy
334398b3f7 [10458] Changes to corpse decay/respawn times for creatures
*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>
2010-09-09 11:58:53 +02:00
VladimirMangos
e3d9ebe81e [10448] Use base run speed * 2 as fall speed.
It equal to base flight speed and not dependent from real creature speed as expected.
2010-09-05 23:02:06 +04:00
VladimirMangos
acd0716297 [10432] Rename ASSERT -> MANGOS_ASSERT and related fixes
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
2010-09-02 05:13:16 +04:00
NoFantasy
32e3e252fb [10431] Correcting issues with flying creatures falling to ground at death.
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).
2010-09-01 00:31:31 +02:00
Revils
5d6c271627 [10404] Additional checks for call assist.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-08-24 14:38:30 +04:00
VladimirMangos
09b03b470e [10402] Use ObjectGuid in packets and fix some uint32 guids cases. 2010-08-23 12:37:11 +04:00
Schmoozerd
927e9d77f0 [10397] Fixed wrong difficulty selection and possible crash. 2010-08-22 11:52:18 +04:00
VladimirMangos
9d76725a0e [10391] Restore build at Unix after Unit::GetUnit drop. 2010-08-20 23:44:01 +04:00
VladimirMangos
23be9ae496 [10386] Correct creature entry selection for raid difficulties
Original patch provided by False.Genesis.
2010-08-20 18:35:54 +04:00
VladimirMangos
77ae9a63b8 [10385] Remove Unit::GetUnit and update it callers. 2010-08-20 16:53:45 +04:00
NoFantasy
d0df25fd8c [10381] Implement generic system for racial model selection
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>
2010-08-19 16:58:53 +02:00
NoFantasy
a15b0916b6 [10373] Drop unused team-argument in ChooseDisplayId -function
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-08-18 18:09:56 +02:00
VladimirMangos
5f44c4da21 [10363] More wide use ObjectGuid in way remove MAKE_NEW_GUID uses.
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.
2010-08-17 08:22:28 +04:00
VladimirMangos
c138fbe902 [10304] Use loop instead repeating code in models check. 2010-08-01 06:17:11 +04:00
NoFantasy
7bdf05901d [10296] Move ChooseDisplayId to Creature class for access from script side
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-07-30 21:08:58 +02:00
NoFantasy
25d9fd265b [10293] Correct a not exitan...non-existin... a word that is often spelled wrong
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-07-30 18:26:08 +02:00
NoFantasy
2ae0badf48 [10289] Adjust creature models system
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>
2010-07-30 16:40:17 +02:00
Lynx3d
730b4deaaf [10272] Add option for search distance to getHeight() functions and make Creature::FallGround() use VMaps properly.
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.
2010-07-26 08:09:08 +02:00
VladimirMangos
9d8b66cf93 [10246] Restore work killCredit and kill achievements in regular difficulty instances. 2010-07-22 13:11:34 +04:00
VladimirMangos
20a5551739 [10207] Implement ITEM_FLAGS2_EXT_COST_REQUIRES_GOLD use instead sign of ExtendedCost field. 2010-07-17 19:23:38 +04:00
Laise
beff2a145c [10185] fix auras adding to previously added holder 2010-07-12 20:29:26 +03:00
Laise
a32b3063a2 [10156] Add shared object for auras of same spell and move spell proc code to its own file, also spread procs by auras and effect indexes. 2010-07-07 19:08:26 +03:00
NoFantasy
1713caae17 [10115] Add function to update model_info at changes to scale or model.
* 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>
2010-06-28 12:10:56 +02:00
NoFantasy
2375a1cb71 [10110] Add function Get/SetObjectScale and update code where scale is set.
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-06-27 12:39:29 +02:00
SilverIce
6ca609629c [10073] Make object active at applying view on it
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.
2010-06-18 00:19:12 +04:00
VladimirMangos
492f467bcc [10068] Fixes in pet movments
* 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.
2010-06-17 02:46:39 +04:00
NoFantasy
809d9d2063 [10055] Use creature equipment from normal _template when id is not set for difficulty
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>
2010-06-14 17:57:24 +02:00
VladimirMangos
fcf996b4fd [9959] Fixed resent radnom problem with looting related to skinning code changes.
Thanks to boxa for help in research problem.
2010-05-23 11:47:04 +04:00
VladimirMangos
67b8ca03b5 [9957] Alow sell item for money and extanded coset without momey in same time.
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.
2010-05-22 19:49:07 +04:00
VladimirMangos
2591a2333a [9947] More skinning fixes.
* 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.
2010-05-21 11:10:59 +04:00
VladimirMangos
d4f1b510ae [9934] Skinning related fixes
* Show skinning tooltip only after creature loot
  (when creature can be explcitly skinned).
* Allow reopen skinning loot if still have not looted items.
2010-05-19 15:35:20 +04:00
VladimirMangos
d86dcd60d7 [9925] Add more log filters
* damage - different direct damage calculation tracing
* combat - combat state updates, roll attack result and etc
* spell_cast - spell cast progress and aura apply
2010-05-18 12:38:52 +04:00
VladimirMangos
696a4b6db0 [9918] Fixed player's tapped creature loot access by group in diff cases
* 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.
2010-05-17 12:56:57 +04:00
VladimirMangos
96d50bf55a [9917] Fixes in loot roll timer work and related cleanups.
* 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.
2010-05-17 05:29:01 +04:00
VladimirMangos
722135b326 [9838] More log filters and macro uses.
* LogFilter_Weather
* LogFilter_PeriodicAffects
* LogFilter_PlayerMoves
* LogFilter_SQLText
* LogFilter_AIAndMovegens
* LogFilter_PlayerStats
2010-05-05 18:46:10 +04:00
NoFantasy
92ab082fc6 [9832] Move function to select an attacking target from EventAi to Creature class
Also rename function to a more descriptive name, SelectAttackingTarget

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-05-04 12:46:09 +02:00
VladimirMangos
eb66482020 [9786] Fixed crash at drop vendor items (anorther way). 2010-04-24 03:04:23 +04:00
VladimirMangos
f2dd9daf45 [9765] Prevent crash at use .npc delitem to item with multiply extanded costs. 2010-04-19 13:38:12 +04:00
SilverIce
e3f3f3410a [9736] Added more usable interface for grid visits
(based on SilverIce's repo commit f20f01e)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-04-12 15:15:55 +04:00
VladimirMangos
25c2a76b63 [9716] Allow to vendor have same items in list with different extanded price. 2010-04-10 05:41:30 +04:00
XTZGZoReX
34e56c9978 [9641] Fix typo; IN_MILISECONDS -> IN_MILLISECONDS. 2010-03-30 14:44:57 +02:00
NoFantasy
bfecdc3ded [9603] Implement use of UNIT_FLAG_PASSIVE for creature.
Add function to check creatures own ability to initiate an attack in MoveInLineOfSight.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-03-18 11:29:27 +01:00
NoFantasy
9823356946 [9589] Add additional field for storage of speed_run rate of creature
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>
2010-03-15 15:47:56 +01:00
VladimirMangos
ab7840a591 [9580] Add ObjectGuid const& Object::GetObjectGuid() and restore build. 2010-03-13 17:35:47 +03:00
NoFantasy
3d3348e485 [9556] Allow summoned creatures use MovementType == RANDOM_MOTION_TYPE
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>
2010-03-09 01:29:19 +01:00
VladimirMangos
6487c24f29 [9545] Rename ObjectDefines.h -> ObjectGuid.h
Also move unrelated generic defines to Common.h
2010-03-07 20:05:32 +03:00