DavidW Posted June 11, 2022 Share Posted June 11, 2022 It works fine for me with the default no projectile; code here. DEFINE_PATCH_FUNCTION weapon_damage_by_class INT_VAR header=0 // the weapon header to which the effect is applied probability1=100 // the probabilities for the effect to be applied probability2=0 STR_VAR class="" // the class which gets the effect (from class.ids) spell="" // a spell which is cast on the target on a successful hit, but only if the wielder is the correct class BEGIN LPF ADD_ITEM_EFFECT INT_VAR type=99 header probability1 probability2 opcode=326 target=1 timing=1 parameter1=IDS_OF_SYMBOL (class "%class%") parameter2=105 STR_VAR resource="%spell%" END END CREATE spl dw-dagg INNER_PATCH_SAVE ab_data "" BEGIN // add new ability INSERT_BYTES 0x0 0x28 WRITE_BYTE 0x0 1 WRITE_SHORT 0x2 4 WRITE_BYTE 0xc 1 WRITE_SHORT 0x22 1 WRITE_SHORT 0x24 1 WRITE_SHORT 0x26 1 // projectile = None END WRITE_SHORT 0x68 1 WRITE_LONG 0x6a 0x9a INSERT_BYTES 0x72 0x28 WRITE_ASCII 0x72 "%ab_data%" LPF ADD_SPELL_EFFECT INT_VAR opcode=12 // damage target=2 timing=1 parameter2=0x10000*0x10 // piercing parameter1=5 // base damage dicenumber=1 // variable damage dicesize=4 END COPY_EXISTING "dagg01.itm" "override/dw-dagg.itm" LPF weapon_damage_by_class STR_VAR class=MAGE spell=dw-dagg END Quote Link to comment
RoyalProtector Posted June 11, 2022 Author Share Posted June 11, 2022 (edited) Alright, I changed it to "None" (was "Default"), and it works now. Much appreciated, now I can continue on my quest to make daggers not useless compared to other weapons. Edited June 11, 2022 by RoyalProtector Quote Link to comment
RoyalProtector Posted July 27, 2023 Author Share Posted July 27, 2023 By the way, how would you go about doing this script for every dagger? I assume we can do some looping and some type checking to find if it's a dagger or not, and patch them all that way. Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.