Forráskód Böngészése

* Updates to various custom stuff that buying stores might/are expected to support (follow up to r14713).
- Buying store no longer works on novending maps/cells (bugreport:4778).
- MANNER_NOROOM mute flag now affects buying stores as well (like vending).
- Enabled @autotrade for buying stores.

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

ai4rei 14 éve
szülő
commit
c9d4af2383
6 módosított fájl, 39 hozzáadás és 4 törlés
  1. 4 0
      Changelog-Trunk.txt
  2. 2 0
      conf/Changelog.txt
  3. 1 1
      conf/msg_athena.conf
  4. 2 2
      src/map/atcommand.c
  5. 28 0
      src/map/buyingstore.c
  6. 2 1
      src/map/status.c

+ 4 - 0
Changelog-Trunk.txt

@@ -1,6 +1,10 @@
 Date	Added
 
 2011/02/23
+	* Updates to various custom stuff that buying stores might/are expected to support (follow up to r14713). [Ai4rei]
+	- Buying store no longer works on novending maps/cells (bugreport:4778).
+	- MANNER_NOROOM mute flag now affects buying stores as well (like vending).
+	- Enabled @autotrade for buying stores.
 	* Fixed whispering to NPCs (::OnWhisperGlobal) not working for NPCs whose unique name is different from the display name (bugreport:4776, since r2624). [Ai4rei]
 2011/02/20
 	* Fixed SP regen not stopping when Maximize Power (BS_MAXIMIZE) is in effect. [Ai4rei]

+ 2 - 0
conf/Changelog.txt

@@ -1,5 +1,7 @@
 Date	Added
 
+2011/02/23
+	* Rev. 14724 Made autotrade error message store type-neutral, as it is used for buying stores now as well. [Ai4rei]
 2011/02/19
 	* Rev. 14713 Added map-server feature settings file 'battle/feature.conf'. [Ai4rei]
 	- Added setting 'feature.buying_store' to enable/disable the buying store system.

+ 1 - 1
conf/msg_athena.conf

@@ -455,7 +455,7 @@
 //542: %.0s%.0sSomeone stole %s
 // 543~548 are not used (previously @away messages)
 // @Autotrade
-549: You should be vending to use @autotrade.
+549: You should have a shop open to use @autotrade.
 
 //550 -> 650: Job Names
 550: Novice

+ 2 - 2
src/map/atcommand.c

@@ -5945,8 +5945,8 @@ ACMD_FUNC(autotrade)
 		return -1;
 	}
 	
-	if( !sd->vender_id ) { //check if player is vending
-		clif_displaymessage(fd, msg_txt(549)); // You should be vending to use @Autotrade.
+	if( !sd->vender_id && !sd->state.buyingstore ) { //check if player is vending or buying
+		clif_displaymessage(fd, msg_txt(549)); // "You should have a shop open to use @autotrade."
 		return -1;
 	}
 	

+ 28 - 0
src/map/buyingstore.c

@@ -50,6 +50,17 @@ bool buyingstore_setup(struct map_session_data* sd, unsigned char slots)
 		return false;
 	}
 
+	if( sd->sc.data[SC_NOCHAT] && (sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM) )
+	{// custom: mute limitation
+		return false;
+	}
+
+	if( map[sd->bl.m].flag.novending || map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) )
+	{// custom: no vending maps/cells
+		clif_displaymessage(sd->fd, msg_txt(276)); // "You can't open a shop on this map"
+		return false;
+	}
+
 	if( slots > MAX_BUYINGSTORE_SLOTS )
 	{
 		ShowWarning("buyingstore_setup: Requested %d slots, but server supports only %d slots.\n", (int)slots, MAX_BUYINGSTORE_SLOTS);
@@ -88,6 +99,17 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
 		return;
 	}
 
+	if( sd->sc.data[SC_NOCHAT] && (sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM) )
+	{// custom: mute limitation
+		return;
+	}
+
+	if( map[sd->bl.m].flag.novending || map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) )
+	{// custom: no vending maps/cells
+		clif_displaymessage(sd->fd, msg_txt(276)); // "You can't open a shop on this map"
+		return;
+	}
+
 	weight = sd->weight;
 
 	// check item list
@@ -171,6 +193,12 @@ void buyingstore_close(struct map_session_data* sd)
 
 		// notify other players
 		clif_buyingstore_disappear_entry(sd);
+
+		// remove auto-trader
+		if( sd->state.autotrade )
+		{
+			map_quit(sd);
+		}
 	}
 }
 

+ 2 - 1
src/map/status.c

@@ -6747,7 +6747,8 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid)
 		case SC_AUTOTRADE:
 			if (tid == INVALID_TIMER)
 				break;
-			vending_closevending(sd);
+			// Note: vending/buying is closed by unit_remove_map, no
+			// need to do it here.
 			map_quit(sd);
 			// Because map_quit calls status_change_end with tid -1
 			// from here it's not neccesary to continue