//This is the script so far. Im not a scripter so be easy on me. LOL!!
//Works with custom weapons with 7 character tags. Last character needs to be a number.
//This is how i named my weapons.
//Dagger. Tag "dagger1" without quotes.
//Dagger + 1 Tag "dagger2"
//It works with any type of weapon named this way.
void main()
{
object oPC = GetLastOpenedBy(); // Designates the PC
object oPrimary = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC); // Get the weapon the PC is wielding
string sWeapon = GetTag(oPrimary); // Get the Tag of the PC's weapon
string sCheck = GetStringRight(sWeapon, 1); // Gets the last digit of the tag
if (sCheck == "1") //This is the last digit of the equipped weapons tag. If its a match the script runs
{
string s1 = GetStringLeft(sWeapon, 6);// Get 1st 6 characters of the Tag
string s2 = "2";// 2 is the last character of the custom weapons Tag
string sNewWeapon = (s1 + s2);//Adds s1 string and s2 strings together to create new weapon.
CreateItemOnObject(sNewWeapon, OBJECT_SELF, 1); // Puts the new +1 weapon into the chest
ActionTakeItem(oPrimary, oPC); // Take the weapon the PC was weilding
DestroyObject(oPrimary, 0.0); // Instantly destroy the weapon just taken
}
else if (sCheck == "2")
{
string s1 = GetStringLeft(sWeapon, 6);
string s2 = "3";
string sNewWeapon = (s1 + s2);
CreateItemOnObject(sNewWeapon, OBJECT_SELF, 1);
ActionTakeItem(oPrimary, oPC);
DestroyObject(oPrimary, 0.0);
}
else if (sCheck == "3")
{
string s1 = GetStringLeft(sWeapon, 6);
string s2 = "4";
string sNewWeapon = (s1 + s2);
CreateItemOnObject(sNewWeapon, OBJECT_SELF, 1);
ActionTakeItem(oPrimary, oPC);
DestroyObject(oPrimary, 0.0);
}
else if (sCheck == "4")
{
string s1 = GetStringLeft(sWeapon, 6);
string s2 = "5";
string sNewWeapon = (s1 + s2);
CreateItemOnObject(sNewWeapon, OBJECT_SELF, 1);
ActionTakeItem(oPrimary, oPC);
DestroyObject(oPrimary, 0.0);
}
else if (sCheck == "5")
{
string s1 = GetStringLeft(sWeapon, 6);
string s2 = "6";
string sNewWeapon = (s1 + s2);
CreateItemOnObject(sNewWeapon, OBJECT_SELF, 1);
ActionTakeItem(oPrimary, oPC);
DestroyObject(oPrimary, 0.0);
}
else if (sCheck == "6")
{
string s1 = GetStringLeft(sWeapon, 6);
string s2 = "7";
string sNewWeapon = (s1 + s2);
CreateItemOnObject(sNewWeapon, OBJECT_SELF, 1);
ActionTakeItem(oPrimary, oPC);
DestroyObject(oPrimary, 0.0);
}
else if (sCheck == "7")
{
string s1 = GetStringLeft(sWeapon, 6);
string s2 = "8";
string sNewWeapon = (s1 + s2);
CreateItemOnObject(sNewWeapon, OBJECT_SELF, 1);
ActionTakeItem(oPrimary, oPC);
DestroyObject(oPrimary, 0.0);
}
else if (sCheck == "8")
{
string s1 = GetStringLeft(sWeapon, 6);
string s2 = "9";
string sNewWeapon = (s1 + s2);
CreateItemOnObject(sNewWeapon, OBJECT_SELF, 1);
ActionTakeItem(oPrimary, oPC);
DestroyObject(oPrimary, 0.0);
}
}
0 ·
January 14