Skip to content

Commit

Permalink
Merge pull request #5188 from Barthandalus/base
Browse files Browse the repository at this point in the history
Rebuild Pull Request #5033 after accidental wipe.
  • Loading branch information
TeoTwawki authored Feb 29, 2024
2 parents 7f393bc + 5c1d59c commit 62f01f3
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 1 deletion.
17 changes: 17 additions & 0 deletions scripts/actions/abilities/immanence.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-----------------------------------
-- Ability: Immanence
-- Makes it possible for your next elemental magic spell to be used in a skillchain, but not a magic burst.
-- Obtained: Scholar Level 87
-- Duration: 1 Black Magic Spell or 60 seconds, whichever occurs first.
-----------------------------------
local abilityObject = {}

abilityObject.onAbilityCheck = function(player, target, ability)
return 0, 0
end

abilityObject.onUseAbility = function(player, target, ability)
player:addStatusEffect(xi.effect.IMMANENCE, 1, 0, 60)
end

return abilityObject
2 changes: 1 addition & 1 deletion sql/abilities.sql
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ INSERT INTO `abilities` VALUES (312,'feather_step',19,83,4,5,220,591,0,17,2000,0
INSERT INTO `abilities` VALUES (313,'striking_flourish',19,89,1,30,226,0,0,222,2000,0,14,20.0,0,1,80,0,0,NULL); -- check animation/message1
INSERT INTO `abilities` VALUES (314,'ternary_flourish',19,93,1,30,226,0,0,222,2000,0,14,20.0,0,1,80,0,0,NULL); -- check animation/message1
INSERT INTO `abilities` VALUES (316,'perpetuance',20,87,1,1,231,100,0,224,2000,0,6,0.0,0,1,80,0,16,'ABYSSEA');
-- INSERT INTO `abilities` VALUES (317,'immanence',20,87,1,1,231,100,0,245,2000,0,6,0.0,0,1,80,0,0,NULL);
INSERT INTO `abilities` VALUES (317,'immanence',20,87,1,1,231,100,0,245,2000,0,6,0.0,0,1,80,0,0,NULL);
INSERT INTO `abilities` VALUES (318,'smiting_breath',14,90,4,60,238,100,0,94,2000,0,6,8.0,0,1,80,0,0,NULL);
INSERT INTO `abilities` VALUES (319,'restoring_breath',14,90,1,60,239,100,0,94,2000,0,6,0.0,0,1,80,0,0,NULL);
INSERT INTO `abilities` VALUES (320,'konzen-ittai',12,65,4,180,132,529,0,39,2000,0,14,4.0,0,1,300,0,0,'ABYSSEA');
Expand Down
84 changes: 84 additions & 0 deletions src/map/entities/charentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,90 @@ void CCharEntity::OnCastFinished(CMagicState& state, action_t& action)

StatusEffectContainer->DelStatusEffectSilent(EFFECT_CHAIN_AFFINITY);
}

if (actionTarget.param > 0 &&
PSpell->dealsDamage() &&
PSpell->getSpellGroup() == SPELLGROUP_BLACK &&
(StatusEffectContainer->HasStatusEffect(EFFECT_IMMANENCE)))
{
SUBEFFECT effect = SUBEFFECT_NONE;
switch (PSpell->getSpellFamily())
{
case SPELLFAMILY_STONE:
effect = battleutils::GetSkillChainEffect(PTarget, 4, 0, 0);
break;
case SPELLFAMILY_GEOHELIX:
effect = battleutils::GetSkillChainEffect(PTarget, 4, 0, 0);
break;
case SPELLFAMILY_WATER:
effect = battleutils::GetSkillChainEffect(PTarget, 5, 0, 0);
break;
case SPELLFAMILY_HYDROHELIX:
effect = battleutils::GetSkillChainEffect(PTarget, 5, 0, 0);
break;
case SPELLFAMILY_AERO:
effect = battleutils::GetSkillChainEffect(PTarget, 6, 0, 0);
break;
case SPELLFAMILY_ANEMOHELIX:
effect = battleutils::GetSkillChainEffect(PTarget, 6, 0, 0);
break;
case SPELLFAMILY_FIRE:
effect = battleutils::GetSkillChainEffect(PTarget, 3, 0, 0);
break;
case SPELLFAMILY_PYROHELIX:
effect = battleutils::GetSkillChainEffect(PTarget, 3, 0, 0);
break;
case SPELLFAMILY_BLIZZARD:
effect = battleutils::GetSkillChainEffect(PTarget, 7, 0, 0);
break;
case SPELLFAMILY_CRYOHELIX:
effect = battleutils::GetSkillChainEffect(PTarget, 7, 0, 0);
break;
case SPELLFAMILY_THUNDER:
effect = battleutils::GetSkillChainEffect(PTarget, 8, 0, 0);
break;
case SPELLFAMILY_IONOHELIX:
effect = battleutils::GetSkillChainEffect(PTarget, 8, 0, 0);
break;
case SPELLFAMILY_LUMINOHELIX:
effect = battleutils::GetSkillChainEffect(PTarget, 1, 0, 0);
break;
case SPELLFAMILY_NOCTOHELIX:
effect = battleutils::GetSkillChainEffect(PTarget, 2, 0, 0);
break;
default:
break;
}

if (PSpell->getSpellFamily() >= SPELLFAMILY_FIRE &&
PSpell->getSpellFamily() <= SPELLFAMILY_WATER)
{
StatusEffectContainer->DelStatusEffectSilent(EFFECT_IMMANENCE);
}

if (PSpell->getSpellFamily() >= SPELLFAMILY_GEOHELIX &&
PSpell->getSpellFamily() <= SPELLFAMILY_LUMINOHELIX)
{
StatusEffectContainer->DelStatusEffectSilent(EFFECT_IMMANENCE);
}

if (effect != SUBEFFECT_NONE)
{
int32 skillChainDamage = battleutils::TakeSkillchainDamage(static_cast<CBattleEntity*>(this), PTarget, actionTarget.param, nullptr);

if (skillChainDamage < 0)
{
actionTarget.addEffectParam = -skillChainDamage;
actionTarget.addEffectMessage = 384 + effect;
}
else
{
actionTarget.addEffectParam = skillChainDamage;
actionTarget.addEffectMessage = 287 + effect;
}
actionTarget.additionalEffect = effect;
}
}
}
}
charutils::RemoveStratagems(this, PSpell);
Expand Down

0 comments on commit 62f01f3

Please sign in to comment.