34 lines
1.3 KiB
Plaintext
34 lines
1.3 KiB
Plaintext
///////////////////////////////////////////////////////////////////////////////
|
|
// Commoner death - needed for creating slaves
|
|
// By Deva Bryson Winblood. 12/28/2003
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
void main()
|
|
{
|
|
object oKiller=GetLastKiller();
|
|
object oMe=OBJECT_SELF;
|
|
string sKiller=GetResRef(oKiller);
|
|
object oSlave;
|
|
object oMod=GetModule();
|
|
int nSC=GetLocalInt(oMod,"nSLAVEC");
|
|
object oSCM=GetLocalObject(oMod,"oSCM");
|
|
if ((sKiller=="slvg1"||sKiller=="slv"||sKiller=="slvg2"||sKiller=="slvg3"||sKiller=="slvg4"||sKiller=="slvg5")&&nSC<5)
|
|
{ // killed by slavers
|
|
if (GetGender(oMe)==GENDER_FEMALE)
|
|
{ // create female slave
|
|
nSC++;
|
|
oSlave=CreateObject(OBJECT_TYPE_CREATURE,"slave2",GetLocation(oMe));
|
|
SetLocalObject(oMod,"oSLAVE"+IntToString(nSC),oSlave);
|
|
SetLocalInt(oMod,"nSLAVEC",nSC);
|
|
} // create female slave
|
|
else
|
|
{ // create male slave
|
|
nSC++;
|
|
oSlave=CreateObject(OBJECT_TYPE_CREATURE,"slave1",GetLocation(oMe));
|
|
SetLocalObject(oMod,"oSLAVE"+IntToString(nSC),oSlave);
|
|
SetLocalInt(oMod,"nSLAVEC",nSC);
|
|
} // create male slave
|
|
SetLocalObject(oSlave,"oMaster",oSCM);
|
|
} // killed by slavers
|
|
ExecuteScript("rts_mon_death",OBJECT_SELF);
|
|
}
|