فهرست منبع

- When a mob fails to use the selected skill, it will now move on to the next one in the list, rather than return from the function with fail status.
- Mobs won't try to run away when rude-attacked if they have a locked-on target already.
- Moved the teleport on LP fail check from castend_nodamageid to status_check_skilluse, this way unit_useskill will return failed when trying to use it.


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

skotlex 18 سال پیش
والد
کامیت
272cc6201e
3فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 2 2
      src/map/mob.c
  2. 0 4
      src/map/skill.c
  3. 4 0
      src/map/status.c

+ 2 - 2
src/map/mob.c

@@ -1160,7 +1160,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
 			)	{	//Rude attacked
 				if (md->state.attacked_count++ >= RUDE_ATTACKED_COUNT &&
 					!mobskill_use(md, tick, MSC_RUDEATTACKED) && can_move &&
-					unit_escape(bl, abl, rand()%10 +1))
+					!tbl && unit_escape(bl, abl, rand()%10 +1))
 				{	//Escaped.
 					//TODO: Maybe it shouldn't attempt to run if it has another, valid target?
 					md->attacked_id = 0;
@@ -2855,7 +2855,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
 		if (!flag) 
 		{	//Skill failed.
 			md->skillidx = -1;
-			return 0;
+			continue;
 		}
 		if(battle_config.mob_ai&0x200)
 		{ //pass on delay to same skill.

+ 0 - 4
src/map/skill.c

@@ -4443,10 +4443,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 		break;
 
 	case AL_TELEPORT:
-		//Should fail when used on top of Land Protector [Skotlex]
-		if (map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR))
-			break;
-
 		if(sd) {
 			if (map[bl->m].flag.noteleport) {
 				clif_skill_teleportmessage(sd,0);

+ 4 - 0
src/map/status.c

@@ -973,6 +973,10 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
 		if (hide_flag&INF_GROUND_SKILL && skill_get_unit_target(skill_num)&BCT_ENEMY)
 			return 0;
 	}	
+		
+	//Should fail when used on top of Land Protector [Skotlex]
+	if (src && skill_num == AL_TELEPORT && map_getcell(src->m, src->x, src->y, CELL_CHKLANDPROTECTOR))
+		return 0;
 
 	if (src) sc = status_get_sc(src);