SRL Archive - SRL Bugs

Incorrect autocast info.


YoHoJo

2011-12-12 21:01:16

Spell: wind strike        - Level needed: 1  - EXP per cast: 5.5  - AutoCast: False  - Runes:  1 Air Rune(s); 1

Should be true for autocast.
Idk how….

  AutoCasts := [1, 2, 5, 8, 9, 17, 26, 28, 30, 31, 32, 34]; 

It's the second spell, so '2'.

Hobbit

2011-12-12 21:09:00

Shouldn't this:
  AutoCast := (not InIntArray(AutoCasts, I)); 

Be this:
  AutoCast := (InIntArray(AutoCasts, I));

?

Edit: Line 204 of magic.simba

Kyle Undefined

2011-12-12 21:17:36

I just ran into that, and was just looking into it. Kinda lost tbh.

Hobbit

2011-12-12 21:30:47

Here is the vital parts of the include thrown into a test debug program.
First is original include, second is my fix (removing not).
Run to print results.

In short: The not was messing it up.

Sent pull request that fixes it :)


original

program new;




const
rune_Air = 0;
rune_Body = 1;
rune_Mind = 2;
rune_Earth = 3;
rune_Fire = 4;
rune_Water = 5;
rune_Chaos = 6;
rune_Law = 7;
rune_Cosmic = 8;
rune_Death = 9;
rune_Nature = 10;
rune_Blood = 11;
rune_Soul = 12;
rune_Astral = 13;
rune_Count = 14;

{ type TSpell;
Description: Contains info about a certain spell. }
type
TSpell = record
Name: string;
Level: Integer;
AutoCast: Boolean;
Exp: Extended;
RequiredRunes: array of Integer;
RequiredRuneAmount: array of Integer;
end;

{ type SpellMode;
Description: An array of TSpell }
SpellMode = array of TSpell;

var
{ var SpellModes
Description: Stores all the spells, after using SetupSpells.
Use as SpellModes[SpellMode_Combat][I] example..}
SpellModes: array of SpellMode;

{ var SpellSetUp
Description: Is set to true if the spells are setup}
SpellSetUp: Boolean;

{ var srl_magic_BookSortedBy
Description: Stores the sort method of the current spellbook}
srl_magic_BookSortedBy: integer;



Const
{ const TotalSpells
Description: Number of spells in your spellbook}
TotalSpells = 65;

{ const SpellMode_
Description: consts for the in-game spellmodes
note: SpellMode_All stands for all of them}
SpellMode_Combat = 0;
SpellMode_Teleport = 1;
SpellMode_Misc = 2;
SpellMode_Skill = 3;
SpellMode_All = 10;

{ const BookSort_
Description: consts for the in-game magic book sorts}
BookSort_Level = 0;
BookSort_Combat = 1;
BookSort_Teleport = 2;

{*******************************************************************************
procedure SetupSpells;
By: N1ke!
Rev: 39
Date: 12 Sep 09
Description: Sets the SpellModes var to match the runescape spells.
*******************************************************************************}
procedure SetupSpells;
var
I, H: Integer;
Names: TstringArray;
Exps: TExtendedArray;
Levels, AutoCasts: TIntegerArray;
ReqRunes: array of TIntegerArray;
ReqRuneAmt: array of TIntegerArray;
begin
SetArrayLength(SpellModes, 4);
srl_magic_BookSortedBy := -1;

{SpellMode_Combat}
Names := ['wind rush', 'wind strike', 'confuse', 'water strike', 'earth strike',
'weaken', 'fire strike', 'wind bolt', 'curse', 'bind',
'water bolt', 'earth bolt', 'fire bolt', 'crumble undead',
'wind blast', 'water blast', 'iban blast', 'snare',
'magic dart', 'earth blast', 'fire blast', 'saradomin strike',
'claws of guthix', 'flames of zamorak', 'wind wave',
'water wave', 'vulnerability', 'earth wave',
'enfeeble', 'fire wave', 'entangle', 'stun', 'charge',
'wind surge', 'teleport block', 'water surge', 'earth surge',
'fire surge'];

