From f1d1731fc7ae896da3e269ba846e595a73e15047 Mon Sep 17 00:00:00 2001 From: splose Date: Wed, 16 Jun 2021 11:24:07 -0400 Subject: [PATCH] [Command] Add #npcedit rarespawn (#1418) * add #npcedit rarespawn * minor fix --- zone/command.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zone/command.cpp b/zone/command.cpp index 40c7b6d82..eb0d9da45 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -9059,6 +9059,7 @@ void command_npcedit(Client *c, const Seperator *sep) c->Message(Chat::White, "#npcedit slow_mitigation - Set an NPC's slow mitigation"); c->Message(Chat::White, "#npcedit flymode - Set an NPC's flymode [0 = ground, 1 = flying, 2 = levitate, 3 = water, 4 = floating]"); c->Message(Chat::White, "#npcedit raidtarget - Set an NPCs raid_target field"); + c->Message(Chat::White, "#npcedit rarespawn - Set an NPCs rare flag"); c->Message(Chat::White, "#npcedit respawntime - Set an NPCs respawn timer in seconds"); } @@ -9667,6 +9668,15 @@ void command_npcedit(Client *c, const Seperator *sep) } } + if (strcasecmp(sep->arg[1], "rarespawn") == 0) { + if (sep->arg[2][0] && sep->IsNumber(sep->arg[2]) && atoi(sep->arg[2]) >= 0) { + c->Message(Chat::Yellow, "NPCID %u is %s as a rare spawn.", npcTypeID, atoi(sep->arg[2]) == 0 ? "no longer designated" : "now designated"); + std::string query = StringFormat("UPDATE npc_types SET rare_spawn = %i WHERE id = %i", atoi(sep->arg[2]), npcTypeID); + content_db.QueryDatabase(query); + return; + } + } + if (strcasecmp(sep->arg[1], "respawntime") == 0) { if (sep->arg[2][0] && sep->IsNumber(sep->arg[2]) && atoi(sep->arg[2]) > 0) { c->Message(Chat::Yellow, "NPCID %u (spawngroup %i) respawn time set to %i.", npcTypeID, c->GetTarget()->CastToNPC()->GetSpawnGroupId(), atoi(sep->arg[2]));