Compare commits

...

12 Commits

Author SHA1 Message Date
Daegaladh
8291fce243 Leftovers 2024-04-15 10:41:53 +02:00
Daegaladh
873600fd8b Small mistake 2024-04-15 10:32:00 +02:00
Daegaladh
999daa6e47 Copypaste fail 2024-04-15 10:24:04 +02:00
Daegaladh
e83252bc69 Optimized a big chunk of repetitive code 2024-04-15 10:09:36 +02:00
Daegaladh
e00e97c401 Optimizations 2024-04-13 17:35:47 +02:00
Daegaladh
347e138687 Fix check in Swordsman tutorial quest 2024-04-13 17:04:43 +02:00
Playtester
81894eeba6 Venom Splasher, Venom Knife (#8248)
- Venom Splasher now ignores +% damage cards, but no longer ignores weapon element
- Venom Splasher now uses the correct durations and cooldowns in pre-re (was already correct in renewal)
- Venom Splasher and Venom Knife now correctly use default poison duration
- Venom Splasher and Venom Knife now have a poison chance of 100%
- Fixes #8221
2024-04-12 21:56:39 +02:00
Playtester
9eff7be9cd ATKpercent for monsters (#8246)
- Most NPC skills are now influenced by ATKpercent again
- LK_SPIRALPIERCE is now only not influenced by ATKpercent when used by players
- Introduced a new enum for bonus check flags
- Follow-up to 03f07ab
- Fixes #3538
2024-04-11 18:35:14 +02:00
Playtester
82c37ce32d NPC_POWERUP, NPC_AGIUP (vs. Quagmire) and Dispel (#8243)
- NPC_POWERUP and NPC_AGIUP now grant their own unique status changes
- Duration of NPC_POWERUP is now 5s*level
- Duration of NPC_AGIUP is now 10s*level and max level is back to 10
- Quagmire, Slow Grace and Adoramus now work even when the target used NPC_AGIUP
- NPC_AGIUP will remove Decrease Agi on start but will not prevent it
- NPC_AGIUP can be dispelled, but NPC_POWERUP cannot
- Dispel will now make a monster unlock its target
- Removed custom code to display the NPC_POWERUP effect, it's now correctly linked to EFST_POWERUP
- Removed the ifdef around EXTREMITYFIST2, so we no longer constantly change its ID
- Fixes #8242 
- Fixes #904 
- Fixes #7346
2024-04-10 18:34:49 +02:00
Atemo
c70bc39751 Implemented SC_PERIOD_RECEIVEITEM_2ND and SC_PERIOD_PLUSEXP_2ND (#8197) 2024-04-10 14:01:12 +02:00
Playtester
eb4658f940 Envenom Element Modifier Adjustments (#8237)
- Envenom now applies the attribute table to the final damage again (fixes #8212)
2024-04-09 17:09:23 +02:00
Playtester
03f07ab8c7 Various NPC skill fixes (#8233)
- Fixed the damage type of various NPC skills
- NPC_*BREATH skills and NPC_VAMPIRE_GIFT will now no longer be influenced by ATKpercent
- Fixed NPC_CRITICALSLASH not working in pre-re
- NPC_KEEPING now lasts 30s
- NPC_BARRIER now lasts 15s
- NPC_DEFENDER now lasts 15s, reduces damage by 87.5% and halves movement speed
- Fixes #3538
2024-04-08 20:24:32 +02:00
15 changed files with 404 additions and 1062 deletions

View File

@@ -4998,7 +4998,7 @@ Body:
TargetType: Attack
DamageFlags:
NoDamage: true
IgnoreElement: true
IgnoreAtkCard: true
IgnoreFlee: true
Range: 1
Hit: Single
@@ -5013,26 +5013,47 @@ Body:
CastTime: 1000
Duration1:
- Level: 1
Time: 5000
Time: 11000
- Level: 2
Time: 5500
Time: 10000
- Level: 3
Time: 6000
Time: 9000
- Level: 4
Time: 6500
Time: 8000
- Level: 5
Time: 7000
- Level: 6
Time: 7500
Time: 6000
- Level: 7
Time: 8000
Time: 5000
- Level: 8
Time: 8500
Time: 4000
- Level: 9
Time: 9000
Time: 3000
- Level: 10
Time: 9500
Time: 2000
Duration2: 60000
Cooldown:
- Level: 1
Time: 7500
- Level: 2
Time: 8000
- Level: 3
Time: 8500
- Level: 4
Time: 9000
- Level: 5
Time: 9500
- Level: 6
Time: 10000
- Level: 7
Time: 10500
- Level: 8
Time: 11000
- Level: 9
Time: 11500
- Level: 10
Time: 12000
Requires:
SpCost:
- Level: 1
@@ -5805,8 +5826,8 @@ Body:
- Id: 192
Name: NPC_MAGICALATTACK
Description: Demon Shock Attack
MaxLevel: 10
Type: Weapon
MaxLevel: 1
Type: Magic
TargetType: Attack
Flags:
IsNpc: true
@@ -5912,34 +5933,13 @@ Body:
Name: NPC_KEEPING
Description: Keeping
MaxLevel: 1
Type: Weapon
TargetType: Self
DamageFlags:
NoDamage: true
Flags:
IsNpc: true
HitCount: 1
Duration1:
- Level: 1
Time: 60000
- Level: 2
Time: 70000
- Level: 3
Time: 80000
- Level: 4
Time: 90000
- Level: 5
Time: 100000
- Level: 6
Time: 110000
- Level: 7
Time: 120000
- Level: 8
Time: 130000
- Level: 9
Time: 140000
- Level: 10
Time: 150000
Duration1: 30000
Status: Keeping
- Id: 202
Name: NPC_DARKBREATH
@@ -5979,60 +5979,19 @@ Body:
Flags:
IsNpc: true
HitCount: 1
Duration1:
- Level: 1
Time: 60000
- Level: 2
Time: 70000
- Level: 3
Time: 80000
- Level: 4
Time: 90000
- Level: 5
Time: 100000
- Level: 6
Time: 110000
- Level: 7
Time: 120000
- Level: 8
Time: 130000
- Level: 9
Time: 140000
- Level: 10
Time: 150000
Duration1: 15000
Status: Barrier
- Id: 205
Name: NPC_DEFENDER
Description: Defender
MaxLevel: 1
Type: Weapon
TargetType: Self
DamageFlags:
NoDamage: true
Flags:
IsNpc: true
HitCount: 1
Duration1:
- Level: 1
Time: 60000
- Level: 2
Time: 70000
- Level: 3
Time: 80000
- Level: 4
Time: 90000
- Level: 5
Time: 100000
- Level: 6
Time: 110000
- Level: 7
Time: 120000
- Level: 8
Time: 130000
- Level: 9
Time: 140000
- Level: 10
Time: 150000
Duration1: 15000
Status: Armor
- Id: 206
Name: NPC_LICK
@@ -9398,8 +9357,7 @@ Body:
- Id: 349
Name: NPC_POWERUP
Description: Power Up
MaxLevel: 10
Type: Weapon
MaxLevel: 5
TargetType: Self
DamageFlags:
NoDamage: true
@@ -9408,19 +9366,19 @@ Body:
Hit: Single
Duration1:
- Level: 1
Time: 10000
Time: 5000
- Level: 2
Time: 15000
Time: 10000
- Level: 3
Time: 20000
Time: 15000
- Level: 4
Time: 25000
Time: 20000
- Level: 5
Time: 30000
Status: IncHitRate
Time: 25000
Status: Powerup
- Id: 350
Name: NPC_AGIUP
Description: Agility UP
Description: Agility Up
MaxLevel: 10
TargetType: Self
DamageFlags:
@@ -9432,14 +9390,24 @@ Body:
- Level: 1
Time: 10000
- Level: 2
Time: 15000
- Level: 3
Time: 20000
- Level: 4
Time: 25000
- Level: 5
- Level: 3
Time: 30000
Status: IncFleeRate
- Level: 4
Time: 40000
- Level: 5
Time: 50000
- Level: 6
Time: 60000
- Level: 7
Time: 70000
- Level: 8
Time: 80000
- Level: 9
Time: 90000
- Level: 10
Time: 100000
Status: Agiup
- Id: 351
Name: NPC_SIEGEMODE
Description: Siege Mode
@@ -16995,32 +16963,13 @@ Body:
Skill:
Plagiarism: true
Reproduce: true
Duration2:
- Level: 1
Time: 15000
- Level: 2
Time: 20000
- Level: 3
Time: 25000
- Level: 4
Time: 30000
- Level: 5
Time: 35000
- Level: 6
Time: 40000
- Level: 7
Time: 45000
- Level: 8
Time: 50000
- Level: 9
Time: 55000
- Level: 10
Time: 60000
Duration2: 60000
Requires:
SpCost: 15
Ammo:
Dagger: true
AmmoAmount: 1
Status: Poison
- Id: 1005
Name: RG_CLOSECONFINE
Description: Close Confine

View File

@@ -1130,6 +1130,8 @@ Body:
Watk_Element: true
- Status: Armor
DurationLookup: NPC_DEFENDER
CalcFlags:
Speed: true
- Status: Armor_Element_Water
Icon: EFST_RESIST_PROPERTY_WATER
CalcFlags:
@@ -2057,7 +2059,6 @@ Body:
NoBanishingBuster: true
NoClearance: true
- Status: Inchitrate
DurationLookup: NPC_POWERUP
CalcFlags:
Hit: true
Flags:
@@ -2076,7 +2077,6 @@ Body:
NoBanishingBuster: true
NoClearance: true
- Status: Incfleerate
DurationLookup: NPC_AGIUP
CalcFlags:
Flee: true
Flags:
@@ -7060,3 +7060,25 @@ Body:
NoClearbuff: true
- Status: WeaponBreaker
DurationLookup: NPC_WEAPONBRAKER
- Status: Powerup
Icon: EFST_POWERUP
DurationLookup: NPC_POWERUP
CalcFlags:
Hit: true
Flags:
NoClearbuff: true
NoDispell: true
NoBanishingBuster: true
NoClearance: true
- Status: Agiup
Icon: EFST_AGIUP
DurationLookup: NPC_AGIUP
CalcFlags:
Speed: true
Flee: true
Flags:
NoClearbuff: true
NoBanishingBuster: true
NoClearance: true
EndOnStart:
Decreaseagi: true

View File

@@ -70737,7 +70737,8 @@ Body:
NoMail: true
NoAuction: true
Script: |
/* TODO */
sc_start SC_PERIOD_RECEIVEITEM_2ND,604800000,50;
sc_start SC_PERIOD_PLUSEXP_2ND,604800000,50;
- Id: 100914
AegisName: EXP_Drop_Up_1Hours
Name: Kafra Buff(1 Hour)
@@ -70750,8 +70751,9 @@ Body:
NoGuildStorage: true
NoMail: true
NoAuction: true
# Script: |
# /* TODO */
Script: |
sc_start SC_PERIOD_RECEIVEITEM_2ND,86400000,50;
sc_start SC_PERIOD_PLUSEXP_2ND,86400000,50;
- Id: 100917
AegisName: Hero_Weapon_Hammer_4
Name: Modified Hero's Weapon Refinement Hammer IV
@@ -70859,6 +70861,9 @@ Body:
NoGuildStorage: true
NoMail: true
NoAuction: true
Script: |
sc_start SC_PERIOD_RECEIVEITEM_2ND,86400000,50;
sc_start SC_PERIOD_PLUSEXP_2ND,86400000,50;
- Id: 100950
AegisName: Evt_RagFes_Box
Name: Ragfest Commemorative Box
@@ -73313,6 +73318,9 @@ Body:
NoGuildStorage: true
NoMail: true
NoAuction: true
Script: |
sc_start SC_PERIOD_RECEIVEITEM_2ND,604800000,50;
sc_start SC_PERIOD_PLUSEXP_2ND,604800000,50;
- Id: 101240
AegisName: Season_Evt_Reward_1
Name: January Event's Reward Box

View File

@@ -5243,7 +5243,7 @@ Body:
TargetType: Attack
DamageFlags:
NoDamage: true
IgnoreElement: true
IgnoreAtkCard: true
IgnoreFlee: true
Range: 1
Hit: Single
@@ -5277,7 +5277,7 @@ Body:
Time: 3000
- Level: 10
Time: 2000
Duration2: 20000
Duration2: 18000
Cooldown:
- Level: 1
Time: 7500
@@ -6076,8 +6076,8 @@ Body:
- Id: 192
Name: NPC_MAGICALATTACK
Description: Demon Shock Attack
MaxLevel: 10
Type: Weapon
MaxLevel: 1
Type: Magic
TargetType: Attack
Flags:
IsNpc: true
@@ -6183,34 +6183,13 @@ Body:
Name: NPC_KEEPING
Description: Keeping
MaxLevel: 1
Type: Weapon
TargetType: Self
DamageFlags:
NoDamage: true
Flags:
IsNpc: true
HitCount: 1
Duration1:
- Level: 1
Time: 60000
- Level: 2
Time: 70000
- Level: 3
Time: 80000
- Level: 4
Time: 90000
- Level: 5
Time: 100000
- Level: 6
Time: 110000
- Level: 7
Time: 120000
- Level: 8
Time: 130000
- Level: 9
Time: 140000
- Level: 10
Time: 150000
Duration1: 30000
Status: Keeping
- Id: 202
Name: NPC_DARKBREATH
@@ -6250,60 +6229,19 @@ Body:
Flags:
IsNpc: true
HitCount: 1
Duration1:
- Level: 1
Time: 60000
- Level: 2
Time: 70000
- Level: 3
Time: 80000
- Level: 4
Time: 90000
- Level: 5
Time: 100000
- Level: 6
Time: 110000
- Level: 7
Time: 120000
- Level: 8
Time: 130000
- Level: 9
Time: 140000
- Level: 10
Time: 150000
Duration1: 15000
Status: Barrier
- Id: 205
Name: NPC_DEFENDER
Description: Defender
MaxLevel: 1
Type: Weapon
TargetType: Self
DamageFlags:
NoDamage: true
Flags:
IsNpc: true
HitCount: 1
Duration1:
- Level: 1
Time: 60000
- Level: 2
Time: 70000
- Level: 3
Time: 80000
- Level: 4
Time: 90000
- Level: 5
Time: 100000
- Level: 6
Time: 110000
- Level: 7
Time: 120000
- Level: 8
Time: 130000
- Level: 9
Time: 140000
- Level: 10
Time: 150000
Duration1: 15000
Status: Armor
- Id: 206
Name: NPC_LICK
@@ -9708,8 +9646,7 @@ Body:
- Id: 349
Name: NPC_POWERUP
Description: Power Up
MaxLevel: 10
Type: Weapon
MaxLevel: 5
TargetType: Self
DamageFlags:
NoDamage: true
@@ -9718,19 +9655,19 @@ Body:
Hit: Single
Duration1:
- Level: 1
Time: 10000
Time: 5000
- Level: 2
Time: 15000
Time: 10000
- Level: 3
Time: 20000
Time: 15000
- Level: 4
Time: 25000
Time: 20000
- Level: 5
Time: 30000
Status: IncHitRate
Time: 25000
Status: Powerup
- Id: 350
Name: NPC_AGIUP
Description: Agility UP
Description: Agility Up
MaxLevel: 10
TargetType: Self
DamageFlags:
@@ -9742,14 +9679,24 @@ Body:
- Level: 1
Time: 10000
- Level: 2
Time: 15000
- Level: 3
Time: 20000
- Level: 4
Time: 25000
- Level: 5
- Level: 3
Time: 30000
Status: IncFleeRate
- Level: 4
Time: 40000
- Level: 5
Time: 50000
- Level: 6
Time: 60000
- Level: 7
Time: 70000
- Level: 8
Time: 80000
- Level: 9
Time: 90000
- Level: 10
Time: 100000
Status: Agiup
- Id: 351
Name: NPC_SIEGEMODE
Description: Siege Mode
@@ -18560,32 +18507,13 @@ Body:
Skill:
Plagiarism: true
Reproduce: true
Duration2:
- Level: 1
Time: 15000
- Level: 2
Time: 20000
- Level: 3
Time: 25000
- Level: 4
Time: 30000
- Level: 5
Time: 35000
- Level: 6
Time: 40000
- Level: 7
Time: 45000
- Level: 8
Time: 50000
- Level: 9
Time: 55000
- Level: 10
Time: 60000
Duration2: 18000
Requires:
SpCost: 35
Ammo:
Dagger: true
AmmoAmount: 1
Status: Poison
- Id: 1005
Name: RG_CLOSECONFINE
Description: Close Confine

View File

@@ -1148,6 +1148,8 @@ Body:
Watk_Element: true
- Status: Armor
DurationLookup: NPC_DEFENDER
CalcFlags:
Speed: true
- Status: Armor_Element_Water
Icon: EFST_RESIST_PROPERTY_WATER
CalcFlags:
@@ -2170,7 +2172,6 @@ Body:
NoBanishingBuster: true
NoClearance: true
- Status: Inchitrate
DurationLookup: NPC_POWERUP
CalcFlags:
Hit: true
Flags:
@@ -2189,7 +2190,6 @@ Body:
NoBanishingBuster: true
NoClearance: true
- Status: Incfleerate
DurationLookup: NPC_AGIUP
CalcFlags:
Flee: true
Flags:
@@ -8895,3 +8895,43 @@ Body:
NoBanishingBuster: true
NoDispell: true
NoClearance: true
- Status: Period_Receiveitem_2nd
Icon: EFST_PERIOD_RECEIVEITEM_2ND
Flags:
NoRemoveOnDead: true
NoClearbuff: true
NoDispell: true
NoBanishingBuster: true
NoClearance: true
SendVal1: true
- Status: Period_Plusexp_2nd
Icon: EFST_PERIOD_PLUSEXP_2ND
Flags:
NoRemoveOnDead: true
NoClearbuff: true
NoDispell: true
NoBanishingBuster: true
NoClearance: true
SendVal1: true
- Status: Powerup
Icon: EFST_POWERUP
DurationLookup: NPC_POWERUP
CalcFlags:
Hit: true
Flags:
NoClearbuff: true
NoDispell: true
NoBanishingBuster: true
NoClearance: true
- Status: Agiup
Icon: EFST_AGIUP
DurationLookup: NPC_AGIUP
CalcFlags:
Speed: true
Flee: true
Flags:
NoClearbuff: true
NoBanishingBuster: true
NoClearance: true
EndOnStart:
Decreaseagi: true

View File

@@ -2832,3 +2832,13 @@ SC_WEAPONBREAKER
desc: Bonus given when using NPC_WEAPONBRAKER skill
val1: Skill level
val2: val1 * 2 weapon break chance
SC_POWERUP
desc: Increases ATKpercent and Hit.
val1: + ATKpercent
val2: +% Hit
SC_AGIUP
desc: Increase Speed and Flee.
val1: +% Walkspeed
val2: +% Flee

File diff suppressed because it is too large Load Diff

View File

@@ -1762,7 +1762,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if((sce=tsc->getSCE(SC_ARMOR)) && //NPC_DEFENDER
sce->val3&flag && sce->val4&flag)
damage -= damage * tsc->getSCE(SC_ARMOR)->val2 / 100;
damage /= tsc->getSCE(SC_ARMOR)->val2;
if( tsc->getSCE(SC_ENERGYCOAT) && (skill_id == GN_HELLS_PLANT_ATK ||
#ifdef RENEWAL
@@ -2932,10 +2932,9 @@ static bool is_attack_critical(struct Damage* wd, struct block_list *src, struct
if (!first_call)
return (wd->type == DMG_CRITICAL || wd->type == DMG_MULTI_HIT_CRITICAL);
#ifdef RENEWAL
if (skill_id == NPC_CRITICALSLASH || skill_id == LG_PINPOINTATTACK) //Always critical skills
return true;
#endif
if( skill_id && !skill_get_nk(skill_id,NK_CRITICAL) )
return false;
@@ -3360,35 +3359,37 @@ static bool attack_ignores_def(struct Damage* wd, struct block_list *src, struct
/**
* This function lists which skills are unaffected by refine bonus, masteries, Star Crumbs and Spirit Spheres
* This function is also used to determine if atkpercent applies
* @param src: Source of the attack
* @param skill_id: Skill being used
* @param type 1 - Checking refine bonus; 2 - Checking Star Crumb bonus
* @param chk_flag: The bonus that is currently being checked for, see e_bonus_chk_flag
* @return true = bonus applies; false = bonus does not apply
*/
static bool battle_skill_stacks_masteries_vvs(uint16 skill_id, int type)
static bool battle_skill_stacks_masteries_vvs(struct block_list &src, uint16 skill_id, e_bonus_chk_flag chk_flag)
{
switch (skill_id) {
// PC skills that are unaffected
case PA_SHIELDCHAIN:
case CR_SHIELDBOOMERANG:
case AM_ACIDTERROR:
case MO_INVESTIGATE:
case MO_EXTREMITYFIST:
case PA_SACRIFICE:
case NPC_DRAGONBREATH:
case RK_DRAGONBREATH:
case RK_DRAGONBREATH_WATER:
case NC_SELFDESTRUCTION:
case LG_SHIELDPRESS:
case LG_EARTHDRIVE:
case NPC_DRAGONBREATH:
return false;
case CR_GRANDCROSS:
case NPC_GRANDDARKNESS:
// Grand Cross is influenced by refine bonus but not by atkpercent / masteries / Star Crumbs / Spirit Spheres
if (type != 1)
if (chk_flag != BCHK_REFINE)
return false;
break;
case LK_SPIRALPIERCE:
// Spiral Pierce is influenced only by refine bonus and Star Crumbs
if (type != 1 && type != 2)
// Spiral Pierce is influenced only by refine bonus and Star Crumbs for players
if (src.type == BL_PC && chk_flag != BCHK_REFINE && chk_flag != BCHK_STAR)
return false;
break;
}
@@ -3732,11 +3733,11 @@ static void battle_calc_element_damage(struct Damage* wd, struct block_list *src
status_change* sc = status_get_sc(src);
struct status_data* sstatus = status_get_status_data(src);
struct status_data* tstatus = status_get_status_data(target);
int right_element = battle_get_weapon_element(wd, src, target, skill_id, skill_lv, EQI_HAND_R, true);
// Elemental attribute fix
if(!nk[NK_IGNOREELEMENT] && (wd->damage > 0 || wd->damage2 > 0)) {
int left_element = battle_get_weapon_element(wd, src, target, skill_id, skill_lv, EQI_HAND_L, true);
int right_element = battle_get_weapon_element(wd, src, target, skill_id, skill_lv, EQI_HAND_R, true);
switch (skill_id) {
case PA_SACRIFICE:
@@ -3788,18 +3789,21 @@ static void battle_calc_element_damage(struct Damage* wd, struct block_list *src
// These mastery bonuses are non-elemental and should apply even if the attack misses
// They are still increased by the EDP/Magnum Break bonus damage (WATK_ELEMENT)
// In renewal these bonuses do not apply when the attack misses
if (sd && battle_skill_stacks_masteries_vvs(skill_id, 2)) {
if (sd && battle_skill_stacks_masteries_vvs(*src, skill_id, BCHK_STAR)) {
// Star Crumb bonus damage
ATK_ADD2(wd->damage, wd->damage2, sd->right_weapon.star, sd->left_weapon.star);
}
// Check if general mastery bonuses apply (above check is only for Star Crumb)
if (battle_skill_stacks_masteries_vvs(skill_id, 0)) {
if (battle_skill_stacks_masteries_vvs(*src, skill_id, BCHK_ALL)) {
// Spirit Sphere bonus damage
ATK_ADD(wd->damage, wd->damage2, battle_get_spiritball_damage(*wd, *src, skill_id));
// Skill-specific bonuses
if (skill_id == TF_POISON)
if (skill_id == TF_POISON) {
ATK_ADD(wd->damage, wd->damage2, 15 * skill_lv);
// Envenom applies the attribute table to the base damage and then again to the final damage
wd->damage = battle_attr_fix(src, target, wd->damage, right_element, tstatus->def_ele, tstatus->ele_lv, 1);
}
}
// These bonuses do not apply to skills that ignore element, unit skills and skills that have their own base damage formula
@@ -3851,7 +3855,7 @@ static void battle_calc_attack_masteries(struct Damage* wd, struct block_list *s
}
// Check if mastery damage applies to current skill
if (sd && battle_skill_stacks_masteries_vvs(skill_id, 0))
if (sd && battle_skill_stacks_masteries_vvs(*src, skill_id, BCHK_ALL))
{ //Add mastery damage
uint16 skill;
@@ -4436,7 +4440,7 @@ static void battle_calc_multi_attack(struct Damage* wd, struct block_list *src,s
*/
static unsigned short battle_get_atkpercent(struct block_list& bl, uint16 skill_id, status_change& sc)
{
if (!battle_skill_stacks_masteries_vvs(skill_id, 0))
if (!battle_skill_stacks_masteries_vvs(bl, skill_id, BCHK_ALL))
return 100;
int atkpercent = 100;
@@ -4455,6 +4459,8 @@ static unsigned short battle_get_atkpercent(struct block_list& bl, uint16 skill_
atkpercent -= 25;
if (sc.getSCE(SC_INCATKRATE))
atkpercent += sc.getSCE(SC_INCATKRATE)->val1;
if (sc.getSCE(SC_POWERUP))
atkpercent += sc.getSCE(SC_POWERUP)->val1;
if (sc.getSCE(SC_SKE))
atkpercent += 300;
if (sc.getSCE(SC_BLOODLUST))
@@ -6687,7 +6693,7 @@ static void battle_calc_attack_post_defense(struct Damage* wd, struct block_list
#ifndef RENEWAL
//Refine bonus
if (sd) {
if (battle_skill_stacks_masteries_vvs(skill_id, 1)) {
if (battle_skill_stacks_masteries_vvs(*src, skill_id, BCHK_REFINE)) {
ATK_ADD2(wd->damage, wd->damage2, sstatus->rhw.atk2, sstatus->lhw.atk2);
}
wd->basedamage += sstatus->rhw.atk2;

View File

@@ -79,6 +79,13 @@ enum e_battle_check_target : uint32 {
BCT_FRIEND = BCT_NOENEMY,
};
/// Check flag for common damage bonuses such as: ATKpercent, Refine, Passive Mastery, Spirit Spheres and Star Crumbs
enum e_bonus_chk_flag : uint8 {
BCHK_ALL, /// Check if all of the common damage bonuses apply to this skill
BCHK_REFINE, /// Check if refine bonus is applied (pre-renewal only currently)
BCHK_STAR, /// Check if Star Crumb bonus is applied (pre-renewal only currently)
};
/// Damage structure
struct Damage {
#ifdef RENEWAL

View File

@@ -2492,6 +2492,8 @@ int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int b
if (sd->sc.getSCE(SC_ITEMBOOST))
drop_rate_bonus += sd->sc.getSCE(SC_ITEMBOOST)->val1;
if (sd->sc.getSCE(SC_PERIOD_RECEIVEITEM_2ND))
drop_rate_bonus += sd->sc.getSCE(SC_PERIOD_RECEIVEITEM_2ND)->val1;
int cap;

View File

@@ -8222,6 +8222,9 @@ static void pc_calcexp(map_session_data *sd, t_exp *base_exp, t_exp *job_exp, st
bonus += (sd->sc.getSCE(SC_EXPBOOST)->val1 / battle_config.vip_bm_increase);
}
if (sd->sc.getSCE(SC_PERIOD_PLUSEXP_2ND))
bonus += sd->sc.getSCE(SC_PERIOD_PLUSEXP_2ND)->val1;
if (*base_exp) {
t_exp exp = (t_exp)(*base_exp + ((double)*base_exp * ((bonus + vip_bonus_base) / 100.)));
*base_exp = cap_value(exp, 1, MAX_EXP);
@@ -8231,6 +8234,9 @@ static void pc_calcexp(map_session_data *sd, t_exp *base_exp, t_exp *job_exp, st
if (sd->sc.getSCE(SC_JEXPBOOST))
bonus += sd->sc.getSCE(SC_JEXPBOOST)->val1;
if (sd->sc.getSCE(SC_PERIOD_PLUSEXP_2ND)) // Increase Jexp as well
bonus += sd->sc.getSCE(SC_PERIOD_PLUSEXP_2ND)->val1;
if (*job_exp) {
t_exp exp = (t_exp)(*job_exp + ((double)*job_exp * ((bonus + vip_bonus_job) / 100.)));
*job_exp = cap_value(exp, 1, MAX_EXP);

View File

@@ -1910,10 +1910,11 @@
export_constant(SC_GRENADE_FRAGMENT_6);
export_constant(SC_AUTO_FIRING_LAUNCHER);
export_constant(SC_HIDDEN_CARD);
#ifdef RENEWAL
export_constant(SC_PERIOD_RECEIVEITEM_2ND);
export_constant(SC_PERIOD_PLUSEXP_2ND);
export_constant(SC_EXTREMITYFIST2);
#endif
export_constant(SC_POWERUP);
export_constant(SC_AGIUP);
/* status icons */
export_deprecated_constant2("SI_BLANK",-1);

View File

@@ -1422,15 +1422,13 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl, uint
break;
case AS_VENOMKNIFE:
if (sd) //Poison chance must be that of Envenom. [Skotlex]
skill_lv = pc_checkskill(sd, TF_POISON);
[[fallthrough]];
case TF_POISON:
case AS_SPLASHER:
if(!sc_start2(src,bl,SC_POISON,(4*skill_lv+10),skill_lv,src->id,skill_get_time2(skill_id,skill_lv))
&& sd && skill_id==TF_POISON
)
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
sc_start2(src, bl, SC_POISON, 100, skill_lv, src->id, skill_get_time2(skill_id, skill_lv));
break;
case TF_POISON:
if (!sc_start2(src, bl, SC_POISON, (4 * skill_lv + 10), skill_lv, src->id, skill_get_time2(skill_id, skill_lv)) && sd)
clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
break;
case AS_SONICBLOW:
@@ -6200,7 +6198,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
break;
case NPC_MAGICALATTACK:
skill_attack(BF_MAGIC,src,src,bl,skill_id,skill_lv,tick,flag);
skill_attack(skill_get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, flag);
sc_start(src,src,SC_MAGICALATTACK,100,skill_lv,skill_get_time(skill_id,skill_lv));
break;
@@ -9651,6 +9649,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
//Remove bonus_script by Dispell
if (dstsd)
pc_bonus_script_clear(dstsd,BSF_REM_ON_DISPELL);
// Monsters will unlock their target instead
else if (dstmd)
mob_unlocktarget(dstmd, tick);
if(!tsc || !tsc->count)
break;
@@ -9997,15 +9998,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case NPC_POWERUP:
sc_start(src,bl,SC_INCATKRATE,100,200,skill_get_time(skill_id, skill_lv));
clif_skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(src,bl,type,100,100,skill_get_time(skill_id, skill_lv)));
sc_start2(src,bl,type,100,200,100,skill_get_time(skill_id, skill_lv)));
break;
case NPC_AGIUP:
sc_start(src,bl,SC_SPEEDUP1,100,50,skill_get_time(skill_id, skill_lv));
clif_skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(src,bl,type,100,100,skill_get_time(skill_id, skill_lv)));
sc_start2(src,bl,type,100,50,100,skill_get_time(skill_id, skill_lv)));
break;
case NPC_INVISIBLE:
@@ -10253,9 +10252,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}
clif_skill_nodamage(src,bl,skill_id,skill_lv,
sc_start4(src,bl,type,100,skill_lv,skill_id,src->id,skill_get_time(skill_id,skill_lv),1000));
#ifndef RENEWAL
if (sd) skill_blockpc_start (sd, skill_id, skill_get_time(skill_id, skill_lv)+3000);
#endif
break;
case PF_MINDBREAKER:

View File

@@ -7403,6 +7403,8 @@ static signed short status_calc_hit(struct block_list *bl, status_change *sc, in
hit += sc->getSCE(SC_MTF_HITFLEE)->val1;
if(sc->getSCE(SC_INCHITRATE))
hit += hit * sc->getSCE(SC_INCHITRATE)->val1/100;
if (sc->getSCE(SC_POWERUP))
hit += hit * sc->getSCE(SC_POWERUP)->val2 / 100;
if(sc->getSCE(SC_BLIND))
hit -= hit * 25/100;
if(sc->getSCE(SC_HEAT_BARREL))
@@ -7519,6 +7521,8 @@ static signed short status_calc_flee(struct block_list *bl, status_change *sc, i
// Rate value
if(sc->getSCE(SC_INCFLEERATE))
flee += flee * sc->getSCE(SC_INCFLEERATE)->val1/100;
if (sc->getSCE(SC_AGIUP))
flee += flee * sc->getSCE(SC_AGIUP)->val2 / 100;
if(sc->getSCE(SC_SPIDERWEB) || sc->getSCE(SC_WIDEWEB))
flee -= flee * 50/100;
if(sc->getSCE(SC_BERSERK))
@@ -8012,8 +8016,10 @@ static unsigned short status_calc_speed(struct block_list *bl, status_change *sc
speed_rate = 150;
// GetMoveHasteValue1()
if( sc->getSCE(SC_SPEEDUP1) ) // !FIXME: used both by NPC_AGIUP and Speed Potion script
if( sc->getSCE(SC_SPEEDUP1) )
val = max( val, sc->getSCE(SC_SPEEDUP1)->val1 );
if (sc->getSCE(SC_AGIUP))
val = max(val, sc->getSCE(SC_AGIUP)->val1);
if( sc->getSCE(SC_INCREASEAGI) )
val = max( val, 25 );
if( sc->getSCE(SC_WINDWALK) )
@@ -8081,6 +8087,8 @@ static unsigned short status_calc_speed(struct block_list *bl, status_change *sc
speed = 200;
if( sc->getSCE(SC_DEFENDER) )
speed = max(speed, 200);
if (sc->getSCE(SC_ARMOR))
speed = max(speed, 200);
if( sc->getSCE(SC_WALKSPEED) && sc->getSCE(SC_WALKSPEED)->val1 > 0 ) // ChangeSpeed
speed = speed * 100 / sc->getSCE(SC_WALKSPEED)->val1;
@@ -11467,7 +11475,7 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
break;
case SC_ARMOR:
// NPC_DEFENDER:
val2 = 80; // Damage reduction
val2 = 8; // Damage will be divided by this value
// Attack requirements to be blocked:
val3 = BF_LONG; // Range
val4 = BF_WEAPON|BF_MISC; // Type
@@ -11511,8 +11519,10 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
case SC_EXPBOOST:
case SC_JEXPBOOST:
case SC_JP_EVENT04:
if (val1 < 0)
val1 = 0;
case SC_PERIOD_RECEIVEITEM_2ND:
case SC_PERIOD_PLUSEXP_2ND:
if (val1 < 1)
return 0;
break;
case SC_INCFLEE2:
case SC_INCCRI:
@@ -12884,13 +12894,6 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
if ((val1&0xFFFF) == CG_MOONLIT)
sc->opt3 |= OPT3_MOONLIT;
break;
case SC_INCATKRATE:
// Simulate Explosion Spirits effect for NPC_POWERUP [Skotlex]
if (bl->type != BL_MOB) {
disable_opt_flag = true;
break;
}
break;
}
// On Aegis, when turning on a status change, first goes the option packet, then the sc packet.

View File

@@ -1304,10 +1304,13 @@ enum sc_type : int16 {
SC_GRENADE_FRAGMENT_6,
SC_AUTO_FIRING_LAUNCHER,
SC_HIDDEN_CARD,
SC_PERIOD_RECEIVEITEM_2ND,
SC_PERIOD_PLUSEXP_2ND,
SC_EXTREMITYFIST2,
SC_POWERUP,
SC_AGIUP,
#ifdef RENEWAL
SC_EXTREMITYFIST2, //! NOTE: This SC should be right before SC_MAX, so it doesn't disturb if RENEWAL is disabled
#endif
SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
};