Aller au contenu

Photo

Anti magic zones, Duskwood style.


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

#1
andysks

andysks
  • Members
  • 1 650 messages

I copied the Duskwood scripts to use in an area of mine. Only difference, when I leave the area the spell failure is still there. Only thing I changed was this on the HB event.

 

From,

	object oPC = GetFirstPC();
	object oArea = GetArea(oPC);
	if(oArea != OBJECT_SELF && oArea != GetObjectByTag("2211_wolflair"))
	{
		return;
	}

To,

	object oPC = GetFirstPC();
	object oArea = GetArea(oPC);
	if(oArea != OBJECT_SELF)
	{
		return;
	}

I don't know. It just seemed like the right thing to do. Any clues?



#2
4760

4760
  • Members
  • 1 207 messages

Are you sure OBJECT_SELF is really the area? That's the only reason with the PC not being in the area to explain why the script ends ("return;") without doing nothing.



#3
andysks

andysks
  • Members
  • 1 650 messages

Hi 4760, thanks for the reply.

 

The above part is from the hb script. It shouldn't matter nonetheless. All it does is check if somebody removed the effect (death), and reapply it. It works fine, I just posted it because it's the only thing that got changed from the OC scripts. Anyway, I could have elaborated. This is the OnExit which didn't work (removing the effect).

// Copy of the OC duskwood script to apply spell failure.
//

void DWRemoveAntiMag(object oCreature)
{
	effect eEffect = GetFirstEffect(oCreature);
	while (GetIsEffectValid(eEffect) == TRUE)
	{
		if (GetEffectSubType(eEffect) == SUBTYPE_SUPERNATURAL)
		{
			if (GetEffectType(eEffect) == EFFECT_TYPE_SPELL_FAILURE)
			{
				RemoveEffect(oCreature, eEffect);
			}
		}
		eEffect = GetNextEffect(oCreature);
	}	
}	
	
void main()
{
	object oCreature = GetExitingObject();
	if (GetObjectType(oCreature) == OBJECT_TYPE_CREATURE)
	{
		DWRemoveAntiMag(oCreature);
	}	
}

Something that might help the situation. The exiting of the area happens through a world map transition, which is brought by the use of an item.

Use the item

Bring up the world map gui

Travel.



#4
4760

4760
  • Members
  • 1 207 messages

Ah, OK.

 

Was it done the same way in Duskwood? I'm wondering if the use of the item (therefore, still in the area) bringing up the world map gui prevents the OnExit trigger of the area from running.



#5
andysks

andysks
  • Members
  • 1 650 messages

I guessed the same and this is why I mentioned it. When I get a chance I will add the function of the On Exit on my travel library script, instead of a normal OnExit and see what happens then.



#6
rjshae

rjshae
  • Members
  • 4 491 messages
    object oPC = GetFirstPC();
    object oArea = GetArea(oPC);
    if(oArea != OBJECT_SELF && oArea != GetObjectByTag("2211_wolflair"))
    {
        return;
    }

So in this case it looks like the OBJECT_SELF check is just to make sure this isn't being run by the area heartbeat. If this is run on the PC then it would just drop through rather than returning. I suspect you may have broken it by removing the second check.



#7
Dann-J

Dann-J
  • Members
  • 3 161 messages

When I created an area that imposes spell failure on the party, I decided to make it easier on myself and have the area heartbeat script constantly apply it for 6.1 seconds. That way it wears off by itself within a round of leaving the area, without the need for an OnExit script.


  • kamal_, andysks et 4760 aiment ceci

#8
andysks

andysks
  • Members
  • 1 650 messages

That's actually a really good method.



#9
andysks

andysks
  • Members
  • 1 650 messages

Both versions worked. The problem with my version was what Bob said. OBJECT_SELF was running on the PC...

Changed it to

if(oArea != GetObjectByTag("PL_LIBRARY"))

and worked fine. Thanks.



#10
bealzebub

bealzebub
  • Members
  • 352 messages

I've used the Duskwood scripts with a trigger onenter and onexit instead of an area and it worked good. I wish there was a good wild magic script to go with the anti-magic.



#11
Dann-J

Dann-J
  • Members
  • 3 161 messages

I've used the Duskwood scripts with a trigger onenter and onexit instead of an area and it worked good. I wish there was a good wild magic script to go with the anti-magic.

 

I created a simple wild magic system for a module I'm working on at the moment, via spell hooking. There's a 25% chance of either complete spell failure, the spell casting successfully but with a magical backlash, the spell warping and having undesired effects, or the spell casting normally without any consequences. You never know what will happen in that particular area. Having your fireball polymorph your enemies into frost giants is always fun.

 

I seem to recall a more complex wild magic system on the old vault, but a quick search of the new vault doesn't seem to find it.