Beispiel #1
0
        public static List <UOACZBoneBox> GetActiveInstances()
        {
            List <UOACZBoneBox> m_ActiveInstances = new List <UOACZBoneBox>();

            for (int a = 0; a < m_Instances.Count; a++)
            {
                UOACZBoneBox instance = m_Instances[a];

                if (instance.Deleted)
                {
                    continue;
                }

                if (UOACZRegion.ContainsItem(instance))
                {
                    m_ActiveInstances.Add(instance);
                }
            }

            return(m_ActiveInstances);
        }
Beispiel #2
0
        public static int CorpseNotoriety(Mobile source, Corpse target)
        {
            if (target.AccessLevel > AccessLevel.Player)
            {
                return(Notoriety.CanBeAttacked);
            }

            #region UOACZ

            if (UOACZRegion.ContainsItem(target))
            {
                PlayerMobile pm_Owner = target.Owner as PlayerMobile;
                BaseCreature bc_Owner = target.Owner as BaseCreature;

                if (pm_Owner != null)
                {
                    UOACZPersistance.CheckAndCreateUOACZAccountEntry(pm_Owner);

                    if (pm_Owner.IsUOACZUndead)
                    {
                        return(Notoriety.Murderer);
                    }

                    if (pm_Owner.m_UOACZAccountEntry.ActiveProfile == UOACZAccountEntry.ActiveProfileType.Human)
                    {
                        if (pm_Owner.m_UOACZAccountEntry.HumanProfile.HonorPoints <= UOACZSystem.HonorAggressionThreshold)
                        {
                            return(Notoriety.Enemy);
                        }

                        if (pm_Owner.Criminal)
                        {
                            return(Notoriety.CanBeAttacked);
                        }

                        return(Notoriety.Innocent);
                    }
                }

                if (bc_Owner != null)
                {
                    if (bc_Owner is UOACZBaseUndead)
                    {
                        if (bc_Owner.ControlMaster == source)
                        {
                            return(Notoriety.Ally);
                        }

                        return(Notoriety.CanBeAttacked);
                    }

                    if (bc_Owner is UOACZBaseWildlife)
                    {
                        return(Notoriety.CanBeAttacked);
                    }

                    if (bc_Owner is UOACZBaseHuman)
                    {
                        return(Notoriety.Innocent);
                    }
                }

                return(Notoriety.CanBeAttacked);
            }

            #endregion

            Body body = (Body)target.Amount;

            BaseCreature cretOwner = target.Owner as BaseCreature;

            if (cretOwner != null)
            {
                //TEST: GUILD

                /*
                 * Guild sourceGuild = GetGuildFor(source.Guild as Guild, source);
                 * Guild targetGuild = GetGuildFor(target.Guild as Guild, target.Owner);
                 *
                 * if (sourceGuild != null && targetGuild != null)
                 * {
                 *  if (sourceGuild == targetGuild || sourceGuild.IsAlly(targetGuild))
                 *      return Notoriety.Ally;
                 *
                 *  else if (sourceGuild.IsEnemy(targetGuild))
                 *      return Notoriety.Enemy;
                 * }
                 */

                if (cretOwner.IsLoHBoss() || cretOwner.FreelyLootable)
                {
                    return(Notoriety.CanBeAttacked);
                }

                if (CheckHouseFlag(source, target.Owner, target.Location, target.Map))
                {
                    return(Notoriety.CanBeAttacked);
                }

                int actual = Notoriety.CanBeAttacked;

                if (target.Kills >= 5 || (body.IsMonster && IsSummoned(target.Owner as BaseCreature)) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).IsMurderer() || ((BaseCreature)target.Owner).IsAnimatedDead)))
                {
                    actual = Notoriety.Murderer;
                }

                if (DateTime.UtcNow >= (target.TimeOfDeath + Corpse.MonsterLootRightSacrifice))
                {
                    return(actual);
                }

                Party sourceParty = Party.Get(source);

                List <Mobile> list = target.Aggressors;

                for (int i = 0; i < list.Count; ++i)
                {
                    if (list[i] == source || (sourceParty != null && Party.Get(list[i]) == sourceParty))
                    {
                        return(actual);
                    }
                }

                return(Notoriety.Innocent);
            }

            else
            {
                if (target.Kills >= 5 || (body.IsMonster && IsSummoned(target.Owner as BaseCreature)) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).IsMurderer() || ((BaseCreature)target.Owner).IsAnimatedDead)))
                {
                    return(Notoriety.Murderer);
                }

                if (target.Criminal)
                {
                    return(Notoriety.Criminal);
                }

                //TEST: GUILD

                /*
                 * Guild sourceGuild = GetGuildFor(source.Guild as Guild, source);
                 * Guild targetGuild = GetGuildFor(target.Guild as Guild, target.Owner);
                 *
                 * if (sourceGuild != null && targetGuild != null)
                 * {
                 *  if (sourceGuild == targetGuild || sourceGuild.IsAlly(targetGuild))
                 *      return Notoriety.Ally;
                 *
                 *  else if (sourceGuild.IsEnemy(targetGuild))
                 *      return Notoriety.Enemy;
                 * }
                 */

                if (target.Owner != null && target.Owner is BaseCreature && ((BaseCreature)target.Owner).AlwaysAttackable)
                {
                    return(Notoriety.CanBeAttacked);
                }

                if (CheckHouseFlag(source, target.Owner, target.Location, target.Map))
                {
                    return(Notoriety.CanBeAttacked);
                }

                if (!(target.Owner is PlayerMobile) && !IsPet(target.Owner as BaseCreature))
                {
                    return(Notoriety.CanBeAttacked);
                }

                List <Mobile> list = target.Aggressors;

                for (int i = 0; i < list.Count; ++i)
                {
                    if (list[i] == source)
                    {
                        return(Notoriety.CanBeAttacked);
                    }
                }

                if (SpellHelper.InBuccs(target.Map, target.Location) || SpellHelper.InYewOrcFort(target.Map, target.Location) || SpellHelper.InYewCrypts(target.Map, target.Location))
                {
                    return(Notoriety.CanBeAttacked);
                }

                if (GreyZoneTotem.InGreyZoneTotemArea(target.Location, target.Map))
                {
                    return(Notoriety.CanBeAttacked);
                }

                //Hotspot Nearby
                if (Custom.Hotspot.InHotspotArea(target.Location, target.Map, true))
                {
                    return(Notoriety.CanBeAttacked);
                }

                if (target.IsBones)
                {
                    return(Notoriety.CanBeAttacked);
                }

                return(Notoriety.Innocent);
            }
        }
