//#include "_persist_01a" #include "nw_i0_plot" #include "x2_inc_itemprop" #include "aps_include" void CreateAnObject(string sResource, object oPC, int iStackSize); void CreateCraftedObject(string sResRef, object oPC, int iIngotType, int iJewelType, int iQuality); string GetObjectName(object oPC, int iIngotType, int iJewelType); void GetNextStackedItem(object oPC, string sItemTag, int iCount, int iMode, string sStackResRef); void GetNextItemPossessedBy(object oPC, string sItemTag); string CraftLookup(string sResRef, int iIngotType, int iJewelType); itemproperty GetProperty(int iProp, int iIngotType, int iJewelType, string sType, string sQuality); //string ComponentLookup(int iIngotType, int iJewelType); void main() { object oItem = GetInventoryDisturbItem(); object oPC = GetLastDisturbed(); object oSelf = OBJECT_SELF; string sTag = GetTag(oItem); string sSuccess = ""; string sFail = ""; string sItemResRef = ""; string sItemResRefPoor = ""; string sItemResRefExceptional = ""; int iRandom = 0; int iSuccess = 0; int iSuccess2 = 0; int iSkillGain = 0; int iComponent1 = 1; int iComponent2 = 0; int iComponent3 = 0; int iComponent1Stackable = 0; int iComponent2Stackable = 1; int iComponent3Stackable = 0; int iStackSize; int iDifficulty; string sComponent1 = ""; string sComponent2 = ""; string sComponent3 = ""; string sComponent1Name = ""; string sComponent2Name = ""; string sComponent3Name = ""; string sComponentResRef = ""; object oTemp = OBJECT_INVALID; string sJewelryType; int iIngotType = GetLocalInt(oPC,"iUseIngotType"); // get the current ingot type used int iIngotMod = iIngotType *25;// set the skill modifier for the ingot type used. //Modifiers for Ingot Type if (iIngotType==9) iIngotMod = 90; // Silver is little easier than Bronze if (iIngotType==10) iIngotMod = 175; // Mithril is hard as Verite if (iIngotType==11) iIngotMod = 200; // Adamantite is hard as Valorite if (iIngotType==12) iIngotMod = 150; // Platinum is hard as Agapite if (iIngotMod >0) iIngotMod = iIngotMod + 250; int iJewelType = GetLocalInt(oPC,"iUseJewelType"); int iJewelMod = 0; //Modifiers for Gem Type if (iJewelType>0) iJewelMod = 50; if (iJewelType>12) iJewelMod = 100; if (iJewelType>25) iJewelMod = 150; if (iJewelType>36) iJewelMod = 200; if (iJewelType>42) iJewelMod = 250; if (iJewelType>50) iJewelMod = 300; int iJewelSkill = GetPersistentInt(oPC,"iJewelSkill","UOACraft"); int iJewelChance = iJewelSkill; if (GetInventoryDisturbType()== INVENTORY_DISTURB_TYPE_ADDED) { // The following 3 lines are to ensure compatability with UOAbigal's Persistent Token System. // You can replace them with whatever 'no-drop' code you have or comment them out. string sNoDropFlag = (GetStringLeft(GetTag(oItem),6)); if (sNoDropFlag == "NoDrop" || sNoDropFlag == "TOKEN_"||sNoDropFlag=="_TBOX_") return; if (GetBaseItemType(oItem)==BASE_ITEM_LARGEBOX) { DestroyObject(oItem); SendMessageToPC(oPC,"To avoid possible dupe exploits, the container placed in this bag may be destroyed."); return; } // End of compatability portion. CopyItem(oItem,oPC,TRUE); DestroyObject(oItem); FloatingTextStringOnCreature("You can only craft by removing pattern tokens from this station.",oPC,FALSE); } // Check for ingot/gem type switch or non-flagswitch/pattern item if (GetStringLeft(GetResRef(oItem),7)!="pattern") { if (sTag == "SWITCH_IRON"){SetLocalInt(oPC,"iUseIngotType",0);sComponent1 = "Iron";} if (sTag == "SWITCH_DULL"){SetLocalInt(oPC,"iUseIngotType",1);sComponent1 = "Dull Copper";} if (sTag == "SWITCH_SHADOW"){SetLocalInt(oPC,"iUseIngotType",2);sComponent1 = "Shadow Iron";} if (sTag == "SWITCH_COPPER"){SetLocalInt(oPC,"iUseIngotType",3);sComponent1 = "Copper";} if (sTag == "SWITCH_BRONZE"){SetLocalInt(oPC,"iUseIngotType",4);sComponent1 = "Bronze";} if (sTag == "SWITCH_GOLD"){SetLocalInt(oPC,"iUseIngotType",5);sComponent1 = "Gold";} if (sTag == "SWITCH_AGAPITE"){SetLocalInt(oPC,"iUseIngotType",6);sComponent1 = "Agapite";} if (sTag == "SWITCH_VERITE"){SetLocalInt(oPC,"iUseIngotType",7);sComponent1 = "Verite";} if (sTag == "SWITCH_VALORITE"){SetLocalInt(oPC,"iUseIngotType",8);sComponent1 = "Valorite";} if (sTag == "SWITCH_SILVER"){SetLocalInt(oPC,"iUseIngotType",9);sComponent1 = "Silver";} if (sTag == "SWITCH_MITHRIL"){SetLocalInt(oPC,"iUseIngotType",10);sComponent1 = "Mithril";} if (sTag == "SWITCH_ADAMANTITE"){SetLocalInt(oPC,"iUseIngotType",11);sComponent1 = "Adamantite";} if (sTag == "SWITCH_PLATINUM"){SetLocalInt(oPC,"iUseIngotType",12);sComponent1 = "Platinum";} if (GetStringRight(sTag,4)=="1000") { SetLocalInt(oPC,"iUseJewelType",0); sComponent2 = GetStringRight(GetName(oItem),GetStringLength(GetName(oItem))-4); FloatingTextStringOnCreature("Preparing to craft without gemstones.",oPC,FALSE); DestroyObject(oItem); //ExecuteScript("_onclose_clear",OBJECT_SELF); //ExecuteScript("_open_anvil",OBJECT_SELF); string sTagSelf = GetTag(oSelf); AssignCommand(oPC,DoPlaceableObjectAction(oSelf,PLACEABLE_ACTION_USE)); AssignCommand(oPC,DelayCommand(1.5,DoPlaceableObjectAction(GetNearestObjectByTag(sTagSelf,oPC,1),PLACEABLE_ACTION_USE))); } if (StringToInt(GetStringRight(sTag,3))>99) { SetLocalInt(oPC,"iUseJewelType",StringToInt(GetStringRight(sTag,3))-100); sComponent2 = GetStringRight(GetName(oItem),GetStringLength(GetName(oItem))-4); FloatingTextStringOnCreature("Preparing to use "+sComponent2+".",oPC,FALSE); DestroyObject(oItem); //ExecuteScript("_onclose_clear",OBJECT_SELF); //ExecuteScript("_open_anvil",OBJECT_SELF); string sTagSelf = GetTag(oSelf); AssignCommand(oPC,DoPlaceableObjectAction(oSelf,PLACEABLE_ACTION_USE)); AssignCommand(oPC,DelayCommand(1.5,DoPlaceableObjectAction(GetNearestObjectByTag(sTagSelf,oPC,1),PLACEABLE_ACTION_USE))); } if (GetStringLeft(sTag,7)=="SWITCH_") { FloatingTextStringOnCreature("Re-tooling to use "+sComponent1+" ingots.",oPC,FALSE); DestroyObject(oItem); //ExecuteScript("_onclose_clear",OBJECT_SELF); //ExecuteScript("_open_anvil",OBJECT_SELF); string sTagSelf = GetTag(oSelf); AssignCommand(oPC,DoPlaceableObjectAction(oSelf,PLACEABLE_ACTION_USE)); AssignCommand(oPC,DelayCommand(1.5,DoPlaceableObjectAction(GetNearestObjectByTag(sTagSelf,oPC,1),PLACEABLE_ACTION_USE))); } return; } CopyObject(oItem,GetLocation(oPC),OBJECT_SELF,GetTag(oItem)); DestroyObject(oItem); if (GetLocalInt(OBJECT_SELF,"iAmInUse") != 0) { SendMessageToPC(oPC,"You must wait until the current jewelry item is completed before starting another."); return; } SetLocalInt(OBJECT_SELF,"iAmInUse",99); DelayCommand(14.0,SetLocalInt(OBJECT_SELF,"iAmInUse",0)); // Set Ingot Tag and name based on ingot selection switch (iIngotType) { case 0:{sComponent2 = "INGOT_IRON";sComponent2Name = "iron ingots";break;} case 1:{sComponent2 = "INGOT_DULL";sComponent2Name = "dull copper ingots";break;} case 2:{sComponent2 = "INGOT_SHADOW";sComponent2Name = "shadow iron ingots";break;} case 3:{sComponent2 = "INGOT_COPPER";sComponent2Name = "copper ingots";break;} case 4:{sComponent2 = "INGOT_BRONZE";sComponent2Name = "bronze ingots";break;} case 5:{sComponent2 = "INGOT_GOLD";sComponent2Name = "gold ingots";break;} case 6:{sComponent2 = "INGOT_AGAPITE";sComponent2Name = "agapite ingots";break;} case 7:{sComponent2 = "INGOT_VERITE";sComponent2Name = "verite ingots";break;} case 8:{sComponent2 = "INGOT_VALORITE";sComponent2Name = "valorite ingots";break;} case 9:{sComponent2 = "INGOT_SILVER";sComponent2Name = "silver ingots";break;} case 10:{sComponent2 = "INGOT_MITHRIL";sComponent2Name = "mithril ingots";break;} case 11:{sComponent2 = "INGOT_ADAMANTITE";sComponent2Name = "adamantite ingots";break;} case 12:{sComponent2 = "INGOT_PLATINUM";sComponent2Name = "platinum ingots";break;} default:{FloatingTextStringOnCreature("Error in ingot selection..",oPC,FALSE);return;break;} } if (iJewelChance < 350) { iJewelChance = GetAbilityScore(oPC,ABILITY_DEXTERITY)*5; iJewelChance = iJewelChance+(GetAbilityScore(oPC,ABILITY_WISDOM)*3); iJewelChance = iJewelChance+(GetAbilityScore(oPC,ABILITY_CHARISMA)*2); iJewelChance = iJewelChance*3; if (iJewelChance>350)iJewelChance=350; if (iJewelSkill > iJewelChance) iJewelChance=iJewelSkill; } //Begin Crafting Test if (sTag == "pattern075")//RINGS { //iJewelChance = iJewelChance - 100; if (iJewelType==0) { sSuccess = "You carefully mold the ring smoothing off any rough edges."; sFail = "The metal shatters the mold as you try to craft the ring."; sItemResRef = CraftLookup("Ring-Normal",iIngotType,0); sItemResRefPoor = CraftLookup("Ring-Poor",iIngotType,0); sItemResRefExceptional = CraftLookup("Ring-Exceptional",iIngotType,0); sComponent1 = "ITEM_RINGMOLD"; // Ring mold sComponent1Name = "ring molds"; } else { sSuccess = "You carefully set the stone into the ring's mount."; sFail = "The gemstone shatters in your attempt to set it into the ring's setting."; sItemResRef = CraftLookup("Ring-Normal",iIngotType,0); sJewelryType = "ring"; sComponent1 = CraftLookup("Ring-Exceptional",iIngotType,0); sComponent1Name = "exceptional "+GetStringLeft(sComponent2Name,GetStringLength(sComponent2Name)-7)+" rings"; } iComponent1 = 1; //1 Ring Mold or 1 Ring of selected Type iComponent2 = 1; //1 Ingot or 1 Exceptional Gem } //Begin Crafting Test if (sTag == "pattern096") //AMULETS { iJewelChance = iJewelChance - 100; if (iJewelType==0) { sSuccess = "You carefully mold the amulet smoothing off any rough edges."; sFail = "The metal shatters the mold as you try to craft the amulet."; sItemResRef = CraftLookup("Amulet-Normal",iIngotType,0); sItemResRefPoor = CraftLookup("Amulet-Poor",iIngotType,0); sItemResRefExceptional = CraftLookup("Amulet-Exceptional",iIngotType,0); sComponent1 = "ITEM_AMULETMOLD"; // Amulet mold sComponent1Name = "amulet molds"; } else { sSuccess = "You carefully set the stone into the amulet's mount."; sFail = "One gemstone shatters in your attempt to set it into the amulet's setting."; sItemResRef = CraftLookup("Amulet-Normal",iIngotType,0); sJewelryType = "ammy"; sComponent1 = CraftLookup("Amulet-Exceptional",iIngotType,0); sComponent1Name = "exceptional "+GetStringLeft(sComponent2Name,GetStringLength(sComponent2Name)-9)+" amulets"; } iComponent1 = 1; //1 Ring Mold or 1 Ring of selected Type iComponent2 = 2; //2 Ingot or 2 Exceptional Gem } //Begin Crafting Test if (sTag == "pattern097")//NECKLACES { iJewelChance = iJewelChance - 50; if (iJewelType==0) { sSuccess = "You carefully mold the necklace smoothing off any rough edges."; sFail = "The metal shatters the mold as you try to craft the necklace."; sItemResRef = CraftLookup("Necklace-Normal",iIngotType,0); sItemResRefPoor = CraftLookup("Necklace-Poor",iIngotType,0); sItemResRefExceptional = CraftLookup("Necklace-Exceptional",iIngotType,0); sComponent1 = "ITEM_NECKLACEMOLD"; // Necklace mold sComponent1Name = "necklace molds"; } else { sSuccess = "You carefully set the stone into the necklace's mount."; sFail = "The gemstone shatters in your attempt to set it into the necklace's mount."; sItemResRef = CraftLookup("Necklace-Normal",iIngotType,0); sJewelryType = "neck"; sComponent1 = CraftLookup("Necklace-Exceptional",iIngotType,0); sComponent1Name = "exceptional "+GetStringLeft(sComponent2Name,GetStringLength(sComponent2Name)-11)+" necklaces"; } iComponent1 = 1; //1 Necklace Mold or 1 Necklace of selected Type iComponent2 = 1; //1 Ingot or 1 Exceptional Gem } //Name the gem, if the type is not '0' - or 'No Gem' switch(iJewelType) { case 0:{break;} //Do nothing.. sComponent2 is an ingot.. set earlier case 1:{sComponent2="GEM_EX_EYEAGATE";sComponent2Name="Expertly Cut Eye Agate";break;} case 2:{sComponent2="GEM_EX_HEMATITE";sComponent2Name="Expertly Cut Hematite";break;} case 3:{sComponent2="GEM_EX_AZURITE";sComponent2Name="Expertly Cut Azurite";break;} case 4:{sComponent2="GEM_EX_BANDEDAGATE";sComponent2Name="Expertly Cut Banded Agate";break;} case 5:{sComponent2="GEM_EX_BLUEQUARTZ";sComponent2Name="Expertly Cut Blue Quartz";break;} case 6:{sComponent2="GEM_EX_LAPISLAZULI";sComponent2Name="Expertly Cut Lapis Lazuli";break;} case 7:{sComponent2="GEM_EX_MALACHITE";sComponent2Name="Expertly Cut Malachite";break;} case 8:{sComponent2="GEM_EX_MOSSAGATE";sComponent2Name="Expertly Cut Moss Agate";break;} case 9:{sComponent2="GEM_EX_OBSIDIAN";sComponent2Name="Expertly Cut Obsidian";break;} case 10:{sComponent2="GEM_EX_RHODOCHROSITE";sComponent2Name="Expertly Cut Rhodochrosite";break;} case 11:{sComponent2="GEM_EX_TIGEREYE";sComponent2Name="Expertly Cut Tiger Eye";break;} case 12:{sComponent2="GEM_EX_TURQUOISE";sComponent2Name="Expertly Cut Turquoise";break;} case 13:{sComponent2="GEM_EX_BLOODSTONE";sComponent2Name="Expertly Cut Bloodtsone";break;} case 14:{sComponent2="GEM_EX_ONYX";sComponent2Name="Expertly Cut Onyx";break;} case 15:{sComponent2="GEM_EX_ZIRCON";sComponent2Name="Expertly Cut Zircon";break;} case 16:{sComponent2="GEM_EX_ROCKCRYSTAL";sComponent2Name="Expertly Cut Rock Crystal";break;} case 17:{sComponent2="GEM_EX_SARDONYX";sComponent2Name="Expertly Cut Sardonyx";break;} case 18:{sComponent2="GEM_EX_SMOKYQUARTZ";sComponent2Name="Expertly Cut Smoky Quartz";break;} case 20:{sComponent2="GEM_EX_STARROSEQUARTZ";sComponent2Name="Expertly Cut Star Rose Quartz";break;} case 19:{sComponent2="GEM_EX_CARNELIAN";sComponent2Name="Expertly Cut Carnelian";break;} case 21:{sComponent2="GEM_EX_CHALCENDONY";sComponent2Name="Expertly Cut Chalcendony";break;} case 22:{sComponent2="GEM_EX_CHRYSOPRASE";sComponent2Name="Expertly Cut Chrysoprase";break;} case 23:{sComponent2="GEM_EX_CITRINE";sComponent2Name="Expertly Cut Citrine";break;} case 24:{sComponent2="GEM_EX_JASPER";sComponent2Name="Expertly Cut Jasper";break;} case 25:{sComponent2="GEM_EX_MOONSTONE";sComponent2Name="Expertly Cut Moonstone";break;} case 26:{sComponent2="GEM_EX_ALEXANDRITE";sComponent2Name="Expertly Cut Alexandrite";break;} case 27:{sComponent2="GEM_EX_AMBER";sComponent2Name="Expertly Cut Amber";break;} case 28:{sComponent2="GEM_EX_AMETHYST";sComponent2Name="Expertly Cut Amethyst";break;} case 29:{sComponent2="GEM_EX_TOURMALINE";sComponent2Name="Expertly Cut Tourmaline";break;} case 30:{sComponent2="GEM_EX_WHITEPEARL";sComponent2Name="Expertly Cut White Pearl";break;} case 31:{sComponent2="GEM_EX_REDSPINEL";sComponent2Name="Expertly Cut Red Spinel";break;} case 32:{sComponent2="GEM_EX_CORAL";sComponent2Name="Expertly Cut Coral";break;} case 33:{sComponent2="GEM_EX_GARNET_RED";sComponent2Name="Expertly Cut Red Garnet";break;} case 34:{sComponent2="GEM_EX_CHRYSOBERYL";sComponent2Name="Expertly Cut Chrysoberyl";break;} case 35:{sComponent2="GEM_EX_JADE";sComponent2Name="Expertly Cut Jade";break;} case 36:{sComponent2="GEM_EX_JET";sComponent2Name="Expertly Cut Jet";break;} case 37:{sComponent2="GEM_EX_TOPAZ";sComponent2Name="Expertly Cut Topaz";break;} case 38:{sComponent2="GEM_EX_PERIDOT";sComponent2Name="Expertly Cut Peridot";break;} case 39:{sComponent2="GEM_EX_GARNET_VIOLET";sComponent2Name="Expertly Cut Violet Garnet";break;} case 40:{sComponent2="GEM_EX_BLUESPINEL";sComponent2Name="Expertly Cut Blue Spinel";break;} case 41:{sComponent2="GEM_EX_AQUAMARINE";sComponent2Name="Expertly Cut Aquamarine";break;} case 42:{sComponent2="GEM_EX_BLACKPEARL";sComponent2Name="Expertly Cut Black Pearl";break;} case 43:{sComponent2="GEM_EX_BLACKOPAL";sComponent2Name="Expertly Cut Black Opal";break;} case 44:{sComponent2="GEM_EX_EMERALD";sComponent2Name="Expertly Cut Emerald";break;} case 45:{sComponent2="GEM_EX_FIREOPAL";sComponent2Name="Expertly Cut Fire Opal";break;} case 46:{sComponent2="GEM_EX_OPAL";sComponent2Name="Expertly Cut Opal";break;} case 47:{sComponent2="GEM_EX_ORIENTALAMETHYST";sComponent2Name="Expertly Cut Oriental Amethyst";break;} case 48:{sComponent2="GEM_EX_ORIENTALTOPAZ";sComponent2Name="Expertly Cut Oriental Topaz";break;} case 49:{sComponent2="GEM_EX_STARRUBY";sComponent2Name="Expertly Cut Star Ruby";break;} case 50:{sComponent2="GEM_EX_STARSAPPHIRE";sComponent2Name="Expertly Cut Star Sapphire";break;} case 51:{sComponent2="GEM_EX_SAPPHIRE";sComponent2Name="Expertly Cut Sapphire";break;} case 52:{sComponent2="GEM_EX_BLACKSAPPHIRE";sComponent2Name="Expertly Cut Black Sapphire";break;} case 53:{sComponent2="GEM_EX_RUBY";sComponent2Name="Expertly Cut Ruby";break;} case 54:{sComponent2="GEM_EX_ORIENTALEMERALD";sComponent2Name="Expertly Cut Oriental Emerald";break;} case 55:{sComponent2="GEM_EX_JACINTH";sComponent2Name="Expertly Cut Jacinth";break;} case 56:{sComponent2="GEM_EX_DIAMOND";sComponent2Name="Expertly Cut Diamond";break;} } //Adjust skill chance for item + component difficulties iJewelChance = iJewelChance - iIngotMod; iJewelChance = iJewelChance - iJewelMod; iJewelChance = iJewelChance - iDifficulty; // check for components if (GetNumItems(oPC,sComponent1) < iComponent1) { FloatingTextStringOnCreature("You do not have enough "+sComponent1Name+" to do this.",oPC,FALSE); return; } if (iComponent2 > 0) { if (GetNumItems(oPC,sComponent2) < iComponent2) { FloatingTextStringOnCreature("You do not have enough "+sComponent2Name+" to do this.",oPC,FALSE); return; } } if (iComponent3 > 0) { if (GetNumItems(oPC,sComponent3) < iComponent3) { FloatingTextStringOnCreature("You do not have enough "+sComponent3Name+" to do this.",oPC,FALSE); return; } } //Assign Animations and sounds AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,12.0)); PlaySound("as_na_steamshrt2"); AssignCommand(oPC,PlaySound("as_na_branchsnp2")); DelayCommand(0.5,PlaySound("as_cv_chiseling3")); DelayCommand(7.0,PlaySound("as_cv_branchsnp2")); DelayCommand(8.2,PlaySound("as_cv_barglass1")); DelayCommand(8.9,PlaySound("as_cv_barglass1")); DelayCommand(9.5,PlaySound("as_cv_barglass1")); DelayCommand(10.0,PlaySound("as_cv_barglass1")); DelayCommand(10.5,PlaySound("as_cv_barglass1")); DelayCommand(11.0,PlaySound("as_cv_barglass1")); DelayCommand(11.5,PlaySound("as_cv_barglass1")); // This snippet of code is cut-n-paste direct from ATS // Reason for this is because I had no clue how to assign an increase // in the z-axis of the location of the anvil for sparks to display. // After reading through this code, it is obvious that vEffecrPos.z // is the line which assigns this. Due to my own ignorance in this issue // I have decided to leave this snippet of code intact with this credit to // the original ATS script coders, whomever they may have been. location locAnvil = GetLocation(OBJECT_SELF); vector vEffectPos = GetPositionFromLocation(locAnvil); vEffectPos.z += 1.0; location locEffect = Location( GetAreaFromLocation(locAnvil), vEffectPos,GetFacingFromLocation(locAnvil) ); ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), locEffect); DelayCommand(1.7, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), locEffect)); DelayCommand(2.4, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), locEffect)); DelayCommand(3.1, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), locEffect)); DelayCommand(3.8, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), locEffect)); // end of ATS snippet ^^^^ // DelayCommand(4.6,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPECIAL_WHITE_ORANGE,FALSE),locEffect)); DelayCommand(5.9,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPARKS_PARRY,FALSE),locEffect)); if (iJewelType==0) { DelayCommand(7.1,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPECIAL_WHITE_BLUE,FALSE),locEffect)); DelayCommand(8.2,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPECIAL_WHITE_BLUE,FALSE),locEffect)); DelayCommand(9.6,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPECIAL_WHITE_BLUE,FALSE),locEffect)); DelayCommand(11.6,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_HIT_ACID,FALSE),locEffect)); } else { DelayCommand(7.1,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPECIAL_RED_ORANGE,FALSE),locEffect)); DelayCommand(8.2,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPARKS_PARRY,FALSE),locEffect)); DelayCommand(9.6,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPARKS_PARRY,FALSE),locEffect)); DelayCommand(11.6,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_HIT_ELECTRICAL,FALSE),locEffect)); } // Remove all components float fPause = 0.0; if (iComponent1Stackable != 0) { oTemp = GetItemPossessedBy(oPC,sComponent1); sComponentResRef = GetResRef(oTemp); iStackSize = GetNumStackedItems(oTemp); DestroyObject(oTemp); if (iStackSize < iComponent1) { iComponent1 = iComponent1 - iStackSize; DelayCommand(2.0,GetNextStackedItem(oPC,sComponent1,iComponent1,1,sComponentResRef)); } else { if (iStackSize > iComponent1) { iStackSize = iStackSize - iComponent1; DelayCommand(1.0,CreateAnObject(sComponentResRef,oPC,iStackSize)); } } } else { for (iComponent1; iComponent1>0; iComponent1--) { fPause = fPause+0.5; AssignCommand(oPC,DelayCommand(fPause,GetNextItemPossessedBy(oPC,sComponent1))); } } if (sComponent2 != "") { if (iComponent2Stackable != 0) { oTemp = GetItemPossessedBy(oPC,sComponent2); sComponentResRef = GetResRef(oTemp); iStackSize = GetNumStackedItems(oTemp); DestroyObject(oTemp); if (iStackSize < iComponent2) { iComponent2 = iComponent2 - iStackSize; DelayCommand(2.0,GetNextStackedItem(oPC,sComponent2,iComponent2,1, sComponentResRef)); } else { if (iStackSize > iComponent2) { iStackSize = iStackSize - iComponent2; DelayCommand(1.0,CreateAnObject(sComponentResRef,oPC,iStackSize)); } } } else { for (iComponent2; iComponent2>0; iComponent2--) { fPause = fPause+0.5; AssignCommand(oPC,DelayCommand(fPause,GetNextItemPossessedBy(oPC,sComponent2))); } } } if (sComponent3 != "") { if (iComponent3Stackable != 0) { oTemp = GetItemPossessedBy(oPC,sComponent3); sComponentResRef = GetResRef(oTemp); iStackSize = GetNumStackedItems(oTemp); DestroyObject(oTemp); if (iStackSize < iComponent3) { iComponent3 = iComponent3 - iStackSize; DelayCommand(2.0,GetNextStackedItem(oPC,sComponent3,iComponent3,1, sComponentResRef)); } else { if (iStackSize > iComponent3) { iStackSize = iStackSize - iComponent3; DelayCommand(1.0,CreateAnObject(sComponentResRef,oPC,iStackSize)); } } } else { for (iComponent3; iComponent3>0; iComponent3--) { fPause = fPause +0.5; AssignCommand(oPC,DelayCommand(fPause,GetNextItemPossessedBy(oPC,sComponent3))); } } } if (Random(800)<=iJewelChance) { iSuccess = 1; iSuccess2 = 1; if (iJewelType==0) //Only for crafting blank rings/etc { iJewelChance = iJewelChance - 50; if (Random(1000) <= iJewelChance) iSuccess2 = iSuccess2+1; iJewelChance = iJewelChance-100; if (Random(1000) <= iJewelChance) iSuccess2 = iSuccess2+1; iJewelChance = iJewelChance + 150; } else { iSuccess2 = 2; //Corrected for making gem-laden items.. to use the correct sResRef variable. } if (iSuccess2 == 1)AssignCommand(oPC,DelayCommand(12.0,CreateCraftedObject(sItemResRefPoor, oPC, iIngotType, iJewelType, iSuccess2))); if (iSuccess2 == 2)AssignCommand(oPC,DelayCommand(12.0,CreateCraftedObject(sItemResRef, oPC, iIngotType, iJewelType, iSuccess2))); if (iSuccess2 == 3)AssignCommand(oPC,DelayCommand(12.0,CreateCraftedObject(sItemResRefExceptional, oPC, iIngotType, iJewelType, iSuccess2))); AssignCommand(oPC,DelayCommand(12.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE))); if (Random(1000) >= iJewelSkill) { if (d10(1)+1 >= iJewelChance/100) iSkillGain = 1; } } else { if (iJewelType==0) { DelayCommand(11.8,PlaySound("as_cv_claybreak1")); } else { DelayCommand(11.8,PlaySound("as_cv_glasbreak1")); } AssignCommand(oPC,DelayCommand(12.0,FloatingTextStringOnCreature(sFail,oPC,FALSE))); } //Ensure no more than 1 skill gain every 10 seconds to avoid token droppage. if (iSkillGain ==1) { if (GetLocalInt(oPC,"iSkillGain")!= 0) { iSkillGain = 0; } else { SetLocalInt(oPC,"iSkillGain",99); DelayCommand(10.0,SetLocalInt(oPC,"iSkillGain",0)); } } // Do skill gains if (iSkillGain ==1) { string sOldSkill = ""; string sOldSkill2 = ""; iJewelSkill++; sOldSkill2 = IntToString(iJewelSkill); sOldSkill = "."+GetStringRight(sOldSkill2,1); if (iJewelSkill > 9) { sOldSkill = GetStringLeft(sOldSkill2,GetStringLength(sOldSkill2)-1)+sOldSkill; } else { sOldSkill = "0"+sOldSkill; } if (iJewelSkill <= 1000) { //DelayCommand(13.0,SetTokenPair(oPC,12,4,iJewelSkill)); DelayCommand(13.0,SetPersistentInt(oPC,"iJewelSkill",iJewelSkill,0,"UOACraft")); DelayCommand(13.0,SendMessageToPC(oPC,"====================================")); DelayCommand(13.0,SendMessageToPC(oPC,"Your skill in jewelcraft has gone up!")); DelayCommand(13.0,SendMessageToPC(oPC,"Current jewelcraft skill : "+ sOldSkill+"%")); DelayCommand(13.0,SendMessageToPC(oPC,"====================================")); if (GetLocalInt(GetModule(),"_UOACraft_XP")!=0) DelayCommand(12.9,GiveXPToCreature(oPC,GetLocalInt(GetModule(),"_UOACraft_XP"))); } } } void CreateAnObject(string sResource, object oPC, int iStackSize) { CreateItemOnObject(sResource,oPC,iStackSize); return; } void CreateCraftedObject(string sResRef, object oPC, int iIngotType, int iJewelType, int iQuality) { object oCrafted; string sQuality = ""; string sJewelryName; if (iJewelType == 0) { if (iQuality == 2) sQuality = ""; if (iQuality == 1) sQuality = "Poorly Crafted"; if (iQuality == 3) sQuality = "Exceptionally Crafted"; } if (GetStringLeft(sResRef,4)=="ring") { sJewelryName = "Ring"; oCrafted = CreateItemOnObject("craft_ring", OBJECT_SELF, 1, sResRef); } if (GetStringLeft(sResRef,4)=="ammy") { sJewelryName = "Amulet"; oCrafted = CreateItemOnObject("craft_amulet", OBJECT_SELF, 1, sResRef); } if (GetStringLeft(sResRef,4)=="neck") { sJewelryName = "Necklace"; oCrafted = CreateItemOnObject("craft_necklace", OBJECT_SELF, 1, sResRef); } string sItem = GetName(oCrafted); string sPlayer = GetName(oPC); string sName = GetObjectName(oPC, iIngotType, iJewelType); SetName(oCrafted, sQuality + " " + sName + " " + sJewelryName); SetDescription(oCrafted, "This is a crafted " + sJewelryName + " from the forges of " + sPlayer); itemproperty ipAdd1 = GetProperty(1, iIngotType, iJewelType, sJewelryName, sQuality); IPSafeAddItemProperty(oCrafted, ipAdd1); itemproperty ipAdd2 = GetProperty(2, iIngotType, iJewelType, sJewelryName, sQuality); IPSafeAddItemProperty(oCrafted, ipAdd2); if (iJewelType > 0) { itemproperty ipAdd3 = GetProperty(3, iIngotType, iJewelType, sJewelryName, sQuality); IPSafeAddItemProperty(oCrafted, ipAdd3); } if (iJewelType > 0) { itemproperty ipAdd4 = GetProperty(4, iIngotType, iJewelType, sJewelryName, sQuality); IPSafeAddItemProperty(oCrafted, ipAdd4); } ActionGiveItem(oCrafted, oPC); } itemproperty GetProperty(int iProp, int iIngotType, int iJewelType, string sType, string sQuality) { int n = 0; if (sType == "Ring") { switch (iProp) { case 1: if (sQuality == "") n = 1; if (sQuality == "Exceptionally Crafted") n = 1; switch (iIngotType) { case 0: case 1: case 2: return ItemPropertyACBonus(0 + n); case 3: case 4: case 5: case 9: return ItemPropertyACBonus(1 + n); case 6: case 10: case 12: return ItemPropertyACBonus(2 + n); case 8: case 7: case 11: return ItemPropertyACBonus(3 + n); } case 2: if (sQuality == "") n = 1; if (sQuality == "Exceptionally Crafted") n = 1; switch (iIngotType) { case 0: return ItemPropertyACBonus(0 + n); case 1: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_PIERCING, IP_CONST_DAMAGERESIST_5); case 2: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SLASHING, IP_CONST_DAMAGERESIST_5); case 3: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ELECTRICAL, IP_CONST_DAMAGERESIST_5); case 4: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGERESIST_5); case 5: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGERESIST_5); case 6: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_PHYSICAL, IP_CONST_DAMAGERESIST_5); case 7: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_MAGICAL, IP_CONST_DAMAGERESIST_5); case 8: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_NEGATIVE, IP_CONST_DAMAGERESIST_5); case 9: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGERESIST_5); case 10: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_DIVINE, IP_CONST_DAMAGERESIST_5); case 11: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_POSITIVE, IP_CONST_DAMAGERESIST_5); case 12: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SONIC, IP_CONST_DAMAGERESIST_5); } case 3: switch (iJewelType) { case 1: return ItemPropertySkillBonus(SKILL_HEAL, 2); case 2: return ItemPropertySkillBonus(SKILL_LORE, 2); case 3: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 2); case 4: return ItemPropertySkillBonus(SKILL_HIDE, 2); case 5: return ItemPropertySkillBonus(SKILL_SPOT, 2); case 6: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 2); case 7: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 2); case 8: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 2); case 9: return ItemPropertySkillBonus(SKILL_TUMBLE, 2); case 10: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 2); case 11: return ItemPropertySkillBonus(SKILL_LISTEN, 2);; case 12: return ItemPropertySkillBonus(SKILL_TAUNT, 2); case 13: return ItemPropertySkillBonus(SKILL_HEAL, 4); case 14: return ItemPropertySkillBonus(SKILL_LORE, 4); case 15: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 4); case 16: return ItemPropertySkillBonus(SKILL_HIDE, 4); case 17: return ItemPropertySkillBonus(SKILL_SPOT, 4); case 18: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 4); case 20: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 4); case 19: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 4); case 21: return ItemPropertySkillBonus(SKILL_TUMBLE, 4); case 22: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 4); case 23: return ItemPropertySkillBonus(SKILL_LISTEN, 4); case 24: return ItemPropertySkillBonus(SKILL_TAUNT, 4); case 25: return ItemPropertySkillBonus(SKILL_HEAL, 6); case 26: return ItemPropertySkillBonus(SKILL_LORE, 6); case 27: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 6); case 28: return ItemPropertySkillBonus(SKILL_HIDE, 6); case 29: return ItemPropertySkillBonus(SKILL_SPOT, 6); case 30: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 6); case 31: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 6); case 32: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 6); case 33: return ItemPropertySkillBonus(SKILL_TUMBLE, 6); case 34: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 6); case 35: return ItemPropertySkillBonus(SKILL_LISTEN, 6); case 36: return ItemPropertySkillBonus(SKILL_TAUNT, 6); case 37: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_FORTITUDE, 3); case 38: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_FEAR, 3); case 39: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DISEASE, 3); case 40: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_POISON, 3); case 41: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DEATH, 3); case 42: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_REFLEX, 3); case 43: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_WILL, 3); case 44: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_FORTITUDE, 6); case 45: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_FEAR, 6); case 46: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DISEASE, 6); case 47: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_POISON, 6); case 48: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DEATH, 6); case 49: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_REFLEX, 6); case 50: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_WILL, 6); case 51: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_CHA, 3); case 52: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_WIS, 3); case 53: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_CON, 3); case 54: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_INT, 3); case 55: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_STR, 3); case 56: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_DEX, 3); } case 4: switch (iJewelType) { case 1: return ItemPropertySkillBonus(SKILL_HEAL, 2); case 2: return ItemPropertySkillBonus(SKILL_LORE, 2); case 3: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 2); case 4: return ItemPropertySkillBonus(SKILL_HIDE, 2); case 5: return ItemPropertySkillBonus(SKILL_SPOT, 2); case 6: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 2); case 7: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 2); case 8: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 2); case 9: return ItemPropertySkillBonus(SKILL_TUMBLE, 2); case 10: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 2); case 11: return ItemPropertySkillBonus(SKILL_LISTEN, 2);; case 12: return ItemPropertySkillBonus(SKILL_TAUNT, 2); case 13: return ItemPropertySkillBonus(SKILL_HEAL, 4); case 14: return ItemPropertySkillBonus(SKILL_APPRAISE, 4); case 15: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 4); case 16: return ItemPropertySkillBonus(SKILL_MOVE_SILENTLY, 4); case 17: return ItemPropertySkillBonus(SKILL_SPOT, 4); case 18: return ItemPropertySkillBonus(SKILL_SET_TRAP, 4); case 20: return ItemPropertySkillBonus(SKILL_PICK_POCKET, 4); case 19: return ItemPropertySkillBonus(SKILL_RIDE, 4); case 21: return ItemPropertySkillBonus(SKILL_PARRY, 4); case 22: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 4); case 23: return ItemPropertySkillBonus(SKILL_SPOT, 4); case 24: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 4); case 25: return ItemPropertySkillBonus(SKILL_HEAL, 6); case 26: return ItemPropertySkillBonus(SKILL_APPRAISE, 6); case 27: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 6); case 28: return ItemPropertySkillBonus(SKILL_MOVE_SILENTLY, 6); case 29: return ItemPropertySkillBonus(SKILL_SEARCH, 6); case 30: return ItemPropertySkillBonus(SKILL_SET_TRAP, 6); case 31: return ItemPropertySkillBonus(SKILL_PICK_POCKET, 6); case 32: return ItemPropertySkillBonus(SKILL_RIDE, 6); case 33: return ItemPropertySkillBonus(SKILL_PARRY, 6); case 34: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 6); case 35: return ItemPropertySkillBonus(SKILL_SPOT, 6); case 36: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 6); case 37: return ItemPropertyRegeneration(1); case 38: return ItemPropertyRegeneration(1); case 39: return ItemPropertyRegeneration(1); case 40: return ItemPropertyRegeneration(1); case 41: return ItemPropertyRegeneration(1); case 42: return ItemPropertyRegeneration(1); case 43: return ItemPropertyRegeneration(2); case 44: return ItemPropertyRegeneration(2); case 45: return ItemPropertyRegeneration(2); case 46: return ItemPropertyRegeneration(2); case 47: return ItemPropertyRegeneration(2); case 48: return ItemPropertyRegeneration(2); case 49: return ItemPropertyRegeneration(2); case 50: return ItemPropertyRegeneration(2); case 51: return ItemPropertyRegeneration(3); case 52: return ItemPropertyRegeneration(3); case 53: return ItemPropertyRegeneration(3); case 54: return ItemPropertyRegeneration(3); case 55: return ItemPropertyRegeneration(3); case 56: return ItemPropertyRegeneration(3); } } } if (sType == "Amulet") { switch (iProp) { case 1: if (sQuality == "") n = 1; if (sQuality == "Exceptionally Crafted") n = 1; switch (iIngotType) { case 0: case 1: case 2: return ItemPropertyACBonus(0 + n); case 3: case 4: case 5: case 9: return ItemPropertyACBonus(1 + n); case 6: case 10: case 12: return ItemPropertyACBonus(2 + n); case 8: case 7: case 11: return ItemPropertyACBonus(3 + n); } case 2: if (sQuality == "") n = 1; if (sQuality == "Exceptionally Crafted") n = 1; switch (iIngotType) { case 0: return ItemPropertyACBonus(0 + n); case 1: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_PIERCING, IP_CONST_DAMAGERESIST_5); case 2: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SLASHING, IP_CONST_DAMAGERESIST_5); case 3: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ELECTRICAL, IP_CONST_DAMAGERESIST_5); case 4: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGERESIST_5); case 5: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGERESIST_5); case 6: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_PHYSICAL, IP_CONST_DAMAGERESIST_5); case 7: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_MAGICAL, IP_CONST_DAMAGERESIST_5); case 8: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_NEGATIVE, IP_CONST_DAMAGERESIST_5); case 9: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGERESIST_5); case 10: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_DIVINE, IP_CONST_DAMAGERESIST_5); case 11: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_POSITIVE, IP_CONST_DAMAGERESIST_5); case 12: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SONIC, IP_CONST_DAMAGERESIST_5); } case 3: switch (iJewelType) { case 1: return ItemPropertySkillBonus(SKILL_HEAL, 2); case 2: return ItemPropertySkillBonus(SKILL_LORE, 2); case 3: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 2); case 4: return ItemPropertySkillBonus(SKILL_HIDE, 2); case 5: return ItemPropertySkillBonus(SKILL_SPOT, 2); case 6: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 2); case 7: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 2); case 8: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 2); case 9: return ItemPropertySkillBonus(SKILL_TUMBLE, 2); case 10: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 2); case 11: return ItemPropertySkillBonus(SKILL_LISTEN, 2);; case 12: return ItemPropertySkillBonus(SKILL_TAUNT, 2); case 13: return ItemPropertySkillBonus(SKILL_HEAL, 4); case 14: return ItemPropertySkillBonus(SKILL_LORE, 4); case 15: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 4); case 16: return ItemPropertySkillBonus(SKILL_HIDE, 4); case 17: return ItemPropertySkillBonus(SKILL_SPOT, 4); case 18: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 4); case 20: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 4); case 19: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 4); case 21: return ItemPropertySkillBonus(SKILL_TUMBLE, 4); case 22: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 4); case 23: return ItemPropertySkillBonus(SKILL_LISTEN, 4); case 24: return ItemPropertySkillBonus(SKILL_TAUNT, 4); case 25: return ItemPropertySkillBonus(SKILL_HEAL, 6); case 26: return ItemPropertySkillBonus(SKILL_LORE, 6); case 27: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 6); case 28: return ItemPropertySkillBonus(SKILL_HIDE, 6); case 29: return ItemPropertySkillBonus(SKILL_SPOT, 6); case 30: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 6); case 31: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 6); case 32: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 6); case 33: return ItemPropertySkillBonus(SKILL_TUMBLE, 6); case 34: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 6); case 35: return ItemPropertySkillBonus(SKILL_LISTEN, 6); case 36: return ItemPropertySkillBonus(SKILL_TAUNT, 6); case 37: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_FORTITUDE, 3); case 38: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_FEAR, 3); case 39: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DISEASE, 3); case 40: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_POISON, 3); case 41: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DEATH, 3); case 42: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_REFLEX, 3); case 43: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_WILL, 3); case 44: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_FORTITUDE, 6); case 45: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_FEAR, 6); case 46: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DISEASE, 6); case 47: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_POISON, 6); case 48: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DEATH, 6); case 49: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_REFLEX, 6); case 50: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_WILL, 6); case 51: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_CHA, 3); case 52: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_WIS, 3); case 53: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_CON, 3); case 54: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_INT, 3); case 55: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_STR, 3); case 56: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_DEX, 3); } case 4: switch (iJewelType) { case 1: return ItemPropertySkillBonus(SKILL_HEAL, 2); case 2: return ItemPropertySkillBonus(SKILL_LORE, 2); case 3: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 2); case 4: return ItemPropertySkillBonus(SKILL_HIDE, 2); case 5: return ItemPropertySkillBonus(SKILL_SPOT, 2); case 6: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 2); case 7: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 2); case 8: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 2); case 9: return ItemPropertySkillBonus(SKILL_TUMBLE, 2); case 10: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 2); case 11: return ItemPropertySkillBonus(SKILL_LISTEN, 2);; case 12: return ItemPropertySkillBonus(SKILL_TAUNT, 2); case 13: return ItemPropertySkillBonus(SKILL_HEAL, 4); case 14: return ItemPropertySkillBonus(SKILL_APPRAISE, 4); case 15: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 4); case 16: return ItemPropertySkillBonus(SKILL_MOVE_SILENTLY, 4); case 17: return ItemPropertySkillBonus(SKILL_SPOT, 4); case 18: return ItemPropertySkillBonus(SKILL_SET_TRAP, 4); case 20: return ItemPropertySkillBonus(SKILL_PICK_POCKET, 4); case 19: return ItemPropertySkillBonus(SKILL_RIDE, 4); case 21: return ItemPropertySkillBonus(SKILL_PARRY, 4); case 22: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 4); case 23: return ItemPropertySkillBonus(SKILL_SPOT, 4); case 24: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 4); case 25: return ItemPropertySkillBonus(SKILL_HEAL, 6); case 26: return ItemPropertySkillBonus(SKILL_APPRAISE, 6); case 27: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 6); case 28: return ItemPropertySkillBonus(SKILL_MOVE_SILENTLY, 6); case 29: return ItemPropertySkillBonus(SKILL_SEARCH, 6); case 30: return ItemPropertySkillBonus(SKILL_SET_TRAP, 6); case 31: return ItemPropertySkillBonus(SKILL_PICK_POCKET, 6); case 32: return ItemPropertySkillBonus(SKILL_RIDE, 6); case 33: return ItemPropertySkillBonus(SKILL_PARRY, 6); case 34: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 6); case 35: return ItemPropertySkillBonus(SKILL_SPOT, 6); case 36: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 6); case 37: return ItemPropertyRegeneration(1); case 38: return ItemPropertyRegeneration(1); case 39: return ItemPropertyRegeneration(1); case 40: return ItemPropertyRegeneration(1); case 41: return ItemPropertyRegeneration(1); case 42: return ItemPropertyRegeneration(1); case 43: return ItemPropertyRegeneration(2); case 44: return ItemPropertyRegeneration(2); case 45: return ItemPropertyRegeneration(2); case 46: return ItemPropertyRegeneration(2); case 47: return ItemPropertyRegeneration(2); case 48: return ItemPropertyRegeneration(2); case 49: return ItemPropertyRegeneration(2); case 50: return ItemPropertyRegeneration(2); case 51: return ItemPropertyRegeneration(3); case 52: return ItemPropertyRegeneration(3); case 53: return ItemPropertyRegeneration(3); case 54: return ItemPropertyRegeneration(3); case 55: return ItemPropertyRegeneration(3); case 56: return ItemPropertyRegeneration(3); } } } if (sType == "Necklace") { switch (iProp) { case 1: if (sQuality == "") n = 1; if (sQuality == "Exceptionally Crafted") n = 1; switch (iIngotType) { case 0: case 1: case 2: return ItemPropertyACBonus(0 + n); case 3: case 4: case 5: case 9: return ItemPropertyACBonus(1 + n); case 6: case 10: case 12: return ItemPropertyACBonus(2 + n); case 8: case 7: case 11: return ItemPropertyACBonus(3 + n); } case 2: if (sQuality == "") n = 1; if (sQuality == "Exceptionally Crafted") n = 1; switch (iIngotType) { case 0: return ItemPropertyACBonus(0 + n); case 1: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_PIERCING, IP_CONST_DAMAGERESIST_5); case 2: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SLASHING, IP_CONST_DAMAGERESIST_5); case 3: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ELECTRICAL, IP_CONST_DAMAGERESIST_5); case 4: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGERESIST_5); case 5: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGERESIST_5); case 6: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_PHYSICAL, IP_CONST_DAMAGERESIST_5); case 7: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_MAGICAL, IP_CONST_DAMAGERESIST_5); case 8: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_NEGATIVE, IP_CONST_DAMAGERESIST_5); case 9: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGERESIST_5); case 10: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_DIVINE, IP_CONST_DAMAGERESIST_5); case 11: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_POSITIVE, IP_CONST_DAMAGERESIST_5); case 12: return ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SONIC, IP_CONST_DAMAGERESIST_5); } case 3: switch (iJewelType) { case 1: return ItemPropertySkillBonus(SKILL_HEAL, 2); case 2: return ItemPropertySkillBonus(SKILL_LORE, 2); case 3: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 2); case 4: return ItemPropertySkillBonus(SKILL_HIDE, 2); case 5: return ItemPropertySkillBonus(SKILL_SPOT, 2); case 6: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 2); case 7: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 2); case 8: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 2); case 9: return ItemPropertySkillBonus(SKILL_TUMBLE, 2); case 10: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 2); case 11: return ItemPropertySkillBonus(SKILL_LISTEN, 2);; case 12: return ItemPropertySkillBonus(SKILL_TAUNT, 2); case 13: return ItemPropertySkillBonus(SKILL_HEAL, 4); case 14: return ItemPropertySkillBonus(SKILL_LORE, 4); case 15: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 4); case 16: return ItemPropertySkillBonus(SKILL_HIDE, 4); case 17: return ItemPropertySkillBonus(SKILL_SPOT, 4); case 18: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 4); case 20: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 4); case 19: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 4); case 21: return ItemPropertySkillBonus(SKILL_TUMBLE, 4); case 22: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 4); case 23: return ItemPropertySkillBonus(SKILL_LISTEN, 4); case 24: return ItemPropertySkillBonus(SKILL_TAUNT, 4); case 25: return ItemPropertySkillBonus(SKILL_HEAL, 6); case 26: return ItemPropertySkillBonus(SKILL_LORE, 6); case 27: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 6); case 28: return ItemPropertySkillBonus(SKILL_HIDE, 6); case 29: return ItemPropertySkillBonus(SKILL_SPOT, 6); case 30: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 6); case 31: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 6); case 32: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 6); case 33: return ItemPropertySkillBonus(SKILL_TUMBLE, 6); case 34: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 6); case 35: return ItemPropertySkillBonus(SKILL_LISTEN, 6); case 36: return ItemPropertySkillBonus(SKILL_TAUNT, 6); case 37: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_FORTITUDE, 3); case 38: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_FEAR, 3); case 39: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DISEASE, 3); case 40: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_POISON, 3); case 41: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DEATH, 3); case 42: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_REFLEX, 3); case 43: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_WILL, 3); case 44: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_FORTITUDE, 6); case 45: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_FEAR, 6); case 46: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DISEASE, 6); case 47: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_POISON, 6); case 48: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEVS_DEATH, 6); case 49: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_REFLEX, 6); case 50: return ItemPropertyBonusSavingThrow(IP_CONST_SAVEBASETYPE_WILL, 6); case 51: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_CHA, 3); case 52: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_WIS, 3); case 53: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_CON, 3); case 54: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_INT, 3); case 55: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_STR, 3); case 56: return ItemPropertyAbilityBonus(IP_CONST_ABILITY_DEX, 3); } case 4: switch (iJewelType) { case 1: return ItemPropertySkillBonus(SKILL_HEAL, 2); case 2: return ItemPropertySkillBonus(SKILL_LORE, 2); case 3: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 2); case 4: return ItemPropertySkillBonus(SKILL_HIDE, 2); case 5: return ItemPropertySkillBonus(SKILL_SPOT, 2); case 6: return ItemPropertySkillBonus(SKILL_DISABLE_TRAP, 2); case 7: return ItemPropertySkillBonus(SKILL_OPEN_LOCK, 2); case 8: return ItemPropertySkillBonus(SKILL_ANIMAL_EMPATHY, 2); case 9: return ItemPropertySkillBonus(SKILL_TUMBLE, 2); case 10: return ItemPropertySkillBonus(SKILL_SPELLCRAFT, 2); case 11: return ItemPropertySkillBonus(SKILL_LISTEN, 2);; case 12: return ItemPropertySkillBonus(SKILL_TAUNT, 2); case 13: return ItemPropertySkillBonus(SKILL_HEAL, 4); case 14: return ItemPropertySkillBonus(SKILL_APPRAISE, 4); case 15: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 4); case 16: return ItemPropertySkillBonus(SKILL_MOVE_SILENTLY, 4); case 17: return ItemPropertySkillBonus(SKILL_SPOT, 4); case 18: return ItemPropertySkillBonus(SKILL_SET_TRAP, 4); case 20: return ItemPropertySkillBonus(SKILL_PICK_POCKET, 4); case 19: return ItemPropertySkillBonus(SKILL_RIDE, 4); case 21: return ItemPropertySkillBonus(SKILL_PARRY, 4); case 22: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 4); case 23: return ItemPropertySkillBonus(SKILL_SPOT, 4); case 24: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 4); case 25: return ItemPropertySkillBonus(SKILL_HEAL, 6); case 26: return ItemPropertySkillBonus(SKILL_APPRAISE, 6); case 27: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 6); case 28: return ItemPropertySkillBonus(SKILL_MOVE_SILENTLY, 6); case 29: return ItemPropertySkillBonus(SKILL_SEARCH, 6); case 30: return ItemPropertySkillBonus(SKILL_SET_TRAP, 6); case 31: return ItemPropertySkillBonus(SKILL_PICK_POCKET, 6); case 32: return ItemPropertySkillBonus(SKILL_RIDE, 6); case 33: return ItemPropertySkillBonus(SKILL_PARRY, 6); case 34: return ItemPropertySkillBonus(SKILL_CONCENTRATION, 6); case 35: return ItemPropertySkillBonus(SKILL_SPOT, 6); case 36: return ItemPropertySkillBonus(SKILL_DISCIPLINE, 6); case 37: return ItemPropertyRegeneration(1); case 38: return ItemPropertyRegeneration(1); case 39: return ItemPropertyRegeneration(1); case 40: return ItemPropertyRegeneration(1); case 41: return ItemPropertyRegeneration(1); case 42: return ItemPropertyRegeneration(1); case 43: return ItemPropertyRegeneration(2); case 44: return ItemPropertyRegeneration(2); case 45: return ItemPropertyRegeneration(2); case 46: return ItemPropertyRegeneration(2); case 47: return ItemPropertyRegeneration(2); case 48: return ItemPropertyRegeneration(2); case 49: return ItemPropertyRegeneration(2); case 50: return ItemPropertyRegeneration(2); case 51: return ItemPropertyRegeneration(3); case 52: return ItemPropertyRegeneration(3); case 53: return ItemPropertyRegeneration(3); case 54: return ItemPropertyRegeneration(3); case 55: return ItemPropertyRegeneration(3); case 56: return ItemPropertyRegeneration(3); } } } return ItemPropertyACBonus(0); } string GetObjectName(object oPC, int iIngotType, int iJewelType) { string sName1; string sName2; string sName3; switch (iIngotType) { case 0: sName1 = "Iron"; break; case 1: sName1 = "Dull Copper"; break; case 2: sName1 = "Shadow Iron"; break; case 3: sName1 = "Copper"; break; case 4: sName1 = "Bronze"; break; case 5: sName1 = "Gold"; break; case 6: sName1 = "Agapite"; break; case 7: sName1 = "Verite"; break; case 8: sName1 = "Valorite"; break; case 9: sName1 = "Silver"; break; case 10: sName1 = "Mithril"; break; case 11: sName1 = "Adamantite"; break; case 12: sName1 = "Platinum"; break; } switch (iJewelType) { case 1: sName2 = "Eye Agate"; break; case 2: sName2 ="Hematite"; break; case 3: sName2 ="Azurite"; break; case 4: sName2 ="Banded Agate"; break; case 5: sName2 ="Blue Quartz"; break; case 6: sName2 ="Lapis Lazuli"; break; case 7: sName2 ="Malachite"; break; case 8: sName2 ="Moss Agate"; break; case 9: sName2 ="Obsidian"; break; case 10: sName2 ="Rhodochrosite"; break; case 11: sName2 ="Tiger Eye"; break; case 12: sName2 ="Turquoise"; break; case 13: sName2 ="Bloodtsone"; break; case 14: sName2 ="Onyx"; break; case 15: sName2 ="Zircon"; break; case 16: sName2 ="Rock Crystal"; break; case 17: sName2 ="Sardonyx"; break; case 18: sName2 ="Smoky Quartz"; break; case 20: sName2 ="Star Rose Quartz"; break; case 19: sName2 ="Carnelian"; break; case 21: sName2 ="Chalcendony"; break; case 22: sName2 ="Chrysoprase"; break; case 23: sName2 ="Citrine"; break; case 24: sName2 ="Jasper"; break; case 25: sName2 ="Moonstone"; break; case 26: sName2 ="Alexandrite"; break; case 27: sName2 ="Amber"; break; case 28: sName2 ="Amethyst"; break; case 29: sName2 ="Tourmaline"; break; case 30: sName2 ="White Pearl"; break; case 31: sName2 ="Red Spinel"; break; case 32: sName2 ="Coral"; break; case 33: sName2 ="Red Garnet"; break; case 34: sName2 ="Chrysoberyl"; break; case 35: sName2 ="Jade"; break; case 36: sName2 ="Jet"; break; case 37: sName2 ="Topaz"; break; case 38: sName2 ="Peridot"; break; case 39: sName2 ="Violet Garnet"; break; case 40: sName2 ="Blue Spinel"; break; case 41: sName2 ="Aquamarine"; break; case 42: sName2 ="Black Pearl"; break; case 43: sName2 ="Black Opal"; break; case 44: sName2 ="Emerald"; break; case 45: sName2 ="Fire Opal"; break; case 46: sName2 ="Opal"; break; case 47: sName2 ="Oriental Amethyst"; break; case 48: sName2 ="Oriental Topaz"; break; case 49: sName2 ="Star Ruby"; break; case 50: sName2 ="Star Sapphire"; break; case 51: sName2 ="Sapphire"; break; case 52: sName2 ="Black Sapphire"; break; case 53: sName2 ="Ruby"; break; case 54: sName2 ="Oriental Emerald"; break; case 55: sName2 ="Jacinth"; break; case 56: sName2 ="Diamond"; break; } sName3 = sName2 + " " + sName1; return sName3; } void GetNextStackedItem(object oPC, string sItemTag, int iCount, int iMode, string sStackResRef) { object oTemp = GetItemPossessedBy(oPC,sItemTag); int iStackCount = GetNumStackedItems(oTemp); int iTemp = iCount - iStackCount; iStackCount = iStackCount-iCount; DestroyObject(oTemp); if (iStackCount > 0) { SendMessageToPC(oPC,"You should get back "+IntToString(iStackCount)); DelayCommand(1.0,CreateAnObject(sStackResRef,oPC,iStackCount)); } // this next line *should* recursively call this function if the number of // stacked items does not meet the required number of items to be destroyed. if (iTemp > 0) DelayCommand(1.0,GetNextStackedItem(oPC,sItemTag,iTemp, iMode, sStackResRef)); return; } void GetNextItemPossessedBy(object oPC, string sItemTag) { object oTemp = GetItemPossessedBy(oPC,sItemTag); DestroyObject(oTemp); return; } string CraftLookup(string sResRef, int iIngotType, int iJewelType) { string sTempNum; string sTempRet; string sTempRet2; string sTempRet3; if (GetStringLeft(sResRef,4)=="Ring") sTempRet2="ring_"; if (GetStringLeft(sResRef,6)=="Amulet") sTempRet2="ammy_"; if (GetStringLeft(sResRef,8)=="Necklace") sTempRet2="neck_"; switch (iIngotType) { case 1:{sTempRet = "dull_";break;} case 2:{sTempRet = "shadow_";break;} case 3:{sTempRet = "copper_";break;} case 4:{sTempRet = "bronze_";break;} case 5:{sTempRet = "gold_";break;} case 6:{sTempRet = "agapite_";break;} case 7:{sTempRet = "verite_";break;} case 8:{sTempRet = "val_";break;} case 9:{sTempRet = "silver_";break;} case 10:{sTempRet = "mithril_";break;} case 11:{sTempRet = "admnt_";break;} case 12:{sTempRet = "platnum_";break;} default:{sTempRet = "iron_";break;} } if (iJewelType==0) //Blank Jewelry { if (GetStringRight(sResRef,6)=="Normal") sTempNum = "001"; if (GetStringRight(sResRef,4)=="Poor") sTempNum = "002"; if (GetStringRight(sResRef,11)=="Excpetional") sTempNum = "003"; } else if (iJewelType>0) //Gem-Added to Jewelry { string sTempNum = IntToString(100+iJewelType); } sTempRet3=sTempRet2+sTempRet+sTempNum; return sTempRet3; }