topaz-next / topaz

💎 A server emulator for Final Fantasy XI.
GNU General Public License v3.0
55 stars 81 forks source link

[RoE] Implement weekly objectives, sparks exchange limit, voucher storage and exchange #2486

Closed ghost closed 3 years ago

ghost commented 3 years ago

I affirm:

Temporary:

This implements a lot of various items, which are as follows:

Records of Eminence NPCs All Records of Eminence NPCs will now accept and store copper vouchers. In addition, copper vouchers can now be exchanged for both currencies and provisions.

Note: At the current time, Escha Silt is not implemented in the database for storage. Current NPC behavior is to remove the currency, though no points will be awarded. The map server will report a database error, should a player attempt to purchase it!

Weekly Sparks Exchange Limit Exchange limit has been implemented, and is flag configurable. Current settings follow default retail behavior (enabled, maximum limit of 100000 sparks exchanged).

From settings.lua:

ENABLE_EXCHANGE_LIMIT = 1 -- Enable Maximum limit of sparks spent per Week (default retail behavior: 1)
WEEKLY_EXCHANGE_LIMIT = 100000 -- Maximum amount of sparks that can be spent per week (default retail value: 100000)

Currency Caps Currency caps have been added for Unity Accolades, Ballista Points, Sparks of Eminence, and Valor Points. Currently, this is only implemented for the sparks vendor, but CLuaBaseEntity::addCurrency() now supports an optional argument to allow passing a maximum limit.

From settings.lua

-- Currency Caps (Change at your own risk!)
CAP_CURRENCY_ACCOLADES = 99999
CAP_CURRENCY_BALLISTA  = 2000
CAP_CURRENCY_SPARKS    = 99999
CAP_CURRENCY_VALOR     = 50000

Weekly RoE Objectives Weekly RoE objectives have been implemented, and similar to the exchange limit, are reset at JP midnight on the week transition. Weekly objectives can be declared by setting the flag "weekly" within the RoE record. A sample has been provided for RoE ID #3367 - "Signet, brb (W)"

Note: Many weekly objectives have triggers that are not common to other objectives. For this sample, onRecordTrigger is called directly in conquest.lua. This may change over time as common groupings are discovered.

Core Changes Outside of roe-specific changes to support resets, the following common functions have been modified, but should have no impact on previous function:

CLuaBaseEntity::addCurrency(std::string const& currencyType, int32 amount, sol::object const& maxObj)

addCurrency now supports an optional cap to be passed to charutils::AddPoints(). No argument, or a nil value passed will function as previously implemented.

CLuaBaseEntity::setCharVar() database function has been moved to charutils::SetCharVar() which the binding now references.