Author Topic: Trigger of the .... something  (Read 59092 times)

0 Members and 2 Guests are viewing this topic.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Trigger of the .... something
« on: June 06, 2011, 06:58:26 am »
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: [Select]
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
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.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #1 on: June 08, 2011, 10:15:35 am »
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: [Select]

<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


Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #2 on: June 09, 2011, 09:40:15 pm »
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: [Select]

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%

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #3 on: June 10, 2011, 06:10:13 pm »
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: [Select]

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

Offline Molly

  • Administrator
  • Hero Member
  • *****
  • Posts: 691
    • View Profile
Re: Trigger of the .... something
« Reply #4 on: June 11, 2011, 01:25:15 am »
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,

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

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #5 on: June 11, 2011, 08:54:47 pm »
I was just pointing out that there may be a way around the script.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #6 on: June 16, 2011, 09:56:19 pm »
Code: [Select]
Name: 'Crystal Ball to Locate a Mob.',  VNum: [  205], RNum: [  205]
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 7, Arg list: locate
Commands:
* By Rumble of The Builder Academy    tbamud.com 9091
set find %arg%
if !%find.is_pc%
  eval rname %find.room%
  %send% %actor% As you gaze into the ball, it starts to glow. You see an image of %find.name% in %rname.name%.
else
  %send% %actor% All that you see is a blurry haze.
end
%echoaround% %actor% %actor.name% peers into %actor.hisher% gently glowing crystal ball.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #7 on: June 21, 2011, 09:37:51 am »
Code: [Select]
Name: 'Open a Chest once per zone reset',  VNum: [  209], RNum: [  209]
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 100, Arg list: open
Commands:
* By Mordecai
if chest /= %arg%
  * Verify that the player typed 'open chest'
  * Has the player already opened this chest?
  context %actor.id%
  if %already_opened_chest%
    %send% %actor% The chest has already been opened, and emptied.
  else
    * The first time!  OK, open the chest.
    %send% %actor% You get a jar of naphthalene from an iron bound chest.
    %load% obj 306 %actor% inv
    set already_opened_chest 1
    global already_opened_chest
    return 0
  end
else
* Not 'open chest' - pass control back to the command parser
  return 0
end

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #8 on: June 22, 2011, 06:06:28 pm »
A voodoo doll that could actually hurt a PC?  Sounds dangerous.

Code: [Select]
Name: 'Voodoo Doll',  VNum: [ 1381], RNum: [  453]
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 2, Arg list: pin
Commands:
* By Heiach
if !%arg%
  %send% %actor% Stab a pin into a voodoo doll of who?
else
  eval dmg %arg.hitp% * 100 / %arg.maxhitp%
  if (%dmg% > 25)
    eval pain %random.15%
    switch %pain%
      case 1
        set hurt back
      break
      case 2
        set hurt head
      break
      case 3
        set hurt stomach
break
      case 4
        set hurt left eye
      break
      case 5
        set hurt chest
      break
      case 6
        set hurt right eye
      break
      case 7
        set hurt left arm
      break
      case 8
        set hurt right arm
      break
      case 9
        set hurt left leg
      break
      case 10
set hurt right leg
      break
      case 11
        set hurt groin
      break
      case 12
        set hurt left foot
      break
      case 13
        set hurt right foot
      break
      case 14
        set hurt throat
      break
      case 15
        set hurt heart
      break
      default
      break
    done
%send% %actor% You slowly push a pin into the voodoo doll of %arg.name%'s %hurt%.
    %echoaround% %actor% %actor.name% slowly pushes a pin into a voodoo doll.
    %send% %arg% You suddenly feel a sharp stabbing pain in your %hurt%!
    %echoaround% %arg% %arg.name% suddenly screams with pain, clenching %arg.hisher% %hurt%!
    %damage% %arg% 10
    wait 20 s
  elseif %dmg% < 26
    set msg %random.5%
    switch %msg%
      case 1
        %send% %actor% %arg.name% has suffered enough!
      break
      case 2
        %send% %actor% %arg.name% can't take it anymore!
      break
      case 3
        %send% %actor% %arg.name% is too weak!
      break
case 4
        %send% %actor% %arg.name% is still writhing in pain!
      break
      case 5
        %send% %actor% %arg.name% won't survive another pin!
      break
      default
      break
    done
  end
end


Offline Molly

  • Administrator
  • Hero Member
  • *****
  • Posts: 691
    • View Profile
Re: Trigger of the .... something
« Reply #9 on: June 23, 2011, 01:35:35 am »
Heh, I like that.
Can I have one.
There is someone I'd like to hurt a bit. :P

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #10 on: June 24, 2011, 07:54:26 pm »
Molly witha voodoo doll.. that sent a shiver down my spine.
Here's a script that will let your mobs load with different eq when they load.  That way each "knight" can look slightly different - even if they are the same vnum.

Code: [Select]
Name: '(2700) different eq on load',  VNum: [ 2772], RNum: [  731]
Trigger Intended Assignment: Mobiles
Trigger Type: Load , Numeric Arg: 100, Arg list: None
Commands:
switch %random.3%
  case 1
    %load% obj 2750
    wear tunic
  break
  case 2
    %load% obj 2752
    wear shirt
  break
  case 3
    %load% obj 2753
    wear vest
  break
  default
    %load% obj 2752
    wear shirt
break
done
switch %random.3%
  case 1
    %load% obj 2754
    wear pants
  break
  case 2
    %load% obj 2755
    wear trousers
  break
  case 3
    %load% obj 2756
    wear breeches
  break
  default
    %load% obj 2755
    wear trousers
  break
