Majesty Gold HD

Majesty Gold HD

Customize Majesty!
Create and upload new Quests and Mods for Majesty HD!
Mod Questions
I'm posting this here to help index modding questions and to avoid mine clogging up the list.
< >
Showing 1-15 of 26 comments
BILLYREDNECK 1 4 Feb, 2021 @ 6:38am 
#1

Is there a way to make maps larger than 1024x1024?

Answer: Not at this time.


#2

Is there a limit to how many dice rolls a single function can run 'simultaneously'?

Answer: No known limit as of now. But there seems to be a lag issue once you run 4+ rolls simultaneously.


#3

What is the difference between the category 'subtype' and the category 'family'?

Answer: //This is used by buff-ing monsters, so they know which monster types to buff.


#4

Is there a way to have a function distinguish between different levels in another function?

Answer: ...


#5

I've come across this error several times recently and haven't had the chance to dig into it. I has always occurred on a 1024x1024 size map.

---------------------------------------------------------------------------------------------------

Script error:

Call Sequence was:

$ranger_tree( (), Ranger#1231 )

$explore_map( false, Ranger#1231, 95 )

$GetNearestHiddenCoord( false, Ranger#1231, 0, 0 ) - line 17:

GetNearestHiddenCoord() called for off-map unit.

---------------------------------------------------------------------------------------------------

In addition, I've noticed that when Rangers 'visit lost lands' and use either the Eastern or Western map edges that they move extremely fast but they are not using a speed potion. I think it has something to do with a number rollover ( sort've like if you set something to spawn at $RandomCoord () but set the max distance beyond the edge, then the spawn may 'wrap around' the map and spawn on the opposite side/corner and be closer to the palace than intended).

Last edited by BILLYREDNECK; 14 Mar, 2021 @ 11:53pm
VikesRule 40 4 Feb, 2021 @ 9:22pm 
Originally posted by BILLYREDNECK:
Is there a way to make maps larger than 1024x1024?
As far as I know, you cannot make a map size different than 128x128, 256x256, 512x512, or 1024x1024.
BILLYREDNECK 1 16 Feb, 2021 @ 1:47am 
#2

Is there a limit to how many dice rolls a single function can run 'simultaneously'?

I have a function that rolls 4 dice for 4 events that all have an independent chance to occur,
but a majesty started crashing today and while I'm fairly certain it's this bit of coding I'm not
positive yet.

function starts

roll1 -> determines [event_set_1]
roll2 -> determines [event_set_2]
roll3 -> determines [event_set_3]
roll4 -> determines [event_set_4]

All 4 dice rolls are independent of each other and the [event_sets] have no direct
interaction other than being from the same function. There has been some stuttering
which usually occurs around the time the function runs, but again, I'm not sure if it's the
function doing too much at once, the function being poorly structured/designed, or
something unrelated.
Last edited by BILLYREDNECK; 16 Feb, 2021 @ 3:28am
BILLYREDNECK 1 16 Feb, 2021 @ 3:30am 
#3

What is the difference between the category 'subtype' and the category 'family'?

At first I thought this had to do with the addition of the War_Party AI, but from what I can tell that's based on subtype.
VikesRule 40 16 Feb, 2021 @ 6:07pm 
Originally posted by BILLYREDNECK:
#2

Is there a limit to how many dice rolls a single function can run 'simultaneously'?

I have a function that rolls 4 dice for 4 events that all have an independent chance to occur,
but a majesty started crashing today and while I'm fairly certain it's this bit of coding I'm not
positive yet.

function starts

roll1 -> determines [event_set_1]
roll2 -> determines [event_set_2]
roll3 -> determines [event_set_3]
roll4 -> determines [event_set_4]

All 4 dice rolls are independent of each other and the [event_sets] have no direct
interaction other than being from the same function. There has been some stuttering
which usually occurs around the time the function runs, but again, I'm not sure if it's the
function doing too much at once, the function being poorly structured/designed, or
something unrelated.
There shouldn't be any issue with this, at least not with 4 dice rolls. I've had functions that had hundreds of random numbers generated without any issues. Are you getting any type of GPL error when the function runs?


Originally posted by BILLYREDNECK:
#3

What is the difference between the category 'subtype' and the category 'family'?

At first I thought this had to do with the addition of the War_Party AI, but from what I can tell that's based on subtype.
When I check mx_prototype.gpl, it says this for "family" in comment:
//This is used by buff-ing monsters, so they know which monster types to buff
BILLYREDNECK 1 19 Feb, 2021 @ 12:55am 
To be fair, as far as #2 goes, it's more like:

roll1 -> determines [event_set_1]

roll1 -> roll1a -> roll1a1 -> roll1a1a
roll1a1b
roll1a1c
...
roll1a2 -> roll1a2a
roll1a2b
...
roll1a3
...
roll1b
...

That's how pretty much each roll goes. There's no GPL error, no error code, and nothing I see in the debugger, just a hang and then a crash.

I've been trying to rebuild the code in a less resource intensive, albeit much less effective manner, and it hasn't been going stellar to say the least.

If it would help, I can share the file with you.
Last edited by BILLYREDNECK; 19 Feb, 2021 @ 1:00am
BILLYREDNECK 1 19 Feb, 2021 @ 1:15am 
#4

Is there a way to have a function distinguish between different levels in another function?

example: function1 has a category list and each category list is filled with
a list of types.

function2 defines which category to look in then defines the roll
to determine which type is returned, overwriting the typeroll
already defined in function1.

something like:

function Populate ()
declare
agent Palace, SpawnMe;
list Palaces;
integer MonsterCat, SpawnThis;
coordinate loc1;
string spawn1;

begin
... blah blah blah;
loc1 = RandomCoord ( Palace, 400 );
spawn1 = $MonsterChooser (2);
SpawnThis = $RandomNumber (2) + 1;

SpawnMe = ( Palace, spawn1, loc1, #Monster_Player );
...
end

/////////////////////////////////////

function MonsterChooser ( integer MonsterCat ) is string
declare
integer SpawnThis;

begin

if ( MonsterCat == 1 )

begin
SpawnThis = $RandomNumber (2) + 1;

if ( SpawnThis == 1 )
begin
return "Giant_Rat";
end
else if ( SpawnThis == 2 )
begin
return "White_Wolf";
end
end

else if ( MonsterCat == 2 )

begin
SpawnThis = $RandomNumber (4) + 1;

if ( SpawnThis == 1 )
begin
return "Giant_Rat";
end
else if ( SpawnThis == 2 )
begin
return "White_Wolf";
end
else if ( SpawnThis == 3 )
begin
return "Goblin_Archer";
end
else if ( SpawnThis == 4 )
begin
return "Goblin_Fighter";
end

end

end

///////////////////////////

As far as I can tell, the $MonsterChooser (2) will send the function to MonsterCat == 2, but I can't seem to get the function to apply the new SpawnThis value. It just ignores it and uses the predefined SpawnThis value instead.
Last edited by BILLYREDNECK; 19 Feb, 2021 @ 1:23am
VikesRule 40 19 Feb, 2021 @ 10:33am 
Originally posted by BILLYREDNECK:
To be fair, as far as #2 goes, it's more like:

roll1 -> determines [event_set_1]

roll1 -> roll1a -> roll1a1 -> roll1a1a
roll1a1b
roll1a1c
...
roll1a2 -> roll1a2a
roll1a2b
...
roll1a3
...
roll1b
...

That's how pretty much each roll goes. There's no GPL error, no error code, and nothing I see in the debugger, just a hang and then a crash.

I've been trying to rebuild the code in a less resource intensive, albeit much less effective manner, and it hasn't been going stellar to say the least.

If it would help, I can share the file with you.
Sure you can post it here and I'll take a look.


Originally posted by BILLYREDNECK:
#4

Is there a way to have a function distinguish between different levels in another function?

example: function1 has a category list and each category list is filled with
a list of types.

function2 defines which category to look in then defines the roll
to determine which type is returned, overwriting the typeroll
already defined in function1.

something like:

function Populate ()
declare
agent Palace, SpawnMe;
list Palaces;
integer MonsterCat, SpawnThis;
coordinate loc1;
string spawn1;

begin
... blah blah blah;
loc1 = RandomCoord ( Palace, 400 );
spawn1 = $MonsterChooser (2);
SpawnThis = $RandomNumber (2) + 1;

SpawnMe = ( Palace, spawn1, loc1, #Monster_Player );
...
end

/////////////////////////////////////

function MonsterChooser ( integer MonsterCat ) is string
declare
integer SpawnThis;

begin

if ( MonsterCat == 1 )

begin
SpawnThis = $RandomNumber (2) + 1;

if ( SpawnThis == 1 )
begin
return "Giant_Rat";
end
else if ( SpawnThis == 2 )
begin
return "White_Wolf";
end
end

else if ( MonsterCat == 2 )

begin
SpawnThis = $RandomNumber (4) + 1;

if ( SpawnThis == 1 )
begin
return "Giant_Rat";
end
else if ( SpawnThis == 2 )
begin
return "White_Wolf";
end
else if ( SpawnThis == 3 )
begin
return "Goblin_Archer";
end
else if ( SpawnThis == 4 )
begin
return "Goblin_Fighter";
end

end

end

///////////////////////////

As far as I can tell, the $MonsterChooser (2) will send the function to MonsterCat == 2, but I can't seem to get the function to apply the new SpawnThis value. It just ignores it and uses the predefined SpawnThis value instead.
Hmm this looks like it should work as you intended, maybe send me the file for this one as well and I can take a look. One thing I'm wondering is in your function populate () what purpose does this line serve?
SpawnThis = $RandomNumber (2) + 1;
BILLYREDNECK 1 20 Feb, 2021 @ 1:46pm 
Originally posted by BILLYREDNECK:


Originally posted by BILLYREDNECK:
#4

Is there a way to have a function distinguish between different levels in another function?

example: function1 has a category list and each category list is filled with
a list of types.

function2 defines which category to look in then defines the roll
to determine which type is returned, overwriting the typeroll
already defined in function1.

something like:

function Populate ()
declare
agent Palace, SpawnMe;
list Palaces;
integer MonsterCat, SpawnThis;
coordinate loc1;
string spawn1;

begin
... blah blah blah;
loc1 = RandomCoord ( Palace, 400 );
spawn1 = $MonsterChooser (2);
SpawnThis = $RandomNumber (2) + 1;

SpawnMe = ( Palace, spawn1, loc1, #Monster_Player );
...
end

/////////////////////////////////////

function MonsterChooser ( integer MonsterCat ) is string
declare
integer SpawnThis;

begin

if ( MonsterCat == 1 )

begin
SpawnThis = $RandomNumber (2) + 1;

if ( SpawnThis == 1 )
begin
return "Giant_Rat";
end
else if ( SpawnThis == 2 )
begin
return "White_Wolf";
end
end

else if ( MonsterCat == 2 )

begin
SpawnThis = $RandomNumber (4) + 1;

if ( SpawnThis == 1 )
begin
return "Giant_Rat";
end
else if ( SpawnThis == 2 )
begin
return "White_Wolf";
end
else if ( SpawnThis == 3 )
begin
return "Goblin_Archer";
end
else if ( SpawnThis == 4 )
begin
return "Goblin_Fighter";
end

end

end

///////////////////////////

As far as I can tell, the $MonsterChooser (2) will send the function to MonsterCat == 2, but I can't seem to get the function to apply the new SpawnThis value. It just ignores it and uses the predefined SpawnThis value instead.
Hmm this looks like it should work as you intended, maybe send me the file for this one as well and I can take a look. One thing I'm wondering is in your function populate () what purpose does this line serve?
SpawnThis = $RandomNumber (2) + 1;


The SpawnThis = $RandomNumber (2) + 1; in MonsterChooser () is to allow ( MonsterCat == 2 ) to be used as a generic group selector (pick one from this group, etc ) with all four options available.

The SpawnThis = $RandomNumber (2) + 1; in the function doing the calling is to arbitrarily narrow down the ( MonsterChooser == 2 ) list for that specific call of the function.

The main purpose of this is to prevent MonsterChooser from having to be 3000 lines long with dozens of distinct categories made up of almost identical lists, if that helps.

So basically, part of the time the full list is being used, but part of the time only a portion of the list is available to the calling function

What I don't understand is why the SpawnThis () overwrite in the caller function isn't being applied. And I could have sworn it was working correctly the other day.
Last edited by BILLYREDNECK; 20 Feb, 2021 @ 2:13pm
BILLYREDNECK 1 20 Feb, 2021 @ 2:10pm 
Originally posted by VikesRule:
Originally posted by BILLYREDNECK:
To be fair, as far as #2 goes, it's more like:

roll1 -> determines [event_set_1]

roll1 -> roll1a -> roll1a1 -> roll1a1a
roll1a1b
roll1a1c
...
roll1a2 -> roll1a2a
roll1a2b
...
roll1a3
...
roll1b
...

That's how pretty much each roll goes. There's no GPL error, no error code, and nothing I see in the debugger, just a hang and then a crash.

I've been trying to rebuild the code in a less resource intensive, albeit much less effective manner, and it hasn't been going stellar to say the least.

If it would help, I can share the file with you.
Sure you can post it here and I'll take a look.


Originally posted by BILLYREDNECK:
#4

Is there a way to have a function distinguish between different levels in another function?

example: function1 has a category list and each category list is filled with
a list of types.

function2 defines which category to look in then defines the roll
to determine which type is returned, overwriting the typeroll
already defined in function1.

something like:

function Populate ()
declare
agent Palace, SpawnMe;
list Palaces;
integer MonsterCat, SpawnThis;
coordinate loc1;
string spawn1;

begin
... blah blah blah;
loc1 = RandomCoord ( Palace, 400 );
spawn1 = $MonsterChooser (2);
SpawnThis = $RandomNumber (2) + 1;

SpawnMe = ( Palace, spawn1, loc1, #Monster_Player );
...
end

/////////////////////////////////////

function MonsterChooser ( integer MonsterCat ) is string
declare
integer SpawnThis;

begin

if ( MonsterCat == 1 )

begin
SpawnThis = $RandomNumber (2) + 1;

if ( SpawnThis == 1 )
begin
return "Giant_Rat";
end
else if ( SpawnThis == 2 )
begin
return "White_Wolf";
end
end

else if ( MonsterCat == 2 )

begin
SpawnThis = $RandomNumber (4) + 1;

if ( SpawnThis == 1 )
begin
return "Giant_Rat";
end
else if ( SpawnThis == 2 )
begin
return "White_Wolf";
end
else if ( SpawnThis == 3 )
begin
return "Goblin_Archer";
end
else if ( SpawnThis == 4 )
begin
return "Goblin_Fighter";
end

end

end

///////////////////////////

As far as I can tell, the $MonsterChooser (2) will send the function to MonsterCat == 2, but I can't seem to get the function to apply the new SpawnThis value. It just ignores it and uses the predefined SpawnThis value instead.
Hmm this looks like it should work as you intended, maybe send me the file for this one as well and I can take a look. One thing I'm wondering is in your function populate () what purpose does this line serve?
SpawnThis = $RandomNumber (2) + 1;


So the code is about 130,000+ characters and won't post here without being significantly broken up. Is that cool with you or would you rather have the file itself?
BILLYREDNECK 1 20 Feb, 2021 @ 2:14pm 
part 1

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// repopulates environment during quest (mainly tier 1-2 animals, monsters, plants)

function PopEnviron2 ()
declare
agent Palace, SpawnMe, SpawnMe2, ResPlants;
list Palaces, ListPopAnimal, ListPopMonster, ListMonster, ListMonster2, ListMonster3, ListMonster4, ListMonster5, ListMonster6, ListMonster7, ListMonster8, ListMonster9, ListMonster10, ListMonster11, ListMonster12, ListResPlants;
integer PopAnimalRate, PopMonsterRate, PopPlantRate, SpawnThis, SpawnThis2, RollMe, RollMe2, RollMe3, RollMe4, Loop1, Loop1Roll, Loop2, Loop2Roll, Loop3, Loop3Roll, Loop4, Loop4Roll;
integer RollRaid;
coordinate Loc1, Loc2;
string Spawn1, Spawn2;

begin
//PopAnimalRate is used to set a number that determines if a spawn will occur or not. Is rather arbitrary.
// and may replace the Loop1Roll and Loop2Roll when they determine whether or not to spawn.
Palaces = $ListPalaces ();
Palace = $ListMember ( Palaces, 1 );
Loop1 = 0;
Loop2 = 0;
PopAnimalRate = $RandomNumber (21) + 5; // 5-25;
PopMonsterRate = $RandomNumber (16) + 5; // 5-20;
PopPlantRate = $RandomNumber (13) + 3;

//$ListObjects ( Palace, "monster", -1, ListPopAnimal, #NoHiddenMap, #NotMyPlayer, #CheckSubTypes, "animal" );

$ListObjects ( Palace, "monster", -1, ListMonster, #NoHiddenMap, #NotMyPlayer, #CheckSubTypes, "animal" );

$ListObjects ( Palace, "monster", -1, ListMonster3, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Dryad" );
$ListObjects ( Palace, "monster", -1, ListMonster4, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Goblin_Archer" );
$ListObjects ( Palace, "monster", -1, ListMonster5, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Goblin_Fighter" );
$ListObjects ( Palace, "mosnter", -1, ListMonster6, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Goblin_Priest" );
$ListObjects ( Palace, "mystery", -1, ListMonster7, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Skeleton" );
$ListObjects ( Palace, "monster", -1, ListMonster8, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Harpy" );
$ListObjects ( Palace, "monster", -1, ListMonster9, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Zombie" );
$ListObjects ( Palace, "monster", -1, ListMonster10, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Goblin_Champion" );
$ListObjects ( Palace, "monster", -1, ListMonster11, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Ratman" );
$ListObjects ( Palace, "monster", -1, ListMonster12, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "RatmanShaman" );

ListMonster2 = $AddLists ( ListMonster3, ListMonster4, ListMonster5, ListMonster6, ListMonster7, ListMonster8, ListMonster9, ListMonster10, ListMonster11, ListMonster12 );

// Currently available events
RollMe = $RandomNumber (5) + 1;

// test values for single event
//Loop1Roll = 1;
//Loop2Roll = 20;
//Loop3Roll = 500;
//Loop4Roll = 500;
//PopAnimalRate = 50;
//PopMonsterRate = 50;
//RollMe = 3;
//RollMe2 = 1;
//RollMe3 = 2;
//RollMe4 = 1;

if ( RollMe == 1 )
// repopulate Daemonwood and Strangleweed // [check] possibly add loop rolls to dicatate whether or not daemonwoods/strangleweeds are populated
begin
$ClearList ( ListMonster );
PopPlantRate = $RandomNumber (9) + 2; // 10
RollMe2 = $RandomNumber (2) + 1;

if ( RollMe2 == 1 )
begin
$ListObjects ( Palace, "monster", -1, ListMonster, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Daemonwood" );

if ( $ListSize ( ListMonster ) <= PopPlantRate )
begin
Loop1Roll = $RandomNumber (10) + 1;

while ( Loop1 < Loop1Roll ) do
begin
$SpawnUnit ( Palace, "Daemonwood", $CoordChooser (97), #Monster_Player );

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListMonster ) > PopPlantRate )
begin
$ClearList ( ListMonster );
$ListObjects ( Palace, "monster", -1, ListMonster, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Strangleweed" );

PopPlantRate = $RandomNumber (13) + 3;

if ( $ListSize ( ListMonster ) < PopPlantRate )
begin
Loop1Roll = $RandomNumber (8) + 3;

while ( Loop1 < Loop1Roll ) do
begin
$SpawnUnit ( Palace, "Strangleweed", $CoordChooser (97), #Monster_Player );

( Loop1 ) ++;
end
end
end
end
else if ( RollMe2 == 2 )
begin
$ClearList ( ListMonster );
$ListObjects ( Palace, "monster", -1, ListMonster, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Strangleweed" );

PopPlantRate = $RandomNumber (13) + 3;

if ( $ListSize ( ListMonster ) <= PopPlantRate )
begin
Loop1Roll = $RandomNumber (8) + 3;

while ( Loop1 < Loop1Roll ) do
begin
$SpawnUnit ( Palace, "Strangleweed", $CoordChooser (97), #NoHiddenMap );

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListMonster ) > PopPlantRate )
begin
$ClearList ( ListMonster );
$ListObjects ( Palace, "monster", -1, ListMonster, #NoHiddenMap, #NotMyPlayer, #CheckTitles, "Daemonwood" );

PopPlantRate = $RandomNumber (9) + 2; // 10

if ( $ListSize ( ListMonster ) < PopPlantRate )
begin
Loop1Roll = $RandomNumber (10) + 1;

while ( Loop1 < Loop1Roll ) do
begin
$SpawnUnit ( Palace, "Daemonwood", $CoordChooser (97), #Monster_Player );

( Loop1 ) ++;
end
end
end
end
end
BILLYREDNECK 1 20 Feb, 2021 @ 2:14pm 
part 2

else if ( RollMe == 2 )
// repopulate healing and poison plants // [check] possibly add loop rolls to dicatate whether or not healing/poison plants are populated
begin

RollMe2 = $RandomNumber (2) + 1;

if ( RollMe2 == 1 )
begin
$ListObjects ( Palace, "Healing_herbs", -1, ListResPlants, #NoHiddenMap );

if ( $ListSize ( ListResPlants ) <= PopPlantRate )
begin
Loop1Roll = $RandomNumber (8) + 3;

while ( Loop1 < Loop1Roll ) do
begin
$SpawnUnit ( Palace, "Resource_Healplant", $CoordChooser (97), #Monster_Player );

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListResPlants ) > PopPlantRate )
begin
$ClearList ( ListResPlants );
$ListObjects ( Palace, "Poison_plants", -1, ListResPlants, #NoHiddenMap );

if ( $ListSize ( ListResPlants ) < PopPlantRate )
begin
Loop1Roll = $RandomNumber (8) + 3;

while ( Loop1 < Loop1Roll ) do
begin
$SpawnUnit ( Palace, "Resource_Poisonplant", $CoordChooser (97), #Monster_Player );

( Loop1 ) ++;
end
end
end
end
else if ( RollMe2 == 2 )
begin
$ListObjects ( Palace, "Poison_plants", -1, ListResPlants, #NoHiddenMap );

if ( $ListSize ( ListResPlants ) <= PopPlantRate )
begin
Loop1Roll = $RandomNumber (8) + 3;

while ( Loop1 < Loop1Roll ) do
begin
$SpawnUnit ( Palace, "Resource_Poisonplant", $CoordChooser (97), #Monster_Player );

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListResPlants ) > PopPlantRate )
begin
$ClearList ( ListResPlants );
$ListObjects ( Palace, "Healing_herbs", -1, ListResPlants, #NoHiddenMap );

if ( $ListSize ( ListResPlants ) < PopPlantRate )
begin
Loop1Roll = $RandomNumber (8) + 3;

while ( Loop1 < Loop1Roll ) do
begin
$SpawnUnit ( Palace, "Resource_Healplant", $CoordChooser (97), #Monster_Player );

( Loop1 ) ++;
end
end
end
end
end

else if ( RollMe == 3 ) // [check] ?change Loop1Roll and Loop2Roll smaller
// repopulate wandering tier 1-2 animals/monsters
begin
Loop1Roll = $RandomNumber (11) + 5; // 15
Loop2Roll = $RandomNumber (8) + 3; // 10
RollMe2 = $RandomNumber (2) + 1;

if ( RollMe2 == 1 )
begin
if ( $ListSize ( ListMonster ) <= PopAnimalRate ) // if ( ListMonster which is # of animal monsters, anywhere on the map, not owned by p1, and of the subtype 'animal' ) <= ( Loop1Roll = 0 to 15 ), then do the following:
begin
while ( Loop1 < Loop1Roll ) do // while ( Loop1 = 0 ) <= ( Loop1Roll = 0 to 15 ), do the following:
begin
SpawnThis = $RandomNumber (2); // ( SpawnThis ) is a random number between 1 and 2, inclusive (includes 1 and 2 as possible values).
Spawn1 = $PopEnvironChooser ( SpawnThis );

SpawnMe = $SpawnUnit ( Palace, $PopEnvironChooser ( SpawnThis ), $CoordChooser (97), #Monster_Player ); // ( SpawnMe ) is an agent that is a unit spawned by the p1 palace, the unit type is determined by the function ( PopEnvironChooser ) option value defined by ( SpawnThis ), at the coordinates determined by function ( CoordChooser ) option value ( 97 ), and is owned by the monster player (yellow health bars).
SpawnMe's "activeScript" = $Animal; // agent ( SpawnMe ) has its ( activeScript ) set to the function ( Animal ).
SpawnMe's "basicScript" = $Animal; // agent ( SpawnMe ) has its ( basicScript ) set to the function ( Animal ).
SpawnMe's "backScript" = $Animal; // agent ( SpawnMe ) has its ( backScript ) set to the function ( Animal ).
SpawnMe's "StartingScript" = $Animal; // agent ( SpawnMe ) has its ( StartingScript ) set to the function ( Animal ).

( Loop1 ) ++; // integer ( Loop1 ) increases by 1 each time the function loops, when this section of the function runs, during this iteration of the function running.
end
end
else if ( $ListSize ( ListMonster ) > PopAnimalRate ) // else [otherwise] if ( ListMonster which is # of animal monsters, anywhere on the map, not owned by p1, and of the subtype 'animal' ) > ( Loop1Roll = 0 to 15 ), then do the following:
begin
if ( $ListSize ( ListMonster2 ) < PopMonsterRate )
begin
while ( Loop2 < Loop2Roll ) do
begin
SpawnThis = $RandomNumber (2) + 3;

SpawnMe = $SpawnUnit ( Palace, $PopEnvironChooser ( SpawnThis ), $CoordChooser (97), #Monster_Player );
SpawnMe's "activeScript" = $Wandering;
SpawnMe's "basicScript" = $Wandering;
SpawnMe's "backScript" = $Wandering;
SpawnMe's "StartingScript" = $Wandering;

( Loop2 ) ++;
end
end
end
end
else if ( RollMe2 == 2 )
begin
if ( $ListSize ( ListMonster2 ) <= PopMonsterRate )
begin
while ( Loop2 < Loop2Roll ) do
begin
SpawnThis = $RandomNumber (2) + 3;

SpawnMe = $SpawnUnit ( Palace, $PopEnvironChooser ( SpawnThis ), $CoordChooser (97), #Monster_Player );
SpawnMe's "activeScript" = $Wandering;
SpawnMe's "basicScript" = $Wandering;
SpawnMe's "backScript" = $Wandering;
SpawnMe's "StartingScript" = $Wandering;

( Loop2 ) ++;
end
end
else if ( $ListSize ( ListMonster2 ) > PopMonsterRate )
begin
if ( $ListSize ( ListMonster ) < PopAnimalRate )
begin
while ( Loop1 < Loop1Roll ) do
begin
SpawnThis = $RandomNumber (2);

SpawnMe = $SpawnUnit ( Palace, $PopEnvironChooser ( SpawnThis ), $CoordChooser (97), #Monster_Player );
SpawnMe's "activeScript" = $Animal;
SpawnMe's "basicScript" = $Animal;
SpawnMe's "backScript" = $Animal;
SpawnMe's "StartingScript" = $Animal;

( Loop1 ) ++;
end
end
end
end
end
BILLYREDNECK 1 20 Feb, 2021 @ 2:15pm 
part 3

else if ( RollMe == 4 ) // [check] ?change Loop1Roll and Loop2Roll smaller
// tier 1-2 animal/monster pack, same animal/monster type, small/medium/large
begin

Loc1 = $RandomEdgeCoord ( $RandomNumber (4) );
Loop1Roll = $RandomNumber (5) + 2; // 2-6, 4-8, 6-10
Loop2Roll = $RandomNumber (3) + 2; // 2-4, 4-6, 6-8

//RollMe2 = $RandomNumber (4) + 1;
RollMe2 = $RandomNumber (3) + 1;

if ( RollMe2 == 1 )
// spawn small tier 1-2 animal pack first
begin
if ( $ListSize ( ListMonster ) <= PopAnimalRate )
begin
SpawnThis = $RandomNumber (2) + 30; // 30-31
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Animal;
SpawnMe's "basicScript" = $Animal;
SpawnMe's "backScript" = $Animal;
SpawnMe's "StartingScript" = $Animal;

( Loop1 ) ++;
end

$MiniMapAnimation ( Loc1, "Event_Beacon" );
end
else if ( $ListSize ( ListMonster ) > PopAnimalRate )
begin
if ( $ListSize ( ListMonster2 ) < PopMonsterRate )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Wandering;
SpawnMe's "basicScript" = $Wandering;
SpawnMe's "backScript" = $Wandering;
SpawnMe's "StartingScript" = $Wandering;

( Loop2 ) ++;
end

$MiniMapAnimation ( Loc1, "Event_Beacon" );
end
end
end
else if ( RollMe2 == 2 )
// spawn small tier 1-2 monster pack first
begin
if ( $ListSize ( ListMonster2 ) <= PopMonsterRate )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Wandering;
SpawnMe's "basicScript" = $Wandering;
SpawnMe's "backScript" = $Wandering;
SpawnMe's "StartingScript" = $Wandering;

( Loop2 ) ++;
end
end
else if ( $ListSize ( ListMonster2 ) > PopMonsterRate )
begin
if ( $ListSize ( ListMonster ) < Loop1Roll )
begin
SpawnThis = $RandomNumber (2) + 30;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Animal;
SpawnMe's "basicScript" = $Animal;
SpawnMe's "backScript" = $Animal;
SpawnMe's "StartingScript" = $Animal;

( Loop1 ) ++;
end
end
end
end
else if ( RollMe2 == 3 )
// spawn medium tier 1-2 animal/monster pack, 1/2 chance
begin
Loop1Roll = $RandomNumber (5) + 4; // 2-6, 4-8, 6-10
Loop2Roll = $RandomNumber (3) + 4; // 2-4, 4-6, 6-8

RollMe3 = $RandomNumber (10) + 1; // [change] ?change to 10/20/30?
RollMe4 = $RandomNumber (2) + 1;

if ( RollMe3 <= 5 )
begin
if ( RollMe4 == 1)
// spawn medium animal pack first
begin
if ( $ListSize ( ListMonster ) <= PopAnimalRate )
begin
SpawnThis = $RandomNumber (2) + 30;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Animal;
SpawnMe's "basicScript" = $Animal;
SpawnMe's "backScript" = $Animal;
SpawnMe's "StartingScript" = $Animal;

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListMonster ) > PopAnimalRate )
begin
if ( $ListSize ( ListMonster2 ) < Loop2Roll )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Wandering;
SpawnMe's "basicScript" = $Wandering;
SpawnMe's "backScript" = $Wandering;
SpawnMe's "StartingScript" = $Wandering;

( Loop2 ) ++;
end
end
end
end
else if ( RollMe4 == 2 )
// spawn medium monster pack first
begin
if ( $ListSize ( ListMonster2 ) <= PopMonsterRate )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Wandering;
SpawnMe's "basicScript" = $Wandering;
SpawnMe's "backScript" = $Wandering;
SpawnMe's "StartingScript" = $Wandering;

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListMonster2 ) > PopMonsterRate )
begin
if ( $ListSize ( ListMonster ) < Loop1Roll )
begin
SpawnThis = $RandomNumber (2) + 30;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Animal;
SpawnMe's "basicScript" = $Animal;
SpawnMe's "backScript" = $Animal;
SpawnMe's "StartingScript" = $Animal;

( Loop1 ) ++;
end
end
end
end
end
end
else if ( RollMe2 == 100 )
// spawn large tier 1-2 animal/monster pack, 1/4 chance
begin
Loop1Roll = $RandomNumber (5) + 6; // 2-6, 4-8, 6-10
Loop2Roll = $RandomNumber (3) + 6; // 2-4, 4-6, 6-8

RollMe3 = $RandomNumber (8) + 1; // [change] ?change to 10/20/30?
RollMe4 = $RandomNumber (2) + 1;

if ( RollMe3 <= 2 )
begin
if ( RollMe4 == 1)
// spawn large animal pack first
begin
if ( $ListSize ( ListMonster ) <= PopAnimalRate )
begin
SpawnThis = $RandomNumber (2) + 30;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Animal;
SpawnMe's "basicScript" = $Animal;
SpawnMe's "backScript" = $Animal;
SpawnMe's "StartingScript" = $Animal;

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListMonster ) > PopAnimalRate )
begin
if ( $ListSize ( ListMonster2 ) < Loop2Roll )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Wandering;
SpawnMe's "basicScript" = $Wandering;
SpawnMe's "backScript" = $Wandering;
SpawnMe's "StartingScript" = $Wandering;

( Loop2 ) ++;
end
end
end
end
else if ( RollMe4 == 2 )
// spawn large monster pack first
begin
if ( $ListSize ( ListMonster2 ) <= PopMonsterRate )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Wandering;
SpawnMe's "basicScript" = $Wandering;
SpawnMe's "backScript" = $Wandering;
SpawnMe's "StartingScript" = $Wandering;

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListMonster2 ) > PopMonsterRate )
begin
if ( $ListSize ( ListMonster ) < Loop1Roll )
begin
SpawnThis = $RandomNumber (2) + 30;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Animal;
SpawnMe's "basicScript" = $Animal;
SpawnMe's "backScript" = $Animal;
SpawnMe's "StartingScript" = $Animal;

( Loop1 ) ++;
end
end
end
end
end
end
end
BILLYREDNECK 1 20 Feb, 2021 @ 2:15pm 
part 4

else if ( RollMe == 5 )
// tier 1-2 animal/monster pack raids, same animal/monster type, small/medium/large
// meant to feel like random environment event, not like a mission specific raid
begin

Loc1 = $RandomEdgeCoord ( $RandomNumber (4) );
Loop1Roll = $RandomNumber (5) + 2; // 2-6, 4-8, 6-10
Loop2Roll = $RandomNumber (3) + 2; // 2-4, 4-6, 6-8

//RollMe2 = $RandomNumber (4) + 1;
RollMe2 = $RandomNumber (3) + 1;

if ( RollMe2 == 1 )
// spawn small tier 1-2 animal pack raid first
begin
if ( $ListSize ( ListMonster ) <= PopAnimalRate )
begin
SpawnThis = $RandomNumber (2) + 30; // 30-31
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop1 ) ++;
end

$MiniMapAnimation ( Loc1, "Event_Beacon" );
end
else if ( $ListSize ( ListMonster ) > PopAnimalRate )
begin
if ( $ListSize ( ListMonster2 ) < PopMonsterRate )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop2 ) ++;
end

$MiniMapAnimation ( Loc1, "Event_Beacon" );
end
end
end
else if ( RollMe2 == 2 )
// spawn small tier 1-2 monster pack raid first
begin
if ( $ListSize ( ListMonster2 ) <= PopMonsterRate )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop2 ) ++;
end
end
else if ( $ListSize ( ListMonster2 ) > PopMonsterRate )
begin
if ( $ListSize ( ListMonster ) < Loop1Roll )
begin
SpawnThis = $RandomNumber (2) + 30;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop1 ) ++;
end
end
end
end
else if ( RollMe2 == 3 )
// spawn medium tier 1-2 animal/monster pack raid, 3/10 chance
begin
Loop1Roll = $RandomNumber (5) + 4; // 2-6, 4-8, 6-10
Loop2Roll = $RandomNumber (3) + 4; // 2-4, 4-6, 6-8

RollMe3 = $RandomNumber (10) + 1; // [change] ?change to 10/20/30?
RollMe4 = $RandomNumber (2) + 1;

if ( RollMe3 <= 3 )
begin
if ( RollMe4 == 1)
// spawn medium animal pack raid first
begin
if ( $ListSize ( ListMonster ) <= PopAnimalRate )
begin
SpawnThis = $RandomNumber (2) + 30;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListMonster ) > PopAnimalRate )
begin
if ( $ListSize ( ListMonster2 ) < Loop2Roll )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop2 ) ++;
end
end
end
end
else if ( RollMe4 == 2 )
// spawn medium monster pack raid first
begin
if ( $ListSize ( ListMonster2 ) <= PopMonsterRate )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListMonster2 ) > PopMonsterRate )
begin
if ( $ListSize ( ListMonster ) < Loop1Roll )
begin
SpawnThis = $RandomNumber (2) + 30;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop1 ) ++;
end
end
end
end
end
end
else if ( RollMe2 == 100 )
// spawn large tier 1-2 animal/monster pack raid, 1/4 chance
begin
Loop1Roll = $RandomNumber (5) + 6; // 2-6, 4-8, 6-10
Loop2Roll = $RandomNumber (3) + 6; // 2-4, 4-6, 6-8

RollMe3 = $RandomNumber (20) + 1; // [change] ?change to 10/20/30?
RollMe4 = $RandomNumber (2) + 1;

if ( RollMe3 <= 5 )
begin
if ( RollMe4 == 1)
// spawn large animal pack first
begin
if ( $ListSize ( ListMonster ) <= PopAnimalRate )
begin
SpawnThis = $RandomNumber (2) + 30;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListMonster ) > PopAnimalRate )
begin
if ( $ListSize ( ListMonster2 ) < Loop2Roll )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop2 ) ++;
end
end
end
end
else if ( RollMe4 == 2 )
// spawn large monster pack raid first
begin
if ( $ListSize ( ListMonster2 ) <= PopMonsterRate )
begin
SpawnThis = 32;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop1 ) ++;
end
end
else if ( $ListSize ( ListMonster2 ) > PopMonsterRate )
begin
if ( $ListSize ( ListMonster ) < Loop1Roll )
begin
SpawnThis = $RandomNumber (2) + 30;
Spawn1 = $PopEnvironChooser ( SpawnThis );

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop1 ) ++;
end
end
end
end
end
end
end
BILLYREDNECK 1 20 Feb, 2021 @ 2:16pm 
part 5

else if ( RollMe == 6 ) // [inprog] in-progress
// themed animal/monster packs/ and raids, tier 1-3
// meant to feel like random environment event, not like a mission specific raid
begin
Loc1 = $CoordChooser (0);

Rollme2 = $RandomNumber (2) + 1;
//Rollme2 = 1;

if ( RollMe2 == 1 )
// themed animal/monster pack, not raid
begin

//PopAnimalRate = $RandomNumber (21) + 5; // 5-25
//PopMonsterRate = $RandomNumber (16) + 5; // 5-20
Loop1Roll = $RandomNumber (5) + 2; // 2-6
Loop2Roll = $RandomNumber (4) + 1; // 1-4

RollMe3 = $RandomNumber (2) + 1;

if ( $ListSize ( ListMonster ) < PopAnimalRate )
begin
if ( RollMe3 == 1 )
// wandering wolf pack
begin
Spawn1 = "White_Wolf";
Spawn2 = "Werewolf";

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Animal;
SpawnMe's "basicScript" = $Animal;
SpawnMe's "backScript" = $Animal;
SpawnMe's "StartingScript" = $Animal;

( Loop1 ) ++;
end
while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe2 = $SpawnUnit ( Palace, Spawn2, Loc2, #Monster_Player );
SpawnMe2's "activeScript" = $Animal;
SpawnMe2's "basicScript" = $Animal;
SpawnMe2's "backScript" = $Animal;
SpawnMe2's "StartingScript" = $Animal;

( Loop2 ) ++;
end
end
else if ( RollMe3 == 2 )
// wandering rat pack
begin
Spawn1 = "Giant_Rat";
Spawn2 = "Ratman";

while ( Loop1 < Loop1Roll ) do
begin
SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Animal;
SpawnMe's "basicScript" = $Animal;
SpawnMe's "backScript" = $Animal;
SpawnMe's "StartingScript" = $Animal;

( Loop1 ) ++;
end
while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe2 = $SpawnUnit ( Palace, Spawn2, Loc2, #Monster_Player );
SpawnMe2's "activeScript" = $Animal;
SpawnMe2's "basicScript" = $Animal;
SpawnMe2's "backScript" = $Animal;
SpawnMe2's "StartingScript" = $Animal;

( Loop2 ) ++;
end
end
else if ( RollMe3 == 3 )
begin

end
end
end
else if ( RollMe2 == 2 )
// themed animal/monster pack, raid
// only possible if RollMe3 <= 3, otherwise nothing happens
begin
RollMe3 = $RandomNumber (20) + 1;

if ( RollMe3 <= 3 )
// chance of raid spawn
begin
Loop1Roll = $RandomNumber (5) + 2; // 2-6
Loop2Roll = $RandomNumber (4) + 1; // 1-4

RollMe4 = $RandomNumber (2) + 1;

if ( $ListSize ( ListMonster ) < PopAnimalRate )
begin
if ( RollMe4 == 1 )
// raiding wolf pack
begin
Spawn1 = "White_Wolf";
Spawn2 = "Werewolf";

while ( Loop1 < Loop1Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop1 ) ++;
end
while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe2 = $SpawnUnit ( Palace, Spawn2, Loc2, #Monster_Player );
SpawnMe2's "activeScript" = $Raider;
SpawnMe2's "basicScript" = $Raider;
SpawnMe2's "backScript" = $Raider;
SpawnMe2's "StartingScript" = $Raider;

( Loop2 ) ++;
end
end
else if ( RollMe4 == 2 )
// raiding rat pack
begin
Spawn1 = "Giant_Rat";
Spawn2 = "Ratman";

while ( Loop1 < Loop1Roll ) do
begin
SpawnMe = $SpawnUnit ( Palace, Spawn1, Loc2, #Monster_Player );
SpawnMe's "activeScript" = $Raider;
SpawnMe's "basicScript" = $Raider;
SpawnMe's "backScript" = $Raider;
SpawnMe's "StartingScript" = $Raider;

( Loop1 ) ++;
end
while ( Loop2 < Loop2Roll ) do
begin
Loc2 = $RandomCoord ( Loc1, 400 );

SpawnMe2 = $SpawnUnit ( Palace, Spawn2, Loc2, #Monster_Player );
SpawnMe2's "activeScript" = $Raider;
SpawnMe2's "basicScript" = $Raider;
SpawnMe2's "backScript" = $Raider;
SpawnMe2's "StartingScript" = $Raider;

( Loop2 ) ++;
end
end
end
end
end
end
< >
Showing 1-15 of 26 comments
Per page: 1530 50