示例#1
0
    // see batch.py; imports preference from speedup.ini

    public static void t_mode()
    {
        SetGlobalFlag(403, Co8Settings.TestModeEnabled);
        ScriptDaemon.set_f("qs_disable_random_encounters", Co8Settings.RandomEncountersDisabled);
        ScriptDaemon.set_f("qs_autoloot", Co8Settings.QuickstartAutolootEnabled);
        ScriptDaemon.set_f("qs_autoconvert_jewels", Co8Settings.QuickstartAutolootAutoConvertJewels);
    }
示例#2
0
 public static bool set_sport_encounter_4()
 {
     QueueRandomEncounter(3444);
     ScriptDaemon.set_f("s_sport_4_scheduled");
     SetGlobalVar(564, 1);
     return(RunDefault);
 }
示例#3
0
 public static bool return_Zuggtmoy(GameObject attachee, GameObject triggerer)
 {
     if ((!GetGlobalFlag(188) && !GetGlobalFlag(189)))
     {
         ScriptDaemon.set_f("s_zuggtmoy_gone");
         // play banishment movie
         Fade(0, 0, 301, 0);
         // play slides and end game or go to verbo
         if ((GetGlobalFlag(500)))
         {
             Utilities.set_end_slides_nc(attachee, triggerer);
             GameSystems.Movies.MovieQueuePlay();
             MakeAreaKnown(14);
             StartTimer(1500, () => go_to_verbobonc());
             return(RunDefault);
         }
         else
         {
             Utilities.set_end_slides(attachee, triggerer);
             GameSystems.Movies.MovieQueuePlayAndEndGame();
             return(SkipDefault);
         }
     }
     return(SkipDefault);
 }
示例#4
0
    public override bool OnDying(GameObject attachee, GameObject triggerer)
    {
        if (CombatStandardRoutines.should_modify_CR(attachee))
        {
            CombatStandardRoutines.modify_CR(attachee, CombatStandardRoutines.get_av_level());
        }

        SetGlobalFlag(202, false);
        ScriptDaemon.set_f("skole_dead");
        return(RunDefault);
    }
示例#5
0
    public void ApplySideEffect(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
        case 3:
        case 51:
        case 63:
        case 64:
        case 91:
        case 92:
        case 125:
        case 126:
        case 133:
        case 134:
        case 143:
        case 144:
            originalScript = "npc.attack( pc )";
            npc.Attack(pc);
            break;

        case 60:
        case 130:
        case 180:
        case 190:
            originalScript = "game.global_flags[108] = 1";
            SetGlobalFlag(108, true);
            break;

        case 70:
            originalScript = "game.global_flags[172] = 1";
            SetGlobalFlag(172, true);
            break;

        case 171:
        case 172:
        case 231:
        case 232:
            originalScript = "pc.money_adj(-50000)";
            pc.AdjustMoney(-50000);
            break;

        case 1020:
        case 1030:
            originalScript = "set_f('realized_grurz_new_situation')";
            ScriptDaemon.set_f("realized_grurz_new_situation");
            break;

        default:
            originalScript = null;
            return;
        }
    }
示例#6
0
    public static bool goons_attack(GameObject attachee)
    {
        if (GetQuestState(42) != QuestState.Completed && !ScriptDaemon.get_f("s_skole_goons_scheduled") && !ScriptDaemon.get_f("skole_dead"))
        {
            ScriptDaemon.set_f("s_skole_goons_scheduled");
            SetQuestState(42, QuestState.Botched);
            SetGlobalFlag(202, true);
            QueueRandomEncounter(3004);
        }

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

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

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

            var y_ghoul = yyp_max + 18;
            y_ghoul = Math.Min(603, y_ghoul);
            var y_ghoul_add   = new[] { 0, 0, 2, 2, -2 };
            var x_ghoul_add   = new[] { 0, 2, 0, 2, 0 };
            var x_ghoul       = 433;
            var ghoul_counter = 0;
            foreach (var npc in ObjList.ListVicinity(new locXY(463, 603), ObjectListFilter.OLC_NPC))
            {
                if (npc.GetNameId() == 14129 && npc.GetLeader() == null && !npc.IsUnconscious())
                {
                    npc.Move(new locXY(x_ghoul + x_ghoul_add[ghoul_counter], y_ghoul + y_ghoul_add[ghoul_counter]), 0, 0);
                    ghoul_counter += 1;
                    npc.Attack(SelectedPartyLeader);
                }
            }
        }
    }
