summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-02-14 17:18:11 -0200
committershennetsind <ind@henn.et>2013-02-14 17:18:11 -0200
commit2bc85620e0b91aaaa29f929e618d5f6d6623b4f0 (patch)
tree3f828ba070367820df99d4e286dc2cc023b92cd9 /src/map/pc.c
parent810ba40b78087cc6aa7eb9ad3a3e46534393b9e8 (diff)
downloadhercules-2bc85620e0b91aaaa29f929e618d5f6d6623b4f0.tar.gz
hercules-2bc85620e0b91aaaa29f929e618d5f6d6623b4f0.tar.bz2
hercules-2bc85620e0b91aaaa29f929e618d5f6d6623b4f0.tar.xz
hercules-2bc85620e0b91aaaa29f929e618d5f6d6623b4f0.zip
Fixed Bug #5018
Skills granted through scripts are now permanent, until this date they were not relog persistent Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 0dd210394..1bc37040e 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1253,7 +1253,7 @@ static int pc_calc_skillpoint(struct map_session_data* sd)
if(sd->status.skill[i].flag == SKILL_FLAG_PERMANENT)
skill_point += skill;
else
- if(sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0)
+ if(sd->status.skill[i].flag == SKILL_FLAG_REPLACED_LV_0)
skill_point += (sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0);
}
}
@@ -1283,13 +1283,13 @@ int pc_calc_skilltree(struct map_session_data *sd)
for( i = 0; i < MAX_SKILL; i++ )
{
- if( sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED ) //Don't touch plagiarized skills
+ if( sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED && sd->status.skill[i].flag != SKILL_FLAG_PERM_GRANTED ) //Don't touch these
sd->status.skill[i].id = 0; //First clear skills.
}
for( i = 0; i < MAX_SKILL; i++ )
{
- if( sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED )
+ if( sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PERM_GRANTED && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED )
{ // Restore original level of skills after deleting earned skills.
sd->status.skill[i].lv = (sd->status.skill[i].flag == SKILL_FLAG_TEMPORARY) ? 0 : sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0;
sd->status.skill[i].flag = SKILL_FLAG_PERMANENT;
@@ -1509,7 +1509,7 @@ int pc_clean_skilltree(struct map_session_data *sd)
sd->status.skill[i].flag = 0;
}
else
- if (sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0){
+ if (sd->status.skill[i].flag == SKILL_FLAG_REPLACED_LV_0){
sd->status.skill[i].lv = sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0;
sd->status.skill[i].flag = 0;
}
@@ -3442,7 +3442,7 @@ int pc_skill(TBL_PC* sd, int id, int level, int flag)
case 0: //Set skill data overwriting whatever was there before.
sd->status.skill[id].id = id;
sd->status.skill[id].lv = level;
- sd->status.skill[id].flag = SKILL_FLAG_PERMANENT;
+ sd->status.skill[id].flag = SKILL_FLAG_PERM_GRANTED;
if( level == 0 ) //Remove skill.
{
sd->status.skill[id].id = 0;
@@ -6056,7 +6056,7 @@ int pc_allskillup(struct map_session_data *sd)
nullpo_ret(sd);
for(i=0;i<MAX_SKILL;i++){
- if (sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED) {
+ if (sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PERM_GRANTED && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED) {
sd->status.skill[i].lv = (sd->status.skill[i].flag == SKILL_FLAG_TEMPORARY) ? 0 : sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0;
sd->status.skill[i].flag = SKILL_FLAG_PERMANENT;
if (sd->status.skill[i].lv == 0)
@@ -6329,6 +6329,9 @@ int pc_resetskill(struct map_session_data* sd, int flag)
if( i == NV_BASIC && (sd->class_&MAPID_UPPERMASK) != MAPID_NOVICE )
continue;
+ if( sd->status.skill[i].flag == SKILL_FLAG_PERM_GRANTED )
+ continue;
+
if( flag&4 && !skill_ischangesex(i) )
continue;
@@ -6344,7 +6347,7 @@ int pc_resetskill(struct map_session_data* sd, int flag)
if( sd->status.skill[i].flag == SKILL_FLAG_PERMANENT )
skill_point += lv;
else
- if( sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0 )
+ if( sd->status.skill[i].flag == SKILL_FLAG_REPLACED_LV_0 )
skill_point += (sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0);
if( !(flag&2) )