Mobs in Places

For builders to discuss and ask building questions.
Post Reply
Melusine
Staff
Staff
Posts: 1975
Joined: Tue Jul 25, 2006 5:40 am
Location: The Moonwood

Mobs in Places

Post by Melusine » Thu Apr 15, 2010 5:06 am

Hi there! So I had another question about a quest I'm working on while building my area here... The basic thing I want to happen is the PC walks into one room, and then the mob loads into the next room over. It isn't a mob that I want to be there all the time... What is the easiest way to do this? I've tried going through the lessons and posts on the forum here, but either I'm not seeing what's there, or I'm not putting something together here. The first room will have another mob that I'm doing an echo through, and I'd prefer to have the mob appear after that, if possible.

Any suggestions/help would be greatly appreciated :)


(Edited to make my meaning a bit clearer...)
Anastacia Syria, Truescar of Loviatar
User avatar
Kregor
Sword Grand Master
Sword Grand Master
Posts: 1474
Joined: Sun Jul 11, 2004 6:14 am
Location: Baldur's Gate

Re: Mobs in Places

Post by Kregor » Thu Apr 15, 2010 6:34 am

Okay, here we go...

You have two rooms, room A and room B. Room A has Mobile A, which is the one that is in the room the PC walks into.

On Mobile A, you will need a greet_prog (or could be a rand_prog with a fair percentage, if you want a slight delay for the echo and the magic). This greet_prog should contain the echo you want upon PC entry. In addition, it will need to have a mpmload command for Mobile B to load in Room B. The magic to make this mobile load in another room, is the mpat command. This command instructs Mobile A to go to Room B, and pop back to Room A without you even seeing it.

Quick example:

Code: Select all

>greet_prog 100~
mpecho {80}A large rumble sounds in the room to the west!
mpat <vnum of Room B> mpmload <vnum of Mobile B>
~
Now, that's the simple form, however, it doesn't take into account that someone might have already summoned Mobile B and he's already waiting there. So to this prog you also need to add a check to make sure there isn't already a mobile there, so our edited prog looks more like this:

Code: Select all

>greet_prog 100~
mpecho {80}A large rumble sounds in the room to the west!
if mobinroom(<vnum of room B>) == 0
  mpat <vnum of Room B> mpmload <vnum of Mobile B>
endif
~
So, that way, if the mobile is already there, the second part of the prog within the if check will not trigger.

The second part of the equation, because I know this will be the next step in your parade. if you don't want Mobile B hanging around in Room B all wounded or affected or qbit set or what have you, you need to put some sort of rand_prog on Mobile B that will purge him after a period of time.

BUT, you don't want Mobile B to purge itself likely while a PC is in the room, so, you would want a check for PCs in the room on that rand_prog. Quick example for Mobile B's purge prog:

Code: Select all

>rand_prog 1~
if pcinroom($i) == 0
  mpgoto 3
endif
~
That should get you started. It will ultimately get more complex once I know the exact purpose and premise behind the mobile in the next room, but there's the basics. :)
"There is no safety for honest men except by believing all possible evil of evil men."

Kregor - Ranger of Tangled Trees
Rozor - Lady Luck's Duelist
Tygen - Ranger-Bard of Mielikki
Melusine
Staff
Staff
Posts: 1975
Joined: Tue Jul 25, 2006 5:40 am
Location: The Moonwood

Re: Mobs in Places

Post by Melusine » Thu Apr 15, 2010 7:07 am

Brilliant! Thank you :)

That part was tripping me up.. the rest of what I want him to do seems fairly simple, but that one part eluded me. Thank you very much :)
Anastacia Syria, Truescar of Loviatar
Post Reply