liqeen
Active Member
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%.
<attribute key="increasemagicpercent" value=""/>
How do I add it via source?Add this in items.xml, If it doesn't work so you'll need to add it via source.
XML:<attribute key="increasemagicpercent" value=""/>
what source u use ?How do I add it via source?
I am using this onewhat source u use ?
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
<event type="healthchange" name="demonArmorHelath" script="demonArmorDMG.lua"/>
<event type="manachange" name="demonArmorMana" script="demonArmorDMG.lua"/>
<script>
<event name="demonArmorHelath" />
<event name="demonArmorMana" />
</script>