New usable item ( To retrieve AID or CID)

Khazou

New member
Messages
41
Points
0
Hi,

I was wondering, if it could be possible to implement a new type of usable item.

This item, bind to a NPC label, will give the opportunity to target a monster or a player like Skill Scroll item, and will then execute the NPC label + giving the script the monster ID or the player account/char ID.

I don't think it would be so difficult to make, but it would expand the capabilities of thing possible with script to a whole next level
default_smile.png


What do you think about it ?

If you have some question, feel free to ask, as I am French, maybe i didn't explain it very well

 
You can make item use GOTO or callfunc, why would you make a new special type of usable items?

 
Last edited by a moderator:
You can use goto, but you can't retrieve the ID of the target.

Having the character ID of the target coulb be usefull to execute some action on the character targeted and not on the character using the item

 
You can use goto, but you can't retrieve the ID of the target.

Having the character ID of the target coulb be usefull to execute some action on the character targeted and not on the character using the item
Make a skill that targets, and make that skill run a npc label afterwards, and use that skill in item.Or make a script command which does this.

 
Well, that could be a solution
default_smile.png


I tought it would have be easier to have a new item type, but since we can already do this at this moment.

Edit: Can you explain me how to execute a label npc, with a skill ?

I made a new skill, but I don't know how to call a npc from skill.c

I made this in skill.c

case NPC_TARGET_ITEM:        //npc_event(sd,"targetItem#rQ::rooter",0);        npc_event_doall_id("targetItem#rQ::rooter",dstsd);        return 0; 
But i get this error:

skill.c: In function ‘skill_castend_nodamage_id’:skill.c:5227:8: error: ‘struct npc_interface’ has no member named ‘npc_event_doall_id’
But i don't know how to use a function from an other .c file

Edit2: I understood that i had to use npc->event_doall_id and not npc_event_doall_id

But now i don't know how to retrieve the rid from a map_session_data variable

Edit3: Finally it works with

case NPC_TARGET_ITEM: //npc_event(sd,"targetItem#rQ::rooter",0); npc->event(dstsd,"targetItem#rQ::OnRooter",0); return true;
I'm still having problem when i target a monster, but i should found this out
default_smile.png


 
Last edited by a moderator:
Back
Top