Jump to content

Feature request - Check conditions in DB script


Xfurry
 Share

Recommended Posts

Hi,

I'm trying to create an advanced support for events scripts which should handle the World PvP areas, and even some battleground related logic, similar to the one used on retail.

My question and concern is: Is it possible to check conditions in a DB script? Or is it reasonable to implement such a feature?

I'm thinking about a similar conditioning system as the one in gossip scripts.

For execute creature script if creature has XXXX aura, eff idx YYY; or execute quest script if player has XXXX item with count YYYY; or execute event script if zone has world state XXXX with value YYY.

Link to comment
Share on other sites

it might be an idea to create a conditions table of the format

(id, cond-type, val1, val2) with id as primary key and (cond-type, val1, val2) as secondary key.

actually this is currently done internally in mangos (conditions are mapped to one condition id)

advantages:

* faster to load

* less space in the database

* easier to expand other systems with conditions, as a condition is only one collumn then and not three

disadvantages:

* way harder to read, because every condition requires an additional SELECT to the conditions table.

* Also harder to port database content with conditions between different db projects (though could be possible to unify to one conditions table (agreement of ids)..)

Now about the idea of conditions and db-scripts.

At first this would require some serious rework of the condition system, because the condition system currently works only with players - for db scripting this must be extended to also work on worldobjects.

Then ofc many conditions make no sense for db-scripting, only some special conditions like world-state values (or sd2-instance return values, which is a "bad" condition)

Link to comment
Share on other sites

In my opinion, if we can add a strong system which can check DB script conditions in a unified table completed by a feature which can handle map zone specific world states all pvp areas, including Battlegrounds and Wintergrasp can simply become a long list of DB queries which handle events, world states, gameobjects and creatures based on specific actions and conditions. So all hardcoded stuff we already have or we want to add in core can become DB scripts, similar to event AI scripts from SD2.

PS. Even some SD2 scripts could be moved to eventAI if the library would be extended to handle more events, for example movement or achiev criterias. ;)

Link to comment
Share on other sites

This sounds like a great idea. Plus, it has the added advantage of streamlining the core a bit and making things more modular, which should allow for adding new features and content in a simpler fashion rather than digging around in the guts of the server to hard-code a lot of things.

Link to comment
Share on other sites

The main idea of this feature is to add the possibility to script advanced events by using database tools. This basically involves scripts for world pvp and battlegrounds.

Currently I'm working on implementing a system which can send script events based on the pvp status of a capture point, along with other feature, suggested by Schmoozerd, which should handle the world state processing straight from database (you probably know that not all world states can be found in DBC).

The purpose of the topic is to motivate somebody to work on a conditioning system which would allow complex scripts to be run in DB. Honestly I don't have enough motivation and patience to work on this one either. :)

So the final goal of all these nice features would be to have all world pvp scripts, including Wintergrasp, implemented by using simple DB scripts.

You are probably wondering how is it possible. It's simple - each capture point send a script event based on the faction and the progress of the capture (that tiny progress bar which appears when you hold a tower - see Eye of the Storm). Then this events are processed by the DB script and summon creatures, change world states, apply zone buffs, etc.

For Wintergrasp, you should know that the destructible buildings also send events on damaged, destroyed and rebuild, and these can also be used in the battlefield script. (Of course you'll need some more code to handle grouping and battlefield mechanics first, but this is only the basic stuff).

This also applies to Battlegrounds if the core would support a strong system which can handle missing DBC spells, which are a lot in the pvp systems.

Link to comment
Share on other sites

Having the ability to script in db does make it easier to get things done. Having said that I think db scripting has its place and scripting a BG in the db is a bit past its bounds. :)

You don't have to script the full BG in database. But some simple stuff can be handled in DB. Or you can have a mix event handling - core + DB, similar to what we have in SD2 for event scripting.

For example you could script the Hellfire Peninsula pvp system only in DB if the proper tools were provided because it's simple, but you can't handle timed events - like the lock period for the Terokkar pvp area.

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