فهرست منبع

- Updated BD_INTOABYSS's unit flag to not affect mobs.
- Changed setting for skill_nocast flag 16. It is no longer a "pk-mode map" setting, it's now a clone-forbidden skill. That is, skills with the flag 16 will never be copied by clones. If you use a PK-mode server, use flag 2 now to forbid skills from common maps.
- Default skills from not being cloned are Magnus Exorcism and Turn Undead.
- The map search free cell will now use the size of the map # of tries before giving up when the spawn area is the whole map. Added a check to inmediately give up when the number of spawn retries has reached the max specified (no_spawn_onplayer = 100).
- Cleaned up a bit the clone code to account for the unit flags UF_NOPC/UF_NOMOB when the skill is not ground-based (accounts for self skill that causes a ground-tile to be placed, like Dances).


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

skotlex 19 سال پیش
والد
کامیت
eea63beee9
10فایلهای تغییر یافته به همراه51 افزوده شده و 26 حذف شده
  1. 12 0
      Changelog-Trunk.txt
  2. 1 1
      conf-tmpl/battle/monster.conf
  3. 1 0
      db/Changelog.txt
  4. 7 3
      db/skill_nocast_db.txt
  5. 1 1
      db/skill_unit_db.txt
  6. 12 7
      src/map/map.c
  7. 12 6
      src/map/mob.c
  8. 2 6
      src/map/skill.c
  9. 1 0
      src/map/skill.h
  10. 2 2
      src/map/status.c

+ 12 - 0
Changelog-Trunk.txt

@@ -4,6 +4,18 @@ 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.
 
 2006/06/23
