summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/guild.c9
-rw-r--r--src/map/pc.c38
-rw-r--r--src/map/skill.c2
4 files changed, 38 insertions, 13 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index e1db71d4f..1cce2fcba 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -486,7 +486,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
if (sc && sc->count) {
}
*/
- if (battle_config.pk_mode && sd && damage)
+ if (battle_config.pk_mode && sd && bl->type == BL_PC && damage)
{
if (flag & BF_SKILL) { //Skills get a different reduction than non-skills. [Skotlex]
if (flag&BF_WEAPON)
diff --git a/src/map/guild.c b/src/map/guild.c
index b75af5bea..a06b29f8d 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -789,6 +789,7 @@ int guild_leave(struct map_session_data *sd,int guild_id,
int guild_expulsion(struct map_session_data *sd,int guild_id,
int account_id,int char_id,const char *mes)
{
+ struct map_session_data *tsd;
struct guild *g;
int i,ps;
@@ -799,12 +800,18 @@ int guild_expulsion(struct map_session_data *sd,int guild_id,
if(g==NULL)
return 0;
- if(sd->status.guild_id!=guild_id || map[sd->bl.m].flag.gvg_castle) //Can't leave inside guild castles.
+ if(sd->status.guild_id!=guild_id)
return 0;
if( (ps=guild_getposition(sd,g))<0 || !(g->position[ps].mode&0x0010) )
return 0; //Expulsion permission
+ //Can't leave inside guild castles.
+ if ((tsd = map_id2sd(account_id)) == NULL ||
+ tsd->status.char_id != char_id ||
+ map[tsd->bl.m].flag.gvg_castle)
+ return 0;
+
for(i=0;i<g->max_member;i++){ // 所属しているか
if(g->member[i].account_id==account_id &&
g->member[i].char_id==char_id ){
diff --git a/src/map/pc.c b/src/map/pc.c
index ee30f5bc8..88b7fde40 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -946,7 +946,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
do {
flag = 0;
for(i = 0; i < MAX_SKILL_TREE && (id = skill_tree[c][i].id) > 0; i++) {
- int j, f, inf2;
+ int j, f, k, inf2;
if(sd->status.skill[id].id)
continue; //Skill already known.
@@ -954,9 +954,19 @@ int pc_calc_skilltree(struct map_session_data *sd)
f = 1;
if(!battle_config.skillfree) {
for(j = 0; j < 5; j++) {
- if( skill_tree[c][i].need[j].id && pc_checkskill(sd,skill_tree[c][i].need[j].id) < skill_tree[c][i].need[j].lv) {
- f = 0; // one or more prerequisites wasn't satisfied
- break;
+ if((k=skill_tree[c][i].need[j].id))
+ {
+ if (!sd->status.skill[k].id || sd->status.skill[k].flag == 13)
+ k = 0; //Not learned.
+ else if (sd->status.skill[k].flag) //Real lerned level
+ k = sd->status.skill[skill_tree[c][i].need[j].id].flag-2;
+ else
+ k = pc_checkskill(sd,k);
+ if (k < skill_tree[c][i].need[j].lv)
+ {
+ f=0;
+ break;
+ }
}
}
if (sd->status.job_level < skill_tree[c][i].joblv)
@@ -1021,17 +1031,25 @@ static void pc_check_skilltree(struct map_session_data *sd, int skill) {
do {
flag=0;
for(i=0;i < MAX_SKILL_TREE && (id=skill_tree[c][i].id)>0;i++){
- int j,f=1;
+ int j,f=1, k;
if(sd->status.skill[id].id) //Already learned
continue;
for(j=0;j<5;j++) {
- if( skill_tree[c][i].need[j].id &&
- pc_checkskill(sd,skill_tree[c][i].need[j].id) <
- skill_tree[c][i].need[j].lv) {
- f=0;
- break;
+ if((k=skill_tree[c][i].need[j].id))
+ {
+ if (!sd->status.skill[k].id || sd->status.skill[k].flag == 13)
+ k = 0; //Not learned.
+ else if (sd->status.skill[k].flag) //Real lerned level
+ k = sd->status.skill[skill_tree[c][i].need[j].id].flag-2;
+ else
+ k = pc_checkskill(sd,k);
+ if (k < skill_tree[c][i].need[j].lv)
+ {
+ f=0;
+ break;
+ }
}
}
if (!f)
diff --git a/src/map/skill.c b/src/map/skill.c
index 2a55a5280..e70aa222e 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11412,6 +11412,7 @@ int skill_readdb (void)
skill_init_unit_layout();
memset(skill_produce_db,0,sizeof(skill_produce_db));
+ k=0;
for(m=0;m<2;m++){
sprintf(path, "%s/%s", db_path, filename[m]);
fp=fopen(path,"r");
@@ -11421,7 +11422,6 @@ int skill_readdb (void)
ShowError("can't read %s\n",path);
return 1;
}
- k=0;
while(fgets(line,1020,fp)){
char *split[7 + MAX_PRODUCE_RESOURCE * 2];
int x,y;