﻿RandomCatEyeColor = {
	type = character
	random_valid = yes

	text = {
		trigger = {
			var:eye_color = flag:blue
		}
		localization_key = eye_color_blue
	}

	text = {
		trigger = {
			var:eye_color = flag:yellow
		}
		localization_key = eye_color_yellow
	}

	text = {
		trigger = {
			var:eye_color = flag:green
		}
		localization_key = eye_color_green
	}

	text = {
		trigger = {
			var:eye_color = flag:amber
		}
		localization_key = eye_color_amber
	}

	text = {
		trigger = {
			var:eye_color = flag:copper
		}
		localization_key = eye_color_copper
	}

	text = {
		trigger = {
			var:eye_color = flag:emerald
		}
		localization_key = eye_color_emerald
	}
}


#For cat story
CatStoryName = {
	type = character

	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:custom
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:custom
				}
			}
		}
		localization_key = cat_name
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:cat_name_gyb
					NOT = { exists = var:book_topic_cat_name }
				}
				AND = {
					exists = var:book_topic_cat_name
					var:book_topic_cat_name = flag:cat_name_gyb
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:cat_name_gyb
				}
			}
		}
		localization_key = cat_name_gyb
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:cat_name_mite
					NOT = { exists = var:book_topic_cat_name }
				}
				AND = {
					exists = var:book_topic_cat_name
					var:book_topic_cat_name = flag:cat_name_mite
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:cat_name_mite
				}
			}
		}
		localization_key = cat_name_mite
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:cat_name_gray
					NOT = { exists = var:book_topic_cat_name }
				}
				AND = {
					exists = var:book_topic_cat_name
					var:book_topic_cat_name = flag:cat_name_gray
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:cat_name_gray
				}
			}
		}
		localization_key = cat_name_gray
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:cat_name_flame
					NOT = { exists = var:book_topic_cat_name }
				}
				AND = {
					exists = var:book_topic_cat_name
					var:book_topic_cat_name = flag:cat_name_flame
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:cat_name_flame
				}
			}
		}
		localization_key = cat_name_flame
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:cat_name_meone
					NOT = { exists = var:book_topic_cat_name }
				}
				AND = {
					exists = var:book_topic_cat_name
					var:book_topic_cat_name = flag:cat_name_meone
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:cat_name_meone
				}
			}
		}
		localization_key = cat_name_meone
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:cat_name_cruibne
					NOT = { exists = var:book_topic_cat_name }
				}
				AND = {
					exists = var:book_topic_cat_name
					var:book_topic_cat_name = flag:cat_name_cruibne
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:cat_name_cruibne
				}
			}
		}
		localization_key = cat_name_cruibne
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:cat_name_snow
					NOT = { exists = var:book_topic_cat_name }
				}
				AND = {
					exists = var:book_topic_cat_name
					var:book_topic_cat_name = flag:cat_name_snow
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:cat_name_snow
				}
			}
		}
		localization_key = cat_name_snow
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:cat_name_shadow
					NOT = { exists = var:book_topic_cat_name }
				}
				AND = {
					exists = var:book_topic_cat_name
					var:book_topic_cat_name = flag:cat_name_shadow
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:cat_name_shadow
				}
			}
		}
		localization_key = cat_name_shadow
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:cat_name_paws
					NOT = { exists = var:book_topic_cat_name }
				}
				AND = {
					exists = var:book_topic_cat_name
					var:book_topic_cat_name = flag:cat_name_paws
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:cat_name_paws
				}
			}
		}
		localization_key = cat_name_paws
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:cat_name_mittens
					NOT = { exists = var:book_topic_cat_name }
				}
				AND = {
					exists = var:book_topic_cat_name
					var:book_topic_cat_name = flag:cat_name_mittens
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:cat_name_mittens
				}
			}
		}
		localization_key = cat_name_mittens
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_cat_name
					var:story_cycle_cat_name = flag:cat_name_spooky
					NOT = { exists = var:book_topic_cat_name }
				}
				AND = {
					exists = var:book_topic_cat_name
					var:book_topic_cat_name = flag:cat_name_spooky
				}
				AND = {
					exists = var:sacrificed_cat_name
					var:sacrificed_cat_name = flag:cat_name_spooky
				}
			}
		}
		localization_key = cat_name_spooky
	}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = PE_story_cycle_cat
					exists = var:pet_dummy
				}
				var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_cat_name
	}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_cat
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_cat_name
	}
}

