Jump to content

Recommended Posts

  • Bot

char_battle.cpp

search:

bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type)
{
	[...]

	if (pAttacker)
	{
		[...]
	}

	[...]
}

add inside "if (pAttacker)"
this:
 

		if (pAttacker->IsMonster())
		{
			int resistType = 0;
			if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_ELEC))
				resistType = POINT_RESIST_ELEC;
			else if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_FIRE))
				resistType = POINT_RESIST_FIRE;
			else if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_ICE))
				resistType = POINT_RESIST_ICE;
			else if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_WIND))
				resistType = POINT_RESIST_WIND;
			else if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_EARTH))
				resistType = POINT_RESIST_EARTH;
			else if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_DARK))
				resistType = POINT_RESIST_DARK;

			if(resistType && GetPoint(resistType) > 0)
			{
				int result = (int)GetPoint(resistType);
				if(result > 50)
					result = 50;

				dam -= dam*result/100;
			}
		}

There should be something like that:

bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type)
{
	[...]

	if (pAttacker)
	{
		[...]
		if (pAttacker->IsMonster())
		{
			int resistType = 0;
			if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_ELEC))
				resistType = POINT_RESIST_ELEC;
			else if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_FIRE))
				resistType = POINT_RESIST_FIRE;
			else if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_ICE))
				resistType = POINT_RESIST_ICE;
			else if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_WIND))
				resistType = POINT_RESIST_WIND;
			else if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_EARTH))
				resistType = POINT_RESIST_EARTH;
			else if(pAttacker->IsRaceFlag(RACE_FLAG_ATT_DARK))
				resistType = POINT_RESIST_DARK;

			if(resistType && GetPoint(resistType) > 0)
			{
				int result = (int)GetPoint(resistType);
				if(result > 50)
					result = 50;

				dam -= dam*result/100;
			}
		}
	}

	[...]
}

 

  • Good 1
  • Love 1
  • Love 1

english_banner.gif

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



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.