void EntityList::ClearTrapPointers() { auto it = trap_list.begin(); while (it != trap_list.end()) { Trap* cur = it->second; if (cur->IsTrap()) { cur->DestroyHiddenTrigger(); } ++it; } }
void EntityList::UpdateAllTraps(bool respawn, bool repopnow) { auto it = trap_list.begin(); while (it != trap_list.end()) { Trap* cur = it->second; if (cur->IsTrap()) { cur->UpdateTrap(respawn, repopnow); } ++it; } Log.Out(Logs::General, Logs::Traps, "All traps updated."); }
bool EntityList::IsTrapGroupSpawned(uint32 trap_id, uint8 group) { auto it = trap_list.begin(); while (it != trap_list.end()) { Trap* cur = it->second; if (cur->IsTrap() && cur->group == group && cur->trap_id != trap_id) { return true; } ++it; } return false; }
void EntityList::GetTrapInfo(Client* client) { uint8 count = 0; auto it = trap_list.begin(); while (it != trap_list.end()) { Trap* cur = it->second; if (cur->IsTrap()) { bool isset = (cur->chkarea_timer.Enabled() && !cur->reset_timer.Enabled()); client->Message(CC_Default, " Trap: (%d) found at %0.2f,%0.2f,%0.2f. Times Triggered: %d Is Active: %d Group: %d Message: %s", cur->trap_id, cur->m_Position.x, cur->m_Position.y, cur->m_Position.z, cur->times_triggered, isset, cur->group, cur->message.c_str()); ++count; } ++it; } client->Message(CC_Default, "%d traps found.", count); }