I tried just changing it to a maintain in ABI_base, and obviously that didn't work. I looked through the lines inside Spell_modal.nss and realized the ability's script has to be inside that for it to work as a real maintain that can be toggled on and off. So I took the code out of Spell_singletarget.nss and put it inside of Spell_modal.nss.
I then found this line; "EFFECT_DURATION_TYPE_TEMPORARY", and changed it to "EFFECT_DURATION_TYPE_PERMANENT", since that seemed necessary to make it last as long as it was maintained rather than just the regular 20 seconds.
I know about the issue with the damage being applied while the ability is active rather than when it fails, and could see exactly what was causing it; the damage lines were positioned to always occur, rather than only if the mental check succeeded, so I tried to move that.
But that created this error message when exporting;
"E: 16:58:53 - spell_modal.nss - spell_modal.nss(134): Unknown state in compiler", so I just scrapped that section entirely since it was unnecessary.
Now here's the real problem. After doing all of that, I get this new message when exporting;
"E: 17:11:23 - spell_modal.nss - spell_modal.nss(128): Variable defined without type (while compiling var_constants_h.nss)"
The line it's referring to is this; "eEffect = EffectCharm(stEvent.oCaster, stEvent.oTarget);"
When I try it out in-game, the spell appears to succeed (no failure message), and the ability toggles on, but it has no effect on the target. That botched line appears to be the crux of the whole spell where it applies the charm effect, so that's clearly the issue. But I have absolutely no idea how to fix it.
Can anyone help?
Here's what the whole section looks like;
case ABILITY_SPELL_BLOOD_CONTROL:
{
// if creature has blood
int nAppearanceType = GetAppearanceType(stEvent.oTarget);
if (GetM2DAInt(TABLE_APPEARANCE, "bCanBleed", nAppearanceType) == TRUE)
{
// remove stacking effects
RemoveStackingEffects(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility);
// does not work on PCs
if (IsPartyMember(stEvent.oTarget) == FALSE)
{
// creatures with conversations are not charmed
// this is to prevent creatures that talk then turn hostile from talking again
if (HasConversation(stEvent.oTarget) == FALSE)
{
// mental resistance
if (ResistanceCheck(stEvent.oCaster, stEvent.oTarget, PROPERTY_ATTRIBUTE_SPELLPOWER, RESISTANCE_MENTAL) == FALSE)
{
float fDuration = GetRankAdjustedEffectDuration(stEvent.oTarget, BLOOD_CONTROL_DURATION);
eEffect = EffectCharm(stEvent.oCaster, stEvent.oTarget);
eEffect = SetEffectEngineInteger(eEffect, EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));
ApplyEffectOnObject(EFFECT_DURATION_TYPE_PERMANENT, eEffect, stEvent.oTarget, fDuration, stEvent.oCaster, stEvent.nAbility);
}
}
}
} else
{
UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_IMMUNE);
}
bHostile = TRUE;
break;
}
Modifié par Kesaru, 03 mars 2010 - 10:54 .





Retour en haut






