Code: Select all
defineObject{
name = "party",
baseObject = "party",
components = {
{
class = "Party",
onRest = function(self)
-- if there are monsters in the 80 tiles surrounding the party then
for i = 1 , 4 do
local name = party.party:getChampion(i):getName()
if party.party:getChampion(i):isAlive() == true then
playSound("polymorph_bear")
hudPrint(name .. " says: 'We can't rest here. There are monsters in the surroundings.'")
break
end
end
return false
-- end
end,
},
},
}
Thank you for your help.