Items that raise skills

Users who are viewing this thread

Hello friends. I am new to modding, yada yada, searched for my question, blah blah blah  :smile: . I'd like to create an item that adds points to a skill, specifically a sword that adds to ironflesh and power strike, and possible other skills if I really want to play dirty. I have the sword done. It works perfectly, but I do not know how to make it add points to a skill. Is there a tutorial out there, and if not can an honorable member of our esteemed community offer assistance in the creation of one?

Many thanks, et cetera.
 
Check out script_game_get_skill_modifier_for_troop. Note that if you want it to check if the player is wielding it (and not merely holding it in the inventory) iterate through inventory slots 0 to 4 instead of the range specified in script_get_troop_item_amount (or use the
Code:
troop_has_item_equipped
operation).
 
Thank you Caitularity, but I am attempting to edit items in a mod already made. I don't think the tool you gave me does this. Somebody, where can one find script_game_get_skill_modifier_for_troop?
 
search "script_game_get_skill_modifier_for_troop" in module scripts

NORMAL:
  # script_game_get_skill_modifier_for_troop
  # This script is called from the game engine when a skill's modifiers are needed
  # INPUT: arg1 = troop_no, arg2 = skill_no
  # OUTPUT: trigger_result = modifier_value
  ("game_get_skill_modifier_for_troop",
  [(store_script_param, ":troop_no", 1),
    (store_script_param, ":skill_no", 2),
    (assign, ":modifier_value", 0),
    (try_begin),
      (eq, ":skill_no", "skl_wound_treatment"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_wound_treatment_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
    (else_try),
      (eq, ":skill_no", "skl_trainer"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_training_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
    (else_try),
      (eq, ":skill_no", "skl_surgery"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_surgery_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
  #This is try checks for if item is equipped in a slo

add behind
    (else_try),
      (eq, ":skill_no", "skl_athletics"),
      (troop_get_inventory_slot,":cur_item1",":troop_no",ek_item_0),#Here we are getting items from slots 0,1,2,3
  (troop_get_inventory_slot,":cur_item2",":troop_no",ek_item_1),#Those slots are where weapons are placed.
  (troop_get_inventory_slot,":cur_item3",":troop_no",ek_item_2),#We get them all to a different :local. Now all those :local variables are equal to one of the items in slots.
  (troop_get_inventory_slot,":cur_item4",":troop_no",ek_item_3),#Then we check each item, if it is the one we want.
  (this_or_next|eq, ":cur_item1", "itm_hood_black_mask"),#These are conditions similar to the conditions above.
  (this_or_next|eq, ":cur_item2", "itm_hood_black_mask_w"),#But we check multiple variables, so we use this_or_next|
      (this_or_next|eq, ":cur_item3", "itm_hood_black_mask_r"),#As the name suggests it is either this contion or the next.
      (eq, ":cur_item4", "itm_hood_mask_master"),#Since this one is the last one we don't need this_or_next. When any of the items is the item we want the script succeds.
      (val_add, ":modifier_value", 3),#And when succeded adds 3.
(else_try),
      (eq, ":skill_no", "skl_athletics"),
      (troop_get_inventory_slot,":cur_item1",":troop_no",ek_item_0),#Here we are getting items from slots 0,1,2,3
  (troop_get_inventory_slot,":cur_item2",":troop_no",ek_item_1),#Those slots are where weapons are placed.
  (troop_get_inventory_slot,":cur_item3",":troop_no",ek_item_2),#We get them all to a different :local. Now all those :local variables are equal to one of the items in slots.
  (troop_get_inventory_slot,":cur_item4",":troop_no",ek_item_3),#Then we check each item, if it is the one we want.
  (this_or_next|eq, ":cur_item1", "itm_hood_black_mask_g"),#These are conditions similar to the conditions above.
  (this_or_next|eq, ":cur_item2", "itm_hood_black_mask_b"),#But we check multiple variables, so we use this_or_next|
  (this_or_next|eq, ":cur_item3", "itm_hood_black_mask_v"),#As the name suggests it is either this contion or the next.
  (eq, ":cur_item4", "itm_hood_black_mask_master"),#Since this one is the last one we don't need this_or_next. When any of the items is the item we want the script succeds.
  (val_add, ":modifier_value", 3),#And when succeded adds 3.
    (else_try),
  (eq, ":skill_no", "skl_athletics"),
  (troop_get_inventory_slot,":cur_item1",":troop_no",ek_item_0),#Here we are getting items from slots 0,1,2,3
  (troop_get_inventory_slot,":cur_item2",":troop_no",ek_item_1),#Those slots are where weapons are placed.
  (troop_get_inventory_slot,":cur_item3",":troop_no",ek_item_2),#We get them all to a different :local. Now all those :local variables are equal to one of the items in slots.
  (troop_get_inventory_slot,":cur_item4",":troop_no",ek_item_3),#Then we check each item, if it is the one we want.
  (this_or_next|eq, ":cur_item1", "itm_hood_mask"),#These are conditions similar to the conditions above.
  (this_or_next|eq, ":cur_item2", "itm_hood_mask_w"),#But we check multiple variables, so we use this_or_next|
  (this_or_next|eq, ":cur_item3", "itm_hood_mask_r"),#As the name suggests it is either this contion or the next.
  (eq, ":cur_item4", "itm_hood_mask_g"),#Since this one is the last one we don't need this_or_next. When any of the items is the item we want the script succeds.
  (val_add, ":modifier_value", 3),#And when succeded adds 3.
(else_try),
  (eq, ":skill_no", "skl_athletics"),
  (troop_get_inventory_slot,":cur_item1",":troop_no",ek_item_0),#Here we are getting items from slots 0,1,2,3
  (troop_get_inventory_slot,":cur_item2",":troop_no",ek_item_1),#Those slots are where weapons are placed.
  (troop_get_inventory_slot,":cur_item3",":troop_no",ek_item_2),#We get them all to a different :local. Now all those :local variables are equal to one of the items in slots.
  (troop_get_inventory_slot,":cur_item4",":troop_no",ek_item_3),#Then we check each item, if it is the one we want.
  (this_or_next|eq, ":cur_item1", "itm_hood_mask_b"),#These are conditions similar to the conditions above.
  (this_or_next|eq, ":cur_item2", "itm_hood_mask_v"),#But we check multiple variables, so we use this_or_next|
  (this_or_next|eq, ":cur_item3", "itm_ninja_armor"),#As the name suggests it is either this contion or the next.
  (eq, ":cur_item4", "itm_ninja_boots"),#Since this one is the last one we don't need this_or_next. When any of the items is the item we want the script succeds.
  (val_add, ":modifier_value", 3),#And when succeded adds 3.


my example
  # script_game_get_skill_modifier_for_troop
  # This script is called from the game engine when a skill's modifiers are needed
  # INPUT: arg1 = troop_no, arg2 = skill_no
  # OUTPUT: trigger_result = modifier_value
  ("game_get_skill_modifier_for_troop",
  [(store_script_param, ":troop_no", 1),
    (store_script_param, ":skill_no", 2),
    (assign, ":modifier_value", 0),
    (try_begin),
      (eq, ":skill_no", "skl_wound_treatment"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_wound_treatment_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
    (else_try),
      (eq, ":skill_no", "skl_trainer"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_training_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
    (else_try),
      (eq, ":skill_no", "skl_surgery"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_surgery_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
  #This is try checks for if item is equipped in a slot
    (else_try),
      (eq, ":skill_no", "skl_athletics"),
      (troop_get_inventory_slot,":cur_item1",":troop_no",ek_item_0),#Here we are getting items from slots 0,1,2,3
  (troop_get_inventory_slot,":cur_item2",":troop_no",ek_item_1),#Those slots are where weapons are placed.
  (troop_get_inventory_slot,":cur_item3",":troop_no",ek_item_2),#We get them all to a different :local. Now all those :local variables are equal to one of the items in slots.
  (troop_get_inventory_slot,":cur_item4",":troop_no",ek_item_3),#Then we check each item, if it is the one we want.
  (this_or_next|eq, ":cur_item1", "itm_hood_black_mask"),#These are conditions similar to the conditions above.
  (this_or_next|eq, ":cur_item2", "itm_hood_black_mask_w"),#But we check multiple variables, so we use this_or_next|
      (this_or_next|eq, ":cur_item3", "itm_hood_black_mask_r"),#As the name suggests it is either this contion or the next.
      (eq, ":cur_item4", "itm_hood_mask_master"),#Since this one is the last one we don't need this_or_next. When any of the items is the item we want the script succeds.
      (val_add, ":modifier_value", 3),#And when succeded adds 3.
(else_try),
      (eq, ":skill_no", "skl_athletics"),
      (troop_get_inventory_slot,":cur_item1",":troop_no",ek_item_0),#Here we are getting items from slots 0,1,2,3
  (troop_get_inventory_slot,":cur_item2",":troop_no",ek_item_1),#Those slots are where weapons are placed.
  (troop_get_inventory_slot,":cur_item3",":troop_no",ek_item_2),#We get them all to a different :local. Now all those :local variables are equal to one of the items in slots.
  (troop_get_inventory_slot,":cur_item4",":troop_no",ek_item_3),#Then we check each item, if it is the one we want.
  (this_or_next|eq, ":cur_item1", "itm_hood_black_mask_g"),#These are conditions similar to the conditions above.
  (this_or_next|eq, ":cur_item2", "itm_hood_black_mask_b"),#But we check multiple variables, so we use this_or_next|
  (this_or_next|eq, ":cur_item3", "itm_hood_black_mask_v"),#As the name suggests it is either this contion or the next.
  (eq, ":cur_item4", "itm_hood_black_mask_master"),#Since this one is the last one we don't need this_or_next. When any of the items is the item we want the script succeds.
  (val_add, ":modifier_value", 3),#And when succeded adds 3.
    (else_try),
  (eq, ":skill_no", "skl_athletics"),
  (troop_get_inventory_slot,":cur_item1",":troop_no",ek_item_0),#Here we are getting items from slots 0,1,2,3
  (troop_get_inventory_slot,":cur_item2",":troop_no",ek_item_1),#Those slots are where weapons are placed.
  (troop_get_inventory_slot,":cur_item3",":troop_no",ek_item_2),#We get them all to a different :local. Now all those :local variables are equal to one of the items in slots.
  (troop_get_inventory_slot,":cur_item4",":troop_no",ek_item_3),#Then we check each item, if it is the one we want.
  (this_or_next|eq, ":cur_item1", "itm_hood_mask"),#These are conditions similar to the conditions above.
  (this_or_next|eq, ":cur_item2", "itm_hood_mask_w"),#But we check multiple variables, so we use this_or_next|
  (this_or_next|eq, ":cur_item3", "itm_hood_mask_r"),#As the name suggests it is either this contion or the next.
  (eq, ":cur_item4", "itm_hood_mask_g"),#Since this one is the last one we don't need this_or_next. When any of the items is the item we want the script succeds.
  (val_add, ":modifier_value", 3),#And when succeded adds 3.
(else_try),
  (eq, ":skill_no", "skl_athletics"),
  (troop_get_inventory_slot,":cur_item1",":troop_no",ek_item_0),#Here we are getting items from slots 0,1,2,3
  (troop_get_inventory_slot,":cur_item2",":troop_no",ek_item_1),#Those slots are where weapons are placed.
  (troop_get_inventory_slot,":cur_item3",":troop_no",ek_item_2),#We get them all to a different :local. Now all those :local variables are equal to one of the items in slots.
  (troop_get_inventory_slot,":cur_item4",":troop_no",ek_item_3),#Then we check each item, if it is the one we want.
  (this_or_next|eq, ":cur_item1", "itm_hood_mask_b"),#These are conditions similar to the conditions above.
  (this_or_next|eq, ":cur_item2", "itm_hood_mask_v"),#But we check multiple variables, so we use this_or_next|
  (this_or_next|eq, ":cur_item3", "itm_shinobi_armor"),#As the name suggests it is either this contion or the next.
  (eq, ":cur_item4", "itm_ninja_boots"),#Since this one is the last one we don't need this_or_next. When any of the items is the item we want the script succeds.
  (val_add, ":modifier_value", 3),#And when succeded adds 3.
    (try_end),#Ends Trying For Skills.
    (set_trigger_result, ":modifier_value"),#This the execution of the scipt: :troop_no gets :modifier_value bonus to :skill_no.
]),
 
Back
Top Bottom