示例#8
0
    public static void spawn_grate_object()
    {
        if (!ScriptDaemon.get_f("harpy_grate"))
        {
            var should_drop_grate = false;
            foreach (var pc in PartyLeader.GetPartyMembers())
            {
                var(xx, yy) = pc.GetLocation();
                if (xx <= 415 && yy < 580 && yy > 500)
                {
                    should_drop_grate = true;
                }

                if (should_drop_grate)
                {
                    ScriptDaemon.set_f("harpy_grate");
                    GameObject grate_obj = null;
                    foreach (var obj in ObjList.ListVicinity(new locXY(415, 556), ObjectListFilter.OLC_PORTAL))
                    {
                        if (obj.GetNameId() == 120)
                        {
                            grate_obj = obj;
                        }
                    }

                    if (grate_obj == null)
                    {
                        grate_obj = GameSystems.MapObject.CreateObject(120, new locXY(415, 556));
                        grate_obj.Move(new locXY(415, 556), 0, 11f);
                        grate_obj.Rotation = 1.57f * 3 / 2;
                        grate_obj.SetPortalFlag(PortalFlag.JAMMED);
                        grate_obj.SetObjectFlag(ObjectFlag.SHOOT_THROUGH);
                        grate_obj.SetObjectFlag(ObjectFlag.SEE_THROUGH);
                        grate_obj.SetObjectFlag(ObjectFlag.CLICK_THROUGH);
                        grate_obj.SetObjectFlag(ObjectFlag.TRANSLUCENT);
                        grate_obj.SetObjectFlag(ObjectFlag.NO_BLOCK);
                        grate_obj.SetObjectFlag(ObjectFlag.NOHEIGHT);
                    }

                    // game.timevent_add( grate_npc_timed_event, (  ), 250, 1 )
                    AttachParticles("Orb-Summon-Earth Elemental", grate_obj);
                    GameSystems.Scroll.ShakeScreen(50, 500);
                    Sound(4180, 1);
                }
            }
        }
    }
示例#9
0
    public static bool evac(GameObject attachee)
    {
        ScriptDaemon.set_f("boatmens_tavern_evac_on");
        attachee.SetScriptId(ObjScriptEvent.FirstHeartbeat, 117); // san_first_heartbeat
        foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC))
        {
            if ((obj.GetLeader() == null))
            {
                if ((obj.GetNameId() == 14133 || obj.GetNameId() == 8020 || obj.GetNameId() == 8057 || obj.GetNameId() == 14374 || obj.GetNameId() == 14290 || obj.GetNameId() == 14372 || obj.GetNameId() == 14152))
                {
                    obj.SetScriptId(ObjScriptEvent.FirstHeartbeat, 117);
                    obj.SetObjectFlag(ObjectFlag.OFF);
                }
            }
        }

        return(RunDefault);
    }
