summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-01-25 19:50:02 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-01-25 19:50:02 +0000
commit922f62e89a8b3dae0f7e407fae044299988b9ece (patch)
tree08d5ac0db76899cd696d938b90ed26ab4deff209 /src/map/status.c
parent5601d184cad4fb9b4ed6c51e15305e5800b30718 (diff)
downloadhercules-922f62e89a8b3dae0f7e407fae044299988b9ece.tar.gz
hercules-922f62e89a8b3dae0f7e407fae044299988b9ece.tar.bz2
hercules-922f62e89a8b3dae0f7e407fae044299988b9ece.tar.xz
hercules-922f62e89a8b3dae0f7e407fae044299988b9ece.zip
- Implemented new item bonus scripts required for battlegrounds.
- Battlegrounds items rewards for Tierra Valley and Flavius done (but autoscript rate is suggested - 5%). - Restricted trade/storage/drop for those items. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13490 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/map/status.c b/src/map/status.c
index fcfc0fb7f..67f4a7c85 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1754,6 +1754,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
+ sizeof(sd->addeff2)
+ sizeof(sd->skillatk)
+ sizeof(sd->skillheal)
+ + sizeof(sd->skillheal2)
+ sizeof(sd->hp_loss)
+ sizeof(sd->sp_loss)
+ sizeof(sd->hp_regen)
@@ -5102,6 +5103,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
return 0;
break;
case SC_HPREGEN:
+ case SC_HPDRAIN:
case SC_SPREGEN:
case SC_BOSSMAPINFO:
case SC_STUN:
@@ -5432,6 +5434,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
tick = 10000;
break;
case SC_HPREGEN:
+ case SC_HPDRAIN:
case SC_SPREGEN:
if( val1 == 0 ) return 0;
// val1 = heal percent/amout
@@ -7094,6 +7097,17 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr data)
}
break;
+ case SC_KNOWLEDGE:
+ if (!sd) break;
+ if(bl->m == sd->feel_map[0].m ||
+ bl->m == sd->feel_map[1].m ||
+ bl->m == sd->feel_map[2].m)
+ { //Timeout will be handled by pc_setpos
+ sce->timer = INVALID_TIMER;
+ return 0;
+ }
+ break;
+
case SC_BLEEDING:
if (--(sce->val4) >= 0) {
int flag;
@@ -7107,14 +7121,16 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr data)
}
break;
- case SC_KNOWLEDGE:
- if (!sd) break;
- if(bl->m == sd->feel_map[0].m ||
- bl->m == sd->feel_map[1].m ||
- bl->m == sd->feel_map[2].m)
- { //Timeout will be handled by pc_setpos
- sce->timer = INVALID_TIMER;
- return 0;
+ case SC_HPDRAIN:
+ if( --(sce->val4) >= 0 )
+ {
+ int flag, hp = (sce->val1 < 0) ? (int)(status->max_hp * -1 * sce->val1 / 100.) : sce->val1;
+ map_freeblock_lock();
+ status_fix_damage(NULL, bl, hp, 0);
+ flag = !sc->data[type];
+ map_freeblock_unlock();
+ if( flag ) return 0;
+ sc_timer_next((sce->val2 * 1000) + tick, status_change_timer, bl->id, data);
}
break;
@@ -7130,7 +7146,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr data)
sp = (sce->val1 < 0) ? (int)(sd->status.max_sp * -1 * sce->val1 / 100.) : sce->val1 ;
status_heal(bl, hp, sp, 2);
- sc_timer_next((sce->val2 * 1000) + tick, status_change_timer, bl->id, data );
+ sc_timer_next((sce->val2 * 1000) + tick, status_change_timer, bl->id, data);
return 0;
}
break;