public static void EquipItem(Gear item, string msg, bool flag)
//Equip the provided item, If flag is set then we are removing an original piece so must add it to the originalgear list.
//If flag is false then the original piece is already on the list.
{
//Get Current ID of item equiped in Inventory to see what we have equipped
int currentItemId = Helpers.GetIdOfItemInSlot(item.GetInvSlot());
int vyrsID = 0;
int currentItemActorSNO = Helpers.GetActorSNOOfItemInSlot(item.GetInvSlot());
string currentItemName = Helpers.GetItemNameInSlot(item.GetInvSlot());
//Archon Check
if (ZetaDia.Me.ActorClass == ActorClass.Wizard)
{
//Get Dynamical Item ID of Vyrs item for the current Slot
switch (item.GetInvSlot())
{
case InventorySlot.Hands: vyrsID = Helpers.GetIdOfItem(346210); break;
case InventorySlot.Torso: vyrsID = Helpers.GetIdOfItem(332357); break;
case InventorySlot.Legs: vyrsID = Helpers.GetIdOfItem(332360); break;
case InventorySlot.Feet: vyrsID = Helpers.GetIdOfItem(332363); break;
}
//checks if Player is in Archon and gearswap would affect a vyrs item
if (vyrsID != 0 && vyrsID != -999 && vyrsID == currentItemId && ZetaDia.Me.HasBuff(SNOPower.Wizard_Archon))
return;
}
//Check if current item Id is not the same as the one we are trying to equip, if not equip it! (this may not be necessary)
if (currentItemId != item.GetDynamicId())
{
//add current item to the original gear list
if (flag)
{
originalGear.Add(new Gear(item, currentItemActorSNO, currentItemName));
}
WriteToLog(msg);
ZetaDia.Me.Inventory.EquipItem(item.GetDynamicId(), item.GetInvSlot());
Helpers.SetInUse(item.GetCondition());
}
}