Skip to content

Commit

Permalink
Bug Fixes:
Browse files Browse the repository at this point in the history
* Fixed #371, missing entry for Solid Skin (EL_SOLID_SKIN) in skill_cast_db.txt, causing the skill gives effect only for a ms.
* Follow up f19e2dc `pc_mapid2jobid` gives wrong value and revert `JOBL_SUPER_NOVICE` flag that was introduced in 8256194.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
  • Loading branch information
cydh committed Apr 16, 2015
1 parent 9b1c138 commit 2fdcd92
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 22 deletions.
2 changes: 2 additions & 0 deletions db/re/skill_cast_db.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1916,6 +1916,8 @@
8408,0,0,0,-1,0,0,-1
//-- EL_ZEPHYR
8409,0,0,0,15000,0,0,-1
//-- EL_SOLID_SKIN
8410,0,0,0,-1,0,0,-1
//-- EL_STONE_SHIELD
8411,0,0,0,-1,0,0,-1
//-- EL_POWER_OF_GAIA
Expand Down
2 changes: 1 addition & 1 deletion src/map/clif.c
Original file line number Diff line number Diff line change
Expand Up @@ -13690,7 +13690,7 @@ void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd)
/// "Help me out~ Please~ T_T"
void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd)
{
if( sd->class_&JOBL_SUPER_NOVICE ) {
if( (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE ) {
unsigned int next = pc_nextbaseexp(sd);

if( next == 0 ) next = pc_thisbaseexp(sd);
Expand Down
18 changes: 8 additions & 10 deletions src/map/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ enum MOBID {
#define JOBL_UPPER 0x1000 //4096
#define JOBL_BABY 0x2000 //8192
#define JOBL_THIRD 0x4000 //16384
#define JOBL_SUPER_NOVICE 0x8000 //32768

//for filtering and quick checking.
#define MAPID_BASEMASK 0x00ff
Expand Down Expand Up @@ -148,7 +147,8 @@ enum e_mapid {
MAPID_GANGSI,
MAPID_OKTOBERFEST,
//2-1 Jobs
MAPID_KNIGHT = JOBL_2_1|0x1,
MAPID_SUPER_NOVICE = JOBL_2_1|0x0,
MAPID_KNIGHT,
MAPID_WIZARD,
MAPID_HUNTER,
MAPID_PRIEST,
Expand Down Expand Up @@ -198,7 +198,8 @@ enum e_mapid {
MAPID_BABY_MERCHANT,
MAPID_BABY_THIEF,
//Baby 2-1 Jobs
MAPID_BABY_KNIGHT = JOBL_BABY|JOBL_2_1|0x1,
MAPID_SUPER_BABY = JOBL_BABY|JOBL_2_1|0x0,
MAPID_BABY_KNIGHT,
MAPID_BABY_WIZARD,
MAPID_BABY_HUNTER,
MAPID_BABY_PRIEST,
Expand All @@ -212,7 +213,8 @@ enum e_mapid {
MAPID_BABY_ALCHEMIST,
MAPID_BABY_ROGUE,
//3-1 Jobs
MAPID_RUNE_KNIGHT = JOBL_THIRD|JOBL_2_1|0x1,
MAPID_SUPER_NOVICE_E = JOBL_THIRD|JOBL_2_1|0x0,
MAPID_RUNE_KNIGHT,
MAPID_WARLOCK,
MAPID_RANGER,
MAPID_ARCH_BISHOP,
Expand Down Expand Up @@ -240,7 +242,8 @@ enum e_mapid {
MAPID_GENETIC_T,
MAPID_SHADOW_CHASER_T,
//Baby 3-1 Jobs
MAPID_BABY_RUNE = JOBL_THIRD|JOBL_BABY|JOBL_2_1|0x1,
MAPID_SUPER_BABY_E = JOBL_THIRD|JOBL_BABY|JOBL_2_1|0x0,
MAPID_BABY_RUNE,
MAPID_BABY_WARLOCK,
MAPID_BABY_RANGER,
MAPID_BABY_BISHOP,
Expand All @@ -253,11 +256,6 @@ enum e_mapid {
MAPID_BABY_SURA,
MAPID_BABY_GENETIC,
MAPID_BABY_CHASER,
//Super Novices
MAPID_SUPER_NOVICE = JOBL_SUPER_NOVICE|JOBL_2_1|0x0,
MAPID_SUPER_BABY = JOBL_SUPER_NOVICE|JOBL_BABY|JOBL_2_1|0x0,
MAPID_SUPER_NOVICE_E = JOBL_SUPER_NOVICE|JOBL_THIRD|JOBL_2_1|0x0,
MAPID_SUPER_BABY_E = JOBL_SUPER_NOVICE|JOBL_THIRD|JOBL_BABY|JOBL_2_1|0x0,
};

//Max size for inputs to Graffiti, Talkie Box and Vending text prompts
Expand Down
12 changes: 5 additions & 7 deletions src/map/pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ int pc_calc_skilltree_normalize_job(struct map_session_data *sd)
c = MAPID_NOVICE;
}
// limit 2nd class and above to first class job levels (super novices are exempt)
else if (sd->class_&JOBL_2 && !(sd->class_&JOBL_SUPER_NOVICE))
else if (sd->class_&JOBL_2 && (sd->class_&MAPID_UPPERMASK) != MAPID_SUPER_NOVICE)
{
// regenerate change_level_2nd
if (!sd->change_level_2nd)
Expand Down Expand Up @@ -5779,8 +5779,6 @@ int pc_jobid2mapid(unsigned short b_class)
//Reverts the map-style class id to the client-style one.
int pc_mapid2jobid(unsigned short class_, int sex)
{
class_ &= JOBL_SUPER_NOVICE; // Quick conversion to get proper Super Novice ID.

switch(class_) {
//Novice And 1-1 Jobs
case MAPID_NOVICE: return JOB_NOVICE;
Expand Down Expand Up @@ -6245,7 +6243,7 @@ int pc_checkbaselevelup(struct map_session_data *sd) {
status_calc_pc(sd,SCO_FORCE);
status_percent_heal(&sd->bl,100,100);

if(sd->class_&JOBL_SUPER_NOVICE) {
if ((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE) {
sc_start(&sd->bl,&sd->bl,status_skill2sc(PR_KYRIE),100,1,skill_get_time(PR_KYRIE,1));
sc_start(&sd->bl,&sd->bl,status_skill2sc(PR_IMPOSITIO),100,1,skill_get_time(PR_IMPOSITIO,1));
sc_start(&sd->bl,&sd->bl,status_skill2sc(PR_MAGNIFICAT),100,1,skill_get_time(PR_MAGNIFICAT,1));
Expand Down Expand Up @@ -7257,7 +7255,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)

// Activate Steel body if a super novice dies at 99+% exp [celest]
// Super Novices have no kill or die functions attached when saved by their angel
if (sd->class_&JOBL_SUPER_NOVICE && !sd->state.snovice_dead_flag) {
if (!sd->state.snovice_dead_flag && (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE) {
unsigned int next = pc_nextbaseexp(sd);

if( next == 0 ) next = pc_thisbaseexp(sd);
Expand Down Expand Up @@ -8085,7 +8083,7 @@ bool pc_jobchange(struct map_session_data *sd,int job, char upper)
return false; //Nothing to change.

// changing from 1st to 2nd job
if ((b_class&JOBL_2) && !(sd->class_&JOBL_2) && !(b_class&JOBL_SUPER_NOVICE)) {
if ((b_class&JOBL_2) && !(sd->class_&JOBL_2) && (sd->class_&MAPID_UPPERMASK) != MAPID_SUPER_NOVICE) {
sd->change_level_2nd = sd->status.job_level;
pc_setglobalreg (sd, "jobchange_level", sd->change_level_2nd);
}
Expand Down Expand Up @@ -8729,7 +8727,7 @@ bool pc_setregistry(struct map_session_data *sd,const char *reg,int val,int type
{
case 3: //Char reg
if( !strcmp(reg,"PC_DIE_COUNTER") && sd->die_counter != val ) {
i = (!sd->die_counter && sd->class_&JOBL_SUPER_NOVICE);
i = (!sd->die_counter && (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE);
sd->die_counter = val;
if( i )
status_calc_pc(sd,SCO_NONE); // Lost the bonus.
Expand Down
4 changes: 2 additions & 2 deletions src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
hp += hp * skill * 2 / 100;
else if( src->type == BL_HOM && (skill = hom_checkskill(((TBL_HOM*)src), HLIF_BRAIN)) > 0 )
hp += hp * skill * 2 / 100;
if( sd && tsd && sd->status.partner_id == tsd->status.char_id && sd->class_&JOBL_SUPER_NOVICE && sd->status.sex == 0 )
if( sd && tsd && sd->status.partner_id == tsd->status.char_id && (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.sex == 0 )
hp *= 2;
break;
}
Expand Down Expand Up @@ -8172,7 +8172,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SL_SUPERNOVICE:
case SL_WIZARD:
//NOTE: here, 'type' has the value of the associated MAPID, not of the SC_SPIRIT constant.
if (sd && dstsd && !(((dstsd->class_&MAPID_UPPERMASK) == type) || (skill_id == SL_SUPERNOVICE && (dstsd->class_&JOBL_SUPER_NOVICE)))) {
if (sd && dstsd && !((dstsd->class_&MAPID_UPPERMASK) == type)) {
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/map/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -2698,7 +2698,7 @@ static int status_get_hpbonus(struct block_list *bl, enum e_status_bonus type) {
bonus += sd->bonus.hp;
if ((i = pc_checkskill(sd,CR_TRUST)) > 0)
bonus += i * 200;
if (sd->class_&JOBL_SUPER_NOVICE && sd->status.base_level >= 99)
if ((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.base_level >= 99)
bonus += 2000; // Supernovice lvl99 hp bonus.
}

Expand Down Expand Up @@ -3337,7 +3337,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt)
}

// If a Super Novice has never died and is at least joblv 70, he gets all stats +10
if((sd->class_&JOBL_SUPER_NOVICE && (sd->status.job_level >= 70 || sd->class_&JOBL_THIRD)) && sd->die_counter == 0) {
if(((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && (sd->status.job_level >= 70 || sd->class_&JOBL_THIRD)) && sd->die_counter == 0) {
status->str += 10;
status->agi += 10;
status->vit += 10;
Expand Down

0 comments on commit 2fdcd92

Please sign in to comment.