Browse Source

- Changed Greed Scroll's type to 11 (all itemskill items should use this)
- Ignore %MDef bonuses now only reduce target's base MDEF, not MDEF2.
- Updated the 'skills that cause no damage are blocked now if the skill element is blocked by the target' to only apply if the skill has a status change associated (fixes Resurrection/Heal being blocked).
- Reverted the opt_flag2 change in status_change_start (clif_changeoption2) since it never served its purpose.
- Added a warning to prevent loading mobs with IDs that belong to the clone range.
- Changed MAX_MOB_DB to 3000, updated the definitions of the clone range defines so they are updated automatically with the change of MAX_MOB_DB.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11287 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 17 years ago
parent
commit
1a91ca358c
9 changed files with 58 additions and 52 deletions
  1. 6 0
      Changelog-Trunk.txt
  2. 2 0
      db/Changelog.txt
  3. 1 1
      db/item_db.txt
  4. 1 1
      src/map/battle.c
  5. 5 0
      src/map/mob.c
  6. 4 3
      src/map/mob.h
  7. 1 1
      src/map/pet.c
  8. 8 8
      src/map/skill.c
  9. 30 38
      src/map/status.c

+ 6 - 0
Changelog-Trunk.txt

@@ -4,6 +4,12 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
 2007/09/24
 2007/09/24
+	* Ignore %MDef bonuses now only reduce target's base MDEF, not MDEF2.
+	* Updated the 'skills that cause no damage are blocked now if the skill
+	  element is blocked by the target' to only apply if the skill has a status
+	  change associated (fixes Resurrection/Heal being blocked).
+	* Added a warning to prevent loading mobs with IDs that belong to the clone
+	  range. [Skotlex]
 	* Limited manual detection of data truncation to string/enum/blob columns.
 	* Limited manual detection of data truncation to string/enum/blob columns.
 	* Renamed conf-tmpl to conf. [FlavioJS]
 	* Renamed conf-tmpl to conf. [FlavioJS]
 2007/09/23
 2007/09/23

+ 2 - 0
db/Changelog.txt

@@ -28,6 +28,8 @@
 
 
 =======================
 =======================
 09/24
 09/24
+	* Changed Greed Scroll's type to 11 (all itemskill items should use this)
+	  [Skotlex]
 	* Fixed Lever Action Rifle thanks to Cort [Playtester]
 	* Fixed Lever Action Rifle thanks to Cort [Playtester]
 09/23
 09/23
 	* Fixed some "official bugs" [Playtester]
 	* Fixed some "official bugs" [Playtester]

+ 1 - 1
db/item_db.txt

@@ -3769,7 +3769,7 @@
 14526,Oriental_Pastry,Oriental Pastry,0,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_MATKPOTION,180000,10; },{},{}
 14526,Oriental_Pastry,Oriental Pastry,0,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_MATKPOTION,180000,10; },{},{}
 14527,Dungeon_Teleport_Scroll,Dungeon Teleport Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashDungeon"; },{},{}
 14527,Dungeon_Teleport_Scroll,Dungeon Teleport Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashDungeon"; },{},{}
 14528,PVP_Mobile_Scroll,PVP Mobile Scroll,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{}
 14528,PVP_Mobile_Scroll,PVP Mobile Scroll,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{}
-14529,Greed_Scroll,Greed Scroll,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemskill 1013,1; },{},{}
+14529,Greed_Scroll,Greed Scroll,11,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemskill 1013,1; },{},{}
 14530,Evasion_Scroll,Evasion Scroll,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCFLEE,1800000,30; },{},{}
 14530,Evasion_Scroll,Evasion Scroll,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCFLEE,1800000,30; },{},{}
 14531,Concentration_Power_Scroll,Concentration Power Scroll,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCHIT,1800000,30; },{},{}
 14531,Concentration_Power_Scroll,Concentration Power Scroll,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCHIT,1800000,30; },{},{}
 //14532,±âÃÊ_Field_Manual,±âÃÊ_Field_Manual,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{}
 //14532,±âÃÊ_Field_Manual,±âÃÊ_Field_Manual,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{}

+ 1 - 1
src/map/battle.c

