Переглянути джерело

- Fixed NPC_SELFDESTRUCTION damaging yourself, causing the source to be knocked back, as well as making others in the splash damage not receive any damage if they are hurt after the caster.
- Fixed NPC_RUN not setting the mob's state to MSS_WALK (normally not set by the mob ai)
- unit_walktoxy flag&2 setting will now also ignore unit_can_move, for a forced walk.
- Adjusted NPC_RUN level of Marine Spheres (5->7 cells)


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

skotlex 19 роки тому
батько
коміт
6ef71063cb
4 змінених файлів з 14 додано та 8 видалено
  1. 4 0
      Changelog-Trunk.txt
  2. 1 1
      db/mob_skill_db.txt
  3. 7 2
      src/map/skill.c
  4. 2 5
      src/map/unit.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ 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/08/01
+	* Miscellanous fixes which make the Marine Sphere self destruction work as
+	  best as I can. It only has one flaw: It self-destructs instantly after
+	  walking because if I make it use self-destruction with a cast-bar,
+	  client-side the object stops moving inmediately... [Skotlex]
 	* Modified unit_walktoxy and NPC_RUN to enable running even when the caster
 	  does not has the MD_CANMOVE bit on. [Skotlex]
 	* PF_MINDBREAKER will now silently fail if you try to use it on someone who

+ 1 - 1
db/mob_skill_db.txt

@@ -684,7 +684,7 @@
 1141,Marina@NPC_CRITICALSLASH,attack,170,1,500,500,5000,no,target,always,0,,,,,,6
 1141,Marina@NPC_EMOTION,walk,197,1,2000,0,5000,yes,self,always,0,19,,,,,
 1141,Marina@NPC_WATERATTACK,attack,184,2,500,500,5000,no,target,always,0,,,,,,6
-1142,Marine Sphere@NPC_RUN,idle,354,5,10000,0,30000,no,master,alchemist,,,,,,,
+1142,Marine Sphere@NPC_RUN,idle,354,7,10000,0,30000,no,master,alchemist,,,,,,,
 1142,Marine Sphere@NPC_SELFDESTRUCTION,idle,173,1,10000,0,0,no,self,afterskill,354,,,,,,
 1142,Marine Sphere@NPC_SELFDESTRUCTION,idle,173,1,10000,2000,5000,no,self,skillused,173,,,,,,
 1142,Marine Sphere@NPC_SELFDESTRUCTION,idle,173,1,500,2000,5000,no,self,myhpltmaxrate,99,,,,,,

+ 7 - 2
src/map/skill.c

@@ -3098,13 +3098,17 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
 	case CR_ACIDDEMONSTRATION:
 	case TF_THROWSTONE:
 	case NPC_SMOKING:
-	case NPC_SELFDESTRUCTION:
 	case HVAN_EXPLOSION:	//[orn]
 	case GS_FLING:
 	case NJ_ZENYNAGE:
 		skill_attack(BF_MISC,src,src,bl,skillid,skilllv,tick,flag);
 		break;
 
+	case NPC_SELFDESTRUCTION:
+		if (src != bl)
+			skill_attack(BF_MISC,src,src,bl,skillid,skilllv,tick,flag);
+		break;
+
 	// Celest
 	case PF_SOULBURN:
 		if (rand()%100 < (skilllv < 5 ? 30 + skilllv * 10 : 70)) {
@@ -4903,7 +4907,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 			int dir = (bl == src)?unit_getdir(src):map_calc_dir(src,bl->x,bl->y); //If cast on self, run forward, else run away.
 			unit_stop_attack(src);
 			//Run skillv tiles overriding the can-move check.
-			unit_walktoxy(src, bl->x + skilllv * mask[dir][0], bl->y + skilllv * mask[dir][1], 2);
+			if (unit_walktoxy(src, src->x + skilllv * mask[dir][0], src->y + skilllv * mask[dir][1], 2) && md)
+				md->state.skillstate = MSS_WALK; //Otherwise it isn't updated in the ai.
 		}
 		break;
 

+ 2 - 5
src/map/unit.c

@@ -258,7 +258,7 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
 	return 0;
 }
 
-//Easy parameter: &1 -> 1/2 = easy/hard, &2 -> ignore MD_CANMOVE check
+//Easy parameter: &1 -> 1/2 = easy/hard, &2 -> force walking.
 int unit_walktoxy( struct block_list *bl, int x, int y, int easy) {
 	struct unit_data        *ud = NULL;
 	struct status_change		*sc = NULL;
@@ -272,12 +272,9 @@ int unit_walktoxy( struct block_list *bl, int x, int y, int easy) {
 	
 	if( ud == NULL) return 0;
 
-	if(!(easy&2) && !status_get_mode(bl)&MD_CANMOVE)
+	if(!(easy&2) && (!status_get_mode(bl)&MD_CANMOVE || !unit_can_move(bl)))
 		return 0;
 	
-	if (!unit_can_move(bl))
-		return 0;
-
 	ud->state.walk_easy = easy&1;
 	ud->target = 0;
 	ud->to_x = x;