Ammo Swapping - shastaxc/silver-libs GitHub Wiki
Handles swapping of ammo for ranged weapons (including archery, marksmanship, and throwing). Simply define the ammo you wish to use in the enabling function for different situations (default, magic damage, accuracy, etc) and your ammo will swap when it needs to.
Implementation
Ensure you have the silibs precast hook in your job lua. See the Installation page for more details.
If Using Mote Libs
If the specified functions already exist, just put the silibs part inside of it in the appropriate spot. Please add the following:
function job_setup()
silibs.enable_handle_ammo_swaps({
...ammo assignment here...
})
end
If Using Selindrile Libs
If the specified functions already exist, just put the silibs part inside of it in the appropriate spot. Please add the following in your char_job_gear.lua file:
function user_job_setup()
silibs.enable_handle_ammo_swaps({
...ammo assignment here...
})
end
Ammo Assignment Format
In the enabling function (shown above) you must define the ammo you wish to use in specific circumstances for each range weapon type. The weapon types are:
- Bow
- Crossbow
- Gun_or_Cannon
And the different ammo types are:
- Default: Used most of the time. It is also the fallback option in case you don't have any of the other ammo.
- Accuracy: Used in high accuracy situations.
- Physical_Weaponskill_Ranged: Used for ranged physical weaponskills.
- Magic_Damage: Used when you are dealing magic damage.
- Magic_Accuracy: Used for Light Shot and Dark Shot. You can exclude if not COR.
- Quick_Draw: Used when performing Quick Draws (not Light or Dark). This ammo is never consumed. You can exclude if not COR.
- Physical_Weaponskill_Melee: Used for melee physical weaponskills.
- Magical_Weaponskill_Melee: Used for melee magical weaponskills.
An example for a RNG:
silibs.enable_handle_ammo_swaps({
Bow = {
Default = "Chrono Arrow",
Accuracy = "Yoichi's Arrow",
Physical_Weaponskill_Ranged = "Chrono Arrow",
Magic_Damage = "Chrono Arrow",
Magic_Accuracy = "Chrono Arrow",
Physical_Weaponskill_Melee = "Hauksbok Arrow", -- Does not get consumed
Magical_Weaponskill_Melee = "Hauksbok Arrow", -- Does not get consumed
},
Crossbow = {
Default = "Quelling Bolt",
Accuracy = "Quelling Bolt",
Physical_Weaponskill_Ranged = "Quelling Bolt",
Magic_Damage = "Quelling Bolt",
Magic_Accuracy = "Quelling Bolt",
Physical_Weaponskill_Melee = "Hauksbok Bolt", -- Does not get consumed
Magical_Weaponskill_Melee = "Hauksbok Bolt", -- Does not get consumed
},
Gun_or_Cannon = {
Default = "Chrono Bullet",
Accuracy = "Eradicating Bullet",
Physical_Weaponskill_Ranged = "Chrono Bullet",
Magic_Damage = "Devastating Bullet",
Magic_Accuracy = "Devastating Bullet",
Physical_Weaponskill_Melee = "Hauksbok Bullet", -- Does not get consumed
Magical_Weaponskill_Melee = "Hauksbok Bullet", -- Does not get consumed
}
})
An example for COR:
silibs.enable_handle_ammo_swaps({
Gun_or_Cannon = {
Default = "Chrono Bullet",
Accuracy = "Devastating Bullet",
Physical_Weaponskill_Ranged = "Chrono Bullet",
Magic_Damage = "Living Bullet",
Magic_Accuracy = "Devastating Bullet",
Quick_Draw = "Hauksbok Bullet", -- Does not get consumed
Physical_Weaponskill_Melee = "Hauksbok Bullet", -- Does not get consumed
Magical_Weaponskill_Melee = "Hauksbok Bullet", -- Does not get consumed
}
})