Files
Anphillia_PRC8/_module/nss/anph_fishing.nss
Jaysyn904 28cdb617b3 Initial commit
Adding all of the current content for Anphillia Unlimited.
2024-01-04 07:49:38 -05:00

96 lines
4.3 KiB
Plaintext

void main()
{
object oPC = GetClickingObject();
object oFishingRod = GetObjectByTag("FishingRod");
object oPoss = GetItemPossessedBy(oPC, "FishingRod");
object oBearspawn = GetWaypointByTag("BearSpawn");
location lBear = GetLocation(oBearspawn);
location lLoc = GetLocation(oPC);
int nDexMod = GetAbilityModifier (ABILITY_DEXTERITY, oPC);
int nWisMod = GetAbilityModifier (ABILITY_WISDOM, oPC);
int nRoll = d20(); //The roll
int nTotal = nRoll + nDexMod + nWisMod; //Total roll
int nFishLong = d20() + 9; //The longer of the fish
string sFish = IntToString(nFishLong);
if (oPoss != OBJECT_INVALID) //Checks if the PC has a fishing rod!
{
PlaySound("as_na_splash2");
if (nTotal >= 18) //DC check to catch a fish, it's not that easy!
{
int nCatch= d100(); //ok, what did the PC caught?
if (nCatch == 100) //PC gets a loot bag!
{
CreateObject(OBJECT_TYPE_PLACEABLE, "plc_lootbag2", lLoc, TRUE);
SendMessageToPC(oPC, "You caught a bag!!!!");
}
if ( (nCatch >= 50) && (nCatch <= 99) ) //PC gets a fish
{
CreateObject(OBJECT_TYPE_ITEM, "nw_it_msmlmisc20", lLoc, TRUE);
SendMessageToPC(oPC, "You caught a " + sFish + " inches fish!!!!");
object oFishes = GetObjectByTag("NW_IT_MSMLMISC20", 3); //Checks if there are 3 fishes around
if (oFishes != OBJECT_INVALID) //So, if there are more than 3 fishes around...
{
int nAttrackRoll = d100(); //The % roll to attrack a bear
if (nAttrackRoll >= 90) //The (reversed) % of attracting a bear
{
CreateObject(OBJECT_TYPE_CREATURE, "nw_bearbrwn", lBear, TRUE);
SendMessageToPC(oPC, "The smell of fish attracked a BEAR, run (and don't forget your fishing rod)!");
}
}
}
if ( (nCatch >= 30) && (nCatch <=49) ) //PC gets a bottle
{
CreateObject(OBJECT_TYPE_ITEM, "nw_it_thnmisc001", lLoc, TRUE);
SendMessageToPC(oPC, "You caught an empty bottle!!!!");
}
if ( (nCatch >= 25) && (nCatch <=29) ) //PC gets a skeleton and fight
{
CreateObject(OBJECT_TYPE_PLACEABLE, "nw_pl_skeleton", lLoc, TRUE);
SendMessageToPC(oPC, "You caught a skeleton!!!");
}
if ( (nCatch >= 20) && (nCatch <=24) ) //PC gets a corpse
{
CreateObject(OBJECT_TYPE_PLACEABLE, "plc_corpse1", lLoc, TRUE);
SendMessageToPC(oPC, "You caught a corpse!!!");
}
if ( (nCatch >= 10) && (nCatch <=19) ) //PC gets rags
{
CreateObject(OBJECT_TYPE_ITEM, "nw_it_msmlmisc21", lLoc, TRUE);
SendMessageToPC(oPC, "You caught some smelly rags!!!");
}
if ( (nCatch >= 05) && (nCatch <=09) ) //PC gets a gargoyle skull
{
CreateObject(OBJECT_TYPE_ITEM, "nw_it_msmlmisc14", lLoc, TRUE);
SendMessageToPC(oPC, "You caught a skull!!!!");
}
if ( (nCatch >= 01) && (nCatch <=04) ) //PC gets stein
{
CreateObject(OBJECT_TYPE_ITEM, "nw_it_thnmisc002", lLoc, TRUE);
SendMessageToPC(oPC, "You caught an empty ale stein!!!!");
}
}
if (nTotal <=17) //Too bad!
{
SendMessageToPC(oPC, "You caught nothing, better luck next time!");
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED , 1.0, 2.0));
}
int nBreak = d100(); //that's to check if the rod will break!
if (nBreak >= 95)
{
SendMessageToPC(oPC, "You almost got one but it got away and your fishing rod broke!!!!");
DestroyObject(oPoss, 0.0);
PlaySound("as_na_branchsnp3");
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS , 1.0, 2.0));
}
}
else
{
SendMessageToPC(oPC, "You don't have a fishing rod, get one if you want to fish!");
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD , 1.0, 2.0));
}
}