public StoneCityMoongateAddon()
        {
            XmlAttach.AttachTo(this, new XmlCitySiege(3000, 60, 60, 1, 1, 5)); //<-------new CitySiege Attachment
            AddonComponent ac = null;

            ac = new AddonComponent(1928);
            AddComponent(ac, -4, -4, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -4, -3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -4, 3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -4, 4, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -3, -4, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -3, -3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -3, -2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -3, 2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -3, 3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -3, 4, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -2, -3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -2, -2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -2, -1, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -2, 0, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -2, 1, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -2, 2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -2, 3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -1, -2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -1, -1, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -1, 0, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -1, 1, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, -1, 2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 0, -2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 0, -1, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 0, 0, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 0, 1, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 0, 2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 1, -2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 1, -1, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 1, 0, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 1, 1, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 1, 2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 2, -3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 2, -2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 2, -1, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 2, 0, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 2, 1, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 2, 2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 2, 3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 3, -4, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 3, -3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 3, -2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 3, 2, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 3, 3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 3, 4, 0);
            ac = new AddonComponent(1929);
            AddComponent(ac, -2, 4, 0);
            ac = new AddonComponent(1929);
            AddComponent(ac, 2, 4, 0);
            ac = new AddonComponent(1931);
            AddComponent(ac, -2, -4, 0);
            ac = new AddonComponent(1931);
            AddComponent(ac, 2, -4, 0);
            ac = new AddonComponent(1932);
            AddComponent(ac, -4, -2, 0);
            ac = new AddonComponent(1932);
            AddComponent(ac, -4, 2, 0);
            ac = new AddonComponent(1937);
            AddComponent(ac, -4, 1, 0);
            ac = new AddonComponent(1937);
            AddComponent(ac, 1, -4, 0);
            ac = new AddonComponent(1938);
            AddComponent(ac, -1, 4, 0);
            ac = new AddonComponent(1939);
            AddComponent(ac, -4, -1, 0);
            ac = new AddonComponent(1939);
            AddComponent(ac, 1, 4, 0);
            ac = new AddonComponent(1940);
            AddComponent(ac, -1, -4, 0);
            ac = new AddonComponent(1945);
            AddComponent(ac, -3, 1, 0);
            ac = new AddonComponent(1945);
            AddComponent(ac, 1, -3, 0);
            ac = new AddonComponent(1946);
            AddComponent(ac, -1, 3, 0);
            ac = new AddonComponent(1946);
            AddComponent(ac, 3, -1, 0);
            ac = new AddonComponent(1947);
            AddComponent(ac, -1, -3, 0);
            ac = new AddonComponent(1947);
            AddComponent(ac, 3, 1, 0);
            ac = new AddonComponent(1948);
            AddComponent(ac, -3, -1, 0);
            ac = new AddonComponent(1948);
            AddComponent(ac, 1, 3, 0);
            ac = new AddonComponent(1929);
            AddComponent(ac, 0, 3, 0);
            ac = new AddonComponent(1930);
            AddComponent(ac, 3, 0, 0);
            ac = new AddonComponent(1931);
            AddComponent(ac, 0, -3, 0);
            ac = new AddonComponent(1932);
            AddComponent(ac, -3, 0, 0);
            ac = new AddonComponent(1309);
            AddComponent(ac, -4, 3, 5);
            ac = new AddonComponent(1309);
            AddComponent(ac, -3, 3, 5);
            ac = new AddonComponent(1307);
            AddComponent(ac, -3, 4, 5);
            ac = new AddonComponent(1306);
            AddComponent(ac, -4, -4, 5);
            ac = new AddonComponent(1308);
            AddComponent(ac, -4, -3, 5);
            ac = new AddonComponent(1306);
            AddComponent(ac, -3, -4, 5);
            ac = new AddonComponent(1307);
            AddComponent(ac, -3, -3, 5);
            ac = new AddonComponent(1308);
            AddComponent(ac, -3, -2, 5);
            ac = new AddonComponent(1306);
            AddComponent(ac, -2, -2, 5);
            ac = new AddonComponent(1306);
            AddComponent(ac, -1, -2, 5);
            ac = new AddonComponent(1307);
            AddComponent(ac, 0, -2, 5);
            ac = new AddonComponent(1308);
            AddComponent(ac, 1, -2, 5);
            ac = new AddonComponent(1305);
            AddComponent(ac, 2, -2, 5);
            ac = new AddonComponent(1309);
            AddComponent(ac, 3, -4, 5);
            ac = new AddonComponent(1309);
            AddComponent(ac, 3, -3, 5);
            ac = new AddonComponent(1308);
            AddComponent(ac, 2, -3, 5);
            ac = new AddonComponent(1306);
            AddComponent(ac, 3, -2, 5);
            ac = new AddonComponent(1306);
            AddComponent(ac, -3, 2, 5);
            ac = new AddonComponent(1309);
            AddComponent(ac, -2, 2, 5);
            ac = new AddonComponent(1308);
            AddComponent(ac, -1, 2, 5);
            ac = new AddonComponent(1307);
            AddComponent(ac, 0, 2, 5);
            ac = new AddonComponent(1309);
            AddComponent(ac, 1, 2, 5);
            ac = new AddonComponent(1306);
            AddComponent(ac, 2, 2, 5);
            ac = new AddonComponent(1309);
            AddComponent(ac, 3, 2, 5);
            ac = new AddonComponent(1309);
            AddComponent(ac, 2, 3, 5);
            ac = new AddonComponent(1305);
            AddComponent(ac, 3, 3, 5);
            ac = new AddonComponent(1307);
            AddComponent(ac, 3, 4, 5);
            ac = new AddonComponent(1308);
            AddComponent(ac, -2, -1, 5);
            ac = new AddonComponent(1307);
            AddComponent(ac, -2, 0, 5);
            ac = new AddonComponent(1306);
            AddComponent(ac, -2, 1, 5);
            ac = new AddonComponent(1307);
            AddComponent(ac, -1, -1, 5);
            ac = new AddonComponent(1308);
            AddComponent(ac, -1, 0, 5);
            ac = new AddonComponent(1308);
            AddComponent(ac, -1, 1, 5);
            ac = new AddonComponent(1305);
            AddComponent(ac, 0, -1, 5);
            ac = new AddonComponent(1309);
            AddComponent(ac, 0, 0, 5);
            ac = new AddonComponent(1306);
            AddComponent(ac, 0, 1, 5);
            ac = new AddonComponent(1305);
            AddComponent(ac, 1, -1, 5);
            ac = new AddonComponent(1306);
            AddComponent(ac, 1, 0, 5);
            ac = new AddonComponent(1309);
            AddComponent(ac, 1, 1, 5);
            ac = new AddonComponent(1309);
            AddComponent(ac, 2, -1, 5);
            ac = new AddonComponent(1305);
            AddComponent(ac, 2, 0, 5);
            ac = new AddonComponent(1308);
            AddComponent(ac, 2, 1, 5);
            ac = new AddonComponent(1305);
            AddComponent(ac, -2, -3, 5);
            ac = new AddonComponent(1307);
            AddComponent(ac, -2, 3, 5);
            ac = new AddonComponent(1306);
            AddComponent(ac, -4, 4, 5);
            ac = new AddonComponent(469);
            AddComponent(ac, -4, -4, 5);
            ac = new AddonComponent(470);
            AddComponent(ac, -3, -4, 5);
            ac = new AddonComponent(472);
            AddComponent(ac, -4, -3, 5);
            ac = new AddonComponent(469);
            AddComponent(ac, -4, 4, 5);
            ac = new AddonComponent(470);
            AddComponent(ac, -3, 4, 5);
            ac = new AddonComponent(6814);
            AddComponent(ac, -4, 4, 5);
            ac = new AddonComponent(6814);
            AddComponent(ac, -4, -4, 5);
            ac = new AddonComponent(6816);
            AddComponent(ac, -4, 4, 5);
            ac = new AddonComponent(6816);
            AddComponent(ac, -4, -4, 5);
            ac = new AddonComponent(472);
            AddComponent(ac, -4, 5, 6);
            ac = new AddonComponent(1928);
            AddComponent(ac, 4, -4, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 4, -3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 4, 3, 0);
            ac = new AddonComponent(1928);
            AddComponent(ac, 4, 4, 0);
            ac = new AddonComponent(1930);
            AddComponent(ac, 4, -2, 0);
            ac = new AddonComponent(1930);
            AddComponent(ac, 4, 2, 0);
            ac = new AddonComponent(1938);
            AddComponent(ac, 4, -1, 0);
            ac = new AddonComponent(1940);
            AddComponent(ac, 4, 1, 0);
            ac = new AddonComponent(1306);
            AddComponent(ac, 4, -4, 5);
            ac = new AddonComponent(1309);
            AddComponent(ac, 4, -3, 5);
            ac = new AddonComponent(1307);
            AddComponent(ac, 4, 3, 5);
            ac = new AddonComponent(1305);
            AddComponent(ac, 4, 4, 5);
            ac = new AddonComponent(469);
            AddComponent(ac, 4, 4, 5);
            ac = new AddonComponent(470);
            AddComponent(ac, 5, 4, 6);
            ac = new AddonComponent(469);
            AddComponent(ac, 4, -4, 5);
            ac = new AddonComponent(470);
            AddComponent(ac, 5, -4, 6);
            ac = new AddonComponent(472);
            AddComponent(ac, 4, -3, 5);
            ac = new AddonComponent(6814);
            AddComponent(ac, 4, -4, 5);
            ac = new AddonComponent(6814);
            AddComponent(ac, 4, 4, 5);
            ac = new AddonComponent(6816);
            AddComponent(ac, 4, 4, 5);
            ac = new AddonComponent(6816);
            AddComponent(ac, 4, -4, 5);
            ac = new AddonComponent(472);
            AddComponent(ac, 4, 5, 6);
        }
Example #2
0
        public FieldstoneCityStableAddon()
        {
            XmlAttach.AttachTo(this, new XmlCitySiege(5000, 60, 60, 1, 1, 5)); //<-------new CitySiege Attachment
            AddonComponent ac = null;

            ac = new AddonComponent(28);
            AddComponent(ac, 4, -5, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, 3, -5, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, 2, -5, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, 1, -5, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, 0, -5, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, -1, -5, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, -2, -5, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, -3, -5, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, -4, -5, 7);
            ac = new AddonComponent(27);
            AddComponent(ac, -5, 4, 7);
            ac = new AddonComponent(27);
            AddComponent(ac, -5, 0, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 4, 4, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, 4, 3, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, 4, 1, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, 4, 0, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 3, 3, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 3, 2, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, 3, 1, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, 2, 1, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 2, 0, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 1, 4, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, 1, 1, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 1, -1, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 1, -4, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 0, 3, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 0, 2, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 0, 1, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, 0, -2, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 0, -3, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 0, -4, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -1, 0, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, -1, -1, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, -2, 4, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -2, 3, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, -2, 2, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -2, 1, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, -2, 0, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, -2, -1, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, -2, -2, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, -2, -3, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, -2, -4, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, -3, 4, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -3, 2, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, -3, 1, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, -3, 0, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, -3, -1, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -3, -2, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -3, -3, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, -4, 4, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -4, 2, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, -4, 1, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -4, 0, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -4, -1, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -4, -2, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, -4, -3, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, -4, -4, 7);
            ac = new AddonComponent(100);
            AddComponent(ac, 4, 3, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, 4, 2, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, 4, 1, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, 4, 0, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, 4, -1, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, 4, -2, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, 4, -3, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, 4, -4, 0);
            ac = new AddonComponent(1873);
            AddComponent(ac, 3, 5, 0);
            ac = new AddonComponent(1873);
            AddComponent(ac, 2, 5, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, 3, 4, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, 2, 4, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, -1, 4, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, -2, 4, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, -3, 4, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, -4, 4, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, 1, -5, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, 0, -5, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, -1, -5, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, -2, -5, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, -3, -5, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, -4, -5, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, -5, 4, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, -5, 3, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, -5, 2, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, -5, 1, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, -5, 0, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, -5, -1, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, -5, -2, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, -5, -3, 0);
            ac = new AddonComponent(100);
            AddComponent(ac, -5, -4, 0);
            ac = new AddonComponent(102);
            AddComponent(ac, -5, -5, 0);
            ac = new AddonComponent(27);
            AddComponent(ac, -5, -3, 7);
            ac = new AddonComponent(27);
            AddComponent(ac, -5, 3, 7);
            ac = new AddonComponent(27);
            AddComponent(ac, -5, 1, 7);
            ac = new AddonComponent(27);
            AddComponent(ac, -5, -2, 7);
            ac = new AddonComponent(29);
            AddComponent(ac, -5, -5, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 4, 2, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, 4, -1, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 4, -2, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, 4, -3, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, 3, 4, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 3, 0, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, 3, -1, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, 3, -2, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, 3, -3, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, 3, -4, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, 2, 4, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 2, 3, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, 2, 2, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, 2, -1, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, 2, -2, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 2, -3, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 2, -4, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 1, 3, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, 1, 2, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, 1, 0, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 1, -2, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 1, -3, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 0, 4, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 0, 0, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, 0, -1, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, -1, 4, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, -1, 3, 7);
            ac = new AddonComponent(1236);
            AddComponent(ac, -1, 2, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -1, 1, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -1, -2, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, -1, -3, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, -1, -4, 7);
            ac = new AddonComponent(1238);
            AddComponent(ac, -3, 3, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -3, -4, 7);
            ac = new AddonComponent(1239);
            AddComponent(ac, -4, 3, 7);
            ac = new AddonComponent(101);
            AddComponent(ac, 4, 4, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, 1, 4, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, 0, 4, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, 4, -5, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, 3, -5, 0);
            ac = new AddonComponent(99);
            AddComponent(ac, 2, -5, 0);
            ac = new AddonComponent(27);
            AddComponent(ac, -5, -4, 7);
            ac       = new AddonComponent(10675);
            ac.Light = LightType.ArchedWindowEast;
            AddComponent(ac, -5, 2, 7);
            ac       = new AddonComponent(10675);
            ac.Light = LightType.ArchedWindowEast;
            AddComponent(ac, -5, -1, 7);
            ac       = new AddonComponent(10675);
            ac.Light = LightType.ArchedWindowEast;
            AddComponent(ac, 4, 3, 7);
            ac       = new AddonComponent(10675);
            ac.Light = LightType.ArchedWindowEast;
            AddComponent(ac, 4, 0, 7);
            ac       = new AddonComponent(10675);
            ac.Light = LightType.ArchedWindowEast;
            AddComponent(ac, 4, -3, 7);
            ac       = new AddonComponent(10670);
            ac.Light = LightType.Circle225;
            AddComponent(ac, -1, 4, 7);
            ac       = new AddonComponent(10670);
            ac.Light = LightType.Circle225;
            AddComponent(ac, -3, 4, 7);
            ac = new AddonComponent(26);
            AddComponent(ac, 4, 4, 7);
            ac = new AddonComponent(27);
            AddComponent(ac, 4, 2, 7);
            ac = new AddonComponent(27);
            AddComponent(ac, 4, 1, 7);
            ac = new AddonComponent(27);
            AddComponent(ac, 4, -1, 7);
            ac = new AddonComponent(27);
            AddComponent(ac, 4, -2, 7);
            ac = new AddonComponent(27);
            AddComponent(ac, 4, -4, 7);
            ac = new AddonComponent(1237);
            AddComponent(ac, 4, -4, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, 1, 4, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, 0, 4, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, -2, 4, 7);
            ac = new AddonComponent(28);
            AddComponent(ac, -4, 4, 7);
            ac = new AddonComponent(1883);
            AddComponent(ac, 1, 5, 0);
            ac = new AddonComponent(6459);
            AddComponent(ac, -4, -4, 27);
            ac = new AddonComponent(6459);
            AddComponent(ac, -4, -3, 27);
            ac = new AddonComponent(6459);
            AddComponent(ac, -4, -2, 27);
            ac = new AddonComponent(6459);
            AddComponent(ac, -4, -1, 27);
            ac = new AddonComponent(6459);
            AddComponent(ac, -4, 0, 27);
            ac = new AddonComponent(6459);
            AddComponent(ac, -4, 1, 27);
            ac = new AddonComponent(6459);
            AddComponent(ac, -4, 2, 27);
            ac = new AddonComponent(6459);
            AddComponent(ac, -4, 3, 27);
            ac = new AddonComponent(6459);
            AddComponent(ac, -4, 4, 27);
            ac = new AddonComponent(6459);
            AddComponent(ac, -4, 5, 27);
            ac = new AddonComponent(6459);
            AddComponent(ac, -3, -4, 30);
            ac = new AddonComponent(6459);
            AddComponent(ac, -3, -3, 30);
            ac = new AddonComponent(6459);
            AddComponent(ac, -3, -2, 30);
            ac = new AddonComponent(6459);
            AddComponent(ac, -3, -1, 30);
            ac = new AddonComponent(6459);
            AddComponent(ac, -3, 0, 30);
            ac = new AddonComponent(6459);
            AddComponent(ac, -3, 1, 30);
            ac = new AddonComponent(6459);
            AddComponent(ac, -3, 2, 30);
            ac = new AddonComponent(6459);
            AddComponent(ac, -3, 3, 30);
            ac = new AddonComponent(6459);
            AddComponent(ac, -3, 4, 30);
            ac = new AddonComponent(6459);
            AddComponent(ac, -3, 5, 30);
            ac = new AddonComponent(6459);
            AddComponent(ac, -2, -4, 33);
            ac = new AddonComponent(6459);
            AddComponent(ac, -2, -3, 33);
            ac = new AddonComponent(6459);
            AddComponent(ac, -2, -2, 33);
            ac = new AddonComponent(6459);
            AddComponent(ac, -2, -1, 33);
            ac = new AddonComponent(6459);
            AddComponent(ac, -2, 0, 33);
            ac = new AddonComponent(6459);
            AddComponent(ac, -2, 1, 33);
            ac = new AddonComponent(6459);
            AddComponent(ac, -2, 2, 33);
            ac = new AddonComponent(6459);
            AddComponent(ac, -2, 3, 33);
            ac = new AddonComponent(6459);
            AddComponent(ac, -2, 4, 33);
            ac = new AddonComponent(6459);
            AddComponent(ac, -2, 5, 33);
            ac = new AddonComponent(6459);
            AddComponent(ac, -1, -4, 36);
            ac = new AddonComponent(6459);
            AddComponent(ac, -1, -3, 36);
            ac = new AddonComponent(6459);
            AddComponent(ac, -1, -2, 36);
            ac = new AddonComponent(6459);
            AddComponent(ac, -1, -1, 36);
            ac = new AddonComponent(6459);
            AddComponent(ac, -1, 0, 36);
            ac = new AddonComponent(6459);
            AddComponent(ac, -1, 1, 36);
            ac = new AddonComponent(6459);
            AddComponent(ac, -1, 2, 36);
            ac = new AddonComponent(6459);
            AddComponent(ac, -1, 3, 36);
            ac = new AddonComponent(6459);
            AddComponent(ac, -1, 4, 36);
            ac = new AddonComponent(6459);
            AddComponent(ac, -1, 5, 36);
            ac = new AddonComponent(6459);
            AddComponent(ac, 0, -4, 39);
            ac = new AddonComponent(6459);
            AddComponent(ac, 0, -3, 39);
            ac = new AddonComponent(6459);
            AddComponent(ac, 0, -2, 39);
            ac = new AddonComponent(6459);
            AddComponent(ac, 0, -1, 39);
            ac = new AddonComponent(6459);
            AddComponent(ac, 0, 0, 39);
            ac = new AddonComponent(6459);
            AddComponent(ac, 0, 1, 39);
            ac = new AddonComponent(6459);
            AddComponent(ac, 0, 2, 39);
            ac = new AddonComponent(6459);
            AddComponent(ac, 0, 3, 39);
            ac = new AddonComponent(6459);
            AddComponent(ac, 0, 4, 39);
            ac = new AddonComponent(6459);
            AddComponent(ac, 0, 5, 39);
            ac = new AddonComponent(6457);
            AddComponent(ac, 1, -4, 39);
            ac = new AddonComponent(6457);
            AddComponent(ac, 1, -3, 39);
            ac = new AddonComponent(6457);
            AddComponent(ac, 1, -2, 39);
            ac = new AddonComponent(6457);
            AddComponent(ac, 1, -1, 39);
            ac = new AddonComponent(6457);
            AddComponent(ac, 1, 0, 39);
            ac = new AddonComponent(6457);
            AddComponent(ac, 1, 1, 39);
            ac = new AddonComponent(6457);
            AddComponent(ac, 1, 2, 39);
            ac = new AddonComponent(6457);
            AddComponent(ac, 1, 3, 39);
            ac = new AddonComponent(6457);
            AddComponent(ac, 1, 4, 39);
            ac = new AddonComponent(6457);
            AddComponent(ac, 1, 5, 39);
            ac = new AddonComponent(6457);
            AddComponent(ac, 2, -4, 36);
            ac = new AddonComponent(6457);
            AddComponent(ac, 2, -3, 36);
            ac = new AddonComponent(6457);
            AddComponent(ac, 2, -2, 36);
            ac = new AddonComponent(6457);
            AddComponent(ac, 2, -1, 36);
            ac = new AddonComponent(6457);
            AddComponent(ac, 2, 0, 36);
            ac = new AddonComponent(6457);
            AddComponent(ac, 2, 1, 36);
            ac = new AddonComponent(6457);
            AddComponent(ac, 2, 2, 36);
            ac = new AddonComponent(6457);
            AddComponent(ac, 2, 3, 36);
            ac = new AddonComponent(6457);
            AddComponent(ac, 2, 4, 36);
            ac = new AddonComponent(6457);
            AddComponent(ac, 2, 5, 36);
            ac = new AddonComponent(6457);
            AddComponent(ac, 3, -4, 33);
            ac = new AddonComponent(6457);
            AddComponent(ac, 3, -3, 33);
            ac = new AddonComponent(6457);
            AddComponent(ac, 3, -2, 33);
            ac = new AddonComponent(6457);
            AddComponent(ac, 3, -1, 33);
            ac = new AddonComponent(6457);
            AddComponent(ac, 3, 0, 33);
            ac = new AddonComponent(6457);
            AddComponent(ac, 3, 1, 33);
            ac = new AddonComponent(6457);
            AddComponent(ac, 3, 2, 33);
            ac = new AddonComponent(6457);
            AddComponent(ac, 3, 3, 33);
            ac = new AddonComponent(6457);
            AddComponent(ac, 3, 4, 33);
            ac = new AddonComponent(6457);
            AddComponent(ac, 3, 5, 33);
            ac = new AddonComponent(6457);
            AddComponent(ac, 4, -4, 30);
            ac = new AddonComponent(6457);
            AddComponent(ac, 4, -3, 30);
            ac = new AddonComponent(6457);
            AddComponent(ac, 4, -2, 30);
            ac = new AddonComponent(6457);
            AddComponent(ac, 4, -1, 30);
            ac = new AddonComponent(6457);
            AddComponent(ac, 4, 0, 30);
            ac = new AddonComponent(6457);
            AddComponent(ac, 4, 1, 30);
            ac = new AddonComponent(6457);
            AddComponent(ac, 4, 2, 30);
            ac = new AddonComponent(6457);
            AddComponent(ac, 4, 3, 30);
            ac = new AddonComponent(6457);
            AddComponent(ac, 4, 4, 30);
            ac = new AddonComponent(6457);
            AddComponent(ac, 4, 5, 30);
            ac = new AddonComponent(6457);
            AddComponent(ac, 5, -4, 27);
            ac = new AddonComponent(6457);
            AddComponent(ac, 5, -3, 27);
            ac = new AddonComponent(6457);
            AddComponent(ac, 5, -2, 27);
            ac = new AddonComponent(6457);
            AddComponent(ac, 5, -1, 27);
            ac = new AddonComponent(6457);
            AddComponent(ac, 5, 0, 27);
            ac = new AddonComponent(6457);
            AddComponent(ac, 5, 1, 27);
            ac = new AddonComponent(6457);
            AddComponent(ac, 5, 2, 27);
            ac = new AddonComponent(6457);
            AddComponent(ac, 5, 3, 27);
            ac = new AddonComponent(6457);
            AddComponent(ac, 5, 4, 27);
            ac = new AddonComponent(6457);
            AddComponent(ac, 5, 5, 27);
            ac = new AddonComponent(24);
            AddComponent(ac, -3, 4, 27);
            ac = new AddonComponent(24);
            AddComponent(ac, -2, 4, 27);
            ac = new AddonComponent(24);
            AddComponent(ac, -4, 4, 27);
            ac = new AddonComponent(24);
            AddComponent(ac, -1, 4, 27);
            ac = new AddonComponent(24);
            AddComponent(ac, 0, 4, 27);
            ac = new AddonComponent(24);
            AddComponent(ac, 1, 4, 27);
            ac = new AddonComponent(24);
            AddComponent(ac, 2, 4, 27);
            ac = new AddonComponent(24);
            AddComponent(ac, 3, 4, 27);
            ac = new AddonComponent(24);
            AddComponent(ac, -2, 4, 30);
            ac = new AddonComponent(24);
            AddComponent(ac, -1, 4, 30);
            ac = new AddonComponent(24);
            AddComponent(ac, 0, 4, 30);
            ac = new AddonComponent(24);
            AddComponent(ac, 1, 4, 30);
            ac = new AddonComponent(24);
            AddComponent(ac, -1, 4, 33);
            ac = new AddonComponent(24);
            AddComponent(ac, 0, 4, 33);
            ac = new AddonComponent(1882);
            AddComponent(ac, 4, 5, 0);
            ac = new AddonComponent(37);
            AddComponent(ac, -4, -2, 7);
            ac = new AddonComponent(37);
            AddComponent(ac, -3, -2, 7);
            ac = new AddonComponent(37);
            AddComponent(ac, -2, -2, 7);
            ac = new AddonComponent(37);
            AddComponent(ac, -4, 1, 7);
            ac = new AddonComponent(37);
            AddComponent(ac, -3, 1, 7);
            ac = new AddonComponent(37);
            AddComponent(ac, -2, 1, 7);
            ac = new AddonComponent(38);
            AddComponent(ac, -2, -1, 7);
            ac = new AddonComponent(38);
            AddComponent(ac, -2, 1, 7);
            ac = new AddonComponent(38);
            AddComponent(ac, -2, -2, 7);
            ac = new AddonComponent(38);
            AddComponent(ac, -2, -4, 7);
            ac = new AddonComponent(38);
            AddComponent(ac, -2, 2, 7);
            ac = new AddonComponent(2880);
            AddComponent(ac, 3, -4, 7);
            ac = new AddonComponent(2878);
            AddComponent(ac, 2, -4, 7);
            ac = new AddonComponent(2880);
            AddComponent(ac, 1, -4, 7);
            ac = new AddonComponent(5453);
            AddComponent(ac, -4, -4, 7);
            ac = new AddonComponent(5453);
            AddComponent(ac, -4, -1, 7);
            ac = new AddonComponent(5453);
            AddComponent(ac, -4, 2, 7);
            ac = new AddonComponent(4980);
            AddComponent(ac, 1, -4, 13);
            ac = new AddonComponent(4976);
            AddComponent(ac, 2, -4, 13);
            ac = new AddonComponent(3893);
            AddComponent(ac, -4, 0, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, -3, -3, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, 0, 1, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, 2, -3, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, 2, 3, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, -3, 2, 7);
            ac = new AddonComponent(3894);
            AddComponent(ac, -4, 0, 7);
            ac = new AddonComponent(3894);
            AddComponent(ac, -4, -3, 7);
            ac = new AddonComponent(3894);
            AddComponent(ac, -4, 3, 7);
            ac = new AddonComponent(3896);
            AddComponent(ac, -1, -1, 7);
            ac       = new AddonComponent(2581);
            ac.Light = LightType.Circle225;
            AddComponent(ac, 3, -4, 15);
            ac = new AddonComponent(24);
            AddComponent(ac, -4, 4, 27);
            ac = new AddonComponent(2968);
            AddComponent(ac, -5, 5, 7);
        }
Example #3
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (state == null || info == null || state.Mobile == null || this.m_gauntlet == null || this.m_gauntlet.Challenger == null)
            {
                return;
            }

            XmlPoints afrom = (XmlPoints)XmlAttach.FindAttachment(state.Mobile, typeof(XmlPoints));

            switch (info.ButtonID)
            {
            case 1:
                // refresh

                //m_gauntlet.CheckForDisqualification();

                state.Mobile.SendGump(new CTFGump(this.m_gauntlet, state.Mobile, this.viewpage));
                break;

            case 10:
                // Entry fee
                int       val = 0;
                TextRelay tr  = info.GetTextEntry(10);
                if (tr != null)
                {
                    try
                    {
                        val = int.Parse(tr.Text);
                    }
                    catch
                    {
                    }
                }
                this.m_gauntlet.EntryFee = val;

                this.m_gauntlet.ResetAcceptance();

                // update all the gumps
                RefreshAllGumps(this.m_gauntlet, true);

                state.Mobile.SendGump(new CTFGump(this.m_gauntlet, state.Mobile, this.viewpage));
                break;

            case 11:
                // update teams
                if (this.m_WorkingList != null)
                {
                    for (int i = 0; i < this.m_WorkingList.Count; i++)
                    {
                        // is this on the visible page?
                        if ((int)(i / this.PlayersPerPage) != this.viewpage)
                        {
                            continue;
                        }

                        CTFGauntlet.ChallengeEntry entry = (CTFGauntlet.ChallengeEntry) this.m_WorkingList[i];
                        if (entry != null)
                        {
                            int tval = 0;
                            tr = info.GetTextEntry(500 + i);
                            if (tr != null)
                            {
                                try
                                {
                                    tval = int.Parse(tr.Text);
                                }
                                catch
                                {
                                }
                            }
                            entry.Team = tval;
                        }
                    }
                }

                this.m_gauntlet.ResetAcceptance();
                // update all the gumps
                RefreshAllGumps(this.m_gauntlet, true);

                state.Mobile.SendGump(new CTFGump(this.m_gauntlet, state.Mobile, this.viewpage));
                break;

            case 12:
                // page up
                // try doing the default for non-participants
                int nplayers = 0;
                if (this.m_gauntlet.Participants != null)
                {
                    nplayers = this.m_gauntlet.Participants.Count;
                }

                int page = this.viewpage + 1;
                if (page > (int)(nplayers / this.PlayersPerPage))
                {
                    page = (int)(nplayers / this.PlayersPerPage);
                }

                if (this.m_WorkingList != null)
                {
                    for (int i = 0; i < this.m_WorkingList.Count; i++)
                    {
                        CTFGauntlet.ChallengeEntry entry = (CTFGauntlet.ChallengeEntry) this.m_WorkingList[i];
                        if (entry != null)
                        {
                            if (entry.Participant == state.Mobile)
                            {
                                entry.PageBeingViewed++;

                                if (entry.PageBeingViewed > (int)(nplayers / this.PlayersPerPage))
                                {
                                    entry.PageBeingViewed = (int)(nplayers / this.PlayersPerPage);
                                }

                                page = entry.PageBeingViewed;
                                //break;
                            }
                        }
                    }
                }

                state.Mobile.SendGump(new CTFGump(this.m_gauntlet, state.Mobile, page));
                break;

            case 13:
                // page down
                // try doing the default for non-participants
                page = this.viewpage - 1;
                if (page < 0)
                {
                    page = 0;
                }
                if (this.m_WorkingList != null)
                {
                    for (int i = 0; i < this.m_WorkingList.Count; i++)
                    {
                        CTFGauntlet.ChallengeEntry entry = (CTFGauntlet.ChallengeEntry) this.m_WorkingList[i];
                        if (entry != null)
                        {
                            if (entry.Participant == state.Mobile)
                            {
                                entry.PageBeingViewed--;

                                if (entry.PageBeingViewed < 0)
                                {
                                    entry.PageBeingViewed = 0;
                                }

                                page = entry.PageBeingViewed;
                                //break;
                            }
                        }
                    }
                }

                state.Mobile.SendGump(new CTFGump(this.m_gauntlet, state.Mobile, page));
                break;

            case 20:
                // arena size
                val = 0;
                tr  = info.GetTextEntry(20);
                if (tr != null)
                {
                    try
                    {
                        val = int.Parse(tr.Text);
                    }
                    catch
                    {
                    }
                }
                this.m_gauntlet.ArenaSize = val;

                this.m_gauntlet.ResetAcceptance();

                // update all the gumps
                RefreshAllGumps(this.m_gauntlet, true);

                state.Mobile.SendGump(new CTFGump(this.m_gauntlet, state.Mobile, this.viewpage));
                break;

            case 30:
                // target score
                val = 0;
                tr  = info.GetTextEntry(30);
                if (tr != null)
                {
                    try
                    {
                        val = int.Parse(tr.Text);
                    }
                    catch
                    {
                    }
                }
                this.m_gauntlet.TargetScore = val;

                this.m_gauntlet.ResetAcceptance();

                // update all the gumps
                RefreshAllGumps(this.m_gauntlet, true);

                state.Mobile.SendGump(new CTFGump(this.m_gauntlet, state.Mobile, this.viewpage));
                break;

            case 40:
                // match length
                double dval = 0;
                tr = info.GetTextEntry(40);
                if (tr != null)
                {
                    try
                    {
                        dval = double.Parse(tr.Text);
                    }
                    catch
                    {
                    }
                }
                this.m_gauntlet.MatchLength = TimeSpan.FromMinutes(dval);

                this.m_gauntlet.ResetAcceptance();

                // update all the gumps
                RefreshAllGumps(this.m_gauntlet, true);

                state.Mobile.SendGump(new CTFGump(this.m_gauntlet, state.Mobile, this.viewpage));
                break;

            case 100:

                // add to Participants
                if (this.m_gauntlet.Participants == null)
                {
                    this.m_gauntlet.Participants = new ArrayList();
                }

                if (this.MaxTeamSize > 0 && this.m_gauntlet.Participants.Count >= this.MaxTeamSize)
                {
                    XmlPoints.SendText(state.Mobile, 100535);         // "Challenge is full!"
                }
                else
                {
                    state.Mobile.Target = new MemberTarget(this.m_gauntlet, this.m_gauntlet.Participants);
                }

                state.Mobile.SendGump(new CTFGump(this.m_gauntlet, state.Mobile, this.viewpage));
                break;

            case 300:
                // Start game
                if (this.m_WorkingList == null)
                {
                    return;
                }

                bool complete = true;
                foreach (CTFGauntlet.ChallengeEntry entry in this.m_WorkingList)
                {
                    if (entry != null)
                    {
                        Mobile m = entry.Participant;

                        if (m == null)
                        {
                            continue;
                        }

                        if (!this.m_gauntlet.CheckQualify(m))
                        {
                            complete = false;
                            break;
                        }

                        if (!entry.Accepted)
                        {
                            XmlPoints.SendText(this.m_gauntlet.Challenger, 100539, m.Name);      // "{0} has not accepted yet."
                            complete = false;
                            break;
                        }

                        // and they have a team
                        if (entry.Team <= 0)
                        {
                            XmlPoints.SendText(this.m_gauntlet.Challenger, 100594, m.Name);     // "{0} has not been assigned a team."
                            complete = false;
                        }
                    }
                }

                if (this.m_WorkingList.Count < 2)
                {
                    XmlPoints.SendText(this.m_gauntlet.Challenger, 100540);      // "Insufficient number of players."
                    complete = false;
                }

                // make sure all the bases have been defined
                ArrayList Teams = this.m_gauntlet.GetTeams();

                // make sure that all bases have teams defined
                if (Teams != null)
                {
                    foreach (TeamInfo t in Teams)
                    {
                        bool hasteam = false;
                        foreach (CTFBase b in this.m_gauntlet.HomeBases)
                        {
                            if (t.ID == b.Team)
                            {
                                hasteam = true;
                                break;
                            }
                        }

                        if (!hasteam)
                        {
                            XmlPoints.SendText(this.m_gauntlet.Challenger, 100621, t.ID);     // "Team {0} base not defined."
                            complete = false;
                        }
                    }
                }
                else
                {
                    complete = false;
                }

                if (complete)
                {
                    this.m_gauntlet.Participants = new ArrayList();

                    foreach (CTFGauntlet.ChallengeEntry entry in this.m_WorkingList)
                    {
                        if (entry != null)
                        {
                            Mobile m = entry.Participant;

                            if (m == null)
                            {
                                continue;
                            }

                            // try to collect any entry fee
                            if (!this.m_gauntlet.CollectEntryFee(m, this.m_gauntlet.EntryFee))
                            {
                                continue;
                            }

                            // set up the challenge on each player
                            XmlPoints a = (XmlPoints)XmlAttach.FindAttachment(m, typeof(XmlPoints));
                            if (a != null)
                            {
                                a.ChallengeGame = this.m_gauntlet;
                            }

                            entry.Status = ChallengeStatus.Active;

                            this.m_gauntlet.Participants.Add(entry);
                        }
                    }

                    // and lock the game
                    this.m_gauntlet.StartGame();

                    // refresh all gumps
                    RefreshAllGumps(this.m_gauntlet, true);
                }
                else
                {
                    state.Mobile.SendGump(new CTFGump(this.m_gauntlet, state.Mobile, this.viewpage));
                }

                break;

            default:
            {
                // forfeit buttons
                if (info.ButtonID >= 4000)
                {
                    int selection = info.ButtonID - 4000;

                    if (selection < this.m_WorkingList.Count)
                    {
                        CTFGauntlet.ChallengeEntry entry = (CTFGauntlet.ChallengeEntry) this.m_WorkingList[selection];

                        // find the master participants list entry with the same participant
                        if (this.m_gauntlet.Participants != null)
                        {
                            CTFGauntlet.ChallengeEntry forfeitentry = null;

                            foreach (CTFGauntlet.ChallengeEntry masterentry in this.m_gauntlet.Participants)
                            {
                                if (entry == masterentry)
                                {
                                    forfeitentry = masterentry;
                                    break;
                                }
                            }

                            // and remove it
                            if (forfeitentry != null)
                            {
                                forfeitentry.Status = ChallengeStatus.Forfeit;

                                // inform him that he has been kicked
                                this.m_gauntlet.Forfeit(forfeitentry.Participant);
                            }
                        }
                    }
                }
                // kick buttons
                if (info.ButtonID >= 2000)
                {
                    int selection = info.ButtonID - 2000;

                    if (selection < this.m_WorkingList.Count)
                    {
                        CTFGauntlet.ChallengeEntry entry = (CTFGauntlet.ChallengeEntry) this.m_WorkingList[selection];
                        // find the master participants list entry with the same participant
                        if (this.m_gauntlet.Participants != null)
                        {
                            CTFGauntlet.ChallengeEntry kickentry = null;

                            foreach (CTFGauntlet.ChallengeEntry masterentry in this.m_gauntlet.Participants)
                            {
                                if (entry == masterentry)
                                {
                                    kickentry = masterentry;
                                    break;
                                }
                            }

                            // and remove it
                            if (kickentry != null)
                            {
                                this.m_gauntlet.Participants.Remove(kickentry);

                                // refresh his gump and inform him that he has been kicked
                                if (kickentry.Participant != null)
                                {
                                    XmlPoints.SendText(kickentry.Participant, 100545, this.m_gauntlet.ChallengeName);         // "You have been kicked from {0}"
                                    kickentry.Participant.SendGump(new CTFGump(this.m_gauntlet, kickentry.Participant, this.viewpage));
                                }
                            }
                        }

                        this.m_gauntlet.ResetAcceptance();
                    }

                    // refresh all gumps
                    RefreshAllGumps(this.m_gauntlet, true);
                    //state.Mobile.SendGump( new CTFGump( m_gauntlet, state.Mobile));
                }
                else if (info.ButtonID >= 1000)
                {
                    int selection = info.ButtonID - 1000;
                    // set the acceptance flag of the participant
                    if (selection < this.m_WorkingList.Count)
                    {
                        CTFGauntlet.ChallengeEntry entry = (CTFGauntlet.ChallengeEntry) this.m_WorkingList[selection];

                        entry.Accepted = !entry.Accepted;
                    }

                    // refresh all gumps
                    RefreshAllGumps(this.m_gauntlet, true);
                    //state.Mobile.SendGump( new CTFGump( m_gauntlet, state.Mobile));
                }

                break;
            }
            }
        }
Example #4
0
        public override void OnKill(Mobile killed, Mobile killer)
        {
            base.OnKill(killed, killer);

            // supports ignoring XmlPoints challenges
            if (m_ChallengeStatus)
            {
                m_ChallengeStatus = false;
                return;
            }

            if (killed == null || killer == null || killer == killed)
            {
                return;
            }

            // check for within guild kills and ignore them
            if (SameGuild(killed, killer))
            {
                return;
            }

            // this calculates the base faction level that will be gained/lost based upon the fame of the killed mob
            double value = (double)(killed.Fame / 1000.0);

            if (value <= 0)
            {
                value = 1;
            }

            // calculates credits gained in a similar way
            int cval = (int)(killed.Fame * m_CreditScale);

            if (cval <= 0)
            {
                cval = 1;
            }

            Credits += cval;

            // prepare the group lists that will be checked for faction
            List <XmlMobFactions.Group> glist  = null;
            List <XmlMobFactions.Group> dglist = null;

            // check to see whether this mob type has already been hashed into a group list
            if (!GroupHash.TryGetValue(killed.GetType(), out glist) || glist == null)
            {
                // otherwise look it up the slow way and prepare a hash entry for it at the same time
                // unless it is using dynamic faction
                glist = new List <XmlMobFactions.Group>();
                foreach (Group g in KillGroups)
                {
                    if (MatchType(g.Members, killed))
                    {
                        glist.Add(g);
                    }
                }
                GroupHash[killed.GetType()] = glist;
            }

            // have to look up dynamic factions the exhaustive way
            // does this mob have dynamic faction assignments?
            XmlAttachment dynam = XmlAttach.FindAttachment(killed, typeof(XmlDynamicFaction));

            if (dynam != null)
            {
                //if(XmlAttach.FindAttachment(XmlAttach.MobileAttachments, killed, typeof(XmlDynamicFaction)) != null)
                //{
                dglist = new List <XmlMobFactions.Group>();
                foreach (Group g in KillGroups)
                {
                    if (XmlDynamicFaction.MatchFaction(killed, g.DynamicFaction))
                    {
                        dglist.Add(g);
                    }
                }
            }

            List <List <XmlMobFactions.Group> > alist = new List <List <XmlMobFactions.Group> >();

            if (glist != null && glist.Count > 0)
            {
                alist.Add(glist);
            }
            if (dglist != null && dglist.Count > 0)
            {
                alist.Add(dglist);
            }

            //  go through this with static and dynamic factions
            foreach (List <XmlMobFactions.Group> al in alist)
            {
                foreach (Group g in al)
                {
                    // tabulate the faction loss from target group allies
                    if (g.Allies != null && g.Allies.Length > 0)
                    {
                        for (int i = 0; i < g.Allies.Length; i++)
                        {
                            Group ally = g.Allies[i];

                            int facloss = 0;
                            try
                            {
                                facloss = (int)(value * g.AllyLoss[i]);
                            }
                            catch {}
                            if (facloss <= 0)
                            {
                                facloss = 1;
                            }

                            int p = GetFactionLevel(ally.GroupType) - facloss;
                            SetFactionLevel(ally.GroupType, p);
                            if (verboseMobFactions)
                            {
                                killer.SendMessage("lost {0} faction {1}", ally.GroupType, facloss);
                            }
                        }
                    }

                    // tabulate the faction gain from target group opponents
                    if (g.Opponents != null && g.Opponents.Length > 0)
                    {
                        for (int i = 0; i < g.Opponents.Length; i++)
                        {
                            Group opp = g.Opponents[i];

                            int facgain = 0;
                            try
                            {
                                facgain = (int)(value * g.OpponentGain[i]);
                            }
                            catch {}
                            if (facgain <= 0)
                            {
                                facgain = 1;
                            }

                            int p = GetFactionLevel(opp.GroupType) + facgain;
                            SetFactionLevel(opp.GroupType, p);
                            if (verboseMobFactions)
                            {
                                killer.SendMessage("gained {0} faction {1}", opp.GroupType, facgain);
                            }
                        }
                    }
                }
            }

            m_EndTime = DateTime.Now + Refractory;
        }
Example #5
0
        public virtual void AssignItemEffect(Item targetitem, int effectid, int hue, int fraction)
        {
            if (targetitem == null || targetitem.Deleted)
            {
                return;
            }

            // deal with addons
            if (targetitem is BaseAddon)
            {
                BaseAddon addon = (BaseAddon)targetitem;
                if (addon.Components != null)
                {
                    int count = 0;
                    // change the ids of all of the components if they dont already have xmlsiege attachments
                    foreach (AddonComponent i in addon.Components)
                    {
                        if (XmlAttach.FindAttachment(i, typeof(XmlSiege)) == null)
                        {
                            // put the effect on a fraction of the components, but make sure you have at least one
                            if (Utility.Random(100) < fraction || count == 0)
                            {
                                Effects.SendLocationEffect(i.Location, i.Map, effectid, DamagedItemEffectDuration, hue, 0);
                                //Effects.SendTargetEffect(i, DamagedItemEffectID, DamagedItemEffectDuration, hue, 0);
                                count++;
                            }
                        }
                    }
                }
            }
            else
            if (targetitem is BaseMulti)
            {
                // place an effect at the location of the target item
                Effects.SendLocationEffect(targetitem.Location, targetitem.Map, effectid, DamagedItemEffectDuration, hue, 0);

                ArrayList tilelist = new ArrayList();
                // go through all of the multi components
                MultiComponentList mcl = ((BaseMulti)targetitem).Components;
                int count = 0;
                if (mcl != null && mcl.List != null)
                {
                    for (int i = 0; i < mcl.List.Length; i++)
                    {
                        MultiTileEntry t = mcl.List[i];

                        int x = t.m_OffsetX + targetitem.X;
                        int y = t.m_OffsetY + targetitem.Y;
                        int z = t.m_OffsetZ + targetitem.Z;
                        if (Utility.Random(100) < fraction || count == 0)
                        {
                            tilelist.Add(new TileEntry(t.m_ItemID, x, y, z));
                            count++;
                        }
                    }

                    foreach (TileEntry s in tilelist)
                    {
                        Effects.SendLocationEffect(new Point3D(s.X, s.Y, s.Z), targetitem.Map, effectid, DamagedItemEffectDuration, hue, 0);
                    }
                }
            }
            else
            {
                // place an effect at the location of the target item
                Effects.SendLocationEffect(targetitem.Location, targetitem.Map, effectid, DamagedItemEffectDuration, hue, 0);
                //Effects.SendTargetEffect(targetitem, DamagedItemEffectID, DamagedItemEffectDuration, hue, 0);
            }
        }
