//:://///////////////////////////////////////////// //:: Mark Fritzlen //:: CheckIfTrapdoorFound //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* This script is meant to be triggered by a onEnter event when the user enters the zone of a generic trigger. This implementation is currently set up with a single placed throwrug with the trigger surrounding the area around the throw rug. Notes: make sure the Static proporty of the throwrug is not set or it will be undestroyable. */ //::////////////////////////////////////////////// //:: Created By: Mark "Levian Del'Orr" Fritzlen //:: Created On: June 21, 2002 //::////////////////////////////////////////////// #include "prc_inc_racial" void FoundSecretTrapdoor(object oFinder); void main() { //Initialize variables int iDC = 15; //Set this value to a higher number if trapdoor is more difficult to find int iClassModifier = 0; //Search bonus based on class, int iRaceModifier = 0; //Search bonus based on race; int iSearchSkillModifier = 0; //Search bonus based on search skill object oFinder = GetEnteringObject(); if (GetIsPC(oFinder) == TRUE) { AssignCommand(oFinder, SpeakString("hmmm ... somthing seems weird about this place.")); //Assign class modifiers //NOT SURE OF THESE RULES...NEED TO CHECK AD&D PLAYERS GUIDE if (GetLevelByClass(CLASS_TYPE_ROGUE, oFinder) > 0) { iClassModifier =+ 2; } else if (GetLevelByClass(CLASS_TYPE_RANGER, oFinder) > 0 || GetLevelByClass (CLASS_TYPE_BARD, oFinder) > 0) { iClassModifier =+ 1; } //Assign Race Modifier //NOT SURE OF THESE RULES...NEED TO CHECK AD&D PLAYERS GUIDE if (MyPRCGetRacialType(oFinder) == RACIAL_TYPE_DWARF || MyPRCGetRacialType(oFinder) == RACIAL_TYPE_ELF) { iRaceModifier =+ 2; } else if (MyPRCGetRacialType(oFinder) == RACIAL_TYPE_HALFELF) { iRaceModifier =+ 1; } if (GetHasFeat(FEAT_KEEN_SENSE, oFinder)) { iRaceModifier =+ 2; } //Assign Skill Modifier //NOT SURE OF THESE RULES...NEED TO CHECK AD&D PLAYERS GUIDE //Just assigning the search skill value iSearchSkillModifier = GetSkillRank(SKILL_SEARCH, oFinder); //Determine if the user notices the trapdoor under the rug if (d20(1) + iClassModifier + iRaceModifier + iSearchSkillModifier > iDC) { //Secret trapdoor is found FoundSecretTrapdoor (oFinder); } } } void FoundSecretTrapdoor(object oFinder) { object oTrapdoor; object oNewTrapdoor; oTrapdoor = GetObjectByTag("WP_HiddenTrapdoor"); location loc = GetLocation(oTrapdoor); oNewTrapdoor = CreateObject(OBJECT_TYPE_PLACEABLE, "trapdoor001", loc, FALSE); AssignCommand(oFinder, SpeakString("Oh look, I discovered a trapdoor!")); }