data\talkactions\scripts\nomedoarquivo.lua
function onSay(cid, words, param, channel)
--configuration by notle
local i = {qnt = 3, --Quantia de summons permitida
level = 10, -- level pra usa summons
mana = 250, -- quanto de mana que vai perde assim que usa
voc = {1,2,3,4,5,6,7,8,9,10,11,12}, -- ID das vocations
ignore = {"demon","apocalypse","treiner"}} -- summon que não pode ser criandos
--configuration by notle
local pid = cid
local t = string.explode(param, ",")
if getPlayerMana(cid) > i.mana then
if(t[2]) then
pid = getPlayerByNameWildcard(t[2])
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.") then return true end
elseif #getCreatureSummons(cid) == i.qnt and doPlayerSendCancel(cid, "Máximo de summons atingido.") then return true
elseif getPlayerLevel(cid) <= i.level and doPlayerSendCancel(cid, "sorry insufficient level [up ate " ..i.level.. "].") then return true
elseif not isInArray(i.voc, getPlayerVocation(cid)) and doPlayerSendCancel(cid, " Your vocation can not create summons.") then return true
elseif isInArray(i.ignore, string.lower(t[1])) and doPlayerSendCancel(cid, "you can not summon this creature.") then return true end
for o = 1,i.qnt and doSummonMonster(pid, t[1]) do
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "you invoked a "..t[1].."")
return doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) and doPlayerAddMana(cid, -i.mana) and true
end
else
return doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) and doPlayerSendCancel(cid, "sorry insufficient mana.")
end
end
talkactions.xml
<talkaction words="!cmd" event="script" value="nomedoarquivo.lua"/>
pra usa comando !cmd dragon
só editar a o gosto
--configuration by notle
local i = {qnt = 3, --Quantia de summons permitida
level = 10, -- level pra usa summons
mana = 250, -- quanto de mana que vai perde assim que usa
voc = {1,2,3,4,5,6,7,8,9,10,11,12}, -- ID das vocations
ignore = {"demon","apocalypse","treiner"}} -- summon que não pode ser criandos
--configuration by notle