Jump to content
  • 0
Sign in to follow this  
Lord Ganja

What part of source triggers character select and attack?

Question

I need help to locate this part of source that triggers:

 

1) After clicking Character Select Button

- I was about to create an npc script that is triggered AFTER clicking Character Select Button but BEFORE going to the Character Select Screen.

 I just need to know which one and which part of the script is triggered right after you click the Char Select Button.

- What I will do here is like a confirmation message before a player logged out or go to the char select screen.

 

2) Before a player attack

- I was also about to create an npc script that is triggered when you click or about to attack anything.

- What I will also do here is, if a variable is equals to 1, the player can't attack anything.

- It's like a restriction so player can't attack anything.

 

 

I just need to know which part of the source triggers this. Thanks in advance!

 

EDIT:

I already found the #2 question 'Before a player attack' at battle.c..

Edited by Lord Ganja

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Pretty sure everything can be made simply by NPC scripts. With mapflags you can enable no attack, and for #1 use OnPCLoginEvent:

Setup your OnPCLoginEvent however you want, but none of this needs src imo

Share this post


Link to post
Share on other sites
  • 0

Pretty sure everything can be made simply by NPC scripts. With mapflags you can enable no attack, and for #1 use OnPCLoginEvent:

 

Setup your OnPCLoginEvent however you want, but none of this needs src imo

The attack is attached per player. some players can attack while some can't. but i've already found it.

 

on #1 how can i do it on npc script by OnPCLoginEvent if it was supposed to be triggered before a character logout?

Share this post


Link to post
Share on other sites
  • 0

OnPCLogoutEvent?



your statement:

- I was about to create an npc script that is triggered AFTER clicking Character Select Button but BEFORE going to the Character Select Screen.

Doesnt make sense. All npc/scripts are handled via map-server ann npc script could do something afterwards but before going to the character select screen won't happen, when all is npc/scripts is handled in the map-server? your idea might not be a reality sadly for RO not sure. I know script-side more than src side.

Edited by Aeromesi

Share this post


Link to post
Share on other sites
  • 0

What i meant is it will stop player to go to the character select screen after clicking character select so OnPCLogoutEvent won't do this.

 

- What I will do here is like a confirmation message before a player logged out or go to the char select screen.

 

Idk if it might really be possible, but I think it is. It might work like this

 

putting this under the source triggered right after clicking the char select button

nd = npc->name2id("custom_ncp_script");if (nd && nd->subtype == SCRIPT)	script->run(nd->u.scr.script, 0, sd->bl.id, nd->bl.id);// ---- Maybe we need to put return or an end so the script won't continue//----- This part is where the character goes on to the char select screen

 

npc script

-     script     custom_npc_script    -1,{// The script that is triggered after clicking char select buton}

 

But what I don't know is how will the character go to the char select screen after loading the npc script XD but somehow maybe I can figure that out

Edited by Lord Ganja

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
Answer this question...

×   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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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