[DERS] Mod'a Freelancer Eklemek

Users who are viewing this thread

Senin modul system niye türkçe :grin:
O en alttaki hatalar için enlisted diyor ya, başında dolar işareti olmadan varrieble dosyasına yaz, bu dosya modul systemin içinde.
 

RoadWarriror

Master Knight
WBNWWF&S
X0VqP7.png

Abi ben böyle bir hata alıyorum yardım edermisin.
 
Öncelikle bu ilk dersim. Hatalarım varsa affedin.
Module Constans:
Code:
#+FREELANCER start
freelancer_version = 13
#Floris or no Diplomacy:
freelancer_can_use_item  = "script_troop_can_use_item"
#with Diplomacy:
#freelancer_can_use_item = "script_dplmc_troop_can_use_item"


#Party Slots
slot_party_orig_morale = slot_party_ai_rationale
slot_freelancer_equip_start = 100 #only used for freelancer_party_backup
slot_freelancer_version     = slot_freelancer_equip_start - 2 #only used for freelancer_party_backup

#Faction Slot
slot_faction_freelancer_troop = 101 #should be unused

#Troop Slots
slot_troop_freelancer_start_xp   =  slot_troop_signup   #110 -only used for player
slot_troop_freelancer_start_date =  slot_troop_signup_2 #111 -only used for player

plyr_mission_vacation = 1
#+Freelancer end

