Skip to content

Commit

Permalink
mod SPIKES_BONUS and add to duelists tights
Browse files Browse the repository at this point in the history
  • Loading branch information
overefined committed Oct 18, 2023
1 parent 796bf9d commit 4898ede
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
1 change: 1 addition & 0 deletions scripts/enum/mod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ xi.mod =
SPIKES_DMG = 344,
TP_BONUS = 345,
PERPETUATION_REDUCTION = 346,
SPIKES_BONUS = 1080, -- Increases spikes damage by percentage (e.g. mod value 50 = +50% spikes damage)

-- Warrior
BERSERK_POTENCY = 948, -- Augments "Berserk"/Enhances "Berserk" effect (Conqueror)
Expand Down
3 changes: 3 additions & 0 deletions sql/item_mods.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2851,6 +2851,7 @@ INSERT INTO `item_mods` VALUES (10714,9,8); -- DEX: 8
INSERT INTO `item_mods` VALUES (10714,12,8); -- INT: 8
INSERT INTO `item_mods` VALUES (10714,115,15); -- ELEM: 15
INSERT INTO `item_mods` VALUES (10714,500,5); -- ITEM_ADDEFFECT_DMG: 5
INSERT INTO `item_mods` VALUES (10714,1080,1); -- Enhances effect of "Spikes" spells

-- Assassins Culottes +2
INSERT INTO `item_mods` VALUES (10715,1,44); -- DEF: 44
Expand Down Expand Up @@ -25460,6 +25461,7 @@ INSERT INTO `item_mods` VALUES (15121,1,33); -- DEF: 33
INSERT INTO `item_mods` VALUES (15121,5,16); -- MP: 16
INSERT INTO `item_mods` VALUES (15121,9,5); -- DEX: 5
INSERT INTO `item_mods` VALUES (15121,115,10); -- ELEM: 10
INSERT INTO `item_mods` VALUES (15121,1080, 1); -- Enhances effect of "Spikes" spells

-- Assassins Culottes
INSERT INTO `item_mods` VALUES (15122,1,34); -- DEF: 34
Expand Down Expand Up @@ -27758,6 +27760,7 @@ INSERT INTO `item_mods` VALUES (15584,1,34); -- DEF: 34
INSERT INTO `item_mods` VALUES (15584,5,16); -- MP: 16
INSERT INTO `item_mods` VALUES (15584,9,6); -- DEX: 6
INSERT INTO `item_mods` VALUES (15584,115,12); -- ELEM: 12
INSERT INTO `item_mods` VALUES (15584,1080,1); -- Enhances effect of "Spikes" spells

-- Assassins Culottes +1
INSERT INTO `item_mods` VALUES (15585,1,35); -- DEF: 35
Expand Down
13 changes: 7 additions & 6 deletions src/map/modifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,13 @@ enum class Mod
LIFE_CYCLE_EFFECT = 1029, // Adds bonus HP% returned to the luopan when using Life Cycle
AURA_SIZE = 1030, // Used to extend aura size, the formula is 6.25 + (PEntity->getMod(Mod::AURA_SIZE) / 100) so adding 100 will make this 7.25

ENSPELL = 341, // stores the type of enspell active (0 if nothing)
ENSPELL_DMG = 343, // stores the base damage of the enspell before reductions
ENSPELL_DMG_BONUS = 432, //
ENSPELL_CHANCE = 856, // Chance of enspell activating (0 = 100%, 10 = 10%, 30 = 30%, ...)
SPIKES = 342, // store the type of spike spell active (0 if nothing)
SPIKES_DMG = 344, // stores the base damage of the spikes before reductions
ENSPELL = 341, // stores the type of enspell active (0 if nothing)
ENSPELL_DMG = 343, // stores the base damage of the enspell before reductions
ENSPELL_DMG_BONUS = 432, //
ENSPELL_CHANCE = 856, // Chance of enspell activating (0 = 100%, 10 = 10%, 30 = 30%, ...)
SPIKES = 342, // store the type of spike spell active (0 if nothing)
SPIKES_DMG = 344, // stores the base damage of the spikes before reductions
SPIKES_BONUS = 1080, // Increases spikes damage by percentage (e.g. mod value 50 = +50% spikes damage)

TP_BONUS = 345, //
SAVETP = 880, // SAVETP Effect for Miser's Roll / ATMA / Hagakure.
Expand Down
29 changes: 27 additions & 2 deletions src/map/utils/battleutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,19 @@ namespace battleutils
ELEMENT spikeElement = (ELEMENT)((uint8)GetSpikesDamageType(Action->spikesEffect) - (uint8)DAMAGE_TYPE::ELEMENTAL);
int32 damage = Action->spikesParam;

if (PDefender->getMod(Mod::SPIKES_BONUS) > 0)
{
if (static_cast<SPIKES>(Action->spikesEffect) == SPIKES::SPIKE_BLAZE)
{
damage += PDefender->INT() * 6 / 256 * PDefender->getMod(Mod::SPIKES_BONUS);
}
else if (static_cast<SPIKES>(Action->spikesEffect) == SPIKES::SPIKE_ICE ||
static_cast<SPIKES>(Action->spikesEffect) == SPIKES::SPIKE_SHOCK)
{
damage += PDefender->INT() * 3 / 256 * PDefender->getMod(Mod::SPIKES_BONUS);
}
}

if (static_cast<SPIKES>(Action->spikesEffect) == SPIKES::SPIKE_DREAD)
{
// drain same as damage taken
Expand Down Expand Up @@ -1068,15 +1081,27 @@ namespace battleutils
}
case SUBEFFECT_ICE_SPIKES:
{
if (xirand::GetRandomNumber(100) < 20 + lvlDiff && !PAttacker->StatusEffectContainer->HasStatusEffect(EFFECT_PARALYSIS))
uint16 base = 20;
if (PDefender->getMod(Mod::SPIKES_BONUS) > 0)
{
base *= 1.f + ((PDefender->getMod(Mod::SPIKES_BONUS) * 20) / 100.f);
}

if (xirand::GetRandomNumber(100) < base + lvlDiff && !PAttacker->StatusEffectContainer->HasStatusEffect(EFFECT_PARALYSIS))
{
PAttacker->StatusEffectContainer->AddStatusEffect(new CStatusEffect(EFFECT_PARALYSIS, EFFECT_PARALYSIS, 20, 0, 30));
}
break;
}
case SUBEFFECT_SHOCK_SPIKES:
{
if (xirand::GetRandomNumber(100) < 30 + lvlDiff && !PAttacker->StatusEffectContainer->HasStatusEffect(EFFECT_STUN))
uint16 base = 30;
if (PDefender->getMod(Mod::SPIKES_BONUS) > 0)
{
base *= 1.f + ((PDefender->getMod(Mod::SPIKES_BONUS) * 20) / 100.f);
}

if (xirand::GetRandomNumber(100) < base + lvlDiff && !PAttacker->StatusEffectContainer->HasStatusEffect(EFFECT_STUN))
{
PAttacker->StatusEffectContainer->AddStatusEffect(new CStatusEffect(EFFECT_STUN, EFFECT_STUN, 1, 0, 3));
}
Expand Down

0 comments on commit 4898ede

Please sign in to comment.