Explorar o código

Fixed battle_attr_fix logic for defense element level (#8723)

Fixed #8722 

Co-authored-by: Atemo <Atemo@users.noreply.github.com>
Singe Horizontal hai 7 meses
pai
achega
e035c0658f
Modificáronse 2 ficheiros con 3 adicións e 3 borrados
  1. 1 1
      src/map/battle.cpp
  2. 2 2
      src/map/status.cpp

+ 1 - 1
src/map/battle.cpp

@@ -466,7 +466,7 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
 		return damage;
 	}
 
-	ratio = elemental_attribute_db.getAttribute(def_lv-1, atk_elem, def_type);
+	ratio = elemental_attribute_db.getAttribute(def_lv, atk_elem, def_type);
 	if (sc && sc->count) { //increase dmg by src status
 		switch(atk_elem){
 			case ELE_FIRE:

+ 2 - 2
src/map/status.cpp

@@ -15674,10 +15674,10 @@ AttributeDatabase elemental_attribute_db;
  * @param level Element level 1 ~ MAX_ELE_LEVEL
  */
 int16 AttributeDatabase::getAttribute(uint16 level, uint16 atk_ele, uint16 def_ele) {
-	if (!CHK_ELEMENT(atk_ele) || !CHK_ELEMENT(def_ele) || !CHK_ELEMENT_LEVEL(level+1))
+	if (!CHK_ELEMENT(atk_ele) || !CHK_ELEMENT(def_ele) || !CHK_ELEMENT_LEVEL(level))
 		return 100;
 
-	return this->attr_fix_table[level][atk_ele][def_ele];
+	return this->attr_fix_table[level-1][atk_ele][def_ele];
 }
 
 const std::string StatusDatabase::getDefaultLocation() {