Module Game Menus şunu bulun:
Code:
  ("notification_relieved_as_marshal", mnf_disable_all_keys,
    "{s4} wishes to inform you that your services as marshal are no longer required. In honor of valiant efforts on behalf of the realm over the last {reg4} days, however, {reg8?she:he} offers you a purse of {reg5} denars.",
    "none",
    [
    (assign, reg4, "$g_player_days_as_marshal"),
   

   
    (store_div, ":renown_gain", "$g_player_days_as_marshal",4),
    (val_min, ":renown_gain", 20),
    (store_mul, ":denar_gain", "$g_player_days_as_marshal", 50),
    (val_max, ":denar_gain", 200),
    (val_min, ":denar_gain", 4000),
    (troop_add_gold, "trp_player", ":denar_gain"),
    (call_script, "script_change_troop_renown", "trp_player", ":renown_gain"),
    (assign, "$g_player_days_as_marshal", 0),
    (assign, "$g_dont_give_marshalship_to_player_days", 15),
    (assign, reg5, ":denar_gain"),
   
    (faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
    (str_store_troop_name, s4, ":faction_leader"),
    (troop_get_type, reg8, ":faction_leader"),
    ],
   
     [
      ("continue",[],"Continue",
       [        
         (change_screen_return),        
       ]),        
    ]
  ),
Altına bunu ekleyin:
Module Meshes en altına:
Mission Templates en üstüne:
Code:
# (ti_on_agent_hit, 0, 0,
       # [],
    # [           (store_trigger_param_1, ":unused"),     
            # (store_trigger_param_2, ":agent"), #Trigger parameter 2 for this trigger is the attacker agent. Parameter 1 is the hit agent.
            # (agent_is_human, ":agent"),
            # (agent_is_alive, ":agent"),
       
        # (agent_get_wielded_item,":breakweapon",":agent",0),
       
        # (is_between,":breakweapon","itm_wooden_stick","itm_awlpike_long"), #change this to set the items you want to break               
                       
        # (store_random_in_range,":weaponbreakchance",1,150),
# #--Cabadrin imod Quality Modifier
       # (agent_get_troop_id, ":troop_id", ":agent"),
       # (try_begin),    #only heroes have item modifications
           # (troop_is_hero, ":troop_id"),
           # (try_for_range, ":item_slot", ek_item_0, ek_head),    # heroes have only 4 possible weapons (equipped)
               # (troop_get_inventory_slot, reg8, ":troop_id", ":item_slot"),  #Find Item Slot with same item ID as Equipped Weapon
               # (eq, reg8, ":breakweapon"),
               # (troop_get_inventory_slot_modifier, ":imod", ":troop_id", ":item_slot"),
           # (try_end),
       # (else_try),
           # (assign, ":imod", imodbit_plain),
       # (try_end),
# #Better than Average
# #I know i'm totally wrong with most of them, just go on and edit the values as you want
       # (try_begin),
           # (eq, imodbit_masterwork, ":imod"),
           # (val_min,":weaponbreakchance",9),#1%
       # (else_try),
           # (eq, imodbit_tempered, ":imod"),
           # (val_min,":weaponbreakchance",8),#2%
       # (else_try),
           # (eq, imodbit_balanced, ":imod"),
           # (val_add,":weaponbreakchance",3),
       # (else_try),
           # (eq, imodbit_heavy, ":imod"),
           # (val_add,":weaponbreakchance",2),
       # (else_try),
           # (eq, imodbit_plain, ":imod"),
           # (val_add,":weaponbreakchance",1),
   # #Worse than Average
       # (else_try),
           # (eq, imodbit_bent, ":imod"),
           # (val_add,":weaponbreakchance",4),
       # (else_try),
           # (eq, imodbit_rusty, ":imod"),
           # (val_add,":weaponbreakchance",7),
       # (else_try),
           # (eq, imodbit_chipped, ":imod"),
           # (val_add,":weaponbreakchance",8),
       # (else_try),
           # (eq, imodbit_cracked, ":imod"),
           # (val_add,":weaponbreakchance",15),
       # (try_end),
    # #--End imod Quality Modifier
               # (try_begin),  
            # (ge,":weaponbreakchance",140),
            # (agent_unequip_item,":agent",":breakweapon"),
            # (str_store_item_name, s0, ":breakweapon"),
            # (try_begin),
                # (get_player_agent_no, ":player_agent"),
                # (eq, ":agent", ":player_agent"),
                # (troop_remove_item, "trp_player", ":breakweapon"),
                # (display_message, "@You broke your {s0}.",0xFF0000),
                # (else_try),
                   # #(agent_get_troop_id, ":troop", ":agent"),
                # (str_store_troop_name,s1,":troop_id"),
                # (display_message, "@{s1} broke his {s0}.",0x66FF33),
                    # (agent_set_animation, ":agent", "anim_strike_chest_front"),
                # (assign, ":weapon_broke", 1),
                            # (else_try),
                                # (agent_get_horse,":horse",":agent"),
                   # #(agent_get_troop_id, ":troop", ":agent"),
                                # (str_store_troop_name,s1,":troop_id"),
                # (display_message, "@{s1} broke his {s0}.",0x66FF33),
                    # (agent_set_animation, ":agent", "anim_strike_chest_front"),#You need to replace this animation with the horseman's strike
                # (assign, ":weapon_broke", 1),
            # (try_end),
        # (try_end), 
    # ]),

# (ti_on_agent_killed_or_wounded, 0, 0, [(store_trigger_param_2, ":killer_agent_no"),(eq, ":killer_agent_no", "$fplayer_agent_no")],
   # [
    # (store_trigger_param_1, ":dead_agent_no"),
    # (neg|agent_is_ally, ":dead_agent_no"),
    # (agent_is_human, ":dead_agent_no"),   
    # (val_add, "$killcount", 1),
   # ]),
   
# END OF FREELANCER TRIGGERS
Module Parties:
Code:
 ("freelancer_party_backup","{!}",  pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
Presentations:
Code:
# __Freelancer Report: Commander_:Start_________________________________________________

  ("taragoth_lords_report", 0, mesh_load_window, [

    (ti_on_presentation_load,
    [
        (presentation_set_duration, 999999),
        (set_fixed_point_multiplier, 1000),

        #title
        (create_text_overlay, reg0, "@CURRENT COMMANDER'S REPORT!", tf_left_align),
        (position_set_x, pos1, 50),
        (position_set_y, pos1, 650),
        (overlay_set_position, reg0, pos1),
        (position_set_x, pos1, 1500),
        (position_set_y, pos1, 1500),
        (overlay_set_size, reg0, pos1),
       
        #Player Name
        #(create_text_overlay, reg0, "@'{playername}'", tf_center_justify),
        #(position_set_x, pos1, 500),
        #(position_set_y, pos1, 615),
        #(overlay_set_position, reg0, pos1),

        (assign, ":cur_y_adder", 40),  #the amount of space between lines
        (assign, ":cur_y", 580),
        (position_set_x, pos1, 50),       
       
        #Commander_name
        (str_store_troop_name, s19, "$enlisted_lord"),
        (create_text_overlay, reg0, "@Your Commander: {s19}", tf_left_align),   
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg0, pos1),
        (val_sub, ":cur_y", ":cur_y_adder"),

        #Player_Relation
        (call_script, "script_troop_get_player_relation", "$enlisted_lord"),
        #(assign, ":commander_relation", reg0),
        (create_text_overlay, reg0, "@Commander Relation: {reg0}", tf_left_align),
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg0, pos1),
        (val_sub, ":cur_y", ":cur_y_adder"),

        #Faction_name
        (store_faction_of_troop, reg1, "$enlisted_lord"),
        (str_store_faction_name, s20, reg1),
        (create_text_overlay, reg0, "@Enlisted Faction: {s20}", tf_left_align),
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg0, pos1),
        (val_sub, ":cur_y", ":cur_y_adder"),

        #Rank_name
        (str_store_troop_name, s21, "$player_cur_troop"),
        (create_text_overlay, reg0, "@Current Rank: {s21}", tf_left_align),
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg0, pos1),
        (val_sub, ":cur_y", ":cur_y_adder"),
       
        #xp-to-next promotion
        (troop_get_slot, ":service_xp_start", "trp_player", slot_troop_freelancer_start_xp),
        (troop_get_xp, ":service_xp_cur", "trp_player"),
        (val_sub, ":service_xp_cur", ":service_xp_start"),
        (troop_get_upgrade_troop, ":upgrade_troop", "$player_cur_troop", 0),
        (str_store_string, s1, "@N/A"),
        (try_begin),
            (gt, ":upgrade_troop", 1), #make sure troop is valid and not player troop
            (call_script, "script_game_get_upgrade_xp", "$player_cur_troop"),
            (store_sub, reg0, reg0, ":service_xp_cur"), #required XP from script
            (gt, reg0, 0),
            (str_store_string, s1, "str_reg0"),
        (try_end),
        (create_text_overlay, reg0, "@Experience to next promotion: {s1}", tf_left_align),
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg0, pos1),
        (val_sub, ":cur_y", ":cur_y_adder"),

        #enlisted_time
        (store_current_day, ":cur_day"),
        (troop_get_slot, ":service_day_start", "trp_player", slot_troop_freelancer_start_date),
        (store_sub, ":service_length", ":cur_day", ":service_day_start"),
        (assign, reg20, ":service_length"),
        (create_text_overlay, reg0, "@Days in service: {reg20}", tf_left_align),
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg0, pos1),
        (val_sub, ":cur_y", ":cur_y_adder"),

        #current_wage
        (store_character_level, ":level", "$player_cur_troop"),
        #pays player 10 times the troop level
        (store_mul, ":weekly_pay", 10, ":level"),
        (assign, reg23, ":weekly_pay"),
        (create_text_overlay, reg0, "@Current Wage: {reg23} denars.", tf_left_align),
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg0, pos1),
        (val_sub, ":cur_y", ":cur_y_adder"),
       
        #next_pay
        (str_store_date, s25, "$g_next_pay_time"),
        (create_text_overlay, reg0, "@Next Pay/Promotion day: {s25}", tf_left_align),
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg0, pos1),
        (val_sub, ":cur_y", ":cur_y_adder"),

        #Commanders_troops size(right side)
        (store_party_size_wo_prisoners,":army_size","$enlisted_party"),
        (assign, reg26, ":army_size"),
        (create_text_overlay, reg0, "@Army size: {reg26}", tf_left_align),
        (position_set_x, pos1, 800),
        (position_set_y, pos1, 60),
        (overlay_set_position, reg0, pos1),
        (position_set_x, pos1, 900),
        (position_set_y, pos1, 900),
        (overlay_set_size, reg0, pos1),

        #commanders_army_title
        (create_text_overlay, reg0, "@Commander's Army", tf_left_align),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 430),
        (overlay_set_position, reg0, pos1),

        #camp  pic       
        (create_mesh_overlay, reg0, "mesh_pic_camp"),
        (position_set_x, pos1, 450),
        (position_set_y, pos1, 380),
        (overlay_set_position, reg0, pos1),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 500),
        (overlay_set_size, reg0, pos1),   
         #Faction arms(try_end),
        
        (store_faction_of_troop, ":cmdr_faction", "$enlisted_lord"),
        (try_begin),
            (eq, ":cmdr_faction","fac_kingdom_1"),
            (create_mesh_overlay, reg0, "mesh_pic_arms_swadian"),
        (else_try),
            (eq, ":cmdr_faction","fac_kingdom_2"),
            (create_mesh_overlay, reg0, "mesh_pic_arms_vaegir"),
        (else_try),
            (eq, ":cmdr_faction","fac_kingdom_3"),
            (create_mesh_overlay, reg0, "mesh_pic_arms_khergit"),
        (else_try),
            (eq, ":cmdr_faction","fac_kingdom_4"),
            (create_mesh_overlay, reg0, "mesh_pic_arms_nord"),
        (else_try),
            (eq, ":cmdr_faction","fac_kingdom_5"),
            (create_mesh_overlay, reg0, "mesh_pic_arms_rhodok"),
        (else_try),
            (eq, ":cmdr_faction","fac_kingdom_6"),
            (create_mesh_overlay, reg0, "mesh_pic_sarranid_arms"),
        (try_end),

        (position_set_x, pos1, 180),
        (position_set_y, pos1, 80),
        (overlay_set_position, reg0, pos1),
        (position_set_x, pos1, 600),
        (position_set_y, pos1, 600),
        (overlay_set_size, reg0, pos1),

        (str_clear, s0),
        (create_text_overlay, "$g_presentation_obj_bugdet_report_container", s0, tf_scrollable_style_2),
        (position_set_x, pos1, 560),
        (position_set_y, pos1, 100),
        (overlay_set_position, "$g_presentation_obj_bugdet_report_container", pos1),
        (position_set_x, pos1, 400),
        (position_set_y, pos1, 300),
        (overlay_set_area_size, "$g_presentation_obj_bugdet_report_container", pos1),
        (set_container_overlay, "$g_presentation_obj_bugdet_report_container"), #all of this above here puts the list of troops in a scrollable box

        (assign, ":cur_y_adder", 40),  #the amount of space between lines
        (party_get_num_companion_stacks, ":num_of_stacks", "$enlisted_party"),
        (store_mul, ":cur_y", ":num_of_stacks", ":cur_y_adder"),
 
        (try_for_range, ":i", 1, ":num_of_stacks"), #1, to skip the commander
            (party_stack_get_troop_id, ":troop_id", "$enlisted_party", ":i"),
            (party_stack_get_size, ":stack_size", "$enlisted_party", ":i"),
            (party_stack_get_num_wounded, ":stack_wounded", "$enlisted_party", ":i"),
            (val_sub, ":stack_size", ":stack_wounded"),
                       
            (str_store_troop_name, s1, ":troop_id"),
            (create_text_overlay, reg0, s1),
            (position_set_x, pos1, 25),
            (position_set_y, pos1, ":cur_y"),
            (overlay_set_position, reg0, pos1),
            (position_set_x, pos1, 900),
            (position_set_y, pos1, 900),
            (overlay_set_size, reg0, pos1),
           
           
            (assign, reg0, ":stack_size"),
            (create_text_overlay, reg0, "str_reg0"),
            (position_set_x, pos1, 325),
            (position_set_y, pos1, ":cur_y"),
            (overlay_set_position, reg0, pos1),
            (position_set_x, pos1, 900),
            (position_set_y, pos1, 900),
            (overlay_set_size, reg0, pos1),

           
            (val_sub, ":cur_y", ":cur_y_adder"),
        (try_end), #End Stack/Troop Loop

        (set_container_overlay, -1), #end the box so you can keep putting other things elsewhere
   
        #done button
        (create_game_button_overlay, "$g_presentation_obj_custom_battle_designer_19", "@Done", tf_center_justify),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 25),
        (overlay_set_position, "$g_presentation_obj_custom_battle_designer_19", pos1),

    ]),
    (ti_on_presentation_event_state_change,
    [
        (store_trigger_param_1, ":object"),
        (try_begin),
            (eq, ":object", "$g_presentation_obj_custom_battle_designer_19"),
            (presentation_set_duration, 0),
        (try_end),
    ]),
   ]),