Beispiel #3
0
        public override void OnSingleClick(Mobile from)
        {
            if (from.AccessLevel == AccessLevel.Player)
            {
                return;
            }

            switch (Behavior)
            {
            case WaypointBehavior.NextWaypoint:
                LabelTo(from, "Waypoint: Next");
                break;

            case WaypointBehavior.ReverseOrder:
                LabelTo(from, "Waypoint: Reverse Order");
                break;

            case WaypointBehavior.ReturnToStart:
                LabelTo(from, "Waypoint: Return to Start");
                break;

            case WaypointBehavior.SetHomeHere:
                LabelTo(from, "Waypoint: Set Home Here");
                break;

            case WaypointBehavior.Idle10secThenNextWaypoint:
                LabelTo(from, "Waypoint: 10s Next");
                break;

            case WaypointBehavior.Idle30secThenNextWaypoint:
                LabelTo(from, "Waypoint: 30s Next");
                break;

            case WaypointBehavior.Idle10secThenReverseOrder:
                LabelTo(from, "Waypoint: 10s Reverse");
                break;

            case WaypointBehavior.Idle30secThenReverseOrder:
                LabelTo(from, "Waypoint: 30s Reverse");
                break;
            }

            string splitGroupText = "";

            if (m_GotoSplitGroup > -1)
            {
                splitGroupText += "Goto Split: " + m_GotoSplitGroup.ToString() + " ";
            }

            if (m_SplitGroup > -1)
            {
                splitGroupText += "Split Group is: " + m_SplitGroup.ToString();
            }

            if (splitGroupText != "")
            {
                LabelTo(from, splitGroupText);
            }

            LabelTo(from, "Previous Waypoints: " + PreviousWaypoints.Count);

            if (m_GotoSplitGroup > -1)
            {
                int splitWaypointTargets = 0;

                from.SendMessage(2550, "Waypoint split destinations at:");

                foreach (UOACZWayPoint waypoint in m_UOACZWaypoints)
                {
                    if (!UOACZRegion.ContainsItem(waypoint))
                    {
                        continue;
                    }

                    if (waypoint.m_WaypointType == m_WaypointType && waypoint.m_SplitGroup == m_GotoSplitGroup)
                    {
                        splitWaypointTargets++;
                        from.SendMessage(waypoint.Location.X.ToString() + "," + waypoint.Location.Y.ToString() + "," + waypoint.Location.Z.ToString());
                    }
                }

                from.SendMessage(2550, splitWaypointTargets.ToString() + " potential split destinations.");
            }

            else
            {
                if (NextWaypoint != null)
                {
                    from.SendMessage(2550, "Next Waypoint at: " + NextWaypoint.Location.X.ToString() + ", " + NextWaypoint.Location.Y.ToString() + ", " + NextWaypoint.Location.Z.ToString());
                }
            }
        }
Beispiel #4
0
            protected override void OnTick()
            {
                if (m_UOACZSpawner == null)
                {
                    Stop();
                    return;
                }

                if (m_UOACZSpawner.Deleted)
                {
                    Stop();
                    return;
                }

                if (!UOACZRegion.ContainsItem(m_UOACZSpawner))
                {
                    return;
                }
                if (!UOACZPersistance.Active)
                {
                    return;
                }
                if (!m_UOACZSpawner.Activated || m_UOACZSpawner.RootParentEntity != null)
                {
                    return;
                }

                if (m_UOACZSpawner.TotalSpawnsOccured >= m_UOACZSpawner.MaxTotalSpawns)
                {
                    return;
                }

                int spawnsNeeded = m_UOACZSpawner.GetAvailableSpawnAmount();

                if (spawnsNeeded == 0)
                {
                    m_UOACZSpawner.m_LastActivity = DateTime.UtcNow;

                    double spawnDelay = m_UOACZSpawner.m_MinSpawnTime + (Utility.RandomDouble() * (m_UOACZSpawner.m_MaxSpawnTime - m_UOACZSpawner.m_MinSpawnTime));
                    m_UOACZSpawner.m_NextActivity = TimeSpan.FromMinutes(spawnDelay);

                    return;
                }

                DateTime nextSpawnTime = m_UOACZSpawner.m_LastActivity + m_UOACZSpawner.m_NextActivity;

                if (nextSpawnTime <= DateTime.UtcNow)
                {
                    int spotsSpawned = 0;

                    if (spawnsNeeded > 0)
                    {
                        if (!m_UOACZSpawner.SpawnAllAvailable)
                        {
                            spawnsNeeded = 1;
                        }

                        m_UOACZSpawner.PerformSpawns(spawnsNeeded);

                        m_UOACZSpawner.m_LastActivity = DateTime.UtcNow;

                        double spawnDelay = m_UOACZSpawner.m_MinSpawnTime + (Utility.RandomDouble() * (m_UOACZSpawner.m_MaxSpawnTime - m_UOACZSpawner.m_MinSpawnTime));
                        m_UOACZSpawner.m_NextActivity = TimeSpan.FromMinutes(spawnDelay);
                    }
                }
            }