Levels := [1, 1, 3, 5, 9, 11, 13, 17, 19, 20, 23, 29, 35, 39,
41, 47, 50, 50, 50, 53, 59, 60, 60, 60, 62, 65,
66, 70, 73, 75, 79, 80, 80, 81, 85, 85, 90, 95];

Exps := [3.5, 5.5, 13, 7.5, 9.5, 21, 11.5, 13.5, 29, 30, 16.5, 19.5, 22.5, 24.5,
25.5, 28.5, 30, 60, 30, 31.5, 34.5, 35, 35, 35, 36, 37.5, 76,
40, 83, 42.5, 89, 90, 180, 75, 80, 80, 85, 90];

AutoCasts := [1, 2, 5, 8, 9, 17, 26, 28, 30, 31, 32, 34];

ReqRuneAmt := [
TIntegerArray([1]), TIntegerArray([1, 1]), TIntegerArray([3, 2, 1]),
TIntegerArray([1, 1, 1]), TIntegerArray([2, 1, 1]), TIntegerArray([3, 2, 1]),
TIntegerArray([3, 2, 1]), TIntegerArray([2, 1]), TIntegerArray([2, 3, 1]),
TIntegerArray([3, 3, 2]), TIntegerArray([2, 2, 1]), TIntegerArray([3, 2, 1]),
TIntegerArray([4, 3, 1]), TIntegerArray([2, 2, 1]), TIntegerArray([3, 1]),
TIntegerArray([3, 3, 1]), TIntegerArray([5, 1 {Iban Staff}]), TIntegerArray([4, 4, 3]),
TIntegerArray([1, 4 {Slayer Staff}]), TIntegerArray([4, 3, 1]), TIntegerArray([5, 4, 1]),
TIntegerArray([2, 2, 4 {Staff of Saradomin}]), TIntegerArray([1, 2, 4 {Staff of Guthx or Void Knight Mace}]),
TIntegerArray([4, 2, 1 {Staff of Zamorak}]), TIntegerArray([5, 1]), TIntegerArray([7, 5, 1]),
TIntegerArray([5, 5, 1]), TIntegerArray([7, 5, 1]), TIntegerArray([8, 8, 1]),
TIntegerArray([7, 5, 1]), TIntegerArray([5, 5, 4]), TIntegerArray([12, 12, 1]),
TIntegerArray([3, 3, 3]), TIntegerArray([7, 1, 1]), TIntegerArray([1, 1, 1]),
TIntegerArray([10, 7, 1, 1]), TIntegerArray([10, 7, 1, 1]), TIntegerArray([10, 7, 1, 1])
];

