Core/Creature: Use proper name for wander distance.
Port From (https://github.com/TrinityCore/TrinityCore/commit/72093e98e1bdbd3b83d8030d1cb50306bb04b028)
This commit is contained in:
@@ -361,7 +361,7 @@ namespace Framework.Constants
|
|||||||
// 296 free
|
// 296 free
|
||||||
|
|
||||||
// End
|
// End
|
||||||
CommandSpawndist = 297,
|
CommandWanderDistance = 297,
|
||||||
CommandSpawntime = 298,
|
CommandSpawntime = 298,
|
||||||
CommandModifyHonor = 299,
|
CommandModifyHonor = 299,
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace Framework.Database
|
|||||||
PrepareStatement(WorldStatements.UPD_CREATURE_FACTION, "UPDATE creature_template SET faction = ? WHERE entry = ?");
|
PrepareStatement(WorldStatements.UPD_CREATURE_FACTION, "UPDATE creature_template SET faction = ? WHERE entry = ?");
|
||||||
PrepareStatement(WorldStatements.UPD_CREATURE_NPCFLAG, "UPDATE creature_template SET npcflag = ? WHERE entry = ?");
|
PrepareStatement(WorldStatements.UPD_CREATURE_NPCFLAG, "UPDATE creature_template SET npcflag = ? WHERE entry = ?");
|
||||||
PrepareStatement(WorldStatements.UPD_CREATURE_POSITION, "UPDATE creature SET position_x = ?, position_y = ?, position_z = ?, orientation = ? WHERE guid = ?");
|
PrepareStatement(WorldStatements.UPD_CREATURE_POSITION, "UPDATE creature SET position_x = ?, position_y = ?, position_z = ?, orientation = ? WHERE guid = ?");
|
||||||
PrepareStatement(WorldStatements.UPD_CREATURE_SPAWN_DISTANCE, "UPDATE creature SET spawndist = ?, MovementType = ? WHERE guid = ?");
|
PrepareStatement(WorldStatements.UPD_CREATURE_WANDER_DISTANCE, "UPDATE creature SET wander_distance = ?, MovementType = ? WHERE guid = ?");
|
||||||
PrepareStatement(WorldStatements.UPD_CREATURE_SPAWN_TIME_SECS, "UPDATE creature SET spawntimesecs = ? WHERE guid = ?");
|
PrepareStatement(WorldStatements.UPD_CREATURE_SPAWN_TIME_SECS, "UPDATE creature SET spawntimesecs = ? WHERE guid = ?");
|
||||||
PrepareStatement(WorldStatements.INS_CREATURE_FORMATION, "INSERT INTO creature_formations (leaderGUID, memberGUID, dist, angle, groupAI) VALUES (?, ?, ?, ?, ?)");
|
PrepareStatement(WorldStatements.INS_CREATURE_FORMATION, "INSERT INTO creature_formations (leaderGUID, memberGUID, dist, angle, groupAI) VALUES (?, ?, ?, ?, ?)");
|
||||||
PrepareStatement(WorldStatements.INS_WAYPOINT_DATA, "INSERT INTO waypoint_data (id, point, position_x, position_y, position_z, orientation) VALUES (?, ?, ?, ?, ?, ?)");
|
PrepareStatement(WorldStatements.INS_WAYPOINT_DATA, "INSERT INTO waypoint_data (id, point, position_x, position_y, position_z, orientation) VALUES (?, ?, ?, ?, ?, ?)");
|
||||||
@@ -80,7 +80,7 @@ namespace Framework.Database
|
|||||||
PrepareStatement(WorldStatements.SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?");
|
PrepareStatement(WorldStatements.SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?");
|
||||||
PrepareStatement(WorldStatements.SEL_GAMEOBJECT_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM gameobject WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_");
|
PrepareStatement(WorldStatements.SEL_GAMEOBJECT_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM gameobject WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_");
|
||||||
PrepareStatement(WorldStatements.SEL_CREATURE_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM creature WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_");
|
PrepareStatement(WorldStatements.SEL_CREATURE_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM creature WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_");
|
||||||
PrepareStatement(WorldStatements.INS_CREATURE, "INSERT INTO creature (guid, id , map, spawnDifficulties, PhaseId, PhaseGroup, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, MovementType, npcflag, unit_flags, unit_flags2, unit_flags3, dynamicflags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
PrepareStatement(WorldStatements.INS_CREATURE, "INSERT INTO creature (guid, id , map, spawnDifficulties, PhaseId, PhaseGroup, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, wander_distance, currentwaypoint, curhealth, curmana, MovementType, npcflag, unit_flags, unit_flags2, unit_flags3, dynamicflags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
PrepareStatement(WorldStatements.DEL_GAME_EVENT_CREATURE, "DELETE FROM game_event_creature WHERE guid = ?");
|
PrepareStatement(WorldStatements.DEL_GAME_EVENT_CREATURE, "DELETE FROM game_event_creature WHERE guid = ?");
|
||||||
PrepareStatement(WorldStatements.DEL_GAME_EVENT_MODEL_EQUIP, "DELETE FROM game_event_model_equip WHERE guid = ?");
|
PrepareStatement(WorldStatements.DEL_GAME_EVENT_MODEL_EQUIP, "DELETE FROM game_event_model_equip WHERE guid = ?");
|
||||||
PrepareStatement(WorldStatements.INS_GAMEOBJECT, "INSERT INTO gameobject (guid, id, map, spawnDifficulties, PhaseId, PhaseGroup, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
PrepareStatement(WorldStatements.INS_GAMEOBJECT, "INSERT INTO gameobject (guid, id, map, spawnDifficulties, PhaseId, PhaseGroup, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
@@ -116,7 +116,7 @@ namespace Framework.Database
|
|||||||
UPD_CREATURE_FACTION,
|
UPD_CREATURE_FACTION,
|
||||||
UPD_CREATURE_NPCFLAG,
|
UPD_CREATURE_NPCFLAG,
|
||||||
UPD_CREATURE_POSITION,
|
UPD_CREATURE_POSITION,
|
||||||
UPD_CREATURE_SPAWN_DISTANCE,
|
UPD_CREATURE_WANDER_DISTANCE,
|
||||||
UPD_CREATURE_SPAWN_TIME_SECS,
|
UPD_CREATURE_SPAWN_TIME_SECS,
|
||||||
INS_CREATURE_FORMATION,
|
INS_CREATURE_FORMATION,
|
||||||
INS_WAYPOINT_DATA,
|
INS_WAYPOINT_DATA,
|
||||||
|
|||||||
@@ -1403,8 +1403,8 @@ namespace Game.Chat
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("spawndist", RBACPermissions.CommandNpcSetSpawndist)]
|
[Command("wanderdistance", RBACPermissions.CommandNpcSetSpawndist)]
|
||||||
static bool HandleNpcSetSpawnDistCommand(StringArguments args, CommandHandler handler)
|
static bool HandleNpcSetWanderDistanceCommand(StringArguments args, CommandHandler handler)
|
||||||
{
|
{
|
||||||
if (args.Empty())
|
if (args.Empty())
|
||||||
return false;
|
return false;
|
||||||
@@ -1428,7 +1428,7 @@ namespace Game.Chat
|
|||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
creature.SetRespawnRadius(option);
|
creature.SetWanderDistance(option);
|
||||||
creature.SetDefaultMovementType(mtype);
|
creature.SetDefaultMovementType(mtype);
|
||||||
creature.GetMotionMaster().Initialize();
|
creature.GetMotionMaster().Initialize();
|
||||||
if (creature.IsAlive()) // dead creature will reset movement generator at respawn
|
if (creature.IsAlive()) // dead creature will reset movement generator at respawn
|
||||||
@@ -1437,14 +1437,14 @@ namespace Game.Chat
|
|||||||
creature.Respawn();
|
creature.Respawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_SPAWN_DISTANCE);
|
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_WANDER_DISTANCE);
|
||||||
stmt.AddValue(0, option);
|
stmt.AddValue(0, option);
|
||||||
stmt.AddValue(1, (byte)mtype);
|
stmt.AddValue(1, (byte)mtype);
|
||||||
stmt.AddValue(2, guidLow);
|
stmt.AddValue(2, guidLow);
|
||||||
|
|
||||||
DB.World.Execute(stmt);
|
DB.World.Execute(stmt);
|
||||||
|
|
||||||
handler.SendSysMessage(CypherStrings.CommandSpawndist, option);
|
handler.SendSysMessage(CypherStrings.CommandWanderDistance, option);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ namespace Game.Entities
|
|||||||
long m_respawnTime; // (secs) time of next respawn
|
long m_respawnTime; // (secs) time of next respawn
|
||||||
uint m_respawnDelay; // (secs) delay between corpse disappearance and respawning
|
uint m_respawnDelay; // (secs) delay between corpse disappearance and respawning
|
||||||
uint m_corpseDelay; // (secs) delay between death and corpse disappearance
|
uint m_corpseDelay; // (secs) delay between death and corpse disappearance
|
||||||
float m_respawnradius;
|
float m_wanderDistance;
|
||||||
uint m_boundaryCheckTime; // (msecs) remaining time for next evade boundary check
|
uint m_boundaryCheckTime; // (msecs) remaining time for next evade boundary check
|
||||||
uint m_combatPulseTime; // (msecs) remaining time for next zone-in-combat pulse
|
uint m_combatPulseTime; // (msecs) remaining time for next zone-in-combat pulse
|
||||||
uint m_combatPulseDelay; // (secs) how often the creature puts the entire zone in combat (only works in dungeons)
|
uint m_combatPulseDelay; // (secs) how often the creature puts the entire zone in combat (only works in dungeons)
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
// checked at loading
|
// checked at loading
|
||||||
DefaultMovementType = (MovementGeneratorType)(data != null ? data.movementType : cInfo.MovementType);
|
DefaultMovementType = (MovementGeneratorType)(data != null ? data.movementType : cInfo.MovementType);
|
||||||
if (m_respawnradius == 0 && DefaultMovementType == MovementGeneratorType.Random)
|
if (m_wanderDistance == 0 && DefaultMovementType == MovementGeneratorType.Random)
|
||||||
DefaultMovementType = MovementGeneratorType.Idle;
|
DefaultMovementType = MovementGeneratorType.Idle;
|
||||||
|
|
||||||
for (byte i = 0; i < SharedConst.MaxCreatureSpells; ++i)
|
for (byte i = 0; i < SharedConst.MaxCreatureSpells; ++i)
|
||||||
@@ -1267,12 +1267,12 @@ namespace Game.Entities
|
|||||||
|
|
||||||
data.spawntimesecs = (int)m_respawnDelay;
|
data.spawntimesecs = (int)m_respawnDelay;
|
||||||
// prevent add data integrity problems
|
// prevent add data integrity problems
|
||||||
data.spawndist = GetDefaultMovementType() == MovementGeneratorType.Idle ? 0.0f : m_respawnradius;
|
data.WanderDistance = GetDefaultMovementType() == MovementGeneratorType.Idle ? 0.0f : m_wanderDistance;
|
||||||
data.currentwaypoint = 0;
|
data.currentwaypoint = 0;
|
||||||
data.curhealth = (uint)GetHealth();
|
data.curhealth = (uint)GetHealth();
|
||||||
data.curmana = (uint)GetPower(PowerType.Mana);
|
data.curmana = (uint)GetPower(PowerType.Mana);
|
||||||
// prevent add data integrity problems
|
// prevent add data integrity problems
|
||||||
data.movementType = (byte)(m_respawnradius == 0 && GetDefaultMovementType() == MovementGeneratorType.Random
|
data.movementType = (byte)(m_wanderDistance == 0 && GetDefaultMovementType() == MovementGeneratorType.Random
|
||||||
? MovementGeneratorType.Idle : GetDefaultMovementType());
|
? MovementGeneratorType.Idle : GetDefaultMovementType());
|
||||||
data.spawnDifficulties = spawnDifficulties;
|
data.spawnDifficulties = spawnDifficulties;
|
||||||
data.npcflag = npcflag;
|
data.npcflag = npcflag;
|
||||||
@@ -1309,7 +1309,7 @@ namespace Game.Entities
|
|||||||
stmt.AddValue(index++, GetPositionZ());
|
stmt.AddValue(index++, GetPositionZ());
|
||||||
stmt.AddValue(index++, GetOrientation());
|
stmt.AddValue(index++, GetOrientation());
|
||||||
stmt.AddValue(index++, m_respawnDelay);
|
stmt.AddValue(index++, m_respawnDelay);
|
||||||
stmt.AddValue(index++, m_respawnradius);
|
stmt.AddValue(index++, m_wanderDistance);
|
||||||
stmt.AddValue(index++, 0);
|
stmt.AddValue(index++, 0);
|
||||||
stmt.AddValue(index++, GetHealth());
|
stmt.AddValue(index++, GetHealth());
|
||||||
stmt.AddValue(index++, GetPower(PowerType.Mana));
|
stmt.AddValue(index++, GetPower(PowerType.Mana));
|
||||||
@@ -2455,7 +2455,7 @@ namespace Game.Entities
|
|||||||
if (m_creatureData != null)
|
if (m_creatureData != null)
|
||||||
{
|
{
|
||||||
m_creatureData.SpawnPoint.GetPosition(out x, out y, out z, out ori);
|
m_creatureData.SpawnPoint.GetPosition(out x, out y, out z, out ori);
|
||||||
dist = m_creatureData.spawndist;
|
dist = m_creatureData.WanderDistance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3160,7 +3160,7 @@ namespace Game.Entities
|
|||||||
m_spawnId = spawnId;
|
m_spawnId = spawnId;
|
||||||
m_respawnCompatibilityMode = data.spawnGroupData.flags.HasAnyFlag(SpawnGroupFlags.CompatibilityMode);
|
m_respawnCompatibilityMode = data.spawnGroupData.flags.HasAnyFlag(SpawnGroupFlags.CompatibilityMode);
|
||||||
m_creatureData = data;
|
m_creatureData = data;
|
||||||
m_respawnradius = data.spawndist;
|
m_wanderDistance = data.WanderDistance;
|
||||||
m_respawnDelay = (uint)data.spawntimesecs;
|
m_respawnDelay = (uint)data.spawntimesecs;
|
||||||
|
|
||||||
if (!Create(map.GenerateLowGuid(HighGuid.Creature), map, data.Id, data.SpawnPoint, data, 0, !m_respawnCompatibilityMode))
|
if (!Create(map.GenerateLowGuid(HighGuid.Creature), map, data.Id, data.SpawnPoint, data, 0, !m_respawnCompatibilityMode))
|
||||||
@@ -3246,8 +3246,8 @@ namespace Game.Entities
|
|||||||
public uint GetRespawnDelay() { return m_respawnDelay; }
|
public uint GetRespawnDelay() { return m_respawnDelay; }
|
||||||
public void SetRespawnDelay(uint delay) { m_respawnDelay = delay; }
|
public void SetRespawnDelay(uint delay) { m_respawnDelay = delay; }
|
||||||
|
|
||||||
public float GetRespawnRadius() { return m_respawnradius; }
|
public float GetWanderDistance() { return m_wanderDistance; }
|
||||||
public void SetRespawnRadius(float dist) { m_respawnradius = dist; }
|
public void SetWanderDistance(float dist) { m_wanderDistance = dist; }
|
||||||
|
|
||||||
public void DoImmediateBoundaryCheck() { m_boundaryCheckTime = 0; }
|
public void DoImmediateBoundaryCheck() { m_boundaryCheckTime = 0; }
|
||||||
uint GetCombatPulseDelay() { return m_combatPulseDelay; }
|
uint GetCombatPulseDelay() { return m_combatPulseDelay; }
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
public uint displayid;
|
public uint displayid;
|
||||||
public sbyte equipmentId;
|
public sbyte equipmentId;
|
||||||
public float spawndist;
|
public float WanderDistance;
|
||||||
public uint currentwaypoint;
|
public uint currentwaypoint;
|
||||||
public uint curhealth;
|
public uint curhealth;
|
||||||
public uint curmana;
|
public uint curmana;
|
||||||
|
|||||||
@@ -3366,7 +3366,7 @@ namespace Game
|
|||||||
var time = Time.GetMSTime();
|
var time = Time.GetMSTime();
|
||||||
|
|
||||||
// 0 1 2 3 4 5 6 7 8 9 10
|
// 0 1 2 3 4 5 6 7 8 9 10
|
||||||
SQLResult result = DB.World.Query("SELECT creature.guid, id, map, position_x, position_y, position_z, orientation, modelid, equipment_id, spawntimesecs, spawndist, " +
|
SQLResult result = DB.World.Query("SELECT creature.guid, id, map, position_x, position_y, position_z, orientation, modelid, equipment_id, spawntimesecs, wander_distance, " +
|
||||||
//11 12 13 14 15 16 17 18 19 20 21
|
//11 12 13 14 15 16 17 18 19 20 21
|
||||||
"currentwaypoint, curhealth, curmana, MovementType, spawnDifficulties, eventEntry, poolSpawnId, creature.npcflag, creature.unit_flags, creature.unit_flags2, creature.unit_flags3, " +
|
"currentwaypoint, curhealth, curmana, MovementType, spawnDifficulties, eventEntry, poolSpawnId, creature.npcflag, creature.unit_flags, creature.unit_flags2, creature.unit_flags3, " +
|
||||||
//22 23 24 25 26 27
|
//22 23 24 25 26 27
|
||||||
@@ -3415,7 +3415,7 @@ namespace Game
|
|||||||
data.displayid = result.Read<uint>(7);
|
data.displayid = result.Read<uint>(7);
|
||||||
data.equipmentId = result.Read<sbyte>(8);
|
data.equipmentId = result.Read<sbyte>(8);
|
||||||
data.spawntimesecs = result.Read<int>(9);
|
data.spawntimesecs = result.Read<int>(9);
|
||||||
data.spawndist = result.Read<float>(10);
|
data.WanderDistance = result.Read<float>(10);
|
||||||
data.currentwaypoint = result.Read<uint>(11);
|
data.currentwaypoint = result.Read<uint>(11);
|
||||||
data.curhealth = result.Read<uint>(12);
|
data.curhealth = result.Read<uint>(12);
|
||||||
data.curmana = result.Read<uint>(13);
|
data.curmana = result.Read<uint>(13);
|
||||||
@@ -3477,25 +3477,25 @@ namespace Game
|
|||||||
"but creature are not in instance.", guid, data.Id);
|
"but creature are not in instance.", guid, data.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.spawndist < 0.0f)
|
if (data.WanderDistance < 0.0f)
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Sql, "Table `creature` have creature (GUID: {0} Entry: {1}) with `spawndist`< 0, set to 0.", guid, data.Id);
|
Log.outError(LogFilter.Sql, "Table `creature` have creature (GUID: {0} Entry: {1}) with `wander_distance`< 0, set to 0.", guid, data.Id);
|
||||||
data.spawndist = 0.0f;
|
data.WanderDistance = 0.0f;
|
||||||
}
|
}
|
||||||
else if (data.movementType == (byte)MovementGeneratorType.Random)
|
else if (data.movementType == (byte)MovementGeneratorType.Random)
|
||||||
{
|
{
|
||||||
if (MathFunctions.fuzzyEq(data.spawndist, 0.0f))
|
if (MathFunctions.fuzzyEq(data.WanderDistance, 0.0f))
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Sql, "Table `creature` have creature (GUID: {0} Entry: {1}) with `MovementType`=1 (random movement) but with `spawndist`=0, replace by idle movement type (0).", guid, data.Id);
|
Log.outError(LogFilter.Sql, "Table `creature` have creature (GUID: {0} Entry: {1}) with `MovementType`=1 (random movement) but with `wander_distance`=0, replace by idle movement type (0).", guid, data.Id);
|
||||||
data.movementType = (byte)MovementGeneratorType.Idle;
|
data.movementType = (byte)MovementGeneratorType.Idle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (data.movementType == (byte)MovementGeneratorType.Idle)
|
else if (data.movementType == (byte)MovementGeneratorType.Idle)
|
||||||
{
|
{
|
||||||
if (data.spawndist != 0.0f)
|
if (data.WanderDistance != 0.0f)
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Sql, "Table `creature` have creature (GUID: {0} Entry: {1}) with `MovementType`=0 (idle) have `spawndist`<>0, set to 0.", guid, data.Id);
|
Log.outError(LogFilter.Sql, "Table `creature` have creature (GUID: {0} Entry: {1}) with `MovementType`=0 (idle) have `wander_distance`<>0, set to 0.", guid, data.Id);
|
||||||
data.spawndist = 0.0f;
|
data.WanderDistance = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3620,7 +3620,7 @@ namespace Game
|
|||||||
data.equipmentId = 0;
|
data.equipmentId = 0;
|
||||||
|
|
||||||
data.spawntimesecs = (int)spawntimedelay;
|
data.spawntimesecs = (int)spawntimedelay;
|
||||||
data.spawndist = 0;
|
data.WanderDistance = 0;
|
||||||
data.currentwaypoint = 0;
|
data.currentwaypoint = 0;
|
||||||
data.curhealth = (uint)(Global.DB2Mgr.EvaluateExpectedStat(ExpectedStatType.CreatureHealth, level, cInfo.HealthScalingExpansion, scaling.ContentTuningID, (Class)cInfo.UnitClass) * cInfo.ModHealth * cInfo.ModHealthExtra);
|
data.curhealth = (uint)(Global.DB2Mgr.EvaluateExpectedStat(ExpectedStatType.CreatureHealth, level, cInfo.HealthScalingExpansion, scaling.ContentTuningID, (Class)cInfo.UnitClass) * cInfo.ModHealth * cInfo.ModHealthExtra);
|
||||||
data.curmana = stats.GenerateMana(cInfo);
|
data.curmana = stats.GenerateMana(cInfo);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Game.Movement
|
|||||||
owner.StopMoving();
|
owner.StopMoving();
|
||||||
|
|
||||||
if (_wanderDistance == 0f)
|
if (_wanderDistance == 0f)
|
||||||
_wanderDistance = owner.GetRespawnRadius();
|
_wanderDistance = owner.GetWanderDistance();
|
||||||
|
|
||||||
// Retail seems to let a creature walk 2 up to 10 splines before triggering a pause
|
// Retail seems to let a creature walk 2 up to 10 splines before triggering a pause
|
||||||
_wanderSteps = RandomHelper.URand(2, 10);
|
_wanderSteps = RandomHelper.URand(2, 10);
|
||||||
|
|||||||
@@ -536,10 +536,10 @@ namespace Game.Movement
|
|||||||
Add(new FollowMovementGenerator(target, SharedConst.PetFollowDist, new ChaseAngle(SharedConst.PetFollowAngle)));
|
Add(new FollowMovementGenerator(target, SharedConst.PetFollowDist, new ChaseAngle(SharedConst.PetFollowAngle)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveRandom(float spawndist = 0.0f)
|
public void MoveRandom(float wanderDistance = 0.0f)
|
||||||
{
|
{
|
||||||
if (_owner.IsTypeId(TypeId.Unit))
|
if (_owner.IsTypeId(TypeId.Unit))
|
||||||
Add(new RandomMovementGenerator(spawndist));
|
Add(new RandomMovementGenerator(wanderDistance), MovementSlot.Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveFollow(Unit target, float dist, float angle = 0.0f, MovementSlot slot = MovementSlot.Active) { MoveFollow(target, dist, new ChaseAngle(angle), slot); }
|
public void MoveFollow(Unit target, float dist, float angle = 0.0f, MovementSlot slot = MovementSlot.Active) { MoveFollow(target, dist, new ChaseAngle(angle), slot); }
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
-- Use more appropriate name for distance used by random movement generator.
|
||||||
|
ALTER TABLE `creature`
|
||||||
|
CHANGE COLUMN `spawndist` `wander_distance` FLOAT NOT NULL DEFAULT '0' AFTER `spawntimesecs`;
|
||||||
|
|
||||||
|
-- Update name used by chat command.
|
||||||
|
UPDATE `trinity_string` SET `content_default`='Wander distance changed to: %f' WHERE `entry`=297;
|
||||||
|
UPDATE `command` SET `name`='npc set wanderdistance', `help`='Syntax: .npc set wanderdistance #dist\r\n\r\nAdjust wander distance of selected creature to dist.' WHERE `name`='npc set spawndist';
|
||||||
Reference in New Issue
Block a user