It's not all too hard to do! Put this into your luna.lua file:
Code: Select all
local multiHitNPCs = {
[1] = 2,
[2] = 3,
}
function onNPCHarm(eventObj,npc,reason,culprit)
if not multiHitNPCs[npc.id] or (reason == HARM_TYPE_LAVA or reason == HARM_TYPE_OFFSCREEN) then return end
local data = npc.data
if npc:mem(0x156,FIELD_WORD) > 0 then
eventObj.cancelled = true
return
end
data.health = (data.health or multiHitNPCs[npc.id]) - 1
if data.health > 0 then
npc:mem(0x156,FIELD_WORD,20) -- Invincibility time
eventObj.cancelled = true
end
end
... and replace that list in "multiHitNPCs". For example, if you wanted red goombas (ID 2) to take 3 hits and green koopas (ID 4) to take 2 hits, you'd do:
Code: Select all
local multiHitNPCs = {
[2] = 3,
[4] = 2,
}