@@ -2340,7 +2340,7 @@ struct Damage battle_calc_magic_attack(
 				{
 				{
 					if (i > 100) i = 100;
 					if (i > 100) i = 100;
 					mdef -= mdef * i/100;
 					mdef -= mdef * i/100;
-					mdef2-= mdef2* i/100;
+					//mdef2-= mdef2* i/100;
 				}
 				}
 			}
 			}
 			if(battle_config.magic_defense_type)
 			if(battle_config.magic_defense_type)

+ 5 - 0
src/map/mob.c

@@ -3239,6 +3239,11 @@ static bool mob_parse_dbrow(char** str)
 		return false;
 		return false;
 	}
 	}
 	
 	
+	if (class_ >= MOB_CLONE_START && class_ < MOB_CLONE_END) {
+		ShowWarning("Mob with ID: %d not loaded. That ID is reserved for player clones. Please increase MAX_MOB_DB (%d)\n", MAX_MOB_DB);
+		return false;
+	}
+
 	if (mob_db_data[class_] == NULL)
 	if (mob_db_data[class_] == NULL)
 		mob_db_data[class_] = aCalloc(1, sizeof (struct mob_data));
 		mob_db_data[class_] = aCalloc(1, sizeof (struct mob_data));
 	
 	

+ 4 - 3
src/map/mob.h

@@ -13,7 +13,8 @@
 
 
 // Change this to increase the table size in your mob_db to accomodate a larger mob database.
 // Change this to increase the table size in your mob_db to accomodate a larger mob database.
 // Be sure to note that IDs 4001 to 4048 are reserved for advanced/baby/expanded classes.
 // Be sure to note that IDs 4001 to 4048 are reserved for advanced/baby/expanded classes.
-#define MAX_MOB_DB 10000
+// Notice that the last 1000 entries are used for player clones, so always set this to desired value +1000
+#define MAX_MOB_DB 3000
 
 
 //The number of drops all mobs have and the max drop-slot that the steal skill will attempt to steal from.
 //The number of drops all mobs have and the max drop-slot that the steal skill will attempt to steal from.
 #define MAX_MOB_DROP 10
 #define MAX_MOB_DROP 10
@@ -28,8 +29,8 @@
 #define MOB_SLAVEDISTANCE 2
 #define MOB_SLAVEDISTANCE 2
 
 
 // These define the range of available IDs for clones. [Valaris]
 // These define the range of available IDs for clones. [Valaris]
-#define MOB_CLONE_START 9001
-#define MOB_CLONE_END 10000
+#define MOB_CLONE_START (MAX_MOB_DB-999)
+#define MOB_CLONE_END MAX_MOB_DB
 
 
 // Scripted Mob AI Constants
 // Scripted Mob AI Constants
 #define CALLBACK_NPCCLICK	0x100
 #define CALLBACK_NPCCLICK	0x100

+ 1 - 1
src/map/pet.c

@@ -215,7 +215,7 @@ int pet_sc_check(struct map_session_data *sd, int type)
 
 
 	if( pd == NULL
 	if( pd == NULL
 	||  (battle_config.pet_equip_required && pd->pet.equip == 0)
 	||  (battle_config.pet_equip_required && pd->pet.equip == 0)
-	||  pd->recovery == NULL 
+	||  pd->recovery == NULL
 	||  pd->recovery->timer != -1
 	||  pd->recovery->timer != -1
 	||  pd->recovery->type != type )
 	||  pd->recovery->type != type )
 		return 1;
 		return 1;

+ 8 - 8
src/map/skill.c

@@ -3417,7 +3417,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 	struct status_change *tsc;
 	struct status_change *tsc;
 	struct mob_data *md = NULL;
 	struct mob_data *md = NULL;
 	struct mob_data *dstmd = NULL;
 	struct mob_data *dstmd = NULL;
-	int i,type=-1;
+	int i,type;
 	
 	
 	if(skillid > 0 && skilllv <= 0) return 0;	// celest
 	if(skillid > 0 && skilllv <= 0) return 0;	// celest
 
 
@@ -3445,16 +3445,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 		return 1;
 		return 1;
 	if(status_isdead(src))
 	if(status_isdead(src))
 		return 1;
 		return 1;
+
 	if(src!=bl && status_isdead(bl) && skillid != ALL_RESURRECTION && skillid != PR_REDEMPTIO)
 	if(src!=bl && status_isdead(bl) && skillid != ALL_RESURRECTION && skillid != PR_REDEMPTIO)
 		return 1;
 		return 1;
 
 
 	tstatus = status_get_status_data(bl);
 	tstatus = status_get_status_data(bl);
 	sstatus = status_get_status_data(src);
 	sstatus = status_get_status_data(src);
 	
 	
