Оружия после удара будут периодически наносить противнику урон.
Инструкция по добавлению:
Добавляем эту строку в module_constants.py:
Цитата
slot_agent_is_poisoned = 30
Находим скрипт game_get_item_extra_text в module_scripts и добавляем следующие строки в конец скрипта:
Цитата
(else_try),
(this_or_next|eq, ":item_no", "itm_falchion"), #This is a list of weapons that should have poison effect
(eq, ":item_no", "itm_arrows"),
(try_begin),
(eq, ":extra_text_id", 0),
(set_result_string, "@Poisoned"),
(set_trigger_result, 0x3F8000),
(try_end),
]),
(this_or_next|eq, ":item_no", "itm_falchion"), #This is a list of weapons that should have poison effect
(eq, ":item_no", "itm_arrows"),
(try_begin),
(eq, ":extra_text_id", 0),
(set_result_string, "@Poisoned"),
(set_trigger_result, 0x3F8000),
(try_end),
]),
Следующие строки добавляем в module_mission_templates:
Цитата
poison1 = (ti_on_agent_hit, 0, 0, [], [
(store_trigger_param_1, ":victim"),
(store_trigger_param_2, ":attacker"),
(store_trigger_param, ":missile", 5),
#Here we should add weapons that were listed before. Note that weapons are added in reg0 and missiles in ":missile"
variable. It is important. Also do keep in mind that in this case, throwing weapons are treated as missiles
(this_or_next|eq, reg0, "itm_falchion"),
(eq, ":missile", "itm_arrows"),
(try_begin),
(agent_get_slot, ":is_poisoned", ":victim", slot_agent_is_poisoned),
(get_player_agent_no, ":player"),
(agent_get_horse, ":p_horse", ":player"),
(try_begin),
(eq, ":attacker", ":player"),
(neq, ":is_poisoned", 1),
(try_begin),
(neg|agent_is_human, ":victim"),
(display_message, "@You have poisoned a horse!", 0x3F8000),
(agent_set_slot, ":victim", slot_agent_is_poisoned, 1),
(else_try),
(display_message, "@You have poisoned the enemy!", 0x3F8000),
(agent_set_slot, ":victim", slot_agent_is_poisoned, 1),
(try_end),
(else_try),
(eq, ":victim", ":player"),
(neq, ":is_poisoned", 1),
(display_message, "@You are poisoned!", 0x3F8000),
(agent_set_slot, ":victim", slot_agent_is_poisoned, 1),
(else_try),
(eq, ":victim", ":p_horse"),
(neq, ":is_poisoned", 1),
(display_message, "@Your horse is poisoned!", 0x3F8000),
(agent_set_slot, ":victim", slot_agent_is_poisoned, 1),
(else_try),
(neq, ":is_poisoned", 1),
(agent_set_slot, ":victim", slot_agent_is_poisoned, 1),
(try_end),
(try_end),
])
poison2 = (1, 0, 0, [], [
(try_for_agents,":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_get_slot, ":is_poisoned", ":cur_agent", slot_agent_is_poisoned),
(eq, ":is_poisoned", 1),
(try_begin),
(store_agent_hit_points,":agent_hp",":cur_agent", 0),
(val_sub,":agent_hp", 1),
(agent_set_hit_points,":cur_agent",":agent_hp", 0),
(le,":agent_hp", 1),
(remove_agent,":cur_agent"),
(try_end),
(try_end),
])
poison3 = (ti_on_agent_killed_or_wounded, 0, 0, [], [
(store_trigger_param_1, ":victim"),
(agent_get_troop_id, ":troop", ":victim"),
(str_store_troop_name, s33, ":troop"),
(agent_get_slot, ":is_poisoned", ":victim", slot_agent_is_poisoned),
(try_begin),
(eq, ":is_poisoned", 1),
(agent_is_human, ":victim"),
(troop_is_hero, ":troop"),
(display_message, "@{s33} fainted of poison.", 0x3F8000),
(set_trigger_result, 2),
(else_try),
(eq, ":is_poisoned", 1),
(agent_is_human, ":victim"),
(display_message, "@{s33} died of poison.", 0x3F8000),
(set_trigger_result, 1),
(else_try),
(eq, ":is_poisoned", 1),
(display_message, "@Horse died of poison.", 0x3F8000),
(set_trigger_result, 1),
(try_end),
])
(store_trigger_param_1, ":victim"),
(store_trigger_param_2, ":attacker"),
(store_trigger_param, ":missile", 5),
#Here we should add weapons that were listed before. Note that weapons are added in reg0 and missiles in ":missile"
variable. It is important. Also do keep in mind that in this case, throwing weapons are treated as missiles
(this_or_next|eq, reg0, "itm_falchion"),
(eq, ":missile", "itm_arrows"),
(try_begin),
(agent_get_slot, ":is_poisoned", ":victim", slot_agent_is_poisoned),
(get_player_agent_no, ":player"),
(agent_get_horse, ":p_horse", ":player"),
(try_begin),
(eq, ":attacker", ":player"),
(neq, ":is_poisoned", 1),
(try_begin),
(neg|agent_is_human, ":victim"),
(display_message, "@You have poisoned a horse!", 0x3F8000),
(agent_set_slot, ":victim", slot_agent_is_poisoned, 1),
(else_try),
(display_message, "@You have poisoned the enemy!", 0x3F8000),
(agent_set_slot, ":victim", slot_agent_is_poisoned, 1),
(try_end),
(else_try),
(eq, ":victim", ":player"),
(neq, ":is_poisoned", 1),
(display_message, "@You are poisoned!", 0x3F8000),
(agent_set_slot, ":victim", slot_agent_is_poisoned, 1),
(else_try),
(eq, ":victim", ":p_horse"),
(neq, ":is_poisoned", 1),
(display_message, "@Your horse is poisoned!", 0x3F8000),
(agent_set_slot, ":victim", slot_agent_is_poisoned, 1),
(else_try),
(neq, ":is_poisoned", 1),
(agent_set_slot, ":victim", slot_agent_is_poisoned, 1),
(try_end),
(try_end),
])
poison2 = (1, 0, 0, [], [
(try_for_agents,":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_get_slot, ":is_poisoned", ":cur_agent", slot_agent_is_poisoned),
(eq, ":is_poisoned", 1),
(try_begin),
(store_agent_hit_points,":agent_hp",":cur_agent", 0),
(val_sub,":agent_hp", 1),
(agent_set_hit_points,":cur_agent",":agent_hp", 0),
(le,":agent_hp", 1),
(remove_agent,":cur_agent"),
(try_end),
(try_end),
])
poison3 = (ti_on_agent_killed_or_wounded, 0, 0, [], [
(store_trigger_param_1, ":victim"),
(agent_get_troop_id, ":troop", ":victim"),
(str_store_troop_name, s33, ":troop"),
(agent_get_slot, ":is_poisoned", ":victim", slot_agent_is_poisoned),
(try_begin),
(eq, ":is_poisoned", 1),
(agent_is_human, ":victim"),
(troop_is_hero, ":troop"),
(display_message, "@{s33} fainted of poison.", 0x3F8000),
(set_trigger_result, 2),
(else_try),
(eq, ":is_poisoned", 1),
(agent_is_human, ":victim"),
(display_message, "@{s33} died of poison.", 0x3F8000),
(set_trigger_result, 1),
(else_try),
(eq, ":is_poisoned", 1),
(display_message, "@Horse died of poison.", 0x3F8000),
(set_trigger_result, 1),
(try_end),
])
Все готово для использования.