summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 54a3208d2..d108d8cfa 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2068,6 +2068,7 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {
struct status_data *mstatus;
struct block_list *mbl = NULL;
int flag=0;
+ int guardup_lv = 0;
if(opt&SCO_FIRST) { //Set basic level on respawn.
if (md->level > 0 && md->level <= MAX_LEVEL && md->level != md->db->lv)
@@ -2083,7 +2084,8 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {
if (md->special_state.size)
flag|=2;
- if (md->guardian_data && md->guardian_data->guardup_lv)
+ if( md->guardian_data && md->guardian_data->g
+ && (guardup_lv = guild->checkskill(md->guardian_data->g,GD_GUARDUP)) )
flag|=4;
if (battle_config.slaves_inherit_speed && md->master_id)
@@ -2218,10 +2220,10 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {
mstatus->mdef += (gc->defense+2)/3;
}
if(md->class_ != MOBID_EMPERIUM) {
- mstatus->batk += mstatus->batk * 10*md->guardian_data->guardup_lv/100;
- mstatus->rhw.atk += mstatus->rhw.atk * 10*md->guardian_data->guardup_lv/100;
- mstatus->rhw.atk2 += mstatus->rhw.atk2 * 10*md->guardian_data->guardup_lv/100;
- mstatus->aspd_rate -= 100*md->guardian_data->guardup_lv;
+ mstatus->batk += mstatus->batk * 10*guardup_lv/100;
+ mstatus->rhw.atk += mstatus->rhw.atk * 10*guardup_lv/100;
+ mstatus->rhw.atk2 += mstatus->rhw.atk2 * 10*guardup_lv/100;
+ mstatus->aspd_rate -= 100*guardup_lv;
}
}
@@ -5980,15 +5982,18 @@ int status_get_guild_id(struct block_list *bl) {
if (((TBL_PET*)bl)->msd)
return ((TBL_PET*)bl)->msd->status.guild_id;
break;
- case BL_MOB: {
+ case BL_MOB:
+ {
struct map_session_data *msd;
struct mob_data *md = (struct mob_data *)bl;
- if (md->guardian_data) //Guardian's guild [Skotlex]
- return md->guardian_data->guild_id;
- if (md->special_state.ai && (msd = map->id2sd(md->master_id)) != NULL)
+ if( md->guardian_data ) { //Guardian's guild [Skotlex]
+ // Guardian guild data may not been available yet, castle data is always set
+ return (md->guardian_data->g)?md->guardian_data->g->guild_id:md->guardian_data->castle->guild_id;
+ }
+ if( md->special_state.ai && (msd = map->id2sd(md->master_id)) != NULL )
return msd->status.guild_id; //Alchemist's mobs [Skotlex]
- }
- break;
+ break;
+ }
case BL_HOM:
if (((TBL_HOM*)bl)->master)
return ((TBL_HOM*)bl)->master->status.guild_id;
@@ -6024,7 +6029,7 @@ int status_get_emblem_id(struct block_list *bl) {
struct map_session_data *msd;
struct mob_data *md = (struct mob_data *)bl;
if (md->guardian_data) //Guardian's guild [Skotlex]
- return md->guardian_data->emblem_id;
+ return (md->guardian_data->g) ? md->guardian_data->g->emblem_id:0;
if (md->special_state.ai && (msd = map->id2sd(md->master_id)) != NULL)
return msd->guild_emblem_id; //Alchemist's mobs [Skotlex]
}