Jump to content

Is there any way to make a weapon add extra damage based on what class is wielding it?


Recommended Posts

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

 

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...