LordFenris

Member
Currently, along with a group of friends are preparing a new server that contains a large quantity of rules known from the server Siege Perilous. We are currently working on the implementation of, inter alia, the following rule. I know that some shards apply it and hence my request to you for any suggestions as to how to introduce it in the current version servuo. Thanks for any your help.

  • Murderers and Criminals will not be able to kick/ban others from their home. In addition, if a murderer or flagged criminal opens the door to a house in which a blue player has banned players/monsters, the ban list for the house will be cleared.
 
In BaseHouse.cs, you will need to change the Kick method and Ban methods to check if the person banning is a murderer.

The second part is a bit harder, but I think your best place is to change the OnOpened method of the BaseHouseDoor class which is found inside HouseDoors.cs
 
In HouseDoors.cs there is OnOpened.

C#:
        public override void OnOpened(Mobile from)
        {
            BaseHouse house = this.FindHouse();
            if (house != null && house.IsFriend(from) && from.IsPlayer() && house.RefreshDecay())
                from.SendLocalizedMessage(1043293); // Your house's age and contents have been refreshed.
            if (house != null && house.Public && !house.IsFriend(from))
                house.Visits++;
        }

In this section i would do some if statements



C#:
            if ((pm.Kills > 3) || (pm.Criminal != false))
            {
                house.Bans.Clear();
            }

Add the Above code below this

C#:
            if (house != null && house.Public && !house.IsFriend(from))
                house.Visits++;

___________________________________________________



And in BaseHouse.cs there is...

C#:
        public void Ban(Mobile from, Mobile targ)
        {
            if (!this.IsFriend(from) || this.m_Bans == null)
                return;
                  ...
        }



Under the Above code put this...

C#:
            if ((from.Kills > 4) || (from.Criminal != false))
            {
                from.SendMessage("You cannot ban anyone at this time.");
                return;
            }



I tested the above code and it works for what you are asking.
 
Man you are a God .
Thanks alot :)

The only question is whether such a method could be applied also to the teleporters, for which some players probably fall once the idea to use teleporters which will allow them to avoid opening the door
 
Last edited:
Umm, I'm still a little confused on that last comment.
What exactly are you looking to do with Teleporters.

With that info I can probably help more.
 
In general, I mean about rule that criminal or murderer entrance to the building in which he is a friend, resulted in clearing the ban list of this house. I thought that such erasing the ban list followed when crim or PK using the doors for so it looked like a PVP server OSI Siege P - where I once played. But I remembered that along with the AOS players often - instead of a door - use teleporters, so deleting ban list only when you open the door may be insufficient way to protect against the bannings people by murderers and criminals. They could relog - for example - on their innocent alts, ban other people inside house (without doors, only with teleporters), and next relog again on PK toon without risk of ban list cleaning.
 
Last edited:
try doing what i did in HouseDoors.cs, in HouseTeleporter.cs

In the OnMoveOver section.
C#:
        public override bool OnMoveOver(Mobile m)//Line 68
        {
            if (this.m_Target != null && !this.m_Target.Deleted)
            {
                if (this.CheckAccess(m))
                {
                    if (!m.Hidden || m.IsPlayer())
                        new EffectTimer(this.Location, this.Map, 2023, 0x1F0, TimeSpan.FromSeconds(0.4)).Start();

                    new DelayTimer(this, m).Start();
                }
                else
                {
                    m.SendLocalizedMessage(1061637); // You are not allowed to access this.
                }
            }

            return true;
        }

I don't really have much time to get the code for you, but this is a good place to start.

If you are having some problems after trying some stuff, drop another line and I'll try to help out with what i can.
 
I think that we could not do without a reference to the player mobile inside houseteleporter.cs and housedoors.cs, because I received an error after housedoors change:
Errors:
+ Items/Construction/Doors/HouseDoors.cs:
CS0103: Line 184: The name `pm' does not exist in the current context

will check if ((from.Kills > 3) || (from.Criminal)) - edit : its work :)
 
Last edited:
'pm' is refering to PlayerMobile but was never called for. try changing 'pm' to 'from'
 
Doors and ban rules work properly now but banlist clean implementation to houseteleporter.sc in OnMoveOver section need additional connection with a piece of code that supports this list
Errors:
+ Multis / HouseTeleporter.cs:
CS0103: Line 83: The name `house 'does not exist in the current context
On our shard we are currently working to solve this problem
Now we checking your code in CheckAccess section :)

Edit: Solved :D Thanks Pal. Your part of code help us so much :D
 
Last edited:
*thumbs up* Glad you got it working, can you please post the code if you can? I'm interested in what it looks like.
 
Of course. Here is it:

Houseteleporter.cs (CheckAccess section)
public bool CheckAccess(Mobile m)
{
BaseHouse house = BaseHouse.FindHouseAt(this);

if ((m.Kills > 4) || (m.Criminal))
{
house.Bans.Clear();
}

if (house != null && (house.Public ? house.IsBanned(m) : !house.HasAccess(m)))
return false;

return (house != null && house.HasSecureAccess(m, this.m_Level));
}
Now we implement three additional change.
I think it could be a very interesting complement to the already described changes in the code:

1: Clean the ban list is naturally occur only when a player killer (criminal) passes through the door or the teleporter in the building, which it owns, co-owns or friend. The idea is that those players are not cleaned ban lists in the homes of other players and only in those where they have permission. Leaving the principles of cleaning every ban list, even in someone else's home, could endanger the buildings belonging to innocent players, such as merchants serving their vendors.
2 The introduction of the lack of opportunities for use the kick if a player is a murderer and a criminal (I think that it is sufficient to duplicate code already agreed in the section responsible for kick)
3 Enter a murderer or a criminal player to a private house (by opening the door or go through the teleporter), which this player is the owner, co-owner or friend would result in an automatic change in such a house for the public. Player murderer or criminal, will not be able to change this home back to private (this could be done only by innocent character).
:D
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back