Welcome to the Builder Academy

Question Trigger of the Day - Object Load on Enter/Leave

More
22 Aug 2012 23:06 #730 by Rumble
Code:
Name: 'Mob Quest Example Load 8ball - 22', VNum: [ 189], RNum: [ 188] Trigger Intended Assignment: Rooms Trigger Type: Enter , Numeric Arg: 100, Arg list: None Commands: * By Rumble of The Builder Academy tbamud.com 9091 * Check if the 8ball is already in the room. If not load it. * I know this only checks the first item in the room, I don't really care. KISS if %self.contents.vnum% != 47 %load% obj 47 end wait 2 sec %echoaround% %actor.name% A magic eight ball drops from the sky striking %actor.name% on the head. %send% %actor% A magic eight ball drops from the sky striking you on the head. %damage% %actor% %random.5%
Code:
Name: 'TBA Magic Eight Ball Check - 26', VNum: [ 188], RNum: [ 187] Trigger Intended Assignment: Mobiles Trigger Type: Leave , Numeric Arg: 100, Arg list: None Commands: * By Rumble of The Builder Academy tbamud.com 9091 * Check to see if the person is not carrying the magic eight ball if !%actor.has_item(47)% * They are not carrying it. So stop them and give them one. * Return 0 ignores their command to go west. They stay in the room. return 0 wait 1 sec say You forgot your magic eight ball. Take this one. * Loads the object to the actors inventory. %load% obj 47 %actor% %send% %actor% %self.name% gives you the magic eight ball. end
If this was helpful please vote or leave a review for TBA.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

  • Scarman
  • Visitor
  • Visitor
15 Feb 2013 22:40 #1515 by Scarman
How can I use this code to load an object into a container in the room? I want the container to be reloaded with a quest item upon exit or after a certain period of time. No matter what I try, it just loads the object into the room.

Please Log in or Create an account to join the conversation.

More
15 Feb 2013 23:22 #1516 by Rumble
This is unfortunately a bit complicated. The easiest way is to have a mob do it. If you don't want the player to see the mob putting it into the container use %at% 0. Below is a trig of a bartender filling a pack of cigarettes using at 0 to not spam players.
Code:
Name: 'Order Beer and Cigs', VNum: [18101], RNum: [ 2184] Trigger Intended Assignment: Mobiles Trigger Type: Command , Numeric Arg: 100, Arg list: order Commands: if %cmd% == order && %arg% == beer %send% %actor% %self.name% takes your order and heads for the bar room to get your beer. wait 100 %send% %actor% %self.name% returns with your beer and places it by you. %echoaround% %actor% %self.name% returns from the bar room with a beer and places it infront of %actor.name%. %load% obj 18104 give pint %actor.name% elseif %cmd% == order && %arg% == cigarettes %send% %actor% %self.name% takes your order and heads for the bar room to get your cigarettes. eval cigcount 1 while (%cigcount% <= 20) %at% 0 %load% obj 18105 eval cigcount %cigcount% + 1 done %at% 0 %load% obj 18106 %at% 0 put all pack wait 100 %send% %actor% %self.name% returns from the bar room with your cigarettes and hands them to you. %echoaround% %actor% %self.name% returns from the bar room with a pack of cigarettes and hands them to %actor.name%. give pack %actor.name%

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

  • Scarman
  • Visitor
  • Visitor
16 Feb 2013 00:18 - 16 Feb 2013 00:20 #1518 by Scarman
Wow. Thanks for the quick response.

Is there a way to just purge the container and reload the container itself. Kind of like a zone reset for rooms. I am sorry I am kind of new at this. The quest is to retrieve an amulet off a dead corpse(container) but I want the amulet to respawn before the zone resets. I suppose I could add a mob into the room and use this code but that isn't exactly what I would like to do. Is there a way to reset the room upon leave? There are no other objects or mobs that will spawn in this room, just the container and the quest item within.
Last edit: 16 Feb 2013 00:20 by Scarman. Reason: Added last sentence.

Please Log in or Create an account to join the conversation.

More
16 Feb 2013 01:05 #1519 by Rumble
You could make a hidden or invis mob and have it check for the item and then put the item into the corpse when the player leaves if it isn't there.

help trig-mob-leave

Or you can reload it when the player takes the object

help trig-obj-get

Or you can make it look like the player takes the object but never really let him, just load a new one and echo the "you get an amulet from the corpse of..."

help trig-obj-command with %load% obj

HELP TRIG-TYPE and pick which one works best for you.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

Time to create page: 0.243 seconds