Aschbourne_PRC8/_module/nss/_open_bowyer.nss
GetOffMyYarn 69879d6957 Areas and Fixes
Added CCOH and missing areas
Changed some areas to be craftable,
Fixed some on death issues,
Fixed the Gaurd
2024-08-30 11:38:44 -04:00

78 lines
3.3 KiB
Plaintext

//#include "_persist_01a"
#include "aps_include"
void main()
{
object oPC = GetLastOpenedBy();
//int iBowSkill = GetTokenPair(oPC,13,3);
int iBowSkill = GetPersistentInt(oPC,"iBowSkill","UOACraft"
);
int iBowChance = iBowSkill;
int iWoodType = GetLocalInt(oPC,"iUseThisWood");
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)
{
CreateItemOnObject("skilllogbook",oPC,1);
}
if (iBowChance < 350)
{
iBowChance = GetAbilityScore(oPC,ABILITY_STRENGTH)*5;
iBowChance = iBowChance+(GetAbilityScore(oPC,ABILITY_DEXTERITY)*3);
iBowChance = iBowChance+(GetAbilityScore(oPC,ABILITY_WISDOM)*2);
iBowChance = iBowChance*3;
if (iBowChance>350)iBowChance=350;
if (iBowSkill > iBowChance) iBowChance=iBowSkill;
}
// Create Wood Type FlagSwitches
if (iWoodType != 0)CreateItemOnObject("flagswitch026",OBJECT_SELF,1);
if (iWoodType != 1)CreateItemOnObject("flagswitch027",OBJECT_SELF,1);
if (iWoodType != 2)CreateItemOnObject("flagswitch028",OBJECT_SELF,1);
if (iWoodType != 3)CreateItemOnObject("flagswitch029",OBJECT_SELF,1);
if (iWoodType != 4)CreateItemOnObject("flagswitch030",OBJECT_SELF,1);
if (iWoodType != 5)CreateItemOnObject("flagswitch031",OBJECT_SELF,1);
if (iWoodType != 6)CreateItemOnObject("flagswitch032",OBJECT_SELF,1);
if (iWoodType != 7)CreateItemOnObject("flagswitch033",OBJECT_SELF,1);
if (iWoodType != 8)CreateItemOnObject("flagswitch034",OBJECT_SELF,1);
if (iWoodType != 9)CreateItemOnObject("flagswitch035",OBJECT_SELF,1);
if (iWoodType != 10)CreateItemOnObject("flagswitch036",OBJECT_SELF,1);
if (iWoodType != 11)CreateItemOnObject("flagswitch037",OBJECT_SELF,1);
if (iWoodType != 12)CreateItemOnObject("flagswitch038",OBJECT_SELF,1);
if (iWoodType != 13)CreateItemOnObject("flagswitch039",OBJECT_SELF,1);
if (iWoodType != 14)CreateItemOnObject("flagswitch040",OBJECT_SELF,1);
if (iWoodType != 15)CreateItemOnObject("flagswitch041",OBJECT_SELF,1);
if (iWoodType != 16)CreateItemOnObject("flagswitch042",OBJECT_SELF,1);
if (iWoodType != 17)CreateItemOnObject("flagswitch043",OBJECT_SELF,1);
if (iWoodType != 18)CreateItemOnObject("flagswitch044",OBJECT_SELF,1);
int iPenalty = iWoodType * 5;
iBowChance = iBowChance - iPenalty;
// Create tokens for items which are 24.0 skill or below, as all characters can make these.
CreateItemOnObject("pattern055",OBJECT_SELF,1); //ShortBow
if (iBowChance >=250) CreateItemOnObject("pattern016",OBJECT_SELF,1); //Light Crossbow
if (iBowChance >=400) CreateItemOnObject("pattern058",OBJECT_SELF,1); //Long Bow
if (iBowChance >=450) CreateItemOnObject("pattern017",OBJECT_SELF,1); //Heavy CrossBow
// Search for and destroy any hidden 'body bags' from prior incarnations of this placeable
object oSearchForBag = GetNearestObjectByTag("Body Bag",OBJECT_SELF,1);
if (oSearchForBag == OBJECT_INVALID)return;
object oBagItem = OBJECT_INVALID;
if (GetDistanceToObject(oSearchForBag)<= 0.2)
{
//SendMessageToPC(GetFirstPC(),"Body bag found.. destroying contents..");
oBagItem = GetFirstItemInInventory(oSearchForBag);
while (oBagItem != OBJECT_INVALID)
{
//SendMessageToPC(GetFirstPC(),"Destroying : "+GetName(oBagItem));
DestroyObject(oBagItem);
oBagItem = GetNextItemInInventory(oSearchForBag);
}
DestroyObject(oSearchForBag,1.0);
}
}