andu
Sold 649 scripts, 25 maps and 9 events!
Edit:
I did this, compiled it and seem to works without any issues. Please check it for potential problems.
Old post:
I did this, compiled it and seem to works without any issues. Please check it for potential problems.
Spells able to cost both mana and manapercent at once and also health and healthpercent +luascript by Olrios · Pull Request #2734 · otland/forgottenserver
I made spells able to cost for example 20 mana and 5% max mana at once. Would be useful for custom servers. If this code is okey and the way I published it tell me please. Try it out with: In spell...
github.com
Old post:
I'd like to make healthCost. Spells where you have to spend heal to cast. Tried to make it in VS but without success.
Got errorIn this line:Code:spells.cpp(640): warning C4018: '<': signed/unsigned mismatch
C++:if (player->getHealth() < getHealthCost(player) && !player->hasFlag(PlayerFlag_HasInfiniteMana)) {
Here is my getHealthCost:
C++:uint32_t Spell::getHealthCost(const Player* player) const { uint32_t finalHealth = 0; if (health != 0) { finalHealth = health; } if (healthPercent != 0) { uint32_t maxHealth = player->getMaxHealth(); uint32_t healthCost = (maxHealth * healthPercent) / 100; finalHealth = finalHealth + healthCost; } return finalHealth; }
When I tried to solve it with info from stackoverflow website then no errors in console, no errors in VS but server crashes during loading.
Any tips? I Also added healthCost in everyplace where manaCost is too. Just copied it and changed mana to health. But cannot handle the issue with crashing
Last edited: