REO-EE/_module/nss/lcs_clk_include.nss
Jaysyn904 f82740bbbd Initial commit
Initial commit
2024-02-22 13:22:03 -05:00

210 lines
6.3 KiB
Plaintext

//:://////////////////////////////////////////////
//:: Created By: Cuprius
//:: Created On: 2/17/08
//:: Based on similar original LCS scripts by Lilista
//:://////////////////////////////////////////////
#include "lcs_settings"
int lcs_GetNextValidColor(object oItem, int nPart)
{
int nAppearance = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_COLOR, nPart);
if(nAppearance >= 63)
{
nAppearance = 0;
}
else
{
nAppearance = nAppearance + 1;
}
return nAppearance;
}
int lcs_GetPreviousValidColor(object oItem, int nPart)
{
int nAppearance = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_COLOR, nPart);
if(nAppearance <= 0)
{
nAppearance = 63;
}
else
{
nAppearance = nAppearance - 1;
}
return nAppearance;
}
void lcs_ModifyColorandEquipNewCloak(object oItem, int nPart, int nAppearance)
{
object oPC = GetItemPossessor(oItem);
object oNewItem = CopyItemAndModify(oItem, ITEM_APPR_TYPE_ARMOR_COLOR, nPart, nAppearance);
DestroyObject(oItem);
SetCommandable(TRUE, oPC);
AssignCommand(oPC, ActionEquipItem(oNewItem, INVENTORY_SLOT_CLOAK));
}
int lcs_GetNextValidCloakModel(object oItem)
{
int nAppearance = GetItemAppearance(oItem, ITEM_APPR_TYPE_SIMPLE_MODEL, 0);
int nHidewing = StringToInt(Get2DAString("cloakmodel", "HIDEWING", nAppearance));
if (nHidewing == 1)
{
if (nLCSCloak2daRowNoWingsMax3 > 0 && nAppearance >= nLCSCloak2daRowNoWingsMax3)
{
nAppearance = nLCSCloak2daRowNoWingsMin1;
}
else if (nLCSCloak2daRowNoWingsMin3 > 0 && nAppearance >= nLCSCloak2daRowNoWingsMin3)
{
nAppearance = nAppearance + 1;
}
else if (nLCSCloak2daRowNoWingsMax2 > 0 && nAppearance >= nLCSCloak2daRowNoWingsMax2)
{
if (nLCSCloak2daRowNoWingsMin3 > 0) nAppearance = nLCSCloak2daRowNoWingsMin3;
else nAppearance = nLCSCloak2daRowNoWingsMin1;
}
else if (nLCSCloak2daRowNoWingsMin2 > 0 && nAppearance >= nLCSCloak2daRowNoWingsMin2)
{
nAppearance = nAppearance + 1;
}
else if (nAppearance >= nLCSCloak2daRowNoWingsMax1)
{
if (nLCSCloak2daRowNoWingsMin2 > 0) nAppearance = nLCSCloak2daRowNoWingsMin2;
else nAppearance = nLCSCloak2daRowNoWingsMin1;
}
else
{
nAppearance = nAppearance + 1;
}
}
else // nHidewing == 0
{
if (nLCSCloak2daRowWingsMax3 > 0 && nAppearance >= nLCSCloak2daRowWingsMax3)
{
nAppearance = nLCSCloak2daRowWingsMin1;
}
else if (nLCSCloak2daRowWingsMin3 > 0 && nAppearance >= nLCSCloak2daRowWingsMin3)
{
nAppearance = nAppearance + 1;
}
else if (nLCSCloak2daRowWingsMax2 > 0 && nAppearance >= nLCSCloak2daRowWingsMax2)
{
if (nLCSCloak2daRowWingsMin3 > 0) nAppearance = nLCSCloak2daRowWingsMin3;
else nAppearance = nLCSCloak2daRowWingsMin1;
}
else if (nLCSCloak2daRowWingsMin2 > 0 && nAppearance >= nLCSCloak2daRowWingsMin2)
{
nAppearance = nAppearance + 1;
}
else if (nAppearance >= nLCSCloak2daRowWingsMax1)
{
if (nLCSCloak2daRowWingsMin2 > 0) nAppearance = nLCSCloak2daRowWingsMin2;
else nAppearance = nLCSCloak2daRowWingsMin1;
}
else
{
nAppearance = nAppearance + 1;
}
}
string sCloakModel = Get2DAString("cloakmodel", "LABEL", nAppearance);
while (sCloakModel == "")
{
nAppearance = nAppearance + 1;
sCloakModel = Get2DAString("cloakmodel", "LABEL", nAppearance);
}
return nAppearance;
}
int lcs_GetPreviousValidCloakModel(object oItem)
{
int nAppearance = GetItemAppearance(oItem, ITEM_APPR_TYPE_SIMPLE_MODEL, 0);
int nHidewing = StringToInt(Get2DAString("cloakmodel", "HIDEWING", nAppearance));
if (nHidewing == 1)
{
if (nAppearance <= nLCSCloak2daRowNoWingsMin1)
{
if (nLCSCloak2daRowNoWingsMax3 > 0) nAppearance = nLCSCloak2daRowNoWingsMax3;
else if (nLCSCloak2daRowNoWingsMax2 > 0) nAppearance = nLCSCloak2daRowNoWingsMax2;
else nAppearance = nLCSCloak2daRowNoWingsMax1;
}
else if (nAppearance <= nLCSCloak2daRowNoWingsMax1)
{
nAppearance = nAppearance - 1;
}
else if (nLCSCloak2daRowNoWingsMin2 > 0 && nAppearance <= nLCSCloak2daRowNoWingsMin2)
{
nAppearance = nLCSCloak2daRowNoWingsMax1;
}
else if (nLCSCloak2daRowNoWingsMax2 > 0 && nAppearance <= nLCSCloak2daRowNoWingsMax2)
{
nAppearance = nAppearance - 1;
}
else if (nLCSCloak2daRowNoWingsMin3 > 0 && nAppearance <= nLCSCloak2daRowNoWingsMin3)
{
if (nLCSCloak2daRowNoWingsMax2 > 0) nAppearance = nLCSCloak2daRowNoWingsMax2;
else nAppearance = nLCSCloak2daRowNoWingsMax1;
}
else if (nLCSCloak2daRowNoWingsMax3 > 0 && nAppearance <= nLCSCloak2daRowNoWingsMax3)
{
nAppearance = nAppearance - 1;
}
else
{
nAppearance = nLCSCloak2daRowNoWingsMax1;
}
}
else // nHidewing == 0
{
if (nAppearance <= nLCSCloak2daRowWingsMin1)
{
if (nLCSCloak2daRowWingsMax3 > 0) nAppearance = nLCSCloak2daRowWingsMax3;
else if (nLCSCloak2daRowWingsMax2 > 0) nAppearance = nLCSCloak2daRowWingsMax2;
else nAppearance = nLCSCloak2daRowWingsMax1;
}
else if (nAppearance <= nLCSCloak2daRowWingsMax1)
{
nAppearance = nAppearance - 1;
}
else if (nLCSCloak2daRowWingsMin2 > 0 && nAppearance <= nLCSCloak2daRowWingsMin2)
{
nAppearance = nLCSCloak2daRowWingsMax1;
}
else if (nLCSCloak2daRowWingsMax2 > 0 && nAppearance <= nLCSCloak2daRowWingsMax2)
{
nAppearance = nAppearance - 1;
}
else if (nLCSCloak2daRowWingsMin3 > 0 && nAppearance <= nLCSCloak2daRowWingsMin3)
{
if (nLCSCloak2daRowWingsMax2 > 0) nAppearance = nLCSCloak2daRowWingsMax2;
else nAppearance = nLCSCloak2daRowWingsMax1;
}
else if (nLCSCloak2daRowWingsMax3 > 0 && nAppearance <= nLCSCloak2daRowWingsMax3)
{
nAppearance = nAppearance - 1;
}
else
{
nAppearance = nLCSCloak2daRowWingsMax1;
}
}
string sCloakModel = Get2DAString("cloakmodel", "LABEL", nAppearance);
while (sCloakModel == "")
{
nAppearance = nAppearance - 1;
sCloakModel = Get2DAString("cloakmodel", "LABEL", nAppearance);
}
return nAppearance;
}
void lcs_ModifyandEquipNewCloak(object oItem, int nAppearance)
{
object oPC = GetItemPossessor(oItem);
object oNewItem = CopyItemAndModify(oItem, ITEM_APPR_TYPE_SIMPLE_MODEL, 0, nAppearance);
DestroyObject(oItem);
SetCommandable(TRUE, oPC);
AssignCommand(oPC, ActionEquipItem(oNewItem, INVENTORY_SLOT_CLOAK));
}