|
Drystin Beginner
Joined: 24 Jul 2002 Posts: 18 Location: Denmark
|
Posted: Sat Jan 11, 2003 10:17 pm
Random Casting Trigger |
Hello People i hope you can help me here.
you see i need a trigger.
This is how it should work.
You sense (*) is sending you a prayer.
My Char should then cast a random set of spells and actions to the %1 but not all kind of spells and actions, some of the has less priority like cast str or cast dex, those will only be castet like 1 out of 10 times, and others more offen then those.
also i have a var with names included so only some people has benefits of that trigger.
Is that possible ?
if so how :) |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Jan 11, 2003 11:37 pm |
Yes, it's possible:
#TRIGGER {You sense {@friends} is sending you a prayer.} {#EXEC %item(@actions, %random(1, %numitems(@actions)))}
@friends is a stringlist where each element in the list is the name of a person that is allowed to get benefits from the trigger. Your actions and spells will be in the @actions stringlist. Each one will appear just as you would type them. If you want one to be selected more often, put it more than once in the list. Example, if there are 10 items in the list and three are "cast str", then "cast str" has a 30% probability of being selected while the others have a 10% probability (assuming they each appear only once).
Kjata |
|
|
|
theoldone Novice
Joined: 31 Dec 2002 Posts: 41 Location: USA
|
Posted: Thu Jan 16, 2003 2:13 am |
I don't understand how this works
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Jan 16, 2003 2:49 am |
What exactly don't you understand? To make it work, just copy and paste the script provided into zMUD's command line and press Enter. Then create the two needed variables described in the previous reply.
Kjata |
|
|
|
theoldone Novice
Joined: 31 Dec 2002 Posts: 41 Location: USA
|
Posted: Thu Jan 16, 2003 8:48 pm |
I don't understand how to set up the variables
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Jan 16, 2003 11:18 pm |
@friends is a stringlist with the names of the people allowed to get the benefits. Like so:
#VAR friends {Kjata|Zugg|theoldone}
@actions is a stringlist with the possible commands the script will execute. If a command appears more than once, it has more chances of being selected. Like so:
#VAR actions {cast str|cast dex|cast dex|cast int|cast str|cast str}
In this case the only possible commands that can be executed are either "cast str", "cast dex" or "cast int". However, "cast int" has a probability of being selected of 1/6, "cast dex" 1/3 and "cast str" 1/2.
Kjata |
|
|
|
|
|