# _____________________________________________________________________________END______
Quests:
Code:
  ("freelancer_enlisted", "Enlisted in the Party of {s13}", 0,
   "{!}You are currently enlisted in the party of {s13} of {s14}."),
  ("freelancer_vacation", "Enlisted: On Leave", 0,
   "{!}You have been granted leave from the party of {s13} of {s14}."),
  ("freelancer_captured", "Enlisted: Captured", 0,
   "{!}Your commander's party has been defeated and you have been captured. Return to the service of {s13} of {s14}."),

simple_triggers:
Code:
#+freelancer start
  #  WEEKLY PAY AND CHECKS FOR UPGRADE

    (24 * 7, [
        (eq, "$freelancer_state", 1),
        (troop_get_slot, ":service_xp_start", "trp_player", slot_troop_freelancer_start_xp),
        (troop_get_xp, ":player_xp_cur", "trp_player"),
        (store_sub, ":service_xp_cur", ":player_xp_cur", ":service_xp_start"),

        #ranks for pay levels and to upgrade player equipment based on upgrade troop level times 1000
        # (try_begin),
           # (troop_get_upgrade_troop, ":upgrade_troop", "$player_cur_troop", 0),
           # (gt, ":upgrade_troop", 1), #make sure troop is valid and not player troop
           # (store_character_level, ":level", ":upgrade_troop"),
           # (store_pow, ":required_xp", ":level", 2), #square the level and
           # (val_mul, ":required_xp", 100),           #multiply by 100 to get xp
           # (ge, ":service_xp_cur", ":level"),
           # (jump_to_menu, "mnu_upgrade_path"),
        # (try_end),
        (try_begin),
           (troop_get_upgrade_troop, ":upgrade_troop", "$player_cur_troop", 0),
           (gt, ":upgrade_troop", 1), #make sure troop is valid and not player troop
          
           (call_script, "script_game_get_upgrade_xp", "$player_cur_troop"),
           (assign, ":required_xp", reg0),          
           ##THIS  BLOCK IS ALMOST DEFINITELY BE BETTER than the above two lines which could be commented out in exchange for them.
           # (store_character_level, ":cur_level", "$player_cur_troop"),
           # (val_sub, ":cur_level", 1),
           # (get_level_boundary, ":cur_level", ":cur_level"),
           # (store_character_level, ":required_xp", ":upgrade_troop"),
           # (val_sub, ":required_xp", 1),
           # (get_level_boundary, ":required_xp", ":required_xp"),
           # (val_sub, ":required_xp", ":cur_level"),          
           ##
                     
           (ge, ":service_xp_cur", ":required_xp"),
           (try_begin),
                   (call_script, "script_cf_freelancer_player_can_upgrade", ":upgrade_troop"),
                (troop_set_slot, "trp_player", slot_troop_freelancer_start_xp, ":player_xp_cur"),
                (jump_to_menu, "mnu_upgrade_path"),
           (else_try),
                (assign, ":reason", reg0), #from cf_freelancer_player_can_upgrade
                (try_begin),
                    (eq, ":reason", 0), #not enough strength, for melee weapons
                    (display_message, "@You are not strong enough to lift a weapon fit for your promotion!"),
                (else_try),
                    (eq, ":reason", 1), #not enough strength, for armor
                    (display_message, "@You are not strong enough to hold all that weight required with promotion!."),
                (else_try),
                    (eq, ":reason", 2), #not enough power draw/throw/strength for bow/crossbow/throwing
                    (display_message, "@Your arms are to weak to advance in the artillary at this moment."),
                (else_try),
                    (eq, ":reason", 3), #not enough riding skill for horse
                    (display_message, "@You require more horse riding skills to fit your next poisition!"),
                (try_end),               
           (try_end),           
        (try_end),
       
       
       
        (store_character_level, ":level", "$player_cur_troop"),
        #pays player 10 times the troop level
        (store_mul, ":weekly_pay", 10, ":level"),
        (troop_add_gold, "trp_player", ":weekly_pay"),
        (add_xp_to_troop, 70, "trp_player"),
        (play_sound, "snd_money_received", 0),
    ]),

