Przeglądaj źródła

- skill_blown will now trigger on-touch npcs on the landing tile.
- Max trade distance has been reduced from 5 to 2.
- Undisguising will now resend the cart-contents.


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

skotlex 18 lat temu
rodzic
commit
245db024cd
4 zmienionych plików z 19 dodań i 5 usunięć
  1. 3 0
      Changelog-Trunk.txt
  2. 6 0
      src/map/pc.c
  3. 4 0
      src/map/skill.c
  4. 6 5
      src/map/trade.c

+ 3 - 0
Changelog-Trunk.txt

@@ -4,6 +4,9 @@ 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/10/05
+	* skill_blown will now trigger on-touch npcs on the landing tile. [Skotlex]
+	* Max trade distance has been reduced from 5 to 2. [Skotlex]
+	* Undisguising will now resend the cart-contents. [Skotlex]
 	* Added function npc_unload_duplicates(), it unloads all npcs that are a
 	  duplicate of the passed one. For use with @unloadnpc to prevent crashes
 	  when you unload the npc that has duplicates. [Skotlex]

+ 6 - 0
src/map/pc.c

@@ -1139,6 +1139,12 @@ int pc_disguise(struct map_session_data *sd, int class_) {
 	status_set_viewdata(&sd->bl, class_);
 	clif_changeoption(&sd->bl);
 	clif_spawn(&sd->bl);
+	if (class_ == sd->status.class_ && pc_iscarton(sd))
+	{	//It seems the cart info is lost on undisguise.
+		clif_cartlist(sd);
+		clif_updatestatus(sd,SP_CARTINFO);
+	}
+
 	return 1;
 }
 

+ 4 - 0
src/map/skill.c

@@ -22,6 +22,7 @@
 #include "pet.h"
 #include "mercenary.h"	//[orn]
 #include "mob.h"
+#include "npc.h"
 #include "battle.h"
 #include "party.h"
 #include "itemdb.h"
@@ -1770,6 +1771,9 @@ int skill_blown (struct block_list *src, struct block_list *target, int count)
 	if(!(count&0x20000)) 
 		clif_blown(target);
 
+	if(target->type == BL_PC && map_getcell(target->m,x,y,CELL_CHKNPC))
+		npc_touch_areanpc((TBL_PC*)target,target->m,x,y); //Invoke area NPC
+
 	return (count&0xFFFF); //Return amount of knocked back cells.
 }
 

+ 6 - 5
src/map/trade.c

@@ -19,6 +19,8 @@
 #include "log.h"
 #include "../common/malloc.h"
 
+//Max distance from traders to enable a trade to take place.
+#define TRADE_DISTANCE 2
 
 /*==========================================
  * Initiates a trade request.
@@ -61,8 +63,8 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
 	
 	//Fixed. Only real GMs can request trade from far away! [Lupus] 
 	if (level < lowest_gm_level && (sd->bl.m != target_sd->bl.m ||
-		 (sd->bl.x - target_sd->bl.x <= -5 || sd->bl.x - target_sd->bl.x >= 5) ||
-		 (sd->bl.y - target_sd->bl.y <= -5 || sd->bl.y - target_sd->bl.y >= 5))) {
+		!check_distance_bl(&sd->bl, &target_sd->bl, TRADE_DISTANCE)
+	)) {
 		clif_tradestart(sd, 0); // too far
 		return ;
 	}
@@ -93,9 +95,8 @@ void trade_tradeack(struct map_session_data *sd, int type) {
 
 	//Copied here as well since the original character could had warped.
 	if (type == 3 && pc_isGM(target_sd) < lowest_gm_level && (sd->bl.m != target_sd->bl.m ||
-		 (sd->bl.x - target_sd->bl.x <= -5 || sd->bl.x - target_sd->bl.x >= 5) ||
-		 (sd->bl.y - target_sd->bl.y <= -5 || sd->bl.y - target_sd->bl.y >= 5)))
-  	{
+		!check_distance_bl(&sd->bl, &target_sd->bl, TRADE_DISTANCE)
+	)) {
 		sd->trade_partner=0;
 		target_sd->trade_partner = 0;
 		clif_tradestart(sd, 0); // too far