Creating a Passive Feat
Gambrow
Member Posts: 5
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);
}
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);
}
0
Comments
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.
OnClientEnter and OnPlayerLevelUp are the events in which a player might have the heritage feat for the first time.