ReqRunes := [
TIntegerArray([rune_Air]), {}
TIntegerArray([rune_Air, rune_Mind]), {}
TIntegerArray([rune_Water, rune_Earth, rune_Body]), {}
TIntegerArray([rune_Water, rune_Air, rune_Mind]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Mind]), {}
TIntegerArray([rune_Water, rune_Earth, rune_Body]), {}
TIntegerArray([rune_Fire, rune_Air, rune_Mind]), {}
TIntegerArray([rune_Air, rune_Chaos]), {}
TIntegerArray([rune_Water, rune_Earth, rune_Body]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Nature]), {}
TIntegerArray([rune_Water, rune_Air, rune_Chaos]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Chaos]), {}
TIntegerArray([rune_Fire, rune_Air, rune_Chaos]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Chaos]), {}
TIntegerArray([rune_Air, rune_Death]), {}
TIntegerArray([rune_Water, rune_Air, rune_Death]), {}
TIntegerArray([rune_Fire, rune_Death {Iban Staff}]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Nature]), {}
TIntegerArray([rune_Death, rune_Mind {Slayer Staff}]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Death]), {}
TIntegerArray([rune_Fire, rune_Air, rune_Death]), {}
TIntegerArray([rune_Fire, rune_Blood, rune_Air {Staff of Saradomin}]), {}
TIntegerArray([rune_Fire, rune_Blood, rune_Air {Staff of Guthx or Void Knight Mace}]), {}
TIntegerArray([rune_Fire, rune_Blood, rune_Air {Staff of Zamorak}]), {}
TIntegerArray([rune_Air, rune_Blood]), {}
TIntegerArray([rune_Water, rune_Air, rune_Blood]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Soul]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Blood]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Soul]), {}
TIntegerArray([rune_Fire, rune_Air, rune_Blood]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Nature]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Soul]), {}
TIntegerArray([rune_Fire, rune_Blood, rune_Air]), {}
TIntegerArray([rune_Air, rune_Blood, rune_Death]), {}
TIntegerArray([rune_Death, rune_Chaos, rune_Law]), {}
TIntegerArray([rune_Water, rune_Air, rune_Blood, rune_Death]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Blood, rune_Death]), {}
TIntegerArray([rune_Fire, rune_Air, rune_Blood, rune_Death])
];

SetArrayLength(SpellModes[SpellMode_Combat], GetArrayLength(Names));
H := High(Names);
for I:=0 to H do
with SpellModes[SpellMode_Combat][I] do
begin
Name := Names[I];
Level := Levels[I];
Exp := Exps[I];
AutoCast := (not InIntArray(AutoCasts, I));
RequiredRunes := ReqRunes[i];
RequiredRuneAmount := ReqRuneAmt[i];
end;


{SpellMode_Teleport}
Names := ['lumbridge home teleport', 'mobilising armies teleport',
'varrock teleport', 'lumbridge teleport',
'falador teleport', 'teleport to house',
'camelot teleport', 'ardougne teleport', 'watchtower teleport',
'trollheim teleport', 'teleport to ape atoll',
'teleother lumbridge', 'teleother falador',
'teleother camelot'];

Levels := [0, 10, 25, 31, 37, 40, 45, 51, 58, 61, 64, 74, 82, 90];

Exps := [0, 19, 35, 41, 48, 30, 55.5, 61, 68, 68, 74, 84, 92, 100];

ReqRuneAmt := [
TIntegerArray([0 {lumbridge home tele}]), TIntegerArray([1, 1, 1]),
TIntegerArray([1, 3, 1]), TIntegerArray([1, 3, 1]), TIntegerArray([1, 3, 1]),
TIntegerArray([1, 1, 1]), TIntegerArray([5, 1]), TIntegerArray([2, 2]),
TIntegerArray([2, 2]), TIntegerArray([2, 2]), TIntegerArray([2, 2, 2]),
TIntegerArray([1, 1, 1]), TIntegerArray([1, 1, 1]), TIntegerArray([2, 1])
];

ReqRunes := [
TIntegerArray([0 {lumbridge home tele}]),
TIntegerArray([rune_Law, rune_Air, rune_Water]),
TIntegerArray([rune_Fire, rune_Air, rune_Law]),
TIntegerArray([rune_Earth, rune_Air, rune_Law]),
TIntegerArray([rune_Water, rune_Air, rune_Law]),
TIntegerArray([rune_Air, rune_Earth, rune_Law]),
TIntegerArray([rune_Air, rune_Law]),
TIntegerArray([rune_Water, rune_Law]),
TIntegerArray([rune_Earth, rune_Law]),
TIntegerArray([rune_Fire, rune_Law]),
TIntegerArray([rune_Water, rune_Fire, rune_Law {Banana}]),
TIntegerArray([rune_Soul, rune_Law, rune_Earth]),
TIntegerArray([rune_Soul, rune_Law, rune_Water]),
TIntegerArray([rune_Soul, rune_Law])
];

