Bläddra i källkod

Removed some hardcoded mob ids

Created some race2 values for mobs used in the Manuk and Splendide status changes
Lemongrass3110 9 år sedan
förälder
incheckning
65b716f586
7 ändrade filer med 23 tillägg och 53 borttagningar
  1. 1 1
      db/import-tmpl/mob_race2_db.txt
  2. 5 1
      db/re/mob_race2_db.txt
  3. 12 34
      src/map/battle.c
  4. 2 0
      src/map/map.h
  5. 0 4
      src/map/mob.c
  6. 0 13
      src/map/mob.h
  7. 3 0
      src/map/script_constants.h

+ 1 - 1
db/import-tmpl/mob_race2_db.txt

@@ -1,5 +1,5 @@
 // Monster Racial Groups Database
 //
 // Structure of Database:
-// Race2ID,MobID1,MobID2,MobID3,...,MobID9
+// Race2ID,MobID1,MobID2,MobID3,...,MobID100
 

+ 5 - 1
db/re/mob_race2_db.txt

@@ -1,7 +1,7 @@
 // Monster Racial Groups Database
 //
 // Structure of Database:
-// Race2ID,MobID1,MobID2,MobID3,...,MobID50
+// Race2ID,MobID1,MobID2,MobID3,...,MobID100
 
 // Goblins
 1,1122,1123,1124,1125,1126,1258,1299
@@ -24,3 +24,7 @@
 // Bio Labs
 // TODO : Monsters in lhz_dun_n not implemented yet. [secretdataz]
 10,1634,1635,1636,1637,1638,1639,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,2221,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241
+// Manuk
+11,1986,1987,1988,1989,1990,1997,1998,1999
+// Splendide
+12,1991,1992,1993,1994,1995

+ 12 - 34
src/map/battle.c

@@ -1306,23 +1306,11 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
 
 		// Compressed code, fixed by map.h [Epoque]
 		if (src->type == BL_MOB) {
-			int i;
-
-			if (sc->data[SC_MANU_DEF]) {
-				for (i=0;ARRAYLENGTH(mob_manuk)>i;i++) {
-					if (mob_manuk[i]==((TBL_MOB*)src)->mob_id) {
-						damage -= damage * sc->data[SC_MANU_DEF]->val1 / 100;
-						break;
-					}
-				}
+			if( sc->data[SC_MANU_DEF] && status_get_race2(src) == RC2_MANUK ){
+				damage -= damage * sc->data[SC_MANU_DEF]->val1 / 100;
 			}
-			if (sc->data[SC_SPL_DEF]) {
-				for (i=0;ARRAYLENGTH(mob_splendide)>i;i++) {
-					if (mob_splendide[i]==((TBL_MOB*)src)->mob_id) {
-						damage -= damage * sc->data[SC_SPL_DEF]->val1 / 100;
-						break;
-					}
-				}
+			if( sc->data[SC_SPL_DEF] && status_get_race2(src) == RC2_SPLENDIDE ){
+				damage -= damage * sc->data[SC_SPL_DEF]->val1 / 100;
 			}
 		}
 
@@ -1462,27 +1450,17 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
 
 		// [Epoque]
 		if (bl->type == BL_MOB) {
-			uint8 i;
-
-			if ( ((sce=sc->data[SC_MANU_ATK]) && (flag&BF_WEAPON)) ||
-				 ((sce=sc->data[SC_MANU_MATK]) && (flag&BF_MAGIC))
+			if ( (((sce=sc->data[SC_MANU_ATK]) && (flag&BF_WEAPON)) ||
+				 ((sce=sc->data[SC_MANU_MATK]) && (flag&BF_MAGIC))) &&
+				 status_get_race2(bl) == RC2_MANUK
 				) {
-				for (i=0;ARRAYLENGTH(mob_manuk)>i;i++) {
-					if (((TBL_MOB*)bl)->mob_id==mob_manuk[i]) {
-						damage += damage * sce->val1 / 100;
-						break;
-					}
-				}
+				damage += damage * sce->val1 / 100;
 			}
-			if ( ((sce=sc->data[SC_SPL_ATK]) && (flag&BF_WEAPON)) ||
-				 ((sce=sc->data[SC_SPL_MATK]) && (flag&BF_MAGIC))
+			if ( (((sce=sc->data[SC_SPL_ATK]) && (flag&BF_WEAPON)) ||
+				 ((sce=sc->data[SC_SPL_MATK]) && (flag&BF_MAGIC))) &&
+				 status_get_race2(bl) == RC2_SPLENDIDE
 				) {
-				for (i=0;ARRAYLENGTH(mob_splendide)>i;i++) {
-					if (((TBL_MOB*)bl)->mob_id==mob_splendide[i]) {
-						damage += damage * sce->val1 / 100;
-						break;
-					}
-				}
+				damage += damage * sce->val1 / 100;
 			}
 		}
 		/* Self Buff that destroys the armor of any target hit with melee or ranged physical attacks */

+ 2 - 0
src/map/map.h

@@ -297,6 +297,8 @@ enum e_race2 {
 	RC2_BATTLEFIELD,
 	RC2_TREASURE,
 	RC2_BIOLAB,
+	RC2_MANUK,
+	RC2_SPLENDIDE,
 	RC2_MAX
 };
 

+ 0 - 4
src/map/mob.c

@@ -104,10 +104,6 @@ struct s_randomsummon_group {
 
 static DBMap *mob_summon_db; /// Random Summon DB. struct s_randomsummon_group -> group_id
 
-//Defines the Manuk/Splendide mob groups for the status reductions [Epoque]
-const int mob_manuk[8] = { MOBID_TATACHO, MOBID_CENTIPEDE, MOBID_NEPENTHES, MOBID_HILLSRION, MOBID_HARDROCK_MOMMOTH, MOBID_G_TATACHO, MOBID_G_HILLSRION, MOBID_CENTIPEDE_LARVA };
-const int mob_splendide[5] = { MOBID_TENDRILRION, MOBID_CORNUS, MOBID_NAGA, MOBID_LUCIOLA_VESPA, MOBID_PINGUICULA };
-
 /*==========================================
  * Local prototype declaration   (only required thing)
  *------------------------------------------*/

+ 0 - 13
src/map/mob.h

@@ -61,19 +61,6 @@ enum MOBID {
 	MOBID_G_GEOGRAPHER		= 1590,
 	MOBID_GUARDIAN_STONE1	= 1907,
 	MOBID_GUARDIAN_STONE2,
-	MOBID_TATACHO			= 1986,
-	MOBID_CENTIPEDE,
-	MOBID_NEPENTHES,
-	MOBID_HILLSRION,
-	MOBID_HARDROCK_MOMMOTH,
-	MOBID_TENDRILRION,
-	MOBID_CORNUS,
-	MOBID_NAGA,
-	MOBID_LUCIOLA_VESPA,
-	MOBID_PINGUICULA,
-	MOBID_G_TATACHO			= 1997,
-	MOBID_G_HILLSRION,
-	MOBID_CENTIPEDE_LARVA,
 	MOBID_SILVERSNIPER		= 2042,
 	MOBID_MAGICDECOY_FIRE,
 	MOBID_MAGICDECOY_WATER,

+ 3 - 0
src/map/script_constants.h

@@ -2424,6 +2424,9 @@
 	export_constant(RC2_BATTLEFIELD);
 	export_constant(RC2_TREASURE);
 	export_constant(RC2_BIOLAB);
+	export_constant(RC2_MANUK);
+	export_constant(RC2_SPLENDIDE);
+	export_constant(RC2_MAX);
 
 	/* classes */
 	export_constant(CLASS_NORMAL);