Jump to content
  • 0
Pink Guy

Need help with hatred reset and disable hatred to emperium

Question

Hello guys I tried copying this post. I also made it as close as the current coding (copied feelings then modified it to make sure it's the current coding syntax). I also added the 1552 entry to conf/messages.conf but when I type @hatereset in my server nothing happens and the message that appears is "??".

Here are my current codes.

src/map/atcommand.c

/*==========================================
 * Feel (SG save map) Reset [HiddenDragon]
 *------------------------------------------*/
ACMD(feelreset)
{
	pc->resetfeel(sd);
	clif->message(fd, msg_fd(fd,1324)); // Reset 'Feeling' maps.

	return true;
}

ACMD(hatereset)
{
	pc->resethate(sd);
	clif->message(fd, msg_fd(fd,1552));

	return true;
}

conf/message.conf

1552: Reset Hatred.

src/map/pc.c

/*==========================================
 * /resetfeel [Komurka]
 *------------------------------------------*/
static int pc_resetfeel(struct map_session_data *sd)
{
	int i;
	nullpo_ret(sd);

	for (i=0; i<MAX_PC_FEELHATE; i++)
	{
		sd->feel_map[i].m = -1;
		sd->feel_map[i].index = 0;
		pc_setglobalreg(sd,script->add_variable(pc->sg_info[i].feel_var),0);
	}

	return 0;
}

static int pc_resethate(struct map_session_data *sd)
{
	int i;
	nullpo_ret(sd);

	for (i = 0; i < MAX_PC_FEELHATE; i++) {
		sd->hate_mob[i] = -1;
		pc_setglobalreg(sd,script->add_variable(pc->sg_info[i].hate_var),0);
	}
	return 0;
}

Anyone can help me fix this?

This is what I get after typing @hatereset.

EadQngK.png

 

Also how do I disable Hatred to emperium?

Edited by Pink Guy

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

The error message is clearly stating what is wrong. Your message number (1552) is outside of the accepted ranged (0-1502). Increase MAX_MSG in atcommand.h to accommodate.

Share this post


Link to post
Share on other sites
  • 0

tyvm that fix the hatred command.  now anyone know how to disable it to emperium, barricade, guardian stone (or at least just emperium)?

Edited by Pink Guy

Share this post


Link to post
Share on other sites
  • 0

Search skill.c for SG_HATE.  Target is emperium mob then skill fails. Add the mobs you need.

		case SG_HATE:
			if (sd) {
				clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
				// mobs which cannot be hated
				int class_ = status->get_class(bl);
				if (class_ ==   MOBID_EMPELIUM) {
					clif->message(sd->fd, msg_sd(sd, 1551));  // Hatred cannot be cast on this mob.
					clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0);
					break;
				}

				if (!pc->set_hate_mob(sd, skill_lv-1, bl))
					clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0);
			}
			break;

 

Share this post


Link to post
Share on other sites
  • 0
30 minutes ago, bWolfie said:

Search skill.c for SG_HATE.  Target is emperium mob then skill fails. Add the mobs you need.

case SG_HATE: if (sd) { clif->skill_nodamage(src,bl,skill_id,skill_lv,1); // mobs which cannot be hated int class_ = status->get_class(bl); if (class_ == MOBID_EMPELIUM) { clif->message(sd->fd, msg_sd(sd, 1551)); // Hatred cannot be cast on this mob. clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } if (!pc->set_hate_mob(sd, skill_lv-1, bl)) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break;


		case SG_HATE:
			if (sd) {
				clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
				// mobs which cannot be hated
				int class_ = status->get_class(bl);
				if (class_ ==   MOBID_EMPELIUM) {
					clif->message(sd->fd, msg_sd(sd, 1551));  // Hatred cannot be cast on this mob.
					clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0);
					break;
				}

				if (!pc->set_hate_mob(sd, skill_lv-1, bl))
					clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0);
			}
			break;

  

I tried that but it's giving me error when I recompile and I can still hatred emp.

z4bSPtt.png

Share this post


Link to post
Share on other sites
  • 0

you can try just doing this to your skill.c

		case SG_HATE:
		      if (dstmd && dstmd->class_ == MOBID_EMPELIUM) {
					clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0);
                    return 0;
                }
			if (sd) {
				clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
				if (!pc->set_hate_mob(sd, skill_lv-1, bl))
					clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0);
			}
			break;

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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