SetArrayLength(SpellModes[SpellMode_Teleport], GetArrayLength(Names));
H := High(Names);
for I:=0 to High(Names)do
with SpellModes[SpellMode_Teleport][I] do
begin
Name := Names[I];
Level := Levels[I];
Exp := Exps[I];
AutoCast := (not InIntArray(AutoCasts, I));
RequiredRunes := ReqRunes[i];
RequiredRuneAmount := ReqRuneAmt[i];
end;


{SpellMode_Misc}
Names := ['bones to bananas', 'low level alchemy', 'telekinetic grab',
'high level alchemy', 'bones to peaches'];

Levels := [15, 21, 33, 55, 60];

Exps := [25, 31, 43, 65, 35.5];

ReqRuneAmt := [
TIntegerArray([2, 2, 1]), TIntegerArray([3, 1]), TIntegerArray([1, 1]),
TIntegerArray([5, 1]), TIntegerArray([4, 4, 2])
];

ReqRunes := [
TIntegerArray([rune_Earth, rune_Water, rune_Nature]),
TIntegerArray([rune_Fire, rune_Nature]),
TIntegerArray([rune_Air, rune_Law]),
TIntegerArray([rune_Fire, rune_Nature]),
TIntegerArray([rune_Water, rune_Earth, rune_Nature])
];

SetArrayLength(SpellModes[SpellMode_Misc], GetArrayLength(Names));
H := High(Names);
for I:=0 to High(Names)do
with SpellModes[SpellMode_Misc][I] do
begin
Name := Names[I];
Level := Levels[I];
Exp := Exps[I];
AutoCast := false;
RequiredRunes := ReqRunes[i];
RequiredRuneAmount := ReqRuneAmt[i];
end;


{SpellMode_Skill}
Names := ['enchant crossbow bolt', 'lvl-1 enchant', 'lvl-2 enchant',
'superheat item', 'lvl-3 enchant', 'charge water orb',
'lvl-4 enchant', 'charge earth orb', 'charge fire orb',
'charge air orb', 'lvl-5 enchant', 'lvl-6 enchant'];

Levels := [4, 7, 27, 43, 49, 56, 57, 60, 63, 66, 68, 87];

Exps := [0, 17.5, 37, 53, 59, 66, 67, 70, 73, 76, 78, 97];

ReqRuneAmt := [
TIntegerArray([0 {enchant bolt}]), TIntegerArray([1, 1]), TIntegerArray([3, 1]),
TIntegerArray([4, 1]), TIntegerArray([5, 1]), TIntegerArray([30, 3 {Orb}]),
TIntegerArray([10, 1]), TIntegerArray([30, 3 {Orb}]), TIntegerArray([30, 3 {Orb}]),
TIntegerArray([30, 3 {Orb}]), TIntegerArray([15, 15, 1]), TIntegerArray([20, 20, 1])
];

ReqRunes := [
TIntegerArray([0 {enchant bolt}]),
TIntegerArray([rune_Water, rune_Cosmic]),
TIntegerArray([rune_Air, rune_Cosmic]),
TIntegerArray([rune_Fire, rune_Nature]),
TIntegerArray([rune_Fire, rune_Cosmic]),
TIntegerArray([rune_Water, rune_Cosmic]),
TIntegerArray([rune_Earth, rune_Cosmic]),
TIntegerArray([rune_Earth, rune_Cosmic]),
TIntegerArray([rune_Fire, rune_Cosmic]),
TIntegerArray([rune_Air, rune_Cosmic]),
TIntegerArray([rune_Water, rune_Earth, rune_Cosmic]),
TIntegerArray([rune_Earth, rune_Fire, rune_Cosmic])
];

SetArrayLength(SpellModes[SpellMode_Skill], GetArrayLength(Names));
H := High(Names);
for I:=0 to High(Names) do
with SpellModes[SpellMode_Skill][I] do
begin
Name := Names[I];
Level := Levels[I];
Exp := Exps[I];
AutoCast := false;
RequiredRunes := ReqRunes[i];
RequiredRuneAmount := ReqRuneAmt[i];
end;