CatStoryNamePossessive = {
	type = character

	#text = { #Checks for pre-scripted names that ends with "s". Sadly we have no way to check custom names...
	#	trigger = { var:story_cycle_cat_name = flag:cat_name_mittens }
	#	localization_key = cat_name_mittens_possessive
	#}

	#text = {
	#	trigger = { var:story_cycle_cat_name = flag:cat_name_paws }
	#	localization_key = cat_name_paws_possessive
	#}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = PE_story_cycle_cat
					exists = var:pet_dummy
				}
				var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_cat_name_possessive
	}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_cat
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_cat_name_possessive
	}
	
	text = {
		localization_key = cat_name_possessive
	}
}

CatFurColor = {
	type = character
	
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_cat
				var:body_color = flag:brown
			}
		}
		localization_key = fur_color_brown
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_cat
				var:body_color = flag:gray
			}
		}
		localization_key = fur_color_gray
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_cat
				var:body_color = flag:orange
			}
		}
		localization_key = fur_color_orange
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_cat
				var:body_color = flag:black
			}
		}
		localization_key = fur_color_black
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_cat
				var:body_color = flag:white
			}
		}
		localization_key = fur_color_white
	}
}

CatEyeColor = {
	type = character
	
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_cat
				var:eye_color = flag:blue
			}
		}
		localization_key = eye_color_blue
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_cat
				var:eye_color = flag:yellow
			}
		}
		localization_key = eye_color_yellow
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_cat
				var:eye_color = flag:green
			}
		}
		localization_key = eye_color_green
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_cat
				var:eye_color = flag:amber
			}
		}
		localization_key = eye_color_amber
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_cat
				var:eye_color = flag:copper
			}
		}
		localization_key = eye_color_copper
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_cat
				var:eye_color = flag:emerald
			}
		}
		localization_key = eye_color_emerald
	}
}

CatStoryHerHis = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_cat
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_cat_gender_herhis
	}
}

CatStoryHerHim = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_cat
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_cat_gender_herhim
	}
}

CatStorySheHe = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_cat
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_cat_gender_shehe
	}
}

CatStoryHerselfHimself = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_cat
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_cat_gender_herselfhimself
	}
}

CatStoryFemaleMale = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_cat
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = yes }
		}
		localization_key = cat_gender_female
	}
	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_cat
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = no }
		}
		localization_key = cat_gender_male
	}
}

