QUANDO OS PLAYERS DO MEU OT ESTAO EM WAR ELE USA AS POTIONS PARA CURAR. MAIS DO NADA ELA PARA DE CURA. AI SE O CARA RELOGA AI ELE CONSEGUE CURA NOVAMENTE. SE ALGUEM ENTENDA SOBRE ESTE BUG. ME AJUDA
PORFAVOR OU ADD SKYP : killobi
QUANDO OS PLAYERS DO MEU OT ESTAO EM WAR ELE USA AS POTIONS PARA CURAR. MAIS DO NADA ELA PARA DE CURA. AI SE O CARA RELOGA AI ELE CONSEGUE CURA NOVAMENTE. SE ALGUEM ENTENDA SOBRE ESTE BUG. ME AJUDA
PORFAVOR OU ADD SKYP : killobi
1° Evite usar caps lock
2° Leia as Regras "Nao é permitido utilizar outros meios de comunicaçao para ajudar ou Obter ajuda, o Xtibia é um forum e todas as duvidas deveram ser senadas aqui"
3° Reorganize seu topico dessa vez com uma Fonte adequada!
e qual a versão do seu OT?
8.6 . descupa ai mano so novo aki nao sei vo ler as regras sim !
Topico esta em uma area incorreta
a area certa seria "Pedidos e duvidas de scipring"
Reportado!!
ei . mais me ajuda arrumar isso no meu OT ?
local all = {1,2,3,4,5,7,6,8} -- All Vocations.
local potions = {
[7620] = {vocations = all, emptypotion = 7636, mana = {1200, 1200}},
[7589] = {level = 50, vocations = {1, 2, 3, 5, 6, 7}, emptypotion = 7634, mana = {1200, 1200}},
[7590] = {level = 80, vocations = {1, 2, 5, 6}, emptypotion = 7635, mana = {1200, 1200}},
[8704] = {vocations = all, emptypotion = 7636, health = {1200, 1200}},
[7618] = {vocations = all, emptypotion = 7636, health = {1200, 1200}},
[7588] = {level = 50, vocations = {3, 4, 7, 8}, emptypotion = 7634, health = {1200, 1200}},
[7591] = {level = 80, vocations = {4, 8}, emptypotion = 7635, health = {1200, 1200}},
[8473] = {level = 130, vocations = {4, 8}, emptypotion = 7635, health = {1200, 1200}},
[8472] = {level = 80, vocations = {3, 7}, emptypotion = 7635, health = {1200, 1200}, mana = {1200, 1200}},
}
local potionc = "" -- Use ".
function getVocNames(tab)
function getVocName(v)
return isInArray({1, 5}, v) and "sorcerers" or isInArray({2, 6}, v) and "druids" or isInArray({3,7}, v) and "paladins" or isInArray({4,8}, v) and "knights" or ""
end
for i = 1, #tab do
if not string.find((a == nil and "" or a), getVocName(tab)) then
a = a and a .. " and " .. getVocName(tab) or getVocName(tab)
end
end
return a
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
if getPlayerAccess(cid) >= 4 or isInArray(potions[item.itemid].vocations, getPlayerVocation(itemEx.uid)) and getPlayerLevel(itemEx.uid) >= (potions[item.itemid].level == nil and 0 or potions[item.itemid].level) and getPlayerLevel(cid) >= (potions[item.itemid].level == nil and 0 or potions[item.itemid].level) then
if potions[item.itemid].mana then
doCreatureAddMana(itemEx.uid, math.random(potions[item.itemid].mana[1], potions[item.itemid].mana[2]))
end
if potions[item.itemid].health then
doCreatureAddHealth(itemEx.uid, math.random(potions[item.itemid].health[1], potions[item.itemid].health[2]))
end
if potionc == "transform" then
if getPlayerItemById(cid, TRUE, potions[item.itemid].emptypotion).uid ~= 0 then
if getPlayerItemById(cid, TRUE, potions[item.itemid].emptypotion).type < 100 then
doTransformItem(getPlayerItemById(cid, TRUE, potions[item.itemid].emptypotion).uid, potions[item.itemid].emptypotion, getPlayerItemById(cid, TRUE, potions[item.itemid].emptypotion).type+1)
doRemoveItem(item.uid, 1)
else
doPlayerAddItem(cid, potions[item.itemid].emptypotion, 1)
doRemoveItem(item.uid, 1)
end
else
doPlayerAddItem(cid, potions[item.itemid].emptypotion, 1)
doRemoveItem(item.uid, 1)
end
elseif potionc == "remove" then
doRemoveItem(item.uid, 1)
end
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
else
return doCreatureSay(itemEx.uid, "Only " .. getVocNames(potions[item.itemid].vocations) .. (potions[item.itemid].level and " of level " .. potions[item.itemid].level .. " or above " or " ") .. "may drink this fluid.", TALKTYPE_ORANGE_1)
end
end
return TRUE
end
poiqwsdop, sei que voce é novato entao quero te dar uma dica, sempre que voce for postar algum script grande utilize o spoiler
(codigo= [.spoiler] texto [./spoiler] "sem os pontos")
e uma outra pergunta quando o player usa a potion da algum erro no seu distro?
entaum erro no distro nao aparece nada.
Topico esta em uma area incorreta
a area certa seria "Pedidos e duvidas de scipring"
Reportado!!
na verdade aqui pode ser abordado todo tipo de duvida!
e creio que seja prblema de com,pilação e nao de script!
Daijobu!
cada 1 me fala uma coisa. e ngm resolve o meu poblema. adianta o que fica movendo de topico
ai agr ngm responde
ja tentou utilizar outro script ?
Topico esta em uma area incorreta
a area certa seria "Pedidos e duvidas de scipring"
Reportado!!
Essa area serve para todos o pedidos e duvidas de iniciantes , eles devem perguntar aqui antes de irem para as categorias especificas.
@topic
Você pode tentar usar isso , mas salve o seu em outro lugar antes.
local config = {
removeOnUse = "no",
usableOnTarget = "yes", -- can be used on target? (fe. healing friend)
splashable = "no",
realAnimation = "no", -- make text effect visible only for players in range 1x1
healthMultiplier = 1.0,
manaMultiplier = 1.0
}
config.removeOnUse = getBooleanFromString(config.removeOnUse)
config.usableOnTarget = getBooleanFromString(config.usableOnTarget)
config.splashable = getBooleanFromString(config.splashable)
config.realAnimation = getBooleanFromString(config.realAnimation)
local POTIONS = {
[8704] = {empty = 7636, splash = 2, health = {50, 100}}, -- small health potion
[7618] = {empty = 7636, splash = 2, health = {100, 200}}, -- health potion
[7588] = {empty = 7634, splash = 2, health = {200, 400}, level = 50, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion
[7591] = {empty = 7635, splash = 2, health = {500, 700}, level = 80, vocations = {4, 8}, vocStr = "knights"}, -- great health potion
[8473] = {empty = 7635, splash = 2, health = {800, 1000}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion
[7620] = {empty = 7636, splash = 7, mana = {70, 130}}, -- mana potion
[7589] = {empty = 7634, splash = 7, mana = {110, 190}, level = 50, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion
[7590] = {empty = 7635, splash = 7, mana = {200, 300}, level = 80, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion
[8472] = {empty = 7635, splash = 3, health = {200, 400}, mana = {110, 190}, level = 80, vocations = {3, 7}, vocStr = "paladins"} -- great spirit potion
}
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
local potion = POTIONS[item.itemid]
if(not potion) then
return false
end
if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then
if(not config.splashable) then
return false
end
if(toPosition.x == CONTAINER_POSITION) then
toPosition = getThingPos(item.uid)
end
doDecayItem(doCreateItem(2016, potion.splash, toPosition))
doTransformItem(item.uid, potion.empty)
return true
end
if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and
not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES))
then
doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1)
return true
end
local health = potion.health
if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then
return false
end
local mana = potion.mana
if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then
return false
end
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
if(not realAnimation) then
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
else
for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do
if(isPlayer(tid)) then
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid)
end
end
end
doAddCondition(cid, exhaust)
if(not potion.empty or config.removeOnUse) then
doRemoveItem(item.uid, 1)
return true
end
doRemoveItem(item.uid, 1)
return true
end
<action itemid="7588-7591;8472-8473;7618;7620;8704" event="script" value="liquids/potions.lua"/>
Estão na pasta aqui dum ot e funcionam normalmente
Tente esse
local config = { removeOnUse = "yes", usableOnTarget = "yes", -- can be used on target? (fe. healing friend) splashable = "no", range = -1, realAnimation = "no", -- make text effect visible only for players in range 1x1 multiplier = { health = 1.0, mana = 1.0 } } config.removeOnUse = getBooleanFromString(config.removeOnUse) config.usableOnTarget = getBooleanFromString(config.usableOnTarget) config.splashable = getBooleanFromString(config.splashable) config.realAnimation = getBooleanFromString(config.realAnimation) local POTIONS = { [8704] = {empty = 7636, splash = 42, health = {50, 100}}, -- small health potion [7618] = {empty = 7636, splash = 42, health = {100, 200}}, -- health potion [7588] = {empty = 7634, splash = 42, health = {200, 400}, level = 50, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion [7591] = {empty = 7635, splash = 42, health = {500, 700}, level = 80, vocations = {4, 8}, vocStr = "knights"}, -- great health potion [8473] = {empty = 7635, splash = 42, health = {800, 1000}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion [7620] = {empty = 7636, splash = 47, mana = {70, 130}}, -- mana potion [7589] = {empty = 7634, splash = 47, mana = {110, 190}, level = 50, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion [7590] = {empty = 7635, splash = 47, mana = {200, 300}, level = 80, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion [8472] = {empty = 7635, splash = 43, health = {200, 400}, mana = {110, 190}, level = 80, vocations = {3, 7}, vocStr = "paladins"} -- great spirit potion } local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) local potion = POTIONS[item.itemid] if(not potion) then return false end if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then if(not config.splashable) then return false end if(toPosition.x == CONTAINER_POSITION) then toPosition = getThingPosition(item.uid) end doDecayItem(doCreateItem(POOL, potion.splash, toPosition)) doRemoveItem(item.uid, 1) if(not potion.empty or config.removeOnUse) then return true end if(fromPosition.x ~= CONTAINER_POSITION) then doCreateItem(potion.empty, fromPosition) else doPlayerAddItem(cid, potion.empty, 1) end return true end if(hasCondition(cid, CONDITION_EXHAUST)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return true end if(((potion.level and getPlayerLevel(itemEx.uid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(itemEx.uid)))) and not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1) return true end if(config.range > 0 and cid ~= itemEx.uid and getDistanceBetween(getThingPosition(cid), getThingPosition(itemEx.uid)) > config.range) then return false end local health = potion.health if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.multiplier.health))) then return false end local mana = potion.mana if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.multiplier.mana))) then return false end doSendMagicEffect(getThingPosition(itemEx.uid), CONST_ME_MAGIC_BLUE) if(not config.realAnimation) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) else for i, tid in ipairs(getSpectators(getThingPosition(itemEx.uid), 1, 1)) do if(isPlayer(tid)) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid) end end end doAddCondition(cid, exhaust) doRemoveItem(item.uid, 1) if(not potion.empty or config.removeOnUse) then return true end if(fromPosition.x ~= CONTAINER_POSITION) then doCreateItem(potion.empty, fromPosition) else doPlayerAddItem(cid, potion.empty, 1) end return true end
#Configurando
removeOnUse = "yes", -- Remover ao usar ?
usableOnTarget = "yes", -- can be used on target? (fe. healing friend)
Pode ser usado no target ?
teste e poste o resultado
"O fracasso é a oportunidade de se começar de novo inteligentemente"