Jump to content
Khazou

New usable item ( To retrieve AID or CID)

Recommended Posts

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 :)

 

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

Share this post


Link to post
Share on other sites

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

Edited by Oxxy

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Understood you now, ye, could be useful function for some events, for example.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Well, that could be a solution :)

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 :)

Edited by Khazou

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.