forked from atom0s/Cure-Please
-
Notifications
You must be signed in to change notification settings - Fork 35
/
OLDBARDCODE.txt
366 lines (340 loc) · 22.3 KB
/
OLDBARDCODE.txt
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
if ((Form2.config.enableSinging) && (!castingLock) && _ELITEAPIPL.Player.Status != 33)
{
if (Last_SongCast_Timer[0] != DefaultTime && Last_SongCast_Timer_Span[0].Minutes >= 2)
{
Last_Song_Cast = String.Empty;
}
if (_ELITEAPIPL.Player.MainJob == 10 || _ELITEAPIPL.Player.SubJob == 10)
{
PL_BRDCount = _ELITEAPIPL.Player.GetPlayerInfo().Buffs.Where(b => b == 195 || b == 196 || b == 197 || b == 198 || b == 199 || b == 200 || b == 201 || b == 214 || b == 215 || b == 216 || b == 218 || b == 219 || b == 222).Count();
if (_ELITEAPIPL.Player.Name != _ELITEAPIMonitored.Player.Name)
{
Monitored_BRDCount = _ELITEAPIMonitored.Player.GetPlayerInfo().Buffs.Where(b => b == 195 || b == 196 || b == 197 || b == 198 || b == 199 || b == 200 || b == 201 || b == 214 || b == 215 || b == 216 || b == 218 || b == 219 || b == 222).Count();
}
}
// Grab the Song's Information
var song_1 = SongInfo.Where(c => c.song_position == Form2.config.song1).FirstOrDefault();
var song_2 = SongInfo.Where(c => c.song_position == Form2.config.song2).FirstOrDefault();
var song_3 = SongInfo.Where(c => c.song_position == Form2.config.song3).FirstOrDefault();
var song_4 = SongInfo.Where(c => c.song_position == Form2.config.song4).FirstOrDefault();
var dummy1_song = SongInfo.Where(c => c.song_position == Form2.config.dummy1).FirstOrDefault();
var dummy2_song = SongInfo.Where(c => c.song_position == Form2.config.dummy2).FirstOrDefault();
// Check the distance of the Monitored player
int Monitoreddistance = 50;
var monitoredTarget = _ELITEAPIPL.Entity.GetEntity((int)_ELITEAPIMonitored.Player.TargetID);
Monitoreddistance = (int)monitoredTarget.Distance;
int Songs_Possible = 0;
if (song_1.song_name.ToLower() != "blank")
{
Songs_Possible++;
}
if (song_2.song_name.ToLower() != "blank")
{
Songs_Possible++;
}
if (dummy1_song != null && dummy1_song.song_name.ToLower() != "blank")
{
Songs_Possible++;
}
if (dummy2_song != null && dummy2_song.song_name.ToLower() != "blank")
{
Songs_Possible++;
}
// List to make it easy to check how many of each buff is needed.
List<int> SongDataMax = new List<int>
{
song_1.buff_id,
song_2.buff_id,
song_3.buff_id,
song_4.buff_id
};
// Check Whether e have the songs Currently Up
int count1_type = _ELITEAPIPL.Player.GetPlayerInfo().Buffs.Where(b => b == song_1.buff_id).Count();
int count2_type = _ELITEAPIPL.Player.GetPlayerInfo().Buffs.Where(b => b == song_2.buff_id).Count();
int count3_type = _ELITEAPIPL.Player.GetPlayerInfo().Buffs.Where(b => b == dummy1_song.buff_id).Count();
int count4_type = _ELITEAPIPL.Player.GetPlayerInfo().Buffs.Where(b => b == song_3.buff_id).Count();
int count5_type = _ELITEAPIPL.Player.GetPlayerInfo().Buffs.Where(b => b == dummy2_song.buff_id).Count();
int count6_type = _ELITEAPIPL.Player.GetPlayerInfo().Buffs.Where(b => b == song_4.buff_id).Count();
int MON_count1_type = _ELITEAPIMonitored.Player.GetPlayerInfo().Buffs.Where(b => b == song_1.buff_id).Count();
int MON_count2_type = _ELITEAPIMonitored.Player.GetPlayerInfo().Buffs.Where(b => b == song_2.buff_id).Count();
int MON_count3_type = _ELITEAPIMonitored.Player.GetPlayerInfo().Buffs.Where(b => b == dummy1_song.buff_id).Count();
int MON_count4_type = _ELITEAPIMonitored.Player.GetPlayerInfo().Buffs.Where(b => b == song_3.buff_id).Count();
int MON_count5_type = _ELITEAPIMonitored.Player.GetPlayerInfo().Buffs.Where(b => b == dummy2_song.buff_id).Count();
int MON_count6_type = _ELITEAPIMonitored.Player.GetPlayerInfo().Buffs.Where(b => b == song_4.buff_id).Count();
// RECAST SONGS IF NEARBY THEMONITORED PLAYER
if (Form2.config.recastSongs_Monitored && Monitoreddistance <= 9 && _ELITEAPIMonitored.Player.Name != _ELITEAPIPL.Player.Name)
{
// SONG NUMBER #1
if (song_casting == 0 && (song_1.song_name.ToLower() != "blank" && MON_count1_type < SongDataMax.Where(c => c == song_1.buff_id).Count() && Last_Song_Cast != song_1.song_name || ForceSongRecast == true))
{
if (CheckSpellRecast(song_1.song_name) == 0 && (HasSpell(song_1.song_name)) && JobChecker(song_1.song_name) == true && (!castingLock))
{
castSpell("<me>", song_1.song_name);
Last_Song_Cast = song_1.song_name;
Last_SongCast_Timer[0] = DateTime.Now;
playerSong1[0] = DateTime.Now;
song_casting = 1;
}
if (Songs_Possible == 1)
ForceSongRecast = false;
}
// SONG NUMBER #2
else if (song_casting == 1 && (song_2.song_name.ToLower() != "blank" && MON_count2_type < SongDataMax.Where(c => c == song_2.buff_id).Count() && Last_Song_Cast != song_2.song_name || ForceSongRecast == true))
{
if (CheckSpellRecast(song_2.song_name) == 0 && (HasSpell(song_2.song_name)) && JobChecker(song_2.song_name) == true && (!castingLock))
{
castSpell("<me>", song_2.song_name);
Last_Song_Cast = song_2.song_name;
Last_SongCast_Timer[0] = DateTime.Now;
playerSong2[0] = DateTime.Now;
song_casting = 2;
}
if (Songs_Possible == 2)
ForceSongRecast = false;
}
// DUMMY SONG NUMBER #1 AND SONG NUMBER #3
else if (song_casting == 2 && Monitored_BRDCount >= 2 && (song_3.song_name.ToLower() != "blank" && MON_count4_type < SongDataMax.Where(c => c == song_3.buff_id).Count() && Last_Song_Cast != song_3.song_name || ForceSongRecast == true))
{
if (Monitored_BRDCount <= 2)
{
if (CheckSpellRecast(dummy1_song.song_name) == 0 && (HasSpell(dummy1_song.song_name)) && JobChecker(dummy1_song.song_name) == true && (!castingLock))
{
castSpell("<me>", dummy1_song.song_name);
}
}
else
{
if (CheckSpellRecast(song_3.song_name) == 0 && (HasSpell(song_3.song_name)) && JobChecker(song_3.song_name) == true && (!castingLock))
{
castSpell("<me>", song_3.song_name);
Last_Song_Cast = song_3.song_name;
Last_SongCast_Timer[0] = DateTime.Now;
playerSong3[0] = DateTime.Now;
song_casting = 3;
}
}
if (Songs_Possible == 3)
ForceSongRecast = false;
}
// DUMMY SONG NUMBER #2 AND SONG NUMBER #4
else if (song_casting == 3 && Monitored_BRDCount >= 3 && (song_4.song_name.ToLower() != "blank" && MON_count6_type < SongDataMax.Where(c => c == song_4.buff_id).Count() && Last_Song_Cast != song_4.song_name || ForceSongRecast == true))
{
if (Monitored_BRDCount < 4)
{
if (CheckSpellRecast(dummy2_song.song_name) == 0 && (HasSpell(dummy2_song.song_name)) && JobChecker(dummy2_song.song_name) == true && (!castingLock))
{
castSpell("<me>", dummy2_song.song_name);
}
}
else
{
if (CheckSpellRecast(song_4.song_name) == 0 && (HasSpell(song_4.song_name)) && JobChecker(song_4.song_name) == true && (!castingLock))
{
castSpell("<me>", song_4.song_name);
Last_Song_Cast = song_4.song_name;
Last_SongCast_Timer[0] = DateTime.Now;
playerSong4[0] = DateTime.Now;
song_casting = 0;
}
}
if (Songs_Possible == 3)
ForceSongRecast = false;
}
else if (Monitored_BRDCount <= 2 && Songs_Possible > 2)
song_casting = 0;
else if (Monitored_BRDCount <= 3 && Songs_Possible > 3)
song_casting = 0;
// ONCE ALL SONGS HAVE BEEN CAST ONLY RECAST THEM WHEN THEY MEET THE THRESHOLD SET ON SONG RECAST AND BLOCK IF IT'S SET AT LAUNCH DEFAULTS
if (playerSong1[0] != DefaultTime && playerSong1_Span[0].Minutes >= Form2.config.recastSongTime)
{
if ((Form2.config.SongsOnlyWhenNear && Monitoreddistance < 10) || Form2.config.SongsOnlyWhenNear == false)
{
if (CheckSpellRecast(song_1.song_name) == 0 && (HasSpell(song_1.song_name)) && JobChecker(song_1.song_name) == true && (!castingLock))
{
castSpell("<me>", song_1.song_name);
playerSong1[0] = DateTime.Now;
song_casting = 0;
}
}
}
else if (playerSong2[0] != DefaultTime && playerSong2_Span[0].Minutes >= Form2.config.recastSongTime)
{
if ((Form2.config.SongsOnlyWhenNear && Monitoreddistance < 10) || Form2.config.SongsOnlyWhenNear == false)
{
if (CheckSpellRecast(song_2.song_name) == 0 && (HasSpell(song_2.song_name)) && JobChecker(song_2.song_name) == true && (!castingLock))
{
castSpell("<me>", song_2.song_name);
playerSong2[0] = DateTime.Now;
song_casting = 0;
}
}
}
else if (playerSong3[0] != DefaultTime && playerSong3_Span[0].Minutes >= Form2.config.recastSongTime)
{
if ((Form2.config.SongsOnlyWhenNear && Monitoreddistance < 10) || Form2.config.SongsOnlyWhenNear == false)
{
if (CheckSpellRecast(song_3.song_name) == 0 && (HasSpell(song_3.song_name)) && JobChecker(song_3.song_name) == true && (!castingLock))
{
castSpell("<me>", song_3.song_name);
playerSong3[0] = DateTime.Now;
song_casting = 0;
}
}
}
else if (playerSong4[0] != DefaultTime && playerSong4_Span[0].Minutes >= Form2.config.recastSongTime)
{
if ((Form2.config.SongsOnlyWhenNear && Monitoreddistance < 10) || Form2.config.SongsOnlyWhenNear == false)
{
if (CheckSpellRecast(song_4.song_name) == 0 && (HasSpell(song_4.song_name)) && JobChecker(song_4.song_name) == true && (!castingLock))
{
castSpell("<me>", song_4.song_name);
playerSong4[0] = DateTime.Now;
song_casting = 0;
}
}
}
}
else
{
// Check if you need the monitored player nearby and if they are, or if the only requirement is songs being enabled
if ((Form2.config.SongsOnlyWhenNear == true && Monitoreddistance < 10) || (Form2.config.SongsOnlyWhenNear == false || _ELITEAPIPL.Player.Name == _ELITEAPIMonitored.Player.Name))
{
// SONG NUMBER #1
if (song_casting == 0 && (song_1.song_name.ToLower() != "blank" && count1_type < SongDataMax.Where(c => c == song_1.buff_id).Count() && Last_Song_Cast != song_1.song_name || ForceSongRecast == true))
{
if (CheckSpellRecast(song_1.song_name) == 0 && (HasSpell(song_1.song_name)) && JobChecker(song_1.song_name) == true && (!castingLock))
{
castSpell("<me>", song_1.song_name);
Last_Song_Cast = song_1.song_name;
Last_SongCast_Timer[0] = DateTime.Now;
playerSong1[0] = DateTime.Now;
song_casting = 1;
}
if (Songs_Possible == 1)
ForceSongRecast = false;
}
// SONG NUMBER #2
else if (song_casting == 1 && (song_2.song_name.ToLower() != "blank" && count2_type < SongDataMax.Where(c => c == song_2.buff_id).Count() && Last_Song_Cast != song_2.song_name || ForceSongRecast == true))
{
if (CheckSpellRecast(song_2.song_name) == 0 && (HasSpell(song_2.song_name)) && JobChecker(song_2.song_name) == true && (!castingLock))
{
castSpell("<me>", song_2.song_name);
Last_Song_Cast = song_2.song_name;
Last_SongCast_Timer[0] = DateTime.Now;
playerSong2[0] = DateTime.Now;
song_casting = 2;
}
if (Songs_Possible == 2)
ForceSongRecast = false;
}
// DUMMY SONG NUMBER #1 AND SONG NUMBER #3
else if (song_casting == 2 && PL_BRDCount >= 2 && (song_3.song_name.ToLower() != "blank" && count4_type < SongDataMax.Where(c => c == song_3.buff_id).Count() && Last_Song_Cast != song_3.song_name || ForceSongRecast == true))
{
if (PL_BRDCount <= 2)
{
if (CheckSpellRecast(dummy1_song.song_name) == 0 && (HasSpell(dummy1_song.song_name)) && JobChecker(dummy1_song.song_name) == true && (!castingLock))
{
castSpell("<me>", dummy1_song.song_name);
}
}
else
{
if (CheckSpellRecast(song_3.song_name) == 0 && (HasSpell(song_3.song_name)) && JobChecker(song_3.song_name) == true && (!castingLock))
{
castSpell("<me>", song_3.song_name);
Last_Song_Cast = song_3.song_name;
Last_SongCast_Timer[0] = DateTime.Now;
playerSong3[0] = DateTime.Now;
song_casting = 3;
}
}
if (Songs_Possible == 3)
ForceSongRecast = false;
}
// DUMMY SONG NUMBER #2 AND SONG NUMBER #4
else if (song_casting == 3 && PL_BRDCount >= 3 && (song_4.song_name.ToLower() != "blank" && count6_type < SongDataMax.Where(c => c == song_4.buff_id).Count() && Last_Song_Cast != song_4.song_name || ForceSongRecast == true))
{
if (PL_BRDCount < 4)
{
if (CheckSpellRecast(dummy2_song.song_name) == 0 && (HasSpell(dummy2_song.song_name)) && JobChecker(dummy2_song.song_name) == true && (!castingLock))
{
castSpell("<me>", dummy2_song.song_name);
}
}
else
{
if (CheckSpellRecast(song_4.song_name) == 0 && (HasSpell(song_4.song_name)) && JobChecker(song_4.song_name) == true && (!castingLock))
{
castSpell("<me>", song_4.song_name);
Last_Song_Cast = song_4.song_name;
Last_SongCast_Timer[0] = DateTime.Now;
playerSong4[0] = DateTime.Now;
song_casting = 0;
}
}
if (Songs_Possible == 3)
ForceSongRecast = false;
}
else if (PL_BRDCount <= 2 && Songs_Possible > 2)
song_casting = 0;
else if (PL_BRDCount <= 3 && Songs_Possible > 3)
song_casting = 0;
// ONCE ALL SONGS HAVE BEEN CAST ONLY RECAST THEM WHEN THEY MEET THE THRESHOLD SET ON SONG RECAST AND BLOCK IF IT'S SET AT LAUNCH DEFAULTS
if (playerSong1[0] != DefaultTime && playerSong1_Span[0].Minutes >= Form2.config.recastSongTime)
{
if ((Form2.config.SongsOnlyWhenNear && Monitoreddistance < 10) || Form2.config.SongsOnlyWhenNear == false)
{
if (CheckSpellRecast(song_1.song_name) == 0 && (HasSpell(song_1.song_name)) && JobChecker(song_1.song_name) == true && (!castingLock))
{
castSpell("<me>", song_1.song_name);
playerSong1[0] = DateTime.Now;
song_casting = 0;
}
}
}
else if (playerSong2[0] != DefaultTime && playerSong2_Span[0].Minutes >= Form2.config.recastSongTime)
{
if ((Form2.config.SongsOnlyWhenNear && Monitoreddistance < 10) || Form2.config.SongsOnlyWhenNear == false)
{
if (CheckSpellRecast(song_2.song_name) == 0 && (HasSpell(song_2.song_name)) && JobChecker(song_2.song_name) == true && (!castingLock))
{
castSpell("<me>", song_2.song_name);
playerSong2[0] = DateTime.Now;
song_casting = 0;
}
}
}
else if (playerSong3[0] != DefaultTime && playerSong3_Span[0].Minutes >= Form2.config.recastSongTime)
{
if ((Form2.config.SongsOnlyWhenNear && Monitoreddistance < 10) || Form2.config.SongsOnlyWhenNear == false)
{
if (CheckSpellRecast(song_3.song_name) == 0 && (HasSpell(song_3.song_name)) && JobChecker(song_3.song_name) == true && (!castingLock))
{
castSpell("<me>", song_3.song_name);
playerSong3[0] = DateTime.Now;
song_casting = 0;
}
}
}
else if (playerSong4[0] != DefaultTime && playerSong4_Span[0].Minutes >= Form2.config.recastSongTime)
{
if ((Form2.config.SongsOnlyWhenNear && Monitoreddistance < 10) || Form2.config.SongsOnlyWhenNear == false)
{
if (CheckSpellRecast(song_4.song_name) == 0 && (HasSpell(song_4.song_name)) && JobChecker(song_4.song_name) == true && (!castingLock))
{
castSpell("<me>", song_4.song_name);
playerSong4[0] = DateTime.Now;
song_casting = 0;
}
}
}
}
else
ShowStatus("WARNING: Monitored player (" + monitoredTarget.Name + ") is out of range. (Distance: " + monitoredTarget.Distance + ")");
if ((Songs_Possible == 1 && song_casting >= 0) || (Songs_Possible == 2 && song_casting >= 2) || (Songs_Possible == 3 && song_casting >= 3) || (Songs_Possible == 4 && song_casting >= 4))
{
song_casting = 0;
}
}
}