Battledale_PRC8/_module/nss/jw_smith_enter.nss
Jaysyn904 e5b3f6ad61 Finished PRC8 integration
Finished PRC8 integration.  Moved creature abilities to top hak.  Setup tooling.  Created release archive
2024-03-12 21:27:23 -04:00

65 lines
1.9 KiB
Plaintext

#include "prc_inc_spells"
void main()
{
// smith entering
object oPC=GetEnteringObject();
if (!GetIsObjectValid(oPC)||!GetIsPC(oPC)||GetIsDM(oPC)||GetIsDMPossessed(oPC)||PRCGetHasEffect(EFFECT_TYPE_POLYMORPH,oPC))
{
return;
}
object oHide=GetItemPossessedBy(oPC,"jw_craftfeat_giv");
if (GetIsObjectValid(oHide))
{
DestroyObject(oHide);
}
object oBelt=GetItemInSlot(INVENTORY_SLOT_BELT,oPC);
if (GetIsObjectValid(oBelt))
{
SetLocalObject(oBelt,"jw_smith_belt",oBelt);
}
oHide=CreateItemOnObject("jw_craftfeat_giv",oPC);
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,ActionEquipItem(oHide,INVENTORY_SLOT_BELT));
SendMessageToPC(oPC,"While in the workshop, you may carry any armour, shield or weapon as if you had the correct feats, but not if you are barred from using the item due to class or alignment restrictions");
FloatingTextStringOnCreature("Received crafting feats belt",oPC);
if (!GetHasFeat(FEAT_ARMOR_PROFICIENCY_LIGHT,oPC))
{
IPSafeAddItemProperty(oHide,ItemPropertyBonusFeat(IP_CONST_FEAT_ARMOR_PROF_LIGHT),3600.0);
}
if (!GetHasFeat(FEAT_ARMOR_PROFICIENCY_MEDIUM,oPC))
{
IPSafeAddItemProperty(oHide,ItemPropertyBonusFeat(IP_CONST_FEAT_ARMOR_PROF_MEDIUM),3600.0);
}
if (!GetHasFeat(FEAT_ARMOR_PROFICIENCY_HEAVY,oPC))
{
IPSafeAddItemProperty(oHide,ItemPropertyBonusFeat(IP_CONST_FEAT_ARMOR_PROF_HEAVY),3600.0);
}
if (!GetHasFeat(FEAT_WEAPON_PROFICIENCY_SIMPLE,oPC))
{
IPSafeAddItemProperty(oHide,ItemPropertyBonusFeat(IP_CONST_FEAT_WEAPON_PROF_SIMPLE),3600.0);
}
if (!GetHasFeat(FEAT_WEAPON_PROFICIENCY_MARTIAL,oPC))
{
IPSafeAddItemProperty(oHide,ItemPropertyBonusFeat(IP_CONST_FEAT_WEAPON_PROF_MARTIAL),3600.0);
}
if (!GetHasFeat(FEAT_WEAPON_PROFICIENCY_EXOTIC,oPC))
{
IPSafeAddItemProperty(oHide,ItemPropertyBonusFeat(IP_CONST_FEAT_WEAPON_PROF_EXOTIC),3600.0);
}
if (!GetHasFeat(FEAT_SHIELD_PROFICIENCY,oPC))
{
IPSafeAddItemProperty(oHide,ItemPropertyBonusFeat(35),3600.0);
}
}