OSP Code SP [WB] Appointed regulars as Companions

Users who are viewing this thread

Ikaguia

Grandmaster Knight
in module_constants:
Code:
troop_hero_begin		= "trp_male_hero01"	#this is for apointing troops as heros
troop_hero_end			= "trp_hero_end"#this is for apointing troops as heros
slto_inactive_hero      = 10 #this is for apointing troops as heros
renown_required_to_apoint_hero = 30
gold_required_to_apoint_hero = 1500
obs: search for slto_ and change the 10 for the first avaiable number
obs2: you can change the 30 and the 1500 to the values you want

in module_troops:
Code:
####register     #name  #plural#flags                #scene #reserved  #faction    #item#attributes             #level   #wp  #skill       #facecodes
  ["male_hero01","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero02","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero03","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero04","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero05","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero06","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero07","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero08","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero09","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero10","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero11","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero12","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero13","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero14","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero15","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero16","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero17","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero18","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero19","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero20","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero21","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero22","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero23","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero24","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero25","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero26","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero27","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero28","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero29","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero30","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero31","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero32","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero33","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero34","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero35","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero36","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero37","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero38","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero39","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero40","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero41","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero42","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero43","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero44","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero45","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero46","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero47","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero48","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero49","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["male_hero50","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero01","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero02","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero03","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero04","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero05","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero06","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero07","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero08","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero09","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero10","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero11","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero12","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero13","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero14","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero15","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero16","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero17","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero18","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero19","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero20","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero21","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero22","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero23","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero24","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero25","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero26","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero27","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero28","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero29","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero30","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero31","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero32","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero33","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero34","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero35","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero36","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero37","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero38","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero39","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero40","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero41","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero42","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero43","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero44","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero45","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero46","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero47","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero48","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero49","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["female_hero50","Hero","Hero",tf_hero|tf_female|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],
  ["hero_end","Hero","Hero",tf_hero|tf_randomize_face, 0, reserved,  fac_commoners,[],str_3|agi_3|int_3|cha_3|level(1),wp(1),0,man_face_young_1,man_face_older_4],


in module scripts:
Code:
# script_initialize_apointed_heros
  ("initialize_apointed_heros",
   [(try_for_range, ":hero", troop_hero_begin, troop_hero_end),
	  (troop_set_slot, ":hero", slot_troop_occupation, slto_inactive_hero),
	  (troop_get_type,":gender",":hero"),
	  (val_mod, ":gender", 2),
	  (assign, ":x", 0),
	  (try_for_range, ":unused", 0,100),
		(neq, ":gender", 1),#if it is male
		(neq, ":x", 1),
		(store_random_in_range, ":name", "str_male_name_001", "str_male_name_end"),
		(neg|troop_slot_eq, troop_hero_end, ":name", 1),
		(assign, ":x", 1),
	  (try_end),
	  (try_for_range, ":unused", 0,100),
	    (eq, ":gender", 1),#if it is female
	    (neq, ":x", 1),
	    (store_random_in_range, ":name", "str_female_name_001", "str_female_name_end"),
		(neg|troop_slot_eq, troop_hero_end, ":name", 1),
		(assign, ":x", 1),
	  (try_end),
	  (troop_set_slot, troop_hero_end, ":name", 1),
	  (troop_set_name, ":name", ":hero"),
	  (troop_set_plural_name, ":name", ":hero"),
	(try_end),
   ]),

# script_troop_apoint_hero
# input_1 = new hero
# input_2 = regular to be apointed as hero
# Usefull for making heroes based on regulars
  ("troop_apoint_hero",
   [(store_script_param, ":hero", 1),
	(store_script_param, ":regular", 2),
	(call_script, "script_copy_troop", ":hero", ":regular"),
	(call_script, "script_recruit_troop_as_companion", ":hero"),
	(remove_member_from_party,":regular","p_main_party"),
	(troop_remove_gold,0,gold_required_to_apoint_hero),
   ]),

# script_copy_troop
# input_1 = troop to copy to
# input_2 = troop to be copied from
# Usefull for making heroes based on regulars
  ("copy_troop",
   [(store_script_param, ":hero", 1),
	(store_script_param, ":regular", 2),
	#name
	(str_clear, s1),
	(str_clear, s2),
	(str_clear, s3),
	(str_store_troop_name_plural,s1,":hero"),
	(str_store_troop_name,s2,":regular"),
	(str_store_string, s3, "@{s2} {s1}"),#example: "swadian knight marcus"
	(troop_set_name, s3, ":hero"),
	#xp
	(troop_get_xp, ":troop_1_xp", ":hero"),
	(troop_get_xp, ":troop_2_xp", ":regular"),
	(val_sub, ":troop_2_xp", ":troop_1_xp"), #it will be probably 0, but...
	(add_xp_to_troop,":troop_2_xp",":hero"),
	#race &gender
	(troop_get_type, ":type", ":regular"),
	(troop_set_type, ":hero", ":type"),
	#faction
	(store_troop_faction,":faction",":regular"),
	(troop_set_faction,":hero",":faction"),
	#proficiency levels
	(try_for_range, ":proficiency", 0, 7),#0 is one handed 6 is firearm if you don't want to include firearm, change the 7 to 6
	  (store_proficiency_level,":proficiency_lvl",":regular",":proficiency"),
	  (store_proficiency_level,":proficiency_lvl2",":hero",":proficiency"),
	  (val_sub, ":proficiency_lvl", ":proficiency_lvl2"),#it will be probably 0, but...
	  (troop_raise_proficiency_linear,":hero",":proficiency",":proficiency_lvl"),
	(try_end),
	#attribute
	(try_for_range, ":att", 0, 4),#0 is strenght 3 is charisma
	  (store_attribute_level,":att_level",":regular",":att"),
	  (store_attribute_level,":att_level2",":hero",":att"),
	  (val_sub, ":att_level", ":att_level2"),#it will be probably 0, but...
	#skill levels
	(assign, ":last_skill", "skl_reserved_18"),
	(val_add, ":last_skill", 1),
	(try_for_range, ":skill", "skl_trade", ":last_skill"),
	  (store_skill_level,":skill_lvl",":skill",":regular"),
	  (store_skill_level,":skill2_lvl",":skill",":hero"),
	  (val_sub, ":skill_lvl", ":skill2_lvl"),#it will be probably 0, but...
	  (troop_raise_skill,":hero",":skill",":skill_lvl"),
	(try_end),
	#health
	(store_troop_health,":health",":regular",0),
	(troop_set_health,":hero",":health"),
	#items
	(troop_clear_inventory,":hero"),
	(troop_loot_troop,":hero",":regular",70), #70% of the itens will be moved
	(store_random_horse,":horse"),
	(troop_add_item,":hero",":horse"),
	(store_random_equipment,":equipment"),
	(troop_add_item,":hero",":equipment"),
	(store_random_armor,":armor"),
	(troop_add_item,":hero",":armor"),
	(troop_sort_inventory,":hero"),
	(troop_equip_items,":hero"),
   ]),
obs: at script_game_start (the first one in module scripts) add (call_script, "script_initialize_apointed_heros"),

at module_dialogs:
Code:
                     ], "We are not supposed to talk while on guard, {sir/madam}.", "close_window",[]],
                     
  [anyone|plyr,"hall_guard_talk", [], "Stay on duty and let me know if anyone comes to see me.", "hall_guard_duty",[]],
  [anyone,"hall_guard_duty", [], "Yes, {my lord/my lady}. As you wish.", "close_window",[]],
  
  [anyone|plyr,"hall_guard_talk", [
  (eq, 1, 0),
  ], "I want you to arrest this man immediately!", "hall_guard_arrest",[]],
  [anyone,"hall_guard_arrest", [], "Who do you want arrested {my lord/madam}?", "hall_guard_arrest_2",[]],
  [anyone|plyr,"hall_guard_arrest_2", [], "Ah, never mind my high spirits lads.", "close_window",[]],
  [anyone|plyr,"hall_guard_arrest_2", [], "Forget it. I will find another way to deal with this.", "close_window",[]],

  [anyone,"enemy_defeated", [], "Arggh! I hate this.", "close_window",[]],

  [anyone,"party_relieved", [], "Thank you for helping us against those bastards.", "close_window",[]],

  [anyone,"start", [(eq,"$talk_context", tc_party_encounter),(store_encountered_party, reg(5)),(party_get_template_id,reg(7),reg(5)),(eq,reg(7),"pt_sea_raiders")],
   "I will drink from your skull!", "battle_reason_stated",[(play_sound,"snd_encounter_sea_raiders")]],
  
