Kater Posted May 15, 2024 Group: Members Topic Count: 76 Topics Per Day: 0.20 Content Count: 175 Reputation: 2 Joined: 04/03/24 Last Seen: 1 hour ago Share Posted May 15, 2024 Hello friends, do you know where the adjustment is made so that when attacking and changing weapons, the effect of the changed weapon applies? famous switch. Example: Katar blade and exchange for dagger to increase damage Quote Link to comment Share on other sites More sharing options...
0 ckx_ Posted May 16, 2024 Group: Members Topic Count: 7 Topics Per Day: 0.01 Content Count: 26 Reputation: 4 Joined: 06/29/22 Last Seen: March 27 Share Posted May 16, 2024 So... you want to make it so that when you have a Katar equipped, and you swap to a Dagger, you gain a damage buff? If you give more details about your intended functionality and your level of technical ability to make code changes I can adjust my response to help you better. For now I'll just throw out some starting points for you to investigate. I would make a custom status for this by adding an entry in status_db.yml, then setup the status in source by adding it to the `sc_type` enum in status.hpp. You'll also want to export the enum in script_constants.hpp. Where you add a check for the SC to actually increase the damage is up to how you want it to stack. For starters, you can add a check for the SC in `battle_calc_cardfix` (if you want card style damage) or `battle_addmastery` (if you want it to add mastery style attack). It seems most straightforward to give the player the status somewhere in pc_equipitem (pc.cpp). You have a few options for implementation here. I'm going to say what I think is simplest to get you started then you can improve it through testing. 1) Store a reference near the top of the function to the player's current weapon type, e.g: `int oldweapon = sd->weapontype1` 2) Near the bottom of the function, sometime after sd->weapontype1 gets updated to id->subtype, do a simple check: if (oldweapon == W_KATAR && sd->weapontype1 == W_DAGGER) { sc_start(...) } I would throw this right after the assignment happens probably, so around here. Don't forget to brace the unbraced if statement, recompile, and try it out. Note that if you want this effect to happen for specific daggers as opposed to every dagger, then I would favor an approach that calls a buildin_func through the dagger's Equip Script. Quote Link to comment Share on other sites More sharing options...
Question
Kater
Hello friends, do you know where the adjustment is made so that when attacking and changing weapons, the effect of the changed weapon applies?
famous switch.
Example: Katar blade and exchange for dagger to increase damage
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.