• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Bug script c++ help me

Mexa94

New Member
Joined
Dec 26, 2009
Messages
7
Reaction score
0
Location
Poland
Please repair this script, c + + for TSF 0.3.5pl1. 1 skill = 1% less the cost of the spell. example: the cost of the spell is 1000MP. I have a skill like 10 is the cost of this spell is no longer 1000MP but 900mp

Code:
player->changeMana(-(int32_t)manaCost - (manaCost*player->getSkill(SKILL_FISH, SKILL_LEVEL)/100));
 
Last edited:
try this:

Code:
int32_t manaCost -= ((manaCost / 100) * player->getSkill(SKILL_FISH, SKILL_LEVEL));
if(player->getSkill(SKILL_FISH, SKILL_LEVEL) > 99) //we have to add this or else the player will gain mana if his skill is above 100.
    manaCost = 0; // the default mana cost for it if his skill is above 99, else he wouldn't loose any mana at all.

player->changeMana(-manaCost);


kind regards, Evil Hero.
 

Similar threads

Back
Top