######################################
# GENERIC MEMBER CHAT
######################################

  [anyone,"member_chat", [], "Your orders {sir/madam}?", "regular_member_talk",[]],
  [anyone|plyr,"regular_member_talk", [], "Tell me about yourself", "view_regular_char_requested",[]],
  [anyone,"view_regular_char_requested", [], "Aye {sir/madam}. Let me tell you all there is to know about me.", "do_regular_member_view_char",[[change_screen_view_character]]],
  [anyone,"do_regular_member_view_char", [], "Anything else?", "regular_member_talk",[]],

##Floris: Removed this to make it savegame compatible.
# Custom Troops begin
#  [anyone|plyr,"regular_member_talk", [(is_between,"$g_talk_troop",customizable_troops_begin, customizable_troops_end),], "I'd like to select your equipment.", "customize_troop_equipment_requested",[]],
#  [anyone,"customize_troop_equipment_requested", [], "Aye {sir/madam}. Here is all the gear we have currently equipped. Your inventory will show the gear that you can assign to us.", "finish_custom_troop",[(call_script, "script_start_customizing", "$g_talk_troop")]],
#  [anyone,"finish_custom_troop", [], "Very good {sir/madam}. I will put on the new gear now.", "finish_custom_response",[]],
#  [anyone|plyr,"finish_custom_response", [], "Carry on.", "close_window",[(call_script, "script_finish_customizing", "$g_talk_troop")]],
# Custom Troops end
##

