Script in next post to avoid the paste/format mess.
(It was the simple path)
Modifié par Morbane, 27 avril 2012 - 07:55 .
Modifié par Morbane, 27 avril 2012 - 07:55 .
Modifié par Morbane, 26 avril 2012 - 09:00 .
if(GetIsEnemy(oTarget, oCaster))
{
// oTarget = GetNextInPersistentObject(oTarget);
Modifié par Morbane, 26 avril 2012 - 09:02 .
object oDebug = GetFirstPC(FALSE); SendMessageToPC(oDebug, "The script fires!!");
it's a good idea, i've seen anomalies too when not doing !Caster on that if()DannJ wrote...
Most spell scripts I've looked at check both for GetIsEnemy AND not-caster. I don't know if that's overly cautious, but I usually follow the trend.
Modifié par kevL, 26 avril 2012 - 10:38 .
object oTarget = GetFirstInPersistentObject();
while(GetIsObjectValid(oTarget))
{
oTarget = GetNextInPersistentObject();
}
/** * Get the first object within oPersistentObject. * @onerror Returns OBJECT_INVALID if no object is found. * @param oPersistentObject ( DEFAULT: OBJECT_SELF ) * @param nResidentObjectType OBJECT_TYPE_* ( DEFAULT: OBJECT_TYPE_CREATURE ) * @param nPersistentZone PERSISTENT_ZONE_ACTIVE. This could also take the value PERSISTENT_ZONE_FOLLOW, but this is no longer used. ( DEFAULT: PERSISTENT_ZONE_ACTIVE ) * @return */ object GetFirstInPersistentObject(object oPersistentObject=OBJECT_SELF, int nResidentObjectType=OBJECT_TYPE_CREATURE, int nPersistentZone=PERSISTENT_ZONE_ACTIVE); /** * Get the next object within oPersistentObject. * @onerror Returns OBJECT_INVALID if no object is found. * @param oPersistentObject ( DEFAULT: OBJECT_SELF ) * @param nResidentObjectType OBJECT_TYPE_* ( DEFAULT: OBJECT_TYPE_CREATURE ) * @param nPersistentZone PERSISTENT_ZONE_ACTIVE. This could also take the value PERSISTENT_ZONE_FOLLOW, but this is no longer used. ( DEFAULT: PERSISTENT_ZONE_ACTIVE ) * @return */ object GetNextInPersistentObject(object oPersistentObject=OBJECT_SELF, int nResidentObjectType=OBJECT_TYPE_CREATURE, int nPersistentZone=PERSISTENT_ZONE_ACTIVE);
Modifié par painofdungeoneternal, 26 avril 2012 - 10:53 .