//////////////////////////////////////////////////////////////////////////////// /* Script Type: Placeable Script; OnUsed Description: Placed parrot in Sarah's bedroom in Home area Added to make parrot placeable less static as well as to provide a hint to click on the bloodstain - Speak random string */ //////////////////////////////////////////////////////////////////////////////// void randomLine (object oParrot); void main() { object oPC = GetLastUsedBy(); // if Player has already clicked on parrot before: if (GetIsPC(oPC) && (GetLocalInt(oPC, "usedKeats") == 1)) { // if Player has clicked on parrot five times: if ((GetLocalInt(oPC, "numberUsedKeats") == 5)) { AssignCommand(OBJECT_SELF, ActionSpeakString("Shouldn't you be looking for your daughter? Maybe click on that bloodstain over there, hmm?")); // Reset click count SetLocalInt(oPC, "numberUsedKeats", 1); } // Otherwise: else { // Speak random string randomLine(OBJECT_SELF); // Increment click count int nKeats = GetLocalInt(oPC, "numberUsedKeats"); SetLocalInt(oPC, "numberUsedKeats", nKeats+1); } } // On first click, mark parrot as used if (GetIsPC(oPC) && !(GetLocalInt(oPC, "usedKeats") == 1)) { //Speak flavor string AssignCommand(oPC, ClearAllActions()); AssignCommand(oPC, ActionSpeakString("It's Keats, your daughter's pet parrot.")); // Mark as used SetLocalInt(oPC, "usedKeats", 1); // Start click count SetLocalInt(oPC, "numberUsedKeats", 1); } } // Randomly assign a speakstring to object oParrot void randomLine (object oParrot) { int nCase = Random(3); switch (nCase) { case 0: AssignCommand(oParrot, ActionSpeakString("I'm just a parrot! Yup!")); break; case 1: AssignCommand(oParrot, ActionSpeakString("Stop poking me! Awk!")); break; case 2: AssignCommand(oParrot, ActionSpeakString("I've nothing clever to say! Nope!")); break; } }