I have tried creating a Slaver that will whip the slave, but for some reason the whipper isn't whipping the whippy. Here is my script, and tags on NPC.
_______________________________________________________________________________________________________
Tag: Whipper
// Whipper On_HeartBeat script: whipper_onhrtbet
void main()
{
object oArea = GetArea(OBJECT_SELF);
int sPCINAREA = FALSE;
object oObject = GetFirstObjectInArea(oArea);
while(GetIsObjectValid(oObject))
{
if(GetIsPC(oObject))
{
sPCINAREA = FALSE;
}
oObject = GetNextObjectInArea(oArea);
}
if(sPCINAREA == TRUE)
{
string sWhippy = "WHIPPY";
object oWhippy = GetNearestObjectByTag(sWhippy);
if(GetIsObjectValid(oWhippy))
{
AssignCommand (OBJECT_SELF, ActionAttack(oWhippy));
ActionAttack(oWhippy);
ClearAllActions(TRUE);
}
}
}
_________________________________________________________________________________________________________
Tag: Whippy
// Whippy On_HeartBeat script: whippy_onhrtbet
void main()
{
string sYell;
object oArea = GetArea(OBJECT_SELF);
int sPCINAREA = FALSE;
object oObject = GetFirstObjectInArea(oArea);
while(GetIsObjectValid(oObject))
{
if(GetIsPC(oObject))
{
sPCINAREA = TRUE;
}
oObject = GetNextObjectInArea(oArea);
}
if(sPCINAREA == TRUE)
{
// Make sure were still on the ground.
int iAnim;
int iAnimRoll = d4();
switch (iAnimRoll)
{
case 1: iAnim = ANIMATION_LOOPING_DEAD_FRONT; break;
case 2: iAnim = ANIMATION_LOOPING_DEAD_BACK; break;
case 3: iAnim = ANIMATION_LOOPING_WORSHIP; break;
case 4: iAnim = ANIMATION_LOOPING_MEDITATE; break;
default: iAnim = ANIMATION_LOOPING_DEAD_FRONT; break;
DelayCommand(3.0f,PlayAnimation(iAnim));
}
AssignCommand(OBJECT_SELF, PlayAnimation(iAnim, 1.0, 6.0));
int iRand = d8();
switch (iRand)
{
case 1: sYell = "OUCH!"; break;
case 2: sYell = "OOF!"; break;
case 3: sYell = "MAMMA!"; break;
case 4: sYell = "PLEASE!"; break;
case 5: sYell = "OOHH!"; break;
case 6: sYell = "AHHH!"; break;
case 7: sYell = "GRRR!"; break;
case 8: sYell = "ACK!"; break;
default: sYell = "OUCH!"; break;
DelayCommand(3.0f,SpeakString(sYell));
}
ClearAllActions();
}
}
_________________________________________________________________________________________________________
Any Help would be greatly appreciated. Thank you in advance!