Hello i made this script for custom passive spell that make player who have it to add shootrange to bow:
and function when you put down a bow (then it's range gonna change back to original)
It does change shoot range of weapon, i have other script that shows on console range of weapon and it changes, but when im trying to shoot some monster it have original shootrange, not that modyfied by script ;/. Can someone tell me why ? Example : bow have range 3 originally, I'm equipping it and it would have range 6. But it still shoots with range 3.
Bow range when not equipped (original, look chat window)
Bow range when equipped and script worked (look chat window):
The problem is that bow still shoot with range 3 not 6 ...
Lua:
function onEquip(cid, item, slot, uid)
local skill_level = getPlayerStorageValue(cid, 9000)
local original_item_range = getItemInfo(item.itemid).shootRange
setPlayerStorageValue(cid,9001,original_item_range)
if item.itemid == 2456 then
if skill_level == 1 then
doItemSetAttribute(item.uid, item.shootRange, 4)
elseif skill_level == 2 then
doItemSetAttribute(item.uid, item.shootRange, 5)
elseif skill_level == 3 then
doItemSetAttribute(item.uid, item.shootRange, 6)
elseif skill_level == 4 then
doItemSetAttribute(item.uid, item.shootRange, 7)
end
end
return true
end
and function when you put down a bow (then it's range gonna change back to original)
Lua:
function onDeEquip(cid, item, slot)
local original_item_range = getPlayerStorageValue(cid, 9001)
if item.itemid == 2456 then
doItemSetAttribute(item.uid, item.shootRange, original_item_range)
end
return true
end
It does change shoot range of weapon, i have other script that shows on console range of weapon and it changes, but when im trying to shoot some monster it have original shootrange, not that modyfied by script ;/. Can someone tell me why ? Example : bow have range 3 originally, I'm equipping it and it would have range 6. But it still shoots with range 3.
Bow range when not equipped (original, look chat window)
Bow range when equipped and script worked (look chat window):
The problem is that bow still shoot with range 3 not 6 ...
Last edited: