OK, so I believe this will suffice for a weapon that:
-will give a bonus to a (Stat) and or add a (Trait)... IF
-the weapon is being held in hand (slot 7 or 8) AND the champion holding the weapon is of (Race)
This is the weapon definition for items.lua-
cloneObject{
name = "drakkan_minotaur_mace",
baseObject = "knoffer",
uiName = "Drakkan Minotaur Mace",
skill = "maces",
requiredLevel = 0,
attackPower = 30,
weight = 2.2,
onEquipItem = function(champion, slot)
return specialWeaponScripts.drakkanMaceEquip(champion, slot)
end,
onUnequipItem = function(champion, slot)
return specialWeaponScripts.drakkanMaceUnequip(champion, slot)
end,
description = "A mace forged by the greatly feared drakkan minotaurs of old.",
}
And this is for a script entity in dungeon called "specialWeaponScripts" -
-------------Drakkan Minotaur Mace-------------------------
function drakkanMaceEquip(champion, slot)
if champion:getRace() == "Minotaur" then
if slot == 7 or slot == 8 then
champion:modifyStatCapacity("strength", 5)
champion:modifyStat("strength", 5)
champion:addTrait("aggressive", false)
hudPrint("The mace feels invigorating for you to hold")
end
end
end
function drakkanMaceUnequip(champion, slot)
if champion:getRace() == "Minotaur" then
if slot == 7 or slot == 8 then
champion:modifyStatCapacity("strength", -5)
champion:modifyStat("strength", -5)
champion:removeTrait("aggressive", false)
hudPrint("You put the mace away...")
end
end
end
Drakkan, I may well create a special weapon scripts thread soon with these kinds of things included,
you don't mind if I include this 'if race > buff' type weapon script??
Let me know if you have any dramas...
EDIT - I have created the weapons script thread....
viewtopic.php?f=14&t=4088