HoS_PRC8/_mod/_module/nss/cv_hma_buyequip.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

38 lines
1.0 KiB
Plaintext

#include "x3_inc_horse"
#include "x2_inc_itemprop"
void main()
{
object oPC=GetPCSpeaker();
object oMe=OBJECT_SELF;
object oHorse=HorseGetMyHorse(oPC);
int nTail=GetLocalInt(oHorse,"bDBW_HORSE");
int nParm=GetLocalInt(oPC,"nParm");
int nCost=GetLocalInt(oPC,"nCost");
itemproperty iProp;
DeleteLocalInt(oPC,"nCost");
SetCreatureTailType(nTail+nParm,oHorse);
if (nParm>1)
{ // armor
object oSkin=GetItemInSlot(INVENTORY_SLOT_CARMOUR,oHorse);
if (nParm==3)
{ // leather
iProp=ItemPropertyACBonus(2);
} // leather
else if (nParm==5)
{ // chain
iProp=ItemPropertyACBonus(4);
} // chain
else if (nParm==4)
{ // scale
iProp=ItemPropertyACBonus(5);
} // scale
else if (nParm==6||nParm==7)
{ // padded
iProp=ItemPropertyACBonus(1);
} // padded
IPSafeAddItemProperty(oSkin,iProp);
} // armor
AssignCommand(oMe,TakeGoldFromCreature(nCost,oPC));
}