* Add correct Reset position (Npc will evade now to the last reached waypoint, and not to the next waypoint)
* Add proper return value for the CONDITION_LAST_WAYPOINT
* Let WaypointMMGen behave better after evading (keep PAUSED state, keep waittimer (original author @Schmoozerd)
* Allow waypoints that have point-ids not from 1 to n
* Remove possibly bad sql-statements to "fix" the above property
* Simplify code a little bit
Remaining TODO: Bring commands up-to-date and also make things more simple instead of using the database to store visual waypoints
Spline movement controls movements of server-side controlled units (monster movement, taxi movement, etc).
Proper implementation of effects such as charge, jump, cyclic movement will rely on it.
However, need improve our states system before.
Technical changes:
1. Added linear, catmullrom and bezier3 splines which based on client's algorthims. They can be reused for proper transport position interpolation.
2. Precission increased. There are no more position desync issues since client's position calculation formulas used.
3. Now possible to move by paths with multiple points, send whole path to client.
Now any creatures/gameobjects loaded base at DB data
in non-instanceable/instanceable maps always have same guid
as in DB data.
* Also remove useless by same reasons MaNGOS::GameObjectWithDbGUIDCheck
- Script library presence is now optional.
- Some script hooks have new names. Scripting libraries need to be adjusted accordingly.
Signed-off-by: zergtmn <zerg@myisp.com>
Also other classes have been affected, due to the use of search&replace.
This will probably break some patches and 3rd party libraries, so make sure to update them if required.
Thanks to Phille for the original idea and patch!
Template can be used for several cases:
* Unique creature that are already spawned in database (requires creature.MovementType=2 like guid based creature_movement)
* Summoned creature that has a pre-defined path (requires creature_template.MovementType=2)
Note that creature_template.MovementType=2 should be used with care, and must not be used for creatures that may be summoned in random locations in world.
Added additional startup checks for existing creature_movement-table
Signed-off-by: NoFantasy <nofantasy@nf.no>
* Initialization to ensure destination is always set (prevent evade problem)
* Simplify how behavior for node is processed, incl fix MovementInform script call (based on idea/past code from Quriq14)
* Make sure last node is also processed correct (DB script for last node will now work as expected)
As usual if any problems occur, you can call our toll free customer support number.
Signed-off-by: NoFantasy <nofantasy@nf.no>
Let script library know when some event is about to start. Event id's may be found in several sources, such as spells, GO's and transport/taxi paths.
Database scripts may be prevented by returning true from script side whenever needed. If false, DB script will run like normal.
New database table event_id_scripts will need a ScriptName for the event id, in same way as for example areatrigger_scripts.
Signed-off-by: NoFantasy <nofantasy@nf.no>
New field script_id in creature_movement can be filled for each waypoint point and run the corresponding script from creature_movement_scripts.
Script_id can be any value and several points/creatures can share the same script (with limits of course, such as script depending on location and other factors).
DB projects are advised to move current text, spells and emotes data in creature_movement fields as these fields are strictly no longer needed and may be fully removed in the future.
Signed-off-by: NoFantasy <nofantasy@nf.no>
Waypoint/db script/event ai/'.npc playemote' emote data now auto select by emote id way to execute:
oneshot or persistent state
So if in referenced DB data wrongly used state emote as oneshot case this will work in different way now.
* If creature near respawn point and by defult do random movement
then restart from current point
* If creature have default waypoints movegen restart from last
updated point. Not reload waypoints
* Re-number enums by function groups and use where possible new defined masks in code instead raw enum |-lists.
* Avoid use movement generator generic state markers like UNIT_STAT_CONFUSED for mark movement stoped.
Add special shadow UNIT_STAT_CONFUSED_MOVE/etc states for like use.
UNIT_STAT_CONFUSED in like case will be safe expect use for normal checks confused state presence
And UNIT_STAT_CONFUSED_MOVE for check real move in this state