## CC view regular's equipment
  [anyone|plyr,"regular_member_talk", [],
   "Let me see your inventory.", "view_regular_inventory", []
  ],
  [anyone,"view_regular_inventory",
    [], "Very well, it's all here...", "do_view_regular_inventory",
    [
      (call_script, "script_copy_inventory", "$g_player_troop", "trp_temp_array_a"),
      (call_script, "script_copy_inventory", "$g_talk_troop", "trp_temp_array_b"),

      (try_for_range, ":i_slot", 0, 10),
        (troop_get_inventory_slot, ":item", "trp_temp_array_b", ":i_slot"),
        (gt, ":item", -1),
        (troop_get_inventory_slot_modifier, ":imod", "trp_temp_array_b", ":i_slot"),
        (troop_add_item,"trp_temp_array_b", ":item", ":imod"),
        (troop_set_inventory_slot, "trp_temp_array_b", ":i_slot", -1),
      (try_end),

      (change_screen_loot, "trp_temp_array_b"),
    ]],
  [anyone,"do_view_regular_inventory", [],
   "Have you got it?", "do_view_regular_inventory_2", []
  ],
  [anyone|plyr,"do_view_regular_inventory_2", 
    [
      (call_script, "script_copy_inventory", "trp_temp_array_a", "$g_player_troop"),
    ],
   "Yes, I got it.", "do_regular_member_view_char", []
  ],
