Sistema por talkactions
Descrição
!back - remove o pet
Level minimo e maximo -- para sumonar o pet
Maximo Summons -- Só pode sumonar 1 pet
tilepz -- em protec zone não pode summonar
Talkactions/scripts
function onSay(cid, words, param, itemEx, params) if isCreature(cid) then if words == "!back" then doRemoveCreature(x) return True end end local summons = getCreatureSummons(cid) local monster = { ["dragon lord hatchling"] = { Level = 10, Levelmax = 30, Voc = 1, Vocp = 5 }, ["dragon hatchling"] = { Level = 10, Levelmax = 30, Voc = 2, Vocp = 6 }, ["frost dragon hatchling"] = { Level = 10, Levelmax = 30, Voc = 3, Vocp = 7 }, ["dark dragon hatchling"] = { Level = 10, Levelmax = 30, Voc = 4, Vocp = 8 } } for k,v in pairs(monster) do if getPlayerVocation(cid) == v.Voc or getPlayerVocation(cid) == v.Vocp then if getPlayerLevel(cid) >= v.Level and getPlayerLevel(cid) <= v.Levelmax then if (table.maxn(summons) < 1)then if getTilePzInfo(getCreaturePosition(cid)) == false then x = doSummonCreature(k, getCreaturePosition(cid)) doConvinceCreature(cid, x) doCreatureSay(cid, "Go to me ,".. k,1) else doPlayerSendCancel(cid, "Sorry, You cannot create Element Pet in pz.") end else doPlayerSendCancel(cid, "Sorry, You can not create more than one Element Pet.") end else doPlayerSendCancel(cid, "Sorry, You no have Level for creat your Element Pet.") end end end return true end
Talkactions.xml
<talkaction words="!criar" script="vocationsummon.lua"/> <talkaction words="!back" script="vocationsummon.lua"/>
Editando
["Nome do Monster"] = { Level = Level Minimo, Levelmax = Level Maximo, Voc = Vocação, Vocp = Promotion },
não esqueça de editar a flag
<flag convinceable="1"/>
no monster
e no ultimo monster da tabela não deve ter virgula no final
Tirando Lvl Max
Procure por
if getPlayerLevel(cid) >= v.Level and getPlayerLevel(cid) <= v.Levelmax then
e Deixa assim
if getPlayerLevel(cid) >= v.Level then
Gosto ? Da ++rep não cai o dedo