示例#10
0
    public static void quickstart(int simulated_game_state = 0, bool cheat_items = true, bool autokill_on = true)
    {
        gearup(simulated_game_state, true);
        Logger.Info("{0}", simulated_game_state.ToString());
        if (simulated_game_state >= 0)
        {
            SetQuestState(18, QuestState.Completed); // Catch Furnok quest
            SetQuestState(100, QuestState.Accepted); // Fetch Giant's head
            SetGlobalFlag(21, true);                 // Enable Terjon
            MakeAreaKnown(2);                        // Moathouse
            MakeAreaKnown(5);                        // Emridy
        }

        if (simulated_game_state >= 1)
        {
            Logger.Info("Executing WB...");
            // Having just completed Welkwood Bog, going on Moathouse + Emridy
            StoryState = 1;
            MakeAreaKnown(7);                        // Welkwood Bog
            SetGlobalVar(970, 2);                    // Talked to Smyth about WB
            // game.global_flags[66] = 1 # Paid Elmo - do NOT set this flag, else he won't get his better gear
            SetGlobalFlag(67, true);                 // Have spoken to vignette's relevant figure
            SetGlobalFlag(605, true);                // WB description box fired
            SetGlobalFlag(976, true);                // Mathel dead
            SetQuestState(73, QuestState.Completed); // Welkwood Bog quest
            if (PartyAlignment == Alignment.NEUTRAL)
            {
                SetQuestState(27, QuestState.Accepted); // Find Terjon's pendant
            }

            // Kill section #
            if ((ScriptDaemon.get_v("qs_welkwood") & (((1 << 11)) - 1)) != (((1 << 11)) - 1))
            {
                ScriptDaemon.set_v("qs_welkwood", ScriptDaemon.get_v("qs_welkwood") | 1);
                if ((ScriptDaemon.get_v("qs_welkwood") & 2) == 0)
                {
                    ScriptDaemon.cnk(14785); // Mathel
                    ScriptDaemon.set_v("qs_welkwood", ScriptDaemon.get_v("qs_welkwood") | 2);
                }

                if ((ScriptDaemon.get_v("qs_welkwood") & 0x4) == 0)
                {
                    ScriptDaemon.cnk(14183); // Goblin Leader
                    ScriptDaemon.set_v("qs_welkwood", ScriptDaemon.get_v("qs_welkwood") | 0x4);
                }

                if ((ScriptDaemon.get_v("qs_welkwood") & 0x8) == 0)
                {
                    ScriptDaemon.cnk(14641); // Kobold Sergeant
                    ScriptDaemon.set_v("qs_welkwood", ScriptDaemon.get_v("qs_welkwood") | 0x8);
                }

                if ((ScriptDaemon.get_v("qs_welkwood") & 0x10) == 0)
                {
                    ScriptDaemon.cnk(14631); // Gnoll
                    ScriptDaemon.set_v("qs_welkwood", ScriptDaemon.get_v("qs_welkwood") | 0x10);
                }

                if ((ScriptDaemon.get_v("qs_welkwood") & 0x20) == 0)
                {
                    ScriptDaemon.cnk(14081); // Skeleton Gnoll
                    ScriptDaemon.set_v("qs_welkwood", ScriptDaemon.get_v("qs_welkwood") | 0x20);
                }

                if ((ScriptDaemon.get_v("qs_welkwood") & 0x40) == 0)
                {
                    ScriptDaemon.cnk(14640, how_many: 10, timer: 200); // Kobolds
                    ScriptDaemon.set_v("qs_welkwood", ScriptDaemon.get_v("qs_welkwood") | 0x40);
                }

                if ((ScriptDaemon.get_v("qs_welkwood") & (1 << 7)) == 0)
                {
                    ScriptDaemon.cnk(14187, how_many: 18, timer: 800); // Goblins
                    ScriptDaemon.set_v("qs_welkwood", ScriptDaemon.get_v("qs_welkwood") | (1 << 7));
                }

                if ((ScriptDaemon.get_v("qs_welkwood") & 0x100) == 0)
                {
                    ScriptDaemon.cnk(14183); // Goblin Leader
                    ScriptDaemon.set_v("qs_welkwood", ScriptDaemon.get_v("qs_welkwood") | 0x100);
                }

                if ((ScriptDaemon.get_v("qs_welkwood") & 0x200) == 0)
                {
                    ScriptDaemon.cnk(14640, how_many: 9, timer: 1800); // Kobolds
                    ScriptDaemon.set_v("qs_welkwood", ScriptDaemon.get_v("qs_welkwood") | 0x200);
                }

                if ((ScriptDaemon.get_v("qs_welkwood") & 0x400) == 0)
                {
                    ScriptDaemon.cnk(14641); // Kobold Sergeant
                    ScriptDaemon.set_v("qs_welkwood", ScriptDaemon.get_v("qs_welkwood") | (1 << 10));
                }

                Logger.Info("WB executed!");
            }
        }

        // for pc in game.party[0].group_list():
        // if pc.stat_level_get(stat_experience) <= 820:
        // pc.stat_base_set(stat_experience, 820)
        if (simulated_game_state >= 2)
        {
            if (autokill_on)
            {
                ScriptDaemon.set_f("qs_autokill_moathouse", true);
            }

            // Having just completed Moathouse + Emridy + Welkwood Bog
            // for pc in game.party[0].group_list():
            // if pc.stat_level_get(stat_experience) <= 6000:
            // pc.stat_base_set(stat_experience, 6000)
            StoryState = 2;
            MakeAreaKnown(8);  // Moathouse Cave Exit
            MakeAreaKnown(10); // Deklo
            Logger.Info("Executing Moathouse + Emridy Meadows...");
        }

        if (simulated_game_state >= 3)
        {
            // Having Finished Nulb + HB
            // I.E. auto-kill Nulb and HB
            // preparing for "legitimate" AoH + Revenge Encounter + Moathouse Respawn ( + Temple )
            // for pc in game.party[0].group_list():
            // if pc.stat_level_get(stat_experience) <= 16000:
            // pc.stat_base_set(stat_experience, 16000)
            Logger.Info("Executing Nulb, HB");
            StoryState = 3;
            MakeAreaKnown(3);                       // Nulb
            MakeAreaKnown(6);                       // Imeryds
            MakeAreaKnown(9);                       // HB
            SetQuestState(35, QuestState.Accepted); // Grud's story
            SetQuestState(41, QuestState.Accepted); // Preston's tooth ache
            SetQuestState(42, QuestState.Accepted); // Assassinate Lodriss
            SetQuestState(59, QuestState.Accepted); // Free Serena
            SetQuestState(60, QuestState.Accepted); // Mona's Orb
            SetQuestState(63, QuestState.Accepted); // Bribery for justice
            if (autokill_on)
            {
                ScriptDaemon.set_f("qs_autokill_nulb", true);
            }
        }

        if (simulated_game_state >= 3.5f)
        {
            SetQuestState(65, QuestState.Accepted); // Hero's Prize Quest
            SetGlobalVar(972, 2);                   // Have talked to Kent about Witch
            ScriptDaemon.set_f("qs_arena_of_heroes_enable");
        }

        if (simulated_game_state >= 4)
        {
            // Autokill Temple, AoH, Revenge Encounter, MR
            Logger.Info("Executing Temple, AoH, Moathouse Respawn, Revenge Encounter");
            if (autokill_on)
            {
                ScriptDaemon.set_f("qs_autokill_temple");
            }

            StoryState = 4;
            MakeAreaKnown(4);                       // Temple
            SetQuestState(65, QuestState.Accepted); // Hero's Prize Quest
            SetGlobalFlag(944, true);
        }

        if (simulated_game_state >= 5)
        {
            // Autokill Greater Temple, Verbobonc (minus slavers)
            Logger.Info("Executing Greater Temple, Verbobonc");
            if (autokill_on)
            {
                ScriptDaemon.set_f("qs_autokill_greater_temple");
            }

            StoryState = 5;
            MakeAreaKnown(11); // Temple Burnt Farmhouse
            MakeAreaKnown(14); // Verbobonc
        }

        if (simulated_game_state >= 6)
        {
            Logger.Info("Executing Nodes, WotGS");
            if (autokill_on)
            {
                ScriptDaemon.set_f("qs_autokill_nodes");
            }

            StoryState = 6;
        }
    }
