Cien 0 Posted July 7, 2019 Share Posted July 7, 2019 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 More sharing options...
Syriza 235 Posted July 7, 2019 Share Posted July 7, 2019 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 1 Link to comment Share on other sites More sharing options...
Premium tierrilopes 452 Posted July 7, 2019 Premium Share Posted July 7, 2019 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 More sharing options...
Cien 0 Posted July 7, 2019 Author Share Posted July 7, 2019 vor 34 Minuten schrieb Syriza: isnt this the calculation from martys source? why did you release it lol Well i dont exacly know what you mean. This piece of Code is available for anyone with the first post on Google from ~12/2017... Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now