eqemu-server/zone/combat_record.h
Alex King a244509d63
[Quest API] Export Combat Record to Death Events (#4112)
# Perl
- Add `$combat_start_time`, `$combat_end_time`, `$damage_received`, and `$healing_received` to death events for NPCs.

# Lua
- Add `e.combat_start_time`, `e.combat_end_time`, `e.damage_received`, and `e.healing_received` to death events for NPCs.

# Notes
- Allows operators to hook in to the combat record logic so they can log the start and end of combat as well as the damage/healing received over the course of the fight.
2024-02-24 22:57:49 -06:00

30 lines
744 B
C++

#ifndef EQEMU_COMBAT_RECORD_H
#define EQEMU_COMBAT_RECORD_H
#include <ctime>
#include <string>
#include "../common/types.h"
class CombatRecord {
public:
void Start(const std::string& in_mob_name);
void Stop();
bool InCombat() const;
void ProcessHPEvent(int64 hp, int64 current_hp);
double TimeInCombat() const;
float GetDamageReceivedPerSecond() const;
float GetHealedReceivedPerSecond() const;
time_t GetStartTime() const;
time_t GetEndTime() const;
int64 GetDamageReceived() const;
int64 GetHealingReceived() const;
private:
std::string m_mob_name;
time_t m_start_time = 0;
time_t m_end_time = 0;
int64 m_damage_received = 0;
int64 m_heal_received = 0;
};
#endif //EQEMU_COMBAT_RECORD_H