-	if(src!=bl && (i = skill_get_pl(skillid, skilllv)) > ELE_NEUTRAL && 
-		battle_attr_fix(NULL, NULL, 100, i, tstatus->def_ele, tstatus->ele_lv) <= 0)
-		return 1; //Skills with an element should be blocked if the target element absorbs it.
-
 	//Check for undead skills that convert a no-damage skill into a damage one. [Skotlex]
 	//Check for undead skills that convert a no-damage skill into a damage one. [Skotlex]
 	switch (skillid) {
 	switch (skillid) {
 		case HLIF_HEAL:	//[orn]
 		case HLIF_HEAL:	//[orn]
@@ -3483,11 +3480,14 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 				return skill_castend_pos2(src,bl->x,bl->y,skillid,skilllv,tick,0);
 				return skill_castend_pos2(src,bl->x,bl->y,skillid,skilllv,tick,0);
 	}
 	}
 
 
-	if (skillid > 0)
-		type = SkillStatusChangeTable(skillid);
-
+	type = SkillStatusChangeTable(skillid);
 	tsc = status_get_sc(bl);
 	tsc = status_get_sc(bl);
 
 
+	if (src!=bl && type > -1 &&
+		(i = skill_get_pl(skillid, skilllv)) > ELE_NEUTRAL &&
+		battle_attr_fix(NULL, NULL, 100, i, tstatus->def_ele, tstatus->ele_lv) <= 0)
+		return 1; //Skills that cause an status should be blocked if the target element blocks its element.
+
 	map_freeblock_lock();
 	map_freeblock_lock();
 	switch(skillid)
 	switch(skillid)
 	{
 	{

+ 30 - 38
src/map/status.c

@@ -5900,18 +5900,18 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
 		case SC_SPEARQUICKEN:
 		case SC_SPEARQUICKEN:
 		case SC_CONCENTRATION:
 		case SC_CONCENTRATION:
 			sc->opt3 |= 0x1;
 			sc->opt3 |= 0x1;
-			opt_flag = 2;
+			opt_flag = 0;
 			break;
 			break;
 		case SC_MAXOVERTHRUST:
 		case SC_MAXOVERTHRUST:
 		case SC_OVERTHRUST:
 		case SC_OVERTHRUST:
 		case SC_SWOO:	//Why does it shares the same opt as Overthrust? Perhaps we'll never know...
 		case SC_SWOO:	//Why does it shares the same opt as Overthrust? Perhaps we'll never know...
 			sc->opt3 |= 0x2;
 			sc->opt3 |= 0x2;
-			opt_flag = 2;
+			opt_flag = 0;
 			break;
 			break;
 		case SC_ENERGYCOAT:
 		case SC_ENERGYCOAT:
 		case SC_SKE:
 		case SC_SKE:
 			sc->opt3 |= 0x4;
 			sc->opt3 |= 0x4;
-			opt_flag = 2;
+			opt_flag = 0;
 			break;
 			break;
 		case SC_INCATKRATE:
 		case SC_INCATKRATE:
 			//Simulate Explosion Spirits effect for NPC_POWERUP [Skotlex]
 			//Simulate Explosion Spirits effect for NPC_POWERUP [Skotlex]
@@ -5921,39 +5921,39 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
 			}
 			}
 		case SC_EXPLOSIONSPIRITS:
 		case SC_EXPLOSIONSPIRITS:
 			sc->opt3 |= 0x8;
 			sc->opt3 |= 0x8;
-			opt_flag = 2;
+			opt_flag = 0;
 			break;
 			break;
 		case SC_STEELBODY:
 		case SC_STEELBODY:
 		case SC_SKA:
 		case SC_SKA:
 			sc->opt3 |= 0x10;
 			sc->opt3 |= 0x10;
-			opt_flag = 2;
+			opt_flag = 0;
 			break;
 			break;
 		case SC_BLADESTOP:
 		case SC_BLADESTOP:
 			sc->opt3 |= 0x20;
 			sc->opt3 |= 0x20;
-			opt_flag = 2;
+			opt_flag = 0;
 			break;
 			break;
 		//0x40 missing?
 		//0x40 missing?
 		case SC_BERSERK:
 		case SC_BERSERK:
 			sc->opt3 |= 0x80;
 			sc->opt3 |= 0x80;
