Commit graph

334 commits

Author SHA1 Message Date
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
NoFantasy
7eeaed6d10 [9430] Implement preservation of current health percent at UpdateEntry use
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>
2010-02-22 01:22:07 +01:00
VladimirMangos
84080aaf60 [9411] More SpellEffectIndex using in apropriate cases 2010-02-19 06:45:11 +03:00
VladimirMangos
ff8d494ed4 [9408] Add MAX_EFFECT_INDEX to enum SpellEffectIndex and use it. 2010-02-18 23:33:16 +03:00
VladimirMangos
5af05a314e [9405] Make all movements instant applied.
* 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.
2010-02-18 01:09:33 +03:00
NoFantasy
7c555add76 [9403] Replace number with enum name where explicitly used in array/other checks
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-02-17 19:07:00 +01:00
VladimirMangos
54559b5c03 [9401] Resolve porblems with waypoints moved/etc after [9400]
* 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.
2010-02-17 17:22:43 +03:00
VladimirMangos
d536661cbf [9399] Simplify config options loading code. 2010-02-16 22:14:20 +03:00
Lynx3d
b2718378ef [9392] Update creature/gameobject pool at despawn instead spawn prepare.
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>
2010-02-15 21:43:06 +03:00
AlexDereka
ebfb0f9835 [9389] Cleanup config data. Use proper names and expected types. 2010-02-15 15:29:06 +03:00
AlexDereka
5368751c13 [9386] Store some config values in Rate emun. 2010-02-15 00:17:44 +03:00
AlexDereka
ccfd42bf3e [9381] Fixed some compile warnings. 2010-02-14 18:16:07 +03:00
NoFantasy
08c364214b [9335] Clarify error log message after rewrite of monster_* to spline_* flags
Also change name of related field in code.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-02-09 00:32:22 +01:00
VladimirMangos
8e0069f364 [9327] Replace leader based indexing groups by group ids.
* 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.
2010-02-08 08:25:06 +03:00
tomrus88
db547a008a Get rid of monster movement flags, since it's really spline flags.
Thanks to Ralek for research.
2010-02-07 15:03:36 +03:00
tomrus88
c990e2aaef Fixed error output at creature loading. 2010-02-07 00:54:45 +03:00
tomrus88
d9e92d1987 - Updated unit dynamic flags enum. 2010-01-29 02:12:03 +03:00
XTZGZoReX
0ff9250de2 [9245] Remove CellLock class and all cell-level thread locking.
* 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.
2010-01-23 21:36:15 +01:00
VladimirMangos
797dd6d931 [9232] Replace list bool fields with exclusive true values by subtype field in Creature.
Use it in recently added code instead dynamic_cast use.
2010-01-21 22:23:17 +03:00
zhenya
4178d5bb6a [9228] Speedup groups store and other code work.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-01-21 17:43:27 +03:00
VladimirMangos
eaecc467d5 [9212] Implement pet speed synchronization with owner only for follow mode.
* 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.
2010-01-19 03:56:26 +03:00
NoFantasy
23a77a1d36 [9165] Implement speed reduction at creatures DoFleeToGetAssistance
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-01-13 02:26:08 +01:00
VladimirMangos
83261d9b9b [9159] Skip invisible/stealthed and not detected targets from threat list at next target selection.
This will fix work spell 58984 and similar in combat.
2010-01-12 10:48:58 +03:00
VladimirMangos
4d90a2e1f2 [9146] More poolmgr cleanps.
* Replace mixed values used type args by function template specializations
* More explcilty show fact that poolmgr work only with db guids.
2010-01-11 12:24:36 +03:00