40. ARRAY EXAMPLES
Name: 'Random Healing Spell', VNum: [57715], RNum: [ 3668]
Trigger Intended Assignment: Rooms
Trigger Type: Speech , Numeric Arg: 100, Arg list: heal
Commands:
eval heal %random.15% -1
eval text[0] %random.5% * -10
eval text[1] %random.8% * -7
eval text[2] %random.3% * -5
eval text[3] %random.6% * -7
eval text[4] %random.2% * -3
eval text[5] %random.5% * -3
eval text[6] %random.6% * -2
eval text[7] %random.6% * -3
eval text[8] %random.1% * -1
eval text[9] %random.1% * -10
eval text[10] %random.3% * -10
eval text[11] %random.7% * -2
eval text[12] %random.4% * -8
eval text[13] %random.2% * -3
eval text[14] %random.4% * -2
set heal2 %%text[%heal%]%%
eval heal2 %heal2%
%damage% %actor% %heal2%
set heal3 -%heal2%
eval heal3 %heal3%
%send% %actor% You have been healed by %heal3% hitpoints.
This one was written by me, there a few other examples by other people such as:
Name: 'Dog Emote - 192', VNum: [ 150], RNum: [ 150]
Trigger Intended Assignment: Mobiles
Trigger Type: Random , Numeric Arg: 10, Arg list: None
Commands:
eval max %random.4%
set txt[1] sniffs at you friendlily.
set txt[2] whimpers for some attention.
set txt[3] growls menacingly at your feet.
set txt[4] watches your every movement suspiciously.
set speech %%txt[%max%]%%
eval speech %speech%
emote %speech%
Name: 'Falling Fruit', VNum: [41005], RNum: [ 3014]
Trigger Intended Assignment: Rooms
Trigger Type: Random , Numeric Arg: 25, Arg list: None
Commands:
* Random
* Falling fruity affects
* Fruit of various descriptions falls from the tree and as it strikes
* players it cast's various affects on them
eval numOne %random.8%
eval numTwo %random.6%
eval numThr %random.16%
*
set fruit[1] apple
set fruit[2] banana
set fruit[3] pear
set fruit[4] orange
set fruit[5] kiwi
set fruit[6] starfruit
set fruit[7] peach
set fruit[8] strawberry
set color[1] red
set color[2] orange
set color[3] yellow
set color[4] green
set color[5] blue
set color[6] purple
set spell[1] cure light
set spell[2] heal
set spell[3] poison
set spell[4] blind
set spell[5] curse
set spell[6] cure blind
set spell[7] armor
set spell[8] bless
set spell[9] cure light
set spell[10] invisibility
set spell[11] strength
set spell[12] sense life
set spell[13] bless
set spell[14] sleep
set spell[15] sanc
set spell[16] chill touch
*
set type %%fruit[%numOne%]%%
set desc %%color[%numTwo%]%%
set affect %%spell[%numThr%]%%
*
eval type %type%
eval desc %desc%
eval affect %affect%
eval target %random.char%
*
%send% %target% A %desc% %type% falls from the tree and hits you.
%echoaround% %target% A %desc% %type% falls from the tree and hits %target.name%
.
dg_cast '%affect%' %target%
wait 1 sec
%echo% The %type% falls to the ground and vanishes.
http://www.dgscripts.n3.net/Name: 'bbv find pkers', VNum: [*****], RNum: [ 3931]
Trigger Intended Assignment: Objects
Trigger Type: Command, Numeric Arg: 1, Arg list: locate
Commands:
if %arg%
if %arg.omr%==mobile
if %arg.is_pc%
if %arg.canbeseen%
if %arg.is_pk%
eval rname %arg.room%
%send% %actor% As you gaze into the present. You see an image of %arg.name% in %rname.name%
else
%send% %actor% They are not PK.
end
else
%send% %actor% %arg% doesn't appear to be around.
end
else
%send% %actor% %arg% doesn't appear to be around.
end
else
%send% %actor% That is not a player.
end
%echoaround% %actor% %actor.name% peers into the present.
else
return 0
end
Name: 'Room peeker', VNum: [25617], RNum: [ 5080]
Trigger Intended Assignment: Objects
Trigger Type: Command, Numeric Arg: 3, Arg list: peek
Commands:
switch %arg.mudcommand%
case north
set arg north
break
case south
set arg south
break
case east
set arg east
break
case west
set arg west
break
case up
set arg up
break
case down
set arg down
break
default
return 0
halt
break
done
eval thatRoom %%actor.room.%arg%(vnum)%%
if %thatRoom% > 0
%send% %actor% You peek %arg%.
dg_peek %actor% %thatRoom%
else
%send% %actor% Where do you want to peek?
end