-
Notifications
You must be signed in to change notification settings - Fork 6
/
disband_levy.txt
108 lines (94 loc) · 1.76 KB
/
disband_levy.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
disband_levy = {
enable = yes
toggle = no
army_only = yes
hidden = {
OR = {
has_legion_trigger = yes
AND = {
exists = commander
commander = {
is_mercenary = yes
}
}
}
}
soundeffect ="event:/SFX/UI/Unit/sfx_ui_unit_reorganization"
allow = {
is_army = yes
in_combat = no
is_moving = no
is_exiled = no
in_siege = no
has_commander = yes
has_legion_trigger = no
unit_owner = {
war = no
has_civil_war = no
}
trigger_if = {
limit = {
exists = commander
}
commander = {
loyalty > 33
}
}
}
start_effect = {
set_variable = {
name = normalized_xp_percentage
value = experience_percentage
}
save_scope_as = levy_unit
if = {
# only the governors unit gets levy xp otherwise it would be OP for tribes
limit = {
AND = {
exists = commander
commander = {
is_governor = yes
}
}
}
change_variable = {
name = normalized_xp_percentage
multiply = 100
}
if = {
limit = {
has_variable = levy_start_xp
}
scope:levy_unit.unit_owner = {
set_variable = {
name = country_levy_start_xp
value = scope:levy_unit.var:levy_start_xp
}
}
}
else = {
scope:levy_unit.unit_owner = {
set_variable = {
name = country_levy_start_xp
value = 10
}
}
}
# debug_log = "levy [THIS.Var('country_levy_start_xp').GetValue]"
scope:levy_unit.unit_owner = {
add_military_experience = {
value = scope:levy_unit.var:normalized_xp_percentage
subtract = var:country_levy_start_xp
multiply = 0.055
min = 0
max = 5
}
remove_variable = country_levy_start_xp
}
}
scope:levy_unit = {
remove_variable = normalized_xp_percentage
destroy_unit = yes
}
}
}