I couldn't remove AddObject and m_bgObjects from code
cause it's still needed for buffobjects.. later
the poolsystem must be rewritten, so that it'll work for instances too
then those objects can be removed
(it would be possible to take the eventsystem for those spawns too - but
this would be the wrong way to handle it)
they are spawned in all arenas 60 seconds after start
so i implemented this function in BattleGround.cpp
maybe we should use BattleGroundAA for such things
then we also can drop all arena-files, cause
all arenas are working in the same way
(at least those which are currently implemented)
BattleGroundWS: changed warsong code for db-move
BattleGroundAB: changed arathi basin code for db-move
BattleGroundEY: changed eye of the storm code for db move
also some cleanup like:
renaming POINTS_MAX to NODES_MAX
renamed "m_" -> should only be used for classmember
BattleGroundAA: changed arena code for db move
i added a map m_ActiveEvents which will track all current active events
it's allways key:event1 -> value:event2 so it's like a one dimensional array
which contains current active event2..
i only need one event2 in this list, cause i only want to allow one event2 at
the same time if other event2 are also active right now - i would just despawn
it
(for example (numbers not real) arathi basin stables are event1=3 and have 5
states (alliance assault, horde assault, neutral...) so every state has an
event2 index and only one state at a time is possible (so if we spawn
horde-contested gameobjects/creatures, we will despawn everything else)
OnObjectDBLoad - generic implementation for this function:
will automaticly spawn or not spawn.. open (doors) or not open
gameobjects/creatures
doors:
i use event1=254 and event2=0
IsDoor(event1,event2) - just a check if this event could be a door (mostly not
needed for bg-subclasses)
OpenDoorEvent(event1,event2) - opens the door (used in bg subclass cause some
doors also must be despawned)
SpawnEvent(event1, event2, bool spawn)
spawn=true says all related gameobjects/creatures getting spawned, else despawned
will despawn all event2 in event1 which are not equal to the
event2-parameter
also this function will set the right values in m_ActiveEvents
IsActiveEvent(event1,event2) - returns true if event is active
those eventindexes will then be used by the battleground-code to decide
which creature belongs to which objective
for example all creatures in alteracvalley which are standing around a tower
will belong to one eventindex then.. the eventindex will be defined through the code
and must be proper documented for db-devs
this makes those functions independent from the bg_objects vector
also dooropen and doorclose will now accept only guid
additional i removed the comments around spawnbgcreatures-function
also i updated this function, so that it'll work
this is a virtual function and can be used to move gameobjects
and creatures from battlegroundcode to database
for this i also had to add a BattleGround-pointer to the map
so i renamed CreateBattleGround(instanceid) to CreateBattleGroundMap(instanceid, Battleground*)