Jump to content

New conditions system


Schmoozerd
 Share

Recommended Posts

This thread is about the new conditions system, which is intended to replace the current condition handling.

(Faramir's version)

The basic idea is:

Wrap up all conditions into one table, called `conditions`, and refer to this table from loot or gossips directly by entry.

To be able to have complicated conditions (like HasAura AND NotHasItem), two Meta-Conditions for AND (-1) and OR (-2) are introduced.

Reason for this:

Advantages:

* Less space in the database

* More powerfull concept

* Easier to add conditions to other places

Disadvantes:

* Harder to read (always require an additional join - or a set of joins)

* Harder to port entries from tables with conditions between different DB-projects

* Converting requires some additional tool (realized with a non-optimal working python script)

To Test

Source Code for core changes can be found here: http://paste2.org/p/1975570

or on my github repo: https://github.com/Schmoozerd/mangos/commits/condition_system

You need to apply the file sql/updates/66666_01_conditions.sql

An Update for current UDB 404 can be found here: http://paste2.org/p/1975572

An Update for current YTDB 618 can be found here: http://paste2.org/p/1975574

You can generate the SQL changes yourself easily with the python tool located within contrib/ConvertConditions

This is extremely usefull to use if you have many custom conditions - you then just can use a clean conditions table for starters, and rebase your custom conditions on top of them.

NOTE: I have currently reserved the condition_entries 1-99 for mangos' use, please do not fill them with custom data!

In the moment the system coexists with old conditions for gossip-system, but REPLACES the condition in the *_loot_template(s), so you must apply the SQLs or no loot-condition will exist.

I think there is no rush in directly removing the old conditions from the database, this will happen some time after the new conditions system is applied.

For easier work with the new conditions, faramir wrote a helper tool, located on his github repo: http://github.com/faramir118/MangosUtil/

Please feedback test-results :)

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