#  HOURLY CHECKS

    (1,[
        (eq, "$freelancer_state", 1),
        #so that sight and camera follows near commander's party
        (set_camera_follow_party, "$enlisted_party"),
        (party_relocate_near_party, "p_main_party", "$enlisted_party", 1),

        (assign, ":num_food", 0),
        (troop_get_inventory_capacity, ":max_inv_slot", "trp_player"),
        (try_for_range, ":cur_inv_slot", ek_item_0, ":max_inv_slot"),
           (troop_get_inventory_slot, ":cur_item", "trp_player", ":cur_inv_slot"),
           (ge, ":cur_item", 0),
           (is_between, ":cur_item", food_begin, food_end),
           (val_add, ":num_food", 1),
        (try_end),
        (try_begin),
           (lt, ":num_food", 2),
           (troop_add_item, "trp_player", "itm_trade_bread"),
        (try_end),
    ]),
   
  #+freelancer end
module_triggers:
Code:
#+freelancer start

#  CHECKS IF "$enlisted_party" IS DEFEATED

    (0.0, 0, 0, [
        (eq, "$freelancer_state", 1),
        (gt, "$enlisted_party", 0),
        (neg|party_is_active, "$enlisted_party"),
    ],
    [
        (assign, "$freelancer_state", 0),
        (call_script, "script_freelancer_detach_party"),
       
        #to prevent companions from being lost forever
        (call_script, "script_party_restore"),
        (party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
        (try_for_range_backwards, ":cur_stack", 0, ":num_stacks"),
            (party_stack_get_troop_id, ":return_troop", "p_main_party", ":cur_stack"),
            (neg|troop_is_hero, ":return_troop"),
            (party_stack_get_size, ":stack_size", "p_main_party", ":cur_stack"),
            (party_remove_members, "p_main_party", ":return_troop", ":stack_size"),
        (try_end),

        #removes faction relation given at enlist
        (store_troop_faction, ":commander_faction", "$enlisted_lord"),
        (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end),
            (neq, ":commander_faction", ":cur_faction"),
            (faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
            (call_script, "script_set_player_relation_with_faction", ":cur_faction", 0),
        (try_end),

        (assign, "$g_encountered_party", "$g_enemy_party"),
        (jump_to_menu, "mnu_captivity_start_wilderness"),
    ]),

#  CHECKS IF "$enlisted_party" HAS JOINED BATTLE

    (0.0, 0, 0, [
        (eq, "$freelancer_state", 1),
       
        #collected nearby enemies->detach (post-battle)
        (try_begin),
            (party_slot_ge, "p_freelancer_party_backup", slot_party_last_in_combat, 1),
            (map_free),
            (party_set_slot, "p_freelancer_party_backup", slot_party_last_in_combat, 0),
            (party_get_num_attached_parties, ":num_attached", "p_main_party"),
            (try_for_range_backwards, ":i", 0, ":num_attached"),
                (party_get_attached_party_with_rank, ":party", "p_main_party", ":i"),
                (party_detach, ":party"),
            (try_end),
        (try_end),
       
        #Is currently in battle
        (party_get_battle_opponent, ":commander_enemy", "$enlisted_party"),
        (gt, ":commander_enemy", 0),
       
        #checks that the player's health is high enough to join battle
        (store_troop_health, ":player_health", "trp_player"),
        (ge, ":player_health", 50),
    ],
    [
        (jump_to_menu, "mnu_world_map_soldier"),
    ]),

#  CHECKS IF PLAYER WON THE REVOLT

    (1.0, 0, 0, [
        (eq, "$freelancer_state", 0),
        (gt, "$enlisted_party", 0),
        (neg|party_is_active, "$enlisted_party"),

        (store_troop_faction, ":commander_faction", "$enlisted_lord"),
        (store_relation, ":relation", "fac_player_supporters_faction", ":commander_faction"),
        (lt, ":relation", 0),

        (party_get_attached_party_with_rank, ":attached_party", "p_main_party", 0),
        (eq, "p_temp_party_2", ":attached_party"),
    ],
    [
        (assign, "$enlisted_party", -1),
        (party_detach, "p_temp_party_2"),
        (store_skill_level, ":cur_leadership", "skl_leadership", "trp_player"),
        (store_skill_level, ":cur_persuasion", "skl_persuasion", "trp_player"),
        (store_add, ":chance", ":cur_persuasion", ":cur_leadership"),
        (val_add, ":chance", 10),
        (store_random_in_range, ":prisoner_state", 0, ":chance"),

        (try_begin),
            (is_between, ":prisoner_state", 0, 5),
            (call_script, "script_party_calculate_strength", "p_main_party", 0),
            (assign, ":main_strength", reg0),
            (call_script, "script_party_calculate_strength", "p_temp_party_2", 0),
            (assign, ":temp_strength", reg0),
            (ge, ":temp_strength", ":main_strength"),

            (party_get_num_prisoner_stacks, ":num_stacks", "p_temp_party_2"),
            (try_for_range, ":cur_stack", 0, ":num_stacks"),
                (party_prisoner_stack_get_troop_id, ":cur_troops", "p_temp_party_2", ":cur_stack"),
                (party_prisoner_stack_get_size, ":cur_size", "p_temp_party_2", ":cur_stack"),
                (party_remove_prisoners, "p_temp_party_2", ":cur_troops", ":cur_size"),
            (try_end),

            (tutorial_box, "@The released prisoners were not be trusted and they are preparing to attack you!", "@Warning!"),
            (start_encounter, "p_temp_party_2"),
            (change_screen_map),
        (else_try),
            (is_between, ":prisoner_state", 5, 10),
            (tutorial_box, "@The released prisoners scattered as soon as the battle finished. You will not be seeing them again.", "@Notice!"),
            (party_clear, "p_temp_party_2"),
        (else_try),
            (tutorial_box, "@The released prisoners have remained loyal and will join your party", "@Notice!"),
            (party_get_num_companion_stacks, ":num_stacks", "p_temp_party_2"),
            (try_for_range, ":cur_stack", 0, ":num_stacks"),
                (party_stack_get_troop_id, ":cur_troops", "p_temp_party_2", ":cur_stack"),
                (party_stack_get_size, ":cur_size", "p_temp_party_2", ":cur_stack"),
                (party_add_members, "p_main_party", ":cur_troops", ":cur_size"),
            (try_end),
            (party_clear, "p_temp_party_2"),
        (try_end),
    ]),

# IF LEFT MOUSE CLICK GO TO SOLDIER'S MENU

    (0.0, 0, 0, [
        (eq, "$freelancer_state", 1),
        (key_clicked, key_left_mouse_button),

        (set_fixed_point_multiplier, 1000),
        (mouse_get_position, pos0),
        (position_get_y, ":y", pos0),
        (gt, ":y", 50), #allows the camp, reports, quests, etc. buttons to be clicked
    ],
    [
        (jump_to_menu, "mnu_world_map_soldier"),
        (rest_for_hours_interactive, 9999, 4, 0),
    ]),

(24.0, 0, 0, [
        (eq, "$freelancer_state", 2),
    ],
    [
        (troop_get_slot, ":days_left", "trp_player", slot_troop_days_on_mission),
        (try_begin),
          (gt, ":days_left", 5),
          (val_sub, ":days_left", 1),
          (troop_set_slot, "trp_player", slot_troop_days_on_mission, ":days_left"),
        (else_try),         
          (is_between, ":days_left", 1, 5),
          (assign, reg0, ":days_left"),
          (display_message, "@You have {reg0} days left till you are declared as a deserter!"),
          (val_sub, ":days_left", 1),
          (troop_set_slot, "trp_player", slot_troop_days_on_mission, ":days_left"),
        (else_try), #declare deserter
          (eq, ":days_left", 0),
          (call_script, "script_event_player_deserts"),
          (display_message, "@You have now been declared as a deserter!"),
        (try_end), 
    ]),


#+freelancer end

Hatam olduysa affedin. Bunu yapınca build_module'de bir sürü warning çıkıyor. Bunları düzeltemedim ama oyun içinde sorun yok. Herkese iyi oyunlar. Umarım faydalı olmuştur.:smile: Devamını yorum olarak yazacağım. Karakter yetmedi :grin:
Kodlarda herhangi bir bug varmı ona göre entegre edeceğim kendi moduma
 
tamadır sağol birde bu ne işe yarıyor
Basit aslında bir lordun yada kralın ordusunda asker olabiliyorsun (sarranid kıdemli okçusu, nord kahramanı gibi) ayrıca rütbe sistemi var yani acemi olarak katılıp rütbe yükseliyosun ayrıca itemlerde rütbeye göre artıyor ha birde :grin: isyan var lorda isyan edebilirsin tabi seni seven 1-2 askerde sizle gelir ama o krallığa düşman olursun başka bişey daha :grin: izin alabiliyorsun (1-2 gün izin alabilirmiyim lordum gibi) bu arada mağaşıda güzel ha az para yok bu işlerde :grin:
 
Basit aslında bir lordun yada kralın ordusunda asker olabiliyorsun (sarranid kıdemli okçusu, nord kahramanı gibi) ayrıca rütbe sistemi var yani acemi olarak katılıp rütbe yükseliyosun ayrıca itemlerde rütbeye göre artıyor ha birde :grin: isyan var lorda isyan edebilirsin tabi seni seven 1-2 askerde sizle gelir ama o krallığa düşman olursun başka bişey daha :grin: izin alabiliyorsun (1-2 gün izin alabilirmiyim lordum gibi) bu arada mağaşıda güzel ha az para yok bu işlerde :grin:
aga sen çevirdinmi bunları bana çevrilmiş atarmısın?
 
Top Bottom