Author Topic: Advanced Scripts  (Read 41023 times)

0 Members and 1 Guest are viewing this topic.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
30. ZONE ECHO
« Reply #30 on: October 29, 2013, 06:41:51 pm »

30. ZONE ECHO

There is now a way to send the same echo to an entire zone, or to a

range of rooms within a zone.

Use %zecho% for sending echos to the entire zone

and %zrecho% for sending echos to a range of rooms.



The syntax for them are:

%zecho% <zone#> <message>



%zrecho% <zone#> <first room> <last room> <message>

where first room is the first room that will get the message

and last room is the last room to get it.



Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
31. PREVENT FROM USING TWO OF THE SAME ITEM
« Reply #31 on: October 29, 2013, 06:42:43 pm »
31. PREVENT FROM USING TWO OF THE SAME ITEM

This is useful if the item is very powerful, and there are more than one

location where you can wear/wield it (neck, wield, ear, ankle and legs/feet

for centaurs).

It can also be used for an action that is only triggered if the actor is

wearing/wielding a certain item.

The wear_loc numbers are the same that you get in ZEDIT when equipping a

mob.



EXAMPLE

if !%actor.varexists(whatever)%

 return 0

 %send% %actor% You are not worthy of using this item, %actor.name%

 %echoaround% %actor% {cR%actor.name% is a THIEF!{c0

else

 wait 1

 eval w1 %actor.eq(16)%

 */Primary

 eval w2 %actor.eq(28)%

 */Secondary

 if ((%w1.vnum%==5641)||(%w2.vnum%==5641))

  return 0

  %send% %actor% You are not a strong enough warrior to handle two of these items.

 endif

endif


Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
32. CHECK FOR PLAYERS IN THE ROOM
« Reply #32 on: October 29, 2013, 06:43:55 pm »
32. CHECK FOR PLAYERS IN THE ROOM

Here's how how to find out other than the actor and self are in a room:

You will need to make a LOOP that has a 'look' at all the people in the room

with it, using the '.next_in_room' variable.



for example:



eval this_room %self.room%

eval person %this_room.people%

while %person%

<do action>

eval person %person.next_in_room%

done



explained-->:



"eval this_room %self.room%"

this line creates a new local variable called 'this_room' that contains

the identity of the room that the mob (self) is in.

so whenever you refer to 'this_room' you mean the room the 'self' is in.

You can use any room fields with this variable as if it was the room itself.

IE. %this_room.<room field>%



"eval person %this_room.people%"

This line creates a new local variable called 'person' that contains the

identity of the first person in room 'this_room'.

'person' can be now used the same way you use character variables, like

%actor.name%, you can use %person.name% to return that value.



"while %person%"

This like starts a loop that runs IF %person% doesn't equal 0, or rather,

if %person% exists.



"<do action>"

these actions can be anything you like to happen to that particular individual.

I would suggest that if you want it to respond to ALL the players in

the room, you have a check like this next:



if %person.vnum%<0

say %person.name% is a player.

elseif %person.vnum%>0

say %person.name% is a mob.

else

say There is an invisible immortal in the room.

endif



"eval person %person.next_in_room%"

This line changes the data in the local variable called 'person', with the identity of the NEXT person in the room list.

so for example if you had in a room:



Bob the builder. //Bob being an pc.

Hector the heroic. //Hector being an pc.

Sally the annoying newbie. //Sally being an pc.

A young mouse nibbles at your toes. //A young mouse being a npc.



if these people were in the room, the first person in the loop would

be Bob (%person.name% == Bob), then when it did the

'eval person %person.next_in_room%' the person.next_in_room is Hector.

So (%person.name% == Hector) now.

when it gets to 'a young mouse' then %person.vnum% will be greater

than 0 (all mobs have positive vnums (as far as we are concerned) players

have a vnum equal to -1).

Once the loop gets to 'a young mouse' the next person in the room

doesn't exist. so %person%==0, or NULL, nothing.

And the loop will stop.



"Done"

Done shows the script where then end of the loop is. (not the end of

the script)

if you want the while loop to stop in the middle of looping you can

use the 'break' command.



--------------



OKAY so lets apply that to your script.



Your script is:



eval Xecks %xecks%

set xecks %xecks%

global xecks

while %xecks% !=3

mecho %self utters yada yada

wait 2

mload mob 12099

wait 10

mforce xecks say i will protect you master

wait 1

mforce xecks fol jupiter

group xecks

mforce xecks massist jupiter

eval xecks %xecks% +1

set xecks %xecks%

global xecks

done



Edited:

From the information there is, i am assuming it is a MOB

trigger set to go off in a fight.

(so i am going to offer an alternative script for you. Just

to make it 'easier'. heh.)



firstly, instead of your previous script (above), use this.

All it does is load the 'xecks' mobs.



for: mobs

type: hitperc (or fight)

narg: 99 // i put 99 because if its a hitperc trigger set at 100

arg: // it can be a lil bugged sometimes.

commands:



while (%xecks%<3)

%echo% %self.name% utters yada yada

wait 2

%load% mob 12099

eval xecks %xecks%+1

global xecks

wait 10

done



Then put THIS script on the xecks themselves:



for: Mobs

type: load

Narg: 100

arg:

commands:

wait 1

eval this_room %self.room%

eval person %this_room.people%

while %person%

wait 10

eval jupi_name %person.alias%

if %jupi_name.contains(jupiter)%

* This checks to see if the word jupiter is in 'person's' list of alias's

if %person.fighting%

* if this is true, 'jupiter' is currently fighting someone.

(and therefore is assistable)

say I will protect you master!

wait 1

assist jupiter

else

%purge% self

* The purge will remove the mob if Jupiter IS NOT fighting.

%echo% %self.name% dissappears.

end

else

%purge% self

* The purge will remove the mob if Jupiter isn't in the room.

%echo% %self.name% dissappears.

end

eval person %person.next_in_room%

done



Basically this script, goes through each person in the room that this

mob loads in, and if one of the people in the room is called jupiter

and they are fighting someone, then this mob will assist, otherwise it

will remove itself.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
33. STOP SCRIPT LOOP
« Reply #33 on: October 29, 2013, 06:44:30 pm »
33. STOP SCRIPT LOOP



A loop basically consists of an if-check and an endif.



If you want the loop to stop running the rest of the script if the

if-check is true, you put a 'halt' line at the end of the loop.

If you want the script to keep running after checking the loop, you put

a 'done' line at the end of it.


Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
34. %ACTOR% and %ACTOR.NAME%, HIS AND HERS
« Reply #34 on: October 29, 2013, 06:45:22 pm »
34. %ACTOR% and %ACTOR.NAME%, HIS AND HERS



Some players, who have chosen names that are also used for mobs, sometimes

are having problems doing the Quests, because the script code confuses them

with the mobs. Below are some info to remedy this problem as far as possible.



The difference between %actor% and %actor.name%:

%actor% is a reference to the player exactly. It's like the players unique

soul, the id number.

The script can use it directly for sending messages to, damaging and whatever.



It is also possible for the script to locate that player by name.

Which is why %actor.name% usually works as well.



Basically use %actor% with 'imm' commmands, and %actor.name% with mortal

commands. I.e.

%actor.name% needs to be used in normal commands, like tell, whisper, kill,

look, give... etc.

But %actor% needs to be used with scripts commands like: mkill, mhunt, %send%,

%echoaround%, %damage% %teleport% etc etc...



THE SEX OF THE ACTOR:



The sex of the actor is determined with %actor.sex%.

Below is the easiest way to ensure that you also get the right sex on

expressions like his/her, so you don't have to use 'their' in a script.



if %actor.sex% == male

 eval he his

 else

 eval he her

end

%echo% %actor.name% looks very cool wielding %he% dagger!



You can use a similar loop for 'he' and 'she'.



if %actor.sex% == male

 eval se he

else

 eval se she

end

%echo% %actor.name% doesn't seem to know what %se% is doing!



Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
35. %PURGE% RULES
« Reply #35 on: October 29, 2013, 06:46:37 pm »
35. %PURGE% RULES



for objects:

 when the item is worn use: %purge% %self%

 otherwise use: %purge% %self.name%



for mobs:

 %purge% without arg won't make the mob purge itself, but everything else in the room.

 To make a mob get rid of itself use: %purge% self



containers:

 If you want a script to purge a container with content, you need to purge twice,

 otherwise the content will ne on the floor.



OBS!!!!

mjunk is a safer way of purging mob inventory. (leaves no room message).

The %purge% scripts have a tendency to screw things up after the code update,

since they now can do a purge even outside the room where the mob is.

So the command line

%purge% sword

would purge the first sword it finds in the WHERE list, which might be disastrous.

This happens especially if there is no ball in the room with the script, because

someone took it away, or whatever. This is one reason for the weird equip bug where

certain items would inexplicably disappear from a player's inventory.



Go easy on the %purge% script, and consult a head builder about how to use them!


Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
36. COMMAND TRIGGERS
« Reply #36 on: October 29, 2013, 06:47:20 pm »
36. COMMAND TRIGGERS

1. Command triggers don't work for immortals, so you need a mort to test

   those scripts, or use

   atlev 50 >command>

2. If the command line is one of the usual mudcommands, you need to bypass

   it by setting the trigger up like this:



Trigger Intended Assignment: Rooms

Trigger Type: Command , Numeric Arg: 100, Arg list: *

Commands:

if %cmd.mudcommand% == sit

 %send% %actor% Go hang out somewhere else.

 %teleport% %actor% 3000

else

 return 0

endif



3. You can also set the command arg in 2 steps, like this:



Trigger Type: Command , Numeric Arg: 100, Arg list: push

Commands:

if boulder/=%arg||stone/=%arg%

 wait 1 s

 %echo% The boulder reluctantly rolls to one side.

else

 wait 1 s

 %send% %actor% push what?

endif

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
37. SET PLAYER FLAGS WITH SCRIPTS
« Reply #37 on: October 29, 2013, 06:48:18 pm »
37. SET PLAYER FLAGS WITH SCRIPTS



example:

nop %actor.is_killer(on)%



------------

SOME UNSORTED EXAMPLES:



THIEF_ASSASSIN SCRIPT

Name: 'Near Death Trap Mahatma - 6318',  VNum: [ 6300], RNum: [  618]

Trigger Intended Assignment: Mobiles

Trigger Type: Greet , Numeric Arg: 100, Arg list: None

Commands:

* Near Death Trap stuns actor and takes all of their equipment.

wait 3 sec

say Here, have a quick trip to Hell.

wait 2 sec

%send% %actor% Mahatma plunges a black dagger into your back and takes all

your equipment.

%echoaround% %actor% Mahatma plunges a black dagger into %actor.name%'s back

and takes all of %actor.hisher% equipment.

eval stunned %actor.hitp%

%damage% %actor% %stunned%

while %actor.inventory%

  eval item %actor.inventory%

  eval item_to_purge %%actor.inventory(%item.vnum%)%%

  eval stolen %item.vnum%

  %purge% %item_to_purge%

  %load% obj %stolen%

done

eval i 0

while %i% < 18

  eval item %%actor.eq(%i%)%%

  if %item%

    eval stolen %item.vnum%

    eval item_to_purge %%actor.eq(%i%)%%

    %purge% %item_to_purge%

    %load% obj %stolen%

  end

  eval i %i%+1

done



----------

This script makes a mob load and hand out random objects.



Name: 'trick or treat',  VNum: [37522], RNum: [ 4109]

Trigger Intended Assignment: Mobiles

Trigger Type: Speech , Numeric Arg: 1, Arg list: trick treat

Commands:

wait 1s

if !%actor.inventory(34016)%

shout Get lost you beggar!

halt

end

say Oh my! Don't you look .. uhh.. how do you look? Well, anyway, nice get up.

em goes to get the treat bowl.

wait 4s

em comes back holding a huge bowl filled to the brim with all sorts of things.

wait 2s

em digs in the bowl and pulls something out.

set obj1 11060

set obj2 37571

set obj3 13315

set obj4 37572

set obj5 17430

set obj6 32089

set obj7 37573

set obj8 14771

set obj9 37574

set obj10 22360

set obj11 12300

set obj12 37575

set obj13 37547

set obj14 37576

set obj15 37577

eval obj %%obj%random.15%%%

%load% obj %obj%

wait 1s

eval object %self.inventory%

eval objname %object.name%

give %objname.car% %actor.name%

say There you go! Enjoy!

end

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
38. RANDOM SPELLS ON A POTION
« Reply #38 on: October 29, 2013, 06:49:01 pm »
38. RANDOM SPELLS ON A POTION



Name: 'A Potion of Many Things',  VNum: [10116], RNum: [ 2467]

Trigger Intended Assignment: Objects

Trigger Type: Load , Numeric Arg: 100, Arg list: None

Commands:

set spell_list 1 3 4 12 14 15 16 17 18 19 20 21 28 29 33 34 36 38 39 41 43 44

46 50 51 56 57 58 59 60

extract oval %random.30% %spell_list%

osetval 1 %oval%

extract oval %random.30% %spell_list%

osetval 2 %oval%

extract oval %random.30% %spell_list%

osetval 3 %oval%

global oval

%echo% The drink bubbles and foams.


Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
39. SEX CHANGE AND ABORTION PILLS
« Reply #39 on: October 29, 2013, 06:49:59 pm »
39. SEX CHANGE AND ABORTION PILLS

OBS! You can have no waits in consume triggers!



#44603

fertility pill~

1 s 100

~

%send% %actor% You swallow a fertility pill.

%echoaround% %actor% %actor.name% hopefully swallows a fertility pill.

if %actor.sex% == female

 nop %actor.is_pregnant(on)%

 %send% %actor% It seems the Goddess Illythia made your wish come true!

 %echoaround% %actor% It seems the Goddess Illythia made %actor.name%'s wish come true!

else

 %send% %actor% Only females can get pregnant, you dork!

 %echoaround% %actor% What a dork! Next he'll ask for an abortion, no doubt.

endif

~



#44609

abortion pill~

1 s 100

~

%send% %actor% You swallow a fertility pill.

%echoaround% %actor% %actor.name% hopefully swallows an abortion pill.

if %actor.sex% == female

 nop %actor.is_pregnant(off)%

 eval amount (%actor.hitp%/2)

 %damage% %actor% %amount%

 %send% %actor% You feel a wave of nausea and a searing pain.

 %send% %actor% It's taken care of. But next time use a contraceptive instead!

 %echoaround% %actor% Really - you'd think people could use contraceptives instead!

else

 %send% %actor% Just use a condom, you dork!

 %echoaround% %actor% What a dork! Next he'll ask for a pregnancy pill, no doubt.

endif

~



num arg 2

if %cmd.mudcommand%==eat

 if ((%arg% == meat)||(%arg% == meatball))

  if %actor.sex(female)%

   nop %actor.sex(male)%

   %echo% %actor.name% eats the meatballs.

   %echo% %actor.name% has become a GIRL!

   %purge% %self%

  elseif %actor.sex(male)%

   nop %actor.sex(female)%

   %echo% %actor.name% eats the meatballs.

   %echo% %actor.name% has become a BOY!

   %purge% %self%

  endif

 else

  return 0

 endif

else

 return 0

endif

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
40. ARRAY EXAMPLES
« Reply #40 on: October 29, 2013, 06:51:25 pm »
40. ARRAY EXAMPLES



Name: 'Random Healing Spell',  VNum: [57715], RNum: [ 3668]

Trigger Intended Assignment: Rooms

Trigger Type: Speech , Numeric Arg: 100, Arg list: heal

Commands:

eval heal %random.15% -1

eval text[0] %random.5% * -10

eval text[1] %random.8% * -7

eval text[2] %random.3% * -5

eval text[3] %random.6% * -7

eval text[4] %random.2% * -3

eval text[5] %random.5% * -3

eval text[6] %random.6% * -2

eval text[7] %random.6% * -3

eval text[8] %random.1% * -1

eval text[9] %random.1% * -10

eval text[10] %random.3% * -10

eval text[11] %random.7% * -2

eval text[12] %random.4% * -8

eval text[13] %random.2% * -3

eval text[14] %random.4% * -2

set heal2 %%text[%heal%]%%

eval heal2 %heal2%

%damage% %actor% %heal2%

set heal3 -%heal2%

eval heal3 %heal3%

%send% %actor% You have been healed by %heal3% hitpoints.





This one was written by me, there a few other examples by other people such as:



Name: 'Dog Emote - 192',  VNum: [  150], RNum: [  150]

Trigger Intended Assignment: Mobiles

Trigger Type: Random , Numeric Arg: 10, Arg list: None

Commands:

eval max %random.4%

set  txt[1] sniffs at you friendlily.

set  txt[2] whimpers for some attention.

set  txt[3] growls menacingly at your feet.

set  txt[4] watches your every movement suspiciously.

set  speech %%txt[%max%]%%

eval speech %speech%

emote %speech%

Name: 'Falling Fruit',  VNum: [41005], RNum: [ 3014]

Trigger Intended Assignment: Rooms

Trigger Type: Random , Numeric Arg: 25, Arg list: None

Commands:

* Random

* Falling fruity affects

* Fruit of various descriptions falls from the tree and as it strikes

*  players it cast's various affects on them

eval numOne %random.8%

eval numTwo %random.6%

eval numThr %random.16%

*

set fruit[1] apple

set fruit[2] banana

set fruit[3] pear

set fruit[4] orange

set fruit[5] kiwi

set fruit[6] starfruit

set fruit[7] peach

set fruit[8] strawberry

set color[1] red

set color[2] orange

set color[3] yellow

set color[4] green

set color[5] blue

set color[6] purple

set spell[1] cure light

set spell[2] heal

set spell[3] poison

set spell[4] blind

set spell[5] curse

set spell[6] cure blind

set spell[7] armor

set spell[8] bless

set spell[9] cure light

set spell[10] invisibility

set spell[11] strength

set spell[12] sense life

set spell[13] bless

set spell[14] sleep

set spell[15] sanc

set spell[16] chill touch

*

set type %%fruit[%numOne%]%%

set desc %%color[%numTwo%]%%

set affect %%spell[%numThr%]%%

*

eval type %type%

eval desc %desc%

eval affect %affect%

eval target %random.char%

*

%send% %target% A %desc% %type% falls from the tree and hits you.

%echoaround% %target% A %desc% %type% falls from the tree and hits %target.name%

.

dg_cast '%affect%' %target%

wait 1 sec

%echo% The %type% falls to the ground and vanishes.





http://www.dgscripts.n3.net/







Name: 'bbv find pkers',  VNum: [*****], RNum: [ 3931]

Trigger Intended Assignment: Objects

Trigger Type: Command, Numeric Arg: 1, Arg list: locate

Commands:

if %arg%

  if %arg.omr%==mobile

    if %arg.is_pc%

      if %arg.canbeseen%

        if %arg.is_pk% 

          eval rname %arg.room%

          %send% %actor% As you gaze into the present. You see an image of %arg.name% in %rname.name%

        else

          %send% %actor% They are not PK.

        end

      else

        %send% %actor% %arg% doesn't appear to be around.

      end

    else

      %send% %actor% %arg% doesn't appear to be around.

    end

  else

    %send% %actor% That is not a player.

  end

  %echoaround% %actor% %actor.name% peers into the present.

else

  return 0

end





Name: 'Room peeker',  VNum: [25617], RNum: [ 5080]

Trigger Intended Assignment: Objects

Trigger Type: Command, Numeric Arg: 3, Arg list: peek

Commands:

switch %arg.mudcommand%

  case north

    set arg north

  break

  case south

    set arg south

  break

  case east

    set arg east

  break

  case west

    set arg west

  break

  case up

    set arg up

  break

  case down

    set arg down

  break

  default

    return 0

    halt

  break

done

eval thatRoom %%actor.room.%arg%(vnum)%%

if %thatRoom% > 0

  %send% %actor% You peek %arg%.

  dg_peek %actor% %thatRoom%

else

  %send% %actor% Where do you want to peek?

end

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Various Useful things to know
« Reply #41 on: October 29, 2013, 07:04:52 pm »
if %arg%|=carvings
will return true if the arg is car, carv, carvi, carvin, carving or carvings

nop %actor.is_pregnant(on)%
will make a character pregnant

mlag <player> <1 to 300 miliseconds>
lags said player by the amount of time stated

if %self.contained_by%== vnum
checks to see if the item with this script is in the container that equals the vnum

if %findmob.21311(21332)%
checks to see if a certain mob is in a certain room.
(the first vnum is the room, the second is the mob)
so this script is looking for mob 21332 in room 21311

%actor.room.vnum%
gives you the vnum of the room the actor is in.

%actor.room.name%
gives you the name of the room the actor is in.

%actor.room.north(room).name%
gives the name of the room to the north of the actor.

%load% obj <vnum> %actor%
loads an object directly onto the player instead of having the mob have to drop the object and the player to pick it up.


%load% obj 1234 %actor% 16
allows you to load an object (12234) directly to the wear location (16-wielded) on the actor.
Note: if the actor is already wielding something, it will go to inventory.
%load% obj 1234 %actor.eq(wield)% does the same thing.







Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
TO CHECK IF A PLAYER IS WEARING/WIELDING A CERTAIN ITEM
« Reply #42 on: October 29, 2013, 07:07:14 pm »
if %actor.eq(wield1)%

if %actor.eq(wield2)%

set wield %actor.eq(wield2)%

if %wield%

 if %wield.vnum% == 1300

 %echo% yes, that actor is wielding the correct weapon!

 end

end



if %actor.eq(neck1)%

if %actor.eq(neck1).vnum% == 1300



etc



For positions on a player for use in scripts with the %actor.eq(<position>)% thing.

"hold", WEAR_HOLD

"held", WEAR_HOLD

"light", WEAR_LIGHT

"wield", WEAR_WIELD

"wield2", WEAR_WIELD_2

"rfinger", WEAR_FINGER_R

"lfinger", WEAR_FINGER_L

"neck1", WEAR_NECK_1

"neck2", WEAR_NECK_2

"body", WEAR_BODY

"head", WEAR_HEAD

"legs", WEAR_LEGS

"feet", WEAR_FEET

"hands", WEAR_HANDS

"arms", WEAR_ARMS

"shield", WEAR_SHIELD

"about", WEAR_ABOUT

"waist", WEAR_WAIST

"rwrist", WEAR_WRIST_R

"lwrist", WEAR_WRIST_L

"face", WEAR_FACE

"eyes", WEAR_EYES

"hips", WEAR_HIPS

"legs2", WEAR_LEGS_2

"feet2", WEAR_FEET_2

"antenna", WEAR_ANTENNA

"tail", WEAR_TAIL

"horns", WEAR_HORNS

"focus", WEAR_FOCUS

The ones in the quote marks are what you can use, minus the quote marks as in:



if %actor.eq(hands)%

say You have something on your hands!

end


Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
WHEN USING ORDINARY MUDCOMMANDS IN A SCRIPT:
« Reply #43 on: October 29, 2013, 07:10:36 pm »
as first line in the script.put an * as arg under 5, and then the line

if %cmd.mudcommand%==<mud command used>

example:
if %cmd.mudcommand%==put
as first line in the script.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
LOAD OBJECTS INTO CONTAINERS
« Reply #44 on: October 29, 2013, 07:11:36 pm »
To load an object into a container use

%load% obj <vnum> %container%

*load container

%load% obj <obj vnum>

*save the reference to the container (so it doesnt get wiped when you load the next item)

set cont %loaded%

*then load each item you want to put in the container.

%load% obj <vnum> %cont.name%



etc etc...



Or use

%load% obj <obj vnum> <room vnum>

to load the object in a different room than the script is set on.



To load new objects at each zone reset

when you load the container the first time...

just save the %loaded% value in a global

so the next time you wanna put something in it...

you just keep using the %cont%

if !%cont%

 %load% obj <cont vnum>

 set cont %loaded%

 global cont

 %load% obj 12346 %cont%

else

 %load% obj 12346 %cont%

end
« Last Edit: October 29, 2013, 07:13:07 pm by Kvetch »