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

Solved How to add Voction

killing

Member
Joined
Feb 23, 2012
Messages
815
Reaction score
11
Location
BIH
How to Add voction to this rune

LUA:
function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)
if mag >= 0 then
doSendMagicEffect(topos,14)
doCreatureSay(cid,"Mixed Rune",19)
doPlayerAddMana(cid, 50000)
doCreatureAddHealth(cid,30000)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.")
end
return 1
end
 
LUA:
local vocations = {1, 2, 5, 6}

function onUse(cid, item, frompos, item2, topos)
    local vocation = getPlayerVocation(cid)
    if not isInArray(vocations, vocation) then
        doSendMagicEffect(frompos, CONST_ME_MAGIC_POFF)
        doPlayerSendCancel(cid, "Your vocation cannot use this rune. It can be used by bla bla bla..")
        return true
    end

    local mLvl = getPlayerMagLevel(cid)
    if mLvl >= 0 then
        doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
        doCreatureSay(cid, "Mixed Rune", TALKTYPE_MONSTER)
        doPlayerAddMana(cid, 50000)
        doCreatureAddHealth(cid, 30000)
        if item.type > 1 then
            doChangeTypeItem(item.uid, item.type-1)
        end
    else
        doSendMagicEffect(frompos, CONST_ME_MAGIC_POFF)
        doPlayerSendCancel(cid, "You don't have the required magic level to use that rune.")
    end
    return true
end

Like this.
Also, you should use constants in scripts which ensures that the scripts are working on newer clients too most of the time and it makes it easier to understand/read.
 
LUA:
local vocations = {1, 2, 5, 6}

function onUse(cid, item, frompos, item2, topos)
    local vocation = getPlayerVocation(cid)
    if not isInArray(vocations, vocation) then
        doSendMagicEffect(frompos, CONST_ME_MAGIC_POFF)
        doPlayerSendCancel(cid, "Your vocation cannot use this rune. It can be used by bla bla bla..")
        return true
    end

    local mLvl = getPlayerMagLevel(cid)
    if mLvl >= 0 then
        doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
        doCreatureSay(cid, "Mixed Rune", TALKTYPE_MONSTER)
        doPlayerAddMana(cid, 50000)
        doCreatureAddHealth(cid, 30000)
        if item.type > 1 then
            doChangeTypeItem(item.uid, item.type-1)
        end
    else
        doSendMagicEffect(frompos, CONST_ME_MAGIC_POFF)
        doPlayerSendCancel(cid, "You don't have the required magic level to use that rune.")
    end
    return true
end

Like this.
Also, you should use constants in scripts which ensures that the scripts are working on newer clients too most of the time and it makes it easier to understand/read.


yeah Summ Thanks Rep++
Im Sorry but Can u check this too
http://otland.net/f16/pma-phpmyadmin-185456/

- - - Updated - - -

i cant Enter in Phpmyadmin because of that.
:p
 
Back
Top