# 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.
]),