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