Skip to content

Creating a Passive Feat

I'm trying to create a passive feat for Dragon Disciple, which gives elemental immunity depending of the its dragon heritage, and AFAIK, it´s not working. Would someone help me?

feat.2da

LABEL FEAT DESCRIPTION ICON MINATTACKBONUS MINSTR MINDEX MININT MINWIS MINCON MINCHA MINSPELLLVL PREREQFEAT1 PREREQFEAT2 GAINMULTIPLE EFFECTSSTACK ALLCLASSESCANUSE CATEGORY MAXCR SPELLID SUCCESSOR CRValue USESPERDAY MASTERFEAT TARGETSELF OrReqFeat0 OrReqFeat1 OrReqFeat2 OrReqFeat3 OrReqFeat4 REQSKILL ReqSkillMinRanks REQSKILL2 ReqSkillMinRanks2 Constant TOOLSCATEGORIES HostileFeat MinLevel MinLevelClass MaxLevel MinFortSave PreReqEpic ReqAction
1178 FEAT_DRAGON_ABILITIES_VG 83495 83500 ife_X2DDArmor **** **** **** **** **** **** **** **** **** **** 0 0 0 **** **** 900 **** 1 **** **** **** **** **** **** **** **** **** **** **** **** FEAT_DRAGON_ABILITIES_VG 5 **** 1 56 10 **** 0 0
1179 FEAT_DRAGON_HERITAGE_RED 16777517 16777517 ife_X2DDArmor **** **** **** **** **** **** **** **** **** **** 0 0 0 **** **** 901 **** 1 **** **** 1 **** **** **** **** **** **** **** **** **** FEAT_DRAGON_HERITAGE_RED **** **** **** **** **** **** **** ****
1180 FEAT_DRAGON_HERITAGE_BLACK 16777518 16777518 ife_X2DDArmor **** **** **** **** **** **** **** **** **** **** 0 0 0 **** **** 902 **** 1 **** **** 1 **** **** **** **** **** **** **** **** **** FEAT_DRAGON_HERITAGE_BLACK **** **** **** **** **** **** **** ****
1181 FEAT_DRAGON_HERITAGE_BLUE 16777519 16777519 ife_X2DDArmor **** **** **** **** **** **** **** **** **** **** 0 0 0 **** **** 903 **** 1 **** **** 1 **** **** **** **** **** **** **** **** **** FEAT_DRAGON_HERITAGE_BLUE **** **** **** **** **** **** **** ****
1182 FEAT_DRAGON_HERITAGE_BRASS 16777520 16777520 ife_X2DDArmor **** **** **** **** **** **** **** **** **** **** 0 0 0 **** **** 904 **** 1 **** **** 1 **** **** **** **** **** **** **** **** **** FEAT_DRAGON_HERITAGE_BRASS **** **** **** **** **** **** **** ****
1183 FEAT_DRAGON_HERITAGE_BRONZE 16777521 16777521 ife_X2DDArmor **** **** **** **** **** **** **** **** **** **** 0 0 0 **** **** 905 **** 1 **** **** 1 **** **** **** **** **** **** **** **** **** FEAT_DRAGON_HERITAGE_BRONZE **** **** **** **** **** **** **** ****
1184 FEAT_DRAGON_HERITAGE_COPPER 16777522 16777522 ife_X2DDArmor **** **** **** **** **** **** **** **** **** **** 0 0 0 **** **** 906 **** 1 **** **** 1 **** **** **** **** **** **** **** **** **** FEAT_DRAGON_HERITAGE_COPPER **** **** **** **** **** **** **** ****
1185 FEAT_DRAGON_HERITAGE_GOLD 16777523 16777523 ife_X2DDArmor **** **** **** **** **** **** **** **** **** **** 0 0 0 **** **** 907 **** 1 **** **** 1 **** **** **** **** **** **** **** **** **** FEAT_DRAGON_HERITAGE_GOLD **** **** **** **** **** **** **** ****
1186 FEAT_DRAGON_HERITAGE_GREEN 16777524 16777524 ife_X2DDArmor **** **** **** **** **** **** **** **** **** **** 0 0 0 **** **** 908 **** 1 **** **** 1 **** **** **** **** **** **** **** **** **** FEAT_DRAGON_HERITAGE_GREEN **** **** **** **** **** **** **** ****
1187 FEAT_DRAGON_HERITAGE_SILVER 16777525 16777525 ife_X2DDArmor **** **** **** **** **** **** **** **** **** **** 0 0 0 **** **** 909 **** 1 **** **** 1 **** **** **** **** **** **** **** **** **** FEAT_DRAGON_HERITAGE_SILVER **** **** **** **** **** **** **** ****
1188 FEAT_DRAGON_HERITAGE_WHITE 16777526 16777526 ife_X2DDArmor **** **** **** **** **** **** **** **** **** **** 0 0 0 **** **** 910 **** 1 **** **** 1 **** **** **** **** **** **** **** **** **** FEAT_DRAGON_HERITAGE_WHITE **** **** **** **** **** **** **** ****

