Just a quick question - has anyone attempted to make a Cloud object/spell - that causes the Sleep condition??
As in a cloud / damageTile that Sleeps monsters whenever it deals damage (yes I realise damage wakes up monsters)
Just wondering if anyone has a work around for this?
Ive tried the basics like this:
Code: Select all
{
class = "TileDamager",
attackPower = 1,
repeatCount = 5,
repeatDelay = 1,
onHitMonster = function(self, monster)
monster:setCondition("sleep", 10)
if monster:hasCondition("sleep") then
monster:setConditionValue("sleep", 10)
end
end,
},
Code: Select all
{
class = "TileDamager",
attackPower = 1,
--sound = "dark_bolt_hit",
--screenEffect = "dark_bolt_screen",
repeatCount = 5,
repeatDelay = 1,
onHitMonster = function(self, monster)
delayedCall("trapSpellScripts", 0.2, "setSleepingMonster", monster.go.name)
end,
},
function setSleepingMonster(mon)
local m = findEntity(mon)
if m and m.monster then
print("monster")
m.monster:setCondition("sleep", 10)
if m.sleeping then
print("sleeping monster")
end
end
end
Akroma