Beispiel #5
0
        public virtual void PerformSpawns(int spawnsNeeded)
        {
            for (int a = 0; a < spawnsNeeded; a++)
            {
                bool spawnCreated = false;

                for (int b = 0; b < 25; b++)
                {
                    if (spawnCreated)
                    {
                        break;
                    }

                    Point3D newLocation = new Point3D();

                    int x = X;

                    int xOffset = Utility.RandomMinMax(0, SpawnRange);
                    if (Utility.RandomDouble() >= .5)
                    {
                        xOffset *= -1;
                    }

                    x += xOffset;

                    int y = Y;

                    int yOffset = Utility.RandomMinMax(0, SpawnRange);
                    if (Utility.RandomDouble() >= .5)
                    {
                        yOffset *= -1;
                    }

                    y += yOffset;

                    newLocation.X = x;
                    newLocation.Y = y;
                    newLocation.Z = Z;

                    SpellHelper.AdjustField(ref newLocation, Map, 12, false);

                    UOACZSpawnRedirector spawnRedirector = null;

                    if (!IgnoreRedirector)
                    {
                        foreach (UOACZSpawnRedirector redirector in UOACZSpawnRedirector.m_Instances)
                        {
                            if (!UOACZRegion.ContainsItem(redirector))
                            {
                                continue;
                            }

                            if (Utility.GetDistance(redirector.Location, newLocation) <= redirector.TriggerRadius)
                            {
                                spawnRedirector = redirector;
                                break;
                            }
                        }
                    }

                    if (spawnRedirector != null)
                    {
                        newLocation.X = spawnRedirector.Location.X + Utility.RandomMinMax(-1 * spawnRedirector.TriggerRadius, spawnRedirector.TriggerRadius);
                        newLocation.Y = spawnRedirector.Location.Y + Utility.RandomMinMax(-1 * spawnRedirector.TriggerRadius, spawnRedirector.TriggerRadius);
                        newLocation.Z = spawnRedirector.Location.Z;

                        int redirectionX = 0;
                        int redirectionY = 0;

                        switch (Utility.RandomMinMax(1, 3))
                        {
                        case 1:
                            redirectionX = Utility.RandomMinMax(spawnRedirector.MinRedirection, spawnRedirector.MaxRedirection);

                            if (Utility.RandomDouble() <= .5)
                            {
                                redirectionX *= -1;
                            }

                            newLocation.X = spawnRedirector.Location.X + redirectionX;
                            break;

                        case 2:
                            redirectionY = Utility.RandomMinMax(spawnRedirector.MinRedirection, spawnRedirector.MaxRedirection);

                            if (Utility.RandomDouble() <= .5)
                            {
                                redirectionY *= -1;
                            }

                            newLocation.Y = spawnRedirector.Location.Y + redirectionY;
                            break;

                        case 3:
                            redirectionX = Utility.RandomMinMax(spawnRedirector.MinRedirection, spawnRedirector.MaxRedirection);

                            if (Utility.RandomDouble() <= .5)
                            {
                                redirectionX *= -1;
                            }

                            newLocation.X = spawnRedirector.Location.X + redirectionX;

                            redirectionY = Utility.RandomMinMax(spawnRedirector.MinRedirection, spawnRedirector.MaxRedirection);

                            if (Utility.RandomDouble() <= .5)
                            {
                                redirectionY *= -1;
                            }

                            newLocation.Y = spawnRedirector.Location.Y + redirectionY;
                            break;
                        }

                        SpellHelper.AdjustField(ref newLocation, Map, 12, false);
                    }

                    bool areaIsBlocked = false;

                    foreach (UOACZSpawnAreaBlocker spawnAreaBlocker in UOACZSpawnAreaBlocker.m_Instances)
                    {
                        if (!UOACZRegion.ContainsItem(spawnAreaBlocker))
                        {
                            continue;
                        }

                        if (spawnAreaBlocker.BlockedArea.Contains(newLocation))
                        {
                            areaIsBlocked = true;
                            break;
                        }
                    }

                    if (areaIsBlocked)
                    {
                        continue;
                    }

                    if (UOACZSystem.IsValidSpawnLocation(newLocation, Map, CheckSpawnForAdjacentBlocking))
                    {
                        Spawn(newLocation, Map);

                        TotalSpawnsOccured++;

                        m_LastActivity = DateTime.UtcNow;
                        spawnCreated   = true;
                    }
                }
            }
        }
