mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
fix(Core/Creature): Use proper name for wander distance (#2858)
* Change from spawndist to wander_distance Co-Authored-By: ratkosrb <ratkosrb@users.noreply.github.com> * fix sql error Co-Authored-By: ratkosrb <ratkosrb@users.noreply.github.com> * Let's see if this fixes eluna :) * Revert "Let's see if this fixes eluna :)" This reverts commit be675bf83fc6a02f3347ea76408152d623d374bf. * fix indent * Revert "fix indent" This reverts commit f4cb3d2d9fa908445d342b6f2e6dda9d52fd4665. * Revert "Revert "fix indent"" This reverts commit 48527cfd2f9031f95bdf6e0d7b90111a3c0dc0f2. Co-authored-by: ratkosrb <ratkosrb@users.noreply.github.com>
This commit is contained in:
@@ -149,7 +149,7 @@ public:
|
||||
{ "model", SEC_ADMINISTRATOR, false, &HandleNpcSetModelCommand, "" },
|
||||
{ "movetype", SEC_ADMINISTRATOR, false, &HandleNpcSetMoveTypeCommand, "" },
|
||||
{ "phase", SEC_ADMINISTRATOR, false, &HandleNpcSetPhaseCommand, "" },
|
||||
{ "spawndist", SEC_ADMINISTRATOR, false, &HandleNpcSetSpawnDistCommand, "" },
|
||||
{ "wanderdistance", SEC_ADMINISTRATOR, false, &HandleNpcSetWanderDistanceCommand, "" },
|
||||
{ "spawntime", SEC_ADMINISTRATOR, false, &HandleNpcSetSpawnTimeCommand, "" },
|
||||
{ "data", SEC_ADMINISTRATOR, false, &HandleNpcSetDataCommand, "" },
|
||||
//{ TODO: fix or remove these commands
|
||||
@@ -935,7 +935,7 @@ public:
|
||||
* Valid movement types are:
|
||||
* <ul>
|
||||
* <li> stay - NPC wont move </li>
|
||||
* <li> random - NPC will move randomly according to the spawndist </li>
|
||||
* <li> random - NPC will move randomly according to the wander_distance </li>
|
||||
* <li> way - NPC will move with given waypoints set </li>
|
||||
* </ul>
|
||||
* additional parameter: NODEL - so no waypoints are deleted, if you
|
||||
@@ -1107,7 +1107,7 @@ public:
|
||||
}
|
||||
|
||||
//set spawn dist of creature
|
||||
static bool HandleNpcSetSpawnDistCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleNpcSetWanderDistanceCommand(ChatHandler* handler, const char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -1131,7 +1131,7 @@ public:
|
||||
else
|
||||
return false;
|
||||
|
||||
creature->SetRespawnRadius((float)option);
|
||||
creature->SetWanderDistance((float)option);
|
||||
creature->SetDefaultMovementType(mtype);
|
||||
creature->GetMotionMaster()->Initialize();
|
||||
if (creature->IsAlive()) // dead creature will reset movement generator at respawn
|
||||
@@ -1140,7 +1140,7 @@ public:
|
||||
creature->Respawn();
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_DISTANCE);
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_WANDER_DISTANCE);
|
||||
|
||||
stmt->setFloat(0, option);
|
||||
stmt->setUInt8(1, uint8(mtype));
|
||||
@@ -1148,7 +1148,7 @@ public:
|
||||
|
||||
WorldDatabase.Execute(stmt);
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_SPAWNDIST, option);
|
||||
handler->PSendSysMessage(LANG_COMMAND_WANDER_DISTANCE, option);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user