-			opt_flag = 2;
+			opt_flag = 0;
 			break;
 			break;
 		//0x100, 0x200 missing?
 		//0x100, 0x200 missing?
 		case SC_MARIONETTE:
 		case SC_MARIONETTE:
 		case SC_MARIONETTE2:
 		case SC_MARIONETTE2:
 			sc->opt3 |= 0x400;
 			sc->opt3 |= 0x400;
-			opt_flag = 2;
+			opt_flag = 0;
 			break;
 			break;
 		case SC_ASSUMPTIO:
 		case SC_ASSUMPTIO:
 			sc->opt3 |= 0x800;
 			sc->opt3 |= 0x800;
-			opt_flag = 2;
+			opt_flag = 0;
 			break;
 			break;
 		case SC_WARM: //SG skills [Komurka]
 		case SC_WARM: //SG skills [Komurka]
 			sc->opt3 |= 0x1000;
 			sc->opt3 |= 0x1000;
-			opt_flag = 2;
+			opt_flag = 0;
 			break;
 			break;
 		case SC_KAITE:
 		case SC_KAITE:
 			sc->opt3 |= 0x2000;
 			sc->opt3 |= 0x2000;
-			opt_flag = 2;
+			opt_flag = 0;
 			break;
 			break;
 		//OPTION
 		//OPTION
 		case SC_HIDING:
 		case SC_HIDING:
@@ -5989,12 +5989,8 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
 
 
 	//On Aegis, when turning on a status change, first goes the option packet,
 	//On Aegis, when turning on a status change, first goes the option packet,
 	// then the sc packet.
 	// then the sc packet.
