summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/mapserver-logging23
-rw-r--r--src/char/char.c2
-rw-r--r--src/map/clif.c3
-rw-r--r--src/map/mob.c18
-rw-r--r--src/map/pc.c71
-rw-r--r--src/map/script.c4
6 files changed, 80 insertions, 41 deletions
diff --git a/doc/mapserver-logging b/doc/mapserver-logging
index e7088eb..983de1f 100644
--- a/doc/mapserver-logging
+++ b/doc/mapserver-logging
@@ -28,28 +28,31 @@ ZEROTARGET ::= 'null' | <TARGET>
MOB-MESSAGE ::= 'DEAD'
-PC-MESSAGE ::= 'WPNDMG' <TARGET> int 'FOR' int WPN int # "WPNDMG MOB01 type FOR damage WPN weapon-item"
+PC-MESSAGE ::= 'WPNDMG' <TARGET> int 'FOR' int WPN int # "WPNDMG MOB01 type FOR damage WPN weapon-item"
| 'WPNINJURY' <TARGET> int 'FOR' int
+ | 'MOB-TO-MOB-DMG' 'FROM' <MOB> int 'TO' <MOB> int 'FOR' int # Summoned monster damage
| 'SPELLHEAL-INSTA' <PC> FOR int
| 'SPELLDMG' <MOB> FOR int BY spell-id
| 'CAST' spell-id <SPELLRESULT>
- | 'STAT' int int int int int int <STATPLACE> # str agi vit int dex luk
- | 'XP' int int ZENY int '+' int <XPPLACE> # level xp zeny bank-zeny
- | 'MAGIC' int int int int int int 'EXP' int int 'LOGIN' # magic life war transmute nature ether magic-xp healer-xp
- | 'SKILL-ACTIVATE' int int int # skillid skilllvl skillpower
- | 'SKILL-UP' int int int # skillid skilllvl skillpower
+ | 'STAT' int int int int int int <STATPLACE> # str agi vit int dex luk
+ | 'XP' int int 'JOB' int int int 'ZENY' int '+' int <XPPLACE> # level xp job-level skill-xp skill-pts zeny bank-zeny
+ | 'SKILLPOINTS-UP' int # new number of unused skill points
+ | 'MAGIC' int int int int int int 'EXP' int int 'LOGIN' # magic life war transmute nature ether magic-xp healer-xp
+ | 'SKILL-ACTIVATE' int int int # skillid skilllvl skillpower
+ | 'SKILL-UP' int int int # skillid skilllvl skillpower
| 'SKILL-DEACTIVATE' int
| 'MAGIC-ABSORB-DMG' int
| 'GAINXP' int <XPREASON>
- | 'PICKUP' int int # item-id count
+ | 'PICKUP' int int # item-id count
| 'INJURED-BY' <ZEROTARGET> 'FOR' int
| 'DEAD'
| 'LOGOUT'
- | 'TRADECOMMIT' 'WITH' int 'GIVE' int 'GET' int # pc-id give-zeny get-zeny
+ | 'TRADECOMMIT' 'WITH' int 'GIVE' int 'GET' int # pc-id give-zeny get-zeny
| 'TRADECANCEL'
| 'TRADEOK'
-
-
+ | 'STATUP'
+ | 'STATRESET'
+ | 'STATUP'
NOTES:
------
diff --git a/src/char/char.c b/src/char/char.c
index 98321ec..c60305b 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -1335,7 +1335,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
WFIFOL(fd,j+4) = p->base_exp;
WFIFOL(fd,j+8) = p->zeny;
WFIFOL(fd,j+12) = p->job_exp;
- WFIFOL(fd,j+16) = p->job_level;
+ WFIFOL(fd,j+16) = 0; //p->job_level; // [Fate] We no longer reveal this to the player, as its meaning is weird.
WFIFOW(fd,j+20) = find_equip_view(p, 0x0040); // 9: shoes
WFIFOW(fd,j+22) = find_equip_view(p, 0x0004); // 10: gloves
diff --git a/src/map/clif.c b/src/map/clif.c
index f168ae5..7f603a9 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2120,7 +2120,8 @@ 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;
+ return 1; // [Fate] Don't report this anymore
+ //WFIFOL(fd,4)=sd->status.job_level;
break;
case SP_MANNER:
WFIFOL(fd,4)=sd->status.manner;
diff --git a/src/map/mob.c b/src/map/mob.c
index a5fc159..cec0b92 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2242,11 +2242,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);
@@ -2313,6 +2313,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 d09680f..0b251cc 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -45,8 +45,8 @@
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, \
@@ -1427,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;
@@ -1478,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;
@@ -1487,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];
@@ -4379,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;
}
@@ -4422,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;
@@ -4525,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 60ea879..d01fc99 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"},