SRL Archive - Reflection Development

GetNPCsByName


Naike

2010-05-30 15:39:07


function GetNPCsByName(S: TStringArray): TNPCArray;
var
NPCs: TNPCArray;
I, II, arrC: Integer;
begin
If Not LoggedIn then
Exit;

SetArrayLength(Result, 1000);
NPCs := GetNPCs;
If (GetArrayLength(NPCs) = 0) then
Exit;

for i:=0 to High(S)do
for ii:=0 to High(NPCs) do
If (Pos(Lowercase(S[I]), Lowercase(NPCs[II].Name)) > 0) then
begin
Inc(arrC);
Result[arrC-1] := NPCs[I];
end;

SetArrayLength(Result, arrC);
end;

Might want that since ID's aren't added?
Don't see why this isn't added yet though..

Nava2

2010-05-30 15:40:37

I liked the system using variants..

Naike

2010-05-30 15:42:40

ID's aren't added to the TNPC type for some reason..?
What do you want to use variants for, the changing indexes :p ?

Nava2

2010-05-30 15:45:28

Nah, this:

FindNPC(identifier: variant): TNPC;

Naike

2010-05-30 16:02:08

Just noticed that someone added st00f (;

Drakan

2010-05-30 16:47:05

From: Naike
Just noticed that someone added st00f (;


I added them this morning….