PDA

View Full Version : Lich (infomon?) bug causing waggle and swaggle to overextend mana



geoffire
11-29-2009, 09:55 PM
This has happened to me 6 or 7 times now, on various characters while using swaggle and waggle. It ALWAYS happens when another char is casting spells at me while the script is waiting for mana, and I've noticed it on the last cast before the script is finished and 509 being cast at me (don't know if this is always the case, just noticed it was a few of the times it happend).

Here's a log thats less than 10 seconds in game time, I bolded something I found interesting:

[waggle]>cast
>lay
You gesture.
A shadowy patch of ether rises up through the ground to encompass you, swiftly sinking into your skin.
Cast Roundtime 3 Seconds.
[ Cloak of Shadows: +0:34:00, 3:54:47 remaining. ]
[waggle: waiting for mana...]
You lie down.
Ticilo lies down.
Ticilo recites a series of mystical phrases while raising his hands...
Ticilo gestures at you.
You feel much stronger.
[ Strength: +0:18:00, 2:16:16 remaining. (Ticilo) ]
[waggle: waiting for mana...]
Ticilo recites a series of mystical phrases while raising his hands...
Ticilo gestures at you.
You feel much stronger.
[ Strength: +0:18:00, 2:34:12 remaining. (Ticilo) ]
[waggle]>prepare 712
You begin drawing a faint, twisting symbol while softly intoning the words for Cloak of Shadows...
Your spell is ready.
[waggle]>cast
You gesture.
A shadowy patch of ether rises up through the ground to encompass you, swiftly sinking into your skin.
You have overextended yourself!
You feel yourself going into shock!
Cast Roundtime 3 Seconds.
[ Cloak of Shadows: +0:34:00, 4:09:58 remaining. ]
[waggle: waiting for mana...]
It seems the spells cast at me while waiting triggers something. Looking at the waggle code i find this block, This is the only place "echo 'waiting for mana...'" is in the code:

check_mana = proc { |spell|
cost = eval(spell.cost).to_i
cost += [cost/4, 1].max if checkspell(515)
unless checkmana(cost)
# fixme: use sign of wracking if allowed
# fixme: use sigil of power if allowed
echo 'waiting for mana...'
wait_until { checkmana(eval(spell.cost)) }
end }
(cutting out an unimportant block)
cast_spell = proc { |spell, target|
spell = fix_spell.call(spell)
result = nil
loop {
check_mana.call(spell)
unless checkprep == spell.name
release_spell.call
loop {
waitrt?
waitcastrt?
check_mana.call(spell)
prepare_result = dothistimeout "prepare #{spell.num}", 8, /^You already have a spell readied! You must RELEASE it if you wish to prepare another!$|^Your spell(?:song)? is ready\.|^You can't think clearly enough to prepare a spell!$|^You are concentrating too intently .*?to prepare a spell\.$|^You are too injured to make that dextrous of a movement|^The searing pain in your throat makes that impossible|^But you don't have any mana!\.$/
(it goes on, not important for us here though)
So, Somehow the spells cast at me caused checkmana to get the green light to continue. The first cast of 509 got past the first call of 'check_mana' then the part i bolded showed it was called again. The next cast of 509 got past that check and the spell was prepared and cast.

I've since tried having one char "waiting on mana" and cast 509 at them, but can't get it to happen on demand.

Tillmen
11-29-2009, 10:02 PM
When someone else casts spells on you, and their spell ranks are known, your spells ranks are changed to match theirs just long enough to put the spell up with the correct duration. It's only a small fraction of a second, but apparently this is long enough to drop out of the wait_while because the variable mana cost spell looks like it costs less. I don't see an easy fix for this in infomon, but it should be easy enough to change waggle and swaggle to deal with it.