Server Totals
Mikona - (1)
Wilderness - (1)
Ferrell - (0)
Le'Or - (0)
Elysia - (0)
M'Chek - (0)
Deglos - (0)
Visimontium - (0)
Underdark - (0)
Total players: 2
Gallery

Links Menu

Broken spell fix (SoV, web, etc)

Forum for posing direct questions to the Avlis Team. Purpose is to facilitate Team/Player communication.

Moderators: Nighthawk4, Dungeon Masters

Broken spell fix (SoV, web, etc)

PostAuthor: sly_1 » Tue Mar 16, 2004 11:28 pm

OK, this script should fix spells like Storm of Vengeance, Web, Entangle, etc. Anything creating a persistent, though temporary area effect. I'm not going to pretend to understand any of this, as I'm scripting illiterate, but I'm sure the scripting wizards can make sense of it.

The problem is the real low priority of the AoE heartbeat not the script itself.

So I add to the AoE OnEnter script a pseudo heartbeat that contains all the AoE heartbeat code. Set it to fire the first time the AoE is entered using a DOONCE local int and comment out all the heart beat code.

e.g

AoE OnEnter

// add any #include from the AoE heartbeat not present already in the OnEnter script

void DoPseudoHeartbeat();

void main()
{
if (!GetLocalInt(OBJECT_SELF, "DOONCE"))
{
SetLocalInt(OBJECT_SELF, "DOONCE", TRUE);
DoPseudoHeartbeat();
}
// the rest of any AoE OnEnter code unchanged
...
}

void DoPseudoHeartbeat()
{
DelayCommand(RoundsToSeconds(1), DoPseudoHeartbeat());
// copy in all the AoE OnHeartbeat code unchanged here
...
}

// end of OnEnter

// AoE Heartbeat
void main()
{
/* comment everything out
...
*/
}


This was provided to me by Qel Chamyaar, the lead scripter for another PW I play on. Hope it helps ;)
I have the strength of a bear that has the strength of TWO bears!

sly_1
Prince of Bloated Discourse
 
Posts: 222
Joined: Tue Jun 10, 2003 4:21 am

PostAuthor: Fuzz » Wed Mar 17, 2004 12:13 am

Looks like it would introduce even more lag, imo... OnHeartbeat = suck.
<Sili> I've seen septic tanks with less shit in them than Fuzz.

<Ronnin> damm not even a kiss??
<Chasmania> Kiss Fuzz? I'd rather fellate a goat.

<Chasmania> there are many roads to Rome..they just picked a shit filled alley full of scabby hookers and bums.


The shape of things to come...
User avatar
Fuzz
Elder Sage
 
Posts: 4649
Joined: Fri Jul 04, 2003 4:36 am
Location: Kayvareh

PostAuthor: Jordicus » Wed Mar 17, 2004 12:21 am

no.. the script above only simulates a heartbeat through a recursive function..

but the fact is that many of the AoE spells already involve the system hearbeat.
You see things and you say, "Why?" But I dream things that never were and say, "Why not?" George Bernard Shaw
User avatar
Jordicus
Team Member; Retired with Honors
 
Posts: 8048
Joined: Tue Jan 21, 2003 3:46 pm
Location: Whitehall, PA (GMT -4)

PostAuthor: sly_1 » Wed Mar 17, 2004 2:37 am

*shrug* Like I said, I don't know squat about scripting. All I know is that I'm positive the fix works. SOV works fine on that other world, along with all the other spells that have the same problem. I'll dig up a more complete spell script demonstrating the entire fix for you guys, if I can find the thing. The script doesn't seem to affect the amount of lag in any perceptible fashion, in my experience. At the very least, the spell creates as much lag as it would have under the "normal" script.

Regardless, shouldn't spells work properly? :)

Anyway, it's worth a shot. If it works elsewhere maybe it'll work here too ;)
I have the strength of a bear that has the strength of TWO bears!

sly_1
Prince of Bloated Discourse
 
Posts: 222
Joined: Tue Jun 10, 2003 4:21 am

PostAuthor: sly_1 » Fri Mar 19, 2004 1:42 am

OK, here's the full fix for SOV, but the same theory works for other spells having the same problem. It should work for any persistent area effect spell. Edited this post a bit for clarity:

Posted 02/17/04 09:27:04 (GMT) -- Chris..S

Persistent Area of Effect spells work like triggers, they have OnEnter, OnExit & Heartbeat scripts. The OnEnter and OnExit scripts tend to work fine. The heartbeat seems to get such a low priority so that you may not even get one heartbeat firing before the duration of the spell expires.

