Exemple #1
0
    public static void get_something(GameObject attachee)
    {
        if (Utilities.critter_is_unconscious(attachee) || attachee.HasCondition(SpellEffects.SpellSoundBurst) || attachee.D20Query(D20DispatcherKey.QUE_Critter_Is_Stunned))
        {
            attachee.FloatMesFileLine("mes/spell.mes", 20021);
            return;
        }

        // game.particles( "sp-summon monster I", game.party[0] )
        foreach (var weap in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_WEAPON))
        {
            if (weap != null)
            {
                var sizeCat = (SizeCategory)attachee.GetInt(obj_f.size);
                if (sizeCat <= SizeCategory.Medium && attachee.DistanceTo(weap) <= 10)
                {
                    attachee.GetItem(weap);
                    attachee.WieldBestInAllSlots();
                }
                else if (sizeCat > SizeCategory.Medium && attachee.DistanceTo(weap) <= 17)
                {
                    attachee.GetItem(weap);
                    attachee.WieldBestInAllSlots();
                }
            }
        }

        if (nothing(attachee))
        {
            Livonya.get_melee_strategy(attachee);
            return;
        }
        else
        {
            attachee.ClearCritterFlag(CritterFlag.UNUSED_00000400);
            if (attachee.HasFeat(FeatId.QUICK_DRAW))
            {
                Livonya.get_melee_strategy(attachee);
                attachee.FloatMesFileLine("mes/skill_ui.mes", 199);
            }
            else if (attachee.HasFeat(FeatId.COMBAT_EXPERTISE))
            {
                attachee.SetInt(obj_f.critter_strategy, 54);
                attachee.FloatMesFileLine("mes/skill_ui.mes", 654);
            }
            else
            {
                attachee.SetInt(obj_f.critter_strategy, 55);
                attachee.FloatMesFileLine("mes/skill_ui.mes", 655);
            }
        }

        return;
    }
Exemple #2
0
    public override bool OnEnterCombat(GameObject attachee, GameObject triggerer)
    {
        if (attachee.GetNameId() == 14913) // grate
        {
            attachee.Move(new locXY(415, 556), 0, 11f);
            attachee.Rotation = 1.57f * 3 / 2;
        }

        Livonya.tag_strategy(attachee);
        Livonya.get_melee_strategy(attachee);
        return(RunDefault);
    }
Exemple #3
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        if (attachee.GetNameId() == 14913) // harpy grate
        {
            attachee.Move(new locXY(415, 556), 0, 11f);
            attachee.Rotation = 1.57f * 3 / 2;
            return(SkipDefault);
        }
        else if (attachee.GetNameId() == 14914)
        {
            return(SkipDefault);
        }
        else if (attachee.GetNameId() == 14811) // The Beacon
        {
            attachee.SetInt(obj_f.critter_strategy, 104);
            attachee.FloatMesFileLine("mes/script_activated.mes", 15, TextFloaterColor.Red);
            return(RunDefault);
        }

        // Copied from script 310 :	#
        // THIS IS USED FOR BREAK FREE
        while ((attachee.FindItemByName(8903) != null))
        {
            attachee.FindItemByName(8903).Destroy();
        }

        // if (attachee.d20_query(Q_Is_BreakFree_Possible)): # workaround no longer necessary!
        // create_item_in_inventory( 8903, attachee )
        // attachee.d20_send_signal(S_BreakFree)
        // if game.global_flags[403] == 1:
        // attachee.float_mesfile_line( 'mes\\script_activated.mes', 15, 1 )
        if (attachee.GetNameId() == 14249 || attachee.GetNameId() == 14381 || attachee.GetNameId() == 14296) // Ogre, Medium Earth Elem, Large Earth Elem
        {
        }
        else if (attachee.GetNameId() == 14243 && attachee.GetMap() == 5066) // harpies	at Temple Level 1
        {
            ghouls_harpies_join_in(attachee);
            spawn_grate_object();
        }
        else
        {
            Livonya.get_melee_strategy(attachee);
        }

        return(RunDefault);
    }
Exemple #4
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);
    }
