Ejemplo n.º 1
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                var movId = (short)trigger.Text.NextInt(1);

                foreach (var chr in trigger.Args.Character.GetNearbyCharacters(true))
                {
                    Asda2CharacterHandler.SendEmoteResponse(chr, movId);
                }
            }
Ejemplo n.º 2
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                short emote = (short)trigger.Text.NextInt(1);

                foreach (Character nearbyCharacter in (IEnumerable <Character>)trigger.Args.Character
                         .GetNearbyCharacters <Character>(true))
                {
                    Asda2CharacterHandler.SendEmoteResponse(nearbyCharacter, emote, (byte)1, 0.0596617f, -0.9982219f);
                }
            }
Ejemplo n.º 3
0
 public static void StartDigRequest(IRealmClient client, RealmPacketIn packet)
 {
     if (client.ActiveCharacter.IsDigging)
     {
         client.ActiveCharacter.SendSystemMessage("You already digging.");
         SendStartDigResponseResponse(client, Asda2DigResult.DiggingFail);
     }
     else if (client.ActiveCharacter.IsInCombat || client.ActiveCharacter.IsMoving)
     {
         client.ActiveCharacter.SendSystemMessage("You can't dig while moving or fighting.");
         SendStartDigResponseResponse(client, Asda2DigResult.DiggingFail);
     }
     else
     {
         Asda2Item mainWeapon = client.ActiveCharacter.MainWeapon as Asda2Item;
         if (mainWeapon == null || mainWeapon.Category != Asda2ItemCategory.Showel)
         {
             SendStartDigResponseResponse(client, Asda2DigResult.YouHaveNoShowel);
         }
         else
         {
             Asda2Item asda2Item = client.ActiveCharacter.Asda2Inventory.Equipment[10];
             bool      flag      = asda2Item != null && asda2Item.Category == Asda2ItemCategory.DigOil;
             if ((flag
        ? (client.ActiveCharacter.MapId < (MapId)Asda2DigMgr.PremiumMapDiggingTemplates.Count
          ? 1
          : 0)
        : (client.ActiveCharacter.MapId < (MapId)Asda2DigMgr.MapDiggingTemplates.Count ? 1 : 0)) ==
                 0)
             {
                 client.ActiveCharacter.YouAreFuckingCheater(
                     "Trying to dig in unknown location : " + client.ActiveCharacter.MapId, 10);
                 SendStartDigResponseResponse(client, Asda2DigResult.DiggingFail);
             }
             else if ((flag
             ? Asda2DigMgr.PremiumMapDiggingTemplates[(byte)client.ActiveCharacter.MapId]
             : Asda2DigMgr.MapDiggingTemplates[(byte)client.ActiveCharacter.MapId]).MinLevel >
                      client.ActiveCharacter.Level)
             {
                 SendStartDigResponseResponse(client,
                                              Asda2DigResult.YouUnableToDigInThisLocationDueLowLevel);
             }
             else
             {
                 client.ActiveCharacter.CancelAllActions();
                 client.ActiveCharacter.IsDigging = true;
                 ++client.ActiveCharacter.Stunned;
                 client.ActiveCharacter.Map.CallDelayed(6000, () => Asda2DigMgr.ProcessDig(client));
                 Asda2CharacterHandler.SendEmoteResponse(client.ActiveCharacter, 110, 0, 0.0f,
                                                         0.0f);
                 SendStartDigResponseResponse(client, Asda2DigResult.Ok);
             }
         }
     }
 }
Ejemplo n.º 4
0
        [PacketHandler(RealmServerOpCode.StartDig)]//5428
        public static void StartDigRequest(IRealmClient client, RealmPacketIn packet)
        {
            //var accId = packet.ReadInt32();//default : 340701Len : 4
            if (client.ActiveCharacter.IsDigging)
            {
                client.ActiveCharacter.SendSystemMessage("You already digging.");
                SendStartDigResponseResponse(client, Asda2DigResult.DiggingFail);
                return;
            }
            if (client.ActiveCharacter.IsInCombat || client.ActiveCharacter.IsMoving)
            {
                client.ActiveCharacter.SendSystemMessage("You can't dig while moving or fighting.");
                SendStartDigResponseResponse(client, Asda2DigResult.DiggingFail);
                return;
            }
            var showel = client.ActiveCharacter.MainWeapon as Asda2Item;

            if (showel == null || showel.Category != Asda2ItemCategory.Showel)
            {
                SendStartDigResponseResponse(client, Asda2DigResult.YouHaveNoShowel);
                return;
            }
            var oilItem  = client.ActiveCharacter.Asda2Inventory.Equipment[10];
            var isUseOil = oilItem != null && oilItem.Category == Asda2ItemCategory.DigOil;

            if (!(isUseOil ? client.ActiveCharacter.MapId < (MapId)Asda2DigMgr.PremiumMapDiggingTemplates.Count : client.ActiveCharacter.MapId < (MapId)Asda2DigMgr.MapDiggingTemplates.Count))
            {
                client.ActiveCharacter.YouAreFuckingCheater("Trying to dig in unknown location : " + client.ActiveCharacter.MapId, 10);
                SendStartDigResponseResponse(client, Asda2DigResult.DiggingFail);
                return;
            }

            if (isUseOil)
            {
                Asda2TitleChecker.OnUseAutoFishDig(client.ActiveCharacter);
            }
            var templ = isUseOil
                                 ? Asda2DigMgr.PremiumMapDiggingTemplates[(byte)client.ActiveCharacter.MapId]
                                 : Asda2DigMgr.MapDiggingTemplates[(byte)client.ActiveCharacter.MapId];

            if (templ.MinLevel > client.ActiveCharacter.Level)
            {
                SendStartDigResponseResponse(client, Asda2DigResult.YouUnableToDigInThisLocationDueLowLevel);
                return;
            }
            client.ActiveCharacter.CancelAllActions();
            client.ActiveCharacter.IsDigging = true;
            client.ActiveCharacter.Stunned++;
            client.ActiveCharacter.Map.CallDelayed(6000, () => Asda2DigMgr.ProcessDig(client));
            Asda2CharacterHandler.SendEmoteResponse(client.ActiveCharacter, 110, 0, 0, 0);
            SendStartDigResponseResponse(client, Asda2DigResult.Ok);
        }