Não entendi direito.
Se você estiver querendo uma magia que sumona um monstro (apenas um) eu ti arranjo.
Ex:
-Player usa magia
-Monstro sumonado
-Player tenta sumonar de novo. não conssegue
-Algum tempo depois o monstro some (tempo escolhido por você)
-Player já pode sumona-lo novamente
Se for isso que você quer eu ti arranjo.





info
Grupo: Campones
Registrado: 27/07/12
Posts: 24
Reputação: 0
eu tava querendo fazer uma magia q invocasse um crystal protector tipo pbot, fiz tudinho e tals, mas quando uso a magia simplesmente disse que o mostro ja foi invocado mesmo não tendo aparecido nada...
Spells.xml
</instant>
<instant name="utevo aura" words="utevo aura" lvl="300" mana="2000" casterTargetOrDirection="1" blockwalls="1" exhaustion="3000" needlearn="0" script="pbot/utevo aura.lua">
<vocation id="9"/>
<vocation id="10"/>
e script
local removeTime = 1.0 --time to remove the clones
local mana = 1000
local HAVE_CLONE = 65537 --storage to know if you have clones or not
local arr = {
{
{0, 0, 0},
{0, 2, 0},
{0, 1, 0}
}
}
local function removeCreatures(cid, creature)
setPlayerStorageValue(cid, HAVE_CLONE, 0)
if isCreature(creature) == TRUE then
doRemoveCreature(creature)
end
end
function onTargetTile(cid, pos)
local creature = doSummonCreature("Protector", pos)
doCreatureAddMana(cid, -1500)
doCreatureSay(cid, "Utevo Aura", TALKTYPE_ORANGE_1)
doConvinceCreature(cid, creature)
addEvent(removeCreatures, removeTime * 30000, cid, creature)
return TRUE
end
local combat = {}
for i = 1, 1 do
combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_POFF)
setCombatArea(combat, createCombatArea(arr))
_G["onTargetTile" .. i] = onTargetTile
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile" .. i)
end
function onCastSpell(cid, var)
local level = getPlayerLevel(cid)
if getPlayerStorageValue(cid, HAVE_CLONE) < 1 then
if level > 350 then
doCombat(cid, combat[1], var)
else
doCombat(cid, combat[1], var)
end
setPlayerStorageValue(cid, HAVE_CLONE, 1)
else
doPlayerSendCancel(cid, "Voce ja fez o Crystal Protector.")
end
end