mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-17 10:21:28 +00:00
SummonBuriedCharacterCorpses converted to xyz_heading
This commit is contained in:
parent
efc4ba0e27
commit
dd5265dc02
@ -8522,7 +8522,7 @@ void command_summonburriedplayercorpse(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Corpse* PlayerCorpse = database.SummonBuriedCharacterCorpses(t->CharacterID(), t->GetZoneID(), zone->GetInstanceID(), t->GetX(), t->GetY(), t->GetZ(), t->GetHeading());
|
Corpse* PlayerCorpse = database.SummonBuriedCharacterCorpses(t->CharacterID(), t->GetZoneID(), zone->GetInstanceID(), t->GetPosition());
|
||||||
|
|
||||||
if(!PlayerCorpse)
|
if(!PlayerCorpse)
|
||||||
c->Message(0, "Your target doesn't have any burried corpses.");
|
c->Message(0, "Your target doesn't have any burried corpses.");
|
||||||
|
|||||||
@ -1740,7 +1740,7 @@ bool QuestManager::summonburriedplayercorpse(uint32 char_id, const xyz_heading&
|
|||||||
if(char_id <= 0)
|
if(char_id <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Corpse* PlayerCorpse = database.SummonBuriedCharacterCorpses(char_id, zone->GetZoneID(), zone->GetInstanceID(), position.m_X, position.m_Y, position.m_Z, position.m_Heading);
|
Corpse* PlayerCorpse = database.SummonBuriedCharacterCorpses(char_id, zone->GetZoneID(), zone->GetInstanceID(), position);
|
||||||
if(!PlayerCorpse)
|
if(!PlayerCorpse)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@ -3771,37 +3771,39 @@ bool ZoneDatabase::LoadCharacterCorpseData(uint32 corpse_id, PlayerCorpse_Struct
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_zone_id, uint16 dest_instance_id, float dest_x, float dest_y, float dest_z, float dest_heading) {
|
Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_zone_id, uint16 dest_instance_id, const xyz_heading& position) {
|
||||||
Corpse* NewCorpse = 0;
|
Corpse* corpse = nullptr;
|
||||||
std::string query = StringFormat(
|
std::string query = StringFormat("SELECT `id`, `charname`, `time_of_death`, `is_rezzed` "
|
||||||
"SELECT `id`, `charname`, `time_of_death`, `is_rezzed` FROM `character_corpses` WHERE `charid` = '%u' AND `is_buried` = 1 ORDER BY `time_of_death` LIMIT 1",
|
"FROM `character_corpses` "
|
||||||
char_id
|
"WHERE `charid` = '%u' AND `is_buried` = 1 "
|
||||||
);
|
"ORDER BY `time_of_death` LIMIT 1",
|
||||||
|
char_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
NewCorpse = Corpse::LoadFromDBData(
|
corpse = Corpse::LoadFromDBData(
|
||||||
atoll(row[0]), // uint32 in_dbid
|
atoll(row[0]), // uint32 in_dbid
|
||||||
char_id, // uint32 in_charid
|
char_id, // uint32 in_charid
|
||||||
row[1], // char* in_charname
|
row[1], // char* in_charname
|
||||||
dest_x, // float in_x
|
position.m_X, // float in_x
|
||||||
dest_y, // float in_y
|
position.m_Y, // float in_y
|
||||||
dest_z, // float in_z
|
position.m_Z, // float in_z
|
||||||
dest_heading, // float in_heading
|
position.m_Heading, // float in_heading
|
||||||
row[2], // char* time_of_death
|
row[2], // char* time_of_death
|
||||||
atoi(row[3]) == 1, // bool rezzed
|
atoi(row[3]) == 1, // bool rezzed
|
||||||
false // bool was_at_graveyard
|
false // bool was_at_graveyard
|
||||||
);
|
);
|
||||||
if (NewCorpse) {
|
if (!corpse)
|
||||||
entity_list.AddCorpse(NewCorpse);
|
continue;
|
||||||
NewCorpse->SetDecayTimer(RuleI(Character, CorpseDecayTimeMS));
|
|
||||||
NewCorpse->Spawn();
|
entity_list.AddCorpse(corpse);
|
||||||
if (!UnburyCharacterCorpse(NewCorpse->GetDBID(), dest_zone_id, dest_instance_id, dest_x, dest_y, dest_z, dest_heading))
|
corpse->SetDecayTimer(RuleI(Character, CorpseDecayTimeMS));
|
||||||
|
corpse->Spawn();
|
||||||
|
if (!UnburyCharacterCorpse(corpse->GetDBID(), dest_zone_id, dest_instance_id, position.m_X, position.m_Y, position.m_Z, position.m_Heading))
|
||||||
LogFile->write(EQEMuLog::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id);
|
LogFile->write(EQEMuLog::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return NewCorpse;
|
return corpse;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id, uint16 dest_instance_id, float dest_x, float dest_y, float dest_z, float dest_heading) {
|
bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id, uint16 dest_instance_id, float dest_x, float dest_y, float dest_z, float dest_heading) {
|
||||||
|
|||||||
@ -297,7 +297,7 @@ public:
|
|||||||
uint32 GetCharacterCorpseItemCount(uint32 corpse_id);
|
uint32 GetCharacterCorpseItemCount(uint32 corpse_id);
|
||||||
bool LoadCharacterCorpseData(uint32 corpse_id, PlayerCorpse_Struct* pcs);
|
bool LoadCharacterCorpseData(uint32 corpse_id, PlayerCorpse_Struct* pcs);
|
||||||
Corpse* LoadCharacterCorpse(uint32 player_corpse_id);
|
Corpse* LoadCharacterCorpse(uint32 player_corpse_id);
|
||||||
Corpse* SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, float dest_x, float dest_y, float dest_z, float dest_heading);
|
Corpse* SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, const xyz_heading& position);
|
||||||
void MarkCorpseAsRezzed(uint32 dbid);
|
void MarkCorpseAsRezzed(uint32 dbid);
|
||||||
bool GetDecayTimes(npcDecayTimes_Struct* npcCorpseDecayTimes);
|
bool GetDecayTimes(npcDecayTimes_Struct* npcCorpseDecayTimes);
|
||||||
bool BuryCharacterCorpse(uint32 dbid);
|
bool BuryCharacterCorpse(uint32 dbid);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user