spells.2da

Label Name IconResRef School Range VS MetaMagic TargetType ImpactScript Bard Cleric Druid Paladin Ranger Wiz_Sorc Innate ConjTime ConjAnim ConjHeadVisual ConjHandVisual ConjGrndVisual ConjSoundVFX ConjSoundMale ConjSoundFemale CastAnim CastTime CastHeadVisual CastHandVisual CastGrndVisual CastSound Proj ProjModel ProjType ProjSpwnPoint ProjSound ProjOrientation ImmunityType ItemImmunity SubRadSpell1 SubRadSpell2 SubRadSpell3 SubRadSpell4 SubRadSpell5 Category Master UserType SpellDesc UseConcentration SpontaneouslyCast AltMessage HostileSetting FeatID Counter1 Counter2 HasProjectile
900 FEAT_DRAGON_ABILITIES_VG 83495 ife_X2DDArmor E P **** 0x00 0x01 vg_dradis_abi **** **** **** **** **** **** 0 0 **** **** **** **** **** **** **** **** 1 **** **** **** **** 0 **** **** **** **** **** **** 0 **** **** **** **** **** 16 **** 3 **** 0 0 **** 0 1178 **** **** 0
901 FEAT_DRAGON_HERITAGE_RED 16777517 ife_X2DDArmor E P **** 0x00 0x01 vg_dradis_red **** **** **** **** **** **** 0 0 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** 16 **** 3 16777517 0 0 **** 0 1179 **** **** 0
902 FEAT_DRAGON_HERITAGE_BLACK 16777518 ife_X2DDArmor E P **** 0x00 0x01 vg_dradis_bla **** **** **** **** **** **** 0 0 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** 16 **** 3 16777518 0 0 **** 0 1180 **** **** 0
903 FEAT_DRAGON_HERITAGE_BLUE 16777519 ife_X2DDArmor E P **** 0x00 0x01 vg_dradis_blu **** **** **** **** **** **** 0 0 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** 16 **** 3 16777519 0 0 **** 0 1181 **** **** 0
904 FEAT_DRAGON_HERITAGE_BRASS 16777520 ife_X2DDArmor E P **** 0x00 0x01 vg_dradis_bra **** **** **** **** **** **** 0 0 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** 16 **** 3 16777520 0 0 **** 0 1182 **** **** 0
905 FEAT_DRAGON_HERITAGE_BRONZE 16777521 ife_X2DDArmor E P **** 0x00 0x01 vg_dradis_bro **** **** **** **** **** **** 0 0 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** 16 **** 3 16777521 0 0 **** 0 1183 **** **** 0
906 FEAT_DRAGON_HERITAGE_COPPER 16777522 ife_X2DDArmor E P **** 0x00 0x01 vg_dradis_cop **** **** **** **** **** **** 0 0 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** 16 **** 3 16777522 0 0 **** 0 1184 **** **** 0
907 FEAT_DRAGON_HERITAGE_GOLD 16777523 ife_X2DDArmor E P **** 0x00 0x01 vg_dradis_gol **** **** **** **** **** **** 0 0 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** 16 **** 3 16777523 0 0 **** 0 1185 **** **** 0
908 FEAT_DRAGON_HERITAGE_GREEN 16777524 ife_X2DDArmor E P **** 0x00 0x01 vg_dradis_gre **** **** **** **** **** **** 0 0 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** 16 **** 3 16777524 0 0 **** 0 1186 **** **** 0
909 FEAT_DRAGON_HERITAGE_SILVER 16777525 ife_X2DDArmor E P **** 0x00 0x01 vg_dradis_sil **** **** **** **** **** **** 0 0 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** 16 **** 3 16777525 0 0 **** 0 1187 **** **** 0
910 FEAT_DRAGON_HERITAGE_WHITE 16777526 ife_X2DDArmor E P **** 0x00 0x01 vg_dradis_whi **** **** **** **** **** **** 0 0 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** 16 **** 3 16777526 0 0 **** 0 1188 **** **** 0

