Building & Scripting > Scripting Board

Trigger of the .... something

<< < (5/10) > >>

Molly:
And here are Tor's flags:

-------------------------------------------------------------------------------
Global Variables for Tor:
                                 warelephant:                     1
                                       aswan:                    1
                               kermapolitics:                     1
                                    hunterba:                     4
                                   skincount:                     2
                                      arthur:                     6
                                   reformers:                     6
                                     hween09:                     1
                                 apple_count:                    46
                               hween2009soul:                      
                         hween2009billiards3:                     1
                                     lowell1:                     1
                             millicent1_done:                     1
                                     mother1:                     1
                                          89:                     4
                                killedabbess:                     1
                                      clock1:                     1
                            pirateparrotdone:                     1
                                  orsini_yes:                     1
                                     orsini1:                     1
                                     wreaths:                     2
                                       lycon:                     3
                                     islands:  MollyAndMordecaiRule
                                       hades:                     5
                                  poked_hook:                     1
                                   gorget144:                     1
                                   golem_num:                     1
                                 sabatons144:                     1
                                    rapunzel:                     1
                                     orsini2:                     1
                                     donegan:                     1
                                       curly:                     1
                                       shave:                     1
                                       josua:                     4
                                   streaking:                     1
                                  fisherbaby:                     1
                                   centaurea:                     1

[ Return to continue, (q)uit, (r)efresh, (b)ack, or page number (1/5) ]

                                  piratemap3:                     1
                                bunny_killer:                     1
                                     marielf:                     1
                                   paulonote:                     1
                                 rrbluebells:                     1
                             sheriff_legend2:                     1
                             sheriff_legend1:                     1
                                     golfkey:                     1
                                   ali_money:                     8
                                       pris1:                     1
                                       brskn:                     1
                                      claire:                     1
                                   gar_anger:                     1
                                     marquis:                     1
                                  greenhorne:                     1
                                        jack:                     1
                             arch_apprentice:                     1
                                     robbies:                     1
                                   hannadone:                     1
                                     wolfies:                     1
                              wolf_ear_count:                     4
                            robber_ear_count:                     1
                                       joje1:                     1
                           sheriff_drygulch1:                     1
                               quest_academy:                     1
                                     hintnum:                    69
                                       gordy:                     2
                                  traveller2:                     1
                                  traveller1:                     1
                             smithnailpolish:                     1
                                        zera:                     1
                                gerardquest1:                      
                                gerardquest2:                      
                            royal_wolfhunter:                     1
                                          55:                     1
                                          66:                     1
                                          77:                     1
                                      earnum:                

[ Return to continue, (q)uit, (r)efresh, (b)ack, or page number (2/5) ]

     2
                                     player1:                     1
                                 mudschooltp:                     1
                                 appointment:                     1
                                 koboldkills:                    23
                                   koboldrep:                   961
                                   goblinrep:                   967
                                 goblinkills:                    13
                                frenchknight:                     1
                                    petstats:  goldie 92 79 0 0 7 9 0 1 1
                                  fritztask1:                     1
                                      marion:                 21034
                                 dragonscale:                     1
                                   greencoat:                     1
                                   robinhood:                     1
                                robindagdone:                     1
                                          40:                     1
                                          41:                     0
                                          42:                     0
                                          43:                     1
                                          44:                     0
                                          45:                     0
                                       adia2:                     1
                                   mountain1:                     1
                                 bullcatcher:                     1
                                summerville2:                     1
                                summerville1:                     1
                                 saberskill1:                     1
                                  yodataught:                     1
                                 saberskill2:                     1
                                        urnc:                     1
                                  riddlebook:                     1
                                  slotcredit:                     0
                                       count:                     1
                                      augias:                     1
                                       moria:                     1
                                     viagros:                     1
                                     wabeeto:                     1

[ Return to continue, (q)uit, (r)efresh, (b)ack, or page number (3/5) ]

                                    overseer:                     1
                                      spiros:                     1
                             calydnosspinner:                     1
                              calydnosweaver:                     1
                                  samothrace:                     1
                                    damiskos:                     1
                                      eunuch:                     4
                                      anaphe:                     1
                                 chiossultan:                     1
                                        syme:                     1
                                  frogstatue:                     1
                                     liqueur:                     1
                                  athosabbot:                     1
                                      nimue1:                     1
                                     bandana:                      
                             lowell1_rocking:                     0
                               prisonerbroth:                     1
                                       bravo:                     9
                                   odysseus1:                     1
                                       ajax2:                     1
                                          99:                     5
                                 gauntlet144:                     1
                                azizi_rescue:                     1
                                      asking:                     1
                                       book1:                     1
                                  baronchest:                     2
                                    anne_yes:                     1
                            child_shoes_done:                      
                        burkeandhare_corpses:                     4
                           lion_house_access:                     1
                                  easter_egg:                     1
                               hween2009four:                     1
                               hween2009five:                     1
                                hween2009two:                     1
                                hween2009cue:                     1
                                hween2009one:                     1
                         hween2009billiards2:                     1
                           failed_apple_bite:                 14

