Esempio n. 1
0
    public static void ghouls_harpies_join_in(GameObject attachee)
    {
        foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC))
        {
            if ((new[] { 14095, 14128, 14129 }).Contains(obj.GetNameId()) && ScriptDaemon.within_rect_by_corners(obj, 415, 556, 419, 590) && obj.GetLeader() == null)
            {
                // ghouls in the eastern room - should join the fray, per the module
                obj.Attack(SelectedPartyLeader);
            }

            if (obj.GetNameId() == 14243 && obj.GetLeader() == null)
            {
                // other harpies
                obj.Attack(SelectedPartyLeader);
            }
        }

        if (attachee.GetMap() == 5066 && (!ScriptDaemon.get_f("j_ghouls_corridor_temple_1"))) // temple level 1
        {
            ScriptDaemon.set_f("j_ghouls_corridor_temple_1");
            var yyp_max = 556;
            var yyp_o   = 561;
            foreach (var pc in PartyLeader.GetPartyMembers())
            {
                var(xxp, yyp) = pc.GetLocation();
                if (xxp >= 433 && yyp >= 561)
                {
                    if (yyp > yyp_max)
                    {
                        yyp_max = yyp;
                    }
                }
            }

            var y_ghoul = yyp_max + 18;
            y_ghoul = Math.Min(603, y_ghoul);
            var y_ghoul_add   = new[] { 0, 0, 2, 2, -2 };
            var x_ghoul_add   = new[] { 0, 2, 0, 2, 0 };
            var x_ghoul       = 433;
            var ghoul_counter = 0;
            foreach (var npc in ObjList.ListVicinity(new locXY(463, 603), ObjectListFilter.OLC_NPC))
            {
                if (npc.GetNameId() == 14129 && npc.GetLeader() == null && !npc.IsUnconscious())
                {
                    npc.Move(new locXY(x_ghoul + x_ghoul_add[ghoul_counter], y_ghoul + y_ghoul_add[ghoul_counter]), 0, 0);
                    ghoul_counter += 1;
                    npc.Attack(SelectedPartyLeader);
                }
            }
        }
    }
Esempio n. 2
0
    public override bool OnHeartbeat(GameObject attachee, GameObject triggerer)
    {
        if ((GetGlobalVar(568) == 1))
        {
            SetGlobalVar(569, GetGlobalVar(569) + 1);
            if ((GetGlobalVar(569) == 4))
            {
                Sound(4180, 1);
            }
            else if ((GetGlobalVar(569) == 7))
            {
                spawn_hydra(attachee, triggerer);
            }
            else if ((GetGlobalVar(569) == 10))
            {
                spawn_others(attachee, triggerer);
                SetGlobalVar(569, 0);
            }
        }

        foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_CRITTERS))
        {
            if ((ScriptDaemon.within_rect_by_corners(obj, 538, 394, 531, 408)))
            {
                attachee.ClearObjectFlag(ObjectFlag.OFF);
                obj.AddCondition("Prone", 1, 0);
                AttachParticles("ef-splash", obj);
                Sound(4177, 1);
                StartTimer(300, () => relocate_west(attachee, obj));
                obj.BeginDialog(attachee, 1);
            }

            if ((ScriptDaemon.within_rect_by_corners(obj, 487, 398, 481, 412)))
            {
                attachee.ClearObjectFlag(ObjectFlag.OFF);
                obj.AddCondition("Prone", 1, 0);
                AttachParticles("ef-splash", obj);
                Sound(4177, 1);
                StartTimer(300, () => relocate_east(attachee, obj));
                obj.BeginDialog(attachee, 1);
            }
        }

        return(RunDefault);
    }
Esempio n. 3
0
    public static bool san_enter_combat_backup_with_beacon_shit(GameObject attachee, GameObject triggerer)
    {
        Livonya.tag_strategy(attachee);
        if (attachee.GetNameId() == 14811)                       // The Beacon
        {
            attachee.SetScriptId(ObjScriptEvent.EndCombat, 446); // end combat round script
            attachee.FloatMesFileLine("mes/script_activated.mes", 13, TextFloaterColor.Red);
            return(RunDefault);
        }

        if ((!ScriptDaemon.can_see_party(attachee) && ScriptDaemon.is_far_from_party(attachee, 10)) || ScriptDaemon.is_far_from_party(attachee, 40))
        {
            if (ScriptDaemon.is_far_from_party(attachee, 70))
            {
                var joe = Utilities.party_closest(attachee);
                ScriptDaemon.encroach(attachee, joe);
            }

            attachee.SetInt(obj_f.critter_strategy, 119); // Seek out low ac beacon
            AttachParticles("sp-Hold Person", attachee);
            if (ScriptDaemon.get_v("Beacon_Active") == 0)
            {
                var top_path    = 0;
                var bottom_path = 0;
                foreach (var pc in GameSystems.Party.PartyMembers)
                {
                    if (ScriptDaemon.within_rect_by_corners(pc, 467, 360, 467, 388) && !pc.IsUnconscious())
                    {
                        top_path = top_path + 1;
                    }

                    if (ScriptDaemon.within_rect_by_corners(pc, 504, 355, 504, 385) && !pc.IsUnconscious())
                    {
                        bottom_path = bottom_path + 1;
                    }
                }

                int primary_beacon_x;
                int primary_beacon_y;
                int tertiary_beacon_x;
                int tertiary_beacon_y;
                if (top_path > bottom_path)
                {
                    primary_beacon_x  = 470;
                    primary_beacon_y  = 388;
                    tertiary_beacon_x = 492;
                    tertiary_beacon_y = 387;
                }
                else
                {
                    primary_beacon_x  = 492;
                    primary_beacon_y  = 387;
                    tertiary_beacon_x = 470;
                    tertiary_beacon_y = 388;
                }

                var beacon_loc  = new locXY(primary_beacon_x, primary_beacon_y);
                var beacon3_loc = new locXY(tertiary_beacon_x, tertiary_beacon_y);
                var beacon      = GameSystems.MapObject.CreateObject(14811, beacon_loc);
                beacon.Move(new locXY(470, 388), 0, 0);
                beacon.SetInt(obj_f.npc_ac_bonus, -50);
                beacon.SetBaseStat(Stat.dexterity, -70); // causes problems at end of round, or does it?
                // beacon.object_flag_set(OF_DONTDRAW) # this causes combat to lag at the beacon's turn
                beacon.SetObjectFlag(ObjectFlag.CLICK_THROUGH);
                beacon.AddToInitiative();
                beacon.SetInitiative(-20);
                UiSystems.Combat.Initiative.UpdateIfNeeded();
                beacon.SetScriptId(ObjScriptEvent.EndCombat, 446); // end combat round
                // beacon.scripts[14] = 446 # exit combat
                AttachParticles("sp-hold person", beacon);
                var beacon2 = GameSystems.MapObject.CreateObject(14811, new locXY(483, 395));
                beacon2.Move(new locXY(483, 395), 0, 0);
                beacon2.SetInt(obj_f.npc_ac_bonus, -40);
                // beacon2.object_flag_set(OF_DONTDRAW)
                beacon2.SetObjectFlag(ObjectFlag.CLICK_THROUGH);
                beacon2.AddToInitiative();
                beacon2.SetInitiative(-21);
                UiSystems.Combat.Initiative.UpdateIfNeeded();
                AttachParticles("sp-hold person", beacon2);
                var beacon3 = GameSystems.MapObject.CreateObject(14811, beacon3_loc);
                beacon3.Move(beacon3_loc, 0, 0);
                beacon3.SetInt(obj_f.npc_ac_bonus, -30);
                // beacon3.object_flag_set(OF_DONTDRAW)
                beacon3.SetObjectFlag(ObjectFlag.CLICK_THROUGH);
                beacon3.AddToInitiative();
                beacon3.SetInitiative(-23);
                UiSystems.Combat.Initiative.UpdateIfNeeded();
                AttachParticles("sp-hold person", beacon3);
                ScriptDaemon.set_v("Beacon_Active", 3);
            }
        }
        else if (ScriptDaemon.is_far_from_party(attachee, 75))
        {
            var joe = Utilities.party_closest(attachee);
            ScriptDaemon.encroach(attachee, joe);
        }
        else
        {
            Livonya.get_melee_strategy(attachee);
        }

        // Tried changing their standpoint midfight, didn't work.
        // attachee.standpoint_set(STANDPOINT_DAY, attachee.obj_get_int(obj_f_npc_pad_i_3) - 342 + 500)
        // attachee.standpoint_set(STANDPOINT_NIGHT, attachee.obj_get_int(obj_f_npc_pad_i_3) - 342 + 500)
        // if attachee.obj_get_int(obj_f_npc_pad_i_3) == 361 or attachee.obj_get_int(obj_f_npc_pad_i_3) == 362: #sentry standpoints
        // hl(attachee)
        // xx = 482
        // yy = 417
        // for npc in game.obj_list_vicinity(location_from_axis(xx,yy), OLC_NPC ):
        // if npc.leader_get() == OBJ_HANDLE_NULL:
        // npc.standpoint_set(STANDPOINT_DAY, npc.obj_get_int(obj_f_npc_pad_i_3) - 342 + 500)
        // npc.standpoint_set(STANDPOINT_NIGHT, npc.obj_get_int(obj_f_npc_pad_i_3) - 342 + 500)
        // npc.npc_flag_set(ONF_KOS)
        // npc.npc_flag_unset(ONF_KOS_OVERRIDE)
        return(RunDefault);
    }
