Initial commit. Updated release archive.
This commit is contained in:
34
_module/nss/as_pirate_check.nss
Normal file
34
_module/nss/as_pirate_check.nss
Normal file
@@ -0,0 +1,34 @@
|
||||
#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);
|
||||
|
||||
}
|
Reference in New Issue
Block a user