How do you deal with a negative OPCODE? Like:
Also, would love it if someone could show me how to make this piece of code:
only effect certain items, rather than ALL. Pretty much just want it to apply to wooden clubs and lances.
Code:
OPCODE -2147481944
Also, would love it if someone could show me how to make this piece of code:
Code:
common_weapon_break = (0.4, 0, 0, [], [
(try_for_agents, ":agent_id"),
(agent_get_attack_action, reg0, ":agent_id"),
(eq,reg0,3), #completing attack
#Cruger MODIFICATION BEGIN----------------------------------------------------------------------------
#Cruger MODIFICATION END------------------------------------------------------------------------------
(agent_get_wielded_item,":breakweapon",":agent_id",0),
(gt,":breakweapon",itm_no_item),
(item_get_type, ":weapontype", ":breakweapon"),
(store_random_in_range,":weaponbreakchance",1,100),
(try_begin),
(eq,itp_type_polearm,":weapontype"),
# (display_message, "@Polearm"),
(val_mul,":weaponbreakchance",3.01),
# (else_try),
# (eq,itp_type_two_handed_wpn,":weapontype"),
# # (display_message, "@2 hander"),
# (val_mul,":weaponbreakchance",1),
# (else_try),
# (eq,itp_type_one_handed_wpn,":weapontype"),
# # (display_message, "@1 hander"),
# (val_mul,":weaponbreakchance",1),
(try_end),
(agent_get_horse,":agent_mounted",":agent_id"),
(try_begin),
(ge,":agent_mounted",0),
# (display_message, "@Mounted."),
(val_mul,":weaponbreakchance",3.01),
(try_end),
(try_begin),
(ge,":weaponbreakchance",20), #chief cambiado
(agent_unequip_item,":agent_id",":breakweapon"),
#Cruger MODIFICATION BEGIN----------------------------------------------------------------------------
(get_player_agent_no, ":player_agent_id"),
(try_begin),
(eq, ":agent_id", ":player_agent_id"),
(play_sound,"snd_shield_broken",),
(display_message, "@Hah! Your weapon broke. This can not be repaired until the end of the battle"),
(try_end),
#Cruger MODIFICATION END------------------------------------------------------------------------------
(lt,":agent_mounted",0),
(agent_set_animation, ":agent_id", "anim_strike_chest_front"),
(try_end),
(try_end),
])
only effect certain items, rather than ALL. Pretty much just want it to apply to wooden clubs and lances.