Esempio n. 4
0
    public static void romag_call_help(GameObject attachee)
    {
        if (attachee.GetMap() == 5066 && (!ScriptDaemon.get_f("j_earth_commander_troops_temple_1")) && ScriptDaemon.within_rect_by_corners(attachee, 440, 432, 440, 451)) // temple level 1
        {
            attachee.FloatLine(1000, attachee);
            ScriptDaemon.set_f("j_earth_commander_troops_temple_1");
            var yyp_max                  = 439;
            var party_in_troop_room      = false;
            var party_in_romag_room      = false;
            var party_outside_romag_room = false;
            foreach (var pc in PartyLeader.GetPartyMembers())
            {
                var(xxp, yyp) = pc.GetLocation();
                if ((xxp >= 440 && xxp <= 452 && yyp >= 439 && yyp <= 451))
                {
                    party_in_romag_room = true;
                    if (yyp > yyp_max)
                    {
                        yyp_max = yyp;
                    }
                }

                if (xxp >= 453 && yyp <= 451)
                {
                    party_outside_romag_room = true;
                }

                if ((yyp >= 455 && yyp <= 471 && xxp >= 439 && xxp <= 457) || ((xxp - yyp) <= 1 && yyp <= 471 && xxp >= 456))
                {
                    party_in_troop_room = true;
                }
            }

            var y_troop = yyp_max + 18;
            y_troop = Math.Min(465, y_troop);
            var y_troop_add   = new[] { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 };
            var x_troop_add   = new[] { 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, -1, -2, -3 };
            var x_troop       = 446;
            var troop_counter = 0;
            if (party_outside_romag_room && !party_in_romag_room)
            {
                y_troop     = 446;
                x_troop     = 445;
                y_troop_add = new[] { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 0, 1, 2, 3, 0, 1 };
                x_troop_add = new[] { 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, -1, -1, -1, -1, -2, -2 };
            }

            if (!party_in_troop_room)
            {
                foreach (var npc in ObjList.ListVicinity(new locXY(453, 463), ObjectListFilter.OLC_NPC))
                {
                    if ((new[] { 14162, 14163, 14165, 14337, 14339, 14156 }).Contains(npc.GetNameId()) && npc.GetLeader() == null && !npc.IsUnconscious())
                    {
                        var(xx, yy) = npc.GetLocation();
                        if (yy > y_troop)
                        {
                            npc.Move(new locXY(x_troop + x_troop_add[troop_counter], y_troop + y_troop_add[troop_counter]), 0, 0);
                            troop_counter += 1;
                        }
                    }
                }
            }

            // npc.attack(game.leader)
            foreach (var npc in ObjList.ListVicinity(new locXY(453, 463), ObjectListFilter.OLC_NPC))
            {
                if ((new[] { 14162, 14163, 14165, 14337, 14339, 14156 }).Contains(npc.GetNameId()) && npc.GetLeader() == null)
                {
                    npc.Attack(SelectedPartyLeader);
                }
            }
        }
    }
