1. Yet Another Barmaid Script
2. Barmaid Serves Patrons
3. Notes:
This is probably floating around here in many incarnations (some of which
don't work) but since I didn't see it in this thread I thought I'd add my
version I threw together. This script has been around for a while and is
based on the lovely David Gaider's script of similar ilk. I also recall
hearing there was one in the game, but I haven' come across it. At minimum
you'll need a Barmaid NPC, a couple of friendly NPC patrons, and two
waypoints(tags: WP_Bar and WP_Bar2). I also have a barkeeper with the tag
"Barkeeper".
This script should be attached to the OnUserDefined event of the Barmaid
NPC. Remember to uncomment these two lines in the Barmaid's OnSpawn script
(make a copy of it first):
NWScript: SetSpawnInCondition (NW_FLAG_HEARTBEAT_EVENT);
SetSpawnInCondition (NW_FLAG_ON_DIALOGUE_EVENT);
Here's the OnUserDefined code:
NWScript:
void main()
{
int nUser = GetUserDefinedEventNumber();
int nRandom = Random(4);
object oCustomer = GetLocalObject(OBJECT_SELF, "CUSTOMER");
object oBar = GetWaypointByTag("WP_Bar");
object oBar2 = GetWaypointByTag("WP_Bar2");
if (nUser == 1001)
{
if (!GetIsObjectValid(oCustomer) && (GetLocalInt(OBJECT_SELF, "BARMAID_STATE") < 1))
{
oCustomer = GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF, nRandom);
if (oCustomer != GetObjectByTag("Barkeeper") && oCustomer != OBJECT_SELF && GetIsObjectValid(oCustomer) )
{
SetLocalInt (OBJECT_SELF, "BARMAID_STATE", 1);
SetLocalObject (OBJECT_SELF, "CUSTOMER", oCustomer);
ActionMoveToObject(oCustomer);
switch(Random(4))
{
case 0:
ActionSpeakString ("Can I get you something?");
break;
case 1:
ActionSpeakString ("What'll it be?");
break;
case 2:
ActionSpeakString ("Some refreshment for you and your friends?");
break;
case 3:
ActionSpeakString ("Another round?");
break;
}
ActionWait(5.0);
ActionDoCommand (SetLocalInt(OBJECT_SELF, "BARMAID_STATE", 2));
ActionMoveToObject(oBar);
switch(Random(4))
{
case 0:
ActionSpeakString ("I need two Dragon Breath Ales and a Ilipur Bitter.");
break;
case 1:
ActionSpeakString ("A Mindflayer with a twist and two bottles of Prespur Rum.");
break;
case 2:
ActionSpeakString ("They want a basket of Crispy Ogre Ears");
break;
case 3:
ActionSpeakString ("Three ales and a pony keg for theHalf-Orc.");
break;
}
ActionWait(8.0);
ActionDoCommand (SetLocalInt(OBJECT_SELF, "BARMAID_STATE", 3));
ActionMoveToObject (oCustomer);
switch(Random(4))
{
case 0:
ActionSpeakString ("Enjoy.");
break;
case 1:
ActionSpeakString ("That'll be 5 platinum. I'm just kidding. 15 copper, please.");
break;
case 2:
ActionSpeakString ("You look like you could use this.");
break;
case 3:
ActionSpeakString ("Ice brewed in Icewind Dale, friend. Enjoy.");
break;
}
ActionWait(3.0);
ActionDoCommand (SetLocalObject(OBJECT_SELF, "CUSTOMER", OBJECT_INVALID));
ActionMoveToObject(oBar2);
ActionWait(5.0);
switch(Random(4))
{
case 0:
ActionSpeakString ("Slow night tonight, eh Charlie?");
break;
case 1:
ActionSpeakString ("My feet are killing me.");
break;
case 2:
ActionSpeakString ("I can't live on these tips. Two copper?");
break;
case 3:
ActionSpeakString ("He's kind of cute.");
break;
}
ActionWait(5.0);
ActionDoCommand (SetLocalInt(OBJECT_SELF, "BARMAID_STATE", 0));
}
}
}
if (nUser == 1004)
{
SetLocalObject (OBJECT_SELF, "CUSTOMER", OBJECT_INVALID);
SetLocalInt (OBJECT_SELF, "BARMAID_STATE", 0);
}
}
Or how about, oh, to hell with it. Even these scripts won't satisfy you and
your ilk, why bother arguing with the stubborn? Fine, you win, hey everyone,
Please post some more barmaid scripts, we don't have enough here.
By the way, it would be really great if someone would make a barmaid script
were she took orders, sold you hookers, lit the lamps during certain times
of the day while walking way points through doors and other areas, operating
levers that spawned in creatures and that teleport away patrons based on
race, class, faction and money, while cooking, playing darts and reading a
sundial, but only during the day. If anyone could make that script I would
greatly appreciate it. It's exactly what we need on this thread.
_________________
"Fetch me that gem encrusted skull from amongst that pile of bone and ash."
- Robillard to his Half-Ogre henchmen.
"Duh, OK."- Last words from Grogg, son of Grogg, as he reached for the Demi-Lich's
skull.
- The Tomb of Horrors
|