Party Check

For builders to discuss and ask building questions.
Post Reply
Amalia
Sword Grand Master
Sword Grand Master
Posts: 331
Joined: Wed Feb 01, 2006 6:51 pm
Location: Ardeep Forest
Contact:

Party Check

Post by Amalia » Sun Feb 25, 2007 12:31 am

I'm in the process of building a quest, and I wonder if anyone knows how to check the party for a certain attribute to update the quest-- for example, to update if a member of the current party is a certain alignment or a certain class, or if none of the party are, to update when someone who is joins the party.

Thanks!
Dear Enemy: May the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment.
Dalvyn
Sword Grand Master
Sword Grand Master
Posts: 4708
Joined: Tue Jul 15, 2003 9:26 pm
Location: House of Wonder, Waterdeep

Post by Dalvyn » Sun Feb 25, 2007 1:14 am

There is no built-in checks that covers the whole party. The best alternative I can think is to use a greet_prog.

A perfect situation would have the following three steps:
  1. A room where the group would enter.
  2. Put an invisible mob in the room, with a greet_prog like the following:

    Code: Select all

    >greet_prog 100~
    if '''guild($n) == Rangers'''
      mpmset self quest 0 1 1
    endif
    ~
    (I used "being a ranger" as the attribute to check here, but it can be replaced with anything else)

    This program uses quest bit on the invisible mob and set the quest bit to 1 if someone who is a Ranger has entered the room.

    We also need to reset this quest bit to 0 before/after the check. More on that below.
  3. Have whatever follows in the quest be managed by the invisible mob (so it can check on whether there is a ranger in the group or not). For example, if what they need to do is "track" a monster and you want a mob to assist them if no ranger is present, you could add this program:

    Code: Select all

    >intercept_prog track~
    if quest(0,1,self) == 1
      mpunintercept
    else
      mpecho {20}Janon appears in a blinding flash of light.
      mpecho {20}Janon says: Since none of you is a ranger, I will help you.
      mpecho {20}Janon examines the tracks on the ground.
      mpecho {20}Janon says "The monster went east!" before disappearing.
    endif
    ~
Obviously, this solution would have to be modified depending on what your quest is exactly.

Now... to reset the invisible mob's quest bits... that too depends on how your quest works too. Here are a few options.
  • If you know that the characters must enter another room right before reaching the room with your invisible mob, you could add this program in this first room.

    Code: Select all

    >greet_prog 100~
    mpat (the other room vnum) resetyourbits
    ~
    This program will issue the command "resetyourbits" in the room where the invisible mob is. To make it work, you also need to have the invisible mob react to this command, by adding the following program on it.

    Code: Select all

    >intercept_prog resetyourbits~
    mpmset self quest 0 1 0
    ~
  • Another solution would be to reset the bits to 0 whenever someone leaves the room with the invisible mob, with the following program.

    Code: Select all

    >leave_prog 100~
    mpmset self quest 0 1 0
    ~
    This can be a rather good solution if the group is sure to always remain together.
Well, as you see, there is no perfect solution... and there is no simple solution either. :)
Amalia
Sword Grand Master
Sword Grand Master
Posts: 331
Joined: Wed Feb 01, 2006 6:51 pm
Location: Ardeep Forest
Contact:

Post by Amalia » Sun Feb 25, 2007 2:50 am

Spifftacular. I think I can use this. Thanks!
Dear Enemy: May the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment.
Post Reply