Capable Scripter

Vert-I-Go

Well-Known Member
May 17, 2016
55
21
45
North Woods of Wisconsin
I am looking for a capable scripter to help with minor scripts for some systems I am working on.
Systems are customized spell systems which will be released at a later date. Mostly just need some hints on how to accomplish certain effects in spells. Get kinda burnt out from animations and graphics brain goes to goo for scripting lol
 

Vert-I-Go

Well-Known Member
May 17, 2016
55
21
45
North Woods of Wisconsin
Ok I need help with what should be a simple task.
This is for RunUO 2.6
I need a spell script to place a item on ground I have the item script but having issues how to create the script for the spell to place item. its for a fire totem that will shoot fireballs at targets which I have created or had hep being created here is fire totem script I have just need some help with how to place object with spell.
Code:
using System;

using Server;
using Server.Mobiles;
using System.Collections;
using System.Collections.Generic;
using Server.Spells;


namespace Server.Items

{
   
    public class FireTotem : Item
   
    {
               public Mobile m_Owner;       
        public EffectTimer m_Timer;

       
        public static TimeSpan TickDuration = TimeSpan.FromSeconds(3.0);       
       
        public DateTime m_Expiration = DateTime.UtcNow;

            public static int Range = 15;

             
        [Constructable]
            public FireTotem( Mobile owner, double duration ) : base()       
       
        {
            Name = "fire totem";
            Weight = 2.0;
            Movable = false;
                    m_Owner = owner;
           
            m_Expiration = DateTime.UtcNow + TimeSpan.FromSeconds(duration);

           
            Movable = false;      
            if (m_Timer == null)
               
            m_Timer = new EffectTimer(this);

           
            m_Timer.Start(); 
       
        }

            public static bool PlayerCanDamage(Mobile from, Mobile target)
            {
                    if (from == null)
                return false;

                    if (target == null)
                return false;

                    if (!target.Alive || target.IsDeadBondedPet)
                return false;

                    if (!target.CanBeDamaged())
                    return false;

                    if (!from.CanBeHarmful(target))
                return false;
           
                    int NotorietyResult = Notoriety.Compute(from, target);

                    if (NotorietyResult == Notoriety.CanBeAttacked)
                return true;

                    if (NotorietyResult == Notoriety.Criminal)
                return true;

                    if (NotorietyResult == Notoriety.Murderer)
                return true;

                    return false;
            }

       

        public class EffectTimer : Timer
       
        {
           
            public FireTotem m_FireTotem;

           

            public EffectTimer(FireTotem FireTotem): base(TimeSpan.Zero, TickDuration)
           
            {
               
                m_FireTotem = FireTotem;

               
                Priority = TimerPriority.TwoFiftyMS;
           
            }

           

            protected override void OnTick()
           
            {
               
                if (m_FireTotem == null)
               
                {
                   
                    Stop();
                   
                    return;
               
                }

               

                if (m_FireTotem.Deleted)
               
                {
                  
                    Stop();
                   
                    return;
               
                }

               

                if (DateTime.UtcNow >= m_FireTotem.m_Expiration)
               
                {
                   
                    m_FireTotem.Delete();
                   
                    return;
               
                }

               

                Queue m_Queue = new Queue();

                        var nearbyMobiles = m_FireTotem.Map.GetMobilesInRange(m_FireTotem.Location, Range);

               
                   
                foreach (Mobile mobile in nearbyMobiles)
               
                {
                   
                    if (mobile == null) continue;
                                if (mobile.AccessLevel > AccessLevel.Player) continue;
                                if (mobile.Hidden) continue;
                                if (!m_FireTotem.Map.LineOfSight(m_FireTotem.Location, mobile.Location)) continue;

                   
                    if (PlayerCanDamage(m_FireTotem.m_Owner, mobile))
                       
                    m_Queue.Enqueue(mobile);
               
                }

                           Point3D location = m_FireTotem.Location;
                        Map map = m_FireTotem.Map;

                        if (m_Queue.Count > 0)
                                Effects.PlaySound(location, map, 0x226);

                           while (m_Queue.Count > 0)
                        {
                                Mobile mobile = (Mobile)m_Queue.Dequeue();

                                if (mobile == null)
                                    continue;

                                IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 10), map);
                                IEntity endLocation = new Entity(Serial.Zero, new Point3D(mobile.Location.X, mobile.Location.Y, mobile.Location.Z + 5), map);
                   
                   
                    Effects.SendMovingEffect(startLocation, endLocation, 0x36D4, 8, 0, false, false, 0, 0);

                                double targetDistance = Utility.GetDistanceToSqrt(startLocation.Location, endLocation.Location);
                   
                    double destinationDelay = (double)targetDistance * .06;

                                Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                                {
                                       if (mobile == null)
                                            return;

                                    int damage = Utility.RandomMinMax(10, 20);

                                    mobile.PlaySound(0x359);

                                    new Blood().MoveToWorld(mobile.Location, mobile.Map);
                                    AOS.Damage(mobile, damage, 100, 0, 0, 0, 0);
                                });
                        }
           
            }
           
        } 

       
       
        public override void OnAfterDelete()
       
        {
           
            if (m_Timer != null)
           
            {
               
                m_Timer.Stop();
               
                m_Timer = null;
           
            }

           
           
            base.OnAfterDelete();
       
        }

       

        public FireTotem(Serial serial): base(serial)
       
        {
       
        }

       

        public override void Serialize( GenericWriter writer )
       
        {
           
            base.Serialize( writer );
           
            writer.Write( (int) 0 ); 
            writer.Write(m_Expiration);
       
        }

       

        public override void Deserialize(GenericReader reader)
       
        {
           
            base.Deserialize( reader );
   
       
            int version = reader.ReadInt();

           
                     
            if (version >= 0)
           
            {
               
                m_Expiration = reader.ReadDateTime();
           
            }

           
           
                    if (m_Expiration <= DateTime.UtcNow)
                        Delete();           

                    else
                    {
                        if (m_Timer == null)
                            m_Timer = new EffectTimer(this);

                        m_Timer.Start();
                   }
   
        }
   
    }

}
 

zerodowned

Moderator
ServUO Developer
Jun 28, 2014
1,771
219
ok, i'll take a look at it in a little bit. targeting shouldn't be too difficult to get working.
 

Shafev

Well-Known Member
Jan 19, 2019
104
13
if you want to pay for help he help you at a cost your shard will crash.

but i will help you for free.
 

Shafev

Well-Known Member
Jan 19, 2019
104
13
I cant edit it you guys have all edits turned off....

I am sorry zerodowned didn't mean to let my opinions run wild.