Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getHand(player)
- local _ALLOWEDS = {} -- example {2723, 8329, 8921}
- local slotRight = getPlayerSlotItem(player, 5)
- local slotLeft = getPlayerSlotItem(player, 6)
- if isInArray(_ALLOWEDS, slotRight.itemid) then
- return "right"
- elseif isInArray(_ALLOWEDS, slotLeft.itemid) then
- return "left"
- end
- return nil
- end
- function getWandDmg(itemId)
- local file = io.open("data/weapons/weapons.xml", "r")
- for info in string.gmatch(file:read("*a"), "<weapons(.-)</weapons>") do
- if info:match("wand id=\"(.-)\"") == itemId then
- local min = info:match("min=(.-)")
- local max = info:match("max=(.-)")
- return math.random(min, max)
- end
- end
- file:close()
- return nil
- end
- function getWandDmgType(itemId)
- local file = io.open("data/weapons/weapons.xml", "r")
- for info in string.gmatch(file:read("*a"), "<weapons(.-)</weapons>") do
- if info:match("wand id=\"(.-)\"") == itemId then
- local type = info:match("type=(.-)")
- return tostring(type)
- end
- end
- file:close()
- return nil
- end
- function setWandExtraDmg(wand, extra)
- local value = tonumber(getWandExtraDmg(wand))
- return doSetItemAttribute(wand.uid, "extraDmg", value + extra)
- end
- function getWandExtraDmg(wand)
- if getItemAttribute(wand.uid, "extraDmg") == nil then
- doSetItemAttribute(wand.uid, "extraDmg", 0)
- end
- return getItemAttribute(wand.uid, "extraDmg")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement