75 lines
2.6 KiB
Plaintext
75 lines
2.6 KiB
Plaintext
// matilda's trap
|
|
void fnDoSequence(object oPC,object oCage,object oMatilda)
|
|
{ // do animation... speaking and more
|
|
int nState=GetLocalInt(oCage,"nState");
|
|
object oTP_Loc=GetWaypointByTag("TELEPORT_Matilda");
|
|
float fDelay=8.0;
|
|
int HAG_APPEARANCE=454;
|
|
switch(nState)
|
|
{ // main switch
|
|
case 0: { // teleport
|
|
SetLocalInt(oCage,"nState",1);
|
|
AssignCommand(oMatilda,JumpToObject(oMatilda));
|
|
break;
|
|
} // teleport
|
|
case 1: { // statement 1
|
|
SetLocalInt(oCage,"nState",2);
|
|
AssignCommand(oMatilda,SpeakString("Well are you not now in a pickle?"));
|
|
break;
|
|
} // statement 1
|
|
case 2: { // statement 2
|
|
SetLocalInt(oCage,"nState",3);
|
|
AssignCommand(oMatilda,SpeakString("Or should I say a cage?"));
|
|
break;
|
|
} // statement 2
|
|
case 3: { // statement 3
|
|
SetLocalInt(oCage,"nState",4);
|
|
AssignCommand(oMatilda,SpeakString("I bet you wish you had left now."));
|
|
SetLocalInt(oCage,"nAppearance",GetAppearanceType(oMatilda));
|
|
SetCreatureAppearanceType(oMatilda,HAG_APPEARANCE);
|
|
break;
|
|
} // statement 3
|
|
case 4: { // statement 4
|
|
SetLocalInt(oCage,"nState",5);
|
|
AssignCommand(oMatilda,SpeakString("No matter, My sisters and I needed some new pets."));
|
|
break;
|
|
} // statement 4
|
|
case 5: { // send the PC onward
|
|
oTP_Loc=GetWaypointByTag("Matildas_Victim");
|
|
AssignCommand(oPC,JumpToObject(oTP_Loc));
|
|
SetLocalInt(oCage,"nState",6);
|
|
break;
|
|
} // send the PC onward
|
|
case 6: { // restore appearance, reenact NPC ACTIVITIES, destroy cage
|
|
SetCreatureAppearanceType(oMatilda,GetLocalInt(oCage,"nAppearance"));
|
|
SetLocalInt(oMatilda,"nGNBDisabled",FALSE);
|
|
DelayCommand(1.0,DestroyObject(oCage));
|
|
break;
|
|
} // restore appearance, reenact NPC ACTIVITIES, destroy the cage
|
|
default: break;
|
|
} // main switch
|
|
DelayCommand(fDelay,fnDoSequence(oPC,oCage,oMatilda));
|
|
} // fnDoSequence()
|
|
|
|
void fnCreateAndDo(object oPC,object oWP,object oMatilda)
|
|
{
|
|
object oCage;
|
|
oCage=CreateObject(OBJECT_TYPE_PLACEABLE,"forcecage",GetLocation(oWP));
|
|
SetLocalInt(oMatilda,"nGNBDisabled",TRUE);
|
|
AssignCommand(oPC,JumpToObject(oWP));
|
|
fnDoSequence(oPC,oCage,oMatilda);
|
|
} // fnCreateAndDo()
|
|
|
|
/////////////////////////////////////////////////////////////////// MAIN
|
|
void main()
|
|
{
|
|
object oWP=GetWaypointByTag("COVEY_PLACECAGE");
|
|
object oPC=GetEnteringObject();
|
|
object oMatilda=GetObjectByTag("Matilda");
|
|
if (GetIsPC(oPC)==TRUE)
|
|
{ // PC entered trap area
|
|
AssignCommand(oMatilda,SpeakString("Versaknia Zamosath!!"));
|
|
DelayCommand(3.0,fnCreateAndDo(oPC,oWP,oMatilda));
|
|
} // PC entered trap area
|
|
}
|