zexus
Member
- Joined
- Oct 1, 2016
- Messages
- 133
- Reaction score
- 18
I'm using this scripts to exausted on SSA/Might Ring:
ssa_exhaust.lua
mightring_exhaust.lua
But somehow it brokes the defense scripts and its not even removing the charges...
Did u guys know why?
Code:
<!-- onequip_exausted_pvp -->
<movevent type="Equip" itemid="2197" slot="necklace" event="script" value="onequip_exausted_pvp/ssa_exhaust.lua"/>
<movevent type="DeEquip" itemid="2197" slot="necklace" event="script" value="onequip_exausted_pvp/ssa_exhaust.lua"/>
<movevent type="Equip" itemid="2164" slot="ring" event="script" value="onequip_exausted_pvp/mightring_exhaust.lua"/>
<movevent type="DeEquip" itemid="2164" slot="ring" event="script" value="onequip_exausted_pvp/mightring_exhaust.lua"/>
ssa_exhaust.lua
Code:
local exhaustTime = 6 -- How many seconds of exhaust between equipping
function onEquip(cid, item, slot)
if item.uid ~= 0 then
if tonumber(getItemAttribute(item.uid, "equipped")) and tonumber(getItemAttribute(item.uid, "equipped")) == 1 then
return true
end
if getCreatureStorage(cid, "ssaexhaust") < os.time() then
callFunction(cid, item.uid, slot, false)
doCreatureSetStorage(cid, "ssaexhaust", os.time() + exhaustTime)
doItemSetAttribute(item.uid, "equipped", 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may not equip an ssa for " .. getCreatureStorage(cid, "ssaexhaust") - os.time() .. " seconds.")
return false
end
end
return true
end
function onDeEquip(cid, item, slot)
callFunction(cid, item.uid, slot, false)
doItemSetAttribute(item.uid, "equipped", -1)
return true
end
mightring_exhaust.lua
Code:
local exhaustTime = 6 -- How many seconds of exhaust between equipping
function onEquip(cid, item, slot)
if item.uid ~= 0 then
if tonumber(getItemAttribute(item.uid, "equipped")) and tonumber(getItemAttribute(item.uid, "equipped")) == 1 then
return true
end
if getCreatureStorage(cid, "mightringexhaust") < os.time() then
callFunction(cid, item.uid, slot, false)
doCreatureSetStorage(cid, "mightringexhaust", os.time() + exhaustTime)
doItemSetAttribute(item.uid, "equipped", 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may not equip an might ring for " .. getCreatureStorage(cid, "mightringexhaust") - os.time() .. " seconds.")
return false
end
end
return true
end
function onDeEquip(cid, item, slot)
callFunction(cid, item.uid, slot, false)
doItemSetAttribute(item.uid, "equipped", -1)
return true
end
But somehow it brokes the defense scripts and its not even removing the charges...
Did u guys know why?