130 lines
6.8 KiB
Plaintext
130 lines
6.8 KiB
Plaintext
// This is the ASG Custom Inlcude
|
|
// int FindItemLevel(object oItem);
|
|
|
|
int FindItemLevel(object oItem)
|
|
{
|
|
int iGoldValue;
|
|
int iBaseType;
|
|
// Scroll & Potion Level
|
|
// Load Values
|
|
// ** Store Item Level Restrictions
|
|
int iLevel_1 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_1");
|
|
int iLevel_2 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_2");
|
|
int iLevel_3 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_3");
|
|
int iLevel_4 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_4");
|
|
int iLevel_5 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_5");
|
|
int iLevel_6 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_6");
|
|
int iLevel_7 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_7");
|
|
int iLevel_8 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_8");
|
|
int iLevel_9 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_9");
|
|
int iLevel_10 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_10");
|
|
int iLevel_11 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_11");
|
|
int iLevel_12 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_12");
|
|
int iLevel_13 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_13");
|
|
int iLevel_14 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_14");
|
|
int iLevel_15 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_15");
|
|
int iLevel_16 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_16");
|
|
int iLevel_17 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_17");
|
|
int iLevel_18 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_18");
|
|
int iLevel_19 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_19");
|
|
int iLevel_20 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_20");
|
|
int iLevel_Plus = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_Plus");
|
|
// Set Potion & Scroll Level Restrictions
|
|
int iLevel_p1 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p1");
|
|
int iLevel_p2 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p2");
|
|
int iLevel_p3 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p3");
|
|
int iLevel_p4 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p4");
|
|
int iLevel_p5 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p5");
|
|
int iLevel_p6 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p6");
|
|
int iLevel_p7 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p7");
|
|
int iLevel_p8 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p8");
|
|
int iLevel_p9 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p9");
|
|
int iLevel_p10 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p10");
|
|
int iLevel_p11 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p11");
|
|
int iLevel_p12 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p12");
|
|
int iLevel_p13 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p13");
|
|
int iLevel_p14 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p14");
|
|
int iLevel_p15 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p15");
|
|
int iLevel_p16 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p16");
|
|
int iLevel_p17 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p17");
|
|
int iLevel_p18 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p18");
|
|
int iLevel_p19 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p19");
|
|
int iLevel_p20 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p20");
|
|
int iLevel_pPlus = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_pPlus");
|
|
|
|
int nIDd = GetIdentified(oItem);
|
|
if(nIDd == FALSE)
|
|
{
|
|
SetIdentified(oItem, TRUE);
|
|
iGoldValue = GetGoldPieceValue(oItem);
|
|
SetIdentified(oItem, FALSE);
|
|
} else {
|
|
iGoldValue = GetGoldPieceValue(oItem);
|
|
}
|
|
iBaseType = GetBaseItemType(oItem);
|
|
if (iBaseType == BASE_ITEM_POTIONS || iBaseType == BASE_ITEM_SPELLSCROLL || iBaseType == BASE_ITEM_SCROLL)
|
|
{
|
|
if(iGoldValue <= iLevel_p1) return 1;
|
|
if(iGoldValue > iLevel_p1 && iGoldValue <= iLevel_p2) return 2;
|
|
if(iGoldValue > iLevel_p2 && iGoldValue <= iLevel_p3) return 3;
|
|
if(iGoldValue > iLevel_p3 && iGoldValue <= iLevel_p4) return 4;
|
|
if(iGoldValue > iLevel_p4 && iGoldValue <= iLevel_p5) return 5;
|
|
if(iGoldValue > iLevel_p5 && iGoldValue <= iLevel_p6) return 6;
|
|
if(iGoldValue > iLevel_p6 && iGoldValue <= iLevel_p7) return 7;
|
|
if(iGoldValue > iLevel_p7 && iGoldValue <= iLevel_p8) return 8;
|
|
if(iGoldValue > iLevel_p8 && iGoldValue <= iLevel_p9) return 9;
|
|
if(iGoldValue > iLevel_p9 && iGoldValue <= iLevel_p10) return 10;
|
|
if(iGoldValue > iLevel_p10 && iGoldValue <= iLevel_p11) return 11;
|
|
if(iGoldValue > iLevel_p11 && iGoldValue <= iLevel_p12) return 12;
|
|
if(iGoldValue > iLevel_p12 && iGoldValue <= iLevel_p13) return 13;
|
|
if(iGoldValue > iLevel_p13 && iGoldValue <= iLevel_p14) return 14;
|
|
if(iGoldValue > iLevel_p14 && iGoldValue <= iLevel_p15) return 15;
|
|
if(iGoldValue > iLevel_p15 && iGoldValue <= iLevel_p16) return 16;
|
|
if(iGoldValue > iLevel_p16 && iGoldValue <= iLevel_p17) return 17;
|
|
if(iGoldValue > iLevel_p17 && iGoldValue <= iLevel_p18) return 18;
|
|
if(iGoldValue > iLevel_p18 && iGoldValue <= iLevel_p19) return 19;
|
|
if(iGoldValue > iLevel_p19 && iGoldValue <= iLevel_p20) return 20;
|
|
if(iGoldValue > iLevel_p20)
|
|
{
|
|
iGoldValue=iGoldValue-iLevel_p20;
|
|
iGoldValue=iGoldValue/iLevel_pPlus;
|
|
iGoldValue+=20;
|
|
return iGoldValue;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(iGoldValue <= iLevel_1) return 1;
|
|
if(iGoldValue > iLevel_1 && iGoldValue <= iLevel_2) return 2;
|
|
if(iGoldValue > iLevel_2 && iGoldValue <= iLevel_3) return 3;
|
|
if(iGoldValue > iLevel_3 && iGoldValue <= iLevel_4) return 4;
|
|
if(iGoldValue > iLevel_4 && iGoldValue <= iLevel_5) return 5;
|
|
if(iGoldValue > iLevel_5 && iGoldValue <= iLevel_6) return 6;
|
|
if(iGoldValue > iLevel_6 && iGoldValue <= iLevel_7) return 7;
|
|
if(iGoldValue > iLevel_7 && iGoldValue <= iLevel_8) return 8;
|
|
if(iGoldValue > iLevel_8 && iGoldValue <= iLevel_9) return 9;
|
|
if(iGoldValue > iLevel_9 && iGoldValue <= iLevel_10) return 10;
|
|
if(iGoldValue > iLevel_10 && iGoldValue <= iLevel_11) return 11;
|
|
if(iGoldValue > iLevel_11 && iGoldValue <= iLevel_12) return 12;
|
|
if(iGoldValue > iLevel_12 && iGoldValue <= iLevel_13) return 13;
|
|
if(iGoldValue > iLevel_13 && iGoldValue <= iLevel_14) return 14;
|
|
if(iGoldValue > iLevel_14 && iGoldValue <= iLevel_15) return 15;
|
|
if(iGoldValue > iLevel_15 && iGoldValue <= iLevel_16) return 16;
|
|
if(iGoldValue > iLevel_16 && iGoldValue <= iLevel_17) return 17;
|
|
if(iGoldValue > iLevel_17 && iGoldValue <= iLevel_18) return 18;
|
|
if(iGoldValue > iLevel_18 && iGoldValue <= iLevel_19) return 19;
|
|
if(iGoldValue > iLevel_19 && iGoldValue <= iLevel_20) return 20;
|
|
if(iGoldValue > iLevel_20)
|
|
{
|
|
iGoldValue=iGoldValue-iLevel_20;
|
|
iGoldValue=iGoldValue/iLevel_Plus;
|
|
iGoldValue+=20;
|
|
return iGoldValue;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|