NPC healers walking away mid spell

For builders to discuss and ask building questions.
Post Reply
Kielar
Sword Novice
Sword Novice
Posts: 49
Joined: Tue Aug 14, 2012 5:15 pm

NPC healers walking away mid spell

Post by Kielar » Sun Aug 19, 2012 3:50 pm

It took three attempts before Ghent actually completed the spell. The npc shouldn't be able to move while casting. Failing that, the target should still receive the benefit of the spell.

--------------------------------------------------
glance self
A muscular male moon elf is in perfect health.
His left arm is critically injured.
His right arm is severed.

heal limbs
You donate 2 gold, 1 silver to High Radiance Ghentilara's faith.
High Radiance Ghentilara begins to chant.

High Radiance Ghentilara walks south.
You hear the sound of footsteps from the south.

glance self
A muscular male moon elf is in perfect health.
His left arm has many nasty wounds.
His right arm is severed.

heal limbs
High Radiance Ghentilara says to you 'Here is your change, 3 gold'
You donate 2 gold, 1 silver to High Radiance Ghentilara's faith.
High Radiance Ghentilara begins to chant.

High Radiance Ghentilara walks south.
You hear the sound of footsteps from the south.

heal limbs

You donate 2 gold, 1 silver to High Radiance Ghentilara's faith.
High Radiance Ghentilara begins to chant.

High Radiance Ghentilara utters the words, 'toralounsozgruhz'.
High Radiance Ghentilara's healing power causes your right arm to grow back.

High Radiance Ghentilara walks west.
You hear the sound of footsteps from the west.
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: NPC healers walking away mid spell

Post by Harroghty » Mon Aug 20, 2012 12:29 am

I added some code to some of the wandering healers in and around Waterdeep (the change will be live with the next copyover). I am going to moving this post to the Builder's Discussion forums so that other builders can use this same code in the future if they so desire. It just adds the SENTINEL flag to a wandering healer mobile when someone types HEAL and then it removes it when anyone moves out of the room (it will not remove the flag if an NPC wanders out, but anyone who physically types NORTH, for example). Not perfect, but workable.

Code: Select all

>intercept_prog heal~
mpunintercept
mpmset $i flags sentinel
mpmset $i quest 0 1 1
~
>intercept_prog north~
if quest(0, 1, $i) == 1
  mpmset $i flags sentinel
  mpmset $i quest 0 1 0
endif
mpunintercept
~
>intercept_prog south~
if quest(0, 1, $i) == 1
  mpmset $i flags sentinel
  mpmset $i quest 0 1 0
endif
mpunintercept
~
>intercept_prog east~
if quest(0, 1, $i) == 1
  mpmset $i flags sentinel
  mpmset $i quest 0 1 0
endif
mpunintercept
~
>intercept_prog west~
if quest(0, 1, $i) == 1
  mpmset $i flags sentinel
  mpmset $i quest 0 1 0
endif
mpunintercept
~
>intercept_prog northeast~
if quest(0, 1, $i) == 1
  mpmset $i flags sentinel
  mpmset $i quest 0 1 0
endif
mpunintercept
~
>intercept_prog northwest~
if quest(0, 1, $i) == 1
  mpmset $i flags sentinel
  mpmset $i quest 0 1 0
endif
mpunintercept
~
>intercept_prog southeast~
if quest(0, 1, $i) == 1
  mpmset $i flags sentinel
  mpmset $i quest 0 1 0
endif
mpunintercept
~
>intercept_prog southwest~
if quest(0, 1, $i) == 1
  mpmset $i flags sentinel
  mpmset $i quest 0 1 0
endif
mpunintercept
~
>intercept_prog up~
if quest(0, 1, $i) == 1
  mpmset $i flags sentinel
  mpmset $i quest 0 1 0
endif
mpunintercept
~
>intercept_prog down~
if quest(0, 1, $i) == 1
  mpmset $i flags sentinel
  mpmset $i quest 0 1 0
endif
mpunintercept
~
"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
Raona
Staff
Staff
Posts: 4944
Joined: Fri Aug 19, 2005 3:40 pm
Location: Waterdeep - Halls of Justice
Contact:

Re: NPC healers walking away mid spell

Post by Raona » Tue Aug 21, 2012 11:36 am

Is there a hard code issue here worth tackling, namely that NPCs can move while casting?
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: NPC healers walking away mid spell

Post by Harroghty » Tue Aug 21, 2012 2:38 pm

I don't believe so. Not with the other issues at hand from the hard code perspective.
"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
Tarven
Sword Grand Master
Sword Grand Master
Posts: 365
Joined: Tue Jun 19, 2012 3:40 am

Re: NPC healers walking away mid spell

Post by Tarven » Tue Aug 21, 2012 7:09 pm

I'm not 100% sure, but I'm fairly certain that they can't cast -offensive- spells while moving. If they could, that'd be a whole different bag. Theoretically, an easy fix for players would be to follow the NPC healer, before requesting the heal.
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: NPC healers walking away mid spell

Post by Harroghty » Tue Aug 21, 2012 7:24 pm

There are few enough wandering NPC healers that it should be pretty easy to apply this soft code bandage and avoid either of those courses of action.
"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
Tarven
Sword Grand Master
Sword Grand Master
Posts: 365
Joined: Tue Jun 19, 2012 3:40 am

Re: NPC healers walking away mid spell

Post by Tarven » Tue Aug 21, 2012 7:42 pm

Harroghty wrote:There are few enough wandering NPC healers that it should be pretty easy to apply this soft code bandage and avoid either of those courses of action.
That too. =P In fact, I think that same temple might even have another healer that doesn't wander, though I might be mistaken.
Mask
Staff
Staff
Posts: 2649
Joined: Tue Jul 15, 2003 9:21 pm

Re: NPC healers walking away mid spell

Post by Mask » Tue Aug 21, 2012 9:45 pm

Would a 'leave_prog' not be a better choice than a bunch of intercepts?
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: NPC healers walking away mid spell

Post by Harroghty » Tue Aug 21, 2012 9:54 pm

Not sure that those work, but yes; it would if they do.

Confirmed, leave progs do not work.
"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