summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c45
-rw-r--r--src/map/itemdb.h1
-rw-r--r--src/map/script.c2
-rw-r--r--src/map/skill.c24
-rw-r--r--src/map/status.c21
-rw-r--r--src/map/status.h1
6 files changed, 73 insertions, 21 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 02fe69beb..558e90a08 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1596,6 +1596,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
wd.damage = sstatus->max_hp* 9/100;
wd.damage2 = 0;
break;
+#ifndef RENEWAL
case LK_SPIRALPIERCE:
case ML_SPIRALPIERCE:
if (sd) {
@@ -1622,6 +1623,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
break;
}
break;
+#endif
case CR_SHIELDBOOMERANG:
case PA_SHIELDCHAIN:
case LG_SHIELDPRESS:
@@ -2419,6 +2421,9 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
}
}
//Div fix.
+#ifdef RENEWAL
+ if( skill_num != LK_SPIRALPIERCE && skill_num != ML_SPIRALPIERCE)
+#endif
damage_div_fix(wd.damage, wd.div_);
//The following are applied on top of current damage and are stackable.
@@ -2590,12 +2595,41 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
flag.idef2||flag.pdef2?0:-vit_def
);
}
-
+#ifdef RENEWAL
+ /**
+ * Racial/Size and etc modifications should not work with this formula(only the ATK is affected w/ mods) except for now, since RE ATK formula is not yet fully implemented in rA. [malufett]
+ * Formula: Floor[Floor(Weapon Weight/2)*skill level + ATK ]*(100%+50%*s.lvl) * 5 multi-hits
+ **/
+ if( skill_num == LK_SPIRALPIERCE || skill_num == ML_SPIRALPIERCE)
+ {
+ short index = sd?sd->equip_index[EQI_HAND_R]:0;
+ int weight = sstatus->rhw.atk2;
+
+ if (sd && index >= 0 &&
+ sd->inventory_data[index] &&
+ sd->inventory_data[index]->type == IT_WEAPON)
+ weight = sd->inventory_data[index]->weight/20;
+
+ ATK_ADD(weight * skill_lv);
+ ATK_RATE(100+50*skill_lv);
+
+ damage_div_fix(wd.damage, wd.div_);
+ }
+#endif
//Post skill/vit reduction damage increases
- if( sc && skill_num != LK_SPIRALPIERCE && skill_num != ML_SPIRALPIERCE )
+ if( sc )
{ //SC skill damages
- if(sc->data[SC_AURABLADE])
- ATK_ADD(20*sc->data[SC_AURABLADE]->val1);
+ if(sc->data[SC_AURABLADE]
+#ifndef RENEWAL
+ && skill_num != LK_SPIRALPIERCE && skill_num != ML_SPIRALPIERCE
+#endif
+ ){
+ int lv = sc->data[SC_AURABLADE]->val1;
+#ifdef RENEWAL
+ lv *= ((skill_num == LK_SPIRALPIERCE || skill_num == ML_SPIRALPIERCE)?wd.div_:1); // +100 per hit in lv 5
+#endif
+ ATK_ADD(20*lv);
+ }
}
//Refine bonus
@@ -3913,9 +3947,6 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
case GN_THORNS_TRAP:
md.damage = 100 + 200 * skill_lv + sstatus->int_;
break;
- case GN_BLOOD_SUCKER:
- md.damage = 200 + 100 * skill_lv + sstatus->int_;
- break;
case GN_HELLS_PLANT_ATK:
md.damage = sstatus->int_ * 4 * skill_lv * (10 / (10 - pc_checkskill(sd,AM_CANNIBALIZE)));//Need accurate official formula. [Rytech]
break;
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 390954e3f..5471fe7e6 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -161,6 +161,7 @@ struct item_data* itemdb_exists(int nameid);
#define itemid_isgemstone(id) ( (id) >= ITEMID_YELLOW_GEMSTONE && (id) <= ITEMID_BLUE_GEMSTONE )
#define itemdb_iscashfood(id) ( (id) >= 12202 && (id) <= 12207 )
#define itemdb_is_GNbomb(n) (n >= 13260 && n <= 13267)
+#define itemdb_is_GNthrowable(n) (n >= 13268 && n <= 13290)
const char* itemdb_typename(int type);
int itemdb_group_bonus(struct map_session_data* sd, int itemid);
diff --git a/src/map/script.c b/src/map/script.c
index 41507e5c4..8dc7ea3da 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -16380,7 +16380,7 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(checkriding,""),
BUILDIN_DEF(checkwug,""),
BUILDIN_DEF(checkmadogear,""),
- BUILDIN_DEF(setmadogear,""),
+ BUILDIN_DEF(setmadogear,"?"),
BUILDIN_DEF2(savepoint,"save","sii"),
BUILDIN_DEF(savepoint,"sii"),
BUILDIN_DEF(gettimetick,"i"),
diff --git a/src/map/skill.c b/src/map/skill.c
index f373ab08f..d997f97b6 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -3885,7 +3885,6 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
case GS_FLING:
case NJ_ZENYNAGE:
case GN_THORNS_TRAP:
- case GN_BLOOD_SUCKER:
case GN_HELLS_PLANT_ATK:
skill_attack(BF_MISC,src,src,bl,skillid,skilllv,tick,flag);
break;
@@ -8424,12 +8423,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
case GN_BLOOD_SUCKER:
- if( skill_unitsetting(src, skillid, skilllv, bl->x, bl->y, 0) ) { // Do we need this unit setting? [Xazax]
- clif_skill_nodamage(src, bl, skillid, skilllv, 1);
- sc_start2(bl, type, 100, skilllv, src->id, skill_get_time(skillid,skilllv));
- } else if( sd ) {
- clif_skill_fail(sd, skillid, USESKILL_FAIL_LEVEL, 0);
- break;
+ {
+ struct status_change *sc = status_get_sc(src);
+
+ if( sc && sc->bs_counter < skill_get_maxcount( skillid , skilllv) ) {
+ if( tsc && tsc->data[type] ){
+ (sc->bs_counter)--;
+ status_change_end(src, type, INVALID_TIMER); // the first one cancels and the last one will take effect resetting the timer
+ }
+ clif_skill_nodamage(src, bl, skillid, skilllv, 1);
+ sc_start2(bl, type, 100, skilllv, src->id, skill_get_time(skillid,skilllv));
+ (sc->bs_counter)++;
+ } else if( sd ) {
+ clif_skill_fail(sd, skillid, USESKILL_FAIL_LEVEL, 0);
+ break;
+ }
}
break;
@@ -8461,7 +8469,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
skill_attack(BF_WEAPON,src,src,bl,GN_SLINGITEM_RANGEMELEEATK,skilllv,tick,flag);
} else //Otherwise, it fails, shows animation and removes items.
clif_skill_fail(sd,GN_SLINGITEM_RANGEMELEEATK,0xa,0);
- } else {
+ } else if( itemdb_is_GNthrowable(ammo_id) ){
struct script_code *script = sd->inventory_data[i]->script;
if( !script )
break;
diff --git a/src/map/status.c b/src/map/status.c
index ee9ef88ea..c52ead56d 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -669,7 +669,7 @@ void initChangeTables(void)
**/
set_sc( GN_CARTBOOST , SC_GN_CARTBOOST, SI_CARTSBOOST , SCB_SPEED );
set_sc( GN_THORNS_TRAP , SC_THORNSTRAP , SI_THORNTRAP , SCB_NONE );
- set_sc( GN_BLOOD_SUCKER , SC_BLOODSUCKER , SI_BLOODSUCKER , SCB_NONE );
+ set_sc_with_vfx( GN_BLOOD_SUCKER , SC_BLOODSUCKER , SI_BLOODSUCKER , SCB_NONE );
set_sc( GN_WALLOFTHORN , SC_STOP , SI_BLANK , SCB_NONE );
set_sc( GN_FIRE_EXPANSION_SMOKE_POWDER, SC_SMOKEPOWDER , SI_FIRE_EXPANSION_SMOKE_POWDER, SCB_NONE );
set_sc( GN_FIRE_EXPANSION_TEAR_GAS , SC_TEARGAS , SI_FIRE_EXPANSION_TEAR_GAS , SCB_NONE );
@@ -2472,7 +2472,8 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
if(sd->inventory_data[index]){ // Arrows
sd->arrow_atk += sd->inventory_data[index]->atk;
sd->state.lr_flag = 2;
- run_script(sd->inventory_data[index]->script,0,sd->bl.id,0);
+ if( !itemdb_is_GNthrowable(sd->inventory_data[index]->nameid) ) //don't run scripts on throwable items
+ run_script(sd->inventory_data[index]->script,0,sd->bl.id,0);
sd->state.lr_flag = 0;
if (!calculating) //Abort, run_script retriggered status_calc_pc. [Skotlex]
return 1;
@@ -8809,6 +8810,15 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
case SC_CURSEDCIRCLE_TARGET:
clif_bladestop(bl, sce->val2, 0);
break;
+ case SC_BLOODSUCKER:
+ if( sce->val2 ){
+ struct block_list *src = map_id2bl(sce->val2);
+ if(src){
+ struct status_change *sc = status_get_sc(src);
+ sc->bs_counter--;
+ }
+ }
+ break;
}
opt_flag = 1;
@@ -9615,13 +9625,14 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
if( !src || (src && (status_isdead(src) || src->m != bl->m || distance_bl(src, bl) >= 12)) )
break;
map_freeblock_lock();
- damage = skill_attack(skill_get_type(GN_BLOOD_SUCKER), src, src, bl, GN_BLOOD_SUCKER, sce->val1, tick, 0);
+ damage = 200 + 100 * sce->val1 + status_get_int(src);
+ status_damage(src, bl, damage, 0, clif_damage(bl,bl,tick,status->amotion,status->dmotion+200,damage,1,0,0), 1);
+ unit_skillcastcancel(bl,1);
if ( sc->data[type] ) {
sc_timer_next(1000 + tick, status_change_timer, bl->id, data);
}
map_freeblock_unlock();
- status_heal(src, damage, 0, 0);
- clif_skill_nodamage(src, bl, GN_BLOOD_SUCKER, 0, 1);
+ status_heal(src, damage*(5 + 5 * sce->val1)/100, 0, 0); // 5 + 5% per level
return 0;
}
break;
diff --git a/src/map/status.h b/src/map/status.h
index b414b46db..56a019682 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -1564,6 +1564,7 @@ struct status_change {
#ifndef RENEWAL
unsigned char sg_counter; //Storm gust counter (previous hits from storm gust)
#endif
+ unsigned char bs_counter; // Blood Sucker counter
struct status_change_entry *data[SC_MAX];
};