Example #6
0
        public XMLQuestLogGump(Mobile from, int page, List <object> list) : base(12, 24)
        {
            if (from == null)
            {
                return;
            }

            from.CloseGump(typeof(XMLQuestLogGump));

            XmlQuestPoints p = (XmlQuestPoints)XmlAttach.FindAttachment(from, typeof(XmlQuestPoints));

            m_From = from;
            m_Page = page;

            if (list == null)
            {
                // make a new list based on the number of items in the book
                int nquests = 0;
                list = new List <object>( );

                // find all quest items in the players pack
                if (from.Backpack != null)
                {
                    Item [] packquestitems = from.Backpack.FindItemsByType(typeof(IXmlQuest));

                    if (packquestitems != null)
                    {
                        nquests += packquestitems.Length;
                        for (int i = 0; i < packquestitems.Length; ++i)
                        {
                            if (packquestitems[i] != null && !packquestitems[i].Deleted && !(packquestitems[i].Parent is XmlQuestBook))
                            {
                                list.Add(packquestitems[i]);
                            }
                        }
                    }

                    // find any questbooks they might have
                    Item [] questbookitems = from.Backpack.FindItemsByType(typeof(XmlQuestBook));

                    if (questbookitems != null)
                    {
                        for (int j = 0; j < questbookitems.Length; ++j)
                        {
                            Item [] questitems = ((XmlQuestBook)questbookitems[j]).FindItemsByType(typeof(IXmlQuest));

                            if (questitems != null)
                            {
                                nquests += questitems.Length;

                                for (int i = 0; i < questitems.Length; ++i)
                                {
                                    list.Add(questitems[i]);
                                }
                            }
                        }
                    }

                    // find any completed quests on the XmlQuestPoints attachment

                    if (p != null && p.QuestList != null)
                    {
                        // add all completed quests
                        foreach (XmlQuestPoints.QuestEntry q in p.QuestList)
                        {
                            list.Add(q);
                        }
                    }
                }
            }

            m_List = list;

            int index = GetIndexForPage(page);
            int count = GetCountForIndex(index);

            int tableIndex = 0;

            int width = 600;

            width = 766;

            X = (824 - width) / 2;

            int xoffset = 20;

            AddPage(0);

            AddBackground(10, 10, width, 439, 5054);
            AddImageTiled(18, 20, width - 17, 420, 2624);

            AddImageTiled(58 - xoffset, 64, 36, 352, 200);               // open
            AddImageTiled(96 - xoffset, 64, 163, 352, 1416);             // name
            AddImageTiled(261 - xoffset, 64, 55, 352, 200);              // type
            AddImageTiled(308 - xoffset, 64, 85, 352, 1416);             // status
            AddImageTiled(395 - xoffset, 64, 116, 352, 200);             // expires

            AddImageTiled(511 - xoffset, 64, 42, 352, 1416);             // points
            AddImageTiled(555 - xoffset, 64, 175, 352, 200);             // completed
            AddImageTiled(734 - xoffset, 64, 42, 352, 1416);             // repeated

            for (int i = index; i < (index + count) && i >= 0 && i < list.Count; ++i)
            {
                object obj = list[i];

                AddImageTiled(24, 94 + (tableIndex * 32), 489, 2, 2624);

                ++tableIndex;
            }

            AddAlphaRegion(18, 20, width - 17, 420);
            AddImage(5, 5, 10460);
            AddImage(width - 15, 5, 10460);
            AddImage(5, 424, 10460);
            AddImage(width - 15, 424, 10460);

            AddHtmlLocalized(375, 25, 200, 30, 1046026, LabelColor, false, false);                                  // Quest Log

            AddHtmlLocalized(63 - xoffset, 45, 200, 32, 1072837, LabelColor, false, false);                         // Current Points:

            AddHtml(243 - xoffset, 45, 200, 32, XmlSimpleGump.Color("Available Credits:", "FFFFFF"), false, false); // Your Reward Points:

            AddHtml(453 - xoffset, 45, 200, 32, XmlSimpleGump.Color("Rank:", "FFFFFF"), false, false);              // Rank

            AddHtml(600 - xoffset, 45, 200, 32, XmlSimpleGump.Color("Quests Completed:", "FFFFFF"), false, false);  // Quests completed

            if (p != null)
            {
                int pcolor = 53;
                AddLabel(170 - xoffset, 45, pcolor, p.Points.ToString());
                AddLabel(350 - xoffset, 45, pcolor, p.Credits.ToString());
                AddLabel(500 - xoffset, 45, pcolor, p.Rank.ToString());
                AddLabel(720 - xoffset, 45, pcolor, p.QuestsCompleted.ToString());
            }

            AddHtmlLocalized(63 - xoffset, 64, 200, 32, 3000362, LabelColor, false, false);                     // Open
            AddHtmlLocalized(147 - xoffset, 64, 200, 32, 3005104, LabelColor, false, false);                    // Name
            AddHtmlLocalized(270 - xoffset, 64, 200, 32, 1062213, LabelColor, false, false);                    // Type
            AddHtmlLocalized(326 - xoffset, 64, 200, 32, 3000132, LabelColor, false, false);                    // Status
            AddHtmlLocalized(429 - xoffset, 64, 200, 32, 1062465, LabelColor, false, false);                    // Expires

            AddHtml(514 - xoffset, 64, 200, 32, XmlSimpleGump.Color("Points", "FFFFFF"), false, false);         // Points
            AddHtml(610 - xoffset, 64, 200, 32, XmlSimpleGump.Color("Next Available", "FFFFFF"), false, false); // Next Available
            //AddHtmlLocalized( 610 - xoffset, 64, 200, 32,  1046033, LabelColor, false, false ); // Completed
            AddHtmlLocalized(738 - xoffset, 64, 200, 32, 3005020, LabelColor, false, false);                    // Repeat

            AddButton(675 - xoffset, 416, 4017, 4018, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(710 - xoffset, 416, 120, 20, 1011441, LabelColor, false, false);               // EXIT

            AddButton(113 - xoffset, 416, 0xFA8, 0xFAA, 10, GumpButtonType.Reply, 0);
            AddHtml(150 - xoffset, 416, 200, 32, XmlSimpleGump.Color("Top Players", "FFFFFF"), false, false);              // Top players gump


            tableIndex = 0;

            if (page > 0)
            {
                AddButton(225, 416, 4014, 4016, 2, GumpButtonType.Reply, 0);
                AddHtmlLocalized(260, 416, 150, 20, 1011067, LabelColor, false, false);                   // Previous page
            }

            if (GetIndexForPage(page + 1) < list.Count)
            {
                AddButton(375, 416, 4005, 4007, 3, GumpButtonType.Reply, 0);
                AddHtmlLocalized(410, 416, 150, 20, 1011066, LabelColor, false, false);                   // Next page
            }

            for (int i = index; i < (index + count) && i >= 0 && i < list.Count; ++i)
            {
                object obj = list[i];


                if (obj is IXmlQuest)
                {
                    IXmlQuest e = (IXmlQuest)obj;

                    int y = 96 + (tableIndex++ *32);


                    AddButton(60 - xoffset, y + 2, 0xFAB, 0xFAD, 2000 + i, GumpButtonType.Reply, 0);                       // open gump


                    int color;

                    if (!e.IsValid)
                    {
                        color = 33;
                    }
                    else
                    if (e.IsCompleted)
                    {
                        color = 67;
                    }
                    else
                    {
                        color = 5;
                    }


                    AddLabel(100 - xoffset, y, color, (string)e.Name);

                    //AddHtmlLocalized( 315, y, 200, 32, e.IsCompleted ? 1049071 : 1049072, htmlcolor, false, false ); // Completed/Incomplete
                    AddLabel(315 - xoffset, y, color, e.IsCompleted ? "Completed" : "In Progress");

                    // indicate the expiration time
                    if (e.IsValid)
                    {
                        // do a little parsing of the expiration string to fit it in the space
                        string substring = e.ExpirationString;
                        if (e.ExpirationString.IndexOf("Expires in") >= 0)
                        {
                            substring = e.ExpirationString.Substring(11);
                        }
                        AddLabel(400 - xoffset, y, color, (string)substring);
                    }
                    else
                    {
                        AddLabel(400 - xoffset, y, color, "No longer valid");
                    }

                    if (e.PartyEnabled)
                    {
                        AddLabel(270 - xoffset, y, color, "Party");
                        //AddHtmlLocalized( 250, y, 200, 32, 3000332, htmlcolor, false, false ); // Party
                    }
                    else
                    {
                        AddLabel(270 - xoffset, y, color, "Solo");
                    }

                    AddLabel(515 - xoffset, y, color, e.Difficulty.ToString());
                }
                else
                if (obj is XmlQuestPoints.QuestEntry)
                {
                    XmlQuestPoints.QuestEntry e = (XmlQuestPoints.QuestEntry)obj;

                    int y     = 96 + (tableIndex++ *32);
                    int color = 67;

                    AddLabel(100 - xoffset, y, color, (string)e.Name);

                    AddLabel(315 - xoffset, y, color, "Completed");

                    if (e.PartyEnabled)
                    {
                        AddLabel(270 - xoffset, y, color, "Party");
                        //AddHtmlLocalized( 250, y, 200, 32, 3000332, htmlcolor, false, false ); // Party
                    }
                    else
                    {
                        AddLabel(270 - xoffset, y, color, "Solo");
                    }

                    AddLabel(515 - xoffset, y, color, e.Difficulty.ToString());

                    //AddLabel( 560 - xoffset, y, color, e.WhenCompleted.ToString() );
                    // determine when the quest can be done again by looking for an xmlquestattachment with the same name
                    XmlQuestAttachment qa = (XmlQuestAttachment)XmlAttach.FindAttachment(from, typeof(XmlQuestAttachment), e.Name);
                    if (qa != null)
                    {
                        if (qa.Expiration == TimeSpan.Zero)
                        {
                            AddLabel(560 - xoffset, y, color, "Not Repeatable");
                        }
                        else
                        {
                            DateTime nexttime = DateTime.Now + qa.Expiration;
                            AddLabel(560 - xoffset, y, color, nexttime.ToString());
                        }
                    }
                    else
                    {
                        // didnt find one so it can be done again
                        AddLabel(560 - xoffset, y, color, "Available Now");
                    }

                    AddLabel(741 - xoffset, y, color, e.TimesCompleted.ToString());
                }
            }
        }
Example #7
0
        public virtual bool Eat(Mobile from)
        {
            // Fill the Mobile with FillFactor
            if (this.CheckHunger(from))
            {
                // Play a random "eat" sound
                from.PlaySound(Utility.Random(0x3A, 3));

                if (from.Body.IsHuman && !from.Mounted)
                {
                    from.Animate(34, 5, 1, true, false, 0);
                }

                if (this.m_Poison != null)
                {
                    from.ApplyPoison(this.m_Poisoner, this.m_Poison);
                }

                #region Raw Food
                if (this.m_Raw == true)
                {
                    switch (Utility.Random(7))
                    {
                    case 0: from.SendMessage("The food was raw and you don't feel so well!");  from.Poison = Poison.Regular; break;

                    case 1: from.SendMessage("The food was raw and you don't feel so well!");  from.Poison = Poison.Lesser; break;

                    case 2: from.SendMessage("The food was raw and you don't feel so well!");  from.Poison = Poison.Greater; break;

                    case 3: from.SendMessage("You were lucky you didn't get food poisoning"); break;

                    case 4: from.SendMessage("The food was raw and you don't feel so well!");  from.Poison = Poison.Deadly; break;

                    case 5: from.SendMessage("You were lucky you didn't get food poisoning"); break;

                    case 6: from.SendMessage("The food was raw and you don't feel so well!");  from.Poison = Poison.Regular; break;

                    default: break;
                    }
                }
                #endregion

                #region SicknessSYS_Start_5
                switch (Utility.Random(5000))
                {
                case 0: Rotten = true; break;

                case 1: Rotten = false; break;

                default: break;
                }

                PlayerMobile pm = from as PlayerMobile;

                if (Rotten == true)
                {
                    switch (Utility.Random(12))
                    {
                    case 0: pm.SendMessage("The food was rotten and you don't feel so well!");  pm.Poison = Poison.Regular; break;

                    case 1: pm.SendMessage("The food was rotten and you don't feel so well!");  pm.Poison = Poison.Lesser; break;

                    case 2: pm.SendMessage("The food was rotten and you don't feel so well!");  pm.Hits -= 10; break;

                    case 3: pm.SendMessage("The food was rotten and you don't feel so well!");  pm.Mana -= 10; break;

                    case 4: pm.SendMessage("The food was rotten and you don't feel so well!");  pm.Poison = Poison.Greater; break;

                    case 5: pm.SendMessage("The food was rotten and you didn't get food poisoning"); break;

                    case 6: pm.SendMessage("The food was rotten and you don't feel so well!");  pm.Poison = Poison.Deadly; break;

                    case 7: pm.SendMessage("The food was rotten and you don't feel so well!"); pm.Hunger -= 10; break;

                    case 8: pm.SendMessage("The food was rotten and you didn't get food poisoning"); break;

                    case 9: pm.SendMessage("The food was rotten and you don't feel so well!");  pm.Poison = Poison.Regular; break;

                    case 10: pm.SendMessage("The food was rotten and you don't feel so well!"); pm.Hunger -= 10; break;

                    case 11: pm.SendMessage("The food was rotten and you don't feel so well!");  pm.Stam -= 10; break;

                    default: break;
                    }
                }
                #endregion

                #region stat and skill boost
                if (m_StatBoostTime < 1)
                {
                    m_StatBoostTime     = m_FillFactor * 1;           //1 minutes, same as fillfactor time Stats are based on seconds
                    m_StatBoostDataTime = (m_StatBoostTime / 1) * 60; //converting seconds to minutes for same timeframe as m_StatBoostTime
                }
                if (m_SkillBoostTime < 1)
                {
                    m_SkillBoostTime = m_FillFactor * 1;//1 minutes, same as fillfactor timeSkill is based in Minutes in XmlSpawner
                }
                if (m_Skill != null)
                {
                    if (XmlAttach.FindAttachment(from, typeof(XmlData), m_Skill) == null)
                    {
                        XmlAttach.AttachTo(from, new XmlData(m_Skill, m_Skill, m_SkillBoostTime));                //Set Data to look for next time, XmlData is by minute
                        XmlAttach.AttachTo(from, new XmlSkill(m_Skill, m_Skill, m_SkillBoost, m_SkillBoostTime)); //+ Skill, XmlSkill is by the MINUTE

                        from.FixedEffect(0x376A, 9, 32);
                        from.PlaySound(0x1F2);
                    }
                    else
                    {
                        from.SendMessage(521, "You are already under a {0} effect.", m_Skill);
                    }
                }

                if (IntBoost > 0)
                {
                    if (XmlAttach.FindAttachment(from, typeof(XmlData), "Int") == null)
                    {
                        XmlAttach.AttachTo(from, new XmlData("Int", "Int", m_StatBoostTime)); //Set Data to look for next time, XmlData is by minute
                        XmlAttach.AttachTo(from, new XmlInt(IntBoost, m_StatBoostDataTime));  //+ int, XmlInt is by the SECOND

                        from.FixedEffect(0x376A, 9, 32);
                        from.PlaySound(0x1F2);
                    }
                    else
                    {
                        from.SendMessage(521, "You are already under a Int effect.");
                    }
                }
                if (DexBoost > 0)
                {
                    if (XmlAttach.FindAttachment(from, typeof(XmlData), "Dex") == null)
                    {
                        XmlAttach.AttachTo(from, new XmlData("Dex", "Dex", m_StatBoostTime)); //Set Data to look for next time, XmlData is by minute
                        XmlAttach.AttachTo(from, new XmlDex(DexBoost, m_StatBoostDataTime));  //+ dex, XmlDex is by the SECOND

                        from.FixedEffect(0x376A, 9, 32);
                        from.PlaySound(0x1F2);
                    }
                    else
                    {
                        from.SendMessage(521, "You are already under a Dex effect.");
                    }
                }
                if (StrBoost > 0)
                {
                    if (XmlAttach.FindAttachment(from, typeof(XmlData), "Str") == null)
                    {
                        XmlAttach.AttachTo(from, new XmlData("Str", "Str", m_StatBoostTime)); //Set Data to look for next time, XmlData is by minute
                        XmlAttach.AttachTo(from, new XmlStr(StrBoost, m_StatBoostDataTime));  //+ str, XmlStr is by the SECOND

                        from.FixedEffect(0x376A, 9, 32);
                        from.PlaySound(0x1F2);
                    }
                    else
                    {
                        from.SendMessage(521, "You are already under a Str effect.");
                    }
                }
                #endregion

                this.Consume();

                EventSink.InvokeOnConsume(new OnConsumeEventArgs(from, this));

                return(true);
            }

            return(false);
        }
Example #8
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info == null || state == null || state.Mobile == null || Rewards == null)
            {
                return;
            }

            Mobile from = state.Mobile;

            switch (info.ButtonID)
            {
            case 12:
                // page up
                int nitems = 0;
                if (Rewards != null)
                {
                    nitems = Rewards.Count;
                }

                int page = viewpage + 1;
                if (page > (int)(nitems / maxItemsPerPage))
                {
                    page = (int)(nitems / maxItemsPerPage);
                }
                state.Mobile.SendGump(new PointsRewardGump(state.Mobile, page));
                break;

            case 13:
                // page down
                page = viewpage - 1;
                if (page < 0)
                {
                    page = 0;
                }
                state.Mobile.SendGump(new PointsRewardGump(state.Mobile, page));
                break;

            default:
            {
                if (info.ButtonID >= 1000)
                {
                    int selection = info.ButtonID - 1000;
                    if (selection < Rewards.Count)
                    {
                        XmlPointsRewards r = Rewards[selection] as XmlPointsRewards;

                        // check the price
                        if (XmlPoints.HasCredits(from, r.Cost))
                        {
                            // create an instance of the reward type
                            object o = null;

                            try{
                                o = Activator.CreateInstance(r.RewardType, r.RewardArgs);
                            } catch {}

                            bool received = true;

                            if (o is Item)
                            {
                                // and give them the item
                                from.AddToBackpack((Item)o);
                            }
                            else
                            if (o is Mobile)
                            {
                                // if it is controllable then set the buyer as master.  Note this does not check for control slot limits.
                                if (o is BaseCreature)
                                {
                                    BaseCreature b = o as BaseCreature;
                                    b.Controlled    = true;
                                    b.ControlMaster = from;
                                }

                                ((Mobile)o).MoveToWorld(from.Location, from.Map);
                            }
                            else
                            if (o is XmlAttachment)
                            {
                                XmlAttachment a = o as XmlAttachment;

                                XmlAttach.AttachTo(from, a);
                            }
                            else
                            {
                                from.SendMessage(33, "unable to create {0}.", r.RewardType.Name);
                                received = false;
                            }

                            // complete the transaction
                            if (received)
                            {
                                // charge them
                                XmlPoints.TakeCredits(from, r.Cost);
                                from.SendMessage("You have purchased {0} for {1} credits.", r.Name, r.Cost);
                            }
                        }
                        else
                        {
                            from.SendMessage("Insufficient Credits for {0}.", r.Name);
                        }
                        from.SendGump(new PointsRewardGump(from, viewpage));
                    }
                }
                break;
            }
            }
        }
        public override void OnAttach()
        {
            base.OnAttach();
            if (AttachedTo is PlayerMobile)
            {
                PlayerStatsConfig psc = new PlayerStatsConfig();
                Configured        c   = new Configured();
                if (this.m_Levell == 0)
                {
                    m_Levell   = 1;
                    m_MaxLevel = c.StartMaxLvl;
                    m_ToLevell = 100;
                }

                PlayerAttloop loop = (PlayerAttloop)XmlAttach.FindAttachment((((PlayerMobile)this.AttachedTo)), typeof(PlayerAttloop));
                if (loop == null)
                {
                    XmlAttach.AttachTo((((PlayerMobile)this.AttachedTo)), new PlayerAttloop());
                }

                if (psc.ForceStartingStats == true)
                {
                    (((PlayerMobile)this.AttachedTo)).RawStr = psc.ForceStartingStatsSTR;
                    (((PlayerMobile)this.AttachedTo)).RawDex = psc.ForceStartingStatsDEX;
                    (((PlayerMobile)this.AttachedTo)).RawInt = psc.ForceStartingStatsINT;
                }

                if (psc.ForceNewPlayerIntoGuild == true)
                {
                    PlayerStatsConfig.ForceIntoGuild((((PlayerMobile)this.AttachedTo)));
                }
                if (psc.AddToBackpackOnAttach == true)
                {
                    PlayerStatsConfig.CustomBackPackDrops((((PlayerMobile)this.AttachedTo)));
                }
                if (psc.NewStartingLocation == true)
                {
                    PlayerStatsConfig.StartingLocation((((PlayerMobile)this.AttachedTo)));
                }
                if (psc.AutoActivate_GemMining == true)
                {
                    (((PlayerMobile)this.AttachedTo)).GemMining = true;
                }
                if (psc.AutoActivate_BasketWeaving == true)
                {
                    (((PlayerMobile)this.AttachedTo)).BasketWeaving = true;
                }
                if (psc.AutoActivate_CanBuyCarpets == true)
                {
                    (((PlayerMobile)this.AttachedTo)).CanBuyCarpets = true;
                }
                if (psc.AutoActivate_AcceptGuildInvites == true)
                {
                    (((PlayerMobile)this.AttachedTo)).AcceptGuildInvites = true;
                }
                if (psc.AutoActivate_Glassblowing == true)
                {
                    (((PlayerMobile)this.AttachedTo)).Glassblowing = true;
                }
                if (psc.AutoActivate_LibraryFriend == true)
                {
                    (((PlayerMobile)this.AttachedTo)).LibraryFriend = true;
                }
                if (psc.AutoActivate_Masonry == true)
                {
                    (((PlayerMobile)this.AttachedTo)).Masonry = true;
                }
                if (psc.AutoActivate_SandMining == true)
                {
                    (((PlayerMobile)this.AttachedTo)).SandMining = true;
                }
                if (psc.AutoActivate_StoneMining == true)
                {
                    (((PlayerMobile)this.AttachedTo)).StoneMining = true;
                }
                if (psc.AutoActivate_Spellweaving == true)
                {
                    (((PlayerMobile)this.AttachedTo)).Spellweaving = true;
                }
                if (psc.AutoActivate_MechanicalLife == true)
                {
                    (((PlayerMobile)this.AttachedTo)).MechanicalLife = true;
                }
                if (psc.AutoActivate_DisabledPvpWarning == true)
                {
                    (((PlayerMobile)this.AttachedTo)).DisabledPvpWarning = true;
                }
                if (psc.AutoActivate_isYoung == true)
                {
                    (((PlayerMobile)this.AttachedTo)).Young = true;
                }
                if (psc.AutoActivate_CantWalk == true)
                {
                    (((PlayerMobile)this.AttachedTo)).CantWalk = true;
                }
                if (psc.AutoActivate_MaxFollowSlots == true)
                {
                    (((PlayerMobile)this.AttachedTo)).FollowersMax = psc.AutoActivate_MaxFollowSlotsTotal;
                }
                if (psc.AutoActivate_SkillsCap == true)
                {
                    (((PlayerMobile)this.AttachedTo)).SkillsCap = psc.AutoActivate_SkillsCapVar;
                }
                if (psc.AutoActivate_StartingTotalStatCap == true)
                {
                    (((PlayerMobile)this.AttachedTo)).StatCap = psc.AutoActivate_StartingTotalStatCapVar;
                }
            }
            else
            {
                Delete();
            }
        }
        public NecroCityStableAddon()
        {
            XmlAttach.AttachTo(this, new XmlCitySiege(5000, 60, 60, 1, 1, 5)); //<-------new CitySiege Attachment
            AddonComponent ac = null;

            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, 0, -5, 7);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, -3, -5, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, -4, 2, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, -4, 1, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, -4, 0, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, -4, -4, 7);
            ac     = new AddonComponent(353);
            ac.Hue = 1108;
            AddComponent(ac, -4, -5, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 5, 1, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 5, 0, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 5, -1, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 5, -2, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 5, -3, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 5, -4, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 4, 2, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 4, 1, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 4, -1, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 4, -2, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 4, -3, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 4, -4, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 3, 2, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 3, 1, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 3, 0, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 3, -1, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 3, -2, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 3, -3, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 3, -4, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 2, 1, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 2, 0, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 2, -1, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 2, -3, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 1, 1, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 1, 0, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 1, -1, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 1, -2, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 1, -3, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 1, -4, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 0, 2, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 0, 1, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 0, -1, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 0, -2, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -1, 2, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -1, 1, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -1, -1, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, -1, -2, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, -1, -3, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -1, -4, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, -2, 2, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -2, 0, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, -2, -1, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -2, -2, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, -2, -3, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -2, -4, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, -3, 2, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, -3, 1, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -3, 0, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -3, -1, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, -3, -2, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -3, -3, 7);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, 5, 2, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, 5, 1, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, 5, -3, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, 5, -4, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, 4, -5, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, 2, -5, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, 1, -5, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, -3, -5, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, -4, 2, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, -4, 1, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, -4, 0, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, -4, -2, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, -4, -3, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, -4, -4, 0);
            ac     = new AddonComponent(102);
            ac.Hue = 1108;
            AddComponent(ac, -4, -5, 0);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, 5, -5, 7);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, 4, -5, 7);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, 3, -5, 7);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, -1, -5, 7);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, -2, -5, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, -4, -2, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 5, 2, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 4, 0, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 2, 2, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 2, -2, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 2, -4, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 0, 0, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 0, -3, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 0, -4, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -1, 0, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -2, 1, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -3, -4, 7);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, 5, 0, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, 3, -5, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, 0, -5, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, -1, -5, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, -2, -5, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, -4, -1, 0);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, 1, -5, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, -4, -1, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, -4, -3, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 1, 2, 7);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, 5, -1, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, 5, -2, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, 5, -5, 0);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -3, -2, 7);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -2, -2, 7);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -1, -2, 7);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -3, 1, 7);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -2, 1, 7);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -1, 1, 7);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -1, -2, 7);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -1, -1, 7);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -1, 2, 7);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -1, 1, 7);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -1, -4, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, 5, -4, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, 5, -2, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, 5, -1, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, 5, 1, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, 5, 2, 7);
            ac       = new AddonComponent(354);
            ac.Light = LightType.Circle225;
            ac.Hue   = 1108;
            AddComponent(ac, 5, -3, 7);
            ac       = new AddonComponent(354);
            ac.Light = LightType.Circle225;
            ac.Hue   = 1108;
            AddComponent(ac, 5, 0, 7);
            ac       = new AddonComponent(355);
            ac.Light = LightType.Circle225;
            ac.Hue   = 1108;
            AddComponent(ac, 2, -5, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, 3, 2, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, 0, -4, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, 3, -2, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, 0, 2, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, -2, -4, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, -3, 0, 7);
            ac = new AddonComponent(3893);
            AddComponent(ac, -2, 2, 7);
            ac = new AddonComponent(3894);
            AddComponent(ac, -3, -4, 7);
            ac = new AddonComponent(3894);
            AddComponent(ac, -3, -1, 7);
            ac = new AddonComponent(3894);
            AddComponent(ac, -3, 2, 7);
            ac = new AddonComponent(2880);
            AddComponent(ac, 4, -4, 7);
            ac = new AddonComponent(2878);
            AddComponent(ac, 3, -4, 7);
            ac = new AddonComponent(2880);
            AddComponent(ac, 2, -4, 7);
            ac = new AddonComponent(4980);
            AddComponent(ac, 2, -4, 13);
            ac = new AddonComponent(4977);
            AddComponent(ac, 3, -4, 13);
            ac = new AddonComponent(4979);
            AddComponent(ac, 4, -4, 17);
            ac = new AddonComponent(5453);
            AddComponent(ac, -2, -1, 7);
            ac = new AddonComponent(5453);
            AddComponent(ac, -3, -3, 7);
            ac = new AddonComponent(5453);
            AddComponent(ac, -2, 2, 7);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -3, -4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -3, -3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -3, -2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -3, -1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -3, 0, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -3, 1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -3, 2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -2, -4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -2, -3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -2, -2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -2, -1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -2, 0, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -2, 1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -2, 2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -1, -4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -1, -3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -1, -2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -1, -1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -1, 0, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -1, 1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -1, 2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 0, -4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 0, -3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 0, -2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 0, -1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 0, 0, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 0, 1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 0, 2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 1, -4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 1, -3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 1, -2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 1, -1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 1, 0, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 1, 1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 1, 2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 2, -4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 2, -3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 2, -2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 2, -1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 2, 0, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 2, 1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 2, 2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 3, -4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 3, -3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 3, -2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 3, -1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 3, 0, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 3, 1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 3, 2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 4, -4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 4, -3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 4, -2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 4, -1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 4, 0, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 4, 1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 4, 2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 5, -4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 5, -3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 5, -2, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 5, -1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 5, 0, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 5, 1, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 5, 2, 27);
            ac     = new AddonComponent(363);
            ac.Hue = 1108;
            AddComponent(ac, -4, -5, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -4, -4, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -4, -3, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -4, -2, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -4, -1, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -4, 0, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -4, 1, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -4, 2, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -3, -5, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -2, -5, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -1, -5, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, 0, -5, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, 1, -5, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, 2, -5, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, 3, -5, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, 4, -5, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, 5, -5, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, 5, -4, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, 5, -3, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, 5, -2, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, 5, -1, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, 5, 0, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, 5, 1, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, 5, 2, 27);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, -4, 4, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, -4, 3, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 5, 4, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 4, 4, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 4, 3, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 3, 4, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 3, 3, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 2, 4, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 2, 3, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, 1, 3, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, -1, 3, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, -2, 4, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -2, 3, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -3, 4, 7);
            ac     = new AddonComponent(1294);
            ac.Hue = 1108;
            AddComponent(ac, -3, 3, 7);
            ac     = new AddonComponent(101);
            ac.Hue = 1108;
            AddComponent(ac, 5, 4, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, 5, 3, 0);
            ac     = new AddonComponent(1873);
            ac.Hue = 1108;
            AddComponent(ac, 4, 5, 0);
            ac     = new AddonComponent(1873);
            ac.Hue = 1108;
            AddComponent(ac, 3, 5, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, 4, 4, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, 3, 4, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, 2, 4, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, 1, 4, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, 0, 4, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, -1, 4, 0);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, -2, 4, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, -4, 4, 0);
            ac     = new AddonComponent(100);
            ac.Hue = 1108;
            AddComponent(ac, -4, 3, 0);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 5, 3, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 1, 4, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 0, 4, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, 0, 3, 7);
            ac     = new AddonComponent(1293);
            ac.Hue = 1108;
            AddComponent(ac, -1, 4, 7);
            ac     = new AddonComponent(99);
            ac.Hue = 1108;
            AddComponent(ac, -3, 4, 0);
            ac     = new AddonComponent(1882);
            ac.Hue = 1108;
            AddComponent(ac, 5, 5, 0);
            ac     = new AddonComponent(1883);
            ac.Hue = 1108;
            AddComponent(ac, 2, 5, 0);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -1, 4, 7);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, -3, 4, 7);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, -2, 4, 7);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, -1, 4, 7);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, 1, 4, 7);
            ac     = new AddonComponent(350);
            ac.Hue = 1108;
            AddComponent(ac, 5, 4, 7);
            ac     = new AddonComponent(352);
            ac.Hue = 1108;
            AddComponent(ac, 2, 4, 7);
            ac     = new AddonComponent(351);
            ac.Hue = 1108;
            AddComponent(ac, 5, 3, 7);
            ac       = new AddonComponent(355);
            ac.Light = LightType.Circle225;
            ac.Hue   = 1108;
            AddComponent(ac, 0, 4, 7);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -3, 3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -3, 4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -2, 3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -2, 4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -1, 3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, -1, 4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 0, 3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 0, 4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 1, 3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 1, 4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 2, 3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 2, 4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 3, 3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 3, 4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 4, 3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 4, 4, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 5, 3, 27);
            ac     = new AddonComponent(1173);
            ac.Hue = 1108;
            AddComponent(ac, 5, 4, 27);
            ac = new AddonComponent(2974);
            AddComponent(ac, -4, 5, 7);
            ac     = new AddonComponent(360);
            ac.Hue = 1108;
            AddComponent(ac, 5, 4, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -4, 3, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, -4, 4, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -3, 4, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -2, 4, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, -1, 4, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, 0, 4, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, 1, 4, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, 2, 4, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, 3, 4, 27);
            ac     = new AddonComponent(362);
            ac.Hue = 1108;
            AddComponent(ac, 4, 4, 27);
            ac     = new AddonComponent(361);
            ac.Hue = 1108;
            AddComponent(ac, 5, 3, 27);
        }
