TI

Simples sistema de Pet Ajuda

Por Tio Gandalf, 16 de mai. de 2020 em Scripts

1
773
Tio GandalfT
16 de maio de 2020 às 18:18

Ola boa noite senhores, gostaria de ajuda se possível, de adaptar esse spript pra uma vocação especifica, tipo só pra paladin etc.., agradeço muito quem puder me ajudar!!!!

 

 

 

se localiza na pasta action

 

 

        <action itemid="6546" script="other/upgrade.lua"/>

 

 

function onUse(cid, item, frompos, item2, topos)

if getTilePzInfo(getCreaturePosition(cid)) then
doPlayerSendCancel(cid,"Esse monstro nao pode ser sumonado em protect zone!.")
return TRUE
end
if (getPlayerStorageValue(cid, 11548) >= os.time()) then
doPlayerSendTextMessage(cid, 6,"Por medidas de segurança você só pode utilizar este comando em " ..
(getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
return true
end
storage = 11548
if #getCreatureSummons(cid) >= 1 then
return doPlayerSendCancel(cid,"Voce nao pode ter summons para batalhar!")
end
if getPlayerStorageValue(cid,storsol) == 1 then
local z = getCreatureSummons(cid)[1]
doSendMagicEffect(getCreaturePosition(z), 2)
doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 3)
return true
end
local summons = getCreatureSummons(cid)
local pet = {
["Bug"] = {1,250},
["rotworm"] = {251,300},
["dragon"] = {301,5000},
["demon"] = {5001,9999},
["infernatil"] = {10000,15000},
["morgaroth"] = {15001,23000},
["ghazbaran"] = {23001,30000}
}
for k,v in pairs(pet) do -- 1
if getPlayerStorageValue(cid,storsol) < 1 then
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2
if (table.maxn(summons) < 1)then -- 3
x = doSummonCreature(k, getCreaturePosition(cid))
doConvinceCreature(cid, x)
setPlayerStorageValue(cid,11548,os.time()+30)
doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
end
end
end
end
return true
end