• 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!

Lua Mana/Life Rune - Spells

FearWar

Active Member
Joined
Sep 17, 2017
Messages
221
Reaction score
26
Location
Brasil
I am making a foundation for the ultimate cure to make a life / rune mana!

Lua:
attackType = ATTACK_NONE
animationEffect = NM_ANI_NONE
 
hitEffect = NM_ME_NONE
damageEffect = NM_ME_MAGIC_POISEN
animationColor = GREEN
offensive = false
drawblood = false
 
BlessedUltimateObject = MagicDamageObject(attackType, animationEffect, hitEffect, damageEffect, animationColor, offensive, drawblood, 0, 0)
 
function onCast(cid, creaturePos, level, maglv, var)
    centerpos = {x=creaturePos.x, y=creaturePos.y, z=creaturePos.z}
 
return doTargetMagic(cid, centerpos, BlessedUltimateObject:ordered())
end

XML:
<rune name="Blessed Ultimate"        id="2274"    charges="1"        maglv="0"    mana="0"    enabled="1"></rune>

Within this code above, I wanted to add when using the rune, it cures all the life and all the mana of the character.

Help-me?
 
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);}
 
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
 
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()){
 
Back
Top