-
Notifications
You must be signed in to change notification settings - Fork 1
/
globals.cpp
38 lines (33 loc) · 1.03 KB
/
globals.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "pch.h"
#include "globals.h"
std::ofstream logs;
int logs_enabled = 0;
pugi::xml_document h5_stats;
// game funcs
SkillIdFromStrFunc skill_id_from_str = (SkillIdFromStrFunc)0x009F5C90;
ReturnMasteryIdFunc mastery_id_from_str = (ReturnMasteryIdFunc)0x00ACFEF0;
ReturnSpellIdFunc spell_id_from_str = (ReturnSpellIdFunc)0x009F29C0;
IsSpellEmpoweredFunc is_spell_empowered = (IsSpellEmpoweredFunc)0x00A34100;
void initLog() {
if (logs_enabled) {
logs.open("H5.log");
logs.close();
}
}
void writeLog(const char* type, const std::string& message) {
if (logs_enabled) {
logs.open("H5.log", std::ios::app);
if (logs.is_open()) {
logs << type << message << std::endl;
logs.close();
}
}
}
int spell_id_from_str_precursor(std::string spell_name)
{
int spell_address[2];
spell_address[0] = reinterpret_cast<int>(&spell_name[0]);
spell_address[1] = spell_address[0] + spell_name.size();
int spell_id = spell_id_from_str(spell_address);
return spell_id;
}