Aller au contenu

Photo

Can ActionCastFakeSpell be countered?


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

#1
Baaleos

Baaleos
  • Members
  • 1 330 messages
I am working on a 'Magic District' to a city in my PW.

I want to have student mages, practicing magic.

I would like to have some mages scripted to cast fake spells at eachother, and have them counter them etc.


Is this possible?


I dont want to use real spells, on the off chance that a real spell will get through, cause damage, or cause a faction war.

Mordenkaines Disjunction is more a less the universal Counter Spell, if i make sure each mage has this spell, they should be able to counter eachother, as long as they make the dc roll/lore check.
I just dont know if Fake Spells are counterable.

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
I have not worked wit counter spells, So i am nor sure how they work that well. 
If the fake spell is not firing the event. you can always singnal the event as if the spell was really cast.

Function - SignalEvent

Function - EventSpellCastAt

#3
Shadooow

Shadooow
  • Members
  • 4 470 messages
I think they cant but never tried actually. But got better solution: just wont let actuall spell to trigger via spellhook then ;)

#4
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

ShaDoOoW wrote...

I think they cant but never tried actually. But got better solution: just wont let actuall spell to trigger via spellhook then ;)

 If you stop the spell from firing with a spell hook.  It still will not signal the event that the spell was cast at the target.  Therefore he still will not respond.  After all it is the impact script that singnials the event that the spell was cast at the NPC. 

  Still after a little thought instead of making sure my actors always had enough spells to cast, I think it may be better to do this with user defined events.   Just give each spell cast at them Npc a unique user defined event fo tor his reactions to the spell cast at him.  Basicly either cast a Fake spell or Real Cheat spell in responce to the incomming user defined  event.  

#5
Hardcore UFO

Hardcore UFO
  • Members
  • 86 messages
I may be beside the mark but after the question what came to mind was to simly have the NPCs using VFX/actions to simulate spells, with the counterspeller delayed by 3 seconds (both NPC or sets of NPCs started by the same trigger to synchronize). Saves the trouble of putting in new entries to the spells.2da for a seldom used spell.

#6
Pstemarie

Pstemarie
  • Members
  • 2 745 messages
In addition to the universal counters (see the wiki), counterspelling is controlled by spells.2da. The spell line ID# listed in the Counter1 or Counter2 columns is the spell that can be used to counter that particular spell. Counterspell is a casting mode, meaning that, if I understand correctly, when a spellcaster is targeted with a spell and they have the appropriate counter available they will attempt to counter the spell cast at them.

I am not sure if ActionCastFakeSpell... fires the OnSpellCastAt Event. I would assume NOT, because the spellscript is never fired and therefore the event is never signaled. However, it does provoke attacks of opportunity.

Since counterspelling is (seems to be) powered by the OnSpellCastAt Event, if ActionCastFakeSpell...does not signal that event to fire then the counter will never be made.

Furthermore, the Counter1 and Counter2 columns in spells.2da are horrbily WRONG. The majority of appropriate counters are not listed and several spells that should not have a counter are listed as having one.

Modifié par Pstemarie, 20 août 2011 - 09:12 .


#7
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
@Pstemarie; All good points. But I also have in the back of my mind that this is baaleos that is asking and there is no way of telling what he has allready added or fixed in the 2da.  Or if he has gotten counter spelling to work in other places something that I have never seen work.  But then I mormally don't play mages either. I have not in fact plaed a mage since the 2.0 rule set and that one was hybread between DnD and the ICE rule sets.     


Hardcore UFO wrote...

I may be beside the mark but after the question what came to mind was to simly have the NPCs using VFX/actions to simulate spells, with the counterspeller delayed by 3 seconds (both NPC or sets of NPCs started by the same trigger to synchronize). Saves the trouble of putting in new entries to the spells.2da for a seldom used spell.


  No one here has sugested adding new lines to the 2da file.   Also having the NPC react to the spell allows more freedon and randomness then the caster's script deciding how the NPC being cast at will respond.   Having the NPC make his own reactions would allow you to make each NPC have there own quricks as to how they handle each situation.   Here is a verry simplistic example of what Im talking about. 

