local ec = EventCallback
function ec.onSpawn(monster, position, startup, artificial)
if monster:getSkull() == SKULL_RED then
monster:registerEvent("redSkullHp")
monster:registerEvent("redSkullMana")
end
local monsterMaxHp = monster:getMaxHealth()
if monster:getSkull() == SKULL_WHITE then
monster:setMaxHealth(monsterMaxHp * 1.1)
monster:setHealth(monsterMaxHp * 1.1)
end
return true
end
ec:register(-555)
local redSkullHp = CreatureEvent("redSkullHp")
function redSkullHp.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if attacker and attacker:isMonster() then
if attacker:getSkull() == SKULL_RED then
primaryDamage = primaryDamage * 1.1
end
end
return primaryDamage, primaryType, secondaryDamage, secondaryType, origin
end
redSkullHp:register()
local redSkullMana = CreatureEvent("redSkullMana")
function redSkullMana.onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if attacker and attacker:isMonster() then
if attacker:getSkull() == SKULL_RED then
primaryDamage = primaryDamage * 1.1
end
end
return primaryDamage, primaryType, secondaryDamage, secondaryType, origin
end
redSkullMana:register()
local creatureEvent = CreatureEvent("monsterRS")
function creatureEvent.onLogin(player)
player:registerEvent("redSkullHp")
player:registerEvent("redSkullMana")
return true
end
creatureEvent:register()