99 Bottles of Beer on the Wall
From NWNWiki
99 Bottles of Beer on the Wall
Contents |
[edit] What it does
Has an NPC sing 99 bottles of beer on the wall. That's right, the whole song! Something I felt ought to be out there. Have an NPC bard in the corner? Need him to be singing something but don't have time to come up with a song of your own? Then this script is for you!
[edit] Notes
When your NPC finishes the song he says, "One more time!" and starts over!
[edit] The Script, Part 1
Make this script the NPC's OnSpawn script
void main()
{
SetLocalInt(OBJECT_SELF, "SINGER_COUNT", 100);
}
[edit] The Script, Part 2
Make this the NPC's OnHeartbeat script:
int nCount=GetLocalInt(OBJECT_SELF, "SINGER_COUNT");
void main()
{
nCount = nCount-1;
if (nCount==-1)
{
ActionSpeakString("One more time!");
SetLocalInt(OBJECT_SELF, "SINGER_COUNT", 100);
}
else
{
if (nCount==0)
{
ActionSpeakString(IntToString(nCount)+" bottles of beer on the wall!");
}
else
{
if (nCount==1)
{
ActionSpeakString(IntToString(nCount)+" bottle of beer on the wall.");
ActionWait(2.0);
ActionSpeakString(IntToString(nCount)+" bottle of beer.");
ActionWait(2.0);
ActionSpeakString("Take it down, pass it around...");
}
else
{
if (nCount==2)
{
ActionSpeakString(IntToString(nCount)+" bottles of beer on the wall.");
ActionWait(1.5);
ActionSpeakString(IntToString(nCount)+" bottles of beer.");
ActionWait(1.5);
ActionSpeakString("Take one down and pass it around...");
ActionWait(1.5);
ActionSpeakString(IntToString(nCount-1)+" bottle of beer on the wall!");
}
else
{
ActionSpeakString(IntToString(nCount)+" bottles of beer on the wall.");
ActionWait(1.5);
ActionSpeakString(IntToString(nCount)+" bottles of beer.");
ActionWait(1.5);
ActionSpeakString("Take one down and pass it around...");
ActionWait(1.5);
ActionSpeakString(IntToString(nCount-1)+" bottles of beer on the wall!");
}
}
}
SetLocalInt(OBJECT_SELF, "SINGER_COUNT", nCount);
}
}
[edit] Special Thanks
A special thanks to the author of Celowin's Scripting Tutorials for making it possible for me to turn out scripts like this.