[ Return to continue, (q)uit, (r)efresh, (b)ack, or page number (4/5) ]

  
                                  bit_apples:                    43
                                    appleexp:               1296000
                                generalteeth:                     1
                                  enter_quay:                     1
                                    amunplot:                     2

Kvetch:
I completely understand the problem with all the questflags, as I stated, I've got lists of my own that look a lot like those.  But, if we gave people a journal so they could write down what they know, we wouldn't have to deal with the questflags.  At least that's my thought and at least it's some way for them to keep track of things on the game instead of papers that they're constantly losing.  Or maybe that's only me.

Molly:
OK, to be a bit more constructive, here's an idea for how a scripted journal could actually work - at least for the Quests that have a questcard.

Since each Quest would need a unique identity, it would be simplest to just use the number of the Questcard for that.
It would take a bit of an effort on the player's side, to find the number of the quest they got stuck on from a long list, but from the player's point of view that would still be relatively easy.

It would however also take a lot of research to ferret out all the correct flags from the various script files and a lot of scripting to set up the scripts, but at least it is doable.

Step 1
We'd make an object called Quest Journal, which the player can get in the Questor's Office.
The journal itself would be similar for all players, but it has a number of scripts placed on it to check for the correct questflag of whoever is using it, and provide some guidance based on that.

The command 'look journal' would provide the following info:

This journal contains a list of all the Questcards.
First you need to find the number of the quest you are looking for.
Since there are over 100 Questcards, the journal has 7 pages,
and there are 15 quests on each page.
Type 'look Index' to view the Quest numbers on each page.
Type 'look #' (for instance 'look 4') to view the Quests on each page.
*
To find out your status on a certain Quest, you need to first HOLD the Journal.
Then you have to SAY the number of the Quest.
(for instance type 'SAY 5' to check your status on The Enchanted Frogs).

The command 'look index' would give the following list:
INDEX
Page 1. Card 1-15
Page 2. Card 16-30
Page 3. Card 31-45
Page 4. Card 46-60
Page 5. Card 61-75
Page 6. Card 76-90
Page 7. Card 91-105

Then 'look 1' would produce the following result:
1.   Wanted Poster I
2.   Wanted Poster II
3.   Cyrene's lover
4.   Robber Baron's prisoners
5.   The enchanted frogs
6.   Thetis' lover
7.   The Viking Quarrel
8.   The Lady in the Lake
9.   Nimue's quest
10.  The Tower of Rapunzel
11.  The bereaved woman
12.  Chief Arapahoola's Snake Elixir     
13.  The Secret Sword
14.  Llano Estacado
15.  Exoliath's armor

They would still have to look at the actual questcards to get the detailed info on each Quest.

Step 2.

Now we need to make a script - or several scripts - for the journal, based on the questflags that the quests set on the players.

Many of the easier quests just provide some limited stats item, and don't set any questflag. They are fully repeatable, meaning that you can do them over and over again, without any restrictions at all.
And this is also the info you'd get from saying the number of these quests.

However, if they also provide tokens and/or exp, they have a flag check to give a smaller reward after the first time.
The script would check for that flag, and dependant on the result you'd get the following info:
'You haven't completed this Quest yet.'    or
'You've already done this quest, but you can repeat it for a smaller reward.'

Yet others have a check on the item you get, to stop people who haven't done the quest from using the item. But otherwise they are similar to the former category. You can repeat them to get the item, but any exp and or tokens will be a lot less after the first time, so the message should be similar to the above category.

This gives us the beginning of the script:
*
if %arg%|= 1
 if !%actor.varexists(curly)%
  %send% %actor% You haven't completed this Quest yet.
 else
  %send% %actor% You have already done this Quest, but you can repeat it for a smaller reward.
 endif
elseif %arg%|= 2
 if !%actor.varexists(donegan)%
  %send% %actor% You haven't completed this Quest yet.
 else
  %send% %actor% You have already done this Quest, but you can repeat it for a smaller reward.
 endif
