ma ktoś pomysł, jak poprawnie zaimplementować(zmodyfikować) taki kod jako level regeneracji do nauczenia w grze?
func void zs_recharger()
{
B_ResetAll(self);
B_ClearPerceptions(self);
};
func int zs_recharger_loop()
{
if(Npc_GetStateTime(self) > 3)
{
Npc_SetStateTime(self,4);
if(hero.attribute[ATR_MANA] < hero.attribute[ATR_MANA_MAX]) && (hero.attribute[ATR_HITPOINTS] > 0)
{
if(Npc_GetTalentSkill(hero,NPC_TALENT_MAGE) == 1)
{
hero.attribute[ATR_MANA] = hero.attribute[ATR_MANA] + 5;
};
if(Npc_GetTalentSkill(hero,NPC_TALENT_MAGE) == 2)
{
hero.attribute[ATR_MANA] = hero.attribute[ATR_MANA] + 15;
};
if(Npc_GetTalentSkill(hero,NPC_TALENT_MAGE) == 3)
{
hero.attribute[ATR_MANA] = hero.attribute[ATR_MANA] + 25;
};
if(Npc_GetTalentSkill(hero,NPC_TALENT_MAGE) == 4)
{
hero.attribute[ATR_MANA] = hero.attribute[ATR_MANA] + 40;
};
if(Npc_GetTalentSkill(hero,NPC_TALENT_MAGE) == 5)
{
hero.attribute[ATR_MANA] = hero.attribute[ATR_MANA] + 75;
};
if(Npc_GetTalentSkill(hero,NPC_TALENT_MAGE) == 6)
{
hero.attribute[ATR_MANA] = hero.attribute[ATR_MANA] + 100;
};
if (hero.attribute[ATR_MANA]>hero.attribute[ATR_MANA_MAX])
{
hero.attribute[ATR_MANA]=hero.attribute[ATR_MANA_MAX];
};
};
};
return LOOP_CONTINUE;
};
func void zs_recharger_end()
{
};