PDA

View Full Version : [REQUEST] Equip dwarven ring when drunk



erwinb1992
01-11-2016, 12:04 PM
Hi guys,

I need help with a script. I want my character to equip a dwarven ring when drunk and after ~15 seconds take it off again. I have been botting mutated humans and the mercenary blobs sometimes make me drunk. Because of that my character hicks up a ramp and the walker gets stuck.

I have been looking on the forums for a function like this but couldnt find it. If it exists, just drop the link below :)
Many thanks in advance!

eldera
01-11-2016, 05:17 PM
It should work but haven't tested it though.


local checkDrunkStatus = 10 -- recheck if drunk every x seconds
local unequipToContainer = 1 -- unequip to x container ex. 1 SHOULD be mainbp

-- [[ DO NOT EDIT BELOW THIS LINE ]] --

lastTimeDwarvenRingEquipped = os.time()
dwarvenRingId = Item.GetID("dwarven ring")

Module.New("dwarven-ring", function()
if (Self.isDrunk() and Self.Ring().id ~= Item.GetRingActiveID(dwarvenRingId)) then
lastTimeDwarvenRingEquipped = os.time()
Self.Equip(dwarvenRingId, "ring")
elseif (os.time() - lastTimeDwarvenRingEquipped > checkDrunkStatus) then
if (Self.Ring().id == Item.GetRingActiveID(dwarvenRingId) and Self.TargetID() == 0) then
Walker.Delay(1000)
Self.Dequip("ring", unequipTo)
end
end
end)

erwinb1992
01-11-2016, 09:40 PM
You are an absolute legend. Works like a charm. Many thanks!!