internal class Anvil : Command
{
public Anvil()
: base("anvil")
{
}
protected override bool Process(Player player, RealmTime time, string[] args)
{
if (args.Length == 2)
{
var num2 = 3;
var num1 = 3;
try
{
int choice1 = int.Parse(args[0]);
switch (choice1)
{
case 1:
num1 += 1;
break;
case 2:
num1 += 2;
break;
case 3:
num1 += 3;
break;
case 4:
num1 += 4;
break;
case 5:
num1 += 5;
break;
case 6:
num1 += 6;
break;
case 7:
num1 += 7;
break;
case 8:
num1 += 8;
break;
default:
player.SendError("Invalid Inventory slot");
player.SendHelp("Slots: 1, 2, 3, 4, 5, 6, 7, 8");
return false;
}
}
catch
{
player.SendError("Error while crafting");
return false;
}
try
{
int choice2 = int.Parse(args[1]);
switch (choice2)
{
case 1:
num2 += 1;
break;
case 2:
num2 += 2;
break;
case 3:
num2 += 3;
break;
case 4:
num2 += 4;
break;
case 5:
num2 += 5;
break;
case 6:
num2 += 6;
break;
case 7:
num2 += 7;
break;
case 8:
num2 += 8;
break;
default:
player.SendError("Invalid Inventory slot");
player.SendHelp("Slots: 1, 2, 3, 4, 5, 6, 7, 8");
return false;
}
}
catch
{
player.SendError("Error while crafting");
return false;
}
if (num1 == num2) { player.SendError("Don't try to cheat the system fool ~ Tpain"); return false; }
else
{
var Hot = player.Inventory[num1];
var Pink = player.Inventory[num2];
int item1 = 0;
int item2 = 0; // If you end up with too many items or you want to overlap recipies then just turn this into a switch and case
if (Hot == player.Manager.GameData.Items[0xa8a]) { item1 = 1; } //Agate
if (Hot == player.Manager.GameData.Items[0xaa2]) { item1 = 2; } //Astral Staff
if (Pink == player.Manager.GameData.Items[0xa8d]) { item2 = 1; } //Blocd Bow Add more items to add more recipies
if (Pink == player.Manager.GameData.Items[0xa87]) { item2 = 2; } //Ancient Warning
if (item1 == item2) //<= Do not bother this but if the player does not have the exact two items requird to craft it then it will fail
{
if (item1 == 0) //if player does not have any of the items then it will fail
{
player.SendError("Don't try to cheat me fool ~Sacha");
return false;
}
if (item1 == 1) //Agate + Blood Bow = Sword of Acclaim
{
Pink = null;
Hot = player.Manager.GameData.Items[0xb0b];
player.SendInfo("Congrats...enjoy your sword hun :*");
}
if (item2 == 2) //Astral Staff + Ancient Warning = Masamune
{
Pink = null;
Hot = player.Manager.GameData.Items[0xc50];
player.SendInfo("Congrats...enjoy your katana hun :*");
}
else { player.SendInfo("Crafting Failed._.'"); return false; }
}
}
return true;
}
else
{
player.SendHelp("Usage: /anvil <Slot1> <slot2>");
player.SendHelp("Slots: 1, 2, 3, 4, 5, 6, 7, 8");
return false;
}
}
}