1
0

Support in eq2emu for respawn_offset_low respawn_offset_high to align with changes in spawn_location_placement for editor

alter table spawn_location_placement add column respawn_offset_low int(10) signed not null default 0 after respawn;
alter table spawn_location_placement add column respawn_offset_high int(10) signed not null default 0 after respawn_offset_low;
This commit is contained in:
Emagi 2024-12-19 13:02:18 -05:00
parent fe10353863
commit 7f138c5bef
5 changed files with 79 additions and 34 deletions

View File

@ -148,6 +148,8 @@ Spawn::Spawn(){
is_loot_complete = false; is_loot_complete = false;
is_loot_dispensed = false; is_loot_dispensed = false;
reset_movement = false; reset_movement = false;
respawn_offset_low = 0;
respawn_offset_high = 0;
ResetKnockedBack(); ResetKnockedBack();
} }
@ -1847,6 +1849,22 @@ void Spawn::SetRespawnTime(int32 time){
respawn = time; respawn = time;
} }
sint32 Spawn::GetRespawnOffsetLow(){
return respawn_offset_low;
}
void Spawn::SetRespawnOffsetLow(sint32 time){
respawn_offset_low = time;
}
sint32 Spawn::GetRespawnOffsetHigh(){
return respawn_offset_high;
}
void Spawn::SetRespawnOffsetHigh(sint32 time){
respawn_offset_high = time;
}
int32 Spawn::GetExpireOffsetTime(){ int32 Spawn::GetExpireOffsetTime(){
return expire_offset; return expire_offset;
} }

View File

@ -901,6 +901,11 @@ public:
int32 GetRespawnTime(); int32 GetRespawnTime();
void SetRespawnTime(int32 time); void SetRespawnTime(int32 time);
sint32 GetRespawnOffsetLow();
void SetRespawnOffsetLow(sint32 time);
sint32 GetRespawnOffsetHigh();
void SetRespawnOffsetHigh(sint32 time);
int32 GetExpireTime() { return expire_time; } int32 GetExpireTime() { return expire_time; }
void SetExpireTime(int32 new_expire_time) { expire_time = new_expire_time; } void SetExpireTime(int32 new_expire_time) { expire_time = new_expire_time; }
int32 GetExpireOffsetTime(); int32 GetExpireOffsetTime();
@ -1498,6 +1503,8 @@ private:
int32 spawn_entry_id; int32 spawn_entry_id;
int32 spawn_location_spawns_id; int32 spawn_location_spawns_id;
int32 respawn; int32 respawn;
sint32 respawn_offset_low;
sint32 respawn_offset_high;
int32 expire_time; int32 expire_time;
int32 expire_offset; int32 expire_offset;
float x_offset; float x_offset;

View File

