What part of source triggers character select and attack?

Lord Ganja

New member
Messages
161
Points
0
Age
34
Location
Ganja World
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..

 
Last edited by a moderator:
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

 
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?

 
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.

 
Last edited by a moderator:
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

 
Last edited by a moderator:
Back
Top