|
Boca Wanderer
Joined: 04 Mar 2001 Posts: 58 Location: USA
|
Posted: Fri Jan 18, 2002 12:59 pm
Spell Casting Troubles |
This problem is with my mage and spellcasting. The way I am set up
to cast spells now is based on the initial attack by the leader and
then by the result message of the spell. When I see (and there are
many) a message such as "Your * hits * hard" I autocast the next
attack spell. This worked great until I got a new class of spells
that will hit the mob 1d3+1 times so I will get 2 to 4 result messages which causes
me to cast the next spell that many times!! This creates spell lag
for me and I am often still casting after the mob is dead, or the recall
order is given, neither of which is good!
Some facts about my mud:
It is round based where you can cast 1 spell the first round, 2 the
second, 1 the third and so on.
You can tell the start of a new round by a message that looks like
this (for example) "The weaponsmaster is fighting Gli right in front
of you!". This message can appear multiple times in the round, but
always one right after the other (no prompt in between). So here is
a sample of what a round "break" would look like:
The weaponsmaster is fighting Gli right in front of you! ROUND 1
The weaponsmaster is fighting Gli right in front of you! ROUND 1
Hype lays a healing hand on Gli's wounds.
Hp:997 Mo:180 Ma:640 Sec:40 [Good] [nsw] AC:[-3] Dr:[-3] Hr:[-1]>
The weaponsmaster is fighting Gli right in front of you! ROUND 2
So the is fighting is the key, and when separated by my prompt,
and shows the start of a new round. BTW, the "is fighting" person
can be any group member, not just the leader.
Here is an example of what the "multiple" hit messages look like:
Your fists of rock hit the weaponsmaster hard.
Your fists of rock hit the weaponsmaster hard.
The weaponsmaster is dead! R.I.P.
Your blood freezes as you hear the weaponsmaster's death cry.
You receive your share of 8021 experience points.
Hp:997 Mo:171 Ma:564 Sec:33 [Good] [nesw] AC:[-3] Dr:[-3] Hr:[-1]>
mana = 612 and lastspell=fr
mana = 612 and lastspell=fr
ca 'fists of rock'
ca 'fists of rock'
It seems to me that I can try to cast based on a new round, but I want to get the max
spells cast (2 in each even round, 1 in the odd rounds). If I go this
way my autocast systems goes away and I cast when fighting only.
Or I could somehow work with the multiple "hit" messages and only cast
once per set. I was having trouble making this work.
Anyway, I sure could use some advice on how to handle this.
Thanks!
Boca |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Jan 18, 2002 11:58 pm |
If your mud is consistent with the rounds being 1/2/1/2/1/2/1/2, then you have a very simple thing to do. I assume you will always some message about your casting each round, and you will have to issue the cast command twice to get it to cast twice in that round, and you have some time in between rounds. As such a pseudo code answer to point you on your way.
#CLASS AutoCastTriggers
#TR {messages indicating casting occurred} {
#ADD Rounds 1
#T- AutoCastTriggers
#ALARM {+2} {#T+ AutoCastTriggers}
#ALARM AutoCastRound {+1} {CastForNextRound}
}
#CLASS 0
#AL CastForNextRound {
#ECHO Mana: @CurMana LastSpell: @LastSpell
#NOOP whatever checking for mana
#IF (%mod(@Rounds,2)) {ca '@LastSpell'} {ca '@LastSpell';ca '@LastSpell'}
#T+ AutoCastTriggers
}
#TR {Death message and other messages saying don't cast} {
#UNTRIGGER AutoCastRound
#NOOP other reactions might want to turn off autocaast triggers to run away or something
}
I think that should give you the idea. Basically do all your tracking off your casting message becaause that is all you can trust. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|