mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
* Added mintime and maxtime to spawnentry. This will prevent a NPC from spawning outside of the times specified. NPCs spawned in this way will then behave like normal NPCs. They will not despawn on their own, unlike spawn_events/spawn_conditions. NPCs using this that are alone in their spawngroup will attempt to spawn after their respawn timer has expired if the time of day is outside their range. Otherwise, another NPC in the spawngroup will be chosen to spawn. The normal rules (chance, spawn_limit) still apply to these NPCs, this is just another rule added to the system. mintime and maxtime both represent the in-game EQ Hour. Valid values are 1-24. If either or both of the values are 0, then the NPC will not have any time restriction. Added a new rule World:BootHour. This allows server admins to specify the EQ hour the server will boot to. Valid options are 1-24. Setting this rule to 0 (default) disables it and world will use whatever time is specified in the DB. * generated base_spawnentry_repository.h from script * removed the rule insert from database_update_manifest.cpp. * Add logging, initializers, minor cleanup * Remove if/else branch * Update eqtime.cpp * Initializers, logging --------- Co-authored-by: Akkadius <akkadius1@gmail.com>
47 lines
1.1 KiB
C++
Executable File
47 lines
1.1 KiB
C++
Executable File
#include "../../client.h"
|
|
|
|
void SetDate(Client *c, const Seperator *sep)
|
|
{
|
|
const auto arguments = sep->argnum;
|
|
if (
|
|
arguments < 2 ||
|
|
!sep->IsNumber(2) ||
|
|
!sep->IsNumber(3) ||
|
|
!sep->IsNumber(4)
|
|
) {
|
|
c->Message(Chat::White, "Usage: #date [Year] [Month] [Day] [Hour] [Minute]");
|
|
c->Message(Chat::White, "Hour and Minute are optional");
|
|
return;
|
|
}
|
|
|
|
TimeOfDay_Struct t{};
|
|
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &t);
|
|
|
|
const uint16 year = Strings::ToUnsignedInt(sep->arg[2]);
|
|
const uint8 month = Strings::ToUnsignedInt(sep->arg[3]);
|
|
const uint8 day = Strings::ToUnsignedInt(sep->arg[4]);
|
|
const uint8 hour = !sep->IsNumber(5) ? t.hour : Strings::ToUnsignedInt(sep->arg[5]) + 1;
|
|
const uint8 minute = !sep->IsNumber(6) ? t.minute : Strings::ToUnsignedInt(sep->arg[6]);
|
|
|
|
c->Message(
|
|
Chat::White,
|
|
fmt::format("Setting world time to {}/{}/{} {}.",
|
|
year,
|
|
month,
|
|
day,
|
|
Strings::ZoneTime(hour, minute)
|
|
).c_str()
|
|
);
|
|
|
|
zone->SetDate(year, month, day, hour, minute);
|
|
|
|
LogInfo(
|
|
"{} :: Setting world time to {}/{}/{} {}.",
|
|
c->GetCleanName(),
|
|
year,
|
|
month,
|
|
day,
|
|
Strings::ZoneTime(hour, minute)
|
|
);
|
|
}
|