diff --git a/data/campaigns/Descent_Into_Darkness/scenarios/11_Descent_into_Darkness.cfg b/data/campaigns/Descent_Into_Darkness/scenarios/11_Descent_into_Darkness.cfg index 197155e1930d..0588b60622a8 100644 --- a/data/campaigns/Descent_Into_Darkness/scenarios/11_Descent_into_Darkness.cfg +++ b/data/campaigns/Descent_Into_Darkness/scenarios/11_Descent_into_Darkness.cfg @@ -520,8 +520,65 @@ [/remove_item] # Previously recruited and new adepts can now also become liches - {MODIFY_UNIT (type=Dark Adept DiD) advances_to (Dark Sorcerer)} - {MODIFY_UNIT (type=Dark Sorcerer DiD) advances_to (Lich,Necromancer)} + # To tranform them, all units from the recall list get copied + # and replaced by a new one with the changed type + [store_unit] + [filter] + type=Dark Adept DiD, Dark Sorcerer DiD + [/filter] + variable=mages + kill=yes + [/store_unit] + + [for] + array=mages + variable=i + [do] + # Get the new type: + [switch] + variable=mages[$i].type + [case] + value=Dark Adept DiD + [set_variable] + name=new_type + value=Dark Adept + [/set_variable] + [/case] + [case] + value=Dark Sorcerer DiD + [set_variable] + name=new_type + value=Dark Sorcerer + [/set_variable] + [/case] + [/switch] + + # Create a new mage with the same attributes as the old one: + [unit] + type=$new_type + max_experience=$mages[$i].max_experience + max_hitpoints=$mages[$i].max_hitpoints + experience=$mages[$i].experience + name=$mages[$i].name + id=$mages[$i].id + gender=$mages[$i].gender + side=1 + placement=recall # The only place they can be at the moment. + [modifications] + [insert_tag] + name=trait + variable=mages[$i].modifications.trait[0] + [/insert_tag] + [insert_tag] + name=trait + variable=mages[$i].modifications.trait[1] + [/insert_tag] + [/modifications] + [/unit] + [/do] + [/for] + + {CLEAR_VARIABLE mages,new_type} [disallow_recruit] side=1