xii mano esse script ae fico taooooooooo POGado.... kkk' nem sabia oq tava fazendo direito ae kkk
tenta fazer assim...
troca a tabela do lib/configuration.lua por isso...
headbutt = {
--[{lvl min, lvl max}] = {},
[{1, 25}] = {{"Metapod", 3}, {"Kakuna", 3}, {"Pidgey", 3}, {"Ekans", 1}, {"Sentret", 1}, {"Pineco", 1}, {"Spinarak", 2}},
[{26, 40}] = {{"Pineco", 2}, {"Pidgeotto", 1}, {"Hoothoot", 1}, {"Natu", 1}, {"Beedrill", 2}, {"Spearow", 3}},
[{41, 60}] = {{"Arbok", 1}, {"Beedrill", 4}, {"Furret", 1}, {"Ariados", 2}, {"Pidgeotto", 2}, {"Yanma", 1}, {"Pineco", 4}},
[{61, 80}] = {{"Beedrill", 5}, {"Forretress", 1}, {"Furret", 3}, {"Ariados", 3}, {"Pidgeotto", 4}, {"Yanma", 3}},
[{81, 100000}] = {{"Forretress", 3}, {"Noctowl", 2}, {"Xatu", 2}, {"Yanma", 4}, {"Beedrill", 6}, {"Furret", 6}},
}
e troca a parte do lib/order.lua por isso...
elseif skill == "headbutt" then --alterado v1.6
local master = getCreatureMaster(sid)
local array = {}
for lvls, pokes in pairs(headbutt) do
if getPlayerLevel(master) >= lvls[1] and getPlayerLevel(master) <= lvls[2] then
array = pokes
break
end
end
if not next(array) then --proteçao para caso algum player tenha lvl maior q o limite da tabela, q ali ta 100k
print("Some player have level bigger then 100k ")
doPlayerSendTextMessage(cid, 20, "You can't have level bigger then 100k ")
return true
end
local rand = array[math.random(#array)]
for j = 1, rand[2] do
local poke = doCreateMonster(rand[1], getClosestFreeTile(sid, pos), false)
doSetMonsterPassive(poke)
doWildAttackPlayer(poke, master)
end
local item = getTileItemById(pos, 12591) --id do item arvore normal
doCreatureSay(sid, "HEADBUTT!", TALKTYPE_MONSTER)
markPos(sid, {x=1,y=1,z=7})
doFaceCreature(sid, pos)
doSendMagicEffect(getThingPos(item.uid), 118)
doTransformItem(item.uid, 12592) --id do item arvore quebrada
local function growHead()
doTransformItem(getTileItemById(pos, 12592).uid, 12591) --id do item arvore quebrada, arvore normal
end
addEvent(growHead, choose(5, 10, 20, 30) * 60 * 1000) --o tempo pra arvore voltar ao normal varia de 5~30min
caso ainda de o problema, veja se os ids das arvores esta correto...
12591 = arvore normal 12592 = arvore quebrada
e tb veja se o poke q tas usando ta na tabela...
specialabilities["headbutt"]
ps: nao testei ^^








info
Grupo: Campones
Registrado: 13/06/12
Posts: 83
Reputação: +13
http://www.xtibia.com/forum/topic/205878-como-editar-headbutt-do-pda/
Daonde sai esse homologação.xtibia? haha