Exemple #5
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        var webbed = Livonya.break_free(attachee, 3);

        if ((attachee != null && !Utilities.critter_is_unconscious(attachee) && !attachee.D20Query(D20DispatcherKey.QUE_Prone) && attachee.GetLeader() == null))
        {
            if ((attachee.GetNameId() == 8910 || attachee.GetNameId() == 8921))
            {
                if ((Utilities.obj_percent_hp(attachee) <= 75))
                {
                    if ((attachee.GetNameId() == 8910))
                    {
                        // hb gatekeeper east
                        if ((GetGlobalVar(787) <= 17))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 540);
                            SetGlobalVar(787, GetGlobalVar(787) + 1);
                        }
                        else if ((GetGlobalVar(788) <= 1))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 537);
                            SetGlobalVar(788, GetGlobalVar(788) + 1);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 534);
                        }
                    }
                    else if ((attachee.GetNameId() == 8921))
                    {
                        // hb gatekeeper west
                        if ((GetGlobalVar(790) <= 17))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 540);
                            SetGlobalVar(790, GetGlobalVar(790) + 1);
                        }
                        else if ((GetGlobalVar(791) <= 1))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 537);
                            SetGlobalVar(791, GetGlobalVar(791) + 1);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 534);
                        }
                    }
                }
                else if ((Utilities.obj_percent_hp(attachee) >= 76))
                {
                    if ((attachee.GetNameId() == 8910))
                    {
                        // hb gatekeeper east
                        var orcserg01 = Utilities.find_npc_near(attachee, 8894);
                        var orcdomi01 = Utilities.find_npc_near(attachee, 8895);
                        var orcbowm01 = Utilities.find_npc_near(attachee, 8899);
                        var orcbowm02 = Utilities.find_npc_near(attachee, 8900);
                        var orcarch01 = Utilities.find_npc_near(attachee, 8901);
                        var orcarch02 = Utilities.find_npc_near(attachee, 8902);
                        var orcsnip01 = Utilities.find_npc_near(attachee, 8903);
                        var hilgian01 = Utilities.find_npc_near(attachee, 8904);
                        var hilgian02 = Utilities.find_npc_near(attachee, 8905);
                        var hilgian03 = Utilities.find_npc_near(attachee, 8906);
                        var hilgian04 = Utilities.find_npc_near(attachee, 8907);
                        var hilgian05 = Utilities.find_npc_near(attachee, 8908);
                        var orcsham01 = Utilities.find_npc_near(attachee, 8909);
                        if ((Utilities.obj_percent_hp(orcserg01) <= 75 || Utilities.obj_percent_hp(orcdomi01) <= 75 || Utilities.obj_percent_hp(orcbowm01) <= 75 || Utilities.obj_percent_hp(orcbowm02) <= 75 || Utilities.obj_percent_hp(orcarch01) <= 75 || Utilities.obj_percent_hp(orcarch02) <= 75 || Utilities.obj_percent_hp(orcsnip01) <= 75 || Utilities.obj_percent_hp(hilgian01) <= 75 || Utilities.obj_percent_hp(hilgian02) <= 75 || Utilities.obj_percent_hp(hilgian03) <= 75 || Utilities.obj_percent_hp(hilgian04) <= 75 || Utilities.obj_percent_hp(hilgian05) <= 75 || Utilities.obj_percent_hp(orcsham01) <= 75))
                        {
                            if ((GetGlobalVar(787) <= 17))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 474);
                                SetGlobalVar(787, GetGlobalVar(787) + 1);
                            }
                            else if ((GetGlobalVar(788) <= 1))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 537);
                                SetGlobalVar(788, GetGlobalVar(788) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 534);
                            }
                        }
                        else
                        {
                            if ((GetGlobalVar(788) <= 1))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 537);
                                SetGlobalVar(788, GetGlobalVar(788) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 543);
                            }
                        }
                    }
                    else if ((attachee.GetNameId() == 8921))
                    {
                        // hb gatekeeper west
                        var ogrexxx01 = Utilities.find_npc_near(attachee, 8911);
                        var ettinxx01 = Utilities.find_npc_near(attachee, 8912);
                        var ettinxx02 = Utilities.find_npc_near(attachee, 8913);
                        var ettinxx03 = Utilities.find_npc_near(attachee, 8914);
                        var ettinxx04 = Utilities.find_npc_near(attachee, 8915);
                        var ettinxx05 = Utilities.find_npc_near(attachee, 8916);
                        var orcbowm01 = Utilities.find_npc_near(attachee, 8917);
                        var orcbowm02 = Utilities.find_npc_near(attachee, 8918);
                        var orcarch01 = Utilities.find_npc_near(attachee, 8919);
                        var orcsham01 = Utilities.find_npc_near(attachee, 8920);
                        if ((Utilities.obj_percent_hp(ogrexxx01) <= 75 || Utilities.obj_percent_hp(ettinxx01) <= 75 || Utilities.obj_percent_hp(ettinxx02) <= 75 || Utilities.obj_percent_hp(ettinxx03) <= 75 || Utilities.obj_percent_hp(ettinxx04) <= 75 || Utilities.obj_percent_hp(ettinxx05) <= 75 || Utilities.obj_percent_hp(orcbowm01) <= 75 || Utilities.obj_percent_hp(orcbowm02) <= 75 || Utilities.obj_percent_hp(orcarch01) <= 75 || Utilities.obj_percent_hp(orcsham01) <= 75))
                        {
                            if ((GetGlobalVar(790) <= 17))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 474);
                                SetGlobalVar(790, GetGlobalVar(790) + 1);
                            }
                            else if ((GetGlobalVar(791) <= 1))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 537);
                                SetGlobalVar(791, GetGlobalVar(791) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 534);
                            }
                        }
                        else
                        {
                            if ((GetGlobalVar(791) <= 1))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 537);
                                SetGlobalVar(791, GetGlobalVar(791) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 543);
                            }
                        }
                    }
                }
            }
            else if ((attachee.GetNameId() == 8961 || attachee.GetNameId() == 8965))
            {
                if ((Utilities.obj_percent_hp(attachee) <= 75))
                {
                    if ((attachee.GetNameId() == 8961))
                    {
                        // hb ravine north
                        if ((GetGlobalVar(794) <= 17))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 540);
                            SetGlobalVar(794, GetGlobalVar(794) + 1);
                        }
                        else if ((GetGlobalVar(795) <= 1))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 537);
                            SetGlobalVar(795, GetGlobalVar(795) + 1);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 534);
                        }
                    }
                    else if ((attachee.GetNameId() == 8965))
                    {
                        // hb ravine south
                        if ((GetGlobalVar(796) <= 17))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 540);
                            SetGlobalVar(796, GetGlobalVar(796) + 1);
                        }
                        else if ((GetGlobalVar(797) <= 1))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 537);
                            SetGlobalVar(797, GetGlobalVar(797) + 1);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 534);
                        }
                    }
                }
                else if ((Utilities.obj_percent_hp(attachee) >= 76))
                {
                    if ((attachee.GetNameId() == 8961))
                    {
                        // hb ravine north
                        var gnollxx01 = Utilities.find_npc_near(attachee, 8931);
                        var gnollxx02 = Utilities.find_npc_near(attachee, 8932);
                        var gnollxx03 = Utilities.find_npc_near(attachee, 8933);
                        var gnollxx04 = Utilities.find_npc_near(attachee, 8934);
                        var gnollxx05 = Utilities.find_npc_near(attachee, 8935);
                        var bugbear01 = Utilities.find_npc_near(attachee, 8936);
                        var bugbear02 = Utilities.find_npc_near(attachee, 8937);
                        var bugbear03 = Utilities.find_npc_near(attachee, 8938);
                        var bugbear04 = Utilities.find_npc_near(attachee, 8939);
                        var ogrexxx01 = Utilities.find_npc_near(attachee, 8969);
                        var ogrexxx02 = Utilities.find_npc_near(attachee, 8970);
                        var ogrexxx03 = Utilities.find_npc_near(attachee, 8971);
                        var orcsham01 = Utilities.find_npc_near(attachee, 8960);
                        var orcbowm01 = Utilities.find_npc_near(attachee, 8978);
                        var orcarch01 = Utilities.find_npc_near(attachee, 8979);
                        var orcsnip01 = Utilities.find_npc_near(attachee, 8980);
                        var orcmark01 = Utilities.find_npc_near(attachee, 8981);
                        var orcsnip02 = Utilities.find_npc_near(attachee, 8982);
                        var orcarch02 = Utilities.find_npc_near(attachee, 8983);
                        if ((Utilities.obj_percent_hp(gnollxx01) <= 75 || Utilities.obj_percent_hp(gnollxx02) <= 75 || Utilities.obj_percent_hp(gnollxx03) <= 75 || Utilities.obj_percent_hp(gnollxx04) <= 75 || Utilities.obj_percent_hp(gnollxx05) <= 75 || Utilities.obj_percent_hp(bugbear01) <= 75 || Utilities.obj_percent_hp(bugbear02) <= 75 || Utilities.obj_percent_hp(bugbear03) <= 75 || Utilities.obj_percent_hp(bugbear04) <= 75 || Utilities.obj_percent_hp(ogrexxx01) <= 75 || Utilities.obj_percent_hp(ogrexxx02) <= 75 || Utilities.obj_percent_hp(ogrexxx03) <= 75 || Utilities.obj_percent_hp(orcsham01) <= 75 || Utilities.obj_percent_hp(orcbowm01) <= 75 || Utilities.obj_percent_hp(orcarch01) <= 75 || Utilities.obj_percent_hp(orcsnip01) <= 75 || Utilities.obj_percent_hp(orcmark01) <= 75 || Utilities.obj_percent_hp(orcsnip02) <= 75 || Utilities.obj_percent_hp(orcarch02) <= 75))
                        {
                            if ((GetGlobalVar(794) <= 17))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 474);
                                SetGlobalVar(794, GetGlobalVar(794) + 1);
                            }
                            else if ((GetGlobalVar(795) <= 1))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 537);
                                SetGlobalVar(795, GetGlobalVar(795) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 534);
                            }
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 543);
                        }
                    }
                    else if ((attachee.GetNameId() == 8965))
                    {
                        // hb ravine south
                        var orcserg02 = Utilities.find_npc_near(attachee, 8950);
                        var bugbear06 = Utilities.find_npc_near(attachee, 8951);
                        var bugbear07 = Utilities.find_npc_near(attachee, 8952);
                        var bugbear08 = Utilities.find_npc_near(attachee, 8953);
                        var bugbear09 = Utilities.find_npc_near(attachee, 8954);
                        var gnollxx06 = Utilities.find_npc_near(attachee, 8955);
                        var gnollxx07 = Utilities.find_npc_near(attachee, 8956);
                        var gnollxx08 = Utilities.find_npc_near(attachee, 8957);
                        var gnollxx09 = Utilities.find_npc_near(attachee, 8958);
                        var ettinxx01 = Utilities.find_npc_near(attachee, 8975);
                        var ettinxx02 = Utilities.find_npc_near(attachee, 8976);
                        var ettinxx03 = Utilities.find_npc_near(attachee, 8977);
                        var orcsham02 = Utilities.find_npc_near(attachee, 8966);
                        var orcarch04 = Utilities.find_npc_near(attachee, 8985);
                        var orcsnip03 = Utilities.find_npc_near(attachee, 8987);
                        var orcbowm03 = Utilities.find_npc_near(attachee, 8989);
                        var orcarch05 = Utilities.find_npc_near(attachee, 8991);
                        if ((Utilities.obj_percent_hp(orcserg02) <= 75 || Utilities.obj_percent_hp(bugbear06) <= 75 || Utilities.obj_percent_hp(bugbear07) <= 75 || Utilities.obj_percent_hp(bugbear08) <= 75 || Utilities.obj_percent_hp(bugbear09) <= 75 || Utilities.obj_percent_hp(gnollxx06) <= 75 || Utilities.obj_percent_hp(gnollxx07) <= 75 || Utilities.obj_percent_hp(gnollxx08) <= 75 || Utilities.obj_percent_hp(gnollxx09) <= 75 || Utilities.obj_percent_hp(ettinxx01) <= 75 || Utilities.obj_percent_hp(ettinxx02) <= 75 || Utilities.obj_percent_hp(ettinxx03) <= 75 || Utilities.obj_percent_hp(orcsham02) <= 75 || Utilities.obj_percent_hp(orcarch04) <= 75 || Utilities.obj_percent_hp(orcsnip03) <= 75 || Utilities.obj_percent_hp(orcbowm03) <= 75 || Utilities.obj_percent_hp(orcarch05) <= 75))
                        {
                            if ((GetGlobalVar(796) <= 17))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 474);
                                SetGlobalVar(796, GetGlobalVar(796) + 1);
                            }
                            else if ((GetGlobalVar(797) <= 1))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 537);
                                SetGlobalVar(797, GetGlobalVar(797) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 534);
                            }
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 543);
                        }
                    }
                }
            }
        }
        else if ((attachee.GetLeader() != null))
        {
            attachee.SetInt(obj_f.critter_strategy, 0);
        }

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

        // MELEE TROOPS  #
        // dumb guys - orc rundors, gnoll troops, ettin troops, stone giant troops, hill giant troops  #
        if ((attachee.GetNameId() == 8896 || attachee.GetNameId() == 8897 || attachee.GetNameId() == 8898 || attachee.GetNameId() == 8904 || attachee.GetNameId() == 8905 || attachee.GetNameId() == 8906 || attachee.GetNameId() == 8907 || attachee.GetNameId() == 8908 || attachee.GetNameId() == 8619 || attachee.GetNameId() == 8620 || attachee.GetNameId() == 8621))
        {
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 547);
                    }
                }
            }
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 546);
                    }
                }
            }
        }
        // dumb guys with rage - bugbear troops, orc fighters, ogre troops  #
        else if ((attachee.GetNameId() == 8911 || attachee.GetNameId() == 8614 || attachee.GetNameId() == 8615 || attachee.GetNameId() == 8618))
        {
            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);
                    }
                }
            }
        }
        // smart guys - kallop, boonthag, naig lliht  #
        else if ((attachee.GetNameId() == 8815 || attachee.GetNameId() == 8816 || attachee.GetNameId() == 8813))
        {
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 550);
                    }
                }
            }
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 546);
                    }
                }
            }
        }
        // smart guys with rage - hungous, orc trainer, ergo  #
        else if ((attachee.GetNameId() == 8803 || attachee.GetNameId() == 8922 || attachee.GetNameId() == 8814 || attachee.GetNameId() == 8617))
        {
            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, 558);
                    }
                }
            }
            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);
                    }
                }
            }
        }
        // mage seekers - krunch  #
        else if ((attachee.GetNameId() == 8802))
        {
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 548);
                    }
                }
            }
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 546);
                    }
                }
            }
        }
        // mage seekers with rage - orc murderer, orc dominator  #
        else if ((attachee.GetNameId() == 8895))
        {
            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);
                    }
                }
            }
        }
        // archery seekers - nobody atm  #
        // elif (attachee.name == xxxxx or attachee.name == xxxxx):
        // leader = attachee.leader_get()
        // if (group_percent_hp(leader) >= 51):
        // for obj in game.party[0].group_list():
        // if obj.d20_query(Q_Prone):
        // attachee.obj_set_int(obj_f_critter_strategy, 545)
        // else:
        // attachee.obj_set_int(obj_f_critter_strategy, 549)
        // elif (group_percent_hp(leader) <= 50):
        // for obj in game.party[0].group_list():
        // if obj.d20_query(Q_Prone):
        // attachee.obj_set_int(obj_f_critter_strategy, 545)
        // else:
        // attachee.obj_set_int(obj_f_critter_strategy, 546)
        // archery seekers with rage - orc sergeant, ruff  #
        else if ((attachee.GetNameId() == 8817 || attachee.GetNameId() == 8894))
        {
            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);
                    }
                }
            }
        }
        // flankers - nobody atm  #
        // elif (attachee.name == xxxxx):
        // leader = attachee.leader_get()
        // if (group_percent_hp(leader) >= 51):
        // for obj in game.party[0].group_list():
        // if obj.d20_query(Q_Prone):
        // attachee.obj_set_int(obj_f_critter_strategy, 545)
        // else:
        // attachee.obj_set_int(obj_f_critter_strategy, 556)
        // elif (group_percent_hp(leader) <= 50):
        // for obj in game.party[0].group_list():
        // if obj.d20_query(Q_Prone):
        // attachee.obj_set_int(obj_f_critter_strategy, 545)
        // else:
        // attachee.obj_set_int(obj_f_critter_strategy, 553)
        // flankers with rage - orc assassin  #
        else if ((attachee.GetNameId() == 8616))
        {
            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);
                    }
                }
            }
        }
        // concealed guys - ettins  #
        else if ((attachee.GetNameId() == 8912 || attachee.GetNameId() == 8913 || attachee.GetNameId() == 8914 || attachee.GetNameId() == 8915 || attachee.GetNameId() == 8916))
        {
            if ((Utilities.obj_percent_hp(attachee) <= 75))
            {
                attachee.SetInt(obj_f.critter_strategy, 547);
            }
            else if ((Utilities.obj_percent_hp(attachee) >= 76))
            {
                foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_PC))
                {
                    if ((is_close(attachee, obj)))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 547);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 565);
                    }
                }
            }
        }
        // RANGED TROOPS  #
        // dumb guys - orc bowmen  #
        else if ((attachee.GetNameId() == 8899 || attachee.GetNameId() == 8900 || attachee.GetNameId() == 8917 || attachee.GetNameId() == 8918))
        {
            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() == 8901 || attachee.GetNameId() == 8902 || attachee.GetNameId() == 8919))
        {
            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() == 8903))
        {
            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  #
        // elif (attachee.name == 14749):
        // for obj in game.party[0].group_list():
        // if (obj.stat_level_get(stat_level_wizard) >= 1 or obj.stat_level_get(stat_level_sorcerer) >= 1 or obj.stat_level_get(stat_level_druid) >= 1 or obj.stat_level_get(stat_level_bard) >= 1):
        // leader = attachee.leader_get()
        // if (group_percent_hp(leader) >= 34):
        // attachee.obj_set_int(obj_f_critter_strategy, 557)
        // elif (group_percent_hp(leader) <= 33):
        // attachee.obj_set_int(obj_f_critter_strategy, 553)
        // else:
        // leader = attachee.leader_get()
        // if (group_percent_hp(leader) >= 34):
        // attachee.obj_set_int(obj_f_critter_strategy, 554)
        // elif (group_percent_hp(leader) <= 33):
        // attachee.obj_set_int(obj_f_critter_strategy, 553)
        return(RunDefault);
    }
