Example #1
0
        private GameObject GoCreator()
        {
            var portal =
                Portal.Create(
                    new WorldLocation((MapId)FromMap, new Vector3(FromX + 1000 * FromMap, FromY + 1000 * FromMap)),
                    new WorldLocation((MapId)ToMap, new Vector3(ToX + 1000 * ToMap, ToY + 1000 * ToMap)));
            var spell = new Spell()
            {
                Id = 50000, Range = new SimpleRange(0, 10)
            };
            var effect = new SpellEffect(spell, 0)
            {
                MiscValue  = ToMap,
                MiscValueB = ToX + 1000 * ToMap,
                MiscValueC = ToY + 1000 * ToMap,
                Radius     = 3f,
                EffectType = SpellEffectType.PortalTeleport, ImplicitTargetA = ImplicitSpellTargetType.AllAroundLocation
            };

            spell.Effects    = new SpellEffect[1];
            spell.Duration   = int.MaxValue;
            spell.IsAreaAura = true;

            /*spell.AuraAmplitude = 10000;
             * spell.CastDelay = 10000;*/
            spell.Effects[0] = effect;
            spell.Initialize();
            spell.Init2();
            var aura = new AreaAura(portal, spell);

            aura.Start(null, true);
            return(portal);
        }