feat: Overhauls AI (Speech/Movement) (#2232)
### Summary * Refactors AI so it is easier to read and maintain * Fixes NPC speed issues * Fixes pet sector AI issue that was causing stuttering * Fixes direction snapping for Melee/Mage AI * Refactors pet orders * Refactors speech commands * Removes scale speed by dex for HS+ (it was a stupid feature anyways)
This commit is contained in:
parent
f89150735e
commit
aab731ed96
26 changed files with 3688 additions and 3429 deletions
35
Projects/UOContent/Mobiles/AI/BaseAI/SpeechEventArgsExt.cs
Normal file
35
Projects/UOContent/Mobiles/AI/BaseAI/SpeechEventArgsExt.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright 2019-2025 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: SpeechEventArgsExt.cs *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Server;
|
||||
|
||||
public static class SpeechEventArgsExt
|
||||
{
|
||||
public static int GetFirstKeyword(this SpeechEventArgs e, params ReadOnlySpan<int> keywords)
|
||||
{
|
||||
for (var i = 0; i < keywords.Length; i++)
|
||||
{
|
||||
var keyword = keywords[i];
|
||||
if (e.HasKeyword(keyword))
|
||||
{
|
||||
return keyword;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue