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

- Added support for n to specify minutes to @charban.
- Fixed a logic typo on the way dummy_npc_id was defined.
- Added state.trading to specify when a trading has started. Now you should be able to walk around until the trade is either rejected or started.
- Armor defense is no longer reduced by the amount of characters targetting you.


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

skotlex 19 éve
szülő
commit
63eec80717
8 módosított fájl, 27 hozzáadás és 12 törlés
  1. 7 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/atcommand.c
  3. 4 3
      src/map/battle.c
  4. 2 2
      src/map/clif.c
  5. 2 1
      src/map/map.h
  6. 1 0
      src/map/npc.c
  7. 1 1
      src/map/npc.h
  8. 9 4
      src/map/trade.c

+ 7 - 0
Changelog-Trunk.txt

@@ -3,6 +3,13 @@ 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.
 
+2006/04/19
+	* Added support for n to specify minutes to @charban.  [Skotlex]
+	* Added state.trading to specify when a trading has started. Now you should
+	  be able to walk around until the trade is either rejected or started.
+	  [Skotlex]
+	* Armor defense is no longer reduced by the amount of characters targetting
+	  you. [Skotlex]
 2006/04/19
 	* Updated the doc/script_commands.txt documentation in regards to npc mob
 	  spawn lines. [Skotlex]

+ 1 - 1
src/map/atcommand.c

