Re: Few questions
Posted: Wed Dec 26, 2012 11:20 am
To workaround the shield protection issue you could implement custom onEquipItem and onUnequipItem hooks for the shield.
i've been trying to get it to work but unfortunatly my scripting experience is limited. Upon equiping the shield, my editor just crashes. Could you please take a look at my script and see what could be causing this?petri wrote:To workaround the shield protection issue you could implement custom onEquipItem and onUnequipItem hooks for the shield.
Code: Select all
cloneObject{
name = "tower_shield",
baseObject = "legionary_shield",
uiName = "Scutum",
evasion = 2,
protection = 2,
onEquipItem = function(champion,slot)
champion:modifyStat(protection,2)
end,
onUnequipItem = function(champion,slot)
champion:modifyStat(protection,-2)
end
}
Code: Select all
cloneObject{
name = "tower_shield",
baseObject = "legionary_shield",
uiName = "Scutum",
evasion = 2,
protection = 2,
onEquipItem = function(champion,slot)
if slot == 7 then
champion:modifyStatCapacity("protection", 2)
champion:modifyStat("protection", 2)
elseif slot == 8 then
champion:modifyStatCapacity("protection", 2)
champion:modifyStat("protection", 2)
else
--do nothing
end
end,
onUnequipItem = function(champion,slot)
if slot == 7 then
champion:modifyStatCapacity("protection", -2)
champion:modifyStat("protection", -2)
elseif slot == 8 then
champion:modifyStatCapacity("protection", -2)
champion:modifyStat("protection", -2)
else
--do nothing
end
end,
}