void PlayerLogger::LogLooting(LootSourceType type, ObjectGuid const & droppedBy, ObjectGuid const & itemGuid, uint32 id) { if (!IsLoggingActive(PLAYER_LOGMASK_LOOTING)) return; PlayerLogLooting log = PlayerLogLooting(sWorld.GetUptime()); log.itemEntry = itemGuid.GetEntry(); log.SetLootSourceType(type); log.itemGuid = itemGuid.GetCounter(); log.droppedBy = droppedBy.IsEmpty() ? id : droppedBy.GetEntry(); ((std::vector<PlayerLogLooting>*)(data[PLAYER_LOG_LOOTING]))->push_back(log); }
void PlayerLogger::LogKilling(bool killedEnemy, ObjectGuid const & unitGuid) { if (!IsLoggingActive(PLAYER_LOGMASK_KILL)) return; PlayerLogKilling log = PlayerLogKilling(sWorld.GetUptime()); log.unitEntry = unitGuid.GetEntry(); log.SetKill(killedEnemy); log.unitGuid = unitGuid.GetCounter(); ((std::vector<PlayerLogKilling>*)(data[PLAYER_LOG_KILL]))->push_back(log); }
void PlayerLogger::LogTrading(bool aquire, ObjectGuid const & partner, ObjectGuid const & itemGuid) { if (!IsLoggingActive(PLAYER_LOGMASK_TRADE)) return; PlayerLogTrading log = PlayerLogTrading(sWorld.GetUptime()); log.itemEntry = itemGuid.GetEntry(); log.SetItemAquired(aquire); log.itemGuid = itemGuid.GetCounter(); log.partner = partner.GetCounter(); ((std::vector<PlayerLogTrading>*)(data[PLAYER_LOG_TRADE]))->push_back(log); }
Team BattleGroundIC::GetSpawnTeamFor(ObjectGuid const& guid) const { if (guid.IsEmpty() || !guid.HasEntry()) return TEAM_NONE; switch (guid.GetEntry()) { case VEHICLE_IC_DEMOLISHER: case VEHICLE_IC_DEMOLISHER_1: { if (m_Nodes[BG_IC_NODE_WORKSHOP] == BG_IC_NODE_STATUS_ALLY_OCCUPIED) return ALLIANCE; else if (m_Nodes[BG_IC_NODE_WORKSHOP] == BG_IC_NODE_STATUS_HORDE_OCCUPIED) return HORDE; break; } case VEHICLE_IC_CATAPULT: case VEHICLE_IC_CATAPULT_1: { if (m_Nodes[BG_IC_NODE_DOCKS] == BG_IC_NODE_STATUS_ALLY_OCCUPIED) return ALLIANCE; else if (m_Nodes[BG_IC_NODE_DOCKS] == BG_IC_NODE_STATUS_HORDE_OCCUPIED) return HORDE; break; } case VEHICLE_IC_CANNON: case VEHICLE_IC_CANNON_1: { WorldObject const* obj = const_cast<BattleGroundIC*>(this)->GetBgMap()->GetWorldObject(guid); if (obj) // simplest way to determine factions Ive found return (obj->GetPositionX() > 1000.0f) ? HORDE : ALLIANCE; break; } case VEHICLE_IC_GLAIVE_A: return ALLIANCE; case VEHICLE_IC_GLAIVE_H: return HORDE; default: break; } return TEAM_INVALID; }
Team BattleGroundSA::GetSpawnTeamFor(ObjectGuid const& guid) const override { if (guid.IsEmpty() || !guid.HasEntry()) return TEAM_NONE; switch (guid.GetEntry()) { case VEHICLE_SA_DEMOLISHER: case VEHICLE_SA_DEMOLISHER_1: return GetDefender() == ALLIANCE ? HORDE : ALLIANCE; case VEHICLE_SA_CANNON: case VEHICLE_SA_CANNON_1: return GetDefender() == ALLIANCE ? ALLIANCE : HORDE; default: break; } return TEAM_NONE; }
void PlayerLogger::LogDamage(bool done, uint16 damage, uint16 heal, ObjectGuid const & unitGuid, uint16 spell) { if (!IsLoggingActive(done ? PLAYER_LOGMASK_DAMAGE_DONE : PLAYER_LOGMASK_DAMAGE_GET)) return; PlayerLogDamage log = PlayerLogDamage(sWorld.GetUptime()); log.dmgUnit = (unitGuid.GetCounter() == playerGuid) ? 0 : (unitGuid.IsPlayer() ? unitGuid.GetCounter() : unitGuid.GetEntry()); log.SetCreature(unitGuid.IsCreatureOrPet()); log.damage = damage > 0 ? int16(damage) : -int16(heal); log.spell = spell; ((std::vector<PlayerLogDamage>*)(data[done ? PLAYER_LOG_DAMAGE_DONE : PLAYER_LOG_DAMAGE_GET]))->push_back(log); }