SRL Archive - SRL Suggestions

Further RuneAmount Support


Raskolnikov

2012-03-28 03:19:22

This is in amount in the core folder.

function RuneAmount(Area, RuneType: string): Integer;
var
RuneBmp, II: Integer;
RuneNames: TStringArray;
begin
RuneNames := ['air', 'mind', 'water', 'fire', 'earth', 'law', 'nature', 'chaos', 'death', 'body', 'cosmic', 'soul', 'blood'];
if (InStrArrEx(Lowercase(RuneType), RuneNames, II)) then
begin
RuneBmp := srl_GetBitmap(18 + II);
Result := ItemAmount(Area, 'bmp', RuneBmp, [20]);
FreeBitmap(RuneBmp);
end else
srl_Warn('RuneAmount', 'Invalid RuneType: ''' + RuneType + '''', warn_AllVersions);
end;

Currently, it doesn't have support for armadyl runes or astral runes. Considering there are no extra bitmaps to be added, it's just a pretty simple change.

function RuneAmount(Area, RuneType: string): Integer;
var
RuneBmp, II: Integer;
RuneNames: TStringArray;
begin
RuneNames := ['air', 'mind', 'water', 'fire', 'earth', 'law', 'nature', 'chaos', 'death', 'body', 'cosmic', 'soul', 'blood', 'astral', 'armadyl'];
if (InStrArrEx(Lowercase(RuneType), RuneNames, II)) then
begin
RuneBmp := srl_GetBitmap(18 + II);
Result := ItemAmount(Area, 'bmp', RuneBmp, [20]);
FreeBitmap(RuneBmp);
end else
srl_Warn('RuneAmount', 'Invalid RuneType: ''' + RuneType + '''', warn_AllVersions);
end;

Thanks for your time!s

Coh3n

2012-03-28 18:53:23

The bitmaps already exist, the function just didn't support them?

Raskolnikov

2012-03-28 19:47:56

Oh wait they don't. Disregard this until I grab some bitmaps.

Wyn

2012-04-03 08:47:20

What happened? I just noticed this was missing astral support myself.