Exemple #7
0
    public bool OnStartCombat(GameObject attachee, GameObject triggerer, bool generated_from_timed_event_call)
    {
        if (attachee.GetBaseStat(Stat.dexterity) == -30)
        {
            // Beacon object - skip its turn in case it somehow survives
            attachee.Destroy();
            return(SkipDefault);
        }

        if (GetGlobalFlag(403) && GetGlobalFlag(405))
        {
            attachee.FloatMesFileLine("mes/script_activated.mes", 15, TextFloaterColor.Red);
        }

        var ggv400 = GetGlobalVar(400);
        var ggv401 = GetGlobalVar(401);
        var pad3   = attachee.GetInt(obj_f.npc_pad_i_3);

        if ((ggv400 & (1)) != 0)
        {
            if (attachee.IsUnconscious() && (pad3 & (2)) == 0)
            {
                // Troop knocked unconscious - mark him as such and increase the KOed counter
                pad3 |= 2;
                attachee.SetInt(obj_f.npc_pad_i_3, pad3);
                ggv401 += 1 << 7;
                SetGlobalVar(401, ggv401);
            }
            else if ((pad3 & (2)) != 0 && !attachee.IsUnconscious())
            {
                // Attachee has contributed to unconscious count, but is no longer unconscious
                // E.g. healed
                pad3 &= ~(2);
                if (((ggv401 >> 7) & 15) > 0)
                {
                    ggv401 -= (1 << 7);
                }

                attachee.SetInt(obj_f.npc_pad_i_3, pad3);
                SetGlobalVar(401, ggv401);
            }

            if ((new[] { 14074, 14075, 14076, 14077 }).Contains(attachee.GetNameId()))
            {
                // The "Call Lareth" section
                // Calculates how many troops are down etc. and decides whether to call Lareth
                GameObject seleucas     = null;
                GameObject lareth_sarge = null;
                foreach (var obj1 in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC))
                {
                    if (obj1.GetNameId() == 14077)
                    {
                        seleucas = obj1;
                    }
                    else if (obj1.GetNameId() == 14076)
                    {
                        lareth_sarge = obj1;
                    }
                }

                bool seleucas_down;
                if ((seleucas != null && seleucas.IsUnconscious()) || (ggv400 & (2)) != 0 || (seleucas.GetLeader() != null))
                {
                    seleucas_down = true;
                }
                else
                {
                    seleucas_down = false;
                }

                bool lareth_sarge_down;
                if ((lareth_sarge != null && lareth_sarge.IsUnconscious()))
                {
                    lareth_sarge_down = true;
                }
                else
                {
                    lareth_sarge_down = false;
                }

                var troops_down        = ((ggv401 >> 3) & 15) + ((ggv401 >> 7) & 15);
                var should_call_lareth = false;
                if (seleucas_down && (troops_down >= 2)) // Seleucas + 1 other troop
                {
                    should_call_lareth = true;
                }
                else if (seleucas_down && lareth_sarge_down) // Seleucas + Sergeant
                {
                    should_call_lareth = true;
                }
                else if (troops_down >= 2)
                {
                    should_call_lareth = true;
                }

                if (should_call_lareth)
                {
                    if ((ggv400 & (0x4 + (0x20))) == 0)
                    {
                        // Lareth has not been called upon
                        // And have not initiated combat with Lareth
                        if (seleucas_down && !attachee.IsUnconscious() && (attachee.GetLeader() == null))
                        {
                            // Seleucas is down - the soldier calls Lareth
                            var temppp = attachee.GetScriptId(ObjScriptEvent.Dialog);
                            attachee.SetScriptId(ObjScriptEvent.Dialog, 450);
                            attachee.FloatLine(15001, triggerer);
                            attachee.SetScriptId(ObjScriptEvent.Dialog, temppp);
                            ggv400 |= 0x4;
                            SetGlobalVar(400, ggv400);
                        }
                        else if (!seleucas_down)
                        {
                            // Seleucas is alive - Seleucas calls Lareth
                            seleucas.FloatLine(15000, triggerer);
                            ggv400 |= 0x4;
                            SetGlobalVar(400, ggv400);
                        }
                    }
                    else if ((ggv400 & 0x28) == 0)
                    {
                        var lareth = Utilities.find_npc_near(attachee, 8002);
                        if (lareth != null && !lareth.IsUnconscious())
                        {
                            // if can_see_party(lareth) == 0:
                            lareth.SetInt(obj_f.critter_strategy, 81);        // Lareth's "Join the Fray" strategy - start with shield of faith, then target hurt friendly, heal, and commence attack
                            lareth.SetScriptId(ObjScriptEvent.EndCombat, 60); // san_end_combat
                            lareth.Move(new locXY(476, 546), -60, 10);        // This is to decrease the chances of Lareth skipping his turn
                            var closest_party_member = SelectedPartyLeader;
                            foreach (var pcc in GameSystems.Party.PartyMembers)
                            {
                                if (pcc.DistanceTo(attachee) < closest_party_member.DistanceTo(attachee))
                                {
                                    closest_party_member = pcc;
                                }
                            }

                            lareth.CastSpell(WellKnownSpells.ShieldOfFaith, lareth);
                            lareth.Attack(closest_party_member);
                            var init_current = -100;
                            foreach (var pc in GameSystems.Party.PartyMembers)
                            {
                                if (pc.GetInitiative() < attachee.GetInitiative() && (pc.GetInitiative() - 2) > init_current)
                                {
                                    init_current = pc.GetInitiative() - 2;
                                }
                            }

                            lareth.SetInitiative(init_current); // make sure he gets to act on the same round
                            ggv400 |= 8;
                            SetGlobalVar(400, ggv400);
                        }
                    }
                }
            }

            if (attachee.GetLeader() != null && (pad3 & 0x4) == 0)
            {
                // Attachee charmed
                pad3 |= 0x4;
                attachee.SetInt(obj_f.npc_pad_i_3, pad3);
                ggv401 += (1 << 11);
                SetGlobalVar(401, ggv401);
            }
        }

        // Copied from script 310 :	#
        // THIS IS USED FOR BREAK FREE
        while ((attachee.FindItemByName(8903) != null))
        {
            attachee.FindItemByName(8903).Destroy();
        }

        if ((attachee.D20Query(D20DispatcherKey.QUE_Is_BreakFree_Possible))) // workaround no longer necessary!
        {
            return(RunDefault);
        }

        // create_item_in_inventory( 8903, attachee )
        // attachee.d20_send_signal(S_BreakFree)
        // Wake up from Sleep Scripting	#
        var a123 = attachee.ItemWornAt(EquipSlot.WeaponPrimary).GetInt(obj_f.weapon_type);

        if ((new[] { 14, 17, 46, 48, 68 }).Contains(a123)) // (Is archer)
        {
            // 14 - light crossbow
            // 17 - heavy crossbow
            // 46 - shortbow
            // 48 - longbow
            // 68 - repeating crossbow
            if (!generated_from_timed_event_call && !attachee.IsUnconscious() && !attachee.D20Query(D20DispatcherKey.QUE_Prone) && attachee.GetLeader() == null)
            {
                var player_in_obscuring_mist = 0;
                var grease_detected          = 0;
                var should_wake_up_comrade   = 0;
                // First, find closest party member - the most likely target for an archer
                var closest_pc_1 = SelectedPartyLeader;
                foreach (var pc in PartyLeader.GetPartyMembers())
                {
                    if (pc.DistanceTo(attachee) < closest_pc_1.DistanceTo(attachee))
                    {
                        closest_pc_1 = pc;
                    }
                }

                foreach (var spell_obj in ObjList.ListCone(closest_pc_1, ObjectListFilter.OLC_GENERIC, 30, 0, 360))
                {
                    // Check for active OBSCURING MIST spell objects
                    if (spell_obj.GetInt(obj_f.secretdoor_dc) == 333 + (1 << 15) && spell_obj.DistanceTo(closest_pc_1) <= 17.5f)
                    {
                        player_in_obscuring_mist = 1;
                    }
                }

                foreach (var spell_obj in ObjList.ListCone(closest_pc_1, ObjectListFilter.OLC_GENERIC, 40, 0, 360))
                {
                    // Check for active GREASE spell object
                    if (spell_obj.GetInt(obj_f.secretdoor_dc) == 200 + (1 << 15))
                    {
                        grease_detected = 1;
                        var grease_obj = spell_obj;
                    }
                }

                // Scripting for approaching sleeping friend
                if (player_in_obscuring_mist == 1 || RandomRange(0, 1) == 0)
                {
                    // Player staying back in Obscuring Mist - thus it's more useful to use the archer to wake someone up
                    // Otherwise, 50% chance
                    should_wake_up_comrade = 1;
                }

                if (closest_pc_1.DistanceTo(attachee) <= 8)
                {
                    // Player is close - Attachee will probably get hit trying to approach friend, so abort
                    should_wake_up_comrade = 0;
                }

                if (player_in_obscuring_mist == 1 && RandomRange(1, 12) == 1)
                {
                    // Player Cast Obscuring Mist -
                    // Float a comment about not being able to see the player (1 in 12 chance)
                    if (attachee.GetScriptId(ObjScriptEvent.Dialog) == 0)
                    {
                        attachee.SetScriptId(ObjScriptEvent.Dialog, 450);
                    }

                    attachee.FloatLine(16520 + RandomRange(0, 2), attachee);
                }
            }
        }
        else
        {
            Livonya.tag_strategy(attachee);
            if ((new[] { 37, 41, 43, 44, 61 }).Contains(a123))
            {
                // Reach Weapons
            }
            else
            {
                SetGlobalVar(499, 19);
                Livonya.get_melee_strategy(attachee);
            }
        }

        // Spiritual Weapon Shenanigens	#
        CombatStandardRoutines.Spiritual_Weapon_Begone(attachee);
        return(RunDefault);
    }