done
switch %random.3%
  case 1
    %load% obj 2757
    wear sandals
  break
  case 2
    %load% obj 2758
    wear shoes
  break
  case 3
    %load% obj 2760
    wear boots
  break
  default
    %load% obj 2758
    wear shoes
  break
done
switch %random.2%
  case 1
%load% obj 2751
    wear cord
  break
  case 2
    %load% obj 2759
    wear belt
  break
  default
    %load% obj 2751
    wear cord
  break
done
switch %random.2%
  case 1
    %load% obj 2714
  break
  case 2
    %load% obj 2761
    wear cloth
  break
default
    %load% obj 2761
    wear cloth
  break
done
wear all

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #11 on: June 29, 2011, 09:25:58 pm »
Let them there Wild Wester's Pan for gold!!
Code: [Select]
Name: 'Panning for gold',  VNum: [  700], RNum: [  276]
Trigger Intended Assignment: Rooms
Trigger Type: Command , Numeric Arg: 100, Arg list: p
Commands:
* Don't let someone spam the trigger to make money Take some movement points away every round and stop when they get to 10
if %actor.move% <= 10
  %send% %actor% You are too exhausted to continue.
  halt
end
* Fire on pan gold or abbreviations of each word
if %cmd% /= pan && %arg% /= gold
  eval heldobj %actor.eq(hold)%
  * Make sure they picked up the gold pan in room 703 and are holding it
  if %heldobj.vnum% == 717
    %send% %actor% You dip your pan into the river and scoop up some of the river bed and begin swirling it in the water.
    %echoaround% %actor% %actor.name% dips a pan into the river and begins panning for gold.
    * Take 10 movement points away, wait 3 seconds and give a 1 in 10 chance of success.
    nop %actor.move(-10)%
    wait 3 sec
    if %random.10% == 1
      %send% %actor% You find a small gold nugget in the bottom of your pan.
      %echoaround% %actor% %actor.name% picks something out of %actor.hisher% pan.
      * Give them a nugget
      %load% obj 718 %actor% inv
    else
      %send% %actor% You find nothing of value.
    end
  else
    %send% %actor% You need a pan for that.
  end
end


Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #12 on: July 10, 2011, 11:49:19 am »
Isn't it always a torch or a bookcase that opens up a secret door?  Well, let's just give you the script for it then.

Code: [Select]
Name: 'Pull torch - 23840',  VNum: [23840], RNum: [ 2682]
Trigger Intended Assignment: Rooms
Trigger Type: Command , Numeric Arg: 100, Arg list: pu
Commands:
if pull /= %cmd% && torch /= %arg%
  %send% %actor% The torch turns easily in your hand revealing a trap door.
  %echoaround% %actor% As %actor.name% pulls the torch a trap door swings open leading upwards.
  %door% 23840 up room 23841
  %door% 23840 up name trap door
  wait 60s
  %echo% The trap door slams itself closed as if by magic.
  %door% 23840 up purge
else
  %send% %actor% OK!
  %echoaround% %actor% You start to question the sanity of %actor.name% as they fumble about the room.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #13 on: July 12, 2011, 07:49:05 am »
Here's a way to make a magic user mob useful.  The Numeric Arg of 10, is the percent chance the script will go off while the mob is fighting (fighting being the trigger type).  So, 10% of the time while fighting this mob will cast a spell.  Though, this does go off the level of the person the magic user is fighting and only goes up to level 22, so if it was used in 4D, it'd have to be changed a bit.

Code: [Select]
Name: 'Magic User - 7009, 7200-7202',  VNum: [ 7200], RNum: [ 1050]
Trigger Intended Assignment: Mobiles
Trigger Type: Fight , Numeric Arg: 10, Arg list: None
Commands:
switch %actor.level%
  case 1
  case 2
  case 3
  break
  case 4
    dg_cast 'magic missile' %actor%
  break
  case 5
    dg_cast 'chill touch' %actor%
  break
  case 6
    dg_cast 'burning hands' %actor%
  break
  case 7
  case 8
 dg_cast 'shocking grasp' %actor%
  break
  case 9
  case 10
  case 11
    dg_cast 'lightning bolt' %actor%
  break
  case 12
    dg_cast 'color spray' %actor%
  break
  case 13
    dg_cast 'energy drain' %actor%
  break
  case 14
    dg_cast 'curse' %actor%
  break
  case 15
    dg_cast 'poison' %actor%
  break
  case 16
if %actor.align% > 0
      dg_cast 'dispel good' %actor%
    else
      dg_cast 'dispel evil' %actor%
    end
 break
  case 17
  case 18
    dg_cast 'call lightning' %actor%
  break
  case 19
  case 20
  case 21
  case 22
    dg_cast 'harm' %actor%
  break
  default
    dg_cast 'fireball' %actor%
  break
done

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Trigger of the .... something
« Reply #14 on: August 05, 2011, 09:39:35 am »
A potion that changes every time it loads or is dropped/gotten.  Rather devious if you ask me.  Of course, it's from the mind of Once.
Code: [Select]
Name: 'Potion script.',  VNum: [16928], RNum: [  982]
Trigger Intended Assignment: Objects
Trigger Type: GetLoad, Numeric Arg: 100, Arg list: None
Commands:
eval change1 %random.86%
eval change2 %random.86%
eval change3 %random.86%
if (%change1% || %change2% || %change3%) = 31
eval change1 %random.86%
eval change2 %random.86%
eval change3 %random.86%
osetval 1 %change1%
osetval 2 %change2%
osetval 3 %change3%
endif