they basicaly should
*autocast 22011
*give player after gossiphello buff 2584
*port players away to another spiritguides, when they die
so this can be done by a script
and maybe eventai
i added a function IsDeathOnlySpell() which returns true
if this spell can ONLY be casted while dead, so i haven't
implemented all spells which could be cast while dead..
moved arena/battleground check from spell::checkcast
to SpellMgr::GetSpellAllowedInLocationError
also i adjusted some spell_fail-codes related to battleground
cause a spell_fail_wrong_area always requires the areaid, else it
would output "not in area %s"
then we don't need to check for map->isarena() when player is already in an
arena
----
in Spell.h
i moved "isTargetableForAttack()" to the top - cause it was anyway used
in every case of that switch
and isTargetableForAttack for attack also checks for isAlive
and isInFlight
so this could get simplified
Through the eventsystem can be quite complex and errormessages should
be quite meaningful for finding mistakes in sql
I decided to create another table in database
This table will just contain the map,event1,event2 and a human
readable description of every event
the primary key is over map,event1,event2
this table will be outer joined with bg_creatures,bg_gameobject
so every inner-join part will just match those events and create no error
but every outer join part will mean there was something wrong
(either a spawn which has no existant event, or an event where no spawn is
inside)
also this table is very useful for db-developers, to see which events exist
without looking into code and understanding the logic behind the code
also please note:
those error-checks don't (and can't) report every mistake..
for example if you have an arathibasin node - and add just one creature in this
event - this system won't look, if you've spawned all needed gameobjects and so
on..
an idea would be to add to this table how much gameobjects and creatures have to
be there at minimum - but i doubt that this will be much helpful
also i won't stop battlegrounds from loading if not all events do exist
(just cause i see no need in it)
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*)