• 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!

TFS 1.X+ fix onmanachange

T

Tibia Demon

Guest
i use this script here
it only work if player is in hp. how can i make it work if player using utamo too.
 
Solution
Just add this :p
Lua:
function onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)     
    
    if attacker and attacker:isPlayer() then   
        local base = attacker:getVocation():getId()
    
        if primaryType == COMBAT_HEALING then       
            primaryDamage = primaryDamage * pvpvocs[base].healing   
        elseif creature:isPlayer() then           
            local form = pvpvocs[base].pvp
            if origin == ORIGIN_SPELL then
                primaryDamage = primaryDamage * form.spells
            elseif origin == ORIGIN_MELEE or origin == ORIGIN_CONDITION or origin == ORIGIN_RANGED or origin == ORIGIN_WAND then
                primaryDamage = primaryDamage * form.weapon...
Just add this :p
Lua:
function onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)     
    
    if attacker and attacker:isPlayer() then   
        local base = attacker:getVocation():getId()
    
        if primaryType == COMBAT_HEALING then       
            primaryDamage = primaryDamage * pvpvocs[base].healing   
        elseif creature:isPlayer() then           
            local form = pvpvocs[base].pvp
            if origin == ORIGIN_SPELL then
                primaryDamage = primaryDamage * form.spells
            elseif origin == ORIGIN_MELEE or origin == ORIGIN_CONDITION or origin == ORIGIN_RANGED or origin == ORIGIN_WAND then
                primaryDamage = primaryDamage * form.weapon           
            end       
        elseif creature:isMonster() then
            local form = pvpvocs[base].pve
            if origin == ORIGIN_SPELL then
                primaryDamage = primaryDamage * form.spells
            elseif origin == ORIGIN_MELEE or origin == ORIGIN_CONDITION or origin == ORIGIN_RANGED or origin == ORIGIN_WAND then
                primaryDamage = primaryDamage * form.weapon   
            end               
        end
    elseif creature and creature:isPlayer() then
        local base = creature:getVocation():getId()
    
        if primaryType == COMBAT_HEALING then       
            primaryDamage = primaryDamage * pvpvocs[base].healing
        elseif attacker and attacker:isPlayer() then               
            local form = pvpvocs[base].pvp
            if origin == ORIGIN_SPELL then
                primaryDamage = primaryDamage * form.spells
            elseif origin == ORIGIN_CONDITION then
                primaryDamage = primaryDamage * form.defense
            elseif origin == ORIGIN_MELEE or origin == ORIGIN_CONDITION or origin == ORIGIN_RANGED or origin == ORIGIN_WAND then
                primaryDamage = primaryDamage * form.weapon           
            end               
        elseif attacker and attacker:isMonster() then
            local form = pvpvocs[base].pve
            if origin == ORIGIN_SPELL then
                primaryDamage = primaryDamage * form.spells
            elseif origin == ORIGIN_MELEE or origin == ORIGIN_CONDITION or origin == ORIGIN_RANGED or origin == ORIGIN_WAND then
                primaryDamage = primaryDamage * form.weapon           
            end                       
        end   
    end
    
return primaryDamage, primaryType, secondaryDamage, secondaryType, origin   
end
 
Solution
Back
Top