beginscript; label Wait: if (GetState() != 0 && UnitDead() != 1) { SetNumLives(1); ExcTargetType(0xffffffff); IncTargetType(0x2); //SetFollowRange(100); EndFrame(); goto Start; } EndFrame(); goto Wait; label Start: SetVar(0,Rnd()); // Attack Player % SetVar(1,25); // Attack Player % SetVar(2,1000); // Group a range check label AttackAI: if (OtherUnitInRange (Jkl_G01_01_Scr,GetVar(2)) || OtherUnitInRange (Jkl_G01_02_Scr,GetVar(2)) || OtherUnitInRange (Jkl_G01_03_Scr,GetVar(2)) || OtherUnitInRange (Jkl_G01_04_Scr,GetVar(2)) || OtherUnitInRange (Jkl_G01_05_Scr,GetVar(2)) || OtherUnitInRange (Jkl_G01_06_Scr,GetVar(2)) || OtherUnitInRange (Jkl_G01_07_Scr,GetVar(2)) || OtherUnitInRange (Jkl_G01_08_Scr,GetVar(2)) || OtherUnitInRange (Jkl_G01_09_Scr,GetVar(2)) || OtherUnitInRange (Jkl_G01_10_Scr,GetVar(2))) { SetVar(3,1); } else { SetVar(3,0); } if (PlayerInRange(1000)) { if (GetVar(0) >= GetVar(1) && GetVar(3) == 1) { gosub AttackWho; SetFollowRange(500); } else { IncludeUTarget(0x6c01); SetFollowRange(1000); } } else { gosub AttackWho; SetFollowRange(1000); } EndFrame(); goto AttackAI; label End: EndFrame(); goto End; endscript; beginsub AttackWho; if (OtherUnitDead(Jkl_G01_01_Scr) != 1) { IncludeUTarget(Jkl_G01_02_Scr); SetFollowUnit(Jkl_G01_02_Scr,20,500); return; } if (OtherUnitDead(Jkl_G01_02_Scr) != 1) { IncludeUTarget(Jkl_G01_03_Scr); SetFollowUnit(Jkl_G01_03_Scr,20,500); return; } if (OtherUnitDead(Jkl_G01_03_Scr) != 1) { IncludeUTarget(Jkl_G01_04_Scr); SetFollowUnit(Jkl_G01_04_Scr,20,500); return; } if (OtherUnitDead(Jkl_G01_04_Scr) != 1) { IncludeUTarget(Jkl_G01_05_Scr); SetFollowUnit(Jkl_G01_05_Scr,20,500); return; } if (OtherUnitDead(Jkl_G01_05_Scr) != 1) { IncludeUTarget(Jkl_G01_06_Scr); SetFollowUnit(Jkl_G01_06_Scr,20,500); return; } if (OtherUnitDead(Jkl_G01_06_Scr) != 1) { IncludeUTarget(Jkl_G01_07_Scr); SetFollowUnit(Jkl_G01_07_Scr,20,500); return; } if (OtherUnitDead(Jkl_G01_07_Scr) != 1) { IncludeUTarget(Jkl_G01_08_Scr); SetFollowUnit(Jkl_G01_08_Scr,20,500); return; } if (OtherUnitDead(Jkl_G01_08_Scr) != 1) { IncludeUTarget(Jkl_G01_09_Scr); SetFollowUnit(Jkl_G01_09_Scr,20,500); return; } if (OtherUnitDead(Jkl_G01_09_Scr) != 1) { IncludeUTarget(Jkl_G01_10_Scr); SetFollowUnit(Jkl_G01_10_Scr,20,500); return; } endsub; $