Exemple #1
0
 public static void RemoveEthic_OnTarget(Mobile from, object obj)
 {
     if (obj is PlayerMobile)
     {
         PlayerMobile pm = obj as PlayerMobile;
         if (pm.EthicPlayer == null)
         {
             from.SendMessage("That player does not seem to be in the ethics system.");
         }
         else
         {
             Player p = Player.Find(pm);
             if (p != null)
             {
                 p.Detach();
                 pm.Delta(MobileDelta.Noto);
                 from.SendMessage("That player has been removed from the ethics system.");
             }
         }
     }
     else
     {
         from.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(RemoveEthic_OnTarget));
         from.SendMessage("That is not a player. Try again.");
     }
 }
Exemple #2
0
        public static void MakeEvil_OnTarget(Mobile from, object obj)
        {
            if (obj is PlayerMobile)
            {
                PlayerMobile pm = obj as PlayerMobile;

                if (pm.EthicPlayer != null)
                {
                    Player p = Player.Find(pm);
                    if (p != null)
                    {
                        p.Detach();
                        pm.Delta(MobileDelta.Noto);
                        from.SendMessage("That player has been removed from the ethics system.");
                    }
                }

                Player pl = new Player(Server.Ethics.Ethic.Evil, pm);

                pl.Attach();
                pm.Delta(MobileDelta.Noto);

                pm.FixedEffect(0x373A, 10, 30);
                pm.PlaySound(0x209);
                pm.SendLocalizedMessage(502595);                 // You are now evil.
                from.SendMessage("That player has been added to the ethics system.");
            }
            else
            {
                from.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(RemoveEthic_OnTarget));
                from.SendMessage("That is not a player. Try again.");
            }
        }
Exemple #3
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile mob = (Mobile)obj;

            switch (m_KickType)
            {
            case EthicKickType.Kick:
            {
                Player pl = Player.Find(mob);

                if (pl != null)
                {
                    pl.Detach();
                    mob.SendMessage("You have been kicked from heroes/evil.");
                    AddResponse("They have been kicked from heroes/evil.");
                }
                else
                {
                    LogFailure("They are not in heroes/evils.");
                }

                break;
            }

            case EthicKickType.Ban:
            {
                Account acct = mob.Account as Account;

                if (acct != null)
                {
                    if (acct.GetTag("EthicsBanned") == null)
                    {
                        acct.SetTag("EthicsBanned", "true");
                        AddResponse("The account has been banned from joining heroes/evil.");
                    }
                    else
                    {
                        AddResponse("The account is already banned from joining heroes/evil.");
                    }

                    for (int i = 0; i < acct.Length; ++i)
                    {
                        mob = acct[i];

                        if (mob != null)
                        {
                            Player pl = Player.Find(mob);

                            if (pl != null)
                            {
                                pl.Detach();
                                mob.SendMessage("You have been kicked from heroes/evil.");
                                AddResponse("They have been kicked from heroes/evil.");
                            }
                        }
                    }
                }
                else
                {
                    LogFailure("They have no assigned account.");
                }

                break;
            }

            case EthicKickType.Unban:
            {
                Account acct = mob.Account as Account;

                if (acct != null)
                {
                    if (acct.GetTag("EthicsBanned") == null)
                    {
                        AddResponse("The account is not banned from joining heroes/evil.");
                    }
                    else
                    {
                        acct.RemoveTag("EthicsBanned");
                        AddResponse("The account may now freely join heroes/evil.");
                    }
                }
                else
                {
                    LogFailure("They have no assigned account.");
                }

                break;
            }
            }
        }