This is the first, rough implementation of Playerbot AI by Ike3, originally playerbot by blueboy
There's still TONS of work left to do on this, but it should compile and build
This introduces a new cmake option, playerbots. Disabled by default
Using DB script command 34 (TERMINATE_CONDITION) was triggering an array out of
bounds access when debug logging was on, causing the server to crash. The array
is accessed with ConditionSource as index, but there was no corresponding string
for CONDITION_FROM_RESERVED_1. As a result, the array was missing one string and
accessing the array with the highest possible index, CONDITION_FROM_DBSCRIPTS,
accessed the array out of bounds.
Many thanks to @Schmoozerd for debugging and suggesting a fix and to @scotty0100 for patiently running many tests!
Username wasn't changed to uppercases, therefore the SHA1 hash is always wrong when users have lowercases in their username.
Result: Users cannot log in with telnet.
1 - Implement generating path ( where unit can walk - there blink will available )
2 - Implement Water path (if blink starting before (or in) water - Z coord will safe, if starting IN water, and last point on a ground (if it available) - new Z will on a ground.
3 - Implement Safe blink , both parts :
* - blink at abyss ( unit will stoped before abyss )
* - blink in falling, where difference between unit Z and land Z < 8 yards - unit will blink on a land, if blink in falling, but difference will more then 8 yards - just blink forward
All parts of blink has check LoS (c2618)
Blink -> Check if we are near of liquid level before assigning previous Z to next Z. (c2623) @cyberium
Also when we tp to water we have to set final z a bit under the liquid level. Not at liquid level.
Rewrite Waypoint related commands (c2612)
Toggle the commands .wp add .wp modify and .wp show to be able to work with waypoints from creature_movement_template
Technical changes:
* Move Path Selection to WaypointManager
* Set visual waypoints to be summoned npcs
Remove .npc addmove command to add a waypoint. (c2619)
For this .wp add command is expected to be used
Remove unneeded functions from WaypointManager (c2620)
Waypoint Commands: Improve export command, remove import command (c2621)
* Also finally drop the wpguid columns from creature_movement[_template]
* Also remove all static spawns of id=1 (they are usually waypoints from the old system)
* Fix a minor bug in WaypointManager than can result in a crash if bad params are passed
Waypoint-Commands: Prefer current path's movement for handling (c2626)
WaypointMovement: Allow External sources to load waypoints (with different path ids) (c2627)
* Add SetExternalWaypointTable(..) function to ScriptMgr.h scope to be able to define from which table external waypoints are loaded
* Add AddWaypointFromExternal(..) function to ScriptMgr.h scope to load points into WaypointManager
* Expand MotionMaster::MoveWaypoint function to use source and pathId for specifying which path to load
* Expand MotionMaster::MoveWaypoint function to use some overwrite information for "entry".
This will be helpfull to have one path for mobs with different entry (ie ally/horde npcs with same behaviour)
* For externally loaded waypoints let CreatureAI::MovementInform have EXTERNAL_WAYPOINT_MOVE(256) + pathId as type.
This will allow an external user to know which of "his" paths is used
* Adapt the related commands a little bit such that parts of the commands will also be usable for external paths
At the moment .wp show and .wp export work with external paths.
WaypointMovement: Add support to set the next waypoint (c2635)
* Also add support to initialize a path with waittime before starting movement
* Add additional types for external use of MovementInform such that MovementInform is called when a waypoint is started, or when the last waypoint is handled
* Improve some minor technical issues
Let .wp add command start with 1 as first waypoint (c2640)