Example #11
0
        public MarbleCityMoongateAddon()
        {
            XmlAttach.AttachTo(this, new XmlCitySiege(3000, 60, 60, 1, 1, 5)); //<-------new CitySiege Attachment
            AddonComponent ac = null;

            ac = new AddonComponent(1801);
            AddComponent(ac, 2, -2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 1, 0, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 1, -2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 0, 0, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 0, -2, 0);
            ac = new AddonComponent(3203);
            AddComponent(ac, 3, 3, 5);
            ac = new AddonComponent(3206);
            AddComponent(ac, 4, 3, 5);
            ac = new AddonComponent(3206);
            AddComponent(ac, -4, -3, 5);
            ac = new AddonComponent(1804);
            AddComponent(ac, 1, -3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 1, -1, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 0, 1, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -1, 0, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -4, -4, 0);
            ac = new AddonComponent(3203);
            AddComponent(ac, 3, -3, 5);
            ac = new AddonComponent(3203);
            AddComponent(ac, -3, -3, 5);
            ac = new AddonComponent(3203);
            AddComponent(ac, -3, 3, 5);
            ac = new AddonComponent(3206);
            AddComponent(ac, 4, -3, 5);
            ac = new AddonComponent(3206);
            AddComponent(ac, 3, -4, 5);
            ac = new AddonComponent(1801);
            AddComponent(ac, 3, 4, 0);
            ac = new AddonComponent(3206);
            AddComponent(ac, -4, 3, 5);
            ac = new AddonComponent(3206);
            AddComponent(ac, -3, 4, 5);
            ac = new AddonComponent(283);
            AddComponent(ac, -4, 4, 6);
            ac = new AddonComponent(283);
            AddComponent(ac, 4, -4, 6);
            ac = new AddonComponent(1805);
            AddComponent(ac, -3, 1, 0);
            ac = new AddonComponent(1805);
            AddComponent(ac, -3, 0, 0);
            ac = new AddonComponent(1803);
            AddComponent(ac, 3, 1, 0);
            ac = new AddonComponent(1803);
            AddComponent(ac, 3, 0, 0);
            ac = new AddonComponent(1803);
            AddComponent(ac, 3, -1, 0);
            ac = new AddonComponent(1802);
            AddComponent(ac, 1, 3, 0);
            ac = new AddonComponent(1802);
            AddComponent(ac, 0, 3, 0);
            ac = new AddonComponent(1802);
            AddComponent(ac, -1, 3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 4, 4, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 4, 3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 4, 2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 4, -2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 4, -3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 4, -4, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 3, 3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 3, 2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 3, -2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 3, -4, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 2, 3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 2, 2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 2, 1, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 2, 0, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 2, -1, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 2, -3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 2, -4, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 1, 2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 1, 1, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 0, 2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -1, 2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -1, 1, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -1, -1, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -1, -2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -2, 4, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -2, 3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -2, 2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -2, 1, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -2, 0, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -2, -4, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -3, 3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -3, 2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -3, -2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -3, -3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -3, -4, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -4, 4, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -4, 3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -4, 2, 0);
            ac = new AddonComponent(283);
            AddComponent(ac, -4, -4, 6);
            ac = new AddonComponent(283);
            AddComponent(ac, 4, 4, 6);
            ac = new AddonComponent(3206);
            AddComponent(ac, 3, 4, 5);
            ac = new AddonComponent(3206);
            AddComponent(ac, -3, -4, 5);
            ac = new AddonComponent(1805);
            AddComponent(ac, -3, -1, 0);
            ac = new AddonComponent(1804);
            AddComponent(ac, 0, -3, 0);
            ac = new AddonComponent(1804);
            AddComponent(ac, -1, -3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 3, -3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 2, 4, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, 0, -1, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -2, -1, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -2, -2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -2, -3, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -3, 4, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -4, -2, 0);
            ac = new AddonComponent(1801);
            AddComponent(ac, -4, -3, 0);
        }
        // adds components from a multi.txt file to an existing addon
        public static int LoadAddonFromMulti(XmlSpawnerAddon newaddon, string filename, out string status_str)
        {
            status_str = null;

            if (filename == null)
            {
                status_str = "Invalid filename";
                return(0);
            }

            if (newaddon == null)
            {
                status_str = "Invalid addon";
                return(0);
            }

            bool badformat   = false;
            int  ncomponents = 0;

            if (System.IO.File.Exists(filename))
            {
                using (StreamReader sr = new StreamReader(filename))
                {
                    string line;
                    int    linenumber = 0;

                    // Read and process lines from the file until the end of the file is reached.
                    // Individual lines have the format of
                    // itemid x y z visible [hue] ; attachment[,args]
                    // where visible is a 0/1 and hue can be optionally specified for individual itemid entries.
                    while ((line = sr.ReadLine()) != null)
                    {
                        linenumber++;

                        // process the line
                        if (line.Length == 0)
                        {
                            continue;
                        }

                        // first parse out the component specification from any optional attachment specifications

                        string[] specs = line.Split(';');

                        // the component spec will always be first

                        if (specs == null || specs.Length < 1)
                        {
                            continue;
                        }

                        string[] args = specs[0].Trim().Split(' ');

                        AddonComponent newcomponent = null;

                        if (args != null && args.Length >= 5)
                        {
                            int itemid  = -1;
                            int x       = 0;
                            int y       = 0;
                            int z       = 0;
                            int visible = 0;
                            int hue     = -1;

                            try
                            {
                                itemid  = int.Parse(args[0]);
                                x       = int.Parse(args[1]);
                                y       = int.Parse(args[2]);
                                z       = int.Parse(args[3]);
                                visible = int.Parse(args[4]);

                                // handle the optional fields that are not part of the original multi.txt specification
                                if (args.Length > 5)
                                {
                                    hue = int.Parse(args[5]);
                                }
                            }
                            catch { badformat = true; }

                            if (itemid < 0 || badformat)
                            {
                                status_str = String.Format("Error line {0}", linenumber);
                                break;
                            }

                            // create the new component
                            newcomponent = new AddonComponent(itemid);

                            // set the properties according to the specification
                            newcomponent.Visible = (visible == 1);

                            if (hue >= 0)
                            {
                                newcomponent.Hue = hue;
                            }

                            // add it to the addon
                            newaddon.AddComponent(newcomponent, x, y, z);

                            ncomponents++;
                        }

                        // if a valid component was added, then check to see if any additional attachment specifications need to be processed
                        if (newcomponent != null && specs.Length > 1)
                        {
                            for (int j = 1; j < specs.Length; j++)
                            {
                                if (specs[j] == null)
                                {
                                    continue;
                                }

                                string attachstring = specs[j].Trim();

                                Type type = null;
                                try
                                {
                                    type = SpawnerType.GetType(BaseXmlSpawner.ParseObjectType(attachstring));
                                }
                                catch { }

                                // if so then create it
                                if (type != null && type.IsSubclassOf(typeof(XmlAttachment)))
                                {
                                    object newo = XmlSpawner.CreateObject(type, attachstring, false, true);
                                    if (newo is XmlAttachment)
                                    {
                                        // add the attachment to the target
                                        XmlAttach.AttachTo(newcomponent, (XmlAttachment)newo);
                                    }
                                }
                            }
                        }
                    }

                    sr.Close();
                }
            }
            else
            {
                status_str = "No such file : " + filename;
            }

            if (badformat)
            {
                return(0);
            }
            else
            {
                return(ncomponents);
            }
        }
        public NecroCityMoongateAddon()
        {
            XmlAttach.AttachTo(this, new XmlCitySiege(3000, 60, 60, 1, 1, 5)); //<-------new CitySiege Attachment
            AddonComponent ac = null;

            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -4, -4, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -4, 4, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -3, -3, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -3, 0, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -3, 3, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -2, -2, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -2, -1, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -2, 0, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -2, 1, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -2, 2, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -1, -2, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -1, -1, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -1, 0, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -1, 1, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, -1, 2, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 0, -3, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 0, -2, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 0, -1, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 0, 0, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 0, 1, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 0, 2, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 0, 3, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 1, -2, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 1, -1, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 1, 0, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 1, 1, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 1, 2, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 2, -2, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 2, -1, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 2, 0, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 2, 1, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 2, 2, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 3, -3, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 3, 0, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 3, 3, 0);
            ac     = new AddonComponent(1802);
            ac.Hue = 1108;
            AddComponent(ac, -3, 4, 0);
            ac     = new AddonComponent(1802);
            ac.Hue = 1108;
            AddComponent(ac, 3, 4, 0);
            ac     = new AddonComponent(1802);
            ac.Hue = 1108;
            AddComponent(ac, 0, 4, 0);
            ac     = new AddonComponent(1811);
            ac.Hue = 1108;
            AddComponent(ac, -2, 4, 0);
            ac     = new AddonComponent(1811);
            ac.Hue = 1108;
            AddComponent(ac, 1, 4, 0);
            ac     = new AddonComponent(1812);
            ac.Hue = 1108;
            AddComponent(ac, -1, 4, 0);
            ac     = new AddonComponent(1812);
            ac.Hue = 1108;
            AddComponent(ac, 2, 4, 0);
            ac     = new AddonComponent(1819);
            ac.Hue = 1108;
            AddComponent(ac, -2, 3, 0);
            ac     = new AddonComponent(1819);
            ac.Hue = 1108;
            AddComponent(ac, 1, 3, 0);
            ac     = new AddonComponent(1821);
            ac.Hue = 1108;
            AddComponent(ac, -1, 3, 0);
            ac     = new AddonComponent(1821);
            ac.Hue = 1108;
            AddComponent(ac, 2, 3, 0);
            ac     = new AddonComponent(1804);
            ac.Hue = 1108;
            AddComponent(ac, 0, -4, 0);
            ac     = new AddonComponent(1804);
            ac.Hue = 1108;
            AddComponent(ac, -3, -4, 0);
            ac     = new AddonComponent(1804);
            ac.Hue = 1108;
            AddComponent(ac, 3, -4, 0);
            ac     = new AddonComponent(1805);
            ac.Hue = 1108;
            AddComponent(ac, -4, -3, 0);
            ac     = new AddonComponent(1805);
            ac.Hue = 1108;
            AddComponent(ac, -4, 0, 0);
            ac     = new AddonComponent(1805);
            ac.Hue = 1108;
            AddComponent(ac, -4, 3, 0);
            ac     = new AddonComponent(1810);
            ac.Hue = 1108;
            AddComponent(ac, -4, 2, 0);
            ac     = new AddonComponent(1810);
            ac.Hue = 1108;
            AddComponent(ac, -4, -1, 0);
            ac     = new AddonComponent(1810);
            ac.Hue = 1108;
            AddComponent(ac, -1, -4, 0);
            ac     = new AddonComponent(1810);
            ac.Hue = 1108;
            AddComponent(ac, 2, -4, 0);
            ac     = new AddonComponent(1812);
            ac.Hue = 1108;
            AddComponent(ac, -4, -2, 0);
            ac     = new AddonComponent(1812);
            ac.Hue = 1108;
            AddComponent(ac, -4, 1, 0);
            ac     = new AddonComponent(1813);
            ac.Hue = 1108;
            AddComponent(ac, -2, -4, 0);
            ac     = new AddonComponent(1813);
            ac.Hue = 1108;
            AddComponent(ac, 1, -4, 0);
            ac     = new AddonComponent(1818);
            ac.Hue = 1108;
            AddComponent(ac, -3, 2, 0);
            ac     = new AddonComponent(1818);
            ac.Hue = 1108;
            AddComponent(ac, -3, -1, 0);
            ac     = new AddonComponent(1818);
            ac.Hue = 1108;
            AddComponent(ac, 2, -3, 0);
            ac     = new AddonComponent(1818);
            ac.Hue = 1108;
            AddComponent(ac, -1, -3, 0);
            ac     = new AddonComponent(1819);
            ac.Hue = 1108;
            AddComponent(ac, 3, -2, 0);
            ac     = new AddonComponent(1819);
            ac.Hue = 1108;
            AddComponent(ac, 3, 1, 0);
            ac     = new AddonComponent(1820);
            ac.Hue = 1108;
            AddComponent(ac, -2, -3, 0);
            ac     = new AddonComponent(1820);
            ac.Hue = 1108;
            AddComponent(ac, 1, -3, 0);
            ac     = new AddonComponent(1820);
            ac.Hue = 1108;
            AddComponent(ac, 3, -1, 0);
            ac     = new AddonComponent(1820);
            ac.Hue = 1108;
            AddComponent(ac, 3, 2, 0);
            ac     = new AddonComponent(1821);
            ac.Hue = 1108;
            AddComponent(ac, -3, -2, 0);
            ac     = new AddonComponent(1821);
            ac.Hue = 1108;
            AddComponent(ac, -3, 1, 0);
            ac     = new AddonComponent(4070);
            ac.Hue = 1108;
            AddComponent(ac, -1, 0, 5);
            ac     = new AddonComponent(4071);
            ac.Hue = 1108;
            AddComponent(ac, -1, -1, 5);
            ac     = new AddonComponent(4072);
            ac.Hue = 1108;
            AddComponent(ac, 0, -1, 5);
            ac     = new AddonComponent(4073);
            ac.Hue = 1108;
            AddComponent(ac, -1, 1, 5);
            ac     = new AddonComponent(4074);
            ac.Hue = 1108;
            AddComponent(ac, 0, 0, 5);
            ac     = new AddonComponent(4075);
            ac.Hue = 1108;
            AddComponent(ac, 1, -1, 5);
            ac     = new AddonComponent(4076);
            ac.Hue = 1108;
            AddComponent(ac, 0, 1, 5);
            ac     = new AddonComponent(4077);
            ac.Hue = 1108;
            AddComponent(ac, 1, 1, 5);
            ac     = new AddonComponent(4078);
            ac.Hue = 1108;
            AddComponent(ac, 1, 0, 5);
            ac = new AddonComponent(8708);
            AddComponent(ac, -4, 4, 10);
            ac = new AddonComponent(8708);
            AddComponent(ac, -4, -4, 10);
            ac       = new AddonComponent(6587);
            ac.Light = LightType.Circle225;
            AddComponent(ac, -4, 4, 30);
            ac       = new AddonComponent(6587);
            ac.Light = LightType.Circle225;
            AddComponent(ac, -4, -4, 30);
            ac       = new AddonComponent(6571);
            ac.Light = LightType.Circle225;
            AddComponent(ac, -4, 4, 32);
            ac       = new AddonComponent(6571);
            ac.Light = LightType.Circle225;
            AddComponent(ac, -4, -4, 32);
            ac = new AddonComponent(2976);
            AddComponent(ac, -4, 5, 10);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 4, -4, 0);
            ac     = new AddonComponent(1801);
            ac.Hue = 1108;
            AddComponent(ac, 4, 4, 0);
            ac     = new AddonComponent(1803);
            ac.Hue = 1108;
            AddComponent(ac, 4, -3, 0);
            ac     = new AddonComponent(1803);
            ac.Hue = 1108;
            AddComponent(ac, 4, 3, 0);
            ac     = new AddonComponent(1803);
            ac.Hue = 1108;
            AddComponent(ac, 4, 0, 0);
            ac     = new AddonComponent(1811);
            ac.Hue = 1108;
            AddComponent(ac, 4, 1, 0);
            ac     = new AddonComponent(1811);
            ac.Hue = 1108;
            AddComponent(ac, 4, -2, 0);
            ac     = new AddonComponent(1813);
            ac.Hue = 1108;
            AddComponent(ac, 4, -1, 0);
            ac     = new AddonComponent(1813);
            ac.Hue = 1108;
            AddComponent(ac, 4, 2, 0);
            ac = new AddonComponent(8708);
            AddComponent(ac, 4, -4, 10);
            ac = new AddonComponent(8708);
            AddComponent(ac, 4, 4, 10);
            ac       = new AddonComponent(6587);
            ac.Light = LightType.Circle225;
            AddComponent(ac, 4, -4, 30);
            ac       = new AddonComponent(6587);
            ac.Light = LightType.Circle225;
            AddComponent(ac, 4, 4, 30);
            ac       = new AddonComponent(6571);
            ac.Light = LightType.Circle225;
            AddComponent(ac, 4, 4, 32);
            ac       = new AddonComponent(6571);
            ac.Light = LightType.Circle225;
            AddComponent(ac, 4, -4, 32);
        }