Beispiel #6
0
        public override void OnThink()
        {
            base.OnThink();

            Point3D location = Location;
            Map     map      = Map;

            //Outside of Guard Area
            if (GuardsHome && !(ControlMaster is PlayerMobile))
            {
                if (Utility.GetDistance(Home, location) > MaxDistanceAllowedFromHome)
                {
                    TimedStatic dirt = new TimedStatic(Utility.RandomList(7681, 7682), 5);
                    dirt.Name = "dirt";
                    dirt.MoveToWorld(location, map);

                    dirt.PublicOverheadMessage(MessageType.Regular, 0, false, ReturnHomeString);

                    Effects.PlaySound(location, map, 0x657);

                    int projectiles   = 6;
                    int particleSpeed = 4;

                    for (int a = 0; a < projectiles; a++)
                    {
                        Point3D newLocation = new Point3D(location.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), location.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), location.Z);
                        SpellHelper.AdjustField(ref newLocation, map, 12, false);

                        IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 5), map);
                        IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 5), map);

                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(0x3728), particleSpeed, 0, false, false, 0, 0);
                    }

                    Location  = Home;
                    Combatant = null;

                    return;
                }
            }

            if (m_NeedWaypoint && m_CanTeleportToBaseNode && !(ControlMaster is PlayerMobile))
            {
                Dictionary <UOACZWayPoint, int> DictWaypoints = new Dictionary <UOACZWayPoint, int>();

                foreach (UOACZWayPoint waypoint in UOACZWayPoint.m_UOACZWaypoints)
                {
                    if (!UOACZRegion.ContainsItem(waypoint))
                    {
                        continue;
                    }
                    if (!waypoint.IsBaseNode)
                    {
                        continue;
                    }

                    int distanceToWaypoint = (Utility.GetDistance(Location, waypoint.Location));

                    if (distanceToWaypoint >= UOACZSystem.UndeadMaxDynamicWaypointRange)
                    {
                        continue;
                    }

                    int distanceWeight = (int)(Math.Round(((double)UOACZSystem.UndeadMaxDynamicWaypointRange - (double)distanceToWaypoint) * .05));

                    if (distanceWeight < 1)
                    {
                        distanceWeight = 1;
                    }

                    DictWaypoints.Add(waypoint, distanceWeight);
                }

                if (DictWaypoints.Count > 0)
                {
                    int TotalValues = 0;

                    foreach (KeyValuePair <UOACZWayPoint, int> pair in DictWaypoints)
                    {
                        TotalValues += pair.Value;
                    }

                    double ItemCheck = Utility.RandomDouble();

                    double CumulativeAmount = 0.0;
                    double AdditionalAmount = 0.0;

                    foreach (KeyValuePair <UOACZWayPoint, int> pair in DictWaypoints)
                    {
                        AdditionalAmount = (double)pair.Value / (double)TotalValues;

                        if (ItemCheck >= CumulativeAmount && ItemCheck < (CumulativeAmount + AdditionalAmount))
                        {
                            UOACZWayPoint waypoint = pair.Key;

                            if (waypoint != null)
                            {
                                if (!waypoint.Deleted)
                                {
                                    CurrentWaypoint = pair.Key;
                                    m_NeedWaypoint  = false;

                                    return;
                                }
                            }

                            break;
                        }

                        CumulativeAmount += AdditionalAmount;
                    }
                }

                else
                {
                    m_NeedWaypoint = false;
                }
            }

            if ((DateTime.UtcNow >= m_LastActivity + InactivityThreshold) && !(ControlMaster is PlayerMobile))
            {
                //Send to Random Town Waypoint BaseNode
                if (m_CanTeleportToBaseNode)
                {
                    List <UOACZWayPoint> m_ValidBaseNodes = new List <UOACZWayPoint>();

                    foreach (UOACZWayPoint waypoint in UOACZWayPoint.m_UOACZWaypoints)
                    {
                        if (waypoint == null)
                        {
                            continue;
                        }
                        if (waypoint.Deleted)
                        {
                            continue;
                        }
                        if (!UOACZRegion.ContainsItem(waypoint))
                        {
                            continue;
                        }
                        if (!waypoint.IsBaseNode)
                        {
                            continue;
                        }
                        if (waypoint.WaypointType == UOACZWayPoint.UOACZWaypointType.UndeadWilderness)
                        {
                            continue;
                        }

                        m_ValidBaseNodes.Add(waypoint);
                    }

                    if (m_ValidBaseNodes.Count > 0)
                    {
                        UOACZWayPoint targetWaypoint = m_ValidBaseNodes[Utility.RandomMinMax(0, m_ValidBaseNodes.Count - 1)];

                        MoveToWorld(targetWaypoint.Location, targetWaypoint.Map);
                        CurrentWaypoint = targetWaypoint;
                        m_LastActivity  = DateTime.UtcNow;

                        m_NeedWaypoint = false;
                        return;
                    }
                }

                m_NeedWaypoint = true;
                return;
            }

            if (Utility.RandomDouble() < 0.005)
            {
                if (Combatant == null)
                {
                    Say(idleSpeech[Utility.Random(idleSpeech.Length - 1)]);
                }

                else
                {
                    Say(combatSpeech[Utility.Random(combatSpeech.Length - 1)]);
                }
            }

            bool ignoreBreakableStatics = false;

            if (Hidden && ControlMaster is PlayerMobile)
            {
                ignoreBreakableStatics = true;
            }

            if (DateTime.UtcNow >= m_NextBreakableStaticCheckAllowed && DateTime.UtcNow >= m_NextBreakableStaticAttackAllowed && !ignoreBreakableStatics)
            {
                m_NextBreakableStaticCheckAllowed = DateTime.UtcNow + BreakableStaticCheckDelay;

                BreakableStatic targetBreakableStatic = null;
                Dictionary <BreakableStatic, int> DictBreakableStatics = new Dictionary <BreakableStatic, int>();

                IPooledEnumerable nearbyItems = Map.GetItemsInRange(Location, 1);

                foreach (Item item in nearbyItems)
                {
                    if (item.Deleted)
                    {
                        continue;
                    }

                    if (item is BreakableStatic)
                    {
                        if (!Map.InLOS(Location, item.Location))
                        {
                            continue;
                        }

                        BreakableStatic breakableStatic = item as BreakableStatic;

                        if (breakableStatic is UOACZBreakableStatic)
                        {
                            UOACZBreakableStatic uoaczBreakableStatic = breakableStatic as UOACZBreakableStatic;

                            if (uoaczBreakableStatic.AllowHumanDamage)
                            {
                                continue;
                            }
                        }

                        if (breakableStatic.DamageState == BreakableStatic.DamageStateType.Broken)
                        {
                            continue;
                        }

                        int weight = 5;

                        if (breakableStatic == m_LastBreakableStaticAttacked)
                        {
                            weight += 10;
                        }

                        int damageBonus = (int)Math.Round((10 * (1 - (double)breakableStatic.HitPoints / (double)breakableStatic.MaxHitPoints)));

                        weight += damageBonus;

                        DictBreakableStatics.Add(breakableStatic, weight);
                    }
                }

                nearbyItems.Free();

                int TotalValues = 0;

                foreach (KeyValuePair <BreakableStatic, int> pair in DictBreakableStatics)
                {
                    TotalValues += pair.Value;
                }

                double ItemCheck = Utility.RandomDouble();

                double CumulativeAmount = 0.0;
                double AdditionalAmount = 0.0;

                foreach (KeyValuePair <BreakableStatic, int> pair in DictBreakableStatics)
                {
                    AdditionalAmount = (double)pair.Value / (double)TotalValues;

                    if (ItemCheck >= CumulativeAmount && ItemCheck < (CumulativeAmount + AdditionalAmount))
                    {
                        targetBreakableStatic = pair.Key;
                        break;
                    }

                    CumulativeAmount += AdditionalAmount;
                }

                if (targetBreakableStatic != null)
                {
                    double minHinder = 1;
                    double maxHinder = 1;

                    double weaponUsageDelay = 3;

                    BaseWeapon weapon = Weapon as BaseWeapon;

                    if (weapon != null)
                    {
                        weaponUsageDelay = weapon.GetDelay(this, false).TotalSeconds;
                    }

                    bool stockpileNearby = false;

                    if (targetBreakableStatic is UOACZStockpile)
                    {
                        stockpileNearby = true;
                    }

                    else
                    {
                        switch (targetBreakableStatic.DamageState)
                        {
                        case BreakableStatic.DamageStateType.Normal:
                            minHinder = weaponUsageDelay * .5;
                            maxHinder = weaponUsageDelay;
                            break;

                        case BreakableStatic.DamageStateType.LightlyDamaged:
                            minHinder = weaponUsageDelay * .65;
                            maxHinder = weaponUsageDelay;
                            break;

                        case BreakableStatic.DamageStateType.HeavilyDamaged:
                            minHinder = weaponUsageDelay * .8;
                            maxHinder = weaponUsageDelay;
                            break;
                        }
                    }

                    double delay = minHinder + ((maxHinder - minHinder) * Utility.RandomDouble());

                    if (ControlMaster is PlayerMobile)
                    {
                        delay = 1;
                        SpecialAbilities.EntangleSpecialAbility(1.0, null, this, 1, delay, 0, false, "", "", "-1");
                    }

                    else
                    {
                        if (stockpileNearby)
                        {
                            delay = 10;

                            SpecialAbilities.EntangleSpecialAbility(1.0, null, this, 1, delay, 0, false, "", "", "-1");
                            m_NextBreakableStaticAttackAllowed = DateTime.UtcNow + BreakableStaticAttackDelay;
                        }

                        else
                        {
                            if (Utility.RandomDouble() <= .5)
                            {
                                SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1, delay, true, 0, false, "", "", "-1");
                            }

                            else
                            {
                                SpecialAbilities.EntangleSpecialAbility(1.0, null, this, 1, delay, 0, false, "", "", "-1");
                            }

                            m_NextBreakableStaticAttackAllowed = DateTime.UtcNow + BreakableStaticAttackDelay;
                        }
                    }

                    targetBreakableStatic.Interact(this, BreakableStatic.InteractionType.Weapon);
                }
            }
        }
        public override void Spawn(Point3D point, Map map)
        {
            if (!UOACZPersistance.Active)
            {
                return;
            }

            int creatureThreatLevel = UOACZPersistance.m_ThreatLevel;

            if (!m_Wilderness)
            {
                creatureThreatLevel -= 30;
            }

            int minThreatLevel = 0;
            int maxThreatLevel = creatureThreatLevel;

            if (m_MinThreatLevel > -1)
            {
                minThreatLevel = m_MinThreatLevel;
            }

            if (m_MaxThreatLevel > -1)
            {
                maxThreatLevel = m_MaxThreatLevel;
            }

            Type creatureType = UOACZBaseUndead.GetRandomUndeadType(minThreatLevel, maxThreatLevel);

            if (creatureType != null)
            {
                UOACZBaseUndead creature = (UOACZBaseUndead)Activator.CreateInstance(creatureType);

                if (creature != null)
                {
                    creature.RangeHome             = HomeRange;
                    creature.Home                  = point;
                    creature.m_Spawner             = this;
                    creature.InWilderness          = m_Wilderness;
                    creature.CanTeleportToBaseNode = m_AllowTeleportToBaseNode;

                    creature.MoveToWorld(point, map);
                    m_Mobiles.Add(creature);

                    if (m_AllowTeleportToBaseNode)
                    {
                        if (m_GotoSplitGroup == -1)
                        {
                            creature.m_NeedWaypoint = true;
                        }

                        else
                        {
                            UOACZWayPoint closestWaypoint         = null;
                            int           closestWaypointDistance = 100000;

                            foreach (UOACZWayPoint waypoint in UOACZWayPoint.m_UOACZWaypoints)
                            {
                                if (waypoint == null)
                                {
                                    continue;
                                }
                                if (waypoint.Deleted)
                                {
                                    continue;
                                }
                                if (waypoint.m_GotoSplitGroup == -1)
                                {
                                    continue;
                                }
                                if (!UOACZRegion.ContainsItem(waypoint))
                                {
                                    continue;
                                }
                                if (waypoint.WaypointType == UOACZWayPoint.UOACZWaypointType.UndeadTown && m_Wilderness)
                                {
                                    continue;
                                }
                                if (waypoint.WaypointType == UOACZWayPoint.UOACZWaypointType.UndeadWilderness && !m_Wilderness)
                                {
                                    continue;
                                }

                                if (waypoint.SplitGroup == m_GotoSplitGroup)
                                {
                                    int distanceToWaypoint = Utility.GetDistance(creature.Location, waypoint.Location);

                                    if (distanceToWaypoint <= closestWaypointDistance)
                                    {
                                        closestWaypoint         = waypoint;
                                        closestWaypointDistance = distanceToWaypoint;
                                    }
                                }
                            }

                            if (closestWaypoint != null)
                            {
                                creature.CurrentWaypoint = closestWaypoint;
                            }
                        }
                    }
                }
            }
        }