e basicamente um pet system eu fiz por talkactions!
function onSay(cid, words, param)
local pet = {
["Orc"] = {10, 20},
["Dragon"] = {30,40},
["Cyclops"] = {50,500000}
}
local a = getCreatureSummons(cid)
for k,v in pairs(pet) do
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) <= v[2] then
if (table.maxn(a) < 1)then
x = doSummonCreature(k, getThingPos(cid))
doConvinceCreature(cid,x)
doCreatureSay(cid,"Help my "..k.." pet",TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
elseif words == "!removepet" then
doCreatureSay(cid,"Thanks my "..getCreatureName(a[1]).." pet",TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
doRemoveCreature(a[1])
else
doPlayerSendCancel(cid,"you have pet summoned")
return TRUE
end
end
end
end
e aki por spells so que eu dei uma implementada no da spells tem umas fazes fico legalzin!
function onPet(cid)
local pet = {
["Orc"] = {10, 20},
["Dragon"] = {30,40},
["Cyclops"] = {50,500000}
}
local a = getCreatureSummons(cid)
for k,v in pairs(pet) do
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) <= v[2] then
if (table.maxn(a) < 1)then
x = doSummonCreature(k, getThingPos(cid))
doConvinceCreature(cid,x)
doCreatureSay(cid,"Help my "..k.." pet",TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
addEvent(onPet,500,cid)
return TRUE
end
end
end
end
function onCastSpell(cid, var)
addEvent(doCreatureSay,500,cid,"Pelos poderes")
addEvent(doCreatureSay,1500,cid,"dados a min")
addEvent(doCreatureSay,2500,cid,"eu invoco")
addEvent(doCreatureSay,3500,cid,"uma criatura")
addEvent(doCreatureSay,4500,cid,"Saida do inferno")
addEvent(doCreatureSay,5500,cid,"erga-te")
addEvent(onPet,6500,cid)
return TRUE
end
Tag do talkactions
<talkaction words="!pet;!removepet" script="nome arquivo.lua"/>
e aki da spells
<instant name="Pet" words="invocar" lvl="12" mana="20" prem="0" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="1000" needlearn="0" event="script" value="nome arquivo.lua"> </instant>





info
Grupo: Campones
Registrado: 27/08/08
Posts: 57
Reputação: +6
Ola galera estou tentando fazer uma magia na qal o player sumone um bixo e consequentimente o bixo ajuda o player a atkar qando for colokado o target, meu problema ta na função de convense eu n acho e qando acho n consigo usar então pesso q me ajudem.... Obrigado.