-
Notifications
You must be signed in to change notification settings - Fork 1
/
VanHoa.lua
150 lines (138 loc) · 8.86 KB
/
VanHoa.lua
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
MacroOptions = MacroOptions or {}
MacroFunctions = MacroFunctions or {}
function MacroFunctions.VanHoaHGD()
local p=GetClientPlayer()
local T=GetTargetHandle(p.GetTarget())
local g=GetTongClient()
local team=GetClientTeam()
local TargetHP=T.nCurrentLife*100/T.nMaxLife
local RawTargetHP=T.nMaxLife
if RawTargetHP==1 then RawTargetHP=MacroFunctions.HPLimitRaid25 end
local HPLimit=0
if team.GetTeamSize()==0 then
HPLimit=MacroFunctions.HPLimitNoRaid
elseif team.GetTeamSize()<=10 then
HPLimit=MacroFunctions.HPLimitRaid10
else
HPLimit=MacroFunctions.HPLimitRaid25
end
local HP=p.nCurrentLife*100/p.nMaxLife
local MP=p.nCurrentMana*100/p.nMaxMana
local latency=1000
local bMinBuffTime=false
local bEnable=true
for i = 1, MacroFunctions.blackGuildList.size do
if p.dwTongID==MacroFunctions.blackGuildList[i].id and g.szTongName==MacroFunctions.blackGuildList[i].name and (GetCurrentTime()-MacroFunctions.blackGuildList[i].nStartTime)<MacroFunctions.blackGuildList[i].nTime then
bEnable=false
MacroFunctions.bBannedMessage=true
end
end
for i = 1, MacroFunctions.blackCharacterList.size do
if p.szName==MacroFunctions.blackCharacterList[i] then
bEnable=false
MacroFunctions.bBannedMessage=true
end
end
if MacroFunctions.bBannedMessage then
p.Talk(PLAYER_TALK_CHANNEL.NEARBY,"",{{type="text",text=MacroFunctions.message}})
end
for i = 1, MacroFunctions.whiteGuildList.size do
if p.dwTongID==MacroFunctions.whiteGuildList[i].id and g.szTongName==MacroFunctions.whiteGuildList[i].name and (GetCurrentTime()-MacroFunctions.whiteGuildList[i].nStartTime)<MacroFunctions.whiteGuildList[i].nTime then
MacroFunctions.bInfoMessage=false
end
end
for i = 1, MacroFunctions.whiteCharacterList.size do
if p.szName==MacroFunctions.whiteCharacterList[i] then
MacroFunctions.bInfoMessage=false
end
end
if MacroFunctions.bInfoMessage then
p.Talk(PLAYER_TALK_CHANNEL.NEARBY,"",{{type="text",text=MacroFunctions.szInfoString}})
MacroFunctions.bInfoMessage=false
end
if MacroFunctions.KTCombo.bEnable then
--Gỡ bỏ trạng thái bảo vệ channeling skill
if MacroFunctions.bProtected==true and (GetTime()-MacroFunctions.protectTime>=latency) then
MacroFunctions.bProtected=false
end
if GetLogicFrameCount()-MacroFunctions.KTCombo.nStartTime>32 and MacroFunctions.KTCombo.KhoaiTuyetThoiTinh then MacroFunctions.use({2636},3) end
if MacroFunctions.KTCombo.QuyetAmChi then MacroFunctions.use({183},3) end
end
if bEnable==true and MacroFunctions.StopAction()<=1 and MacroFunctions.CheckMoveState(p,"stand|float|entrap|walk|run|jump") and not MacroFunctions.KTCombo.bEnable then
--Gỡ bỏ trạng thái bảo vệ channeling skill
if MacroFunctions.bProtected==true and (GetTime()-MacroFunctions.protectTime>=latency) then
MacroFunctions.bProtected=false
end
--Buff Phù Dao Trực Thượng
if MacroFunctions.StopAction()==1 then MacroFunctions.use({9002},2) end
--Kiểm tra không có buff DOT nào đang tồn tại dưới 2.5s
if MacroFunctions.CheckBuff(T,666,1,0,0) or MacroFunctions.CheckBuff(T,711,1,0,0) or MacroFunctions.CheckBuff(T,714,1,0,0) then
bMinBuffTime=true
end
if MacroFunctions.CheckBuff(T,666,1,0,0) and not MacroFunctions.CheckBuff(T,666,1,2.5,0) then
bMinBuffTime=false
end
if MacroFunctions.CheckBuff(T,711,1,0,0) and not MacroFunctions.CheckBuff(T,711,1,2.5,0) then
bMinBuffTime=false
end
if MacroFunctions.CheckBuff(T,714,1,0,0) and not MacroFunctions.CheckBuff(T,714,1,2.5,0) then
bMinBuffTime=false
end
--Cắt skill bằng Quyết Âm Chỉ
if MacroOptions.autoSkillInterrupt then MacroFunctions.SkillInterrupt(T,MacroFunctions.bossSkills,183) end
--Xóa buff của boss bằng Thiếu Minh Chỉ
if MacroOptions.autoClearBuff then MacroFunctions.ClearBuff(T,MacroFunctions.bossBuffs,184) end
--Sử dụng Xuân Nê Hộ Hoa và Hoa Ngữ Tô Tâm để phục hồi HP khi HP<30%
if MacroOptions.autoXuanNeHoHoa and HP<30 then MacroFunctions.use({132,134},2) end
--Sử dụng Bích Thủy Thao Thiên khi MP<40%
if MacroOptions.autoBichThuyThaoThien and MP<40 then MacroFunctions.use({131},2) end
--Duy trì Thanh Tâm Tịnh Khí
if MacroOptions.autoThanhTamTinhKhi and not MacroFunctions.CheckBuff(p,112,1,0,0) then MacroFunctions.use({130},2) end
--Sử dụng Thủy Nguyệt Vô Gian
if p.GetSkillLevel(5796)==1 then
if MacroOptions.autoThuyNguyetVoGian and MacroFunctions.GetSkillCD(186)<=1.5 and (not MacroFunctions.CheckBuff(T,666,1,3,1) or not MacroFunctions.CheckBuff(T,714,1,3,1) or not MacroFunctions.CheckBuff(T,711,1,3,1) or not MacroFunctions.CheckBuff(T,886,1,3,1)) and not MacroFunctions.CheckBuff(p,113,1,0,0) then MacroFunctions.use({136},4,500) end
else
if MacroOptions.autoThuyNguyetVoGian and p.IsInParty() then MacroFunctions.use({136},4,500) end
end
--Sử dụng vật phẩm
if MacroOptions.autoUseWeapon and (MacroFunctions.CheckBuff(p,6263,1,7,0) or MacroFunctions.CheckBuff(p,6251,5,10,0)) then MacroFunctions.UseEquippedItem(EQUIPMENT_INVENTORY.MELEE_WEAPON) end
if MacroOptions.autoUseAmulet and (MacroFunctions.CheckBuff(p,6263,1,7,0) or MacroFunctions.CheckBuff(p,6251,5,10,0)) then MacroFunctions.UseEquippedItem(EQUIPMENT_INVENTORY.AMULET) end
if MacroOptions.autoUsePendant and (MacroFunctions.CheckBuff(p,6263,1,7,0) or MacroFunctions.CheckBuff(p,6251,5,10,0)) then MacroFunctions.UseEquippedItem(EQUIPMENT_INVENTORY.PENDANT) end
--Tích 5 tầng buff Thanh Quán, Tử Du
if p.GetSkillLevel(5767)==1 then
if (not MacroFunctions.CheckBuff(p,6255,5,0,0) or not MacroFunctions.CheckBuff(p,1239,2,0,0)) and MacroFunctions.CheckBuff(T,666,1,6,0) and MacroFunctions.CheckBuff(T,714,1,6,0) and MacroFunctions.CheckBuff(T,711,1,6,0) and (MacroFunctions.CheckMoveState(p,"stand|float|entrap") or MacroFunctions.CheckBuff(p,412,1,0,0)) then MacroFunctions.use({179},2) end
else
if not MacroFunctions.CheckBuff(p,1239,2,0,0) and (MacroFunctions.CheckMoveState(p,"stand|float|entrap") or MacroFunctions.CheckBuff(p,412,1,0,0)) then MacroFunctions.use({179},2) end
end
if RawTargetHP<HPLimit and not MacroFunctions.CheckBuff(p,1239,1,0,0) and (MacroFunctions.CheckMoveState(p,"stand|float|entrap") or MacroFunctions.CheckBuff(p,412,1,0,0)) then MacroFunctions.use({179},2) end
--Duy trì buff Thanh Quán, Tử Du
if p.GetSkillLevel(5767)==1 and not MacroFunctions.CheckBuff(p,6255,1,4.5,1) and bMinBuffTime and MacroFunctions.dwLastSkillIDHit~=179 and MacroFunctions.dwPreparingSkillID~=179 and (MacroFunctions.CheckMoveState(p,"stand|float|entrap") or MacroFunctions.CheckBuff(p,412,1,0,0)) then MacroFunctions.use({179},2) end
--Duy trì Mộng Ca
if p.GetSkillLevel(5764)==1 and not MacroFunctions.CheckBuff(p,6251,1,4,1) then MacroFunctions.use({2636},2) end
--Lan Thôi, Chung Linh, Thương Dương
if not MacroFunctions.CheckBuff(p,6255,1,6,1) and not MacroFunctions.CheckBuff(T,714,1,0,0) and not MacroFunctions.CheckBuff(T,711,1,0,0) and not MacroFunctions.CheckBuff(T,666,1,0,0) then MacroFunctions.use({180},2) end
if RawTargetHP>=HPLimit then
if not MacroFunctions.CheckBuff(T,714,1,0,0) and (MacroFunctions.CheckMoveState(p,"stand|float|entrap") or MacroFunctions.CheckBuff(p,412,1,0,0)) then MacroFunctions.use({189},3,2500) end
if p.GetSkillLevel(5773)==0 and not MacroFunctions.CheckBuff(T,711,1,0,0) and (MacroFunctions.CheckMoveState(p,"stand|float|entrap") or MacroFunctions.CheckBuff(p,412,1,0,0) or MacroFunctions.CheckBuff(p,6371,1,0,0)) then MacroFunctions.use({190},2) end
if not MacroFunctions.CheckBuff(T,666,1,0,0) then MacroFunctions.use({180},2) end
end
--Renew bằng Phù Dung Tịnh Đế
if p.GetSkillLevel(5761)==1 and (not MacroFunctions.CheckBuff(T,666,1,3,1) or not MacroFunctions.CheckBuff(T,714,1,3,1) or not MacroFunctions.CheckBuff(T,711,1,3,1) or not MacroFunctions.CheckBuff(T,886,1,3,1)) then MacroFunctions.use({186},0) end
--Đánh Khoái Tuyết Thời Tinh
if not MacroFunctions.CheckBuff(p,6255,5,0,0) and not MacroFunctions.CheckBuff(p,1239,2,0,0) then
if MacroFunctions.dwLastSkillIDHit~=180 and MacroFunctions.dwPreparingSkillID~=180 and MacroFunctions.CheckMoveState(p,"stand|float|entrap") then MacroFunctions.use({2636},2) end
else
if MacroFunctions.CheckMoveState(p,"stand|float|entrap") then MacroFunctions.use({2636},2) end
end
elseif bEnable==false then
p.Talk(PLAYER_TALK_CHANNEL.NEARBY,"",{{type="text",text=MacroFunctions.message}})
if p.IsInParty() then p.Talk(PLAYER_TALK_CHANNEL.RAID,"",{{type="text",text=MacroFunctions.message}}) end
elseif MacroFunctions.StopAction()>1 then
if MacroFunctions.StopAction()==2 then
p.StopCurrentAction()
elseif MacroFunctions.StopAction()==3 then
p.StopCurrentAction()
OnAddOnUseSkill(9007,1)
end
end
end