summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c72
1 files changed, 30 insertions, 42 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 51165ea..5976137 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -38,8 +38,6 @@
#define STATE_BLIND 0x10
-#define MAP_LOG_PC(sd, fmt, args...) MAP_LOG("PC%d %d:%d,%d " fmt, sd->status.char_id, sd->bl.m, sd->bl.x, sd->bl.y, ## args)
-
#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)
@@ -853,6 +851,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, short tmw_versio
strftime(tmpstr, sizeof(tmpstr) - 1, msg_txt(501), gmtime(&connect_until_time)); // "Your account time limit is: %d-%m-%Y %H:%M:%S."
clif_wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1);
}
+ pc_calcstatus(sd,1);
return 0;
}
@@ -875,23 +874,17 @@ int pc_authfail(int id) {
static int pc_calc_skillpoint(struct map_session_data* sd)
{
- int i,skill,skill_point=0;
+ int i, skill_points = 0;
nullpo_retr(0, sd);
- for(i=1;i<MAX_SKILL;i++){
- if( (skill = pc_checkskill(sd,i)) > 0) {
- if(skill_get_inf2(i)&0x01) {
- if(!sd->status.skill[i].flag)
- skill_point += skill;
- else if(sd->status.skill[i].flag > 2 && sd->status.skill[i].flag != 13) {
- skill_point += (sd->status.skill[i].flag - 2);
- }
- }
- }
- }
+ for (i = 0; i < skill_pool_skills_size; i++) {
+ int lv = sd->status.skill[skill_pool_skills[i]].lv;
+ if (lv)
+ skill_points += ((lv * (lv + 1)) >> 1) - 1;
+ }
- return skill_point;
+ return skill_points;
}
/*==========================================
@@ -1381,6 +1374,13 @@ int pc_calcstatus(struct map_session_data* sd,int first)
}
}
+ if (battle_is_unarmed(&sd->bl)) {
+ sd->watk += skill_power(sd, TMW_BRAWLING) / 3; // +66 for 200
+ sd->watk2 += skill_power(sd, TMW_BRAWLING) >> 3; // +25 for 200
+ sd->watk_ += skill_power(sd, TMW_BRAWLING) / 3; // +66 for 200
+ sd->watk_2 += skill_power(sd, TMW_BRAWLING) >> 3; // +25 for 200
+ }
+
if(sd->equip_index[10] >= 0){ // ��
index = sd->equip_index[10];
if(sd->inventory_data[index]){ //�܂�����������Ă��Ȃ�
@@ -1471,6 +1471,10 @@ int pc_calcstatus(struct map_session_data* sd,int first)
sd->paramb[5]+= 5;
}
}
+ sd->speed -= skill_power(sd, TMW_SPEED) >> 3;
+ sd->aspd_rate -= skill_power(sd, TMW_SPEED) / 10;
+ 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){
@@ -2654,12 +2658,7 @@ int pc_skill(struct map_session_data *sd,int id,int level,int flag)
clif_skillinfoblock(sd);
}
else if(sd->status.skill[id].lv < level){ // �o�������邪lv���������Ȃ�
- if(sd->status.skill[id].id==id)
- sd->status.skill[id].flag=sd->status.skill[id].lv+2; // lv���L��
- else {
- sd->status.skill[id].id=id;
- sd->status.skill[id].flag=1; // card�X�L���Ƃ���
- }
+ sd->status.skill[id].id=id;
sd->status.skill[id].lv=level;
}
@@ -4358,6 +4357,7 @@ int pc_checkbaselevelup(struct map_session_data *sd)
//���x���A�b�v�����̂Ńp�[�e�B�[�������X�V����
//(��͈̓`�F�b�N)
party_send_movemap(sd);
+ MAP_LOG_XP(sd, "LEVELUP")
return 1;
}
@@ -4766,6 +4766,8 @@ int pc_skillup(struct map_session_data *sd,int skill_num)
clif_skillup(sd,skill_num);
clif_updatestatus(sd,SP_SKILLPOINT);
clif_skillinfoblock(sd);
+ MAP_LOG_PC(sd, "SKILLUP %d %d %d",
+ skill_num, sd->status.skill[skill_num].lv, skill_power(sd, skill_num));
}
return 0;
@@ -4788,13 +4790,8 @@ int pc_allskillup(struct map_session_data *sd)
c = s_class.job;
s = (s_class.upper==1) ? 1 : 0 ; //�]���ȊO�͒ʏ��̃X�L���H
- for(i=0;i<MAX_SKILL;i++){
+ for(i=0;i<MAX_SKILL;i++)
sd->status.skill[i].id=0;
- if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){ // card�X�L���Ȃ��A
- sd->status.skill[i].lv=(sd->status.skill[i].flag==1)?0:sd->status.skill[i].flag-2; // �{����lv��
- sd->status.skill[i].flag=0; // flag��0�ɂ��Ă���
- }
- }
if (battle_config.gm_allskill > 0 && pc_isGM(sd) >= battle_config.gm_allskill){
// �S�ẴX�L��
@@ -4963,23 +4960,14 @@ int pc_resetskill(struct map_session_data* sd)
nullpo_retr(0, sd);
- for(i=1;i<MAX_SKILL;i++){
+ sd->status.skill_point += pc_calc_skillpoint(sd);
+
+ for(i=1;i<MAX_SKILL;i++)
if( (skill = pc_checkskill(sd,i)) > 0) {
- if(skill_get_inf2(i)&0x01) {
- if(!sd->status.skill[i].flag)
- sd->status.skill_point += skill;
- else if(sd->status.skill[i].flag > 2 && sd->status.skill[i].flag != 13) {
- sd->status.skill_point += (sd->status.skill[i].flag - 2);
- }
- sd->status.skill[i].lv = 0;
- }
- else if(battle_config.quest_skill_reset)
- sd->status.skill[i].lv = 0;
- sd->status.skill[i].flag = 0;
- }
- else
sd->status.skill[i].lv = 0;
- }
+ sd->status.skill[i].flags = 0;
+ }
+
clif_updatestatus(sd,SP_SKILLPOINT);
clif_skillinfoblock(sd);
pc_calcstatus(sd,0);