Jump to content

Elemental Resistances


Recommended Posts

Unfortunately there´s no Tutorial anywhere in regards to this. I´ve only found alot of Threads from people who seem to have the same Question, unfortunately again any answer posted doesn't help.

In short, i would like to give certain Monster Elemental Damage Types so that the Resistances like Lightning, Dark etc reduce the Damage taken.

As far as i can tell all of this is already implemented, my battle.cpp as an example:

	//[ mob -> PC ] ¿ø¼Ò ¼Ó¼º ¹æ¾î Àû¿ë
	//2013/01/17
	//¸ó½ºÅÍ ¼Ó¼º°ø°Ý µ¥¹ÌÁöÀÇ 30%¿¡ ÇØ´çÇÏ´Â ¼öÄ¡¿¡¸¸ ÀúÇ×ÀÌ Àû¿ëµÊ.
	if (pkAttacker->IsNPC() && pkVictim->IsPC())
	{
		if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_ELEC))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_ELEC))		/ 100;
		else if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_FIRE))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_FIRE))		/ 100;
		else if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_ICE))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_ICE))		/ 100;
		else if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_WIND))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_WIND))		/ 100;
		else if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_EARTH))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_EARTH))	/ 100;
		else if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_DARK))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_DARK))		/ 100;
	}
		
	
	return iAtk;

My Question is, how do i give certain Monster lightning Damage respectively an aditional Race Flag ?

(as an example, certain Monster are weak against Devil and their Damage gets reduce by Lightning Resistance )

 

In Mysql, just adding  ATT_ELEC as a new Raceflag in the mob_proto under setRaceFlag doesn't work.

 

Thanks in advance.

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

vor einer Stunde schrieb Cien:

Unfortunately there´s no Tutorial anywhere in regards to this. I´ve only found alot of Threads from people who seem to have the same Question, unfortunately again any answer posted doesn't help.

In short, i would like to give certain Monster Elemental Damage Types so that the Resistances like Lightning, Dark etc reduce the Damage taken.

As far as i can tell all of this is already implemented, my battle.cpp as an example:


	//[ mob -> PC ] ¿ø¼Ò ¼Ó¼º ¹æ¾î Àû¿ë
	//2013/01/17
	//¸ó½ºÅÍ ¼Ó¼º°ø°Ý µ¥¹ÌÁöÀÇ 30%¿¡ ÇØ´çÇÏ´Â ¼öÄ¡¿¡¸¸ ÀúÇ×ÀÌ Àû¿ëµÊ.
	if (pkAttacker->IsNPC() && pkVictim->IsPC())
	{
		if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_ELEC))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_ELEC))		/ 100;
		else if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_FIRE))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_FIRE))		/ 100;
		else if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_ICE))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_ICE))		/ 100;
		else if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_WIND))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_WIND))		/ 100;
		else if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_EARTH))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_EARTH))	/ 100;
		else if (pkAttacker->IsRaceFlag(RACE_FLAG_ATT_DARK))
			iAtk -= (iAtk * 30 * pkVictim->GetPoint(POINT_RESIST_DARK))		/ 100;
	}
		
	
	return iAtk;

My Question is, how do i give certain Monster lightning Damage respectively an aditional Race Flag ?

(as an example, certain Monster are weak against Devil and their Damage gets reduce by Lightning Resistance )

 

In Mysql, just adding  ATT_ELEC as a new Raceflag in the mob_proto under setRaceFlag doesn't work.

 

Thanks in advance.

 

 

isnt this the calculation from martys source? why did you release it lol

  • Love 1
Link to comment
Share on other sites

  • Premium
39 minutes ago, Syriza said:

 

isnt this the calculation from martys source? why did you release it lol

« // [mob -> PC] Element property defense applied
// 2013/01/17
// Monster Attributes Resistance only applies to 30% of attack damage.
»

Calculation on the code above is more accurate then original on (/10000), yet still the same thing as original function, so i wouldnt call this a release or a leak.

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.