There is a fix. In the OnEnter script set up a DOONCE pseudo heartbeat on a 6 second pulse. Strip the heartbeat code out and place it in this pseudo heartbeat. This change makes Storm of Vengence one of the most powerful spells in the game.

The full list of spells affected is quite long and includes...Entangle, Web, Evards Tentacles, Stinking Cloud, Cloudkill, Mind Fog, Acid Fog, Incendiary Cloud, Creeping Doom (which requires a more complex fix), Shadow Web.

There is an unfortunate side effect concerning the Shadow version of Web. There is a bug in the engine concerning the calculation of DC for any spell cast off a sub wheel. In effect this only applies to some of the shadow spells (Shadow versions of Web, Cone of Cold, Fireball, etc). The messed up DC is 246 above normal. This means no save is possible. With Web the failure will quickly drop any trapped creatures to Dex of 3, this prevents spell casting and use of creature abilities.

There are two fixes to the shadow spells problem.

- One, check for spell id and if it is a shadow version and the DC is above 200 subtract 246 from the DC before using it.

- Two place a modified version of spells.2da on the server. Alter the stats of the shadow version spells, the spell school needs to be changed to Illusion and the spell caster level needs to be set at the appropriate level. Do not place this modified spells.2da on a client - the client will then offer the subwheel spells as valid spells on Wizard/Sorc level up.


Below is an sample of a corrected spell script for Storm of Vengence. First the OnEnter Script
[nwscript]
//::///////////////////////////////////////////////
//:: Storm of Vengeance: Heartbeat
//:: NW_S0_StormVenA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates an AOE that decimates the enemies of
the cleric over a 30ft radius around the caster
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 8, 2001
//:://////////////////////////////////////////////

#include "X0_I0_SPELLS"

void DoStormOfVengeance();

void main()
{
//---Qel, fire off first pseudo heartbeat
if (!GetLocalInt(OBJECT_SELF, "qel_HeartStarted"))
{
DelayCommand(RoundsToSeconds(1), DoStormOfVengeance());
SetLocalInt(OBJECT_SELF, "qel_HeartStarted", 1);
}
}


void DoStormOfVengeance()
{
// fire off the next pseudo heartbeat
DelayCommand(RoundsToSeconds(1), DoStormOfVengeance());

//---Qel code copied from nw_s0_stormvenc, its heartbeat script

//Declare major variables
effect eAcid = EffectDamage(d6(3), DAMAGE_TYPE_ACID);
effect eElec = EffectDamage(d6(6), DAMAGE_TYPE_ELECTRICAL);
effect eStun = EffectStunned();
effect eVisAcid = EffectVisualEffect(VFX_IMP_ACID_S);
effect eVisElec = EffectVisualEffect(VFX_IMP_LIGHTNING_M);
effect eVisStun = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eStun, eVisStun);
eLink = EffectLinkEffects(eLink, eDur);
float fDelay;
//Get first target in spell area
object oTarget = GetFirstInPersistentObject();
while(GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_STORM_OF_VENGEANCE));
//Make an SR Check
fDelay = GetRandomDelay(0.5, 2.0);
if(MyResistSpell(GetAreaOfEffectCreator(), oTarget, fDelay) == 0)
{
//Make a saving throw check
// * if the saving throw is made they still suffer acid damage.
// * if they fail the saving throw, they suffer Electrical damage too
if(MySavingThrow(SAVING_THROW_REFLEX, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_ELECTRICITY, GetAreaOfEffectCreator(), fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisAcid, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eAcid, oTarget));
}
else
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisAcid, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eAcid, oTarget));
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisElec, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eElec, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2)));
}
}
}
//Get next target in spell area
oTarget = GetNextInPersistentObject();
}
}
[/nwscript]

and the changed heartbeat

[nwscript]
//::///////////////////////////////////////////////
//:: Storm of Vengeance: Heartbeat
//:: NW_S0_StormVenC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates an AOE that decimates the enemies of
the cleric over a 30ft radius around the caster
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 8, 2001
//:://////////////////////////////////////////////

#include "X0_I0_SPELLS"
void main()
{
/*
commented out (deleted here for convenience
*/
}[/nwscript]
I have the strength of a bear that has the strength of TWO bears!

sly_1
Prince of Bloated Discourse
 
Posts: 222
Joined: Tue Jun 10, 2003 4:21 am


Return to The Avlis Project: Ask the Team

Who is online

Registered users: Akai, Google [Bot]