Skrypt wg którego jest to robione:
func void B_GivePlayerXP(var int add_xp)
{
var int player_has_haotic_exp;
var string concatText;
var int lp_per_level_haotic;
var int hp_per_level_haotic;
var int value_haotic;
if(hero.level == 0)
{
hero.exp_next = 700;
};
player_has_haotic_exp = Hlp_Random(4);
if(player_has_haotic_exp == 0)
{
add_xp = (add_xp * 8) / 10;
}
else if(player_has_haotic_exp == 1)
{
add_xp = (add_xp * 9) / 10;
}
else if(player_has_haotic_exp == 2)
{
add_xp = add_xp;
}
else if(player_has_haotic_exp == 3)
{
add_xp = (add_xp * 11) / 10;
}
else if(player_has_haotic_exp == 4)
{
add_xp = (add_xp * 12) / 10;
};
hero.exp = hero.exp + add_xp;
concatText = PRINT_XPGained;
concatText = ConcatStrings(concatText,IntToString(add_xp));
PrintScreen(concatText,-1,YPOS_XPGained,FONT_ScreenSmall,2);
if(hero.exp >= hero.exp_next)
{
value_haotic = Hlp_Random(90);
if((value_haotic >= 0) && (value_haotic < 30))
{
hp_per_level_haotic = HP_PER_LEVEL;
lp_per_level_haotic = (LP_PER_LEVEL * 8) / 10;
}
else if((value_haotic > 30) && (value_haotic <= 60))
{
hp_per_level_haotic = HP_PER_LEVEL;
lp_per_level_haotic = LP_PER_LEVEL;
}
else if((value_haotic > 60) && (value_haotic <= 90))
{
hp_per_level_haotic = HP_PER_LEVEL;
lp_per_level_haotic = (LP_PER_LEVEL * 10) / 10;
}
else if(value_haotic == 30)
{
hp_per_level_haotic = HP_PER_LEVEL;
lp_per_level_haotic = (LP_PER_LEVEL * 11) / 10;
};
hero.level = hero.level + 1;
hero.exp_next = hero.exp_next + (((hero.level + 21) * hero.level * 25) + 500);
hero.attribute[ATR_HITPOINTS_MAX] = hero.attribute[ATR_HITPOINTS_MAX] + hp_per_level_haotic;
hero.attribute[ATR_HITPOINTS] = hero.attribute[ATR_HITPOINTS_MAX];
hero.lp = hero.lp + lp_per_level_haotic;
PrintScreen(PRINT_LevelUp,-1,YPOS_LevelUp,FONT_Screen,2);
Snd_Play("LevelUp");
};
};