elseif (%arg%|= 3) || (%arg%|= 5) || (%arg%|= 6) || (%arg%|= 7)|| (%arg%|= 8 )
  %send% %actor% You can do this Quest as many times as you like.
etc. etc.

*
Then we get to the first problem:
Some of the Questcards have more than one Quest on them.
That is the case with for instance 5. The enchanted frogs and 14. Llano Estacado.
(Llano even has 6 different quests, but 3 of them, 'The legend of the deamon' and the two 'Wanted Posters' have their own questcards).

Anyhow, this problem could be handled by adding subheadings for each Quest on the Questbook, (and possibly also on the actual Questcard, which means additional build work). So the entry for Card 14 in the Questbook would then look like this:

14. Llano Estacado
-   14A The dying man
-   14B The lost medicine pouch
-   14C Jeff and Joe

In this case you'd need to say 14A to get info on that first quest.

Also the script on the journal will obviously be very long, which means that we have to work either with function scripts, or make several different journals, possibly both.

But then we come to the real problem; The multi-step quests. Usually, but not always, these use the same flags throughout the quest.

Let's take Quest 103 'Rebellion against Arthur' as an example. It is a multi step quest that you initiate by talking to the Captain of the Guards. This sets the flag rebellion, which then will increase or decrease dependant on which mobs you talk to.
Dependent on the number on the flag, the mobs will also give different responses.

When the rebellion number reaches 10 it is replaced by the flag reformers, which in turn increases one step for each task you perform.

When the reformers flag reaches 8, you are presented a choice to help either the Rebels or the Captain, by giving an item to either of them.  Choosing the Captain sets the flag reformers 9, while choosing the Rebels sets reformers 10, and in each case you get one last task to perform.

When the last task is done, reformers flag is replaced by the flag done_reformers, which allows you to redo the quest for a smaller reward.

So here is what the script for this single quest would have to look like:


if %arg%|=103
 if %actor.varexists(done_reformers)%
  %send% %actor% You have already completed this quest, but you can repeat it for a smaller reward.
 endif
 if %actor.varexists(rebellion)%
   %send% %actor% You need to talk to more more people to collect more info about the rebellion.
 endif
 if %actor.varexists(reformers)%
  if %actor.reformers% == 1
   %send% %actor% You should go and talk to the Silk Merchant about an assignment.
  elseif %actor.reformers% == 2
   %send% %actor% The Silk Merchant is expecting you to deliver an item to incriminate Morgan le Fay.
  elseif %actor.reformers% == 3
   %send% %actor% The Silk Merchant is expecting you to bring Nicolo Orsini to him.
   %send% %actor% If you've lost the letter, talk to the merchant who'll give you a new one.
  * and so on, until we get to reformers 10
  endif
 endif
endif

And this is just one of a large number of multi-step quests...

One more thing:

Quite often the questflags of a complex Quest get messed up beyond all help. This is sometimes caused by buggy scripts, but more often by players trying to take shortcuts. Another common reason is forgetting where they were in the quest, and starting it from scratch again, which then results in double flags, that make the questmobs refuse to interact with them.

Usually the only feasible way to fix this is to just remove all the flags for that particular quest from the player file. It means they have to start all over from the beginning again, but that's usually not a big problem.

However, rather than having to ask an imm to assist with this - (which is also frustrating for the imm, who has to sift through several pages of flags to find the right one) - we could make the script do it.
The command would be 'reset #', (for instance 'reset 103'), which would make the script check for all but the end flag and then remove them.
Using the Rebellion against Arthur example, the script would be like this:


