• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Request] Help With Spell, Summon Only For A Monster.

Trinks OT

New Member
Joined
Jun 24, 2011
Messages
3
Reaction score
0
Em 2 linguagens para ficar mais fácil de me ajudarem.
In two languages ​​to make it easier to help me.

PORTUGUES:

Tipo do script: SPELL
Protocolo (versão do Tibia): 8.60
Servidor utilizado: TFS
Nível de experiência: MÉDIO
Adicionais/Informações:

Bom, abaixo irei mostrar o Script da Spell, ela é uma spell de summon, é arrumadinha e tal, mas tem um problema, pode summonar mais de um.

Eu queria que assim, enquanto o monstro tiver vivo, nao possa summonar outro, assim que o mosntro desaparecer, o player ja pode voltar a summonar.

Se puder colocar a seguinte mensagem: Você já fez seu Cyber Protector.

Conto com a colaboração de vocês meus amigos.

INGLES

Type of script: SPELL
Protocol (Tibia version): 8.60
Server used: TFS
Experience Level: MEDIUM
Additional / Info:

Well, the script below will show the spell, it is a spell to summon, is neat and all, but has a problem, you can summon more than one.

I wanted so, as the monster you live, can not summon another, so the monster disappears, the player can already re-summon.

If you can put the following message: You've done your Cyber ​​Protector.

I count on the cooperation of you my friends.

function onTargetTile(cid, position)
position.stackpos = 255
doConvinceCreature(cid, doCreateMonster("protector", position, false))
doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
return true
end
local arr = {
{0, 0, 0},
{0, 2, 0},
{0, 1, 0},
}
local removeTime = 30.0 --time to remove the clones


local function removeCreatures(cid, creature)
if isCreature(creature) == TRUE then
doRemoveCreature(creature)
end
end

function onTargetTile(cid, pos)
local creature = doSummonCreature("Protector", pos)
doCreatureAddMana(cid, -1500)
doConvinceCreature(cid, creature)
addEvent(removeCreatures, removeTime * 3000, cid, creature)
return TRUE
end


local area, combat = createCombatArea(arr), createCombatObject()
setCombatArea(combat, area)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Oi amigo, não sei se te ajuda, mas por ex.. como você está usando um time de 30 segundos que o monstro ficará vivo, pode ir nesse caminho e colocar um storage de 30 segundos.. assim.. quando sumona o primeiro, ele adiciona a storage no player, enquanto a storage for <= 30 segundos, ele não poderá sumonar outro..

Seria uma alternativa...

Caso esse monstro ai, seja só para essa "quest".. também pode criar um creaturescript onde check que o monster morreu e colocar a storage pra zero..

Você pode pegar um exemplo daquelas quests que geram teleport quando monstro morre, saca? ai só trocar as funcões de teleprot pra storage..
 
Replace
Code:
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
with
Code:
function onCastSpell(cid, var)
for _,summon in pairs(getCreatureSummons(cid)) do
if (string.lower(getCreatureName(summon)) == "protector") then
return doPlayerSendCancel(cid, "You've done your Cyber ​​Protector.")
end
end
return doCombat(cid, combat, var)
end
 
Back
Top