示例#11
0
 public static bool kill_lodriss(GameObject attachee)
 {
     attachee.SetObjectFlag(ObjectFlag.OFF);
     ScriptDaemon.set_f("lodriss_killed_outside");
     return(RunDefault);
 }
示例#12
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        if (attachee.GetMap() == 5005) // Moathouse Dungeon
        {
            foreach (var npc in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC))
            {
                if ((new[] { 14066, 14067, 14078, 14079, 14080 }).Contains(npc.GetNameId()) && npc.GetLeader() == null && npc.GetScriptId(ObjScriptEvent.StartCombat) == 0)
                {
                    npc.SetScriptId(ObjScriptEvent.StartCombat, 75);
                }
            }
        }
        else if (attachee.GetMap() == 5066) // Temple level 1
        {
            foreach (var npc in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC))
            {
                if (npc.GetLeader() == null && npc.GetScriptId(ObjScriptEvent.StartCombat) == 0)
                {
                    npc.SetScriptId(ObjScriptEvent.StartCombat, 2);
                }
            }
        }

        if ((GetGlobalVar(709) == 2 && attachee.GetMap() == 5005))
        {
            SetGlobalVar(709, 3);
            foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC))
            {
                if ((obj.GetNameId() == 14079 || obj.GetNameId() == 14080 || obj.GetNameId() == 14067 || obj.GetNameId() == 14078 || obj.GetNameId() == 14066))
                {
                    obj.TurnTowards(triggerer);
                    obj.Attack(triggerer);
                }
            }
        }

        if (attachee.GetMap() == 5066 && (!ScriptDaemon.get_f("j_ogre_temple_1"))) // temple level 1 - gnolls near southern stairs
        {
            var(xx, yy) = attachee.GetLocation();
            if ((Math.Pow((xx - 564), 2) + Math.Pow((yy - 599), 2)) < 200)
            {
                ScriptDaemon.set_f("j_ogre_temple_1");
                var xxp_min = 564;
                var xxp_o   = 564;
                foreach (var pc in PartyLeader.GetPartyMembers())
                {
                    var(xxp, yyp) = pc.GetLocation();
                    if (yyp >= 599)
                    {
                        if (xxp < xxp_min)
                        {
                            xxp_min = xxp;
                        }
                    }
                    else if (yyp < 599 && xxp >= 519 && xxp <= 546 && yyp >= 589)
                    {
                        if (xxp < xxp_o)
                        {
                            xxp_o = xxp;
                        }
                    }
                }

                var x_ogre = Math.Min(xxp_min, xxp_o) - 20;
                x_ogre = Math.Max(507, x_ogre);
                foreach (var npc in ObjList.ListVicinity(new locXY(507, 603), ObjectListFilter.OLC_NPC))
                {
                    if (npc.GetNameId() == 14448 && npc.GetLeader() == null && !npc.IsUnconscious())
                    {
                        npc.Move(new locXY(x_ogre, 601), 0, 0);
                        npc.Attack(SelectedPartyLeader);
                    }
                }
            }
        }

        // THIS IS USED FOR BREAK FREE
        var found_nearby = 0;

        foreach (var obj in PartyLeader.GetPartyMembers())
        {
            if ((obj.DistanceTo(attachee) <= 3 && obj.GetStat(Stat.hp_current) >= -9))
            {
                found_nearby = 1;
            }
        }

        if (found_nearby == 0)
        {
            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)
        // Spiritual Weapon Shenanigens	#
        CombatStandardRoutines.Spiritual_Weapon_Begone(attachee);
        return(RunDefault);
    }
