Beispiel #1
0
 private void SpawnMobT(ZoneCharacter character, params string[] param)
 {
     ushort id = ushort.Parse(param[1]);
     int count = 1;
     if (param.Length >= 3)
     {
         count = int.Parse(param[2]);
     }
     if (DataProvider.Instance.MobsByID.ContainsKey(id))
     {
         for (int i = 0; i < count; i++)
         {
             Mob mob = new Mob(id, new Vector2(character.Position));
             character.Map.FullAddObject(mob);
         }
     }
     else character.DropMessage("Monster ID not found.");
 }
Beispiel #2
0
 private void Test(ZoneCharacter character, params string[] param)
 {
     ushort skillid = ushort.Parse(param[1]);
     if (!DataProvider.Instance.ActiveSkillsByID.ContainsKey(skillid))
     {
         character.DropMessage("Unknown skill.");
     }
     else if (character.SkillsActive.ContainsKey(skillid))
     {
         character.DropMessage("You already have that skill");
     }
     else
     {
         character.SkillsActive.Add(skillid, new Skill(character, skillid));
         Handler18.SendSkillLearnt(character, skillid);
     }
 }
Beispiel #3
0
 private void Pos(ZoneCharacter character, params string[] param)
 {
     character.DropMessage("Map= {0} ({1}); Pos= {2}:{3};",
         character.Map.MapID,
         character.Map.MapInfo.FullName,
         character.Position.X,
         character.Position.Y);
 }
Beispiel #4
0
 private void SpawnMob(ZoneCharacter character, params string[] param)
 {
     ushort id = ushort.Parse(param[1]);
     if (DataProvider.Instance.MobsByID.ContainsKey(id))
     {
         Mob mob = new Mob((ushort)(param.Length == 2 ? id : (ushort) 1045), new Vector2(character.Position));
         character.Map.FullAddObject(mob);
     }
     else character.DropMessage("Monster ID not found.");
 }
Beispiel #5
0
 private void List(ZoneCharacter character, params string[] param)
 {
     character.DropMessage("Your l33t commands:");
     foreach (var kvp in commands)
     {
         if (kvp.Value.GmLevel <= character.Client.Admin)
         {
             character.DropMessage("{0} {1}", kvp.Key, string.Join(" ", kvp.Value.Parameters));
         }
     }
 }
Beispiel #6
0
 private void Performance(ZoneCharacter character, params string[] param)
 {
     character.DropMessage("Ticks per second on this zone: {0}", Worker.Instance.TicksPerSecond);
 }
Beispiel #7
0
 private void ItemCommand(ZoneCharacter character, params string[] param)
 {
     ushort id = ushort.Parse(param[1]);
     byte amount = 1;
     if (param.Length > 2)
     {
         amount = byte.Parse(param[2]);
     }
       // character.GiveItem(id,amount);
     switch (character.GiveItem(id, amount))
     {
         case FiestaLib.InventoryStatus.Full:
             Handler12.InventoryFull(character);
             return;
         case FiestaLib.InventoryStatus.NotFound:
             character.DropMessage("Item not found.");
             return;
     }
 }
Beispiel #8
0
        private void IsGay(ZoneCharacter character, params string[] param)
        {
            ZoneClient otherclient = ClientManager.Instance.GetClientByName(param[1]);
            if (otherclient == null || otherclient.Character == null)
            {
                character.DropMessage("Character not found.");
            }
            ZoneCharacter other = otherclient.Character;

            Question question = new Question("Are you gay?", new QuestionCallback(AnswerGay), character);
            question.Add("Yes", "No", "Boobs!");
            other.Question = question;
            question.Send(other);
        }
Beispiel #9
0
 private void CommandParam(ZoneCharacter character, params string[] param)
 {
     string input = param[1];
     string request;
     if (!input.StartsWith("&"))
     {
         request = "&" + input;
     }
     else request = input;
     CommandInfo info;
     if (commands.TryGetValue(request, out info))
     {
         string output = request + ": ";
         if (info.Parameters.Length > 0)
         {
             foreach (var par in info.Parameters)
             {
                 output += "[" + par + "] ";
             }
         }
         else output += "None";
         character.DropMessage(output);
     }
     else character.DropMessage("Command not found.");
 }
Beispiel #10
0
        private void ChangeMap(ZoneCharacter character, params string[] param)
        {
            ushort mapid = 0;
            if (!ushort.TryParse(param[1], out mapid))
            {
                param[1] = param[1].ToLower();
                var map = DataProvider.Instance.MapsByID.Values.ToList().Find(m => m.ShortName.ToLower() == param[1]);
                if (map != null)
                {
                    mapid = map.ID;
                }
                else
                {
                    character.DropMessage("Map not found");
                    return;
                }
            }
            else
            {
                if (!DataProvider.Instance.MapsByID.ContainsKey(mapid))
                {
                    character.DropMessage("Map not found");
                    return;
                }
            }

            if (param.Length > 2)
            {
                int x = int.Parse(param[2]);
                int y = int.Parse(param[3]);
                character.ChangeMap(mapid, x, y);
            }
            character.ChangeMap(mapid);
        }
Beispiel #11
0
 private void AdminLevel(ZoneCharacter character, params string[] param)
 {
     Log.WriteLine(LogLevel.Debug, "GM {0} authenticated ingame.", character.Name);
     character.DropMessage("Admin level is {0}", character.Client.Admin);
     InterHandler.SendWorldMessage(FiestaLib.WorldMessageTypes.Level20, "Fun!");
 }