SpellSetUp := True;
end;



begin
SetupSpells;
writeln(SpellModes[0][1].Name);
writeln(BoolToStr(SpellModes[0][1].AutoCast));
end.


My Fix:
program new;




const
rune_Air = 0;
rune_Body = 1;
rune_Mind = 2;
rune_Earth = 3;
rune_Fire = 4;
rune_Water = 5;
rune_Chaos = 6;
rune_Law = 7;
rune_Cosmic = 8;
rune_Death = 9;
rune_Nature = 10;
rune_Blood = 11;
rune_Soul = 12;
rune_Astral = 13;
rune_Count = 14;

{ type TSpell;
Description: Contains info about a certain spell. }
type
TSpell = record
Name: string;
Level: Integer;
AutoCast: Boolean;
Exp: Extended;
RequiredRunes: array of Integer;
RequiredRuneAmount: array of Integer;
end;

{ type SpellMode;
Description: An array of TSpell }
SpellMode = array of TSpell;

var
{ var SpellModes
Description: Stores all the spells, after using SetupSpells.
Use as SpellModes[SpellMode_Combat][I] example..}
SpellModes: array of SpellMode;

{ var SpellSetUp
Description: Is set to true if the spells are setup}
SpellSetUp: Boolean;

{ var srl_magic_BookSortedBy
Description: Stores the sort method of the current spellbook}
srl_magic_BookSortedBy: integer;



Const
{ const TotalSpells
Description: Number of spells in your spellbook}
TotalSpells = 65;

{ const SpellMode_
Description: consts for the in-game spellmodes
note: SpellMode_All stands for all of them}
SpellMode_Combat = 0;
SpellMode_Teleport = 1;
SpellMode_Misc = 2;
SpellMode_Skill = 3;
SpellMode_All = 10;

{ const BookSort_
Description: consts for the in-game magic book sorts}
BookSort_Level = 0;
BookSort_Combat = 1;
BookSort_Teleport = 2;

{*******************************************************************************
procedure SetupSpells;
By: N1ke!
Rev: 39
Date: 12 Sep 09
Description: Sets the SpellModes var to match the runescape spells.
*******************************************************************************}
procedure SetupSpells;
var
I, H: Integer;
Names: TstringArray;
Exps: TExtendedArray;
Levels, AutoCasts: TIntegerArray;
ReqRunes: array of TIntegerArray;
ReqRuneAmt: array of TIntegerArray;
begin
SetArrayLength(SpellModes, 4);
srl_magic_BookSortedBy := -1;

{SpellMode_Combat}
Names := ['wind rush', 'wind strike', 'confuse', 'water strike', 'earth strike',
'weaken', 'fire strike', 'wind bolt', 'curse', 'bind',
'water bolt', 'earth bolt', 'fire bolt', 'crumble undead',
'wind blast', 'water blast', 'iban blast', 'snare',
'magic dart', 'earth blast', 'fire blast', 'saradomin strike',
'claws of guthix', 'flames of zamorak', 'wind wave',
'water wave', 'vulnerability', 'earth wave',
'enfeeble', 'fire wave', 'entangle', 'stun', 'charge',
'wind surge', 'teleport block', 'water surge', 'earth surge',
'fire surge'];

Levels := [1, 1, 3, 5, 9, 11, 13, 17, 19, 20, 23, 29, 35, 39,
41, 47, 50, 50, 50, 53, 59, 60, 60, 60, 62, 65,
66, 70, 73, 75, 79, 80, 80, 81, 85, 85, 90, 95];

Exps := [3.5, 5.5, 13, 7.5, 9.5, 21, 11.5, 13.5, 29, 30, 16.5, 19.5, 22.5, 24.5,
25.5, 28.5, 30, 60, 30, 31.5, 34.5, 35, 35, 35, 36, 37.5, 76,
40, 83, 42.5, 89, 90, 180, 75, 80, 80, 85, 90];