@@ -4625,7 +4625,7 @@ int atcommand_char_ban(
 			if (modif_p[0] == 's') {
 				second = value;
 				modif_p++;
-			} else if (modif_p[0] == 'm' && modif_p[1] == 'n') {
+			} else if (modif_p[0] == 'n' || (modif_p[0] == 'm' && modif_p[1] == 'n')) {
 				minute = value;
 				modif_p = modif_p + 2;
 			} else if (modif_p[0] == 'h') {

+ 4 - 3
src/map/battle.c

@@ -1899,10 +1899,11 @@ static struct Damage battle_calc_weapon_attack(
 				target_count = unit_counttargeted(target,battle_config.vit_penalty_count_lv);
 				if(target_count >= battle_config.vit_penalty_count) {
 					if(battle_config.vit_penalty_type == 1) {
-						def1 = (def1 * (100 - (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num))/100;
+// armor defense shouldn't be reduced from what people are saying. [Skotlex]						
+//						def1 = (def1 * (100 - (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num))/100;
 						def2 = (def2 * (100 - (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num))/100;
 					} else { //Assume type 2
-						def1 -= (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num;
+//						def1 -= (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num;
 						def2 -= (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num;
 					}
 				}
@@ -4131,7 +4132,7 @@ void battle_set_defaults() {
 	battle_config.gm_cant_drop_min_lv = 1;
 	battle_config.gm_cant_drop_max_lv = 0;
 	battle_config.disp_hpmeter = 60;
-	battle_config.skill_wall_check = 0;
+	battle_config.skill_wall_check = 1;
 	battle_config.cell_stack_limit = 1;
 	battle_config.bone_drop = 0;
 	battle_config.buyer_name = 1;

+ 2 - 2
src/map/clif.c

@@ -161,10 +161,10 @@ enum {
 
 //Removed sd->npc_shopid because there is no packet sent from the client when you cancel a buy!
 //Quick check to know if the player shouldn't be "busy" with something else to deny action requests. [Skotlex]
-#define clif_cant_act(sd) (sd->npc_id || sd->vender_id || sd->chatID || sd->sc.opt1 || sd->trade_partner || sd->state.storage_flag)
+#define clif_cant_act(sd) (sd->npc_id || sd->vender_id || sd->chatID || sd->sc.opt1 || sd->state.trading || sd->state.storage_flag)
 
 // Checks if SD is in a trade/shop (where messing with the inventory can cause problems/exploits)
-#define clif_trading(sd) (sd->npc_id || sd->vender_id || sd->trade_partner)
+#define clif_trading(sd) (sd->npc_id || sd->vender_id || sd->state.trading )
 
 //To idenfity disguised characters.
 #define disguised(bl) (bl->type==BL_PC && ((TBL_PC*)bl)->disguise)

+ 2 - 1
src/map/map.h

@@ -486,7 +486,8 @@ struct map_session_data {
 		unsigned showexp :1;
 		unsigned showzeny :1;
 		unsigned mainchat :1; //[LuzZza] 
-		unsigned deal_locked :2;
+		unsigned trading :1; //[Skotlex] is 1 only after a trade has started.
+		unsigned deal_locked :2; //1: Clicked on OK. 2: Clicked on TRADE
 		unsigned party_sent :1;
 		unsigned guild_sent :1;
 		unsigned monster_ignore :1; // for monsters to ignore a character [Valaris] [zzo]

+ 1 - 0
src/map/npc.c

@@ -50,6 +50,7 @@ static int npc_mob=0;
 static int npc_delay_mob=0;
 static int npc_cache_mob=0;
 char *current_file = NULL;
+int dummy_npc_id=0;
 int npc_get_new_npc_id(void){ return npc_id++; }
 
 static struct dbt *ev_db;

+ 1 - 1
src/map/npc.h

@@ -66,7 +66,7 @@ int npc_remove_map(struct npc_data *nd);
 int npc_unload(struct npc_data *nd);
 int npc_reload(void);
 
-static int dummy_npc_id;
+extern int dummy_npc_id;
 
 extern char *current_file;
 

+ 9 - 4
src/map/trade.c

@@ -45,7 +45,7 @@ void trade_traderequest(struct map_session_data *sd, int target_id) {
 		if ( pc_can_give_items(level) || pc_can_give_items(pc_isGM(target_sd)) ) //check if both GMs are allowed to trade
 		{
 			clif_displaymessage(sd->fd, msg_txt(246));
-			trade_tradecancel(sd); // GM is not allowed to trade		
+			trade_tradecancel(sd); // GM is not allowed to trade
 		} else if ((target_sd->trade_partner != 0) || (sd->trade_partner != 0)) {
 			trade_tradecancel(sd); // person is in another trade
 		} else {
@@ -83,8 +83,9 @@ void trade_tradeack(struct map_session_data *sd, int type) {
 			target_sd->trade_partner = 0;
 		}
 
-
 		if (type == 3) { //Initiate trade
+			sd->state.trading = 1;
+			target_sd->state.trading = 1;
 			memset(&sd->deal, 0, sizeof(sd->deal));
 			memset(&target_sd->deal, 0, sizeof(target_sd->deal));
 		}
@@ -284,7 +285,7 @@ void trade_tradeadditem(struct map_session_data *sd, int index, int amount) {
 	int trade_i, trade_weight, nameid;
 
 	nullpo_retv(sd);
-	if ((target_sd = map_id2sd(sd->trade_partner)) == NULL || sd->state.deal_locked > 0)
+	if (!sd->state.trading || (target_sd = map_id2sd(sd->trade_partner)) == NULL || sd->state.deal_locked > 0)
 		return; //Can't add stuff.
 
 	if (index == 0)
@@ -428,8 +429,10 @@ void trade_tradecancel(struct map_session_data *sd) {
 		}
 		sd->state.deal_locked = 0;
 		sd->trade_partner = 0;
+		sd->state.trading = 0;
 		target_sd->state.deal_locked = 0;
 		target_sd->trade_partner = 0;
+		target_sd->state.trading = 0;
 		clif_tradecancelled(sd);
 		clif_tradecancelled(target_sd);
 	}
@@ -446,7 +449,7 @@ void trade_tradecommit(struct map_session_data *sd) {
 
 	nullpo_retv(sd);
 
-	if ((target_sd = map_id2sd(sd->trade_partner)) != NULL) {
+	if (sd->state.trading && (target_sd = map_id2sd(sd->trade_partner)) != NULL) {
 		if ((sd->state.deal_locked >= 1) && (target_sd->state.deal_locked >= 1)) { // both have pressed 'ok'
 			if (sd->state.deal_locked < 2) { // set locked to 2
 				sd->state.deal_locked = 2;
@@ -545,8 +548,10 @@ void trade_tradecommit(struct map_session_data *sd) {
 					}
 					sd->state.deal_locked = 0;
 					sd->trade_partner = 0;
+					sd->state.trading = 0;
 					target_sd->state.deal_locked = 0;
 					target_sd->trade_partner = 0;
+					target_sd->state.trading = 0;
 					clif_tradecompleted(sd, 0);
 					clif_tradecompleted(target_sd, 0);
 					// save both player to avoid crash: they always have no advantage/disadvantage between the 2 players