oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE); //Cycle through the targets within the spell shape until an invalid object is captured. while (GetIsObjectValid(oTarget) && nCnt <= nEnemies) { // * caster cannot be harmed by this spell if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && (oTarget != OBJECT_SELF) && (( GetObjectType(OBJECT_SELF) == OBJECT_TYPE_PLACEABLE ) || (GetObjectSeen(oTarget,OBJECT_SELF)))) { //Fire cast spell at event for the specified target SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpell)); // * recalculate appropriate distances fDist = GetDistanceBetween(OBJECT_SELF, oTarget); fDelay = fDist/(3.0 * log(fDist) + 2.0); // Firebrand. // It means that once the target has taken damage this round from the // spell it won't take subsequent damage if (nONEHIT == TRUE) { nExtraMissiles = 1; nRemainder = 0; } int i = 0; //-------------------------------------------------------------- // GZ: Moved SR check out of loop to have 1 check per target // not one check per missile, which would rip spell mantels // apart //-------------------------------------------------------------- if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay)) { for (i=1; i <= nExtraMissiles + nRemainder; i++) { // damage per missile applied here, cut out for brevity } } // for else { // * apply a dummy visual effect ApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget); } nCnt++;// * increment count of missiles fired nRemainder = 0; } oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE); }
I will confirm Hellblazer's concern on ball lighting. I normally use firebrand. This time I decided to test ball lightning out in the Vehl Crypts as I gathered skeleton knuckles.On one occasion I had three skeletons run at me hip-to-hip about 10 meters from me. I casted on the one in the middle and only one ball fired off. Another time I casted at a group of about 5 skeletons that were runing at me; they were grouped in a circle about 6 meters in diameter; I targeted the one in the back. Only two balls shot off. However, another time I had three skeletons right up on me swinging and casted and three balls shot off.If I were using firebrand in the above scenarios I am confident all target would have been hit based on past exerience. I was pretty disapointed in the spell at the time and made a mental note not to use it in the future.
As a related note, I have never seen anyone use ball lightning in game, where I have seen many players use firebrand...maybe this could be part of the reason why no one uses it?