When you have a NPC cast the FakeSpell at amother the code would be something like this.  code snipit to cast the spell.

...
     event eFakeSpellCastAt =EventUserDefined( SPELL_HOLD_PERSON);
   ActionCastFakeSpellAtObject(SPELL_HOLD_PERSON,oTarget);
  
SignalEvent(oTarget,eFakeSpellCastAt);
SetLocalObject(oTarget,"LAST_CASTER",OBJECT_SELF);
... 



Now when that code runs it will cause the OnUserDefined event script to run on the target npc.   So you would place a script somelike the following in that NPC OnUserDefined Event. 

void main()
{

    int    nSpelID = GetUserDefinedEventNumber();
    object oCaster= GetLocalObject(OBJECT_SELF,"LAST_CASTER");

    int oCounterSpell= StringToInt(Get2DAString("spells","Counter1", nSpelID));
    if ( oCounterSpell== 0)   oCounterSpell = SPELL_GREATER_DISPELLING;

    ActionCastFakeSpellAtObject(oCounterSpell,oCaster);
}

 

Now that is over simplistic.  but it shows the basic Idea.

Edited to remove mistake.

Modifié par Lightfoot8, 19 août 2011 - 11:26 .


#8
Hardcore UFO

Hardcore UFO
  • Members
  • 86 messages
Stop laughing at me! I'm not a noob, I'm just... rusty. Yeah.

But if it's doable without 2da edits, all the better. I just assumed having NPCs using non-firing spells needed to be added in.

#9
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Sorry for the mistake UFO. That did not come out right at all. Sorry Again I did not mean to offend.

#10
Hardcore UFO

Hardcore UFO
  • Members
  • 86 messages
I'm not offended. I guess my mock-hurt didn't come out right. :P

Because really, I am a total noob.

#11
WhiZard

WhiZard
  • Members
  • 1 204 messages

Pstemarie wrote...

Firstly, Mordenkainen's Disjunction is NOT a counterspell. It is a spell with the following effects:


The dispel line of spells (including mords) are universal counters.  Each of them covers a range of spells by spell level.  Mords does all spells level 9 or less.  Greater dispelling level 6 or less.  Dispel magic 3 or less. Lesser dispel 2 or less.  These spells are taken in addition to the 2da counters.

#12
WhiZard

WhiZard
  • Members
  • 1 204 messages

Lightfoot8 wrote...

ShaDoOoW wrote...

I think they cant but never tried actually. But got better solution: just wont let actuall spell to trigger via spellhook then ;)

 If you stop the spell from firing with a spell hook.  It still will not signal the event that the spell was cast at the target.  Therefore he still will not respond.  After all it is the impact script that singnials the event that the spell was cast at the NPC. 


Given that counterspell interferes with the casting animation,  the signal event will not fire anyways, as the script is blocked.  Counterspelling has nothing to do with impact it has to do with when the targeted creature is trying to cast any spell (even defensive on himself).

#13
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

WhiZard wrote...

Pstemarie wrote...

Firstly, Mordenkainen's Disjunction is NOT a counterspell. It is a spell with the following effects:


The dispel line of spells (including mords) are universal counters.  Each of them covers a range of spells by spell level.  Mords does all spells level 9 or less.  Greater dispelling level 6 or less.  Dispel magic 3 or less. Lesser dispel 2 or less.  These spells are taken in addition to the 2da counters.


I stand corrected - should have checked the wiki instead of going off memory - ammended my original post. However, I stand behind the remainder of my response.

Modifié par Pstemarie, 20 août 2011 - 12:54 .


#14
WhiZard

WhiZard
  • Members
  • 1 204 messages

Pstemarie wrote...
Since counterspelling is powered by the OnSpellCastAt Event, if ActionCastFakeSpell...does not signal that event to fire then the counter will never be made.


Not powered by OnSpellCastAt event.  Though I have just tested and fake spells cannot be countered, though ShadOoOw does seem to have the correct solution, if mimicking counterspells is what is being attempted.

#15
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Well, Guess that teaches me for meddleing in the affairs of wizards.

#16
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