-	if(opt_flag) {
-		if (opt_flag == 2)
-			clif_changeoption2(bl);
-		else
-			clif_changeoption(bl);
-	}
+	if(opt_flag)
+		clif_changeoption(bl);
 
 
 	if (calc_flag&SCB_DYE)
 	if (calc_flag&SCB_DYE)
 	{	//Reset DYE color
 	{	//Reset DYE color
@@ -6412,15 +6408,15 @@ int status_change_end( struct block_list* bl , int type,int tid )
 
 
 	case SC_HIDING:
 	case SC_HIDING:
 		sc->option &= ~OPTION_HIDE;
 		sc->option &= ~OPTION_HIDE;
-		opt_flag|= 8|4; //Check for warp trigger + AoE trigger
+		opt_flag|= 2|4; //Check for warp trigger + AoE trigger
 		break;
 		break;
 	case SC_CLOAKING:
 	case SC_CLOAKING:
 		sc->option &= ~OPTION_CLOAK;
 		sc->option &= ~OPTION_CLOAK;
-		opt_flag|= 8;
+		opt_flag|= 2;
 		break;
 		break;
 	case SC_CHASEWALK:
 	case SC_CHASEWALK:
 		sc->option &= ~(OPTION_CHASEWALK|OPTION_CLOAK);
 		sc->option &= ~(OPTION_CHASEWALK|OPTION_CLOAK);
-		opt_flag|= 8;
+		opt_flag|= 2;
 		break;
 		break;
 	case SC_SIGHT:
 	case SC_SIGHT:
 		sc->option &= ~OPTION_SIGHT;
 		sc->option &= ~OPTION_SIGHT;
@@ -6446,55 +6442,55 @@ int status_change_end( struct block_list* bl , int type,int tid )
 	case SC_SPEARQUICKEN:
 	case SC_SPEARQUICKEN:
 	case SC_CONCENTRATION:
 	case SC_CONCENTRATION:
 		sc->opt3 &= ~0x1;
 		sc->opt3 &= ~0x1;
-		opt_flag = 2;
+		opt_flag = 0;
 		break;
 		break;
 	case SC_OVERTHRUST:
 	case SC_OVERTHRUST:
 	case SC_MAXOVERTHRUST:
 	case SC_MAXOVERTHRUST:
 	case SC_SWOO:
 	case SC_SWOO:
 		sc->opt3 &= ~0x2;
 		sc->opt3 &= ~0x2;
-		opt_flag = 2;
+		opt_flag = 0;
 		break;
 		break;
 	case SC_ENERGYCOAT:
 	case SC_ENERGYCOAT:
 	case SC_SKE:
 	case SC_SKE:
 		sc->opt3 &= ~0x4;
 		sc->opt3 &= ~0x4;
-		opt_flag = 2;
+		opt_flag = 0;
 		break;
 		break;
 	case SC_INCATKRATE: //Simulated Explosion spirits effect.
 	case SC_INCATKRATE: //Simulated Explosion spirits effect.
 		if (bl->type != BL_MOB)
 		if (bl->type != BL_MOB)
 			break;
 			break;
 	case SC_EXPLOSIONSPIRITS:
 	case SC_EXPLOSIONSPIRITS:
 		sc->opt3 &= ~0x8;
 		sc->opt3 &= ~0x8;
-		opt_flag = 2;
+		opt_flag = 0;
 		break;
 		break;
 	case SC_STEELBODY:
 	case SC_STEELBODY:
 	case SC_SKA:
 	case SC_SKA:
 		sc->opt3 &= ~0x10;
 		sc->opt3 &= ~0x10;
-		opt_flag = 2;
+		opt_flag = 0;
 		break;
 		break;
 	case SC_BLADESTOP:
 	case SC_BLADESTOP:
 		sc->opt3 &= ~0x20;
 		sc->opt3 &= ~0x20;
-		opt_flag = 2;
+		opt_flag = 0;
 		break;
 		break;
 	case SC_BERSERK:
 	case SC_BERSERK:
 		sc->opt3 &= ~0x80;
 		sc->opt3 &= ~0x80;
-		opt_flag = 2;
+		opt_flag = 0;
 		break;
 		break;
 	case SC_MARIONETTE:
 	case SC_MARIONETTE:
 	case SC_MARIONETTE2:
 	case SC_MARIONETTE2:
 		sc->opt3 &= ~0x400;
 		sc->opt3 &= ~0x400;
-		opt_flag = 2;
+		opt_flag = 0;
 		break;
 		break;
 	case SC_ASSUMPTIO:
 	case SC_ASSUMPTIO:
 		sc->opt3 &= ~0x800;
 		sc->opt3 &= ~0x800;
-		opt_flag = 2;
+		opt_flag = 0;
 		break;
 		break;
 	case SC_WARM: //SG skills [Komurka]
 	case SC_WARM: //SG skills [Komurka]
 		sc->opt3 &= ~0x1000;
 		sc->opt3 &= ~0x1000;
-		opt_flag = 2;
+		opt_flag = 0;
 		break;
 		break;
 	case SC_KAITE:
 	case SC_KAITE:
 		sc->opt3 &= ~0x2000;
 		sc->opt3 &= ~0x2000;
-		opt_flag = 2;
+		opt_flag = 0;
 		break;
 		break;
 	default:
 	default:
 		opt_flag = 0;
 		opt_flag = 0;
@@ -6513,12 +6509,8 @@ int status_change_end( struct block_list* bl , int type,int tid )
 	else if (sd)
 	else if (sd)
 		clif_status_load(bl,StatusIconChangeTable[type],0);
 		clif_status_load(bl,StatusIconChangeTable[type],0);
 
 
-	if(opt_flag) {
-		if (opt_flag & 2)
-			clif_changeoption2(bl);
-		else
-			clif_changeoption(bl);
-	}
+	if(opt_flag)
+		clif_changeoption(bl);
 
 
 	if (calc_flag)
 	if (calc_flag)
 		status_calc_bl(bl,calc_flag);
 		status_calc_bl(bl,calc_flag);
@@ -6526,7 +6518,7 @@ int status_change_end( struct block_list* bl , int type,int tid )
 	if(opt_flag&4) //Out of hiding, invoke on place.
 	if(opt_flag&4) //Out of hiding, invoke on place.
 		skill_unit_move(bl,gettick(),1);
 		skill_unit_move(bl,gettick(),1);
 
 
-	if(opt_flag&8 && sd && map_getcell(bl->m,bl->x,bl->y,CELL_CHKNPC))
+	if(opt_flag&2 && sd && map_getcell(bl->m,bl->x,bl->y,CELL_CHKNPC))
 		npc_touch_areanpc(sd,bl->m,bl->x,bl->y); //Trigger on-touch event.
 		npc_touch_areanpc(sd,bl->m,bl->x,bl->y); //Trigger on-touch event.
 
 
 	return 1;
 	return 1;