summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-29 20:34:17 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-29 20:34:17 +0000
commit53e1375cb6926b55a1487b61e5616b299e34e2be (patch)
tree66c641be525b9db654c34f5ab008b813a34832f1 /src/map/status.c
parent9cde26c90a6c3e55eddbee619958aea9b22c8de7 (diff)
downloadhercules-53e1375cb6926b55a1487b61e5616b299e34e2be.tar.gz
hercules-53e1375cb6926b55a1487b61e5616b299e34e2be.tar.bz2
hercules-53e1375cb6926b55a1487b61e5616b299e34e2be.tar.xz
hercules-53e1375cb6926b55a1487b61e5616b299e34e2be.zip
- Added "do_abort" function to the core. It is invoked when the server has received a Segmentation Fault or Floating Point Exception signal. Currently the only one that uses it is the map-server, which then attempts to save all online characters before aborting.
- Note that due to the current coding of the sig plugin, do_abort will not be invoked if you use it! This plugin needs to be updated... - Cleaned up a bit the change element code. val1 is the elemental level, val2 is the element now. - Hardcoded the element and elemental level of SC_CHANGEUNDEAD. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10089 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/map/status.c b/src/map/status.c
index b7c595d51..993be24ea 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -3874,9 +3874,9 @@ static unsigned char status_calc_element(struct block_list *bl, struct status_ch
if( sc->data[SC_BENEDICTIO].timer!=-1 )
return ELE_HOLY;
if( sc->data[SC_CHANGEUNDEAD].timer!=-1)
- return sc->data[SC_CHANGEUNDEAD].val3;
+ return ELE_UNDEAD;
if( sc->data[SC_ELEMENTALCHANGE].timer!=-1)
- return sc->data[SC_ELEMENTALCHANGE].val3;
+ return sc->data[SC_ELEMENTALCHANGE].val2;
return cap_value(element,0,UCHAR_MAX);
}
@@ -3893,7 +3893,7 @@ static unsigned char status_calc_element_lv(struct block_list *bl, struct status
if( sc->data[SC_CHANGEUNDEAD].timer!=-1)
return 1;
if(sc->data[SC_ELEMENTALCHANGE].timer!=-1)
- return sc->data[SC_ELEMENTALCHANGE].val4;
+ return sc->data[SC_ELEMENTALCHANGE].val1;
return cap_value(lv,1,4);
}
@@ -5007,10 +5007,14 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
skill_enchant_elemental_end(bl,type);
break;
case SC_ELEMENTALCHANGE:
- //Val1 is skill level, val2 is skill that invoked this.
- if (!val3) //Val 3 holds the element, when not given, a random one is picked.
- val3 = rand()%ELE_MAX;
- val4 =1+rand()%4; //Elemental Lv is always a random value between 1 and 4.
+ //Val1 is elemental change level, val2 is eleemnt to use.
+ if (!val2) //Val 3 holds the element, when not given, a random one is picked.
+ val2 = rand()%ELE_MAX;
+ //Elemental Lv is always a random value between 1 and 4.
+ if (val1 == 1)
+ val1 =1+rand()%4;
+ else if (val1 > 4)
+ val1 = 4;
break;
case SC_PROVIDENCE:
val2=val1*5; //Race/Ele resist