* Rename barGoLink -> BarGoLink as expected by mangos code style
* Add uint32/uint6 constructor versions for BarGoLink,
and remove lot casts required before for BarGoLink use
This helper change for allow have in future static spawned vehicles as `creature` table data.
Added CreatureInfo::GetHighGuid() high guid selector, and wrapper CreatureData::GetHighGuid()
for most real cases of usage. Also easy get expected guid form by CreatureData::GetObjectGuid(lowguid).
Also fixed some memory lost cases at creature spawn fail.
* Direct store pool system dynamic data in sPoolMgr replaced by
shared pool system data object (for all non instanceable maps)
into WorldPersistentState, and own copies of pool system data
object in DungeonPersistentState/BattlegroundPersistentState.
This let have pools with object at many non-instanceable maps,
and single map pools with unique state for each instance.
* Avoid direct global grid data modify from pool system, and use for this also
recently added local for MapPersistentState grid spawn data.
* Implemented proper API for update pool system data in MapPersistentStates
from GameEvent system.
* Initialize pool system state at MapPersistendState creating.
For shared pool system state for non-instanceable maps initilized at first map state
creating.
Now pool system propertly work in instance also!
* 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
* At game events table loading checked not only allowed event ids range but also event existance.
* Renamed CONDITION_ACTIVE_EVENT -> CONDITION_ACTIVE_GAME_EVENT
* Implemented new conditions:
- CONDITION_NOT_ACTIVE_GAME_EVENT
- CONDITION_ACTIVE_HOLIDAY
- CONDITION_NOT_ACTIVE_HOLIDAY
Recomended use holiday version where possible as more portable.
Also implement save game event state to DB mostly for avoid
send mails at resume game event after server downtime.
Thanks to X-Savior for inspiring and original research.
* Table `game_event_model_equip` renamed to `game_event_creature_data`
* Table allow now store same creatures for different events, BUT
expected that related events no active in same time.
* Added possibility switch entry at gameevent time.
This let have diff factions/loot and etc for creatures.
* Added possibility cast spells at gameevent start/end.
Exist some spells that expected casted to creature at gameevent start
for model replace, and for animation in other cases.
Note: `game_event_creature_data`.`modelid` field posisble will removed soon in fowor related spell use.
Ofc, when spells will implemented in core.
Create new table and convert existing data.
Simplify how game event quests are activated during event by adding generic function to set quest active/inactive.
Any quest in game_event_quest are disabled until event start (and deactivated once stopped)
Signed-off-by: NoFantasy <nofantasy@nf.no>
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>
* 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>
* `game_event_pool` dropped and related in momory data generated
based by another pool tables content.
* Pool work with spawed at event and despawned at event object now different.
- If object listed in `game_event_*` as spawned at event start and it's part of some pool
then all other pool object must be listed as spawned with this event start, and more,
if pool has mother pool, then all mother pool members must have objects spawned at this
event start. More short: all object of some top (not have mother pool) mitbe or listed for some event start spawn,
or not listed for any event start spawn.
- If object listed in `game_event_*` as DEspawned at event start and it's part of some pool
then nothing special required for other pool objects. Event systemwil command to pool system exclude for spawning and despawn referenced
object until event end.
* Many checks has been added at event/pool data loading.
* Changes fix crashes related to event/pool common work.
Thanks to NoFantasy for help in research original problems and ways for improve code.
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>