Better flee runspeed calculation.

Added two new NPC special_abilities, ALWAYS_FLEE and FLEE_PERCENT.
Fixed an issue where a NPC could get stuck on a single coord in a rectangular roambox.
Added mindelay to spawngroup to allow for greater control of the roambox delay. SQL is required.
This commit is contained in:
cavedude00
2014-02-26 18:06:16 -08:00
parent ea31a29f8a
commit 1d6bd3cc5e
19 changed files with 118 additions and 56 deletions
+4 -3
View File
@@ -47,11 +47,11 @@ static inline float ABS(float x) {
return(x);
}
void NPC::AI_SetRoambox(float iDist, float iRoamDist, uint32 iDelay) {
AI_SetRoambox(iDist, GetX()+iRoamDist, GetX()-iRoamDist, GetY()+iRoamDist, GetY()-iRoamDist, iDelay);
void NPC::AI_SetRoambox(float iDist, float iRoamDist, uint32 iDelay, uint32 iMinDelay) {
AI_SetRoambox(iDist, GetX()+iRoamDist, GetX()-iRoamDist, GetY()+iRoamDist, GetY()-iRoamDist, iDelay, iMinDelay);
}
void NPC::AI_SetRoambox(float iDist, float iMaxX, float iMinX, float iMaxY, float iMinY, uint32 iDelay) {
void NPC::AI_SetRoambox(float iDist, float iMaxX, float iMinX, float iMaxY, float iMinY, uint32 iDelay, uint32 iMinDelay) {
roambox_distance = iDist;
roambox_max_x = iMaxX;
roambox_min_x = iMinX;
@@ -59,6 +59,7 @@ void NPC::AI_SetRoambox(float iDist, float iMaxX, float iMinX, float iMaxY, floa
roambox_min_y = iMinY;
roambox_movingto_x = roambox_max_x + 1; // this will trigger a recalc
roambox_delay = iDelay;
roambox_min_delay = iMinDelay;
}
void NPC::DisplayWaypointInfo(Client *c) {