Exemple #8
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        var webbed = Livonya.break_free(attachee, 3);

        if ((attachee != null && !Utilities.critter_is_unconscious(attachee) && !attachee.D20Query(D20DispatcherKey.QUE_Prone) && attachee.GetLeader() == null))
        {
            if ((attachee.GetNameId() == 8962 || attachee.GetNameId() == 8964))
            {
                if ((Utilities.obj_percent_hp(attachee) <= 75))
                {
                    if ((attachee.GetNameId() == 8962))
                    {
                        // hb ravine central 1
                        if ((GetGlobalVar(798) <= 15))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 542);
                            SetGlobalVar(798, GetGlobalVar(798) + 1);
                        }
                        else if ((GetGlobalVar(799) <= 3))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 538);
                            SetGlobalVar(799, GetGlobalVar(799) + 1);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 536);
                        }
                    }
                    else if ((attachee.GetNameId() == 8964))
                    {
                        // hb ravine central 2
                        if ((GetGlobalVar(800) <= 15))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 542);
                            SetGlobalVar(800, GetGlobalVar(800) + 1);
                        }
                        else if ((GetGlobalVar(801) <= 3))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 538);
                            SetGlobalVar(801, GetGlobalVar(801) + 1);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 536);
                        }
                    }
                }
                else if ((Utilities.obj_percent_hp(attachee) >= 76))
                {
                    if ((attachee.GetNameId() == 8962))
                    {
                        // hb ravine central 1
                        var bugbear05 = Utilities.find_npc_near(attachee, 8940);
                        var orcserg01 = Utilities.find_npc_near(attachee, 8941);
                        var orcfigh01 = Utilities.find_npc_near(attachee, 8942);
                        var orcfigh02 = Utilities.find_npc_near(attachee, 8943);
                        var orcfigh03 = Utilities.find_npc_near(attachee, 8944);
                        var orcmurd01 = Utilities.find_npc_near(attachee, 8945);
                        var orcdomi01 = Utilities.find_npc_near(attachee, 8946);
                        var orcfigh04 = Utilities.find_npc_near(attachee, 8947);
                        var orcfigh05 = Utilities.find_npc_near(attachee, 8948);
                        var orcrund01 = Utilities.find_npc_near(attachee, 8949);
                        var stogian01 = Utilities.find_npc_near(attachee, 8972);
                        var hilgian01 = Utilities.find_npc_near(attachee, 8973);
                        var stogian02 = Utilities.find_npc_near(attachee, 8974);
                        var orctheu02 = Utilities.find_npc_near(attachee, 8964);
                        var orcarch03 = Utilities.find_npc_near(attachee, 8984);
                        var orcbowm02 = Utilities.find_npc_near(attachee, 8986);
                        var orcmark02 = Utilities.find_npc_near(attachee, 8988);
                        var orcsnip04 = Utilities.find_npc_near(attachee, 8990);
                        if ((Utilities.obj_percent_hp(bugbear05) <= 75 || Utilities.obj_percent_hp(orcserg01) <= 75 || Utilities.obj_percent_hp(orcfigh01) <= 75 || Utilities.obj_percent_hp(orcfigh02) <= 75 || Utilities.obj_percent_hp(orcfigh03) <= 75 || Utilities.obj_percent_hp(orcmurd01) <= 75 || Utilities.obj_percent_hp(orcdomi01) <= 75 || Utilities.obj_percent_hp(orcfigh04) <= 75 || Utilities.obj_percent_hp(orcfigh05) <= 75 || Utilities.obj_percent_hp(orcrund01) <= 75 || Utilities.obj_percent_hp(stogian01) <= 75 || Utilities.obj_percent_hp(hilgian01) <= 75 || Utilities.obj_percent_hp(stogian02) <= 75 || Utilities.obj_percent_hp(orctheu02) <= 75 || Utilities.obj_percent_hp(orcarch03) <= 75 || Utilities.obj_percent_hp(orcbowm02) <= 75 || Utilities.obj_percent_hp(orcmark02) <= 75 || Utilities.obj_percent_hp(orcsnip04) <= 75))
                        {
                            if ((GetGlobalVar(798) <= 15))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 476);
                                SetGlobalVar(798, GetGlobalVar(798) + 1);
                            }
                            else if ((GetGlobalVar(799) <= 3))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 538);
                                SetGlobalVar(799, GetGlobalVar(799) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 536);
                            }
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 544);
                        }
                    }
                    else if ((attachee.GetNameId() == 8964))
                    {
                        // hb ravine central 2
                        var bugbear05 = Utilities.find_npc_near(attachee, 8940);
                        var orcserg01 = Utilities.find_npc_near(attachee, 8941);
                        var orcfigh01 = Utilities.find_npc_near(attachee, 8942);
                        var orcfigh02 = Utilities.find_npc_near(attachee, 8943);
                        var orcfigh03 = Utilities.find_npc_near(attachee, 8944);
                        var orcmurd01 = Utilities.find_npc_near(attachee, 8945);
                        var orcdomi01 = Utilities.find_npc_near(attachee, 8946);
                        var orcfigh04 = Utilities.find_npc_near(attachee, 8947);
                        var orcfigh05 = Utilities.find_npc_near(attachee, 8948);
                        var orcrund01 = Utilities.find_npc_near(attachee, 8949);
                        var stogian01 = Utilities.find_npc_near(attachee, 8972);
                        var hilgian01 = Utilities.find_npc_near(attachee, 8973);
                        var stogian02 = Utilities.find_npc_near(attachee, 8974);
                        var orctheu01 = Utilities.find_npc_near(attachee, 8962);
                        var orcarch03 = Utilities.find_npc_near(attachee, 8984);
                        var orcbowm02 = Utilities.find_npc_near(attachee, 8986);
                        var orcmark02 = Utilities.find_npc_near(attachee, 8988);
                        var orcsnip04 = Utilities.find_npc_near(attachee, 8990);
                        if ((Utilities.obj_percent_hp(bugbear05) <= 75 || Utilities.obj_percent_hp(orcserg01) <= 75 || Utilities.obj_percent_hp(orcfigh01) <= 75 || Utilities.obj_percent_hp(orcfigh02) <= 75 || Utilities.obj_percent_hp(orcfigh03) <= 75 || Utilities.obj_percent_hp(orcmurd01) <= 75 || Utilities.obj_percent_hp(orcdomi01) <= 75 || Utilities.obj_percent_hp(orcfigh04) <= 75 || Utilities.obj_percent_hp(orcfigh05) <= 75 || Utilities.obj_percent_hp(orcrund01) <= 75 || Utilities.obj_percent_hp(stogian01) <= 75 || Utilities.obj_percent_hp(hilgian01) <= 75 || Utilities.obj_percent_hp(stogian02) <= 75 || Utilities.obj_percent_hp(orctheu01) <= 75 || Utilities.obj_percent_hp(orcarch03) <= 75 || Utilities.obj_percent_hp(orcbowm02) <= 75 || Utilities.obj_percent_hp(orcmark02) <= 75 || Utilities.obj_percent_hp(orcsnip04) <= 75))
                        {
                            if ((GetGlobalVar(800) <= 15))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 476);
                                SetGlobalVar(800, GetGlobalVar(800) + 1);
                            }
                            else if ((GetGlobalVar(801) <= 3))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 538);
                                SetGlobalVar(801, GetGlobalVar(801) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 536);
                            }
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 544);
                        }
                    }
                }
            }
            else if ((attachee.GetNameId() == 8998 || attachee.GetNameId() == 9000))
            {
                if ((Utilities.obj_percent_hp(attachee) <= 75))
                {
                    if ((attachee.GetNameId() == 8998))
                    {
                        // hb pit west 1
                        if ((GetGlobalVar(803) <= 15))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 542);
                            SetGlobalVar(803, GetGlobalVar(803) + 1);
                        }
                        else if ((GetGlobalVar(804) <= 3))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 538);
                            SetGlobalVar(804, GetGlobalVar(804) + 1);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 536);
                        }
                    }
                    else if ((attachee.GetNameId() == 9000))
                    {
                        // hb pit east 1
                        if ((GetGlobalVar(805) <= 15))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 542);
                            SetGlobalVar(805, GetGlobalVar(805) + 1);
                        }
                        else if ((GetGlobalVar(806) <= 3))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 538);
                            SetGlobalVar(806, GetGlobalVar(806) + 1);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 536);
                        }
                    }
                }
                else if ((Utilities.obj_percent_hp(attachee) >= 76))
                {
                    if ((attachee.GetNameId() == 8998))
                    {
                        // hb pit west 1
                        var orcmurd01 = Utilities.find_npc_near(attachee, 8992);
                        var orcserg01 = Utilities.find_npc_near(attachee, 8993);
                        var ogrexxx01 = Utilities.find_npc_near(attachee, 8994);
                        var orcsnip01 = Utilities.find_npc_near(attachee, 8995);
                        var orcsnip02 = Utilities.find_npc_near(attachee, 8996);
                        var orcmark01 = Utilities.find_npc_near(attachee, 8997);
                        if ((Utilities.obj_percent_hp(orcmurd01) <= 75 || Utilities.obj_percent_hp(orcserg01) <= 75 || Utilities.obj_percent_hp(ogrexxx01) <= 75 || Utilities.obj_percent_hp(orcsnip01) <= 75 || Utilities.obj_percent_hp(orcsnip02) <= 75 || Utilities.obj_percent_hp(orcmark01) <= 75))
                        {
                            if ((GetGlobalVar(803) <= 15))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 476);
                                SetGlobalVar(803, GetGlobalVar(803) + 1);
                            }
                            else if ((GetGlobalVar(804) <= 3))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 538);
                                SetGlobalVar(804, GetGlobalVar(804) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 536);
                            }
                        }
                        else
                        {
                            if ((GetGlobalVar(804) <= 3))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 538);
                                SetGlobalVar(804, GetGlobalVar(804) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 544);
                            }
                        }
                    }
                    else if ((attachee.GetNameId() == 9000))
                    {
                        // hb pit east 1
                        var orcassa01 = Utilities.find_npc_near(attachee, 8999);
                        var orcfigh01 = Utilities.find_npc_near(attachee, 8601);
                        var orcfigh02 = Utilities.find_npc_near(attachee, 8602);
                        var orcfigh03 = Utilities.find_npc_near(attachee, 8603);
                        var orcfigh04 = Utilities.find_npc_near(attachee, 8604);
                        var orcfigh05 = Utilities.find_npc_near(attachee, 8605);
                        var orcfigh06 = Utilities.find_npc_near(attachee, 8606);
                        var orcsnip01 = Utilities.find_npc_near(attachee, 8607);
                        var orcsnip02 = Utilities.find_npc_near(attachee, 8608);
                        var orcmark01 = Utilities.find_npc_near(attachee, 8609);
                        if ((Utilities.obj_percent_hp(orcassa01) <= 75 || Utilities.obj_percent_hp(orcfigh01) <= 75 || Utilities.obj_percent_hp(orcfigh02) <= 75 || Utilities.obj_percent_hp(orcfigh03) <= 75 || Utilities.obj_percent_hp(orcfigh04) <= 75 || Utilities.obj_percent_hp(orcfigh05) <= 75 || Utilities.obj_percent_hp(orcfigh06) <= 75 || Utilities.obj_percent_hp(orcsnip01) <= 75 || Utilities.obj_percent_hp(orcsnip02) <= 75 || Utilities.obj_percent_hp(orcmark01) <= 75))
                        {
                            if ((GetGlobalVar(805) <= 15))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 476);
                                SetGlobalVar(805, GetGlobalVar(805) + 1);
                            }
                            else if ((GetGlobalVar(806) <= 3))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 538);
                                SetGlobalVar(806, GetGlobalVar(806) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 536);
                            }
                        }
                        else
                        {
                            if ((GetGlobalVar(806) <= 3))
                            {
                                attachee.SetInt(obj_f.critter_strategy, 538);
                                SetGlobalVar(806, GetGlobalVar(806) + 1);
                            }
                            else
                            {
                                attachee.SetInt(obj_f.critter_strategy, 544);
                            }
                        }
                    }
                }
            }
            else if ((attachee.GetNameId() == 8624))
            {
                // hb cave west
                if ((Utilities.obj_percent_hp(attachee) <= 75))
                {
                    if ((GetGlobalVar(807) <= 15))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 542);
                        SetGlobalVar(807, GetGlobalVar(807) + 1);
                    }
                    else if ((GetGlobalVar(808) <= 3))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 538);
                        SetGlobalVar(808, GetGlobalVar(808) + 1);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 536);
                    }
                }
                else if ((Utilities.obj_percent_hp(attachee) >= 76))
                {
                    var orcwarl01 = Utilities.find_npc_near(attachee, 8626);
                    var orcwitc01 = Utilities.find_npc_near(attachee, 8627);
                    var orcmark01 = Utilities.find_npc_near(attachee, 8628);
                    var orcmark02 = Utilities.find_npc_near(attachee, 8629);
                    var orcsnip01 = Utilities.find_npc_near(attachee, 8630);
                    var orcsnip02 = Utilities.find_npc_near(attachee, 8631);
                    if ((Utilities.obj_percent_hp(orcwarl01) <= 75 || Utilities.obj_percent_hp(orcwitc01) <= 75 || Utilities.obj_percent_hp(orcmark01) <= 75 || Utilities.obj_percent_hp(orcmark02) <= 75 || Utilities.obj_percent_hp(orcsnip01) <= 75 || Utilities.obj_percent_hp(orcsnip02) <= 75))
                    {
                        if ((GetGlobalVar(807) <= 15))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 476);
                            SetGlobalVar(807, GetGlobalVar(807) + 1);
                        }
                        else if ((GetGlobalVar(808) <= 3))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 538);
                            SetGlobalVar(808, GetGlobalVar(808) + 1);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 536);
                        }
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 544);
                    }
                }
            }
            else if ((attachee.GetNameId() == 8625))
            {
                // hb cave east
                if ((Utilities.obj_percent_hp(attachee) <= 75))
                {
                    if ((GetGlobalVar(809) <= 15))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 542);
                        SetGlobalVar(809, GetGlobalVar(809) + 1);
                    }
                    else if ((GetGlobalVar(810) <= 3))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 538);
                        SetGlobalVar(810, GetGlobalVar(810) + 1);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 536);
                    }
                }
                else if ((Utilities.obj_percent_hp(attachee) >= 76))
                {
                    var orcfigh01 = Utilities.find_npc_near(attachee, 8632);
                    var orcfigh02 = Utilities.find_npc_near(attachee, 8633);
                    var gnollxx01 = Utilities.find_npc_near(attachee, 8634);
                    var bugbear01 = Utilities.find_npc_near(attachee, 8635);
                    var boonthagx = Utilities.find_npc_near(attachee, 8816);
                    var kallopxxx = Utilities.find_npc_near(attachee, 8815);
                    var ergoxxxxx = Utilities.find_npc_near(attachee, 8814);
                    var naiglliht = Utilities.find_npc_near(attachee, 8813);
                    var hungousxx = Utilities.find_npc_near(attachee, 8803);
                    var krunchxxx = Utilities.find_npc_near(attachee, 8802);
                    var ruffxxxxx = Utilities.find_npc_near(attachee, 8817);
                    if ((Utilities.obj_percent_hp(orcfigh01) <= 75 || Utilities.obj_percent_hp(orcfigh02) <= 75 || Utilities.obj_percent_hp(gnollxx01) <= 75 || Utilities.obj_percent_hp(bugbear01) <= 75 || Utilities.obj_percent_hp(boonthagx) <= 75 || Utilities.obj_percent_hp(kallopxxx) <= 75 || Utilities.obj_percent_hp(ergoxxxxx) <= 75 || Utilities.obj_percent_hp(naiglliht) <= 75 || Utilities.obj_percent_hp(hungousxx) <= 75 || Utilities.obj_percent_hp(krunchxxx) <= 75 || Utilities.obj_percent_hp(ruffxxxxx) <= 75))
                    {
                        if ((GetGlobalVar(809) <= 15))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 476);
                            SetGlobalVar(809, GetGlobalVar(809) + 1);
                        }
                        else if ((GetGlobalVar(810) <= 3))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 538);
                            SetGlobalVar(810, GetGlobalVar(810) + 1);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 536);
                        }
                    }
                    else
                    {
                        if ((GetGlobalVar(810) <= 3))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 538);
                            SetGlobalVar(810, GetGlobalVar(810) + 1);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 544);
                        }
                    }
                }
            }
        }
        else if ((attachee.GetLeader() != null))
        {
            attachee.SetInt(obj_f.critter_strategy, 0);
        }

        return(RunDefault);
    }
