Lua Mana/Life Rune - Spells

naprawiamforum

Banned User
Joined
Apr 28, 2019
Messages
127
Reaction score
41
mana == manamax health == healthmax :* check sources XD manamax is what you want mana is what you gain per level
 

naprawiamforum

Banned User
Joined
Apr 28, 2019
Messages
127
Reaction score
41
where 9999 try manamax if not you will have to use function getPlayerManaMax and return it to a local variable to use it within the addMana thing
 

naprawiamforum

Banned User
Joined
Apr 28, 2019
Messages
127
Reaction score
41
actually you cant get manamax so try to use manamax instead of 9999 in addPlayerMana if it doesnt work then we will have to edit and recompile engine action file :

and add these

lua_register(luaState, "getPlayerManaMax", ActionScript::luaActionGetPlayerManaMax);

int ActionScript::luaActionGetPlayerManaMax(lua_State *L){ return internalGetPlayerInfo(L,PlayerInfoManaMax);}
 
OP
FearWar

FearWar

Member
Joined
Sep 17, 2017
Messages
71
Reaction score
3
Location
Brasil
actually you cant get manamax so try to use manamax instead of 9999 in addPlayerMana if it doesnt work then we will have to edit and recompile engine action file :

and add these

lua_register(luaState, "getPlayerManaMax", ActionScript::luaActionGetPlayerManaMax);

int ActionScript::luaActionGetPlayerManaMax(lua_State *L){ return internalGetPlayerInfo(L,PlayerInfoManaMax);}
Lua:
function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)
    if mag >= 0 then
        doSendMagicEffect(topos,14)
        doPlayerSay(cid,"Fear Bless!",16)
        doPlayerAddMana(cid, ManaMax)
        doPlayerAddHealth(cid, HealthMax)
    if item.type > 1 then
        doChangeTypeItem(item.uid,item.type-1)
    else
        doRemoveItem(item.uid,1)
    end
    else
        doSendMagicEffect(frompos,2)
        doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.")
    end
    return 1
end
Not work
 

naprawiamforum

Banned User
Joined
Apr 28, 2019
Messages
127
Reaction score
41
try small letters not ManaMax instead manamax
sources look like:
C++:
//player->mana += min(5, player->manamax - player->mana);
                    player->gainManaTick();
                    player->food -= thinkTicks;
                    if(player->healthmax - player->health > 0){
                        //player->health += min(5, player->healthmax - player->health);
                        if(player->gainHealthTick()){
 
Top