local FOODS = {
ITEM_FOOD_MEAT,
ITEM_HAM,
ITEM_FOOD_GRAPE,
ITEM_FOOD_APLE,
ITEM_FOOD_BREAD,
ITEM_FOOD_ROOL,
ITEM_FOOD_CHEESE
}
function onCastSpell(cid, var)
local size = table.maxn(FOODS)
if (doPlayerAddItem(cid, FOODS[math.random(1, size)])) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
return false
end
if(math.random(1, 100) > 50) then
doPlayerAddItem(cid, FOODS[math.random(1, size)])
end
doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN)
return true
end
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

info
Grupo: Visconde
Registrado: 21/08/11
Posts: 470
Reputação: +5
Char no Tibia: ...

local FOODS = { ITEM_FOOD_MEAT, ITEM_HAM, ITEM_FOOD_GRAPE, ITEM_FOOD_APLE, ITEM_FOOD_BREAD, ITEM_FOOD_ROOL, ITEM_FOOD_CHEESE } function onCastSpell(cid, var) local size = table.maxn(FOODS) if (doPlayerAddItem(cid, FOODS[math.random(1, size)])) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) return false end if(math.random(1, 100) > 50) then doPlayerAddItem(cid, FOODS[math.random(1, size)]) end doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN) return true end
agora n da mais erro no distro porem ainda continua sem exhausted e não gasta mana e nen sobe ml dos players.
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

Coloca a tag assim:
<conjure name="Food" words="exevo pan" lvl="14" mana="120" soul="1" exhaustion="1000" aggressive="0" function="conjureFood"> </conjure>
Dessa maneira evita de ter que ficar criando script.
info
Grupo: Visconde
Registrado: 21/08/11
Posts: 470
Reputação: +5
Char no Tibia: ...

LuckOake mesma coisa continua sem exhausted/n gasta mana/e nen sobe o ml dos players
LuckOake mesma coisa continua sem exhausted/n gasta mana/e nen sobe o ml dos players
Mais Você Esta Usando O Spell Com Um Character Player Ou Com O GOD?
info
Grupo: Visconde
Registrado: 21/08/11
Posts: 470
Reputação: +5
Char no Tibia: ...

player neh ...
é porque o SkyLigh tirou o not onde ele não deveria, fazendo com que o script retorne false caso o food seja criado pro player sem problemas, com o not a script fica certinho, pois se não der pra criar, não gasta mana, não aumenta ml etc (retorna false)
o script está 100%, o melhor a se fazer é verificar se todas essas constantes existem:
ITEM_FOOD_MEAT ITEM_HAM ITEM_FOOD_GRAPE ITEM_FOOD_APLE ITEM_FOOD_BREAD ITEM_FOOD_ROOL ITEM_FOOD_CHEESE
basta ir em data/lib/000-constant.lua e verificar se elas foram declaradas
info
Grupo: Visconde
Registrado: 21/08/11
Posts: 470
Reputação: +5
Char no Tibia: ...

mais bru123 os food estao sendo criados porem sem gastar mana /sem exhausted entendeu ?
+ vo da uma olhada aki nisso que voce falo
@edit verifikei aki e sim existem elas na lib
mas queria saber arrumar isso porque se não os players podem usar a magia como 1 anti-push
pois é so segurar o exevo pan na hotkey que não para de criar food e não tem exhasuted e nen gasta mana
Editado Outubro 23 por KennyxD






info
Grupo: Visconde
Registrado: 21/08/11
Posts: 470
Reputação: +5
Char no Tibia: ...
Galera Seguinte minha magia exevo pan no meu servidor 9.53 está bugada ela não tem exhausted não gasta mana e nen sobe ml dos players e dá o seguinte erro no distro quando usa elá
tag da minha spell exevo pan
Script do exevo pan
local FOODS = { ITEM_FOOD_MEAT, ITEM_HAM, ITEM_FOOD_GRAPE, ITEM_FOOD_APLE, ITEM_FOOD_BREAD, ITEM_FOOD_ROOL, ITEM_FOOD_CHEESE } function onCastSpell(cid, var) local size = table.maxn(FOODS) if(not doPlayerAddItem(cid, FOODS[math.random(1, size)])) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) return false end if(math.random(1, 100) > 50) then doPlayerAddItem(cid, FOODS[math.random(1, size)]) end doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN) return true endajuda ai valendo REP +