the mobstuff isn't more hard to handle than the player stuff.
if you're using a debugger and set breakpoints on the values, u'll find this structure to get the current mob hp:
Code:
clientbase + 0x1C + 0x8 + 0x24 + 0x18+ X*0x4 + 0x4 + 0x12C
well since 0x12C the the hp offset, the stuff before that points to the mob base.
if you check the 5th offset u'll see that there's a variable in it. the client seems to allways keep track of all npcs/pets/mobs in ur range.
you can easily use that for your tool. make it loop through that mob table (from 0 to 768) to get all mobs around you.
now that u've got the infos for all mobs around you, you can simply filter out the mob u've selected from that list.
to get the selected mobs id, you can use this structure:
Code:
clientbase + 0x1C + 0x20 + 0xB00
now that u've got the mob base, you can take a look deeper in it. comparing the info of more mobs will get you more adresses, which could be helpfull for your tool later.
for me i found those adresses kinda helpful:
Code:
selected type = 0 (mob/npc/pet?)
cur HP = 0x12C
max HP = 0x16C
xtra info = 0x248
so when u're done, you should be able to build up this code:
Code:
Func GetSelectedInfo($pid)
Local $array[8], $mid, $clientbase, $base, $pointer1, $pointer2, $pointer3, $pointer4, $mob_base, $mob_id, $mob_name, $mob_lvl, $i
$mid = memopen($pid)
$clientbase = memread($mid, 0x9F3E6C)
$base = memread($mid, $clientbase + 0x1C)
$selected = memread($mid, memread($mid, $base + 0x20) + 0xB00)
If $selected = 0 Then ; If nothing is selected, there's no need to display anything.
Return False
EndIf
$pointer3 = memread($mid, memread($mid, memread($mid, $base + 0x8) + 0x24) + 0x18)
For $i=0 To 768
$pointer4 = memread($mid, $pointer3 + $i*0x4)
$mob_base = memread($mid, $pointer4 + 0x4)
If $mob_base<>0 Then
$mob_id = memread($mid, $mob_base + 0x11C)
If $selected = $mob_id Then
$array[0] = memread($mid, $mob_base + 0x12C) ;cur HP
$array[1] = memread($mid, $mob_base + 0x16C) ;max HP
$array[2] = $array[0]/$array[1] * 100 ;percentage
$array[4] = memread($mid, memread($mid, $mob_base + 0x254), 'wchar[30]') ;Mob Name
$array[5] = memread($mid, $mob_base + 0x124) ; Mob Level
Switch memread($mid, $mob_base + 0x248)
Case 0
$array[6] = 'normal'
Case 1
$array[6] = 'Increased Movement'
Case 2
$array[6] = 'Unknown Special'
Case 3
$array[6] = 'Increased Defence'
Case 4
$array[6] = 'Increased Magical Resistance'
Case 5
$array[6] = 'Increased Attack'
Case 6
$array[6] = 'Increased Magical Attack'
Case 7
$array[6] = 'Sacrificial Assault'
Case 8
$array[6] = 'Increased Life'
Case 9
$array[6] = 'Weak'
EndSwitch
Switch memread($mid, $mob_base)
Case 0x90F888
$array[7] = 'NPC'
Case 0x90F5D8
$array[7] = 'Mob'
Case 0x90F9C8
$array[7] = 'Pet'
EndSwitch
Return $array
EndIf
EndIf
Next
memclose($mid)
EndFunc
whis could be used like this for example:
Code:
Dim $pid = ProcessExists("elementclient.exe"), $old_hp, $old_name
While 1
$info = GetSelectedInfo($pid)
If IsArray($info) Then
If $info[4]<>$old_name Then
$old_name = $info[4]
ConsoleWrite(@CRLF)
ConsoleWrite($info[7]&' Name: '&$info[4]&' (lvl '&$info[5]&')'&@CRLF)
ConsoleWrite('Special Info: '&$info[6]&@CRLF)
EndIf
If $info[0]<>$old_hp Then
$old_hp = $info[0]
ConsoleWrite($info[7]&' HP: '&$info[0]&'/'&$info[1]&' ('&Round($info[2],2)&'%)'&@CRLF)
EndIf
EndIf
Sleep(10)
WEnd
and it will return something like this:
Code:
Mob Name: Venomous Ghoul (lvl 21)
Special Info: Increased Life
Mob HP: 4308/4308 (100%)
Mob Name: Arboride Dryad (lvl 21)
Special Info: Increased Movement
Mob HP: 2633/2633 (100%)
Mob HP: 1464/2633 (55.6%)
Mob HP: 1465/2633 (55.64%)
Mob HP: 1466/2633 (55.68%)
Mob HP: 458/2633 (17.39%)
Mob HP: 459/2633 (17.43%)
Mob HP: 461/2633 (17.51%)
well it's just an example :P, but now that you know how to get a list off all available mobs, you could also use the client function to select special mob ids.
all you need is posted right here:
so using this help you should be able to build up a bot, which is able to select mobs, depending on their special status, lvl, name or hp.
for example you could add a function for wizzards, to not attack mobs with increased magical defence.
well maybe u'd like to get some more info about the mo id selection. you can see the client function for selecting the mobs, in the thread i've posted above.
to use all those functions you need the client base, and the call adress.
the function in the client looks like this:
Code:
;~ 0046061D A1 6C3E9F00 MOV EAX,DWORD PTR DS:[9F3E6C] < ClientBase
;~ 00460622 57 PUSH EDI
;~ 00460623 |. 8B48 20 MOV ECX,DWORD PTR DS:[EAX+20]
;~ 00460626 |. 81C1 EC000000 ADD ECX,0EC
;~ 0046062C |. E8 8F961800 CALL elementc.005E9CC0 < Call
;~ The ClientBase and the Call may change with every Client update.
;~ So they are the variable adresses we need to search for =)
so why not use autoit to get the adresses we need? :P we've got such lovely stringregexp functions, which are extremely efficient, in finding code.
Code:
$path = "elementclient.exe"
$file = FileOpen($path, 16)
$data = FileRead($file, FileGetSize($path))
FileClose($file)
$select = StringRegExp($data, '(A1(.{8})578B482081C1EC000000E8(.{8}))', 1)
$call_pos = StringInStr($data, $select[0])/2 + 0x40000E
ConsoleWrite('Base = '&rev($select[1])&@CRLF)
ConsoleWrite('Call = '&Hex(('0x'&rev($select[2])) + $call_pos + 5)&@CRLF)
Func rev($string)
Local $all
For $i = StringLen($string) + 1 To 1 Step -2
$all = $all & StringMid($string, $i, 2)
Next
Return $all
EndFunc
this function will return something like this (in PWI for example):
Code:
Base = 009F3E6C
Call = 005E9CC0
and there u've got the 2 variable adresses u're looking for =)