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

32 lines
1.0 KiB
Plaintext

/////////////////////////////////////////
// Slave purchase
/////////////////////////////////////////
#include "hos_alignment"
void main()
{
object oPC=GetPCSpeaker();
object oSlaver=OBJECT_SELF;
object oMod=GetModule();
int nSC=GetLocalInt(oMod,"nSLAVEC");
int nC=nSC;
int nSP=GetLocalInt(oMod,"nSlaverPower");
object oSlave=GetLocalObject(oMod,"oSLAVE"+IntToString(nSC));
nSP=nSP+5;
SetLocalInt(oMod,"nSlaverPower",nSP);
AssignCommand(oSlaver,TakeGoldFromCreature(50,oPC));
while(nC>0&&oSlave==OBJECT_INVALID)
{ // find slave
nC=nC-1;
oSlave=GetLocalObject(oMod,"oSLAVE"+IntToString(nC));
} // find slave
SetLocalObject(oMod,"oSLAVE"+IntToString(nC),OBJECT_INVALID);
nSC=nSC-1;
SetLocalInt(oMod,"nSLAVEC",nSC);
SetLocalObject(oSlave,"oMaster",oPC);
AssignCommand(oSlave,ClearAllActions());
AssignCommand(oSlave,JumpToObject(oPC));
SetLocalInt(oSlave,"nMode",0);
AdjustAlignmentPartyProtected(oPC,ALIGNMENT_CHAOTIC,5);
AdjustAlignmentPartyProtected(oPC,ALIGNMENT_EVIL,1);
}