summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-11 11:02:53 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-11 11:02:53 +0000
commit4e0e965693d27f8c7a5e7c0c7ebda55ff217ec5b (patch)
treed872b1db6dd8162cda453bef9e41663ceb1462ad /src
parentcf9a1c007ff068ab5cdbbd93c689b00e2b5c4912 (diff)
downloadhercules-4e0e965693d27f8c7a5e7c0c7ebda55ff217ec5b.tar.gz
hercules-4e0e965693d27f8c7a5e7c0c7ebda55ff217ec5b.tar.bz2
hercules-4e0e965693d27f8c7a5e7c0c7ebda55ff217ec5b.tar.xz
hercules-4e0e965693d27f8c7a5e7c0c7ebda55ff217ec5b.zip
- Added missing include npc.h to map.c
- Now when job changing to another class tree, status changes from skills that belong to your previous class are cleared. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11716 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/map.c1
-rw-r--r--src/map/pc.c20
2 files changed, 19 insertions, 2 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 526c24394..97d8e1d12 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -38,6 +38,7 @@
#include "charcommand.h"
#include "log.h"
#include "irc.h"
+#include "npc.h"
#ifndef TXT_ONLY
#include "mail.h"
#endif
diff --git a/src/map/pc.c b/src/map/pc.c
index 4402409db..e50d6c57c 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5606,10 +5606,26 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
sd->change_level = sd->status.job_level;
else if (!sd->change_level)
sd->change_level = 40; //Assume 40?
+ pc_setglobalreg (sd, "jobchange_level", sd->change_level);
}
- pc_setglobalreg (sd, "jobchange_level", sd->change_level);
-
+ if(sd->cloneskill_id) {
+ sd->cloneskill_id = 0;
+ pc_setglobalreg(sd, "CLONE_SKILL", 0);
+ pc_setglobalreg(sd, "CLONE_SKILL_LV", 0);
+ }
+ if ((b_class&&MAPID_UPPERMASK) != (sd->class_&MAPID_UPPERMASK))
+ { //Things to remove when changing class tree.
+ const int class_ = pc_class2idx(sd->status.class_);
+ int id;
+ for(i = 0; i < MAX_SKILL_TREE && (id = skill_tree[class_][i].id) > 0; i++) {
+ //Remove status specific to your current tree skills.
+ id = SkillStatusChangeTable(id);
+ if (id > SC_COMMON_MAX && sd->sc.data[id].timer != -1)
+ status_change_end(&sd->bl, id, -1);
+ }
+ }
+
sd->status.class_ = job;
fame_flag = pc_famerank(sd->status.char_id,sd->class_&MAPID_UPPERMASK);
sd->class_ = (unsigned short)b_class;