Exemple #1
0
        public void Finds_nearest_item_on_ground()
        {
            injection.ServerApi.PlayerEntersWorld(new Location2D(1000, 1000));

            injection.ServerApi.AddNewItemToGround(0xEED, new Location2D(1005, 1005), 20, (Color)0);
            var nearestId = injection.ServerApi.AddNewItemToGround(0xEED, new Location2D(1001, 1001), 15, (Color)0);

            injection.InjectionHost.UO.FindType(0xEED, -1, 1);

            injection.InjectionHost.UO.GetSerial("finditem").Should().Be(NumberConversions.ToHex((int)nearestId));
        }
Exemple #2
0
        public void JournalSerial_returns_serial_at_zero_based_journal_index()
        {
            injection.ServerApi.PlayerEntersWorld(new Location2D(1000, 1000));

            var asdfSerial = injection.Me.PlayerId;
            var qwerSerial = injection.Me.PlayerId + 1;
            var zxcvSerial = injection.Me.PlayerId + 2;

            injection.ServerApi.Say(asdfSerial, "player name", "asdf");
            injection.ServerApi.Say(qwerSerial, "player name", "qwer");
            injection.ServerApi.Say(zxcvSerial, "player name", "zxcv");

            injection.InjectionHost.UO.JournalSerial(0).Should().Be(NumberConversions.ToHex((int)zxcvSerial));
            injection.InjectionHost.UO.JournalSerial(1).Should().Be(NumberConversions.ToHex((int)qwerSerial));
            injection.InjectionHost.UO.JournalSerial(2).Should().Be(NumberConversions.ToHex((int)asdfSerial));
        }
Exemple #3
0
        public void JournalSerial_returns_same_serial_at_found_index_decreased_by_1()
        {
            injection.ServerApi.PlayerEntersWorld(new Location2D(1000, 1000));

            var asdfSerial = injection.Me.PlayerId;
            var qwerSerial = injection.Me.PlayerId + 1;
            var zxcvSerial = injection.Me.PlayerId + 2;

            injection.ServerApi.Say(asdfSerial, "player name", "asdf");
            injection.ServerApi.Say(qwerSerial, "player name", "qwer");
            injection.ServerApi.Say(zxcvSerial, "player name", "zxcv");

            var foundIndex = injection.InjectionHost.UO.InJournal("asdf");

            foundIndex.Should().Be(3);

            injection.InjectionHost.UO.JournalSerial(foundIndex - 1).Should().Be(NumberConversions.ToHex((int)asdfSerial));
        }