@ -46,6 +46,8 @@ struct SpawnEntry{
int32 spawn_id; int32 spawn_id;
float spawn_percentage; float spawn_percentage;
int32 respawn; int32 respawn;
sint32 respawn_offset_low;
sint32 respawn_offset_high;
int32 expire_time; int32 expire_time;
int32 expire_offset; int32 expire_offset;
//devn00b: added spawn location overrides, added these to accomodate. //devn00b: added spawn location overrides, added these to accomodate.

View File

@ -3463,25 +3463,27 @@ int32 WorldDatabase::ProcessSpawnLocations(ZoneServer* zone, const char* sql_que
entry->spawn_id = atoul(row[9]); entry->spawn_id = atoul(row[9]);
entry->spawn_percentage = atof(row[10]); entry->spawn_percentage = atof(row[10]);
entry->respawn = atoul(row[11]); entry->respawn = atoul(row[11]);
entry->expire_time = atoul(row[14]); entry->respawn_offset_low = atoi(row[12]);
entry->expire_offset = atoul(row[15]); entry->respawn_offset_high = atoi(row[13]);
entry->expire_time = atoul(row[16]);
entry->expire_offset = atoul(row[17]);
//devn00b add stat overrides. Just a slight increase in size. Used in ZoneServer::AddNPCSpawn. //devn00b add stat overrides. Just a slight increase in size. Used in ZoneServer::AddNPCSpawn.
entry->lvl_override = atoul(row[19]); entry->lvl_override = atoul(row[21]);
entry->hp_override = atoul(row[20]); entry->hp_override = atoul(row[22]);
entry->mp_override = atoul(row[21]); entry->mp_override = atoul(row[23]);
entry->str_override = atoul(row[22]); entry->str_override = atoul(row[24]);
entry->sta_override = atoul(row[23]); entry->sta_override = atoul(row[25]);
entry->wis_override = atoul(row[24]); entry->wis_override = atoul(row[26]);
entry->int_override = atoul(row[25]); entry->int_override = atoul(row[27]);
entry->agi_override = atoul(row[26]); entry->agi_override = atoul(row[28]);
entry->heat_override = atoul(row[27]); entry->heat_override = atoul(row[29]);
entry->cold_override = atoul(row[28]); entry->cold_override = atoul(row[30]);
entry->magic_override = atoul(row[29]); entry->magic_override = atoul(row[31]);
entry->mental_override = atoul(row[30]); entry->mental_override = atoul(row[32]);
entry->divine_override = atoul(row[31]); entry->divine_override = atoul(row[33]);
entry->disease_override = atoul(row[32]); entry->disease_override = atoul(row[34]);
entry->poison_override = atoul(row[33]); entry->poison_override = atoul(row[35]);
entry->difficulty_override = atoul(row[34]); entry->difficulty_override = atoul(row[36]);
spawn_location->x = atof(row[2]); spawn_location->x = atof(row[2]);
spawn_location->y = atof(row[3]); spawn_location->y = atof(row[3]);
spawn_location->z = atof(row[4]); spawn_location->z = atof(row[4]);
@ -3489,12 +3491,12 @@ int32 WorldDatabase::ProcessSpawnLocations(ZoneServer* zone, const char* sql_que
spawn_location->y_offset = atof(row[6]); spawn_location->y_offset = atof(row[6]);
spawn_location->z_offset = atof(row[7]); spawn_location->z_offset = atof(row[7]);
spawn_location->heading = atof(row[8]); spawn_location->heading = atof(row[8]);
spawn_location->pitch = atof(row[16]); spawn_location->pitch = atof(row[18]);
spawn_location->roll = atof(row[17]); spawn_location->roll = atof(row[19]);
spawn_location->conditional = atoi(row[18]); spawn_location->conditional = atoi(row[20]);
spawn_location->total_percentage += entry->spawn_percentage; spawn_location->total_percentage += entry->spawn_percentage;
spawn_location->grid_id = strtoul(row[12], NULL, 0); spawn_location->grid_id = strtoul(row[14], NULL, 0);
spawn_location->placement_id = strtoul(row[13], NULL, 0); spawn_location->placement_id = strtoul(row[15], NULL, 0);
spawn_location->AddSpawn(entry); spawn_location->AddSpawn(entry);
} }
@ -3533,21 +3535,21 @@ void WorldDatabase::LoadSpawns(ZoneServer* zone)
LogWrite(SPAWN__TRACE, 0, "Spawn", "Enter LoadSpawns"); LogWrite(SPAWN__TRACE, 0, "Spawn", "Enter LoadSpawns");
if(zone->GetInstanceID() == 0) { if(zone->GetInstanceID() == 0) {
npcs = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_npcs sn where sn.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%u and slp.instance_id=%u ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_NPC); npcs = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.respawn_offset_low, slp.respawn_offset_high, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_npcs sn where sn.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%u and slp.instance_id=%u ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_NPC);
objects = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_objects so where so.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%u and slp.instance_id=%u ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_OBJECT); objects = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.respawn_offset_low, slp.respawn_offset_high, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_objects so where so.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%u and slp.instance_id=%u ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_OBJECT);
widgets = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_widgets sw where sw.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%u and slp.instance_id=%u ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_WIDGET); widgets = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.respawn_offset_low, slp.respawn_offset_high, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_widgets sw where sw.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%u and slp.instance_id=%u ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_WIDGET);
signs = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_signs ss where ss.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%u and slp.instance_id=%u ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_SIGN); signs = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.respawn_offset_low, slp.respawn_offset_high, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_signs ss where ss.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%u and slp.instance_id=%u ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_SIGN);
ground_spawns = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_ground sg where sg.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%u and slp.instance_id=%u ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_GROUNDSPAWN); ground_spawns = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.respawn_offset_low, slp.respawn_offset_high, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_ground sg where sg.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%u and slp.instance_id=%u ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_GROUNDSPAWN);
spawn_groups = LoadSpawnLocationGroups(zone); spawn_groups = LoadSpawnLocationGroups(zone);
spawn_group_associations = LoadSpawnLocationGroupAssociations(zone); spawn_group_associations = LoadSpawnLocationGroupAssociations(zone);
spawn_group_chances = LoadSpawnGroupChances(zone); spawn_group_chances = LoadSpawnGroupChances(zone);
} }
else { else {
npcs = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_npcs sn where sn.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%i and (slp.instance_id = 0 or slp.instance_id=%u) ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_NPC); npcs = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.respawn_offset_low, slp.respawn_offset_high, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_npcs sn where sn.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%i and (slp.instance_id = 0 or slp.instance_id=%u) ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_NPC);
objects = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_objects so where so.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%i and (slp.instance_id = 0 or slp.instance_id=%u) ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_OBJECT); objects = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.respawn_offset_low, slp.respawn_offset_high, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_objects so where so.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%i and (slp.instance_id = 0 or slp.instance_id=%u) ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_OBJECT);
widgets = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_widgets sw where sw.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%i and (slp.instance_id = 0 or slp.instance_id=%u) ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_WIDGET); widgets = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.respawn_offset_low, slp.respawn_offset_high, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_widgets sw where sw.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%i and (slp.instance_id = 0 or slp.instance_id=%u) ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_WIDGET);
signs = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_signs ss where ss.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%i and (slp.instance_id = 0 or slp.instance_id=%u) ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_SIGN); signs = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.respawn_offset_low, slp.respawn_offset_high, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_signs ss where ss.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%i and (slp.instance_id = 0 or slp.instance_id=%u) ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_SIGN);
ground_spawns = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_ground sg where sg.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%i and (slp.instance_id = 0 or slp.instance_id=%u) ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_GROUNDSPAWN); ground_spawns = ProcessSpawnLocations(zone, "SELECT sln.id, sle.id, slp.x, slp.y, slp.z, slp.x_offset, slp.y_offset, slp.z_offset, slp.heading, sle.spawn_id, sle.spawnpercentage, slp.respawn, slp.respawn_offset_low, slp.respawn_offset_high, slp.grid_id, slp.id, slp.expire_timer, slp.expire_offset, slp.pitch, slp.roll, sle.condition, slp.lvl_override, slp.hp_override, slp.mp_override, slp.str_override, slp.sta_override, slp.wis_override, slp.int_override, slp.agi_override, slp.heat_override, slp.cold_override, slp.magic_override, slp.mental_override, slp.divine_override, slp.disease_override, slp.poison_override, difficulty_override FROM spawn_location_placement slp, spawn_location_name sln, spawn_location_entry sle, spawn_ground sg where sg.spawn_id = sle.spawn_id and sln.id = sle.spawn_location_id and sln.id = slp.spawn_location_id and slp.zone_id=%i and (slp.instance_id = 0 or slp.instance_id=%u) ORDER BY sln.id, sle.id", SPAWN_ENTRY_TYPE_GROUNDSPAWN);
spawn_groups = LoadSpawnLocationGroups(zone); spawn_groups = LoadSpawnLocationGroups(zone);
spawn_group_associations = LoadSpawnLocationGroupAssociations(zone); spawn_group_associations = LoadSpawnLocationGroupAssociations(zone);
spawn_group_chances = LoadSpawnGroupChances(zone); spawn_group_chances = LoadSpawnGroupChances(zone);

