Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Drystin
Beginner


Joined: 24 Jul 2002
Posts: 18
Location: Denmark

PostPosted: 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 :)
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
theoldone
Novice


Joined: 31 Dec 2002
Posts: 41
Location: USA

PostPosted: Thu Jan 16, 2003 2:13 am   
 
I don't understand how this works
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
theoldone
Novice


Joined: 31 Dec 2002
Posts: 41
Location: USA

PostPosted: Thu Jan 16, 2003 8:48 pm   
 
I don't understand how to set up the variables
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net