Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saying hi to NPC on left click #1149

Open
alfuveam opened this issue Apr 24, 2021 · 4 comments
Open

Saying hi to NPC on left click #1149

alfuveam opened this issue Apr 24, 2021 · 4 comments

Comments

@alfuveam
Copy link

With this feature, is possible say hi on left click.

alt text

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()
@marmichalski
Copy link
Contributor

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.

@alfuveam
Copy link
Author

alfuveam commented May 3, 2021

@marmichalski Have other question, this is enable/disable in Options checkbox "Classic control"?.
You are correct about talk radius, going check this.

@marmichalski
Copy link
Contributor

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.

Screenshot 2021-05-03 at 19 05 09Screenshot 2021-05-03 at 19 07 37

@alfuveam
Copy link
Author

#1150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants