Jump to content
  • 0
Sign in to follow this  
brunosc

No gems for ADM

Question

8 answers to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites
  • 0

Isn't the groups permission 'skill_unconditional' doing exactly this?

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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 by brunosc

Share this post


Link to post
Share on other sites
  • 0

@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 by brunosc

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.