nasagnilac Posted October 9, 2019 Posted October 9, 2019 I would like to request a command that can show your character current skills id and names. At least give me a hint how I can get that skill id and name. Thank you in advance. Quote
1 Akkarin Posted October 9, 2019 Posted October 9, 2019 *getskilllist({<char_id>}); This command sets a bunch of arrays with a complete list of skills the invoking character has. Here's what you get: @skilllist_id[] - skill ids. @skilllist_lv[] - skill levels. @skilllist_flag[] - see 'skill' for the meaning of skill flags. @skilllist_count - number of skills in the above arrays. While 'getskillv' is probably more useful for most situations, this is the easiest way to store all the skills and make the character something else for a while. Advanced job for a day? This could also be useful to see how many skills a character has. This command does not count skills which are set as flag 4 (permament granted) (ALL_BUYING_STORE/ALL_INCCARRY) This should be a good starting point. Bind the command to a script and use getarg() to parse the char's name/ID and output the results using dispbottom. Moving to Script Requests. 2 Quote
0 nasagnilac Posted October 9, 2019 Author Posted October 9, 2019 I got it thank.... is okay that I continue this question. I got this code for @command that will show and add skill id in the array like @autolootid. Anyone can help me clean my code and fix some issue. Quote ARR_FIND(0, AFKSKILLLIST_SIZE, i, sd->state.afk_skilllist == item_data->nameid); Any one can help me change this to skill id: ACMD_FUNC(afkskills) { int i, inf, j = 0; int action = 3; // 1=add, 2=remove, 3=help+list (default), 4=reset nullpo_retr(-1, sd); if (message && *message) { if (message[0] == '+') { message++; action = 1; } else if (message[0] == '-') { message++; action = 2; } else if (!strcmp(message,"reset")) action = 4; } switch(action) { case 1: /* ARR_FIND(0, AFKSKILLLIST_SIZE, i, sd->state.afk_skilllist[i] == item_data->nameid); if (i != AFKSKILLLIST_SIZE) { //clif_displaymessage(fd, msg_txt(sd,1190)); // You're already autolooting this item. return -1; } ARR_FIND(0, AFKSKILLLIST_SIZE, i, sd->state.afk_skilllist[i] == 0); if (i == AFKSKILLLIST_SIZE) { //clif_displaymessage(fd, msg_txt(sd,1191)); // Your autolootitem list is full. Remove some items first with @autolootid -<item name or ID>. return -1; } sd->state.afk_skilllist[i] = item_data->nameid; // Autoloot Activated //sprintf(atcmd_output, msg_txt(sd,1192), item_data->name, item_data->jname, item_data->nameid); // Autolooting item: '%s'/'%s' {%d} //clif_displaymessage(fd, atcmd_output); sd->state.autolooting = 1; */ break; case 2: break; case 3: for(i=0;i<MAX_SKILL;i++){ inf = skill_get_inf(sd->status.skill[i].id); if (!(inf == 0) && sd->status.skill[i].id > 0 && sd->status.skill[i].lv > 0) { j++; } } if(j > 0){ clif_displaymessage(fd, "[ Character Skills ]"); for(i=0;i<MAX_SKILL;i++){ inf = skill_get_inf(sd->status.skill[i].id); if (!(inf == 0) && sd->status.skill[i].id > 0 && sd->status.skill[i].lv > 0) { snprintf(atcmd_output, sizeof atcmd_output, "SID: %d | Lv: %d | Name: %s", sd->status.skill[i].id, sd->status.skill[i].lv, skill_get_name(sd->status.skill[i].id)); clif_displaymessage(fd, atcmd_output); } } }else{ clif_displaymessage(fd, "Can't find a non-passive skills."); } break; case 4: memset(sd->state.afk_skilllist, 0, sizeof(sd->state.afk_skilllist)); break; } return 0; } Quote
0 Akkarin Posted October 10, 2019 Posted October 10, 2019 Uh.. you don't need to touch the src - the script command will do everything you need and throw all the data into an array Quote
Question
nasagnilac
I would like to request a command that can show your character current skills id and names. At least give me a hint how I can get that skill id and name. Thank you in advance.
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.