Exemple #9
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        var webbed = Livonya.break_free(attachee, 3);

        if ((GetGlobalVar(785) == 1))
        {
            attachee.SetInt(obj_f.critter_strategy, 516);
        }
        else if ((GetGlobalVar(785) == 2))
        {
            attachee.SetInt(obj_f.critter_strategy, 517);
        }
        else if ((GetGlobalVar(785) == 3))
        {
            attachee.SetInt(obj_f.critter_strategy, 518);
        }
        else if ((GetGlobalVar(785) == 4))
        {
            attachee.SetInt(obj_f.critter_strategy, 519);
        }
        else if ((GetGlobalVar(785) == 5))
        {
            attachee.SetInt(obj_f.critter_strategy, 520);
        }
        else if ((GetGlobalVar(785) == 6))
        {
            attachee.SetInt(obj_f.critter_strategy, 521);
        }
        else if ((GetGlobalVar(785) == 7))
        {
            attachee.SetInt(obj_f.critter_strategy, 522);
        }
        else if ((GetGlobalVar(785) == 8))
        {
            attachee.SetInt(obj_f.critter_strategy, 523);
        }
        else if ((GetGlobalVar(785) == 9))
        {
            attachee.SetInt(obj_f.critter_strategy, 524);
        }
        else if ((GetGlobalVar(785) == 10))
        {
            attachee.SetInt(obj_f.critter_strategy, 525);
        }
        else if ((GetGlobalVar(785) == 11))
        {
            attachee.SetInt(obj_f.critter_strategy, 526);
        }
        else if ((GetGlobalVar(785) == 12))
        {
            attachee.SetInt(obj_f.critter_strategy, 527);
        }
        else if ((GetGlobalVar(785) == 13))
        {
            attachee.SetInt(obj_f.critter_strategy, 528);
        }
        else if ((GetGlobalVar(785) == 14))
        {
            attachee.SetInt(obj_f.critter_strategy, 529);
        }
        else if ((GetGlobalVar(785) == 15))
        {
            attachee.SetInt(obj_f.critter_strategy, 530);
        }
        else if ((GetGlobalVar(785) == 16))
        {
            attachee.SetInt(obj_f.critter_strategy, 531);
        }
        else if ((GetGlobalVar(785) >= 17))
        {
            attachee.SetInt(obj_f.critter_strategy, 532);
        }

        return(RunDefault);
    }
