#include "x2_inc_spellhook" #include "zep_inc_craft" void main() { object oPC = GetEnteringObject(); object oNPC = OBJECT_SELF; object oTreasureSpawn1 = GetNearestObjectByTag("quest1_reward1spawnpoint1", oPC); object oSpawn1; object oCreate1; object oCreate2; object oCreate3; object oAreaSweep1; object oMap = GetItemPossessedBy(oPC, "Quest1Map1"); int iLuckRoll1; int iType1; int iType2; int iType3; int nBaseType; int nMin; int nMax; int iNumber; int iDamageType; int iDamageBonus1; int iDamageBonus2; int iDamageImmunity1; int iDamageVulnerability1; int iWeight1; int iWeight2; int iClass1; int iAbility1; int iSaveType1; int iSR1; int iMaxEnchants; int iMaxPower1; int iMaxPower2; int iMaxPower3; int iRoll; iRoll = -1; int iRoll2; iRoll2 = -1; int iRoll3; iRoll3 = -1; int iRoll4; iRoll4 = -1; int iRoll5; iRoll5 = -1; int iRoll6; iRoll6 = -1; int iRoll7; iRoll7 = -1; int iRoll8; iRoll8 = -1; int iRoll9; iRoll9 = -1; int iRoll10; iRoll10 = -1; int iRoll11; iRoll11 = -1; int iRoll12; iRoll12 = -1; int iRoll13; iRoll13 = -1; int iRoll14; iRoll14 = -1; int iAC; string sMaxPower1; string sArmor; string sAC; itemproperty ip; if (!GetIsObjectValid(GetNearestObjectByTag("Quest1RewardChest1", oPC))) { oSpawn1 = CreateObject(OBJECT_TYPE_PLACEABLE, "quest1rewardc001", GetLocation(oTreasureSpawn1), FALSE, "Quest1RewardChest1"); SetPlotFlag(oSpawn1, TRUE); SetLocked(oSpawn1, FALSE); SetLockKeyRequired(oSpawn1, FALSE); SetLockLockable(oSpawn1, FALSE); } if (GetIsObjectValid(oMap)) { oSpawn1 = GetNearestObjectByTag("Quest1RewardChest1", oTreasureSpawn1); oCreate1 = CreateItemOnObject(GetLocalString(oMap, "Quest1ItemBlueprint1"), oSpawn1); IPRemoveAllItemProperties(oCreate1,DURATION_TYPE_PERMANENT); iAC = GetItemACValue(oCreate1); SetName(oCreate1, GetLocalString(oMap, "Quest1ItemName1")); DestroyObject(oCreate1, 0.5); //--- if (GetBaseItemType(oCreate1) == BASE_ITEM_RING || GetBaseItemType(oCreate1) == BASE_ITEM_AMULET) { //SendMessageToAllDMs("Ring/Amulet on " + GetTag(oNPC) + ""); nBaseType = GetBaseItemType(oCreate1); /*nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType1 = ITEM_APPR_TYPE_SIMPLE_MODEL; iType2 = -1; iType3 = Random(nMax) + nMin; do { iType3 = Random(nMax) + nMin; oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2));*/ oCreate2 = CopyItem(oCreate1, oNPC); oCreate1 = oCreate2; } else if (GetBaseItemType(oCreate1) == BASE_ITEM_GLOVES) { //SendMessageToAllDMs("Gloves on " + GetTag(oNPC) + ""); nBaseType = GetBaseItemType(oCreate1); /*nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType1 = ITEM_APPR_TYPE_SIMPLE_MODEL; iType2 = -1; iType3 = Random(nMax) + nMin; do { iType3 = Random(nMax) + nMin; oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2));*/ oCreate2 = CopyItem(oCreate1, oNPC); oCreate1 = oCreate2; } else if (IPGetIsMeleeWeapon(oCreate1) || GetWeaponRanged(oCreate1)) { //SendMessageToAllDMs("Weapon on " + GetTag(oNPC) + ""); nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType1 = ITEM_APPR_TYPE_WEAPON_MODEL; iType2 = ITEM_APPR_WEAPON_MODEL_TOP; iType3 = Random(nMax) + nMin; do { iType3 = Random(nMax) + nMin; oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_WEAPON_MODEL; iType2 = ITEM_APPR_WEAPON_MODEL_MIDDLE; iType3 = Random(nMax) + nMin; do { iType3 = Random(nMax) + nMin; oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_WEAPON_MODEL; iType2 = ITEM_APPR_WEAPON_MODEL_BOTTOM; iType3 = Random(nMax) + nMin; do { iType3 = Random(nMax) + nMin; oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_WEAPON_COLOR; iType2 = ITEM_APPR_WEAPON_COLOR_TOP; iType3 = Random(4) + 1; do { iType3 = Random(4) + 1; oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_WEAPON_COLOR; iType2 = ITEM_APPR_WEAPON_COLOR_MIDDLE; iType3 = Random(4) + 1; do { iType3 = Random(4) + 1; oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_WEAPON_COLOR; iType2 = ITEM_APPR_WEAPON_COLOR_BOTTOM; iType3 = Random(4) + 1; do { iType3 = Random(4) + 1; oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); if (!GetIsObjectValid(oCreate1)) { DestroyObject(oCreate1, 0.5); } }while (!GetIsObjectValid(oCreate1)); //ip = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_BLUDGEONING, IP_CONST_DAMAGEBONUS_1); //IPSafeAddItemProperty(oCreate1, ip, 0.0f,X2_IP_ADDPROP_POLICY_REPLACE_EXISTING,TRUE,FALSE); } else if (GetBaseItemType(oCreate1) == BASE_ITEM_ARMOR) { //SendMessageToAllDMs("Armor on " + GetTag(oNPC) + ""); nBaseType = GetBaseItemType(oCreate1); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_BELT; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_BELT)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_BELT); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_BELT)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_BELT); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_LBICEP; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LBICEP)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LBICEP); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LBICEP)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LBICEP); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_LFOOT; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LFOOT)); iType3 = Random(IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LFOOT)); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LFOOT)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LFOOT); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_LFOREARM; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LFOREARM)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LFOREARM); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LFOREARM)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LFOREARM); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_LHAND; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LHAND)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LHAND); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LHAND)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LHAND); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_LSHIN; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LSHIN)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LSHIN); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LSHIN)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LSHIN); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_LSHOULDER; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LSHOULDER)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LSHOULDER); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LSHOULDER)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LSHOULDER); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_LTHIGH; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LTHIGH)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LTHIGH); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_LTHIGH)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_LTHIGH); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_NECK; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_NECK)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_NECK); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_NECK)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_NECK); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_PELVIS; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_PELVIS)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_PELVIS); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_PELVIS)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_PELVIS); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_RBICEP; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RBICEP)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RBICEP); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RBICEP)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RBICEP); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_RFOOT; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RFOOT)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RFOOT); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RFOOT)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RFOOT); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_RFOREARM; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RFOREARM)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RFOREARM); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RFOREARM)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RFOREARM); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_RHAND; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RHAND)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RHAND); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RHAND)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RHAND); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_ROBE; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_ROBE)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_ROBE); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_ROBE)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_ROBE); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_RSHIN; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RSHIN)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RSHIN); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RSHIN)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RSHIN); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_RSHOULDER; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RSHOULDER)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RSHOULDER); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RSHOULDER)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RSHOULDER); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_RTHIGH; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RTHIGH)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RTHIGH); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_RTHIGH)); iType3 = IPGetRandomArmorAppearanceType(oCreate1, ITEM_APPR_ARMOR_MODEL_RTHIGH); /*nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin;*/ oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); /* iType1 = ITEM_APPR_TYPE_ARMOR_MODEL; iType2 = ITEM_APPR_ARMOR_MODEL_TORSO; //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_TORSO)); //iType3 = IPGetRandomArmorAppearanceType(oCreate1, Random(100)); nBaseType = GetBaseItemType(oCreate1); nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType)) /10; nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType)) /10; iType3 = Random(nMax) + nMin; do { //iType3 = Random(ZEP_GetNumberOfArmorAppearances(ITEM_APPR_ARMOR_MODEL_TORSO)); //iType3 = IPGetRandomArmorAppearanceType(oCreate1, Random(100)); iType3 = Random(nMax) + nMin; oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2) || GetItemACValue(oCreate2) != iAC); */ iType1 = ITEM_APPR_TYPE_ARMOR_COLOR; iType2 = ITEM_APPR_ARMOR_COLOR_CLOTH1; iType3 = Random(176); do { iType3 = Random(176); oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_ARMOR_COLOR; iType2 = ITEM_APPR_ARMOR_COLOR_CLOTH1; iType3 = Random(176); do { iType3 = Random(176); oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_COLOR; iType2 = ITEM_APPR_ARMOR_COLOR_CLOTH2; iType3 = Random(176); do { iType3 = Random(176); oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_ARMOR_COLOR; iType2 = ITEM_APPR_ARMOR_COLOR_LEATHER1; iType3 = Random(176); do { iType3 = Random(176); oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_COLOR; iType2 = ITEM_APPR_ARMOR_COLOR_LEATHER2; iType3 = Random(176); do { iType3 = Random(176); oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); DestroyObject(oCreate1, 0.5); }while (!GetIsObjectValid(oCreate1)); iType1 = ITEM_APPR_TYPE_ARMOR_COLOR; iType2 = ITEM_APPR_ARMOR_COLOR_METAL1; iType3 = Random(176); do { iType3 = Random(176); oCreate2 = CopyItemAndModify(oCreate1, iType1, iType2, iType3, TRUE); DestroyObject(oCreate2, 0.5); }while (!GetIsObjectValid(oCreate2)); iType1 = ITEM_APPR_TYPE_ARMOR_COLOR; iType2 = ITEM_APPR_ARMOR_COLOR_METAL2; iType3 = Random(176); do { iType3 = Random(176); oCreate1 = CopyItemAndModify(oCreate2, iType1, iType2, iType3, TRUE); if (!GetIsObjectValid(oCreate1)) { DestroyObject(oCreate1, 0.5); } }while (!GetIsObjectValid(oCreate1)); //ip = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_BLUDGEONING, IP_CONST_DAMAGEBONUS_1); //IPSafeAddItemProperty(oCreate1, ip, 0.0f,X2_IP_ADDPROP_POLICY_REPLACE_EXISTING,TRUE,FALSE); } //--- if (GetHitDice(oPC) <= 5) { SetLocalInt(oNPC, "MaxEnchantsOnItem1", 3); iMaxPower1 = d2(1); iMaxPower2 = 2; iMaxPower3 = 2; sMaxPower1 = "1"; } if (GetHitDice(oPC) > 5 && GetHitDice(oPC) <= 10) { SetLocalInt(oNPC, "MaxEnchantsOnItem1", 5); iMaxPower1 = d4(1); iMaxPower2 = 3; iMaxPower3 = 3; sMaxPower1 = "2"; } if (GetHitDice(oPC) > 11 && GetHitDice(oPC) <= 15) { SetLocalInt(oNPC, "MaxEnchantsOnItem1", 7); iMaxPower1 = d6(1); iMaxPower2 = 4; iMaxPower3 = 4; sMaxPower1 = "3"; } if (GetHitDice(oPC) >= 16) { SetLocalInt(oNPC, "MaxEnchantsOnItem1", 9); iMaxPower1 = d8(1); iMaxPower2 = 5; iMaxPower3 = 5; sMaxPower1 = "4"; } //--- iRoll3 = Random(iMaxPower2); while (iRoll3 == 0 || iRoll3 >= iMaxPower2) { iRoll3 = Random(iMaxPower2); } switch (iRoll3) { case 1: iDamageBonus1 = IP_CONST_DAMAGEBONUS_1; break; case 2: iDamageBonus1 = IP_CONST_DAMAGEBONUS_1d4; break; case 3: iDamageBonus1 = IP_CONST_DAMAGEBONUS_1d6; break; case 4: iDamageBonus1 = IP_CONST_DAMAGEBONUS_1d8; break; } //--- iRoll5 = Random(iMaxPower2); while (iRoll5 == 0 || iRoll5 >= iMaxPower2) { iRoll5 = Random(iMaxPower2); } switch (iRoll5) { case 1: iWeight1 = IP_CONST_WEIGHTINCREASE_30_LBS; break; case 2: iWeight1 = IP_CONST_WEIGHTINCREASE_15_LBS; break; case 3: iWeight1 = IP_CONST_WEIGHTINCREASE_10_LBS; break; case 4: iWeight1 = IP_CONST_WEIGHTINCREASE_5_LBS; break; } //--- iRoll6 = Random(iMaxPower2); while (iRoll6 == 0 || iRoll6 >= iMaxPower2) { iRoll6 = Random(iMaxPower2); } switch (iRoll6) { case 1: iWeight2 = IP_CONST_REDUCEDWEIGHT_80_PERCENT; break; case 2: iWeight2 = IP_CONST_REDUCEDWEIGHT_60_PERCENT; break; case 3: iWeight2 = IP_CONST_REDUCEDWEIGHT_40_PERCENT; break; case 4: iWeight2 = IP_CONST_REDUCEDWEIGHT_20_PERCENT; break; } //--- iNumber = 5; iRoll7 = Random(iNumber); while (iRoll7 == 0 || iRoll7 >= iNumber) { iRoll7 = Random(iNumber); } switch (iRoll7) { case 1: iClass1 = IP_CONST_CLASS_BARD; break; case 2: iClass1 = IP_CONST_CLASS_CLERIC; break; case 3: iClass1 = IP_CONST_CLASS_SORCERER; break; case 4: iClass1 = IP_CONST_CLASS_WIZARD; break; } //--- iNumber = 7; iRoll8 = Random(iNumber); while (iRoll8 == 0 || iRoll8 >= iNumber) { iRoll8 = Random(iNumber); } switch (iRoll8) { case 1: iAbility1 = IP_CONST_ABILITY_CHA; break; case 2: iAbility1 = IP_CONST_ABILITY_CON; break; case 3: iAbility1 = IP_CONST_ABILITY_DEX; break; case 4: iAbility1 = IP_CONST_ABILITY_INT; break; case 5: iAbility1 = IP_CONST_ABILITY_STR; break; case 6: iAbility1 = IP_CONST_ABILITY_WIS; break; } //--- iRoll9 = Random(iMaxPower2); while (iRoll9 == 0 || iRoll9 >= iMaxPower2) { iRoll9 = Random(iMaxPower2); } switch (iRoll9) { case 1: iSR1 = IP_CONST_SPELLRESISTANCEBONUS_10; break; case 2: iSR1 = IP_CONST_SPELLRESISTANCEBONUS_12; break; case 3: iSR1 = IP_CONST_SPELLRESISTANCEBONUS_14; break; case 4: iSR1 = IP_CONST_SPELLRESISTANCEBONUS_16; break; } //--- iNumber = 4; iRoll10 = Random(iNumber); while (iRoll10 == 0 || iRoll10 >= iNumber) { iRoll10 = Random(iNumber); } switch (iRoll10) { case 1: iSaveType1 = IP_CONST_SAVEBASETYPE_FORTITUDE; break; case 2: iSaveType1 = IP_CONST_SAVEBASETYPE_REFLEX; break; case 3: iSaveType1 = IP_CONST_SAVEBASETYPE_WILL; break; } //--- iNumber = 8; iRoll11 = Random(iNumber); while (iRoll11 == 0 || iRoll11 >= iNumber) { iRoll11 = Random(iNumber); } switch (iRoll11) { case 1: iDamageVulnerability1 = IP_CONST_DAMAGEVULNERABILITY_5_PERCENT; break; case 2: iDamageVulnerability1 = IP_CONST_DAMAGEVULNERABILITY_10_PERCENT; break; case 3: iDamageVulnerability1 = IP_CONST_DAMAGEVULNERABILITY_25_PERCENT; break; case 4: iDamageVulnerability1 = IP_CONST_DAMAGEVULNERABILITY_50_PERCENT; break; case 5: iDamageVulnerability1 = IP_CONST_DAMAGEVULNERABILITY_75_PERCENT; break; case 6: iDamageVulnerability1 = IP_CONST_DAMAGEVULNERABILITY_90_PERCENT; break; case 7: iDamageVulnerability1 = IP_CONST_DAMAGEVULNERABILITY_100_PERCENT; break; } //--- iNumber = 5; iRoll12 = Random(iNumber); while (iRoll12 == 0 || iRoll12 >= iNumber) { iRoll12 = Random(iNumber); } switch (iRoll12) { case 1: iDamageImmunity1 = IP_CONST_DAMAGEIMMUNITY_5_PERCENT; break; case 2: iDamageImmunity1 = IP_CONST_DAMAGEIMMUNITY_10_PERCENT; break; case 3: iDamageImmunity1 = IP_CONST_DAMAGEIMMUNITY_25_PERCENT; break; case 4: iDamageImmunity1 = IP_CONST_DAMAGEIMMUNITY_50_PERCENT; break; //case 5: //iDamageImmunity1 = IP_CONST_DAMAGEIMMUNITY_75_PERCENT; //break; //case 6: //iDamageImmunity1 = IP_CONST_DAMAGEIMMUNITY_90_PERCENT; //break; //case 7: //iDamageImmunity1 = IP_CONST_DAMAGEIMMUNITY_100_PERCENT; //break; } //--- iRoll4 = Random(iMaxPower3); while (iRoll4 == 0 || iRoll4 >= iMaxPower3) { iRoll4 = Random(iMaxPower3); } switch (iRoll4) { case 1: iDamageBonus2 = 1; break; case 2: iDamageBonus2 = d2(1); break; case 3: iDamageBonus2 = d3(1); break; case 4: iDamageBonus2 = d4(1); break; } //--- iNumber = 15; iRoll2 = Random(iNumber); while (iRoll2 == 0 || iRoll2 >= iNumber) { iRoll2 = Random(iNumber); } switch (iRoll2) { case 1: iDamageType = IP_CONST_DAMAGETYPE_ACID; break; case 2: iDamageType = IP_CONST_DAMAGETYPE_BLUDGEONING; break; case 3: iDamageType = IP_CONST_DAMAGETYPE_COLD; break; case 4: iDamageType = IP_CONST_DAMAGETYPE_DIVINE; break; case 5: iDamageType = IP_CONST_DAMAGETYPE_ELECTRICAL; break; case 6: iDamageType = IP_CONST_DAMAGETYPE_FIRE; break; case 7: iDamageType = IP_CONST_DAMAGETYPE_MAGICAL; break; case 8: iDamageType = IP_CONST_DAMAGETYPE_NEGATIVE; break; case 9: iDamageType = IP_CONST_DAMAGETYPE_PHYSICAL; break; case 10: iDamageType = IP_CONST_DAMAGETYPE_PIERCING; break; case 11: iDamageType = IP_CONST_DAMAGETYPE_POSITIVE; break; case 12: iDamageType = IP_CONST_DAMAGETYPE_SLASHING; break; case 13: iDamageType = IP_CONST_DAMAGETYPE_SONIC; break; case 14: iDamageType = IP_CONST_DAMAGETYPE_SUBDUAL; break; } //--- if (d100(1) >= 80 && GetLocalInt(oNPC, "MaxEnchantsOnItem1") != 0) { if (IPGetIsMeleeWeapon(oCreate1) || GetBaseItemType(oCreate1) == BASE_ITEM_GLOVES) { ip = ItemPropertyDamageBonus(iDamageType, iDamageBonus1); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (IPGetIsRangedWeapon(oCreate1)) { ip = ItemPropertyMaxRangeStrengthMod(iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (GetBaseItemType(oCreate1) == BASE_ITEM_ARMOR || GetBaseItemType(oCreate1) == BASE_ITEM_AMULET || GetBaseItemType(oCreate1) == BASE_ITEM_RING) { ip = ItemPropertyACBonus(iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } SetLocalInt(oNPC, "MaxEnchantsOnItem1", GetLocalInt(oNPC, "MaxEnchantsOnItem1") - 1); } //--- if (d100(1) >= 80 && GetLocalInt(oNPC, "MaxEnchantsOnItem1") != 0) { if (IPGetIsMeleeWeapon(oCreate1) || GetBaseItemType(oCreate1) == BASE_ITEM_GLOVES) { ip = ItemPropertyAttackBonus(iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (IPGetIsRangedWeapon(oCreate1)) { ip = ItemPropertyAttackBonus(iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (GetBaseItemType(oCreate1) == BASE_ITEM_ARMOR || GetBaseItemType(oCreate1) == BASE_ITEM_AMULET || GetBaseItemType(oCreate1) == BASE_ITEM_RING) { ip = ItemPropertyBonusSavingThrow(iSaveType1, iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } SetLocalInt(oNPC, "MaxEnchantsOnItem1", GetLocalInt(oNPC, "MaxEnchantsOnItem1") - 1); } //--- if (d100(1) >= 90) { if (IPGetIsMeleeWeapon(oCreate1) || GetBaseItemType(oCreate1) == BASE_ITEM_GLOVES) { ip = ItemPropertyDamagePenalty(Random(5) + 1); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (IPGetIsRangedWeapon(oCreate1)) { ip = ItemPropertyAttackPenalty(iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (GetBaseItemType(oCreate1) == BASE_ITEM_ARMOR || GetBaseItemType(oCreate1) == BASE_ITEM_AMULET || GetBaseItemType(oCreate1) == BASE_ITEM_RING) { ip = ItemPropertyDecreaseAC(IP_CONST_ACMODIFIERTYPE_ARMOR, iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } } //--- if (d100(1) >= 90) { if (IPGetIsMeleeWeapon(oCreate1) || GetBaseItemType(oCreate1) == BASE_ITEM_GLOVES) { ip = ItemPropertyEnhancementPenalty(iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (IPGetIsRangedWeapon(oCreate1) || GetBaseItemType(oCreate1) == BASE_ITEM_AMULET || GetBaseItemType(oCreate1) == BASE_ITEM_RING) { ip = ItemPropertyDecreaseAC(IP_CONST_ACMODIFIERTYPE_DEFLECTION, iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (GetBaseItemType(oCreate1) == BASE_ITEM_ARMOR || GetBaseItemType(oCreate1) == BASE_ITEM_AMULET || GetBaseItemType(oCreate1) == BASE_ITEM_RING) { ip = ItemPropertyDamageVulnerability(iDamageType, iDamageVulnerability1); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } } //--- if (d100(1) >= 80 && GetLocalInt(oNPC, "MaxEnchantsOnItem1") != 0) { if (IPGetIsMeleeWeapon(oCreate1) || GetBaseItemType(oCreate1) == BASE_ITEM_GLOVES) { ip = ItemPropertyMassiveCritical(iDamageBonus1); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (IPGetIsRangedWeapon(oCreate1)) { ip = ItemPropertyMassiveCritical(iDamageBonus1); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (GetBaseItemType(oCreate1) == BASE_ITEM_ARMOR || GetBaseItemType(oCreate1) == BASE_ITEM_AMULET || GetBaseItemType(oCreate1) == BASE_ITEM_RING) { ip = ItemPropertyDamageImmunity(iDamageType, iDamageImmunity1); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } SetLocalInt(oNPC, "MaxEnchantsOnItem1", GetLocalInt(oNPC, "MaxEnchantsOnItem1") - 1); } //--- if (d100(1) >= 90) { if (IPGetIsMeleeWeapon(oCreate1) || GetBaseItemType(oCreate1) == BASE_ITEM_GLOVES) { ip = ItemPropertyNoDamage(); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (IPGetIsRangedWeapon(oCreate1)) { ip = ItemPropertyNoDamage(); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (GetBaseItemType(oCreate1) == BASE_ITEM_ARMOR || GetBaseItemType(oCreate1) == BASE_ITEM_AMULET || GetBaseItemType(oCreate1) == BASE_ITEM_RING) { ip = ItemPropertyReducedSavingThrow(iSaveType1, iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } } //--- if (d100(1) >= 90) { ip = ItemPropertyWeightIncrease(iWeight1); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } //--- if (d100(1) >= 80 && GetLocalInt(oNPC, "MaxEnchantsOnItem1") != 0) { ip = ItemPropertyWeightReduction(iWeight2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); SetLocalInt(oNPC, "MaxEnchantsOnItem1", GetLocalInt(oNPC, "MaxEnchantsOnItem1") - 1); } //--- if (d100(1) >= 90 && GetLocalInt(oNPC, "MaxEnchantsOnItem1") != 0) { if (IPGetIsMeleeWeapon(oCreate1) || GetBaseItemType(oCreate1) == BASE_ITEM_GLOVES) { ip = ItemPropertyVampiricRegeneration(iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (IPGetIsRangedWeapon(oCreate1)) { } if (GetBaseItemType(oCreate1) == BASE_ITEM_ARMOR) { ip = ItemPropertyRegeneration(1); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } SetLocalInt(oNPC, "MaxEnchantsOnItem1", GetLocalInt(oNPC, "MaxEnchantsOnItem1") - 1); } //--- if (d100(1) >= 80 && GetLocalInt(oNPC, "MaxEnchantsOnItem1") != 0) { ip = ItemPropertyBonusLevelSpell(iClass1, iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); SetLocalInt(oNPC, "MaxEnchantsOnItem1", GetLocalInt(oNPC, "MaxEnchantsOnItem1") - 1); } //--- if (d100(1) >= 90 && GetLocalInt(oNPC, "MaxEnchantsOnItem1") != 0) { ip = ItemPropertyAbilityBonus(iAbility1, iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); SetLocalInt(oNPC, "MaxEnchantsOnItem1", GetLocalInt(oNPC, "MaxEnchantsOnItem1") - 1); } //--- if (d100(1) >= 80 && GetLocalInt(oNPC, "MaxEnchantsOnItem1") != 0) { ip = ItemPropertyBonusSpellResistance(iSR1); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); SetLocalInt(oNPC, "MaxEnchantsOnItem1", GetLocalInt(oNPC, "MaxEnchantsOnItem1") - 1); } //--- if (d100(1) >= 96 && GetLocalInt(oNPC, "MaxEnchantsOnItem1") != 0) { if (IPGetIsMeleeWeapon(oCreate1) || GetBaseItemType(oCreate1) == BASE_ITEM_GLOVES) { ip = ItemPropertyEnhancementBonus(iDamageBonus2); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (IPGetIsRangedWeapon(oCreate1)) { ip = ItemPropertyUnlimitedAmmo(IP_CONST_UNLIMITEDAMMO_BASIC); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } if (GetBaseItemType(oCreate1) == BASE_ITEM_ARMOR) { ip = ItemPropertyRegeneration(1); IPSafeAddItemProperty(oCreate1, ip, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, FALSE); } SetLocalInt(oNPC, "MaxEnchantsOnItem1", GetLocalInt(oNPC, "MaxEnchantsOnItem1") - 1); } //--- iLuckRoll1 = Random(6) + 1; switch (iLuckRoll1) { case 1: if (GetIsObjectValid(oMap)) { DestroyObject(oCreate1); DestroyObject(oSpawn1); oAreaSweep1 = GetFirstObjectInArea(oNPC); while (GetIsObjectValid(oAreaSweep1)) { if (GetName(oAreaSweep1) == "Remains") { DelayCommand(2.0, DestroyObject(oAreaSweep1)); } oAreaSweep1 = GetNextObjectInArea(oNPC); } DelayCommand(10.0, FloatingTextStringOnCreature("There is nothing here, this map hasn't leaded you to the stash.", oPC, TRUE)); } break; case 2: SetName(oCreate1, "Old " + GetLocalString(oMap, "Quest1ItemTypeName1") + ""); IPRemoveAllItemProperties(oCreate1,DURATION_TYPE_PERMANENT); break; case 3: break; case 4: break; case 5: break; case 6: break; } int iTreasureNumber1; if (iLuckRoll1 != 1) { CreateItemOnObject("nw_it_gold001", oSpawn1, Random(301)); if (d100(1)>70) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>70) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>70) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } if (d100(1)>75) { iTreasureNumber1 = Random (237) + 1; CreateItemOnObject("treasure_" + IntToString(iTreasureNumber1) + "", oSpawn1, 1); } } DestroyObject(oMap); } }