forked from leftspace89/pPlat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLBuffInstance.cpp
120 lines (104 loc) · 2.93 KB
/
LBuffInstance.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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include "LBuffInstance.h"
#include "Obj_AI_Base.h"
Obj_AI_Base* GetAttackableUnitByNetworkID(uint id)
{
return (Obj_AI_Base*)MAKEPTR(Offsets::ObjectManager::LocalPlayer);
}
#ifdef yedekamanhayarramıyesinbuyedekolsunamk
BuffInstance* BuffInstance::GetBuffPtr(uint netID)
{
auto ptr = GetAttackableUnitByNetworkID(netID);// attackable unit by network yapılacak
if (ptr != nullptr)
{
auto buffBegin = *ptr->GetBegin();
auto buffEnd = *ptr->GetEnd();
if (buffBegin != nullptr && buffEnd != nullptr)
{
for (uint32_t i = 0; i < (buffEnd - buffBegin) / sizeof(BuffInstance); i++)
{
auto buffNode = buffBegin + i;
auto buffInst = buffNode->buffInst;
if (buffNode != nullptr && buffInst != nullptr)
{
if (buffInst->IsValid())
{
auto base = buffInst->GetScriptBaseBuff();
if (base)
{
//bufflist.push_back(buffInst);
ENGINE_MSG("i(%02x) : (%.f : %.f) : (%s)\n", *buffInst->GetIndex(), *buffInst->GetStartTime(), *buffInst->GetEndTime(), base->GetName());
}
}
}
}
}
}
return nullptr;
}
#endif
std::vector<BuffInstance*> BuffInstance::GetBuffList(GameObject*ptrin)
{
std::vector<BuffInstance*> bufflist;
auto ptr = reinterpret_cast<Obj_AI_Base*>(ptrin);//GetAttackableUnitByNetworkID(netid);// attackable unit by network yapılacak
if (ptr != nullptr)
{
auto buffBegin = *ptr->GetBegin();
auto buffEnd = *ptr->GetEnd();
if (buffBegin != nullptr && buffEnd != nullptr)
{
for (uint32_t i = 0; i < (buffEnd - buffBegin) / sizeof(BuffInstance); i++)
{
auto buffNode = buffBegin + i;
auto buffInst = buffNode->buffInst;
if (buffNode != nullptr && buffInst != nullptr)
{
if (buffInst->IsValid())
{
auto base = buffInst->GetScriptBaseBuff();
if (base)
{
bufflist.push_back(buffInst);
#ifdef _DEBUG0
ENGINE_MSG("i(%02x) : (%.f : %.f) : (%s)\n", *buffInst->GetIndex(), *buffInst->GetStartTime(), *buffInst->GetEndTime(), base->GetName());
#endif
}
}
}
}
}
}
return bufflist;
}
std::vector<RVector3*> Obj_AI_Base::GetPathList()
{
return GetPathList(reinterpret_cast<Obj_AI_Base*>(this));
}
std::vector<RVector3*> Obj_AI_Base::GetPathList(Obj_AI_Base*ptrin)
{
std::vector<RVector3*> bufflist;
auto ptr = ptrin;//GetAttackableUnitByNetworkID(netid);// attackable unit by network yapılacak
if (ptr != nullptr)
{
auto aim = *ptr->GetAIManager_Client();
auto buffBegin = *aim->GetNavBegin();
auto buffEnd = *aim->GetNavEnd();
if (buffBegin != nullptr && buffEnd != nullptr)
{
for (uint32_t i = 0; i < (buffEnd - buffBegin) ; i++)
{
auto buffNode = buffBegin + (i);
if (buffNode != nullptr )
{
if(buffNode->x > 20 && buffNode->y > 20 && buffNode->z > 20 && buffNode->x < 50000)
{
bufflist.push_back(buffNode);
#ifdef _DEBUG1
ENGINE_MSG("%d : %.f %.f %.f\n",i,buffNode->x, buffNode->y , buffNode->z);
#endif
}
}
}
}
}
return bufflist;
}