dogukanm0 1 Posted May 28, 2019 Share Posted May 28, 2019 Hello. Lightning resistance doesn't work. I want to use this feature as defense against Setaou monsters. I searched in many places but I couldn't find out how. Can you help me? Thak you for your time... Link to comment Share on other sites More sharing options...
Bot Metin2 Dev 4884 Posted May 28, 2019 Bot Share Posted May 28, 2019 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; } } } [...] } 1 1 1 Link to comment Share on other sites More sharing options...
dogukanm0 1 Posted May 28, 2019 Author Share Posted May 28, 2019 When I do this, will be like Metin2GF ? (lightning resistance) Link to comment Share on other sites More sharing options...
Premium Hunger 472 Posted May 29, 2019 Premium Share Posted May 29, 2019 Here 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