Step 2 – Will they engage in battle or not?
The so-called "Mood Coefficient" depends on the value of the Neutral Army's Mood and the presence of the "Diplomacy" skill in the hero. This coefficient will be compared with the Strength Ratio after certain random transformations. If the neutral army is stronger than the hero's army, there will be a battle.
» Mood Coefficient = 0.5 if the Mood value is Friendly
» Mood Coefficient = 1.0 if the Mood value is Aggressive
» Mood Coefficient = 1.5 if the Mood value is Hostile
» Mood Coefficient = 2.0 if the Mood value is Wild
» If the hero has the "Diplomacy" skill, the Mood Coefficient is reduced by 0.2.
The boundaries of the intervals for joining and engaging in battle are calculated based on the Mood Coefficient, and then compared with the Strength Ratio:
Joining Threshold = (random number from 1 to 7) * Mood Coefficient
Battle Threshold = Joining Threshold + 3 * Mood Coefficient
» Interval 1: If the Strength Ratio < Joining Threshold, the neutral army engages in battle.
» Interval 2: If Joining Threshold < Strength Ratio < Battle Threshold, the neutral army joins for money.
» Interval 3: If the Strength Ratio > Battle Threshold, the neutral army joins for free.
Step 3 – Will they join or not?
The probability of joining depends on the Mood of the neutral army, but it is also influenced by some characteristics of the hero's army:
» Chance of Joining = 10% with a Friendly Mood
» Chance of Joining = 5% with an Aggressive Mood
» Chance of Joining = 0% with a Hostile Mood
» Chance of Joining = -5% with a Wild Mood
That is, the increase is not that significant.
It turns out that the army must first fail the strength check and then join.
why is this?
else
SetMonsterCourageAndMood(mob, GetObjectOwner(temp_name), MONSTER_MOOD_AGGRESSIVE, MONSTER_COURAGE_CAN_FLEE_JOIN);