Example #14
0
        public override string OnIdentify(Mobile from)
        {
            string msg      = null;
            int    nSockets = 0;

            // first see if the target has any existing sockets

            XmlSockets s = XmlAttach.FindAttachment(this.AttachedTo, typeof(XmlSockets)) as XmlSockets;

            if (s != null)
            {
                // find out how many sockets it has
                nSockets = s.NSockets;
            }

            if (nSockets > this.MaxSockets)
            {
                this.m_MaxSockets = nSockets;
            }

            if (this.MaxSockets == nSockets)
            {
                // already full so no chance of socketing
                return("Cannot be socketed any further.");
            }

            if (this.MaxSockets > 0)
            {
                msg = String.Format("Maximum sockets allowed is {0}.", this.MaxSockets);
            }
            else if (this.MaxSockets == 0)
            {
                return("You cannot add sockets to this.");
            }
            else if (this.MaxSockets == -1)
            {
                msg = String.Format("Can be socketed.");
            }

            // compute difficulty based upon existing sockets

            if (from != null)
            {
                if (this.MinSkillLevel > 0)
                {
                    msg += String.Format("\nRequires {0} skill in {1} to socket.", this.MinSkillLevel, this.RequiredSkill);
                }

                if (this.MinSkillLevel2 > 0)
                {
                    msg += String.Format("\nas well as {0} skill in {1} to socket.", this.MinSkillLevel2, this.RequiredSkill2);
                }

                if (this.RequiredResource != null && this.ResourceQuantity > 0)
                {
                    msg += String.Format("\nSocketing consumes {0} {1}.", this.ResourceQuantity, this.RequiredResource.Name);
                }

                int success = XmlSockets.ComputeSuccessChance(from, nSockets, this.MinSkillLevel, this.RequiredSkill, this.MinSkillLevel2, this.RequiredSkill2);

                msg += String.Format("\n{0}% chance of socketing\n", success);
            }

            return(msg);
        }
Example #15
0
            private static void TAFTarget(Mobile from, object target)
            {
                if (from == null)
                {
                    return;
                }

                string initialText = "";

                if (target is PlayerMobile)
                {
                    Mobile    friend     = (Mobile)target;
                    Account   fracct     = (Account)friend.Account;
                    ArrayList tafip_List = new ArrayList(fracct.LoginIPs);

                    Account      acct    = (Account)from.Account;
                    ArrayList    ip_List = new ArrayList(acct.LoginIPs);
                    PlayerMobile pm      = from as PlayerMobile;


                    bool toldu = Convert.ToBoolean(acct.GetTag("ToldAFriend"));

                    if (fracct == acct)
                    {
                        initialText = "You can't be your own referrer!";
                    }
                    else
                    {
                        bool uniqueIP = true;

                        foreach (object t in ip_List)
                        {
                            if (tafip_List.Contains(t))
                            {
                                uniqueIP = false;
                            }
                        }

                        XmlReferralRewards re =
                            (XmlReferralRewards)XmlAttach.FindAttachment(friend, typeof(XmlReferralRewards));
                        XmlReferralRewards me =
                            (XmlReferralRewards)XmlAttach.FindAttachment(from, typeof(XmlReferralRewards));

                        //We wrote the method below to prevent players from referring multiple accounts of the same friend.
                        if (uniqueIP)
                        {
                            if (pm != null)
                            {
                                if (me != null)
                                {
                                    if (me.ReferredList.Any(tafip_List.Contains))
                                    {
                                        @from.SendMessage("You've already referred someone that uses their IP address.");
                                        return;
                                    }
                                }
                            }

                            if (!toldu)
                            {
                                initialText = String.Format("{0} marked as referrer.", friend.Name);

                                if (pm != null && me != null)
                                {
                                    foreach (IPAddress ip in tafip_List)
                                    {
                                        me.ReferredList.Add(ip);
                                    }
                                }

                                if (re != null && me != null)
                                {
                                    re.PointsAvailable++;
                                    me.PointsAvailable++;
                                    friend.SendMessage(
                                        "{0} has just marked you as their referrer.  A referral point has been added to your account.  You may spend these by using the [referralrewards command.",
                                        from.Name);
                                    from.SendMessage("You were given a bonus referral point for marking your referrer!");
                                }
                                else
                                {
                                    friend.SendMessage(39, "You are not eligable for referral rewards on {0}.",
                                                       TAFShardName);
                                }

                                acct.SetTag("ToldAFriend", "true");
                                acct.SetTag("Referrer", fracct.ToString());
                            }
                            else
                            {
                                from.SendMessage("You have already set a referrer.");
                                return;
                            }
                        }
                        else
                        {
                            from.SendMessage("You can't refer another account you own.");
                            return;
                        }
                    }
                }
                else
                {
                    initialText = "Please select a player character.";
                }
                from.SendGump(new TAFGump(from, initialText));
            }
Example #16
0
        public AsianCityMarketAddon()
        {
            XmlAttach.AttachTo(this, new XmlCitySiege(10000, 60, 60, 1, 1, 5)); //<-------new CitySiege Attachment
            AddComponent(new AddonComponent(10594), -2, 2, 7);
            AddComponent(new AddonComponent(9321), -2, 2, 47);
            AddComponent(new AddonComponent(9304), -2, 2, 27);
            AddComponent(new AddonComponent(10594), -2, -1, 7);
            AddComponent(new AddonComponent(9308), -2, -1, 27);
            AddComponent(new AddonComponent(9311), -2, -1, 47);
            AddComponent(new AddonComponent(10594), 2, 4, 7);
            AddComponent(new AddonComponent(9307), 2, 4, 27);
            AddComponent(new AddonComponent(11774), 2, 4, 0);
            AddComponent(new AddonComponent(10080), 2, 4, 27);
            AddComponent(new AddonComponent(10594), 3, 0, 7);
            AddComponent(new AddonComponent(9308), 3, 0, 27);
            AddComponent(new AddonComponent(9317), 3, 0, 47);
            AddComponent(new AddonComponent(10594), 3, -1, 7);
            AddComponent(new AddonComponent(9308), 3, -1, 27);
            AddComponent(new AddonComponent(9321), 3, -1, 47);
            AddComponent(new AddonComponent(10598), 3, 2, 7);
            AddComponent(new AddonComponent(9308), 3, 2, 27);
            AddComponent(new AddonComponent(9312), 3, 2, 47);
            AddComponent(new AddonComponent(10595), 3, 1, 7);
            AddComponent(new AddonComponent(9321), 3, 1, 47);
            AddComponent(new AddonComponent(9308), 3, 1, 27);
            AddComponent(new AddonComponent(10594), 5, 2, 7);
            AddComponent(new AddonComponent(9305), 5, 2, 27);
            AddComponent(new AddonComponent(11773), 5, 2, 0);
            AddComponent(new AddonComponent(10077), 5, 2, 27);
            AddComponent(new AddonComponent(10594), 5, 1, 7);
            AddComponent(new AddonComponent(9305), 5, 1, 27);
            AddComponent(new AddonComponent(11773), 5, 1, 0);
            AddComponent(new AddonComponent(10077), 5, 1, 27);
            AddComponent(new AddonComponent(10595), 5, 0, 7);
            AddComponent(new AddonComponent(9305), 5, 0, 27);
            AddComponent(new AddonComponent(11773), 5, 0, 0);
            AddComponent(new AddonComponent(10077), 5, 0, 27);
            AddComponent(new AddonComponent(1861), 5, 5, 0);
            AddComponent(new AddonComponent(10594), 5, 4, 7);
            AddComponent(new AddonComponent(9306), 5, 4, 27);
            AddComponent(new AddonComponent(10069), 5, 4, 7);
            AddComponent(new AddonComponent(11771), 5, 4, 0);
            AddComponent(new AddonComponent(10067), 5, 4, 27);
            AddComponent(new AddonComponent(10594), 5, 3, 7);
            AddComponent(new AddonComponent(9305), 5, 3, 27);
            AddComponent(new AddonComponent(11773), 5, 3, 0);
            AddComponent(new AddonComponent(10077), 5, 3, 27);
            AddComponent(new AddonComponent(1), 0, -1, 0);
            AddComponent(new AddonComponent(10596), 0, -1, 7);
            AddComponent(new AddonComponent(9320), 0, -1, 47);
            AddComponent(new AddonComponent(9304), 0, -1, 27);
            AddComponent(new AddonComponent(5139), 0, -1, 0);
            AddComponent(new AddonComponent(10594), -3, 1, 7);
            AddComponent(new AddonComponent(9302), -3, 1, 27);
            AddComponent(new AddonComponent(10077), -3, 1, 47);
            AddComponent(new AddonComponent(10594), -3, 0, 7);
            AddComponent(new AddonComponent(9302), -3, 0, 27);
            AddComponent(new AddonComponent(10077), -3, 0, 47);
            AddComponent(new AddonComponent(10594), -3, -1, 7);
            AddComponent(new AddonComponent(9302), -3, -1, 27);
            AddComponent(new AddonComponent(10077), -3, -1, 47);
            AddComponent(new AddonComponent(10594), 5, -2, 7);
            AddComponent(new AddonComponent(9305), 5, -2, 27);
            AddComponent(new AddonComponent(11773), 5, -2, 0);
            AddComponent(new AddonComponent(10077), 5, -2, 27);
            AddComponent(new AddonComponent(10593), 5, -3, 7);
            AddComponent(new AddonComponent(9305), 5, -3, 27);
            AddComponent(new AddonComponent(11773), 5, -3, 0);
            AddComponent(new AddonComponent(10077), 5, -3, 27);
            AddComponent(new AddonComponent(10594), 5, -4, 7);
            AddComponent(new AddonComponent(9299), 5, -4, 27);
            AddComponent(new AddonComponent(10079), 5, -4, 7);
            AddComponent(new AddonComponent(11773), 5, -4, 0);
            AddComponent(new AddonComponent(10077), 5, -4, 27);
            AddComponent(new AddonComponent(10082), 5, -5, 7);
            AddComponent(new AddonComponent(11774), 5, -5, 0);
            AddComponent(new AddonComponent(10080), 5, -5, 27);
            AddComponent(new AddonComponent(10598), 4, 3, 7);
            AddComponent(new AddonComponent(9308), 4, 3, 27);
            AddComponent(new AddonComponent(10069), 4, 3, 27);
            AddComponent(new AddonComponent(9312), 4, 3, 47);
            AddComponent(new AddonComponent(10067), 4, 3, 47);
            AddComponent(new AddonComponent(10594), 4, 4, 7);
            AddComponent(new AddonComponent(9307), 4, 4, 27);
            AddComponent(new AddonComponent(11774), 4, 4, 0);
            AddComponent(new AddonComponent(10080), 4, 4, 27);
            AddComponent(new AddonComponent(1849), 4, 5, 0);
            AddComponent(new AddonComponent(1849), 3, 5, 0);
            AddComponent(new AddonComponent(10594), -1, 4, 7);
            AddComponent(new AddonComponent(9307), -1, 4, 27);
            AddComponent(new AddonComponent(11774), -1, 4, 0);
            AddComponent(new AddonComponent(10080), -1, 4, 27);
            AddComponent(new AddonComponent(10594), 0, 4, 7);
            AddComponent(new AddonComponent(9307), 0, 4, 27);
            AddComponent(new AddonComponent(11774), 0, 4, 0);
            AddComponent(new AddonComponent(10080), 0, 4, 27);
            AddComponent(new AddonComponent(10596), 1, 0, 7);
            AddComponent(new AddonComponent(9308), 1, 0, 27);
            AddComponent(new AddonComponent(9311), 1, 0, 47);
            AddComponent(new AddonComponent(1849), -1, 5, 0);
            AddComponent(new AddonComponent(10594), 1, -2, 7);
            AddComponent(new AddonComponent(9308), 1, -2, 27);
            AddComponent(new AddonComponent(9320), 1, -2, 47);
            AddComponent(new AddonComponent(10594), 1, -3, 7);
            AddComponent(new AddonComponent(9320), 1, -3, 47);
            AddComponent(new AddonComponent(9308), 1, -3, 27);
            AddComponent(new AddonComponent(10594), 1, -4, 7);
            AddComponent(new AddonComponent(9300), 1, -4, 27);
            AddComponent(new AddonComponent(10080), 1, -4, 47);
            AddComponent(new AddonComponent(11774), 1, -5, 0);
            AddComponent(new AddonComponent(10080), 1, -5, 27);
            AddComponent(new AddonComponent(11774), 0, -5, 0);
            AddComponent(new AddonComponent(10080), 0, -5, 27);
            AddComponent(new AddonComponent(10594), 0, -4, 7);
            AddComponent(new AddonComponent(9300), 0, -4, 27);
            AddComponent(new AddonComponent(10080), 0, -4, 47);
            AddComponent(new AddonComponent(10594), 0, -3, 7);
            AddComponent(new AddonComponent(9308), 0, -3, 27);
            AddComponent(new AddonComponent(9323), 0, -3, 47);
            AddComponent(new AddonComponent(10594), -2, -4, 7);
            AddComponent(new AddonComponent(9300), -2, -4, 27);
            AddComponent(new AddonComponent(10082), -2, -4, 27);
            AddComponent(new AddonComponent(10080), -2, -4, 47);
            AddComponent(new AddonComponent(1849), 2, 5, 0);
            AddComponent(new AddonComponent(10598), -1, -1, 7);
            AddComponent(new AddonComponent(9318), -1, -1, 47);
            AddComponent(new AddonComponent(9308), -1, -1, 27);
            AddComponent(new AddonComponent(10594), 0, 1, 7);
            AddComponent(new AddonComponent(9308), 0, 1, 27);
            AddComponent(new AddonComponent(9312), 0, 1, 47);
            AddComponent(new AddonComponent(10593), -1, 1, 7);
            AddComponent(new AddonComponent(9308), -1, 1, 27);
            AddComponent(new AddonComponent(9311), -1, 1, 47);
            AddComponent(new AddonComponent(10594), 1, 2, 7);
            AddComponent(new AddonComponent(9310), 1, 2, 47);
            AddComponent(new AddonComponent(9303), 1, 2, 27);
            AddComponent(new AddonComponent(10598), 2, 2, 7);
            AddComponent(new AddonComponent(9308), 2, 2, 27);
            AddComponent(new AddonComponent(9313), 2, 2, 47);
            AddComponent(new AddonComponent(10594), -3, 4, 7);
            AddComponent(new AddonComponent(9309), -3, 4, 27);
            AddComponent(new AddonComponent(10082), -3, 4, 7);
            AddComponent(new AddonComponent(11774), -3, 4, 0);
            AddComponent(new AddonComponent(10080), -3, 4, 27);
            AddComponent(new AddonComponent(10594), 2, 0, 7);
            AddComponent(new AddonComponent(9308), 2, 0, 27);
            AddComponent(new AddonComponent(9312), 2, 0, 47);
            AddComponent(new AddonComponent(11773), -4, 3, 0);
            AddComponent(new AddonComponent(10077), -4, 3, 27);
            AddComponent(new AddonComponent(10079), -4, 4, 7);
            AddComponent(new AddonComponent(11773), -4, 4, 0);
            AddComponent(new AddonComponent(10077), -4, 4, 27);
            AddComponent(new AddonComponent(898), -4, 4, 7);
            //AddComponent( new AddonComponent( 3026 ), -4, 5, 7 ); //Replace me!
            //AddComponent( new AddonComponent( 4027 ), -3, 5, 2 );
            AddComponent(new AddonComponent(2968), -4, 5, 7);
            AddComponent(new AddonComponent(10598), 3, -3, 7);
            AddComponent(new AddonComponent(9308), 3, -3, 27);
            AddComponent(new AddonComponent(9320), 3, -3, 47);
            AddComponent(new AddonComponent(10595), -3, -2, 7);
            AddComponent(new AddonComponent(9302), -3, -2, 27);
            AddComponent(new AddonComponent(10077), -3, -2, 47);
            AddComponent(new AddonComponent(10598), -3, -3, 7);
            AddComponent(new AddonComponent(9302), -3, -3, 27);
            AddComponent(new AddonComponent(10079), -3, -3, 27);
            AddComponent(new AddonComponent(10077), -3, -3, 47);
            AddComponent(new AddonComponent(10594), -3, -4, 7);
            AddComponent(new AddonComponent(9301), -3, -4, 27);
            AddComponent(new AddonComponent(10076), -3, -4, 27);
            AddComponent(new AddonComponent(10074), -3, -4, 47);
            AddComponent(new AddonComponent(11773), -4, 2, 0);
            AddComponent(new AddonComponent(10077), -4, 2, 27);
            AddComponent(new AddonComponent(10076), -4, -5, 7);
            AddComponent(new AddonComponent(11772), -4, -5, 0);
            AddComponent(new AddonComponent(10074), -4, -5, 27);
            AddComponent(new AddonComponent(1849), 1, 5, 0);
            AddComponent(new AddonComponent(10598), 2, 3, 7);
            AddComponent(new AddonComponent(9320), 2, 3, 47);
            AddComponent(new AddonComponent(10080), 2, 3, 47);
            AddComponent(new AddonComponent(9308), 2, 3, 27);
            AddComponent(new AddonComponent(10594), 1, 3, 7);
            AddComponent(new AddonComponent(9308), 1, 3, 27);
            AddComponent(new AddonComponent(9316), 1, 3, 47);
            AddComponent(new AddonComponent(10080), 1, 3, 47);
            AddComponent(new AddonComponent(1849), -2, 5, 0);
            AddComponent(new AddonComponent(10595), -1, 3, 7);
            AddComponent(new AddonComponent(9308), -1, 3, 27);
            AddComponent(new AddonComponent(9313), -1, 3, 47);
            AddComponent(new AddonComponent(10080), -1, 3, 47);
            AddComponent(new AddonComponent(1849), 0, 5, 0);
            AddComponent(new AddonComponent(10594), -2, 4, 7);
            AddComponent(new AddonComponent(9307), -2, 4, 27);
            AddComponent(new AddonComponent(11774), -2, 4, 0);
            AddComponent(new AddonComponent(10080), -2, 4, 27);
            AddComponent(new AddonComponent(11774), 4, -5, 0);
            AddComponent(new AddonComponent(10080), 4, -5, 27);
            AddComponent(new AddonComponent(10594), 4, -4, 7);
            AddComponent(new AddonComponent(9300), 4, -4, 27);
            AddComponent(new AddonComponent(10082), 4, -4, 27);
            AddComponent(new AddonComponent(10080), 4, -4, 47);
            AddComponent(new AddonComponent(10593), 4, -3, 7);
            AddComponent(new AddonComponent(9308), 4, -3, 27);
            AddComponent(new AddonComponent(10079), 4, -3, 27);
            AddComponent(new AddonComponent(9310), 4, -3, 47);
            AddComponent(new AddonComponent(10077), 4, -3, 47);
            AddComponent(new AddonComponent(10594), 5, -1, 7);
            AddComponent(new AddonComponent(9305), 5, -1, 27);
            AddComponent(new AddonComponent(11773), 5, -1, 0);
            AddComponent(new AddonComponent(10077), 5, -1, 27);
            AddComponent(new AddonComponent(10594), -1, -4, 7);
            AddComponent(new AddonComponent(9300), -1, -4, 27);
            AddComponent(new AddonComponent(10080), -1, -4, 47);
            AddComponent(new AddonComponent(11774), -1, -5, 0);
            AddComponent(new AddonComponent(10080), -1, -5, 27);
            AddComponent(new AddonComponent(10596), -1, -2, 7);
            AddComponent(new AddonComponent(9308), -1, -2, 27);
            AddComponent(new AddonComponent(9323), -1, -2, 47);
            AddComponent(new AddonComponent(10596), 0, -2, 7);
            AddComponent(new AddonComponent(9308), 0, -2, 27);
            AddComponent(new AddonComponent(9323), 0, -2, 47);
            AddComponent(new AddonComponent(10594), -1, 0, 7);
            AddComponent(new AddonComponent(9308), -1, 0, 27);
            AddComponent(new AddonComponent(9314), -1, 0, 47);
            AddComponent(new AddonComponent(10079), -4, -4, 7);
            AddComponent(new AddonComponent(11773), -4, -4, 0);
            AddComponent(new AddonComponent(10077), -4, -4, 27);
            AddComponent(new AddonComponent(11773), -4, -3, 0);
            AddComponent(new AddonComponent(10077), -4, -3, 27);
            AddComponent(new AddonComponent(10594), -2, 0, 7);
            AddComponent(new AddonComponent(9308), -2, 0, 27);
            AddComponent(new AddonComponent(9311), -2, 0, 47);
            AddComponent(new AddonComponent(10595), 4, -1, 7);
            AddComponent(new AddonComponent(9308), 4, -1, 27);
            AddComponent(new AddonComponent(9322), 4, -1, 47);
            AddComponent(new AddonComponent(10077), 4, -1, 47);
            AddComponent(new AddonComponent(10593), 4, 0, 7);
            AddComponent(new AddonComponent(9308), 4, 0, 27);
            AddComponent(new AddonComponent(9321), 4, 0, 47);
            AddComponent(new AddonComponent(10077), 4, 0, 47);
            AddComponent(new AddonComponent(10596), 4, 1, 7);
            AddComponent(new AddonComponent(9322), 4, 1, 47);
            AddComponent(new AddonComponent(10077), 4, 1, 47);
            AddComponent(new AddonComponent(9303), 4, 1, 27);
            AddComponent(new AddonComponent(10595), 4, 2, 7);
            AddComponent(new AddonComponent(9308), 4, 2, 27);
            AddComponent(new AddonComponent(9319), 4, 2, 47);
            AddComponent(new AddonComponent(10077), 4, 2, 47);
            AddComponent(new AddonComponent(10594), 3, 4, 7);
            AddComponent(new AddonComponent(9307), 3, 4, 27);
            AddComponent(new AddonComponent(11774), 3, 4, 0);
            AddComponent(new AddonComponent(10080), 3, 4, 27);
            AddComponent(new AddonComponent(10594), 3, 3, 7);
            AddComponent(new AddonComponent(9308), 3, 3, 27);
            AddComponent(new AddonComponent(9323), 3, 3, 47);
            AddComponent(new AddonComponent(10080), 3, 3, 47);
            AddComponent(new AddonComponent(10596), -1, 2, 7);
            AddComponent(new AddonComponent(9308), -1, 2, 27);
            AddComponent(new AddonComponent(9319), -1, 2, 47);
            AddComponent(new AddonComponent(11773), -4, -2, 0);
            AddComponent(new AddonComponent(10077), -4, -2, 27);
            AddComponent(new AddonComponent(10593), 0, 3, 7);
            AddComponent(new AddonComponent(9308), 0, 3, 27);
            AddComponent(new AddonComponent(9312), 0, 3, 47);
            AddComponent(new AddonComponent(10080), 0, 3, 47);
            AddComponent(new AddonComponent(10595), 1, 1, 7);
            AddComponent(new AddonComponent(9308), 1, 1, 27);
            AddComponent(new AddonComponent(9313), 1, 1, 47);
            AddComponent(new AddonComponent(10594), 2, -1, 7);
            AddComponent(new AddonComponent(9308), 2, -1, 27);
            AddComponent(new AddonComponent(9310), 2, -1, 47);
            AddComponent(new AddonComponent(10594), 1, -1, 7);
            AddComponent(new AddonComponent(9308), 1, -1, 27);
            AddComponent(new AddonComponent(9323), 1, -1, 47);
            AddComponent(new AddonComponent(10594), 2, -3, 7);
            AddComponent(new AddonComponent(9308), 2, -3, 27);
            AddComponent(new AddonComponent(9323), 2, -3, 47);
            AddComponent(new AddonComponent(10594), 2, -2, 7);
            AddComponent(new AddonComponent(9308), 2, -2, 27);
            AddComponent(new AddonComponent(9318), 2, -2, 47);
            AddComponent(new AddonComponent(11774), 2, -5, 0);
            AddComponent(new AddonComponent(10080), 2, -5, 27);
            AddComponent(new AddonComponent(10594), 2, -4, 7);
            AddComponent(new AddonComponent(9300), 2, -4, 27);
            AddComponent(new AddonComponent(10080), 2, -4, 47);
            AddComponent(new AddonComponent(10598), -2, -3, 7);
            AddComponent(new AddonComponent(9308), -2, -3, 27);
            AddComponent(new AddonComponent(9311), -2, -3, 47);
            AddComponent(new AddonComponent(10595), -2, -2, 7);
            AddComponent(new AddonComponent(9308), -2, -2, 27);
            AddComponent(new AddonComponent(9313), -2, -2, 47);
            AddComponent(new AddonComponent(11774), -2, -5, 0);
            AddComponent(new AddonComponent(10080), -2, -5, 27);
            AddComponent(new AddonComponent(10082), -3, -5, 7);
            AddComponent(new AddonComponent(11774), -3, -5, 0);
            AddComponent(new AddonComponent(10080), -3, -5, 27);
            AddComponent(new AddonComponent(10598), -2, 1, 7);
            AddComponent(new AddonComponent(9308), -2, 1, 27);
            AddComponent(new AddonComponent(9317), -2, 1, 47);
            AddComponent(new AddonComponent(10594), 0, 0, 7);
            AddComponent(new AddonComponent(9310), 0, 0, 47);
            AddComponent(new AddonComponent(9308), 0, 0, 27);
            AddComponent(new AddonComponent(10594), 1, 4, 7);
            AddComponent(new AddonComponent(9307), 1, 4, 27);
            AddComponent(new AddonComponent(11774), 1, 4, 0);
            AddComponent(new AddonComponent(10080), 1, 4, 27);
            AddComponent(new AddonComponent(10598), 0, 2, 7);
            AddComponent(new AddonComponent(9308), 0, 2, 27);
            AddComponent(new AddonComponent(9311), 0, 2, 47);
            AddComponent(new AddonComponent(10596), 2, 1, 7);
            AddComponent(new AddonComponent(9308), 2, 1, 27);
            AddComponent(new AddonComponent(9310), 2, 1, 47);
            AddComponent(new AddonComponent(1862), -3, 5, 0);
            AddComponent(new AddonComponent(10594), -2, 3, 7);
            AddComponent(new AddonComponent(9308), -2, 3, 27);
            AddComponent(new AddonComponent(10082), -2, 3, 27);
            AddComponent(new AddonComponent(9313), -2, 3, 47);
            AddComponent(new AddonComponent(10080), -2, 3, 47);
            AddComponent(new AddonComponent(10594), -3, 3, 7);
            AddComponent(new AddonComponent(9302), -3, 3, 27);
            AddComponent(new AddonComponent(10079), -3, 3, 27);
            AddComponent(new AddonComponent(10077), -3, 3, 47);
            AddComponent(new AddonComponent(10598), 3, -4, 7);
            AddComponent(new AddonComponent(9300), 3, -4, 27);
            AddComponent(new AddonComponent(10080), 3, -4, 47);
            AddComponent(new AddonComponent(11774), 3, -5, 0);
            AddComponent(new AddonComponent(10080), 3, -5, 27);
            AddComponent(new AddonComponent(10593), 3, -2, 7);
            AddComponent(new AddonComponent(9310), 3, -2, 47);
            AddComponent(new AddonComponent(9304), 3, -2, 27);
            AddComponent(new AddonComponent(10595), 4, -2, 7);
            AddComponent(new AddonComponent(9322), 4, -2, 47);
            AddComponent(new AddonComponent(10077), 4, -2, 47);
            AddComponent(new AddonComponent(9308), 4, -2, 27);
            AddComponent(new AddonComponent(11773), -4, -1, 0);
            AddComponent(new AddonComponent(10077), -4, -1, 27);
            AddComponent(new AddonComponent(11773), -4, 0, 0);
            AddComponent(new AddonComponent(10077), -4, 0, 27);
            AddComponent(new AddonComponent(11773), -4, 1, 0);
            AddComponent(new AddonComponent(10077), -4, 1, 27);
            AddComponent(new AddonComponent(10594), -1, -3, 7);
            AddComponent(new AddonComponent(9320), -1, -3, 47);
            AddComponent(new AddonComponent(9303), -1, -3, 27);
            AddComponent(new AddonComponent(10594), -3, 2, 7);
            AddComponent(new AddonComponent(9302), -3, 2, 27);
            AddComponent(new AddonComponent(10077), -3, 2, 47);
            AddonComponent ac;

            ac = new AddonComponent(2968);
            AddComponent(ac, -4, 5, 7);
            ac = new AddonComponent(898);
            AddComponent(ac, -4, 4, 7);
        }
Example #17
0
        public static void ChatAction(NetState state, PacketReader pvSrc)
        {
            /*if ( !m_Enabled )
             *  return;
             */

            if (state == null || state.Mobile == null || state.Account == null)
            {
                return;
            }

            try
            {
                /*
                 * ChatUser user = ChatUser.GetChatUser( from );
                 *
                 * if ( user == null )
                 *  return;
                 */

                string lang     = pvSrc.ReadStringSafe(4);
                int    actionID = pvSrc.ReadInt16();
                string param    = pvSrc.ReadUnicodeString();

                /*
                 *              ChatActionHandler handler = ChatActionHandlers.GetHandler( actionID );
                 *
                 *              if ( handler != null )
                 *              {
                 *                      Channel channel = user.CurrentChannel;
                 *
                 *                      if ( handler.RequireConference && channel == null )
                 *                      {
                 *                              user.SendMessage( 31 ); // You must be in a conference to do this.
                 *                                                                              // To join a conference, select one from the Conference menu.
                 *                      }
                 *                      else if ( handler.RequireModerator && !user.IsModerator )
                 *                      {
                 *                              user.SendMessage( 29 ); // You must have operator status to do this.
                 *                      }
                 *                      else
                 *                      {
                 *                              handler.Callback( user, channel, param );
                 *                      }
                 *              }
                 *              else
                 *              {
                 *                      Console.WriteLine( "Client: {0}: Unknown chat action 0x{1:X}: {2}", state, actionID, param );
                 *              }*/

                // CUSTOM CODE for uoforever--Chat b/w mobs with the same teamflags


                Mobile         from      = state.Mobile;
                List <XmlTeam> fromTeams = XmlAttach.GetTeams(from);
                if (fromTeams != null)
                {
                    List <NetState> states = NetState.Instances;
                    foreach (NetState nextstate in states)
                    {
                        if (nextstate.Mobile == null)
                        {
                            continue;
                        }
                        if (nextstate.Mobile.AccessLevel >= AccessLevel.GameMaster)
                        {
                            // just get the first team
                            nextstate.Mobile.SendMessage(101, "[" + fromTeams[0].TeamVal + "] " + from.Name + ": " + param);
                        }
                        else
                        {
                            if (nextstate.Mobile.CustomTeam)
                            {
                                List <XmlTeam> toTeams = XmlAttach.GetTeams(nextstate.Mobile);
                                if (XmlTeam.SameTeam(fromTeams, toTeams))
                                {
                                    nextstate.Mobile.SendMessage(101, from.Name + ": " + param);
                                }
                            }
                        }
                    }
                }
                else if (from.AccessLevel >= AccessLevel.Counselor ||
                         CreaturePossession.HasAnyPossessPermissions(from))
                {
                    List <NetState> states       = NetState.Instances;
                    Mobile          sourceMobile = from;
                    if (from is BaseCreature)
                    {
                        sourceMobile = state.Account.GetPseudoSeerLastCharacter();
                    }
                    if (sourceMobile != null)
                    {
                        foreach (NetState nextstate in states)
                        {
                            if (nextstate.Mobile == null)
                            {
                                continue;
                            }
                            if (nextstate.Mobile.AccessLevel >= AccessLevel.Counselor ||
                                CreaturePossession.HasAnyPossessPermissions(nextstate.Mobile))
                            {
                                // just get the first team
                                nextstate.Mobile.SendMessage(101, sourceMobile.Name + ": " + param);
                            }
                            else if (nextstate.Mobile is BaseCreature)
                            {
                                if (nextstate.Account == null)
                                {
                                    continue;
                                }
                                Mobile controllingMobile = nextstate.Account.GetPseudoSeerLastCharacter();
                                if (controllingMobile == null)
                                {
                                    continue;
                                }
                                nextstate.Mobile.SendMessage(101, sourceMobile.Name + ": " + param);
                            }
                        }
                    }
                }
                else if (from is BaseCreature)
                {
                    List <NetState> states            = NetState.Instances;
                    Mobile          controllingMobile = state.Account.GetPseudoSeerLastCharacter();
                    if (controllingMobile != null)
                    {
                        foreach (NetState nextstate in states)
                        {
                            if (nextstate.Mobile == null)
                            {
                                continue;
                            }
                            if (nextstate.Mobile.AccessLevel >= AccessLevel.Counselor ||
                                CreaturePossession.HasAnyPossessPermissions(nextstate.Mobile))
                            {
                                // just get the first team
                                nextstate.Mobile.SendMessage(101, controllingMobile.Name + ": " + param);
                            }
                            else if (nextstate.Mobile is BaseCreature)
                            {
                                nextstate.Mobile.SendMessage(101, controllingMobile.Name + ": " + param);
                            }
                        }
                    }
                }
                else
                {
                    from.SendMessage("You are not on a team!");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (state == null || info == null || state.Mobile == null || m_gauntlet == null || m_gauntlet.Challenger == null)
            {
                return;
            }

            XmlPoints afrom = (XmlPoints)XmlAttach.FindAttachment(state.Mobile, typeof(XmlPoints));

            switch (info.ButtonID)
            {
            case 1:
                // refresh

                m_gauntlet.CheckForDisqualification();

                state.Mobile.SendGump(new KingOfTheHillGump(m_gauntlet, state.Mobile, viewpage));
                break;

            case 10:
                // Entry fee
                int       val = 0;
                TextRelay tr  = info.GetTextEntry(10);
                if (tr != null)
                {
                    try{ val = int.Parse(tr.Text); } catch {}
                }
                m_gauntlet.EntryFee = val;

                m_gauntlet.ResetAcceptance();

                // update all the gumps
                RefreshAllGumps(m_gauntlet, true);

                state.Mobile.SendGump(new KingOfTheHillGump(m_gauntlet, state.Mobile, viewpage));
                break;

            case 12:
                // page up
                // try doing the default for non-participants
                int nplayers = 0;
                if (m_gauntlet.Participants != null)
                {
                    nplayers = m_gauntlet.Participants.Count;
                }

                int page = viewpage + 1;
                if (page > (int)(nplayers / PlayersPerPage))
                {
                    page = (int)(nplayers / PlayersPerPage);
                }

                foreach (KingOfTheHillGauntlet.ChallengeEntry entry in m_WorkingList)
                {
                    if (entry != null)
                    {
                        if (entry.Participant == state.Mobile)
                        {
                            entry.PageBeingViewed++;

                            if (entry.PageBeingViewed > (int)(nplayers / PlayersPerPage))
                            {
                                entry.PageBeingViewed = (int)(nplayers / PlayersPerPage);
                            }
                            page = entry.PageBeingViewed;
                            break;
                        }
                    }
                }

                state.Mobile.SendGump(new KingOfTheHillGump(m_gauntlet, state.Mobile, page));
                break;

            case 13:
                // page down
                // try doing the default for non-participants

                page = viewpage - 1;
                if (page < 0)
                {
                    page = 0;
                }
                foreach (KingOfTheHillGauntlet.ChallengeEntry entry in m_WorkingList)
                {
                    if (entry != null)
                    {
                        if (entry.Participant == state.Mobile)
                        {
                            entry.PageBeingViewed--;

                            if (entry.PageBeingViewed < 0)
                            {
                                entry.PageBeingViewed = 0;
                            }
                            page = entry.PageBeingViewed;
                            break;
                        }
                    }
                }

                state.Mobile.SendGump(new KingOfTheHillGump(m_gauntlet, state.Mobile, page));
                break;

            case 20:
                // arena size
                val = 0;
                tr  = info.GetTextEntry(20);
                if (tr != null)
                {
                    try{ val = int.Parse(tr.Text); } catch {}
                }
                m_gauntlet.ArenaSize = val;

                m_gauntlet.ResetAcceptance();

                // update all the gumps
                RefreshAllGumps(m_gauntlet, true);

                state.Mobile.SendGump(new KingOfTheHillGump(m_gauntlet, state.Mobile, viewpage));
                break;

            case 30:
                // target score
                val = 0;
                tr  = info.GetTextEntry(30);
                if (tr != null)
                {
                    try{ val = int.Parse(tr.Text); } catch {}
                }
                m_gauntlet.TargetScore = val;

                m_gauntlet.ResetAcceptance();

                // update all the gumps
                RefreshAllGumps(m_gauntlet, true);

                state.Mobile.SendGump(new KingOfTheHillGump(m_gauntlet, state.Mobile, viewpage));
                break;

            case 100:

                // add to Participants
                if (m_gauntlet.Participants == null)
                {
                    m_gauntlet.Participants = new ArrayList();
                }

                if (MaxTeamSize > 0 && m_gauntlet.Participants.Count >= MaxTeamSize)
                {
                    XmlPoints.SendText(state.Mobile, 100535);         // "Challenge is full!"
                }
                else
                {
                    state.Mobile.Target = new MemberTarget(m_gauntlet, m_gauntlet.Participants);
                }


                state.Mobile.SendGump(new KingOfTheHillGump(m_gauntlet, state.Mobile, viewpage));
                break;

            case 300:
                // Start game
                if (m_WorkingList == null)
                {
                    return;
                }

                bool complete = true;
                foreach (KingOfTheHillGauntlet.ChallengeEntry entry in m_WorkingList)
                {
                    if (entry != null)
                    {
                        Mobile m = entry.Participant;

                        if (m == null)
                        {
                            continue;
                        }

                        if (!m_gauntlet.CheckQualify(m))
                        {
                            complete = false;
                            break;
                        }

                        if (!entry.Accepted)
                        {
                            XmlPoints.SendText(m_gauntlet.Challenger, 100539, m.Name);      // "{0} has not accepted yet."
                            complete = false;
                            break;
                        }
                    }
                }

                if (m_WorkingList.Count < 2)
                {
                    XmlPoints.SendText(m_gauntlet.Challenger, 100540);      // "Insufficient number of players."
                    complete = false;
                }

                if (m_gauntlet.TargetScore <= 0)
                {
                    XmlPoints.SendText(m_gauntlet.Challenger, 100568);      // "No valid end condition for match."
                    complete = false;
                }
                // copy all of the accepted entries to the final participants list


                if (complete)
                {
                    m_gauntlet.Participants = new ArrayList();

                    foreach (KingOfTheHillGauntlet.ChallengeEntry entry in m_WorkingList)
                    {
                        if (entry != null)
                        {
                            Mobile m = entry.Participant;

                            if (m == null)
                            {
                                continue;
                            }

                            // try to collect any entry fee
                            if (!m_gauntlet.CollectEntryFee(m, m_gauntlet.EntryFee))
                            {
                                continue;
                            }

                            // set up the challenge on each player
                            XmlPoints a = (XmlPoints)XmlAttach.FindAttachment(m, typeof(XmlPoints));
                            if (a != null)
                            {
                                a.ChallengeGame = m_gauntlet;
                            }

                            entry.Status = ChallengeStatus.Active;

                            m_gauntlet.Participants.Add(entry);
                        }
                    }

                    // and lock the game
                    m_gauntlet.StartGame();

                    // refresh all gumps
                    RefreshAllGumps(m_gauntlet, true);
                }
                else
                {
                    state.Mobile.SendGump(new KingOfTheHillGump(m_gauntlet, state.Mobile, viewpage));
                }

                break;

            default:
            {
                // forfeit buttons
                if (info.ButtonID >= 4000)
                {
                    int selection = info.ButtonID - 4000;

                    if (selection < m_WorkingList.Count)
                    {
                        KingOfTheHillGauntlet.ChallengeEntry entry = (KingOfTheHillGauntlet.ChallengeEntry)m_WorkingList[selection];

                        // find the master participants list entry with the same participant
                        if (m_gauntlet.Participants != null)
                        {
                            KingOfTheHillGauntlet.ChallengeEntry forfeitentry = null;

                            foreach (KingOfTheHillGauntlet.ChallengeEntry masterentry in m_gauntlet.Participants)
                            {
                                if (entry == masterentry)
                                {
                                    forfeitentry = masterentry;
                                    break;
                                }
                            }

                            // and remove it
                            if (forfeitentry != null)
                            {
                                forfeitentry.Status = ChallengeStatus.Forfeit;

                                // inform him that he has been kicked
                                m_gauntlet.Forfeit(forfeitentry.Participant);
                            }
                        }
                    }
                }
                // kick buttons
                if (info.ButtonID >= 2000)
                {
                    int selection = info.ButtonID - 2000;

                    if (selection < m_WorkingList.Count)
                    {
                        KingOfTheHillGauntlet.ChallengeEntry entry = (KingOfTheHillGauntlet.ChallengeEntry)m_WorkingList[selection];
                        // find the master participants list entry with the same participant
                        if (m_gauntlet.Participants != null)
                        {
                            KingOfTheHillGauntlet.ChallengeEntry kickentry = null;

                            foreach (KingOfTheHillGauntlet.ChallengeEntry masterentry in m_gauntlet.Participants)
                            {
                                if (entry == masterentry)
                                {
                                    kickentry = masterentry;
                                    break;
                                }
                            }

                            // and remove it
                            if (kickentry != null)
                            {
                                m_gauntlet.Participants.Remove(kickentry);

                                // refresh his gump and inform him that he has been kicked
                                if (kickentry.Participant != null)
                                {
                                    XmlPoints.SendText(kickentry.Participant, 100545, m_gauntlet.ChallengeName);     // "You have been kicked from {0}"
                                    kickentry.Participant.SendGump(new KingOfTheHillGump(m_gauntlet, kickentry.Participant, viewpage));
                                }
                            }
                        }

                        m_gauntlet.ResetAcceptance();
                    }

                    // refresh all gumps
                    RefreshAllGumps(m_gauntlet, true);
                    //state.Mobile.SendGump( new KingOfTheHillGump( m_gauntlet, state.Mobile));
                }
                else
                // accept buttons
                if (info.ButtonID >= 1000)
                {
                    int selection = info.ButtonID - 1000;
                    // set the acceptance flag of the participant
                    if (selection < m_WorkingList.Count)
                    {
                        KingOfTheHillGauntlet.ChallengeEntry entry = (KingOfTheHillGauntlet.ChallengeEntry)m_WorkingList[selection];

                        entry.Accepted = !entry.Accepted;
                    }

                    // refresh all gumps
                    RefreshAllGumps(m_gauntlet, true);

                    //state.Mobile.SendGump( new KingOfTheHillGump( m_gauntlet, state.Mobile));
                }


                break;
            }
            }
        }
Example #19
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if (info == null || m_From == null)
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 0:                     // EXIT
            {
                break;
            }

            case 2:                     // Previous page
            {
                if (m_Page > 0)
                {
                    m_From.SendGump(new XMLQuestLogGump(m_From, m_Page - 1, m_List));
                }

                return;
            }

            case 3:                     // Next page
            {
                if (GetIndexForPage(m_Page + 1) < m_List.Count)
                {
                    m_From.SendGump(new XMLQuestLogGump(m_From, m_Page + 1, m_List));
                }

                break;
            }

            case 10:                     // Top players
            {
                // if this player has an XmlQuestPoints attachment, find it
                XmlQuestPoints p = (XmlQuestPoints)XmlAttach.FindAttachment(m_From, typeof(XmlQuestPoints));

                m_From.CloseGump(typeof(XmlQuestLeaders.TopQuestPlayersGump));
                m_From.SendGump(new XmlQuestLeaders.TopQuestPlayersGump(p));

                break;
            }


            default:
            {
                if (info.ButtonID >= 2000)
                {
                    int index = info.ButtonID - 2000;

                    if (index < 0 || index >= m_List.Count)
                    {
                        break;
                    }

                    if (m_List[index] is IXmlQuest)
                    {
                        IXmlQuest o = m_List[index] as IXmlQuest;

                        if (o != null && !o.Deleted)
                        {
                            m_From.SendGump(new XMLQuestLogGump(m_From, m_Page, null));
                            m_From.CloseGump(typeof(XmlQuestStatusGump));
                            m_From.SendGump(new XmlQuestStatusGump(o, o.TitleString, 320, 0, true));
                        }
                    }
                }

                break;
            }
            }
        }
