Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/09/25 in Posts

  1. Hi everyone, it's been a long time since I visited the this forum, I had thought about making a simpler control panel, I hope there are those here who want to contribute to the control panel that I made, if anyone is interested, please send a message directly. Here is the display, suggestions and input from all of you are very important for the development of this control panel.
    1 point
  2. Still running but need more improvement
    1 point
  3. hi, thank you so much, i'm using : 1. Next.js 2. React 3. TypeScript 4. Tailwind CSS 5. MySQL 6. phpBB 7. shadcn/ui 8. Server Actions 9. JWT (JSON Web Tokens) 10. Environment Variables actually I was inspired by fluxcp, but because fluxcp is considered outdated, I want to make it from scratch, for the function, it's the same as fluxcp, there are only a few updates, for example optimizing database performance and realtime api. thanks for the input and suggestions, I really appreciate it, I think this CP is still far from perfect, but I will try as much as possible so that it can be used by everyone, I will make it opensource, and I will push it on github, if anyone wants to contribute, of course I am very happy. Now I'm working on making the items appear in full in each character's inventory, it may look silly, but I will upload the icon and image directly, so as to minimize errors, haha
    1 point
  4. It looks very cool. I like the dashboard wipes. Hope u will finally release it. Which programming languages and frameworks/APIs ur using? U want to overwrite the forum theme instead of style it in the forum itself? That's could be a cool thing. For Vote u can use one or more stars so that's not duplicated icons. U can use 2 humans for forum as example. Rynbef~
    1 point
  5. This has been a request that I think everyone has made at one point or another, but I initially looked at it and said "too complicated". Well, today I decided to finally code the thing. Basically, this is an adjustment to the Reset NPC that gives you the option to only reset your current class, leaving your previous classes untouched. This requires code changes to support it, and you'll have to recompile your server afterwards. A quick caveat, though this includes code to support third and fourth classes (for Renewal), that code is untested. It's similar to the second class logic so it should work, but if you have some kind of weird issue it's probably there. In pc.cpp, find the pc_resetskill method Find this line: int i, skill_point=0; Replace it with this: int i, j, k, l, baseClass, secondTransClass, thirdClass, currentClass, skid, skill_point = 0; bool previousClassSkill, isSecondClass = false, isThirdClass = false, isFourthClass = false; Find this line: if( flag&4 && (sd->class_&MAPID_UPPERMASK) != MAPID_BARDDANCER ) return 0; Insert this below it (don't replace the code above). If your server has fourth classes, uncomment that line. baseClass = pc_mapid2jobid(sd->class_ & MAPID_BASEMASK, sd->status.sex); secondTransClass = pc_mapid2jobid(sd->class_ & MAPID_UPPERMASK | JOBL_UPPER, sd->status.sex); thirdClass = pc_mapid2jobid(sd->class_ | JOBL_THIRD, sd->status.sex); currentClass = pc_mapid2jobid(sd->class_, sd->status.sex); if ((sd->class_ & MAPID_BASEMASK) != sd->class_ && (sd->class_ & MAPID_BASEMASK | JOBL_UPPER) != sd->class_ && (sd->class_ & MAPID_BASEMASK | JOBL_BABY) != sd->class_) isSecondClass = true; if ((sd->class_ | JOBL_THIRD) == sd->class_ && (sd->class_ & MAPID_BASEMASK) != sd->class_ && (sd->class_ & MAPID_UPPERMASK) != sd->class_) isThirdClass = true; //if ((sd->class_ | JOBL_FOURTH) == sd->class_ && (sd->class_ & MAPID_BASEMASK) != sd->class_ && (sd->class_ & MAPID_UPPERMASK) != sd->class_ && (sd->class_ | JOBL_THIRD) != sd->class_) isFourthClass = true; currentClass = pc_class2idx(currentClass); baseClass = pc_class2idx(baseClass); secondTransClass = pc_class2idx(secondTransClass); thirdClass = pc_class2idx(thirdClass); Find this line if (lv == 0 || skill_id == 0) continue; What you need to add next depends on your version of eathena. If you are on latest, which has the new skill tree, add this below that line: if (flag & 16) { previousClassSkill = false; if (baseClass != currentClass) { std::shared_ptr<s_skill_tree> firstTree = skill_tree_db.find(baseclass); if (tree != nullptr && !tree->skills.empty()) { for (const auto &it : tree->skills) { skid = skill_get_index(it.first); if (skid == skill_id) previousClassSkill = true; } } } if (isThirdClass) { std::shared_ptr<s_skill_tree> secondTree = skill_tree_db.find(secondTransClass); if (tree != nullptr && !tree->skills.empty()) { for (const auto &it : tree->skills) { skid = skill_get_index(it.first); if (skid == skill_id) previousClassSkill = true; } } } if (isFourthClass) { std::shared_ptr<s_skill_tree> thirdTree = skill_tree_db.find(thirdClass); if (tree != nullptr && !tree->skills.empty()) { for (const auto &it : tree->skills) { skid = skill_get_index(it.first); if (skid == skill_id) previousClassSkill = true; } } } } If you are on an older version, which has the old form of skill_tree, add this below that line instead: if (flag & 16) { previousClassSkill = false; if (baseClass != currentClass) { for (j = 0; j < MAX_SKILL_TREE && (skid = skill_tree[baseClass][j].skill_id) > 0; j++) { if (skid == skill_id) previousClassSkill = true; } } if (isThirdClass) { for (k = 0; k < MAX_SKILL_TREE && (skid = skill_tree[secondTransClass][k].skill_id) > 0; k++) { if (skid == skill_id) previousClassSkill = true; } } if (previousClassSkill) continue; } We're pretty much done with pc_resetskill, but if you want, you can add this to the comment at the top of the method, as the final line: * if flag&16, Only reset skills that the current class can learn Almost done with code changes, now we just need to add the script function. The remainder of the changes are in script.cpp: First, find the definitions of the script functions by searching for this: struct script_function buildin_func[] And add the following line somewhere, ideally below the one for resetskill BUILDIN_DEF(resetskillcurrentonly, "?"), Now add this method somewhere, ideally below resetskill but it can in theory go anywhere. /** * Reset player's skill, leaving previous classes untouched * resetskillcurrentonly({<char_id>}); **/ BUILDIN_FUNC(resetskillcurrentonly) { TBL_PC* sd; if (!script_charid2sd(2, sd)) return SCRIPT_CMD_FAILURE; pc_resetskill(sd, 17); return SCRIPT_CMD_SUCCESS; } With this done, you can recompile the client and everything should be set. Now all you need is the new version of the resetnpc script below and you'll have the new functionality. Man, this was a lot harder than it should have been. Rathena should really just add this option by default. resetnpc.txt
    1 point
×
×
  • Create New...