Dvrstle Posted October 29, 2012 Posted October 29, 2012 @skillall command is enabled in my server for almost 5months, i want it to be removed and i want every skills to be reset Quote
Euphy Posted October 29, 2012 Posted October 29, 2012 You can do it through a script: - script SkillReset -1,{ OnPCLoginEvent: if (!SkillReset) { resetskill; dispbottom "Skills reset!"; set SkillReset,1; } end; } Quote
Dvrstle Posted October 29, 2012 Author Posted October 29, 2012 but what if the server accidentaly closed.. . so it will reset again their skills? sir? Quote
Emistry Posted October 30, 2012 Posted October 30, 2012 it should only reset once..... you can just run the script...and shut down the server upon the script reset your skill... and restart back your server and see that your character skill is resetted or not.. Quote
Dvrstle Posted October 30, 2012 Author Posted October 30, 2012 but it will just reset the characters who logs in. . . xD and i want it to reset only 3rd job characters as well as kagerou and oboro. . . and then it will give 167 skill points Quote
Emistry Posted October 30, 2012 Posted October 30, 2012 but it will just reset the characters who logs in. . . xD and i want it to reset only 3rd job characters as well as kagerou and oboro. . . and then it will give 167 skill points blame yourself.....you didnt mention about it .... - script Sample -1,{ OnPCLoginEvent: if( Class >= 4054 && !DONE ){ resetskill; set DONE,1; set SkillPoint,168; message strcharinfo(0),"Skill Resetted."; } end; } Quote
Dvrstle Posted October 30, 2012 Author Posted October 30, 2012 but it will just reset the characters who logs in. . . xD and i want it to reset only 3rd job characters as well as kagerou and oboro. . . and then it will give 167 skill points blame yourself.....you didnt mention about it .... - script Sample -1,{ OnPCLoginEvent: if( Class >= 4054 && !DONE ){ resetskill; set DONE,1; set SkillPoint,168; message strcharinfo(0),"Skill Resetted."; } end; } im really sorry again, can you please add another check .... it should reset 3rd job and kagerou/oboro with baselvl 150 and job lvl 50 =) Quote
Emistry Posted October 30, 2012 Posted October 30, 2012 change if( Class >= 4054 && !DONE ){ to if( Class >= 4054 && !DONE && BaseLevel >= 150 && JobLevel >= 50 ){ Quote
goddameit Posted October 30, 2012 Posted October 30, 2012 (edited) didn't test set .@where$,"( ( `class` = 4211 || `class` = 4212 || ( `class` >= 4054 && `class` <= 4079 ) ) && `base_level` = 150 && `job_level` = 50 )"; for(set .@i,0;;set .@i,.@i+1) { deletearray .@cid[0],128; query_sql "SELECT `char_id` FROM `char` WHERE "+.@where$+" LIMIT "+(127*.@i)+","+(127*(.@i+1))+"",.@cid; for(set .@j,0;.@cid[.@j];set .@j,.@j+1) { uery_sql "DELETE FROM `skill` WHERE `char_id` = ".@cid[.@j]"; } if(.@j!=127) break; } query_sql "UPDATE `char` set `skill_point` = 168 WHERE "+.@where$; Edited October 30, 2012 by goddameit Quote
AnnieRuru Posted October 30, 2012 Posted October 30, 2012 (edited) wtf ... goddameit can sometimes think outside the box when solving a problem .... thx for the idea here is the tested sql script update `char`, ( select char_id, sum(lv) as xyz from skill group by char_id ) as abc set skill_point = skill_point + xyz where `char`.char_id = abc.char_id; delete from skill; run this when server is off EDIT: wait, this is for all characters ... wait I think of some way for gunslinger only update `char`, ( select char_id, sum(lv) as xyz from skill group by char_id ) as abc set skill_point = skill_point + xyz where `char`.char_id = abc.char_id and class >= 4054 and base_level >= 150 and job_level >= 50; delete from skill; like this EDIT2 ... erm ... I think the class is abit ... off wait I recheck the job ID yeah Emistry is wrong, goddameit correct update `char`, ( select char_id, sum(lv) as xyz from skill group by char_id ) as abc set skill_point = skill_point + xyz where `char`.char_id = abc.char_id and ( class = 4211 or class = 4212 or ( class >= 4054 and class <= 4079 ) ) and base_level >= 150 and job_level >= 50; delete from skill; like this I think this is final LMAO ... delete from skill will wipe the database ... >.< wait .... urgh ... I really post too fast ... update `char`, ( select char_id, sum(lv) as xyz from skill group by char_id ) as abc set skill_point = skill_point + xyz where `char`.char_id = abc.char_id and ( class = 4211 or class = 4212 or ( class >= 4054 and class <= 4079 ) ) and base_level >= 150 and job_level >= 50; delete from skill where skill.char_id in ( select char_id from `char` where ( class = 4211 or class = 4212 or ( class >= 4054 and class <= 4079 ) ) and base_level >= 150 and job_level >= 50 ); bleh .... finally ... I hope no more of such things <.< final EDIT: this method is not correct either - like marriage skill shouldn't be edit and if a user riding, should unmount them ... etc Edited October 30, 2012 by AnnieRuru 1 Quote
Brian Posted October 30, 2012 Posted October 30, 2012 Players who used @allskill would have more skills than normal, so it might be better to reset their skill_point based on JobLevel. Quote
AnnieRuru Posted October 30, 2012 Posted October 30, 2012 (edited) like this ? update `char` set skill_point = job_level -1 where ( class = 4211 or class = 4212 or ( class >= 4054 and class <= 4079 ) ) and base_level >= 150 and job_level >= 50; delete from skill where skill.char_id in ( select char_id from `char` where ( class = 4211 or class = 4212 or ( class >= 4054 and class <= 4079 ) ) and base_level >= 150 and job_level >= 50 ); become simpler SQL script though EDIT: I think above method is not correct ... need to calculate with previous job like dancer also got skill points from archer and novice ..hmm ... Edited October 30, 2012 by AnnieRuru Quote
Brian Posted October 30, 2012 Posted October 30, 2012 I think it would be something like: Novice (9) + First Job (max 49) + Trans Second Job (max 69). So the maximum would be 127 skill_points. (I'm not sure how 3rd jobs affect this) XD High Priest job 70, who job changed at level 50 High Acolyte: --> 9 + (50-1) + (70-1) = 127 High Priest job 68, who job changed at level 45 High Acolyte: --> 9 + (45-1) + (68-1) = 120 We can check these variables to see what level they jobchanged at. jobchange_level jobchange_level_3rd Quote
AnnieRuru Posted October 30, 2012 Posted October 30, 2012 pc.c /*========================================== * /resetskill * if flag&1, perform block resync and status_calc call. * if flag&2, just count total amount of skill points used by player, do not really reset. * if flag&4, just reset the skills if the player class is a bard/dancer type (for changesex.) *------------------------------------------*/ int pc_resetskill(struct map_session_data* sd, int flag) { int i, lv, inf2, skill_point=0; nullpo_ret(sd); if( flag&4 && (sd->class_&MAPID_UPPERMASK) != MAPID_BARDDANCER ) return 0; if( !(flag&2) ) { //Remove stuff lost when resetting skills. /** * It has been confirmed on official server that when you reset skills with a ranked tweakwon your skills are not reset (because you have all of them anyway) **/ if( (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc_famerank(sd->status.char_id, MAPID_TAEKWON) ) return 0; if( pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd) ) clif_status_load(&sd->bl, SI_DEVIL, 0); //Remove perma blindness due to skill-reset. [skotlex] i = sd->sc.option; if( i&OPTION_RIDING && pc_checkskill(sd, KN_RIDING) ) i &= ~OPTION_RIDING; if( i&OPTION_FALCON && pc_checkskill(sd, HT_FALCON) ) i &= ~OPTION_FALCON; if( i&OPTION_DRAGON && pc_checkskill(sd, RK_DRAGONTRAINING) ) i &= ~OPTION_DRAGON; if( i&OPTION_WUG && pc_checkskill(sd, RA_WUGMASTERY) ) i &= ~OPTION_WUG; if( i&OPTION_WUGRIDER && pc_checkskill(sd, RA_WUGRIDER) ) i &= ~OPTION_WUGRIDER; if( i&OPTION_MADOGEAR && ( sd->class_&MAPID_THIRDMASK ) == MAPID_MECHANIC ) i &= ~OPTION_MADOGEAR; if( i&OPTION_MOUNTING ) i &= ~OPTION_MOUNTING; #ifndef NEW_CARTS if( i&OPTION_CART && pc_checkskill(sd, MC_PUSHCART) ) i &= ~OPTION_CART; #else if( sd->sc.data[sC_PUSH_CART] ) pc_setcart(sd, 0); #endif if( i != sd->sc.option ) pc_setoption(sd, i); if( merc_is_hom_active(sd->hd) && pc_checkskill(sd, AM_CALLHOMUN) ) merc_hom_vaporize(sd, 0); } for( i = 1; i < MAX_SKILL; i++ ) { lv = sd->status.skill[i].lv; if (lv < 1) continue; inf2 = skill_get_inf2(i); if( inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL) ) //Avoid reseting wedding/linker skills. continue; // Don't reset trick dead if not a novice/baby if( i == NV_TRICKDEAD && (sd->class_&MAPID_UPPERMASK) != MAPID_NOVICE ) { sd->status.skill[i].lv = 0; sd->status.skill[i].flag = 0; continue; } // do not reset basic skill if( i == NV_BASIC && (sd->class_&MAPID_UPPERMASK) != MAPID_NOVICE ) continue; if( flag&4 && !skill_ischangesex(i) ) continue; if( inf2&INF2_QUEST_SKILL && !battle_config.quest_skill_learn ) { //Only handle quest skills in a special way when you can't learn them manually if( battle_config.quest_skill_reset && !(flag&2) ) { //Wipe them sd->status.skill[i].lv = 0; sd->status.skill[i].flag = 0; } continue; } if( sd->status.skill[i].flag == SKILL_FLAG_PERMANENT ) skill_point += lv; else if( sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0 ) skill_point += (sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0); if( !(flag&2) ) {// reset sd->status.skill[i].lv = 0; sd->status.skill[i].flag = 0; } } if( flag&2 || !skill_point ) return skill_point; sd->status.skill_point += skill_point; if( flag&1 ) { clif_updatestatus(sd,SP_SKILLPOINT); clif_skillinfoblock(sd); status_calc_pc(sd,0); } return skill_point; } ok I give up ... there's some skill that shouldn't be reset like marriage skill ... etc doing it from SQL with this still plausible but the script will become too big and not as efficient to just have an npc script with just 1 single command do all the things above Quote
Ryokem Posted October 31, 2012 Posted October 31, 2012 According to what the others said, I believe this is still the best option given but it will just reset the characters who logs in. . . xD and i want it to reset only 3rd job characters as well as kagerou and oboro. . . and then it will give 167 skill points blame yourself.....you didnt mention about it .... - script Sample -1,{ OnPCLoginEvent: if( Class >= 4054 && !DONE && BaseLevel >= 150 && JobLevel >= 50){ resetskill; set DONE,1; set SkillPoint,168; message strcharinfo(0),"Skill Resetted."; } end; } Quote
goddameit Posted October 31, 2012 Posted October 31, 2012 Annie and Brian are talking about real point count if given is a constan then you don't need to know it Quote
Dvrstle Posted October 31, 2012 Author Posted October 31, 2012 According to what the others said, I believe this is still the best option given but it will just reset the characters who logs in. . . xD and i want it to reset only 3rd job characters as well as kagerou and oboro. . . and then it will give 167 skill points blame yourself.....you didnt mention about it .... - script Sample -1,{ OnPCLoginEvent: if( Class >= 4054 && !DONE && BaseLevel >= 150 && JobLevel >= 50){ resetskill; set DONE,1; set SkillPoint,168; message strcharinfo(0),"Skill Resetted."; } end; } ok tnx ill use this one. . . . thnx for the effort guys. btw the real skill point to be given is 167 because when my character's skill have already reset, the basic skills will not be reset. so it will be a minus 9 to the skill points 1 Quote
Dvrstle Posted November 1, 2012 Author Posted November 1, 2012 i need help again /hp some of my players can't add 3rd job skills even they just have 49skillpoints =( Quote
Question
Dvrstle
@skillall command is enabled in my server for almost 5months, i want it to be removed and i want every skills to be reset
18 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.