From e5ec8271619789ca32fc1cbcd8a51865f2b84b47 Mon Sep 17 00:00:00 2001 From: Silv3r Date: Sat, 7 Apr 2018 22:36:29 +0200 Subject: [PATCH] Once we talk to a NPC, they can no longer aggro us --- PROBot/BotClient.cs | 2 +- PROProtocol/GameClient.cs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/PROBot/BotClient.cs b/PROBot/BotClient.cs index 89d79c0..6041487 100644 --- a/PROBot/BotClient.cs +++ b/PROBot/BotClient.cs @@ -311,7 +311,7 @@ public bool TalkToNpc(Npc target) bool canInteract = Game.Map.CanInteract(Game.PlayerX, Game.PlayerY, target.PositionX, target.PositionY); if (canInteract) { - Game.TalkToNpc(target.Id); + Game.TalkToNpc(target); return true; } else diff --git a/PROProtocol/GameClient.cs b/PROProtocol/GameClient.cs index bbbdd2f..4b0eb35 100644 --- a/PROProtocol/GameClient.cs +++ b/PROProtocol/GameClient.cs @@ -325,7 +325,7 @@ private void UpdateNpcBattle() _npcBattleTimeout.Update(); if (_npcBattleTimeout.IsActive) return; - TalkToNpc(_npcBattler.Id); + TalkToNpc(_npcBattler); _npcBattler = null; } @@ -893,9 +893,11 @@ public void ChangePokemon(int number) UseAttack(number + 5); } - public void TalkToNpc(int id) + public void TalkToNpc(Npc npc) { - SendTalkToNpc(id); + npc.CanBattle = false; + + SendTalkToNpc(npc.Id); _dialogTimeout.Set(); }