WIP: Dexxer/Mage/Necro Hybrid by KikRox268

Related: Swords

Description: This is an edit to Jaseowns "Dexxer Bot" and "Mage" script. I copied and pasted from both, the lines that I felt I needed to make it work for my build. Known issues, re-equipping left hand weapon after casting "greater heal" doesn't work 100% of the time and it doesn't seem like it will use "cure" pots in order to cure poison.

What it does: Summons elementals automatically, even once they die/ Auto targeting/ Auto attack when within range/ Cast "Greater Heal" when life is low/ Cast necro abilities based on variables set.

1#This script is a copy and paste of 2 different Jaseowns scripts. This is not a script made by Jaseowns! I just want to clarify that. 
2
3# Dexxer Bot by Jaseowns
4# UO Outlands
5#######
6# Working on this during the live streams: Monday / Wednesday / Friday
7# https://youtube.com/jaseowns/live
8#######
9# Basic Heal and Chivalry abilties to heal by Jaseowns
10# UO Outlands
11@setvar! cdPreventOverheadSpam 2000
12
13# Check potion buffs controllers
14@setvar! checkStr 1
15@setvar! checkDex 1
16@setvar! checkMagic 1
17@setvar! checkHealPot 1
18@setvar! checkCurePot 1
19@setvar! checkRefreshPot 1
20
21# These control when the potion will be drank
22# Edit to your liking
23@setvar! hpCheckToTriggerHealPotion 35
24@setvar! hpCheckToTriggerCurePotion 40
25@setvar! stamCheckToTriggerRedPotion 20
26
27# Automatically Select Next Target
28@setvar! autoTargetNextMob 1
29
30@setvar! minimumWaitForPing 200
31
32# make sure you add a friends list called: IgnoreMobs
33@setvar! didYouSetupIgnoreMobs 1
34
35
36
37###############
38###  Choose your summons
39######
40@setvar! castSummonFireElementalCount 1
41@setvar! castSummonCreatureCount 1
42@setvar! castSummonEarthElementalCount 1
43@setvar! castSummonEarthElementalAsMummy 1
44
45###############
46###  Choose your necro spells (ignored if less then required necro skill)
47######
48@setvar! castEvilOmen 0
49@setvar! castCorpseSkin 0
50@setvar! castVampiricEmbrace 1
51@setvar! castMindRot 0
52@setvar! castPoisonStrike 0
53@setvar! castBloodOath 1
54@setvar! castPainSpike 0
55@setvar! requireWitherBeforeSummons 1
56
57###############
58### Necro Cooldowns
59######
60@setvar! cdEvilOmen 30500
61@setvar! cdVampiricEmbrace 30500
62@setvar! cdCorpseSkin 30500
63@setvar! cdMindRot 30500
64@setvar! cdWither 30500
65@setvar! cdVengefulSpirit 30500
66@setvar! cdBloodOath 30500
67@setvar! cdPainSpike 30500
68@setvar! cdPoisonStrike 30500
69
70@setvar! patrolPetEvenIfLastTargetIsBeyondEightTiles 1
71@setvar! cdKillTarget 60000
72@setvar! cdMeditation 10000
73
74if counttype "gold coin" backpack as total
75    if 10000 < total
76        overhead "Warning: {{total}} gold!" 34
77    endif
78endif
79
80#### Pet Names, unique to you
81if not listexists petNameList
82    createlist petNameList
83endif
84if list petNameList = 0
85    pushlist petNameList "NecroMummy"
86    pushlist petNameList "NecroLich"
87    pushlist petNameList "NecroCreature"
88endif
89
90
91##############################################
92###########  DO NOT EDIT BELOW THIS
93#######
94
95if not varexist jaseowns
96    overhead "v2.3.0" 34
97    overhead "uorazorscripts.com/mage-bot" 34
98    say "This script was brought to you by youtube.com/Jaseowns" 88
99    wait 500
100    @setvar! jaseowns 1
101endif
102
103if didYouSetupIgnoreMobs = 0
104    overhead "For this script to work, make sure you add a friends list called: IgnoreMobs" 34
105    sysmsg  "For this script to work, make sure you add a friends list called: IgnoreMobs" 34
106    wait 1500
107    overhead "Click Friends Tab -> [checkmark] enabled -> [checkmark] Next/Prev Target ignores 'IgnoreMobs'" 88
108    sysmsg "Click Friends Tab -> [checkmark] enabled -> [checkmark] Next/Prev Target ignores 'IgnoreMobs'" 88
109    wait 5000
110    overhead "If everything is setup, update didYouSetupIgnoreMobs to 1"
111    sysmsg "If everything is setup, update didYouSetupIgnoreMobs to 1"
112    wait 5000
113    replay
114endif
115
116if dead 
117    overhead "Rip" 34
118    wait 5000
119    replay
120endif
121
122if not findtype "White Potion" backpack
123    @setvar! checkStr 0
124endif
125
126if not findtype "Blue Potion" backpack
127    @setvar! checkDex 0
128endif
129
130if not findtype "Black Potion" backpack
131    @setvar! checkMagic 0
132endif
133
134if not timerexists preventOverheadSpamTimer
135    createtimer preventOverheadSpamTimer
136    settimer preventOverheadSpamTimer cdPreventOverheadSpam
137endif
138
139@setvar! myKillTarget 0 
140@setvar! targetInRange 0 
141
142if not varexist myPreviousKillTarget
143    @setvar myPreviousKillTarget 0     
144endif
145
146if autoTargetNextMob = 1
147    @hotkey 'Target Closest Non-Friendly Monster'
148    wait minimumWaitForPing
149    if insysmsg "No one matching that was found"
150        if timer preventOverheadSpamTimer >= cdPreventOverheadSpam
151            overhead "found no one" 34
152            settimer preventOverheadSpamTimer 0
153        endif
154    else
155        @setvar! myKillTarget lasttarget 
156    endif    
157    
158    if myKillTarget = 0
159        // do nothing
160    elseif not find lasttarget ground -1 -1 1
161        if timer preventOverheadSpamTimer >= cdPreventOverheadSpam
162            overhead "● ▼ OUT OF RANGE ▼ ●" 88 lasttarget
163            settimer preventOverheadSpamTimer 0
164        endif
165        if find lasttarget ground -1 -1 8
166            attack lasttarget 
167        endif
168    else
169        @setvar! targetInRange 1
170        if timer preventOverheadSpamTimer >= cdPreventOverheadSpam
171            overhead "● ▼▼ HERE ▼▼ ●" 88 lasttarget    
172            settimer preventOverheadSpamTimer 0
173        endif
174        attack lasttarget 
175    endif
176elseif dead myKillTarget
177    @hotkey 'Target Closest Non-Friendly Monster'
178    wait minimumWaitForPing
179    if insysmsg "No one matching that was found"
180        // do nothing
181    else
182        @setvar! myKillTarget lasttarget 
183        if myKillTarget = 0
184            // do nothing
185        elseif not find lasttarget ground -1 -1 1
186            // do nothing
187        else
188            @setvar! targetInRange 1
189        endif
190    endif    
191elseif find myKillTarget ground -1 -1 1
192    @setvar! targetInRange 1
193endif
194
195
196
197if targetInRange = 1
198    # Eat food if we got it
199    if not findbuff "food" and findtype "tray" backpack as jood
200        dclick jood
201        wait minimumWaitForPing
202    endif
203    
204# Use Taste ID if possible
205if skill "Taste Identification" >= 50 and not findbuff "herb" and timer meditiationTimer >= 11000 
206    useskill 'tasteidentification'
207    wft 500
208    target backpack
209    settimer meditiationTimer 0
210endif    
211
212    @setvar! needStrBuff 0
213    @setvar! needDexBuff 0
214    @setvar! needMagicBuff 0
215    @setvar! needHealPot 0
216    @setvar! needCurePot 0
217    @setvar! needRefreshPot 0
218
219    if checkStr = 1 and not findbuff "Strength"
220        @setvar! needStrBuff 1
221    endif
222
223    if checkDex = 1 and not findbuff "Agility"
224        @setvar! needDexBuff 1 
225    endif
226
227    if checkMagic = 1 and not findbuff "Magic Resist Potion"
228        @setvar! needMagicBuff 1 
229    endif
230
231    if checkHealPot = 1 and hp <= hpCheckToTriggerHealPotion
232        @setvar! needHealPot 1 
233    endif
234
235    if checkCurePot = 1 and poisoned and hp <= hpCheckToTriggerCurePotion
236        @setvar! needCurePot 1 
237    endif
238
239    if checkRefreshPot = 1 and stam <= stamCheckToTriggerRedPotion
240        @setvar! needRefreshPot 1 
241    endif
242
243    if needStrBuff = 1 and not findtype "White Potion" backpack
244        @setvar! needStrBuff 0
245    endif
246
247    if needDexBuff = 1 and not findtype "Blue Potion" backpack
248        @setvar! needDexBuff 0
249    endif
250
251    if needMagicBuff = 1 and not findtype "Black Potion" backpack
252        @setvar! needMagicBuff 0
253    endif
254
255    if needHealPot = 1 and not findtype "Yellow Potion" backpack
256        @setvar! needHealPot 0
257    endif
258
259    if needCurePot = 1 and not findtype "Orange Potion" backpack
260        @setvar! needCurePot 0
261    endif
262
263    if needRefreshPot = 1 and not findtype "Red Potion" backpack
264        @setvar! needRefreshPot 0
265    endif
266    
267    @setvar! jaseCanDrinkPotion 0
268
269    if needStrBuff = 1 or needDexBuff = 1 or needMagicBuff = 1 or needHealPot = 1 or needCurePot = 1 or needRefreshPot = 1
270
271        @setvar! jaseRightHand 0
272        @setvar! jaseLeftHand 0
273        @setvar! needTwoHandSwap 0
274        @setvar! needShieldSwap 0
275
276        if jaseCanDrinkPotion = 1
277            // do nothing
278        else
279            if needTwoHandSwap = 1
280                if skill "Swordsmanship" > 0 and findtype "cutlass|broadsword|scimitar|viking sword|longsword|katana" backpack as item
281                    dclick item
282                    wait minimumWaitForPing
283                elseif skill "Mace Fighting" > 0 and findtype "maul|war axe|war mace|mace|hammer pick|club" backpack as item
284                    dclick item
285                    wait minimumWaitForPing
286                elseif skill "Fencing" > 0 and findtype "kryss|war fork|dagger" backpack as item
287                    dclick item
288                    wait minimumWaitForPing
289                elseif skill "Archery" > 0 and findtype "crossbow" backpack as item
290                    dclick item
291                    wait minimumWaitForPing
292                else
293                    hotkey 'Arm/Disarm Left Hand'    
294                    wait minimumWaitForPing
295                endif
296                @setvar! jaseCanDrinkPotion 1
297            elseif needShieldSwap = 1
298                hotkey 'Arm/Disarm Left Hand'
299                @setvar! jaseCanDrinkPotion 1
300                wait minimumWaitForPing
301            endif
302        endif
303
304        if jaseCanDrinkPotion = 1
305            
306            if needHealPot = 1
307                if findtype "Yellow Potion" backpack as jotion
308                    overhead "chug heal"
309                    dclick jotion
310                    wait minimumWaitForPing
311                else
312                    overhead "No Heal potion found!" 34
313                endif
314            endif
315            
316            if needCurePot = 1
317                if findtype "Orange Potion" backpack as jotion
318                    overhead "chug cure"
319                    dclick jotion
320                    wait minimumWaitForPing
321                else
322                    overhead "No Cure potion found!" 34
323                endif
324            endif
325            
326            if needRefreshPot = 1
327                if findtype "Red Potion" backpack as jotion
328                    overhead "chug refresh"
329                    dclick jotion
330                    wait minimumWaitForPing
331                else
332                    overhead "No Refresh potion found!" 34
333                endif
334            endif
335        
336            if needStrBuff = 1
337                if findtype "White Potion" backpack as jotion
338                    overhead "chug"
339                    dclick jotion
340                    wait minimumWaitForPing
341                else
342                    overhead "No STR potion found!" 34
343                endif
344            endif
345            
346            if needDexBuff = 1
347                if findtype "Blue Potion" backpack as jotion
348                    overhead "chug"
349                    dclick jotion
350                    wait minimumWaitForPing
351                else
352                    overhead "No AGI potion found!" 34
353                endif
354            endif
355            
356            if needMagicBuff = 1
357                if findtype "Black Potion" backpack as jotion
358                    overhead "chug"
359                    dclick jotion
360                    wait minimumWaitForPing
361                else
362                    overhead "No MR potion found!" 34
363                endif
364            endif
365
366            if needTwoHandSwap = 1
367                dclick jaseLeftHand
368                wait minimumWaitForPing
369            elseif needShieldSwap = 1
370                hotkey 'Arm/Disarm Left Hand'
371            endif
372        endif
373    endif
374    
375endif
376
377if skill "Camping" > 0
378    if not findbuff "campfire"
379        overhead "Camping Buff" 88
380        if not findtype "campfire" ground -1 -1 2 and findtype "kindling" as jindling
381            dclick jindling
382            wait minimumWaitForPing
383        endif
384        if not findtype "campfire" ground -1 -1 2
385            overhead "We have camping, but can not make a campfire!" 34
386        else
387            overhead "Make sure you stand by your camp fire!" 88
388        endif
389    endif
390endif
391wait 200
392
393if not gumpexists 622436516 and skill "Necromancy" >= 50
394    say '[NecromancyHotbar'
395    wait 500
396endif
397
398// Setting current necro symbols - checks again it the attack loop
399@setvar! necroSymbols 12
400if gumpexists 622436516 and skill "Necromancy" >= 50
401    if ingump "12/" 622436516
402        @setvar! necroSymbols 12
403    elseif ingump "13/" 622436516
404        @setvar! necroSymbols 13
405    elseif ingump "14/" 622436516
406        @setvar! necroSymbols 14
407    elseif ingump "15/" 622436516
408        @setvar! necroSymbols 15
409    elseif ingump "16/" 622436516
410        @setvar! necroSymbols 16
411    elseif ingump "17/" 622436516
412        @setvar! necroSymbols 17
413    elseif ingump "18/" 622436516
414        @setvar! necroSymbols 18
415    elseif ingump "19/" 622436516
416        @setvar! necroSymbols 19
417    elseif ingump "20/" 622436516
418        @setvar! necroSymbols 20
419    elseif ingump "21/" 622436516
420        @setvar! necroSymbols 21
421    elseif ingump "11/" 622436516
422        @setvar! necroSymbols 11
423    elseif ingump "10/" 622436516
424        @setvar! necroSymbols 10
425    elseif ingump "9/" 622436516
426        @setvar! necroSymbols 9
427    elseif ingump "8/" 622436516
428        @setvar! necroSymbols 8
429    elseif ingump "7/" 622436516
430        @setvar! necroSymbols 7
431    elseif ingump "6/" 622436516
432        @setvar! necroSymbols 6
433    elseif ingump "5/" 622436516
434        @setvar! necroSymbols 5
435    elseif ingump "4/" 622436516
436        @setvar! necroSymbols 4
437    elseif ingump "3/" 622436516
438        @setvar! necroSymbols 3
439    elseif ingump "2/" 622436516
440        @setvar! necroSymbols 2
441    elseif ingump "1/" 622436516
442        @setvar! necroSymbols 1
443    elseif ingump "0/" 622436516
444        @setvar! necroSymbols 0
445    endif
446endif
447
448if not timerexists evilOmenTimer
449    createtimer evilOmenTimer
450    settimer evilOmenTimer cdEvilOmen
451endif
452
453if not timerexists vampiricEmbraceTimer
454    createtimer vampiricEmbraceTimer
455    settimer vampiricEmbraceTimer cdVampiricEmbrace
456endif
457
458if not timerexists corpseSkinTimer
459    createtimer corpseSkinTimer
460    settimer corpseSkinTimer cdCorpseSkin
461endif
462
463if not timerexists mindRotTimer
464    createtimer mindRotTimer
465    settimer mindRotTimer cdMindRot
466endif
467
468if not timerexists killTargetTimer
469    createtimer killTargetTimer
470    settimer killTargetTimer cdKillTarget
471endif
472
473if not timerexists witherTimer
474    createtimer witherTimer
475    settimer witherTimer cdWither
476endif
477
478if not timerexists vengefulSpiritTimer
479    createtimer vengefulSpiritTimer
480    settimer vengefulSpiritTimer cdVengefulSpirit
481endif
482
483if not timerexists bloodOathTimer
484    createtimer bloodOathTimer
485    settimer bloodOathTimer cdBloodOath
486endif
487
488if not timerexists meditiationTimer
489    createtimer meditiationTimer
490    settimer meditiationTimer cdMeditation
491endif
492
493if not timerexists preventOverheadSpamTimer
494    createtimer preventOverheadSpamTimer
495    settimer preventOverheadSpamTimer cdPreventOverheadSpam
496endif
497
498@setvar! cdPreventSpamNecroAbilities 750
499if not timerexists preventSpamNecroAbilitiesTimer
500    createtimer preventSpamNecroAbilitiesTimer
501    settimer preventSpamNecroAbilitiesTimer cdPreventSpamNecroAbilities
502endif
503
504if not varexist myEarthPet
505    @setvar! myEarthPet 0
506endif
507
508// make sure we have enough symbols to summon (6 for wither + vengful spirit)
509if skill "Necromancy" >= 90 and requireWitherBeforeSummons = 1
510    while followers < 4 and 6 > necroSymbols
511        // we already have vengeful spirit active, skip the check
512        if timer vengefulSpiritTimer < cdVengefulSpirit
513           break
514        endif
515        if diffhits >= 30
516            if targetexists 
517                hotkey 'Cancel Current Target'
518            endif
519            while not targetexists 'beneficial'
520                if diffhits >= 60
521                    cast 'Heal'
522                else
523                    cast 'Greater Heal'                
524                endif
525                wait 50
526                if hp = maxhp
527                    hotkey '> Interrupt'
528                    break
529                endif
530            endwhile
531            if targetexists 'beneficial'
532                hotkey 'Target Self'
533            endif
534        endif
535        if timer preventOverheadSpamTimer >= cdPreventOverheadSpam
536            overhead "waiting for symbols" 88
537            settimer preventOverheadSpamTimer 0
538        endif
539        if gumpexists 622436516 and skill "Necromancy" >= 50
540            if ingump "12/" 622436516
541                @setvar! necroSymbols 12
542            elseif ingump "13/" 622436516
543                @setvar! necroSymbols 13
544            elseif ingump "14/" 622436516
545                @setvar! necroSymbols 14
546            elseif ingump "15/" 622436516
547                @setvar! necroSymbols 15
548            elseif ingump "16/" 622436516
549                @setvar! necroSymbols 16
550            elseif ingump "17/" 622436516
551                @setvar! necroSymbols 17
552            elseif ingump "18/" 622436516
553                @setvar! necroSymbols 18
554            elseif ingump "19/" 622436516
555                @setvar! necroSymbols 19
556            elseif ingump "20/" 622436516
557                @setvar! necroSymbols 20
558            elseif ingump "21/" 622436516
559                @setvar! necroSymbols 21
560            elseif ingump "11/" 622436516
561                @setvar! necroSymbols 11
562            elseif ingump "10/" 622436516
563                @setvar! necroSymbols 10
564            elseif ingump "9/" 622436516
565                @setvar! necroSymbols 9
566            elseif ingump "8/" 622436516
567                @setvar! necroSymbols 8
568            elseif ingump "7/" 622436516
569                @setvar! necroSymbols 7
570            elseif ingump "6/" 622436516
571                @setvar! necroSymbols 6
572            elseif ingump "5/" 622436516
573                @setvar! necroSymbols 5
574            elseif ingump "4/" 622436516
575                @setvar! necroSymbols 4
576            elseif ingump "3/" 622436516
577                @setvar! necroSymbols 3
578            elseif ingump "2/" 622436516
579                @setvar! necroSymbols 2
580            elseif ingump "1/" 622436516
581                @setvar! necroSymbols 1
582            elseif ingump "0/" 622436516
583                @setvar! necroSymbols 0
584            endif
585        endif
586    endwhile
587endif
588
589
590if not varexist lichOne
591    @setvar! lichOne 0
592endif
593
594if not varexist lichTwo
595    @setvar! lichTwo 0
596endif
597
598if not varexist earthOne
599    @setvar! earthOne 0
600endif
601
602if not varexist earthTwo
603    @setvar! earthTwo 0
604endif
605
606if lichOne = creatureOne or lichTwo = creatureOne or earthOne = creatureOne or earthTwo = creatureOne
607    overhead "Duplicated"
608    unsetvar creatureOne
609endif
610
611if diffhits >= 30
612    if targetexists 
613        hotkey 'Cancel Current Target'
614    endif
615    while not targetexists 'beneficial'
616        if diffhits >= 60
617            cast 'Heal'
618        else
619            cast 'Greater Heal'                
620        endif
621     if skill "Swordsmanship" > 0 and findtype "cutlass|broadsword|scimitar|viking sword|longsword|katana" backpack as item
622        dclick item
623        wait minimumWaitForPing
624     endif   
625        wait 50
626        if hp = maxhp
627            hotkey '> Interrupt'
628            break
629        endif
630    endwhile
631    if targetexists 'beneficial'
632        target self
633    endif
634    replay
635endif
636
637
638if castSummonEarthElementalCount > 0
639    if diffhits < 30
640        if followers = 0
641            @setvar! followCount 0
642        elseif followers = 1
643            @setvar! followCount 1
644        elseif followers = 2
645            @setvar! followCount 2
646        elseif followers = 3
647            @setvar! followCount 3
648        elseif followers = 4
649            @setvar! followCount 4
650        elseif followers = 5
651            @setvar! followCount 5
652        endif
653        if dead earthOne or not find earthOne ground -1 -1 12
654            if followers < 4
655                while mana < 50
656                    if diffhits >= 30
657                        replay
658                    endif
659                    if timer preventOverheadSpamTimer >= cdPreventOverheadSpam
660                        overhead "waiting for mana" 88
661                        settimer preventOverheadSpamTimer 0
662                    endif
663                    wait 200
664                endwhile
665                
666                if castSummonEarthElementalAsMummy = 1
667                    if timer vengefulSpiritTimer >= cdVengefulSpirit and skill "Necromancy" >= 50
668                        yell "[VengefulSpirit"
669                        settimer vengefulSpiritTimer 0
670                        wait 500
671                    endif
672                elseif timer vengefulSpiritTimer <= cdVengefulSpirit and skill "Necromancy" >= 50
673                    overhead  "Waiting for spirit to go away" 
674                    replay
675                endif
676                while followers = followCount
677                    cast "Earth elemental"
678                    wait 500
679                    if timer witherTimer >= cdWither and skill "Necromancy" >= 95
680                        yell "[Wither"
681                        settimer witherTimer 0
682                    endif
683                    if diffhits >= 30
684                        hotkey '> Interrupt'
685                        break
686                    endif
687                endwhile
688                    if skill "Swordsmanship" > 0 and findtype "cutlass|broadsword|scimitar|viking sword|longsword|katana" backpack as item
689                    dclick item
690                    wait minimumWaitForPing
691                // 158 - an ancient mummy
692                // 14 - an earth elemental
693                if findtype 158|14 ground -1 -1 6 as myPet
694                    if noto myPet = "friend" and list petNameList > 0
695                        overhead "Renaming..."
696                        foreach petName in petNameList
697                            rename myPet petName
698                            break
699                        endfor
700                        poplist petNameList "front"
701                    endif
702                    @setvar! earthOne myPet
703                    say "all guard me"
704                    replay
705                endif
706            endif
707        endif
708    endif
709    
710    if diffhits < 30 and castSummonEarthElementalCount > 1
711        if followers = 0
712            @setvar! followCount 0
713        elseif followers = 1
714            @setvar! followCount 1
715        elseif followers = 2
716            @setvar! followCount 2
717        elseif followers = 3
718            @setvar! followCount 3
719        elseif followers = 4
720            @setvar! followCount 4
721        elseif followers = 5
722            @setvar! followCount 5
723        endif
724        if dead earthTwo or not find earthTwo ground -1 -1 12
725            if followers < 4
726                while mana < 50
727                    if diffhits >= 30
728                        replay
729                    endif
730                    if timer preventOverheadSpamTimer >= cdPreventOverheadSpam
731                        overhead "waiting for mana" 88
732                        settimer preventOverheadSpamTimer 0
733                    endif
734                    wait 200
735                endwhile
736                if timer vengefulSpiritTimer >= cdVengefulSpirit and skill "Necromancy" >= 50
737                    yell "[VengefulSpirit"
738                    settimer vengefulSpiritTimer 0
739                    wait 500
740                endif
741                while followers = followCount
742                    cast "Earth elemental"
743                    wait 500
744                    if timer witherTimer >= cdWither and skill "Necromancy" >= 95
745                        yell "[Wither"
746                        settimer witherTimer 0
747                    endif
748                    if diffhits >= 30
749                        hotkey '> Interrupt'
750                        break
751                    endif
752                endwhile
753                    if skill "Swordsmanship" > 0 and findtype "cutlass|broadsword|scimitar|viking sword|longsword|katana" backpack as item
754                    dclick item
755                    wait minimumWaitForPing
756                // 158 - an ancient mummy
757                // 14 - an earth elemental
758                if findtype 158|14 ground -1 -1 6 as myPet
759                    if noto myPet = "friend" and list petNameList > 0
760                        overhead "Renaming..."
761                        foreach petName in petNameList
762                            rename myPet petName
763                            break
764                        endfor
765                        poplist petNameList "front"
766                    endif
767                    @setvar! earthTwo myPet
768                    say "all guard me"
769                    replay
770                endif
771            endif
772        endif
773    endif
774endif
775
776
777if castSummonFireElementalCount > 0
778    if diffhits < 30
779    
780        if lichOne = 0 
781            // do nothing
782        elseif lichOne = lichTwo
783            overhead "Duplicated"
784            unsetvar lichOne
785        endif
786        
787        if followers = 0
788            @setvar! followCount 0
789        elseif followers = 1
790            @setvar! followCount 1
791        elseif followers = 2
792            @setvar! followCount 2
793        elseif followers = 3
794            @setvar! followCount 3
795        elseif followers = 4
796            @setvar! followCount 4
797        elseif followers = 5
798            @setvar! followCount 5
799        endif
800        if dead lichOne or not find lichOne ground -1 -1 12
801            if followers < 4
802                while mana < 50
803                    if diffhits >= 30
804                        replay
805                    endif
806                    if timer preventOverheadSpamTimer >= cdPreventOverheadSpam
807                        overhead "waiting for mana" 88
808                        settimer preventOverheadSpamTimer 0
809                    endif
810                    wait 200
811                endwhile
812                if timer vengefulSpiritTimer >= cdVengefulSpirit and skill "Necromancy" >= 50
813                    yell "[VengefulSpirit"
814                    settimer vengefulSpiritTimer 0
815                    wait 500
816                endif
817                @ignore lichTwo
818                while followers = followCount
819                    cast "fire elemental"
820                    wait 500
821                    if timer witherTimer >= cdWither and skill "Necromancy" >= 95
822                        yell "[Wither"
823                        settimer witherTimer 0
824                    endif
825                    if diffhits >= 30
826                        hotkey '> Interrupt'
827                        break
828                    endif
829                endwhile
830                    if skill "Swordsmanship" > 0 and findtype "cutlass|broadsword|scimitar|viking sword|longsword|katana" backpack as item
831                    dclick item
832                    wait minimumWaitForPing
833                // 24 - a lich
834                // 15 - a fire elemental
835                if findtype 24|15 ground -1 -1 6 as myPet
836                    if noto myPet = "friend" and list petNameList > 0
837                        overhead "Renaming..."
838                        foreach petName in petNameList
839                            rename myPet petName
840                            break
841                        endfor
842                        poplist petNameList "front"
843                    endif
844                    @setvar! lichOne myPet
845                    overhead "Lich One Set" 88 lichOne
846                    say "all guard me"
847                    @clearignore 
848                    replay
849                endif
850            endif
851        endif
852    endif
853    
854    if diffhits < 30 and castSummonFireElementalCount > 1
855        if followers = 0
856            @setvar! followCount 0
857        elseif followers = 1
858            @setvar! followCount 1
859        elseif followers = 2
860            @setvar! followCount 2
861        elseif followers = 3
862            @setvar! followCount 3
863        elseif followers = 4
864            @setvar! followCount 4
865        elseif followers = 5
866            @setvar! followCount 5
867        endif
868        if dead lichTwo or not find lichTwo ground -1 -1 12
869            if followers < 4
870                while mana < 50
871                    if diffhits >= 30
872                        replay
873                    endif
874                    if timer preventOverheadSpamTimer >= cdPreventOverheadSpam
875                        overhead "waiting for mana" 88
876                        settimer preventOverheadSpamTimer 0
877                    endif
878                    wait 200
879                endwhile
880                if timer vengefulSpiritTimer >= cdVengefulSpirit and skill "Necromancy" >= 50
881                    yell "[VengefulSpirit"
882                    settimer vengefulSpiritTimer 0
883                    wait 500
884                endif
885                @ignore lichOne
886                while followers = followCount
887                    cast "fire elemental"
888                    wait 500
889                    if timer witherTimer >= cdWither and skill "Necromancy" >= 95
890                        yell "[Wither"
891                        settimer witherTimer 0
892                    endif
893                    if diffhits >= 30
894                        hotkey '> Interrupt'
895                        break
896                    endif
897                endwhile
898                    if skill "Swordsmanship" > 0 and findtype "cutlass|broadsword|scimitar|viking sword|longsword|katana" backpack as item
899                    dclick item
900                    wait minimumWaitForPing                
901                // 24 - a lich
902                // 15 - a fire elemental
903                if findtype 24|15 ground -1 -1 6 as myPet
904                    if noto myPet = "friend" and list petNameList > 0
905                        overhead "Renaming..."
906                        foreach petName in petNameList
907                            rename myPet petName
908                            break
909                        endfor
910                        poplist petNameList "front"
911                    endif
912                    @clearignore
913                    @setvar! lichTwo myPet
914                    overhead "Lich Two Set" 88 lichTwo
915                    say "all guard me"
916                    replay
917                endif
918                
919            endif
920        endif
921    endif
922endif
923
924if castSummonCreatureCount = 0
925    // do nothing
926elseif castSummonCreatureCount = 1 and not dead creatureOne
927    // do nothing
928elseif castSummonCreatureCount = 1
929    if followers = 4 and diffhits < 30
930        if followers = 0
931            @setvar! followCount 0
932        elseif followers = 1
933            @setvar! followCount 1
934        elseif followers = 2
935            @setvar! followCount 2
936        elseif followers = 3
937            @setvar! followCount 3
938        elseif followers = 4
939            @setvar! followCount 4
940        elseif followers = 5
941            @setvar! followCount 5
942        endif
943        while mana < 14
944            if timer preventOverheadSpamTimer >= cdPreventOverheadSpam
945                overhead "waiting for mana" 88
946                settimer preventOverheadSpamTimer 0
947            endif
948            if diffhits >= 30
949                replay
950            endif
951            wait 200
952        endwhile
953        if timer vengefulSpiritTimer >= cdVengefulSpirit
954            yell "[VengefulSpirit"
955            settimer vengefulSpiritTimer 0
956            wait 200
957        endif
958        while followers = followCount
959            cast 'Summ. Creature'
960            wait 500
961            if diffhits >= 30
962                hotkey '> Interrupt'
963                replay
964            endif
965        endwhile
966            if skill "Swordsmanship" > 0 and findtype "cutlass|broadsword|scimitar|viking sword|longsword|katana" backpack as item
967            dclick item
968            wait minimumWaitForPing        
969        say "all guard me"
970            endif
971        endif    
972else
973    for 6
974        if index = 0
975            // do nothing
976        else
977            if diffhits < 30
978                @setvar! needToSummon 0
979                if index = 1
980                    if dead creatureOne or not find creatureOne ground -1 -1 12
981                        @setvar! needToSummon 1
982                    endif
983                elseif index = 2
984                    if dead creatureTwo or not find creatureTwo ground -1 -1 12
985                        @setvar! needToSummon 1
986                    endif
987                elseif index = 3
988                    if dead creatureThree or not find creatureThree ground -1 -1 12
989                        @setvar! needToSummon 1
990                    endif
991                elseif index = 4
992                    if dead creatureFour or not find creatureFour ground -1 -1 12
993                        @setvar! needToSummon 1
994                    endif
995                elseif index = 5
996                    if dead creatureFive or not find creatureFive ground -1 -1 12
997                        @setvar! needToSummon 1
998                    endif
999                endif
1000            
1001                if needToSummon = 1
1002                    if followers = 0
1003                        @setvar! followCount 0
1004                    elseif followers = 1
1005                        @setvar! followCount 1
1006                    elseif followers = 2
1007                        @setvar! followCount 2
1008                    elseif followers = 3
1009                        @setvar! followCount 3
1010                    elseif followers = 4
1011                        @setvar! followCount 4
1012                    elseif followers = 5
1013                        @setvar! followCount 5
1014                    endif
1015                   
1016                    while mana < 50
1017                        if diffhits >= 30
1018                            replay
1019                        endif
1020                        if timer preventOverheadSpamTimer >= cdPreventOverheadSpam
1021                            overhead "waiting for mana" 88
1022                            settimer preventOverheadSpamTimer 0
1023                        endif
1024                        wait 200
1025                    endwhile
1026                    if timer vengefulSpiritTimer >= cdVengefulSpirit and skill "Necromancy" >= 50
1027                        yell "[VengefulSpirit"
1028                        settimer vengefulSpiritTimer 0
1029                        wait 500
1030                    endif
1031   
1032                    hotkey 'Next Friendly Monster Target'
1033                    @setvar! checkLastTarget lasttarget
1034                    if checkLastTarget = earthOne
1035                        hotkey 'Next Friendly Monster Target'
1036                        @setvar! checkLastTarget lasttarget 
1037                    endif
1038                    
1039                    if checkLastTarget = earthTwo
1040                       hotkey 'Next Friendly Monster Target'
1041                       @setvar! checkLastTarget lasttarget 
1042                    endif
1043                    
1044                    if checkLastTarget = lichOne
1045                       hotkey 'Next Friendly Monster Target'
1046                       @setvar! checkLastTarget lasttarget 
1047                    endif
1048                    
1049                    if checkLastTarget = lichTwo
1050                       hotkey 'Next Friendly Monster Target'
1051                       @setvar! checkLastTarget lasttarget 
1052                    endif
1053                    @setvar! creatureOne checkLastTarget
1054                    
1055                    if find checkLastTarget ground -1 -1 6 as myPet
1056                        if noto myPet = "friend" and list petNameList > 0
1057                            overhead "Renaming..."
1058                            foreach petName in petNameList
1059                                rename myPet petName
1060                                break
1061                            endfor
1062                            poplist petNameList "front"
1063                        endif
1064                        if index = 1
1065                            if dead creatureOne or not find creatureOne ground -1 -1 12
1066                                @setvar! creatureOne myPet
1067                            endif
1068                        elseif index = 2
1069                            if dead creatureTwo or not find creatureTwo ground -1 -1 12
1070                                @setvar! creatureTwo myPet
1071                            endif
1072                        elseif index = 3
1073                            if dead creatureThree or not find creatureThree ground -1 -1 12
1074                                @setvar! creatureThree myPet
1075                            endif
1076                        elseif index = 4
1077                            if dead creatureFour or not find creatureFour ground -1 -1 12
1078                                @setvar! creatureFour myPet
1079                            endif
1080                        elseif index = 5
1081                            if dead creatureFive or not find creatureFive ground -1 -1 12
1082                                @setvar! creatureFive myPet
1083                            endif
1084                        endif
1085                    endif
1086                endif
1087            endif
1088        endif
1089        if index = castSummonCreatureCount
1090            break
1091        endif
1092    endfor
1093endif
1094
1095if castVampiricEmbrace = 1 and timer vampiricEmbraceTimer >= cdVampiricEmbrace and skill "Necromancy" >= 70 and findtype 8198 ground -1 -1 4 as jorpse
1096    say "[VampiricEmbrace"
1097    wft 500
1098    target jorpse
1099    settimer vampiricEmbraceTimer 0
1100    cooldown VampiricEmbrace cdVampiricEmbrace
1101endif
1102
1103loop