Fixed CCOH, Fixed starting GP, Fixed DMFI languages, Fix cep weapon appearances, Fixed new player start up system. Added PC deleter. Added ACP 4.1. Full compile. Updated release archive.
773 lines
26 KiB
Plaintext
773 lines
26 KiB
Plaintext
//#include "_persist_01a"
|
|
#include "nw_i0_plot"
|
|
|
|
void CreateAnObject(string sResource, object oPC, int iStackSize);
|
|
string CraftLookup(string sResRef, int iIngotType);
|
|
void GetNextStackedItem(object oPC, string sItemTag, int iCount, int iMode, string sStackResRef);
|
|
int GetModifier(string sItemTag);
|
|
|
|
void main()
|
|
{
|
|
int iUseMode = 0;
|
|
if (GetInventoryDisturbType()!= INVENTORY_DISTURB_TYPE_ADDED)
|
|
{
|
|
iUseMode = 99;
|
|
if (GetLastDisturbed() == OBJECT_SELF)
|
|
{
|
|
DestroyObject(GetInventoryDisturbItem());
|
|
return;
|
|
}
|
|
}
|
|
|
|
object oPC = GetLastDisturbed();
|
|
object oItem = GetInventoryDisturbItem();
|
|
object oTemp = OBJECT_INVALID;
|
|
|
|
if (iUseMode == 0)
|
|
{
|
|
// 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.
|
|
|
|
if (GetLocalInt(OBJECT_SELF,"iAmInUse") != 0)
|
|
{
|
|
CopyItem(oItem,oPC,TRUE);
|
|
SendMessageToPC(oPC,"You must wait until the current lathing process is complete before starting another.");
|
|
DestroyObject(oItem);
|
|
return;
|
|
}
|
|
|
|
if (iUseMode==0)
|
|
{
|
|
SetLocalInt(OBJECT_SELF,"iAmInUse",99);
|
|
DelayCommand(13.0,SetLocalInt(OBJECT_SELF,"iAmInUse",0));
|
|
}
|
|
|
|
string sItemTag = GetTag(oItem);
|
|
string sItemTagTemp;
|
|
string sItem1ResRef = "";
|
|
string sItem2ResRef = "";
|
|
string sItem3ResRef = "";
|
|
string sItemFailResRef = "kindling";
|
|
string sShaft = "";
|
|
string sComponentResRef="";
|
|
string sFeather = "ITEM_FEATHER";
|
|
int iTemp = 10;
|
|
int iCount1 = 0;
|
|
int iCount2 = 0;
|
|
int iCount3 = 0;
|
|
int iRandom = 0;
|
|
int iSuccess = 0;
|
|
int iQuality = 0;
|
|
int iShaftType = 0;
|
|
int iMetalType = 0;
|
|
int iShaftStackSize = 0;
|
|
string sSuccess = "";
|
|
string sTempString = "";
|
|
int iFletchModifier;
|
|
int iAttachMode = 0; //If attachmode = 1, do skill check to attach to shafts
|
|
int iItemStack;
|
|
int iItemStack2;
|
|
object oItem2;
|
|
|
|
int iFletchingSkill = GetCampaignInt("UOACraft","iFletchingSkill",oPC);
|
|
int iFletchingChance = iFletchingSkill;
|
|
|
|
if (iFletchingChance <350)
|
|
{
|
|
iFletchingChance = GetAbilityScore(oPC,ABILITY_DEXTERITY)*5;
|
|
iFletchingChance = iFletchingChance+(GetAbilityScore(oPC,ABILITY_STRENGTH)*3);
|
|
iFletchingChance = iFletchingChance+(GetAbilityScore(oPC,ABILITY_CHARISMA)*2);
|
|
iFletchingChance = iFletchingChance*3;
|
|
if (iFletchingChance >350) iFletchingChance = 350;
|
|
if (iFletchingSkill>iFletchingChance)iFletchingChance = iFletchingSkill;
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GetStringLeft(sItemTag,5) != "WOOD_")
|
|
{
|
|
if (iUseMode==0)
|
|
{
|
|
oItem2 = GetItemPossessedBy(OBJECT_SELF,GetTag(oItem)); //This ensures accurate count of a split stack
|
|
iItemStack = GetNumStackedItems(oItem2);
|
|
//SendMessageToPC(oPC,"A) ITEM STACKSIZE - "+IntToString(iItemStack));
|
|
if (iItemStack==0)
|
|
{
|
|
SendMessageToPC(oPC,"An error has occured in trying to determine the number of stacked items placed into the lathe.");
|
|
CopyItem(oItem,oPC,TRUE);
|
|
DestroyObject(oItem);
|
|
return;
|
|
}
|
|
}
|
|
//SendMessageToPC(oPC," 1) ITEM STACKSIZE - "+IntToString(iItemStack));
|
|
if (GetStringLeft(sItemTag,5) == "ITEM_")
|
|
{
|
|
sTempString = GetStringRight(sItemTag,GetStringLength(sItemTag)-5);
|
|
if (GetStringLeft(sTempString,2) == "N_")
|
|
{
|
|
iQuality = 2;
|
|
sTempString = GetStringRight(sTempString,GetStringLength(sTempString)-2);
|
|
}
|
|
if (GetStringLeft(sTempString,3) == "EX_")
|
|
{
|
|
iQuality = 3;
|
|
sTempString = GetStringRight(sTempString,GetStringLength(sTempString)-3);
|
|
}
|
|
if (GetStringLeft(sTempString,5) == "POOR_")
|
|
{
|
|
iQuality = 1;
|
|
sTempString = GetStringRight(sTempString,GetStringLength(sTempString)-5);
|
|
}
|
|
}
|
|
if (GetStringLeft(sTempString,10)== "ARROWHEAD_") iShaftType = 1;
|
|
if (GetStringLeft(sTempString,8)== "BOLTTIP_") iShaftType = 2;
|
|
|
|
|
|
|
|
// For filled glass arrowheads
|
|
if (iQuality==0)
|
|
{
|
|
//Determine Quality
|
|
if (GetStringRight(sItemTag,5)=="_POOR")iQuality = 1;
|
|
if (GetStringRight(sItemTag,7)=="_NORMAL")iQuality=2;
|
|
if (GetStringRight(sItemTag,12)=="_EXCEPTIONAL")iQuality=3;
|
|
|
|
//Determine Type Arrowheads
|
|
if (GetStringLeft(sItemTag,16)=="WACID_ARROWHEAD_")iShaftType=1;
|
|
if (GetStringLeft(sItemTag,16)=="MACID_ARROWHEAD_") iShaftType=1;
|
|
if (GetStringLeft(sItemTag,16)=="SACID_ARROWHEAD_") iShaftType=1;
|
|
if (GetStringLeft(sItemTag,17)=="VSACID_ARROWHEAD_") iShaftType=1;
|
|
|
|
//Determine Type bolt tips
|
|
if (GetStringLeft(sItemTag,14)=="WACID_BOLTTIP_") iShaftType=2;
|
|
if (GetStringLeft(sItemTag,14)=="MACID_BOLTTIP_") iShaftType=2;
|
|
if (GetStringLeft(sItemTag,14)=="SACID_BOLTTIP_") iShaftType=2;
|
|
if (GetStringLeft(sItemTag,14)=="VSACID_BOLTTIP_") iShaftType=2;
|
|
|
|
//Determine End Product Type
|
|
if (GetStringLeft(sItemTag,6)=="WACID_")
|
|
{
|
|
iMetalType =14;
|
|
iFletchModifier = 200;
|
|
iAttachMode=99;
|
|
}
|
|
if (GetStringLeft(sItemTag,6)=="MACID_")
|
|
{
|
|
iMetalType =15;
|
|
iFletchModifier = 400;
|
|
iAttachMode=99;
|
|
}
|
|
if (GetStringLeft(sItemTag,6)=="SACID_")
|
|
{
|
|
iMetalType =16;
|
|
iFletchModifier = 600;
|
|
iAttachMode=99;
|
|
}
|
|
if (GetStringLeft(sItemTag,7)=="VSACID_")
|
|
{
|
|
iMetalType =17;
|
|
iFletchModifier = 800;
|
|
iAttachMode=99;
|
|
}
|
|
} //End of filled arrow/bolt determination
|
|
|
|
|
|
if (iShaftType==0)
|
|
{
|
|
CopyItem(oItem,oPC,TRUE);
|
|
SendMessageToPC(oPC,"You cannot lathe this item into arrow or bolt shafts!");
|
|
DestroyObject(oItem);
|
|
return;
|
|
}
|
|
if (iFletchModifier>iFletchingSkill)
|
|
{
|
|
CopyItem(oItem,oPC,TRUE);
|
|
SendMessageToPC(oPC,"You have no idea how to properly attach this to the shafts!");
|
|
DestroyObject(oItem);
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (iShaftType !=0)
|
|
{
|
|
if (iMetalType==0)
|
|
{
|
|
if (GetStringRight(sItemTag,7)=="_NORMAL")iMetalType =1;
|
|
if (GetStringRight(sItemTag,5)=="_DULL")iMetalType =2;
|
|
if (GetStringRight(sItemTag,7)=="_SHADOW")iMetalType =3;
|
|
if (GetStringRight(sItemTag,7)=="_COPPER")iMetalType =4;
|
|
if (GetStringRight(sItemTag,7)=="_BRONZE")iMetalType =5;
|
|
if (GetStringRight(sItemTag,5)=="_GOLD")iMetalType =6;
|
|
if (GetStringRight(sItemTag,8)=="_AGAPITE")iMetalType =7;
|
|
if (GetStringRight(sItemTag,7)=="_VERITE")iMetalType =8;
|
|
if (GetStringRight(sItemTag,9)=="_VALORITE")iMetalType =9;
|
|
if (GetStringRight(sItemTag,7)=="_SILVER")iMetalType =10;
|
|
if (GetStringRight(sItemTag,8)=="_MITHRIL")iMetalType =11;
|
|
if (GetStringRight(sItemTag,11)=="_ADAMANTITE")iMetalType =12;
|
|
if (GetStringRight(sItemTag,9)=="_PLATINUM")iMetalType =13;
|
|
if (iMetalType!=0)
|
|
{
|
|
iAttachMode=99;
|
|
oItem2 = GetItemPossessedBy(OBJECT_SELF,GetTag(oItem)); //This ensures accurate count of a split stack
|
|
iItemStack = GetNumStackedItems(oItem2);
|
|
//SendMessageToPC(oPC,"2) ITEM STACKSIZE - "+IntToString(iItemStack));
|
|
}
|
|
}
|
|
|
|
switch (iQuality)
|
|
{
|
|
case 2:
|
|
{
|
|
if (iShaftType==1)
|
|
{
|
|
sShaft = "ITEM_ARROWSHAFTNORMAL";
|
|
sItem2ResRef = CraftLookup("nw_wamar001",iMetalType);
|
|
}
|
|
if (sShaft=="")
|
|
{
|
|
sShaft = "ITEM_BOLTSHAFTSNORMAL";
|
|
sItem2ResRef = CraftLookup("nw_wambo001",iMetalType);
|
|
}
|
|
break;
|
|
}
|
|
case 3:
|
|
{
|
|
if (iShaftType==1)
|
|
{
|
|
sShaft = "ITEM_ARROWSHAFTEXCEPTIONAL";
|
|
sItem3ResRef = CraftLookup("wamar003",iMetalType);
|
|
}
|
|
if (sShaft=="")
|
|
{
|
|
sShaft = "ITEM_BOLTSHAFTSEXCEPTIONAL";
|
|
sItem3ResRef = CraftLookup("wambo003",iMetalType);
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
{
|
|
if (iShaftType==1)
|
|
{
|
|
sShaft = "ITEM_ARROWSHAFTPOOR";
|
|
sItem1ResRef = CraftLookup("wamar002",iMetalType);
|
|
}
|
|
if (sShaft=="")
|
|
{
|
|
sShaft = "ITEM_BOLTSHAFTSPOOR";
|
|
sItem1ResRef = CraftLookup("wambo002",iMetalType);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
//check for components
|
|
if (GetNumItems(oPC,sShaft)<iItemStack)
|
|
{
|
|
FloatingTextStringOnCreature("You do not have enough shafts to make that many.",oPC,FALSE);
|
|
CopyItem(oItem,oPC,TRUE);
|
|
DestroyObject(oItem);
|
|
return;
|
|
}
|
|
if (GetNumItems(oPC,sFeather)==0)
|
|
{
|
|
FloatingTextStringOnCreature("You do not have enough feathers to fletch them with.",oPC,FALSE);
|
|
CopyItem(oItem,oPC,TRUE);
|
|
DestroyObject(oItem);
|
|
return;
|
|
}
|
|
|
|
//remove components
|
|
oTemp = GetItemPossessedBy(oPC,sShaft);
|
|
sComponentResRef = GetResRef(oTemp);
|
|
iShaftStackSize = GetNumStackedItems(oTemp);
|
|
DestroyObject(oTemp);
|
|
|
|
if (iShaftStackSize < iItemStack)
|
|
{
|
|
iItemStack2 = iItemStack - iShaftStackSize;
|
|
//SendMessageToPC(oPC,"3) ITEM STACKSIZE - "+IntToString(iItemStack));
|
|
DelayCommand(2.0,GetNextStackedItem(oPC,sShaft,iItemStack2,1,sComponentResRef));
|
|
}
|
|
else
|
|
{
|
|
if (iShaftStackSize > iItemStack)
|
|
{
|
|
iShaftStackSize = iShaftStackSize - iItemStack;
|
|
DelayCommand(1.0,CreateAnObject(sComponentResRef,oPC,iShaftStackSize));
|
|
}
|
|
}
|
|
if (Random(1000)<iItemStack*10)
|
|
{
|
|
DelayCommand(9.1,PlaySound("as_na_bushmove2"));
|
|
oTemp = GetItemPossessedBy(oPC,sFeather);
|
|
DestroyObject(oTemp,5.0);
|
|
AssignCommand(oPC,DelayCommand(5.0,FloatingTextStringOnCreature("You have used up a batch of feathers!",oPC,FALSE)));
|
|
}
|
|
|
|
|
|
if (iAttachMode!=0) //Check successes while attaching arrowheads to shafts
|
|
{
|
|
iFletchModifier = iFletchModifier/2;
|
|
iCount3 = iItemStack;
|
|
iItemStack = 0;
|
|
iFletchingChance = iFletchingChance - iFletchModifier;
|
|
if (iFletchingChance<1) iFletchingChance=1;
|
|
iCount1 = 0;
|
|
for (iCount3; iCount3>0; iCount3--)
|
|
{
|
|
if (Random(1000)<=iFletchingChance)iItemStack++;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//Assign Animations
|
|
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,10.0));
|
|
PlaySound("as_na_grassmove2");
|
|
DelayCommand(3.0,PlaySound("as_na_grassmove2"));
|
|
DelayCommand(6.0,PlaySound("as_na_bushmove1"));
|
|
DelayCommand(9.0,PlaySound("as_na_branchsnp2"));
|
|
if (iShaftType==1) AssignCommand(oPC,DelayCommand(9.5,FloatingTextStringOnCreature("You careate "+IntToString(iItemStack)+" arrows.",oPC,FALSE)));
|
|
if (iShaftType==2) AssignCommand(oPC,DelayCommand(9.5,FloatingTextStringOnCreature("You careate "+IntToString(iItemStack)+" bolts.",oPC,FALSE)));
|
|
//create the product on the PC
|
|
if (iQuality==1) DelayCommand(10.0,CreateAnObject(sItem1ResRef,oPC,iItemStack));
|
|
if (iQuality==2) DelayCommand(10.0,CreateAnObject(sItem2ResRef,oPC,iItemStack));
|
|
if (iQuality==3) DelayCommand(10.0,CreateAnObject(sItem3ResRef,oPC,iItemStack));
|
|
|
|
DestroyObject(oItem);
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
DestroyObject(oItem,3.0);
|
|
//int iFletchingSkill = GetTokenPair(oPC,13,2);
|
|
|
|
|
|
//Determine modifiers to success
|
|
if (iMetalType<14) iFletchModifier = GetModifier(sItemTag);
|
|
if (iFletchingChance < iFletchModifier)
|
|
{
|
|
FloatingTextStringOnCreature("You have no idea how to lathe this wood into shafts.",oPC,FALSE);
|
|
CopyItem(oItem,oPC,TRUE);
|
|
DestroyObject(oItem);
|
|
return;
|
|
}
|
|
|
|
iFletchModifier = iFletchModifier/2;
|
|
//iFletchingChance = iFletchingChance+iFletchModifier;
|
|
|
|
|
|
if (iAttachMode==0) //Check successes while crafting shafts
|
|
{
|
|
for (iTemp; iTemp>0; iTemp--)
|
|
{
|
|
if (Random(800)<= iFletchingChance-iFletchModifier)
|
|
{
|
|
iRandom = Random(1000);
|
|
if (iRandom <= iFletchingChance-500+iFletchModifier) // Check for Exceptional
|
|
{
|
|
iCount3++;
|
|
}
|
|
else
|
|
{
|
|
if (iRandom <= iFletchingChance-200+iFletchModifier) // Check for normal
|
|
{
|
|
iCount2++;
|
|
}
|
|
else
|
|
{
|
|
if (iRandom <= iFletchingChance+iFletchModifier) iCount1++; // Check for poor
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GetLocalInt(oPC,"iFletchingMode")==0) //make arrowshafts
|
|
{
|
|
sItem1ResRef = "arrowshaft001";
|
|
sItem2ResRef = "arrowshaft002";
|
|
sItem3ResRef = "arrowshaft003";
|
|
sSuccess = "Arrowshafts created - ("+IntToString(iCount1)+" Poor) ("+IntToString(iCount2)+" Normal) ("+IntToString(iCount3)+" Exceptional) and some kindling";
|
|
}
|
|
|
|
if (GetLocalInt(oPC,"iFletchingMode")!=0) //make boltshafts
|
|
{
|
|
sItem1ResRef = "boltshafts001";
|
|
sItem2ResRef = "boltshafts002";
|
|
sItem3ResRef = "boltshafts003";
|
|
sSuccess = "Bolt shafts created - ("+IntToString(iCount1)+" Poor) ("+IntToString(iCount2)+" Normal) ("+IntToString(iCount3)+" Exceptional) and some kindling";
|
|
}
|
|
|
|
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,12.0));
|
|
|
|
AssignCommand(oPC,DelayCommand(12.0,CreateAnObject(sItemFailResRef,oPC,1)));
|
|
AssignCommand(oPC,DelayCommand(12.0,CreateAnObject(sItem1ResRef,oPC,iCount1)));
|
|
AssignCommand(oPC,DelayCommand(12.0,CreateAnObject(sItem2ResRef,oPC,iCount2)));
|
|
AssignCommand(oPC,DelayCommand(12.0,CreateAnObject(sItem3ResRef,oPC,iCount3)));
|
|
AssignCommand(oPC,DelayCommand(12.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE)));
|
|
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));
|
|
|
|
if (iFletchingSkill <200)
|
|
{
|
|
if (iCount1 >0) iSuccess = 1;
|
|
if (iCount2 >0) iSuccess = 1;
|
|
}
|
|
else
|
|
{
|
|
if (iFletchingSkill<700)
|
|
{
|
|
if (iCount2 >0) iSuccess = 1;
|
|
}
|
|
else
|
|
{
|
|
if (iCount3 >0) iSuccess = 1;
|
|
}
|
|
}
|
|
|
|
int iSkillGain=0;
|
|
if (iSuccess==1)
|
|
{
|
|
if (d10(1)+1 >= iFletchingSkill/100) iSkillGain = 1;
|
|
}
|
|
|
|
//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 = "";
|
|
iFletchingSkill++;
|
|
sOldSkill2 = IntToString(iFletchingSkill);
|
|
sOldSkill = "."+GetStringRight(sOldSkill2,1);
|
|
if (iFletchingSkill > 9)
|
|
{
|
|
sOldSkill = GetStringLeft(sOldSkill2,GetStringLength(sOldSkill2)-1)+sOldSkill;
|
|
}
|
|
else
|
|
{
|
|
sOldSkill = "0"+sOldSkill;
|
|
}
|
|
if (iFletchingSkill <= 1000)
|
|
{
|
|
//DelayCommand(12.0,SetTokenPair(oPC,13,2,iFletchingSkill));
|
|
DelayCommand(12.0,SetCampaignInt("UOACraft","iFletchingSkill",iFletchingSkill,oPC));
|
|
DelayCommand(12.0,SendMessageToPC(oPC,"===================================="));
|
|
DelayCommand(12.0,SendMessageToPC(oPC,"Your skill in fletching has gone up!"));
|
|
DelayCommand(12.0,SendMessageToPC(oPC,"Current fletching skill : "+ sOldSkill+"%"));
|
|
DelayCommand(12.0,SendMessageToPC(oPC,"===================================="));
|
|
if (GetLocalInt(GetModule(),"_UOACraft_XP")!=0) DelayCommand(11.9,GiveXPToCreature(oPC,GetLocalInt(GetModule(),"_UOACraft_XP")));
|
|
}
|
|
}
|
|
} // End of iUseMode = 0 (added to inventory) section
|
|
|
|
if (iUseMode == 99)
|
|
{
|
|
if (GetTag(oItem) == "SWITCH_ARROWSHAFT")
|
|
{
|
|
CreateItemOnObject("flagswitch003",OBJECT_SELF,1);
|
|
SetLocalInt(oPC,"iFletchingMode",0);
|
|
FloatingTextStringOnCreature("Switching to 'Arrowshaft' Mode...",oPC,FALSE);
|
|
}
|
|
if (GetTag(oItem) == "SWITCH_BOLTSHAFT")
|
|
{
|
|
CreateItemOnObject("flagswitch004",OBJECT_SELF,1);
|
|
SetLocalInt(oPC,"iFletchingMode",99);
|
|
FloatingTextStringOnCreature("Switching to 'Boltshaft' Mode...",oPC,FALSE);
|
|
}
|
|
|
|
DestroyObject(oItem);
|
|
}
|
|
|
|
}
|
|
|
|
void CreateAnObject(string sResource, object oPC, int iStackSize)
|
|
{
|
|
CreateItemOnObject(sResource,oPC,iStackSize);
|
|
return;
|
|
}
|
|
|
|
string CraftLookup(string sResRef, int iIngotType)
|
|
{
|
|
switch (iIngotType)
|
|
{
|
|
case 2:
|
|
{
|
|
//Dull Copper Arrows
|
|
if (sResRef =="wamar002") return "wamar005";
|
|
if (sResRef =="nw_wamar001") return "wamar004";
|
|
if (sResRef =="wamar003") return "wamar006";
|
|
//Dull Copper Bolts
|
|
if (sResRef=="wambo002") return "wambo005";
|
|
if (sResRef=="nw_wambo001") return "wambo004";
|
|
if (sResRef=="wambo003") return "wambo006";
|
|
break;
|
|
}
|
|
case 3:
|
|
{
|
|
//Shadow Iron Arrows
|
|
if (sResRef =="wamar002") return "wamar008";
|
|
if (sResRef =="nw_wamar001") return "wamar007";
|
|
if (sResRef =="wamar003") return "wamar009";
|
|
//Shadow Iron Bolts
|
|
if (sResRef=="wambo002") return "wambo008";
|
|
if (sResRef=="nw_wambo001") return "wambo007";
|
|
if (sResRef=="wambo003") return "wambo009";
|
|
break;
|
|
}
|
|
case 4:
|
|
{
|
|
//Copper Arrows
|
|
if (sResRef =="wamar002") return "wamar011";
|
|
if (sResRef =="nw_wamar001") return "wamar010";
|
|
if (sResRef =="wamar003") return "wamar012";
|
|
//Copper Bolts
|
|
if (sResRef=="wambo002") return "wambo011";
|
|
if (sResRef=="nw_wambo001") return "wambo010";
|
|
if (sResRef=="wambo003") return "wambo012";
|
|
break;
|
|
}
|
|
case 5:
|
|
{
|
|
//Bronze Arrows
|
|
if (sResRef =="wamar002") return "wamar014";
|
|
if (sResRef =="nw_wamar001") return "wamar013";
|
|
if (sResRef =="wamar003") return "wamar015";
|
|
//Bronze Bolts
|
|
if (sResRef=="wambo002") return "wambo014";
|
|
if (sResRef=="nw_wambo001") return "wambo013";
|
|
if (sResRef=="wambo003") return "wambo015";
|
|
break;
|
|
}
|
|
case 6:
|
|
{
|
|
//Gold Arrows
|
|
if (sResRef =="wamar002") return "wamar017";
|
|
if (sResRef =="nw_wamar001") return "wamar016";
|
|
if (sResRef =="wamar003") return "wamar018";
|
|
//Gold Bolts
|
|
if (sResRef=="wambo002") return "wambo017";
|
|
if (sResRef=="nw_wambo001") return "wambo016";
|
|
if (sResRef=="wambo003") return "wambo018";
|
|
break;
|
|
}
|
|
case 7:
|
|
{
|
|
//Agapite Arrows
|
|
if (sResRef =="wamar002") return "wamar020";
|
|
if (sResRef =="nw_wamar001") return "wamar019";
|
|
if (sResRef =="wamar003") return "wamar021";
|
|
//Agapite Bolts
|
|
if (sResRef=="wambo002") return "wambo020";
|
|
if (sResRef=="nw_wambo001") return "wambo019";
|
|
if (sResRef=="wambo003") return "wambo021";
|
|
break;
|
|
}
|
|
case 8:
|
|
{
|
|
//Verite Arrows
|
|
if (sResRef =="wamar002") return "wamar023";
|
|
if (sResRef =="nw_wamar001") return "wamar022";
|
|
if (sResRef =="wamar003") return "wamar024";
|
|
//Verite Bolts
|
|
if (sResRef=="wambo002") return "wambo023";
|
|
if (sResRef=="nw_wambo001") return "wambo022";
|
|
if (sResRef=="wambo003") return "wambo024";
|
|
break;
|
|
}
|
|
case 9:
|
|
{
|
|
//Valorite Arrows
|
|
if (sResRef =="wamar002") return "wamar026";
|
|
if (sResRef =="nw_wamar001") return "wamar025";
|
|
if (sResRef =="wamar003") return "wamar027";
|
|
//Valorite Bolts
|
|
if (sResRef=="wambo002") return "wambo026";
|
|
if (sResRef=="nw_wambo001") return "wambo025";
|
|
if (sResRef=="wambo003") return "wambo027";
|
|
break;
|
|
}
|
|
case 10:
|
|
{
|
|
//Silver Arrows
|
|
if (sResRef =="wamar002") return "wamar029";
|
|
if (sResRef =="nw_wamar001") return "wamar028";
|
|
if (sResRef =="wamar003") return "wamar030";
|
|
//Silver Bolts
|
|
if (sResRef=="wambo002") return "wambo029";
|
|
if (sResRef=="nw_wambo001") return "wambo028";
|
|
if (sResRef=="wambo003") return "wambo030";
|
|
break;
|
|
}
|
|
case 11:
|
|
{
|
|
//Mithril Arrows
|
|
if (sResRef =="wamar002") return "wamar032";
|
|
if (sResRef =="nw_wamar001") return "wamar031";
|
|
if (sResRef =="wamar003") return "wamar033";
|
|
//Mithril Bolts
|
|
if (sResRef=="wambo002") return "wambo032";
|
|
if (sResRef=="nw_wambo001") return "wambo031";
|
|
if (sResRef=="wambo003") return "wambo033";
|
|
break;
|
|
}
|
|
case 12:
|
|
{
|
|
//Adamantite Arrows
|
|
if (sResRef =="wamar002") return "wamar035";
|
|
if (sResRef =="nw_wamar001") return "wamar034";
|
|
if (sResRef =="wamar003") return "wamar036";
|
|
//Adamantite Bolts
|
|
if (sResRef=="wambo002") return "wambo035";
|
|
if (sResRef=="nw_wambo001") return "wambo034";
|
|
if (sResRef=="wambo003") return "wambo036";
|
|
break;
|
|
}
|
|
case 13:
|
|
{
|
|
//Platinum Arrows
|
|
if (sResRef =="wamar002") return "wamar038";
|
|
if (sResRef =="nw_wamar001") return "wamar037";
|
|
if (sResRef =="wamar003") return "wamar039";
|
|
//Platinum Bolts
|
|
if (sResRef=="wambo002") return "wambo038";
|
|
if (sResRef=="nw_wambo001") return "wambo037";
|
|
if (sResRef=="wambo003") return "wambo039";
|
|
break;
|
|
}
|
|
case 14:
|
|
{
|
|
//Weak Acid Arrows
|
|
if (sResRef =="wamar002") return "acidarrow001";//poor
|
|
if (sResRef =="nw_wamar001") return "acidarrow002";//normal
|
|
if (sResRef =="wamar003") return "acidarrow003";//exceptional
|
|
//Weak Acid Bolts
|
|
if (sResRef =="wambo002") return "acidbolt001";//poor
|
|
if (sResRef =="nw_wambo001") return "acidbolt002";//normal
|
|
if (sResRef =="wambo003") return "acidbolt003";//exceptional
|
|
}
|
|
case 15:
|
|
{
|
|
//Moderate Acid Arrows
|
|
if (sResRef =="wamar002") return "acidarrow004";//poor
|
|
if (sResRef =="nw_wamar001") return "acidarrow005";//normal
|
|
if (sResRef =="wamar003") return "acidarrow006";//exceptional
|
|
//Moderate Acid Bolts
|
|
if (sResRef =="wambo002") return "acidbolt004";//poor
|
|
if (sResRef =="nw_wambo001") return "acidbolt005";//normal
|
|
if (sResRef =="wambo003") return "acidbolt006";//exceptional
|
|
}
|
|
case 16:
|
|
{
|
|
//Strong Acid Arrows
|
|
if (sResRef =="wamar002") return "acidarrow007";//poor
|
|
if (sResRef =="nw_wamar001") return "acidarrow008";//normal
|
|
if (sResRef =="wamar003") return "acidarrow009";//exceptional
|
|
//Strong Acid Bolts
|
|
if (sResRef =="wambo002") return "acidbolt007";//poor
|
|
if (sResRef =="nw_wambo001") return "acidbolt008";//normal
|
|
if (sResRef =="wambo003") return "acidbolt009";//exceptional
|
|
}
|
|
case 17:
|
|
{
|
|
//Very Strong Acid Arrows
|
|
if (sResRef =="wamar002") return "acidarrow010";//poor
|
|
if (sResRef =="nw_wamar001") return "acidarrow011";//normal
|
|
if (sResRef =="wamar003") return "acidarrow012";//exceptional
|
|
//Very Strong Acid Bolts
|
|
if (sResRef =="wambo002") return "acidbolt010";//poor
|
|
if (sResRef =="nw_wambo001") return "acidbolt011";//normal
|
|
if (sResRef =="wambo003") return "acidbolt012";//exceptional
|
|
}
|
|
default:
|
|
{
|
|
return sResRef;
|
|
break;
|
|
}
|
|
}
|
|
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;
|
|
}
|
|
|
|
int GetModifier(string sItemTag)
|
|
{
|
|
if (sItemTag=="WOOD_NORMAL") return 0;
|
|
if (sItemTag=="WOOD_OLIVE") return 25;
|
|
if (sItemTag=="WOOD_WILLOW") return 50;
|
|
if (sItemTag=="WOOD_PINE") return 75;
|
|
if (sItemTag=="WOOD_FIR") return 100;
|
|
if (sItemTag=="WOOD_MANGROVE") return 125;
|
|
if (sItemTag=="WOOD_CHERRY") return 150;
|
|
if (sItemTag=="WOOD_MAPLE") return 175;
|
|
if (sItemTag=="WOOD_ALMOND") return 200;
|
|
if (sItemTag=="WOOD_HICKORY") return 225;
|
|
if (sItemTag=="WOOD_BIRCH") return 300;
|
|
if (sItemTag=="WOOD_ELDER") return 325;
|
|
if (sItemTag=="WOOD_WALNUT") return 350;
|
|
if (sItemTag=="WOOD_ELM") return 375;
|
|
if (sItemTag=="WOOD_MAHOGANY") return 400;
|
|
if (sItemTag=="WOOD_OAK") return 425;
|
|
if (sItemTag=="WOOD_YEW") return 450;
|
|
if (sItemTag=="WOOD_REDWOOD") return 475;
|
|
if (sItemTag=="WOOD_IRONWOOD") return 500;
|
|
return 0;
|
|
}
|