mpaffect and herbs

For builders to discuss and ask building questions.
Post Reply
User avatar
Myn
Sword Apprentice
Sword Apprentice
Posts: 92
Joined: Mon Aug 04, 2003 3:23 pm
Location: Zhentil Keep
Contact:

mpaffect and herbs

Post by Myn » Wed Nov 16, 2016 4:54 pm

I was wondering if there was a way to use mpaffect, or something like it, to add an herb effect from a prog?

User avatar
Harroghty
Staff
Staff
Posts: 9489
Joined: Tue Jul 27, 2004 5:38 pm

Re: mpaffect and herbs

Post by Harroghty » Wed Nov 16, 2016 5:02 pm

Myn: can you describe exactly what you'd like to do?
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons

User avatar
Myn
Sword Apprentice
Sword Apprentice
Posts: 92
Joined: Mon Aug 04, 2003 3:23 pm
Location: Zhentil Keep
Contact:

Re: mpaffect and herbs

Post by Myn » Wed Nov 16, 2016 6:03 pm

Sure thing, I am making a hushthorn tea which should make the drinker drowsy per FR lore. To do this, I have a prog that sets the drinker's metal state down a bit, and echos about heavy eyes and what not. I'd like to add the hushtorn herb to the PC's affect list through this prog. I was hoping to avoid using the herb_hushtorn in the drink item itself just because of the echo it has (Hitroom : $n seems to gain energy under the effect of the herb.) just because its the opposite of the actual effect. Here is the item thus far, if it makes it more clear:

Code: Select all

flask of hushthorn tea~
{E0}flask of {20}hus{60}h{20}tho{60}r{20}n t{60}e{20}a~
{E0}A small flask of {20}t{60}e{20}a{E0} has been left here.~
~
ITEM_TYPE_DRINK_CON
0
CAN_WEAR_TAKE|CAN_WEAR_HOLD
QUALITY_AVERAGE MATERIAL_GLASS COND_PERFECT SIZE_MEDIUM
1 1 LIQ_TEA 0 0 0
>use_prog 100~
mpechoat $n {60}As you drink the bitter tea, you feel your eyes grow heavier and your body starts to feel deeply relaxed...
mpmadd $n mentalstate -25
~
|
Ultimately, adding the affect here would just be for a bit of flavor, but I thought it might come in handy for other things as well so I was wodering what code I could put in to add the herb effect as though it had been used/drank/applied/etc.

User avatar
Harroghty
Staff
Staff
Posts: 9489
Joined: Tue Jul 27, 2004 5:38 pm

Re: mpaffect and herbs

Post by Harroghty » Wed Nov 16, 2016 7:30 pm

Some of us have used an invisible mobile, loaded by the object, to simulate persistent effects for consumables. So you would:
  • check if the mobile is present
    if not, load it
    prompt the PC to enter a "secret" command for the mobile to intercept
    use the mobile and maybe a QBIT to deliver persistent effects once the object is gone (consumed)
Here's a lazy example of how this might work.

On object:

Code: Select all

>use_prog 100~
if mobinroom(1234) > 0
else
  mpmload 1234
endif
mpforce $n triggerteaprogone
~
On mobile:

Code: Select all

>intercept_prog triggerteaprogone~
if questr(1234, 0, 1, $n) == 1
else
  mpmset $n questr 1234 0 1 1
endif
follow $n
if rand(33)
  mpechoat $n You are getting very sleepy...
else
  if rand(50)
    mpechoat $n Whatever else
  else
    mpechoat $n Whatever else
  endif
endif
~
>rand_prog 50~
if questr(1234, 0, 1, $r) == 1
if rand(50)
  mpechoat $r You feel sleepy...
else
  mpechoat $r You recover from your stupor
  mpmset $r questr 1234 0 1 0
  mpgoto 3
endif
~
|
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons

Post Reply