Need help with hatred reset and disable hatred to emperium

Pink Guy

New member
Messages
34
Points
0
Location
Japan
Emulator
Client Version
2015-11-04
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.m = -1;
sd->feel_map.index = 0;
pc_setglobalreg(sd,script->add_variable(pc->sg_info.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 = -1;
pc_setglobalreg(sd,script->add_variable(pc->sg_info.hate_var),0);
}
return 0;
}


Anyone can help me fix this?

This is what I get after typing @hatereset.



Also how do I disable Hatred to emperium?

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

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

 
Last edited by a moderator:
Search skill.c for SG_HATE.  Target is emperium mob then skill fails. Add the mobs you need.

Code:
		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;
 
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


 
you can try just doing this to your skill.c

Code:
		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;
 
Back
Top