2024-06-14 10:48:20 -04:00
|
|
|
//#include "_persist_01a"
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
object oPC = GetLastOpenedBy();
|
|
|
|
//int iGlassSkill = GetTokenPair(oPC,14,5);
|
2024-09-16 23:40:48 -04:00
|
|
|
int iGlassSkill = GetCampaignInt("UOACraft","iTinkerSkill",oPC);
|
2024-06-14 10:48:20 -04:00
|
|
|
int iGlassChance = iGlassSkill;
|
|
|
|
|
|
|
|
if (GetItemPossessedBy(oPC,"NoDrop_SkillLogBook")==OBJECT_INVALID)
|
|
|
|
{
|
|
|
|
CreateItemOnObject("skilllogbook",oPC,1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (iGlassChance <350)
|
|
|
|
{
|
|
|
|
iGlassChance = GetAbilityScore(oPC,ABILITY_DEXTERITY)*5;
|
|
|
|
iGlassChance = iGlassChance+(GetAbilityScore(oPC,ABILITY_INTELLIGENCE)*3);
|
|
|
|
iGlassChance = iGlassChance+(GetAbilityScore(oPC,ABILITY_STRENGTH)*2);
|
|
|
|
iGlassChance = iGlassChance *3;
|
|
|
|
if (iGlassChance > 350) iGlassChance = 350;
|
|
|
|
if (iGlassSkill > iGlassChance) iGlassChance = iGlassSkill;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Create Flagswitches for filling arrow tips, etc, with various potions
|
|
|
|
CreateItemOnObject("flagswitch058",OBJECT_SELF,1); //Weak Acid Selector
|
|
|
|
if (iGlassChance>=100)CreateItemOnObject("flagswitch059",OBJECT_SELF,1); //Moderate Acid Selector
|
|
|
|
if (iGlassChance>=250)CreateItemOnObject("flagswitch060",OBJECT_SELF,1); //Strong Acid Selector
|
|
|
|
if (iGlassChance>=500)CreateItemOnObject("flagswitch061",OBJECT_SELF,1); //Very Strong Acid Selector
|
|
|
|
|
|
|
|
|
|
|
|
// Create Patterns for objects with less than 24.0 skill
|
|
|
|
CreateItemOnObject("pattern001",OBJECT_SELF,1); //Tinker Toolset
|
|
|
|
CreateItemOnObject("pattern008",OBJECT_SELF,1); // Shovel
|
|
|
|
CreateItemOnObject("pattern005",OBJECT_SELF,1); // Sewing Kit
|
|
|
|
CreateItemOnObject("pattern012",OBJECT_SELF,1); // Sewing Kit
|
|
|
|
CreateItemOnObject("pattern112",OBJECT_SELF,1); // Carpenters Tools
|
|
|
|
|
|
|
|
if (iGlassChance >= 250) CreateItemOnObject("pattern009",OBJECT_SELF,1); // Woodsman Axe
|
|
|
|
if (iGlassChance >= 250) CreateItemOnObject("pattern079",OBJECT_SELF,1); // Orchard Blade
|
|
|
|
if (iGlassChance >= 300) CreateItemOnObject("pattern080",OBJECT_SELF,1); // Fillet Knife
|
|
|
|
if (iGlassChance >= 300) CreateItemOnObject("pattern006",OBJECT_SELF,1); // Miner's Pick
|
|
|
|
if (iGlassChance >= 350) CreateItemOnObject("pattern007",OBJECT_SELF,1); // Miner's Pickaxe
|
|
|
|
if (iGlassChance >= 400) CreateItemOnObject("pattern089",OBJECT_SELF,1); // Excavation Tools
|
|
|
|
if (iGlassChance >= 500) CreateItemOnObject("pattern081",OBJECT_SELF,1); // Glass Arrowhead
|
|
|
|
if (iGlassChance >= 500) CreateItemOnObject("pattern082",OBJECT_SELF,1); // Glass Bolt Tip
|
|
|
|
if (iGlassChance >= 600) CreateItemOnObject("pattern083",OBJECT_SELF,1); // Glass Sling Bullet
|
|
|
|
|
|
|
|
// 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);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|