Jump to content
  • 0
Sign in to follow this  
jupeto

Party Member Base Levels

Question

Is there a way to determine base and job levels in a party? given the party id or the invoking character?

 

using getpartymember(getcharid(CHAR_ID_PARTY));

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Not sure if there's a better way, but one way you could do it is using attachrid.

 

I didn't test, kinda working on logic. The way it works is:

1. Fetch party ID.

2. Check if party member is online. If yes, continue. If no, loop again to next array and check.

3. attachrid of the online AID, collect their BaseLevel and put it in an array (.@blvl[]).

4. detachrid; display name + base level

 

 

-    script    Party Member Base Level    FAKE_NPC,{

    getpartymember(getcharid(CHAR_ID_PARTY));

    for (.@i = 0; .@i < $@partymembercount; ++.@i)
    {
        if (isloggedin($@partymemberaid[.@i]))
        {
            attachrid($@partymemberaid[.@i]);
            .@blvl[.@i] = BaseLevel;
            detachrid;
            dispbottom("" + $@partymembername$[.@i] + ": Level " + .@blvl[.@i] + "");
        }
    }

    end;

}

Share this post


Link to post
Share on other sites
  • 0


[Error]: script_rid2sd: fatal error ! player not attached!

[Debug]: Function: dispbottom (1 parameter):

[Debug]: Data: string value="Jupeto: Level 99"

[Debug]: Source (NPC): Teaching Manager at prontera (144,282)

Share this post


Link to post
Share on other sites
  • 0

[Error]: script_rid2sd: fatal error ! player not attached!
[Debug]: Function: __setr (2 parameters):
[Debug]: Data: variable name='.@blvl' index=0
[Debug]: Data: param name='BaseLevel' type=11
[Debug]: Source (NPC): SamplePartyBaseLevel at prontera (144,282)
[Warning]: script_get_val: cannot access player variable 'BaseLevel', defaulting to 0

I only use this code

 


        getpartymember(getcharid(CHAR_ID_PARTY));

        for (.@i = 0; .@i < $@partymembercount; ++.@i)
        {
            dispbottom($@partymemberaid[.@i] + " : " + $@partymembercid[.@i] + " (" + $@partymembername$[.@i]) + ")";
        }
        close;

the result of each account id and character id is 0, maybe that's why your code doesn't work... but the member name is OK

 

EDIT 2:

 

I wonder why the code below works, I need to specify all 3 types to get the account id, character id, and character names

 


        getpartymember(getcharid(CHAR_ID_PARTY), 0);
        getpartymember(getcharid(CHAR_ID_PARTY), 1);
        getpartymember(getcharid(CHAR_ID_PARTY), 2);
        .@aid = getcharid(CHAR_ID_ACCOUNT);

        for (.@i = 0; .@i < $@partymembercount; ++.@i)
        {
            if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i]))
            {
                detachrid;
                attachrid($@partymemberaid[.@i]);
                .@blvl[.@i] = BaseLevel;
                detachrid;
                attachrid(.@aid);
                dispbottom("" + $@partymembername$[.@i] + ": Level " + .@blvl[.@i] + "");
            }
        }
        close;
Edited by jupeto

Share this post


Link to post
Share on other sites
  • 0

Is it good now? Actually I didn't read the script_commands.txt doc properly haha didn't notice you need to specify type. If you are still having issues I will try to test tomorrow.

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.