In my mod I'm going to implement a system where units can get random promotions from a pre-defined list when produced (something like in Battle for Wesnoth, where new units get two random traits). These can include small bonuses for normal units, bigger bonuses for heroes, and "mutations" for Demonic units. I'm not very good at LUA coding, so I need help from an expert.
It can be handled by a special promotion defined in Unit_FreePromotions that, when the unit is produced, gets replaced by a random set of promotions, or a special unit attribute defined as a new column in the Units table. As an example, I need code that gives the unit a promotion chosen randomly from these 3: PROMOTION_STRONG, PROMOTION_RESILIENT or PROMOTION_HEALTHY (in the mod it will be more complex than that, but I'll handle the details myself, I only need to know how to detect a new unit constructed, and grant it some random promotions).
Thanks in advance for any help
It can be handled by a special promotion defined in Unit_FreePromotions that, when the unit is produced, gets replaced by a random set of promotions, or a special unit attribute defined as a new column in the Units table. As an example, I need code that gives the unit a promotion chosen randomly from these 3: PROMOTION_STRONG, PROMOTION_RESILIENT or PROMOTION_HEALTHY (in the mod it will be more complex than that, but I'll handle the details myself, I only need to know how to detect a new unit constructed, and grant it some random promotions).
Thanks in advance for any help
