Aeronx
Intermediate OT User
- Joined
- Dec 17, 2015
- Messages
- 746
- Solutions
- 9
- Reaction score
- 125
First of all, Hello! and thanks for your time.
As the tittle says, im trying to get the defense from the item on the right hand, normally a shield.
I've tried something like this.
i get plenty of errors.. been trying many enums, searched everywhere for an answer, but i couldnt solve it.
The base of this spell is that i want to make the damage based on players current armor or defense (from weapon and shield).
Thanks for your time!
As the tittle says, im trying to get the defense from the item on the right hand, normally a shield.
I've tried something like this.
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
combat:setParameter(COMBAT_PARAM_USECHARGES, 1)
function onGetFormulaValues(player, itemType, skill, defense, factor)
local def = itemType:getSlotPosition(SLOTP_RIGHT):getDefense()
return -def, -def
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, var)
return combat:execute(creature, var)
end
The base of this spell is that i want to make the damage based on players current armor or defense (from weapon and shield).
Thanks for your time!