Welcome
Welcome to <strong>SunUO</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Season changing for SunUO

Release your custom scripts to the public. By posting your scripts here it is automatically licensed under the terms of the GPL.

Season changing for SunUO

Postby SiENcE on Fri Aug 24, 2007 12:22 pm

I'm backported some scripts from RunUO2 to SunUO.

here is the first:

Season.cs
Code: Select all
/// 24/08/2007 Modification by SiENcE for SunUO support
using System;
using Server;
using Server.Network;
using Server.Mobiles;
using System.IO;
using System.Text;
using System.Collections;
using System.Net;
using Server.Accounting;
using Server.Items;
using Server.Menus;
using Server.Menus.Questions;
using Server.Menus.ItemLists;
using Server.Spells;
using Server.Targeting;
using Server.Targets;
using Server.Gumps;

namespace Server.Scripts.Commands
{
   public class SetSeason
   {
      public static void Initialize()
      {
         Server.Commands.Register("Season", AccessLevel.Seer, new CommandEventHandler(Season_OnCommand));
      }

      [Usage( "Season [number]" )]
      [Description( "Sets season." )]
      public static void Season_OnCommand(CommandEventArgs e)
      {
         Map map;

         if(e.Length == 1)
         {
            for(int i = 1; i < 5; i++)
            {
               map = Map.Maps[i]; //Map.AllMaps[i];
               map.Season = (e.GetInt32(0));

               foreach(NetState state in NetState.Instances)
               {
                  Mobile m = state.Mobile;
                  if(m != null)
                  {
                     state.Send(SeasonChange.Instantiate(m.GetSeason(), true));
                     m.SendEverything();
                  }
               }
            }
         }
      }
   }
}
SiENcE
 
Posts: 14
Joined: Fri Aug 24, 2007 12:19 pm
Location: Munich

Return to Script Releases

Who is online

Users browsing this forum: No registered users and 0 guests

cron