//#include "_persist_01a" void main() { object oPC = GetLastOpenedBy(); //int iCarpentrySkill = GetTokenPair(oPC,13,3); int iCarpentrySkill = GetCampaignInt("UOACraft","iCarpentrySkill",oPC); int iCarpentryChance = iCarpentrySkill; int iWoodType = GetLocalInt(oPC,"iUseThisWood"); if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID) { CreateItemOnObject("skilllogbook",oPC,1); } if (iCarpentryChance < 350) { iCarpentryChance = GetAbilityScore(oPC,ABILITY_STRENGTH)*5; iCarpentryChance = iCarpentryChance+(GetAbilityScore(oPC,ABILITY_DEXTERITY)*3); iCarpentryChance = iCarpentryChance+(GetAbilityScore(oPC,ABILITY_CONSTITUTION)*2); iCarpentryChance = iCarpentryChance*3; if (iCarpentryChance>350)iCarpentryChance=350; if (iCarpentrySkill > iCarpentryChance) iCarpentryChance=iCarpentrySkill; } // 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 * 10; iCarpentryChance = iCarpentryChance - iPenalty; // Create tokens for items which are 24.0 skill or below, as all characters can make these. CreateItemOnObject("pattern109",OBJECT_SELF,1); //Torch if (iCarpentryChance >=200) CreateItemOnObject("pattern103",OBJECT_SELF,1); //Quarterstaff if (iCarpentryChance >=300) CreateItemOnObject("pattern104",OBJECT_SELF,1); // //if (iCarpentryChance >=450) CreateItemOnObject("pattern",OBJECT_SELF,1); // if (iWoodType==0) { if (iCarpentryChance >=400) CreateItemOnObject("pattern117",OBJECT_SELF,1); //Wine Cask if (iCarpentryChance >=500) CreateItemOnObject("pattern118",OBJECT_SELF,1); //Beer Barrel } if (iWoodType==7) { if (iCarpentryChance >=400) CreateItemOnObject("pattern119",OBJECT_SELF,1); //Mead Barrel } if (iWoodType==15) { if (iCarpentryChance >=200) CreateItemOnObject("pattern120",OBJECT_SELF,1); //Whiskey Barrel if (iCarpentryChance >=250) CreateItemOnObject("pattern121",OBJECT_SELF,1); //Rum Barrel } // 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); } }