From e69f7a6cf1eab40bbba186d7a02cf75ca4f04892 Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Mon, 23 May 2022 19:56:30 -0400 Subject: [PATCH] [Commands] Remove unused/broken #deletegraveyard and #setgraveyard Commands. (#2198) - These commands don't function in their current state, and they probably haven't ever. - Removing the commands and putting this in an editor makes more sense, as #setgraveyard uses the current zone XYZ coordinates of a target to set a graveyard for another zone. and they also only allow version 0 graveyards. - Not sure of a better idea than just deleting, as setting data based on another zone using your current zone's data seems beyond the scope of a command. --- common/database.cpp | 15 ---------- common/database.h | 2 -- zone/command.cpp | 4 --- zone/command.h | 2 -- zone/gm_commands/deletegraveyard.cpp | 35 ---------------------- zone/gm_commands/setgraveyard.cpp | 44 ---------------------------- zone/zonedb.cpp | 33 --------------------- zone/zonedb.h | 4 --- 8 files changed, 139 deletions(-) delete mode 100755 zone/gm_commands/deletegraveyard.cpp delete mode 100755 zone/gm_commands/setgraveyard.cpp diff --git a/common/database.cpp b/common/database.cpp index 4e7cb53d6..93535e584 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -1107,21 +1107,6 @@ bool Database::GetZoneLongName(const char* short_name, char** long_name, char* f return true; } -uint32 Database::GetZoneGraveyardID(uint32 zone_id, uint32 version) { - - std::string query = StringFormat("SELECT graveyard_id FROM zone WHERE zoneidnumber='%u' AND (version=%i OR version=0) ORDER BY version DESC", zone_id, version); - auto results = QueryDatabase(query); - - if (!results.Success()) - return 0; - - if (results.RowCount() == 0) - return 0; - - auto row = results.begin(); - return atoi(row[0]); -} - bool Database::GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zoneid, float* graveyard_x, float* graveyard_y, float* graveyard_z, float* graveyard_heading) { std::string query = StringFormat("SELECT zone_id, x, y, z, heading FROM graveyard WHERE id=%i", graveyard_id); diff --git a/common/database.h b/common/database.h index b20a0c3a5..d70960e99 100644 --- a/common/database.h +++ b/common/database.h @@ -251,8 +251,6 @@ public: bool GetZoneLongName(const char* short_name, char** long_name, char* file_name = 0, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, uint32* graveyard_id = 0, uint32* maxclients = 0); bool LoadPTimers(uint32 charid, PTimerList &into); - uint32 GetZoneGraveyardID(uint32 zone_id, uint32 version); - uint8 GetPEQZone(uint32 zone_id, uint32 version); uint8 GetRaceSkill(uint8 skillid, uint8 in_race); uint8 GetServerType(); diff --git a/zone/command.cpp b/zone/command.cpp index efd259d28..3f25dbd83 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -145,7 +145,6 @@ int command_init(void) command_add("date", "[yyyy] [mm] [dd] [HH] [MM] - Set EQ time", AccountStatus::EQSupport, command_date) || command_add("dbspawn2", "[spawngroup] [respawn] [variance] - Spawn an NPC from a predefined row in the spawn2 table", AccountStatus::GMAdmin, command_dbspawn2) || command_add("delacct", "[accountname] - Delete an account", AccountStatus::GMLeadAdmin, command_delacct) || - command_add("deletegraveyard", "[zone name] - Deletes the graveyard for the specified zone.", AccountStatus::GMMgmt, command_deletegraveyard) || command_add("delpetition", "[petition number] - Delete a petition", AccountStatus::ApprenticeGuide, command_delpetition) || command_add("depop", "- Depop your NPC target", AccountStatus::Guide, command_depop) || command_add("depopzone", "- Depop the zone", AccountStatus::GMAdmin, command_depopzone) || @@ -308,7 +307,6 @@ int command_init(void) command_add("setcrystals", "[value] - Set your or your player target's available radiant or ebon crystals", AccountStatus::GMAdmin, command_setcrystals) || command_add("setendurance", "[Endurance] - Set your or your target's Endurance", AccountStatus::GMAdmin, command_setendurance) || command_add("setfaction", "[Faction ID] - Sets targeted NPC's faction in the database", AccountStatus::GMAreas, command_setfaction) || - command_add("setgraveyard", "[zone name] - Creates a graveyard for the specified zone based on your target's LOC.", AccountStatus::GMMgmt, command_setgraveyard) || command_add("sethp", "[Health] - Set your or your target's Health", AccountStatus::GMAdmin, command_sethp) || command_add("setlanguage", "[language ID] [value] - Set your target's language skillnum to value", AccountStatus::Guide, command_setlanguage) || command_add("setlsinfo", "[Email] [Password] - Set loginserver email address and password (if supported by loginserver)", AccountStatus::Steward, command_setlsinfo) || @@ -1161,7 +1159,6 @@ void command_bot(Client *c, const Seperator *sep) #include "gm_commands/date.cpp" #include "gm_commands/dbspawn2.cpp" #include "gm_commands/delacct.cpp" -#include "gm_commands/deletegraveyard.cpp" #include "gm_commands/delpetition.cpp" #include "gm_commands/depop.cpp" #include "gm_commands/depopzone.cpp" @@ -1322,7 +1319,6 @@ void command_bot(Client *c, const Seperator *sep) #include "gm_commands/setcrystals.cpp" #include "gm_commands/setendurance.cpp" #include "gm_commands/setfaction.cpp" -#include "gm_commands/setgraveyard.cpp" #include "gm_commands/sethp.cpp" #include "gm_commands/setlanguage.cpp" #include "gm_commands/setlsinfo.cpp" diff --git a/zone/command.h b/zone/command.h index b6d766d70..884a85d65 100644 --- a/zone/command.h +++ b/zone/command.h @@ -54,7 +54,6 @@ void command_databuckets(Client *c, const Seperator *sep); void command_date(Client *c, const Seperator *sep); void command_dbspawn2(Client *c, const Seperator *sep); void command_delacct(Client *c, const Seperator *sep); -void command_deletegraveyard(Client *c, const Seperator *sep); void command_delpetition(Client *c, const Seperator *sep); void command_depop(Client *c, const Seperator *sep); void command_depopzone(Client *c, const Seperator *sep); @@ -229,7 +228,6 @@ void command_setanim(Client *c, const Seperator *sep); void command_setcrystals(Client *c, const Seperator *sep); void command_setendurance(Client *c, const Seperator *sep); void command_setfaction(Client *c, const Seperator *sep); -void command_setgraveyard(Client *c, const Seperator *sep); void command_sethp(Client *c, const Seperator *sep); void command_setlanguage(Client *c, const Seperator *sep); void command_setlsinfo(Client *c, const Seperator *sep); diff --git a/zone/gm_commands/deletegraveyard.cpp b/zone/gm_commands/deletegraveyard.cpp deleted file mode 100755 index 43560eb6f..000000000 --- a/zone/gm_commands/deletegraveyard.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "../client.h" - -void command_deletegraveyard(Client *c, const Seperator *sep) -{ - uint32 zoneid = 0; - uint32 graveyard_id = 0; - - if (!sep->arg[1][0]) { - c->Message(Chat::White, "Usage: #deletegraveyard [zonename]"); - return; - } - - zoneid = ZoneID(sep->arg[1]); - graveyard_id = content_db.GetZoneGraveyardID(zoneid, 0); - - if (zoneid > 0 && graveyard_id > 0) { - if (content_db.DeleteGraveyard(zoneid, graveyard_id)) { - c->Message(Chat::White, "Successfuly deleted graveyard %u for zone %s.", graveyard_id, sep->arg[1]); - } - else { - c->Message(Chat::White, "Unable to delete graveyard %u for zone %s.", graveyard_id, sep->arg[1]); - } - } - else { - if (zoneid <= 0) { - c->Message(Chat::White, "Unable to retrieve a ZoneID for the zone: %s", sep->arg[1]); - } - else if (graveyard_id <= 0) { - c->Message(Chat::White, "Unable to retrieve a valid GraveyardID for the zone: %s", sep->arg[1]); - } - } - - return; -} - diff --git a/zone/gm_commands/setgraveyard.cpp b/zone/gm_commands/setgraveyard.cpp deleted file mode 100755 index e1b043e4b..000000000 --- a/zone/gm_commands/setgraveyard.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "../client.h" - -void command_setgraveyard(Client *c, const Seperator *sep) -{ - uint32 zoneid = 0; - uint32 graveyard_id = 0; - Client *t = c; - - if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) { - t = c->GetTarget()->CastToClient(); - } - - if (!sep->arg[1][0]) { - c->Message(Chat::White, "Usage: #setgraveyard [zonename]"); - return; - } - - zoneid = ZoneID(sep->arg[1]); - - if (zoneid > 0) { - graveyard_id = content_db.CreateGraveyardRecord(zoneid, t->GetPosition()); - - if (graveyard_id > 0) { - c->Message(Chat::White, "Successfuly added a new record for this graveyard!"); - if (content_db.AddGraveyardIDToZone(zoneid, graveyard_id) > 0) { - c->Message(Chat::White, "Successfuly added this new graveyard for the zone %s.", sep->arg[1]); - // TODO: Set graveyard data to the running zone process. - c->Message(Chat::White, "Done!"); - } - else { - c->Message(Chat::White, "Unable to add this new graveyard to the zone %s.", sep->arg[1]); - } - } - else { - c->Message(Chat::White, "Unable to create a new graveyard record in the database."); - } - } - else { - c->Message(Chat::White, "Unable to retrieve a ZoneID for the zone: %s", sep->arg[1]); - } - - return; -} - diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index c370e14ce..273898b1b 100755 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -4187,39 +4187,6 @@ bool ZoneDatabase::GetFactionIdsForNPC(uint32 nfl_id, std::listrandom.Real(-20,20)); diff --git a/zone/zonedb.h b/zone/zonedb.h index 08ded3155..122005688 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -399,17 +399,13 @@ public: bool BuryAllCharacterCorpses(uint32 charid); bool DeleteCharacterCorpse(uint32 dbid); bool SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, const glm::vec4& position); - bool SummonAllGraveyardCorpses(uint32 cur_zoneid, uint32 dest_zoneid, uint16 dest_instanceid, const glm::vec4& position); int CountCharacterCorpses(uint32 char_id); int CountCharacterCorpsesByZoneID(uint32 char_id, uint32 zone_id); bool UnburyCharacterCorpse(uint32 dbid, uint32 new_zoneid, uint16 dest_instanceid, const glm::vec4& position); bool LoadCharacterCorpses(uint32 iZoneID, uint16 iInstanceID); - bool DeleteGraveyard(uint32 zone_id, uint32 graveyard_id); uint32 GetCharacterCorpseDecayTimer(uint32 corpse_db_id); uint32 GetCharacterBuriedCorpseCount(uint32 char_id); uint32 SendCharacterCorpseToGraveyard(uint32 dbid, uint32 zoneid, uint16 instanceid, const glm::vec4& position); - uint32 CreateGraveyardRecord(uint32 graveyard_zoneid, const glm::vec4& position); - uint32 AddGraveyardIDToZone(uint32 zone_id, uint32 graveyard_id); uint32 SaveCharacterCorpse(uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, PlayerCorpse_Struct* dbpc, const glm::vec4& position, uint32 guildid); uint32 UpdateCharacterCorpse(uint32 dbid, uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, PlayerCorpse_Struct* dbpc, const glm::vec4& position, uint32 guildid, bool rezzed = false); uint32 UpdateCharacterCorpseConsent(uint32 charid, uint32 guildid);