WhiZard wrote...

Pstemarie wrote...
Since counterspelling is powered by the OnSpellCastAt Event, if ActionCastFakeSpell...does not signal that event to fire then the counter will never be made.


Not powered by OnSpellCastAt event.  Though I have just tested and fake spells cannot be countered, though ShadOoOw does seem to have the correct solution, if mimicking counterspells is what is being attempted.


I wonder what triggers it then. I had assumed it was the OnSpellCastAtEvent - something hard-coded, but I if I understand correctly what I've read in the Lexicon and wiki, that event is triggered only from the SignalEvent function? Now I'm really confused Image IPB

#17
WhiZard

WhiZard
  • Members
  • 1 204 messages

Pstemarie wrote...

WhiZard wrote...

Pstemarie wrote...
Since counterspelling is powered by the OnSpellCastAt Event, if ActionCastFakeSpell...does not signal that event to fire then the counter will never be made.


Not powered by OnSpellCastAt event.  Though I have just tested and fake spells cannot be countered, though ShadOoOw does seem to have the correct solution, if mimicking counterspells is what is being attempted.


I wonder what triggers it then. I had assumed it was the OnSpellCastAtEvent - something hard-coded, but I if I understand correctly what I've read in the Lexicon and wiki, that event is triggered only from the SignalEvent function? Now I'm really confused Image IPB

Likely whatever triggers the casting animation, also triggers the counterspell casting animations and the actual counterspell.

Modifié par WhiZard, 20 août 2011 - 03:06 .


#18
ffbj

ffbj
  • Members
  • 593 messages
Why not just make them immune to everything and then they can cast real spells at each-other, and counter-spells but never get hurt. Like make them immune to all spells below a certain level and then just give them spells just below that level. Cheesy and easy, but that would be my approach.So like just give them all amulets that make them immune to spells below a certain level, and just make sure they don't have any spells above that level.  Seems simple enough.

Modifié par ffbj, 22 août 2011 - 02:47 .


#19
WhiZard

WhiZard
  • Members
  • 1 204 messages

ffbj wrote...

Why not just make them immune to everything and then they can cast real spells at each-other, and counter-spells but never get hurt. Like make them immune to all spells below a certain level and then just give them spells just below that level. Cheesy and easy, but that would be my approach.So like just give them all amulets that make them immune to spells below a certain level, and just make sure they don't have any spells above that level.  Seems simple enough.


But a few, like grease and darkness can get through.  Protection from spells only works in so far as a spell resistance check is made and used to resist all effects.

But I would like more feedback from the OP insofar as how close to the automatic counterspelling does he/she wish to be.

#20
ffbj

ffbj
  • Members
  • 593 messages
If you have immunity to all spells below a certain level would they still affect you? It's not spell resistance it's no effect from spells below a certain level. At least that would be my understanding.

#21
WhiZard

WhiZard
  • Members
  • 1 204 messages

ffbj wrote...

If you have immunity to all spells below a certain level would they still affect you? It's not spell resistance it's no effect from spells below a certain level. At least that would be my understanding.


Spell Immunity is only called by the ResistSpell() command.

#22
Shadooow

Shadooow
  • Members
  • 4 470 messages

Pstemarie wrote...

WhiZard wrote...

Pstemarie wrote...
Since counterspelling is powered by the OnSpellCastAt Event, if ActionCastFakeSpell...does not signal that event to fire then the counter will never be made.


Not powered by OnSpellCastAt event.  Though I have just tested and fake spells cannot be countered, though ShadOoOw does seem to have the correct solution, if mimicking counterspells is what is being attempted.


I wonder what triggers it then. I had assumed it was the OnSpellCastAtEvent - something hard-coded, but I if I understand correctly what I've read in the Lexicon and wiki, that event is triggered only from the SignalEvent function? Now I'm really confused Image IPB

Yea. WhiZard explained it correctly. SignalEvent has no effect on counterspelling which is completely hardcoded and cannot be altered without nwnx. Only SignalEvent effects are - making initiative check and strip invisibility/GS in case of hostile spell and triggering monsters AI/custom OnSpellCastAt script.