-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHealing.cpp
More file actions
46 lines (36 loc) · 1.07 KB
/
Healing.cpp
File metadata and controls
46 lines (36 loc) · 1.07 KB
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
39
40
41
42
43
44
45
46
#include "stdafx.h"
#include "Healing.h"
using namespace std;
Healing::Healing(Aux_function& aux_arg) : aux(aux_arg) {
this->update_flag = false;
}
void Healing::scan_packet(std::vector<unsigned char>& arr) {
for (int i = 0; i < (int)arr.size() - 22; i++) {
if (*(unsigned int*)&arr[i] == 0x26262722 && arr[i + 5] == 0x69) {
this->health = *(unsigned int*)&arr[i + 9];
this->max_health = *(unsigned int*)&arr[i + 13];
this->mana = *(unsigned int*)&arr[i + 17];
this->max_mana = *(unsigned int*)&arr[i + 21];
cout << "HP: " << this->health << endl;
cout << "MP: " << this->mana << endl;
}
}
}
unsigned int Healing::get_health() const {
return this->health;
}
unsigned int Healing::get_mana() const {
return this->mana;
}
unsigned int Healing::get_max_health() const {
return this->max_health;
}
unsigned int Healing::get_max_mana() const {
return this->max_mana;
}
void Healing::set_update_flag(bool f) {
this->update_flag = f;
}
bool Healing::get_update_flag() const {
return this->update_flag;
}