//#include "_persist_01a" #include "nw_i0_plot" #include "aps_include" void CreateAnObject(string sResource, object oPC, int iStackSize); void GetNextStackedItem(object oPC, string sItemTag, int iCount, int iMode, string sStackResRef); void GetNextItemPossessedBy(object oPC, string sItemTag); string GetComponent(int iWoodType); string GetComponentName(int iWoodType); string CraftLookup(string sResRef, int iWoodType); void main() { object oSelf = OBJECT_SELF; object oItem = GetInventoryDisturbItem(); object oPC = GetLastDisturbed(); string sTag = GetTag(oItem); string sSuccess = ""; string sFail = ""; string sItemResRef = ""; string sItemResRefPoor = ""; string sItemResRefExceptional = ""; int iRandom = 0; int iSuccess = 0; int iSkillGain = 0; int iComponent1 = 1; int iComponent2 = 0; int iComponent3 = 0; int iComponent1Stackable = 1; int iComponent2Stackable = 0; int iComponent3Stackable = 0; int iStackSize = 0; int iWoodType = GetLocalInt(oPC,"iUseThisWood"); // Credit to Lau3 for reporting this spacing error "iUseThis Wood". int iPenalty = iWoodType*5; int iDifficulty = 0; string sComponent1 = ""; string sComponent2 = ""; string sComponent3 = ""; string sComponent1Name = ""; string sComponent2Name = ""; string sComponent3Name = ""; string sComponentResRef = ""; object oTemp = OBJECT_INVALID; 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); } if (GetStringLeft(GetResRef(oItem),10)=="flagswitch") { if (sTag == "SWITCH_WOOD1") SetLocalInt(oPC,"iUseThisWood",0); if (sTag == "SWITCH_WOOD2") SetLocalInt(oPC,"iUseThisWood",1); if (sTag == "SWITCH_WOOD3") SetLocalInt(oPC,"iUseThisWood",2); if (sTag == "SWITCH_WOOD4") SetLocalInt(oPC,"iUseThisWood",3); if (sTag == "SWITCH_WOOD5") SetLocalInt(oPC,"iUseThisWood",4); if (sTag == "SWITCH_WOOD6") SetLocalInt(oPC,"iUseThisWood",5); if (sTag == "SWITCH_WOOD7") SetLocalInt(oPC,"iUseThisWood",6); if (sTag == "SWITCH_WOOD8") SetLocalInt(oPC,"iUseThisWood",7); if (sTag == "SWITCH_WOOD9") SetLocalInt(oPC,"iUseThisWood",8); if (sTag == "SWITCH_WOOD10") SetLocalInt(oPC,"iUseThisWood",9); if (sTag == "SWITCH_WOOD11") SetLocalInt(oPC,"iUseThisWood",10); if (sTag == "SWITCH_WOOD12") SetLocalInt(oPC,"iUseThisWood",11); if (sTag == "SWITCH_WOOD13") SetLocalInt(oPC,"iUseThisWood",12); if (sTag == "SWITCH_WOOD14") SetLocalInt(oPC,"iUseThisWood",13); if (sTag == "SWITCH_WOOD15") SetLocalInt(oPC,"iUseThisWood",14); if (sTag == "SWITCH_WOOD16") SetLocalInt(oPC,"iUseThisWood",15); if (sTag == "SWITCH_WOOD17") SetLocalInt(oPC,"iUseThisWood",16); if (sTag == "SWITCH_WOOD18") SetLocalInt(oPC,"iUseThisWood",17); if (sTag == "SWITCH_WOOD19") SetLocalInt(oPC,"iUseThisWood",18); string sWoodMessage = "Switching wood types. now set to "+GetStringLowerCase(GetName(oItem))+"."; FloatingTextStringOnCreature(sWoodMessage,oPC,FALSE); DestroyObject(oItem); 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; } if (GetStringLeft(GetResRef(oItem),7)!="pattern") return; CopyObject(oItem,GetLocation(oPC),OBJECT_SELF,GetTag(oItem)); DestroyObject(oItem); if (GetLocalInt(OBJECT_SELF,"iAmInUse") != 0) { SendMessageToPC(oPC,"You must wait till the current bow or crossbow is completed before starting another."); return; } //int iBowSkill = GetTokenPair(oPC,13,3); // uses NWN database //int iBowSkill = GetCampaignInt("UOACraft","iBowSkill",oPC); //external database int iBowSkill = GetPersistentInt(oPC,"iBowSkill","UOACraft"); int iBowChance = iBowSkill; 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; } // Adjust skill for the penalty for the wood type being used. iBowChance = iBowChance - iPenalty; // begin crafting test if (sTag == "P_SHORTBOW") { sSuccess = "You successfully form and shape the wood into a shortbow."; sFail = "You are unable to shape and form the wood properly, and the shortbow is ruined."; sItemResRefPoor = CraftLookup("wbwsh002",iWoodType); sItemResRef = CraftLookup("nw_wbwsh001",iWoodType); sItemResRefExceptional = CraftLookup("wbwsh003",iWoodType); sComponent1 = GetComponent(iWoodType); iComponent1 = 3; } if (sTag == "P_LONGBOW") { iDifficulty = 400; sSuccess = "You successfully form and shape the wood into a longbow."; sFail = "You are unable to shape and form the wood properly, and the longbow is ruined."; sItemResRefPoor = CraftLookup("wbwln002",iWoodType); sItemResRef = CraftLookup("nw_wbwln001",iWoodType); sItemResRefExceptional = CraftLookup("wbwln003",iWoodType); sComponent1 = GetComponent(iWoodType); iComponent1 = 6; } if (sTag == "P_LIGHTCROSSBOW") { iDifficulty = 250; sSuccess = "You successfully form and shape the wood into a light crossbow."; sFail = "You are unable to shape and form the wood properly, and the light crossbow is ruined."; sItemResRefPoor = CraftLookup("wbwxl002",iWoodType); sItemResRef = CraftLookup("nw_wbwxl001",iWoodType); sItemResRefExceptional = CraftLookup("wbwxl003",iWoodType); sComponent1 = GetComponent(iWoodType); iComponent1 = 4; } if (sTag == "P_HEAVYCROSSBOW") { iDifficulty = 450; sSuccess = "You successfully form and shape the wood into a heavy crossbow."; sFail = "You are unable to shape and form the wood properly, and the heavy crossbow is ruined."; sItemResRefPoor = CraftLookup("wbwxh002",iWoodType); sItemResRef = CraftLookup("nw_wbwxh001",iWoodType); sItemResRefExceptional = CraftLookup("wbwxh003",iWoodType); sComponent1 = GetComponent(iWoodType); iComponent1 = 6; } sComponent1Name = GetComponentName(iWoodType); // 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; } } // visual and audio crafting effects AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,12.0)); PlaySound("al_cv_fanlg1"); PlaySound("al_cv_millwheel1"); PlaySound("al_mg_pillrlght1"); DelayCommand(6.0,PlaySound("al_cv_fanlg1")); DelayCommand(6.0,PlaySound("al_cv_millwheel1")); DelayCommand(6.0,PlaySound("al_mg_pillrlght1")); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SMOKE_PUFF,FALSE),OBJECT_SELF,1.0); DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPECIAL_WHITE_ORANGE,FALSE),OBJECT_SELF,1.0)); DelayCommand(3.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPARKS_PARRY,FALSE),OBJECT_SELF,1.0)); DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPECIAL_RED_ORANGE,FALSE),OBJECT_SELF,1.0)); DelayCommand(7.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPARKS_PARRY,FALSE),OBJECT_SELF,1.0)); DelayCommand(9.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPECIAL_WHITE_BLUE,FALSE),OBJECT_SELF,1.0)); DelayCommand(11.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPARKS_PARRY,FALSE),OBJECT_SELF,1.0)); DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SMOKE_PUFF,FALSE),OBJECT_SELF,1.0)); // Remove all components 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--) { 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--) { 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--) { GetNextItemPossessedBy(oPC,sComponent3); } } } iBowChance = iBowChance - iDifficulty; if (iBowChance <1) iBowChance = 1; iRandom = Random(1000); if (iRandom <= iBowChance) { iSuccess = 1; int iSuccess2 = 1; iBowChance = iBowChance - 50; if (Random(1000) <= iBowChance) iSuccess2 = iSuccess2+1; iBowChance = iBowChance-100; if (Random(1000) <= iBowChance) iSuccess2 = iSuccess2+1; iBowChance = iBowChance + 150; if (iSuccess2 == 1)AssignCommand(oPC,DelayCommand(12.0,CreateAnObject(sItemResRefPoor,oPC,1))); if (iSuccess2 == 2)AssignCommand(oPC,DelayCommand(12.0,CreateAnObject(sItemResRef,oPC,1))); if (iSuccess2 == 3)AssignCommand(oPC,DelayCommand(12.0,CreateAnObject(sItemResRefExceptional,oPC,1))); AssignCommand(oPC,DelayCommand(12.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE))); if (Random(1000) >= iBowSkill) { if (d10(1)+1 >= iBowChance/100) iSkillGain = 1; } } else { AssignCommand(oPC,DelayCommand(12.0,FloatingTextStringOnCreature(sFail,oPC,FALSE))); return; } //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)); } } if (iSkillGain ==1) { string sOldSkill = ""; string sOldSkill2 = ""; iBowSkill++; sOldSkill2 = IntToString(iBowSkill); sOldSkill = "."+GetStringRight(sOldSkill2,1); if (iBowSkill > 9) { sOldSkill = GetStringLeft(sOldSkill2,GetStringLength(sOldSkill2)-1)+sOldSkill; } else { sOldSkill = "0"+sOldSkill; } if (iBowSkill <= 1000) { //DelayCommand(13.0,SetTokenPair(oPC,13,3,iBowSkill)); //NWN database //DelayCommand(13.0,SetCampaignInt("UOACraft","iBowSkill",iBowSkill,oPC)); //external database DelayCommand(13.0,SetPersistentInt(oPC,"iBowSkill",iBowSkill,0,"UOACraft")); DelayCommand(13.0,SendMessageToPC(oPC,"===================================")); DelayCommand(13.0,SendMessageToPC(oPC,"Your skill in bowcraft has gone up!")); DelayCommand(13.0,SendMessageToPC(oPC,"Current bowcraft skill : "+ sOldSkill+"%")); DelayCommand(13.0,SendMessageToPC(oPC,"===================================")); if (GetLocalInt(GetModule(),"_UOACraft_XP")!=0) DelayCommand(12.9,GiveXPToCreature(oPC,GetLocalInt(GetModule(),"_UOACraft_XP"))); } } SetLocalInt(OBJECT_SELF,"iAmInUse",99); DelayCommand(14.0,SetLocalInt(OBJECT_SELF,"iAmInUse",0)); //ensure at least 1 respawn 10 minutes after used... //this is to prevent a broken placeable that is used, with a 'in use' delay //which would cancel the respawn if (GetLocalInt(OBJECT_SELF,"iAmSetToRespawn")!=99) { SetLocalInt(OBJECT_SELF,"iAmSetToRespawn",99); DelayCommand(600.0,ExecuteScript("_onclose_clear",OBJECT_SELF)); } } void CreateAnObject(string sResource, object oPC, int iStackSize) { CreateItemOnObject(sResource,oPC,iStackSize); return; } 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 GetComponent(int iWoodType) { switch (iWoodType) { case 1:{return "WOOD_OLIVE"; break;} case 2:{return "WOOD_WILLOW"; break;} case 3:{return "WOOD_PINE"; break;} case 4:{return "WOOD_FIR"; break;} case 5:{return "WOOD_MANGROVE"; break;} case 6:{return "WOOD_CHERRY"; break;} case 7:{return "WOOD_MAPLE"; break;} case 8:{return "WOOD_ALMOND"; break;} case 9:{return "WOOD_HICKORY"; break;} case 10:{return "WOOD_BIRCH"; break;} case 11:{return "WOOD_ELDER"; break;} case 12:{return "WOOD_WALNUT"; break;} case 13:{return "WOOD_ELM"; break;} case 14:{return "WOOD_MAHOGANY"; break;} case 15:{return "WOOD_OAK"; break;} case 16:{return "WOOD_YEW"; break;} case 17:{return "WOOD_REDWOOD"; break;} case 18:{return "WOOD_IRONWOOD"; break;} default:{return "WOOD_NORMAL"; break;} } return "WOOD_NORMAL"; } string GetComponentName(int iWoodType) { switch (iWoodType) { case 1:{return "olive branches"; break;} case 2:{return "willow branches"; break;} case 3:{return "pine logs"; break;} case 4:{return "fir logs"; break;} case 5:{return "mangrove logs"; break;} case 6:{return "cherry logs"; break;} case 7:{return "maple logs"; break;} case 8:{return "almond logs"; break;} case 9:{return "hickory logs"; break;} case 10:{return "birch logs"; break;} case 11:{return "elder logs"; break;} case 12:{return "walnut logs"; break;} case 13:{return "elm logs"; break;} case 14:{return "mahogany logs"; break;} case 15:{return "oak logs"; break;} case 16:{return "yew branches"; break;} case 17:{return "redwood"; break;} case 18:{return "ironwood"; break;} default:{return "normal logs"; break;} } return "normal logs"; } string CraftLookup(string sResRef, int iWoodType) { switch (iWoodType) { case 0: { return sResRef; break; } case 1: { // Olive Shortbow if (sResRef=="wbwsh002") return "wbwsh005"; if (sResRef=="nw_wbwsh001") return "wbwsh004"; if (sResRef=="wbwsh003") return "wbwsh006"; // Olive Longbow if (sResRef=="wbwln002") return "wbwln005"; if (sResRef=="nw_wbwln001") return "wbwln004"; if (sResRef=="wbwln003") return "wbwln006"; // Olive Light Crossbow if (sResRef=="wbwxl002") return "wbwxl005"; if (sResRef=="nw_wbwxl001") return "wbwxl006"; if (sResRef=="wbwxl003") return "wbwxl033"; // Olive Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh005"; if (sResRef=="nw_wbwxh001") return "wbwxh004"; if (sResRef=="wbwxh003") return "wbwxh006"; break; } case 2: { // Willow Shortbow if (sResRef=="wbwsh002") return "wbwsh008"; if (sResRef=="nw_wbwsh001") return "wbwsh007"; if (sResRef=="wbwsh003") return "wbwsh009"; // Willow Longbow if (sResRef=="wbwln002") return "wbwln008"; if (sResRef=="nw_wbwln001") return "wbwln007"; if (sResRef=="wbwln003") return "wbwln009"; // Willow Light Crossbow if (sResRef=="wbwxl002") return "wbwxl007"; if (sResRef=="nw_wbwxl001") return "wbwxl004"; if (sResRef=="wbwxl003") return "wbwxl038"; // willow Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh008"; if (sResRef=="nw_wbwxh001") return "wbwxh007"; if (sResRef=="wbwxh003") return "wbwxh009"; break; } case 3: { // Pine Shortbow if (sResRef=="wbwsh002") return "wbwsh011"; if (sResRef=="nw_wbwsh001") return "wbwsh010"; if (sResRef=="wbwsh003") return "wbwsh012"; // Pine Longbow if (sResRef=="wbwln002") return "wbwln011"; if (sResRef=="nw_wbwln001") return "wbwln010"; if (sResRef=="wbwln003") return "wbwln012"; // Pine Light Crossbow if (sResRef=="wbwxl002") return "wbwxl010"; if (sResRef=="nw_wbwxl001") return "wbwxl009"; if (sResRef=="wbwxl003") return "wbwxl011"; // pine Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh011"; if (sResRef=="nw_wbwxh001") return "wbwxh010"; if (sResRef=="wbwxh003") return "wbwxh012"; break; } case 4: { // Fir Shortbow if (sResRef=="wbwsh002") return "wbwsh014"; if (sResRef=="nw_wbwsh001") return "wbwsh013"; if (sResRef=="wbwsh003") return "wbwsh015"; // Fir Longbow if (sResRef=="wbwln002") return "wbwln014"; if (sResRef=="nw_wbwln001") return "wbwln013"; if (sResRef=="wbwln003") return "wbwln015"; // Fir Light Crossbow if (sResRef=="wbwxl002") return "wbwxl013"; if (sResRef=="nw_wbwxl001") return "wbwxl012"; if (sResRef=="wbwxl003") return "wbwxl014"; // Fir Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh014"; if (sResRef=="nw_wbwxh001") return "wbwxh013"; if (sResRef=="wbwxh003") return "wbwxh015"; break; } case 5: { // Mangrove Shortbow if (sResRef=="wbwsh002") return "wbwsh017"; if (sResRef=="nw_wbwsh001") return "wbwsh016"; if (sResRef=="wbwsh003") return "wbwsh018"; // Mangrove Longbow if (sResRef=="wbwln002") return "wbwln017"; if (sResRef=="nw_wbwln001") return "wbwln016"; if (sResRef=="wbwln003") return "wbwln018"; // Mangrove Light Crossbow if (sResRef=="wbwxl002") return "wbwxl016"; if (sResRef=="nw_wbwxl001") return "wbwxl015"; if (sResRef=="wbwxl003") return "wbwxl017"; // Mangrove Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh017"; if (sResRef=="nw_wbwxh001") return "wbwxh016"; if (sResRef=="wbwxh003") return "wbwxh018"; break; } case 6: { // Cherry Shortbow if (sResRef=="wbwsh002") return "wbwsh020"; if (sResRef=="nw_wbwsh001") return "wbwsh019"; if (sResRef=="wbwsh003") return "wbwsh021"; // Cherry Longbow if (sResRef=="wbwln002") return "wbwln020"; if (sResRef=="nw_wbwln001") return "wbwln019"; if (sResRef=="wbwln003") return "wbwln021"; // Cherry Light Crossbow if (sResRef=="wbwxl002") return "wbwxl019"; if (sResRef=="nw_wbwxl001") return "wbwxl018"; if (sResRef=="wbwxl003") return "wbwxl020"; // Cherry Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh020"; if (sResRef=="nw_wbwxh001") return "wbwxh019"; if (sResRef=="wbwxh003") return "wbwxh021"; break; } case 7: { // Maple Shortbow if (sResRef=="wbwsh002") return "wbwsh023"; if (sResRef=="nw_wbwsh001") return "wbwsh022"; if (sResRef=="wbwsh003") return "wbwsh024"; // Maple Longbow if (sResRef=="wbwln002") return "wbwln023"; if (sResRef=="nw_wbwln001") return "wbwln022"; if (sResRef=="wbwln003") return "wbwln024"; // Maple Light Crossbow if (sResRef=="wbwxl002") return "wbwxl022"; if (sResRef=="nw_wbwxl001") return "wbwxl021"; if (sResRef=="wbwxl003") return "wbwxl023"; // Maple Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh023"; if (sResRef=="nw_wbwxh001") return "wbwxh022"; if (sResRef=="wbwxh003") return "wbwxh024"; break; } case 8: { // Almond Shortbow if (sResRef=="wbwsh002") return "wbwsh026"; if (sResRef=="nw_wbwsh001") return "wbwsh025"; if (sResRef=="wbwsh003") return "wbwsh027"; // Almond Longbow if (sResRef=="wbwln002") return "wbwln026"; if (sResRef=="nw_wbwln001") return "wbwln025"; if (sResRef=="wbwln003") return "wbwln027"; // Almond Light Crossbow if (sResRef=="wbwxl002") return "wbwxl025"; if (sResRef=="nw_wbwxl001") return "wbwxl024"; if (sResRef=="wbwxl003") return "wbwxl026"; // Almond Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh026"; if (sResRef=="nw_wbwxh001") return "wbwxh025"; if (sResRef=="wbwxh003") return "wbwxh027"; break; } case 9: { // Hickory Shortbow if (sResRef=="wbwsh002") return "wbwsh029"; if (sResRef=="nw_wbwsh001") return "wbwsh028"; if (sResRef=="wbwsh003") return "wbwsh030"; // Hickory Longbow if (sResRef=="wbwln002") return "wbwln029"; if (sResRef=="nw_wbwln001") return "wbwln028"; if (sResRef=="wbwln003") return "wbwln030"; // Hickory Light Crossbow if (sResRef=="wbwxl002") return "wbwxl028"; if (sResRef=="nw_wbwxl001") return "wbwxl027"; if (sResRef=="wbwxl003") return "wbwxl029"; // Hickory Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh029"; if (sResRef=="nw_wbwxh001") return "wbwxh028"; if (sResRef=="wbwxh003") return "wbwxh030"; break; } case 10: { // Birch Shortbow if (sResRef=="wbwsh002") return "wbwsh032"; if (sResRef=="nw_wbwsh001") return "wbwsh031"; if (sResRef=="wbwsh003") return "wbwsh033"; // Birch Longbow if (sResRef=="wbwln002") return "wbwln032"; if (sResRef=="nw_wbwln001") return "wbwln031"; if (sResRef=="wbwln003") return "wbwln033"; // Birch Light Crossbow if (sResRef=="wbwxl002") return "wbwxl031"; if (sResRef=="nw_wbwxl001") return "wbwxl030"; if (sResRef=="wbwxl003") return "wbwxl032"; // Birch Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh032"; if (sResRef=="nw_wbwxh001") return "wbwxh031"; if (sResRef=="wbwxh003") return "wbwxh033"; break; } case 11: { // Elder Shortbow if (sResRef=="wbwsh002") return "wbwsh035"; if (sResRef=="nw_wbwsh001") return "wbwsh034"; if (sResRef=="wbwsh003") return "wbwsh036"; // Elder Longbow if (sResRef=="wbwln002") return "wbwln035"; if (sResRef=="nw_wbwln001") return "wbwln034"; if (sResRef=="wbwln003") return "wbwln036"; // Elder Light Crossbow if (sResRef=="wbwxl002") return "wbwxl035"; if (sResRef=="nw_wbwxl001") return "wbwxl034"; if (sResRef=="wbwxl003") return "wbwxl036"; // Elder Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh035"; if (sResRef=="nw_wbwxh001") return "wbwxh034"; if (sResRef=="wbwxh003") return "wbwxh036"; break; } case 12: { // Walnut Shortbow if (sResRef=="wbwsh002") return "wbwsh038"; if (sResRef=="nw_wbwsh001") return "wbwsh037"; if (sResRef=="wbwsh003") return "wbwsh039"; // Walnut Longbow if (sResRef=="wbwln002") return "wbwln038"; if (sResRef=="nw_wbwln001") return "wbwln037"; if (sResRef=="wbwln003") return "wbwln039"; // Walnut Light Crossbow if (sResRef=="wbwxl002") return "wbwxl038"; if (sResRef=="nw_wbwxl001") return "wbwxl037"; if (sResRef=="wbwxl003") return "wbwxl039"; // Walnut Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh038"; if (sResRef=="nw_wbwxh001") return "wbwxh037"; if (sResRef=="wbwxh003") return "wbwxh039"; break; } case 13: { // Elm Shortbow if (sResRef=="wbwsh002") return "wbwsh041"; if (sResRef=="nw_wbwsh001") return "wbwsh040"; if (sResRef=="wbwsh003") return "wbwsh042"; // Elm Longbow if (sResRef=="wbwln002") return "wbwln041"; if (sResRef=="nw_wbwln001") return "wbwln040"; if (sResRef=="wbwln003") return "wbwln042"; // Elm Light Crossbow if (sResRef=="wbwxl002") return "wbwxl041"; if (sResRef=="nw_wbwxl001") return "wbwxl040"; if (sResRef=="wbwxl003") return "wbwxl042"; // Elm Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh041"; if (sResRef=="nw_wbwxh001") return "wbwxh040"; if (sResRef=="wbwxh003") return "wbwxh042"; break; } case 14: { // Mahogany Shortbow if (sResRef=="wbwsh002") return "wbwsh044"; if (sResRef=="nw_wbwsh001") return "wbwsh043"; if (sResRef=="wbwsh003") return "wbwsh045"; // Mahogany Longbow if (sResRef=="wbwln002") return "wbwln044"; if (sResRef=="nw_wbwln001") return "wbwln043"; if (sResRef=="wbwln003") return "wbwln045"; // Mahogany Light Crossbow if (sResRef=="wbwxl002") return "wbwxl044"; if (sResRef=="nw_wbwxl001") return "wbwxl043"; if (sResRef=="wbwxl003") return "wbwxl045"; // Mahogany Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh044"; if (sResRef=="nw_wbwxh001") return "wbwxh043"; if (sResRef=="wbwxh003") return "wbwxh045"; break; } case 15: { // Oak Shortbow if (sResRef=="wbwsh002") return "wbwsh047"; if (sResRef=="nw_wbwsh001") return "wbwsh046"; if (sResRef=="wbwsh003") return "wbwsh048"; // Oak Longbow if (sResRef=="wbwln002") return "wbwln047"; if (sResRef=="nw_wbwln001") return "wbwln046"; if (sResRef=="wbwln003") return "wbwln048"; // Oak Light Crossbow if (sResRef=="wbwxl002") return "wbwxl047"; if (sResRef=="nw_wbwxl001") return "wbwxl046"; if (sResRef=="wbwxl003") return "wbwxl048"; // Oak Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh047"; if (sResRef=="nw_wbwxh001") return "wbwxh046"; if (sResRef=="wbwxh003") return "wbwxh048"; break; } case 16: { // Yew Shortbow if (sResRef=="wbwsh002") return "wbwsh050"; if (sResRef=="nw_wbwsh001") return "wbwsh049"; if (sResRef=="wbwsh003") return "wbwsh051"; // Yew Longbow if (sResRef=="wbwln002") return "wbwln050"; if (sResRef=="nw_wbwln001") return "wbwln049"; if (sResRef=="wbwln003") return "wbwln051"; // Yew Light Crossbow if (sResRef=="wbwxl002") return "wbwxl050"; if (sResRef=="nw_wbwxl001") return "wbwxl049"; if (sResRef=="wbwxl003") return "wbwxl051"; // Yew Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh050"; if (sResRef=="nw_wbwxh001") return "wbwxh049"; if (sResRef=="wbwxh003") return "wbwxh051"; break; } case 17: { // Redwood Shortbow if (sResRef=="wbwsh002") return "wbwsh053"; if (sResRef=="nw_wbwsh001") return "wbwsh052"; if (sResRef=="wbwsh003") return "wbwsh054"; // Redwood Longbow if (sResRef=="wbwln002") return "wbwln053"; if (sResRef=="nw_wbwln001") return "wbwln052"; if (sResRef=="wbwln003") return "wbwln054"; // Redwood Light Crossbow if (sResRef=="wbwxl002") return "wbwxl053"; if (sResRef=="nw_wbwxl001") return "wbwxl052"; if (sResRef=="wbwxl003") return "wbwxl054"; // Redwood Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh053"; if (sResRef=="nw_wbwxh001") return "wbwxh052"; if (sResRef=="wbwxh003") return "wbwxh054"; break; } case 18: { // Ironwood Shortbow if (sResRef=="wbwsh002") return "wbwsh056"; if (sResRef=="nw_wbwsh001") return "wbwsh055"; if (sResRef=="wbwsh003") return "wbwsh057"; // Ironwood Longbow if (sResRef=="wbwln002") return "wbwln056"; if (sResRef=="nw_wbwln001") return "wbwln055"; if (sResRef=="wbwln003") return "wbwln057"; // Ironwood Light Crossbow if (sResRef=="wbwxl002") return "wbwxl056"; if (sResRef=="nw_wbwxl001") return "wbwxl055"; if (sResRef=="wbwxl003") return "wbwxl057"; // Ironwood Heavy Crossbow if (sResRef=="wbwxh002") return "wbwxh056"; if (sResRef=="nw_wbwxh001") return "wbwxh055"; if (sResRef=="wbwxh003") return "wbwxh057"; break; } default: { return sResRef; break; } } return sResRef; }