Thank you a lot for your excellent explanation and statement, it helped me clearing up and better understand the situation now! Probably I begin with testing whether promotion and healing occur before or after the hook by calling
Unit:GetDamage on those events
Code:
Events.LocalPlayerTurnBegin
Events.UnitPromoted
Events.LocalPlayerTurnEnd
and comparing for a heavily damaged unit far enough away from enemy units and Promotion available.
Depending on the results either
Events.LocalPlayerTurnBegin & Events.UnitPromoted or
Events.UnitPromoted & Events.LocalPlayerTurnEnd are used then as pair in which first the unit damages are stored in a table and second the healing/damageDelta is set back (or just reduced). This applies only to the human Player, but maybe also the neglected barbarians get a bit care: small unconditional amount per turn.
---
Strangely the amount of health that is granted by promotion is not defined in GlobalParameters?
EXPERIENCE_PROMOTE_HEALED & EXPERIENCE_RETRAIN_HEALED define the amount of Experience that is gained by being healed. At least that worked in the beginning: #it was very annoying to try killing enemy units and thay get promoted very fast!!!# #changes I made to make the game enjoyable while constantly waging wars: UPDATE GlobalParameters SET Value = 25 WHERE Name="EXPERIENCE_PROMOTE_HEALED"#, but possibly not now #Since the Australia patch [...] several experience-related things in the Gameplay.xml file which no longer work. [...] <Row Name="EXPERIENCE_PROMOTE_HEALED" Value="100"/>#
Depending on tests perhaps
also Experience has to be reduced for the human Player. If appropriate GlobalParameters.EXPERIENCE_PROMOTE_HEALED & EXPERIENCE_RETRAIN_HEALED should be
increased for the AIplayers.
.