Forkz
Well-Known Member
- Joined
- Jun 29, 2020
- Messages
- 380
- Solutions
- 1
- Reaction score
- 89
Hello otlanders,
According to the script below my spell spawns a custom monster around the target but when the target enters PZ or teleport area the monster stops attacking and does not end the attack (time).
Script Spell
According to the script below my spell spawns a custom monster around the target but when the target enters PZ or teleport area the monster stops attacking and does not end the attack (time).
Script Spell
Lua:
local removeTime = 3 --time to remove the clones
local arrs = {
{ x=-1, y=-1},
{ x=1, y=-1},
{ x=-1, y=1},
{ x=1, y=1}
}
local summonName = "Headcaptor"
local effect = CONST_ME_MAGIC_BLUE
local summonSay = "headcaptor"
function onCastSpell(cid, var)
local targetId = variantToNumber(var)
if not targetId then
return false
end
for k, v in pairs(arrs) do
local position = getCreaturePosition(targetId)
position.x, position.y = position.x + v.x, position.y + v.y
local creature = doCreateMonster(summonName, position, false, true)
if isCreature(creature) then
doTeleportThing(creature, position)
doSendMagicEffect(position, effect)
doConvinceCreature(cid, creature)
doMonsterSetTarget(creature, targetId)
doCreatureSay(creature, summonSay, TALKTYPE_ORANGE_1)
addEvent(function (creature)
if isCreature(creature) then
doRemoveCreature(creature)
end
end, 1000 * removeTime, creature)
end
end
return true
end