void CheckResult(location old, object PC, int phase) { if (old != GetLocation(PC)) return; if (GetLocalInt(GetNearestObject(OBJECT_TYPE_DOOR), "escaping") == 0) { ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(phase + 1, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_PLUS_FIVE), PC); return; } SetLocalInt(OBJECT_SELF, "phase", ++phase); AssignCommand(PC, ActionWait(1.0)); AssignCommand(PC, ActionInteractObject(OBJECT_SELF)); } void Effects(object oPC, int phase) { if (phase == 0) FloatingTextStringOnCreature("You see a crack and start to dig", oPC, FALSE); else { switch (Random(35)) { case 0: FloatingTextStringOnCreature("This is more difficult than I thought", oPC, FALSE); break; case 1: FloatingTextStringOnCreature("Smells like something died here", oPC, FALSE); break; case 2: FloatingTextStringOnCreature("I think I must of taken a wrong turn", oPC, FALSE); break; case 3: FloatingTextStringOnCreature("This better be worth it", oPC, FALSE); break; case 4: FloatingTextStringOnCreature("I hope the guard doesn't catch me", oPC, FALSE); break; case 5: FloatingTextStringOnCreature("So this is justice", oPC, FALSE); break; case 6: FloatingTextStringOnCreature("I feel like Alice in wonderland", oPC, FALSE); break; case 7: FloatingTextStringOnCreature("Hey a dead rat!", oPC, FALSE); CreateItemOnObject("deadrat", oPC); break; case 8: FloatingTextStringOnCreature("I am completely lost", oPC, FALSE); break; case 9: FloatingTextStringOnCreature("Damn this is thick wall", oPC, FALSE); break; case 10: FloatingTextStringOnCreature("Sorry Tyr, I'm too impatient for imprisonment", oPC, FALSE); break; case 11: FloatingTextStringOnCreature("*Singing* Gonna break outta' prison, gonna buy me a mate", oPC, FALSE); break; case 12: FloatingTextStringOnCreature("'Put some forearm into it!' Who said that?!?", oPC, FALSE); break; case 13: FloatingTextStringOnCreature("If only 'ma could see me now!", oPC, FALSE); break; case 14: FloatingTextStringOnCreature("Look 'ma, no hands!", oPC, FALSE); break; case 15: FloatingTextStringOnCreature("Hmm.. wonder where this leads?", oPC, FALSE); break; case 16: FloatingTextStringOnCreature("This is exhausting, if only I could get a cup of coffee", oPC, FALSE); break; case 17: // FloatingTextStringOnCreature("IF YOU CAN READ THIS, SLAP MIKKOR AND TELL HIM HE CAN'T CODE", oPC, FALSE); break; FloatingTextStringOnCreature("Buttons and Barndoors!", oPC, FALSE); break; case 18: FloatingTextStringOnCreature("aosad", oPC, FALSE); break; case 19: FloatingTextStringOnCreature("If this doesn't get me out, theres always suicide", oPC, FALSE); break; case 20: FloatingTextStringOnCreature("X marks the spot... Where's the X?!?", oPC, FALSE); break; case 21: FloatingTextStringOnCreature("Just like marriage", oPC, FALSE); break; case 22: FloatingTextStringOnCreature("After this, I'm going to kidnap a badger", oPC, FALSE); break; case 23: FloatingTextStringOnCreature("Whats that smell? Oh.. its me", oPC, FALSE); break; case 24: FloatingTextStringOnCreature("I see dead people", oPC, FALSE); break; case 25: FloatingTextStringOnCreature("I have a feeling.. I'll be back", oPC, FALSE); break; case 26: FloatingTextStringOnCreature("Remake would be an easier way", oPC, FALSE); break; case 27: FloatingTextStringOnCreature("Maybe I should just give up.. nah", oPC, FALSE); break; case 28: FloatingTextStringOnCreature("Mmm, food", oPC, FALSE); CreateItemOnObject("deadrat", oPC); break; case 29: FloatingTextStringOnCreature("Hey, my lucky day!", oPC, FALSE); GiveGoldToCreature(oPC, 1); break; case 30: FloatingTextStringOnCreature("Ahaa! So that's the way you do it", oPC, FALSE); GiveXPToCreature(oPC, 1); break; case 31: FloatingTextStringOnCreature("Oops, I think I took the wrong turn", oPC, FALSE); GiveXPToCreature(oPC, -1); break; case 32: FloatingTextStringOnCreature("Hey, some leterature!", oPC, FALSE); CreateItemOnObject("prisonbook", oPC); break; case 33: FloatingTextStringOnCreature("Arggh! I see the light, it burns!!!", oPC, FALSE); GiveXPToCreature(oPC, 1); break; case 34: FloatingTextStringOnCreature("Hey, a dead fish!", oPC, FALSE); CreateItemOnObject("deadfish", oPC); break; } } } void CheckGuard(object oPC) { if (GetLocalInt(GetNearestObject(OBJECT_TYPE_DOOR), "escaping") == 1) AssignCommand(oPC, JumpToObject(GetNearestObject(OBJECT_TYPE_WAYPOINT))); } void main() { if (GetLocalInt(OBJECT_SELF, "escaping") == 1) return; SetLocalInt(OBJECT_SELF, "escaping", 1); DelayCommand(10.0, SetLocalInt(OBJECT_SELF, "escaping", 0)); object oPC = GetLastUsedBy(); location lPC = GetLocation(oPC); if (GetLocalInt(GetNearestObject(OBJECT_TYPE_DOOR), "escaping") == 0) SetLocalInt(OBJECT_SELF, "phase", 0); int phase = GetLocalInt(OBJECT_SELF, "phase"); if (phase == 6) { AssignCommand(oPC, JumpToObject(GetNearestObject(OBJECT_TYPE_WAYPOINT))); SetLocalInt(oPC, "nullified", 0); if (GetItemPossessedBy(oPC, "BadgeOfFallen") != OBJECT_INVALID) return; effect eEffect = GetFirstEffect(oPC); while(GetIsEffectValid(eEffect)) { if (GetEffectType(eEffect) == EFFECT_TYPE_SPELL_FAILURE) DelayCommand(0.1, RemoveEffect(oPC, eEffect)); eEffect = GetNextEffect(oPC); } return; } DelayCommand(0.5, Effects(oPC, phase)); SetLocalInt(GetNearestObject(OBJECT_TYPE_DOOR), "escaping", 1); AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 10.0)); DelayCommand(10.0, CheckResult(lPC, oPC, phase)); PlaySound("as_cv_mineshovl1"); }