From bc8350f550226c4d7d848ea9737f46c4a5d61575 Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 8 Aug 2006 01:16:56 +0000 Subject: - 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8177 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/charcommand.c | 6 +++--- src/map/mob.c | 2 -- src/map/pc.c | 16 ++++++++-------- src/map/pc.h | 3 ++- src/map/skill.c | 4 ++-- 5 files changed, 15 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/map/charcommand.c b/src/map/charcommand.c index 50f44988a..d2a75eb1d 100644 --- a/src/map/charcommand.c +++ b/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, "); diff --git a/src/map/mob.c b/src/map/mob.c index 0c76cdb27..cea8b388a 100644 --- a/src/map/mob.c +++ b/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.); diff --git a/src/map/pc.c b/src/map/pc.c index 92dc175cc..8614d5956 100644 --- a/src/map/pc.c +++ b/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); diff --git a/src/map/pc.h b/src/map/pc.h index a8435508b..32eea853c 100644 --- a/src/map/pc.h +++ b/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) diff --git a/src/map/skill.c b/src/map/skill.c index a3c77829e..5eaadd6bd 100644 --- a/src/map/skill.c +++ b/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; -- cgit v1.2.3-70-g09d2