summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-21 18:42:35 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-21 18:42:35 +0000
commit8c2918aa0f1c3eb7c2d66a6aecb46bfff6fe1523 (patch)
treeeede8c765744bf3e5fc090413ddc2a9ede33704c /src/map/pc.c
parentfceac39ea2b984dc29f22da1763a4d216c7a6220 (diff)
downloadhercules-8c2918aa0f1c3eb7c2d66a6aecb46bfff6fe1523.tar.gz
hercules-8c2918aa0f1c3eb7c2d66a6aecb46bfff6fe1523.tar.bz2
hercules-8c2918aa0f1c3eb7c2d66a6aecb46bfff6fe1523.tar.xz
hercules-8c2918aa0f1c3eb7c2d66a6aecb46bfff6fe1523.zip
- Updated the HP/SP leech structures to have race-data attached to them.
- Merged all leeching code to battle_drain function. - Added an enum for races (they match the RC entries in const.txt, except they are in all caps) - Cleaned up atk_mods and aspd_base to be MAX_WEAPON_TYPE sized rather than MAX_WEAPON_TYPE+1 - Simplified a bit the code for Signum Crucis - Added script bonuses: bonus3 bHPDrainRateRace,<Race>,<Activation Rate>,<Drain %> bonus3 bSPDrainRateRace,<Race>,<Activation Rate>,<Drain %> bonus2 bHPDrainValueRace,<Race>,<Value> bonus2 bSPDrainValueRace,<Race>,<Value> git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6221 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c129
1 files changed, 95 insertions, 34 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 665e380ff..371816c8b 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1613,18 +1613,22 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
break;
case SP_HP_DRAIN_VALUE:
if(!sd->state.lr_flag) {
- sd->right_weapon.hp_drain_value += val;
+ sd->right_weapon.hp_drain[RC_NONBOSS].value += val;
+ sd->right_weapon.hp_drain[RC_BOSS].value += val;
}
else if(sd->state.lr_flag == 1) {
- sd->left_weapon.hp_drain_value += val;
+ sd->right_weapon.hp_drain[RC_NONBOSS].value += val;
+ sd->right_weapon.hp_drain[RC_BOSS].value += val;
}
break;
case SP_SP_DRAIN_VALUE:
if(!sd->state.lr_flag) {
- sd->right_weapon.sp_drain_value += val;
+ sd->right_weapon.sp_drain[RC_NONBOSS].value += val;
+ sd->right_weapon.sp_drain[RC_BOSS].value += val;
}
else if(sd->state.lr_flag == 1) {
- sd->left_weapon.sp_drain_value += val;
+ sd->left_weapon.sp_drain[RC_NONBOSS].value += val;
+ sd->left_weapon.sp_drain[RC_BOSS].value += val;
}
break;
case SP_SP_GAIN_VALUE:
@@ -1807,42 +1811,59 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
break;
case SP_HP_DRAIN_RATE:
if(!sd->state.lr_flag) {
- sd->right_weapon.hp_drain_rate += type2;
- sd->right_weapon.hp_drain_per += val;
+ sd->right_weapon.hp_drain[RC_NONBOSS].rate += type2;
+ sd->right_weapon.hp_drain[RC_NONBOSS].per += val;
+ sd->right_weapon.hp_drain[RC_BOSS].rate += type2;
+ sd->right_weapon.hp_drain[RC_BOSS].per += val;
}
else if(sd->state.lr_flag == 1) {
- sd->left_weapon.hp_drain_rate += type2;
- sd->left_weapon.hp_drain_per += val;
+ sd->left_weapon.hp_drain[RC_NONBOSS].rate += type2;
+ sd->left_weapon.hp_drain[RC_NONBOSS].per += val;
+ sd->left_weapon.hp_drain[RC_BOSS].rate += type2;
+ sd->left_weapon.hp_drain[RC_BOSS].per += val;
}
break;
case SP_HP_DRAIN_VALUE:
if(!sd->state.lr_flag) {
- sd->right_weapon.hp_drain_value += type2;
+ sd->right_weapon.hp_drain[RC_NONBOSS].value += type2;
+ sd->right_weapon.hp_drain[RC_NONBOSS].type = val;
+ sd->right_weapon.hp_drain[RC_BOSS].value += type2;
+ sd->right_weapon.hp_drain[RC_BOSS].type = val;
}
else if(sd->state.lr_flag == 1) {
- sd->left_weapon.hp_drain_value += type2;
+ sd->left_weapon.hp_drain[RC_NONBOSS].value += type2;
+ sd->left_weapon.hp_drain[RC_NONBOSS].type = val;
+ sd->left_weapon.hp_drain[RC_BOSS].value += type2;
+ sd->left_weapon.hp_drain[RC_BOSS].type = val;
}
- sd->sp_drain_type = val;
break;
case SP_SP_DRAIN_RATE:
if(!sd->state.lr_flag) {
- sd->right_weapon.sp_drain_rate += type2;
- sd->right_weapon.sp_drain_per += val;
+ sd->right_weapon.sp_drain[RC_NONBOSS].rate += type2;
+ sd->right_weapon.sp_drain[RC_NONBOSS].per += val;
+ sd->right_weapon.sp_drain[RC_BOSS].rate += type2;
+ sd->right_weapon.sp_drain[RC_BOSS].per += val;
}
else if(sd->state.lr_flag == 1) {
- sd->left_weapon.sp_drain_rate += type2;
- sd->left_weapon.sp_drain_per += val;
+ sd->left_weapon.sp_drain[RC_NONBOSS].rate += type2;
+ sd->left_weapon.sp_drain[RC_NONBOSS].per += val;
+ sd->left_weapon.sp_drain[RC_BOSS].rate += type2;
+ sd->left_weapon.sp_drain[RC_BOSS].per += val;
}
- sd->sp_drain_type = 0;
break;
case SP_SP_DRAIN_VALUE:
if(!sd->state.lr_flag) {
- sd->right_weapon.sp_drain_value += type2;
+ sd->right_weapon.sp_drain[RC_NONBOSS].value += type2;
+ sd->right_weapon.sp_drain[RC_NONBOSS].type = val;
+ sd->right_weapon.sp_drain[RC_BOSS].value += type2;
+ sd->right_weapon.sp_drain[RC_BOSS].type = val;
}
else if(sd->state.lr_flag == 1) {
- sd->left_weapon.sp_drain_value += type2;
+ sd->left_weapon.sp_drain[RC_NONBOSS].value += type2;
+ sd->left_weapon.sp_drain[RC_NONBOSS].type = val;
+ sd->left_weapon.sp_drain[RC_BOSS].value += type2;
+ sd->left_weapon.sp_drain[RC_BOSS].type = val;
}
- sd->sp_drain_type = val;
break;
case SP_SP_VANISH_RATE:
if(sd->state.lr_flag != 2) {
@@ -2005,6 +2026,22 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
sd->sp_loss_rate = val;
}
break;
+ case SP_HP_DRAIN_VALUE_RACE:
+ if(!sd->state.lr_flag) {
+ sd->right_weapon.hp_drain[type2].value += val;
+ }
+ else if(sd->state.lr_flag == 1) {
+ sd->left_weapon.hp_drain[type2].value += val;
+ }
+ break;
+ case SP_SP_DRAIN_VALUE_RACE:
+ if(!sd->state.lr_flag) {
+ sd->right_weapon.sp_drain[type2].value += val;
+ }
+ else if(sd->state.lr_flag == 1) {
+ sd->left_weapon.sp_drain[type2].value += val;
+ }
+ break;
default:
if(battle_config.error_log)
@@ -2040,14 +2077,42 @@ int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val)
break;
case SP_SP_DRAIN_RATE:
if(!sd->state.lr_flag) {
- sd->right_weapon.sp_drain_rate += type2;
- sd->right_weapon.sp_drain_per += type3;
+ sd->right_weapon.sp_drain[RC_NONBOSS].rate += type2;
+ sd->right_weapon.sp_drain[RC_NONBOSS].per += type3;
+ sd->right_weapon.sp_drain[RC_NONBOSS].type = val;
+ sd->right_weapon.sp_drain[RC_BOSS].rate += type2;
+ sd->right_weapon.sp_drain[RC_BOSS].per += type3;
+ sd->right_weapon.sp_drain[RC_BOSS].type = val;
+
}
else if(sd->state.lr_flag == 1) {
- sd->left_weapon.sp_drain_rate += type2;
- sd->left_weapon.sp_drain_per += type3;
+ sd->left_weapon.sp_drain[RC_NONBOSS].rate += type2;
+ sd->left_weapon.sp_drain[RC_NONBOSS].per += type3;
+ sd->left_weapon.sp_drain[RC_NONBOSS].type = val;
+ sd->left_weapon.sp_drain[RC_BOSS].rate += type2;
+ sd->left_weapon.sp_drain[RC_BOSS].per += type3;
+ sd->left_weapon.sp_drain[RC_BOSS].type = val;
+ }
+ break;
+ case SP_HP_DRAIN_RATE_RACE:
+ if(!sd->state.lr_flag) {
+ sd->right_weapon.hp_drain[type2].rate += type3;
+ sd->right_weapon.hp_drain[type2].per += val;
+ }
+ else if(sd->state.lr_flag == 1) {
+ sd->left_weapon.hp_drain[type2].rate += type3;
+ sd->left_weapon.hp_drain[type2].per += val;
+ }
+ break;
+ case SP_SP_DRAIN_RATE_RACE:
+ if(!sd->state.lr_flag) {
+ sd->right_weapon.sp_drain[type2].rate += type3;
+ sd->right_weapon.sp_drain[type2].per += val;
+ }
+ else if(sd->state.lr_flag == 1) {
+ sd->left_weapon.sp_drain[type2].rate += type3;
+ sd->left_weapon.sp_drain[type2].per += val;
}
- sd->sp_drain_type = val;
break;
case SP_ADD_MONSTER_DROP_ITEMGROUP:
if (sd->state.lr_flag != 2)
@@ -6226,12 +6291,6 @@ int pc_equipitem(struct map_session_data *sd,int n,int pos)
run_script(data->equip_script,0,sd->bl.id,0);
}
}
-
- if(sd->sc.count) {
- if (sd->sc.data[SC_SIGNUMCRUCIS].timer != -1 && !battle_check_undead(7,sd->def_ele))
- status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1);
- }
-
return 0;
}
@@ -6301,11 +6360,12 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag)
pc_checkallowskill(sd);
if(sd->weapontype1 == 0 && sd->weapontype2 == 0)
skill_enchant_elemental_end(&sd->bl,-1); //武器持ち誓えは無?件で?性付?解除
- if(flag&1) {
+ if(flag&1)
status_calc_pc(sd,0);
- if(sd->sc.count && sd->sc.data[SC_SIGNUMCRUCIS].timer != -1 && !battle_check_undead(7,sd->def_ele))
- status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1);
- }
+
+ if(sd->sc.count && sd->sc.data[SC_SIGNUMCRUCIS].timer != -1 && !battle_check_undead(RC_DEMIHUMAN,sd->def_ele))
+ status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1);
+
//OnUnEquip script [Skotlex]
if (sd->inventory_data[n]) {
struct item_data *data;
@@ -6325,6 +6385,7 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag)
run_script(data->unequip_script,0,sd->bl.id,0);
}
}
+
return 0;
}