diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 2 | ||||
-rw-r--r-- | src/map/mob.c | 18 | ||||
-rw-r--r-- | src/map/pc.c | 84 | ||||
-rw-r--r-- | src/map/script.c | 4 |
4 files changed, 78 insertions, 30 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index f168ae5..7b4720c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2120,7 +2120,7 @@ int clif_updatestatus(struct map_session_data *sd,int type) WFIFOL(fd,4)=sd->status.base_level; break; case SP_JOBLEVEL: - WFIFOL(fd,4)=sd->status.job_level; + WFIFOL(fd,4)=0; break; case SP_MANNER: WFIFOL(fd,4)=sd->status.manner; diff --git a/src/map/mob.c b/src/map/mob.c index b4753da..5a0bedc 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2263,11 +2263,11 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) if (src && src->id == md->master_id && md->mode & MOB_MODE_TURNS_AGAINST_BAD_MASTER) { - /* If the master hits a monster, have the monster turn against him */ - md->master_id = 0; - md->mode = 0x85; /* Regular war mode */ - md->target_id = src->id; - md->attacked_id = src->id; + /* If the master hits a monster, have the monster turn against him */ + md->master_id = 0; + md->mode = 0x85; /* Regular war mode */ + md->target_id = src->id; + md->attacked_id = src->id; } max_hp = battle_get_max_hp(&md->bl); @@ -2334,6 +2334,14 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) } if(src && src->type == BL_MOB && ((struct mob_data*)src)->state.special_mob_ai){ struct mob_data *md2 = (struct mob_data *)src; + struct block_list *master_bl = map_id2bl(md2->master_id); + if (master_bl->type == BL_PC) { + MAP_LOG_PC(((struct map_session_data *)master_bl), "MOB-TO-MOB-DMG FROM MOB%d %d TO MOB%d %d FOR %d", + md2->bl.id, md2->class, + md->bl.id, md->class, + damage); + } + nullpo_retr(0, md2); for(i=0,minpos=0,mindmg=0x7fffffff;i<DAMAGELOG_SIZE;i++){ if(md->dmglog[i].id==md2->master_id) diff --git a/src/map/pc.c b/src/map/pc.c index 5bb0009..0b251cc 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -38,13 +38,15 @@ #define STATE_BLIND 0x10 +#define MAGIC_SKILL_THRESHOLD 200 // [fate] At this threshold, the Astral Soul skill kicks in + #define MAP_LOG_STATS(sd, suffix) \ MAP_LOG_PC(sd, "STAT %d %d %d %d %d %d " suffix, \ sd->status.str, sd->status.agi, sd->status.vit, sd->status.int_, sd->status.dex, sd->status.luk) #define MAP_LOG_XP(sd, suffix) \ - MAP_LOG_PC(sd, "XP %d %d ZENY %d + %d " suffix, \ - sd->status.base_level, sd->status.base_exp, sd->status.zeny, pc_readaccountreg(sd, "BankAccount")) + MAP_LOG_PC(sd, "XP %d %d JOB %d %d %d ZENY %d + %d " suffix, \ + sd->status.base_level, sd->status.base_exp, sd->status.job_level, sd->status.job_exp, sd->status.skill_point, sd->status.zeny, pc_readaccountreg(sd, "BankAccount")) #define MAP_LOG_MAGIC(sd, suffix) \ MAP_LOG_PC(sd, "MAGIC %d %d %d %d %d %d EXP %d %d " suffix, \ @@ -1311,6 +1313,9 @@ int pc_calcstatus(struct map_session_data* sd,int first) } } + if (sd->spellpower_bonus_target < 0) + sd->spellpower_bonus_target = (sd->spellpower_bonus_target * 256) / (MIN (128 + skill_power(sd, TMW_ASTRAL_SOUL), 256)); + if (sd->spellpower_bonus_target < sd->spellpower_bonus_current) sd->spellpower_bonus_current = sd->spellpower_bonus_target; @@ -1422,11 +1427,13 @@ int pc_calcstatus(struct map_session_data* sd,int first) sd->atkmods_[1] = atkmods[1][sd->weapontype2]; sd->atkmods_[2] = atkmods[2][sd->weapontype2]; +/* // job�{�[�i�X�� for(i=0;i<sd->status.job_level && i<MAX_LEVEL;i++){ if(job_bonus[s_class.upper][s_class.job][i]) sd->paramb[job_bonus[s_class.upper][s_class.job][i]-1]++; } +*/ if( (skill=pc_checkskill(sd,MC_INCCARRY))>0 ) // skill can be used with an item now, thanks to orn [Valaris] sd->max_weight += skill*1000; @@ -1473,6 +1480,7 @@ int pc_calcstatus(struct map_session_data* sd,int first) if (sd->aspd_rate < 20) sd->aspd_rate = 20; +/* //1�x�����łȂ�Job70�X�p�m�r��+10 if(s_class.job == 23 && sd->die_counter == 0 && sd->status.job_level >= 70){ sd->paramb[0]+= 15; @@ -1482,6 +1490,7 @@ int pc_calcstatus(struct map_session_data* sd,int first) sd->paramb[4]+= 15; sd->paramb[5]+= 15; } +*/ sd->paramc[0]=sd->status.str+sd->paramb[0]+sd->parame[0]; sd->paramc[1]=sd->status.agi+sd->paramb[1]+sd->parame[1]; sd->paramc[2]=sd->status.vit+sd->paramb[2]+sd->parame[2]; @@ -1512,6 +1521,14 @@ int pc_calcstatus(struct map_session_data* sd,int first) } // [Fate] New tmw magic system sd->matk1 += sd->status.base_level + sd->spellpower_bonus_current; + if (sd->matk1 > MAGIC_SKILL_THRESHOLD) { + int bonus = sd->matk1 - MAGIC_SKILL_THRESHOLD; + int bound = 2 * skill_power(sd, TMW_ASTRAL_SOUL); + if (bonus > bound) + bonus = (bonus * 100) / (100 + bonus - bound); + + sd->matk1 = MAGIC_SKILL_THRESHOLD + bonus; + } sd->matk2 = 0; if (sd->matk1 < 0) sd->matk1 = 0; @@ -4366,22 +4383,55 @@ int pc_checkbaselevelup(struct map_session_data *sd) return 0; } +/*======================================== + * Compute the maximum for sd->skill_point, i.e., the max. number of skill points that can still be filled in + *---------------------------------------- + */ +int pc_skillpt_potential(struct map_session_data *sd) +{ + int skill_id; + int potential = 0; + +#define RAISE_COST(x) (((x)*((x)+1))>>1) + + for (skill_id = 0; skill_id < MAX_SKILL; skill_id++) + if (sd->status.skill[skill_id].id != 0 + && sd->status.skill[skill_id].lv < skill_db[skill_id].max_raise) + potential += RAISE_COST(skill_db[skill_id].max_raise) + - RAISE_COST(sd->status.skill[skill_id].lv); +#undef RAISE_COST + + return potential; +} + int pc_checkjoblevelup(struct map_session_data *sd) { int next = pc_nextjobexp(sd); nullpo_retr(0, sd); - if(sd->status.job_exp >= next && next > 0){ + if (sd->status.job_exp >= next + && next > 0) { + + if (pc_skillpt_potential(sd) < sd->status.skill_point) { // [Fate] Bah, this is is painful. + // But the alternative is quite error-prone, and eAthena has far worse performance issues... + sd->status.job_exp = next - 1; + return 0; + } + // job�����x���A�b�v���� sd->status.job_exp -= next; - sd->status.job_level ++; - clif_updatestatus(sd,SP_JOBLEVEL); clif_updatestatus(sd,SP_NEXTJOBEXP); - sd->status.skill_point ++; + sd->status.skill_point++; clif_updatestatus(sd,SP_SKILLPOINT); pc_calcstatus(sd,0); + MAP_LOG_PC(sd, "SKILLPOINTS-UP %d", sd->status.skill_point); + + if (sd->status.job_level < 250 + && sd->status.job_level < sd->status.base_level * 2) + sd->status.job_level++; // Make levelling up a little harder + clif_misceffect(&sd->bl,1); return 1; } @@ -4409,7 +4459,7 @@ int pc_gainexp_reason(struct map_session_data *sd,int base_exp,int job_exp, int if((battle_config.pvp_exp == 0) && map[sd->bl.m].flag.pvp) // [MouseJstr] return 0; // no exp on pvp maps - MAP_LOG_PC(sd, "GAINXP %d %s", base_exp, ((reason == 2)? "SCRIPTXP" : ((reason == 1) ? "HEALXP" : "KILLXP"))); + MAP_LOG_PC(sd, "GAINXP %d %d %s", base_exp, job_exp, ((reason == 2)? "SCRIPTXP" : ((reason == 1) ? "HEALXP" : "KILLXP"))); if(sd->sc_data[SC_RICHMANKIM].timer != -1) { // added bounds checking [Vaalris] base_exp += base_exp*(25 + sd->sc_data[SC_RICHMANKIM].val1*25)/100; @@ -4512,22 +4562,12 @@ int pc_nextbaseexp(struct map_session_data *sd) */ int pc_nextjobexp(struct map_session_data *sd) { - int i; - - nullpo_retr(0, sd); - - if(sd->status.job_level>=MAX_LEVEL || sd->status.job_level<=0) - return 0; - - if(sd->status.class==0) i=7; - else if(sd->status.class<=6) i=8; - else if(sd->status.class<=22) i=9; - else if(sd->status.class==23) i=10; - else if(sd->status.class==4001) i=11; - else if(sd->status.class<=4007) i=12; - else i=13; + // [fate] For normal levels, this ranges from 20k to 50k, depending on job level. + // Job level is at most twice the player's experience level (base_level). Levelling + // from 2 to 9 is 44 points, i.e., 880k to 2.2M job experience points (this is per + // skill, obviously.) - return exp_table[i][sd->status.job_level-1]; + return 20000 + sd->status.job_level * 150; } /*========================================== diff --git a/src/map/script.c b/src/map/script.c index 9310b6d..7c63b85 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -471,8 +471,8 @@ struct { {buildin_getexp,"getexp","ii"}, {buildin_getinventorylist,"getinventorylist",""}, {buildin_getskilllist,"getskilllist",""}, - {buildin_get_activated_pool_skills,"getpoolskilllist",""}, - {buildin_get_pool_skills,"getactivatedpoolskilllist",""}, + {buildin_get_pool_skills,"getpoolskilllist",""}, + {buildin_get_activated_pool_skills,"getactivatedpoolskilllist",""}, {buildin_activate_pool_skill,"poolskill","i"}, {buildin_deactivate_pool_skill,"unpoolskill","i"}, {buildin_check_pool_skill,"checkpoolskill","i"}, |