{本段代码的目的 显示Combobox1中怪物名称列表}
procedure TForm1.ComboBox1DropDown(Sender: TObject);
var
Monster:PDWORD;
PtTmp:PDWORD;
_kind:PDWORD;
I:Integer;
_name:PDWORD;
_name1:PWideChar;
_name2:string;
begin
PtTmp:=pointer($924E0C);
PtTmp:=pointer(PtTmp^+$1C);
PtTmp:=pointer(PtTmp^+$8);
PtTmp:=pointer(PtTmp^+$24);
PtTmp:=pointer(PtTmp^+$18);
ComboBox1.Clear;
for I:=0 to 768 do
begin
Monster:=pointer(PtTmp^+I*4);//
if Monster^>0 then {当对象数组列表不为0的时候才添加}
begin
Monster:=Pointer(Monster^+$4);
_kind:=Pointer(Monster^+$B4);{怪物种类 6->怪物,7->NPC,9->宠物,玩家,10->GM}
_name:=Pointer(Monster^+$230);//名称
_name1:=Pointer(_name^+$0);
_name2:=WideCharTostring(_name1);
{输出结果}
if ComboBox1.Items.IndexOf(_name2)<0 then ComboBox1.Items.Add(_name2);
end;
end;
end;