+	* Changed setting for skill_nocast flag 16. It is no longer a "pk-mode map"
+	  setting, it's now a clone-forbidden skill. That is, skills with the flag 16
+	  will never be copied by clones. If you use a PK-mode server, use flag 2 now
+	  to forbid skills from common maps. [Skotlex]
+	* Default skills from not being cloned are Magnus Exorcism and Turn Undead. 
+	* The map search free cell will now use the size of the map # of tries
+	  before giving up when the spawn area is the whole map. Added a check to
+	  inmediately give up when the number of spawn retries has reached the max
+	  specified (no_spawn_onplayer = 100). [Skotlex]
+	* Cleaned up a bit the clone code to account for the unit flags
+	  UF_NOPC/UF_NOMOB when the skill is not ground-based (accounts for self
+	  skill that causes a ground-tile to be placed, like Dances). [Skotlex]
 	* Added pc_bonus_autospell_del, gives support for removing autospell
 	  effects. When a negative rate is specified, it will decrease the chance of
 	  casting (eg: You have two different cards with autospell Heal +20% each,

+ 1 - 1
conf-tmpl/battle/monster.conf

@@ -120,7 +120,7 @@ boss_spawn_delay: 100
 
 // Should mobs not spawn within the viewing range of players?
 // 0 is disabled, otherwise it is the number of retries before giving up 
-// and spawning the mob within player-view anyway, unless the max (50) is used,
+// and spawning the mob within player-view anyway, unless the max (100) is used,
 // in which case the mob will not be spawned, and it'll be retried again in
 // 5 seconds.
 no_spawn_on_player: 0

+ 1 - 0
db/Changelog.txt

@@ -25,6 +25,7 @@
 
 =========================
 06/23
+	* Updated BD_INTOABYSS's unit flag to not affect mobs. [Skotlex]
 	* Rogue Card Combo now removes Intimidate autospell [Playtester]
 	* Sorted in the new cards and fixed some equips [Playtester]
 06/22

+ 7 - 3
db/skill_nocast_db.txt

@@ -5,10 +5,10 @@
 //
 // Legend for 'Flag' field (bitmask):
 //  1 = Cannot be used in normal maps
-//  2 = Cannot be used in PvP maps
+//  2 = Cannot be used in PvP maps (use this instead of 1 for PK-mode servers)
 //  4 = Cannot be used in GvG maps
 //  8 = Cannot be used when WoE is on
-//  16 = Cannot be used in PK Mode maps
+//  16 = Cannot be cloned (clones will not copy this skill)
 //  Restricted zones - they're configured by 'restricted <number>' mapflag
 //  32 = Cannot be used in zone 1 maps
 //  64 = Cannot be used in zone 2 maps
@@ -32,7 +32,11 @@
 491,4	//CR_CULTIVATION
 
 //mixed
-488,19	//CG_HERMODE
+488,3	//CG_HERMODE
+
+//Clone Forbidden/pointless skills
+77,16	//PR_TURNUNDEAD
+79,16 //PR_MAGNUS
 
 //Zone 1 - Aldebaran Turbo Track
 219,32 //Snatch

+ 1 - 1
db/skill_unit_db.txt

@@ -61,7 +61,7 @@
 309,0xa1,    ,  4, 0,  -1,party, 0x300	//BD_DRUMBATTLEFIELD#戦太鼓の響き
 310,0xa2,    ,  4, 0,  -1,party, 0x300	//BD_RINGNIBELUNGEN#ニーベルングの指輪
 311,0xa3,    ,  4, 0,  -1,all,   0x300	//BD_ROKISWEIL#ロキの叫び
-312,0xa4,    ,  4, 0,  -1,party, 0x300	//BD_INTOABYSS#深淵の中に
+312,0xa4,    ,  4, 0,  -1,party, 0x320	//BD_INTOABYSS#深淵の中に
 313,0xa5,    ,  4, 0,  -1,party, 0x300	//BD_SIEGFRIED#不死身のジークフリード
 317,0xa6,    ,  3, 0,3000,enemy, 0x100	//BA_DISSONANCE#不協和音
 319,0xa7,    ,  3, 0,  -1,all,   0x120	//BA_WHISTLE#口笛

+ 12 - 7
src/map/map.c

@@ -1484,8 +1484,10 @@ int map_search_freecell(struct block_list *src, int m, short *x,short *y, int rx
 	if (rx >= 0 && ry >= 0) {
 		tries = rx2*ry2;
 		if (tries > 100) tries = 100;
-	} else
-		tries = 1000; //Must retry a lot for maps with many non-walkable tiles.
+	} else {
+		tries = map[m].xs*map[m].ys;
+		if (tries > 500) tries = 500;
+	}
 	
 	while(tries--) {
 		*x = (rx >= 0)?(rand()%rx2-rx+bx):(rand()%(map[m].xs-2)+1);
@@ -1498,12 +1500,15 @@ int map_search_freecell(struct block_list *src, int m, short *x,short *y, int rx
 		{
 			if(flag&2 && !unit_can_reach_pos(src, *x, *y, 1))
 				continue;
-			if(flag&4 && spawn++ < battle_config.no_spawn_on_player &&
-				map_foreachinarea(map_count_sub, m,
-					*x-AREA_SIZE, *y-AREA_SIZE, *x+AREA_SIZE, *y+AREA_SIZE, BL_PC)
-			)
+			if(flag&4) {
+				if (spawn >= 100) return 0; //Limit of retries reached.
+				if (spawn++ < battle_config.no_spawn_on_player &&
+					map_foreachinarea(map_count_sub, m,
+						*x-AREA_SIZE, *y-AREA_SIZE,
+					  	*x+AREA_SIZE, *y+AREA_SIZE, BL_PC)
+				)
 				continue;
-
+			}
 			return 1;
 		}
 	}

+ 12 - 6
src/map/mob.c

@@ -2842,8 +2842,19 @@ int mob_clone_spawn(struct map_session_data *sd, int m, int x, int y, const char
 	//Go Backwards to give better priority to advanced skills.
 	for (i=0,j = MAX_SKILL_TREE-1;j>=0 && i< MAX_MOBSKILL ;j--) {
 		skill_id = skill_tree[sd->status.class_][j].id;
-		if (!skill_id || sd->status.skill[skill_id].lv < 1 || (skill_get_inf2(skill_id)&(INF2_WEDDING_SKILL|INF2_GUILD_SKILL)))
+		if (!skill_id || sd->status.skill[skill_id].lv < 1 ||
+			(skill_get_inf2(skill_id)&(INF2_WEDDING_SKILL|INF2_GUILD_SKILL)) ||
+			skill_get_nocast(skill_id)&16
+		)
+			continue;
+		//Normal aggressive mob, disable skills that cannot help them fight
+		//against players (those with flags UF_NOMOB and UF_NOPC are specific 
+		//to always aid players!) [Skotlex]
+		if (!(flag&1) &&
+			skill_get_unit_id(skill_id, 0) &&
+			skill_get_unit_flag(skill_id)&(UF_NOMOB|UF_NOPC))
 			continue;
+
 		memset (&ms[i], 0, sizeof(struct mob_skill));
 		ms[i].skill_id = skill_id;
 		ms[i].skill_lv = sd->status.skill[skill_id].lv;
@@ -2863,11 +2874,6 @@ int mob_clone_spawn(struct map_session_data *sd, int m, int x, int y, const char
 			else
 				ms[i].state = MSS_BERSERK;
 		} else if(inf&INF_GROUND_SKILL) {
-			//Normal aggressive mob, disable skills that cannot help them fight
-			//against players (those with flags UF_NOMOB and UF_NOPC are specific 
-			//to always aid players!) [Skotlex]
-			if (!(flag&1) && skill_get_unit_flag(skill_id)&(UF_NOMOB|UF_NOPC))
-				continue;
 			if (skill_get_inf2(skill_id)&INF2_TRAP) { //Traps!
 				ms[i].state = MSS_IDLE;
 				ms[i].target = MST_AROUND2;

+ 2 - 6
src/map/skill.c

@@ -854,12 +854,8 @@ int skillnotok (int skillid, struct map_session_data *sd)
 	// Check skill restrictions [Celest]
 	if(!map_flag_vs(sd->bl.m) && skill_get_nocast (skillid) & 1)
 		return 1;
-	if(map[sd->bl.m].flag.pvp) {
-		if(!battle_config.pk_mode && skill_get_nocast (skillid) & 2)
-			return 1;
-		if(battle_config.pk_mode && skill_get_nocast (skillid) & 16)
-			return 1;
-	}
+	if(map[sd->bl.m].flag.pvp && skill_get_nocast (skillid) & 2)
+		return 1;
 	if(map_flag_gvg(sd->bl.m) && skill_get_nocast (skillid) & 4)
 		return 1;
 	if(agit_flag && skill_get_nocast (skillid) & 8)

+ 1 - 0
src/map/skill.h

@@ -160,6 +160,7 @@ int	skill_get_castdef( int id );
 int	skill_get_weapontype( int id );
 int	skill_get_ammotype( int id );
 int	skill_get_ammo_qty( int id, int lv );
+int	skill_get_nocast( int id );
 int	skill_get_unit_id(int id,int flag);
 int	skill_get_inf2( int id );
 int	skill_get_castcancel( int id );

+ 2 - 2
src/map/status.c

@@ -4082,7 +4082,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
 	sc=status_get_sc(bl);
 	status = status_get_status_data(bl);
 
-	if (!sc || !status || status_isdead(bl))
+	if (!sc || status_isdead(bl))
 		return 0;
 	
 	switch (bl->type)
@@ -4194,7 +4194,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
 		//Avoid cloaking with no wall and low skill level. [Skotlex]
 		//Due to the cloaking card, we have to check the wall versus to known skill level rather than the used one. [Skotlex]
 //			if (sd && skilllv < 3 && skill_check_cloaking(bl,&sd->sc))
-			if (sd && pc_checkskill(sd, AS_CLOAKING)< 3 && skill_check_cloaking(bl, &sd->sc))
+			if (sd && pc_checkskill(sd, AS_CLOAKING)< 3 && skill_check_cloaking(bl, sc))
 				return 0;
 		break;
 		case SC_MODECHANGE: