Jump to content

[in 8554] BattleGround Objects to Database


Guest balrok
 Share

Recommended Posts

* What bug does the patch fix? What features does the patch add?

it moves (nearly) all creatures and gameobjects from the battlegroundcode to the database

* For which repository revision was the patch created?

master

* where can this patch be found

http://github.com/balrok/mangos/commits/bg2db

and if you want to use av-patch use this one:

http://github.com/balrok/mangos/commits/bg2db_av

* what needs to be done:

testing :)

fixing bugs:

spiritguides are also visible for living players right now

the intention of this patch is to keep the battleground-code clean.. mostly this was needed for alterac valley with several hundreds creatures/objects but for old battlegrounds it also helps (many lines of code could be removed through this)

the next intention is to keep content out of mangos - that's also why i converted all battlegrounds at once - cause the sql for the bgs will be found in future only at your database provider (but for testing this patch i have mysql in sql/not_for_master*.sql ) and not in mangos's sql updatefiles.. and cause i guess it will be a bit trouble for everyone i want to do everything at once

also with keeping content out of battlegrounds, creating custom things in battlegrounds won't be so difficult as before (or for example add those cats running around at the blacksmith in arathi is also easy possible)

so basically this patch adds no features but will allow easier future developement of bgs (hardest part was always to get the spawning/despawning working correctly - and writing down all spawns in the code :-/ )

and through that also implementation of alterac valley (see it as a first split of this alteracvalley patch)

also i could imagine using this system also for the outdoorpvp-patch..

what needs to be done?

* today i've seen that the spawned spiritguides will also be visible for living units

* go for more performance (i don't think it's slow - but performance is always good :) )

* testing it a bit (there are soo many objects now in database and often i've written the event-ids by hand, there could be some objects wrongly spawned (but i already tried to test as much as possible on my own)

* move buffobjects to database - should only be done when poolsystem will work for instances too.. it is already possible to move them to db - but then looks more like a hack and isn't the effort worth

---

the biggest change to my old bg2db-patch was the move from one-dimensional eventids to two-dimensional ids.. through that it's quite easy to map the nodeid+state to an event (example arathi: event1=node_stables, event2=horde or alliance or neutral)

cause for one node only one state can be at the same moment (a node can't be controlled by horde and controlled by alliance at the same time) i also added in code, that only one event2 can be active in an event1

so spawning an event mostly also despawns another event

for a full list, which eventids i use please look currently in the code or sql-files.. i will create later a list of those ids

if you have questions just ask - but i mostly tried to keep code understandable

Link to comment
Share on other sites

okay thank you I just do it

Sorry for french log, it's only new AV patch wich causing these errors, about bg2db base patch it's ok works fine for me (for now)

BattleGroundAV.cpp
..\\..\\src\\game\\BattleGroundAV.cpp(506) : warning C4101: 'index' : variable locale non référencée
..\\..\\src\\game\\BattleGroundAV.cpp(833) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(834) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(838) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(839) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(877) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(887) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(888) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(890) : error C2677: '[' binaire : aucun opérateur global trouvé qui accepte le type 'BG_AV_OTHER_VALUES' (ou il n'existe aucune conversion acceptable)
..\\..\\src\\game\\BattleGroundAV.cpp(891) : error C2677: '[' binaire : aucun opérateur global trouvé qui accepte le type 'BG_AV_OTHER_VALUES' (ou il n'existe aucune conversion acceptable)
..\\..\\src\\game\\BattleGroundAV.cpp(895) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(896) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(897) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(898) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(899) : error C2109: un indice requiert un type tableau ou pointeur
..\\..\\src\\game\\BattleGroundAV.cpp(901) : error C2109: un indice requiert un type tableau ou pointeur

Link to comment
Share on other sites

no, sorry i pushed the wrong things :x

also i did many new commits now, but cause i haven't tested them all yet i won't push them to bg2db directly they can be previewed in: http://github.com/balrok/mangos/commits/bg2db9

i added many changes suggested by triply, improved some code, and then added functions for checking at db-loading if all events are there (found even a missing event with that^^) or if some eventids are wrong in database

but for the last part i have to think about a better system cause i implement many redundant functions which should get into one

so maybe tomorrow or the day after it i can again release a version which can be tested

also i will update bg2db_av then.. which should be added as own branch without bg2db (cause it actualy must have everythin from bg2db inside it to make sense)

edit put up a bg2db10 branch - there i cleaned up bg2db9 (merged commits together) and removed the pointer-thing which was slower and no good idea :)

Link to comment
Share on other sites

sorry for the delay - i just wanted to write a _small_ patch to avoid that spiritguides can be seen by everyone - but then vladimir and triply told me to get rid of some old hacks and then i had to debug through the whole spellsystem to find out how to let dead creatures cast spells

so in bg2db branch now i moved spiritguides out of battleground code and into sd2 (i've included a sd2.patch in /mangos/ directory)

- it's a bit bad, that now spiritguides won't work without sd2 :-/

but also i think it isn't ok to implement such scripting functions into bg-code too.. also i could imagine to move in future every bg into sd2 (cause mostly bgs are just scripted instances/maps)

about alterac valley: cause i did much rewritings, i just wanted to wait until the dust has set :) cause i'm quite content with the current state now i will update the bg2db_av branch too and look forward to see triply or vladimir to talk about my patches (mostly the newest spell-things need to be talked about - i'm pretty unfamilar with spellcode :x)

and if you would test the patch, it will also be great - cause else i have to do hotfixes in future

so for installing - use branch bg2db

then apply sql: sql/updates/9999_* sql/not_for_master*

then use sd2 and apply inside it mangos/sd2.patch

then apply the sql ScriptDev2/scripts/battleground/bg.sql

i tested everything and couldn't find any error

edit: untested bg2db_av branch uploaded - will post again here, when i tested it

Link to comment
Share on other sites

opcodes are still handled by mangos - and also the opcode answer (my first plan was to move the answer into sd2 - but wasn't that good)

but i have to change in database npc_flags for spiritguides, cause prior this those flags was set through code - and without them you can't talk to spiritguides

---

for bg2db_av: it's now ready - had to make some changes which will get soon into bg2db too

also i added there the bonusweekends (untested - but wasn't a big change anyway, so shouldn't harm)

Link to comment
Share on other sites

ok now in mangos [8554]

as noted in the last commit, you'll need database-content (posted the extracted spawns in http://udbforums.org/index.php?topic=14328.0 )

and scriptdev2 for working spiritguides (not yet committed there)

ah i noticed that i forgot the thanks part in my patch..

so at this place a very big thanks to triply who helped with getting a good blueprint and for reviewing

and also vladimir for reviewing and discussion :)

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use