A ideia do sistema de move (m1, m2, m3) utilizando a doCreatureCastSpell seria basicamente assim:
Link da função: doCreatureCastSpell
function getTime(s)
local n = math.floor(s / 600)
s = s - (600 * n)
return n, s
end
function onSay(cid, words, param)
if #getCreatureSummons(cid) == 0 then --- Check SUMMON!
return doPlayerSendCancel(cid, "Sorry, not possible.")
end
local summon = moves[getCreatureName(getCreatureSummons(cid)[1])][words]
if not summon then
return true
end
local storage = summon.st
local cd = math.ceil(summon.cd/2)
local pokemon = getCreatureSummons(cid)[1]
local target = getCreatureTarget(cid)
---
if getTilePzInfo(getCreaturePosition(pokemon)) and summon.pz == false then --- Check PZ!
return doPlayerSendCancel(cid, "You can't use spells in protection zone.")
end
if getPlayerLevel(cid) < summon.minlvl then --- Check LVL!
return doPlayerSendCancel(cid, "You must be level "..summon.minlvl.." or higher to use this move.")
end
if os.time()-getPlayerStorageValue(cid, storage) <= cd then --- Check CD!
minutes,seconds = getTime(cd-(os.time()-getPlayerStorageValue(cid, storage)))
return doPlayerSendCancel(cid, "Wait "..seconds.." seconds to use "..summon.atk..".")
end
if target == 0 and summon.target then
return doPlayerSendCancel(cid, "You can't use this move.")
end
---
doCreatureSay(cid, getCreatureName(pokemon)..", "..summon.atk.."!", TALKTYPE_MONSTER)
doCreatureSay(pokemon, string.upper(summon.atk).."!", TALKTYPE_MONSTER)
doCreatureCastSpell(pokemon, summon.atk) --- Soltar SPELL!
---
setPlayerStorageValue(cid, storage, os.time()+cd) --- Setar CD!
return true
end
E a tabela com os moves algo assim:
moves = {
["Dragon"] = {
["m1"] = {atk = "Death Strike", minlvl = 20, st = 2000, cd = 0, target = true, pz = false},
["m2"] = {atk = "Flame Strike", minlvl = 20, st = 2001, cd = 0, target = true, pz = false},
["m3"] = {atk = "Mass Healing", minlvl = 20, st = 2002, cd = 0, target = false, pz = false},
["m4"] = {atk = "Wrath of Nature", minlvl = 20, st = 2003, cd = 0, target = false, pz = false},
},
}
No caso trabalharia apenas com as spells do spell.xml não precisaria criar duas spell uma pro summon e outra para o selvagem