Aller au contenu

Photo

Another Creature Ability Script - Fires for solo PC but not for a party - Confusion ensues... (Solved without a solution)


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Morbane

Morbane
  • Members
  • 1 883 messages
This script seems straight forward enough but as the topic says: the heartbeat for the AOE only fires for a solo PC.

But when there is a full party - no Heartbeat... at all...

Script below

Modifié par Morbane, 02 mai 2012 - 09:15 .


#2
Morbane

Morbane
  • Members
  • 1 883 messages
#include "a_const_include"
#include "nw_i0_spells"
void main()
{
object oCaster = GetAreaOfEffectCreator();
object oTarget = GetFirstInPersistentObject();

int nDC = 20;
int nDam = d3();
int nCon = d2();

while (GetIsObjectValid(oTarget))
{
if(GetIsEnemy(oTarget, oCaster) && oTarget != oCaster)
{
SendMessageToPC(GetFirstPC(), "HB Fired " + GetName(oTarget));

if(spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oCaster))
{
SendMessageToPC(GetFirstPC(), "HB Is Target " + GetName(oTarget));

SignalEvent(oTarget, EventSpellCastAt(oCaster, Spell_Ability_Blood_Drain));

if(!MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_DISEASE))
{
SendMessageToPC(GetFirstPC(), GetName(oTarget) + " HB Is Dazed");
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oTarget, RoundsToSeconds(d4()));
}

effect eSwarm = EffectDamage(nDam, DAMAGE_TYPE_SLASHING);
effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION, nCon);
effect eLink = EffectLinkEffects(eCon, eSwarm);

ApplyEffectToObject(DURATION_TYPE_INSTANT, eSwarm, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCon, oTarget);
SendMessageToPC(GetFirstPC(), GetName(oTarget) + " HB Was Drained " + IntToString(nCon) + " Con");
}
}
oTarget = GetNextInPersistentObject();
}
}

#3
Morbane

Morbane
  • Members
  • 1 883 messages
Er - I forgot to ask...

Does anyone see something that would cause the script to not work correctly?

You know when you stare at something too long it just starts to become impossible to see what you're missing? Well that is happening to me now.

#4
Morbane

Morbane
  • Members
  • 1 883 messages
The strangest thing... I just went back and tested this and it is working - apparently fine even... Dont know why it was bugging up before.

Solved without a solution I guess.