Building & Scripting > Scripting Board

Trigger of the .... something

(1/10) > >>

Kvetch:
I'd like to be bold and say trigger of the day, but the sites I know of that have done that haven't posted anything for about 2 years.  Trigger of the month is much too slow.  I guess it's trigger of the - whenever I feel like posting one.  Right now I've got a bunch that I've snuck off TBA along with a few of my own so we may be busy for a while.  To start with, let's use one that's actually in 4D right now, though the idea of it could have come from posts on the TBA board

Name: 'Pirate Parrot Repeat Script',  VNum: [23020], RNum: [ 5138]
Trigger Intended Assignment: Mobiles
Trigger Type: Speech, Numeric Arg: 100, Arg list: *
Commands:

--- Code: ---if %actor.vnum% < 0
  if %c%<20
    eval c 20
    global c
  end
  if !(%speech%/=!)
    eval c (%c%)+1
    global c
    set %c% %speech%
    global %c%
    eval 1 Walk the plank, ye scurvy bilgerat.
    eval 2 Weigh anchor or I'll give ye a taste of the cap'n's daughter.
    eval 3 Ahoy.  Ye scurvy dogs.
    eval 4 Avast.
    eval 5 Aye aye.
    eval 6 Arrr.
    eval 7 C'mere, me boxom beauty.
    eval 8 Well, me hearties, let's see what crawled out of the bung hole.
    eval 9 Drink up, me hearties.
    eval 10 Keelhaul that land rubber.
    eval 11 Awk. Polly wants a cracker.
    eval 12 Avast, me proud beauty. Wanna know why my Roger is so Jolly?
    eval 13 Aye, that's a hornpipe in my pocket and I am happy to see ye.
    eval 14 Prepare to be boarded.
    eval 15 That's the finest pirate booty I've ever laid eyes on. Aye.
    eval 16 That's some treasure chest you've got there.
    eval 17 That's quite a cutlass ye got thar, what ye need is a good scabbard.
    eval 18 Shiver me timbers.  That's a mighty big cannon.
    eval 19 Blow yer man down.
    eval 20 Swab the deck.
    eval count %%random.%c%%%
    set ans %%%count%%%
    eval ans %ans%
    wait %random.5%
    say %ans%
  endif
endif

--- End code ---
What  this script does is make it so the parrot can change what it says based on what's being said around it.  Works for fun, laughs and the irritation of anyone around it for any length of time.

Kvetch:
This could be fun if someone wanted to run with it - or do we have something like it and I don't know about it - that's easy to do.  Could be one of those games kind of like the arena.


--- Code: ---
<On blue paintball gun>

Name: 'Obj Command 81 - Paintball Shoot Blue',  VNum: [   96], RNum: [   96]
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 2, Arg list: shoot
Commands:
* By Rumble of The Builder Academy    tbamud.com 9091
if %arg.room% != %actor.room% || %arg.id% == %actor.id%
  %send% %actor% Shoot: Invalid Target!
  halt
end
set inroom %actor.room%
if %arg.inventory(80)%
  %echoaround% %actor% %actor.name% blasts %arg.name% with %actor.hisher% paintball gun.
  %send% %actor% You blast %arg.name%.
  %send% %arg% You lose!
  %purge% %arg.inventory(80)%
  %zoneecho% %inroom.vnum% %actor.name% shoots %arg.name%. A score for the Blue Team.
elseif %arg.inventory(81)%
  %send% %actor% They are on your team!
elseif
  %send% %actor% %arg.name% is not playing.
End

<On Red paintball gun>

Name: 'Obj Command 80 - Paintball Shoot Red',  VNum: [   97], RNum: [   97]
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 2, Arg list: shoot
Commands:
* By Rumble of The Builder Academy    tbamud.com 9091
if %arg.room% != %actor.room% || %arg.id% == %actor.id%
  %send% %actor% Shoot: Invalid Target!
  halt
end
set inroom %actor.room%
if %arg.inventory(81)%
  %echoaround% %actor% %actor.name% blasts %arg.name% with %actor.hisher% paintball gun.
  %send% %actor% You blast %arg.name%.
  %send% %arg% You lose!
  %purge% %arg.inventory(81)%
  %zoneecho% %inroom.vnum% %actor.name% shoots %arg.name%. A score for the Red Team.
elseif %arg.inventory(80)%
  %send% %actor% They are on your team!
elseif
  %send% %actor% %arg.name% is not playing.
End


--- End code ---

Kvetch:
Making it so players have to figure out some sort of combination.  Of course, there would have to be hints, clues or whatnot in the area, but here's the jest of it:


--- Code: ---
Name: 'Room Command Combination Lock',  VNum: [   92], RNum: [   92]
Trigger Intended Assignment: Rooms
Trigger Type: Command , Numeric Arg: 100, Arg list: push
Commands:
* By Rumble of The Builder Academy    tbamud.com 9091
*
* To allow multiple scripts based on this script we set a context:
  context %self.id%
* clear old var, if set.
  unset reset_buttons
* check argument
  if %arg% == red
    %send% %actor% You push the red button.
    set pushed_red 1
    global pushed_red
  elseif %arg% == yellow
    %send% %actor% You push the yellow button.
    if %pushed_red%
      set pushed_yellow 1
      global pushed_yellow
else
      set reset_buttons 1
    end
  elseif %arg% == green
    %send% %actor% You push the green button.
    if %pushed_red% && %pushed_yellow%
      set pushed_green 1
      global pushed_green
    else
      set reset_buttons 1
    end
  elseif %arg% == blue
    %send% %actor% You push the blue button.
    if %pushed_red% && %pushed_yellow% && %pushed_green%
      set pushed_blue 1
      global pushed_blue
    else
      set reset_buttons 1
    end
  elseif %arg% == purple
%send% %actor% You push the purple button.
    if %pushed_red% && %pushed_yellow% && %pushed_green% && %pushed_blue%
      %send% %actor% You hear a loud click as you push the final button.
      set reset_buttons 1
    else
      set reset_buttons 1
      end
  elseif %arg% == white
    %send% %actor% You push the white reset button.
    set reset_buttons 1
  else
    %send% %actor% Push what ?!
    halt
  end
* reset the buttons if necessary
  if %reset_buttons%
    unset reset_buttons
    unset pushed_red
    unset pushed_yellow
    unset pushed_green
unset pushed_blue
    %send% %actor% The buttons all suddenly pop back out.
  end
* send the state of the buttons
  %send% %actor% red:%pushed_red% yellow:%pushed_yellow% green:%pushed_green% blue:%pushed_blue% purple:%pushed_purple%

--- End code ---

Kvetch:
Do you want it so someone REALLY can't get rid of an item?  Got you covered.  ACtually, I'm not sure that you wouldn't be able to put the item in a container and get rid of it that way, but otherwise, it's worse than being CURSED!  Plus it's a short, easy script.

--- Code: ---
Name: '!DROP Assigner - 1332',  VNum: [ 1366], RNum: [  438]
Trigger Intended Assignment: Objects
Trigger Type: Drop Give Consume , Numeric Arg: 100, Arg list: None
Commands:
* By Rumble of The Builder Academy    tbamud.com 9091
if %actor.level% < 32
  %send% %actor% You can't get rid of %self.shortdesc%.
  return 0
end

--- End code ---

Molly:

--- Quote from: Kvetch on June 10, 2011, 06:10:13 pm ---ACtually, I'm not sure that you wouldn't be able to put the item in a container and get rid of it that way,

--- End quote ---

We have a trigger type for containers; put-in.
Have you trid if that works?

Navigation

[0] Message Index

[#] Next page

Go to full version