private static IEnumerator SpamChatCoroutine()
        {
            if (!isSpamming)
            {
                yield break;
            }

            yield return(WaitFor.Seconds(Random.Range(0.00001f, 0.01f)));

            switch (Random.Range(1, 4))
            {
            case 1:
                Chat.AddExamineMsgToClient(DateTime.Now.ToFileTimeUtc().ToString());
                break;

            case 2:
                Chat.AddChatMsgToChat(ConnectedPlayer.Invalid, DateTime.Now.ToFileTimeUtc().ToString(), ChatChannel.OOC);
                break;

            default:
                Chat.AddLocalMsgToChat(DateTime.Now.ToFileTimeUtc().ToString(), new Vector2(Random.value * 100, Random.value * 100), null);
                break;
            }

            Chat.Instance.StartCoroutine(SpamChatCoroutine());
        }
 public override void Process()
 {
     if (SentByPlayer != ConnectedPlayer.Invalid)
     {
         Chat.AddChatMsgToChat(SentByPlayer, ChatMessageText, Channels);
     }
 }
        public void TeleportTo(TeleportDestination destination)
        {
            ConnectedPlayer teleportingPlayer = GetLastReader();

            if (!HasChargesRemaining(teleportingPlayer.GameObject))
            {
                return;
            }

            if (teleport.IsBusy)
            {
                Chat.AddExamineMsgFromServer(teleportingPlayer.GameObject, $"You are already teleporting!");
                return;
            }

            Transform spawnTransform = PlayerSpawn.GetSpawnForJob((JobType)destination);

            teleport.ServerTeleportWizard(teleportingPlayer.GameObject, spawnTransform.position.CutToInt());

            SpellData teleportSpell = SpellList.Instance.Spells.Find(spell => spell.Name == "Teleport");

            SoundManager.PlayNetworkedAtPos(
                teleportSpell.CastSound, teleportingPlayer.Script.WorldPos, sourceObj: teleportingPlayer.GameObject);

            var incantation = $"{teleportSpell.InvocationMessage.Trim('!')} {destination.ToString().ToUpper()}!";

            Chat.AddChatMsgToChat(teleportingPlayer, incantation, ChatChannel.Local);

            ChargesRemaining--;
        }
        private static IEnumerator SpamChatCoroutine()
        {
            if (isSpamming == false)
            {
                yield break;
            }

            var fakePlayer = ConnectedPlayer.Invalid;

            fakePlayer.Username = "******";

            yield return(WaitFor.Seconds(Random.Range(0.00001f, 0.01f)));

            switch (Random.Range(1, 4))
            {
            case 1:
                Chat.AddExamineMsgToClient($"Examination: {DateTime.Now.ToFileTimeUtc()}");
                break;

            case 2:
                Chat.AddChatMsgToChat(fakePlayer, DateTime.Now.ToFileTimeUtc().ToString(), ChatChannel.OOC, Loudness.NORMAL);
                break;

            default:
                Chat.AddLocalMsgToChat($"Local Message: {DateTime.Now.ToFileTimeUtc()}", new Vector2(Random.value * 100, Random.value * 100), null);
                break;
            }

            Chat.Instance.StartCoroutine(SpamChatCoroutine());
        }
 public override void Process(NetMessage msg)
 {
     if (SentByPlayer != ConnectedPlayer.Invalid)
     {
         Chat.AddChatMsgToChat(SentByPlayer, msg.ChatMessageText, msg.Channels, msg.Loudness);
     }
 }
Exemple #6
0
 public override IEnumerator Process()
 {
     if (SentByPlayer != ConnectedPlayer.Invalid)
     {
         Chat.AddChatMsgToChat(SentByPlayer, ChatMessageText, Channels);
     }
     yield return(null);
 }
Exemple #7
0
        public void LearnSpell(SpellBookSpell spellEntry)
        {
            if (spellEntry.Cost > Points)
            {
                return;
            }

            points -= spellEntry.Cost;

            var player = netTab.LastInteractedPlayer().Player();

            SoundManager.PlayNetworkedAtPos("Blind", player.Script.WorldPos, sourceObj: player.GameObject);
            Chat.AddChatMsgToChat(player, spellEntry.Incantation, ChatChannel.Local);

            Spell spell = spellEntry.Spell.AddToPlayer(player.Script);

            player.Script.mind.AddSpell(spell);
        }
Exemple #8
0
        private void LearnSpell(ConnectedPlayer player, SpellBookSpell spellEntry)
        {
            points -= spellEntry.Cost;

            SoundManager.PlayNetworkedAtPos(learningSound, player.Script.WorldPos, sourceObj: player.GameObject);
            Chat.AddChatMsgToChat(player, spellEntry.Incantation, ChatChannel.Local, Loudness.SCREAMING);

            Spell spellInstance = player.Script.mind.GetSpellInstance(spellEntry.Spell);

            if (spellInstance != null)
            {
                spellInstance.UpgradeTier();
            }
            else
            {
                Spell spell = spellEntry.Spell.AddToPlayer(player.Script);
                player.Script.mind.AddSpell(spell);
            }
        }
        public void TeleportTo(TeleportDestination destination)
        {
            var teleportingPlayer = netTab.LastInteractedPlayer();

            if (!HasChargesRemaining(teleportingPlayer))
            {
                return;
            }

            if (teleport.IsBusy)
            {
                Chat.AddExamineMsgFromServer(teleportingPlayer, $"You are already teleporting!");
                return;
            }

            Transform spawnTransform = PlayerSpawn.GetSpawnForJob((JobType)destination);

            teleport.ServerTeleportWizard(teleportingPlayer, spawnTransform.position.CutToInt());
            Chat.AddChatMsgToChat(teleportingPlayer.Player(), $"SCYAR NILA {destination.ToString().ToUpper()}!", ChatChannel.Local);

            ChargesRemaining--;
        }
Exemple #10
0
        public void CastRitual(SpellBookRitual ritualEntry)
        {
            if (ritualEntry.Cost > Points)
            {
                return;
            }

            ConnectedPlayer player = GetLastReader();

            if (ritualEntry.InvocationMessage != default)
            {
                Chat.AddChatMsgToChat(player, ritualEntry.InvocationMessage, ChatChannel.Local);
            }

            if (ritualEntry.CastSound != default)
            {
                SoundManager.PlayNetworkedAtPos(ritualEntry.CastSound, player.Script.WorldPos, sourceObj: player.GameObject);
            }

            InGameEventsManager.Instance.TriggerSpecificEvent(ritualEntry.EventIndex, ritualEntry.EventType, announceEvent: false);

            points -= ritualEntry.Cost;
        }