#For dog story
DogStoryName = {
	type = character

	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_dog_name
					var:story_cycle_dog_name = flag:custom
				}
				AND = {
					exists = var:sacrificed_dog_name
					var:sacrificed_dog_name = flag:custom
				}
			}
		}
		localization_key = dog_name
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_dog_name
					var:story_cycle_dog_name = flag:dog_name_amiable
					NOT = { exists = var:book_topic_dog_name }
				}
				AND = {
					exists = var:book_topic_dog_name
					var:book_topic_dog_name = flag:dog_name_amiable
				}
				AND = {
					exists = var:sacrificed_dog_name
					var:sacrificed_dog_name = flag:dog_name_amiable
				}
			}
		}
		localization_key = dog_name_amiable
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_dog_name
					var:story_cycle_dog_name = flag:dog_name_nosewise
					NOT = { exists = var:book_topic_dog_name  }
				}
				AND = {
					exists = var:book_topic_dog_name
					var:book_topic_dog_name = flag:dog_name_nosewise
				}
				AND = {
					exists = var:sacrificed_dog_name
					var:sacrificed_dog_name = flag:dog_name_nosewise
				}
			}
		}
		localization_key = dog_name_nosewise
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_dog_name
					var:story_cycle_dog_name = flag:dog_name_holdfast
					NOT = { exists = var:book_topic_dog_name  }
				}
				AND = {
					exists = var:book_topic_dog_name
					var:book_topic_dog_name = flag:dog_name_holdfast
				}
				AND = {
					exists = var:sacrificed_dog_name
					var:sacrificed_dog_name = flag:dog_name_holdfast
				}
			}
		}
		localization_key = dog_name_holdfast
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_dog_name
					var:story_cycle_dog_name = flag:dog_name_gray
					NOT = { exists = var:book_topic_dog_name  }
				}
				AND = {
					exists = var:book_topic_dog_name
					var:book_topic_dog_name = flag:dog_name_gray
				}
				AND = {
					exists = var:sacrificed_dog_name
					var:sacrificed_dog_name = flag:dog_name_gray
				}
			}
		}
		localization_key = dog_name_gray
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_dog_name
					var:story_cycle_dog_name = flag:dog_name_choplicker
					NOT = { exists = var:book_topic_dog_name  }
				}
				AND = {
					exists = var:book_topic_dog_name
					var:book_topic_dog_name = flag:dog_name_choplicker
				}
				AND = {
					exists = var:sacrificed_dog_name
					var:sacrificed_dog_name = flag:dog_name_choplicker
				}
			}
		}
		localization_key = dog_name_choplicker
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_dog_name
					var:story_cycle_dog_name = flag:dog_name_shadow
					NOT = { exists = var:book_topic_dog_name  }
				}
				AND = {
					exists = var:book_topic_dog_name
					var:book_topic_dog_name = flag:dog_name_shadow
				}
				AND = {
					exists = var:sacrificed_dog_name
					var:sacrificed_dog_name = flag:dog_name_shadow
				}
			}
		}
		localization_key = dog_name_shadow
	}
	text = {
		trigger = {
			OR = {
				AND = {
					#for the conversion of vanilla stories (update_vanilla_pet_effect)
					exists = var:original_pet_story
					exists = var:story_cycle_dog_name
					var:story_cycle_dog_name = flag:dog_name_snow
					NOT = { exists = var:book_topic_dog_name  }
				}
				AND = {
					exists = var:book_topic_dog_name
					var:book_topic_dog_name = flag:dog_name_snow
				}
				AND = {
					exists = var:sacrificed_dog_name
					var:sacrificed_dog_name = flag:dog_name_snow
				}
			}
		}
		localization_key = dog_name_snow
	}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = PE_story_cycle_dog
					exists = var:pet_dummy
				}
				var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_dog_name
	}
	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_dog
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_dog_name
	}
}

DogStoryNamePossessive = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = PE_story_cycle_cat
					exists = var:pet_dummy
				}
				var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_dog_name_possessive
	}
	
	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_dog
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_dog_name_possessive
	}
	text = {
		localization_key = dog_name_possessive
	}
}

DogFurColor = {
	type = character
	
	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_pet_dog
				var:body_color = flag:brown
			}
		}
		localization_key = fur_color_brown
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_pet_dog
				var:body_color = flag:gray
			}
		}
		localization_key = fur_color_gray
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_pet_dog
				var:body_color = flag:black
			}
		}
		localization_key = fur_color_black
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_pet_dog
				var:body_color = flag:white
			}
		}
		localization_key = fur_color_white
	}
}

DogEyeColor = {
	type = character
	
	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_pet_dog
				var:eye_color = flag:blue
			}
		}
		localization_key = eye_color_blue
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_pet_dog
				var:eye_color = flag:amber
			}
		}
		localization_key = eye_color_amber
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_pet_dog
				var:eye_color = flag:brown
			}
		}
		localization_key = eye_color_brown
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_pet_dog
				var:eye_color = flag:gray
			}
		}
		localization_key = eye_color_gray
	}
}


DogStoryHerHis = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_dog
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_dog_gender_herhis
	}
}

DogStoryHerHim = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_dog
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_dog_gender_herhim
	}
}

DogStoryGirlBoy = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_dog
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = yes }
		}
		localization_key = girl
	}
	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_dog
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = no }
		}
		localization_key = boy
	}
}

DogStorySheHe = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_dog
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_dog_gender_shehe
	}
}

DogStoryFemaleMale = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_dog
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = yes }
		}
		localization_key = dog_gender_female
	}
	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_pet_dog
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = no }
		}
		localization_key = dog_gender_male
	}
}


