Okie.. I know I'm asking a ton of questions, but this should be the last one im gonna need.
When someone casts a spell such as (spell cast msg)"resistin lotsa phys", i want it to store what that spell was (not using the spell cast msg, but one defined by myself) so that when that particular spell wears off it will recall what type of spell it was. I'm asking this because there are a bunch of spells in the mud that I play that have the same down message, and if i set a trig, its only rigged to one of the types of that spell.. :/
umm... ok, I think that your wanting a bunch of different spell incantations, so im going to give you a few:
resistin lotsa phys - Physical
major burn res - Fire
klizu antifreez merc - Cold
major brain shield - Psionic
each of those spells are greater invulnerability spells, and they all have the same down message: "Your greater invulnerability spell wears off." I want it to store what type of spell it is, then put it in the msg to the world kinda like: "party say -=- Greater {XXX} is OFF -=-" or sumthin. Since they all have the exact down message, i need it to recall what spell was cast.
In the mud that I play, there are spells that protect against different damage types. Greater & lesser invulnerability spells, and they have different messages for when they are casted, but they all have the same down message, either "Your greater invulnerability spell wears off."(greater) or "Your lesser invulnerability spell wears off."(lesser).
I created a trigger for the greater down message, but that only works for the one spell that i created it for. I want the trigger to store what type of greater spell was cast, and then have it recall what type was cast when the spell wears off so that i dont have to have the same down msg for the different types.
I dont know if it makes any sense, but i could just create one generic one, but that wouldnt be very cool at all. :)
OK, I get it. You might be able to squeeze the desired results out without scripting, assuming you only have one spell type cast at once.
First, is to record the type of resistance you now have, based on the message when the spell is cast, so do this:
Trigger: You feel more resistant to * damage.
Send: %1
Send to: Variable (label is name)
Label: SpellType
You might want to set "change colour to" a different colour to confirm that you have matched on the trigger, and to alert you to it. Also maybe play a sound if you want.
What this does is send %1 (the first wildcard, namely the spell type) to the variable "spelltype".
You can test this by getting the spell cast, then checking the MUSHclient variables configuration screen. You should see a variable "spelltype" set to the type of spell, eg. "fire".
Then make a second trigger for when the spell wears off ...
Trigger: ^Your (greater|lesser) invulnerability spell wears off\.$
Send: Your resistance to @spelltype has now worn off.
Send to: Output
Regular expression: checked
Expand variables: checked
When the message about the greater/lesser invulnerability spell wearing off arives, it will send the message to "output" (ie. your own window, not the MUD), and include the "spelltype" variable (because of the "@").
This is what I saw in my test ...
Your greater invulnerability spell wears off.
Your resistance to Fire has now worn off.
The only thing this won't do is handle if you have multiple simultaneous spells. In that case you would need to use some scripting to store more than one of them. However I don't see how it could work out which one had worn off, as the "wear off" message is the same all the time, which is why you wanted to do this in the first place.
hey, thanks. This should work, and since you can have greater/lessers both on, could i just change the @spelltype variable to maybe a different variable name and still recieve the same variable effect?