mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 20:43:26 +02:00
More fixes and edits!
* Fixed a bug with client_exit module button appearing on full reload. * Fixed the battle window to work properly now (left click: attack, right click: menu). * Added auto walk checker for more accurate aut walking: - It will always find the path now, except in rare occasions gets stuck running back and forward - Re-calculates path every 10 steps and also when you hit an object that cancels your step. - Right now this is just a temporary method. - Cancels the checker when you move or press escape (has to be done client-side). * Added a new setting to UIComboBox class 'mouse-scroll' to enable/disable mouse wheel scrolling. * Added support for no ping in cooldowns. * Added missing PlayerStates (hungry and bleeding).
This commit is contained in:
@@ -16,7 +16,9 @@ PlayerStates = {
|
||||
Cursed = 2048,
|
||||
PartyBuff = 4096,
|
||||
PzBlock = 8192,
|
||||
Pz = 16384
|
||||
Pz = 16384,
|
||||
Bleeding = 32768,
|
||||
Hungry = 65536
|
||||
}
|
||||
|
||||
InventorySlotOther = 0
|
||||
@@ -96,3 +98,47 @@ function Player:dismount()
|
||||
g_game.mount(false)
|
||||
end
|
||||
end
|
||||
|
||||
function Player:getLastDestination()
|
||||
return self.lastDestination
|
||||
end
|
||||
|
||||
function Player:setLastDestination(destination)
|
||||
self.lastDestination = destination
|
||||
end
|
||||
|
||||
function Player:getWalkSteps(destination)
|
||||
if not self.walkSteps or not destination then
|
||||
return nil
|
||||
end
|
||||
return self.walkSteps[destination]
|
||||
end
|
||||
|
||||
function Player:setWalkStep(destination)
|
||||
if not self.walkSteps then
|
||||
self.walkSteps = {}
|
||||
end
|
||||
if destination then
|
||||
if not self.walkSteps[destination] then
|
||||
self.walkSteps[destination] = {}
|
||||
end
|
||||
table.insert(self.walkSteps[destination], true)
|
||||
end
|
||||
end
|
||||
|
||||
function Player:clearWalkSteps()
|
||||
self.walkSteps = {}
|
||||
end
|
||||
|
||||
function Player:autoWalk(destination)
|
||||
self:clearWalkSteps()
|
||||
self:setLastDestination(destination)
|
||||
local dirs = g_map.findPath(self:getPosition(), destination, 127, PathFindFlags.AllowNullTiles)
|
||||
|
||||
if #dirs == 0 then
|
||||
modules.game_textmessage.displayStatusMessage(tr('There is no way.'))
|
||||
return false
|
||||
end
|
||||
g_game.autoWalk(dirs)
|
||||
return true
|
||||
end
|
Reference in New Issue
Block a user