39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
// rts_it_mag42r - respawn book
|
|
#include "header_sounds"
|
|
|
|
void main()
|
|
{
|
|
object oPC=GetPCSpeaker();
|
|
if (!GetIsObjectValid(oPC)) oPC=OBJECT_SELF;
|
|
object oItem=GetItemPossessedBy(oPC,"rts_it_mag42");
|
|
int nC;
|
|
object oWP;
|
|
DestroyObject(oItem);
|
|
string sLoc;
|
|
nC=d20();
|
|
if (nC<4)
|
|
{ // desert
|
|
nC=Random(30)+1;
|
|
oWP=GetWaypointByTag("DESERT_TREASURE"+IntToString(nC));
|
|
oItem=CreateObject(OBJECT_TYPE_ITEM,"rts_it_mag42",GetLocation(oWP));
|
|
} // desert
|
|
else if (nC>17)
|
|
{ // northern
|
|
nC=Random(63)+1;
|
|
oWP=GetWaypointByTag("NORTHERN_TREASURE"+IntToString(nC));
|
|
oItem=CreateObject(OBJECT_TYPE_ITEM,"rts_it_mag42",GetLocation(oWP));
|
|
} // northern
|
|
else
|
|
{ // standard
|
|
nC=Random(100);
|
|
oWP=GetWaypointByTag("RL_"+IntToString(nC));
|
|
while(oWP==OBJECT_INVALID)
|
|
{
|
|
nC=Random(100);
|
|
oWP=GetWaypointByTag("RL_"+IntToString(nC));
|
|
}
|
|
oItem=CreateObject(OBJECT_TYPE_ITEM,"rts_it_mag42",GetLocation(oWP));
|
|
} // standard
|
|
fnSoundAlert("vs_ndgreenf_haha");
|
|
}
|