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.c73
1 files changed, 30 insertions, 43 deletions
diff --git a/src/map/status.c b/src/map/status.c
index dc49f7e4e..589acff5c 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1201,7 +1201,7 @@ static int status_damage(struct block_list *src, struct block_list *target, int6
if ((sce=sc->data[SC_GRAVITATION]) && sce->val3 == BCT_SELF) {
struct skill_unit_group* sg = skill->id2group(sce->val4);
if (sg) {
- skill->del_unitgroup(sg, ALC_MARK);
+ skill->del_unitgroup(sg);
sce->val4 = 0;
status_change_end(target, SC_GRAVITATION, INVALID_TIMER);
}
@@ -1596,7 +1596,7 @@ static int status_check_skilluse(struct block_list *src, struct block_list *targ
}
if( skill_id ) {
- if (src != NULL && (sd == NULL || sd->autocast.type != AUTOCAST_ITEM)) {
+ if (src != NULL && (sd == NULL || sd->auto_cast_current.type != AUTOCAST_ITEM)) {
// Items that cast skills using 'itemskill' will not be handled by map_zone_db.
int i;
@@ -1640,7 +1640,7 @@ static int status_check_skilluse(struct block_list *src, struct block_list *targ
if (src != NULL
&& map->getcell(src->m, src, src->x, src->y, CELL_CHKLANDPROTECTOR)
&& !(st->mode&MD_BOSS)
- && (src->type != BL_PC || sd->autocast.type != AUTOCAST_ITEM))
+ && (src->type != BL_PC || sd->auto_cast_current.type != AUTOCAST_ITEM))
return 0;
break;
default:
@@ -1719,7 +1719,7 @@ static int status_check_skilluse(struct block_list *src, struct block_list *targ
return 0; //Can't amp out of Wand of Hermode :/ [Skotlex]
}
- if (skill_id != 0 /* Do not block item-casted skills.*/ && (src->type != BL_PC || sd->autocast.type != AUTOCAST_ITEM)) {
+ if (skill_id != 0 /* Do not block item-casted skills.*/ && (src->type != BL_PC || sd->auto_cast_current.type != AUTOCAST_ITEM)) {
//Skills blocked through status changes...
if (!flag && ( //Blocked only from using the skill (stuff like autospell may still go through
sc->data[SC_SILENCE] ||
@@ -1737,6 +1737,7 @@ static int status_check_skilluse(struct block_list *src, struct block_list *targ
(sc->data[SC_MARIONETTE] && skill_id == CG_MARIONETTE) || //Cannot use marionette if you are being buffed by another
(sc->data[SC_STASIS] && skill->block_check(src, SC_STASIS, skill_id)) ||
(sc->data[SC_KG_KAGEHUMI] && skill->block_check(src, SC_KG_KAGEHUMI, skill_id))
+ || sc->data[SC_ALL_RIDING] != NULL // New mounts can't attack nor use skills in the client; this check makes it cheat-safe. [Ind]
))
return 0;
@@ -1785,8 +1786,6 @@ static int status_check_skilluse(struct block_list *src, struct block_list *targ
} else if ( skill_id != ST_CHASEWALK )
return 0;
}
- if( sc->data[SC_ALL_RIDING] )
- return 0;//New mounts can't attack nor use skills in the client; this check makes it cheat-safe [Ind]
}
if (target == NULL || target == src) //No further checking needed.
@@ -6408,13 +6407,24 @@ static int status_get_class(const struct block_list *bl)
{
nullpo_ret(bl);
switch (bl->type) {
- case BL_PC: return BL_UCCAST(BL_PC, bl)->status.class;
- case BL_MOB: return BL_UCCAST(BL_MOB, bl)->vd->class; //Class used on all code should be the view class of the mob.
- case BL_PET: return BL_UCCAST(BL_PET, bl)->pet.class_;
- case BL_HOM: return BL_UCCAST(BL_HOM, bl)->homunculus.class_;
- case BL_MER: return BL_UCCAST(BL_MER, bl)->mercenary.class_;
- case BL_NPC: return BL_UCCAST(BL_NPC, bl)->class_;
- case BL_ELEM: return BL_UCCAST(BL_ELEM, bl)->elemental.class_;
+ case BL_PC:
+ return BL_UCCAST(BL_PC, bl)->status.class;
+ case BL_MOB:
+ {
+ const struct view_data *const vd = BL_UCCAST(BL_MOB, bl)->vd;
+ nullpo_ret(vd);
+ return vd->class; //Class used on all code should be the view class of the mob.
+ }
+ case BL_PET:
+ return BL_UCCAST(BL_PET, bl)->pet.class_;
+ case BL_HOM:
+ return BL_UCCAST(BL_HOM, bl)->homunculus.class_;
+ case BL_MER:
+ return BL_UCCAST(BL_MER, bl)->mercenary.class_;
+ case BL_NPC:
+ return BL_UCCAST(BL_NPC, bl)->class_;
+ case BL_ELEM:
+ return BL_UCCAST(BL_ELEM, bl)->elemental.class_;
}
return 0;
}
@@ -6504,7 +6514,7 @@ static defType status_get_def(struct block_list *bl)
int def = st ? st->def : 0;
ud = unit->bl2ud(bl);
if (ud && ud->skilltimer != INVALID_TIMER)
- def -= def * skill->get_castdef(ud->skill_id)/100;
+ def -= def * skill->get_castdef(ud->skill_id, ud->skill_lv) / 100;
return cap_value(def, DEFTYPE_MIN, DEFTYPE_MAX);
}
@@ -10788,7 +10798,7 @@ static int status_change_clear(struct block_list *bl, int type)
/*==========================================
* Special condition we want to effectuate, check before ending a status.
*------------------------------------------*/
-static int status_change_end_(struct block_list *bl, enum sc_type type, int tid, const char *file, int line)
+static int status_change_end_(struct block_list *bl, enum sc_type type, int tid)
{
struct map_session_data *sd;
struct status_change *sc;
@@ -10958,23 +10968,9 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid,
break;
case SC_DANCING:
{
- const char* prevfile = "<unknown>";
- int prevline = 0;
struct map_session_data *dsd;
struct status_change_entry *dsc;
- if (sd) {
- if (sd->delunit_prevfile) {
- // initially this is NULL, when a character logs in
- prevfile = sd->delunit_prevfile;
- prevline = sd->delunit_prevline;
- } else {
- prevfile = "<none>";
- }
- sd->delunit_prevfile = file;
- sd->delunit_prevline = line;
- }
-
if (sce->val4 && sce->val4 != BCT_SELF && (dsd=map->id2sd(sce->val4)) != NULL) {
// end status on partner as well
dsc = dsd->sc.data[SC_DANCING];
@@ -10990,19 +10986,10 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid,
// erase associated land skill
struct skill_unit_group *group = skill->id2group(sce->val2);
- if (group == NULL) {
- ShowDebug("status_change_end: SC_DANCING is missing skill unit group (val1=%d, val2=%d, val3=%d, val4=%d, timer=%d, tid=%d, char_id=%d, map=%s, x=%d, y=%d, prev=%s:%d, from=%s:%d). Please report this! (#3504)\n",
- sce->val1, sce->val2, sce->val3, sce->val4, sce->timer, tid,
- sd ? sd->status.char_id : 0,
- mapindex_id2name(map_id2index(bl->m)), bl->x, bl->y,
- prevfile, prevline,
- file, line);
- }
-
sce->val2 = 0;
if( group )
- skill->del_unitgroup(group,ALC_MARK);
+ skill->del_unitgroup(group);
}
if ((sce->val1&0xFFFF) == CG_MOONLIT)
@@ -11106,7 +11093,7 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid,
struct skill_unit_group* group = skill->id2group(sce->val3);
sce->val3 = 0;
if( group )
- skill->del_unitgroup(group,ALC_MARK);
+ skill->del_unitgroup(group);
}
break;
case SC_HERMODE:
@@ -11125,7 +11112,7 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid,
struct skill_unit_group* group = skill->id2group(sce->val4);
sce->val4 = 0;
if( group ) /* might have been cleared before status ended, e.g. land protector */
- skill->del_unitgroup(group,ALC_MARK);
+ skill->del_unitgroup(group);
}
break;
case SC_KAAHI:
@@ -11223,7 +11210,7 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid,
struct skill_unit_group* group = skill->id2group(sce->val2);
sce->val2 = 0;
if (group) /* might have been cleared before status ended, e.g. land protector */
- skill->del_unitgroup(group,ALC_MARK);
+ skill->del_unitgroup(group);
}
break;
case SC_BANDING:
@@ -11231,7 +11218,7 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid,
struct skill_unit_group *group = skill->id2group(sce->val4);
sce->val4 = 0;
if( group ) /* might have been cleared before status ended, e.g. land protector */
- skill->del_unitgroup(group,ALC_MARK);
+ skill->del_unitgroup(group);
}
break;
case SC_CURSEDCIRCLE_ATKER: