im trying to get corpse summoning to work so im messing with SummonBurriedPlayerCorpse quest command i changed it to not read if there IsBurried (not changed here) but anyways it works great but the bodys are still there if the zone never reloads.. so if players are in the zone or whatever all the bodys you summoned get summoned to the npc running this command plus stay in the zone where you died meaning you can dupe items. is there a way to remove the body's from the zone there in before making the new body.
i know you can get the zone the old body was in by getting the zone id from the database. i just don't know how to remove it.
this is the code to summon them
playercorpse.cpp
Code:
Corpse* ZoneDatabase::SummonBurriedPlayerCorpse(int32 char_id, int32 dest_zoneid, float dest_x, float dest_y, float dest_z, float dest_heading) {
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
MYSQL_RES *result;
MYSQL_ROW row;
Corpse* NewCorpse = 0;
unsigned long* lengths;
if (RunQuery(query, MakeAnyLenString(&query, "SELECT id, charname, data, timeofdeath, rezzed FROM player_corpses WHERE charid='%u' AND IsBurried=1 ORDER BY timeofdeath LIMIT 1", char_id), errbuf, &result)) {
row = mysql_fetch_row(result);
lengths = mysql_fetch_lengths(result);
if(row) {
NewCorpse = Corpse::LoadFromDBData(atoi(row[0]), char_id, row[1], (uchar*) row[2], lengths[2], dest_x, dest_y, dest_z, dest_heading, row[3],atoi(row[4])==1, false);
if(NewCorpse) {
entity_list.AddCorpse(NewCorpse);
if(!UnburyPlayerCorpse(NewCorpse->GetDBID(), dest_zoneid, dest_x, dest_y, dest_z, dest_heading))
LogFile->write(EQEMuLog::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id);
}
else
LogFile->write(EQEMuLog::Error, "Unable to construct a player corpse from a burried player corpse for character id %u.", char_id);
}
mysql_free_result(result);
}
else {
cerr << "Error in SummonBurriedPlayerCorpse query '" << query << "' " << errbuf << endl;
}
safe_delete_array(query);
return NewCorpse;
}