Jump to content

Return 1 damage to a specific mob


Go to solution Solved by tierrilopes,

Recommended Posts

  • Bot

Hello,

I was trying to make that when you attack a specific mob, the damage is 1 (something like in the Chiefs Chase event of the official server)

So:

I look for the following:

bool CHARACTER :: Damage (LPCHARACTER pAttacker, int dam, EDamageType type)

I add this below:

	if (pAttacker)
	{
		if (GetRaceNum() == 101)
		{
			SendDamagePacket(pAttacker, 1, DAMAGE_NORMAL);
			return false;
		}
	}

In this case, when I attack mob 101 (Wild Dog), I only hit 1 damage (all right up here) But what happens is that life does not go down, and life should go down, 1 in 1 to kill the mob.

Does anyone have any help for me?

Thanks in advance.

english_banner.gif

Link to comment
Share on other sites

  • Bot
14 hours ago, Xploitz said:

Have you tried to set the Health regen to 0 on the mob when you made the test?

 

2 hours ago, 3bd0 said:

it may be because of his health regen, try it with more damage so you can see it

pr set the mob hp regen to zero

I just tried to put more damage and turn the regen to 0, and ... effectively, I do more damage, but the stupid dog does not die xD!

english_banner.gif

Link to comment
Share on other sites

  • Premium
  • Solution
7 hours ago, WLsj24 said:

 

I just tried to put more damage and turn the regen to 0, and ... effectively, I do more damage, but the stupid dog does not die xD!

 

Do you want to change the "hit" only or also skills?

Changes at the stated functions for hits and arrows (example on arrow):

battle.cpp

  • int CalcArrowDamage
  • devenv_2018-04-21_17-21-18.png
  • int battle_hit

 

for skills:

char_skill

  • FuncSplashDamage

Do you want critical and so on to also work or to always 1 damage, independently of critical, penetrate, etc?

_______________________________________________________________________________________________________

If you want ONLY 1 damage to mobs (hits, skills, criticals, etc), ignore the previous steps and

Go to char_battle.cpp, in the damage function, edit like on image:

devenv_2018-04-21_18-02-35.png

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2
Link to comment
Share on other sites

  • Bot
5 hours ago, tierrilopes said:

 

Do you want to change the "hit" only or also skills?

Changes at the stated functions for hits and arrows (example on arrow):

battle.cpp

  • int CalcArrowDamage
  • devenv_2018-04-21_17-21-18.png
  • int battle_hit

 

for skills:

char_skill

  • FuncSplashDamage

Do you want critical and so on to also work or to always 1 damage, independently of critical, penetrate, etc?

_______________________________________________________________________________________________________

If you want ONLY 1 damage to mobs (hits, skills, criticals, etc)

Go to char_battle.cpp, in the damage function, edit like on image:

devenv_2018-04-21_18-02-35.png

Thanks, it works perfect. To work on hits, skills, criticals, penetrates, poisons, I just need to remove damageFlag = DAMAGE_NORMAL.

Like this:

		if (GetRaceNum() == 101)
		{
			dam = 1;
		}

One thing that happens is that if you have bonus APPLY_STEAL_HP, you will continue to remove 1 damage to the mob, but if you absorb HP obviously the life of the mob will drop more than 1 per hit, which does not matter to me otherwise, it will It would take a long time to kill the mob.

Thank you very much for the help, I was already overwhelmed xD!

 

Edited by Metin2 Dev
Core X - External 2 Internal

english_banner.gif

Link to comment
Share on other sites

  • 7 months later...
  • Active Member

Is here another solution for this? I want to kill some mob only with my hand without weapon, so I set in database strong against.... so player giving no damage with weapon, skills, etc. Only with his hand he can do a damage and I need to set this damage to 700 as default to specific mobs.

I'll be always helpful! 👊 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.