Code: Select all
if ( (pmtDesc->word14_12_15() > 1) // ie: 3, 4, or 6
&& ((d.OrthogonalDistance2Party > 1) || (STRandomBool() != 0)) )
{
if ( (mtD7 == mon_Vexirk) || (mtD7 == mon_LordChaos) )
{
if (STRandomBool() != 0)
{
objD7 = RNFireball;
}
else
{
switch (STRandom0_3())
{
case 0: objD7 = RNDispellMissile; break;
case 1: objD7 = RNLightning; break;
case 2: objD7 = RNPoisonCloud; break;
case 3: objD7 = RNZoSpell; break;
}; //switch()
};
}
else
{
switch (mtD7)
{
case mon_SlimeDevil:
objD7 = RNPoison; break;
case mon_FlyingEye:
if (STRandom(8) != 0) objD7 = RNLightning;
else objD7 = RNZoSpell;
break;
case mon_Zytaz:
if (STRandomBool() != 0) objD7 = RNPoisonCloud;
else objD7 = RNFireball;
break;
case mon_Demon:
case mon_Dragon:
objD7 = RNFireball;
break;
}; // switch
};
D4W = sw(pmtDesc->uByte8[4]/4 + 1);
D4W = sw(D4W + STRandom(D4W));
D4W = sw(D4W + STRandom(D4W));
LaunchMissile(
objD7, //parameter
mapX,
mapY,
D5W, //position??
d.PrimaryDirectionToParty, //direction???
ApplyLimits(20, D4W, 255),
pmtDesc->uByte8[4],
8);
}
Notice that it is all wired into the code. It starts by testing
word14 bits 12-15 to see if they are greater than 1. Any idea
what that test means? Also, it appears the spells are cast
if the distance to the party is greater than 1 or 50-50 probability
if the distance is 1. The spell's strength is also computed.
I suggest that we do with these things the same as we did for
party spells. We provide a mechanism for the designer to
write a "Monster Spell Filter". Then you can override the
up-front tests (should the monster cast a spell?) and provide
the name of the spell to be cast and its strength. Otherwise
you are going to be hounding me forever with requests like:
"Can you disable Vexirk Zo spells on level 5 if the third party
member has a broken apple in their shield hand?" Doing this
will also allow you to make Screamers that cast fireballs.