* [Bots] Add support for Bot scripting.
# Perl
- Add support for `zone/bot.pl` and `zone/bot_v#.pl`.
- Add support for `global/global_bot.pl`.
- Add `$bot->SignalBot(signal_id)` to Perl.
- Add `$bot->OwnerMessage(message)` to Perl.
- Add `$entity_list->SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Perl.
- Add `$entity_list->SignalBotByBotID(bot_id, signal_id)` to Perl.
- Add `$entity_list->SignalBotByBotName(bot_name, signal_id)` to Perl.
- Add `EVENT_SPELL_EFFECT_BOT` to Perl.
- Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Perl.
# Lua
- Add support for `zone/bot.lua` and `zone/bot_v#.lua`.
- Add support for `global/global_bot.lua`.
- Add `bot:SignalBot(signal_id)` to Lua.
- Add `bot:OwnerMessage(message)` to Lua.
- Add `entity_list:SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Lua.
- Add `entity_list:SignalBotByBotID(bot_id, signal_id)` to Lua.
- Add `entity_list:SignalBotByBotName(bot_name, signal_id)` to Lua.
- Add `EVENT_SPELL_EFFECT_BOT` to Lua.
- Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Lua.
# Supported Bot Events
1. `EVENT_CAST`
2. `EVENT_CAST_BEGIN`
3. `EVENT_CAST_ON`
4. `EVENT_COMBAT`
5. `EVENT_DEATH`
6. `EVENT_DEATH_COMPLETE`
7. `EVENT_SAY`
8. `EVENT_SIGNAL`
9. `EVENT_SLAY`
10. `EVENT_SLAY_NPC`
11. `EVENT_SPAWN`
12. `EVENT_TARGET_CHANGE`
13. `EVENT_TIMER`
14. `EVENT_USE_SKILL`
# Common
- Convert NPC pointers in common events to Mob pointers so bots are supported.
- Convert signal IDs to `int` where it wasn't already, allowing negative signals to be sent properly.
* Add EVENT_POPUP_RESPONSE.
* Cleanup and fix EVENT_COMBAT/EVENT_SLAY/EVENT_NPC_SLAY.
* Fix DoNPCEmote calls.
* Update attack.cpp
* Update event_codes.h
* Update bot_command.cpp
* [Bots] Add Quest API Support for Limits.
# Perl
- Add `$client->GetBotCreationLimit()` to Perl.
- Add `$client->GetBotCreationLimit(class_id)` to Perl.
- Add `$client->GetBotRequiredLevel()` to Perl.
- Add `$client->GetBotRequiredLevel(class_id)` to Perl.
- Add `$client->GetBotSpawnLimit()` to Perl.
- Add `$client->GetBotSpawnLimit(class_id)` to Perl.
- Add `$client->SetBotCreationLimit(creation_limit)` to Perl.
- Add `$client->SetBotCreationLimit(creation_limit, class_id)` to Perl.
- Add `$client->SetBotRequiredLevel(required_level)` to Perl.
- Add `$client->SetBotRequiredLevel(required_level, class_id)` to Perl.
- Add `$client->SetBotSpawnLimit(spawn_limit)` to Perl.
- Add `$client->SetBotSpawnLimit(spawn_limit, class_id)` to Perl.
- Add `$entity_list->GetBotListByCharacterID(character_id, class_id)` to Perl.
# Lua
- Add `client:GetBotCreationLimit()` to Lua.
- Add `client:GetBotCreationLimit(class_id)` to Lua.
- Add `client:GetBotRequiredLevel()` to Lua.
- Add `client:GetBotRequiredLevel(class_id)` to Lua.
- Add `client:GetBotSpawnLimit()` to Lua.
- Add `client:GetBotSpawnLimit(class_id)` to Lua.
- Add `client:SetBotCreationLimit(creation_limit)` to Lua.
- Add `client:SetBotCreationLimit(creation_limit, class_id)` to Lua.
- Add `client:SetBotRequiredLevel(required_level)` to Lua.
- Add `client:SetBotRequiredLevel(required_level, class_id)` to Lua.
- Add `client:SetBotSpawnLimit(spawn_limit)` to Lua.
- Add `client:SetBotSpawnLimit(spawn_limit, class_id)` to Lua.
- Add `entity_list:GetBotListByCharacterID(character_id, class_id)` to Lua.
# Notes
- Allows operators to set creation and spawn limits based on class, as well as required level.
- Using the class-inspecific methods sets the global limit or required level.
- Global limits are checked prior to class-specific limits and if they are not met, creation or spawn is disallowed.
- Modified preexisting Quest API to make use of this new stuff under the hood.
* Update bot_command.cpp
* Add client bot file.
* [Quest API] Add SendGMCommand() to Perl/Lua.
# Perl
- Add `$client->SendGMCommand(message)` to Perl.
- Add `$client->SendGMCommand(message, ignore_status)` to Perl.
# Lua
- Add `client:SendGMCommand(message)` to Lua.
- Add `client:SendGMCommand(message, ignore_status)` to Lua.
# Notes
- `ignore_status` allows you to have players use GM commands that they are not the required status level for through the Quest API.
- `ignore_status` is default false, so if you don't send it, it checks and makes sure the player can use the command you're sending before allowing it.
* Typo.
* Formatting.
* Change #scribespells to be aware of spellgroups & ranks
* Formatting
* Fix Formatting, and change stored return data type to match function return type.
* Compact If Statements
* Implemented SQL Query to reduce number of iterations required.
* Cleaned up Query, and improved performance
* Cleaned up SQL Queries
* Formatting
* Indenting fix.
* Update client.cpp
* Fix Formatting in spells.cpp
* Fix ValueWithin.
Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
Co-authored-by: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com>
This required some minor shared task refactoring
- Shared task expiration handling was moved to world. Previously this
was handled by zone and had clients self remove when a shared task
expired. This resulted in wrong messages when a task ended.
- FailTask is now implemented for shared tasks which previously only
made the client quit the shared task. It now fails the task for all
members by ending the shared task.
The `Client::EndSharedTask` api will end the client's current shared
task (removing all members). This is similiar to the `FailTask` api
except it doesn't require a `task_id` and the red task fail banner is
optional (live doesn't use it for shared tasks).
The global `end_dz_task` api was added for when a client context isn't
available. This will end a shared task if the current zone is a dynamic
zone for a shared task mission. Currently only shared tasks use dynamic
zones but this api can be expanded if support is added for tasks/quests.
The global `get_dz_task_id` was added to conveniently get the task id
for the current dynamic zone if it's used for a mission. Note this is
a database hit since that information is not available at zone level.
This fixes a bug that allowed looting items from a player's corpse to
increment a task if it didn't have an npc target defined. It looks
like this bug existed before the changes in 7482cfc0.
This also now passes count for task loot updates to handle item stacks.
Also fixes incorrectly casting Corpse to NPC on loot update
* Figured out Popup Windows
* SendPopupToClient, and response works
* Added Popup logic
* Didn't use WriteSpellInfoSection function
* Misc fixes, DB String ID 11004 now referenced as a constant
* Remove use of "this"
* Added "else" statement to return if "AllowSpellMemorizeFromItem" rule is not used
Some live npcs ignore the request cooldown timer (tutorialb)
A separate function had to be used for perl because the apis use an
array instead of array reference which won't allow a bool overload
This also replaces the fixed array and count args with a vector
* Add faction logging category
Probably should use this for more things
* Add FactionAssociation struct
This is simply just a struct that contains an array of faction ids and
multiplier. This can hold a maximum of 10 entries (Seru hit is 8, so 2
extra) this can be raised if need be.
* Add database changes and other data point changes
This is all the database changes and loading changes
Included is an optional SQL that will be used as a starting point, there
is likely errors or typos, but we will fix those as they are discovered.
* Add Client::RewardFaction function
This just takes the faction ID and the magnitude of the primary faction
hit and calculates the rest.
The minimum change will be either 1 or -1. We stop processing after we
see an ID of 0 and assume there will be no later entries.
The primary faction ID will always receive a hit even if there is no
faction association entries
* Add users of RewardFaction to NPC death, tasks, and QuestRewards
This will only use the new system if the magnitude is set, otherwise we
will just use the old system still
* Add quest system calls and lua QuestReward support
* Add #factionassociation command
This just calls RewardFaction, mostly useful for debugging
The task goal system made implementing tasks a little confusing since
the goal could be ambiguous depending on type. This also didn't support
filtering on multiple goals (e.g. looting items from matching npc names
inside an area). Deliver types could specify an npc id in `delivertonpc`
but the database may have multiple npcs with the same name or a task
might want to match partial npc names.
This replaces goalids with explicit fields for npcs, items, proximity
areas, and touch switch ids. These changes make managing task data
easier without needing to update multiple tables and allows filtering
task updates by multiple criteria. To mitigate any performance impact
from merging task proximities, only clients with explore tasks in the
current zone are checked during client movement updates.
Items and npcs still support goallists but it would be possible to
denormalize entries into delimited strings to combine with the match
lists. This would also decouple task goals from reward lists.
The client task update functions were refactored to run through a single
filtering function which significantly reduces duplicated code from the
legacy task system. This will also make it easier to later implement
any unhandled types.
Since the new fields will handle filtering single entries and lists
based on having values set, `goalmethod` now only distinguishes quest
controlled from source controlled.
This is a breaking api change, `taskexploredarea` has been removed
since explore ids no longer exist.
* [Code Cleanup] Zone data loading refactor
* Update client_packet.cpp
* strcpy adjustments
* Ensure safe points get reloaded properly
* Simplify GetPEQZone and getZoneShutDownDelay
* Bring in zone_store where needed
* Update client.cpp
* Signature
* Signature
* Convert helpers to using pointers
* PR comment
* Update worlddb.cpp
* Fix loading for instances
* Fix zoning with fallback as well
* Another place for instance fallback
- Add $client->GetRecipeMadeCount(recipe_id) to Perl.
- Add $client->HasRecipeLearned(recipe_id) to Perl.
- Add quest::getrecipemadecount(recipe_id) to Perl.
- Add quest::getrecipename(recipe_id) to Perl.
- Add quest::hasrecipelearned(recipe_id) to Perl.
- Add client:GetRecipeMadeCount(recipe_id) to Lua.
- Add client:HasRecipeLearned(recipe_id) to Lua.
- Add eq.get_recipe_made_count(recipe_id) to Lua.
- Add eq.get_recipe_name(recipe_id) to Lua.
- Add eq.has_recipe_learned(recipe_id) to Lua.
* [Bug Fix] Fix Silent Saylinks Sending Message to Others.
Silent saylinks wouldn't send to sender, but to everyone else, so they could see what your saylinks were.
Added an optional `is_silent` bool to ChannelMessageReceived to account for this where necessary.
* Nullptr fix.
* [Quest API] Add Player Teleport Methods.
These methods will allow server operators to teleport players directly to other players via the quest API using the #goto command's functionality.
- Add $client->TeleportToPlayerByCharID(character_id) to Perl.
- Add $client->TeleportToPlayerByName(player_name) to Perl.
- Add $client->TeleportGroupToPlayerByCharID(character_id) to Perl.
- Add $client->TeleportGroupToPlayerByName(player_name) to Perl.
- Add $client->TeleportRaidToPlayerByCharID(character_id) to Perl.
- Add $client->TeleportRaidToPlayerByName(player_name) to Perl.
- Add client:TeleportToPlayerByCharID(character_id) to Lua.
- Add client:TeleportToPlayerByName(player_name) to Lua.
- Add client:TeleportGroupToPlayerByCharID(character_id) to Lua.
- Add client:TeleportGroupToPlayerByName(player_name) to Lua.
- Add client:TeleportRaidToPlayerByCharID(character_id) to Lua.
- Add client:TeleportRaidToPlayerByName(player_name) to Lua.
* Simplify by using repositories
* Simplify
Co-authored-by: Akkadius <akkadius1@gmail.com>
* [Feature] Add Instance Version Support to Experience Modifiers.
Allows Operators to set experience modifiers to be instance version specific so that you can have different versions of the same zone have different modifiers. If there is not one found, it defaults to zone_id 0 for global and instance_veresion -1 for global.
* Update zonedb.cpp
* Typo.
This allows shared tasks to create dz instances automatically through
the `dz_template_id` field instead of using quest scripts. Quest apis
were also added to create expeditions from template ids.
This changes task touch elements to use the dz_switch_id as the goal id
instead of checking if a player zoned. It will remove the need to script
door clicks or modify task element zone field since task packet data can
just be imported.
This adds the `dz_switch_id` field to doors and dynamic_zones. It will
allow for compasses to be automatically added to dz entrances and will
support moving clients to the dz on use without needing to script it.
These can be imported for switches/doors from live packet dumps.
Also removes compass packet encoders (same struct in all clients)
* Add shared task element locking
This adds the `lock_activity_id` field to the tasks table which will
automatically lock a shared task when that element becomes active.
A method was added to world analogous to zone's UnlockActivities to
determine when an activity is active with respect to task steps.
Also adds quest apis to manually lock or unlock a client's shared task
* Add comment
* [Feature] GM State Change Persistance
- Flymode and Invulnerable will now persist over zoning.
- Appended GMSpeed, Flymode and Invulnerable to the hideme message GMs see when they first login.
- Added #godmode [on/off] command to turn on or off hideme, flymode, gmspeed and invulnerable all in one shot.
- /becomenpc will now disable tells to the target player. It will also automatically disable GM States that interfere with its functionality.
- GM Command /toggle will not properly turn tells on/off
- GMs will now be notified if they are ignoring tells when they first zone-in, provided their GM flag is up.
- Added TellsOff variable to the output to #showstats
* [Bug] Fix tells when gmhideme is turned off.
* [Cleanup] Cleanup function and rename for consistancy.
Remove un-needed this->
* Tweaks
* Tweaks
* Update db_update_manifest.txt
* Move string building logic to a vector and use strings join
* Update client_packet.cpp
* Update 2022_07_28_gm_state_changes.sql
* PR comment tweaks
Co-authored-by: Akkadius <akkadius1@gmail.com>
* Update logic checks everywhere for FVNoDropFlag.
FVNoDropFlag == 0 is disabled
FVNoDropFlag == 1 is enabled for everyone
FVNoDropFlag == 2 is enabled for Admin() >= Character:MinStatusForNoDropExemptions
* Adding extra parenthesis to reduce ambiquity of order of operations for FVNoDropFlag checks
* Move FVNoDropFlag checks into a helper function in emu_constants.cpp and make an enum for the possible values.
Added console warning if setting is outside of allowed values.
* Move to client scoped helper method
Co-authored-by: Akkadius <akkadius1@gmail.com>
* [Quest API] Add TrackNPC to Perl/Lua.
- Add quest::tracknpc(entity_id) to Perl.
- Add eq.track_npc(entity_id) to Lua.
- This will allow server operators to arbitrarily Track NPCs for clients with scripts.
- Modified tracking to auto turn off and tell you that you discovered your target if within 10 units, this is to allow scripted Tracking to turn off without the need for the Tracking skill.
* Remove unnecessary DoTracking() call.
* Update client.cpp
* [Cleanup] Cleanup spell and max level bucket logic.
- Spell buckets will now allow new mob->SetBucket() buckets since most people use these now.
- Max level bucket will now allow new mob->SetBucket() bucket since most people use these now.
- Clean up GetScribeableSpells() and GetLearnableDisciplines() logic and magic numbers.
- Make GetClientMaxLevel() uint8 instead of int since it can only be 0-255.
* Fix typo from other commit.
* Lua setter.
* Update client.cpp
* [Titles] Cleanup titles, title suffix, and last name methods.
- Use strings instead of const chars*.
- Add optional parameter to SetAATitle in Lua so you can save to the database similar to Perl.
- Cleanup #lastname command.
- Cleanup #title command.
- Cleanup #titlesuffix command.
* Update npc.cpp
- Add $client->TaskSelector(task_list) to Perl.
- Add client:TaskSelector({task_list}) to Lua.
- Allow $client->AssignTask(task_id) in Perl.
- Allow client:AssignTask(task_id) in Lua.
- Can now assign tasks in scripts without the NPC ID parameter.
* [Commands] #reload Command Overhaul.
- Consolidated #reloadaa, #reloadallrules, #reloadcontentflags, #reloademote, #reloadlevelmods, #reloadmerchants, #reloadperlexportsettings, #reloadqst, #reloadstatic, #reloadtitles, #relaodtraps, #reloadworld, and #reloadzps in to one command.
- #reload has 15 different sub commands you may use, including Log Settings and Tasks reloading.
- All the reload commands are a part of the Developer Tools Menu messages now, as well as part of the documentation.
- Fixes the commands that weren't actually sending their packet to zone server to globally reload stuff.
- Added Variables table reloading to command.
* Consistency.
* Hot reload.
* Final big push.
* [Merchants] Add Merchant Data Bucket capability.
- Allows server operators to limit merchant items based on data bucket values and comparisons.
- Adds 3 columns, bucket_name, bucket_value, and bucket_comparison to merchantlist table.
- Bucket is checked based on GetBucketKey()-bucket_name.
- Buckets are mass loaded when using the merchant so it's not a database call per item, just a grouping of all their buckets from the start.
- This is a nearly year old pull request redone for master.
- bucket_comparison Values are as follows:
- bucket_comparison 0: bucket_name == bucket_value
- bucket_comparison 1: bucket_name != bucket_value
- bucket_comparison 2: bucket_name >= bucket_value
- bucket_comparison 3: bucket_name <= bucket_value
- bucket_comparison 4: bucket_name > bucket_value
- bucket_comparison 5: bucket_name < bucket_value
- bucket_comparison 6: bucket_name is any of pipe(|)-separated bucket_value
- bucket_comparison 7: bucket_name is not any of pipe(|)-separated bucket_value
- bucket_comparison 8: bucket_name is between first and second value of pipe(|)-separated bucket_value
- bucket_comparison 9: bucket_name is not between first and second value of pipe(|)-separated bucket_value
* Revert query change.
* [Commands] Cleanup #reloadzps Command.
- Cleanup messages and logic.
- Make reloading of zone points global instead of zone specific.
* Further cleanup.
- Add zone->GetZoneDescription().
- Add mob->GetTargetDescription(mob).
* Final cleanup.
* Typo.
* [Commands] Add additional #peqzone functionality.
- Add #peqzone flagging capabilities so operators don't have to blanket allow #peqzone access to zones.
- Allows you to set a zone's `peqzone` column to `2` and disallow use of `#peqzone` until they have been given the appropriate flag.
- Add #peqzone_flags command to list your #peqzone flags similar to #flags command.
- Add `character_peqzone_flags` table to database and database_schema.h.
- Required SQL update to add the new table.
- Add client:ClearPEQZoneFlag(zone_id) to Lua.
- Add client:HasPEQZoneFlag(zone_id) to Lua.
- Add client:LoadPEQZoneFlags() to Lua.
- Add client:LoadZoneFlags() to Lua.
- Add client:SendPEQZoneFlagInfo(client) to Lua.
- Add client:SetPEQZoneFlag(zone_id) to Lua.
- Add $client->ClearPEQZoneFlag(zone_id) to Perl.
- Add $client->HasPEQZoneFlag(zone_id) to Perl.
- Add $client->LoadPEQZoneFlags() to Perl.
- Add $client->SendPEQZoneFlagInfo(client) to Perl.
- Add $client->SetPEQZoneFlag(zone_id) to Perl.
* Fixes.
* [Quest API] Add AddPlatinum(), GetCarriedPlatinum() and TakePlatinum() to Perl/Lua.
- Allows for easier NPC interactions.
- GetCarriedPlatinum() adds together all currencies in inventory based on conversion amounts so it works easily with removals/checks.
- Add $client->AddPlatinum(platinum, update_client) to Perl.
- Add $client->GetCarriedPlatinum() to Perl.
- Add $client->TakePlatinum(platinum, update_client) to Perl.
- Add client:AddPlatinum(platinum, update_client) to Lua.
- Add client:GetCarriedPlatinum() to Lua.
- Add client:TakePlatinum(platinum, update_client) to Lua.
* Formatting.
* invulnerable
* modifier
* fix
* fix
* fix
* [API] Perl functions to set invulnerable to and modify environmental damage.
* [API] Perl and Lua functions to set invulnerable to and modify environmental damage.
credit to kinglykrab for lua
* [Spells] Fix for numhits type 7 counter incrementing incorrectly.
* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.
bot fix
* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.
mercs
* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.
remove old variable and related code.
* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.
comments
* escape fix for different target types
* implemented max level for fade
* test
* update
* update
* support modern limits
* Update ruletypes.h
* update
* [Spells] Support for SPA 194 SE_FadingMemories to use max level checks on aggroed mobs
not sure why this code got removed, maybe merge error.
* recast timer updates
* reworked
* removed unneeded param
* fix expendible AA
* fixed
* Update spells.cpp
* [Spells] Fix for AA and Discipline recast timers being set on spell casting failure.
don't check recasts from triggered spells.
* test
* complete
* Update effects.cpp
* Update spells.cpp
* Update effects.cpp
* [Spells] Support for bards using Disciplines while casting or /melody.
Support for spell field 'cast not standing' not allow casting from divine aura
* [Spells] Support for bards using Disciplines while casting or /melody.
DA bypass logic for spells with field 'cast_not_standing'
* updates
* stun and mez bypass
* Update spdat.cpp
* Update spdat.cpp
* Update spells.cpp
* clean
* requirement messages
* update
* pct
* save work
* Reform code 1_22_22
* updated
* update id to pointer
* Update spells.cpp
* rework 2
* update 1_23_22
* Update spells.cpp
* updates
* msg string works
* fix disc timers not be set
* more optimization
* update 1_23_22 PM
moved stop casting out
charm and harmony moved in
* update 1_25_22
rework of functions
* updates 1_26_22
* remove old checks
* gm override added for some
* update bard AA casting checks
* updates
* addbuff exception for bard
* debugs
* charm working
* update
* moved skill check here
* cast from item while singing
* lets not attack mounts
* instant cast items click
* aug clicks working
* aug tests
Bug? Cast time not display on aug clicks for bards
* aug recast from items semi ok
* added item timer function
* unified setting item recast timer
* clean up time
* update
* bard AA cast updates
* debugs removed
* debugs removed
* clean up
* clean up
* better placement of bindsight and numhits fix
* move and rename function
* Update spells.cpp
* add logs
* delete old DoCastingChecks
* Removed old bard pulse functions
* remove AEBardPulse and GroupPulse
* removed Raid::GroupBardPulse
* Pulse Restriction: Divine Aura
* Pulse Restrictions : Fear behavior
* Update spells.cpp
* Update spells.cpp
* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.
bots...
* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.
added recommended isvalidspell check
* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.
merged
* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.
removed defines since we have them as constants
* [Skills] Exponential Decay Skill Up Formula
Added an exponential decay skill up formula option.
The current, linear, formula results in negative chances to skill up, which
have been mitigated via a multiplier and minimum of 1%
* [Skills]Configurable Exponential Decay Formala for Skill Up
What this fixes:
The existing formula for determining whether or not to skill up could result
in negative chances, and made an assumption around the number 252.
This would ultimately result in an override that would set the chance to 1.
My fix:
I created 2 new rules:
Character:SkillUpMaximumChancePercentage
Character:SkillUpMinimumChancePercentage
I changed the forumla to:
chance = ((max - min + skill_modification) * (.99^skill)) + min
This results in an exponential decay that starts at skill-modified maximum
and approaches minimum.
I decided that max-min+skill_modification should never be less than min
I also decided to continue to apply the Character:SkillUpModifier rule
post-calculation. I do not really think this is necessary anymore, given
this new formula, but we can discuss removing it.
I chose 25 and 2 as default maximum and minimum based on feel.
Related method signature fix:
Client::mod_increase_skill_chance was changed to return a double and
accept a double as an input for chance. This matches the actual data types
provided while calling the method and eliminates some type coersion and
resultant truncation. Right now, this method doesn't do anything, but in the
future we could implement skill-specific training dummies that accelerate
skill ups. I deduce that this is the purpose of this method call.
* [Skills]Configurable Exponential Decay Formula for Skill Up
What this fixes:
The existing formula for determining whether or not to skill up could result
in negative chances, and made an assumption around the number 252.
This would ultimately result in an override that would set the chance to 1.
My fix:
I created 2 new rules:
Character:SkillUpMaximumChancePercentage
Character:SkillUpMinimumChancePercentage
I changed the forumla to:
chance = ((max - min + skill_modification) * (.99^skill)) + min
This results in an exponential decay that starts at skill-modified maximum
and approaches minimum.
I decided that max-min+skill_modification should never be less than min
I also decided to continue to apply the Character:SkillUpModifier rule
post-calculation. I do not really think this is necessary anymore, given
this new formula, but we can discuss removing it.
I chose 25 and 2 as default maximum and minimum based on feel.
Related method signature fix:
Client::mod_increase_skill_chance was changed to return a double and
accept a double as an input for chance. This matches the actual data types
provided while calling the method and eliminates some type coersion and
resultant truncation. Right now, this method doesn't do anything, but in the
future we could implement skill-specific training dummies that accelerate
skill ups. I deduce that this is the purpose of this method call.
* fixup! [Skills]Configurable Exponential Decay Formula for Skill Up
* fixup! [Skills]Configurable Exponential Decay Formula for Skill Up