otclient
otclient copied to clipboard
Saying hi to NPC on left click
With this feature, is possible say hi on left click.

index fa9d4799..77ab43c2 100644
--- a/modules/game_interface/gameinterface.lua
+++ b/modules/game_interface/gameinterface.lua
@@ -714,6 +714,12 @@ function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, u
end
end
+ if creatureThing then
+ if creatureThing:isNpc() then
+ g_game.talk("hi")
+ return true
+ end
+ end
local player = g_game.getLocalPlayer()
player:stopAutoWalk()
Why not open a PR with proposed patch then? :)
In Tibia, the character will say "hi" only when it's in NPC talk radius (3 sqm). I suggest to include that check in your code.
@marmichalski Have other question, this is enable/disable in Options checkbox "Classic control"?. You are correct about talk radius, going check this.
If you are asking if this should be tied with Classic control checkbox functionality, then I'd say say, as this is how it is implemented in Tibia, something they call smart click. There is also Talk option available in context menu, which will also make the character say hi. When you select it from too far (> 3 sqm), there will be cancel message displayed in the game window saying You are too far away.


#1150