PDA

View Full Version : Unstun script, etc



Kaldonis
12-13-2012, 12:56 PM
New to lich scripting (and mostly Ruby, too). I'm pretty good with bash scripting, C++, and some others.

Anyway, was hunting last week, and my partner died, and later complained I needed an "unstunning" script. So that was a jump kick concept to get my hands dirty.

I have a prototype, and I'm looking to expand it. The question is, does something like this exist? If it does, I might finish up my version for myself and consider it the useful learning experience it was.

If there isn't, let me give an overview of what I'm working on, and what general expansion I'm considering, and let me know if it sounds useful, or ideas that seem missing.

As a hunting script, it looks for incurred stuns of that nature (rather than constantly checking PC status). Then it checks the status of each PC in the room until it finds one who is stunned. Next is a check of if you know the unstun spell and have the mana (check your status, and cast when you can), or don't know the spell and/or don't have the mana, to look for an oaken wand, check a configuration if there is no open hand to determine how to free a hand, free a hand, get & wave the wand, put it away, and get any item back in said hand. (An MIU check might also be good here.)

The expansions can go to web and players knocked prone, at least. Dispel the web, pull to feet, drag, etc is what I had in mind. Drag could also be a last option for the unstun version. Considering a player array to not include, for example your warrior friend who can use berserk.

I am sure such a script is useful, so the question is if something of the like exists, and what something of this nature ought to encompass.

Let me know....

~daid (player of Kaldonis)

LimChori
12-13-2012, 01:14 PM
If you need a tester please let me know and I will gladly help out!

Archigeek
12-13-2012, 01:22 PM
I realize this isn't lich, but I use this as a manually started script and it works quite well. I've forgotten who gave this to me, but thank you to whomever it was. I modified it slightly to fit my own weaponry etc. With the script being called ".u" you simply type .u <name> and it stows your weapon, releases any spell you may have prepped, grabs an oak wand and unstuns whomever you've put in the <name> spot:

put put my glaes axe in my surcoat
put put my ora axe in my scabbard
put release
put get oak wand from my surcoat
put wave wand at %1
put target clear
put put wand in my surcoat

DaCapn
12-13-2012, 01:53 PM
Here is my unstun routine if you want:


$library_deflist['unstun'] = ['utility','Retrieves oaken wand from imbedsack and waves at a target; (target)']
def unstun(target=nil)
if !GameObj.pcs.any? { |pc| pc.status =~ /stun/i }
echo "### No one is stunned!"; exit
end
# Cast 108 if known
if Spell[108].known?
wait_until{ checkmana >= 8 }; waitrt?; waitcastrt?
multifput "prep 108","cast ##{GameObj.pcs.find{|pc| pc.name =~ /#{target}/i }.id}"
else
# Imbedsack failsafe
if Lich.imbedsack.nil? then echo "### Lich.imbedsack not defined!"; exit; end
# Open one hand
waitrt?
if checkleft and checkright
stoweditem = GameObj.right_hand
multifput "open my #{Lich.lootsack}","put ##{stoweditem.id} in my #{Lich.lootsack}"
end
# Get a wand
fput "open my #{Lich.imbedsack}"
wanditem = GameObj[Lich.imbedsack].contents.find { |obj| obj.name =~ /oaken wand/i }
if wanditem.nil? then echo "### No oaken wand!"
else fput "get ##{wanditem.id}"; end
# Wave wand
waitrt?; waitcastrt?
if target.nil?
fput "wave ##{wanditem.id} at ##{GameObj.pcs.find{|pc| pc.status =~ /stun/i }.id}"
else
fput "wave ##{wanditem.id} at ##{GameObj.pcs.find{|pc| pc.name =~ /#{target}/i }.id}"
end
deadwand = matchtimeout(0.1, /nothing happens/i)
# Stow wand, dead wand check
if deadwand =~ /nothing/i then multifput "drop my wand","close my #{Lich.imbedsack}"
else multifput "put my wand in my #{Lich.imbedsack}","close my #{Lich.imbedsack}"; end
# Retrieve stowed item if any
if !stoweditem.nil? then multifput "open my #{Lich.lootsack}","get ##{stoweditem.id}","close my #{Lich.lootsack}"; end
end
end

subzero
12-13-2012, 02:05 PM
The expansions can go to web and players knocked prone, at least. Dispel the web, pull to feet, drag, etc is what I had in mind

There should be a script on the repo for people knocked over called buddyup.