Esempio n. 5
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        var webbed = Livonya.break_free(attachee, 3);

        // ready vs approach guys with explosives  #
        if ((attachee.GetNameId() == 8932 || attachee.GetNameId() == 8936 || attachee.GetNameId() == 8940 || attachee.GetNameId() == 8944 || attachee.GetNameId() == 8948 || attachee.GetNameId() == 8952 || attachee.GetNameId() == 8956))
        {
            if ((Utilities.obj_percent_hp(attachee) <= 50))
            {
                attachee.SetInt(obj_f.critter_strategy, 547);
            }
            else if ((Utilities.obj_percent_hp(attachee) >= 51))
            {
                attachee.SetInt(obj_f.critter_strategy, 565);
                foreach (var obj in GameSystems.Party.PartyMembers)
                {
                    if ((ScriptDaemon.within_rect_by_corners(obj, 423, 453, 488, 554)))
                    {
                        var damage_dice = Dice.Parse("6d6");
                        AttachParticles("hit-BLUDGEONING-medium", obj);
                        AttachParticles("hit-FIRE-burst", obj);
                        obj.FloatMesFileLine("mes/float.mes", 1);
                        if ((obj.ReflexSaveAndDamage(null, 20, D20SavingThrowReduction.Half, D20SavingThrowFlag.NONE, damage_dice, DamageType.Force, D20AttackPower.UNSPECIFIED, D20ActionType.UNSPECIFIED_MOVE)))
                        {
                            obj.FloatMesFileLine("mes/spell.mes", 30001);
                        }
                        else
                        {
                            obj.FloatMesFileLine("mes/spell.mes", 30002);
                        }

                        SetGlobalFlag(872, true);
                    }
                }

                if ((GetGlobalFlag(872)))
                {
                    go_boom_one_time(attachee, triggerer);
                }
            }
        }
        // ready vs approach guys normal  #
        else if ((attachee.GetNameId() == 8931 || attachee.GetNameId() == 8933 || attachee.GetNameId() == 8934 || attachee.GetNameId() == 8935 || attachee.GetNameId() == 8937 || attachee.GetNameId() == 8938 || attachee.GetNameId() == 8939 || attachee.GetNameId() == 8946 || attachee.GetNameId() == 8941 || attachee.GetNameId() == 8942 || attachee.GetNameId() == 8943 || attachee.GetNameId() == 8945 || attachee.GetNameId() == 8946 || attachee.GetNameId() == 8947 || attachee.GetNameId() == 8949 || attachee.GetNameId() == 8950 || attachee.GetNameId() == 8951 || attachee.GetNameId() == 8953 || attachee.GetNameId() == 8954 || attachee.GetNameId() == 8955 || attachee.GetNameId() == 8967 || attachee.GetNameId() == 8958 || attachee.GetNameId() == 8969 || attachee.GetNameId() == 8970 || attachee.GetNameId() == 8971 || attachee.GetNameId() == 8972 || attachee.GetNameId() == 8973 || attachee.GetNameId() == 8974 || attachee.GetNameId() == 8975 || attachee.GetNameId() == 8976 || attachee.GetNameId() == 8977))
        {
            if ((Utilities.obj_percent_hp(attachee) <= 50))
            {
                attachee.SetInt(obj_f.critter_strategy, 547);
            }
            else if ((Utilities.obj_percent_hp(attachee) >= 51))
            {
                attachee.SetInt(obj_f.critter_strategy, 565);
            }
        }
        // RANGED TROOPS  #
        // dumb guys - orc bowmen  #
        else if ((attachee.GetNameId() == 8978 || attachee.GetNameId() == 8986 || attachee.GetNameId() == 8989))
        {
            var leader = attachee.GetLeader();
            if ((Utilities.group_percent_hp(leader) >= 51))
            {
                attachee.SetInt(obj_f.critter_strategy, 552);
            }
            else if ((Utilities.group_percent_hp(leader) <= 50))
            {
                attachee.SetInt(obj_f.critter_strategy, 553);
            }
        }
        // smart guys - orc archers  #
        else if ((attachee.GetNameId() == 8979 || attachee.GetNameId() == 8983 || attachee.GetNameId() == 8984 || attachee.GetNameId() == 8985 || attachee.GetNameId() == 8991))
        {
            var leader = attachee.GetLeader();
            if ((Utilities.group_percent_hp(leader) >= 51))
            {
                attachee.SetInt(obj_f.critter_strategy, 551);
            }
            else if ((Utilities.group_percent_hp(leader) <= 50))
            {
                attachee.SetInt(obj_f.critter_strategy, 553);
            }
        }
        // mage seekers - orc snipers  #
        else if ((attachee.GetNameId() == 8980 || attachee.GetNameId() == 8982 || attachee.GetNameId() == 8987 || attachee.GetNameId() == 8990))
        {
            var leader = attachee.GetLeader();
            if ((Utilities.group_percent_hp(leader) >= 51))
            {
                attachee.SetInt(obj_f.critter_strategy, 555);
            }
            else if ((Utilities.group_percent_hp(leader) <= 50))
            {
                attachee.SetInt(obj_f.critter_strategy, 553);
            }
        }
        // archery seekers - nobody atm  #
        // elif (attachee.name == xxxxx):
        // leader = attachee.leader_get()
        // if (group_percent_hp(leader) >= 51):
        // attachee.obj_set_int(obj_f_critter_strategy, 554)
        // elif (group_percent_hp(leader) <= 50):
        // attachee.obj_set_int(obj_f_critter_strategy, 553)
        // spell responders - orc marksmen  #
        else if ((attachee.GetNameId() == 8981 || attachee.GetNameId() == 8988))
        {
            foreach (var obj in GameSystems.Party.PartyMembers)
            {
                if ((obj.GetStat(Stat.level_wizard) >= 1 || obj.GetStat(Stat.level_sorcerer) >= 1 || obj.GetStat(Stat.level_druid) >= 1 || obj.GetStat(Stat.level_bard) >= 1))
                {
                    var leader = attachee.GetLeader();
                    if ((Utilities.group_percent_hp(leader) >= 34))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 557);
                    }
                    else if ((Utilities.group_percent_hp(leader) <= 33))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 553);
                    }
                }
                else
                {
                    var leader = attachee.GetLeader();
                    if ((Utilities.group_percent_hp(leader) >= 34))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 554);
                    }
                    else if ((Utilities.group_percent_hp(leader) <= 33))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 553);
                    }
                }
            }
        }

        return(RunDefault);
    }
