HoS_PRC8/_mod/_module/nss/uc_t_ok.nss

24 lines
789 B
Plaintext
Raw Normal View History

2024-11-25 19:36:07 -05:00
////////////////////////////////////////////////////////////////////////////////
// uc_t_ok - Okay to create at least 1 of this unit?
// By Deva B. Winblood. December 21st, 2008
////////////////////////////////////////////////////////////////////////////////
#include "uc_h"
int StartingConditional()
{
object oPC=GetPCSpeaker();
int nBase=GetLocalInt(oPC,"nUCBase");
string sID=GetLocalString(oPC,"sTeamID");
int nMax=GetLocalInt(GetModule(),sID+"_UNITS");
int nUnit=GetLocalInt(oPC,"nUCRun");
int nNumber=nBase+nUnit;
string sDescription;
SetLocalInt(oPC,"nUCRun",nUnit+1);
if (!GetCanBeCreated(sID,nNumber)) return FALSE;
sDescription=GetUnitDescription(sID,nNumber,1,-1,oPC);
SetCustomToken(1001+nUnit,sDescription);
return TRUE;
}