summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-07 16:42:25 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-07 16:42:25 +0000
commit09d10f90af78019f690853ef3079f19122433262 (patch)
treeb5cbb464f3cc4178a2f0c1b47fcf3121fce9bfc6 /src/map/status.c
parent322bbe35455b4c423ca8a1ff695a2c68808f5be9 (diff)
downloadhercules-09d10f90af78019f690853ef3079f19122433262.tar.gz
hercules-09d10f90af78019f690853ef3079f19122433262.tar.bz2
hercules-09d10f90af78019f690853ef3079f19122433262.tar.xz
hercules-09d10f90af78019f690853ef3079f19122433262.zip
- Cleaned up implementation of NPC_EMOTION/NPC_EMOTION_ON. Now val0 is the emotion, val1 sets the mode, val2 adds to the mode, val3 removes from the mode. val4 asks to remove the previous mode change.
- Updated the mob skill reading code so it accepts hexadecimals in the 'val' fields. Also, it will optimize the NPC values so that when you set a mob's mode to their db mode, it will just remove the previous mode. - NPC_EMOTION_ON will now automatically move it's new mode to val2 since it should add a mode, and if this mode doesn't has the aggressive bit, it will remove it. See this "ancient" hypothesis on how NPC_EMOTION_ON should work for the details: http://www.eathena.ws/board/index.php?showtopic=63606 - Updated mob_skill_db to account for the updated mob modes on NPC_EMOTION skills. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9433 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/map/status.c b/src/map/status.c
index b69417757..dee934c8f 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -4631,12 +4631,15 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
int mode;
struct status_data *bstatus = status_get_base_status(bl);
if (!bstatus) return 0;
+ if (sc->data[type].timer != -1)
+ { //Pile up with previous values.
+ if(!val2) val2 = sc->data[type].val2;
+ val3 |= sc->data[type].val3;
+ val4 |= sc->data[type].val4;
+ }
mode = val2?val2:bstatus->mode; //Base mode
- //Mode added AND removed? Added has priority.
- if ((val3&val4))
- val4&= ~(val3&val4);
- if (val3) mode|= val3; //Add mode
if (val4) mode&=~val4; //Del mode
+ if (val3) mode|= val3; //Add mode
if (mode == bstatus->mode) { //No change.
if (sc->data[type].timer != -1) //Abort previous status
return status_change_end(bl, type, -1);