Exemple #10
0
    public override bool OnEnterCombat(GameObject attachee, GameObject triggerer)
    {
        if (GetGlobalFlag(403) && GetGlobalFlag(405))
        {
            attachee.FloatMesFileLine("mes/script_activated.mes", 13, TextFloaterColor.Red);
        }

        if (attachee.GetNameId() == 14077) // Seleucas
        {
            var ggv400 = GetGlobalVar(400);
            var ggv403 = GetGlobalVar(403);
            ggv400 = ggv400 | (1);   // indicate that you have entered combat with Seleucas' group
            SetGlobalVar(400, ggv400);
            if ((ggv403 & (2)) != 0) // Moathouse regroup scenario; Seleucas is warned by guard of approaching party
            {
                ggv403 |= 0x4;
                SetGlobalVar(403, ggv403);
            }

            attachee.RemoveScript(ObjScriptEvent.Heartbeat); // His heartbeat script - disabled, in case hostilies momentarily cease / fight ends with him charmed
            if (GetGlobalFlag(403) && GetGlobalFlag(405))
            {
                SelectedPartyLeader.FloatMesFileLine("mes/script_activated.mes", 10001, TextFloaterColor.Red);
            }
        }
        else if (attachee.GetNameId() == 14074)
        {
            var pad3 = attachee.GetInt(obj_f.npc_pad_i_3);
            if ((pad3 & (0x40)) != 0)
            {
                attachee.FloatLine(15002, triggerer);
                attachee.RemoveScript(ObjScriptEvent.Dialog);
                pad3 ^= 0x40;
                attachee.SetInt(obj_f.npc_pad_i_3, pad3);
            }
        }

        var a123 = attachee.ItemWornAt(EquipSlot.WeaponPrimary).GetInt(obj_f.weapon_type);

        if ((new[] { 14, 17, 46, 48, 68 }).Contains(a123))
        {
            // 14 - light crossbow
            // 17 - heavy crossbow
            // 46 - shortbow
            // 48 - longbow
            // 68 - repeating crossbow
            var dummy = 1;
        }
        else
        {
            Livonya.tag_strategy(attachee);
            if ((new[] { 37, 41, 43, 44, 61 }).Contains(a123))
            {
                // Reach Weapons
            }
            else
            {
                Livonya.get_melee_strategy(attachee);
            }
        }

        return(RunDefault);
    }
    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);
    }