## CC view regular's equipment
###########################################################################
Ikaguia Code Begin
###########################################################################
  [anyone|plyr,"regular_member_talk", [(ge, "$battle_renown_value", renown_required_to_apoint_hero),
    (troop_get_type,":gender1","$g_talk_troop"),(val_mod, ":gender1", 2),
	(assign, ":continue", 0),
    (try_for_range, ":troop", troop_hero_begin, troop_hero_end),
	  (eq, ":continue", 0),
	  (this_or_next|troop_slot_eq, ":troop", slot_troop_occupation, slto_inactive_hero),
	  (neg|troop_slot_eq, ":troop", slot_troop_occupation, slto_player_companion),
	  (troop_get_type,":gender2",":troop"),(val_mod, ":gender2", 2),
	  (eq, ":gender1", ":gender2"),
	  (assign, "$hero_troop", ":troop"),
	  (assign, ":continue", 1),
	(try_end),
	(eq, ":continue", 1),
	],
   "You did well last battle, what is your name?", "regular_apoint_hero", [(val_sub, "$battle_renown_value", renown_required_to_apoint_hero)]
  ],
  [anyone|plyr,"regular_member_talk", [(ge, "$cheat_mode", 1)],
   "[CHEAT]You did well last battle, what is your name?", "regular_apoint_hero", [(troop_get_type,":gender1","$g_talk_troop"),(val_mod, ":gender1", 2),
	(assign, "$hero_troop", troop_hero_begin),
	(try_for_range, ":unused", 0, 101),
	  (store_random_in_range, ":troop", troop_hero_begin, troop_hero_end),
	  (troop_get_type,":gender2",":troop"),(val_mod, ":gender2", 2),
	  (eq, ":gender1", ":gender2"),
	  (assign, "$hero_troop", ":troop"),
	(try_end)]
  ],
   [anyone,"regular_apoint_hero",[(troop_get_type, reg1, "trp_player"),(val_mod, reg1, 2),(str_store_string,s1,"@{reg1?my Lady:my Lord}"),(str_store_troop_name,s2,"$hero_troop")],
      "My name is {s2} and I only did my duty to you, {s1}.","regular_apoint_hero_2",[]
  ],
   [anyone|plyr,"regular_apoint_hero_2",[],
      "And well, too. The only time I've heard someone with such skills in battle, it has been in sagas. You are a hero!","regular_apoint_hero_3",[]
  ],
   [anyone|plyr,"regular_apoint_hero_2",[],
      "I just wanted you to know that I take notice in such skills in battle. Now fall back in line!","close_window",[]
  ],
   [anyone,"regular_apoint_hero_3",[],
      "You honour me with your words. I will do my utter best to honour them.","regular_apoint_hero_4",[]
  ],
   [anyone|plyr,"regular_apoint_hero_4",[(assign, reg2, gold_required_to_apoint_hero ),
	(store_troop_gold,":gold",0),
	(ge, ":gold", reg2),
],
      "*Apoint him as you companion. (This will cost {reg2} {reg2?denar:denars})","regular_apoint_hero_4b",[(call_script,"script_troop_apoint_hero", "$hero_troop", "$g_talk_troop")]
  ],
   [anyone|auto_proceed,"regular_apoint_hero_4b",[],#needed because player can't speak 2 times without being answered.
      "{!}","regular_apoint_hero_4c",[]
  ],
   [anyone|plyr,"regular_apoint_hero_4c",[(str_clear, s1),(str_store_troop_name,s1,"$hero_troop")],
      "From now on you shall be remembered as {s3}. (This will cost {reg2} {reg2?denar:denars})","regular_apoint_hero_5",[]
  ],
   [anyone|plyr,"regular_apoint_hero_4",[],
      "Ok, now fall back in line.","close_window",[]
  ],
   [anyone,"regular_apoint_hero_5",[],
      "I will defend my new title to my death, and I will not let you down. I promise you this; The blood on my steel will never dry!","close_window",[]
  ],
###########################################################################
Ikaguia Code end
###########################################################################
  [anyone|plyr,"regular_member_talk", [], "Nothing. Keep moving.", "close_window",[]],





