240 Commits

Author SHA1 Message Date
catapultam-habeo
ff86cc3b8a
[Crash] Fix zone crash caused by NPC::MoveTo (#4639) 2025-02-03 17:29:39 -06:00
Alex King
d94493468c
[Bug Fix] Fix Mob::CalculateDistance(mob) Typo (#4183)
# Notes
- Was using `GetX()` for all parts of the calculation, meaning it would produce incorrect values.
- Part of [this](https://github.com/EQEmu/Server/pull/3455/files#diff-94a8e3b04f001e4f74ce2da8404cbce7653146d963a3b93be6536505035ce96dR602-R607).
2024-03-09 22:20:02 -05:00
Alex King
2e0ed82986
[Grids] Convert Grid/Grid Entries to Repositories (#4011)
* [Grids] Convert Grid/Grid Entries to Repositories

- Convert `AddWaypoint()`, `AddWaypointForSpawn()`, `DeleteWaypoint()`, `GetHighestWaypoint()`, `GetRandomWaypointFromGrid()`, `GridExistsInZone()`, and `ModifyGrid()` to repositories.

* Update grid.cpp

* Update questmgr.cpp

* Update waypoints.cpp

* Update waypoints.cpp
2024-01-28 23:37:34 -06:00
Alex King
47968774d9
[Cleanup] Remove unused Grid methods (#3944)
# Notes
- Remove `AssignGrid()`, `GetGridType()`, `GetGridType2()`, and `GetWaypoints()` as they are unused.
2024-01-12 23:41:06 -06:00
Chris Miles
4fa9e1d66f
[Code Cleanup] Race constants refactor (#3782)
* [Code Cleanup] Race constants refactor

* Update races.h
2023-12-22 21:34:55 -06:00
Paul Coene
9a6403b196
[Commands] Fix formatting of #wpinfo output. (#3728) 2023-12-01 15:28:24 -05:00
JJ
79918ebaba
[Logs] Change pathing log messages from Error to Pathing. (#3604)
Change pathing log messages from `Error` to `Pathing`.
2023-09-29 11:54:52 -04:00
Chris Miles
f9dc9da42b
[Pathing] Improvements to roambox logic, pathing (#3502)
* [Roambox] Improvements to roambox logic

* Update npc.cpp

* Update npc.cpp

* More pathing fixes
2023-07-18 02:52:04 -05:00
Alex King
728ce0c519
[Quest API] Add GetCloseMobList() and CalculateDistance() overload to Perl/Lua (#3455)
* [Quest API] Add GetCloseMobList() and CalculateDistance() overload to Perl/Lua

# Perl
- Add `$entity_list->GetCloseMobList(mob)`.
- Add `$entity_list->GetCloseMobList(mob, distance)`.
- Add `$mob->CalculateDistance(mob)`.
- Add `$mob->GetCloseMobList()`.
- Add `$mob->GetCloseMobList(distance)`.

# Lua
- Add `eq.get_entity_list():GetCloseMobList(mob)`.
- Add `eq.get_entity_list():GetCloseMobList(mob, distance)`.
- Add `mob:CalculateDistance(mob)`.
- Add `mob:GetCloseMobList()`.
- Add `mob:GetCloseMobList(distance)`.

* Ignore Self

* Update lua_entity_list.cpp

* Cleanup
2023-07-02 10:55:27 -04:00
Aeadoin
7f7ba2e6c2
[Cleanup] Remove unused Includes under zone files (#3162) 2023-04-01 22:55:28 -04:00
Alex King
2a6cf8c8e7
[Strings] Add more number formatters (#2873)
* [Strings] Add more number formatters

# Notes
- Adds `Strings::ToUnsignedInt` for `uint32` support.
- Adds `Strings::ToBigInt` for `int64` support.
- Adds `Strings::ToUnsignedBigInt` for `uint64` support.
- Adds `Strings::ToFloat` for `float` support.
- Replaces all `std::stoi` references with `Strings::ToInt`.
- Replaces all `atoi` references with `Strings::ToInt`.
- Replaces all `std::stoul` references with `Strings::ToUnsignedInt`.
- Replaces all `atoul` references with `Strings::ToUnsignedInt`.
- Replaces all `std::stoll` references with `Strings::ToBigInt`.
- Replaces all `atoll` references with `Strings::ToBigInt`.
- Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `atoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `std::stof` references with `Strings::ToFloat`.

* [Strings] Add more number formatters

- Adds `Strings::ToUnsignedInt` for `uint32` support.
- Adds `Strings::ToBigInt` for `int64` support.
- Adds `Strings::ToUnsignedBigInt` for `uint64` support.
- Adds `Strings::ToFloat` for `float` support.
- Replaces all `std::stoi` references with `Strings::ToInt`.
- Replaces all `atoi` references with `Strings::ToInt`.
- Replaces all `std::stoul` references with `Strings::ToUnsignedInt`.
- Replaces all `atoul` references with `Strings::ToUnsignedInt`.
- Replaces all `std::stoll` references with `Strings::ToBigInt`.
- Replaces all `atoll` references with `Strings::ToBigInt`.
- Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `atoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `std::stof` references with `Strings::ToFloat`.

* Rebase cleanup

* Changes/benchmarks/tests

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
2023-03-04 17:01:19 -06:00
Chris Miles
e103422ca5
[Pathing] More z-clip improvements, Wurm and Spectral Iksar race adjustments (#2988) 2023-02-24 20:27:28 -06:00
Chris Miles
889e57a5af
[Pathing] Improve roambox logic (#2983)
* [Pathing] Improve roambox logic

* Cleanup roambox logic
2023-02-24 14:07:34 -06:00
Chris Miles
1e50f19f7e
[Pathing] Improvements to z-clipping, z-recovery and z-calculations (#2975)
* zclip adjustments

* Remove debug
2023-02-21 10:24:25 -06:00
Alex King
57d0420399
[Quest API] (Performance) Check event EVENT_WAYPOINT_ARRIVE or EVENT_WAYPOINT_DEPART exist before export and execute (#2905)
* [Quest API] Optionally parse EVENT_WAYPOINT_ARRIVE and EVENT_WAYPOINT_DEPART

# Notes
- Optionally parse these events instead of always doing so.

* [Quest API] Optionally parse EVENT_WARP

# Notes
- Optionally parse this event instead of always doing so.

* Revert "[Quest API] Optionally parse EVENT_WARP"

This reverts commit d8acb9883d5547ab473391d2e8639f923a486cef.
2023-02-12 22:27:15 -06:00
Chris Miles
404f7cada8
[Pathing] Improvements to handling tight corridors pathing, clipping detection and recovery (#2826) 2023-02-06 17:24:03 -06:00
Alex King
3335cacac1
[Bots] Cleanup and remove preprocessors. (#2757)
* [Bots] Cleanup and remove preprocessors.

- Removes every `#ifdef BOTS` we have and locks bots behind `Bots:AllowBots` rule.
- Bot updates are now done by default similar to regular database updates.
- Modify `CMakeLists.txt`, `.drone.yml`, and `BUILD.md` to match the removal of `EQEMU_ENABLE_BOTS`.

* Cleanup

- Add SQL for enabling bots for servers with bots.
- Add message that tells players/operators bots are disabled.

* Suggested changes.

* Bot injection stuff

* Change SQL to bot SQL.

* Tweaks

* Remove `is_bot`

* Update version.h

* Update main.cpp

* Update database.cpp

* Fix name availability crash

* Remove bots from update script

Co-authored-by: Akkadius <akkadius1@gmail.com>
2023-01-20 12:35:33 -06:00
Chris Miles
d3e756287e
[Logging] Remove function prefixes (#2766) 2023-01-19 22:24:50 -06:00
Chris Miles
40d1c33351
[Logging] Logging Improvements (#2755)
* Console logging improvements

* stderr handling

* Add origination information

* Formatting

* Update zoneserver.cpp

* Update eqemu_logsys.cpp

* Remove semicolon from MySQLQuery log output

* Remove IsRfc5424LogCategory

* Remove no longer used functions

* Remove definition BUILD_LOGGING

* Deprecate categories UCSServer & WorldServer

* Deprecate UCS / World Server / Zone Server categories

* Deprecate Status, QSServer, Normal

* Update login_server.cpp

* Deprecate Emergency, Alert, Critical, Notice

* Deprecate Alert

* Fix terminal color resetting

* Deprecate headless client

* Move LogAIModerate to Detail

* Deprecate moderate logging level for detail

* Update logs.cpp

* Logs list simplify

* Update logs.cpp

* Add discord to log command

* Remove unused headers

* Windows fix

* Error in world when zones fail to load

* Show warning color properly

* Keep loginserver thread log from colliding with other logs during startup

* Deprecate Loginserver category
2023-01-17 21:18:40 -06:00
Aeadoin
c8218574cc
[Logging] More AI Logging Cleanup (#2616)
* [Logging] Additional AI Cleanup

* More cleanup/formatting fixes

* Typo
2022-12-10 17:36:40 -06:00
Aeadoin
318e487515
[Logging] Cleanup AI Logging Events (#2615) 2022-12-04 14:22:53 -05:00
Chris Miles
5502ab8765
[Pathing] Fix pathing z-correctness for certain models (#2430)
* [Pathing] Fix pathing z-correctness for certain models

* Update npc.cpp

* Update npc.cpp

* Update npc.cpp
2022-09-11 13:05:20 -04:00
Chris Miles
dfd8f84cac
[Strings] Refactor Strings Usage (#2305)
* Initial commit checkpoint

* More functions converted

* Commify

* More functions

* Fin

* Sort declarations

* Split functions between files

* Bots

* Update strings.h

* Split

* Revert find replaces

* Repository template

* Money

* Misc function

* Update CMakeLists.txt

* Saylink

* Update strings.cpp

* Swap Strings::Saylink for Saylink::Create since saylink is coupled to zone database

* API casings
2022-07-14 02:10:52 -05:00
Paul Coene
3936b2b882
[Fix] Boats should never get FixZ'd (#2246)
* Boats should never get FixZ'd

* Use member variable to avoid repetitive checks

* Resolve comments from review

* Fix return type
2022-07-02 13:49:45 -05:00
Michael
e75f87a535
[Quest API] Expand SaveGuardSpot (#2258)
* Expand SaveGuardSpot

- Adds
-- mob:saveguardspot()
-- mob:saveguardspot(true)

* Perl Support
Thanks to KinglyKrab for the perl implementation.
2022-06-10 13:52:22 -04:00
Kinglykrab
fc484d0b1c
[Commands] Cleanup #gassign Command. (#2101)
* [Commands] Cleanup #gassign Command.
- Cleanup messages and logic.

* Update gassign.cpp

* Update gassign.cpp
2022-05-06 19:13:28 -04:00
Chris Miles
5b4aeaa457
[Code Cleanup] Remove this-> in code where its implied (#2088) 2022-05-01 10:22:09 -04:00
Kinglykrab
791d8b329d
[Quest API] Export killed XYZH to EVENT_DEATH_ZONE in Perl. (#2050)
- Export $killed_x, $killed_y, $killed_z, and $killed_h to EVENT_DEATH_ZONE in Perl.
- Cleanup export strings and unnecessary .c_str() calls on event exports.
2022-03-12 13:44:01 -05:00
Paul Coene
7749c626f0
[Bug Fix] Fix issue with mobs summoning PCs into ceilings (#1921) 2022-01-29 19:55:40 -06:00
Kinglykrab
8ec4afe721
[Commands] Cleanup #wpinfo Command. (#1866)
- Cleanup message and logic.
- Only display grid/waypoints if NPC has a grid.
2021-12-04 21:53:29 -05:00
Michael Cook (mackal)
d36d11653a
Fix issue with new summmon method putting players OOB (#1649)
The FindClosestZ was finding the Z above them ... lets try just not
doing that for now :)
2021-10-27 23:42:31 -04:00
Kinglykrab
edf298685e
[Quest API] Convert all char arrays to strings. (#1612)
* [Quest API] Convert all char arrays to strings.
Also change multiple loops for zone controller to one loop.

* Remove 'this' keyword'
2021-10-20 15:59:28 -04:00
Michael Cook (mackal)
80493719f2
[Summoning] Make Summon a bit more live like (#1539)
Pretty sure the distance should probably be melee range / 2 but ahh
yeah. Can't do that. Hopefully 5 units isn't too far.
2021-09-19 15:19:29 -05:00
Alex
3886636ec7
[Commands] Modify #grid and #wp. (#1399)
- #grid add will no longer let you put in a duplicate grid.
- Grid nodes now spawn with invul/immune to damage.
- Grid nodes now set an entity variable "grid_id" on spawn.
- This allows grid nodes to be specifically despawned by "grid_id" entity variable, meaning you can view multiple grids at once and not despawn them all accidentally.
- #grid hide will despawn your targeted NPC's Grid nodes.
- #grid add, #grid show, #grid delete, and #grid hide send messages to let GM know what's going on.
- #wp add and #wp delete now send messages to let the GM know what's going on.
- #wpadd now send messages to let the GM know what's going on.
2021-06-13 21:41:38 -05:00
Paul Coene
39f5949441
#grid delete was deleting the grids everywhere (#1346)
Fix to only delete correct zone grid.
2021-05-09 16:39:54 -04:00
regneq
58e0ce6a4b fixed the references from previous commits. 2021-01-31 16:53:25 -08:00
regneq
e4b437cb5f RandomPath grid type improvement
RandomPath has been changed to the following behavior:

* When stopped at a waypoint, it will now use the waypoint's pause timer if it is non-zero.  If it is zero, it will use the first waypoint's pause timer if that is non-zero.  If both are zero it will use 38 seconds.  Previously it would always use the first waypoint's pause timer if it was non-zero.  This new way is what it should have been from the start, really.

* If any waypoint is flagged as a centerpoint, then the NPCs will always return to that first randomly selected centerpoint waypoint after moving.  I.e. every other move will be to the first waypoint if the bool is set.

If any waypoint has a negative number (-1, -10, etc) in the pause timer. It will not be included in the waypoints to be random.  Instead the npc will just path through it everytime.  This is useful for a path to only select a small area to pause at before returning to it's centerpoints or another random waypoints in between it.
2021-01-31 15:11:45 -08:00
Akkadius
3f62da4573 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-05-23 22:33:34 -05:00
KimLS
2fbd5aaccc Rename namespace EQEmu to namespace EQ (so we don't have two similar but different namespaces anymore) 2020-05-17 18:36:06 -07:00
Akkadius
79dbddd56e Decouple temporary merchant list call [skip ci] 2020-03-30 21:32:59 -05:00
Akkadius
43716332aa Bulk load grids at repop and zone init instead of 2 costly individual selects per NPC, create repositories to decouple database logic from business logic 2020-03-30 05:49:43 -05:00
Akkadius
6af1ae32ae Migrate grids [skip ci] 2020-03-11 04:10:21 -05:00
Paul Coene
ab3d65b2ea
Fix FixZ regarding the use of model in npc_types
This fix only impacts those that use the model field in npc_types to override race on the client.

GetModel() returns model if set, otherwise race.

As a refresher, the model field is there so the server can still see a mob as its base race for things like bane, while the client can use a new model.

FixZ needs to know about this.
2020-02-01 20:29:48 -05:00
regneq
c2b3e85272 Added new pathgrid type 7 (GridCenterPoint). This grid causes a NPC to alternate between the first waypoint in their grid (Number 1 in the editor) and a random waypoint. (1 - 7 - 1 - 4 - 1 - 11 - 1 - 5 - 1, etc)
Changed the wandertype IDs to an enum so we know what we're looking at.
Added new pathgrid type 8 (GridRandomCenterPoint).  (SQL required) This new type causes a NPC to alternate between a random waypoint in grid_entries and a random waypoint marked with the new centerpoint column set to true. If no waypoints are marked as a centerpoint, this wandertype will not work. There is no numbering requirement or limit for centerpoints. You can have as many as you need.
New spawngroup field: wp_spawns (SQL required). Added a new spawngroup field, which is a boolean that if true changes the behavior of spawngroups this way: If the spawnpoint in the spawngroup has a grid, the NPC will spawn at a random waypoint location taken from its grid instead of the spawnpoint location.
New randompath behavior: The randompath grid type will now use the closest waypoint as its current waypoint on spawning.  This allows multiple spawn locations to use the same grid without having the undesirable behavior of walking to the first waypoint through walls and ignoring waypoint nodes. NPC::GetClosestWaypoint() was renamed to NPC::GetClosestWaypoints() as it was filling a list of multiple waypoints. a new method NPC::GetClosestWaypoint() returns a single waypoint in the form of an integer.
2020-01-24 15:11:08 -08:00
Paul Coene
d47bf6a73b
Update waypoints.cpp
Fixed log message to be correct.
2020-01-17 14:35:32 -05:00
Akkadius
96ef76847b Fix log calls that either didn't carry over or were using newer aliases that weren't converted to FMT prior to migration 2019-09-17 00:18:07 -05:00
Akkadius
076d393f79 Logs::FixZ to LogFixZ 2019-09-02 03:54:00 -05:00
Akkadius
44e3f28cb0 Logs::AI to LogAI 2019-09-02 03:44:03 -05:00
Akkadius
b4339691f9 Logs::Pathing to LogPathing 2019-09-02 03:37:55 -05:00
Akkadius
678c25e02c Simplify error logging 2019-09-01 22:05:44 -05:00