Hi

I'm working on revamping Peoharen's Blue Magic system. I *think* I have all the changes I need to have made except these two errors I can't figure out.
Code:
------------------------------------------------------------------------------------------------------------------------
ServUO - [https://www.servuo.com] Version 0.5, Build 6472.26597
Errors:
+ Customs/Blue Magic Expansion/Blue Magic/Spells/Traveler.cs:
    CS1729: Line 79: 'Server.Map' does not contain a constructor that takes 0 arguments
    CS1729: Line 110: 'Server.Map' does not contain a constructor that takes 0 arguments
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

The code I'm working with is in SpellHelper.cs

Code:
        public static bool FindValidSpawnLocation(Map map, ref Point3D p, bool surroundingsOnly)
        {
            if (map == null)    //sanity
                return false;

            if (!surroundingsOnly)
            {
                if (map.CanSpawnMobile(p))    //p's fine.
                {
                    p = new Point3D(p);
                    return true;
                }

                int z = map.GetAverageZ(p.X, p.Y);

                if (map.CanSpawnMobile(p.X, p.Y, z))
                {
                    p = new Point3D(p.X, p.Y, z);
                    return true;
                }
            }

            int offset = Utility.Random(8) * 2;

            for (int i = 0; i < m_Offsets.Length; i += 2)
            {
                int x = p.X + m_Offsets[(offset + i) % m_Offsets.Length];
                int y = p.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];

                if (map.CanSpawnMobile(x, y, p.Z))
                {
                    p = new Point3D(x, y, p.Z);
                    return true;
                }
                else
                {
                    int z = map.GetAverageZ(x, y);

                    if (map.CanSpawnMobile(x, y, z))
                    {
                        p = new Point3D(x, y, z);
                        return true;
                    }
                }
            }

            return false;
        }


AND

Code:
else
                {
                    Caster.SendMessage( "Teleporting to " + point.X.ToString() + ", " + point.Y.ToString() );
                    Caster.Mana -= ScaleMana( GetMana() );
                    /*blue magic*/
                    Server.Map server_map = new Server.Map();
                    Caster.MoveToWorld( point, server_map );
                    /* blue magic */
                    Effects.SendLocationParticles( EffectItem.Create( new Point3D ( point.X, point.Y, point.Z ), Caster.Map, EffectItem.DefaultDuration ), 0x3716, 7, 10, 1266, 3, 5052, 0 );
                    Effects.SendLocationParticles( EffectItem.Create( new Point3D ( point.X, point.Y, point.Z+20 ), Caster.Map, EffectItem.DefaultDuration ), 0x3716, 7, 10, 1266, 3, 5052, 0 );
                    Effects.SendLocationParticles( EffectItem.Create( new Point3D ( point.X, point.Y, point.Z+40 ), Caster.Map, EffectItem.DefaultDuration ), 0x3716, 7, 10, 1266, 3, 5052, 0 );
                    Effects.SendLocationParticles( EffectItem.Create( new Point3D ( point.X, point.Y, point.Z+60 ), Caster.Map, EffectItem.DefaultDuration ), 0x3716, 7, 10, 1266, 3, 5052, 0 );

                }
 
I mean the error tells you whats wrong. There is no Constructor for Map that has 0 paramenters
public Map(int mapID, int mapIndex, int fileIndex, int width, int height, int season, string name, MapRules rules)

that is the actual one, BUT you wouldnt want to create a new map. So use something like Map.Felucca or Map.Trammel

Code:
Server.Map server_map = new Server.Map();
Caster.MoveToWorld( point, server_map );

so this would be something like

Code:
Caster.MoveToWorld( point, Map.Trammel);
 
I'm confused. How do I differentiate between maps. If its asking for one map, how do I handle having multiple maps?
 
it was just an example you can supply the map from anywhere, the casters map, a runes stored map reference, anything you like. But you wouldnt want to create a new map
 
Thats because thats the targeted map, where your player will be after the teleport. So you supply whatever map you will want to go there by any kind of reference or you hard code it, depending on how you want it to work
 
PyrO: So say I want to supply a casters map. How would I go about doing that? I want to give the player the map to choose.

Code:
Caster.MoveToWorld( point, Map.Trammel)

So what mechanism will allow me (in this case) to point to Trammel?
 
well how you would supply the map is to you, but you would then do
Caster.MoveToWorld( point, targetMap);
 
That's what I"m lost on. How to supply the map. Is there a map object that I could somehow ask the player to click on to travel?
 
well thats up to you, like I said. You either do it with a gump, something like a rune, random, speech command ... command itself. Its really up to you. All you need to do is call it so that you do get the value of the map, for the destination you want to go to
 
Just an FYI, I got the Blue Magic Expansion compiling and (although I haven't done the quests myself) seemingly working.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back