Spoiler
1381 if (battle_config.weapon_defense_type) { 1382 vit_def += def1*battle_config.weapon_defense_type; 1383 def1 = 0; 1384 } 1385 #ifdef RENEWAL 1386 /** 1387 * RE DEF Reduction 1388 * Pierce defense gains 1 atk per def/2 1389 **/ 1390 1391 if( def1 < -399 ) // it stops at -399 1392 def1 = 399; // in aegis it set to 1 but in our case it may lead to exploitation so limit it to 399 1393 //return 1; 1394 1395 if( flag&2 ) 1396 damage += def1 >> 1; 1397 1398 if( !(flag&1) && !(flag&2) ) { 1399 if( flag&4 ) 1400 damage -= (def1 + vit_def); 1401 else 1402 damage = (int)((100.0f - def1 / (def1 + 400.0f) * 90.0f) / 100.0f * damage - vit_def); 1403 } 1404 #else 1405 if( def1 > 100 ) def1 = 100; 1406 if( !(flag&1) ){ 1407 if( flag&2 ) 1408 damage = damage * pdef * (def1+vit_def) / 100; 1409 else 1410 damage = damage * (100-def1) / 100; 1411 } 1412 if( !(flag&1 || flag&2) ) 1413 damage -= vit_def; 1414 #endif