If I understood you correctly then here's what you want...
You want to use an alias that passes two wildcards,
the first of which (A) is the venom you want to secrete
and bite with, and the second one (B) is the one you want to illusion before the actual bite.
Then you want to have a list of illusion messages for
each venom, from which you can choose a message by
matching it against (B) and send it to the world along
with illusion syntax ("conjure illusion")
In other words, what I understood, comes down to:
a) (alias 'bite * *') do -> bite sumac xentio
b) secrete sumac
c) wait for balance recovery
d) illusion xentio; bite sumac
Or is %2 in that alias the name of your target? It's still a bit confusing the way it is now, sorry.
I might have it all wrong here and the following is hence utterly useless, but I decided to propose a solution to the problem, as I undestand it, anyway.
Here's the proposed solution. You'll need to copy and paste the aliases, triggers and scripts into your world file and main script file, as well as make sure that no already existing aliases and, more importantly, triggers will get in the way of the new ones. Also, as this was written in the space of 10 minutes on my lap, and the only connection I have to Snakes in Achaea is being robbed by them
regularly, you'll need to make sure the command syntax is consistent and that it generally does what you want it to.
<alias name="BiteIllusion" enabled="y" match="bite * *" script="SelectBiteIllusion" />
<trigger
name="BalanceRecovered"
match="*You have recovered balance on all limbs."
script="DoBiteIllusion"
enabled="n"
sequence="100"
>
</trigger>
Here's the script to make it all work:
'---> These are the variables you'll need, first 3 are
' processed completely in the provided script
' but 'targetVar' is whatever variable you use for your
' target, so replace it with your own in sub
' DoBiteIllusion (and delete it from the declaration if
' it is declared elsewhere already).
dim venomMessage, illusionMessage, secreteVenom, targetVar
'----> This populates the 2 arrays - venomMessage and
' secreteVenom - for storing illusion messages of
' various venoms and names of those venoms,
' respectively. You should specify this sub in Events
' (or whatever it is called)
' under Scripting in World Properties, to be run when
' you open your world. Also fill in the missing
' declarations, venom names and messages
sub OnWorldOpen
venomMessage(1) = "Venom1 message here."
venomMessage(2) = "Venom2 message here."
....
venomMessage(N) = "VenomN message here."
secreteVenom(1) = "sumac"
secreteVenom(2) = "aconite"
...
secreteVenom(N) = "gecko"
end sub
'--->From here you can go by the numbers, just remember
' what venom has what number and use those numbers in
' the SelectBiteIllusion alias. %1 in alias defines what
' venom will be secreted, %2 - what venom will be
' illusioned.
sub SelectBiteIllusion (name, output, wildcs)
dim indxIllusion, indxVenom
indxIllusion = cint(wildcs(2))
indxVenom = cint(wildcs(1))
illusionMessage = "conjure illusion " & venomMessage(indxIllusion)
world.send "secrete " & secreteVenom(indxVenom)
world.enabletrigger "BalanceRecovered", TRUE
end sub
sub DoBiteIllusion (name, output, wildcs)
world.send IllusionMessage
world.send "bite " & targetVar
world.enabletrigger "BalanceRecovered", FALSE
end
P.S. If this is not what you actually need, specify the problem in more detail.
I guess it could all be put into a plugin, but I am too lazy to write one from start to finish right now. |