32 lines
1.0 KiB
Plaintext
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);
|
|
}
|