######################################
# GENERIC PARTY ENCOUNTER
######################################

  [anyone,"start", [(eq,"$talk_context",tc_party_encounter),
                    (gt,"$encountered_party_hostile",0),
                    (encountered_party_is_attacker),
                    ],
   "You have no chance against us. Surrender now or we will kill you all...", "party_encounter_hostile_attacker",
   [(try_begin),
      (eq,"$g_encountered_party_template","pt_steppe_bandits"),
      (play_sound, "snd_encounter_steppe_bandits"),
    (try_end)]],
#  [anyone|plyr,"party_encounter_hostile_attacker", [
#                    ],
#   "I will pay you 1000 denars if you just let us go.", "close_window", []],
  [anyone|plyr,"party_encounter_hostile_attacker", [
                    ],
   "We will fight you to the end!", "close_window", []],
  [anyone|plyr,"party_encounter_hostile_attacker", [
                    ],
   "Don't attack! We surrender.", "close_window", [(assign,"$g_player_surrenders",1)]],
  
  [anyone,"start", [(eq,"$talk_context",tc_party_encounter),
                    (neg|encountered_party_is_attacker),
                    ],
   "What do you want?", "party_encounter_hostile_defender",
   []],

  [anyone|plyr,"party_encounter_hostile_defender", [],
   "Surrender or die!", "party_encounter_hostile_ultimatum_surrender", [

       ]],

#post 0907 changes begin
obs: my code is the one between the ###########################################################################, the rest is just for you to know where to insert it
obs2: I'm using Floris expanded mod pack 2.4, so your code may be different to mine.

