//:://///////////////////////////////////////////// //:: Tailoring - Items Include File //:: tlr_items_inc.nss //:: //::////////////////////////////////////////////// /* Includes functions for scrolling through and recoloring equipped items */ //::////////////////////////////////////////////// //:: Created By: Stacy L. Ropella //:: Created On: January 28, 2006 //:: Edited by 420 for CEP where indicated //::////////////////////////////////////////////// const int PART_NEXT = 0; const int PART_PREV = 1; const int COLOR_NEXT = 3; const int COLOR_PREV = 4; const int HELMET = 8888; const int SHIELD = 8889; int GetIsShieldInvalid(int nCurrApp, int nBaseType); int GetIsWeaponInvalid(int nCurrApp, int nBaseType, int nPart); //Cloak crafting added for CEP void RemakeCloak(object oNPC, object oItem, int nMode) { int nCurrApp, nSlot; object oNew; nCurrApp = GetItemAppearance(oItem, ITEM_APPR_TYPE_SIMPLE_MODEL, 0); int nMin = 1; int nMax = 99; do { if (nMode == PART_NEXT) { if (++nCurrApp>nMax) nCurrApp = nMin; } else { if (--nCurrApp nMax) nCurrApp = nMin; } else { if (--nCurrApp < nMin) nCurrApp = nMax; } while(GetIsShieldInvalid(nCurrApp, nBaseType)) { if (nMode == PART_NEXT) nCurrApp++; else nCurrApp--; } oNew = CopyItemAndModify(oItem, ITEM_APPR_TYPE_SIMPLE_MODEL, 0, nCurrApp, TRUE); } while (!GetIsObjectValid(oNew)); nSlot = INVENTORY_SLOT_LEFTHAND; if (GetIsObjectValid(oNew)) { DestroyObject(oItem); AssignCommand(oNPC, ClearAllActions(TRUE)); AssignCommand(oNPC, ActionEquipItem(oNew, nSlot)); } object oPC = GetPCSpeaker(); SendMessageToPC(oPC, "New Appearance: " + IntToString(nCurrApp)); } void RemakeHelm(object oModel, object oItem, int nMode) { int nCurrApp, nSlot; object oNew; nCurrApp = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, 0); int nMin = 1; int nMax = StringToInt(Get2DAString("baseitems", "MaxRange", BASE_ITEM_HELMET)); do { if (nMode == PART_NEXT) { if (++nCurrApp>nMax) nCurrApp = nMin; } else { if (--nCurrAppnMax) nCurrApp = nMin; } else { if (--nCurrAppnMax) nCurrApp = nMin; } else { if (--nCurrApp= 1 && nBaseType <= 5) return TRUE; To Find the Numbers to Restrict: Shields: Edit a small, large, and tower shield in the toolset and mark which shield model numbers are missing for each shield type. Also note down any shield model number you do not want players to be able to use, and put the unwanted numbers into the above format in the GetIsShieldInvalid function. Weapons: Follow the above method for weapons to determine which model numbers you don't want to allow. */ int GetIsShieldInvalid(int nCurrApp, int nBaseType) { // shield code modified 22/AUG/2006 by SJGL // Edited by 420 for CEP 2.x to use cepshieldmodel.2da //////////////////////////////////////////////////////////////// // Small Shields //////////////////////////////////////////////////////////////// if(nBaseType == BASE_ITEM_SMALLSHIELD) { /* Place restricted numbers here and uncomment as neccessary switch(nCurrApp) { case 1: case 53: case 42: return TRUE; } if( nCurrApp >= 1 && nCurrApp <= 5) return TRUE; */ if(Get2DAString("cepshieldmodel", "BASE_ITEM_SMALLSHIELD", nCurrApp) == "") return TRUE; return FALSE; } //////////////////////////////////////////////////////////////// // Large Shields //////////////////////////////////////////////////////////////// if(nBaseType == BASE_ITEM_LARGESHIELD) { /* Place restricted numbers here and uncomment as neccessary switch(nCurrApp) { case 1: case 53: case 42: return TRUE; } if( nCurrApp >= 1 && nCurrApp <= 5) return TRUE; */ if(Get2DAString("cepshieldmodel", "BASE_ITEM_LARGESHIELD", nCurrApp) == "") return TRUE; return FALSE; } //////////////////////////////////////////////////////////////// // Tower Shields //////////////////////////////////////////////////////////////// if(nBaseType == BASE_ITEM_TOWERSHIELD) { /* Place restricted numbers here and uncomment as neccessary //To restrict individual numbers, replace # //with the number to restrict switch(nCurrApp) { case #: case #: case #: return TRUE; } //To restrict individual numbers, replace # //with the lowest and highest number to restrict (inclusive) if(nCurrApp >= # && nCurrApp <= #) return TRUE; */ if(Get2DAString("cepshieldmodel", "BASE_ITEM_TOWERSHIELD", nCurrApp) == "") return TRUE; return FALSE; } return FALSE; } int GetIsWeaponInvalid(int nCurrApp, int nBaseType, int nPart) { /* // Uncomment and fill out as neccessary. Change **** to the base item // type you are wanting to disallow models from. You can type // "BASE_ITEM_" in the filter to the right, and click the Constants button // to see a list. For example: BASE_ITEM_DAGGER, BASE_ITEM_CLUB, etc. // Copy and paste the below template if you are wanting to restrict models // from more than one item type. //Weapon Top Restrictions if(nPart == ITEM_APPR_WEAPON_MODEL_TOP) { if(nBaseType == BASE_ITEM_****) { //To restrict individual numbers, replace # //with the number to restrict switch(nCurrApp) { case #: case #: case #: return TRUE; } //To restrict individual numbers, replace # //with the lowest and highest number to restrict (inclusive) if(nCurrApp >= # && nCurrApp <= #) return TRUE; } } //Weapon Middle Restrictions if(nPart == ITEM_APPR_WEAPON_MODEL_MIDDLE) { if(nBaseType == BASE_ITEM_****) { //To restrict individual numbers, replace # //with the number to restrict switch(nCurrApp) { case #: case #: case #: return TRUE; } //To restrict individual numbers, replace # //with the lowest and highest number to restrict (inclusive) if(nCurrApp >= # && nCurrApp <= #) return TRUE; } } //Weapon Bottom Restrictions if(nPart == ITEM_APPR_WEAPON_MODEL_BOTTOM) { if(nBaseType == BASE_ITEM_****) { //To restrict individual numbers, replace # //with the number to restrict switch(nCurrApp) { case #: case #: case #: return TRUE; } //To restrict individual numbers, replace # //with the lowest and highest number to restrict (inclusive) if(nCurrApp >= # && nCurrApp <= #) return TRUE; } } */ return FALSE; }