Explorar el Código

- Changed define EQP_WEAPON to specify only the right-hand weapon, added define EQP_ARMS to specify both arm-slots.
- Some minor code cleanups to take account for the above, fixed Strip shield/weapon removing both.


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

skotlex hace 19 años
padre
commit
b372f8dfce
Se han modificado 6 ficheros con 17 adiciones y 16 borrados
  1. 2 0
      Changelog-Trunk.txt
  2. 3 3
      src/map/charcommand.c
  3. 0 2
      src/map/mob.c
  4. 8 8
      src/map/pc.c
  5. 2 1
      src/map/pc.h
  6. 2 2
      src/map/skill.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ 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/08/07
+	* Fixed EQP_WEAPON related code messing up with both weapon AND shield.
+	  [Skotlex]
 	* Cleaned up the Asura code so that when the skill fails your
 	  SP/Spheres/Fury are all taken away always, as well as moving you next to
 	  the target (as long as the target still exists within a reachable path from

+ 3 - 3
src/map/charcommand.c

@@ -783,11 +783,11 @@ charcommand_itemlist(
 							strcat(equipstr, "left accessory, ");
 						if (equip & EQP_ARMOR)
 							strcat(equipstr, "body/armor, ");
-						if ((equip & EQP_WEAPON) == EQP_HAND_R)
+						if ((equip & EQP_ARMS) == EQP_HAND_R)
 							strcat(equipstr, "right hand, ");
-						if ((equip & EQP_WEAPON) == EQP_HAND_L)
+						if ((equip & EQP_ARMS) == EQP_HAND_L)
 							strcat(equipstr, "left hand, ");
-						if ((equip & EQP_WEAPON) == EQP_WEAPON)
+						if ((equip & EQP_ARMS) == EQP_ARMS)
 							strcat(equipstr, "both hands, ");
 						if (equip & EQP_SHOES)
 							strcat(equipstr, "feet, ");

+ 0 - 2
src/map/mob.c

@@ -1801,8 +1801,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 		if(battle_config.mobs_level_up && md->level > md->db->lv) // [Valaris]
 			bonus += (md->level-md->db->lv)*battle_config.mobs_level_up_exp_rate;
 
-		if (bonus > 400) bonus = 400; //Limit gained exp to quadro the mob's exp. [3->4 Komurka]
-
 		if(battle_config.zeny_from_mobs && md->level) {
 			 // zeny calculation moblv + random moblv [Valaris]
 			zeny=(int) ((md->level+rand()%md->level)*per*bonus/100.);

+ 8 - 8
src/map/pc.c

@@ -390,7 +390,7 @@ int pc_equippoint(struct map_session_data *sd,int n)
 		sd->inventory_data[n]->look == W_1HSWORD ||
 		sd->inventory_data[n]->look == W_1HAXE) {
 		if(ep == EQP_HAND_R && (pc_checkskill(sd,AS_LEFT) > 0 || (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN))
-			return EQP_WEAPON;
+			return EQP_ARMS;
 	}
 	return ep;
 }
@@ -524,9 +524,9 @@ int pc_isequip(struct map_session_data *sd,int n)
 		return 0;
 	if (sd->sc.count) {
 			
-		if(item->equip & EQP_WEAPON && item->type == 4 && sd->sc.data[SC_STRIPWEAPON].timer != -1) // Also works with left-hand weapons [DracoRPG]
+		if(item->equip & EQP_ARMS && item->type == IT_WEAPON && sd->sc.data[SC_STRIPWEAPON].timer != -1) // Also works with left-hand weapons [DracoRPG]
 			return 0;
-		if(item->equip & EQP_SHIELD && item->type == 5 && sd->sc.data[SC_STRIPSHIELD].timer != -1)
+		if(item->equip & EQP_SHIELD && item->type == IT_ARMOR && sd->sc.data[SC_STRIPSHIELD].timer != -1)
 			return 0;
 		if(item->equip & EQP_ARMOR && sd->sc.data[SC_STRIPARMOR].timer != -1)
 			return 0;
@@ -538,7 +538,7 @@ int pc_isequip(struct map_session_data *sd,int n)
 			if (sd->status.base_level > 90 && item->equip & EQP_HELM)
 				return 1; //Can equip all helms
 
-			if (sd->status.base_level > 96 && item->equip & EQP_WEAPON && item->type == IT_WEAPON)
+			if (sd->status.base_level > 96 && item->equip & EQP_ARMS && item->type == IT_WEAPON)
 				switch(item->look) { //In weapons, the look determines type of weapon.
 					case W_DAGGER: //Level 4 Knives are equippable.. this means all knives, I'd guess?
 					case W_1HSWORD: //All 1H swords
@@ -6215,12 +6215,12 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
 			pos = sd->equip_index[EQI_ACC_L] >= 0 ? EQP_ACC_R : EQP_ACC_L;
 	}
 
-	if(pos == EQP_WEAPON && id->equip == EQP_HAND_R &&
+	if(pos == EQP_ARMS && id->equip == EQP_HAND_R &&
 		(pc_checkskill(sd, AS_LEFT) > 0 ||
 		(sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN)
 	) {	//Dual wield capable weapon.
-	  	pos = (req_pos&EQP_WEAPON);
-		if (pos == EQP_WEAPON) //User specified both slots, pick one for them.
+	  	pos = (req_pos&EQP_ARMS);
+		if (pos == EQP_ARMS) //User specified both slots, pick one for them.
 			pos = sd->equip_index[EQI_HAND_R] >= 0 ? EQP_HAND_L : EQP_HAND_R;
 	}
 
@@ -6404,7 +6404,7 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag)
 
 	clif_unequipitemack(sd,n,sd->status.inventory[n].equip,1);
 
-	if((sd->status.inventory[n].equip & EQP_WEAPON) && 
+	if((sd->status.inventory[n].equip & EQP_ARMS) && 
 		sd->weapontype1 == 0 && sd->weapontype2 == 0)
 		skill_enchant_elemental_end(&sd->bl,-1);
 	

+ 2 - 1
src/map/pc.h

@@ -64,8 +64,9 @@ enum {
 	EQP_AMMO     = 0x8000, //32768
 } equip_pos_enum;
 
-#define EQP_WEAPON (EQP_HAND_R|EQP_HAND_L)
+#define EQP_WEAPON EQP_HAND_R
 #define EQP_SHIELD EQP_HAND_L
+#define EQP_ARMS (EQP_HAND_R|EQP_HAND_L)
 #define EQP_HELM (EQP_HEAD_LOW|EQP_HEAD_MID|EQP_HEAD_TOP)
 #define EQP_ACC (EQP_ACC_L|EQP_ACC_R)
 

+ 2 - 2
src/map/skill.c

@@ -1664,8 +1664,8 @@ int skill_break_equip (struct block_list *bl, unsigned short where, int rate, in
 				case EQI_HAND_R: //Left/Right hands
 				case EQI_HAND_L:
 					flag = (
-						(where&EQP_WEAPON && sd->inventory_data[j]->type == 4) ||
-						(where&EQP_SHIELD && sd->inventory_data[j]->type == 5));
+						(where&EQP_WEAPON && sd->inventory_data[j]->type == IT_WEAPON) ||
+						(where&EQP_SHIELD && sd->inventory_data[j]->type == IT_ARMOR));
 					break;
 				default:
 					continue;