No gems for ADM

brunosc

New member
Messages
33
Points
0
is it possible to do for all ADM no use gems when use skills?

if yes how i can do it??

 
Hi.

Quick, dirty and untested:View attachment 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

 
Last edited by a moderator:
Isn't the groups permission 'skill_unconditional' doing exactly this?

 
Last edited by a moderator:
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

 
Last edited by a moderator:
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?

 
Last edited by a moderator:
you add it in groups.conf to a group

Code:
	permissions: {
		skill_unconditional: true
	}
 
Last edited by a moderator:
@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 !

 
Last edited by a moderator:
Hi.

In src/map/skill.c find function skill_get_requirement() and replace: (Should be line 15479.)

if (itemid_isgemstone(req.itemid) && skill_id != HW_GANBANTEIN) {


with:

if (itemid_isgemstone(req.itemid) && sd->group->level >= 99) { /// Characters with group level >= 99 don't use gemstones.
req.itemid = 0;
req.amount = 0;
} else if (itemid_isgemstone(req.itemid) && skill_id != HW_GANBANTEIN) {


 Or use this diff: View attachment ADMIN_NO_GEMS.diff

I tested this modification with latest Hercules and it works.

~Kenpachi

 
Back
Top