Example #20
0
        public XmlQuestStatusGump(IXmlQuest questitem, string gumptitle, int X, int Y, bool solid) : base(X, Y)
        {
            Closable    = true;
            Dragable    = true;
            m_X         = X;
            m_Y         = Y;
            m_solid     = solid;
            m_questitem = questitem;
            m_gumptitle = gumptitle;
            AddPage(0);

            if (!solid)
            {
                AddImageTiled(54, 33, 369, 400, 2624);
                AddAlphaRegion(54, 33, 369, 400);
            }
            else
            {
                AddBackground(54, 33, 369, 400, 5054);
            }

            AddImageTiled(416, 39, 44, 389, 203);

            //			AddButton( 338, 392, 2130, 2129, 3, GumpButtonType.Reply, 0 ); // Okay button

            AddHtmlLocalized(139, 59, 200, 30, 1046026, 0x7fff, false, false); // Quest Log
            AddImage(97, 49, 9005);                                            // quest ribbon

            AddImageTiled(58, 39, 29, 390, 10460);                             // left hand border
            AddImageTiled(412, 37, 31, 389, 10460);                            // right hand border
            AddImage(430, 9, 10441);
            AddImageTiled(40, 38, 17, 391, 9263);
            AddImage(6, 25, 10421);
            AddImage(34, 12, 10420);
            AddImageTiled(94, 25, 342, 15, 10304);               // top border
            AddImageTiled(40, 414, 415, 16, 10304);              // bottom border
            AddImage(-10, 314, 10402);
            AddImage(56, 150, 10411);

            AddImage(136, 84, 96);
            AddImage(372, 57, 1417);
            AddImage(381, 66, 5576);

            if (gumptitle != null && gumptitle.Length > 0)
            {                            // display the title if it is there
                AddImage(146, 91, 2103); // bullet
                AddHtml(164, 86, 200, 30, XmlSimpleGump.Color(gumptitle, "00FF42"), false, false);
            }

            if (questitem.NoteString != null && questitem.NoteString.Length > 0)
            {             // display the note string if it is there
                AddHtml(100, 106, 270, 80, questitem.NoteString, true, true);
            }

            DisplayQuestStatus(130, 192, questitem.Objective1, questitem.State1, questitem.Completed1, questitem.Description1);
            DisplayQuestStatus(130, 224, questitem.Objective2, questitem.State2, questitem.Completed2, questitem.Description2);
            DisplayQuestStatus(130, 256, questitem.Objective3, questitem.State3, questitem.Completed3, questitem.Description3);
            DisplayQuestStatus(130, 288, questitem.Objective4, questitem.State4, questitem.Completed4, questitem.Description4);
            DisplayQuestStatus(130, 320, questitem.Objective5, questitem.State5, questitem.Completed5, questitem.Description5);

            //if(questitem.HasCollect){
            AddButton(100, 350, 0x2A4E, 0x2A3A, 700, GumpButtonType.Reply, 0);
            AddLabel(135, 356, 0x384, "Collect");
            //}

            if ((questitem.RewardItem != null && !questitem.RewardItem.Deleted))
            {
                m_questitem.CheckRewardItem();

                if (questitem.RewardItem.Amount > 1)
                {
                    AddLabel(230, 356, 55, String.Format("Reward: {0} ({1})", questitem.RewardItem.GetType().Name,
                                                         questitem.RewardItem.Amount));
                    AddLabel(230, 373, 55, String.Format("Weight: {0}", questitem.RewardItem.Weight * questitem.RewardItem.Amount));
                }
                else
                if (questitem.RewardItem is Container)
                {
                    AddLabel(230, 356, 55, String.Format("Reward: {0} ({1} items)", questitem.RewardItem.GetType().Name,
                                                         questitem.RewardItem.TotalItems));
                    AddLabel(230, 373, 55, String.Format("Weight: {0}", questitem.RewardItem.TotalWeight + questitem.RewardItem.Weight));
                }
                else
                {
                    AddLabel(230, 356, 55, String.Format("Reward: {0}", questitem.RewardItem.GetType().Name));
                    AddLabel(230, 373, 55, String.Format("Weight: {0}", questitem.RewardItem.Weight));
                }
                AddImageTiled(330, 373, 81, 40, 200);
                AddItem(340, 376, questitem.RewardItem.ItemID);
            }
            if (questitem.RewardAttachment != null && !questitem.RewardAttachment.Deleted)
            {
                AddLabel(230, 339, 55, String.Format("Bonus: {0}", questitem.RewardAttachment.GetType().Name));
            }

            if ((questitem.RewardItem != null && !questitem.RewardItem.Deleted) || (questitem.RewardAttachment != null && !questitem.RewardAttachment.Deleted))
            {
                if (questitem.CanSeeReward)
                {
                    AddButton(400, 380, 2103, 2103, 800, GumpButtonType.Reply, 0);
                }
            }

            // indicate any status info
            XmlQuest.VerifyObjectives(questitem);
            if (questitem.Status != null)
            {
                AddLabel(100, 392, 33, questitem.Status);
            }
            else
            // indicate the expiration time
            if (questitem.IsValid)
            {
                //AddHtmlLocalized(150, 400, 50, 37, 1046033, 0xf0000 , false , false ); // Expires
                AddHtml(130, 392, 200, 37, XmlSimpleGump.Color(questitem.ExpirationString, "00FF42"), false, false);
            }
            else
            if (questitem.AlreadyDone)
            {
                if (!questitem.Repeatable)
                {
                    AddLabel(100, 392, 33, "Already done - cannot be repeated");
                }
                else
                {
                    ArrayList a = XmlAttach.FindAttachments(questitem.Owner, typeof(XmlQuestAttachment), questitem.Name);
                    if (a != null && a.Count > 0)
                    {
                        AddLabel(100, 392, 33, String.Format("Repeatable in {0}", ((XmlQuestAttachment)a[0]).Expiration));
                    }
                    else
                    {
                        AddLabel(150, 392, 33, "Already done - ???");
                    }
                }
            }
            else
            {
                //AddHtml( 150, 384, 200, 37, XmlSimpleGump.Color( "No longer valid", "00FF42" ), false, false );
                AddLabel(150, 392, 33, "No longer valid");
            }
            if (XmlQuest.QuestPointsEnabled)
            {
                AddHtml(250, 40, 200, 30, XmlSimpleGump.Color(String.Format("Difficulty Level {0}", questitem.Difficulty), "00FF42"), false, false);
            }
            if (questitem.PartyEnabled)
            {
                AddHtml(250, 55, 200, 30, XmlSimpleGump.Color("Party Quest", "00FF42"), false, false);
                if (questitem.PartyRange >= 0)
                {
                    AddHtml(250, 70, 200, 30, XmlSimpleGump.Color(String.Format("Party Range {0}", questitem.PartyRange), "00FF42"), false, false);
                }
                else
                {
                    AddHtml(250, 70, 200, 30, XmlSimpleGump.Color("No Range Limit", "00FF42"), false, false);
                }
            }
            else
            {
                AddHtml(250, 55, 200, 30, XmlSimpleGump.Color("Solo Quest", "00FF42"), false, false);
            }
        }
Example #21
0
        public static double GetScaledFaction(Mobile from, Mobile mob, double min, double max, double scale)
        {
            if (from == null || mob == null || !from.Player)
            {
                return(0);
            }

            double facvalue = 0;

            //XmlMobFactions x = (XmlMobFactions)XmlAttach.FindAttachment(XmlAttach.MobileAttachments, from, typeof(XmlMobFactions), "Standard");

            XmlMobFactions x = XmlAttach.FindAttachment(from, typeof(XmlMobFactions), "Standard") as XmlMobFactions;

            if (x != null)
            {
                //if(x != null)
                //{

                int count = 0;
                // find any static groups that this mob belongs to.  Note, if it belongs to more than one group, calculate the average.
                List <GroupTypes> glist = FindGroups(mob);

                if (glist != null && glist.Count > 0)
                {
                    foreach (GroupTypes g in glist)
                    {
                        if (g != GroupTypes.End_Unused)
                        {
                            facvalue += x.GetFactionLevel(g) * scale;
                            count++;
                        }
                    }
                }

                // does this mob have dynamic faction assignments?
                List <XmlAttachment> dlist = XmlAttach.FindAttachments(mob, typeof(XmlDynamicFaction));
                if (dlist != null && dlist.Count > 0)
                {
                    //if(XmlAttach.FindAttachment(XmlAttach.MobileAttachments, mob, typeof(XmlDynamicFaction)) != null)
                    //{
                    // do this for dynamic factions as well
                    List <GroupTypes> dglist = DynamicFindGroups(mob);

                    if (dglist != null && dglist.Count > 0)
                    {
                        foreach (GroupTypes g in dglist)
                        {
                            if (g != GroupTypes.End_Unused)
                            {
                                facvalue += x.GetFactionLevel(g) * scale;
                                count++;
                            }
                        }
                    }
                }

                // compute the average faction value
                if (count > 0)
                {
                    facvalue /= count;
                }
            }
            if (facvalue > max)
            {
                facvalue = max;
            }
            if (facvalue < min)
            {
                facvalue = min;
            }

            return(facvalue);
        }
 public override void OnDoubleClick(Mobile from)
 {
     from.SendGump(new XmlPoints.TopPlayersGump(XmlAttach.FindAttachment(from, typeof(XmlPoints)) as XmlPoints));
 }
Example #23
0
        // These functions are borrowed heavily from ArteGordon's BaseXmlSpawner class

        // set property values with support for nested attributes
        public static void SetPropertyValue(TriggerObject trigObj, object o, string name, object value)
        {
            if (o == null)
            {
                throw new UberScriptException("Null object");
            }

            //Type ptype = null;
            object po   = null;
            Type   type = o.GetType();

            PropertyInfo[] props = type.GetProperties(BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public);

            // parse the strings of the form property.attribute into two parts
            // first get the property
            List <string> arglist = PropertyGetters.PropSplitter(name);

            string propname = arglist[0];

            if (propname.Length == 0)
            {
                throw new UberScriptException("Empty string property!");
            }

            // Check whether they are trying to set an xml attachment through the
            // shortcut e.g. TRIGMOB().xmlints.score = TRIGMOB().xmlints.score + 1

            if (arglist.Count > 1 && (propname[0] == 'x' || propname[0] == 'X'))
            {
                // NEED TO HANDLE SETTING PROPERTIES ON THE ATTACHMENTS!
                string lowerPropName = propname.ToLower();
                if (lowerPropName == "xmlints")
                {
                    IEntity entity = o as IEntity;
                    if (entity == null)
                    {
                        throw new UberScriptException("Can't set xmlints on anything but Mobile or Item");
                    }
                    // check for existing xmlValue attachment or create a new one
                    XmlValue xmlValue = XmlAttach.GetValueAttachment(entity, arglist[1]);
                    if (xmlValue == null)
                    {
                        // arglist should only have [xmlints, name], nothing more
                        if (arglist.Count > 2)
                        {
                            throw new UberScriptException("Attempted to set property on a not-yet-existant attachment!:" + name);
                        }
                        xmlValue = new XmlValue(arglist[1], (int)value);
                        XmlAttach.AttachTo(null, entity, xmlValue);
                    }
                    else if (arglist.Count == 2)
                    {
                        if (value == null)
                        {
                            xmlValue.Delete();
                        }
                        else
                        {
                            xmlValue.Value = (int)value;
                        }
                    }
                    else if (arglist.Count > 2)
                    {
                        // could be setting a property on an existing XmlAttachment!
                        // e.g. xmlints.test.expiration = 0:0:1
                        SetPropertyValue(trigObj, xmlValue, arglist[2], value);
                    }
                    return;
                }
                else if (lowerPropName == "xmlstrings")
                {
                    IEntity entity = o as IEntity;
                    if (entity == null)
                    {
                        throw new UberScriptException("Can't set xmlstrings on anything but Mobile or Item");
                    }
                    XmlLocalVariable xmlLocalVariable = XmlAttach.GetStringAttachment(entity, arglist[1]);
                    if (xmlLocalVariable == null)
                    {
                        // arglist should only have [xmlints, name], nothing more
                        if (arglist.Count > 2)
                        {
                            throw new UberScriptException("Attempted to set property on a not-yet-existant attachment!:" + name);
                        }
                        xmlLocalVariable = new XmlLocalVariable(arglist[1], (string)value);
                        XmlAttach.AttachTo(null, entity, xmlLocalVariable);
                    }
                    else if (arglist.Count == 2)
                    {
                        if (value == null)
                        {
                            xmlLocalVariable.Delete();
                        }
                        else
                        {
                            xmlLocalVariable.Data = (string)value;
                        }
                    }
                    else if (arglist.Count > 2)
                    {
                        // could be setting a property on an existing XmlAttachment!
                        // e.g. xmlints.test.expiration = 0:0:1
                        SetPropertyValue(trigObj, xmlLocalVariable, arglist[2], value);
                    }
                    return;
                }
                else if (lowerPropName == "xmldoubles")
                {
                    IEntity entity = o as IEntity;
                    if (entity == null)
                    {
                        throw new UberScriptException("Can't set xmldoubles on anything but Mobile or Item");
                    }
                    XmlDouble xmlDouble = XmlAttach.GetDoubleAttachment(entity, arglist[1]);
                    if (xmlDouble == null)
                    {
                        // arglist should only have [xmlints, name], nothing more
                        if (arglist.Count > 2)
                        {
                            throw new UberScriptException("Attempted to set property on a not-yet-existant attachment!:" + name);
                        }
                        xmlDouble = new XmlDouble(arglist[1], (double)value);
                        XmlAttach.AttachTo(null, entity, xmlDouble);
                    }
                    else if (arglist.Count == 2)
                    {
                        if (value == null)
                        {
                            xmlDouble.Delete();
                        }
                        else
                        {
                            xmlDouble.Value = (double)value;
                        }
                    }
                    else if (arglist.Count > 2)
                    {
                        // could be setting a property on an existing XmlAttachment!
                        // e.g. xmlints.test.expiration = 0:0:1
                        SetPropertyValue(trigObj, xmlDouble, arglist[2], value);
                    }
                    return;
                }
                else if (lowerPropName == "xmlobjs")
                {
                    IEntity entity = o as IEntity;
                    if (entity == null)
                    {
                        throw new UberScriptException("Can't set xmlobjs on anything but Mobile or Item");
                    }
                    XmlObject xmlObject = XmlAttach.GetObjectAttachment(entity, arglist[1]);
                    if (xmlObject == null)
                    {
                        // arglist should only have [xmlints, name], nothing more
                        if (arglist.Count > 2)
                        {
                            throw new UberScriptException("Attempted to set property on a not-yet-existant attachment!:" + name);
                        }
                        xmlObject = new XmlObject(arglist[1], value);
                        XmlAttach.AttachTo(null, entity, xmlObject);
                    }
                    else if (arglist.Count == 2)
                    {
                        if (value == null)
                        {
                            xmlObject.Delete();
                        }
                        else
                        {
                            xmlObject.Value = value;
                        }
                    }
                    else if (arglist.Count > 2)
                    {
                        // XmlObject only contains a few properties that
                        // can be accessed through statements like THIS().xmlobjs.test._____
                        // since there is a potential conflict between the developer wanting access
                        // to the properties on the object contained in the XmlObject.Value (most likely)
                        // or the properties on the XmlObject itself (far less likely)
                        string testPropName = arglist[2].ToLower();
                        // to access properties on the xmlobject itself (e.g. expiration), one must do this:
                        //  THIS().xmlobjs.test.xmlobject.expiration
                        if (testPropName == "xmlobject")
                        {
                            if (arglist.Count < 4)
                            {
                                throw new UberScriptException("Can't set an xmlobject directly, use ATTACH function!");
                            }
                            else
                            {
                                string propLookup = arglist[3]; // add this first so later additions all prepended with '.'
                                for (int i = 4; i < arglist.Count; i++)
                                {
                                    propLookup += "." + arglist[i];
                                }
                                SetPropertyValue(trigObj, xmlObject, propLookup, value);
                            }
                        }
                        else
                        {
                            string propLookup = arglist[2]; // add this first so later additions all prepended with '.'
                            for (int i = 3; i < arglist.Count; i++)
                            {
                                propLookup += "." + arglist[i];
                            }
                            SetPropertyValue(trigObj, xmlObject.Value, propLookup, value);
                        }
                    }

                    //else if (arglist.Count > 2)
                    //{
                    // could be setting a property on an existing XmlAttachment!
                    // e.g. xmlints.test.expiration = 0:0:1
                    //    SetPropertyValue(trigObject, xmlObject, arglist[2], value);
                    //}
                    return;
                }
            }

            /*
             * string[] keywordargs = ParseString(propname, 4, ",");
             *
             * // check for special keywords
             * if (keywordargs[0] == "ATTACHMENT")
             * {
             *  if (keywordargs.Length < 4)
             *  {
             *      return "Invalid ATTACHMENT format";
             *  }
             *  // syntax is ATTACHMENT,type,name,propname
             *
             *  string apropname = keywordargs[3];
             *  string aname = keywordargs[2];
             *  Type attachtype = SpawnerType.GetType(keywordargs[1]);
             *
             *  // allow empty string specifications to be used to indicate a null string which will match any name
             *  if (aname == "") aname = null;
             *
             *  ArrayList attachments = XmlAttach.FindAttachments(o, attachtype, aname);
             *
             *  if (attachments != null && attachments.Count > 0)
             *  {
             *      // change the object, object type, and propname to refer to the attachment
             *      o = attachments[0];
             *      propname = apropname;
             *
             *      if (o == null)
             *      {
             *          return "Null object";
             *      }
             *
             *      type = o.GetType();
             *      props = type.GetProperties(BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public);
             *  }
             *  else
             *      return "Attachment not found";
             *
             * }
             * else if (keywordargs[0] == "SKILL")
             * {
             *  if (keywordargs.Length < 2)
             *  {
             *      return "Invalid SKILL format";
             *  }
             *  bool found = true;
             *  try
             *  {
             *      SkillName skillname = (SkillName)Enum.Parse(typeof(SkillName), keywordargs[1], true);
             *      if (o is Mobile)
             *      {
             *
             *          Skill skill = ((Mobile)o).Skills[skillname];
             *
             *          skill.Base = double.Parse(value);
             *
             *          return "Property has been set.";
             *      }
             *      else
             *          return "Object is not mobile";
             *  }
             *  catch { found = false; }
             *
             *  if (!found)
             *      return "Invalid SKILL reference.";
             * }
             * else if (keywordargs[0] == "STEALABLE")
             * {
             *
             *  bool found = true;
             *  try
             *  {
             *      if (o is Item)
             *      {
             *
             *          ItemFlags.SetStealable(o as Item, bool.Parse(value));
             *
             *          return "Property has been set.";
             *      }
             *      else
             *          return "Object is not an item";
             *  }
             *  catch { found = false; }
             *
             *  if (!found)
             *      return "Invalid Stealable assignment.";
             * }
             * */

            // do a bit of parsing to handle array references
            string[] arraystring = propname.Split('[');
            int      index       = 0;

            if (arraystring.Length > 1)
            {
                // parse the property name from the indexing
                propname = arraystring[0];

                // then parse to get the index value
                string[] arrayvalue = arraystring[1].Split(']');

                if (arrayvalue.Length > 0)
                {
                    try
                    {
                        index = int.Parse(arrayvalue[0]);
                    }
                    catch
                    {
                        try
                        {
                            index = (int)(new MathTree(null, arrayvalue[0])).Calculate(trigObj);
                        }
                        catch
                        {
                            throw new UberScriptException("Could not get int array value from: " + arrayvalue[0] + " for prop of " + name + " on object " + o);
                        }
                    }
                }
            }
            PropertyInfo propInfoToSet     = null;
            string       lowerCasePropName = propname.ToLower();

            // optimization to find propertyInfo without looping through
            if (o is BaseCreature)
            {
                if (BaseCreatureProperties.ContainsKey(lowerCasePropName))
                {
                    propInfoToSet = BaseCreatureProperties[lowerCasePropName];
                }
            }
            else if (o is PlayerMobile)
            {
                if (PlayerMobileProperties.ContainsKey(lowerCasePropName))
                {
                    propInfoToSet = PlayerMobileProperties[lowerCasePropName];
                }
            }
            else if (o is Item)
            {
                if (ItemProperties.ContainsKey(lowerCasePropName))
                {
                    propInfoToSet = ItemProperties[lowerCasePropName];
                }
            }
            // is a nested property with attributes so first get the property
            if (propInfoToSet == null)
            {
                foreach (PropertyInfo p in props)
                {
                    if (Insensitive.Equals(p.Name, propname))
                    {
                        propInfoToSet = p;
                        break;
                    }
                }
            }
            if (propInfoToSet != null)
            {
                //if (IsProtected(type, propname))
                //    return "Property is protected.";

                if (arglist.Count > 1)
                {
                    //ptype = propInfoToSet.PropertyType;
                    po = propInfoToSet.GetValue(o, null);
                    // now set the nested attribute using the new property list
                    string propLookup = arglist[1];
                    for (int i = 2; i < arglist.Count; i++)
                    {
                        propLookup += "." + arglist[i];
                    }
                    SetPropertyValue(trigObj, po, propLookup, value);
                    return;
                    // otherwise let it roll through and throw an exception
                }
                else // arglist.Count == 1
                {
                    //if (IsProtected(type, propname))
                    //    return "Property is protected.";
                    if (!propInfoToSet.CanWrite)
                    {
                        throw new UberScriptException("Property is read only.");
                    }

                    InternalSetValue(o, propInfoToSet, value, false, index);
                    return;
                }
            }

            throw new UberScriptException("Property " + name + " not found on " + o + ".");
        }
Example #24
0
        public LootGump(Mobile m) : base(200, 100)
        {
            LootData lootoptions = (LootData)XmlAttach.FindAttachment(m, typeof(LootData));


            this.Closable   = true;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;

            AddPage(0);
            AddBackground(0, 0, 450, 511, 9380);

            AddLabel(166, 4, 0, @"Looting Options");
            AddLabel(108, 37, 233, @"Select what you want to be looted");

            AddLabel(40, 90, 0, @"All Items");
            AddCheck(160, 90, 1151, 1154, lootoptions.GetAll, 1);

            AddLabel(39, 130, 0, @"Artifacts");
            AddCheck(160, 130, 1151, 1154, lootoptions.GetArtifacts, 2);

            AddLabel(40, 170, 0, @"Weapons");
            AddCheck(160, 170, 1151, 1154, lootoptions.GetWeapons, 3);

            AddLabel(40, 210, 0, @"Armor");
            AddCheck(160, 210, 1151, 1154, lootoptions.GetArmor, 4);

            AddLabel(40, 250, 0, @"Clothing");
            AddCheck(160, 250, 1151, 1154, lootoptions.GetClothing, 5);

            AddLabel(40, 290, 0, @"Jewelry");
            AddCheck(160, 290, 1151, 1154, lootoptions.GetJewelry, 6);

            AddLabel(40, 330, 0, @"Gems");
            AddCheck(160, 330, 1151, 1154, lootoptions.GetGems, 7);

            AddLabel(40, 370, 0, @"Bolts/Arrows");
            AddCheck(160, 370, 1151, 1154, lootoptions.GetArrows, 8);

            AddLabel(270, 90, 0, @"Food");
            AddCheck(380, 90, 1151, 1154, lootoptions.GetFood, 9);

            AddLabel(270, 130, 0, @"Hides");
            AddCheck(380, 129, 1151, 1154, lootoptions.GetHides, 10);

            AddLabel(270, 170, 0, @"Scales");
            AddCheck(380, 170, 1151, 1154, lootoptions.GetScales, 11);

            AddLabel(270, 210, 0, @"Wood");
            AddCheck(380, 210, 1151, 1154, lootoptions.GetWood, 12);

            AddLabel(270, 250, 0, @"Ores");
            AddCheck(380, 250, 1151, 1154, lootoptions.GetOres, 13);

            AddLabel(270, 290, 0, @"Reagents");
            AddCheck(380, 290, 1151, 1154, lootoptions.GetReagents, 14);

            AddLabel(270, 330, 0, @"Potions");
            AddCheck(380, 330, 1151, 1154, lootoptions.GetPotions, 15);

            AddLabel(270, 370, 0, @"Other Things");
            AddCheck(380, 370, 1151, 1154, lootoptions.GetOther, 16);

            AddLabel(140, 410, 0, @"Get Ground Items");
            AddCheck(280, 410, 1151, 1154, lootoptions.GetGroundItems, 17);

            AddButton(349, 450, 247, 248, 1, GumpButtonType.Reply, 0);
            AddButton(30, 450, 241, 242, 0, GumpButtonType.Reply, 0);
        }
Example #25
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            if (version < 5)
            {
                // have to add the XmlDialog attachment
                m_DialogAttachment = new XmlDialog(default(string));
                XmlAttach.AttachTo(this, m_DialogAttachment);
            }

            switch (version)
            {
            case 7:
                m_EItemID  = reader.ReadInt();
                m_Duration = reader.ReadInt();
                m_Offset   = reader.ReadPoint3D();
                m_EHue     = reader.ReadInt();
                goto case 6;

            case 6:
                TalkText = reader.ReadString();
                break;

            case 5:
            {
                break;
            }

            case 4:
            {
                int count = reader.ReadInt();

                SpeechEntries = new ArrayList();
                for (int i = 0; i < count; i++)
                {
                    XmlDialog.SpeechEntry newentry = new XmlDialog.SpeechEntry();

                    newentry.Condition = reader.ReadString();

                    SpeechEntries.Add(newentry);
                }

                goto case 3;
            }

            case 3:
            {
                TriggerOnCarried   = reader.ReadString();
                NoTriggerOnCarried = reader.ReadString();
                goto case 2;
            }

            case 2:
            {
                SpeechPace = reader.ReadInt();

                int count = reader.ReadInt();
                if (version < 4)
                {
                    SpeechEntries = new ArrayList();
                }
                for (int i = 0; i < count; i++)
                {
                    if (version < 4)
                    {
                        XmlDialog.SpeechEntry newentry = new XmlDialog.SpeechEntry();

                        newentry.PrePause         = reader.ReadInt();
                        newentry.LockConversation = reader.ReadBool();
                        newentry.AllowNPCTrigger  = reader.ReadBool();
                        newentry.SpeechStyle      = (MessageType)reader.ReadInt();

                        SpeechEntries.Add(newentry);
                    }
                    else
                    {
                        XmlDialog.SpeechEntry newentry = (XmlDialog.SpeechEntry)SpeechEntries[i];

                        newentry.PrePause         = reader.ReadInt();
                        newentry.LockConversation = reader.ReadBool();
                        newentry.AllowNPCTrigger  = reader.ReadBool();
                        newentry.SpeechStyle      = (MessageType)reader.ReadInt();
                    }
                }
                goto case 1;
            }

            case 1:
            {
                ActivePlayer = reader.ReadMobile();
                goto case 0;
            }

            case 0:
            {
                IsActive        = reader.ReadBool();
                ResetTime       = reader.ReadTimeSpan();
                LastInteraction = reader.ReadDateTime();
                AllowGhostTrig  = reader.ReadBool();
                ProximityRange  = reader.ReadInt();
                Running         = reader.ReadBool();
                ConfigFile      = reader.ReadString();
                int count = reader.ReadInt();
                if (version < 2)
                {
                    SpeechEntries = new ArrayList();
                }
                for (int i = 0; i < count; i++)
                {
                    if (version < 2)
                    {
                        XmlDialog.SpeechEntry newentry = new XmlDialog.SpeechEntry();

                        newentry.EntryNumber = reader.ReadInt();
                        newentry.ID          = reader.ReadInt();
                        newentry.Text        = reader.ReadString();
                        newentry.Keywords    = reader.ReadString();
                        newentry.Action      = reader.ReadString();
                        newentry.DependsOn   = reader.ReadInt().ToString();
                        newentry.Pause       = reader.ReadInt();

                        SpeechEntries.Add(newentry);
                    }
                    else
                    {
                        XmlDialog.SpeechEntry newentry = (XmlDialog.SpeechEntry)SpeechEntries[i];

                        newentry.EntryNumber = reader.ReadInt();
                        newentry.ID          = reader.ReadInt();
                        newentry.Text        = reader.ReadString();
                        newentry.Keywords    = reader.ReadString();
                        newentry.Action      = reader.ReadString();
                        newentry.DependsOn   = reader.ReadInt().ToString();
                        newentry.Pause       = reader.ReadInt();
                    }
                }
                // read in the current entry number. Note this will also set the current entry
                EntryNumber = reader.ReadInt();
                // restart the timer if it was active
                bool isrunning = reader.ReadBool();
                if (isrunning)
                {
                    Mobile   trigmob = reader.ReadMobile();
                    TimeSpan delay   = reader.ReadTimeSpan();
                    if (DialogAttachment != null)
                    {
                        DialogAttachment.DoTimer(delay, trigmob);
                    }
                }
                break;
            }
            }
        }