#For horse story
HorseStoryName = {
	type = character
	
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:tencendur
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_tencendur
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:bucephalus
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_bucephalus
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:seianian
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_seianian
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:zuljanah
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_zuljanah
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:red_hare
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_red_hare
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:veillantif
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_veillantif
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:incitatus
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_incitatus
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:llamrei
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_llamrei
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:sleipnir
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_sleipnir
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:uchchaihshravas
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_uchchaihshravas
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:dadhi_kra
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_dadhi_kra
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:devadatta
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_devadatta
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:keshi
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_keshi
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:kanthaka
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_kanthaka
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:haizum
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_haizum
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:buraq
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_buraq
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:burko
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_burko
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:aranjagaan
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_aranjagaan
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:balius
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_balius
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:xanthos
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_xanthos
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:boreas
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_boreas
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:prancer
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_prancer
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:charger
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_charger
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:abbot
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_abbot
	}
	text = {
		trigger = {
			any_owned_story = {
				story_type = PE_story_cycle_horse
				var:story_cycle_horse_name = flag:glitterhoof
				save_temporary_scope_as = story_temp
			}
			trigger_if = {
				limit = { exists = var:is_naming_pet }
				var:is_naming_pet = scope:story_temp
			}
		}
		localization_key = warhorse_name_glitterhoof
	}
	text = {
		trigger = { always = no }
		localization_key = warhorse_name_charger
		fallback = yes
	}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = PE_story_cycle_horse
					exists = var:pet_dummy
				}
				var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_horse_name
	}
	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = PE_story_cycle_horse
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_horse_name
	}
}


HorseStoryHerHis = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_martial_lifestyle_warhorse
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_horse_gender_herhim
	}

	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_martial_lifestyle_warhorse
				var:horse_gender = flag:female
			}
		}
		localization_key = horse_gender_her
	}
	text = {
		trigger = { always = no }
		fallback = yes
		localization_key = horse_gender_his
	}
}

HorseStoryHerHim = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_martial_lifestyle_warhorse
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_horse_gender_herhim
	}

	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_martial_lifestyle_warhorse
				var:horse_gender = flag:female
			}
		}
		localization_key = horse_gender_her
	}
	text = {
		trigger = { always = no }
		fallback = yes
		localization_key = horse_gender_him
	}
}


HorseStorySheHe = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_martial_lifestyle_warhorse
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			exists = scope:pet_for_loc
		}
		localization_key = pets_expanded_horse_gender_shehe
	}

	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_martial_lifestyle_warhorse
				var:horse_gender = flag:female
			}
		}
		localization_key = horse_gender_she
	}
	text = {
		trigger = { always = no }
		fallback = yes
		localization_key = horse_gender_he
	}
}


HorseStoryMareStallion = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_martial_lifestyle_warhorse
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = yes }
		}
		localization_key = horse_gender_mare
	}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_martial_lifestyle_warhorse
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = no }
		}
		localization_key = horse_gender_stallion
	}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = PE_story_cycle_horse
					exists = var:pet_dummy
				}
				var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = yes }
		}
		localization_key = horse_gender_mare
	}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = PE_story_cycle_horse
					exists = var:pet_dummy
				}
				var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = no }
		}
		localization_key = horse_gender_stallion
	}

	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_martial_lifestyle_warhorse
				var:horse_gender = flag:female
			}
		}
		localization_key = horse_gender_mare
	}
	text = {
		trigger = { always = no }
		fallback = yes
		localization_key = horse_gender_stallion
	}
}

HorseStoryOppositeMareStallion = {
	type = character

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_martial_lifestyle_warhorse
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = no }
		}
		localization_key = horse_gender_mare
	}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = story_cycle_martial_lifestyle_warhorse
					exists = var:updated_pet_story
					exists = var:updated_pet_story.var:pet_dummy
				}
				var:updated_pet_story.var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = yes }
		}
		localization_key = horse_gender_stallion
	}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = PE_story_cycle_horse
					exists = var:pet_dummy
				}
				var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = no }
		}
		localization_key = horse_gender_mare
	}

	text = {
		setup_scope = {
			random_owned_story = {
				limit = {
					story_type = PE_story_cycle_horse
					exists = var:pet_dummy
				}
				var:pet_dummy = { save_scope_as = pet_for_loc }
			}
		}
		trigger = {
			scope:pet_for_loc = { is_female = yes }
		}
		localization_key = horse_gender_stallion
	}

	text = {
		trigger = {
			any_owned_story = {
				story_type = story_cycle_martial_lifestyle_warhorse
				var:horse_gender = flag:male
			}
		}
		localization_key = horse_gender_mare
	}
	text = {
		trigger = { always = no }
		fallback = yes
		localization_key = horse_gender_stallion
	}
}