Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
43 lines
1.7 KiB
Plaintext
43 lines
1.7 KiB
Plaintext
#include "stx_inc_craft"
|
|
|
|
int StartingConditional() {
|
|
object oPC = GetPCSpeaker();
|
|
if (!GetHasSkill(SKILL_CRAFT_ARMOR, oPC))
|
|
return TRUE;
|
|
|
|
object oArmor = GetItemInSlot(INVENTORY_SLOT_HEAD, oPC);
|
|
if (!GetIsObjectValid(oArmor) || GetPlotFlag(oArmor)) {
|
|
oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
|
|
if (!GetIsObjectValid(oArmor) || GetPlotFlag(oArmor))
|
|
return TRUE;
|
|
}
|
|
|
|
if (GetIsDM(oPC)) return FALSE;
|
|
|
|
int iAC = StringToInt(Get2DAString("parts_chest", "ACBONUS", GetItemAppearance(oArmor, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO)));
|
|
object oNPC = GetLocalObject(oPC, "STX_CR_NPC");
|
|
if (GetIsObjectValid(oNPC)) {
|
|
string sRequiredNPC;
|
|
|
|
if (iAC>=0 && iAC<=3) sRequiredNPC = STX_CR_TAILOR_NPC;
|
|
if (iAC>=4 && iAC<=8) sRequiredNPC = STX_CR_SMITH_NPC;
|
|
if (GetBaseItemType(oArmor)==BASE_ITEM_HELMET) sRequiredNPC = STX_CR_SMITH_NPC;
|
|
if (GetTag(oNPC) != sRequiredNPC)
|
|
return TRUE;
|
|
|
|
} else if (STX_CR_REQUIRE_PLACEABLE) {
|
|
string sRequiredPlaceable;
|
|
|
|
if (iAC==0) sRequiredPlaceable = STX_CR_CLOTH_PLACEABLE;
|
|
if (iAC>=1 && iAC<=3) sRequiredPlaceable = STX_CR_LEATHER_PLACEABLE;
|
|
if (iAC>=4 && iAC<=8) sRequiredPlaceable = STX_CR_METAL_PLACEABLE;
|
|
if (GetBaseItemType(oArmor)==BASE_ITEM_HELMET) sRequiredPlaceable = STX_CR_METAL_PLACEABLE;
|
|
object oRequiredPlaceable = GetNearestObjectByTag(sRequiredPlaceable, oPC);
|
|
|
|
if (GetArea(oPC) != GetArea(oRequiredPlaceable) || GetDistanceBetween(oPC, oRequiredPlaceable) > STX_CR_REQUIRED_DISTANCE)
|
|
return TRUE;
|
|
}
|
|
|
|
return FALSE;
|
|
}
|