forked from leftspace89/pPlat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAttackableUnit.h
67 lines (55 loc) · 2.19 KB
/
AttackableUnit.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#ifndef ATTACKABLEUNIT
#define ATTACKABLEUNIT
class
DLLEXPORT AttackableUnit : public GameObject
{
public:
static bool ApplyHooks();
MAKE_GET(ArmorMaterial, std::string, Offsets::oAttackableUnit::ArmorMaterial);
MAKE_GET(AttackShield, float, Offsets::oAttackableUnit::AttackShield);
MAKE_GET(HasBotAI, bool, Offsets::oAttackableUnit::HasBotAI);
MAKE_GET(Health, float, Offsets::oAttackableUnit::Health);
MAKE_GET(IsBot, bool, Offsets::oAttackableUnit::IsBot);
MAKE_GET(IsInvulnerable, bool, Offsets::oAttackableUnit::IsInVulnerable);
MAKE_GET(IsLifestealImmune, bool, Offsets::oAttackableUnit::IsLifestealImmune);
MAKE_GET(IsPhysicalImmune, bool, Offsets::oAttackableUnit::IsPhysicalImmune);
MAKE_GET(IsZombie, bool, Offsets::oAttackableUnit::IsZombie);
MAKE_GET(MagicImmune, bool, Offsets::oAttackableUnit::MagicImmune);
MAKE_GET(AllShield, float, Offsets::oAttackableUnit::AllShield);
MAKE_GET(MagicShield, float, Offsets::oAttackableUnit::MagicShield);
MAKE_GET(Mana, float, Offsets::oAttackableUnit::Mana);
MAKE_GET(MaxHealth, float, Offsets::oAttackableUnit::MaxHealth);
MAKE_GET(MaxMana, float, Offsets::oAttackableUnit::MaxMana);
MAKE_GET(OverrideCollisionHeight, float, Offsets::oAttackableUnit::OverrideCollisionHeight);
MAKE_GET(OverrideCollisionRadius, float, Offsets::oAttackableUnit::OverrideCollisionRadius);
MAKE_GET(PathfindingCollisionRadius, float, Offsets::oAttackableUnit::PathfindingCollisionRadius);
MAKE_GET(WeaponMaterial, std::string, Offsets::oAttackableUnit::WeaponMaterial);
MAKE_GET(Direction, RVector3, Offsets::oAttackableUnit::Direction);
bool IsMelee()
{
return *reinterpret_cast<byte*>(this + static_cast<int>(Offsets::Obj_AIBase::CombatType)) == 1;
}
bool IsRanged()
{
return *reinterpret_cast<byte*>(this + static_cast<int>(Offsets::Obj_AIBase::CombatType)) == 2;
}
bool IsAttackingPlayer()
{
return false;
}
float AttackableUnit::GetHealthPercent()
{
if (*this->GetHealth() <= 0)
return 0;
return *this->GetHealth() * 100 / *this->GetMaxHealth();
}
float AttackableUnit::GetManaPercent()
{
if (!this
|| *this->GetIsDead()
|| *this->GetMana() == 0) return 0;
return *this->GetMana() * 100 / *this->GetMaxMana();
}
};
#endif