Hi i’m new in modding of neverwinter nights 2 have some experience in programming but i don’t know how add damage by feat to custom polymorph i do a custom polymorph in dinosaur shape but for some reason since add something effects as more damage and resistance guiding me in some examples I can not transform
//::///////////////////////////////////////////////
//:: Wild Shape
//:: x2_s2_dinosaurshape
//:://////////////////////////////////////////////
#include “x2_inc_itemprop”
void main()
{
//Declare major variables
object oPC = OBJECT_SELF;
int nSpell = GetSpellId();
object oTarget = GetSpellTargetObject();
effect eVis = EffectVisualEffect(VFX_DUR_POLYMORPH);
eVis = SupernaturalEffect(eVis); // AFW-OEI 12/07/2006: Make it so you can’t dispel the visual effect, which was dispelling wildshape.
effect ePoly;
int nPoly = POLYMORPH_TYPE_COW;
int nMetaMagic = GetMetaMagicFeat();
int nDuration = GetLevelByClass(CLASS_TYPE_DRUID);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
nPoly = 208;
if (nDuration >= 12)
{
nPoly = 209;
}
if (nDuration >= 16)
{
nPoly = 210;
}
if (nDuration >= 18)
{
nPoly = 211;
}
if (nDuration >= 20)
{
nPoly = 212;
}
if (nDuration >= 23)
{
nPoly = 213;
}
if (nDuration >= 26)
{
nPoly = 214;
}
if (nDuration >= 30)
{
nPoly = 215;
}
ePoly = EffectPolymorph(nPoly, FALSE, TRUE); // AFW-OEI 11/27/2006: Use 3rd boolean to say this is a wildshape polymorph.
ePoly = SupernaturalEffect(ePoly);
if (GetHasFeat(3131, oPC, TRUE) == TRUE){
ePoly = EffectDamageIncrease(1);
ePoly = SupernaturalEffect(ePoly);
ePoly = EffectDamageIncrease(DAMAGE_BONUS_1d6,DAMAGE_TYPE_DIVINE);
ePoly = SupernaturalEffect(ePoly);
}
if (GetHasFeat(3132, oPC, TRUE) == TRUE){
ePoly = EffectSpellResistanceIncrease(nDuration + 5);
ePoly = SupernaturalEffect(ePoly);
if(nDuration >= 12){
ePoly = EffectDamageReduction(10);
} else {
ePoly = EffectDamageReduction(5);
}
ePoly = SupernaturalEffect(ePoly);
if(GetGoodEvilValue(oPC)< 50){
if(nDuration >= 8){
ePoly=EffectDamageResistance(DAMAGE_TYPE_COLD,5);
ePoly = SupernaturalEffect(ePoly);
ePoly=EffectDamageResistance(DAMAGE_TYPE_FIRE,5);
ePoly = SupernaturalEffect(ePoly);
} else {
ePoly=EffectDamageResistance(DAMAGE_TYPE_COLD,10);
ePoly = SupernaturalEffect(ePoly);
ePoly=EffectDamageResistance(DAMAGE_TYPE_FIRE,10);
ePoly = SupernaturalEffect(ePoly);
}
} else {
if(nDuration >= 8){
ePoly=EffectDamageResistance(DAMAGE_TYPE_COLD,5);
ePoly = SupernaturalEffect(ePoly);
ePoly=EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL,5);
ePoly = SupernaturalEffect(ePoly);
ePoly=EffectDamageResistance(DAMAGE_TYPE_ACID,5);
ePoly = SupernaturalEffect(ePoly);
} else {
ePoly=EffectDamageResistance(DAMAGE_TYPE_COLD,10);
ePoly = SupernaturalEffect(ePoly);
ePoly=EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL,5);
ePoly = SupernaturalEffect(ePoly);
ePoly=EffectDamageResistance(DAMAGE_TYPE_ACID,5);
ePoly = SupernaturalEffect(ePoly);;
}
}
ePoly = EffectDamageIncrease(DAMAGE_BONUS_1,DAMAGE_TYPE_DIVINE);
ePoly = SupernaturalEffect(ePoly);
ePoly = EffectDamageIncrease(DAMAGE_BONUS_1d6,DAMAGE_TYPE_MAGICAL,RACIAL_TYPE_UNDEAD);
ePoly = SupernaturalEffect(ePoly);
ePoly = EffectDamageIncrease(DAMAGE_BONUS_1d6,DAMAGE_TYPE_MAGICAL,RACIAL_TYPE_OUTSIDER);
ePoly = SupernaturalEffect(ePoly);
}
ePoly = EffectLinkEffects( ePoly, eVis );
ePoly = SupernaturalEffect(ePoly);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oPC, SPELLABILITY_WILD_SHAPE, FALSE));
int bWeapon = StringToInt(Get2DAString("polymorph","MergeW",nPoly)) == 1;
int bArmor = StringToInt(Get2DAString("polymorph","MergeA",nPoly)) == 1;
int bItems = StringToInt(Get2DAString("polymorph","MergeI",nPoly)) == 1;
object oWeaponOld = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
object oArmorOld = GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
object oRing1Old = GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC);
object oRing2Old = GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC);
object oAmuletOld = GetItemInSlot(INVENTORY_SLOT_NECK,oPC);
object oCloakOld = GetItemInSlot(INVENTORY_SLOT_CLOAK,oPC);
object oBootsOld = GetItemInSlot(INVENTORY_SLOT_BOOTS,oPC);
object oBeltOld = GetItemInSlot(INVENTORY_SLOT_BELT,oPC);
object oHelmetOld = GetItemInSlot(INVENTORY_SLOT_HEAD,oPC);
object oShield = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
if (GetIsObjectValid(oShield))
{
if (GetBaseItemType(oShield) !=BASE_ITEM_LARGESHIELD &&
GetBaseItemType(oShield) !=BASE_ITEM_SMALLSHIELD &&
GetBaseItemType(oShield) !=BASE_ITEM_TOWERSHIELD)
{
oShield = OBJECT_INVALID;
}
}
//Apply the VFX impact and effects
ClearAllActions(); // prevents an exploit
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, oPC, HoursToSeconds(nDuration));
object oWeaponNew = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
object oArmorNew = GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC);
if (bWeapon)
{
IPWildShapeCopyItemProperties(oWeaponOld,oWeaponNew, TRUE);
}
if (bArmor)
{
IPWildShapeCopyItemProperties(oShield,oArmorNew);
IPWildShapeCopyItemProperties(oHelmetOld,oArmorNew);
IPWildShapeCopyItemProperties(oArmorOld,oArmorNew);
}
if (bItems)
{
IPWildShapeCopyItemProperties(oRing1Old,oArmorNew);
IPWildShapeCopyItemProperties(oRing2Old,oArmorNew);
IPWildShapeCopyItemProperties(oAmuletOld,oArmorNew);
IPWildShapeCopyItemProperties(oCloakOld,oArmorNew);
IPWildShapeCopyItemProperties(oBootsOld,oArmorNew);
IPWildShapeCopyItemProperties(oBeltOld,oArmorNew);
}
}