Ir para conteúdo
  • 0

Erro Runa vip


MrKirito

Pergunta

to com um erro em uma runa que serve pra heala vida e mana e é pra todas vocaçoes, tipo eu so pally a runa vai heala um poco de vida e mana, se eu for mage ela vai heala mana, e se eu for kina ela vai heala vida ta tudo certo se eu so pally uso a runa e funciona se eu so mage eu uso a runa e tbm funciona mas se eu so kina eu uso e aprece You connot use this object

 

aqui ta o script da runa que eu uso \/ :

 

 

 

local exhaust = createConditionObject(CONDITION_EXHAUST)

setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local cfg = {

["paladin"] = {

MIN_HEALTH = 6000,

MAX_HEALTH = 13000,

MIN_MANA = 4000,

MAX_MANA = 6000

},

["mage"] = {

MIN_MANA = getPlayerLevel(cid) + getPlayerMagLevel(cid) * 4 * 0 + 11000,

MAX_MANA = getPlayerLevel(cid) + getPlayerMagLevel(cid) * 4 * 0 + 17000

},

["kina"] = {

MIN_HEALTH = 10000,

MAX_HEALTH = 18000,

MIN_MANA = 3000,

MAX_MANA = 5000

}

}

 

if isPlayer(itemEx.uid) == FALSE or cid ~= itemEx.uid then

return FALSE

end

if getPlayerVocation(cid) < 5 then

doPlayerSendDefaultCancel(cid, "Somente jogadores VIP(s) podem ultilizar esta runa.")

return TRUE

end

if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then

doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)

return TRUE

end

if(getPlayerLevel(itemEx.uid) < 80) and (getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then

doCreatureSay(itemEx.uid, "Você Precisa obter o level 80 para ultilizar esta runa.", TALKTYPE_ORANGE_1)

return TRUE

end

if isPaladin(itemEx.uid) then

if doCreatureAddHealth(itemEx.uid, math.random(cfg["paladin"].MIN_HEALTH + getPlayerLevel(cid), cfg["paladin"].MAX_HEALTH + getPlayerLevel(cid))) == LUA_ERROR or doPlayerAddMana(itemEx.uid, math.random(cfg["paladin"].MIN_MANA + getPlayerLevel(cid), cfg["paladin"].MAX_MANA + getPlayerLevel(cid))) == LUA_ERROR then

return FALSE

end

doCreatureSay(itemEx.uid, "Pally Vip Rune", TALKTYPE_ORANGE_1)

elseif isDruid(itemEx.uid) or isSorcerer(itemEx.uid) then

if doPlayerAddMana(itemEx.uid, math.random(cfg["mage"].MIN_MANA, cfg["mage"].MAX_MANA)) == LUA_ERROR then

return FALSE

end

doCreatureSay(itemEx.uid, "Mage Vip Rune", TALKTYPE_ORANGE_1)

elseif isKnight(itemEx.uid) then

local function onGetFormulaValues(cid, level, maglevel)

min = (level * 1 + maglevel * 5) * 3.8 - 24

max = (level * 1 + maglevel * 5) * 4.1

if min < 4000 then

min = 6000

end

 

return {[1] = min, [2] = max}

end

local result = onGetFormulaValues(cid, getPlayerLevel(cid), getPlayerMagLevel(cid))

if doCreatureAddHealth(itemEx.uid, math.random(result[1], result[2])) == LUA_ERROR or doPlayerAddMana(itemEx.uid, math.random(cfg["kina"].MIN_MANA + getPlayerLevel(cid), cfg["kina"].MAX_MANA + getPlayerLevel(cid))) == LUA_ERROR then

return FALSE

end

doCreatureSay(itemEx.uid, "Kina Vip Rune", TALKTYPE_ORANGE_1)

end

doAddCondition(cid, exhaust)

doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)

return TRUE

end

 

 

 

quem me ajuda ganha REP+!!!!!!!

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

Tenta ai:

 

 

 

local exhaust = createConditionObject(CONDITION_EXHAUST)

setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local cfg = {

["paladin"] = {

MIN_HEALTH = 6000,

MAX_HEALTH = 13000,

MIN_MANA = 4000,

MAX_MANA = 6000

},

["mage"] = {

MIN_MANA = getPlayerLevel(cid) + getPlayerMagLevel(cid) * 4 * 0 + 11000,

MAX_MANA = getPlayerLevel(cid) + getPlayerMagLevel(cid) * 4 * 0 + 17000

},

["kina"] = {

MIN_HEALTH = 10000,

MAX_HEALTH = 18000,

MIN_MANA = 3000,

MAX_MANA = 5000

}

}

 

if isPlayer(itemEx.uid) == FALSE or cid ~= itemEx.uid then

return FALSE

end

 

if getPlayerVocation(cid) < 5 then

doPlayerSendDefaultCancel(cid, "Somente jogadores VIP(s) podem ultilizar esta runa.")

return TRUE

end

 

if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then

doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)

return TRUE

end

 

if(getPlayerLevel(itemEx.uid) < 80) and (getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then

doCreatureSay(itemEx.uid, "Você Precisa obter o level 80 para ultilizar esta runa.", TALKTYPE_ORANGE_1)

return TRUE

end

 

if isPaladin(itemEx.uid) then

if doCreatureAddHealth(itemEx.uid, math.random(cfg["paladin"].MIN_HEALTH + getPlayerLevel(cid), cfg["paladin"].MAX_HEALTH + getPlayerLevel(cid))) == LUA_ERROR or doPlayerAddMana(itemEx.uid, math.random(cfg["paladin"].MIN_MANA + getPlayerLevel(cid), cfg["paladin"].MAX_MANA + getPlayerLevel(cid))) == LUA_ERROR then

return FALSE

end

doCreatureSay(itemEx.uid, "Pally Vip Rune", TALKTYPE_ORANGE_1)

end

 

if isDruid(itemEx.uid) or isSorcerer(itemEx.uid) then

if doPlayerAddMana(itemEx.uid, math.random(cfg["mage"].MIN_MANA, cfg["mage"].MAX_MANA)) == LUA_ERROR then

return FALSE

end

doCreatureSay(itemEx.uid, "Mage Vip Rune", TALKTYPE_ORANGE_1)

end

 

if isKnight(itemEx.uid) then

if doCreatureAddHealth(itemEx.uid, math.random(cfg["kina"].MIN_HEALTH + getPlayerLevel(cid), cfg["kina"].MAX_HEALTH + getPlayerLevel(cid))) == LUA_ERROR or doPlayerAddMana(itemEx.uid, math.random(cfg["kina"].MIN_MANA + getPlayerLevel(cid), cfg["kina"].MAX_MANA + getPlayerLevel(cid))) == LUA_ERROR then

return FALSE

end

doCreatureSay(itemEx.uid, "Kina Vip Rune", TALKTYPE_ORANGE_1)

end

 

doAddCondition(cid, exhaust)

doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)

return TRUE

end

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...