Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842
PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165
PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165
PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612
PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1
PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1
PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1
PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6 Looter
I would like someone to help me to figure out where to even begin to make a simple looter.
I have a system set up already where a user can choose to add their own items to a check box list and the program will put the items into the backpack. Now i just need to put the code behind it.
Unfortunately it's not quite so simple as to find the address of a loot message. What you'll want to be doing is opening up a proxy (most likely) which will listen to packets received, and when you receive one which defines a creatures loot message you then will know to loot it.
As for the code itself, here's a breakdown of how an average looter might work.
Targeting tracker will monitor current creature location, health.
When targets health reaches 0% for a very brief time, you will know that it is dead and to loot it (you will also likely want to use the proxy mentioned above in case a user isn't using targeting).
The targets last known location from a targeting tracker will be the location of a corpse.
You'll need to find and call an open corpse function in the client, or use a mouse click to right click on the corpse location. Both of these are notoriously difficult in comparison to healing and targeting etc.
Once you have sent the open command you will need to scan the inventory to find the corpse either by container name or ID, depending on how you want to work.
Next step is to find the items in that container, compare them to your "loot items list", and if one of the IDs matches, you can either click and drag or move the item using a function of Tibia.
Once the items are moved you can either close the container, or just leave it to kill itself off. Depending on how your looter works you might decide to do either.
Ask away if you have difficulties with any of the steps, but bare in mind you'll likely be ignored if you don't put some effort in, or provide any code to show that you have at least made an effort before asking. The people here are friendly, but will not be your slaves :P