상속: LootEvent
예제 #1
0
        // PlayerLoot.StartLootingItem()
        public static void StartLootingItem(PlayerLoot playerLoot, BasePlayer looter, Item item)
        {
            // works, event needed

            var ile = new Events.ItemLootEvent(playerLoot, new Player(looter), item);

            OnLootingItem.OnNext(ile);
        }
예제 #2
0
        // PlayerLoot.StartLootingItem()
        public static void On_LootingItem(PlayerLoot playerLoot)
        {
            BasePlayer looter = playerLoot.GetComponent <BasePlayer>();
            var        ile    = new Events.ItemLootEvent(playerLoot, Server.GetPlayer(looter), playerLoot.itemSource);

            OnNext("On_LootingItem", ile);

            if (ile.Cancel)
            {
                playerLoot.Clear();
                looter.SendConsoleCommand("chat.add", 0, String.Format("{0}: {1}", Server.server_message_name.ColorText("fa5"), ile.cancelReason));
            }
        }
예제 #3
0
파일: Hooks.cs 프로젝트: Viproz/Pluton
        // PlayerLoot.StartLootingItem()
        public static void StartLootingItem(PlayerLoot playerLoot)
        {
            BasePlayer looter = playerLoot.GetComponent<BasePlayer>();
            var ile = new Events.ItemLootEvent(playerLoot, Server.GetPlayer(looter), playerLoot.itemSource);
            OnLootingItem.OnNext(ile);

            if (ile.Cancel) {
                playerLoot.Clear();
                looter.SendConsoleCommand("chat.add", 0, String.Format("{0}: {1}", Server.server_message_name.ColorText("fa5"), ile.cancelReason));
            }
        }