Example #26
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            PlayerMobile pm          = sender.Mobile as PlayerMobile;
            LootData     lootoptions = (LootData)XmlAttach.FindAttachment(pm, typeof(LootData));

            switch (info.ButtonID)
            {
            case 0:         // closed or cancel
            {
                break;
            }

            case 1:                         // OKAY button pressed
            {
                ArrayList Selections = new ArrayList(info.Switches);

                if (Selections.Contains(1) == true)
                {
                    lootoptions.GetAll = true;
                }
                else
                {
                    lootoptions.GetAll = false;
                }

                if (Selections.Contains(2) == true)
                {
                    lootoptions.GetArtifacts = true;
                }
                else
                {
                    lootoptions.GetArtifacts = false;
                }

                if (Selections.Contains(3) == true)
                {
                    lootoptions.GetWeapons = true;
                }
                else
                {
                    lootoptions.GetWeapons = false;
                }

                if (Selections.Contains(4) == true)
                {
                    lootoptions.GetArmor = true;
                }
                else
                {
                    lootoptions.GetArmor = false;
                }

                if (Selections.Contains(5) == true)
                {
                    lootoptions.GetClothing = true;
                }
                else
                {
                    lootoptions.GetClothing = false;
                }

                if (Selections.Contains(6) == true)
                {
                    lootoptions.GetJewelry = true;
                }
                else
                {
                    lootoptions.GetJewelry = false;
                }

                if (Selections.Contains(7) == true)
                {
                    lootoptions.GetGems = true;
                }
                else
                {
                    lootoptions.GetGems = false;
                }

                if (Selections.Contains(8) == true)
                {
                    lootoptions.GetArrows = true;
                }
                else
                {
                    lootoptions.GetArrows = false;
                }

                if (Selections.Contains(9) == true)
                {
                    lootoptions.GetFood = true;
                }
                else
                {
                    lootoptions.GetFood = false;
                }

                if (Selections.Contains(10) == true)
                {
                    lootoptions.GetHides = true;
                }
                else
                {
                    lootoptions.GetHides = false;
                }

                if (Selections.Contains(11) == true)
                {
                    lootoptions.GetScales = true;
                }
                else
                {
                    lootoptions.GetScales = false;
                }

                if (Selections.Contains(12) == true)
                {
                    lootoptions.GetWood = true;
                }
                else
                {
                    lootoptions.GetWood = false;
                }

                if (Selections.Contains(13) == true)
                {
                    lootoptions.GetOres = true;
                }
                else
                {
                    lootoptions.GetOres = false;
                }

                if (Selections.Contains(14) == true)
                {
                    lootoptions.GetReagents = true;
                }
                else
                {
                    lootoptions.GetReagents = false;
                }

                if (Selections.Contains(15) == true)
                {
                    lootoptions.GetPotions = true;
                }
                else
                {
                    lootoptions.GetPotions = false;
                }

                if (Selections.Contains(16) == true)
                {
                    lootoptions.GetOther = true;
                }
                else
                {
                    lootoptions.GetOther = false;
                }

                if (Selections.Contains(17) == true)
                {
                    lootoptions.GetGroundItems = true;
                }
                else
                {
                    lootoptions.GetGroundItems = false;
                }

                break;
            }
            }
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID <= 0)
            {
                return; // Canceled
            }
            //ILevelable levitem = (ILevelable)m_Item;
            XmlLevelItem levitem = XmlAttach.FindAttachment(this.m_Item, typeof(XmlLevelItem)) as XmlLevelItem;

            int buttonID = info.ButtonID - 1;
            int type     = buttonID % 7;
            int index    = buttonID / 7;

            int cost      = 0;
            int attrvalue = 0;

            switch (type)
            {
            case 0:     // Cancel
            {
                break;
            }

            case 1:     // Select Attribute Type
            {
                switch (index)
                {
                case 0:             // Melee
                {
                    this.m_From.SendGump(new ItemExperienceGump(this.m_From, this.m_Item, AttributeCategory.Melee, GumpPage.AttributeList));

                    break;
                }

                case 1:             // Magic
                {
                    this.m_From.SendGump(new ItemExperienceGump(this.m_From, this.m_Item, AttributeCategory.Magic, GumpPage.AttributeList));

                    break;
                }

                case 2:             // Char Stats
                {
                    this.m_From.SendGump(new ItemExperienceGump(this.m_From, this.m_Item, AttributeCategory.Stats, GumpPage.AttributeList));

                    break;
                }

                case 3:             // Resistances
                {
                    this.m_From.SendGump(new ItemExperienceGump(this.m_From, this.m_Item, AttributeCategory.Resists, GumpPage.AttributeList));

                    break;
                }

                case 4:             // Weapon Hits
                {
                    this.m_From.SendGump(new ItemExperienceGump(this.m_From, this.m_Item, AttributeCategory.Hits, GumpPage.AttributeList));

                    break;
                }

                case 5:             // Misc.
                {
                    this.m_From.SendGump(new ItemExperienceGump(this.m_From, this.m_Item, AttributeCategory.Misc, GumpPage.AttributeList));

                    break;
                }
                }

                break;
            }

            case 2:     // Attribute selected
            {
                cost = GetPointCost(this.m_Item, LevelAttributes.m_Attributes[index].m_XP);

                if ((levitem.Points - cost) >= 0)
                {
                    //add point to selected attribute
                    if (index >= 0 && index < LevelAttributes.m_Attributes.Length)
                    {
                        if (this.m_Item is BaseWeapon)
                        {
                            attrvalue = ((BaseWeapon)this.m_Item).Attributes[LevelAttributes.m_Attributes[index].m_Attribute];
                            if (attrvalue < LevelAttributes.m_Attributes[index].m_MaxValue)
                            {
                                ((BaseWeapon)this.m_Item).Attributes[LevelAttributes.m_Attributes[index].m_Attribute] += 1;
                                levitem.Points -= cost;
                            }
                        }
                        else if (this.m_Item is BaseArmor)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).Attributes[LevelAttributes.m_Attributes[index].m_Attribute];
                            if (attrvalue < LevelAttributes.m_Attributes[index].m_MaxValue)
                            {
                                ((BaseArmor)this.m_Item).Attributes[LevelAttributes.m_Attributes[index].m_Attribute] += 1;
                                levitem.Points -= cost;
                            }
                        }
                        else if (this.m_Item is BaseJewel)
                        {
                            attrvalue = ((BaseJewel)this.m_Item).Attributes[LevelAttributes.m_Attributes[index].m_Attribute];
                            if (attrvalue < LevelAttributes.m_Attributes[index].m_MaxValue)
                            {
                                ((BaseJewel)this.m_Item).Attributes[LevelAttributes.m_Attributes[index].m_Attribute] += 1;
                                levitem.Points -= cost;
                            }
                        }
                        else if (this.m_Item is BaseClothing)
                        {
                            attrvalue = ((BaseClothing)this.m_Item).Attributes[LevelAttributes.m_Attributes[index].m_Attribute];
                            if (attrvalue < LevelAttributes.m_Attributes[index].m_MaxValue)
                            {
                                ((BaseClothing)this.m_Item).Attributes[LevelAttributes.m_Attributes[index].m_Attribute] += 1;
                                levitem.Points -= cost;
                            }
                        }
                        else
                        {
                            return;
                        }
                    }
                }
                else
                {
                    this.m_From.SendMessage("You don't have enough points available!  This attribute costs " + cost + " points.");
                }

                this.m_From.SendGump(new ItemExperienceGump(this.m_From, this.m_Item, LevelAttributes.m_Attributes[index].m_Category, GumpPage.AttributeList));

                break;
            }

            case 3:     // WeaponAttribute selected
            {
                cost = GetPointCost(this.m_Item, LevelAttributes.m_WeaponAttributes[index].m_XP);

                if ((levitem.Points - cost) >= 0)
                {
                    //add point to selected weapon attribute
                    if (index >= 0 && index < LevelAttributes.m_WeaponAttributes.Length)
                    {
                        if (LevelAttributes.m_WeaponAttributes[index].m_Attribute == AosWeaponAttribute.DurabilityBonus)
                        {
                            attrvalue = ((BaseWeapon)this.m_Item).MaxHitPoints;
                        }
                        else
                        {
                            attrvalue = ((BaseWeapon)this.m_Item).WeaponAttributes[LevelAttributes.m_WeaponAttributes[index].m_Attribute];
                        }

                        if (attrvalue < LevelAttributes.m_WeaponAttributes[index].m_MaxValue)
                        {
                            ((BaseWeapon)this.m_Item).WeaponAttributes[LevelAttributes.m_WeaponAttributes[index].m_Attribute] += 1;
                            levitem.Points -= cost;
                        }
                    }
                }
                else
                {
                    this.m_From.SendMessage("You don't have enough points available!  This attribute costs " + cost + " points.");
                }

                this.m_From.SendGump(new ItemExperienceGump(this.m_From, this.m_Item, LevelAttributes.m_WeaponAttributes[index].m_Category, GumpPage.AttributeList));

                break;
            }

            case 4:     // Armor Attributes Selected
            {
                cost = GetPointCost(this.m_Item, LevelAttributes.m_ArmorAttributes[index].m_XP);
                if ((levitem.Points - cost) >= 0)
                {
                    //add point to selected weapon attribute
                    if (index >= 0 && index < LevelAttributes.m_ArmorAttributes.Length)
                    {
                        if (LevelAttributes.m_ArmorAttributes[index].m_Attribute == AosArmorAttribute.DurabilityBonus)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).MaxHitPoints;
                        }
                        else
                        {
                            attrvalue = ((BaseArmor)this.m_Item).ArmorAttributes[LevelAttributes.m_ArmorAttributes[index].m_Attribute];
                        }

                        if (attrvalue < LevelAttributes.m_ArmorAttributes[index].m_MaxValue)
                        {
                            ((BaseArmor)this.m_Item).ArmorAttributes[LevelAttributes.m_ArmorAttributes[index].m_Attribute] += 1;
                            levitem.Points -= cost;
                        }
                    }
                }
                else
                {
                    this.m_From.SendMessage("You don't have enough points available!  This attribute costs " + cost + " points.");
                }

                this.m_From.SendGump(new ItemExperienceGump(this.m_From, this.m_Item, LevelAttributes.m_ArmorAttributes[index].m_Category, GumpPage.AttributeList));

                break;
            }

            case 5:     // Armor Resists Selected
            {
                cost = GetPointCost(this.m_Item, LevelAttributes.m_ResistanceTypes[index].m_XP);
                if ((levitem.Points - cost) >= 0)
                {
                    //add point to selected weapon attribute
                    if (index >= 0 && index < LevelAttributes.m_ResistanceTypes.Length)
                    {
                        if (LevelAttributes.m_ResistanceTypes[index].m_Attribute == ResistanceType.Physical)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).PhysicalBonus;
                            if (attrvalue < LevelAttributes.m_ResistanceTypes[index].m_MaxValue)
                            {
                                ((BaseArmor)this.m_Item).PhysicalBonus += 1;
                                levitem.Points -= cost;
                            }
                        }
                        else if (LevelAttributes.m_ResistanceTypes[index].m_Attribute == ResistanceType.Fire)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).FireBonus;
                            if (attrvalue < LevelAttributes.m_ResistanceTypes[index].m_MaxValue)
                            {
                                ((BaseArmor)this.m_Item).FireBonus += 1;
                                levitem.Points -= cost;
                            }
                        }
                        else if (LevelAttributes.m_ResistanceTypes[index].m_Attribute == ResistanceType.Cold)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).ColdBonus;
                            if (attrvalue < LevelAttributes.m_ResistanceTypes[index].m_MaxValue)
                            {
                                ((BaseArmor)this.m_Item).ColdBonus += 1;
                                levitem.Points -= cost;
                            }
                        }
                        else if (LevelAttributes.m_ResistanceTypes[index].m_Attribute == ResistanceType.Poison)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).PoisonBonus;
                            if (attrvalue < LevelAttributes.m_ResistanceTypes[index].m_MaxValue)
                            {
                                ((BaseArmor)this.m_Item).PoisonBonus += 1;
                                levitem.Points -= cost;
                            }
                        }
                        else if (LevelAttributes.m_ResistanceTypes[index].m_Attribute == ResistanceType.Energy)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).EnergyBonus;
                            if (attrvalue < LevelAttributes.m_ResistanceTypes[index].m_MaxValue)
                            {
                                ((BaseArmor)this.m_Item).EnergyBonus += 1;
                                levitem.Points -= cost;
                            }
                        }
                        else
                        {
                            return;
                        }
                    }
                }
                else
                {
                    this.m_From.SendMessage("You don't have enough points available!  This attribute costs " + cost + " points.");
                }

                this.m_From.SendGump(new ItemExperienceGump(this.m_From, this.m_Item, LevelAttributes.m_ResistanceTypes[index].m_Category, GumpPage.AttributeList));

                break;
            }

            case 6:     // Jewelry & Clothing Resists Selected
            {
                cost = GetPointCost(this.m_Item, LevelAttributes.m_ElementAttributes[index].m_XP);
                if ((levitem.Points - cost) >= 0)
                {
                    //add point to selected weapon attribute
                    if (index >= 0 && index < LevelAttributes.m_ElementAttributes.Length)
                    {
                        if (this.m_Item is BaseJewel)
                        {
                            attrvalue = ((BaseJewel)this.m_Item).Resistances[LevelAttributes.m_ElementAttributes[index].m_Attribute];
                            if (attrvalue < LevelAttributes.m_ElementAttributes[index].m_MaxValue)
                            {
                                ((BaseJewel)this.m_Item).Resistances[LevelAttributes.m_ElementAttributes[index].m_Attribute] += 1;
                                levitem.Points -= cost;
                            }
                        }
                        else
                        {
                            attrvalue = ((BaseClothing)this.m_Item).Resistances[LevelAttributes.m_ElementAttributes[index].m_Attribute];
                            if (attrvalue < LevelAttributes.m_ElementAttributes[index].m_MaxValue)
                            {
                                ((BaseClothing)this.m_Item).Resistances[LevelAttributes.m_ElementAttributes[index].m_Attribute] += 1;
                                levitem.Points -= cost;
                            }
                        }
                    }
                }
                else
                {
                    this.m_From.SendMessage("You don't have enough points available!  This attribute costs " + cost + " points.");
                }

                this.m_From.SendGump(new ItemExperienceGump(this.m_From, this.m_Item, LevelAttributes.m_ElementAttributes[index].m_Category, GumpPage.AttributeList));

                break;
            }
            }
        }
Example #28
0
        public static void Grab_OnCommand(CommandEventArgs e)
        {
            //   Get LootData attachment
            LootData lootoptions = new LootData();

            // does player already have a lootdata attachment?
            if (XmlAttach.FindAttachment(e.Mobile, typeof(LootData)) == null)
            {
                XmlAttach.AttachTo(e.Mobile, lootoptions);
                // give them one free lootbag
                e.Mobile.AddToBackpack(new LootBag());
            }
            else
            {
                // they have the attachment, just load their options
                lootoptions = (LootData)XmlAttach.FindAttachment(e.Mobile, typeof(LootData));
            }

            //   Check args to see if they want to change loot options
            // if we have args after  "grab"
            if (e.Length != 0)
            {
                // we need to set the loot bag
                if (e.GetString(0) != "options")
                {
                    e.Mobile.SendMessage("Typing the command [grab  by itself loots corpses of your victims. [grab options will allow you to decide what you want to loot.");
                }
                // show loot options gump
                else if (e.GetString(0) == "options")
                {
                    e.Mobile.SendGump(new LootGump(e.Mobile));
                }
            }

            //   Check loot legalities
            Mobile from = e.Mobile;

            if (from.Alive == false)
            {
                from.PlaySound(1069);                   //hey
                from.SendMessage("You cannot do that while you are dead!");
                return;
            }
            //else if ( 0 != CompetitiveGrabRadius && BlockingMobilesInRange( from, GrabRadius ))
            //{
            //	from.PlaySound( 1069 ); //hey
            //	from.SendMessage( "You are too close to another player to do that!" );
            //	return;
            //}

            ArrayList grounditems = new ArrayList();
            ArrayList lootitems   = new ArrayList();
            ArrayList corpses     = new ArrayList();
            Container lootBag     = GetLootBag(from);

            // Gather lootable corpses and items into lists
            foreach (Item item in from.GetItemsInRange(GrabRadius))
            {
                if (!from.InLOS(item) || !item.IsAccessibleTo(from) || !(item.Movable || item is Corpse))
                {
                    continue;
                }

                // add to corpse list if corpse
                if (item is Corpse && CorpseIsLootable(from, item as Corpse, false))                     // && item.Killer == from
                {
                    Corpse deadbody = item as Corpse;
                    if (deadbody.Killer == null)
                    {
                        corpses.Add(item);
                    }
                    else if (deadbody.Killer == from)
                    {
                        corpses.Add(item);
                    }
                    else if (deadbody.Killer is BaseCreature && !(deadbody.Killer is PlayerMobile))
                    {
                        BaseCreature pet = deadbody.Killer as BaseCreature;
                        if (pet.ControlMaster == from || pet.ControlMaster == null)
                        {
                            corpses.Add(item);
                        }
                    }
                }

                // otherwise add to ground items list if loot options indicate
//ORIGINALY HERE-Trying to clear up yellow startup saying that item moble never is
//				else if ( !( item is PlayerMobile ) )
//				{
//					if(lootoptions.GetGroundItems)
//						if (!(item is Corpse))
//							grounditems.Add( item );
//				}
//END ORIGINALY HERE
                else
                if (lootoptions.GetGroundItems)
                {
                    if (!(item is Corpse))
                    {
                        grounditems.Add(item);
                    }
                }
            }

            // see if we really want any of the junk lying on the ground
            GetItems(lootoptions, from, grounditems);

            grounditems.Clear();

            // now inspect and loot appropriate items in corpses
            foreach (Item corpse in corpses)
            {
                Corpse       bod = corpse as Corpse;
                PlayerMobile pm  = from as PlayerMobile;
                //pm.PlayerLevel += 1;

                /*                                          // Uncomment for eventual modifications (not to allow grabbing certain bodies)
                 * Mobile own = bod.Owner as Mobile;
                 * if( (own is Mobile1) || (own is Mobile2) )  // Change mobile names according to what you want to get
                 */
                {
                    // if we are looting hides/scales/meat then carve the corpse
                    if (lootoptions.GetHides && !(bod.Owner is PlayerMobile))
                    {
                        bod.Carve(from, null);
                    }

                    //rummage through the corpse for good stuff
                    foreach (Item item in bod.Items)
                    {
                        lootitems.Add(item);
                    }

                    //  now see if we really want any of this junk
                    GetItems(lootoptions, from, lootitems);

                    // alrighty then, we have all the items we want, now award gold for this corpse, delete it and increment the body count
//                    AwardGold(from, bod, lootBag); //REMED OUT SO THAT REGULAR MOBS WONT GIVE GOLD WHEN USE GRAB COMMAND
                    bod.Delete();

                    // empty lootitems arraylist
                    lootitems.Clear();
                }
            }
        }
Example #29
0
 // ----------------------------------------------
 // Public methods
 // ----------------------------------------------
 public static void Initialize()
 {
     XmlAttach.CleanUp();
 }
Example #30
0
        public static void DoLevel(Mobile klr, Configured c)
        {
            BaseCreature     bc     = (BaseCreature)klr;
            XMLPetLevelAtt   petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt));
            ConfiguredPetXML cs     = new ConfiguredPetXML();
            PlayerMobile     pm     = klr as PlayerMobile;
            LevelHandlerPet  lh     = new LevelHandlerPet();
            ConfiguredSkills css    = new ConfiguredSkills();
            Mobile           cm     = bc.ControlMaster;

            /* Still adding Skill Points for Future Development */

            if (petxml.Expp >= petxml.ToLevell)
            {
                petxml.Expp    = 0;
                petxml.kxp     = 0;
                petxml.Levell += 1;

                int totalStats = bc.RawDex + bc.RawInt + bc.RawStr;

                if (petxml.Levell <= 20)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 20);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below20;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below20Stat;
                    }
                }

                else if (petxml.Levell <= 40)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 40);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below40;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below40Stat;
                    }
                }
                else if (petxml.Levell <= 60)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 60);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below60;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below60Stat;
                    }
                }
                else if (petxml.Levell <= 70)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 80);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below70;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below70Stat;
                    }
                }
                else if (petxml.Levell <= 80)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 100);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below80;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below80Stat;
                    }
                }
                else if (petxml.Levell <= 90)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 120);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below90;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below90Stat;
                    }
                }
                else if (petxml.Levell <= 100)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 140);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below100;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below100Stat;
                    }
                }
                else if (petxml.Levell <= 110)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 140);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below110;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below110Stat;
                    }
                }
                else if (petxml.Levell <= 120)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 150);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below120;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below120Stat;
                    }
                }
                else if (petxml.Levell <= 130)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 150);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below130;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below130Stat;
                    }
                }
                else if (petxml.Levell <= 140)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 160);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below140;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below140Stat;
                    }
                }
                else if (petxml.Levell <= 150)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 180);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below150;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below150Stat;
                    }
                }
                else if (petxml.Levell <= 160)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 180);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below160;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below160Stat;
                    }
                }
                else if (petxml.Levell <= 170)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 190);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below170;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below170Stat;
                    }
                }
                else if (petxml.Levell <= 180)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 190);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below180;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below180Stat;
                    }
                }
                else if (petxml.Levell <= 190)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 190);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below190;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below190Stat;
                    }
                }
                else if (petxml.Levell <= 200)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 200);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below200;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below200Stat;
                    }
                }
            }

            if (cs.RefreshOnLevel)
            {
                if (bc.Hits < bc.HitsMax)
                {
                    bc.Hits = bc.HitsMax;
                }

                if (bc.Mana < bc.ManaMax)
                {
                    bc.Mana = bc.ManaMax;
                }

                if (bc.Stam < bc.StamMax)
                {
                    bc.Stam = bc.StamMax;
                }
            }

            bc.PlaySound(0x20F);
            bc.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist);
            bc.FixedParticles(0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist);

            if (cs.NotifyOnPetlevelUp == true)
            {
                cm.SendMessage("Your Pet level has increased");
            }
            petxml.Expp = 0;
            petxml.kxp  = 0;
        }