Author Topic: Can ActionCastFakeSpell be countered?  (Read 1540 times)

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« on: August 19, 2011, 10:18:53 am »


               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.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #1 on: August 19, 2011, 10:30:30 am »


               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
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #2 on: August 19, 2011, 08:32:34 pm »


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

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #3 on: August 19, 2011, 09:10:42 pm »


               

ShaDoOoW wrote...

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

 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.  
               
               

               
            

Legacy_Hardcore UFO

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #4 on: August 19, 2011, 09:59:29 pm »


               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.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #5 on: August 19, 2011, 10:38:48 pm »


               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 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #6 on: August 19, 2011, 11:34:17 pm »


               @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 .
                     
                  


            

Legacy_Hardcore UFO

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #7 on: August 20, 2011, 12:02:09 am »


               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.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #8 on: August 20, 2011, 12:27:27 am »


               Sorry for the mistake UFO.   That did not come out right at all.   Sorry Again I did not mean to offend.
               
               

               
            

Legacy_Hardcore UFO

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #9 on: August 20, 2011, 12:38:01 am »


               I'm not offended. I guess my mock-hurt didn't come out right. '<img'>

Because really, I am a total noob.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #10 on: August 20, 2011, 01:11:09 am »


               

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.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #11 on: August 20, 2011, 01:50:33 am »


               

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 '<img'>

 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).
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #12 on: August 20, 2011, 01:51:03 am »


               

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 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #13 on: August 20, 2011, 02:06:08 am »


               

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.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Can ActionCastFakeSpell be countered?
« Reply #14 on: August 20, 2011, 02:56:14 am »


               Well, Guess that teaches me for meddleing in the affairs of wizards.