示例#13
0
 public static bool set_bandits()
 {
     QueueRandomEncounter(3434);
     ScriptDaemon.set_f("s_ranths_bandits_scheduled");
     return(RunDefault);
 }
示例#14
0
 public static bool set_gremlich()
 {
     QueueRandomEncounter(3436);
     ScriptDaemon.set_f("s_gremlich_1_scheduled");
     return(RunDefault);
 }
示例#15
0
    public static void romag_call_help(GameObject attachee)
    {
        if (attachee.GetMap() == 5066 && (!ScriptDaemon.get_f("j_earth_commander_troops_temple_1")) && ScriptDaemon.within_rect_by_corners(attachee, 440, 432, 440, 451)) // temple level 1
        {
            attachee.FloatLine(1000, attachee);
            ScriptDaemon.set_f("j_earth_commander_troops_temple_1");
            var yyp_max                  = 439;
            var party_in_troop_room      = false;
            var party_in_romag_room      = false;
            var party_outside_romag_room = false;
            foreach (var pc in PartyLeader.GetPartyMembers())
            {
                var(xxp, yyp) = pc.GetLocation();
                if ((xxp >= 440 && xxp <= 452 && yyp >= 439 && yyp <= 451))
                {
                    party_in_romag_room = true;
                    if (yyp > yyp_max)
                    {
                        yyp_max = yyp;
                    }
                }

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

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

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

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

            // npc.attack(game.leader)
            foreach (var npc in ObjList.ListVicinity(new locXY(453, 463), ObjectListFilter.OLC_NPC))
            {
                if ((new[] { 14162, 14163, 14165, 14337, 14339, 14156 }).Contains(npc.GetNameId()) && npc.GetLeader() == null)
                {
                    npc.Attack(SelectedPartyLeader);
                }
            }
        }
    }
示例#16
0
 public static bool give_reward()
 {
     QueueRandomEncounter(3002);
     ScriptDaemon.set_f("s_tillahi_reward_scheduled");
     return(RunDefault);
 }
示例#17
0
 public static bool set_bethany()
 {
     QueueRandomEncounter(3447);
     ScriptDaemon.set_f("s_bethany_scheduled");
     return(RunDefault);
 }
示例#18
0
    public override bool OnHeartbeat(GameObject attachee, GameObject triggerer)
    {
        attachee.SetScriptId(ObjScriptEvent.EnterCombat, 109); // assign enter_combat script
        if ((GameSystems.Combat.IsCombatActive()))
        {
            if ((attachee != null && !attachee.IsUnconscious() && !attachee.D20Query(D20DispatcherKey.QUE_Prone)))
            {
                run_off(attachee, triggerer);
                return(SkipDefault);
            }
        }

        if ((!GameSystems.Combat.IsCombatActive() && ScriptDaemon.tpsts("dala_buggered_off", 1)))
        {
            var downed_bozos = 0;
            foreach (var hostel_patron in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC))
            {
                if ((new[] { 8018, 14145, 14074 }).Contains(hostel_patron.GetNameId()))
                {
                    if (hostel_patron.IsUnconscious() || hostel_patron.GetLeader() != null)
                    {
                        downed_bozos += 1;
                    }
                }
            }

            if (downed_bozos >= 2)
            {
                // attachee.float_mesfile_line( 'mes\\test.mes', 1, 0 )
                attachee.FadeTo(255, 1, 50);
                foreach (var hostel_patron in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC))
                {
                    foreach (var pc in SelectedPartyLeader.GetPartyMembers())
                    {
                        hostel_patron.AIRemoveFromShitlist(pc);
                        hostel_patron.SetReaction(pc, 80);
                    }
                }

                attachee.ClearObjectFlag(ObjectFlag.CLICK_THROUGH);
                attachee.ClearObjectFlag(ObjectFlag.OFF);
                foreach (var hostel_patron in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC))
                {
                    foreach (var pc in SelectedPartyLeader.GetPartyMembers())
                    {
                        hostel_patron.AIRemoveFromShitlist(pc);
                        hostel_patron.SetReaction(pc, 80);
                    }
                }

                attachee.SetBaseStat(Stat.strength, 10);
                if (!ScriptDaemon.get_f("have_talked_to_dala_post_battle")) // initiate Dala monologue where she faints
                {
                    foreach (var pc in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_PC))
                    {
                        if (ScriptDaemon.is_safe_to_talk_rfv(attachee, pc, 40))
                        {
                            ScriptDaemon.set_f("have_talked_to_dala_post_battle");
                            pc.BeginDialog(attachee, 200);
                        }
                    }
                }
            }
        }
        else if ((!GameSystems.Combat.IsCombatActive())) // this takes care of the infinite battle loop
        {
            // attachee.float_mesfile_line( 'mes\\test.mes', 2, 0 )
            foreach (var hostel_patron in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_NPC))
            {
                if (!((new[] { 8018, 14145, 14074 }).Contains(hostel_patron.GetNameId()))) // added condition because apparently sometimes combat doesn't start before this heartbeat fires and thus it sets them to non-hostile status and no combat actually commences
                {
                    foreach (var pc in SelectedPartyLeader.GetPartyMembers())
                    {
                        hostel_patron.AIRemoveFromShitlist(pc);
                        hostel_patron.SetReaction(pc, 80);
                    }
                }
            }
        }

        if ((GetQuestState(37) == QuestState.Completed))
        {
            // game.new_sid = 0 # commented by S.A. - the heartbeat is now needed
            var dummy = 1;
        }
        else if ((!GetGlobalFlag(89)))
        {
            if ((!GameSystems.Combat.IsCombatActive()))
            {
                var(xx, yy) = attachee.GetLocation();
                if (xx == 478 && yy == 504 && !attachee.HasLineOfSight(SelectedPartyLeader))
                {
                    attachee.TurnTowards(SelectedPartyLeader);
                }

                foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_PC))
                {
                    if ((attachee.HasLineOfSight(obj)))
                    {
                        SetGlobalFlag(89, true);
                        StartTimer(7200000, () => reset_global_flag_89(attachee)); // call reset_global_flag_89 in 2 hours
                        attachee.StealFrom(obj);
                        return(RunDefault);
                    }
                }
            }
        }

        return(RunDefault);
    }
示例#19
0
 public static void mark_pc_dropoff(GameObject obj)
 {
     obj.SetScriptId(ObjScriptEvent.Dialog, 439);
     ScriptDaemon.set_f("pc_dropoff");
 }
示例#20
0
 public override bool OnResurrect(GameObject attachee, GameObject triggerer)
 {
     SetGlobalFlag(202, true);
     ScriptDaemon.set_f("skole_dead", false);
     return(RunDefault);
 }
 public static bool sb_retaliation_for_whistleblower()
 {
     QueueRandomEncounter(3435);
     ScriptDaemon.set_f("s_sb_retaliation_for_whistleblower_scheduled");
     return(RunDefault);
 }