at module_strings:
Code:
  ("male_name_001",  "Marcus"),
  ("male_name_002",  "John"),
  ("male_name_003",  "Hernigam"),
  ("male_name_004",  "Petter"),
  ("male_name_005",  "Cristian"),
  ("male_name_006",  "Arthur"),
  ("male_name_007",  "Cesar"),
  ("male_name_008",  "Lucas"),
  ("male_name_009",  "Avladikus"),
  ("male_name_010",  "Senit"),
  ("male_name_011",  "Milain"),
  ("male_name_012",  "Bombaide"),
  ("male_name_013",  "Malipe"),
  ("male_name_014",  "Singai"),
  ("male_name_015",  "Amunegan"),
  ("male_name_016",  "Jungas"),
  ("male_name_017",  "Artheus"),
  ("male_name_018",  ""),
  ("male_name_019",  ""),
  ("male_name_020",  ""),
  ("male_name_021",  ""),
  ("male_name_022",  ""),
  ("male_name_023",  ""),
  ("male_name_024",  ""),
  ("male_name_025",  ""),
  ("male_name_026",  ""),
  ("male_name_027",  ""),
  ("male_name_028",  ""),
  ("male_name_029",  ""),
  ("male_name_030",  ""),
  ("male_name_031",  ""),
  ("male_name_032",  ""),
  ("male_name_033",  ""),
  ("male_name_034",  ""),
  ("male_name_035",  ""),
  ("male_name_036",  ""),
  ("male_name_037",  ""),
  ("male_name_038",  ""),
  ("male_name_039",  ""),
  ("male_name_040",  ""),
  ("male_name_041",  ""),
  ("male_name_042",  ""),
  ("male_name_043",  ""),
  ("male_name_044",  ""),
  ("male_name_045",  ""),
  ("male_name_046",  ""),
  ("male_name_047",  ""),
  ("male_name_048",  ""),
  ("male_name_049",  ""),
  ("male_name_050",  ""),
  ("male_name_051",  ""),
  ("male_name_052",  ""),
  ("male_name_053",  ""),
  ("male_name_054",  ""),
  ("male_name_055",  ""),
  ("male_name_056",  ""),
  ("male_name_057",  ""),
  ("male_name_058",  ""),
  ("male_name_059",  ""),
  ("male_name_060",  ""),
  ("male_name_061",  ""),
  ("male_name_062",  ""),
  ("male_name_063",  ""),
  ("male_name_064",  ""),
  ("male_name_065",  ""),
  ("male_name_066",  ""),
  ("male_name_067",  ""),
  ("male_name_068",  ""),
  ("male_name_069",  ""),
  ("male_name_070",  ""),
  ("male_name_071",  ""),
  ("male_name_072",  ""),
  ("male_name_073",  ""),
  ("male_name_074",  ""),
  ("male_name_075",  ""),
  ("male_name_076",  ""),
  ("male_name_077",  ""),
  ("male_name_078",  ""),
  ("male_name_079",  ""),
  ("male_name_080",  ""),
  ("male_name_081",  ""),
  ("male_name_082",  ""),
  ("male_name_083",  ""),
  ("male_name_084",  ""),
  ("male_name_085",  ""),
  ("male_name_086",  ""),
  ("male_name_087",  ""),
  ("male_name_088",  ""),
  ("male_name_089",  ""),
  ("male_name_090",  ""),
  ("male_name_091",  ""),
  ("male_name_092",  ""),
  ("male_name_093",  ""),
  ("male_name_094",  ""),
  ("male_name_095",  ""),
  ("male_name_096",  ""),
  ("male_name_097",  ""),
  ("male_name_098",  ""),
  ("male_name_099",  ""),
  ("male_name_end",  "End"),
  ("female_name_001",  ""),
  ("female_name_002",  ""),
  ("female_name_003",  ""),
  ("female_name_004",  ""),
  ("female_name_005",  ""),
  ("female_name_006",  ""),
  ("female_name_007",  ""),
  ("female_name_008",  ""),
  ("female_name_009",  ""),
  ("female_name_010",  ""),
  ("female_name_011",  ""),
  ("female_name_012",  ""),
  ("female_name_013",  ""),
  ("female_name_014",  ""),
  ("female_name_015",  ""),
  ("female_name_016",  ""),
  ("female_name_017",  ""),
  ("female_name_018",  ""),
  ("female_name_019",  ""),
  ("female_name_020",  ""),
  ("female_name_021",  ""),
  ("female_name_022",  ""),
  ("female_name_023",  ""),
  ("female_name_024",  ""),
  ("female_name_025",  ""),
  ("female_name_026",  ""),
  ("female_name_027",  ""),
  ("female_name_028",  ""),
  ("female_name_029",  ""),
  ("female_name_030",  ""),
  ("female_name_031",  ""),
  ("female_name_032",  ""),
  ("female_name_033",  ""),
  ("female_name_034",  ""),
  ("female_name_035",  ""),
  ("female_name_036",  ""),
  ("female_name_037",  ""),
  ("female_name_038",  ""),
  ("female_name_039",  ""),
  ("female_name_040",  ""),
  ("female_name_041",  ""),
  ("female_name_042",  ""),
  ("female_name_043",  ""),
  ("female_name_044",  ""),
  ("female_name_045",  ""),
  ("female_name_046",  ""),
  ("female_name_047",  ""),
  ("female_name_048",  ""),
  ("female_name_049",  ""),
  ("female_name_050",  ""),
  ("female_name_051",  ""),
  ("female_name_052",  ""),
  ("female_name_053",  ""),
  ("female_name_054",  ""),
  ("female_name_055",  ""),
  ("female_name_056",  ""),
  ("female_name_057",  ""),
  ("female_name_058",  ""),
  ("female_name_059",  ""),
  ("female_name_060",  ""),
  ("female_name_061",  ""),
  ("female_name_062",  ""),
  ("female_name_063",  ""),
  ("female_name_064",  ""),
  ("female_name_065",  ""),
  ("female_name_066",  ""),
  ("female_name_067",  ""),
  ("female_name_068",  ""),
  ("female_name_069",  ""),
  ("female_name_070",  ""),
  ("female_name_071",  ""),
  ("female_name_072",  ""),
  ("female_name_073",  ""),
  ("female_name_074",  ""),
  ("female_name_075",  ""),
  ("female_name_076",  ""),
  ("female_name_077",  ""),
  ("female_name_078",  ""),
  ("female_name_079",  ""),
  ("female_name_080",  ""),
  ("female_name_081",  ""),
  ("female_name_082",  ""),
  ("female_name_083",  ""),
  ("female_name_084",  ""),
  ("female_name_085",  ""),
  ("female_name_086",  ""),
  ("female_name_087",  ""),
  ("female_name_088",  ""),
  ("female_name_089",  ""),
  ("female_name_090",  ""),
  ("female_name_091",  ""),
  ("female_name_092",  ""),
  ("female_name_093",  ""),
  ("female_name_094",  ""),
  ("female_name_095",  ""),
  ("female_name_096",  ""),
  ("female_name_097",  ""),
  ("female_name_098",  ""),
  ("female_name_099",  ""),
  ("female_name_end",  "End"),