View File

@ -2992,6 +2992,8 @@ NPC* ZoneServer::AddNPCSpawn(SpawnLocation* spawnlocation, SpawnEntry* spawnentr
npc->SetSpawnLocationID(spawnentry->spawn_location_id); npc->SetSpawnLocationID(spawnentry->spawn_location_id);
npc->SetSpawnEntryID(spawnentry->spawn_entry_id); npc->SetSpawnEntryID(spawnentry->spawn_entry_id);
npc->SetRespawnTime(spawnentry->respawn); npc->SetRespawnTime(spawnentry->respawn);
npc->SetRespawnOffsetLow(spawnentry->respawn_offset_low);
npc->SetRespawnOffsetHigh(spawnentry->respawn_offset_high);
npc->SetExpireTime(spawnentry->expire_time); npc->SetExpireTime(spawnentry->expire_time);
//devn00b add overrides for some spawns //devn00b add overrides for some spawns
@ -3413,6 +3415,8 @@ Sign* ZoneServer::AddSignSpawn(SpawnLocation* spawnlocation, SpawnEntry* spawnen
sign->SetSpawnLocationID(spawnentry->spawn_location_id); sign->SetSpawnLocationID(spawnentry->spawn_location_id);
sign->SetSpawnEntryID(spawnentry->spawn_entry_id); sign->SetSpawnEntryID(spawnentry->spawn_entry_id);
sign->SetRespawnTime(spawnentry->respawn); sign->SetRespawnTime(spawnentry->respawn);
sign->SetRespawnOffsetLow(spawnentry->respawn_offset_low);
sign->SetRespawnOffsetHigh(spawnentry->respawn_offset_high);
sign->SetExpireTime(spawnentry->expire_time); sign->SetExpireTime(spawnentry->expire_time);
if (spawnentry->expire_time > 0) if (spawnentry->expire_time > 0)
AddSpawnExpireTimer(sign, spawnentry->expire_time, spawnentry->expire_offset); AddSpawnExpireTimer(sign, spawnentry->expire_time, spawnentry->expire_offset);
@ -3442,6 +3446,8 @@ Widget* ZoneServer::AddWidgetSpawn(SpawnLocation* spawnlocation, SpawnEntry* spa
widget->SetZ(widget->GetWidgetZ()); widget->SetZ(widget->GetWidgetZ());
} }
widget->SetRespawnTime(spawnentry->respawn); widget->SetRespawnTime(spawnentry->respawn);
widget->SetRespawnOffsetLow(spawnentry->respawn_offset_low);
widget->SetRespawnOffsetHigh(spawnentry->respawn_offset_high);
widget->SetExpireTime(spawnentry->expire_time); widget->SetExpireTime(spawnentry->expire_time);
widget->SetSpawnOrigHeading(widget->GetHeading()); widget->SetSpawnOrigHeading(widget->GetHeading());
if (spawnentry->expire_time > 0) if (spawnentry->expire_time > 0)
@ -3466,6 +3472,8 @@ Object* ZoneServer::AddObjectSpawn(SpawnLocation* spawnlocation, SpawnEntry* spa
object->SetSpawnLocationID(spawnentry->spawn_location_id); object->SetSpawnLocationID(spawnentry->spawn_location_id);
object->SetSpawnEntryID(spawnentry->spawn_entry_id); object->SetSpawnEntryID(spawnentry->spawn_entry_id);
object->SetRespawnTime(spawnentry->respawn); object->SetRespawnTime(spawnentry->respawn);
object->SetRespawnOffsetLow(spawnentry->respawn_offset_low);
object->SetRespawnOffsetHigh(spawnentry->respawn_offset_high);
object->SetExpireTime(spawnentry->expire_time); object->SetExpireTime(spawnentry->expire_time);
if (spawnentry->expire_time > 0) if (spawnentry->expire_time > 0)
AddSpawnExpireTimer(object, spawnentry->expire_time, spawnentry->expire_offset); AddSpawnExpireTimer(object, spawnentry->expire_time, spawnentry->expire_offset);
@ -3489,6 +3497,8 @@ GroundSpawn* ZoneServer::AddGroundSpawn(SpawnLocation* spawnlocation, SpawnEntry
spawn->SetSpawnLocationID(spawnentry->spawn_location_id); spawn->SetSpawnLocationID(spawnentry->spawn_location_id);
spawn->SetSpawnEntryID(spawnentry->spawn_entry_id); spawn->SetSpawnEntryID(spawnentry->spawn_entry_id);
spawn->SetRespawnTime(spawnentry->respawn); spawn->SetRespawnTime(spawnentry->respawn);
spawn->SetRespawnOffsetLow(spawnentry->respawn_offset_low);
spawn->SetRespawnOffsetHigh(spawnentry->respawn_offset_high);
spawn->SetExpireTime(spawnentry->expire_time); spawn->SetExpireTime(spawnentry->expire_time);
if(spawn->GetRandomizeHeading()) { if(spawn->GetRandomizeHeading()) {
@ -9268,7 +9278,13 @@ void ZoneServer::AddIgnoredWidget(int32 id) {
} }
void ZoneServer::AddRespawn(Spawn* spawn) { void ZoneServer::AddRespawn(Spawn* spawn) {
AddRespawn(spawn->GetSpawnLocationID(), spawn->GetRespawnTime()); int32 respawn_time = spawn->GetRespawnTime();
if(spawn->GetRespawnOffsetLow() != 0 || spawn->GetRespawnOffsetHigh() != 0) {
int random_offset = MakeRandomInt(spawn->GetRespawnOffsetLow(), spawn->GetRespawnOffsetHigh());
int result_time = static_cast<int>(respawn_time) + random_offset;
respawn_time = static_cast<unsigned>(std::max(result_time, 0));
}
AddRespawn(spawn->GetSpawnLocationID(), respawn_time);
} }
void ZoneServer::AddRespawn(int32 locationID, int32 respawnTime) { void ZoneServer::AddRespawn(int32 locationID, int32 respawnTime) {