Count total number of items

Legend

New member
Messages
375
Points
0
Age
30
Location
Heaven ♥
Github
Legend95
Emulator
I don't know if this is possible ...

an NPC that would count total number of specific items that i looted.

ie: 

i loot for an apple (itemid 512) for 200pcs... some of them are already consumed and some of them stored in storage/cart...

then, when i talk to the NPC, still same count 200pcs of apple

total number of the specific item (ie: apple) will be added everytime i loot.

Hoping for an answer to my request

Thanks in advance!

 
coding OnPCPickUpEvent now ... ok I'm not coding it =/

EDIT: how to check if the player actually just drop the apple and pick up, repeating the process to bypass this system ?

I just found Hercules unique_id is not meant for stackable items, only equipments

thus it is currently impossible to check, I guess ?

looks impossible currently

 
Last edited by a moderator:
Woah! Thanks for this ms @@AnnieRuru!
default_wub.png


oops
default_sad.png


 
Last edited by a moderator:
ok then I coded it

then you know apple doesn't have unique ID

OnPCPickUpEvent

prontera,155,185,5 script kjsdhfdksfj 1_F_MARIA,{
setarray .@a, 1203,1,4,0, 4001,4001,4859,4701;
getitem2 .@a[0],1,.@a[1],.@a[2],.@a[3], .@a[4],.@a[5],.@a[6],.@a[7];
end;
OnPCPickUpEvent:
announce strcharinfo(0) +" has obtained "+ @pickup[PICKUP_AMOUNT] +"x "+ getitemname(@pickup[PICKUP_ITEMID])
//+ callfunc( "getitemname2", @pickup[PICKUP_ITEMID], @pickup[PICKUP_IDENTIFY], @pickup[PICKUP_REFINE], @pickup[PICKUP_BROKEN], @pickup[PICKUP_CARD1], @pickup[PICKUP_CARD2], @pickup[PICKUP_CARD3], @pickup[PICKUP_CARD4] )
+" at "+ strcharinfo(3) +","+ @pickup[PICKUP_POSX] +","+ @pickup[PICKUP_POSY], bc_all;
dispbottom "unique ID = "+ @pickup[PICKUP_UNIQUEID];
end;
}


Knife ->

screenRuru_Server037.jpg

Apple ->

screenRuru_Server038.jpg

so its impossible

EDIT: or maybe if you make it undroppable ...

nodrop: true


in the item_db.conf ... hmm ...

EDIT2: the idea of this modification came from

https://www.eathena.ws/board/index.php?s=&showtopic=247755&view=findpost&p=1487853

 
Last edited by a moderator:
Back
Top