Back to "b" tags

backstabberAttack by tarouca

Related: Stealth backstab

1# THIS SCRIPT DEPENDS FROM:
2# SCRIPTS: backstabberSetup
3# COOLDOWNS: Tactics, Weapon Ability, Smoke Bomb, Health Potion, Hiding, Rope
4# TO SET THIS COOLDOWNS:
5# PAPERDOLL > OPTIONS > COOLDOWNS > NEW ENTRY
6# ALL COOLDOWNS SHOULD BE SET AS MENTIONED (Tactics, Weapon Ability, Smoke Bomb, Health Potion, Hiding, Rope)
7# ON EACH CHECK: HIDE WHEN INACTIVE, PAUSE DURING WORLD SAVE
8# MOUNT TOKEN
9
10# OVERHEAD MESSAGES ARE USEFUL
11# TO SETUP OVERHEAD MESSAGES:
12# RAZOR > DISPLAY/COUNTERS > OVERHEAD MESSAGES
13# CHECK: SHOW
14# ADD MESSAGE FOR: stealth steps remaining. WITH OVERHEAD OF: {3} STEPS
15# ADD MESSAGE FOR: You feel ready to continue stealthing. WITH OVERHEAD OF: RENEWED
16# ADD MESSAGE FOR: You will automatically stealth when out of steps. WITH OVERHEAD OF: RENEWED
17
18# TO SETUP ENSURE YOU EDIT THE backstabberSetup SCRIPT
19# ADJUST THE lagTimer_ TO YOUR LIKING OR LEAVE IT AS IS
20# ADJUST THE smokeBombCooldown_ TO REFLECT YOUR COOLDOWN (120000 IS THE BASE)
21# ADJUST THE useMagery_ TO 0 IF TEMPLATE HAS MAGERY < 60
22# IF MAGERY >= 60 INVISIBILITY SCROLLS ARE NEEDED
23# REGARDING SERIALS REPLACE XXXXXXXXXX BY THE SERIALS OF YOUR ITEMS:
24# IF NOT USING 2 WEAPON SKILLS, SET THE myBow_ WITH THE SAME VALUE AS myMace_
25# A MAGICAL WIZARD HAT IS NEEDED TO KEEP A DIFFERENCE IN STAMINA SO THAT ON MOVEMENT CHARACTER WONT GET OUT OF STEALTH
26# SET SERIALS FOR: myMount_, myHeadPiece_, myWizardHat_, myMace_, myBow_
27
28#ATTACK
29# UNCOMMENT EVERY CARDINAL BELOW TO GET A CONTIGENGY ON ATTACK.
30# THIS CONTIGENCY PREVENTS YOU FROM INSTANTLY ATTACKING IF YOU RUN THE SCRIPT ATTACK ON TOP OF YOUR TARGET.
31# YOU WILL HAVE TO GAIN 5 TILES OF DISTANCE WHILE THE SCRIPT IS RUNNING AND THEN APPROACH THE TARGET TO GET THE HIT.
32
33if not hidden and not mounted
34    dclick myMount_
35elseif hidden and mounted
36    dclick myMount_
37endif
38
39#setvar engageTarget_ 0
40while not dead lasttarget and hidden
41    if find myMace_ backpack
42        dclick myMace_
43    endif
44#    if find lasttarget ground -1 -1 5 and not find lasttarget ground -1 -1 3 and engageTarget_ = 0
45#        setvar engageTarget_ 1
46#    endif
47    while notStealthing_ = 1 and hidden
48        if timer "dontWalkOverheadTimer_" > dontWalkOverheadTimerTarget_
49            overhead "DONT WALK" 28
50            settimer "dontWalkOverheadTimer_" 0
51        endif
52        if insysmsg "You feel comfortable enough to begin stealthing."
53            setvar notStealthing_ 0
54            overhead "STEALTH"
55        endif
56    endwhile
57    if stam = maxstam and timer "staminaControlTimer_" > staminaControlTimerTarget_
58        dclick myWizardHat_ backpack
59        dclick myHeadPiece_ backpack
60        settimer "staminaControlTimer_" 0
61    endif
62    if checkSteps_ = 1
63        if insysmsg "You have 4 stealth steps remaining." or insysmsg "You have 3 stealth steps remaining." or insysmsg "You have 2 stealth steps remaining." 
64            overhead "WARNING" 43
65        elseif insysmsg "You have 1 stealth steps remaining." or insysmsg "You have 0 stealth steps remaining."
66            overhead "STOP" 28
67        endif
68    endif
69    if insysmsg "You have 0 stealth steps remaining." and checkSteps_ = 0
70        setvar checkSteps_ 1
71    endif
72    if insysmsg "You will automatically stealth when out of steps." and checkSteps_ = 1
73        setvar checkSteps_ 0
74    endif
75    if timer "myTargetOverheadTimer_" > myTargetOverheadTimerTarget_
76        overhead "" 38 lasttarget
77        settimer "myTargetOverheadTimer_" 0
78    endif
79#    if timer "engageOverheadTimer_" > engageOverheadTimerTarget_
80#        overhead "CANT ENGAGE" 38
81#        settimer "engageOverheadTimer_" 0
82#    endif
83    if find lasttarget ground -1 -1 3 and not find lasttarget ground -1 -1 1
84        if timer "proximityOverheadTimer_" > proximityOverheadTimerTarget_
85            overhead "NEAR TARGET" 43
86            settimer "proximityOverheadTimer_" 0
87        endif
88    elseif find lasttarget ground -1 -1 1
89        if timer "proximityOverheadTimer_" > proximityOverheadTimerTarget_
90            overhead "ON SPOT" 38
91            settimer "proximityOverheadTimer_" 0
92        endif
93#        if engageTarget_ = 1
94        cooldown "Tactics" 10000
95        cooldown "Hiding" 5000
96        attack lasttarget
97#        endif
98    endif
99endwhile
100
101if not hidden and not mounted
102    dclick myMount_
103endif
104
105while not hidden and not dead lasttarget
106    if timer "myTargetOverheadTimer_" > myTargetOverheadTimerTarget_
107        overhead "" 38 lasttarget
108        settimer "myTargetOverheadTimer_" 0
109    endif
110    if not hidden and cooldown "Tactics"
111        if find myBow_ backpack
112            dclick myBow_
113        endif
114        if not cooldown "Weapon Ability"
115            if weaponAbility_ = 1
116                say "[WeaponAbility1"    
117            elseif weaponAbility_ = 2
118                say "[WeaponAbility2"
119            else
120                say "[WeaponAbility3"
121            endif
122        endif
123        if insysmsg "You cannot perform that ability yet."
124            cooldown "Weapon Ability" 2500
125        endif
126        warmode "on"
127        attack lasttarget
128    endif
129    if not find lasttarget ground -1 -1 12 and not cooldown "Hiding"
130        overhead "TRY HIDING"
131    endif
132    if not cooldown "Smoke Bomb" and timer "smokeBombOverheadTimer_" > smokeBombOverheadTimerTarget_ and not cooldown "Hiding"
133        overhead "CAN USE SMOKE BOMB"
134        settimer "smokeBombOverheadTimer_" 0
135    endif
136    if timer "tacticsOverheadTimer_" > tacticsOverheadTimerTarget_ and not cooldown "Tactics"
137        overhead "DONT ENGAGE" 32
138        settimer "tacticsOverheadTimer_" 0
139    endif
140    if timer "rangeOverheadTimer_" > rangeOverheadTimerTarget_ and cooldown "Tactics" and find lasttarget ground -1 -1 archeryRange_
141        overhead "IN RANGE"
142        settimer "rangeOverheadTimer_" 0
143    endif
144endwhile