mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-20 06:33:26 +02:00
Version 2.6 - http://otclient.net/showthread.php?tid=552
This commit is contained in:
@@ -70,6 +70,11 @@ context.onTextMessage = function(callback)
|
||||
return context.callback("onTextMessage", callback)
|
||||
end
|
||||
|
||||
-- onLoginAdvice(callback) -- callback = function(message)
|
||||
context.onLoginAdvice = function(callback)
|
||||
return context.callback("onLoginAdvice", callback)
|
||||
end
|
||||
|
||||
-- onAddThing(callback) -- callback = function(tile, thing)
|
||||
context.onAddThing = function(callback)
|
||||
return context.callback("onAddThing", callback)
|
||||
@@ -165,6 +170,10 @@ context.onTurn = function(callback)
|
||||
return context.callback("onTurn", callback)
|
||||
end
|
||||
|
||||
-- onWalk -- callback = function(creature, oldPos, newPos)
|
||||
context.onWalk = function(callback)
|
||||
return context.callback("onWalk", callback)
|
||||
end
|
||||
|
||||
-- CUSTOM CALLBACKS
|
||||
|
||||
|
@@ -238,4 +238,19 @@ context.canShoot = function(pos, distance)
|
||||
return tile:canShoot(distance)
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
context.isTrapped = function(creature)
|
||||
if not creature then
|
||||
creature = context.player
|
||||
end
|
||||
local pos = creature:getPosition()
|
||||
local dirs = {{-1,1}, {0,1}, {1,1}, {-1, 0}, {1, 0}, {-1, -1}, {0, -1}, {1, -1}}
|
||||
for i=1,#dirs do
|
||||
local tile = g_map.getTile({x=pos.x-dirs[i][1],y=pos.y-dirs[i][2],z=pos.z})
|
||||
if tile and tile:isWalkable(false) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
@@ -159,6 +159,7 @@ context.cancelFollow = g_game.cancelFollow
|
||||
context.cancelAttackAndFollow = g_game.cancelAttackAndFollow
|
||||
|
||||
context.logout = g_game.forceLogout
|
||||
context.safeLogout = g_game.safeLogout
|
||||
context.ping = g_game.getPing
|
||||
|
||||
modules.game_cooldown.isGroupCooldownIconActive(id)
|
||||
|
Reference in New Issue
Block a user