summaryrefslogtreecommitdiff
path: root/src/map/skill.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/skill.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/skill.c')
-rw-r--r--src/map/skill.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index daf0abc04..ff75a71f9 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -4937,18 +4937,23 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case NPC_EMOTION_ON:
case NPC_EMOTION:
- if(md && md->skillidx >= 0)
+ //va[0] is the emotion to use.
+ //NPC_EMOTION & NPC_EMOTION_ON can change a mob's mode 'permanently' [Skotlex]
+ //val[1] 'sets' the mode
+ //val[2] adds to the current mode
+ //val[3] removes from the current mode
+ //val[4] if set, asks to delete the previous mode change.
+ if(md && md->skillidx >= 0 && tsc)
{
- clif_emotion(&md->bl,md->db->skill[md->skillidx].val[0]);
- if(!md->special_state.ai &&
- (md->db->skill[md->skillidx].val[1] || md->db->skill[md->skillidx].val[2]))
- //NPC_EMOTION & NPC_EMOTION_ON can change a mob's mode 'permanently' [Skotlex]
- //val[1] 'sets' the mode, val[2] can add/remove from the current mode based on skill used:
- //NPC_EMOTION_ON adds a mode / NPC_EMOTION removes it.
+ clif_emotion(bl, md->db->skill[md->skillidx].val[0]);
+ if(md->db->skill[md->skillidx].val[4] && tsc->data[type].timer != -1)
+ status_change_end(bl, type, -1);
+
+ if(md->db->skill[md->skillidx].val[1] || md->db->skill[md->skillidx].val[2])
sc_start4(src, type, 100, skilllv,
md->db->skill[md->skillidx].val[1],
- skillid==NPC_EMOTION_ON?md->db->skill[md->skillidx].val[2]:0,
- skillid==NPC_EMOTION ?md->db->skill[md->skillidx].val[2]:0,
+ md->db->skill[md->skillidx].val[2],
+ md->db->skill[md->skillidx].val[3],
skill_get_time(skillid, skilllv));
}
break;