Building & Scripting > Scripting Board

Trigger of the .... something

<< < (6/10) > >>

Kvetch:
Trying to make up for the fact I hadn't had any of the scripts on here for a while, so here's a second one:

Name: 'Room Entry - sneak check',  VNum: [  306], RNum: [  227]
Trigger Intended Assignment: Rooms
Trigger Type: Enter , Numeric Arg: 25, Arg list: None
Commands:
* By Rumble of The Builder Academy    tbamud.com 9091
if %actor.is_pc%
  if %actor.skill(sneak)% > 50
    %send% %actor% You walk into the room, not waking any of the clerics.
  else
    %send% %actor% Your entry into the room wakes a few of the clerics.
    %load% mob 340
  end
end

Basically any player that's practiced their sneak skill above 50 will be able to walk into the room without waking the clerics.  If your sneak skill isn't that good, well, good luck fighting them off.

Kvetch:
Name: 'Room Drop - Dg_cast for dropping objects by cost',  VNum: [  332], RNum: [  253]
Trigger Intended Assignment: Rooms
Trigger Type: Drop , Numeric Arg: 100, Arg list: None
Commands:
%%send%% %actor% As you drop the %object.shortdesc%, a loud humming starts to come from the walls.
wait 1
eval worth %object.cost% / 100
switch %worth%
  case 0
    %send% %actor% Your offering was NOT sufficient.
    dg_cast 'magic missile' %actor%
    break
  case 1
    %send% %actor% Your offering was just sufficient.
    dg_cast 'cure light' %actor%
    dg_cast 'clot minor' %actor%
    %purge% %object%
    break
    case 2
    %send% %actor% Your offering was sufficient.
    dg_cast 'refresh' %actor%
    %purge% %object%
    break
  default
    %send% %actor% Your offering was as it must be.
    dg_cast 'invisibility' %actor%
    %purge% %object%
    break
done

** An interesting script that allows you to drop objects and the cost of the object decides what spells you'll get cast on you.  If the object doesn't have sufficient cost then you could even be harmed. **

Kvetch:
Name: 'Mob Command - spellcasting test',  VNum: [  312], RNum: [  233]
Trigger Intended Assignment: Mobiles
Trigger Type: Command , Numeric Arg: 100, Arg list: kill
Commands:
* This command trigger will disallow anyone from trying to
* use the kill command, and will toss a magic missile at them
* for trying.
dg_cast 'magic missile' %actor%
return 0

***Interesting idea for a !kill room***

Kvetch:
Name: 'Room Command - Anti-quit',  VNum: [  314], RNum: [  235]
Trigger Intended Assignment: Rooms
Trigger Type: Command , Numeric Arg: 100, Arg list: quit
Commands:
   %send% %actor% Powerful forces keep you here.

Name: 'Obj Command - No quit',  VNum: [  315], RNum: [  236]
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 3, Arg list: q
Commands:
if %cmd.mudcommand% == quit
  %send% %actor% Divine forces prevent you from doing that.
else
  return 0
end

**The previous 2 scripts basically do the same thing – don't let the player quit.  One is on the room and one is on an object.  Either way, evil. **

Kvetch:
My main reason for putting this next trigger in is to show what to do when the command you want to use is something that is already a basic command in the game.  Things like pull, push, open, throw, or, as in this script, look. 

Name: 'Room Command - Look at Painting',  VNum: [  304], RNum: [  225]
Trigger Intended Assignment: Rooms
Trigger Type: Command , Numeric Arg: 100, Arg list: l
Commands:
* By Rumble of The Builder Academy    tbamud.com 9091
if %cmd.mudcommand% == look && painting /= %arg%
  %send% %actor% As you stare at the painting the figures seem to start moving and acting out the scenes they portray.
  %echoaround% %actor% %actor.name% stares at one of the paintings. A strange look coming over %actor.hisher% face.
else
  * If it doesn't match let the command continue. Without a return 0 a player
  * will not be able to "look" at anything else.
  return 0
end


The reason to put l in the arg list instead of just * is to limit the times this script will trigger.  If you put * in the arg list, it will trigger on any word put in as a command - which is useful if you have more than one command in a script.  If you put l in the arg list, then it'll only trigger when something that starts with l is used as a command: like look, listen, etc.

The return 0 is very important at the end because otherwise the player can't look at anything else - or even just look to refresh the room description. 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version