backstabberAttack by tarouca
# THIS SCRIPT DEPENDS FROM:
# SCRIPTS: backstabberSetup
# COOLDOWNS: Tactics, Weapon Ability, Smoke Bomb, Health Potion, Hiding, Rope
# TO SET THIS COOLDOWNS:
# PAPERDOLL > OPTIONS > COOLDOWNS > NEW ENTRY
# ALL COOLDOWNS SHOULD BE SET AS MENTIONED (Tactics, Weapon Ability, Smoke Bomb, Health Potion, Hiding, Rope)
# ON EACH CHECK: HIDE WHEN INACTIVE, PAUSE DURING WORLD SAVE
# MOUNT TOKEN
# OVERHEAD MESSAGES ARE USEFUL
# TO SETUP OVERHEAD MESSAGES:
# RAZOR > DISPLAY/COUNTERS > OVERHEAD MESSAGES
# CHECK: SHOW
# ADD MESSAGE FOR: stealth steps remaining. WITH OVERHEAD OF: {3} STEPS
# ADD MESSAGE FOR: You feel ready to continue stealthing. WITH OVERHEAD OF: RENEWED
# ADD MESSAGE FOR: You will automatically stealth when out of steps. WITH OVERHEAD OF: RENEWED
# TO SETUP ENSURE YOU EDIT THE backstabberSetup SCRIPT
# ADJUST THE lagTimer_ TO YOUR LIKING OR LEAVE IT AS IS
# ADJUST THE smokeBombCooldown_ TO REFLECT YOUR COOLDOWN (120000 IS THE BASE)
# ADJUST THE useMagery_ TO 0 IF TEMPLATE HAS MAGERY < 60
# IF MAGERY >= 60 INVISIBILITY SCROLLS ARE NEEDED
# REGARDING SERIALS REPLACE XXXXXXXXXX BY THE SERIALS OF YOUR ITEMS:
# IF NOT USING 2 WEAPON SKILLS, SET THE myBow_ WITH THE SAME VALUE AS myMace_
# A MAGICAL WIZARD HAT IS NEEDED TO KEEP A DIFFERENCE IN STAMINA SO THAT ON MOVEMENT CHARACTER WONT GET OUT OF STEALTH
# SET SERIALS FOR: myMount_, myHeadPiece_, myWizardHat_, myMace_, myBow_
#ATTACK
# UNCOMMENT EVERY CARDINAL BELOW TO GET A CONTIGENGY ON ATTACK.
# THIS CONTIGENCY PREVENTS YOU FROM INSTANTLY ATTACKING IF YOU RUN THE SCRIPT ATTACK ON TOP OF YOUR TARGET.
# YOU WILL HAVE TO GAIN 5 TILES OF DISTANCE WHILE THE SCRIPT IS RUNNING AND THEN APPROACH THE TARGET TO GET THE HIT.
if not hidden and not mounted
dclick myMount_
elseif hidden and mounted
dclick myMount_
endif
#setvar engageTarget_ 0
while not dead lasttarget and hidden
if find myMace_ backpack
dclick myMace_
endif
# if find lasttarget ground -1 -1 5 and not find lasttarget ground -1 -1 3 and engageTarget_ = 0
# setvar engageTarget_ 1
# endif
while notStealthing_ = 1 and hidden
if timer "dontWalkOverheadTimer_" > dontWalkOverheadTimerTarget_
overhead "DONT WALK" 28
settimer "dontWalkOverheadTimer_" 0
endif
if insysmsg "You feel comfortable enough to begin stealthing."
setvar notStealthing_ 0
overhead "STEALTH"
endif
endwhile
if stam = maxstam and timer "staminaControlTimer_" > staminaControlTimerTarget_
dclick myWizardHat_ backpack
dclick myHeadPiece_ backpack
settimer "staminaControlTimer_" 0
endif
if checkSteps_ = 1
if insysmsg "You have 4 stealth steps remaining." or insysmsg "You have 3 stealth steps remaining." or insysmsg "You have 2 stealth steps remaining."
overhead "WARNING" 43
elseif insysmsg "You have 1 stealth steps remaining." or insysmsg "You have 0 stealth steps remaining."
overhead "STOP" 28
endif
endif
if insysmsg "You have 0 stealth steps remaining." and checkSteps_ = 0
setvar checkSteps_ 1
endif
if insysmsg "You will automatically stealth when out of steps." and checkSteps_ = 1
setvar checkSteps_ 0
endif
if timer "myTargetOverheadTimer_" > myTargetOverheadTimerTarget_
overhead "▼" 38 lasttarget
settimer "myTargetOverheadTimer_" 0
endif
# if timer "engageOverheadTimer_" > engageOverheadTimerTarget_
# overhead "CANT ENGAGE" 38
# settimer "engageOverheadTimer_" 0
# endif
if find lasttarget ground -1 -1 3 and not find lasttarget ground -1 -1 1
if timer "proximityOverheadTimer_" > proximityOverheadTimerTarget_
overhead "NEAR TARGET" 43
settimer "proximityOverheadTimer_" 0
endif
elseif find lasttarget ground -1 -1 1
if timer "proximityOverheadTimer_" > proximityOverheadTimerTarget_
overhead "ON SPOT" 38
settimer "proximityOverheadTimer_" 0
endif
# if engageTarget_ = 1
cooldown "Tactics" 10000
cooldown "Hiding" 5000
attack lasttarget
# endif
endif
endwhile
if not hidden and not mounted
dclick myMount_
endif
while not hidden and not dead lasttarget
if timer "myTargetOverheadTimer_" > myTargetOverheadTimerTarget_
overhead "▼" 38 lasttarget
settimer "myTargetOverheadTimer_" 0
endif
if not hidden and cooldown "Tactics"
if find myBow_ backpack
dclick myBow_
endif
if not cooldown "Weapon Ability"
if weaponAbility_ = 1
say "[WeaponAbility1"
elseif weaponAbility_ = 2
say "[WeaponAbility2"
else
say "[WeaponAbility3"
endif
endif
if insysmsg "You cannot perform that ability yet."
cooldown "Weapon Ability" 2500
endif
warmode "on"
attack lasttarget
endif
if not find lasttarget ground -1 -1 12 and not cooldown "Hiding"
overhead "TRY HIDING"
endif
if not cooldown "Smoke Bomb" and timer "smokeBombOverheadTimer_" > smokeBombOverheadTimerTarget_ and not cooldown "Hiding"
overhead "CAN USE SMOKE BOMB"
settimer "smokeBombOverheadTimer_" 0
endif
if timer "tacticsOverheadTimer_" > tacticsOverheadTimerTarget_ and not cooldown "Tactics"
overhead "DONT ENGAGE" 32
settimer "tacticsOverheadTimer_" 0
endif
if timer "rangeOverheadTimer_" > rangeOverheadTimerTarget_ and cooldown "Tactics" and find lasttarget ground -1 -1 archeryRange_
overhead "IN RANGE"
settimer "rangeOverheadTimer_" 0
endif
endwhile