Nava2
2009-03-24 18:02:58
{*******************************************************************************
function FindNPC(TheVar: Variant; var NPC: TNPC):boolean;
By: Widget
Description: Finds the tile of the named NPC and puts it in the NPC var.
Returns true if found, false if not. (Try walking with the MM if
it's not on the main screen. Now uses a Name or NPCType
*******************************************************************************}
Function FindNPC(TheVar: Variant; var NPC: TNPC):boolean;
var
NPCs: array of TNPC;
begin
NPCs := SortNPCs(GetNPCsBy(TheVar));
result := GetArrayLength(NPCs)<>0;
if not result then
Exit;
NPC := NPCs[0];
end;Now you can use either an ID or a name with the same function.
Please post some comments, if the general consensus is that it should stay the same, it will.
People, this WILL break some scripts.
But, this isn't a big deal. It would mean changing FindNPCByID to FindNPC, and GetNPCsByID/GetNPCsByName to GetNPCsBy.
Just laying that out, clearly. :)
E: These are currently committed to the Development SVN, not the regular.