Exemple #12
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        var webbed = Livonya.break_free(attachee, 3);

        // MELEE TROOPS  #
        // dumb guys - ettin troops, stone giant troops, hill giant troops, gnoll troops, orc rundors  #
        if ((attachee.GetNameId() == 14985 || attachee.GetNameId() == 14986 || attachee.GetNameId() == 14988 || attachee.GetNameId() == 14475 || attachee.GetNameId() == 8610 || attachee.GetNameId() == 8611 || attachee.GetNameId() == 8612))
        {
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 547);
                    }
                }
            }
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 546);
                    }
                }
            }
        }
        // dumb guys with rage - bugbear troops, ogre troops  #
        else if ((attachee.GetNameId() == 14476 || attachee.GetNameId() == 14990))
        {
            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);
                    }
                }
            }
        }
        // RANGED TROOPS  #
        // dumb guys - orc bowmen  #
        else if ((attachee.GetNameId() == 14467))
        {
            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() == 14746))
        {
            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() == 14748))
        {
            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);
            }
        }

        return(RunDefault);
    }
Exemple #13
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);
    }
Exemple #14
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        var webbed = Livonya.break_free(attachee, 3);

        // MELEE TROOPS  #
        // dumb guys - gnoll troops, kallop, boonthag, naig lliht  #
        if ((attachee.GetNameId() == 8634 || attachee.GetNameId() == 8815 || attachee.GetNameId() == 8816 || attachee.GetNameId() == 8813))
        {
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 547);
                    }
                }
            }
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 546);
                    }
                }
            }
        }
        // dumb guys with rage - bugbear troops, orc fighters, hungous, ergo  #
        else if ((attachee.GetNameId() == 8632 || attachee.GetNameId() == 8633 || attachee.GetNameId() == 8635 || attachee.GetNameId() == 8803 || attachee.GetNameId() == 8814))
        {
            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);
                    }
                }
            }
        }
        // smart guys  - might be a bum strategy, too much running around  #
        // elif (attachee.name == xxxx):
        // leader = attachee.leader_get()
        // if (group_percent_hp(leader) >= 51):
        // for obj in game.party[0].group_list():
        // if obj.d20_query(Q_Prone):
        // attachee.obj_set_int(obj_f_critter_strategy, 545)
        // else:
        // attachee.obj_set_int(obj_f_critter_strategy, 550)
        // elif (group_percent_hp(leader) <= 50):
        // for obj in game.party[0].group_list():
        // if obj.d20_query(Q_Prone):
        // attachee.obj_set_int(obj_f_critter_strategy, 545)
        // else:
        // attachee.obj_set_int(obj_f_critter_strategy, 546)
        // smart guys with rage - might be a bum strategy, too much running around  #
        // elif (attachee.name == xxxx):
        // leader = attachee.leader_get()
        // if (group_percent_hp(leader) >= 51):
        // for obj in game.party[0].group_list():
        // if obj.d20_query(Q_Prone):
        // attachee.obj_set_int(obj_f_critter_strategy, 560)
        // else:
        // attachee.obj_set_int(obj_f_critter_strategy, 558)
        // elif (group_percent_hp(leader) <= 50):
        // for obj in game.party[0].group_list():
        // if obj.d20_query(Q_Prone):
        // attachee.obj_set_int(obj_f_critter_strategy, 560)
        // else:
        // attachee.obj_set_int(obj_f_critter_strategy, 561)
        // mage seekers - krunch  #
        else if ((attachee.GetNameId() == 8802))
        {
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 548);
                    }
                }
            }
            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, 545);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 546);
                    }
                }
            }
        }
        // archery seekers with rage - ruff  #
        else if ((attachee.GetNameId() == 8817))
        {
            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);
                    }
                }
            }
        }
        // RANGED TROOPS  #
        // mage seekers - orc snipers  #
        else if ((attachee.GetNameId() == 8630 || attachee.GetNameId() == 8631))
        {
            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);
            }
        }
        // spell responders - orc marksmen  #
        else if ((attachee.GetNameId() == 8628 || attachee.GetNameId() == 8629))
        {
            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);
                    }
                }
            }
        }

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

        if ((Utilities.obj_percent_hp(attachee) >= 51))
        {
            if ((GetGlobalVar(783) == 1))
            {
                attachee.SetInt(obj_f.critter_strategy, 479);
            }
            else if ((GetGlobalVar(783) == 2))
            {
                attachee.SetInt(obj_f.critter_strategy, 480);
            }
            else if ((GetGlobalVar(783) == 3))
            {
                attachee.SetInt(obj_f.critter_strategy, 481);
            }
            else if ((GetGlobalVar(783) == 4))
            {
                attachee.SetInt(obj_f.critter_strategy, 482);
            }
            else if ((GetGlobalVar(783) == 5))
            {
                attachee.SetInt(obj_f.critter_strategy, 483);
            }
            else if ((GetGlobalVar(783) == 6))
            {
                attachee.SetInt(obj_f.critter_strategy, 484);
            }
            else if ((GetGlobalVar(783) == 7))
            {
                attachee.SetInt(obj_f.critter_strategy, 485);
            }
            else if ((GetGlobalVar(783) == 8))
            {
                attachee.SetInt(obj_f.critter_strategy, 486);
            }
            else if ((GetGlobalVar(783) == 9))
            {
                attachee.SetInt(obj_f.critter_strategy, 487);
            }
            else if ((GetGlobalVar(783) == 10))
            {
                attachee.SetInt(obj_f.critter_strategy, 488);
            }
            else if ((GetGlobalVar(783) == 11))
            {
                attachee.SetInt(obj_f.critter_strategy, 489);
            }
            else if ((GetGlobalVar(783) == 12))
            {
                attachee.SetInt(obj_f.critter_strategy, 490);
            }
            else if ((GetGlobalVar(783) == 13))
            {
                attachee.SetInt(obj_f.critter_strategy, 491);
            }
            else if ((GetGlobalVar(783) == 14))
            {
                attachee.SetInt(obj_f.critter_strategy, 492);
            }
            else if ((GetGlobalVar(783) == 15))
            {
                attachee.SetInt(obj_f.critter_strategy, 493);
            }
            else if ((GetGlobalVar(783) == 16))
            {
                attachee.SetInt(obj_f.critter_strategy, 494);
            }
            else if ((GetGlobalVar(783) == 17))
            {
                attachee.SetInt(obj_f.critter_strategy, 495);
            }
            else if ((GetGlobalVar(783) == 18))
            {
                attachee.SetInt(obj_f.critter_strategy, 496);
            }
            else if ((GetGlobalVar(783) == 19))
            {
                attachee.SetInt(obj_f.critter_strategy, 497);
            }
            else if ((GetGlobalVar(783) >= 20))
            {
                attachee.SetInt(obj_f.critter_strategy, 478);
            }
        }
        else if ((Utilities.obj_percent_hp(attachee) <= 50))
        {
            if ((GetGlobalVar(783) == 19))
            {
                attachee.SetInt(obj_f.critter_strategy, 497);
            }
            else if ((GetGlobalVar(783) == 20))
            {
                attachee.SetInt(obj_f.critter_strategy, 478);
            }
            else if ((GetGlobalVar(783) != 20))
            {
                attachee.SetInt(obj_f.critter_strategy, 486);
            }
        }

        AttachParticles("Trap-Spores", attachee);
        var fx = RandomRange(1, 3);

        if ((fx == 1))
        {
            Sound(4167, 1);
        }
        else if ((fx == 2))
        {
            Sound(4168, 1);
        }
        else if ((fx == 3))
        {
            Sound(4169, 1);
        }

        return(RunDefault);
    }