int GetTimeAdder(string currentTag, string replacementTag, int adder); void main() { PlaySound("as_sw_stonelk1"); int iDay = GetTimeAdder("obd20", "obd20", 16); iDay = iDay + GetTimeAdder("obd12", "obd10", 4); iDay = iDay + GetTimeAdder("obd13", "obd10", 8); iDay = iDay + GetTimeAdder("obd10", "obd10", 12); iDay = iDay + GetTimeAdder("obd02", "obd00", 1); iDay = iDay + GetTimeAdder("obd03", "obd00", 2); iDay = iDay + GetTimeAdder("obd00", "obd00", 3); int iHour = GetTimeAdder("obh20", "obh20", 16); iHour = iHour + GetTimeAdder("obh12", "obh10", 4); iHour = iHour + GetTimeAdder("obh13", "obh10", 8); iHour = iHour + GetTimeAdder("obh10", "obh10", 12); iHour = iHour + GetTimeAdder("obh02", "obh00", 1); iHour = iHour + GetTimeAdder("obh03", "obh00", 2); iHour = iHour + GetTimeAdder("obh00", "obh00", 3); location lLoc; //SpeakString("Day=" + IntToString(iDay) + " Hour="+IntToString(iHour)); if(GetCalendarDay()==iDay && GetTimeHour()==iHour) { PlaySound("as_mg_telepin1"); lLoc=GetLocation(GetWaypointByTag("di_wp_dropoffpoint")); //object oXport = CreateObject(OBJECT_TYPE_PLACEABLE, "xport2obelisk", lLoc, TRUE); //DestroyObject(oXport, 30.0); object oXport = CreateObject(OBJECT_TYPE_PLACEABLE, "di_teleport", lLoc, TRUE, "di_wp_dropoff"); DestroyObject(oXport, 30.0); lLoc=GetLocation(GetWaypointByTag("di_wp_openfield")); oXport = CreateObject(OBJECT_TYPE_PLACEABLE, "di_teleport", lLoc, TRUE, "di_wp_center"); DestroyObject(oXport, 30.0); lLoc=GetLocation(GetWaypointByTag("di_wp_cliffsbottom")); oXport = CreateObject(OBJECT_TYPE_PLACEABLE, "di_teleport", lLoc, TRUE, "ihavefallen"); DestroyObject(oXport, 30.0); lLoc=GetLocation(GetWaypointByTag("di_wp_dreadsthrone")); oXport = CreateObject(OBJECT_TYPE_PLACEABLE, "di_teleport", lLoc, TRUE, "di_dreads_curse_2"); DestroyObject(oXport, 30.0); } else { PlaySound("gui_cannotequip"); if(GetWaypointByTag("di_wp_sdelay1") == OBJECT_INVALID) { object wpTimer = CreateObject(OBJECT_TYPE_WAYPOINT, "NW_WAYPOINT001", GetLocation(GetWaypointByTag("di_wp_cliffsbottom")), FALSE, "di_wp_sdelay1"); DestroyObject(wpTimer, 90.0f); // spawn ugly critter here... location lLoc = GetLocation(GetWaypointByTag("di_wp_openfield")); int c = Random(9); string sResRef; if(c==0) { sResRef = "di_dread_viper"; } else if (c==1) { sResRef = "di_dread_crab"; } else if (c==2) { sResRef = "di_dread_scorpio"; } else if (c==3) { sResRef = "di_filthy_wretch"; } else if (c==4) { sResRef = "di_flotsam"; CreateObject(OBJECT_TYPE_CREATURE, "di_getsam", lLoc, FALSE); } else if (c==5) { sResRef = "di_mangy_curr"; } else if (c==6) { sResRef = "di_sharieking_el"; } else { sResRef = "di_scabrous_dog"; } CreateObject(OBJECT_TYPE_CREATURE, sResRef, lLoc, FALSE); } } } int GetTimeAdder(string currentTag, string replacementResRef, int adder) { object oRuneCheck = GetObjectByTag(currentTag); int result = 0; if(oRuneCheck != OBJECT_INVALID) { result = adder; location lLoc = GetLocation(oRuneCheck); DestroyObject(oRuneCheck); CreateObject(OBJECT_TYPE_PLACEABLE, replacementResRef, lLoc); } return result; }