diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-20 12:07:52 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-20 12:07:52 +0000 |
commit | 257a41619254ceb14b6e0867a20449248b540d41 (patch) | |
tree | 806b0c0cfab18b6e33cb268339a3ff1a84851717 /src/map/pc.c | |
parent | acb92c94cae29a2e516b1f77101889f7d043bf85 (diff) | |
download | hercules-257a41619254ceb14b6e0867a20449248b540d41.tar.gz hercules-257a41619254ceb14b6e0867a20449248b540d41.tar.bz2 hercules-257a41619254ceb14b6e0867a20449248b540d41.tar.xz hercules-257a41619254ceb14b6e0867a20449248b540d41.zip |
* Added 4 new card effects from 3/15's patch
* Added 'enable_ip_rules' to packet_athena.conf
* Updated socket debug messages to be more readable
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1257 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 920784da3..c681f8ec5 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1588,7 +1588,18 @@ int pc_bonus(struct map_session_data *sd,int type,int val) int i; for (i=0; i<11; i++) { if (sd->inventory_data[current_equip_item_index]->equip & equip_pos[i]) { - sd->unequip_damage[i] += val; + sd->unequip_losehp[i] += val; + break; + } + } + } + break; + case SP_LOSESP_WHEN_UNEQUIP: + if(!sd->state.lr_flag) { + int i; + for (i=0; i<11; i++) { + if (sd->inventory_data[current_equip_item_index]->equip & equip_pos[i]) { + sd->unequip_losesp[i] += val; break; } } @@ -1861,10 +1872,22 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) if(sd->state.lr_flag != 2) sd->subsize[type2]+=val; break; + case SP_SUBRACE2: + if(sd->state.lr_flag != 2) + sd->subrace2[type2]+=val; + break; case SP_ADD_ITEM_HEAL_RATE: if(sd->state.lr_flag != 2) sd->itemhealrate[type2 - 1] += val; break; + case SP_EXP_ADDRACE: + if(sd->state.lr_flag != 2) + sd->expaddrace[type2]+=val; + break; + case SP_SP_GAIN_RACE: + if(sd->state.lr_flag != 2) + sd->sp_gain_race[type2]+=val; + break; default: if(battle_config.error_log) @@ -6076,7 +6099,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int pos) */ int pc_unequipitem(struct map_session_data *sd,int n,int flag) { - short dmg = 0; + short hp = 0, sp = 0; nullpo_retr(0, sd); // -- moonsoul (if player is berserk then cannot unequip) @@ -6093,9 +6116,13 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) for(i=0;i<11;i++) { if(sd->status.inventory[n].equip & equip_pos[i]) { sd->equip_index[i] = -1; - if(sd->unequip_damage[i] > 0) { - dmg += sd->unequip_damage[i]; - sd->unequip_damage[i] = 0; + if(sd->unequip_losehp[i] > 0) { + hp += sd->unequip_losehp[i]; + sd->unequip_losehp[i] = 0; + } + if(sd->unequip_losesp[i] > 0) { + sp += sd->unequip_losesp[i]; + sd->unequip_losesp[i] = 0; } } } @@ -6150,10 +6177,12 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1); } - if (dmg > 0) { - if (dmg > sd->status.hp) - dmg = sd->status.hp; - pc_heal(sd,-dmg,0); + if (hp > 0 || sp > 0) { + if (hp > sd->status.hp) + hp = sd->status.hp; + if (sp > sd->status.sp) + sp = sd->status.sp; + pc_heal(sd,-hp,-sp); } return 0; |