Jump to content

Maintained Blood Control


Recommended Posts

As part of the magic overhaul I've been working on, I'm trying to change Blood Control into a maintained spell that will keep the target under your control for as long as you keep it active .I'm having some trouble getting it to work though. Here's what the script for it currently looks like (which I moved from spell_singletarget.ncs tp spell_modal.ncs):

		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);

						eEffects[0] = EffectCharm(stEvent.oCaster, stEvent.oTarget);
						eEffects[0] = SetEffectEngineInteger(eEffects[0], EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));
						ApplyEffectOnObject(EFFECT_DURATION_TYPE_PERMANENT, eEffects[0], stEvent.oTarget, fDuration, stEvent.oCaster, stEvent.nAbility);
					}
				}
			}
		} else
		{
			UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_IMMUNE);
		}
		bEffectValid = TRUE;

		break;
	}

I've also made all of the necessary changes in ABI_base for it to function as a maintained/modal ability.

 

The problems I'm having here are pretty straight forward.

First, for some reason the ability charms the character using it as well as the target. Since you're charming yourself, it basically just causes you to lose control of the character so they can only act off tactics.

The second issue is the ability can only be used once; once I deactivate it, it can't be activated again. The icon looks fine, but nothing happens when you try to use it on someone.

No cast time, no activation, no effect.

 

Can anyone help?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...