Jump to content
  • 0

function return player ID


Tio Akima

Question


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  191
  • Reputation:   138
  • Joined:  09/24/12
  • Last Seen:  

Hi guys,
in map.c I want to create a basic function
a function that returns the player ID, without parameters
only with return ID from the player.
If anyone knows

Something like this:

int map_get_id() {
    struct map_session_data* sd;

    sd = map->id2sd(?);
    return sd->bl.id;
}

OBS: It does not have to be exactly in map.c
but must be a function that returns the player ID

Can someone help me?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  120
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   6
  • Joined:  12/02/11
  • Last Seen:  

Try to use sd->status.char_id

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   431
  • Joined:  01/26/16
  • Last Seen:  

You cannot get the ID out of nowhere. You need a reference of an object containing the ID.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  191
  • Reputation:   138
  • Joined:  09/24/12
  • Last Seen:  

5 hours ago, Secrets said:

You cannot get the ID out of nowhere. You need a reference of an object containing the ID.

oh .. how sad ... so I guess my problem has no solution Secret
What I'm trying to do is this.
See if you can help me:
 

In skill.c
I did an area skill. This skill summon a mob.
I sumono a mob and make him walk (I shoot this mob in one direction) with unit-> walktoxy ();

That is, because of the unit-> walktoxy (), this mob will go through the functions:

unit-> walktoxy (); 
unit-> walktoxy_sub (); 
unit-> walktoxy_timer ();

right?

When this mob dies (or stops walking) I want to call a skill ... skill Lord of Vermilion (WZ_VERMILION)

The function that defines whether the mob has stopped walking is unit-> walktoxy_timer ();

So, I need to call the skill (WZ_VERMILION) inside the function
unit-> walktoxy_timer ();

But for this skill to work, I need the data from the player.

The information that arrives to unit-> walktoxy_timer (); are data from the MOB that walked and stopped ...
The skill (WZ_VERMILION) will only work, if I call it with player data.

This is a way of doing a skillshot ... Throwing the mob in one direction, and when it hits an enemy, an area skill is invoked.
It sounds complicated, but it's a simple logic up to it.
If you can help me, I'll be very grateful. <3

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

15 hours ago, Tio Akima said:

The skill (WZ_VERMILION) will only work, if I call it with player data.

i am not good in rathena the source (or c++) :P

but i think you can call the skill from with mob data instead of the players 

like the mvp Valkyrie Randgris   (RANDGRIS)   Mob-ID#1751 can do WZ_VERMILION

1751,Valkyrie Randgris@WZ_VERMILION,attack,85,21,1000,1000,5000,no,target,always,0,,,,,,,
1751,Valkyrie Randgris@WZ_VERMILION,chase,85,21,2000,1000,5000,no,target,always,0,,,,,,,

so i think you can call the script on the mob you want as a last move before death

i might be wrong ofc

Edited by sader1992
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  191
  • Reputation:   138
  • Joined:  09/24/12
  • Last Seen:  

3 hours ago, sader1992 said:

i am not good in rathena the source (or c++) :P

but i think you can call the skill from with mob data instead of the players 

like the mvp Valkyrie Randgris   (RANDGRIS)   Mob-ID#1751 can do WZ_VERMILION


1751,Valkyrie Randgris@WZ_VERMILION,attack,85,21,1000,1000,5000,no,target,always,0,,,,,,,
1751,Valkyrie Randgris@WZ_VERMILION,chase,85,21,2000,1000,5000,no,target,always,0,,,,,,,

so i think you can call the script on the mob you want as a last move before death

i might be wrong ofc

But if I call the skill using mob data, the skill damage will not be based on the player's build .. or am I mistaken?

If so, it will not do me any good.

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...