diff --git a/utils/global_events.cfg b/utils/global_events.cfg index eb6ae13b..9ea59cb2 100644 --- a/utils/global_events.cfg +++ b/utils/global_events.cfg @@ -777,7 +777,47 @@ Do you want to change it for something else?" [option] label=_"Yes" [command] + {VARIABLE is_legacy no} + [if] + [variable] + name=worked_on.modifications.advancement[$last_advancement_index].id + equals=awareness_dummy + [/variable] + [then] + {VARIABLE is_legacy yes} + [/then] + [/if] {CLEAR_VARIABLE worked_on.modifications.advancement[$last_advancement_index]} + [if] + [variable] + name=is_legacy + equals=yes + [/variable] + [then] + {VARIABLE i 0} + [while] + [variable] + name=i + less_than=$worked_on.modifications.advancement.length + [/variable] + [do] + [if] + [variable] + name=worked_on.modifications.advancement[$i].id + equals=awareness + [/variable] + [then] + {CLEAR_VARIABLE worked_on.modifications.advancement[$i]} + {VARIABLE_OP i sub 1} + [/then] + [/if] + {VARIABLE_OP i add 1} + [/do] + [/while] + {CLEAR_VARIABLE i} + [/then] + [/if] + {CLEAR_VARIABLE is_legacy} {CLEAR_VARIABLE worked_on.variables.achieved_amla} {VARIABLE experience_to_give $worked_on.experience} {VARIABLE_OP experience_to_give add $worked_on.max_experience}