#include "nw_i0_plot" void main() { object oPC = GetEnteringObject(); if (!GetIsPC(oPC)) return; //checks if special encounter is already active if (GetPLocalInt(oPC,"iPirateAttack") != 0) return; //dice roll to see where the party will end up after leaving the hold int nPirateRoll = d10(); //20% chance of getting a pirate attack if (nPirateRoll<=2) { SetPLocalInt(oPC, "iPirateAttack", 1); return; } //20% chance of a ghost ship encounter if (nPirateRoll>=9) { SetPLocalInt(oPC, "iPirateAttack", 3); return; } //otherwise put the party on normal deck SetPLocalInt(oPC, "iPirateAttack", 2); }