//::///////////////////////////////////////////////
//:: inc_changearmor
//:://////////////////////////////////////////////

#include "x2_inc_itemprop"
#include "x2_inc_craft"

void armorModelNext(int iItemAppr)
{
    object oPC   = GetPCSpeaker();
    object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
    oItem = IPGetModifiedArmor(oItem, iItemAppr, X2_IP_ARMORTYPE_NEXT, TRUE);
    AssignCommand(oPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
}

void armorModelPrev(int iItemAppr)
{
    object oPC   = GetPCSpeaker();
    object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
    oItem = IPGetModifiedArmor(oItem, iItemAppr, X2_IP_ARMORTYPE_PREV, TRUE);
    AssignCommand(oPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
}

void armorModelRobe(int iRobeType)
{
    object oPC   = GetPCSpeaker();
    object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
    object oNewItem = IPCreateAndModifyArmorRobe(oItem, iRobeType);
    DestroyObject(oItem);
    AssignCommand(oPC, ActionEquipItem(oNewItem, INVENTORY_SLOT_CHEST));
}

void weaponModelNext(int iWeaponModel)
{
    object oPC   = GetPCSpeaker();
    object oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
    oItem = IPGetModifiedWeapon(oItem, iWeaponModel, X2_IP_WEAPONTYPE_NEXT, TRUE);
    AssignCommand(oPC, ActionEquipItem(oItem, INVENTORY_SLOT_RIGHTHAND));
}

void weaponModelPrev(int iWeaponModel)
{
    object oPC   = GetPCSpeaker();
    object oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
    oItem = IPGetModifiedWeapon(oItem, iWeaponModel, X2_IP_WEAPONTYPE_PREV, TRUE);
    AssignCommand(oPC, ActionEquipItem(oItem, INVENTORY_SLOT_RIGHTHAND));
}