AutoCasts := [1, 2, 5, 8, 9, 17, 26, 28, 30, 31, 32, 34];

ReqRuneAmt := [
TIntegerArray([1]), TIntegerArray([1, 1]), TIntegerArray([3, 2, 1]),
TIntegerArray([1, 1, 1]), TIntegerArray([2, 1, 1]), TIntegerArray([3, 2, 1]),
TIntegerArray([3, 2, 1]), TIntegerArray([2, 1]), TIntegerArray([2, 3, 1]),
TIntegerArray([3, 3, 2]), TIntegerArray([2, 2, 1]), TIntegerArray([3, 2, 1]),
TIntegerArray([4, 3, 1]), TIntegerArray([2, 2, 1]), TIntegerArray([3, 1]),
TIntegerArray([3, 3, 1]), TIntegerArray([5, 1 {Iban Staff}]), TIntegerArray([4, 4, 3]),
TIntegerArray([1, 4 {Slayer Staff}]), TIntegerArray([4, 3, 1]), TIntegerArray([5, 4, 1]),
TIntegerArray([2, 2, 4 {Staff of Saradomin}]), TIntegerArray([1, 2, 4 {Staff of Guthx or Void Knight Mace}]),
TIntegerArray([4, 2, 1 {Staff of Zamorak}]), TIntegerArray([5, 1]), TIntegerArray([7, 5, 1]),
TIntegerArray([5, 5, 1]), TIntegerArray([7, 5, 1]), TIntegerArray([8, 8, 1]),
TIntegerArray([7, 5, 1]), TIntegerArray([5, 5, 4]), TIntegerArray([12, 12, 1]),
TIntegerArray([3, 3, 3]), TIntegerArray([7, 1, 1]), TIntegerArray([1, 1, 1]),
TIntegerArray([10, 7, 1, 1]), TIntegerArray([10, 7, 1, 1]), TIntegerArray([10, 7, 1, 1])
];

ReqRunes := [
TIntegerArray([rune_Air]), {}
TIntegerArray([rune_Air, rune_Mind]), {}
TIntegerArray([rune_Water, rune_Earth, rune_Body]), {}
TIntegerArray([rune_Water, rune_Air, rune_Mind]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Mind]), {}
TIntegerArray([rune_Water, rune_Earth, rune_Body]), {}
TIntegerArray([rune_Fire, rune_Air, rune_Mind]), {}
TIntegerArray([rune_Air, rune_Chaos]), {}
TIntegerArray([rune_Water, rune_Earth, rune_Body]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Nature]), {}
TIntegerArray([rune_Water, rune_Air, rune_Chaos]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Chaos]), {}
TIntegerArray([rune_Fire, rune_Air, rune_Chaos]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Chaos]), {}
TIntegerArray([rune_Air, rune_Death]), {}
TIntegerArray([rune_Water, rune_Air, rune_Death]), {}
TIntegerArray([rune_Fire, rune_Death {Iban Staff}]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Nature]), {}
TIntegerArray([rune_Death, rune_Mind {Slayer Staff}]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Death]), {}
TIntegerArray([rune_Fire, rune_Air, rune_Death]), {}
TIntegerArray([rune_Fire, rune_Blood, rune_Air {Staff of Saradomin}]), {}
TIntegerArray([rune_Fire, rune_Blood, rune_Air {Staff of Guthx or Void Knight Mace}]), {}
TIntegerArray([rune_Fire, rune_Blood, rune_Air {Staff of Zamorak}]), {}
TIntegerArray([rune_Air, rune_Blood]), {}
TIntegerArray([rune_Water, rune_Air, rune_Blood]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Soul]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Blood]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Soul]), {}
TIntegerArray([rune_Fire, rune_Air, rune_Blood]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Nature]), {}
TIntegerArray([rune_Earth, rune_Water, rune_Soul]), {}
TIntegerArray([rune_Fire, rune_Blood, rune_Air]), {}
TIntegerArray([rune_Air, rune_Blood, rune_Death]), {}
TIntegerArray([rune_Death, rune_Chaos, rune_Law]), {}
TIntegerArray([rune_Water, rune_Air, rune_Blood, rune_Death]), {}
TIntegerArray([rune_Earth, rune_Air, rune_Blood, rune_Death]), {}
TIntegerArray([rune_Fire, rune_Air, rune_Blood, rune_Death])
];

