this also just loads into entity_list, not really into zone
| 357 | |
| 358 | //this also just loads into entity_list, not really into zone |
| 359 | bool Zone::LoadGroundSpawns() { |
| 360 | GroundSpawns g{}; |
| 361 | |
| 362 | content_db.LoadGroundSpawns(zoneid, GetInstanceVersion(), &g); |
| 363 | |
| 364 | uint32 added = 0; |
| 365 | |
| 366 | for (uint16 slot_id = 0; slot_id < 50; slot_id++) { |
| 367 | if (EQ::ValueWithin(g.spawn[slot_id].item_id, 1, (SAYLINK_ITEM_ID - 1))) { |
| 368 | auto inst = database.CreateItem(g.spawn[slot_id].item_id); |
| 369 | |
| 370 | const uint32 max_allowed = g.spawn[slot_id].max_allowed; |
| 371 | |
| 372 | if (inst) { |
| 373 | for (uint32 i = 0; i < max_allowed; i++) { |
| 374 | auto object = new Object( |
| 375 | inst, |
| 376 | g.spawn[slot_id].name, |
| 377 | g.spawn[slot_id].max_x, |
| 378 | g.spawn[slot_id].min_x, |
| 379 | g.spawn[slot_id].max_y, |
| 380 | g.spawn[slot_id].min_y, |
| 381 | g.spawn[slot_id].max_z, |
| 382 | g.spawn[slot_id].heading, |
| 383 | g.spawn[slot_id].respawn_timer, |
| 384 | g.spawn[slot_id].fix_z |
| 385 | ); |
| 386 | |
| 387 | entity_list.AddObject(object, false); |
| 388 | |
| 389 | added++; |
| 390 | } |
| 391 | |
| 392 | safe_delete(inst); |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | LogInfo( |
| 398 | "Loaded [{}] Ground Spawn{}", |
| 399 | Strings::Commify(added), |
| 400 | added != 1 ? "s" : "" |
| 401 | ); |
| 402 | |
| 403 | return(true); |
| 404 | } |
| 405 | |
| 406 | int Zone::SaveTempItem(uint32 merchantid, uint32 npcid, uint32 item, int32 charges, bool sold) { |
| 407 |
nothing calls this directly
no test coverage detected