summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c38
-rw-r--r--src/map/chrif.c2
-rw-r--r--src/map/elemental.c3
-rw-r--r--src/map/script.c148
-rw-r--r--src/map/skill.c34
-rw-r--r--src/map/status.c70
6 files changed, 118 insertions, 177 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index ccdabc9b1..e3b8bb40e 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1396,7 +1396,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
int i;
struct status_change *sc, *tsc;
struct map_session_data *sd, *tsd;
- struct status_data *st, *tst;
+ struct status_data *st, *tst, *bst;
nullpo_ret(src);
nullpo_ret(target);
@@ -1406,6 +1406,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
sc = status->get_sc(src);
tsc = status->get_sc(target);
st = status->get_status_data(src);
+ bst = status->get_base_status(src);
tst = status->get_status_data(target);
switch(attack_type){
@@ -2411,9 +2412,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
break;
case GN_CART_TORNADO:
{
- int strbonus = st->str; // FIXME Supposed to take only base STR, but current code wont allow that. So well just take STR for now. [Rytech]
- if ( strbonus > 130 ) // Max base stat limit on official is 130. So well allow no higher then 125 STR here. This limit prevents
- strbonus = 130; // the division from going any lower then 30 so the server wont divide by 0 if someone has 150 STR.
+ int strbonus = bst->str;
skillratio = 50 * skill_lv + (sd ? sd->cart_weight : battle_config.max_cart_weight) / 10 / (150 - strbonus) + 50 * (sd ? pc->checkskill(sd, GN_REMODELING_CART) : 5);
}
break;
@@ -2696,7 +2695,19 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if( (sce=sc->data[SC_AUTOGUARD]) && flag&BF_WEAPON && !(skill->get_nk(skill_id)&NK_NO_CARDFIX_ATK) && rnd()%100 < sce->val2 )
{
int delay;
- clif->skill_nodamage(bl,bl,CR_AUTOGUARD,sce->val1,1);
+ struct block_list *d_bl;
+ struct status_change_entry *sce_d;
+ bool devoted = false;
+
+ if ((sce_d = sc->data[SC_DEVOTION]) && (d_bl = map->id2bl(sce_d->val1)) &&
+ ((d_bl->type == BL_MER && ((TBL_MER*)d_bl)->master && ((TBL_MER*)d_bl)->master->bl.id == bl->id) || //
+ (d_bl->type == BL_PC && ((TBL_PC*)d_bl)->devotion[sce_d->val2] == bl->id))) {
+ // if player is target of devotion, show guard effect on the devotion caster rather than the target
+ devoted = true;
+ clif->skill_nodamage(d_bl, d_bl, CR_AUTOGUARD, sce->val1, 1);
+ } else
+ clif->skill_nodamage(bl, bl, CR_AUTOGUARD,sce->val1, 1);
+
// different delay depending on skill level [celest]
if (sce->val1 <= 5)
delay = 300;
@@ -2704,7 +2715,8 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
delay = 200;
else
delay = 100;
- unit->set_walkdelay(bl, timer->gettick(), delay, 1);
+
+ unit->set_walkdelay((devoted ? d_bl : bl), timer->gettick(), delay, 1);
if(sc->data[SC_CR_SHRINK] && rnd()%100<5*sce->val1)
skill->blown(bl,src,skill->get_blewcount(CR_SHRINK,1),-1,0);
@@ -5217,9 +5229,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
wd.damage-=wd.damage2;
#endif
}
-
- if( src != target ) { // Don't reflect your own damage (Grand Cross)
+
+ if( src != target ) { // Don't reflect your own damage (Grand Cross)
if( wd.dmg_lv == ATK_MISS || wd.dmg_lv == ATK_BLOCK ) {
int64 prev1 = wd.damage, prev2 = wd.damage2;
@@ -5345,6 +5357,9 @@ void battle_reflect_damage(struct block_list *target, struct block_list *src, st
sc = NULL;
if( sc ) {
+ if (sc->data[SC_DEVOTION] && !(wd->flag & BF_SKILL))
+ return; // No reflect for basic attacks on devoted characters
+
if (wd->flag & BF_SHORT && !(skill->get_inf(skill_id) & (INF_GROUND_SKILL | INF_SELF_SKILL))) {
if( sc->data[SC_CRESCENTELBOW] && !is_boss(src) && rnd()%100 < sc->data[SC_CRESCENTELBOW]->val2 ){
//ATK [{(Target HP / 100) x Skill Level} x Caster Base Level / 125] % + [Received damage x {1 + (Skill Level x 0.2)}]
@@ -6353,13 +6368,6 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int range
if( src->m != bl->m )
return false;
-#ifndef CIRCULAR_AREA
- if( src->type == BL_PC ) { // Range for players' attacks and skills should always have a circular check. [Angezerus]
- int dx = src->x - bl->x, dy = src->y - bl->y;
- if( !path->check_distance(dx, dy, range) )
- return false;
- } else
-#endif
if( !check_distance_bl(src, bl, range) )
return false;
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 4c8cd747b..ebdace226 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -1178,7 +1178,7 @@ bool chrif_load_scdata(int fd) {
for (i = 0; i < count; i++) {
data = (struct status_change_data*)RFIFOP(fd,14 + i*sizeof(struct status_change_data));
- status->change_start(NULL, &sd->bl, (sc_type)data->type, 10000, data->val1, data->val2, data->val3, data->val4, data->tick, 15);
+ status->change_start(NULL, &sd->bl, (sc_type)data->type, 10000, data->val1, data->val2, data->val3, data->val4, data->tick, 7);
}
pc->scdata_received(sd);
diff --git a/src/map/elemental.c b/src/map/elemental.c
index caba02692..b594c8899 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -218,6 +218,9 @@ int elemental_delete(struct elemental_data *ed, int reply) {
sd->ed = NULL;
sd->status.ele_id = 0;
+ if( !ed->bl.prev )
+ return unit->free(&ed->bl, 0);
+
return unit->remove_map(&ed->bl, 0, ALC_MARK);
}
diff --git a/src/map/script.c b/src/map/script.c
index ecd12a3c1..2f0aa5831 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10039,118 +10039,80 @@ BUILDIN(hideonnpc)
return true;
}
-/// Starts a status effect on the target unit or on the attached player.
-///
-/// sc_start <effect_id>,<duration>,<val1>{,<unit_id>};
-BUILDIN(sc_start) {
+/* Starts a status effect on the target unit or on the attached player.
+ *
+ * sc_start <effect_id>,<duration>,<val1>{,<rate>,<flag>,{<unit_id>}};
+ * sc_start2 <effect_id>,<duration>,<val1>,<val2>{,<rate,<flag>,{<unit_id>}};
+ * sc_start4 <effect_id>,<duration>,<val1>,<val2>,<val3>,<val4>{,<rate,<flag>,{<unit_id>}};
+ * <flag>
+ * &1: Cannot be avoided (it has to start)
+ * &2: Tick should not be reduced (by vit, luk, lv, etc)
+ * &4: sc_data loaded, no value has to be altered.
+ * &8: rate should not be reduced
+ */
+BUILDIN(sc_start)
+{
+ TBL_NPC * nd = map->id2nd(st->oid);
struct block_list* bl;
enum sc_type type;
- int tick;
- int val1;
- int val4 = 0;
+ int tick, val1, val2, val3, val4=0, rate, flag;
+ char start_type;
+ const char* command = script_getfuncname(st);
+
+ if(strstr(command, "4"))
+ start_type = 4;
+ else if(strstr(command, "2"))
+ start_type = 2;
+ else
+ start_type = 1;
type = (sc_type)script_getnum(st,2);
tick = script_getnum(st,3);
val1 = script_getnum(st,4);
- if( script_hasdata(st,5) )
- bl = map->id2bl(script_getnum(st,5));
- else
- bl = map->id2bl(st->rid);
-
- if( tick == 0 && val1 > 0 && type > SC_NONE && type < SC_MAX && status->sc2skill(type) != 0 ) {
- // When there isn't a duration specified, try to get it from the skill_db
- tick = skill->get_time(status->sc2skill(type), val1);
- }
- if( script->potion_flag == 1 && script->potion_target ) {
- //skill.c set the flags before running the script, this must be a potion-pitched effect.
- bl = map->id2bl(script->potion_target);
- tick /= 2;// Thrown potions only last half.
- val4 = 1;// Mark that this was a thrown sc_effect
- }
-
- if( bl )
- status->change_start(NULL, bl, type, 10000, val1, 0, 0, val4, tick, 2);
-
- return true;
-}
+ //If from NPC we make default flag 1 to be unavoidable
+ if(nd && nd->bl.id == npc->fake_nd->bl.id)
+ flag = script_hasdata(st,5+start_type)?script_getnum(st,5+start_type):2;
+ else
+ flag = script_hasdata(st,5+start_type)?script_getnum(st,5+start_type):1;
-/// Starts a status effect on the target unit or on the attached player.
-///
-/// sc_start2 <effect_id>,<duration>,<val1>,<percent chance>{,<unit_id>};
-BUILDIN(sc_start2) {
- struct block_list* bl;
- enum sc_type type;
- int tick;
- int val1;
- int val4 = 0;
- int rate;
+ rate = script_hasdata(st,4+start_type)?min(script_getnum(st,4+start_type),10000):10000;
- type = (sc_type)script_getnum(st,2);
- tick = script_getnum(st,3);
- val1 = script_getnum(st,4);
- rate = script_getnum(st,5);
- if( script_hasdata(st,6) )
- bl = map->id2bl(script_getnum(st,6));
+ if(script_hasdata(st,(6+start_type)))
+ bl = map->id2bl(script_getnum(st,(6+start_type)));
else
bl = map->id2bl(st->rid);
- if( tick == 0 && val1 > 0 && type > SC_NONE && type < SC_MAX && status->sc2skill(type) != 0 ) {
- // When there isn't a duration specified, try to get it from the skill_db
+ if(tick == 0 && val1 > 0 && type > SC_NONE && type < SC_MAX && status->sc2skill(type) != 0)
+ {// When there isn't a duration specified, try to get it from the skill_db
tick = skill->get_time(status->sc2skill(type), val1);
}
- if( script->potion_flag == 1 && script->potion_target ) {
- //skill.c set the flags before running the script, this must be a potion-pitched effect.
+ if(script->potion_flag == 1 && script->potion_target) { //skill.c set the flags before running the script, this is a potion-pitched effect.
bl = map->id2bl(script->potion_target);
tick /= 2;// Thrown potions only last half.
val4 = 1;// Mark that this was a thrown sc_effect
}
- if( bl )
- status->change_start(NULL, bl, type, rate, val1, 0, 0, val4, tick, 2);
-
- return true;
-}
-
-/// Starts a status effect on the target unit or on the attached player.
-///
-/// sc_start4 <effect_id>,<duration>,<val1>,<val2>,<val3>,<val4>{,<unit_id>};
-BUILDIN(sc_start4) {
- struct block_list* bl;
- enum sc_type type;
- int tick;
- int val1;
- int val2;
- int val3;
- int val4;
-
- type = (sc_type)script_getnum(st,2);
- tick = script_getnum(st,3);
- val1 = script_getnum(st,4);
- val2 = script_getnum(st,5);
- val3 = script_getnum(st,6);
- val4 = script_getnum(st,7);
- if( script_hasdata(st,8) )
- bl = map->id2bl(script_getnum(st,8));
- else
- bl = map->id2bl(st->rid);
-
- if( tick == 0 && val1 > 0 && type > SC_NONE && type < SC_MAX && status->sc2skill(type) != 0 ) {
- // When there isn't a duration specified, try to get it from the skill_db
- tick = skill->get_time(status->sc2skill(type), val1);
- }
+ if(!bl)
+ return 0;
- if( script->potion_flag == 1 && script->potion_target ) {
- //skill.c set the flags before running the script, this must be a potion-pitched effect.
- bl = map->id2bl(script->potion_target);
- tick /= 2;// Thrown potions only last half.
+ switch(start_type) {
+ case 1:
+ status->change_start(bl, bl, type, rate, val1, 0, 0, val4, tick, flag);
+ break;
+ case 2:
+ val2 = script_getnum(st,5);
+ status->change_start(bl, bl, type, rate, val1, val2, 0, val4, tick, flag);
+ break;
+ case 4:
+ val2 = script_getnum(st,5);
+ val3 = script_getnum(st,6);
+ val4 = script_getnum(st,7);
+ status->change_start(bl, bl, type, rate, val1, val2, val3, val4, tick, flag);
+ break;
}
-
- if( bl )
- status->change_start(NULL, bl, type, 10000, val1, val2, val3, val4, tick, 2);
-
- return true;
+ return 0;
}
/// Ends one or all status effects on the target unit or on the attached player.
@@ -18926,9 +18888,9 @@ void script_parse_builtin(void) {
BUILDIN_DEF(disablenpc,"s"),
BUILDIN_DEF(hideoffnpc,"s"),
BUILDIN_DEF(hideonnpc,"s"),
- BUILDIN_DEF(sc_start,"iii?"),
- BUILDIN_DEF(sc_start2,"iiii?"),
- BUILDIN_DEF(sc_start4,"iiiiii?"),
+ BUILDIN_DEF(sc_start,"iii???"),
+ BUILDIN_DEF2(sc_start,"sc_start2","iiii???"),
+ BUILDIN_DEF2(sc_start,"sc_start4","iiiiii???"),
BUILDIN_DEF(sc_end,"i?"),
BUILDIN_DEF(getstatus, "i?"),
BUILDIN_DEF(getscrate,"ii?"),
diff --git a/src/map/skill.c b/src/map/skill.c
index b82c47a69..9f008d65b 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -4068,7 +4068,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
case SL_STIN:
case SL_STUN:
if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
- status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,500,10);
+ status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,500,2);
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
@@ -4507,7 +4507,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
tsc->data[SC_MELODYOFSINK] || tsc->data[SC_BEYOND_OF_WARCRY] || tsc->data[SC_UNLIMITED_HUMMING_VOICE] ) &&
rnd()%100 < 4 * skill_lv + 2 * (sd ? pc->checkskill(sd,WM_LESSON) : 10) + 10 * battle->calc_chorusbonus(sd)) {
skill->attack(BF_MISC,src,src,bl,skill_id,skill_lv,tick,flag);
- status->change_start(src,bl,SC_STUN,10000,skill_lv,0,0,0,skill->get_time(skill_id,skill_lv),8);
+ status->change_start(src,bl,SC_STUN,10000,skill_lv,0,0,0,skill->get_time(skill_id,skill_lv),0);
status_change_end(bl, SC_SWING, INVALID_TIMER);
status_change_end(bl, SC_SYMPHONY_LOVE, INVALID_TIMER);
status_change_end(bl, SC_MOONLIT_SERENADE, INVALID_TIMER);
@@ -5184,7 +5184,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case RK_FIGHTINGSPIRIT:
case RK_ABUNDANCE:
if( sd && !pc->checkskill(sd, RK_RUNEMASTERY) ){
- if( status->change_start(src,&sd->bl, (sc_type)(rnd()%SC_CONFUSION), 1000, 1, 0, 0, 0, skill->get_time2(skill_id,skill_lv),8) ){
+ if( status->change_start(src,&sd->bl, (sc_type)(rnd()%SC_CONFUSION), 1000, 1, 0, 0, 0, skill->get_time2(skill_id,skill_lv),0) ){
skill->consume_requirement(sd,skill_id,skill_lv,2);
map->freeblock_unlock();
return 0;
@@ -6213,7 +6213,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
|| dstsd->status.char_id == sd->status.child
)
) {
- status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,500,8);
+ status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,500,0);
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
@@ -7265,7 +7265,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
return 0;
}
else
- status->change_start(src,bl,SC_STUN,10000,skill_lv,0,0,0,skill->get_time2(skill_id,skill_lv),8);
+ status->change_start(src,bl,SC_STUN,10000,skill_lv,0,0,0,skill->get_time2(skill_id,skill_lv),0);
}
break;
@@ -7671,7 +7671,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if (tsce) {
if(sd)
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,10000,8);
+ status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,10000,0);
status_change_end(bl, SC_SWOO, INVALID_TIMER);
break;
}
@@ -7679,7 +7679,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case SL_SKE:
if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,500,10);
+ status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,500,2);
break;
}
clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
@@ -8646,13 +8646,13 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
//If the target was successfully inflected with the Unlucky status, give 1 of 3 random status's.
switch(rnd()%3) {//Targets in the Unlucky status will be affected by one of the 3 random status's regardless of resistance.
case 0:
- status->change_start(src,bl,SC_POISON,10000,skill_lv,0,0,0,skill->get_time(skill_id,skill_lv),10);
+ status->change_start(src,bl,SC_POISON,10000,skill_lv,0,0,0,skill->get_time(skill_id,skill_lv),2);
break;
case 1:
- status->change_start(src,bl,SC_SILENCE,10000,skill_lv,0,0,0,skill->get_time(skill_id,skill_lv),10);
+ status->change_start(src,bl,SC_SILENCE,10000,skill_lv,0,0,0,skill->get_time(skill_id,skill_lv),2);
break;
case 2:
- status->change_start(src,bl,SC_BLIND,10000,skill_lv,0,0,0,skill->get_time(skill_id,skill_lv),10);
+ status->change_start(src,bl,SC_BLIND,10000,skill_lv,0,0,0,skill->get_time(skill_id,skill_lv),2);
}
}
} else if( sd )
@@ -9547,8 +9547,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
heal = 5 * status->get_lv(&hd->bl) + status->base_matk(&hd->battle_status, status->get_lv(&hd->bl));
status->heal(bl, heal, 0, 0);
clif->skill_nodamage(src, src, skill_id, skill_lv, clif->skill_nodamage(src, bl, AL_HEAL, heal, 1));
- status->change_start(src, src, type, 1000, skill_lv, 0, 0, 0, skill->get_time(skill_id,skill_lv), 1|2|8);
- status->change_start(src, bl, type, 1000, skill_lv, 0, 0, 0, skill->get_time(skill_id,skill_lv), 1|2|8);
+ status->change_start(src, src, type, 1000, skill_lv, 0, 0, 0, skill->get_time(skill_id,skill_lv), 1|2);
+ status->change_start(src, bl, type, 1000, skill_lv, 0, 0, 0, skill->get_time(skill_id,skill_lv), 1|2);
}
break;
@@ -11346,7 +11346,7 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick
break;
} else if( sc && battle->check_target(&sg->unit->bl,bl,sg->target_flag) > 0 ) {
int sec = skill->get_time2(sg->skill_id,sg->skill_lv);
- if( status->change_start(ss, bl,type,10000,sg->skill_lv,1,sg->group_id,0,sec,8) ) {
+ if( status->change_start(ss, bl,type,10000,sg->skill_lv,1,sg->group_id,0,sec,0) ) {
const struct TimerData* td = sc->data[type]?timer->get(sc->data[type]->timer):NULL;
if( td )
sec = DIFF_TICK32(td->tick, tick);
@@ -11727,7 +11727,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
case UNT_MANHOLE:
if( sg->val2 == 0 && tsc && (sg->unit_id == UNT_ANKLESNARE || bl->id != sg->src_id) ) {
int sec = skill->get_time2(sg->skill_id,sg->skill_lv);
- if( status->change_start(ss,bl,type,10000,sg->skill_lv,sg->group_id,0,0,sec, 8) ) {
+ if( status->change_start(ss,bl,type,10000,sg->skill_lv,sg->group_id,0,0,sec, 0) ) {
const struct TimerData* td = tsc->data[type]?timer->get(tsc->data[type]->timer):NULL;
if( td )
sec = DIFF_TICK32(td->tick, tick);
@@ -11757,7 +11757,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
if( bl->id != ss->id ) {
if( status_get_mode(bl)&MD_BOSS )
break;
- if( status->change_start(ss,bl,type,10000,sg->skill_lv,sg->group_id,0,0,skill->get_time2(sg->skill_id, sg->skill_lv), 8) ) {
+ if( status->change_start(ss,bl,type,10000,sg->skill_lv,sg->group_id,0,0,skill->get_time2(sg->skill_id, sg->skill_lv), 0) ) {
map->moveblock(bl, src->bl.x, src->bl.y, tick);
clif->fixpos(bl);
@@ -12117,7 +12117,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
case UNT_CLOUD_KILL:
if(tsc && !tsc->data[type])
- status->change_start(ss,bl,type,10000,sg->skill_lv,sg->group_id,0,0,skill->get_time2(sg->skill_id,sg->skill_lv),8);
+ status->change_start(ss,bl,type,10000,sg->skill_lv,sg->group_id,0,0,skill->get_time2(sg->skill_id,sg->skill_lv),0);
skill->attack(skill->get_type(sg->skill_id),ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
break;
@@ -12212,7 +12212,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
case UNT_POISON_MIST:
skill->attack(BF_MAGIC, ss, &src->bl, bl, sg->skill_id, sg->skill_lv, tick, 0);
- status->change_start(ss, bl, SC_BLIND, rnd() % 100 > sg->skill_lv * 10, sg->skill_lv, sg->skill_id, 0, 0, skill->get_time2(sg->skill_id, sg->skill_lv), 2|8);
+ status->change_start(ss, bl, SC_BLIND, rnd() % 100 > sg->skill_lv * 10, sg->skill_lv, sg->skill_id, 0, 0, skill->get_time2(sg->skill_id, sg->skill_lv), 2);
break;
}
diff --git a/src/map/status.c b/src/map/status.c
index 4a2a6c344..718deaefc 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -6294,9 +6294,9 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
int sc_def = 0, tick_def = -1; //-1 = use sc_def
//Linear resistance substracted from rate and tick after percentual resistance was applied
//Example: 25% -> sc_def2=2000 -> 5%; 2500ms -> tick_def2=2000 -> 500ms
- int sc_def2 = 0, tick_def2 = -1; //-1 = use sc_def2 (pre-re only)
+ int sc_def2 = 0, tick_def2 = 0;
- struct status_data *st;
+ struct status_data *st, *bst;
struct status_change *sc;
struct map_session_data *sd;
@@ -6307,14 +6307,8 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
/// Returns the 'bl's level, capped to 'cap'
#define SCDEF_LVL_CAP(bl, cap) ( (bl) ? (status->get_lv(bl) > (cap) ? (cap) : status->get_lv(bl)) : 0 )
-/// Renewal level modifier.
-/// In renewal, returns the difference between the levels of 'bl' and 'src', both capped to 'maxlv', multiplied by 'factor'
-/// In pre-renewal, returns zero.
-#ifdef RENEWAL
+/// returns the difference between the levels of 'bl' and 'src', both capped to 'maxlv', multiplied by 'factor'
#define SCDEF_LVL_DIFF(bl, src, maxlv, factor) ( ( SCDEF_LVL_CAP((bl), (maxlv)) - SCDEF_LVL_CAP((src), (maxlv)) ) * (factor) )
-#else
-#define SCDEF_LVL_DIFF(bl, src, maxlv, factor) 0
-#endif
//Status that are blocked by Golden Thief Bug card or Wand of Hermod
if (status->isimmune(bl))
@@ -6353,6 +6347,7 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
sd = BL_CAST(BL_PC,bl);
st = status->get_status_data(bl);
+ bst = status_get_base_status(bl);
sc = status->get_sc(bl);
if( sc && !sc->count )
sc = NULL;
@@ -6394,7 +6389,6 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
case SC_DPOISON:
sc_def = st->vit*100;
sc_def2 = st->luk*10 + SCDEF_LVL_DIFF(bl, src, 99, 10);
-#ifdef RENEWAL
if (sd) {
//For players: 60000 - 450*vit - 100*luk
tick_def = st->vit*75;
@@ -6404,7 +6398,6 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
tick>>=1;
tick_def = (st->vit*200)/3;
}
-#endif
break;
case SC_SILENCE:
#ifdef RENEWAL
@@ -6428,14 +6421,12 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
case SC_SLEEP:
sc_def = st->int_*100;
sc_def2 = st->luk*10 + SCDEF_LVL_DIFF(bl, src, 99, 10);
-#ifdef RENEWAL
tick_def2 = st->luk*10;
-#endif
break;
case SC_DEEP_SLEEP:
- sc_def = st->int_*50;
+ sc_def = bst->int_*50;
tick_def = 0; // Linear reduction instead
- tick_def2 = st->int_ * 50 + SCDEF_LVL_CAP(bl, 150) * 50; // kRO balance update lists this formula
+ tick_def2 = bst->int_ * 50 + SCDEF_LVL_CAP(bl, 150) * 50; // kRO balance update lists this formula
break;
case SC_DEC_AGI:
case SC_ADORAMUS:
@@ -6451,19 +6442,11 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
sc_def = st->mdef*100;
sc_def2 = st->luk*10 + SCDEF_LVL_DIFF(bl, src, 99, 10);
tick_def = 0; //No duration reduction
-#ifndef RENEWAL
- tick_def2 = 0; //No duration reduction
-#endif
break;
case SC_FREEZE:
sc_def = st->mdef*100;
sc_def2 = st->luk*10 + SCDEF_LVL_DIFF(bl, src, 99, 10);
- tick_def = 0; //No duration reduction
-#ifdef RENEWAL
tick_def2 = status_get_luk(src) * -10; //Caster can increase final duration with luk
-#else
- tick_def2 = 0; //No duration reduction
-#endif
break;
case SC_CURSE:
// Special property: immunity when luk is zero
@@ -6477,24 +6460,17 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
sc_def = st->luk*100;
sc_def2 = st->luk*10 + SCDEF_LVL_DIFF(NULL, src, 99, 10); // Curse only has a level penalty and no resistance
tick_def = st->vit*100;
-#ifdef RENEWAL
tick_def2 = st->luk*10;
-#endif
break;
case SC_BLIND:
sc_def = (st->vit + st->int_)*50;
sc_def2 = st->luk*10 + SCDEF_LVL_DIFF(bl, src, 99, 10);
-#ifdef RENEWAL
tick_def2 = st->luk*10;
-#endif
break;
case SC_CONFUSION:
sc_def = (st->str + st->int_)*50;
sc_def2 = st->luk*10 + SCDEF_LVL_DIFF(bl, src, 99, 10);
-#ifdef RENEWAL
- sc_def2 = -sc_def2; // Reversed sc_def2
tick_def2 = st->luk*10;
-#endif
break;
case SC_ANKLESNARE:
if(st->mode&MD_BOSS) // Lasts 5 times less on bosses
@@ -6506,7 +6482,6 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
if (sd) //Duration greatly reduced for players.
tick /= 15;
sc_def2 = st->vit*25 + st->agi*10 + SCDEF_LVL_CAP(bl, 99) * 20; // Linear Reduction of Rate
- tick_def2 = 0; //No duration reduction
break;
case SC_MARSHOFABYSS:
//5 second (Fixed) + 25 second - {( INT + LUK ) / 20 second }
@@ -6548,10 +6523,10 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
tick_def2 = (st->vit + st->agi) * 70;
break;
case SC_COLD:
- tick_def2 = st->vit*100 + status->get_lv(bl)*20;
+ tick_def2 = bst->vit*100 + status->get_lv(bl)*20;
break;
case SC_VACUUM_EXTREME:
- tick_def2 = st->str*50;
+ tick_def2 = bst->str*50;
break;
case SC_MANDRAGORA:
sc_def = (st->vit + st->luk)*20;
@@ -6612,13 +6587,6 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
//When tick def not set, reduction is the same for both.
if(tick_def == -1)
tick_def = sc_def;
- if(tick_def2 == -1) {
-#ifdef RENEWAL
- tick_def2 = 0;
-#else
- tick_def2 = sc_def2;
-#endif
- }
//Natural resistance
if (!(flag&8)) {
@@ -6751,7 +6719,7 @@ void status_display_remove(struct map_session_data *sd, enum sc_type type) {
* &1: Cannot be avoided (it has to start)
* &2: Tick should not be reduced (by vit, luk, lv, etc)
* &4: sc_data loaded, no value has to be altered.
-* &8: rate should not be reduced
+* &8: SI will not be sent to the client
*------------------------------------------*/
int status_change_start(struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int flag) {
struct map_session_data *sd = NULL;
@@ -7564,10 +7532,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
int i;
for( i = 0; i < 5; i++ ) {
if( sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) )
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, 1);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, 9);
}
} else if( bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) )
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, 1);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, 9);
}
//val4 signals infinite endure (if val4 == 2 it is infinite endure from Berserk)
if( val4 )
@@ -7661,10 +7629,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
int i;
for( i = 0; i < 5; i++ ) {
if( sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) )
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, 1);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, 9);
}
} else if( bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) )
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, 1);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, 9);
}
break;
case SC_NOEQUIPWEAPON:
@@ -7919,11 +7887,11 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if( sd ) {
for( i = 0; i < 5; i++ ) {
if( sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) )
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, 1);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, 9);
}
}
else if( bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) )
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, 1);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, 9);
}
}
break;
@@ -8067,7 +8035,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
while( i >= 0 ) {
type2 = types[i];
if( d_sc->data[type2] )
- sc_start(bl, bl, type2, 100, d_sc->data[type2]->val1, skill->get_time(status->sc2skill(type2),d_sc->data[type2]->val1));
+ status->change_start(bl, bl, type2, 10000, d_sc->data[type2]->val1, 0, 0, 0, skill->get_time(status->sc2skill(type2),d_sc->data[type2]->val1), (type2 != SC_DEFENDER) ? 8 : 0);
i--;
}
}
@@ -8466,7 +8434,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
tick_time = 4000; // [GodLesZ] tick time
break;
case SC_PYREXIA:
- status->change_start(src, bl,SC_BLIND,10000,val1,0,0,0,30000,11); // Blind status that last for 30 seconds
+ status->change_start(src, bl,SC_BLIND,10000,val1,0,0,0,30000,3); // Blind status that last for 30 seconds
val4 = tick / 3000;
tick_time = 3000; // [GodLesZ] tick time
break;
@@ -9476,7 +9444,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
calc_flag&=~SCB_DYE;
}
- if( !(flag&4 && status->DisplayType[type]) )
+ if(!(flag&8) && !(flag&4 && status->DisplayType[type]))
clif->status_change(bl,status->IconChangeTable[type],1,tick,(val_flag&1)?val1:1,(val_flag&2)?val2:0,(val_flag&4)?val3:0);
/**
@@ -11669,7 +11637,7 @@ int status_change_spread( struct block_list *src, struct block_list *bl ) {
data.val2 = sc->data[i]->val2;
data.val3 = sc->data[i]->val3;
data.val4 = sc->data[i]->val4;
- status->change_start(src,bl,(sc_type)i,10000,data.val1,data.val2,data.val3,data.val4,data.tick,1|2|8);
+ status->change_start(src,bl,(sc_type)i,10000,data.val1,data.val2,data.val3,data.val4,data.tick,1|2);
flag = 1;
}
}