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

* Progressbar aborts when player is attacked.
* Do not stand if damage is from yourself or has no source.(bugreport:3582)
* Any mobs killed by party members within view range are taken into account in questlog.
* 'unit_walktobl' now uses at least 1 as the range since 'unit_can_reach_bl' always sets the target coordinates 1 cell away from the target block.


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

Inkfish 15 роки тому
батько
коміт
2c629f0173
7 змінених файлів з 45 додано та 12 видалено
  1. 5 0
      Changelog-Trunk.txt
  2. 1 0
      src/map/clif.h
  3. 5 3
      src/map/mob.c
  4. 10 8
      src/map/pc.c
  5. 1 1
      src/map/pet.c
  6. 22 0
      src/map/quest.c
  7. 1 0
      src/map/quest.h

+ 5 - 0
Changelog-Trunk.txt

@@ -3,6 +3,11 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+09/09/13
+	* Progressbar aborts when player is attacked. [Inkfish]
+	* Do not stand if damage is from yourself or has no source.(bugreport:3582) [Inkfish]
+	* Any mobs killed by party members within view range are taken into account in questlog. [Inkfish]
+	* 'unit_walktobl' now uses at least 1 as the range since 'unit_can_reach_bl' always sets the target coordinates 1 cell away from the target block. [Inkfish]
 09/09/12
 	* Clarified the names of some questlog functions and eventually implemented kill counts updating. [Inkfish]
 09/09/04

+ 1 - 0
src/map/clif.h

@@ -485,5 +485,6 @@ void clif_party_show_picker(struct map_session_data * sd, struct item * item_dat
 
 // Progress Bar [Inkfish]
 void clif_progressbar(struct map_session_data * sd, unsigned long color, unsigned int second);
+void clif_progressbar_abort(struct map_session_data * sd);
 
 #endif /* _CLIF_H_ */

+ 5 - 3
src/map/mob.c

@@ -1274,7 +1274,7 @@ int mob_warpchase(struct mob_data *md, struct block_list *target)
 	map_foreachinrange (mob_warpchase_sub, &md->bl,
 		md->db->range2, BL_NPC, md, target, &warp, &distance);
 
-	if (warp && unit_walktobl(&md->bl, &warp->bl, 0, 1))
+	if (warp && unit_walktobl(&md->bl, &warp->bl, 1, 1))
 		return 1;
 	return 0;
 }
@@ -1456,7 +1456,7 @@ static bool mob_ai_sub_hard(struct mob_data *md, unsigned int tick)
 			if (!can_move) //Stuck. Wait before walking.
 				return true;
 			md->state.skillstate = MSS_LOOT;
-			if (!unit_walktobl(&md->bl, tbl, 0, 1))
+			if (!unit_walktobl(&md->bl, tbl, 1, 1))
 				mob_unlocktarget(md, tick); //Can't loot...
 			return true;
 		}
@@ -1993,7 +1993,9 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 			}
 			pc_setglobalreg(sd,"TK_MISSION_COUNT", sd->mission_count);
 		}
-		//Move to status.c, and send a delete quest packet and then an add quest packet can refresh the kill counts. Just a trick. :P[Inkfish]
+		if( sd->status.party_id )
+			map_foreachinrange(quest_update_objective_sub,&md->bl,AREA_SIZE,BL_PC,sd->status.party_id,md->class_);
+		else
 		if( sd->avail_quests )
 			quest_update_objective(sd, md->class_);
 	}

+ 10 - 8
src/map/pc.c

@@ -5375,23 +5375,25 @@ static int pc_respawn_timer(int tid, unsigned int tick, int id, intptr data)
 void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp)
 {
 	if (sp) clif_updatestatus(sd,SP_SP);
-	if (!hp) return;
+	if (hp) clif_updatestatus(sd,SP_HP);
+	else return;
+	
+	if( !src || src == &sd->bl )
+		return;
 
-	if(pc_issit(sd)) {
+	if( pc_issit(sd) )
+	{
 		pc_setstand(sd);
 		skill_sit(sd,0);
 	}
 
-	clif_updatestatus(sd,SP_HP);
+	if( sd->progressbar.npc_id )
+		clif_progressbar_abort(sd);
 
-	if(!src || src == &sd->bl)
-		return;
-	
-	if(sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support)
+	if( sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support )
 		pet_target_check(sd,src,1);
 
 	sd->canlog_tick = gettick();
-	return;
 }
 
 int pc_dead(struct map_session_data *sd,struct block_list *src)

+ 1 - 1
src/map/pet.c

@@ -908,7 +908,7 @@ static int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, uns
 	} else {	//Item Targeted, attempt loot
 		if (!check_distance_bl(&pd->bl, target, 1))
 		{	//Out of range
-			if(!unit_walktobl(&pd->bl, target, 0, 1)) //Unreachable target.
+			if(!unit_walktobl(&pd->bl, target, 1, 1)) //Unreachable target.
 				pet_unlocktarget(pd);
 			return 0;
 		} else{

+ 22 - 0
src/map/quest.c

@@ -178,6 +178,28 @@ int quest_delete(TBL_PC * sd, int quest_id)
 	return 0;
 }
 
+int quest_update_objective_sub(struct block_list *bl, va_list ap)
+{
+	struct map_session_data * sd;
+	int mob, party;
+
+	nullpo_retr(0, bl);
+	nullpo_retr(0, sd = (struct map_session_data *)bl);
+
+	party = va_arg(ap,int);
+	mob = va_arg(ap,int);
+
+	if( !sd->avail_quests )
+		return 0;
+	if( sd->status.party_id != party )
+		return 0;
+
+	quest_update_objective(sd, mob);
+
+	return 1;
+}
+
+
 void quest_update_objective(TBL_PC * sd, int mob)
 {
 	int i,j;

+ 1 - 0
src/map/quest.h

@@ -21,6 +21,7 @@ int quest_pc_login(TBL_PC * sd);
 int quest_add(TBL_PC * sd, int quest_id);
 int quest_delete(TBL_PC * sd, int quest_id);
 int quest_change(TBL_PC * sd, int qid1, int qid2);
+int quest_update_objective_sub(struct block_list *bl, va_list ap);
 void quest_update_objective(TBL_PC * sd, int mob);
 int quest_update_status(TBL_PC * sd, int quest_id, quest_state status);
 int quest_check(TBL_PC * sd, int quest_id, quest_check_type type);