Spell events

Is it possible to cause an NPC to cast a spell when i hit it with one of my own?
Can NPCs cast offensive spells on one another if i mark them as defensive?
i.e. a defensive fire ball spell. could such a spell be cast from one NPC on another?
Im trying to make a confuse spell that causes an NPC to cast negetive spells at allies
on a set interval and duration.

------------------
Humanity will crumble under tides of blood.

Is this not somewhat like your chain-lightning question???

------------------
(url="http://"http://geocities.com/plasticwarz/main.html")http://geocities.com...cwarz/main.html(/url)
(url="http://"http://www.geocities.com/coldstoneGE/")http://www.geocities.com/coldstoneGE/(/url) <~~ Check out my latest CGE project!!!

yes and no, i messed around and was wondering if NPCs can cast offensive spell on each other if i mark them as defensive, then ,yes, i could do both my confusion spell and the chain lightening spell. mostly i need to know if i can make an NPC cast a spell throu the use of events attached to a spell i cast on them.

------------------
Humanity will crumble under tides of blood.

Quote

Originally posted by DeathWalker:
Is it possible to cause an NPC to cast a spell when i hit it with one of my own?

No. There is no "hit by spell" event on an NPC. Furthermore, the event objects all default to the player. Calling a "Spell wizard" to launch a spell will make the player cast it, not the NPC that was just targetted.

Quote

Can NPCs cast offensive spells on one another if i mark them as defensive?

Yes, but not in this way. Offensive/defensive only matters in regards to whether the NPC will cast it in order to attack or defend. You will want to make the target "allies" to get the NPC to cast it on other aggressive NPCs. Passive NPCs can never cast spells, nor can they be targetted.

Quote

i.e. a defensive fire ball spell. could such a spell be cast from one NPC on another?

Yes.

Quote

Im trying to make a confuse spell that causes an NPC to cast negetive spells at allies on a set interval and duration.

There is one problem with this, in that you can't alter an existing NPC. You can't add a spell to its spell list, nor tell it to cast a spell. You can't switch its mode from aggressive to defensive caster.

You can only replace an NPC with a different one, which would have the same result as what you want. HOWEVER(here's the infamous "but"), you can not do this externally of the NPC. Ie, you can't cast a spell at an NPC and have it switch the NPC out. The reason is that you can't get the coordinates of the NPC unless the NPCs events are run, which does not happen with a player-initiated spell.

Make sense?

------------------
(url="http://"http://stark.evula.net/pogwalkthrough.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://stark.evula.net/plugins/dev_tools.htm")PoG Dev Tools(/url) | (url="http://"http://stark.evula.net/plugins/spells_expander.htm")Spells Expander(/url)
(url="http://"http://stark.evula.net")Stark.evula.net(/url) | (url="http://"http://www.evula.net")EVula.net(/url) | (url="http://"http://mail.ambrosiasw.com/mailman/listinfo/coldstone_dev")Coldstone-dev mailing list(/url) | (url="http://"http://ucplugs.evula.net/pog.html")PoG Upcoming Plug-Ins Directory(/url)

**

Quote

You can only replace an NPC with a different one, which would have the same result as what you want. HOWEVER(here's the infamous "but"), you can not do this externally of the NPC. Ie, you can't cast a spell at an NPC and have it switch the NPC out. The reason is that you can't get the coordinates of the NPC unless the NPCs events are run, which does not happen with a player-initiated spell.

**

Quote

Originally posted by Debra:
~snip~

Yeah, this should work Debra. As long as you kill the NPC then its death event will be run and you can then fiddle with the NPC.

In PoG, the "rescue the general" quest did this; when the death knight was killed it was removed and Decimus was placed in its place(along with a funky stamp control animation). Since the death knight was killed, its death event was run and its coordinates were saved, allowing for Decimus to be placed at the exact coordinates of the death knight.

------------------
(url="http://"http://stark.evula.net/pogwalkthrough.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://stark.evula.net/plugins/dev_tools.htm")PoG Dev Tools(/url) | (url="http://"http://stark.evula.net/plugins/spells_expander.htm")Spells Expander(/url)
(url="http://"http://stark.evula.net")Stark.evula.net(/url) | (url="http://"http://www.evula.net")EVula.net(/url) | (url="http://"http://mail.ambrosiasw.com/mailman/listinfo/coldstone_dev")Coldstone-dev mailing list(/url) | (url="http://"http://ucplugs.evula.net/pog.html")PoG Upcoming Plug-Ins Directory(/url)

so in that case, can a death event be run only if it was caused by a speceific spell???
if so i can make the confuse spell an instant kill spell, then trigger the death event
for a confuse effect only if the death was caused by the confuse spell.

------------------
Humanity will crumble under tides of blood.
irc: Draco/Dracon

Quote

Originally posted by DeathWalker:
**so in that case, can a death event be run only if it was caused by a speceific spell???
if so i can make the confuse spell an instant kill spell, then trigger the death event
for a confuse effect only if the death was caused by the confuse spell. **

Possibly.

What you could do, in theory, is create a global for the confusion spell. When the spell is cast it trips this global and then proceeds to dish out a lot of damage to the target. In the death event of the NPC you will check the global and if set proceed to the confusion spell stuff. Be sure to reset the global else every death of this NPC from here out will trip the confusion death sequence.

NOTE: There is 1 caveat to all of this that may not allow for this to work. I don't recall if, in a spell, damage is awarded before or after the "cast" event. I recall running into some extremelly oddly ordered progressions when playing with spells, and I believe that all of the stat adjustments are performed before any of the spell events. If this is indeed the case then the above won't work, as the NPC will die before the global is set. You should check this order before getting too involved.

------------------
(url="http://"http://stark.evula.net/pogwalkthrough.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://stark.evula.net/plugins/dev_tools.htm")PoG Dev Tools(/url) | (url="http://"http://stark.evula.net/plugins/spells_expander.htm")Spells Expander(/url)
(url="http://"http://stark.evula.net")Stark.evula.net(/url) | (url="http://"http://www.evula.net")EVula.net(/url) | (url="http://"http://mail.ambrosiasw.com/mailman/listinfo/coldstone_dev")Coldstone-dev mailing list(/url) | (url="http://"http://ucplugs.evula.net/pog.html")PoG Upcoming Plug-Ins Directory(/url)