Name: 'Pokeball',
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 2, Arg list: *
Commands:
switch %self.vnum%
case 100
if %cmd% == choose
%load% mob 100
%force% %actor.room.people% follow %actor.name%
%force% %actor% say I choose you %actor.room.people.shortdesc%!
%load% obj 101 %actor%
%purge% %self%
else
return 0
end
break
case 101
eval check %%findmob.%actor.room.vnum%(101)%%
if %cmd% == return && %check% > 0
%purge% uniquekeyword
%load% obj 100 %actor%
%purge% %self%
else
return 0
end
break
default
return 0
break
done
obj mload 3347
obj force ssolvmoorain follow $n
obj oload 3350 111
obj force $n get empty
obj force $n group ssolvmoorain
obj goto 8
if mobhere 3347
obj echo Ssolvmoorain disappears back into its ball.
obj transfer ssolvmoo 8
obj oload 3349 1
obj force $n get ball
obj goto 8
else
obj echoat $n Huh?
obj mload 3347
obj force ssolvmoorain follow $n
obj oload 3350 111
obj force $n get empty
obj force $n group ssolvmoorain
obj goto 8
if mobhere 3347
obj echo Ssolvmoorain disappears back into its ball.
obj transfer ssolvmoo 8
obj oload 3349 1
obj force $n get ball
obj goto 8
else
obj echoat $n Huh?
Name: '"Array" Example'
Trigger Intended Assignment: Mobiles
Trigger Type: Random , Numeric Arg: 100, Arg list:
Commands:
*give %num% a random value 1-3
set num %random.3%
*create num[1], num[2], num[3]
set string[1] This is the first string of text.
set string[2] This is the second string of text.
set string[3] This is the final string of text.
*create a new variable by embedding %num% inside string[] to end up with one of the three stored strings
eval quote %%num[%num%]%%
say %quote%
I recently finished beta testing a pair of new NPCs that were originally designed to serve a functional purpose, but ended up taking on a life of their own - the Gnome Sorcerer and the Root Monster. Some background is needed first: The newbie starting area in The 7th Plane is a rose garden, where the roses are being controlled by spirit tentacles attached to their roots (located underground, accessible through a hole in the garden's center) in another plane, thus making the roses vicious and evil. The roses, being in a newbie area, are still obviously low level. They're also some of the few NPCs in the entire game that are immobile (from being rooted into the ground). As such, I've had a problem over the years with higher level player characters coming into the rose garden for easy kills (because of certain class oriented aspects that revolve around accumulation of kills), sometimes preventing actual newbies from killing them.
The Gnome Sorcerer starts in his own secret underground house, just north of the roots. He shifts planes and goes around to the spirit tentacles attached to the roots, healing and casting protective spells on them. He also routinely checks the area for signs of players. If he locates one, he chants himself there and discreetly uses a form of read aura. If the player is over a certain level of stat progression (ie: reasonably should not be in the area), he goes back underground with the roots, but in the physical plane, and performs a ritual to summon the Root Monster. Once it is created, the Gnome Sorcerer whispers the name of the player to the Root Monster, activating its primary routine.
The Root Monster has the ability to instantaneously travel to targets if there is a path of dirt (underground/field) for it to burrow through. It uses this ability to hunt down and attack its victim. In combat, it uses its tendrils as a form of entrapment, with a chance to prevent fleeing/escape. If it successfully incapacitates its victim, it will wrap the victim up in tendrils and drag him or her back through the ground to the central root structure beneath the garden. There, it simply tries to keep the player from getting away until the Gnome Sorcerer arrives. Upon the Gnome Sorcerer's arrival, he gets out a blade and cuts the player's head off. He takes the brain as a trophy, selects from a list of glib remarks to make and returns to his house to preserve the brain in a jar (the jar slowly fills up over time with various brains from his victims).
Since other players can attempt to interfere with the Gnome Sorcerer, there are a few side notes: If his blade is taken from him, he will begin trying to get it back, or even craft a new one if he has to. And since the Root Monster primarily uses 'kick' to keep victims incapacitated, the system implicitly handles the case of someone being stuck (ie: Gnome Sorcerer being prevented from getting there in a timely manner) - fatal wound incurred by being bludgeoned to death from kicks.
As a final note, there is an implicit quest connecting these two new NPCs with the area. If someone manages to kill the Root Monster, a golden rose (valuable) grows from its dead body as it sinks back into the ground, and the Gnome Sorcerer is left defenseless. If someone manages to kill the Gnome Sorcerer, the spirit tentacles are left unprotected. If someone then goes and kills each of the spirit tentacles, then the roses will stop attacking, the garden becomes peaceful and all is right with the world! Joy!
Since its creation, I've dubbed the Gnome Sorcerer my sixth pet (a term of fondness I use in referring to my favorite, and typically most devious, NPCs). Does anyone else out there have any fun pet NPCs? If so, post them!