Full Version : Drunken NPC
xmlspawner >>Q&A >>Drunken NPC


<< Prev | Next >>

Abracadabra- 07-06-2006
I made an NPC beggar named Charity. She's based on a RP character I used to play. Now I'd like to spawn her, but I want her to spawn drunk and stay drunk always. Can the xml spawner do this? If not, what would be the scripting code I'd enter into her script to make this happen?

ArteGordon- 07-06-2006
QUOTE (Abracadabra @ July 06, 2006 08:26 pm)
I made an NPC beggar named Charity. She's based on a RP character I used to play. Now I'd like to spawn her, but I want her to spawn drunk and stay drunk always. Can the xml spawner do this? If not, what would be the scripting code I'd enter into her script to make this happen?

to spawn them drunk, I would try adding this to the script for the npc or even in basecreature.cs if you wanted to be able to make any creature drunk

CODE

 public int MakeDrunk
 {
  set
  {
   BAC = value;
   BaseBeverage.CheckHeaveTimer(this);
  }
 }



and then when you spawn them, do it like this and they will spawn drunk

yournpc/makedrunk/60

where the value is the blood alcohol content level that determines how long they will stay drunk.

The way the drunk system works, you will have to keep setting the BAC level back up, because they will gradually become sober.

You can do that by having spawn entries like this

yournpc/makedrunk/60
SETONSPAWN,1/makedrunk/60


and assign both of them to subgroup 1. That way whenever the spawner ticks, it will set the makedrunk property of the npc back to 60, which is the max BAC level and so they will appear to stay drunk forever.

Abracadabra- 07-06-2006
Ok i did everything but the subgroup part...what's this and how do you set it?

ArteGordon- 07-06-2006
QUOTE (Abracadabra @ July 06, 2006 09:57 pm)
Ok i did everything but the subgroup part...what's this and how do you set it?

open the expanded spawner gump by clicking the little arrow button in the lower right corner.
Then you will see a field labeled 'Sub'. Enter the number '1' into that field next to the entries.