Try changing this:
SCAR Code:
case Random(4) + 1 of
3: dir := 'nswe';
4: dir := 'wens';
5: dir := 'sewn';
6: dir := 'ewns';
end;
begin
for i := 3 to 6 do
into this:
SCAR Code:
case Random(4) + 1 of
1: dir := 'nswe';
2: dir := 'wens';
3: dir := 'sewn';
4: dir := 'ewns';
end;
begin
for i := 1 to 4 do
Like Nielsie95 already mentioned
Btw I remember this part in a fighting fucntion from a previous SRL version..
Here's the function:
SCAR Code:
{*****************************************************************************
function FindMonster(Color1, Color2, Color3, Tolerance: Integer; MonsterName: String): Boolean;
By: XxKanexX
Description: Rotates compass in all 4 directions and searches for monster. If monster
is found will Attack the monster using "KAttackMonster" function.
*****************************************************************************}
function FindMonster(Color1, Color2, Color3, Tolerance: Integer; MonsterName:
string): Boolean;
var
i: Integer;
dir: string;
begin
case Random(4) + 1 of
1: dir := 'nswe';
2: dir := 'wens';
3: dir := 'sewn';
4: dir := 'ewns';
end;
for i := 1 to 4 do
if (not (KAttackMonster(Color1, Color2, Color3, Tolerance + i, monsterName)))
then
MakeCompass(StrGet(dir, i))
else
begin
Result := True;
Exit;
end;
end;
^^ from SRL 7.0
-Tsn.