• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Creatureevent

Xtr3m3

Member
Joined
May 14, 2009
Messages
131
Reaction score
11
Someone can help me?

How I check, to Primary or Secondary damage ignore Spells of Healing.

I have try this:

primaryType ~= COMBAT_HEALING or secondaryType ~= COMBAT_HEALING

But don't work.

Thank's in advance.

Kind Regards,
Xtr3m3.
 
Not really sure what you are trying to do. Can you post full script?

Code:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
   if isInArray({ORIGIN_MELEE, ORIGIN_RANGED, ORIGIN_SPELL]]}, origin) and (primaryType ~= COMBAT_HEALING or secondaryType ~= COMBAT_HEALING) then
     -- do any
   end
end

But not ignore healing spells.
 
Ok what you currently have means:
if the origin is melee/ranged/spell and primary or secondary is not healing

I keep re-reading your original post but I can't seem to understand what it is you want.

Do you want to only "do any" if it is a healing spell?
Do you want to only "do any" if neither are a healing spell?
Do you want to only "do any" if at least 1 of them is not a healing spell? < you currently have this
 
Ok what you currently have means:
if the origin is melee/ranged/spell and primary or secondary is not healing

I keep re-reading your original post but I can't seem to understand what it is you want.

Do you want to only "do any" if it is a healing spell?
Do you want to only "do any" if neither are a healing spell?
Do you want to only "do any" if at least 1 of them is not a healing spell? < you currently have this

Man, this is a creaturescripts, my problem is on the "if"
if isInArray({ORIGIN_MELEE, ORIGIN_RANGED, ORIGIN_SPELL]]}, origin)
and
(primaryType ~= COMBAT_HEALING or secondaryType ~= COMBAT_HEALING)
The rest are working.
 
How I check, to Primary or Secondary damage ignore Spells of Healing.
This is the part I don't understand in your post. I cannot help you if I don't know what it is you want to do... what does "damage ignore spells of healing" mean?
 
This is the part I don't understand in your post. I cannot help you if I don't know what it is you want to do... what does "damage ignore spells of healing" mean?
Look this:
Code:
--[[ Defense spells except healing spells ]]

local defense = 50 -- percent

function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if origin == ORIGIN_SPELL then
        if primaryType ~= COMBAT_HEALING then
            primaryDamage = primaryDamage - math.floor((primaryDamage * defense) / 100)
        end
        if secondaryDamage ~= COMBAT_HEALING then
            secondaryDamage = secondaryDamage - math.floor((secondaryDamage * defense) / 100)
        end
    end
    return primaryDamage, primaryType, secondaryDamage, secondaryType
end
 
Back
Top