Browse Source

- @pvpoff and @gvgoff will make everyone in the map stop auto-attacking now.
- when @killer is deactivated the issuer will stop attacking.
- when @killable is deactivated, everyone around the user who is attacking the issuer will stop.
- Cleaned up some the code for dispell. It no longer removes food boosts.
- Players will stop attacking when they change their look.
- Applied Alydis's fix to the mvp item logs logging mvp items even if the player couldn't get the item.
- Changed the default of debuff_on_logout to 1 since food items shouldn't dispell on logout.


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

skotlex 18 years ago
parent
commit
2b3c274f78
7 changed files with 55 additions and 23 deletions
  1. 7 0
      Changelog-Trunk.txt
  2. 3 0
      conf-tmpl/Changelog.txt
  3. 2 2
      conf-tmpl/battle/status.conf
  4. 23 8
      src/map/atcommand.c
  5. 3 2
      src/map/mob.c
  6. 2 0
      src/map/pc.c
  7. 15 11
      src/map/skill.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.
 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.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
+2007/03/14
+	* Adjusted @pvpoff, @gvgoff, @killer, @killable to make characters stop
+	  attacking when used.
+	* Dispell no longer removes food boosts.
+	* Players will stop attacking when they change their look.
+	* Applied Alydis's fix to the mvp item logs logging mvp items even if the
+	  player couldn't get the item.
 2007/03/13
 2007/03/13
 	* Corrected the new packet version entries for skilluseposinfo
 	* Corrected the new packet version entries for skilluseposinfo
 	* Corrected item reloading not unsetting the "delay consume" flag if the
 	* Corrected item reloading not unsetting the "delay consume" flag if the

+ 3 - 0
conf-tmpl/Changelog.txt

@@ -1,5 +1,8 @@
 Date	Added
 Date	Added
 
 
+2007/03/14
+	* Changed the default of debuff_on_logout to 1 since food items shouldn't
+	  dispell on logout. [Skotlex]
 2007/03/08
 2007/03/08
 	* Adjustments for the new mapcache [DracoRPG]
 	* Adjustments for the new mapcache [DracoRPG]
 	- Removed ".gat" from map names in maps_athena.conf
 	- Removed ".gat" from map names in maps_athena.conf

+ 2 - 2
conf-tmpl/battle/status.conf

@@ -38,8 +38,8 @@ status_cast_cancel: 0
 // 0 - remove nothing.
 // 0 - remove nothing.
 // 1 - remove negative buffs (stripping, EF)
 // 1 - remove negative buffs (stripping, EF)
 // 2 - remove positive buffs (cooking)
 // 2 - remove positive buffs (cooking)
-// 3 - remove all buffs that are not saved on official (default)
-debuff_on_logout: 3
+// 3 - remove both negative and positive buffs.
+debuff_on_logout: 1
 
 
 // Adjustment for the natural rate of resistance from status changes.
 // Adjustment for the natural rate of resistance from status changes.
 // If 50, status defense is halved, and you need twice as much stats to block
 // If 50, status defense is halved, and you need twice as much stats to block

+ 23 - 8
src/map/atcommand.c

@@ -2922,6 +2922,17 @@ int atcommand_gm(const int fd, struct map_session_data* sd, const char* command,
 	return 0;
 	return 0;
 }
 }
 
 
