Emera Nova wrote:
So does that mean It's not possible to damage the monster like the party?
There is no direct equivalent to the Champion:damage() method, however you can imitate it pretty much perfectly with MonsterComponent:setHealth(), MonsterComponent:getResistance(), MonsterComponent:showDamageText(), and MonsterComponent:die().
GoldenShadowGS wrote:function damagemummy()
local m = findEntity("mummy_2")
if m ~= nil then
damageTile(m.level, m.x, m.y, 0, m.elevation, 1, "shock", 5)
end
end
This has several problems:
1. it will damage all monsters and HealthComponents in the square (you need to use a TileDamagerComponent with an onHitMonster, onHitObstacle, etc. hook that will check the monster id and only damage the right one)
2. it won't do the right amount of damage because damageTile and TileDamagerComponent use an attack power roll, randomizing the amount of damage, whereas Champion:damage() does the exact amount of damage you specify