summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-08 12:21:28 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-08 12:21:28 +0000
commitc23c79fe6a1bbf54d414007ead915f739e636b85 (patch)
tree338b58cbc7347ae108864eb5270fa852b638f939 /src/map/status.c
parentc348cfa676c0cc54f1a1114c1b5654f97163f86c (diff)
downloadhercules-c23c79fe6a1bbf54d414007ead915f739e636b85.tar.gz
hercules-c23c79fe6a1bbf54d414007ead915f739e636b85.tar.bz2
hercules-c23c79fe6a1bbf54d414007ead915f739e636b85.tar.xz
hercules-c23c79fe6a1bbf54d414007ead915f739e636b85.zip
Updated Deadly Poison and Enchant Poison
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1215 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c55
1 files changed, 11 insertions, 44 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 53c59670f..f81952518 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -4464,54 +4464,21 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
return 0;
}
break;
+
case SC_POISON:
- if(sc_data[SC_SLOWPOISON].timer == -1) {
- if( (--sc_data[type].val3) > 0) {
- int hp = status_get_max_hp(bl);
- if(status_get_hp(bl) > hp>>2) {
- if(sd) {
- hp = 3 + hp*3/200;
- pc_heal(sd,-hp,0);
- }
- else if(bl->type == BL_MOB) {
- struct mob_data *md;
- nullpo_retr(0, md=(struct mob_data *)bl);
- /*if((md=((struct mob_data *)bl)) == NULL)
- break;*/
- hp = 3 + hp/200;
- md->hp -= hp;
- }
- }
- sc_data[type].timer=add_timer(1000+tick,status_change_timer, bl->id, data );
- // hmm setting up a timer and breaking then to call status_change_end just right away?
- // I think you're missing a:
- return 0;
-
- }
- }
- else
- {
- sc_data[type].timer=add_timer(1000+tick,status_change_timer, bl->id, data );
- // hmm setting up a timer and breaking then to call status_change_end just right away?
- // I think you're missing brackets and a:
- return 0;
- }
- break;
case SC_DPOISON:
if (sc_data[SC_SLOWPOISON].timer == -1 && (--sc_data[type].val3) > 0) {
int hp = status_get_max_hp(bl);
- if (status_get_hp(bl) > hp>>2) {
- if(sd) {
- hp = 3 + hp/50;
- pc_heal(sd, -hp, 0);
- } else if (bl->type == BL_MOB) {
- struct mob_data *md;
- nullpo_retr(0, md=(struct mob_data *)bl);
- /*if ((md=((struct mob_data *)bl)) == NULL)
- break;*/
- hp = 3 + hp/100;
- md->hp -= hp;
- }
+ if (type == SC_POISON && status_get_hp(bl) < hp>>2)
+ break;
+ if(sd) {
+ hp = (type == SC_DPOISON) ? 3 + hp/50 : 3 + hp*3/200;
+ pc_heal(sd, -hp, 0);
+ } else if (bl->type == BL_MOB) {
+ struct mob_data *md;
+ nullpo_retr(0, md=(struct mob_data *)bl);
+ hp = (type == SC_DPOISON) ? 3 + hp/100 : 3 + hp/200;
+ md->hp -= hp;
}
}
if (sc_data[type].val3 > 0)