arthurluna
Member
- Joined
- Apr 12, 2008
- Messages
- 178
- Reaction score
- 12
How do I only one monster be summoned in a certain area?
it is checked if there is a monster in this particular area if you have not created another show again.
it is checked if there is a monster in this particular area if you have not created another show again.
- creature:getTile()
- getCreaturePosition
- getTopCreature(position)
Code:
function onAddItem(moveitem, tileitem, position)
local v = t[tileitem.itemid]
if(v and v.corpse == moveitem.itemid) then
for x = v.fromPos.x, v.toPos.x do
for y = v.fromPos.y, v.toPos.y do
for z = v.fromPos.z, v.toPos.z do
if(not isMonster(getTopCreature({x = x, y = y, z = z}).uid < v.boss)) then
doRemoveItem(moveitem.uid)
doSendMagicEffect(position, v.effect)
return Game.createMonster(v.boss, {x = math.random(v.fromPosition.x, v.toPosition.x), y = math.random(v.fromPosition.y, v.toPosition.y), z = 13})
end
end
end
end
end
return true
end
Last edited: