summaryrefslogtreecommitdiff
path: root/src/map/pc.h
diff options
context:
space:
mode:
authorglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-05 14:13:26 +0000
committerglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-05 14:13:26 +0000
commit4d0d981ae30ca3b643e8727e2e5087b957e5d27a (patch)
tree3842a643265d4992875707782d83117144316ad2 /src/map/pc.h
parent13e152b1a9819d6587c9702b7eccd174e62b5e8b (diff)
downloadhercules-4d0d981ae30ca3b643e8727e2e5087b957e5d27a.tar.gz
hercules-4d0d981ae30ca3b643e8727e2e5087b957e5d27a.tar.bz2
hercules-4d0d981ae30ca3b643e8727e2e5087b957e5d27a.tar.xz
hercules-4d0d981ae30ca3b643e8727e2e5087b957e5d27a.zip
- Re-committed r16981/trunk/src/ and follow up r16988/trunk/src/ (pid:161281).
-Fix previous recommit since r16995 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16999 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.h')
-rw-r--r--src/map/pc.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/map/pc.h b/src/map/pc.h
index bc8a76f2a..a4bcb7723 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -314,11 +314,11 @@ struct map_session_data {
short sp_gain_value, hp_gain_value, magic_sp_gain_value, magic_hp_gain_value;
short sp_vanish_rate;
short sp_vanish_per;
- short sp_weapon_matk,sp_base_matk;
unsigned short unbreakable; // chance to prevent ANY equipment breaking [celest]
unsigned short unbreakable_equip; //100% break resistance on certain equipment
unsigned short unstripable_equip;
int fixcastrate,varcastrate;
+ int ematk; // matk bonus from equipment
} bonus;
// zeroed vars end here.
@@ -645,6 +645,8 @@ enum equip_index {
#define pc_rightside_def(sd) ((sd)->battle_status.def)
#define pc_leftside_mdef(sd) ((sd)->battle_status.mdef2)
#define pc_rightside_mdef(sd) ((sd)->battle_status.mdef)
+#define pc_leftside_matk(sd) (status_base_matk(status_get_status_data(&(sd)->bl), (sd)->status.base_level))
+#define pc_rightside_matk(sd) ((sd)->battle_status.rhw.matk+(sd)->bonus.ematk)
#else
#define pc_leftside_atk(sd) ((sd)->battle_status.batk + (sd)->battle_status.rhw.atk + (sd)->battle_status.lhw.atk)
#define pc_rightside_atk(sd) ((sd)->battle_status.rhw.atk2 + (sd)->battle_status.lhw.atk2)
@@ -652,6 +654,18 @@ enum equip_index {
#define pc_rightside_def(sd) ((sd)->battle_status.def2)
#define pc_leftside_mdef(sd) ((sd)->battle_status.mdef)
#define pc_rightside_mdef(sd) ( (sd)->battle_status.mdef2 - ((sd)->battle_status.vit>>1) )
+#define pc_leftside_matk(sd) \
+ (\
+ ((sd)->sc.data[SC_MAGICPOWER] && (sd)->sc.data[SC_MAGICPOWER]->val4) \
+ ?((sd)->battle_status.matk_min * 100 + 50) / ((sd)->sc.data[SC_MAGICPOWER]->val3+100) \
+ :(sd)->battle_status.matk_min \
+ )
+#define pc_rightside_matk(sd) \
+ (\
+ ((sd)->sc.data[SC_MAGICPOWER] && (sd)->sc.data[SC_MAGICPOWER]->val4) \
+ ?((sd)->battle_status.matk_max * 100 + 50) / ((sd)->sc.data[SC_MAGICPOWER]->val3+100) \
+ :(sd)->battle_status.matk_max \
+ )
#endif
int pc_class2idx(int class_);