Sorry, it's two part... The above goes in the monster definition, but the weapon must be defined as giving "vorpal" damage.THOM wrote:The suggestion of Isaac makes me feel silly. Don't know how to use this. If I copy this to the monster definition the result is still nothing.
Like this:
SpoilerShow
Code: Select all
defineObject{
name = "vorpal_blade",
baseObject = "ethereal_blade",
components = {
{
class = "MeleeAttack",
attackPower = 20,
accuracy = 15,
cooldown = 4,
damageType = "vorpal",
swipe = "horizontal",
},
},
} Code: Select all
defineObject{
name = "Invulnerable_crowern",
baseObject = "crowern",
components = {
{
class = "Model",
model = "assets/models/monsters/crowern01.fbx",
storeSourceData = true,
material = "ghost_crowern"
},
{
class = "Monster",
meshName = "crowern_mesh",
footstepSound = "crowern_footstep",
hitSound = "crowern_hit",
dieSound = "crowern_die",
hitEffect = "hit_blood",
capsuleHeight = 0.5,
capsuleRadius = 0.2,
collisionRadius = 0.7,
health = 120,
evasion = 10,
flying = true,
exp = 90,
traits = { "animal" },
onDamage = function(self, damage, damageType)
local result = (damageType == "vorpal")
if not result then
playSound("goromorg_shield_hit")
hudPrint("") hudPrint("") hudPrint("") hudPrint("")
hudPrint("Weapon Ineffective!")
end
return result
end,
},
}
}