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

Damage increase item

liqeen

Active Member
Joined
Nov 26, 2014
Messages
149
Solutions
1
Reaction score
28
Location
Poland
Is it possible to make a damage increase item in lua or there is no such a function to make that and has to be done in c++? For example a ring with 5% damage increase, increases all spells damage by 5%.
 
Add this in items.xml, If it doesn't work so you'll need to add it via source.

XML:
<attribute key="increasemagicpercent" value=""/>
 
If you want clear lua you need register this script on all monsters and on player

This script show how demon armor work on my ot

Code:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)

        if getPlayerSlotItem(attacker, CONST_SLOT_ARMOR).itemid == 2494 then            if primaryType ~= COMBAT_HEALING  then

                return primaryDamage * 1.08 , primaryType, secondaryDamage, secondaryType

            end

        end

--    end

   return primaryDamage , primaryType, secondaryDamage , secondaryType

end

function onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)

        if getPlayerSlotItem(attacker, CONST_SLOT_ARMOR).itemid == 2494 then

            return primaryDamage * 1.08 , primaryType, secondaryDamage, secondaryType

        end

   return primaryDamage , primaryType, secondaryDamage , secondaryType

end

Add to creature scripts

Code:
<event type="healthchange" name="demonArmorHelath" script="demonArmorDMG.lua"/>

    <event type="manachange" name="demonArmorMana" script="demonArmorDMG.lua"/>

Add to every monsters

Code:
<script>
       <event name="demonArmorHelath" />
        <event name="demonArmorMana" />
        </script>
 
Back
Top