76 lines
2.1 KiB
Plaintext
76 lines
2.1 KiB
Plaintext
//Updated for OAI by Olander
|
|
//Original By Fallen
|
|
|
|
#include "oai_inc_constant"
|
|
|
|
void main()
|
|
{
|
|
if(!GetLocalInt(OBJECT_SELF, "BATTLE_ACTIVE")) return;
|
|
int ETotal = GetLocalInt(OBJECT_SELF,"EAST_TOTAL");
|
|
int WTotal = GetLocalInt(OBJECT_SELF,"WEST_TOTAL");
|
|
if(ETotal > 30 && WTotal > 30) return;
|
|
|
|
int EastRand = GetLocalInt(OBJECT_SELF,"EAST_RANDOM");
|
|
int WestRand = GetLocalInt(OBJECT_SELF,"WEST_RANDOM");
|
|
object oTarget;
|
|
float fDist;
|
|
|
|
int D3 = d3();
|
|
int nLoop = 1;
|
|
while(nLoop <= D3 && ETotal < 30)
|
|
{
|
|
oTarget = GetWaypointByTag("BattleEAST");
|
|
location lTarget = GetLocation(oTarget);
|
|
oTarget = GetNearestObject(OBJECT_TYPE_CREATURE,oTarget,Random(EastRand) + 1);
|
|
object oCopy = CopyObject(oTarget, lTarget);
|
|
|
|
if(GetRacialType(oTarget) == RACIAL_TYPE_DRAGON)
|
|
{
|
|
DestroyObject(oTarget);
|
|
SetLocalInt(OBJECT_SELF,"EAST_RANDOM",EastRand-1);
|
|
}
|
|
|
|
if(GetRacialType(oTarget) == RACIAL_TYPE_CONSTRUCT)
|
|
{
|
|
DestroyObject(oTarget);
|
|
SetLocalInt(OBJECT_SELF,"EAST_RANDOM",EastRand-1);
|
|
}
|
|
|
|
ETotal++;
|
|
nLoop++;
|
|
SetLocalInt(OBJECT_SELF,"EAST_TOTAL",ETotal);
|
|
|
|
FloatingTextStringOnCreature(GetName(oTarget) + " has joined the battle!", GetLastUsedBy());
|
|
DelayCommand(3.5, ExecuteScript("test_switch_comm", oCopy));
|
|
}
|
|
|
|
D3 = d3();
|
|
nLoop = 1;
|
|
while(nLoop <= D3 && WTotal < 30)
|
|
{
|
|
object oTarget2 = GetWaypointByTag("BattleWEST");
|
|
location lTarget2 = GetLocation(oTarget2);
|
|
oTarget2 = GetNearestObject(OBJECT_TYPE_CREATURE,oTarget2,Random(WestRand) + 1);
|
|
object oCopy2 = CopyObject(oTarget2, lTarget2);
|
|
|
|
if(GetRacialType(oTarget2) == RACIAL_TYPE_DRAGON)
|
|
{
|
|
DestroyObject(oTarget2);
|
|
SetLocalInt(OBJECT_SELF,"WEST_RANDOM",WestRand-1);
|
|
}
|
|
|
|
if(GetRacialType(oTarget) == RACIAL_TYPE_CONSTRUCT)
|
|
{
|
|
DestroyObject(oTarget);
|
|
SetLocalInt(OBJECT_SELF,"WEST_RANDOM",WestRand-1);
|
|
}
|
|
|
|
WTotal++;
|
|
nLoop++;
|
|
SetLocalInt(OBJECT_SELF,"WEST_TOTAL",WTotal);
|
|
|
|
FloatingTextStringOnCreature(GetName(oTarget2) + " has joined the battle!", GetLastUsedBy());
|
|
DelayCommand(3.5, ExecuteScript("test_switch_comm", oCopy2));
|
|
}
|
|
}
|