obs: plz, add the names between the "" or delete them.
obs2: you can add new ones, just copy name_099 and paste it before name_end

It does everything it needs but it doesn't change the facecode.
I've write it all by myself but I owe thanks to Shredzorz for some help, to NaglFaar for the dialogues and to taleworlds for making this awesome game.

It's used to make a companion out of regular troop

You are free to use this anywhere you want and edit it as you like.
 
Idibil said:
Computica said:
:neutral: Wait, so I don't understand what the purpose of this script is yet. For what reason would someone want to use this?

to can kill lords and replace them with other with different name  and skills  :mrgreen:
You can kill lords then respawn them later under a different name and faction,... without the need of creating new troops. You can create random name by playing around with the strings. The only thing that I can't figure out is how to make random face. The usefulness of dummy troop is you can set stats (increase from zero) and face code.
 
SPD_Phoenix said:
You can kill lords then respawn them later under a different name and faction,... without the need of creating new troops. You can create random name by playing around with the strings. The only thing that I can't figure out is how to make random face. The usefulness of dummy troop is you can set stats (increase from zero) and face code.

Yes, but it change name and faction only, rest same that old lord and there are problems with family tree, because new hero is same that died old hero. I thought that if we add new troop hero, he should be totally different to old died hero. But I havent try this. I think that it would be similar to traitors lords when they change of faction.


Ikaguia said:
rabican said:
from quick glance its used to make a companion out of regular troop

that's it, it's like LAZERAS Top Tier Troops Recruit but it can be done with any troop and many times.

What you use for active it in game? a menu or dialog? Have you create special dialog for them? can you appoint them for lords?
 
Idibil said:
Yes, but it change name and faction only, rest same that old lord and there are problems with family tree, because new hero is same that died old hero. I thought that if we add new troop hero, he should be totally different to old died hero. But I havent try this. I think that it would be similar to traitors lords when they change of faction.
exactly

Idibil said:
What you use for active it in game? a menu or dialog? Have you create special dialog for them? can you appoint them for lords?

I'd ad a new branch in the dialog in the party menu, but I'd check the renown from the last battle and then reset it. also it would cost some gold for buying new equipment (they'll receive a random horse, armor and equipment).
and no, I've not yet created the dialog, I was making a system to make random names to them.


Edit:

finished, now I'll see if it compiles right.


edit2:
ok, It now compiles fine, just needed to change "$troop" in module_dialogues for "$hero_troop" because there was already a ":troop".
and some minor errors in module_scripts

don't use it yet, I'm testing it

edit3: It's almost bugfree, I'm fixing the last ones right now.
 
I REALLY WANT THIS TO MERGE WITH MY DIPLO 4.3 MODULE BUT ASDFGHJKL, i dont know a single bean about coeding. :ssss can anyone heelp me?
 
Ok, it's a little bit necro but!
there is no "man_face_older_4"
To make succesfull compilation you should announce it in module_troops
Code:
man_face_older_2   = 0x0000000fff0052064deeffffffffffff00000000001efff90000000000000000
man_face_older_4   = 0x0000000fff0052064deeffffffffffff00000000001efff90000000000000000
Just copyed the man_face_older_2 string and changed the number
 
Back
Top Bottom