+static int atcommand_stopattack(struct block_list *bl,va_list ap)
+{
+	struct unit_data *ud = unit_bl2ud(bl);
+	int id = va_arg(ap, int);
+	if (ud && ud->attacktimer != INVALID_TIMER && (!id || id == ud->target))
+	{
+		unit_stop_attack(bl);
+		return 1;
+	}
+	return 0;
+}
 /*==========================================
 /*==========================================
  *
  *
  *------------------------------------------
  *------------------------------------------
@@ -2953,6 +2964,7 @@ int atcommand_pvpoff(const int fd, struct map_session_data* sd, const char* comm
 	map[sd->bl.m].flag.pvp = 0;
 	map[sd->bl.m].flag.pvp = 0;
 	clif_send0199(sd->bl.m, 0);
 	clif_send0199(sd->bl.m, 0);
 	map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC);
 	map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC);
+	map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
 	clif_displaymessage(fd, msg_txt(31)); // PvP: Off.
 	clif_displaymessage(fd, msg_txt(31)); // PvP: Off.
 	return 0;
 	return 0;
 }
 }
@@ -3005,6 +3017,7 @@ int atcommand_gvgoff(const int fd, struct map_session_data* sd, const char* comm
 	if (map[sd->bl.m].flag.gvg) {
 	if (map[sd->bl.m].flag.gvg) {
 		map[sd->bl.m].flag.gvg = 0;
 		map[sd->bl.m].flag.gvg = 0;
 		clif_send0199(sd->bl.m, 0);
 		clif_send0199(sd->bl.m, 0);
+		map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
 		clif_displaymessage(fd, msg_txt(33)); // GvG: Off.
 		clif_displaymessage(fd, msg_txt(33)); // GvG: Off.
 	} else {
 	} else {
 		clif_displaymessage(fd, msg_txt(162)); // GvG is already Off.
 		clif_displaymessage(fd, msg_txt(162)); // GvG is already Off.
@@ -6888,10 +6901,11 @@ int atcommand_killer(const int fd, struct map_session_data* sd, const char* comm
 	sd->state.killer = !sd->state.killer;
 	sd->state.killer = !sd->state.killer;
 
 
 	if(sd->state.killer)
 	if(sd->state.killer)
-	  clif_displaymessage(fd, msg_txt(241));
-	else
-	  clif_displaymessage(fd, msg_txt(287));
-
+		clif_displaymessage(fd, msg_txt(241));
+	else {
+		clif_displaymessage(fd, msg_txt(287));
+		pc_stop_attack(sd);
+	}
 	return 0;
 	return 0;
 }
 }
 
 
@@ -6906,10 +6920,11 @@ int atcommand_killable(const int fd, struct map_session_data* sd, const char* co
 	sd->state.killable = !sd->state.killable;
 	sd->state.killable = !sd->state.killable;
 
 
 	if(sd->state.killable)
 	if(sd->state.killable)
-	  clif_displaymessage(fd, msg_txt(242));
-	else
-	  clif_displaymessage(fd, msg_txt(288));
-
+		clif_displaymessage(fd, msg_txt(242));
+	else {
+		clif_displaymessage(fd, msg_txt(288));
+		map_foreachinrange(atcommand_stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id);
+	}
 	return 0;
 	return 0;
 }
 }
 
 

+ 3 - 2
src/map/mob.c

@@ -2121,7 +2121,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 				intif_GMmessage(message,strlen(message)+1,0);
 				intif_GMmessage(message,strlen(message)+1,0);
 			}
 			}
 
 
-			if(mvp_sd->weight*2 > mvp_sd->max_weight)
+			if((temp = mvp_sd->weight*2 > mvp_sd->max_weight))
 				map_addflooritem(&item,1,mvp_sd->bl.m,mvp_sd->bl.x,mvp_sd->bl.y,mvp_sd,second_sd,third_sd,1);
 				map_addflooritem(&item,1,mvp_sd->bl.m,mvp_sd->bl.x,mvp_sd->bl.y,mvp_sd,second_sd,third_sd,1);
 			else if((temp = pc_additem(mvp_sd,&item,1))) {
 			else if((temp = pc_additem(mvp_sd,&item,1))) {
 				clif_additem(sd,0,0,temp);
 				clif_additem(sd,0,0,temp);
@@ -2130,7 +2130,8 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 			
 			
 			if(log_config.enable_logs&0x200)	{//Logs items, MVP prizes [Lupus]
 			if(log_config.enable_logs&0x200)	{//Logs items, MVP prizes [Lupus]
 				log_pick_mob(md, "M", item.nameid, -1, NULL);
 				log_pick_mob(md, "M", item.nameid, -1, NULL);
-				log_pick_pc(mvp_sd, "P", item.nameid, 1, NULL);
+				if (!temp)
+					log_pick_pc(mvp_sd, "P", item.nameid, 1, NULL);
 			}
 			}
 			break;
 			break;
 		}
 		}

+ 2 - 0
src/map/pc.c

@@ -5805,6 +5805,8 @@ int pc_setoption(struct map_session_data *sd,int type)
 		new_look = sd->vd.class_;
 		new_look = sd->vd.class_;
 	}
 	}
 	if (new_look) {
 	if (new_look) {
+		//Stop attacking on new view change (to prevent wedding/santa attacks.
+		pc_stop_attack(sd);
 		clif_changelook(&sd->bl,LOOK_BASE,new_look);
 		clif_changelook(&sd->bl,LOOK_BASE,new_look);
 		if (sd->vd.cloth_color)
 		if (sd->vd.cloth_color)
 			clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
 			clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);

+ 15 - 11
src/map/skill.c

@@ -4625,15 +4625,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 			for(i=0;i<SC_MAX;i++){
 			for(i=0;i<SC_MAX;i++){
 				if (tsc->data[i].timer == -1)
 				if (tsc->data[i].timer == -1)
 					continue;
 					continue;
-				if(i==SC_HALLUCINATION || i==SC_WEIGHT50 || i==SC_WEIGHT90
-					|| i==SC_STRIPWEAPON || i==SC_STRIPSHIELD || i==SC_STRIPARMOR || i==SC_STRIPHELM
-					|| i==SC_CP_WEAPON || i==SC_CP_SHIELD || i==SC_CP_ARMOR || i==SC_CP_HELM
-					|| i==SC_COMBO || i==SC_DANCING || i==SC_GUILDAURA || i==SC_EDP
-					|| i==SC_AUTOBERSERK  || i==SC_CARTBOOST || i==SC_MELTDOWN
-					|| i==SC_SAFETYWALL || i==SC_SMA || i==SC_SPEEDUP0
-					|| i==SC_NOCHAT
-					)
+				switch (i) {
+				case SC_WEIGHT50:    case SC_WEIGHT90:    case SC_HALLUCINATION: 
+				case SC_STRIPWEAPON: case SC_STRIPSHIELD: case SC_STRIPARMOR:
+			  	case SC_STRIPHELM:   case SC_CP_WEAPON:   case SC_CP_SHIELD:
+				case SC_CP_ARMOR:    case SC_CP_HELM:     case SC_COMBO:
+				case SC_STRFOOD:     case SC_AGIFOOD:     case SC_VITFOOD:
+				case SC_INTFOOD:     case SC_DEXFOOD:     case SC_LUKFOOD:
+				case SC_HITFOOD:     case SC_FLEEFOOD:    case SC_BATKFOOD:
+				case SC_WATKFOOD:    case SC_MATKFOOD:    case SC_DANCING:
+				case SC_GUILDAURA:   case SC_EDP:         case SC_AUTOBERSERK:
+				case SC_CARTBOOST:   case SC_MELTDOWN:    case SC_SAFETYWALL:
+				case SC_SMA:         case SC_SPEEDUP0:    case SC_NOCHAT:
+				case SC_ANKLE:
 					continue;
 					continue;
+				}
 				if(i==SC_BERSERK) tsc->data[i].val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
 				if(i==SC_BERSERK) tsc->data[i].val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
 				status_change_end(bl,i,-1);
 				status_change_end(bl,i,-1);
 			}
 			}
@@ -4712,10 +4718,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 				else
 				else
 					hp = 0;
 					hp = 0;
 				
 				
-				if (skilllv > 1 && sp) //Recover some of the SP used
+				if (sp) //Recover some of the SP used
 					sp = sp*(25*(skilllv-1))/100;
 					sp = sp*(25*(skilllv-1))/100;
-				else
-					sp = 0;
 
 
 				if(hp || sp)
 				if(hp || sp)
 					status_heal(src, hp, sp, 2);
 					status_heal(src, hp, sp, 2);