the script (vg_dradis_abi):

#include "vg_constants"
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"

void main()
{
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
//vai dar imunidades
effect eImmunity;
if (GetHasFeat(FEAT_DRAGON_HERITAGE_COPPER) || GetHasFeat(FEAT_DRAGON_HERITAGE_COPPER) || GetHasFeat(FEAT_DRAGON_HERITAGE_GREEN))
{
eImmunity = EffectDamageImmunityIncrease(DAMAGE_TYPE_ACID, 100);
}
else if (GetHasFeat(FEAT_DRAGON_HERITAGE_BLUE) || GetHasFeat(FEAT_DRAGON_HERITAGE_BRONZE))
{
eImmunity = EffectDamageImmunityIncrease(DAMAGE_TYPE_ELECTRICAL, 100);
}
else if (GetHasFeat(FEAT_DRAGON_HERITAGE_RED) || GetHasFeat(FEAT_DRAGON_HERITAGE_BRASS) || GetHasFeat(FEAT_DRAGON_HERITAGE_GOLD))
{
eImmunity = EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 100);
}
else if (GetHasFeat(FEAT_DRAGON_HERITAGE_WHITE) || GetHasFeat(FEAT_DRAGON_HERITAGE_SILVER))
{
eImmunity = EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 100);
}
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eImmunity,OBJECT_SELF);
}

Comments

  • WodahsEhtWodahsEht Member Posts: 10
    It's been awhile since I've dealt with feats, but I think the problem is that passive feats never have a reason to trigger their scripts. The only way to make them trigger is to use event scripts like OnRest and so on. An active feat can be triggered by the player, but a passive feat never actually runs any scripts to my knowledge. You can make the feat an active feat with column "ReqAction" set to 0 which turns on the ability at will without having to run through any animations. However, that would require the player know that they need to do that.
  • ProlericProleric Member Posts: 1,269
    edited January 2020
    The script suggests that the immunity is intended to be automatic for Dragon Disciples possessing a given heritage feat, so I wonder whether it really needs to be a new paasive feat.

    Either way, the trick with a passive feat is to run its script from the event(s) in which the feat is acquired.

    In this case, presumably, that would be OnClientEnter and OnPlayerLevelUp. Both of those scripts would need to run the immunity code, checking that it only runs once.

    More generally (though not in this case) there might be events that remove the passive feat or modify its effects. Again, those event scripts would need to run the code that changes or cancels the effect.

    The main benefit of using a passive feat (rather than a simple flag) is that the player can see its description in the character sheet.
  • GambrowGambrow Member Posts: 5
    Thanks people, I did what you said, I put on the nextlevel event, and it worked. I put on other events (onclientlogin and onrest) and need to test, but i'm tired now.
  • GambrowGambrow Member Posts: 5
    And I forgot to set this effect as an extraordinary, now it's done.
  • ProlericProleric Member Posts: 1,269
    I suspect @WodahsEht just mentioned OnRest as a generic example. In this particular case, unless I've missed something, there should be no change to the immunity when the player rests.

    OnClientEnter and OnPlayerLevelUp are the events in which a player might have the heritage feat for the first time.
Sign In or Register to comment.