SetArrayLength(SpellModes[SpellMode_Combat], GetArrayLength(Names));
H := High(Names);
for I:=0 to H do
with SpellModes[SpellMode_Combat][I] do
begin
Name := Names[I];
Level := Levels[I];
Exp := Exps[I];
AutoCast := (InIntArray(AutoCasts, I));
RequiredRunes := ReqRunes[i];
RequiredRuneAmount := ReqRuneAmt[i];
end;


{SpellMode_Teleport}
Names := ['lumbridge home teleport', 'mobilising armies teleport',
'varrock teleport', 'lumbridge teleport',
'falador teleport', 'teleport to house',
'camelot teleport', 'ardougne teleport', 'watchtower teleport',
'trollheim teleport', 'teleport to ape atoll',
'teleother lumbridge', 'teleother falador',
'teleother camelot'];

Levels := [0, 10, 25, 31, 37, 40, 45, 51, 58, 61, 64, 74, 82, 90];

Exps := [0, 19, 35, 41, 48, 30, 55.5, 61, 68, 68, 74, 84, 92, 100];

ReqRuneAmt := [
TIntegerArray([0 {lumbridge home tele}]), TIntegerArray([1, 1, 1]),
TIntegerArray([1, 3, 1]), TIntegerArray([1, 3, 1]), TIntegerArray([1, 3, 1]),
TIntegerArray([1, 1, 1]), TIntegerArray([5, 1]), TIntegerArray([2, 2]),
TIntegerArray([2, 2]), TIntegerArray([2, 2]), TIntegerArray([2, 2, 2]),
TIntegerArray([1, 1, 1]), TIntegerArray([1, 1, 1]), TIntegerArray([2, 1])
];

ReqRunes := [
TIntegerArray([0 {lumbridge home tele}]),
TIntegerArray([rune_Law, rune_Air, rune_Water]),
TIntegerArray([rune_Fire, rune_Air, rune_Law]),
TIntegerArray([rune_Earth, rune_Air, rune_Law]),
TIntegerArray([rune_Water, rune_Air, rune_Law]),
TIntegerArray([rune_Air, rune_Earth, rune_Law]),
TIntegerArray([rune_Air, rune_Law]),
TIntegerArray([rune_Water, rune_Law]),
TIntegerArray([rune_Earth, rune_Law]),
TIntegerArray([rune_Fire, rune_Law]),
TIntegerArray([rune_Water, rune_Fire, rune_Law {Banana}]),
TIntegerArray([rune_Soul, rune_Law, rune_Earth]),
TIntegerArray([rune_Soul, rune_Law, rune_Water]),
TIntegerArray([rune_Soul, rune_Law])
];

SetArrayLength(SpellModes[SpellMode_Teleport], GetArrayLength(Names));
H := High(Names);
for I:=0 to High(Names)do
with SpellModes[SpellMode_Teleport][I] do
begin
Name := Names[I];
Level := Levels[I];
Exp := Exps[I];
AutoCast := (not InIntArray(AutoCasts, I));
RequiredRunes := ReqRunes[i];
RequiredRuneAmount := ReqRuneAmt[i];
end;


{SpellMode_Misc}
Names := ['bones to bananas', 'low level alchemy', 'telekinetic grab',
'high level alchemy', 'bones to peaches'];

