brunosc 2 Posted December 24, 2019 is it possible to do for all ADM no use gems when use skills? if yes how i can do it?? Quote Share this post Link to post Share on other sites
0 Kenpachi 65 Posted December 24, 2019 Hi. Quick, dirty and untested:admin_no_gems.diff diff --git a/src/map/pc.c b/src/map/pc.c index 179a4b78a..c77bfbc22 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1359,6 +1359,10 @@ static bool pc_authok(struct map_session_data *sd, int login_id2, time_t expirat sd->sc_display = NULL; sd->sc_display_count = 0; + /// Characters with group level => 99 don't use gemstones. + if (sd->group->level >= 99) + sd->special_state.no_gemstone = 1; + // Request all registries (auth is considered completed whence they arrive) intif->request_registry(sd,7); return true; ~Kenpachi 1 brunosc reacted to this Quote Share this post Link to post Share on other sites
0 Ridley 295 Posted December 24, 2019 Isn't the groups permission 'skill_unconditional' doing exactly this? Quote Share this post Link to post Share on other sites
0 Kenpachi 65 Posted December 24, 2019 Indeed. But the permission flag skill_unconditional makes all conditions being ignored. From skill.c skillnotok(): if (pc_has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL)) return 0; // can do any damn thing they want And because @brunosc explicitly asked for gemstones, I wrote that dirty little hack. 😅 ~Kenpachi Quote Share this post Link to post Share on other sites
0 brunosc 2 Posted December 24, 2019 (edited) Checked. if i use this: diff --git a/src/map/pc.c b/src/map/pc.c index 179a4b78a..c77bfbc22 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1359,6 +1359,10 @@ static bool pc_authok(struct map_session_data *sd, int login_id2, time_t expirat sd->sc_display = NULL; sd->sc_display_count = 0; + /// Characters with group level => 99 don't use gemstones. + if (sd->group->level >= 99) + sd->special_state.no_gemstone = 1; + // Request all registries (auth is considered completed whence they arrive) intif->request_registry(sd,7); return true; when i use skill gravitation or other, skill fail because i dont have gem. about if (pc_has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL)) return 0; // can do any damn thing they want how i can do it? add the group level? Edited December 24, 2019 by brunosc Quote Share this post Link to post Share on other sites
0 Ridley 295 Posted December 25, 2019 you add it in groups.conf to a group permissions: { skill_unconditional: true } 1 brunosc reacted to this Quote Share this post Link to post Share on other sites
0 brunosc 2 Posted December 25, 2019 (edited) @Ridley and @Kenpachi brows, i was test it /// Characters with group level => 99 don't use gemstones. + if (sd->group->level >= 99) + sd->special_state.no_gemstone = 1; but not work the other method all skill no consume itens, i need put only gems, blue red yelow.. send one light! pls ! Edited February 12, 2020 by brunosc Quote Share this post Link to post Share on other sites
0 Kenpachi 65 Posted February 13, 2020 Hi. In src/map/skill.c find function skill_get_requirement() and replace: (Should be line 15479.) if (itemid_isgemstone(req.itemid[i]) && skill_id != HW_GANBANTEIN) { with: if (itemid_isgemstone(req.itemid[i]) && sd->group->level >= 99) { /// Characters with group level >= 99 don't use gemstones. req.itemid[i] = 0; req.amount[i] = 0; } else if (itemid_isgemstone(req.itemid[i]) && skill_id != HW_GANBANTEIN) { Or use this diff: ADMIN_NO_GEMS.diff I tested this modification with latest Hercules and it works. ~Kenpachi 1 brunosc reacted to this Quote Share this post Link to post Share on other sites
0 brunosc 2 Posted February 14, 2020 Working, you are the best! Quote Share this post Link to post Share on other sites
is it possible to do for all ADM no use gems when use skills?
if yes how i can do it??
Share this post
Link to post
Share on other sites