![]() |
[Share] Looter
nothing special, just a looter.
Code:
class warrior_looter : warrior |
Interesting, nice.
|
thx drake)
|
someone knows the structure of the item object? ( CSharedItemData )
because if you do if item == 57 it will not work ( item is an object ) then means there should be something like item.class_id or something like that but there is no documentation about... |
Did you compile this or write it as it is now?
|
wrote manually. i don't like nasc and by manual "pseudoAsm" you can get a cleaner and more compact code...
|
u can compile it with:
[php:1:e1a31c9568]. class warrior_loot : warrior { handler: EventHandler SEE_ITEM(item) { AddGetItemDesire(item, 10); super; } } .[/php:1:e1a31c9568] to get exactly this ai.obj snippet ^^ prob is to deal with the looted items - how much items can such a looter carry - what happens with the items - only to pickup specific items etc. |
humm ..try 272
or first 40 and then 272 or 44 or first 40 and then 44 ...one of them should work ..give it a try and post results |
The items collected by the NPC are still in the database, char_id = 0 so they should be cleared with the unkown items. Just fyi.
Has anyone gotten waypoints working properly? If you could combine this with waypoints it would be infinitely more useful. |
mmmm better is with a delay, because if you are fighting with 2 or more mobs, you kill one of the mobs and the others will take your drops.
|
I was thinking of patroling guards like on retail, just that they loot too :)
|
Quote:
|
so it's not possible to obtain the loot from the npc like in other mmogs?
|
Well, the NPC doesn't actually take ownership of the items, so I'm not sure on that one >.>
|
Sorry for the double post, but where do you guys get your referances to functions etc of uncompiled AI code? Is there a post somewhere I'm overlooking?
|
most of the things i got from my decompiler project
or from ressourcetables inside nasc / server |
Would you be willing to share that info? I'm interested ^^ Haven't done much AI work, but I'm very willing to start.
|
Quote:
|
so did the numbers I said worked?
|
hmm, the pets can loot too and the items go to their inventory, there have to be a way to get the inventory ;)
|
This is how I am using it. Basically all my mobs now pickup drops not owned. You can also have the mob delete the item too simply by using the DeleteItem functions.
Code:
EventHandler SEE_ITEM(item) |
See handler GET_ITEM_FINISHED for deleting the item after the mob is done poicking it up
|
Code:
DeleteItem1(myself, item, (OwnItemCount(myself, item))); |
Here is the complete code "untested" which works on a timer to support up to 5 simutaneous items seen by the mob as well as with a 120 second delay on picking up the item. It also deletes the item after it is picked up.
Should work in theory, just needs to be tested. Waypoint code also included Code:
EventHandler SEE_ITEM(item) |
@shawnmb
lookie-lookie :D |
i don't want to DELETE the item...
let the monster drop the picked up items on dying do u found a way to enumerate the inventory? btw - why do u set the AddGetItemDesire via timer? set it on create with 15 (have to be more than the waypoint desire) and the monster will pick up the item and continue with moving to next waypoint (hmm, u like to double or triple post?) |
enumerate the inventory?
No, there is no function in the AI that I have seen from my investigations which will get items in inventory into an array which you could loop through. That is pretty much the only way it would be achievable I am thinking. Can you elaborate on your statement "set it on create with 15" (And yes, Im to lazy to hit the edit button on my first post :P) |
Quote:
|
The SEE_ITEM handler is only envoked when a mob sees the actual items drop within its sight. The see_item handler should have actually been called "SEE_ITEM_DROP" because its the dropping action that gets the handler to envoke. The handler is not envoked if an item is sitting on the ground and the NPC passes by.
All items that the mobs pickup are dropped when they are killed. If you have cached set to auto delete unowned items on start, then those collected items will be deleted on the next cached restart. |
Nice aspect of this, it's a when mob was killed, he drops all what he's pickup! :P
|
i dont have any use for this at the moment but thanks for the share =)
|
| All times are GMT. The time now is 23:37. |