Welcome to the Builder Academy

Question Trigger of the Day - Disallow Storing Keys

More
20 Jun 2012 13:09 - 25 Jun 2012 09:51 #112 by Rumble
By Axanon
Sometimes it can be problematic if a key is maxload 1 and is being stored in a house. To prevent this situation, I came up with an easy little script to stop this from happening. Just attach it to the house (or any room you don't want keys dropped in).
Code:
Name: '[R:VARIOUS] Disallow Storing Keys in Houses' Trigger Intended Assignment: Rooms Trigger Type: Drop , Numeric Arg: 100, Arg list: None Commands: if %object.type% == KEY %send% %actor% The storing of keys in houses is not allowed. return 0 end if %object.type% == CONTAINER set i %object.contents% while %i% set next %i.next_in_list% if %i.type% == KEY %send% %actor% You may not drop containers here while there is a key inside. return 0 end set i %next% done end
NOTE: A good practice is to ensure keys load more than one instance since key storage in a house is no different from a character always idling with keys to hoard them. Single instance keys are a bad idea since if a player dies behind a door with the only key in their corpse they have no way to get back. Also, keys should always be the first dependent object loaded to a mob so they don't rely on other equipment loading to the mob prior to it.

If this was helpful please vote or leave a review for TBA.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com
Last edit: 25 Jun 2012 09:51 by Rumble.

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

Time to create page: 0.169 seconds