Levels := [15, 21, 33, 55, 60];

Exps := [25, 31, 43, 65, 35.5];

ReqRuneAmt := [
TIntegerArray([2, 2, 1]), TIntegerArray([3, 1]), TIntegerArray([1, 1]),
TIntegerArray([5, 1]), TIntegerArray([4, 4, 2])
];

ReqRunes := [
TIntegerArray([rune_Earth, rune_Water, rune_Nature]),
TIntegerArray([rune_Fire, rune_Nature]),
TIntegerArray([rune_Air, rune_Law]),
TIntegerArray([rune_Fire, rune_Nature]),
TIntegerArray([rune_Water, rune_Earth, rune_Nature])
];

SetArrayLength(SpellModes[SpellMode_Misc], GetArrayLength(Names));
H := High(Names);
for I:=0 to High(Names)do
with SpellModes[SpellMode_Misc][I] do
begin
Name := Names[I];
Level := Levels[I];
Exp := Exps[I];
AutoCast := false;
RequiredRunes := ReqRunes[i];
RequiredRuneAmount := ReqRuneAmt[i];
end;


{SpellMode_Skill}
Names := ['enchant crossbow bolt', 'lvl-1 enchant', 'lvl-2 enchant',
'superheat item', 'lvl-3 enchant', 'charge water orb',
'lvl-4 enchant', 'charge earth orb', 'charge fire orb',
'charge air orb', 'lvl-5 enchant', 'lvl-6 enchant'];

Levels := [4, 7, 27, 43, 49, 56, 57, 60, 63, 66, 68, 87];

Exps := [0, 17.5, 37, 53, 59, 66, 67, 70, 73, 76, 78, 97];

ReqRuneAmt := [
TIntegerArray([0 {enchant bolt}]), TIntegerArray([1, 1]), TIntegerArray([3, 1]),
TIntegerArray([4, 1]), TIntegerArray([5, 1]), TIntegerArray([30, 3 {Orb}]),
TIntegerArray([10, 1]), TIntegerArray([30, 3 {Orb}]), TIntegerArray([30, 3 {Orb}]),
TIntegerArray([30, 3 {Orb}]), TIntegerArray([15, 15, 1]), TIntegerArray([20, 20, 1])
];

ReqRunes := [
TIntegerArray([0 {enchant bolt}]),
TIntegerArray([rune_Water, rune_Cosmic]),
TIntegerArray([rune_Air, rune_Cosmic]),
TIntegerArray([rune_Fire, rune_Nature]),
TIntegerArray([rune_Fire, rune_Cosmic]),
TIntegerArray([rune_Water, rune_Cosmic]),
TIntegerArray([rune_Earth, rune_Cosmic]),
TIntegerArray([rune_Earth, rune_Cosmic]),
TIntegerArray([rune_Fire, rune_Cosmic]),
TIntegerArray([rune_Air, rune_Cosmic]),
TIntegerArray([rune_Water, rune_Earth, rune_Cosmic]),
TIntegerArray([rune_Earth, rune_Fire, rune_Cosmic])
];

SetArrayLength(SpellModes[SpellMode_Skill], GetArrayLength(Names));
H := High(Names);
for I:=0 to High(Names) do
with SpellModes[SpellMode_Skill][I] do
begin
Name := Names[I];
Level := Levels[I];
Exp := Exps[I];
AutoCast := false;
RequiredRunes := ReqRunes[i];
RequiredRuneAmount := ReqRuneAmt[i];
end;

SpellSetUp := True;
end;



begin
SetupSpells;
writeln(SpellModes[0][1].Name);
writeln(BoolToStr(SpellModes[0][1].AutoCast));
end.

Narcle

2011-12-12 22:13:32

I wonder when he did that? I worked on Cast() long time ago and was working good, so must of been after that.

Coh3n

2011-12-12 22:41:31

Merged Hobbit, thanks.