I'm new to programming, C#, and scripting. I learn fairly fast, however, I need help using the effects in script. Could someone post a simple script of how to call an effect in a script? Something similar to this but using VitaNex effects:
Effects.SendLocationEffect(m.Location, m.Map, 0x3709, 28, 10, 0x1D3, 5);
I've been searching for examples of how to do the effects but haven't found any....If someone could refer me to examples or post a simple example of the syntax that would be very helpful....Thanks in advance!
Depending on what you want to do, there is multiple options available, all require this reference: and if EffectRender is required:
To answer your question directly;
new EffectInfo( m.Location, m.Map, 0x3709, 0x1D3, 28, 10, EffectRender.SemiTransparent ).Send();
There are pre-defined wave and explosion effects that you can use, which you may have seen in a video or two, or used with the [ExplodeFX and [WaveFX commands; These effects are very easy to write:
var effect = new FireExplodeEffect( loc, map, range );
These are very basic examples, there are many more combinations of arguments and properties to be used, Visual Studio's Intellisense should help you discover these.
What if I wanted a monster to use one of these visual effects in conjunction with a damage effect. Take Sand Vortex, for example. Its using m.FixedParticles( 0x36B0, 10, 25, 9540, 2413, 0, EffectLayer.Waist ); for the visual.
You can construct an EffectInfo object for this purpose, but they use the same methods in the Server.Effects class. The convenience of EffectInfo is that you can re-use it multiple times by calling Send() successively.
When it comes to using the explosion effects for dealing damage, it is recommended to provide an effect handler method to be called on each effect in the explosion's queue.
var fx = new FireExplodeEffect(target, target.Map, ExplosionRange)
EffectHandler = e =>
// Don't repeat damage for multiple effects on the same tile
if (e.ProcessIndex != 0)
public virtual void ExplosionDamage(EffectInfo info)
Effects.PlaySound(info.Source.Location, info.Map, ImpactSound);
foreach (var m in
.Where(m => m != null && !m.Deleted && User.CanBeHarmful(m, false, true)))
m.Damage(Utility.RandomMinMax(DamageMin, DamageMax), User, true);
This code can be found in the ThrowableBomb code in Vita-Nex.