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

47 lines
1.4 KiB
Plaintext

///////////// Generic Load Module
void main()
{
object oMod=GetModule();
int nSync;
int nC;
object oWP;
object oCP;
if (GetLocalInt(oMod,"nInProgress")!=TRUE)
{ // game nor in progress
ExecuteScript("rts_load_mod",OBJECT_SELF);
SetLocalInt(oMod,"nMaxPlayers",20);
SetLocalInt(oMod,"nInProgressJoins",TRUE);
SetLocalInt(oMod,"nGameType",1);
SetLocalInt(oMod,"nMaxSouls",50);
SetLocalInt(oMod,"nAIDelay",4);
SetLocalFloat(oMod,"fXPMultiplier",6.0);
nSync=Random(99999)+1; // sync key used for rejoining characters
SetLocalInt(oMod,"nRTSSync",nSync);
SetLocalInt(oMod,"nManaGoldMultiplier",1);
nC=1;
while(nC<5)
{ // place control shaft
oWP=GetWaypointByTag("CONTROL_POINT"+IntToString(nC));
if (oWP!=OBJECT_INVALID)
{ // control point found
oCP=CreateObject(OBJECT_TYPE_PLACEABLE,"controlna",GetLocation(oWP));
SetLocalObject(oWP,"oShaft",oCP);
SetLocalString(oWP,"sTeamID","NA");
SetLocalInt(oWP,"nNum",nC);
SetLocalInt(oCP,"nNum",nC);
SetLocalString(oCP,"sTeamID","NA");
} // control point found
nC++;
} // place control shaft
} // game not in progress
else
{ // game is in progress
PrintString("Module continuing from saved game...");
int nInstanceID=GetLocalInt(oMod,"nInstanceID");
int nR=d100();
while(nR==nInstanceID) { nR=d100(); }
SetLocalInt(oMod,"nInstanceID",nR);
} // game is in progress
}