Initial upload

Initial upload
This commit is contained in:
Jaysyn904
2024-11-25 19:36:07 -05:00
parent 256ffe12f7
commit 04165202c0
10228 changed files with 10443677 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
////////////////////////////////////////////////////////////////////////////
// Real Time Strategy - NWN - Count Units
//==========================================================================
// By Deva Bryson Winblood. 02/26/2003
////////////////////////////////////////////////////////////////////////////
void main()
{
object oMod=GetModule();
object oMe=OBJECT_SELF;
int nCount=0;
int nDigits=1;
string sTag=GetTag(oMe);
string sPre;
string sMain;
object oC;
string sUnit;
int nTeamNum;
int nL;
int nUnits;
int nUnit;
if (StringToInt(GetStringRight(sTag,2))>0) nDigits=2;
sPre=GetStringLeft(sTag,nDigits);
if (GetIsPC(oMe)) sPre=GetLocalString(oMe,"sTeamID");
sMain=sPre+"_UnitCount";
nTeamNum=GetLocalInt(oMod,sPre+"_num");
nUnits=GetLocalInt(oMod,"nTeamU"+IntToString(nTeamNum));
nUnit=0;
while(nUnit<nUnits&&nUnits!=0)
{ // count
sUnit=sPre+IntToString(nUnit);
nUnit++;
nL=0;
oC=GetObjectByTag(sUnit,nL);
while(oC!=OBJECT_INVALID)
{
nCount++;
nL++;
oC=GetObjectByTag(sUnit,nL);
}
} // count
SetLocalInt(oMod,sMain,nCount);
}