Esempio n. 6
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        var webbed = Livonya.break_free(attachee, 3);

        // MELEE TROOPS  #
        // dumb guys with rage - orc fighters, ogre troops  #
        if ((attachee.GetNameId() == 8994 || attachee.GetNameId() == 8601 || attachee.GetNameId() == 8602 || attachee.GetNameId() == 8603 || attachee.GetNameId() == 8604 || attachee.GetNameId() == 8605 || attachee.GetNameId() == 8606))
        {
            var leader = attachee.GetLeader();
            if ((Utilities.group_percent_hp(leader) >= 51))
            {
                foreach (var obj in PartyLeader.GetPartyMembers())
                {
                    if (obj.D20Query(D20DispatcherKey.QUE_Prone))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 560);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 559);
                    }
                }
            }
            else if ((Utilities.group_percent_hp(leader) <= 50))
            {
                foreach (var obj in PartyLeader.GetPartyMembers())
                {
                    if (obj.D20Query(D20DispatcherKey.QUE_Prone))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 560);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 561);
                    }
                }
            }

            foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_CRITTERS))
            {
                if ((ScriptDaemon.within_rect_by_corners(obj, 538, 394, 531, 408)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(522, 526);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }

                if ((ScriptDaemon.within_rect_by_corners(obj, 487, 398, 481, 412)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(499, 503);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }
            }

            if ((GetGlobalFlag(557) && GetGlobalVar(568) == 0))
            {
                SetGlobalVar(568, 1);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 1))
            {
                Sound(4180, 1);
                SetGlobalVar(568, 2);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 2))
            {
                spawn_hydra();
            }
        }
        // mage seekers with rage - orc murderer  #
        else if ((attachee.GetNameId() == 8992))
        {
            var leader = attachee.GetLeader();
            if ((Utilities.group_percent_hp(leader) >= 51))
            {
                foreach (var obj in PartyLeader.GetPartyMembers())
                {
                    if (obj.D20Query(D20DispatcherKey.QUE_Prone))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 560);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 562);
                    }
                }
            }
            else if ((Utilities.group_percent_hp(leader) <= 50))
            {
                foreach (var obj in PartyLeader.GetPartyMembers())
                {
                    if (obj.D20Query(D20DispatcherKey.QUE_Prone))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 560);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 561);
                    }
                }
            }

            foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_CRITTERS))
            {
                if ((ScriptDaemon.within_rect_by_corners(obj, 538, 394, 531, 408)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(522, 526);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }

                if ((ScriptDaemon.within_rect_by_corners(obj, 487, 398, 481, 412)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(499, 503);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }
            }

            if ((GetGlobalFlag(557) && GetGlobalVar(568) == 0))
            {
                SetGlobalVar(568, 1);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 1))
            {
                Sound(4180, 1);
                SetGlobalVar(568, 2);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 2))
            {
                spawn_hydra();
            }
        }
        // archery seekers with rage - orc sergeant  #
        else if ((attachee.GetNameId() == 8993))
        {
            var leader = attachee.GetLeader();
            if ((Utilities.group_percent_hp(leader) >= 51))
            {
                foreach (var obj in PartyLeader.GetPartyMembers())
                {
                    if (obj.D20Query(D20DispatcherKey.QUE_Prone))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 560);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 563);
                    }
                }
            }
            else if ((Utilities.group_percent_hp(leader) <= 50))
            {
                foreach (var obj in PartyLeader.GetPartyMembers())
                {
                    if (obj.D20Query(D20DispatcherKey.QUE_Prone))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 560);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 561);
                    }
                }
            }

            foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_CRITTERS))
            {
                if ((ScriptDaemon.within_rect_by_corners(obj, 538, 394, 531, 408)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(522, 526);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }

                if ((ScriptDaemon.within_rect_by_corners(obj, 487, 398, 481, 412)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(499, 503);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }
            }

            if ((GetGlobalFlag(557) && GetGlobalVar(568) == 0))
            {
                SetGlobalVar(568, 1);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 1))
            {
                Sound(4180, 1);
                SetGlobalVar(568, 2);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 2))
            {
                spawn_hydra();
            }
        }
        // flankers with rage - orc assassin  #
        else if ((attachee.GetNameId() == 8999))
        {
            var leader = attachee.GetLeader();
            if ((Utilities.group_percent_hp(leader) >= 51))
            {
                foreach (var obj in PartyLeader.GetPartyMembers())
                {
                    if (obj.D20Query(D20DispatcherKey.QUE_Prone))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 560);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 564);
                    }
                }
            }
            else if ((Utilities.group_percent_hp(leader) <= 50))
            {
                foreach (var obj in PartyLeader.GetPartyMembers())
                {
                    if (obj.D20Query(D20DispatcherKey.QUE_Prone))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 560);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 561);
                    }
                }
            }

            foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_CRITTERS))
            {
                if ((ScriptDaemon.within_rect_by_corners(obj, 538, 394, 531, 408)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(522, 526);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }

                if ((ScriptDaemon.within_rect_by_corners(obj, 487, 398, 481, 412)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(499, 503);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }
            }

            if ((GetGlobalFlag(557) && GetGlobalVar(568) == 0))
            {
                SetGlobalVar(568, 1);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 1))
            {
                Sound(4180, 1);
                SetGlobalVar(568, 2);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 2))
            {
                spawn_hydra();
            }
        }
        // RANGED TROOPS  #
        // mage seekers - orc snipers  #
        else if ((attachee.GetNameId() == 8995 || attachee.GetNameId() == 8996 || attachee.GetNameId() == 8607 || attachee.GetNameId() == 8608))
        {
            var leader = attachee.GetLeader();
            if ((Utilities.group_percent_hp(leader) >= 51))
            {
                attachee.SetInt(obj_f.critter_strategy, 555);
            }
            else if ((Utilities.group_percent_hp(leader) <= 50))
            {
                attachee.SetInt(obj_f.critter_strategy, 553);
            }

            foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_CRITTERS))
            {
                if ((ScriptDaemon.within_rect_by_corners(obj, 538, 394, 531, 408)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(522, 526);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }

                if ((ScriptDaemon.within_rect_by_corners(obj, 487, 398, 481, 412)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(499, 503);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }
            }

            if ((GetGlobalFlag(557) && GetGlobalVar(568) == 0))
            {
                SetGlobalVar(568, 1);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 1))
            {
                Sound(4180, 1);
                SetGlobalVar(568, 2);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 2))
            {
                spawn_hydra();
            }
        }
        // spell responders - orc marksmen  #
        else if ((attachee.GetNameId() == 8997 || attachee.GetNameId() == 8609))
        {
            foreach (var obj in PartyLeader.GetPartyMembers())
            {
                if ((obj.GetStat(Stat.level_wizard) >= 1 || obj.GetStat(Stat.level_sorcerer) >= 1 || obj.GetStat(Stat.level_druid) >= 1 || obj.GetStat(Stat.level_bard) >= 1))
                {
                    var leader = attachee.GetLeader();
                    if ((Utilities.group_percent_hp(leader) >= 34))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 557);
                    }
                    else if ((Utilities.group_percent_hp(leader) <= 33))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 553);
                    }
                }
                else
                {
                    var leader = attachee.GetLeader();
                    if ((Utilities.group_percent_hp(leader) >= 34))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 554);
                    }
                    else if ((Utilities.group_percent_hp(leader) <= 33))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 553);
                    }
                }
            }

            foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_CRITTERS))
            {
                if ((ScriptDaemon.within_rect_by_corners(obj, 538, 394, 531, 408)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(522, 526);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }

                if ((ScriptDaemon.within_rect_by_corners(obj, 487, 398, 481, 412)))
                {
                    // obj.condition_add_with_args("Prone",0,0)
                    var coord_x = RandomRange(499, 503);
                    var coord_y = RandomRange(405, 409);
                    obj.Move(new locXY(coord_x, coord_y));
                    AttachParticles("Mon-Phycomid-10", obj);
                    obj.FloatMesFileLine("mes/float.mes", 2);
                    Sound(4177, 1);
                    SetGlobalFlag(557, true);
                }
            }

            if ((GetGlobalFlag(557) && GetGlobalVar(568) == 0))
            {
                SetGlobalVar(568, 1);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 1))
            {
                Sound(4180, 1);
                SetGlobalVar(568, 2);
            }
            else if ((GetGlobalFlag(557) && GetGlobalVar(568) == 2))
            {
                spawn_hydra();
            }
        }
        // animals - hydra  #
        else if ((attachee.GetNameId() == 14982))
        {
            SetGlobalVar(568, GetGlobalVar(568) + 1);
            if ((GetGlobalVar(568) == 4))
            {
                var picker = RandomRange(14978, 14981);
                var animal = GameSystems.MapObject.CreateObject(picker, new locXY(511, 423));
                animal.Move(new locXY(515, 424));
                animal.Rotation = 5.49778714378f;
                animal.SetConcealed(true);
                animal.Unconceal();
                AttachParticles("Mon-YellowMold-30", animal);
                Sound(4181, 1);
            }
            else if ((GetGlobalVar(568) == 5))
            {
                var picker = RandomRange(14978, 14981);
                var animal = GameSystems.MapObject.CreateObject(picker, new locXY(511, 423));
                animal.Move(new locXY(507, 424));
                animal.Rotation = 5.49778714378f;
                animal.SetConcealed(true);
                animal.Unconceal();
                AttachParticles("Mon-YellowMold-30", animal);
                Sound(4181, 1);
            }
            else if ((GetGlobalVar(568) == 6))
            {
                var picker = RandomRange(14978, 14981);
                var animal = GameSystems.MapObject.CreateObject(picker, new locXY(511, 423));
                animal.Move(new locXY(519, 424));
                animal.Rotation = 5.49778714378f;
                animal.SetConcealed(true);
                animal.Unconceal();
                AttachParticles("Mon-YellowMold-30", animal);
                Sound(4181, 1);
            }
            else if ((GetGlobalVar(568) == 7))
            {
                var picker = RandomRange(14978, 14981);
                var animal = GameSystems.MapObject.CreateObject(picker, new locXY(511, 423));
                animal.Move(new locXY(503, 424));
                animal.Rotation = 5.49778714378f;
                animal.SetConcealed(true);
                animal.Unconceal();
                AttachParticles("Mon-YellowMold-30", animal);
                Sound(4181, 1);
            }
            else if ((GetGlobalVar(568) == 8))
            {
                var picker = RandomRange(14978, 14981);
                var animal = GameSystems.MapObject.CreateObject(picker, new locXY(511, 423));
                animal.Move(new locXY(523, 424));
                animal.Rotation = 5.49778714378f;
                animal.SetConcealed(true);
                animal.Unconceal();
                AttachParticles("Mon-YellowMold-30", animal);
                Sound(4181, 1);
            }
            else if ((GetGlobalVar(568) == 9))
            {
                var picker = RandomRange(14978, 14981);
                var animal = GameSystems.MapObject.CreateObject(picker, new locXY(511, 423));
                animal.Move(new locXY(499, 424));
                animal.Rotation = 5.49778714378f;
                animal.SetConcealed(true);
                animal.Unconceal();
                AttachParticles("Mon-YellowMold-30", animal);
                Sound(4181, 1);
            }
        }

        return(RunDefault);
    }