mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[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.
This commit is contained in:
parent
efd04f8324
commit
e69f7a6cf1
@ -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);
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -4187,39 +4187,6 @@ bool ZoneDatabase::GetFactionIdsForNPC(uint32 nfl_id, std::list<struct NPCFactio
|
||||
|
||||
/* Corpse Queries */
|
||||
|
||||
bool ZoneDatabase::DeleteGraveyard(uint32 zone_id, uint32 graveyard_id) {
|
||||
std::string query = StringFormat( "UPDATE `zone` SET `graveyard_id` = 0 WHERE `zone_idnumber` = %u AND `version` = 0", zone_id);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
query = StringFormat("DELETE FROM `graveyard` WHERE `id` = %u", graveyard_id);
|
||||
auto results2 = QueryDatabase(query);
|
||||
|
||||
if (results.Success() && results2.Success()){
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 ZoneDatabase::AddGraveyardIDToZone(uint32 zone_id, uint32 graveyard_id) {
|
||||
std::string query = StringFormat(
|
||||
"UPDATE `zone` SET `graveyard_id` = %u WHERE `zone_idnumber` = %u AND `version` = 0",
|
||||
graveyard_id, zone_id
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
return zone_id;
|
||||
}
|
||||
|
||||
uint32 ZoneDatabase::CreateGraveyardRecord(uint32 graveyard_zone_id, const glm::vec4& position) {
|
||||
std::string query = StringFormat("INSERT INTO `graveyard` "
|
||||
"SET `zone_id` = %u, `x` = %1.1f, `y` = %1.1f, `z` = %1.1f, `heading` = %1.1f",
|
||||
graveyard_zone_id, position.x, position.y, position.z, position.w);
|
||||
auto results = QueryDatabase(query);
|
||||
if (results.Success())
|
||||
return results.LastInsertedID();
|
||||
|
||||
return 0;
|
||||
}
|
||||
uint32 ZoneDatabase::SendCharacterCorpseToGraveyard(uint32 dbid, uint32 zone_id, uint16 instance_id, const glm::vec4& position) {
|
||||
|
||||
double xcorpse = (position.x + zone->random.Real(-20,20));
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user