if (%speech.contains(reset)% && %speech.contains(103)%
 if %actor.varexists(rebellion)%
  rdelete rebellion %actor.id%
 endif
 if %actor.varexists(reformers)%
  rdelete reformers %actor.id%
 endif
endif
 



Kvetch:
A new trigger!!  Let's shake that magical eightball.  Yeah, I stole it from The Builder's Academy, but Rumble makes such neat triggers.
This one is very well documented on what it does and how, I just thought it had to be here.

Name: 'Obj Command Magic Eight Ball - O47',  VNum: [    6], RNum: [    6]
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 2, Arg list: shake
Commands:
* By Rumble of The Builder Academy    tbamud.com 9091
* Numeric Arg: 2 means in character's carried inventory.
* Command trigs do not work for level 33 and above.
* There are 20 possible answers that the Magic Eight Ball can give.
* Of these, nine are full positive, two are full negative, one is
* mostly positive, three are mostly negative, and five are abstentions.
*
* Check arguments if they match. /= checks abbreviations.
if ball /= %arg% || eightball /= %arg%
  * Echo text to everyone else in the room and the actor.
  %echoaround% %actor% %actor.name% shakes %self.shortdesc% vigorously.
  %send% %actor% You shake %self.shortdesc% vigorously.
  * Use a switch to choose a random response (1-20).
  switch %random.20%
    * Send the answer! %self% is the 8ball, or whatever the trig is attached to.
    * Only the actor sees the answer.
* Case is what we are trying to match. Does %random.20% == 1?
    case 1
      %send% %actor% %self.shortdesc% reveals the answer: Outlook Good
      * We are done with this case so check the next one.
    break
    case 2
      %send% %actor% %self.shortdesc% reveals the answer: Outlook Not So Good
    break
    case 3
      %send% %actor% %self.shortdesc% reveals the answer: My Reply Is No
    break
    case 4
      %send% %actor% %self.shortdesc% reveals the answer: Don't Count On It
    break
    case 5
      %send% %actor% %self.shortdesc% reveals the answer: You May Rely On It
    break
    case 6
      %send% %actor% %self.shortdesc% reveals the answer: Ask Again Later
    break
case 7
      %send% %actor% %self.shortdesc% reveals the answer: Most Likely
    break
    case 8
      %send% %actor% %self.shortdesc% reveals the answer: Cannot Predict Now
    break
    case 9
      %send% %actor% %self.shortdesc% reveals the answer: Yes
    break
    case 10
      %send% %actor% %self.shortdesc% reveals the answer: Yes, definitely
    break
    case 11
      %send% %actor% %self.shortdesc% reveals the answer: Better Not Tell You Now
    break
    case 12
      %send% %actor% %self.shortdesc% reveals the answer: It Is Certain
    break
    case 13
%send% %actor% %self.shortdesc% reveals the answer: Very Doubtful
    break
    case 14
      %send% %actor% %self.shortdesc% reveals the answer: It Is Decidedly So
    break
    case 15
      %send% %actor% %self.shortdesc% reveals the answer: Concentrate And Ask Again
    break
    case 16
      %send% %actor% %self.shortdesc% reveals the answer: Signs Point To Yes
    break
    case 17
      %send% %actor% %self.shortdesc% reveals the answer: My Sources Say No
    break
    case 18
      %send% %actor% %self.shortdesc% reveals the answer: Without A Doubt
    break
    case 19
      %send% %actor% %self.shortdesc% reveals the answer: Reply Hazy, Try Again
break
    case 20
      %send% %actor% %self.shortdesc% reveals the answer: As I See It, Yes
    break
    * Every switch should have a default. A catch-all if the cases do not match.
    default
      %send% %actor% %self.shortdesc% explodes since your question is unanswerable.
    break
    * Every switch must have a done! Just like every if needs an end!
  done
  * The actor didn't use the command shake with arg ball or eightball.
else
  * Return 0 allows the command to continue through to the MUD. The player will
  * get the Huh!?! response or the shake social if you have one.
  return 0
end

Kvetch:
Trying to get this back up and going again - which means I need to visit TBA mud more often.  I've not checked this trigger to make sure it works in 4Dimensions, but I believe it will - I have something similar to it when I have dragon's fighting.

Name: 'dg_cast fireball',  VNum: [  104], RNum: [  104]
Trigger Intended Assignment: Mobiles
Trigger Type: Fight , Numeric Arg: 100, Arg list: None
Commands:
* By Rumble of The Builder Academy    tbamud.com 9091
* Only cast the spell every 30 seconds.
if %already_cast%
  wait 30 s
  unset already_cast
else
  dg_cast 'fireball' %actor.name%
  set already_cast 1
  * By globalling the variable it can be accessed by other triggers or when
  * this trigger fires a second time.
  global already_cast
end

I do love the fact that Rumble comments everything he does and makes it a whole lot simpler to follow.  Basically, the first time the mob casts the fireball, it sets the variable on the mob already_cast, then it will wait 30 seconds before it is able to cast it again.  If I remember right, dg_cast doesn't give any action lines when the fireball is cast so you can input what you want it to say - whether it's "The great mage Xander casts a fireball at your face" or "The big red dragon breathes a cone of fire in your direction".  I could be wrong on that though so, if using this script - or creating one like it for other spells - you should check it out and see.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version