public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
        case 6000:
            originalScript = "npc_get(npc, 1) == 0";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 21:
        case 61:
        case 71:
        case 101:
            originalScript = "npc_get(npc, 1) == 1";
            return(ScriptDaemon.npc_get(npc, 1));

        case 22:
        case 41:
        case 102:
            originalScript = "npc_get(npc, 2) == 0 and ( pc.money_get() >= 50000 or (game.global_vars[455] & 2**5 == 0) )";
            return(!ScriptDaemon.npc_get(npc, 2) && (pc.GetMoney() >= 50000 || ((GetGlobalVar(455) & 0x20) == 0)));

        case 23:
        case 42:
        case 103:
            originalScript = "npc_get(npc, 2) == 0 and pc.money_get() < 50000 and (game.global_vars[455] & 2**5 != 0)";
            return(!ScriptDaemon.npc_get(npc, 2) && pc.GetMoney() < 50000 && ((GetGlobalVar(455) & 0x20) != 0));

        default:
            originalScript = null;
            return(true);
        }
    }
Esempio n. 2
0
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
        case 22:
            originalScript = "pc.skill_level_get(npc,skill_diplomacy) >= 19";
            return(pc.GetSkillLevel(npc, SkillId.diplomacy) >= 19);

        case 21:
            originalScript = "game.party_size() >= 2";
            return(GameSystems.Party.PartySize >= 2);

        case 23:
            originalScript = "pc.skill_level_get(npc,skill_diplomacy) <= 18";
            return(pc.GetSkillLevel(npc, SkillId.diplomacy) <= 18);

        case 41:
        case 151:
        case 241:
            originalScript = "game.global_flags[530] == 0";
            return(!GetGlobalFlag(530));

        case 42:
        case 51:
        case 242:
            originalScript = "not npc_get(npc,1)";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 44:
        case 62:
            originalScript = "game.global_flags[530] == 1 and pc.follower_atmax() == 0";
            return(GetGlobalFlag(530) && !pc.HasMaxFollowers());

        case 71:
            originalScript = "pc.skill_level_get(npc,skill_bluff) >= 19";
            return(pc.GetSkillLevel(npc, SkillId.bluff) >= 19);

        case 72:
            originalScript = "pc.skill_level_get(npc,skill_bluff) <= 18";
            return(pc.GetSkillLevel(npc, SkillId.bluff) <= 18);

        case 81:
            originalScript = "pc.skill_level_get(npc,skill_intimidate) >= 19";
            return(pc.GetSkillLevel(npc, SkillId.intimidate) >= 19);

        case 82:
            originalScript = "pc.skill_level_get(npc,skill_intimidate) <= 18";
            return(pc.GetSkillLevel(npc, SkillId.intimidate) <= 18);

        case 152:
            originalScript = "game.global_flags[530] == 1";
            return(GetGlobalFlag(530));

        default:
            originalScript = null;
            return(true);
        }
    }
Esempio n. 3
0
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 3:
            originalScript = "not npc_get(npc,2)";
            return(!ScriptDaemon.npc_get(npc, 2));

        case 21:
        case 41:
            originalScript = "not npc_get(npc,5)";
            return(!ScriptDaemon.npc_get(npc, 5));

        case 22:
        case 31:
            originalScript = "not npc_get(npc,4)";
            return(!ScriptDaemon.npc_get(npc, 4));

        case 101:
            originalScript = "not npc_get(npc,1)";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 102:
            originalScript = "game.global_flags[505] == 1 and not anyone( pc.group_list(), \"has_item\", 12640 ) and game.quests[98].state == qs_unknown";
            return(GetGlobalFlag(505) && !pc.GetPartyMembers().Any(o => o.HasItemByName(12640)) && GetQuestState(98) == QuestState.Unknown);

        case 103:
            originalScript = "anyone( pc.group_list(), \"has_item\", 12640 ) and game.global_flags[966] == 1";
            return(pc.GetPartyMembers().Any(o => o.HasItemByName(12640)) && GetGlobalFlag(966));

        case 104:
            originalScript = "anyone( pc.group_list(), \"has_item\", 12640 ) and game.global_flags[966] == 0";
            return(pc.GetPartyMembers().Any(o => o.HasItemByName(12640)) && !GetGlobalFlag(966));

        case 105:
            originalScript = "game.quests[98].state == qs_mentioned and game.quests[96].state == qs_unknown";
            return(GetQuestState(98) == QuestState.Mentioned && GetQuestState(96) == QuestState.Unknown);

        case 106:
            originalScript = "game.quests[98].state == qs_mentioned and (game.quests[96].state == qs_mentioned or game.quests[96].state == qs_accepted)";
            return(GetQuestState(98) == QuestState.Mentioned && (GetQuestState(96) == QuestState.Mentioned || GetQuestState(96) == QuestState.Accepted));

        case 107:
            originalScript = "game.quests[98].state == qs_accepted and game.global_flags[506] == 0";
            return(GetQuestState(98) == QuestState.Accepted && !GetGlobalFlag(506));

        case 511:
            originalScript = "game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD or game.party_alignment == CHAOTIC_GOOD or game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == TRUE_NEUTRAL";
            return(PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.NEUTRAL);

        case 512:
            originalScript = "game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == LAWFUL_EVIL or game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL";
            return(PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL || PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL);

        default:
            originalScript = null;
            return(true);
        }
    }
    public override bool OnJoin(GameObject attachee, GameObject triggerer)
    {
        if ((ScriptDaemon.npc_get(attachee, 1)))
        {
            ScriptDaemon.npc_set(attachee, 2);
        }

        return(RunDefault);
    }
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        if ((!ScriptDaemon.npc_get(attachee, 1)))
        {
            triggerer.BeginDialog(attachee, 1);
        }
        else if ((ScriptDaemon.npc_get(attachee, 1)))
        {
            triggerer.BeginDialog(attachee, 100);
        }

        return(SkipDefault);
    }
    public override bool OnFirstHeartbeat(GameObject attachee, GameObject triggerer)
    {
        if ((GetGlobalVar(980) == 3 && GetGlobalVar(981) == 3 && GetGlobalVar(982) == 3 && GetGlobalVar(983) == 3 && GetGlobalVar(984) == 3 && GetGlobalVar(985) == 3 && GetGlobalVar(986) == 3)) // turns on angra and co
        {
            attachee.ClearObjectFlag(ObjectFlag.OFF);
            if ((!ScriptDaemon.npc_get(attachee, 4)))
            {
                Sound(4183, 1);
                ScriptDaemon.npc_set(attachee, 4);
            }
        }

        return(RunDefault);
    }
Esempio n. 7
0
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 12:
        case 22:
            originalScript = "not npc_get(npc,1)";
            return(!ScriptDaemon.npc_get(npc, 1));

        default:
            originalScript = null;
            return(true);
        }
    }
Esempio n. 8
0
    public override bool OnHeartbeat(GameObject attachee, GameObject triggerer)
    {
        if ((attachee.GetMap() == 5071))
        {
            if ((!ScriptDaemon.npc_get(attachee, 3)))
            {
                attachee.SetInt(obj_f.hp_damage, 50);
                StartTimer(2000, () => talk_talk(attachee, triggerer));
                ScriptDaemon.npc_set(attachee, 3);
            }

            if ((ScriptDaemon.npc_get(attachee, 2) && !ScriptDaemon.npc_get(attachee, 4)))
            {
                StartTimer(200, () => beth_exit(attachee, triggerer));
                ScriptDaemon.npc_set(attachee, 4);
            }
        }

        return(RunDefault);
    }
Esempio n. 9
0
    public override bool OnDisband(GameObject attachee, GameObject triggerer)
    {
        if (ScriptDaemon.npc_get(attachee, 2))
        {
            foreach (var obj in triggerer.GetPartyMembers())
            {
                if ((obj.GetNameId() == 8022))
                {
                    triggerer.RemoveFollower(obj);
                }
            }

            foreach (var pc in GameSystems.Party.PartyMembers)
            {
                attachee.AIRemoveFromShitlist(pc);
                attachee.SetReaction(pc, 50);
            }

            attachee.RunOff();
        }

        return(RunDefault);
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
        case 11:
        case 21:
        case 31:
            originalScript = "not npc_get(npc,2)";
            return(!ScriptDaemon.npc_get(npc, 2));

        case 3:
        case 12:
        case 22:
        case 32:
            originalScript = "not npc_get(npc,3)";
            return(!ScriptDaemon.npc_get(npc, 3));

        case 4:
        case 13:
        case 23:
        case 33:
            originalScript = "not npc_get(npc,4)";
            return(!ScriptDaemon.npc_get(npc, 4));

        case 5:
        case 14:
        case 24:
        case 34:
            originalScript = "npc_get(npc,2) and npc_get(npc,3) and npc_get(npc,4)";
            return(ScriptDaemon.npc_get(npc, 2) && ScriptDaemon.npc_get(npc, 3) && ScriptDaemon.npc_get(npc, 4));

        default:
            originalScript = null;
            return(true);
        }
    }
Esempio n. 11
0
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
        case 3:
            originalScript = "game.global_flags[111] == 1";
            return(GetGlobalFlag(111));

        case 4:
        case 5:
            originalScript = "game.global_flags[111] == 0";
            return(!GetGlobalFlag(111));

        case 31:
        case 45:
            originalScript = "npc_get(npc, 1) == 0";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 51:
            originalScript = "npc_get(npc, 1) == 1 and npc_get(npc, 2) == 0 and (game.global_vars[452] & (2**0 + 2**1) >= 3 )";
            return(ScriptDaemon.npc_get(npc, 1) && !ScriptDaemon.npc_get(npc, 2) && ((GetGlobalVar(452) & (0x3)) == 0x3));

        case 141:
            originalScript = "npc_get(npc, 3) == 1 and (game.global_vars[452] & (2**1) != 0 )";
            return(ScriptDaemon.npc_get(npc, 3) && ((GetGlobalVar(452) & (0x2)) != 0));

        case 142:
            originalScript = "npc_get(npc, 5) == 1 and npc_get(npc, 6) == 0 and (game.global_vars[452] & (2**2) != 0 )";
            return(ScriptDaemon.npc_get(npc, 5) && !ScriptDaemon.npc_get(npc, 6) && ((GetGlobalVar(452) & (0x4)) != 0));

        default:
            originalScript = null;
            return(true);
        }
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
            originalScript = "not npc.has_met(pc) and (game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD or game.party_alignment == LAWFUL_NEUTRAL)";
            return(!npc.HasMet(pc) && (PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.LAWFUL_NEUTRAL));

        case 3:
            originalScript = "not npc.has_met(pc) and (game.party_alignment == CHAOTIC_GOOD or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == LAWFUL_EVIL)";
            return(!npc.HasMet(pc) && (PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL));

        case 4:
            originalScript = "not npc.has_met(pc) and (game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == CHAOTIC_EVIL or game.party_alignment == NEUTRAL_EVIL)";
            return(!npc.HasMet(pc) && (PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.CHAOTIC_EVIL || PartyAlignment == Alignment.NEUTRAL_EVIL));

        case 5:
            originalScript = "npc.has_met(pc) and (game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD or game.party_alignment == LAWFUL_NEUTRAL)";
            return(npc.HasMet(pc) && (PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.LAWFUL_NEUTRAL));

        case 6:
            originalScript = "npc.has_met(pc) and (game.party_alignment == CHAOTIC_GOOD or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == LAWFUL_EVIL)";
            return(npc.HasMet(pc) && (PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL));

        case 7:
            originalScript = "npc.has_met(pc) and (game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == CHAOTIC_EVIL or game.party_alignment == NEUTRAL_EVIL)";
            return(npc.HasMet(pc) && (PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.CHAOTIC_EVIL || PartyAlignment == Alignment.NEUTRAL_EVIL));

        case 11:
            originalScript = "game.global_flags[985] == 1 and game.quests[69].state == qs_unknown";
            return(GetGlobalFlag(985) && GetQuestState(69) == QuestState.Unknown);

        case 12:
        case 22:
            originalScript = "game.global_vars[999] >= 1 and game.global_vars[999] <= 14 and game.quests[69].state == qs_accepted";
            return(GetGlobalVar(999) >= 1 && GetGlobalVar(999) <= 14 && GetQuestState(69) == QuestState.Accepted);

        case 13:
        case 23:
            originalScript = "game.global_vars[999] >= 15 and game.quests[69].state != qs_completed";
            return(GetGlobalVar(999) >= 15 && GetQuestState(69) != QuestState.Completed);

        case 14:
            originalScript = "game.global_flags[985] == 0 and game.quests[69].state == qs_unknown";
            return(!GetGlobalFlag(985) && GetQuestState(69) == QuestState.Unknown);

        case 15:
            originalScript = "game.global_flags[985] == 1 and game.global_flags[991] == 1 and (game.quests[69].state == qs_mentioned or game.quests[69].state == qs_accepted)";
            return(GetGlobalFlag(985) && GetGlobalFlag(991) && (GetQuestState(69) == QuestState.Mentioned || GetQuestState(69) == QuestState.Accepted));

        case 16:
            originalScript = "game.global_flags[985] == 1 and game.global_flags[991] == 0 and (game.quests[69].state == qs_mentioned or game.quests[69].state == qs_accepted)";
            return(GetGlobalFlag(985) && !GetGlobalFlag(991) && (GetQuestState(69) == QuestState.Mentioned || GetQuestState(69) == QuestState.Accepted));

        case 21:
            originalScript = "game.quests[69].state == qs_mentioned";
            return(GetQuestState(69) == QuestState.Mentioned);

        case 24:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) or (game.quests[84].state == qs_accepted or game.quests[84].state == qs_mentioned) or (game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) or (game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) || (GetQuestState(84) == QuestState.Accepted || GetQuestState(84) == QuestState.Mentioned) || (GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) || (GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned));

        case 25:
            originalScript = "game.quests[69].state == qs_completed";
            return(GetQuestState(69) == QuestState.Completed);

        case 26:
            originalScript = "game.quests[89].state == qs_mentioned";
            return(GetQuestState(89) == QuestState.Mentioned);

        case 27:
            originalScript = "game.quests[89].state == qs_completed and not npc_get(npc,5)";
            return(GetQuestState(89) == QuestState.Completed && !ScriptDaemon.npc_get(npc, 5));

        case 51:
            originalScript = "(game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD or game.party_alignment == LAWFUL_NEUTRAL)";
            return(PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.LAWFUL_NEUTRAL);

        case 52:
            originalScript = "(game.party_alignment == CHAOTIC_GOOD or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == LAWFUL_EVIL)";
            return(PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL);

        case 53:
            originalScript = "(game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == CHAOTIC_EVIL or game.party_alignment == NEUTRAL_EVIL)";
            return(PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.CHAOTIC_EVIL || PartyAlignment == Alignment.NEUTRAL_EVIL);

        case 61:
            originalScript = "game.global_flags[985] == 0";
            return(!GetGlobalFlag(985));

        case 62:
            originalScript = "game.global_flags[985] == 1";
            return(GetGlobalFlag(985));

        case 71:
        case 151:
            originalScript = "game.global_flags[968] == 0";
            return(!GetGlobalFlag(968));

        case 72:
            originalScript = "game.global_flags[991] == 1 and game.global_flags[968] == 1";
            return(GetGlobalFlag(991) && GetGlobalFlag(968));

        case 73:
            originalScript = "game.global_flags[991] == 0 and game.global_flags[968] == 1";
            return(!GetGlobalFlag(991) && GetGlobalFlag(968));

        case 111:
            originalScript = "game.quests[74].state == qs_accepted";
            return(GetQuestState(74) == QuestState.Accepted);

        case 112:
            originalScript = "game.quests[74].state == qs_mentioned";
            return(GetQuestState(74) == QuestState.Mentioned);

        case 161:
            originalScript = "game.global_flags[991] == 1";
            return(GetGlobalFlag(991));

        case 162:
            originalScript = "game.global_flags[991] == 0";
            return(!GetGlobalFlag(991));

        case 172:
            originalScript = "anyone( pc.group_list(), \"has_wielded\", 3007 )";
            return(pc.GetPartyMembers().Any(o => o.HasEquippedByName(3007)));

        case 173:
            originalScript = "pc.stat_level_get(stat_race) == race_gnome";
            return(pc.GetRace() == RaceId.svirfneblin);

        case 191:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) and game.global_flags[989] == 0 and game.global_flags[946] == 0 and game.global_flags[863] == 0 and not npc_get(npc,1)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) && !GetGlobalFlag(989) && !GetGlobalFlag(946) && !GetGlobalFlag(863) && !ScriptDaemon.npc_get(npc, 1));

        case 192:
            originalScript = "(game.quests[84].state == qs_accepted or game.quests[84].state == qs_mentioned) and game.global_flags[973] == 0 and not npc_get(npc,2)";
            return((GetQuestState(84) == QuestState.Accepted || GetQuestState(84) == QuestState.Mentioned) && !GetGlobalFlag(973) && !ScriptDaemon.npc_get(npc, 2));

        case 193:
            originalScript = "(game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned) and game.global_flags[989] == 0 and not npc_get(npc,3)";
            return((GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned) && !GetGlobalFlag(989) && !ScriptDaemon.npc_get(npc, 3));

        case 194:
            originalScript = "(game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) and game.global_flags[989] == 0 and not npc_get(npc,4)";
            return((GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) && !GetGlobalFlag(989) && !ScriptDaemon.npc_get(npc, 4));

        case 241:
            originalScript = "game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD or game.party_alignment == LAWFUL_NEUTRAL";
            return(PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.LAWFUL_NEUTRAL);

        case 242:
            originalScript = "game.party_alignment == CHAOTIC_GOOD or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == LAWFUL_EVIL";
            return(PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL);

        case 243:
            originalScript = "game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == CHAOTIC_EVIL or game.party_alignment == NEUTRAL_EVIL";
            return(PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.CHAOTIC_EVIL || PartyAlignment == Alignment.NEUTRAL_EVIL);

        default:
            originalScript = null;
            return(true);
        }
    }
Esempio n. 13
0
    public override bool OnHeartbeat(GameObject attachee, GameObject triggerer)
    {
        if ((attachee.GetMap() == 5095))
        {
            if ((!GameSystems.Combat.IsCombatActive()))
            {
                if ((attachee != null && !Utilities.critter_is_unconscious(attachee) && !attachee.D20Query(D20DispatcherKey.QUE_Prone) && attachee.GetLeader() == null))
                {
                    if ((GetGlobalVar(986) != 3))
                    {
                        foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_PC))
                        {
                            if ((comment_20(attachee, obj)))
                            {
                                if ((!ScriptDaemon.npc_get(attachee, 3)))
                                {
                                    var comment = RandomRange(1, 400);
                                    if ((comment == 20))
                                    {
                                        attachee.FloatLine(10000, triggerer);
                                    }

                                    if ((comment == 60))
                                    {
                                        attachee.FloatLine(10001, triggerer);
                                    }

                                    if ((comment == 100))
                                    {
                                        attachee.FloatLine(10002, triggerer);
                                    }

                                    if ((comment == 140))
                                    {
                                        attachee.FloatLine(10003, triggerer);
                                    }

                                    if ((comment == 180))
                                    {
                                        attachee.FloatLine(10004, triggerer);
                                    }

                                    if ((comment == 220))
                                    {
                                        attachee.FloatLine(10005, triggerer);
                                    }

                                    if ((comment == 260))
                                    {
                                        attachee.FloatLine(10006, triggerer);
                                    }

                                    if ((comment == 300))
                                    {
                                        attachee.FloatLine(10007, triggerer);
                                    }

                                    if ((comment == 340))
                                    {
                                        attachee.FloatLine(10008, triggerer);
                                    }

                                    if ((comment == 380))
                                    {
                                        attachee.FloatLine(10009, triggerer);
                                    }
                                }
                            }
                        }

                        if ((GetGlobalVar(983) == 1 && !ScriptDaemon.npc_get(attachee, 2)))
                        {
                            StartTimer(200, () => boonthag_exit(attachee, triggerer));
                            ScriptDaemon.npc_set(attachee, 2);
                        }
                    }
                }
            }

            if ((ScriptDaemon.npc_get(attachee, 3)))
            {
                attachee.SetObjectFlag(ObjectFlag.OFF);
            }
        }

        return(RunDefault);
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
        case 11:
            originalScript = "pc.d20_query(Q_IsFallenPaladin) == 1";
            return(pc.D20Query(D20DispatcherKey.QUE_IsFallenPaladin));

        case 21:
            originalScript = "game.global_flags[938] == 1 and game.global_flags[973] == 0 and not npc_get(npc,1)";
            return(GetGlobalFlag(938) && !GetGlobalFlag(973) && !ScriptDaemon.npc_get(npc, 1));

        case 22:
            originalScript = "game.global_flags[973] == 1 and not npc_get(npc,2)";
            return(GetGlobalFlag(973) && !ScriptDaemon.npc_get(npc, 2));

        case 23:
            originalScript = "game.quests[85].state == qs_mentioned";
            return(GetQuestState(85) == QuestState.Mentioned);

        case 24:
            originalScript = "game.global_vars[949] == 2";
            return(GetGlobalVar(949) == 2);

        case 25:
            originalScript = "(game.quests[84].state == qs_mentioned or game.quests[84].state == qs_accepted) and game.global_flags[973] == 0 and not npc_get(npc,7)";
            return((GetQuestState(84) == QuestState.Mentioned || GetQuestState(84) == QuestState.Accepted) && !GetGlobalFlag(973) && !ScriptDaemon.npc_get(npc, 7));

        case 26:
            originalScript = "(game.quests[83].state == qs_mentioned or game.quests[83].state == qs_botched) and not npc_get(npc,3)";
            return((GetQuestState(83) == QuestState.Mentioned || GetQuestState(83) == QuestState.Botched) && !ScriptDaemon.npc_get(npc, 3));

        case 27:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) or (game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) or (game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) || (GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) || (GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned));

        case 28:
            originalScript = "game.quests[78].state == qs_accepted";
            return(GetQuestState(78) == QuestState.Accepted);

        case 51:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 1";
            return(pc.GetStat(Stat.level_paladin) == 1);

        case 52:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 2";
            return(pc.GetStat(Stat.level_paladin) == 2);

        case 53:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 3";
            return(pc.GetStat(Stat.level_paladin) == 3);

        case 54:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 4";
            return(pc.GetStat(Stat.level_paladin) == 4);

        case 55:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 5";
            return(pc.GetStat(Stat.level_paladin) == 5);

        case 56:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 6";
            return(pc.GetStat(Stat.level_paladin) == 6);

        case 57:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 7";
            return(pc.GetStat(Stat.level_paladin) == 7);

        case 58:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 8";
            return(pc.GetStat(Stat.level_paladin) == 8);

        case 59:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 9";
            return(pc.GetStat(Stat.level_paladin) == 9);

        case 60:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 10";
            return(pc.GetStat(Stat.level_paladin) == 10);

        case 61:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 11";
            return(pc.GetStat(Stat.level_paladin) == 11);

        case 62:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 12";
            return(pc.GetStat(Stat.level_paladin) == 12);

        case 63:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 13";
            return(pc.GetStat(Stat.level_paladin) == 13);

        case 64:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 14";
            return(pc.GetStat(Stat.level_paladin) == 14);

        case 65:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 15";
            return(pc.GetStat(Stat.level_paladin) == 15);

        case 66:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 16";
            return(pc.GetStat(Stat.level_paladin) == 16);

        case 67:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 17";
            return(pc.GetStat(Stat.level_paladin) == 17);

        case 68:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 18";
            return(pc.GetStat(Stat.level_paladin) == 18);

        case 69:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 19";
            return(pc.GetStat(Stat.level_paladin) == 19);

        case 70:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 20";
            return(pc.GetStat(Stat.level_paladin) == 20);

        case 81:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 1 and pc.money_get() >= 100000";
            return(pc.GetStat(Stat.level_paladin) == 1 && pc.GetMoney() >= 100000);

        case 82:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 2 and pc.money_get() >= 200000";
            return(pc.GetStat(Stat.level_paladin) == 2 && pc.GetMoney() >= 200000);

        case 83:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 3 and pc.money_get() >= 300000";
            return(pc.GetStat(Stat.level_paladin) == 3 && pc.GetMoney() >= 300000);

        case 84:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 4 and pc.money_get() >= 400000";
            return(pc.GetStat(Stat.level_paladin) == 4 && pc.GetMoney() >= 400000);

        case 85:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 5 and pc.money_get() >= 500000";
            return(pc.GetStat(Stat.level_paladin) == 5 && pc.GetMoney() >= 500000);

        case 86:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 6 and pc.money_get() >= 600000";
            return(pc.GetStat(Stat.level_paladin) == 6 && pc.GetMoney() >= 600000);

        case 87:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 7 and pc.money_get() >= 700000";
            return(pc.GetStat(Stat.level_paladin) == 7 && pc.GetMoney() >= 700000);

        case 88:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 8 and pc.money_get() >= 800000";
            return(pc.GetStat(Stat.level_paladin) == 8 && pc.GetMoney() >= 800000);

        case 89:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 9 and pc.money_get() >= 900000";
            return(pc.GetStat(Stat.level_paladin) == 9 && pc.GetMoney() >= 900000);

        case 90:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 10 and pc.money_get() >= 1000000";
            return(pc.GetStat(Stat.level_paladin) == 10 && pc.GetMoney() >= 1000000);

        case 91:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 11 and pc.money_get() >= 1100000";
            return(pc.GetStat(Stat.level_paladin) == 11 && pc.GetMoney() >= 1100000);

        case 92:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 12 and pc.money_get() >= 1200000";
            return(pc.GetStat(Stat.level_paladin) == 12 && pc.GetMoney() >= 1200000);

        case 93:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 13 and pc.money_get() >= 1300000";
            return(pc.GetStat(Stat.level_paladin) == 13 && pc.GetMoney() >= 1300000);

        case 94:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 14 and pc.money_get() >= 1400000";
            return(pc.GetStat(Stat.level_paladin) == 14 && pc.GetMoney() >= 1400000);

        case 95:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 15 and pc.money_get() >= 1500000";
            return(pc.GetStat(Stat.level_paladin) == 15 && pc.GetMoney() >= 1500000);

        case 96:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 16 and pc.money_get() >= 1600000";
            return(pc.GetStat(Stat.level_paladin) == 16 && pc.GetMoney() >= 1600000);

        case 97:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 17 and pc.money_get() >= 1700000";
            return(pc.GetStat(Stat.level_paladin) == 17 && pc.GetMoney() >= 1700000);

        case 98:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 18 and pc.money_get() >= 1800000";
            return(pc.GetStat(Stat.level_paladin) == 18 && pc.GetMoney() >= 1800000);

        case 99:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 19 and pc.money_get() >= 1900000";
            return(pc.GetStat(Stat.level_paladin) == 19 && pc.GetMoney() >= 1900000);

        case 100:
            originalScript = "pc.stat_level_get(stat_level_paladin) == 20 and pc.money_get() >= 2000000";
            return(pc.GetStat(Stat.level_paladin) == 20 && pc.GetMoney() >= 2000000);

        case 121:
            originalScript = "game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD or game.party_alignment == CHAOTIC_GOOD";
            return(PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.CHAOTIC_GOOD);

        case 122:
            originalScript = "game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == LAWFUL_EVIL";
            return(PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL);

        case 123:
            originalScript = "game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL or game.party_alignment == CHAOTIC_NEUTRAL";
            return(PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL || PartyAlignment == Alignment.CHAOTIC_NEUTRAL);

        case 131:
            originalScript = "pc.money_get() >= 500000";
            return(pc.GetMoney() >= 500000);

        case 151:
            originalScript = "not npc_get(npc,8)";
            return(!ScriptDaemon.npc_get(npc, 8));

        case 231:
            originalScript = "(game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD or game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == CHAOTIC_GOOD or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == LAWFUL_EVIL) and game.quests[84].state == qs_mentioned";
            return((PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL) && GetQuestState(84) == QuestState.Mentioned);

        case 232:
            originalScript = "(game.party_alignment == CHAOTIC_GOOD or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == LAWFUL_EVIL or game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL) and game.quests[84].state == qs_mentioned";
            return((PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL || PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL) && GetQuestState(84) == QuestState.Mentioned);

        case 233:
            originalScript = "(game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL) and game.quests[84].state == qs_mentioned";
            return((PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL) && GetQuestState(84) == QuestState.Mentioned);

        case 234:
            originalScript = "(game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD or game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == CHAOTIC_GOOD or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == LAWFUL_EVIL) and game.quests[84].state == qs_accepted";
            return((PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL) && GetQuestState(84) == QuestState.Accepted);

        case 235:
            originalScript = "(game.party_alignment == CHAOTIC_GOOD or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == LAWFUL_EVIL or game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL) and game.quests[84].state == qs_accepted";
            return((PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL || PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL) && GetQuestState(84) == QuestState.Accepted);

        case 236:
            originalScript = "(game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL) and game.quests[84].state == qs_accepted";
            return((PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL) && GetQuestState(84) == QuestState.Accepted);

        case 241:
            originalScript = "game.quests[83].state == qs_mentioned";
            return(GetQuestState(83) == QuestState.Mentioned);

        case 242:
            originalScript = "game.quests[83].state == qs_botched";
            return(GetQuestState(83) == QuestState.Botched);

        case 261:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) and game.global_flags[989] == 0 and game.global_flags[946] == 0 and game.global_flags[863] == 0 and not npc_get(npc,4)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) && !GetGlobalFlag(989) && !GetGlobalFlag(946) && !GetGlobalFlag(863) && !ScriptDaemon.npc_get(npc, 4));

        case 262:
            originalScript = "(game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned) and game.global_flags[989] == 0 and not npc_get(npc,5)";
            return((GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned) && !GetGlobalFlag(989) && !ScriptDaemon.npc_get(npc, 5));

        case 263:
            originalScript = "(game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) and game.global_flags[989] == 0 and not npc_get(npc,6)";
            return((GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) && !GetGlobalFlag(989) && !ScriptDaemon.npc_get(npc, 6));

        case 301:
            originalScript = "not npc_get(npc,9)";
            return(!ScriptDaemon.npc_get(npc, 9));

        case 302:
            originalScript = "not npc_get(npc,10)";
            return(!ScriptDaemon.npc_get(npc, 10));

        case 303:
            originalScript = "not npc_get(npc,11)";
            return(!ScriptDaemon.npc_get(npc, 11));

        case 304:
            originalScript = "not npc_get(npc,12)";
            return(!ScriptDaemon.npc_get(npc, 12));

        case 312:
            originalScript = "not npc_get(npc,13)";
            return(!ScriptDaemon.npc_get(npc, 13));

        case 313:
            originalScript = "not npc_get(npc,14)";
            return(!ScriptDaemon.npc_get(npc, 14));

        case 314:
            originalScript = "not npc_get(npc,15)";
            return(!ScriptDaemon.npc_get(npc, 15));

        default:
            originalScript = null;
            return(true);
        }
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 3:
            originalScript = "not npc.has_met( pc ) and (is_daytime() == 1)";
            return(!npc.HasMet(pc) && (Utilities.is_daytime()));

        case 4:
            originalScript = "not npc.has_met( pc ) and (is_daytime() != 1)";
            return(!npc.HasMet(pc) && !Utilities.is_daytime());

        case 5:
            originalScript = "not npc.has_met( pc ) and game.quests[15].state == qs_accepted";
            return(!npc.HasMet(pc) && GetQuestState(15) == QuestState.Accepted);

        case 6:
            originalScript = "game.global_flags[508] == 1 and game.quests[96].state == qs_unknown";
            return(GetGlobalFlag(508) && GetQuestState(96) == QuestState.Unknown);

        case 7:
            originalScript = "game.quests[96].state == qs_mentioned";
            return(GetQuestState(96) == QuestState.Mentioned);

        case 41:
        case 61:
        case 71:
        case 81:
        case 91:
            originalScript = "not npc_get(npc,1)";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 42:
        case 51:
        case 72:
        case 82:
        case 92:
            originalScript = "not npc_get(npc,2)";
            return(!ScriptDaemon.npc_get(npc, 2));

        case 43:
        case 52:
        case 62:
            originalScript = "not npc_get(npc,3) and game.global_flags[282] == 0 and not anyone( pc.group_list(), \"has_follower\", 8054 ) and game.global_flags[284] == 1";
            return(!ScriptDaemon.npc_get(npc, 3) && !GetGlobalFlag(282) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8054)) && GetGlobalFlag(284));

        case 44:
        case 53:
        case 63:
            originalScript = "not npc_get(npc,4) and game.global_flags[282] == 1 and not anyone( pc.group_list(), \"has_follower\", 8071 ) and game.global_flags[284] == 0";
            return(!ScriptDaemon.npc_get(npc, 4) && GetGlobalFlag(282) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8071)) && !GetGlobalFlag(284));

        case 45:
        case 54:
        case 64:
            originalScript = "not npc_get(npc,5) and not anyone( pc.group_list(), \"has_follower\", 8054 ) and game.global_flags[282] == 0 and not anyone( pc.group_list(), \"has_follower\", 8071 ) and game.global_flags[284] == 0";
            return(!ScriptDaemon.npc_get(npc, 5) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8054)) && !GetGlobalFlag(282) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8071)) && !GetGlobalFlag(284));

        default:
            originalScript = null;
            return(true);
        }
    }
Esempio n. 16
0
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
            originalScript = "not npc.has_met(pc)";
            return(!npc.HasMet(pc));

        case 3:
            originalScript = "npc.has_met(pc)";
            return(npc.HasMet(pc));

        case 13:
            originalScript = "pc.skill_level_get(npc,skill_gather_information) >= 11 and (game.global_flags[968] == 1 or game.global_flags[986] == 1 or game.global_flags[981] == 1)";
            return(pc.GetSkillLevel(npc, SkillId.gather_information) >= 11 && (GetGlobalFlag(968) || GetGlobalFlag(986) || GetGlobalFlag(981)));

        case 14:
            originalScript = "pc.skill_level_get(npc,skill_gather_information) <= 10 and (game.global_flags[968] == 1 or game.global_flags[986] == 1 or game.global_flags[981] == 1)";
            return(pc.GetSkillLevel(npc, SkillId.gather_information) <= 10 && (GetGlobalFlag(968) || GetGlobalFlag(986) || GetGlobalFlag(981)));

        case 15:
        case 25:
        case 44:
        case 63:
        case 73:
        case 464:
            originalScript = "game.global_vars[977] == 1";
            return(GetGlobalVar(977) == 1);

        case 16:
        case 27:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) or (game.quests[84].state == qs_accepted or game.quests[84].state == qs_mentioned) or (game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) or (game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) || (GetQuestState(84) == QuestState.Accepted || GetQuestState(84) == QuestState.Mentioned) || (GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) || (GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned));

        case 21:
        case 41:
        case 61:
        case 71:
            originalScript = "not npc_get(npc,1)";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 22:
        case 62:
        case 72:
        case 461:
            originalScript = "not npc_get(npc,2)";
            return(!ScriptDaemon.npc_get(npc, 2));

        case 23:
        case 42:
        case 462:
            originalScript = "pc.skill_level_get(npc,skill_gather_information) >= 11 and not npc_get(npc,3) and (game.global_flags[968] == 1 or game.global_flags[986] == 1 or game.global_flags[981] == 1)";
            return(pc.GetSkillLevel(npc, SkillId.gather_information) >= 11 && !ScriptDaemon.npc_get(npc, 3) && (GetGlobalFlag(968) || GetGlobalFlag(986) || GetGlobalFlag(981)));

        case 24:
        case 43:
        case 463:
            originalScript = "pc.skill_level_get(npc,skill_gather_information) <= 10 and not npc_get(npc,3) and (game.global_flags[968] == 1 or game.global_flags[986] == 1 or game.global_flags[981] == 1)";
            return(pc.GetSkillLevel(npc, SkillId.gather_information) <= 10 && !ScriptDaemon.npc_get(npc, 3) && (GetGlobalFlag(968) || GetGlobalFlag(986) || GetGlobalFlag(981)));

        case 26:
            originalScript = "game.global_vars[976] == 1 and game.quests[69].state != qs_completed";
            return(GetGlobalVar(976) == 1 && GetQuestState(69) != QuestState.Completed);

        case 28:
            originalScript = "(game.global_flags[943] == 1 or game.global_vars[945] == 28) and not npc_get(npc,18)";
            return((GetGlobalFlag(943) || GetGlobalVar(945) == 28) && !ScriptDaemon.npc_get(npc, 18));

        case 29:
            originalScript = "game.global_vars[945] == 29 and not npc_get(npc,26)";
            return(GetGlobalVar(945) == 29 && !ScriptDaemon.npc_get(npc, 26));

        case 30:
            originalScript = "game.global_vars[945] == 30 and not npc_get(npc,27)";
            return(GetGlobalVar(945) == 30 && !ScriptDaemon.npc_get(npc, 27));

        case 31:
            originalScript = "game.quests[78].state == qs_accepted";
            return(GetQuestState(78) == QuestState.Accepted);

        case 32:
            originalScript = "game.quests[62].state == qs_accepted and (game.global_flags[560] == 0 or game.global_flags[561] == 0 or game.global_flags[562] == 0) and not npc_get(npc,28)";
            return(GetQuestState(62) == QuestState.Accepted && (!GetGlobalFlag(560) || !GetGlobalFlag(561) || !GetGlobalFlag(562)) && !ScriptDaemon.npc_get(npc, 28));

        case 51:
            originalScript = "pc.skill_level_get(npc,skill_gather_information) >= 11";
            return(pc.GetSkillLevel(npc, SkillId.gather_information) >= 11);

        case 52:
            originalScript = "pc.skill_level_get(npc,skill_gather_information) >= 11 and game.global_vars[977] == 1";
            return(pc.GetSkillLevel(npc, SkillId.gather_information) >= 11 && GetGlobalVar(977) == 1);

        case 53:
        case 54:
            originalScript = "pc.skill_level_get(npc,skill_gather_information) <= 10";
            return(pc.GetSkillLevel(npc, SkillId.gather_information) <= 10);

        case 93:
        case 103:
            originalScript = "game.global_vars[999] >= 1 and game.quests[69].state != qs_completed";
            return(GetGlobalVar(999) >= 1 && GetQuestState(69) != QuestState.Completed);

        case 111:
            originalScript = "pc.skill_level_get(npc,skill_diplomacy) >= 9";
            return(pc.GetSkillLevel(npc, SkillId.diplomacy) >= 9);

        case 112:
            originalScript = "pc.skill_level_get(npc,skill_diplomacy) <= 8";
            return(pc.GetSkillLevel(npc, SkillId.diplomacy) <= 8);

        case 131:
            originalScript = "pc.follower_atmax() == 0";
            return(!pc.HasMaxFollowers());

        case 132:
            originalScript = "pc.follower_atmax() == 1";
            return(pc.HasMaxFollowers());

        case 251:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) and game.global_flags[989] == 0 and game.global_flags[946] == 0 and game.global_flags[863] == 0 and not npc_get(npc,4)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) && !GetGlobalFlag(989) && !GetGlobalFlag(946) && !GetGlobalFlag(863) && !ScriptDaemon.npc_get(npc, 4));

        case 252:
            originalScript = "(game.quests[84].state == qs_accepted or game.quests[84].state == qs_mentioned) and game.global_flags[973] == 0 and not npc_get(npc,5)";
            return((GetQuestState(84) == QuestState.Accepted || GetQuestState(84) == QuestState.Mentioned) && !GetGlobalFlag(973) && !ScriptDaemon.npc_get(npc, 5));

        case 253:
            originalScript = "(game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned) and game.global_flags[989] == 0 and not npc_get(npc,6)";
            return((GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned) && !GetGlobalFlag(989) && !ScriptDaemon.npc_get(npc, 6));

        case 254:
            originalScript = "(game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) and game.global_flags[989] == 0 and not npc_get(npc,7)";
            return((GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) && !GetGlobalFlag(989) && !ScriptDaemon.npc_get(npc, 7));

        case 255:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) and game.global_flags[989] == 0 and npc_get(npc,8) and not npc_get(npc,10)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) && !GetGlobalFlag(989) && ScriptDaemon.npc_get(npc, 8) && !ScriptDaemon.npc_get(npc, 10));

        case 256:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) and game.global_flags[989] == 0 and npc_get(npc,9) and not npc_get(npc,11)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) && !GetGlobalFlag(989) && ScriptDaemon.npc_get(npc, 9) && !ScriptDaemon.npc_get(npc, 11));

        case 257:
            originalScript = "(game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned) and npc_get(npc,10) and not npc_get(npc,14)";
            return((GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned) && ScriptDaemon.npc_get(npc, 10) && !ScriptDaemon.npc_get(npc, 14));

        case 258:
            originalScript = "(game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned) and npc_get(npc,11) and not npc_get(npc,15)";
            return((GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned) && ScriptDaemon.npc_get(npc, 11) && !ScriptDaemon.npc_get(npc, 15));

        case 259:
            originalScript = "(game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) and npc_get(npc,12) and not npc_get(npc,16)";
            return((GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) && ScriptDaemon.npc_get(npc, 12) && !ScriptDaemon.npc_get(npc, 16));

        case 260:
            originalScript = "(game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) and npc_get(npc,13) and not npc_get(npc,17)";
            return((GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) && ScriptDaemon.npc_get(npc, 13) && !ScriptDaemon.npc_get(npc, 17));

        case 282:
        case 292:
        case 412:
            originalScript = "pc.skill_level_get(npc,skill_bluff) >= 15";
            return(pc.GetSkillLevel(npc, SkillId.bluff) >= 15);

        case 301:
            originalScript = "game.quests[77].state == qs_mentioned";
            return(GetQuestState(77) == QuestState.Mentioned);

        case 302:
            originalScript = "(game.global_vars[704] == 1 or game.global_vars[704] == 2) and game.quests[77].state == qs_accepted";
            return((GetGlobalVar(704) == 1 || GetGlobalVar(704) == 2) && GetQuestState(77) == QuestState.Accepted);

        case 303:
            originalScript = "game.global_vars[704] == 3 and game.quests[77].state == qs_accepted";
            return(GetGlobalVar(704) == 3 && GetQuestState(77) == QuestState.Accepted);

        case 311:
            originalScript = "is_daytime()";
            return(Utilities.is_daytime());

        case 312:
            originalScript = "not is_daytime()";
            return(!Utilities.is_daytime());

        case 371:
            originalScript = "game.quests[67].state == qs_mentioned";
            return(GetQuestState(67) == QuestState.Mentioned);

        case 372:
            originalScript = "game.quests[67].state == qs_accepted";
            return(GetQuestState(67) == QuestState.Accepted);

        case 381:
            originalScript = "game.quests[66].state == qs_mentioned";
            return(GetQuestState(66) == QuestState.Mentioned);

        case 382:
            originalScript = "game.quests[66].state == qs_accepted";
            return(GetQuestState(66) == QuestState.Accepted);

        case 471:
            originalScript = "not npc_get(npc,19)";
            return(!ScriptDaemon.npc_get(npc, 19));

        case 472:
            originalScript = "not npc_get(npc,20)";
            return(!ScriptDaemon.npc_get(npc, 20));

        case 473:
            originalScript = "not npc_get(npc,21)";
            return(!ScriptDaemon.npc_get(npc, 21));

        case 474:
            originalScript = "not npc_get(npc,22)";
            return(!ScriptDaemon.npc_get(npc, 22));

        case 482:
            originalScript = "not npc_get(npc,23)";
            return(!ScriptDaemon.npc_get(npc, 23));

        case 483:
            originalScript = "not npc_get(npc,24)";
            return(!ScriptDaemon.npc_get(npc, 24));

        case 484:
            originalScript = "not npc_get(npc,25)";
            return(!ScriptDaemon.npc_get(npc, 25));

        default:
            originalScript = null;
            return(true);
        }
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 12:
        case 32:
        case 52:
        case 72:
        case 92:
        case 112:
        case 132:
        case 152:
        case 172:
        case 192:
        case 212:
        case 232:
        case 282:
        case 302:
        case 322:
            originalScript = "not npc_get(npc,1)";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 13:
        case 33:
        case 53:
        case 73:
        case 93:
        case 113:
        case 133:
        case 153:
        case 173:
        case 193:
        case 213:
        case 233:
        case 283:
        case 303:
        case 323:
            originalScript = "not npc_get(npc,2)";
            return(!ScriptDaemon.npc_get(npc, 2));

        case 14:
        case 34:
        case 54:
        case 74:
        case 94:
        case 114:
        case 134:
        case 154:
        case 174:
        case 194:
        case 214:
        case 234:
        case 284:
        case 304:
        case 324:
            originalScript = "not npc_get(npc,3)";
            return(!ScriptDaemon.npc_get(npc, 3));

        case 15:
        case 35:
        case 55:
        case 75:
        case 95:
        case 115:
        case 135:
        case 155:
        case 175:
        case 195:
        case 215:
        case 235:
        case 285:
        case 305:
        case 325:
            originalScript = "not npc_get(npc,4)";
            return(!ScriptDaemon.npc_get(npc, 4));

        case 16:
        case 36:
        case 56:
        case 76:
        case 96:
        case 116:
        case 136:
        case 156:
        case 176:
        case 196:
        case 216:
        case 236:
        case 286:
        case 306:
        case 326:
            originalScript = "not npc_get(npc,5)";
            return(!ScriptDaemon.npc_get(npc, 5));

        case 17:
        case 37:
        case 57:
        case 77:
        case 97:
        case 117:
        case 137:
        case 157:
        case 177:
        case 197:
        case 217:
        case 237:
        case 287:
        case 307:
        case 327:
            originalScript = "not npc_get(npc,6)";
            return(!ScriptDaemon.npc_get(npc, 6));

        case 18:
        case 38:
        case 58:
        case 78:
        case 98:
        case 118:
        case 138:
        case 158:
        case 178:
        case 198:
        case 218:
        case 238:
        case 288:
        case 308:
        case 328:
            originalScript = "not npc_get(npc,7)";
            return(!ScriptDaemon.npc_get(npc, 7));

        case 19:
        case 39:
        case 59:
        case 79:
        case 99:
        case 119:
        case 139:
        case 159:
        case 179:
        case 199:
        case 219:
        case 239:
        case 289:
        case 309:
        case 329:
            originalScript = "not npc_get(npc,8)";
            return(!ScriptDaemon.npc_get(npc, 8));

        case 20:
        case 40:
        case 60:
        case 80:
        case 100:
        case 120:
        case 140:
        case 160:
        case 180:
        case 200:
        case 220:
        case 240:
        case 290:
        case 310:
        case 330:
            originalScript = "not npc_get(npc,9)";
            return(!ScriptDaemon.npc_get(npc, 9));

        case 21:
        case 41:
        case 61:
        case 81:
        case 101:
        case 121:
        case 141:
        case 161:
        case 181:
        case 201:
        case 221:
        case 241:
        case 291:
        case 311:
        case 331:
            originalScript = "not npc_get(npc,10)";
            return(!ScriptDaemon.npc_get(npc, 10));

        case 23:
        case 43:
        case 63:
        case 83:
        case 103:
        case 123:
        case 143:
        case 163:
        case 183:
        case 203:
        case 223:
        case 243:
        case 293:
        case 313:
        case 333:
            originalScript = "not npc_get(npc,12)";
            return(!ScriptDaemon.npc_get(npc, 12));

        case 24:
        case 44:
        case 64:
        case 84:
        case 104:
        case 124:
        case 144:
        case 164:
        case 184:
        case 204:
        case 224:
        case 244:
        case 294:
        case 314:
        case 334:
            originalScript = "npc_get(npc,12) and not npc_get(npc,13)";
            return(ScriptDaemon.npc_get(npc, 12) && !ScriptDaemon.npc_get(npc, 13));

        case 25:
        case 45:
        case 65:
        case 85:
        case 105:
        case 125:
        case 145:
        case 165:
        case 185:
        case 205:
        case 225:
        case 245:
        case 295:
        case 315:
        case 335:
            originalScript = "game.global_vars[938] == 1 and not npc_get(npc,14)";
            return(GetGlobalVar(938) == 1 && !ScriptDaemon.npc_get(npc, 14));

        case 26:
        case 46:
        case 66:
        case 86:
        case 106:
        case 126:
        case 146:
        case 166:
        case 186:
        case 206:
        case 226:
        case 246:
        case 296:
        case 316:
        case 336:
            originalScript = "npc_get(npc,10)";
            return(ScriptDaemon.npc_get(npc, 10));

        case 251:
            originalScript = "not npc_get(npc,11)";
            return(!ScriptDaemon.npc_get(npc, 11));

        case 362:
            originalScript = "game.global_vars[101] == 1";
            return(GetGlobalVar(101) == 1);

        case 363:
            originalScript = "game.global_vars[102] == 1";
            return(GetGlobalVar(102) == 1);

        case 364:
            originalScript = "game.global_vars[103] == 1";
            return(GetGlobalVar(103) == 1);

        case 372:
            originalScript = "game.global_vars[104] == 1";
            return(GetGlobalVar(104) == 1);

        case 373:
            originalScript = "game.global_vars[105] == 1";
            return(GetGlobalVar(105) == 1);

        case 374:
            originalScript = "game.global_vars[106] == 1";
            return(GetGlobalVar(106) == 1);

        case 382:
            originalScript = "game.global_vars[107] == 1";
            return(GetGlobalVar(107) == 1);

        case 383:
            originalScript = "game.global_vars[108] == 1";
            return(GetGlobalVar(108) == 1);

        case 384:
            originalScript = "game.global_vars[109] == 1";
            return(GetGlobalVar(109) == 1);

        case 392:
            originalScript = "game.global_vars[110] == 1";
            return(GetGlobalVar(110) == 1);

        case 393:
            originalScript = "game.global_vars[111] == 1";
            return(GetGlobalVar(111) == 1);

        case 394:
            originalScript = "game.global_vars[112] == 1";
            return(GetGlobalVar(112) == 1);

        case 402:
            originalScript = "game.global_vars[113] == 1";
            return(GetGlobalVar(113) == 1);

        case 403:
            originalScript = "game.global_vars[114] == 1";
            return(GetGlobalVar(114) == 1);

        case 404:
            originalScript = "game.global_vars[115] == 1";
            return(GetGlobalVar(115) == 1);

        case 411:
            originalScript = "game.global_vars[116] == 1";
            return(GetGlobalVar(116) == 1);

        case 412:
            originalScript = "game.global_vars[117] == 1";
            return(GetGlobalVar(117) == 1);

        case 413:
            originalScript = "game.global_vars[118] == 1";
            return(GetGlobalVar(118) == 1);

        case 414:
            originalScript = "game.global_vars[146] == 1";
            return(GetGlobalVar(146) == 1);

        case 422:
            originalScript = "game.global_vars[119] == 1";
            return(GetGlobalVar(119) == 1);

        case 423:
            originalScript = "game.global_vars[120] == 1";
            return(GetGlobalVar(120) == 1);

        case 424:
            originalScript = "game.global_vars[121] == 1";
            return(GetGlobalVar(121) == 1);

        case 432:
            originalScript = "game.global_vars[122] == 1";
            return(GetGlobalVar(122) == 1);

        case 433:
            originalScript = "game.global_vars[123] == 1";
            return(GetGlobalVar(123) == 1);

        case 434:
            originalScript = "game.global_vars[124] == 1";
            return(GetGlobalVar(124) == 1);

        case 442:
            originalScript = "game.global_vars[125] == 1";
            return(GetGlobalVar(125) == 1);

        case 443:
            originalScript = "game.global_vars[126] == 1";
            return(GetGlobalVar(126) == 1);

        case 444:
            originalScript = "game.global_vars[127] == 1";
            return(GetGlobalVar(127) == 1);

        case 452:
            originalScript = "game.global_vars[128] == 1";
            return(GetGlobalVar(128) == 1);

        case 453:
            originalScript = "game.global_vars[129] == 1";
            return(GetGlobalVar(129) == 1);

        case 454:
            originalScript = "game.global_vars[130] == 1";
            return(GetGlobalVar(130) == 1);

        case 462:
            originalScript = "game.global_vars[131] == 1";
            return(GetGlobalVar(131) == 1);

        case 463:
            originalScript = "game.global_vars[132] == 1";
            return(GetGlobalVar(132) == 1);

        case 464:
            originalScript = "game.global_vars[133] == 1";
            return(GetGlobalVar(133) == 1);

        case 472:
            originalScript = "game.global_vars[134] == 1";
            return(GetGlobalVar(134) == 1);

        case 473:
            originalScript = "game.global_vars[135] == 1";
            return(GetGlobalVar(135) == 1);

        case 474:
            originalScript = "game.global_vars[136] == 1";
            return(GetGlobalVar(136) == 1);

        case 482:
            originalScript = "game.global_vars[137] == 1";
            return(GetGlobalVar(137) == 1);

        case 483:
            originalScript = "game.global_vars[138] == 1";
            return(GetGlobalVar(138) == 1);

        case 484:
            originalScript = "game.global_vars[139] == 1";
            return(GetGlobalVar(139) == 1);

        case 492:
            originalScript = "game.global_vars[140] == 1";
            return(GetGlobalVar(140) == 1);

        case 493:
            originalScript = "game.global_vars[141] == 1";
            return(GetGlobalVar(141) == 1);

        case 501:
            originalScript = "game.global_vars[145] == 1";
            return(GetGlobalVar(145) == 1);

        case 502:
            originalScript = "game.global_vars[142] == 1";
            return(GetGlobalVar(142) == 1);

        case 503:
            originalScript = "game.global_vars[143] == 1";
            return(GetGlobalVar(143) == 1);

        case 504:
            originalScript = "game.global_vars[144] == 1";
            return(GetGlobalVar(144) == 1);

        case 521:
            originalScript = "(game.quests[109].state == qs_mentioned or game.quests[109].state == qs_accepted) and not npc_get(npc,21)";
            return((GetQuestState(109) == QuestState.Mentioned || GetQuestState(109) == QuestState.Accepted) && !ScriptDaemon.npc_get(npc, 21));

        case 522:
            originalScript = "game.quests[78].state == qs_accepted and not npc_get(npc,15)";
            return(GetQuestState(78) == QuestState.Accepted && !ScriptDaemon.npc_get(npc, 15));

        case 523:
            originalScript = "game.global_flags[869] == 1 and not npc_get(npc,16)";
            return(GetGlobalFlag(869) && !ScriptDaemon.npc_get(npc, 16));

        case 524:
            originalScript = "game.quests[90].state == qs_accepted and not npc_get(npc,17)";
            return(GetQuestState(90) == QuestState.Accepted && !ScriptDaemon.npc_get(npc, 17));

        case 532:
            originalScript = "not anyone( pc.group_list(), \"has_follower\", 8716 ) and game.quests[79].state == qs_accepted and not npc_get(npc,18)";
            return(!pc.GetPartyMembers().Any(o => o.HasFollowerByName(8716)) && GetQuestState(79) == QuestState.Accepted && !ScriptDaemon.npc_get(npc, 18));

        case 533:
            originalScript = "not anyone( pc.group_list(), \"has_follower\", 8717 ) and game.quests[80].state == qs_accepted and not npc_get(npc,19)";
            return(!pc.GetPartyMembers().Any(o => o.HasFollowerByName(8717)) && GetQuestState(80) == QuestState.Accepted && !ScriptDaemon.npc_get(npc, 19));

        case 534:
            originalScript = "not anyone( pc.group_list(), \"has_follower\", 8718 ) and game.quests[81].state == qs_accepted and not npc_get(npc,20)";
            return(!pc.GetPartyMembers().Any(o => o.HasFollowerByName(8718)) && GetQuestState(81) == QuestState.Accepted && !ScriptDaemon.npc_get(npc, 20));

        case 541:
            originalScript = "pc.money_get() >= 1000000";
            return(pc.GetMoney() >= 1000000);

        case 551:
        case 1631:
            originalScript = "pc.money_get() >= 400000";
            return(pc.GetMoney() >= 400000);

        case 561:
            originalScript = "pc.money_get() >= 800000";
            return(pc.GetMoney() >= 800000);

        case 571:
        case 581:
        case 591:
            originalScript = "pc.money_get() >= 600000";
            return(pc.GetMoney() >= 600000);

        case 661:
        case 671:
        case 681:
        case 691:
        case 701:
        case 711:
        case 721:
        case 731:
        case 741:
        case 751:
        case 761:
        case 771:
        case 781:
        case 791:
        case 801:
        case 811:
        case 821:
        case 831:
        case 841:
        case 851:
        case 861:
        case 871:
        case 881:
        case 891:
        case 901:
        case 911:
        case 921:
        case 931:
        case 941:
        case 951:
        case 961:
        case 971:
        case 981:
        case 991:
        case 1001:
        case 1011:
        case 1021:
        case 1031:
        case 1041:
        case 1051:
        case 1061:
        case 1071:
        case 1081:
        case 1091:
        case 1101:
        case 1621:
            originalScript = "pc.money_get() >= 100000";
            return(pc.GetMoney() >= 100000);

        case 892:
            originalScript = "pc.money_get() <= 99900";
            return(pc.GetMoney() <= 99900);

        default:
            originalScript = null;
            return(true);
        }
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 472:
            originalScript = "game.quests[74].state == qs_completed and game.quests[109].state == qs_unknown and game.global_flags[550] == 0 and not npc_get(npc,1)";
            return(GetQuestState(74) == QuestState.Completed && GetQuestState(109) == QuestState.Unknown && !GetGlobalFlag(550) && !ScriptDaemon.npc_get(npc, 1));

        case 473:
            originalScript = "(game.global_vars[949] >= 2 or game.party[0].reputation_has(47) == 1) and not npc_get(npc,2)";
            return((GetGlobalVar(949) >= 2 || PartyLeader.HasReputation(47)) && !ScriptDaemon.npc_get(npc, 2));

        case 474:
            originalScript = "game.quests[74].state == qs_completed and game.quests[78].state == qs_unknown and game.global_flags[935] == 0 and game.global_flags[992] == 0 and not npc_get(npc,3)";
            return(GetQuestState(74) == QuestState.Completed && GetQuestState(78) == QuestState.Unknown && !GetGlobalFlag(935) && !GetGlobalFlag(992) && !ScriptDaemon.npc_get(npc, 3));

        case 475:
            originalScript = "game.quests[78].state == qs_completed and game.quests[107].state == qs_unknown and game.global_flags[935] == 0 and game.global_flags[992] == 0 and not npc_get(npc,4)";
            return(GetQuestState(78) == QuestState.Completed && GetQuestState(107) == QuestState.Unknown && !GetGlobalFlag(935) && !GetGlobalFlag(992) && !ScriptDaemon.npc_get(npc, 4));

        case 476:
            originalScript = "game.global_flags[966] == 1 and game.global_vars[939] == 0 and game.global_flags[975] == 0 and game.global_flags[969] == 1 and not npc_get(npc,5)";
            return(GetGlobalFlag(966) && GetGlobalVar(939) == 0 && !GetGlobalFlag(975) && GetGlobalFlag(969) && !ScriptDaemon.npc_get(npc, 5));

        case 477:
            originalScript = "((game.global_vars[510] == 1 or game.global_vars[510] == 2) or ((game.global_vars[501] == 4 or game.global_vars[501] == 5 or game.global_vars[501] == 6) and game.quests[97].state != qs_completed)) and not npc_get(npc,6)";
            return(((GetGlobalVar(510) == 1 || GetGlobalVar(510) == 2) || ((GetGlobalVar(501) == 4 || GetGlobalVar(501) == 5 || GetGlobalVar(501) == 6) && GetQuestState(97) != QuestState.Completed)) && !ScriptDaemon.npc_get(npc, 6));

        case 478:
            originalScript = "game.global_flags[534] == 1";
            return(GetGlobalFlag(534));

        case 479:
            originalScript = "(game.quests[79].state == qs_completed or game.quests[80].state == qs_completed or game.quests[81].state == qs_completed) and game.quests[106].state == qs_unknown and not npc_get(npc,7)";
            return((GetQuestState(79) == QuestState.Completed || GetQuestState(80) == QuestState.Completed || GetQuestState(81) == QuestState.Completed) && GetQuestState(106) == QuestState.Unknown && !ScriptDaemon.npc_get(npc, 7));

        case 480:
            originalScript = "game.global_flags[249] == 1 and game.quests[95].state != qs_completed and not npc_get(npc,8)";
            return(GetGlobalFlag(249) && GetQuestState(95) != QuestState.Completed && !ScriptDaemon.npc_get(npc, 8));

        case 481:
            originalScript = "game.global_flags[962] == 0 and game.quests[95].state == qs_completed and game.quests[105].state == qs_unknown and not npc_get(npc,9)";
            return(!GetGlobalFlag(962) && GetQuestState(95) == QuestState.Completed && GetQuestState(105) == QuestState.Unknown && !ScriptDaemon.npc_get(npc, 9));

        case 482:
            originalScript = "game.global_flags[962] == 1 and game.quests[95].state == qs_completed and game.quests[105].state == qs_unknown and not npc_get(npc,10)";
            return(GetGlobalFlag(962) && GetQuestState(95) == QuestState.Completed && GetQuestState(105) == QuestState.Unknown && !ScriptDaemon.npc_get(npc, 10));

        case 1002:
            originalScript = "pc.map != 5066 and ( ( game.global_vars[491] & (2**5 + 2**6 + 2**15 ) ) != 0  or pc.reputation_has( 11 ) )";
            return(pc.GetMap() != 5066 && ((GetGlobalVar(491) & (0x20 + 0x40 + 0x8000)) != 0 || pc.HasReputation(11)));

        case 1003:
            originalScript = "pc.map != 5067 and ( ( game.global_vars[491] & (2**7 + 2**8 ) ) != 0  or pc.reputation_has( 10 ) or pc.reputation_has( 12 ) or pc.reputation_has( 13 ) )";
            return(pc.GetMap() != 5067 && ((GetGlobalVar(491) & (0x80 + 0x100)) != 0 || pc.HasReputation(10) || pc.HasReputation(12) || pc.HasReputation(13)));

        case 1004:
            originalScript = "pc.map != 5105 and ( game.global_vars[491] & (2**9 + 2**10 + 2**11 + 2**12) ) != 0";
            return(pc.GetMap() != 5105 && (GetGlobalVar(491) & (0x200 + 0x400 + 0x800 + 0x1000)) != 0);

        case 1005:
            originalScript = "( (pc.map != 5080 and ( game.global_vars[491] & (2**13 + 2**14 + 2**21) ) != 0) + ( ( game.global_vars[491] & (2**16 + 2**17 + 2**18 + 2**19) ) != 0 ) + ( pc.map != 5079 and ( game.global_vars[491] & (2**20) ) != 0 ) ) >= 1";
            return((pc.GetMap() != 5080 && (GetGlobalVar(491) & (0x2000 + 0x4000 + 0x200000)) != 0) || ((GetGlobalVar(491) & (0x10000 + 0x20000 + 0x40000 + 0x80000)) != 0) || (pc.GetMap() != 5079 && (GetGlobalVar(491) & (0x100000)) != 0));

        case 1012:
            originalScript = "pc.map != 5080 and ( game.global_vars[491] & (2**13 + 2**14 + 2**21) ) != 0";
            return(pc.GetMap() != 5080 && (GetGlobalVar(491) & (0x2000 + 0x4000 + 0x200000)) != 0);

        case 1013:
            originalScript = "( game.global_vars[491] & (2**16 + 2**17 + 2**18 + 2**19) ) != 0";
            return((GetGlobalVar(491) & (0x10000 + 0x20000 + 0x40000 + 0x80000)) != 0);

        case 1014:
            originalScript = "pc.map != 5079 and ( game.global_vars[491] & (2**20) ) != 0";
            return(pc.GetMap() != 5079 && (GetGlobalVar(491) & (0x100000)) != 0);

        case 1022:
            originalScript = "pc.map != 5064";
            return(pc.GetMap() != 5064);

        case 1023:
            originalScript = "pc.map != 5111 and ( game.global_vars[491] & ( 2**1) ) != 0";
            return(pc.GetMap() != 5111 && (GetGlobalVar(491) & (0x2)) != 0);

        case 1024:
            originalScript = "pc.map != 5065 and ( game.global_vars[491] & ( 2**2) ) != 0";
            return(pc.GetMap() != 5065 && (GetGlobalVar(491) & (0x4)) != 0);

        case 1025:
            originalScript = "( ( pc.map != 5064 ) + ( pc.map != 5111 and ( game.global_vars[491] & ( 2**1) ) != 0 ) + ( pc.map != 5065 and ( game.global_vars[491] & ( 2**2) ) != 0 ) + ( pc.map != 5112 and ( game.global_vars[491] & ( 2**4) ) != 0 ) + ( pc.map != 5092 and ( game.global_vars[491] & ( 2**3) ) != 0 ) + ( pc.map != 5110 and ( game.global_vars[491] & ( 2**0)) ) ) >= 5";
            return((pc.GetMap() != 5064) && (pc.GetMap() != 5111 && (GetGlobalVar(491) & (0x2)) != 0) && (pc.GetMap() != 5065 && (GetGlobalVar(491) & (0x4)) != 0) && (pc.GetMap() != 5112 && (GetGlobalVar(491) & (0x10)) != 0) && (pc.GetMap() != 5092 && (GetGlobalVar(491) & (0x8)) != 0) && (pc.GetMap() != 5110 && ((GetGlobalVar(491) & (0x1))) != 0));

        case 1026:
        case 1032:
            originalScript = "pc.map != 5112 and ( game.global_vars[491] & ( 2**4) ) != 0";
            return(pc.GetMap() != 5112 && (GetGlobalVar(491) & (0x10)) != 0);

        case 1027:
        case 1033:
            originalScript = "pc.map != 5092 and ( game.global_vars[491] & ( 2**3) ) != 0";
            return(pc.GetMap() != 5092 && (GetGlobalVar(491) & (0x8)) != 0);

        case 1028:
        case 1034:
            originalScript = "pc.map != 5110 and ( game.global_vars[491] & ( 2**0) ) != 0";
            return(pc.GetMap() != 5110 && (GetGlobalVar(491) & (0x1)) != 0);

        case 1042:
            originalScript = "( game.global_vars[491] & ( 2**5) ) != 0";
            return((GetGlobalVar(491) & (0x20)) != 0);

        case 1043:
            originalScript = "( game.global_vars[491] & ( 2**6) ) != 0";
            return((GetGlobalVar(491) & (0x40)) != 0);

        case 1044:
            originalScript = "pc.reputation_has( 11 )";
            return(pc.HasReputation(11));

        case 1045:
            originalScript = "( game.global_vars[491] & ( 2**15) ) != 0";
            return((GetGlobalVar(491) & (0x8000)) != 0);

        case 1062:
            originalScript = "( game.global_vars[491] & ( 2**7) ) != 0";
            return((GetGlobalVar(491) & (0x80)) != 0);

        case 1063:
            originalScript = "( game.global_vars[491] & ( 2**8) ) != 0";
            return((GetGlobalVar(491) & (0x100)) != 0);

        case 1064:
            originalScript = "pc.reputation_has( 13 )";
            return(pc.HasReputation(13));

        case 1065:
            originalScript = "(  ( ( game.global_vars[491] & ( 2**7) ) != 0 ) + ( ( game.global_vars[491] & ( 2**8) ) != 0 ) + ( pc.reputation_has( 13 ) ) + ( pc.reputation_has( 12 ) ) + ( pc.reputation_has( 10 ) )  ) >= 5";
            return(((GetGlobalVar(491) & (0x80)) != 0) && ((GetGlobalVar(491) & (0x100)) != 0) && (pc.HasReputation(13)) && (pc.HasReputation(12)) && (pc.HasReputation(10)));

        case 1066:
        case 1072:
            originalScript = "pc.reputation_has( 12 )";
            return(pc.HasReputation(12));

        case 1067:
        case 1073:
            originalScript = "pc.reputation_has( 10 )";
            return(pc.HasReputation(10));

        case 1082:
            originalScript = "( game.global_vars[491] & ( 2**9 ) ) != 0";
            return((GetGlobalVar(491) & (0x200)) != 0);

        case 1083:
            originalScript = "( game.global_vars[491] & ( 2**10) ) != 0";
            return((GetGlobalVar(491) & (0x400)) != 0);

        case 1084:
            originalScript = "( game.global_vars[491] & ( 2**11) ) != 0";
            return((GetGlobalVar(491) & (0x800)) != 0);

        case 1085:
            originalScript = "(  ( ( game.global_vars[491] & ( 2**9) ) != 0 ) + ( ( game.global_vars[491] & ( 2**10) ) != 0 ) + ( ( game.global_vars[491] & ( 2**11) ) != 0 ) + ( ( game.global_vars[491] & ( 2**12) ) != 0 ) + ( ( game.global_vars[491] & ( 2**22) ) != 0 )  ) >= 5";
            return(((GetGlobalVar(491) & (0x200)) != 0) && ((GetGlobalVar(491) & (0x400)) != 0) && ((GetGlobalVar(491) & (0x800)) != 0) && ((GetGlobalVar(491) & (0x1000)) != 0) && ((GetGlobalVar(491) & (0x400000)) != 0));

        case 1086:
        case 1092:
            originalScript = "( game.global_vars[491] & ( 2**12) ) != 0";
            return((GetGlobalVar(491) & (0x1000)) != 0);

        case 1087:
        case 1093:
            originalScript = "( game.global_vars[491] & ( 2**22) ) != 0 and not ( game.global_flags[194] == 1 or game.global_flags[182] == 1)";
            return((GetGlobalVar(491) & (0x400000)) != 0 && !(GetGlobalFlag(194) || GetGlobalFlag(182)));

        case 1088:
            originalScript = "( game.global_vars[491] & ( 2**22) ) != 0 and ( game.global_flags[194] == 1 or game.global_flags[182] == 1)";
            return((GetGlobalVar(491) & (0x400000)) != 0 && (GetGlobalFlag(194) || GetGlobalFlag(182)));

        case 1094:
            originalScript = "( game.global_vars[491] & ( 2**22) ) != 0 and( game.global_flags[194] == 1 or game.global_flags[182] == 1)";
            return((GetGlobalVar(491) & (0x400000)) != 0 && (GetGlobalFlag(194) || GetGlobalFlag(182)));

        case 1102:
            originalScript = "( game.global_vars[491] & (2**13 ) ) != 0";
            return((GetGlobalVar(491) & (0x2000)) != 0);

        case 1103:
            originalScript = "( game.global_vars[491] & (2**14 ) ) != 0";
            return((GetGlobalVar(491) & (0x4000)) != 0);

        case 1104:
            originalScript = "( game.global_vars[491] & (2**21 ) ) != 0";
            return((GetGlobalVar(491) & (0x200000)) != 0);

        case 1122:
            originalScript = "( game.global_vars[491] & ( 2**18) ) != 0";
            return((GetGlobalVar(491) & (0x40000)) != 0);

        case 1123:
            originalScript = "( game.global_vars[491] & ( 2**19) ) != 0";
            return((GetGlobalVar(491) & (0x80000)) != 0);

        case 1124:
            originalScript = "( game.global_vars[491] & ( 2**17) ) != 0";
            return((GetGlobalVar(491) & (0x20000)) != 0);

        case 1125:
            originalScript = "( game.global_vars[491] & ( 2**16) ) != 0";
            return((GetGlobalVar(491) & (0x10000)) != 0);

        default:
            originalScript = null;
            return(true);
        }
    }
Esempio n. 19
0
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        attachee.TurnTowards(triggerer);
        if ((attachee.GetMap() == 5070 || attachee.GetMap() == 5071 || attachee.GetMap() == 5072 || attachee.GetMap() == 5073 || attachee.GetMap() == 5074 || attachee.GetMap() == 5075 || attachee.GetMap() == 5076 || attachee.GetMap() == 5077))
        {
            if ((triggerer.GetRace() == RaceId.half_orc))
            {
                triggerer.BeginDialog(attachee, 6);
            }
            else
            {
                triggerer.BeginDialog(attachee, 1);
            }
        }
        else if ((attachee.GetMap() == 5171))
        {
            if ((GetGlobalFlag(560) && GetGlobalFlag(561) && GetGlobalFlag(562)))
            {
                if ((!GetGlobalFlag(549)))
                {
                    triggerer.BeginDialog(attachee, 240);
                }
                else
                {
                    if ((!GetGlobalFlag(962)))
                    {
                        triggerer.BeginDialog(attachee, 510);
                    }
                    else
                    {
                        triggerer.BeginDialog(attachee, 520);
                    }
                }
            }
            else
            {
                if ((GetGlobalFlag(563)))
                {
                    triggerer.BeginDialog(attachee, 540);
                }
                else
                {
                    if ((!ScriptDaemon.npc_get(attachee, 1)))
                    {
                        triggerer.BeginDialog(attachee, 530);
                        ScriptDaemon.npc_set(attachee, 1);
                    }
                    else
                    {
                        if ((!GetGlobalFlag(962)))
                        {
                            triggerer.BeginDialog(attachee, 550);
                        }
                        else
                        {
                            triggerer.BeginDialog(attachee, 560);
                        }
                    }
                }
            }
        }

        return(SkipDefault);
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
            originalScript = "not npc.has_met(pc)";
            return(!npc.HasMet(pc));

        case 3:
            originalScript = "npc.has_met(pc)";
            return(npc.HasMet(pc));

        case 11:
        case 71:
        case 211:
        case 261:
        case 271:
            originalScript = "game.party_alignment == LAWFUL_GOOD or game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == LAWFUL_EVIL";
            return(PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL);

        case 12:
        case 72:
        case 212:
        case 262:
        case 272:
            originalScript = "game.party_alignment == NEUTRAL_GOOD or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == NEUTRAL_EVIL";
            return(PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.NEUTRAL_EVIL);

        case 13:
        case 73:
        case 213:
        case 263:
        case 273:
            originalScript = "game.party_alignment == CHAOTIC_GOOD or game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == CHAOTIC_EVIL";
            return(PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.CHAOTIC_EVIL);

        case 14:
            originalScript = "game.quests[74].state != qs_unknown";
            return(GetQuestState(74) != QuestState.Unknown);

        case 15:
            originalScript = "game.quests[69].state != qs_unknown";
            return(GetQuestState(69) != QuestState.Unknown);

        case 21:
            originalScript = "game.quests[79].state == qs_mentioned";
            return(GetQuestState(79) == QuestState.Mentioned);

        case 22:
            originalScript = "game.quests[80].state == qs_mentioned";
            return(GetQuestState(80) == QuestState.Mentioned);

        case 23:
            originalScript = "game.quests[81].state == qs_mentioned";
            return(GetQuestState(81) == QuestState.Mentioned);

        case 24:
            originalScript = "game.global_vars[964] == 1";
            return(GetGlobalVar(964) == 1);

        case 25:
            originalScript = "game.global_vars[964] == 0";
            return(GetGlobalVar(964) == 0);

        case 26:
        case 171:
        case 181:
            originalScript = "game.global_flags[956] == 1 and game.quests[79].state != qs_completed";
            return(GetGlobalFlag(956) && GetQuestState(79) != QuestState.Completed);

        case 27:
        case 182:
        case 311:
            originalScript = "game.global_flags[957] == 1 and game.quests[80].state != qs_completed";
            return(GetGlobalFlag(957) && GetQuestState(80) != QuestState.Completed);

        case 28:
        case 183:
        case 321:
            originalScript = "game.global_flags[958] == 1 and game.quests[81].state != qs_completed";
            return(GetGlobalFlag(958) && GetQuestState(81) != QuestState.Completed);

        case 29:
            originalScript = "game.global_vars[951] == 2";
            return(GetGlobalVar(951) == 2);

        case 30:
            originalScript = "game.global_vars[952] == 2";
            return(GetGlobalVar(952) == 2);

        case 31:
            originalScript = "game.global_vars[953] == 2";
            return(GetGlobalVar(953) == 2);

        case 32:
            originalScript = "game.global_vars[964] == 4";
            return(GetGlobalVar(964) == 4);

        case 33:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) or (game.quests[84].state == qs_accepted or game.quests[84].state == qs_mentioned) or (game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) or (game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) || (GetQuestState(84) == QuestState.Accepted || GetQuestState(84) == QuestState.Mentioned) || (GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) || (GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned));

        case 34:
            originalScript = "game.quests[78].state == qs_accepted";
            return(GetQuestState(78) == QuestState.Accepted);

        case 35:
            originalScript = "(game.global_flags[943] == 1 or game.global_vars[945] == 28) and not npc_get(npc,19)";
            return((GetGlobalFlag(943) || GetGlobalVar(945) == 28) && !ScriptDaemon.npc_get(npc, 19));

        case 36:
            originalScript = "game.global_vars[945] == 29 and not npc_get(npc,20)";
            return(GetGlobalVar(945) == 29 && !ScriptDaemon.npc_get(npc, 20));

        case 37:
            originalScript = "game.global_vars[945] == 30 and not npc_get(npc,21)";
            return(GetGlobalVar(945) == 30 && !ScriptDaemon.npc_get(npc, 21));

        case 38:
            originalScript = "game.quests[62].state == qs_accepted and (game.global_flags[560] == 0 or game.global_flags[561] == 0 or game.global_flags[562] == 0) and not npc_get(npc,22)";
            return(GetQuestState(62) == QuestState.Accepted && (!GetGlobalFlag(560) || !GetGlobalFlag(561) || !GetGlobalFlag(562)) && !ScriptDaemon.npc_get(npc, 22));

        case 61:
            originalScript = "pc.reputation_has( 15 ) == 1";
            return(pc.HasReputation(15));

        case 62:
            originalScript = "pc.reputation_has( 33 ) == 1";
            return(pc.HasReputation(33));

        case 63:
            originalScript = "pc.reputation_has( 17 ) == 1";
            return(pc.HasReputation(17));

        case 64:
            originalScript = "pc.reputation_has( 22 ) == 1";
            return(pc.HasReputation(22));

        case 91:
        case 111:
        case 121:
        case 201:
            originalScript = "not npc_get(npc,1)";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 92:
        case 101:
        case 122:
        case 202:
            originalScript = "not npc_get(npc,2)";
            return(!ScriptDaemon.npc_get(npc, 2));

        case 93:
        case 102:
        case 112:
        case 203:
            originalScript = "not npc_get(npc,3)";
            return(!ScriptDaemon.npc_get(npc, 3));

        case 131:
            originalScript = "get_1(npc) and game.quests[79].state == qs_mentioned";
            return(Scripts.get_1(npc) && GetQuestState(79) == QuestState.Mentioned);

        case 132:
            originalScript = "get_2(npc) and game.quests[80].state == qs_mentioned";
            return(Scripts.get_2(npc) && GetQuestState(80) == QuestState.Mentioned);

        case 133:
            originalScript = "get_3(npc) and game.quests[81].state == qs_mentioned";
            return(Scripts.get_3(npc) && GetQuestState(81) == QuestState.Mentioned);

        case 191:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) >= 14";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) >= 14);

        case 192:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) <= 13";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) <= 13);

        case 204:
            originalScript = "not npc_get(npc,1) and not npc_get(npc,2) and not npc_get(npc,3)";
            return(!ScriptDaemon.npc_get(npc, 1) && !ScriptDaemon.npc_get(npc, 2) && !ScriptDaemon.npc_get(npc, 3));

        case 361:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) and game.global_flags[989] == 0 and game.global_flags[946] == 0 and game.global_flags[863] == 0 and not npc_get(npc,7)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) && !GetGlobalFlag(989) && !GetGlobalFlag(946) && !GetGlobalFlag(863) && !ScriptDaemon.npc_get(npc, 7));

        case 362:
            originalScript = "(game.quests[84].state == qs_accepted or game.quests[84].state == qs_mentioned) and game.global_flags[973] == 0 and not npc_get(npc,6)";
            return((GetQuestState(84) == QuestState.Accepted || GetQuestState(84) == QuestState.Mentioned) && !GetGlobalFlag(973) && !ScriptDaemon.npc_get(npc, 6));

        case 363:
            originalScript = "(game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned) and game.global_flags[989] == 0 and not npc_get(npc,5)";
            return((GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned) && !GetGlobalFlag(989) && !ScriptDaemon.npc_get(npc, 5));

        case 364:
            originalScript = "(game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) and game.global_flags[989] == 0 and not npc_get(npc,4)";
            return((GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) && !GetGlobalFlag(989) && !ScriptDaemon.npc_get(npc, 4));

        case 365:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) and game.global_flags[989] == 0 and npc_get(npc,8) and not npc_get(npc,10)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) && !GetGlobalFlag(989) && ScriptDaemon.npc_get(npc, 8) && !ScriptDaemon.npc_get(npc, 10));

        case 366:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) and game.global_flags[989] == 0 and npc_get(npc,9) and not npc_get(npc,11)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) && !GetGlobalFlag(989) && ScriptDaemon.npc_get(npc, 9) && !ScriptDaemon.npc_get(npc, 11));

        case 402:
            originalScript = "pc.skill_level_get(npc,skill_bluff) >= 15";
            return(pc.GetSkillLevel(npc, SkillId.bluff) >= 15);

        case 411:
            originalScript = "game.quests[77].state == qs_mentioned";
            return(GetQuestState(77) == QuestState.Mentioned);

        case 412:
            originalScript = "(game.global_vars[704] == 1 or game.global_vars[704] == 2) and game.quests[77].state == qs_accepted";
            return((GetGlobalVar(704) == 1 || GetGlobalVar(704) == 2) && GetQuestState(77) == QuestState.Accepted);

        case 413:
            originalScript = "game.global_vars[704] == 3 and game.quests[77].state == qs_accepted";
            return(GetGlobalVar(704) == 3 && GetQuestState(77) == QuestState.Accepted);

        case 421:
            originalScript = "is_daytime()";
            return(Utilities.is_daytime());

        case 422:
            originalScript = "not is_daytime()";
            return(!Utilities.is_daytime());

        case 491:
            originalScript = "not npc_get(npc,12)";
            return(!ScriptDaemon.npc_get(npc, 12));

        case 492:
            originalScript = "not npc_get(npc,13)";
            return(!ScriptDaemon.npc_get(npc, 13));

        case 493:
            originalScript = "not npc_get(npc,14)";
            return(!ScriptDaemon.npc_get(npc, 14));

        case 494:
            originalScript = "not npc_get(npc,15)";
            return(!ScriptDaemon.npc_get(npc, 15));

        case 502:
            originalScript = "not npc_get(npc,16)";
            return(!ScriptDaemon.npc_get(npc, 16));

        case 503:
            originalScript = "not npc_get(npc,17)";
            return(!ScriptDaemon.npc_get(npc, 17));

        case 504:
            originalScript = "not npc_get(npc,18)";
            return(!ScriptDaemon.npc_get(npc, 18));

        default:
            originalScript = null;
            return(true);
        }
    }
    // EVERYTHING BELOW HAS TO DO WITH SITRA'S RANNOS AND GREMAG MOD AS FAR AS I KNOW #

    public static int council_heartbeat(GameObject attachee)
    {
        var c_time = Council.council_time();

        // 1 - between 22:00 and 22:30 on council day
        // 2 - between 22:30 and 23:00
        // 3 - between 19:00 and 22:00
        // 4 - after council events ( >23:00 and beyond that day), but without ordinary council
        // 5 - ordinary council time
        // 0 - otherwise
        if (Council.traders_awol() == 1)
        {
            ScriptDaemon.set_v(435, 6);
        }

        if (c_time == 5)
        {
            ScriptDaemon.set_v(440, 1);
        }
        else if (c_time == 1)
        {
            if (ScriptDaemon.get_v(435) == 1)
            {
                ScriptDaemon.set_v(435, 3);
            }
            else if (ScriptDaemon.get_v(435) >= 5 || ScriptDaemon.get_v(435) == 0 && ScriptDaemon.get_v(440) == 0)
            {
                ScriptDaemon.set_v(440, 1);
            }
            else if (ScriptDaemon.get_v(435) == 4)
            {
                // council_events()
                var dummy = 1;
            }
        }
        else if (c_time == 2)
        {
            if (ScriptDaemon.get_v(435) == 3 || ScriptDaemon.get_v(435) == 1)
            {
                ScriptDaemon.set_v(435, 4);
                ScriptDaemon.set_v(436, 1);
                SetGlobalFlag(432, true);
            }
        }
        // council_events()
        else if (c_time == 3)
        {
            if (ScriptDaemon.get_v(435) == 2)
            {
                ScriptDaemon.set_v(435, 5);
                ScriptDaemon.set_v(436, 5);
                SetGlobalVar(750, 3);
                SetGlobalVar(751, 3);
                if ((!PartyLeader.HasReputation(23) && (!GetGlobalFlag(814) || !GetGlobalFlag(815))))
                {
                    PartyLeader.AddReputation(23);
                }
            }
        }
        else if ((c_time == 0 || c_time == 4))
        {
            if (c_time == 0 && GetGlobalFlag(336) && (ScriptDaemon.get_v(435) == 1 || ScriptDaemon.get_v(435) == 2))
            {
                ScriptDaemon.set_v(435, 0);
            }
            else if (ScriptDaemon.get_v(435) == 3 || ScriptDaemon.get_v(435) == 4 || (ScriptDaemon.get_v(435) == 1 && c_time == 4))
            {
                // chiefly used for the case where the whole thing played out without you
                if (ScriptDaemon.get_v(436) == 0)
                {
                    ScriptDaemon.set_v(436, 1);
                }

                ScriptDaemon.set_v(435, 5);
                if ((!PartyLeader.HasReputation(23) && (!GetGlobalFlag(814) || !GetGlobalFlag(815))))
                {
                    PartyLeader.AddReputation(23);
                }
            }

            if (!ScriptDaemon.npc_get(attachee, 10) && attachee.GetMap() == 5001 && c_time == 4)
            {
                hommletans_go_home();
                ScriptDaemon.npc_set(attachee, 10);
            }

            if (ScriptDaemon.get_v(435) == 2 && c_time == 4)
            {
                ScriptDaemon.set_v(435, 5);
                ScriptDaemon.set_v(436, 5);
                SetGlobalVar(750, 3);
                SetGlobalVar(751, 3);
                if ((!PartyLeader.HasReputation(23) && (!GetGlobalFlag(814) || !GetGlobalFlag(815))))
                {
                    PartyLeader.AddReputation(23);
                }
            }

            ScriptDaemon.set_v(440, 0);
        }

        return(1);
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
            originalScript = "not npc.has_met( pc ) and pc.stat_level_get( stat_gender ) == gender_male";
            return(!npc.HasMet(pc) && pc.GetGender() == Gender.Male);

        case 3:
            originalScript = "npc.has_met( pc ) and pc.stat_level_get( stat_gender ) == gender_male";
            return(npc.HasMet(pc) && pc.GetGender() == Gender.Male);

        case 4:
            originalScript = "not npc.has_met( pc ) and pc.stat_level_get( stat_gender ) == gender_female";
            return(!npc.HasMet(pc) && pc.GetGender() == Gender.Female);

        case 5:
            originalScript = "npc.has_met( pc ) and pc.stat_level_get( stat_gender ) == gender_female";
            return(npc.HasMet(pc) && pc.GetGender() == Gender.Female);

        case 21:
        case 121:
            originalScript = "game.global_vars[704] == 1 and game.quests[77].state == qs_accepted";
            return(GetGlobalVar(704) == 1 && GetQuestState(77) == QuestState.Accepted);

        case 22:
        case 122:
            originalScript = "game.global_flags[992] == 1 and game.global_flags[935] == 0 and game.quests[77].state == qs_accepted";
            return(GetGlobalFlag(992) && !GetGlobalFlag(935) && GetQuestState(77) == QuestState.Accepted);

        case 23:
        case 123:
            originalScript = "game.quests[76].state == qs_accepted";
            return(GetQuestState(76) == QuestState.Accepted);

        case 24:
        case 124:
            originalScript = "game.quests[76].state == qs_mentioned";
            return(GetQuestState(76) == QuestState.Mentioned);

        case 25:
        case 125:
            originalScript = "game.global_flags[965] == 1 and game.quests[66].state == qs_accepted";
            return(GetGlobalFlag(965) && GetQuestState(66) == QuestState.Accepted);

        case 26:
        case 126:
            originalScript = "game.global_flags[964] == 1 and game.global_flags[963] == 0 and game.quests[67].state == qs_accepted";
            return(GetGlobalFlag(964) && !GetGlobalFlag(963) && GetQuestState(67) == QuestState.Accepted);

        case 27:
        case 127:
            originalScript = "game.global_flags[964] == 1 and game.global_flags[963] == 1 and game.quests[67].state == qs_accepted and game.party[0].reputation_has(35)";
            return(GetGlobalFlag(964) && GetGlobalFlag(963) && GetQuestState(67) == QuestState.Accepted && PartyLeader.HasReputation(35));

        case 28:
        case 128:
            originalScript = "game.quests[66].state == qs_mentioned";
            return(GetQuestState(66) == QuestState.Mentioned);

        case 29:
        case 129:
            originalScript = "game.quests[67].state == qs_mentioned";
            return(GetQuestState(67) == QuestState.Mentioned);

        case 30:
        case 130:
            originalScript = "game.quests[77].state == qs_mentioned";
            return(GetQuestState(77) == QuestState.Mentioned);

        case 31:
        case 131:
            originalScript = "game.global_vars[978] == 1 and game.global_vars[965] == 0 and (pc.skill_level_get(npc,skill_spot) >= 11 or party_spot_check() >= 11)";
            throw new NotSupportedException("Conversion failed.");

        case 32:
        case 132:
            originalScript = "game.global_vars[978] == 3 and game.global_vars[965] == 1";
            return(GetGlobalVar(978) == 3 && GetGlobalVar(965) == 1);

        case 33:
        case 133:
            originalScript = "game.global_vars[978] == 4 and game.global_vars[965] == 1";
            return(GetGlobalVar(978) == 4 && GetGlobalVar(965) == 1);

        case 34:
        case 134:
            originalScript = "game.global_vars[978] == 5 and game.global_vars[965] == 1";
            return(GetGlobalVar(978) == 5 && GetGlobalVar(965) == 1);

        case 35:
        case 135:
            originalScript = "game.global_vars[958] == 8";
            return(GetGlobalVar(958) == 8);

        case 36:
        case 136:
            originalScript = "game.global_vars[959] == 4";
            return(GetGlobalVar(959) == 4);

        case 37:
        case 137:
            originalScript = "game.global_vars[704] == 2 and game.quests[77].state == qs_accepted and is_daytime()";
            return(GetGlobalVar(704) == 2 && GetQuestState(77) == QuestState.Accepted && Utilities.is_daytime());

        case 38:
        case 138:
            originalScript = "game.global_flags[964] == 1 and game.global_flags[963] == 1 and game.quests[67].state == qs_accepted and not game.party[0].reputation_has(35)";
            return(GetGlobalFlag(964) && GetGlobalFlag(963) && GetQuestState(67) == QuestState.Accepted && !PartyLeader.HasReputation(35));

        case 39:
        case 139:
            originalScript = "game.global_vars[704] == 20";
            return(GetGlobalVar(704) == 20);

        case 40:
        case 140:
            originalScript = "game.global_flags[992] == 0 and game.global_flags[935] == 0 and game.quests[77].state == qs_accepted and game.global_vars[704] == 9";
            return(!GetGlobalFlag(992) && !GetGlobalFlag(935) && GetQuestState(77) == QuestState.Accepted && GetGlobalVar(704) == 9);

        case 41:
        case 141:
            originalScript = "game.global_flags[960] == 1 and game.quests[78].state == qs_accepted";
            return(GetGlobalFlag(960) && GetQuestState(78) == QuestState.Accepted);

        case 46:
        case 146:
            originalScript = "pc.skill_level_get(npc,skill_bluff) >= 10 and pc.reputation_has( 24 ) == 0";
            return(pc.GetSkillLevel(npc, SkillId.bluff) >= 10 && !pc.HasReputation(24));

        case 47:
        case 147:
            originalScript = "pc.skill_level_get(npc,skill_bluff) <= 9 and pc.reputation_has( 24 ) == 0";
            return(pc.GetSkillLevel(npc, SkillId.bluff) <= 9 && !pc.HasReputation(24));

        case 48:
        case 148:
            originalScript = "pc.reputation_has( 24 ) == 1";
            return(pc.HasReputation(24));

        case 71:
        case 171:
            originalScript = "pc.skill_level_get(npc,skill_bluff) <= 9 and pc.reputation_has( 24 ) == 0 and pc.reputation_has( 21 ) == 0";
            return(pc.GetSkillLevel(npc, SkillId.bluff) <= 9 && !pc.HasReputation(24) && !pc.HasReputation(21));

        case 72:
        case 172:
            originalScript = "pc.skill_level_get(npc,skill_bluff) >= 10 and pc.reputation_has( 24 ) == 0 and pc.reputation_has( 21 ) == 0";
            return(pc.GetSkillLevel(npc, SkillId.bluff) >= 10 && !pc.HasReputation(24) && !pc.HasReputation(21));

        case 73:
        case 173:
            originalScript = "pc.reputation_has( 24 ) == 1 and pc.reputation_has( 21 ) == 0";
            return(pc.HasReputation(24) && !pc.HasReputation(21));

        case 74:
        case 174:
            originalScript = "pc.reputation_has( 24 ) == 1 and pc.reputation_has( 21 ) == 1";
            return(pc.HasReputation(24) && pc.HasReputation(21));

        case 261:
            originalScript = "(anyone( pc.group_list(), \"item_find\", 12036 ))";
            return(pc.GetPartyMembers().Any(o => o.FindItemByName(12036) != null));

        case 281:
        case 561:
            originalScript = "game.global_flags[992] == 0";
            return(!GetGlobalFlag(992));

        case 282:
        case 562:
            originalScript = "game.global_flags[992] == 1";
            return(GetGlobalFlag(992));

        case 311:
            originalScript = "game.global_flags[94] == 1";
            return(GetGlobalFlag(94));

        case 312:
            originalScript = "game.global_flags[94] == 0";
            return(!GetGlobalFlag(94));

        case 351:
        case 361:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) >= 9";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) >= 9);

        case 352:
        case 362:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) <= 8";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) <= 8);

        case 392:
        case 402:
            originalScript = "game.global_flags[704] == 1";
            return(GetGlobalFlag(704));

        case 441:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) >= 8";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) >= 8);

        case 444:
        case 462:
        case 471:
            originalScript = "game.global_flags[974] == 0";
            return(!GetGlobalFlag(974));

        case 445:
        case 463:
        case 473:
            originalScript = "game.global_flags[974] == 1";
            return(GetGlobalFlag(974));

        case 621:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) >= 13";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) >= 13);

        case 632:
            originalScript = "pc.skill_level_get(npc,skill_intimidate) >= 16 and game.quests[77].state == qs_botched";
            return(pc.GetSkillLevel(npc, SkillId.intimidate) >= 16 && GetQuestState(77) == QuestState.Botched);

        case 633:
            originalScript = "pc.skill_level_get(npc,skill_intimidate) >= 16 and game.quests[77].state == qs_completed";
            return(pc.GetSkillLevel(npc, SkillId.intimidate) >= 16 && GetQuestState(77) == QuestState.Completed);

        case 641:
            originalScript = "game.quests[77].state == qs_botched";
            return(GetQuestState(77) == QuestState.Botched);

        case 642:
            originalScript = "game.quests[77].state == qs_completed";
            return(GetQuestState(77) == QuestState.Completed);

        case 661:
            originalScript = "game.global_vars[945] == 1";
            return(GetGlobalVar(945) == 1);

        case 662:
            originalScript = "game.global_vars[945] == 2";
            return(GetGlobalVar(945) == 2);

        case 663:
            originalScript = "game.global_vars[945] == 3";
            return(GetGlobalVar(945) == 3);

        case 751:
            originalScript = "not npc_get(npc,1)";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 752:
            originalScript = "not npc_get(npc,2)";
            return(!ScriptDaemon.npc_get(npc, 2));

        case 753:
            originalScript = "not npc_get(npc,3)";
            return(!ScriptDaemon.npc_get(npc, 3));

        case 754:
            originalScript = "not npc_get(npc,4)";
            return(!ScriptDaemon.npc_get(npc, 4));

        case 762:
            originalScript = "not npc_get(npc,5)";
            return(!ScriptDaemon.npc_get(npc, 5));

        case 763:
            originalScript = "not npc_get(npc,6)";
            return(!ScriptDaemon.npc_get(npc, 6));

        case 764:
            originalScript = "not npc_get(npc,7)";
            return(!ScriptDaemon.npc_get(npc, 7));

        default:
            originalScript = null;
            return(true);
        }
    }
Esempio n. 23
0
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
        case 3:
            originalScript = "not npc.has_met( pc )";
            return(!npc.HasMet(pc));

        case 4:
            originalScript = "npc.has_met( pc )";
            return(npc.HasMet(pc));

        case 12:
            originalScript = "(game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD or game.party_alignment == CHAOTIC_GOOD) and pc.stat_level_get(stat_level_paladin) == 0";
            return((PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.CHAOTIC_GOOD) && pc.GetStat(Stat.level_paladin) == 0);

        case 13:
            originalScript = "(game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == CHAOTIC_NEUTRAL)";
            return(PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.CHAOTIC_NEUTRAL);

        case 14:
            originalScript = "(game.party_alignment == LAWFUL_EVIL or game.party_alignment == CHAOTIC_EVIL or game.party_alignment == NEUTRAL_EVIL)";
            return(PartyAlignment == Alignment.LAWFUL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL || PartyAlignment == Alignment.NEUTRAL_EVIL);

        case 15:
            originalScript = "pc.stat_level_get(stat_level_paladin) >= 1";
            return(pc.GetStat(Stat.level_paladin) >= 1);

        case 22:
        case 52:
            originalScript = "game.quests[78].state == qs_accepted";
            return(GetQuestState(78) == QuestState.Accepted);

        case 61:
            originalScript = "not npc_get(npc,1)";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 62:
            originalScript = "not npc_get(npc,2)";
            return(!ScriptDaemon.npc_get(npc, 2));

        case 63:
            originalScript = "not npc_get(npc,3)";
            return(!ScriptDaemon.npc_get(npc, 3));

        case 64:
            originalScript = "not npc_get(npc,4)";
            return(!ScriptDaemon.npc_get(npc, 4));

        case 72:
            originalScript = "not npc_get(npc,5)";
            return(!ScriptDaemon.npc_get(npc, 5));

        case 73:
            originalScript = "not npc_get(npc,6)";
            return(!ScriptDaemon.npc_get(npc, 6));

        case 74:
            originalScript = "not npc_get(npc,7)";
            return(!ScriptDaemon.npc_get(npc, 7));

        case 75:
            originalScript = "(npc_get(npc,1) or npc_get(npc,4)) and not npc_get(npc,8)";
            return((ScriptDaemon.npc_get(npc, 1) || ScriptDaemon.npc_get(npc, 4)) && !ScriptDaemon.npc_get(npc, 8));

        default:
            originalScript = null;
            return(true);
        }
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
            originalScript = "game.global_flags[970] == 0";
            return(!GetGlobalFlag(970));

        case 3:
            originalScript = "game.global_flags[970] == 1";
            return(GetGlobalFlag(970));

        case 4:
            originalScript = "npc.has_met(pc)";
            return(npc.HasMet(pc));

        case 11:
            originalScript = "game.party_alignment == LAWFUL_GOOD";
            return(PartyAlignment == Alignment.LAWFUL_GOOD);

        case 12:
            originalScript = "game.party_alignment == NEUTRAL_GOOD";
            return(PartyAlignment == Alignment.NEUTRAL_GOOD);

        case 13:
            originalScript = "game.party_alignment == CHAOTIC_GOOD";
            return(PartyAlignment == Alignment.CHAOTIC_GOOD);

        case 14:
            originalScript = "game.party_alignment == LAWFUL_NEUTRAL";
            return(PartyAlignment == Alignment.LAWFUL_NEUTRAL);

        case 15:
            originalScript = "game.party_alignment == TRUE_NEUTRAL";
            return(PartyAlignment == Alignment.NEUTRAL);

        case 16:
            originalScript = "game.party_alignment == CHAOTIC_NEUTRAL";
            return(PartyAlignment == Alignment.CHAOTIC_NEUTRAL);

        case 17:
            originalScript = "game.party_alignment == LAWFUL_EVIL";
            return(PartyAlignment == Alignment.LAWFUL_EVIL);

        case 18:
            originalScript = "game.party_alignment == NEUTRAL_EVIL";
            return(PartyAlignment == Alignment.NEUTRAL_EVIL);

        case 19:
            originalScript = "game.party_alignment == CHAOTIC_EVIL";
            return(PartyAlignment == Alignment.CHAOTIC_EVIL);

        case 21:
            originalScript = "game.quests[75].state == qs_accepted";
            return(GetQuestState(75) == QuestState.Accepted);

        case 22:
            originalScript = "game.global_vars[997] == 1 or game.global_vars[997] == 2 or game.global_vars[997] == 3";
            return(GetGlobalVar(997) == 1 || GetGlobalVar(997) == 2 || GetGlobalVar(997) == 3);

        case 23:
            originalScript = "game.quests[74].state == qs_mentioned";
            return(GetQuestState(74) == QuestState.Mentioned);

        case 24:
            originalScript = "game.quests[74].state == qs_accepted or game.quests[77].state == qs_mentioned or game.quests[77].state == qs_accepted or game.quests[76].state == qs_mentioned or game.quests[76].state == qs_accepted";
            return(GetQuestState(74) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned || GetQuestState(77) == QuestState.Accepted || GetQuestState(76) == QuestState.Mentioned || GetQuestState(76) == QuestState.Accepted);

        case 25:
            originalScript = "game.quests[78].state == qs_mentioned";
            return(GetQuestState(78) == QuestState.Mentioned);

        case 26:
            originalScript = "game.global_vars[993] == 3";
            return(GetGlobalVar(993) == 3);

        case 27:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) or (game.quests[84].state == qs_accepted or game.quests[84].state == qs_mentioned) or (game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) or (game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned)";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) || (GetQuestState(84) == QuestState.Accepted || GetQuestState(84) == QuestState.Mentioned) || (GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) || (GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned));

        case 31:
            originalScript = "pc.skill_level_get(npc,skill_diplomacy) >= 8";
            return(pc.GetSkillLevel(npc, SkillId.diplomacy) >= 8);

        case 41:
            originalScript = "pc.skill_level_get(npc,skill_bluff) >= 8";
            return(pc.GetSkillLevel(npc, SkillId.bluff) >= 8);

        case 51:
            originalScript = "pc.stat_level_get( stat_gender ) == gender_male and pc.skill_level_get(npc,skill_intimidate) >= 8";
            return(pc.GetGender() == Gender.Male && pc.GetSkillLevel(npc, SkillId.intimidate) >= 8);

        case 52:
            originalScript = "pc.stat_level_get( stat_gender ) == gender_female and pc.skill_level_get(npc,skill_intimidate) >= 8";
            return(pc.GetGender() == Gender.Female && pc.GetSkillLevel(npc, SkillId.intimidate) >= 8);

        case 65:
        case 425:
            originalScript = "game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD or game.party_alignment == CHAOTIC_GOOD";
            return(PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.CHAOTIC_GOOD);

        case 66:
        case 426:
            originalScript = "game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == CHAOTIC_NEUTRAL";
            return(PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.CHAOTIC_NEUTRAL);

        case 67:
        case 427:
            originalScript = "game.party_alignment == LAWFUL_EVIL or game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL";
            return(PartyAlignment == Alignment.LAWFUL_EVIL || PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL);

        case 83:
            originalScript = "game.quests[69].state >= qs_mentioned";
            return(GetQuestState(69) >= QuestState.Mentioned);

        case 113:
        case 132:
            originalScript = "game.global_flags[969] == 0";
            return(!GetGlobalFlag(969));

        case 131:
            originalScript = "game.global_flags[968] == 0";
            return(!GetGlobalFlag(968));

        case 141:
            originalScript = "game.global_vars[999] >= 1 and game.global_vars[999] <= 14 and not npc_get(npc,4)";
            return(GetGlobalVar(999) >= 1 && GetGlobalVar(999) <= 14 && !ScriptDaemon.npc_get(npc, 4));

        case 142:
            originalScript = "game.global_vars[999] >= 15 and not npc_get(npc,5)";
            return(GetGlobalVar(999) >= 15 && !ScriptDaemon.npc_get(npc, 5));

        case 143:
            originalScript = "game.global_vars[999] == 0";
            return(GetGlobalVar(999) == 0);

        case 162:
        case 172:
        case 941:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) and pc.skill_level_get(npc,skill_sense_motive) <= 10 and game.global_flags[989] == 0 and game.global_flags[946] == 0";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) && pc.GetSkillLevel(npc, SkillId.sense_motive) <= 10 && !GetGlobalFlag(989) && !GetGlobalFlag(946));

        case 163:
        case 173:
        case 942:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) and pc.skill_level_get(npc,skill_sense_motive) >= 11 and game.global_flags[989] == 0 and game.global_flags[946] == 0";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) && pc.GetSkillLevel(npc, SkillId.sense_motive) >= 11 && !GetGlobalFlag(989) && !GetGlobalFlag(946));

        case 201:
        case 211:
        case 212:
        case 221:
        case 231:
        case 232:
            originalScript = "game.quests[77].state == qs_mentioned";
            return(GetQuestState(77) == QuestState.Mentioned);

        case 202:
        case 213:
        case 214:
        case 222:
        case 233:
        case 234:
            originalScript = "game.quests[77].state == qs_accepted";
            return(GetQuestState(77) == QuestState.Accepted);

        case 241:
            originalScript = "game.global_flags[995] == 1 and game.quests[74].state != qs_completed";
            return(GetGlobalFlag(995) && GetQuestState(74) != QuestState.Completed);

        case 242:
            originalScript = "game.global_flags[995] == 0 and not game.quests[74].state == qs_completed";
            return(!GetGlobalFlag(995) && !(GetQuestState(74) == QuestState.Completed));

        case 251:
            originalScript = "game.quests[74].state == qs_accepted";
            return(GetQuestState(74) == QuestState.Accepted);

        case 252:
            originalScript = "game.quests[69].state == qs_accepted or game.quests[69].state == qs_completed";
            return(GetQuestState(69) == QuestState.Accepted || GetQuestState(69) == QuestState.Completed);

        case 253:
            originalScript = "(game.quests[77].state == qs_accepted or game.quests[77].state == qs_mentioned) and game.global_flags[989] == 0 and game.global_flags[946] == 0";
            return((GetQuestState(77) == QuestState.Accepted || GetQuestState(77) == QuestState.Mentioned) && !GetGlobalFlag(989) && !GetGlobalFlag(946));

        case 254:
            originalScript = "(game.quests[76].state == qs_mentioned or game.quests[76].state == qs_accepted) and game.global_flags[989] == 1";
            return((GetQuestState(76) == QuestState.Mentioned || GetQuestState(76) == QuestState.Accepted) && GetGlobalFlag(989));

        case 261:
            originalScript = "game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD or game.party_alignment == CHAOTIC_GOOD or game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == TRUE_NEUTRAL";
            return(PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD || PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.NEUTRAL);

        case 262:
            originalScript = "game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == LAWFUL_EVIL";
            return(PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL);

        case 263:
            originalScript = "game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL";
            return(PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL);

        case 271:
            originalScript = "pc.skill_level_get(npc,skill_diplomacy) >= 10";
            return(pc.GetSkillLevel(npc, SkillId.diplomacy) >= 10);

        case 281:
            originalScript = "pc.skill_level_get(npc,skill_bluff) >= 10";
            return(pc.GetSkillLevel(npc, SkillId.bluff) >= 10);

        case 291:
            originalScript = "pc.skill_level_get(npc,skill_intimidate) >= 10";
            return(pc.GetSkillLevel(npc, SkillId.intimidate) >= 10);

        case 331:
            originalScript = "pc.skill_level_get(npc,skill_diplomacy) >= 12";
            return(pc.GetSkillLevel(npc, SkillId.diplomacy) >= 12);

        case 341:
            originalScript = "pc.skill_level_get(npc,skill_bluff) >= 12";
            return(pc.GetSkillLevel(npc, SkillId.bluff) >= 12);

        case 351:
            originalScript = "pc.stat_level_get( stat_gender ) == gender_male and pc.skill_level_get(npc,skill_intimidate) >= 12";
            return(pc.GetGender() == Gender.Male && pc.GetSkillLevel(npc, SkillId.intimidate) >= 12);

        case 352:
            originalScript = "pc.stat_level_get( stat_gender ) == gender_female and pc.skill_level_get(npc,skill_intimidate) >= 12";
            return(pc.GetGender() == Gender.Female && pc.GetSkillLevel(npc, SkillId.intimidate) >= 12);

        case 361:
            originalScript = "pc.money_get() >= 50000";
            return(pc.GetMoney() >= 50000);

        case 362:
            originalScript = "pc.money_get() <= 49900";
            return(pc.GetMoney() <= 49900);

        case 421:
            originalScript = "game.global_flags[147] == 1";
            return(GetGlobalFlag(147));

        case 422:
            originalScript = "game.global_flags[146] == 1";
            return(GetGlobalFlag(146));

        case 423:
            originalScript = "game.global_flags[189] == 1";
            return(GetGlobalFlag(189));

        case 424:
            originalScript = "game.global_flags[327] == 1";
            return(GetGlobalFlag(327));

        case 431:
        case 441:
            originalScript = "game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD";
            return(PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD);

        case 432:
        case 442:
            originalScript = "game.party_alignment == LAWFUL_EVIL or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == CHAOTIC_GOOD";
            return(PartyAlignment == Alignment.LAWFUL_EVIL || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.CHAOTIC_GOOD);

        case 433:
        case 443:
            originalScript = "game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL or game.party_alignment == CHAOTIC_NEUTRAL";
            return(PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL || PartyAlignment == Alignment.CHAOTIC_NEUTRAL);

        case 491:
            originalScript = "(game.party_alignment == CHAOTIC_GOOD or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == NEUTRAL_GOOD)";
            return(PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.NEUTRAL_GOOD);

        case 492:
            originalScript = "(game.party_alignment == LAWFUL_GOOD or game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == LAWFUL_EVIL)";
            return(PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.LAWFUL_EVIL);

        case 493:
            originalScript = "(game.party_alignment == CHAOTIC_NEUTRAL or game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL)";
            return(PartyAlignment == Alignment.CHAOTIC_NEUTRAL || PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL);

        case 661:
        case 701:
        case 781:
        case 791:
        case 801:
        case 811:
            originalScript = "(game.party_alignment == CHAOTIC_GOOD or game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD)";
            return(PartyAlignment == Alignment.CHAOTIC_GOOD || PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD);

        case 662:
        case 702:
        case 792:
        case 802:
        case 812:
            originalScript = "(game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == CHAOTIC_NEUTRAL)";
            return(PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.CHAOTIC_NEUTRAL);

        case 663:
        case 703:
        case 783:
        case 793:
        case 803:
        case 813:
            originalScript = "(game.party_alignment == CHAOTIC_EVIL or game.party_alignment == LAWFUL_EVIL or game.party_alignment == NEUTRAL_EVIL)";
            return(PartyAlignment == Alignment.CHAOTIC_EVIL || PartyAlignment == Alignment.LAWFUL_EVIL || PartyAlignment == Alignment.NEUTRAL_EVIL);

        case 761:
            originalScript = "game.global_vars[995] == 0";
            return(GetGlobalVar(995) == 0);

        case 762:
            originalScript = "game.global_vars[995] == 1";
            return(GetGlobalVar(995) == 1);

        case 763:
            originalScript = "game.global_vars[995] == 2";
            return(GetGlobalVar(995) == 2);

        case 764:
            originalScript = "game.global_vars[995] == 3";
            return(GetGlobalVar(995) == 3);

        case 765:
            originalScript = "game.global_vars[995] == 4";
            return(GetGlobalVar(995) == 4);

        case 766:
            originalScript = "game.global_vars[995] == 5";
            return(GetGlobalVar(995) == 5);

        case 767:
            originalScript = "game.global_vars[995] == 6";
            return(GetGlobalVar(995) == 6);

        case 768:
            originalScript = "game.global_vars[995] == 7";
            return(GetGlobalVar(995) == 7);

        case 769:
            originalScript = "game.global_vars[995] == 8";
            return(GetGlobalVar(995) == 8);

        case 770:
            originalScript = "game.global_vars[995] == 9";
            return(GetGlobalVar(995) == 9);

        case 771:
            originalScript = "game.global_vars[995] == 10";
            return(GetGlobalVar(995) == 10);

        case 772:
            originalScript = "game.global_vars[995] == 11";
            return(GetGlobalVar(995) == 11);

        case 782:
            originalScript = "(game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == TRUE_NEUTRAL or game.party_alignment ==  CHAOTIC_NEUTRAL)";
            return(PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.CHAOTIC_NEUTRAL);

        case 851:
            originalScript = "game.global_vars[997] == 1";
            return(GetGlobalVar(997) == 1);

        case 852:
            originalScript = "game.global_vars[997] == 2 or game.global_vars[997] == 3";
            return(GetGlobalVar(997) == 2 || GetGlobalVar(997) == 3);

        case 943:
            originalScript = "(game.quests[84].state == qs_accepted or game.quests[84].state == qs_mentioned) and game.global_flags[973] == 0 and not npc_get(npc,1)";
            return((GetQuestState(84) == QuestState.Accepted || GetQuestState(84) == QuestState.Mentioned) && !GetGlobalFlag(973) && !ScriptDaemon.npc_get(npc, 1));

        case 944:
            originalScript = "(game.quests[67].state == qs_accepted or game.quests[67].state == qs_mentioned) and game.global_flags[989] == 0 and not npc_get(npc,2)";
            return((GetQuestState(67) == QuestState.Accepted || GetQuestState(67) == QuestState.Mentioned) && !GetGlobalFlag(989) && !ScriptDaemon.npc_get(npc, 2));

        case 945:
            originalScript = "(game.quests[66].state == qs_accepted or game.quests[66].state == qs_mentioned) and game.global_flags[989] == 0 and not npc_get(npc,3)";
            return((GetQuestState(66) == QuestState.Accepted || GetQuestState(66) == QuestState.Mentioned) && !GetGlobalFlag(989) && !ScriptDaemon.npc_get(npc, 3));

        case 981:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) <= 10";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) <= 10);

        case 982:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) >= 11";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) >= 11);

        case 991:
            originalScript = "game.global_vars[948] == 2";
            return(GetGlobalVar(948) == 2);

        case 992:
            originalScript = "game.global_vars[947] == 2";
            return(GetGlobalVar(947) == 2);

        case 993:
            originalScript = "game.global_vars[946] == 2";
            return(GetGlobalVar(946) == 2);

        default:
            originalScript = null;
            return(true);
        }
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 21:
            originalScript = "game.global_flags[282] == 0 and game.global_flags[284] == 0 and not anyone( pc.group_list(), \"has_follower\", 8054 ) and not anyone( pc.group_list(), \"has_follower\", 8071 )";
            return(!GetGlobalFlag(282) && !GetGlobalFlag(284) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8054)) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8071)));

        case 22:
            originalScript = "game.global_flags[282] == 1 and game.global_flags[284] == 0 and not anyone( pc.group_list(), \"has_follower\", 8071 )";
            return(GetGlobalFlag(282) && !GetGlobalFlag(284) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8071)));

        case 23:
            originalScript = "game.global_flags[282] == 0 and game.global_flags[284] == 1 and not anyone( pc.group_list(), \"has_follower\", 8054 )";
            return(!GetGlobalFlag(282) && GetGlobalFlag(284) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8054)));

        case 24:
            originalScript = "game.global_flags[282] == 1 and game.global_flags[284] == 1";
            return(GetGlobalFlag(282) && GetGlobalFlag(284));

        case 25:
            originalScript = "anyone( pc.group_list(), \"has_follower\", 8054 ) and game.global_flags[284] == 0";
            return(pc.GetPartyMembers().Any(o => o.HasFollowerByName(8054)) && !GetGlobalFlag(284));

        case 26:
            originalScript = "anyone( pc.group_list(), \"has_follower\", 8071 ) and game.global_flags[282] == 0";
            return(pc.GetPartyMembers().Any(o => o.HasFollowerByName(8071)) && !GetGlobalFlag(282));

        case 27:
            originalScript = "anyone( pc.group_list(), \"has_follower\", 8054 ) and game.global_flags[284] == 1";
            return(pc.GetPartyMembers().Any(o => o.HasFollowerByName(8054)) && GetGlobalFlag(284));

        case 28:
            originalScript = "anyone( pc.group_list(), \"has_follower\", 8071 ) and game.global_flags[282] == 1";
            return(pc.GetPartyMembers().Any(o => o.HasFollowerByName(8071)) && GetGlobalFlag(282));

        case 29:
            originalScript = "anyone( pc.group_list(), \"has_follower\", 8054 ) and anyone( pc.group_list(), \"has_follower\", 8071 )";
            return(pc.GetPartyMembers().Any(o => o.HasFollowerByName(8054)) && pc.GetPartyMembers().Any(o => o.HasFollowerByName(8071)));

        case 71:
            originalScript = "game.global_flags[282] == 0 and not anyone( pc.group_list(), \"has_follower\", 8054 )";
            return(!GetGlobalFlag(282) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8054)));

        case 72:
            originalScript = "game.global_flags[284] == 0 and not anyone( pc.group_list(), \"has_follower\", 8071 )";
            return(!GetGlobalFlag(284) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8071)));

        case 73:
        case 231:
            originalScript = "game.global_flags[299] == 0";
            return(!GetGlobalFlag(299));

        case 74:
            originalScript = "game.global_flags[337] == 0";
            return(!GetGlobalFlag(337));

        case 81:
        case 91:
        case 101:
        case 111:
        case 1131:
            originalScript = "game.global_flags[282] == 0 and not npc_get(npc,1) and not anyone( pc.group_list(), \"has_follower\", 8054 )";
            return(!GetGlobalFlag(282) && !ScriptDaemon.npc_get(npc, 1) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8054)));

        case 82:
        case 92:
        case 102:
        case 112:
        case 1132:
            originalScript = "game.global_flags[284] == 0 and not npc_get(npc,2) and not anyone( pc.group_list(), \"has_follower\", 8071 )";
            return(!GetGlobalFlag(284) && !ScriptDaemon.npc_get(npc, 2) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8071)));

        case 83:
        case 93:
        case 103:
        case 113:
        case 1133:
            originalScript = "game.global_flags[299] == 0 and not npc_get(npc,5)";
            return(!GetGlobalFlag(299) && !ScriptDaemon.npc_get(npc, 5));

        case 84:
        case 94:
        case 104:
        case 114:
        case 1134:
            originalScript = "game.global_flags[337] == 0 and not npc_get(npc,4)";
            return(!GetGlobalFlag(337) && !ScriptDaemon.npc_get(npc, 4));

        case 211:
        case 373:
            originalScript = "not pc.follower_atmax()";
            return(!pc.HasMaxFollowers());

        case 212:
            originalScript = "pc.follower_atmax()";
            return(pc.HasMaxFollowers());

        case 232:
            originalScript = "game.global_flags[299] == 1";
            return(GetGlobalFlag(299));

        case 241:
        case 331:
            originalScript = "game.global_flags[337] == 0 and game.global_flags[934] == 0 and not anyone( pc.group_list(), \"has_follower\", 8000 )";
            return(!GetGlobalFlag(337) && !GetGlobalFlag(934) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8000)));

        case 242:
        case 332:
            originalScript = "game.global_flags[337] == 0 and (game.global_flags[934] == 1 or anyone( pc.group_list(), \"has_follower\", 8000 ))";
            return(!GetGlobalFlag(337) && (GetGlobalFlag(934) || pc.GetPartyMembers().Any(o => o.HasFollowerByName(8000))));

        case 243:
        case 333:
            originalScript = "game.global_flags[337] == 1 and game.global_flags[934] == 0 and not anyone( pc.group_list(), \"has_follower\", 8000 )";
            return(GetGlobalFlag(337) && !GetGlobalFlag(934) && !pc.GetPartyMembers().Any(o => o.HasFollowerByName(8000)));

        case 244:
        case 334:
            originalScript = "game.global_flags[337] == 1 and (game.global_flags[934] == 1 or anyone( pc.group_list(), \"has_follower\", 8000 ))";
            return(GetGlobalFlag(337) && (GetGlobalFlag(934) || pc.GetPartyMembers().Any(o => o.HasFollowerByName(8000))));

        case 281:
            originalScript = "anyone( pc.group_list(), \"has_item\", 2203 )";
            return(pc.GetPartyMembers().Any(o => o.HasItemByName(2203)));

        case 282:
            originalScript = "not anyone( pc.group_list(), \"has_item\", 2203 )";
            return(!pc.GetPartyMembers().Any(o => o.HasItemByName(2203)));

        case 371:
        case 621:
            originalScript = "game.global_flags[511] == 0";
            return(!GetGlobalFlag(511));

        case 372:
        case 622:
            originalScript = "game.global_flags[511] == 1";
            return(GetGlobalFlag(511));

        case 381:
        case 391:
        case 631:
        case 641:
            originalScript = "game.global_flags[512] == 0";
            return(!GetGlobalFlag(512));

        case 382:
        case 392:
        case 632:
        case 642:
            originalScript = "game.global_flags[512] == 1";
            return(GetGlobalFlag(512));

        case 401:
        case 411:
        case 651:
        case 661:
            originalScript = "game.global_flags[513] == 0";
            return(!GetGlobalFlag(513));

        case 402:
        case 412:
        case 652:
        case 662:
            originalScript = "game.global_flags[513] == 1";
            return(GetGlobalFlag(513));

        case 421:
        case 431:
        case 671:
        case 681:
            originalScript = "game.global_flags[514] == 0";
            return(!GetGlobalFlag(514));

        case 422:
        case 432:
        case 672:
        case 682:
            originalScript = "game.global_flags[514] == 1";
            return(GetGlobalFlag(514));

        case 441:
        case 451:
        case 691:
        case 701:
            originalScript = "game.global_flags[515] == 0";
            return(!GetGlobalFlag(515));

        case 442:
        case 452:
        case 692:
        case 702:
            originalScript = "game.global_flags[515] == 1";
            return(GetGlobalFlag(515));

        case 461:
        case 471:
        case 711:
        case 721:
            originalScript = "game.global_flags[516] == 0";
            return(!GetGlobalFlag(516));

        case 462:
        case 472:
        case 712:
        case 722:
            originalScript = "game.global_flags[516] == 1";
            return(GetGlobalFlag(516));

        case 481:
        case 491:
        case 731:
        case 741:
            originalScript = "game.global_flags[517] == 0";
            return(!GetGlobalFlag(517));

        case 482:
        case 492:
        case 732:
        case 742:
            originalScript = "game.global_flags[517] == 1";
            return(GetGlobalFlag(517));

        case 501:
        case 511:
        case 751:
        case 761:
            originalScript = "game.global_flags[518] == 0";
            return(!GetGlobalFlag(518));

        case 502:
        case 512:
        case 752:
        case 762:
            originalScript = "game.global_flags[518] == 1";
            return(GetGlobalFlag(518));

        case 521:
        case 531:
        case 771:
        case 781:
            originalScript = "game.global_flags[519] == 0";
            return(!GetGlobalFlag(519));

        case 522:
        case 532:
        case 772:
        case 782:
            originalScript = "game.global_flags[519] == 1";
            return(GetGlobalFlag(519));

        case 541:
        case 551:
        case 791:
        case 801:
            originalScript = "game.global_flags[520] == 0";
            return(!GetGlobalFlag(520));

        case 542:
        case 552:
        case 792:
        case 802:
            originalScript = "game.global_flags[520] == 1";
            return(GetGlobalFlag(520));

        case 561:
        case 571:
        case 811:
        case 821:
            originalScript = "game.global_flags[521] == 0";
            return(!GetGlobalFlag(521));

        case 562:
        case 572:
        case 812:
        case 822:
            originalScript = "game.global_flags[521] == 1";
            return(GetGlobalFlag(521));

        case 581:
        case 591:
        case 831:
        case 841:
            originalScript = "game.global_flags[522] == 0";
            return(!GetGlobalFlag(522));

        case 582:
        case 592:
        case 832:
        case 842:
            originalScript = "game.global_flags[522] == 1";
            return(GetGlobalFlag(522));

        case 1135:
        case 1202:
        case 1212:
        case 1222:
        case 1232:
            originalScript = "pc.stat_level_get( stat_deity ) == 9 and not npc_get(npc,6)";
            return(pc.GetStat(Stat.deity) == 9 && !ScriptDaemon.npc_get(npc, 6));

        case 1151:
        case 1181:
            originalScript = "pc.skill_level_get(npc,skill_bluff) >= 4";
            return(pc.GetSkillLevel(npc, SkillId.bluff) >= 4);

        case 1192:
            originalScript = "pc.stat_level_get( stat_deity ) == 9";
            return(pc.GetStat(Stat.deity) == 9);

        default:
            originalScript = null;
            return(true);
        }
    }
Esempio n. 26
0
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
            originalScript = "not npc.has_met(pc) and is_daytime() == 1";
            return(!npc.HasMet(pc) && Utilities.is_daytime());

        case 3:
            originalScript = "not npc.has_met(pc) and not is_daytime() == 1";
            return(!npc.HasMet(pc) && !(Utilities.is_daytime()));

        case 4:
            originalScript = "npc.has_met(pc) and is_daytime() == 1";
            return(npc.HasMet(pc) && Utilities.is_daytime());

        case 5:
            originalScript = "npc.has_met(pc) and not is_daytime() == 1 and game.quests[77].state == qs_unknown";
            return(npc.HasMet(pc) && !(Utilities.is_daytime()) && GetQuestState(77) == QuestState.Unknown);

        case 6:
            originalScript = "not is_daytime() == 1 and (game.quests[77].state == qs_mentioned or game.quests[77].state == qs_accepted) and pc.skill_level_get(npc,skill_sense_motive) >= 10";
            return(!(Utilities.is_daytime()) && (GetQuestState(77) == QuestState.Mentioned || GetQuestState(77) == QuestState.Accepted) && pc.GetSkillLevel(npc, SkillId.sense_motive) >= 10);

        case 7:
            originalScript = "not is_daytime() == 1 and game.quests[77].state == qs_completed and pc.skill_level_get(npc,skill_sense_motive) >= 10 and not npc_get(npc,2)";
            return(!(Utilities.is_daytime()) && GetQuestState(77) == QuestState.Completed && pc.GetSkillLevel(npc, SkillId.sense_motive) >= 10 && !ScriptDaemon.npc_get(npc, 2));

        case 21:
            originalScript = "game.quests[74].state != qs_unknown and game.quests[74].state != qs_completed and game.quests[69].state == qs_unknown and not npc_get(npc,1)";
            return(GetQuestState(74) != QuestState.Unknown && GetQuestState(74) != QuestState.Completed && GetQuestState(69) == QuestState.Unknown && !ScriptDaemon.npc_get(npc, 1));

        case 22:
            originalScript = "game.quests[69].state != qs_unknown and game.quests[69].state != qs_completed and game.quests[74].state == qs_unknown and not npc_get(npc,1)";
            return(GetQuestState(69) != QuestState.Unknown && GetQuestState(69) != QuestState.Completed && GetQuestState(74) == QuestState.Unknown && !ScriptDaemon.npc_get(npc, 1));

        case 23:
            originalScript = "game.quests[74].state != qs_unknown and game.quests[74].state != qs_completed and game.quests[69].state != qs_unknown and game.quests[69].state != qs_completed and not npc_get(npc,1)";
            return(GetQuestState(74) != QuestState.Unknown && GetQuestState(74) != QuestState.Completed && GetQuestState(69) != QuestState.Unknown && GetQuestState(69) != QuestState.Completed && !ScriptDaemon.npc_get(npc, 1));

        case 24:
            originalScript = "game.global_vars[978] == 1 and (pc.skill_level_get(npc,skill_spot) >= 11 or party_spot_check() >= 11) and game.global_vars[966] == 0";
            throw new NotSupportedException("Conversion failed.");

        case 25:
            originalScript = "game.global_vars[978] == 3 and game.global_vars[966] == 1";
            return(GetGlobalVar(978) == 3 && GetGlobalVar(966) == 1);

        case 26:
            originalScript = "game.global_vars[978] == 4 and game.global_vars[966] == 1";
            return(GetGlobalVar(978) == 4 && GetGlobalVar(966) == 1);

        case 27:
            originalScript = "game.global_vars[978] == 5 and game.global_vars[966] == 1";
            return(GetGlobalVar(978) == 5 && GetGlobalVar(966) == 1);

        case 31:
        case 41:
            originalScript = "pc.stat_level_get(stat_race) == race_gnome";
            return(pc.GetRace() == RaceId.svirfneblin);

        case 71:
        case 171:
            originalScript = "game.global_flags[986] == 1";
            return(GetGlobalFlag(986));

        case 72:
        case 181:
            originalScript = "game.global_flags[981] == 1";
            return(GetGlobalFlag(981));

        case 131:
            originalScript = "game.global_vars[999] >= 1 and game.quests[69].state != completed";
            return(GetGlobalVar(999) >= 1 && GetQuestState(69) != QuestState.Completed);

        case 221:
            originalScript = "npc_get(npc,2)";
            return(ScriptDaemon.npc_get(npc, 2));

        case 222:
            originalScript = "npc_get(npc,3)";
            return(ScriptDaemon.npc_get(npc, 3));

        case 231:
        case 341:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) >= 9";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) >= 9);

        case 232:
        case 342:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) <= 8";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) <= 8);

        case 251:
        case 253:
            originalScript = "not anyone( pc.group_list(), \"has_follower\", 8714 )";
            return(!pc.GetPartyMembers().Any(o => o.HasFollowerByName(8714)));

        case 252:
        case 254:
            originalScript = "anyone( pc.group_list(), \"has_follower\", 8714 )";
            return(pc.GetPartyMembers().Any(o => o.HasFollowerByName(8714)));

        case 261:
        case 281:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) >= 8";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) >= 8);

        case 262:
        case 282:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) <= 7";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) <= 7);

        case 271:
        case 291:
            originalScript = "game.leader.reputation_has(36) == 1";
            return(SelectedPartyLeader.HasReputation(36));

        case 272:
        case 292:
            originalScript = "game.leader.reputation_has(36) == 0";
            return(!SelectedPartyLeader.HasReputation(36));

        case 361:
            originalScript = "is_daytime() == 1 and not npc_get(npc,4)";
            return(Utilities.is_daytime() && !ScriptDaemon.npc_get(npc, 4));

        case 362:
            originalScript = "is_daytime() == 1 and npc_get(npc,4)";
            return(Utilities.is_daytime() && ScriptDaemon.npc_get(npc, 4));

        case 363:
            originalScript = "not is_daytime() == 1";
            return(!(Utilities.is_daytime()));

        default:
            originalScript = null;
            return(true);
        }
    }
Esempio n. 27
0
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
        case 3:
            originalScript = "(game.party_alignment == TRUE_NEUTRAL) or (game.party_alignment == CHAOTIC_NEUTRAL) or (game.party_alignment == LAWFUL_EVIL) or (game.party_alignment == NEUTRAL_EVIL) or (game.party_alignment == CHAOTIC_EVIL)";
            return((PartyAlignment == Alignment.NEUTRAL) || (PartyAlignment == Alignment.CHAOTIC_NEUTRAL) || (PartyAlignment == Alignment.LAWFUL_EVIL) || (PartyAlignment == Alignment.NEUTRAL_EVIL) || (PartyAlignment == Alignment.CHAOTIC_EVIL));

        case 4:
        case 5:
            originalScript = "(game.party_alignment == LAWFUL_NEUTRAL) or (game.party_alignment == LAWFUL_GOOD) or (game.party_alignment == NEUTRAL_GOOD) or (game.party_alignment == CHAOTIC_GOOD)";
            return((PartyAlignment == Alignment.LAWFUL_NEUTRAL) || (PartyAlignment == Alignment.LAWFUL_GOOD) || (PartyAlignment == Alignment.NEUTRAL_GOOD) || (PartyAlignment == Alignment.CHAOTIC_GOOD));

        case 7:
        case 8:
            originalScript = "game.quests[31].state == qs_accepted and group_average_level(pc) <= 6 and anyone( pc.group_list(), \"has_follower\", 8014 )";
            return(GetQuestState(31) == QuestState.Accepted && Utilities.group_average_level(pc) <= 6 && pc.GetPartyMembers().Any(o => o.HasFollowerByName(8014)));

        case 53:
            originalScript = "((game.party_alignment == LAWFUL_NEUTRAL) or (game.party_alignment == LAWFUL_GOOD) or (game.party_alignment == NEUTRAL_GOOD) or (game.party_alignment == CHAOTIC_GOOD)) and (game.story_state == 3)";
            return(((PartyAlignment == Alignment.LAWFUL_NEUTRAL) || (PartyAlignment == Alignment.LAWFUL_GOOD) || (PartyAlignment == Alignment.NEUTRAL_GOOD) || (PartyAlignment == Alignment.CHAOTIC_GOOD)) && (StoryState == 3));

        case 54:
            originalScript = "(game.party_alignment == LAWFUL_NEUTRAL) or ((game.party_alignment == LAWFUL_GOOD) or (game.party_alignment == NEUTRAL_GOOD) or (game.party_alignment == CHAOTIC_GOOD)) and (game.story_state == 3)";
            return((PartyAlignment == Alignment.LAWFUL_NEUTRAL) || ((PartyAlignment == Alignment.LAWFUL_GOOD) || (PartyAlignment == Alignment.NEUTRAL_GOOD) || (PartyAlignment == Alignment.CHAOTIC_GOOD)) && (StoryState == 3));

        case 71:
        case 72:
            originalScript = "(game.story_state == 3)";
            return(StoryState == 3);

        case 182:
        case 184:
        case 191:
        case 193:
        case 392:
        case 394:
            originalScript = "npc_get(npc, 1) == 1";
            return(ScriptDaemon.npc_get(npc, 1));

        case 183:
        case 185:
        case 192:
        case 194:
        case 393:
        case 395:
            originalScript = "npc_get(npc, 1) == 0";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 211:
        case 212:
            originalScript = "game.global_flags[306] == 0";
            return(!GetGlobalFlag(306));

        case 215:
        case 216:
            originalScript = "game.global_flags[306] == 1 and game.global_flags[98] == 0 and game.quests[11].state == qs_accepted";
            return(GetGlobalFlag(306) && !GetGlobalFlag(98) && GetQuestState(11) == QuestState.Accepted);

        case 221:
        case 222:
            originalScript = "game.party_alignment == NEUTRAL_GOOD";
            return(PartyAlignment == Alignment.NEUTRAL_GOOD);

        case 223:
        case 224:
        case 245:
        case 246:
            originalScript = "game.global_flags[98] == 0 and game.quests[11].state == qs_accepted";
            return(!GetGlobalFlag(98) && GetQuestState(11) == QuestState.Accepted);

        case 252:
        case 253:
        case 254:
        case 255:
            originalScript = "game.global_flags[100] == 1";
            return(GetGlobalFlag(100));

        case 501:
            originalScript = "pc.money_get() >= 1500000";
            return(pc.GetMoney() >= 1500000);

        case 502:
            originalScript = "pc.money_get() < 1500000";
            return(pc.GetMoney() < 1500000);

        default:
            originalScript = null;
            return(true);
        }
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 11:
        case 31:
        case 41:
        case 51:
        case 71:
        case 81:
        case 91:
        case 101:
        case 111:
        case 181:
        case 221:
            originalScript = "not npc_get(npc,1)";
            return(!ScriptDaemon.npc_get(npc, 1));

        case 12:
        case 22:
        case 42:
        case 52:
        case 62:
        case 82:
        case 92:
        case 102:
        case 112:
            originalScript = "game.quests[109].state == qs_accepted and not npc_get(npc,2)";
            return(GetQuestState(109) == QuestState.Accepted && !ScriptDaemon.npc_get(npc, 2));

        case 13:
        case 23:
        case 33:
        case 53:
        case 63:
        case 73:
        case 93:
        case 103:
        case 113:
            originalScript = "(game.quests[109].state == qs_mentioned or game.quests[109].state == qs_accepted) and not npc_get(npc,3)";
            return((GetQuestState(109) == QuestState.Mentioned || GetQuestState(109) == QuestState.Accepted) && !ScriptDaemon.npc_get(npc, 3));

        case 14:
        case 24:
        case 34:
        case 44:
        case 64:
        case 74:
        case 84:
        case 114:
            originalScript = "(game.quests[109].state == qs_mentioned or game.quests[109].state == qs_accepted) and not npc_get(npc,4)";
            return((GetQuestState(109) == QuestState.Mentioned || GetQuestState(109) == QuestState.Accepted) && !ScriptDaemon.npc_get(npc, 4));

        case 121:
        case 141:
        case 161:
        case 171:
            originalScript = "(game.quests[109].state == qs_mentioned or game.quests[109].state == qs_accepted) and not npc_get(npc,5)";
            return((GetQuestState(109) == QuestState.Mentioned || GetQuestState(109) == QuestState.Accepted) && !ScriptDaemon.npc_get(npc, 5));

        case 122:
        case 132:
        case 152:
        case 162:
        case 172:
            originalScript = "not npc_get(npc,6)";
            return(!ScriptDaemon.npc_get(npc, 6));

        case 123:
        case 133:
        case 143:
        case 153:
        case 173:
            originalScript = "not npc_get(npc,7)";
            return(!ScriptDaemon.npc_get(npc, 7));

        case 124:
        case 134:
        case 144:
        case 154:
        case 164:
            originalScript = "not npc_get(npc,8)";
            return(!ScriptDaemon.npc_get(npc, 8));

        case 125:
            originalScript = "not npc_get(npc,9) and npc_get(npc,1) and npc_get(npc,2) and npc_get(npc,3) and npc_get(npc,4) and npc_get(npc,5) and npc_get(npc,6) and npc_get(npc,7) and npc_get(npc,8)";
            return(!ScriptDaemon.npc_get(npc, 9) && ScriptDaemon.npc_get(npc, 1) && ScriptDaemon.npc_get(npc, 2) && ScriptDaemon.npc_get(npc, 3) && ScriptDaemon.npc_get(npc, 4) && ScriptDaemon.npc_get(npc, 5) && ScriptDaemon.npc_get(npc, 6) && ScriptDaemon.npc_get(npc, 7) && ScriptDaemon.npc_get(npc, 8));

        case 182:
            originalScript = "not npc_get(npc,3)";
            return(!ScriptDaemon.npc_get(npc, 3));

        case 183:
            originalScript = "not npc_get(npc,4)";
            return(!ScriptDaemon.npc_get(npc, 4));

        case 211:
            originalScript = "game.global_vars[560] == 0 and game.global_flags[542] == 0";
            return(GetGlobalVar(560) == 0 && !GetGlobalFlag(542));

        case 212:
            originalScript = "game.global_vars[560] == 1 and game.global_flags[542] == 0";
            return(GetGlobalVar(560) == 1 && !GetGlobalFlag(542));

        case 213:
            originalScript = "game.global_vars[560] == 2 and game.global_flags[542] == 0";
            return(GetGlobalVar(560) == 2 && !GetGlobalFlag(542));

        case 214:
            originalScript = "game.global_vars[560] == 0 and game.global_flags[542] == 1";
            return(GetGlobalVar(560) == 0 && GetGlobalFlag(542));

        case 222:
        case 231:
        case 321:
        case 331:
        case 341:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) >= 30";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) >= 30);

        case 223:
        case 232:
        case 284:
        case 294:
        case 304:
        case 314:
        case 322:
        case 332:
        case 342:
            originalScript = "pc.skill_level_get(npc,skill_sense_motive) <= 29";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) <= 29);

        case 241:
            originalScript = "game.global_vars[540] == 1 and game.global_vars[541] == 1 and pc.skill_level_get(npc,skill_sense_motive) >= 30";
            return(GetGlobalVar(540) == 1 && GetGlobalVar(541) == 1 && pc.GetSkillLevel(npc, SkillId.sense_motive) >= 30);

        case 242:
            originalScript = "game.global_vars[540] == 2 and game.global_vars[541] == 2 and pc.skill_level_get(npc,skill_sense_motive) >= 30";
            return(GetGlobalVar(540) == 2 && GetGlobalVar(541) == 2 && pc.GetSkillLevel(npc, SkillId.sense_motive) >= 30);

        case 243:
            originalScript = "game.global_vars[540] == 3 and game.global_vars[541] == 3 and pc.skill_level_get(npc,skill_sense_motive) >= 30";
            return(GetGlobalVar(540) == 3 && GetGlobalVar(541) == 3 && pc.GetSkillLevel(npc, SkillId.sense_motive) >= 30);

        case 244:
            originalScript = "game.global_vars[540] == 4 and game.global_vars[541] == 4 and pc.skill_level_get(npc,skill_sense_motive) >= 30";
            return(GetGlobalVar(540) == 4 && GetGlobalVar(541) == 4 && pc.GetSkillLevel(npc, SkillId.sense_motive) >= 30);

        case 251:
            originalScript = "pc.skill_level_get(npc,skill_diplomacy) >= 19";
            return(pc.GetSkillLevel(npc, SkillId.diplomacy) >= 19);

        case 252:
            originalScript = "pc.skill_level_get(npc,skill_bluff) >= 19";
            return(pc.GetSkillLevel(npc, SkillId.bluff) >= 19);

        case 253:
            originalScript = "pc.skill_level_get(npc,skill_intimidate) >= 19";
            return(pc.GetSkillLevel(npc, SkillId.intimidate) >= 19);

        case 254:
            originalScript = "pc.skill_level_get(npc,skill_diplomacy) <= 18";
            return(pc.GetSkillLevel(npc, SkillId.diplomacy) <= 18);

        case 255:
            originalScript = "pc.skill_level_get(npc,skill_bluff) <= 18";
            return(pc.GetSkillLevel(npc, SkillId.bluff) <= 18);

        case 256:
            originalScript = "pc.skill_level_get(npc,skill_intimidate) <= 18";
            return(pc.GetSkillLevel(npc, SkillId.intimidate) <= 18);

        case 261:
            originalScript = "game.global_vars[540] == 1 and game.global_vars[541] == 1 and pc.skill_level_get(npc,skill_diplomacy) >= 20";
            return(GetGlobalVar(540) == 1 && GetGlobalVar(541) == 1 && pc.GetSkillLevel(npc, SkillId.diplomacy) >= 20);

        case 262:
            originalScript = "game.global_vars[540] == 2 and game.global_vars[541] == 2 and pc.skill_level_get(npc,skill_diplomacy) >= 20";
            return(GetGlobalVar(540) == 2 && GetGlobalVar(541) == 2 && pc.GetSkillLevel(npc, SkillId.diplomacy) >= 20);

        case 263:
            originalScript = "game.global_vars[540] == 3 and game.global_vars[541] == 3 and pc.skill_level_get(npc,skill_diplomacy) >= 20";
            return(GetGlobalVar(540) == 3 && GetGlobalVar(541) == 3 && pc.GetSkillLevel(npc, SkillId.diplomacy) >= 20);

        case 264:
            originalScript = "game.global_vars[540] == 4 and game.global_vars[541] == 4 and pc.skill_level_get(npc,skill_diplomacy) >= 20";
            return(GetGlobalVar(540) == 4 && GetGlobalVar(541) == 4 && pc.GetSkillLevel(npc, SkillId.diplomacy) >= 20);

        case 265:
            originalScript = "game.global_vars[540] == 1 and game.global_vars[541] == 1 and pc.skill_level_get(npc,skill_bluff) >= 20";
            return(GetGlobalVar(540) == 1 && GetGlobalVar(541) == 1 && pc.GetSkillLevel(npc, SkillId.bluff) >= 20);

        case 266:
            originalScript = "game.global_vars[540] == 2 and game.global_vars[541] == 2 and pc.skill_level_get(npc,skill_bluff) >= 20";
            return(GetGlobalVar(540) == 2 && GetGlobalVar(541) == 2 && pc.GetSkillLevel(npc, SkillId.bluff) >= 20);

        case 267:
            originalScript = "game.global_vars[540] == 3 and game.global_vars[541] == 3 and pc.skill_level_get(npc,skill_bluff) >= 20";
            return(GetGlobalVar(540) == 3 && GetGlobalVar(541) == 3 && pc.GetSkillLevel(npc, SkillId.bluff) >= 20);

        case 268:
            originalScript = "game.global_vars[540] == 4 and game.global_vars[541] == 4 and pc.skill_level_get(npc,skill_bluff) >= 20";
            return(GetGlobalVar(540) == 4 && GetGlobalVar(541) == 4 && pc.GetSkillLevel(npc, SkillId.bluff) >= 20);

        case 269:
            originalScript = "game.global_vars[540] == 1 and game.global_vars[541] == 1 and pc.skill_level_get(npc,skill_intimidate) >= 20";
            return(GetGlobalVar(540) == 1 && GetGlobalVar(541) == 1 && pc.GetSkillLevel(npc, SkillId.intimidate) >= 20);

        case 270:
            originalScript = "game.global_vars[540] == 2 and game.global_vars[541] == 2 and pc.skill_level_get(npc,skill_intimidate) >= 20";
            return(GetGlobalVar(540) == 2 && GetGlobalVar(541) == 2 && pc.GetSkillLevel(npc, SkillId.intimidate) >= 20);

        case 271:
            originalScript = "game.global_vars[540] == 3 and game.global_vars[541] == 3 and pc.skill_level_get(npc,skill_intimidate) >= 20";
            return(GetGlobalVar(540) == 3 && GetGlobalVar(541) == 3 && pc.GetSkillLevel(npc, SkillId.intimidate) >= 20);

        case 272:
            originalScript = "game.global_vars[540] == 4 and game.global_vars[541] == 4 and pc.skill_level_get(npc,skill_intimidate) >= 20";
            return(GetGlobalVar(540) == 4 && GetGlobalVar(541) == 4 && pc.GetSkillLevel(npc, SkillId.intimidate) >= 20);

        case 273:
            originalScript = "pc.skill_level_get(npc,skill_diplomacy) <= 19";
            return(pc.GetSkillLevel(npc, SkillId.diplomacy) <= 19);

        case 274:
            originalScript = "pc.skill_level_get(npc,skill_bluff) <= 19";
            return(pc.GetSkillLevel(npc, SkillId.bluff) <= 19);

        case 275:
            originalScript = "pc.skill_level_get(npc,skill_intimidate) <= 19";
            return(pc.GetSkillLevel(npc, SkillId.intimidate) <= 19);

        case 281:
        case 291:
        case 301:
        case 311:
            originalScript = "game.global_vars[542] == 1 and pc.skill_level_get(npc,skill_sense_motive) >= 30";
            return(GetGlobalVar(542) == 1 && pc.GetSkillLevel(npc, SkillId.sense_motive) >= 30);

        case 282:
        case 292:
        case 302:
        case 312:
            originalScript = "game.global_vars[542] == 2 and pc.skill_level_get(npc,skill_sense_motive) >= 30";
            return(GetGlobalVar(542) == 2 && pc.GetSkillLevel(npc, SkillId.sense_motive) >= 30);

        case 283:
        case 293:
        case 303:
        case 313:
            originalScript = "game.global_vars[542] == 3 and pc.skill_level_get(npc,skill_sense_motive) >= 30";
            return(GetGlobalVar(542) == 3 && pc.GetSkillLevel(npc, SkillId.sense_motive) >= 30);

        case 351:
            originalScript = "game.global_vars[542] == 1 and pc.skill_level_get(npc,skill_diplomacy) >= 21";
            return(GetGlobalVar(542) == 1 && pc.GetSkillLevel(npc, SkillId.diplomacy) >= 21);

        case 352:
            originalScript = "game.global_vars[542] == 2 and pc.skill_level_get(npc,skill_diplomacy) >= 21";
            return(GetGlobalVar(542) == 2 && pc.GetSkillLevel(npc, SkillId.diplomacy) >= 21);

        case 353:
            originalScript = "game.global_vars[542] == 3 and pc.skill_level_get(npc,skill_diplomacy) >= 21";
            return(GetGlobalVar(542) == 3 && pc.GetSkillLevel(npc, SkillId.diplomacy) >= 21);

        case 354:
            originalScript = "game.global_vars[542] == 1 and pc.skill_level_get(npc,skill_bluff) >= 21";
            return(GetGlobalVar(542) == 1 && pc.GetSkillLevel(npc, SkillId.bluff) >= 21);

        case 355:
            originalScript = "game.global_vars[542] == 2 and pc.skill_level_get(npc,skill_bluff) >= 21";
            return(GetGlobalVar(542) == 2 && pc.GetSkillLevel(npc, SkillId.bluff) >= 21);

        case 356:
            originalScript = "game.global_vars[542] == 3 and pc.skill_level_get(npc,skill_bluff) >= 21";
            return(GetGlobalVar(542) == 3 && pc.GetSkillLevel(npc, SkillId.bluff) >= 21);

        case 357:
            originalScript = "game.global_vars[542] == 1 and pc.skill_level_get(npc,skill_intimidate) >= 21";
            return(GetGlobalVar(542) == 1 && pc.GetSkillLevel(npc, SkillId.intimidate) >= 21);

        case 358:
            originalScript = "game.global_vars[542] == 2 and pc.skill_level_get(npc,skill_intimidate) >= 21";
            return(GetGlobalVar(542) == 2 && pc.GetSkillLevel(npc, SkillId.intimidate) >= 21);

        case 359:
            originalScript = "game.global_vars[542] == 3 and pc.skill_level_get(npc,skill_intimidate) >= 21";
            return(GetGlobalVar(542) == 3 && pc.GetSkillLevel(npc, SkillId.intimidate) >= 21);

        case 360:
            originalScript = "pc.skill_level_get(npc,skill_diplomacy) <= 20";
            return(pc.GetSkillLevel(npc, SkillId.diplomacy) <= 20);

        case 361:
            originalScript = "pc.skill_level_get(npc,skill_bluff) <= 20";
            return(pc.GetSkillLevel(npc, SkillId.bluff) <= 20);

        case 362:
            originalScript = "pc.skill_level_get(npc,skill_intimidate) <= 20";
            return(pc.GetSkillLevel(npc, SkillId.intimidate) <= 20);

        case 372:
        case 382:
        case 392:
        case 422:
            originalScript = "not anyone( pc.group_list(), \"has_follower\", 8767 ) and game.global_vars[544] == 3 and pc.follower_atmax() == 0";
            return(!pc.GetPartyMembers().Any(o => o.HasFollowerByName(8767)) && GetGlobalVar(544) == 3 && !pc.HasMaxFollowers());

        case 401:
            originalScript = "not npc_get(npc,11)";
            return(!ScriptDaemon.npc_get(npc, 11));

        case 402:
            originalScript = "npc_get(npc,11)";
            return(ScriptDaemon.npc_get(npc, 11));

        case 431:
            originalScript = "game.global_vars[542] == 1 and not npc_get(npc,10)";
            return(GetGlobalVar(542) == 1 && !ScriptDaemon.npc_get(npc, 10));

        case 432:
            originalScript = "game.global_vars[542] == 2 and not npc_get(npc,10)";
            return(GetGlobalVar(542) == 2 && !ScriptDaemon.npc_get(npc, 10));

        case 433:
            originalScript = "game.global_vars[542] == 3 and not npc_get(npc,10)";
            return(GetGlobalVar(542) == 3 && !ScriptDaemon.npc_get(npc, 10));

        default:
            originalScript = null;
            return(true);
        }
    }
Esempio n. 29
0
    public override bool OnHeartbeat(GameObject attachee, GameObject triggerer)
    {
        if ((attachee.GetMap() == 5095))
        {
            if ((!GameSystems.Combat.IsCombatActive()))
            {
                if ((attachee != null && !Utilities.critter_is_unconscious(attachee) && !attachee.D20Query(D20DispatcherKey.QUE_Prone) && attachee.GetLeader() == null))
                {
                    if ((GetGlobalVar(986) != 3))
                    {
                        foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_PC))
                        {
                            if ((talk_40(attachee, obj)))
                            {
                                if ((!ScriptDaemon.npc_get(attachee, 1)))
                                {
                                    attachee.TurnTowards(PartyLeader);
                                    PartyLeader.BeginDialog(attachee, 1);
                                    ScriptDaemon.npc_set(attachee, 1);
                                    SetGlobalFlag(558, true);
                                }
                            }
                            else if ((comment_20(attachee, obj)))
                            {
                                if ((!ScriptDaemon.npc_get(attachee, 3)))
                                {
                                    var comment = RandomRange(1, 400);
                                    if ((comment == 20))
                                    {
                                        attachee.FloatLine(10000, triggerer);
                                    }

                                    if ((comment == 60))
                                    {
                                        attachee.FloatLine(10001, triggerer);
                                    }

                                    if ((comment == 100))
                                    {
                                        attachee.FloatLine(10002, triggerer);
                                    }

                                    if ((comment == 140))
                                    {
                                        attachee.FloatLine(10003, triggerer);
                                    }

                                    if ((comment == 180))
                                    {
                                        attachee.FloatLine(10004, triggerer);
                                    }

                                    if ((comment == 220))
                                    {
                                        attachee.FloatLine(10005, triggerer);
                                    }

                                    if ((comment == 260))
                                    {
                                        attachee.FloatLine(10006, triggerer);
                                    }

                                    if ((comment == 300))
                                    {
                                        attachee.FloatLine(10007, triggerer);
                                    }

                                    if ((comment == 340))
                                    {
                                        attachee.FloatLine(10008, triggerer);
                                    }

                                    if ((comment == 380))
                                    {
                                        attachee.FloatLine(10009, triggerer);
                                    }
                                }
                            }
                        }

                        if ((GetGlobalVar(985) == 1 && !ScriptDaemon.npc_get(attachee, 2)))
                        {
                            StartTimer(200, () => krunch_exit(attachee, triggerer));
                            ScriptDaemon.npc_set(attachee, 2);
                        }

                        if (((GetGlobalFlag(555) || GetGlobalFlag(556)) && GetGlobalFlag(559)))
                        {
                            attachee.SetStandpoint(StandPointType.Night, 427);
                            attachee.SetStandpoint(StandPointType.Day, 427);
                        }
                    }
                }
            }

            // game.new_sid = 0
            if ((ScriptDaemon.npc_get(attachee, 3)))
            {
                attachee.SetObjectFlag(ObjectFlag.OFF);
            }
        }

        return(RunDefault);
    }
Esempio n. 30
0
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 1021:
            originalScript = "grate_strength() == 0";
            return(grate_strength() == 0);

        case 1022:
            originalScript = "grate_strength() == 1";
            return(grate_strength() == 1);

        case 1023:
            originalScript = "grate_strength() == 2";
            return(grate_strength() == 2);

        case 1501:
        case 1502:
        case 1556:
            originalScript = "game.global_vars[454] & 2**8 == 0";
            return((GetGlobalVar(454) & 0x100) == 0);

        case 1503:
            originalScript = "game.global_vars[454] & 2**8 != 0 and game.global_flags[104] == 0";
            return((GetGlobalVar(454) & 0x100) != 0 && !GetGlobalFlag(104));

        case 1504:
            originalScript = "game.global_vars[454] & 2**9 != 0 and game.global_flags[104] == 0";
            return((GetGlobalVar(454) & 0x200) != 0 && !GetGlobalFlag(104));

        case 1505:
            originalScript = "npc_get(npc, 1) == 0 and 0==1";
            return(!ScriptDaemon.npc_get(npc, 1) && 0 == 1);

        case 1506:
            originalScript = "game.global_flags[104] == 0";
            return(!GetGlobalFlag(104));

        case 1507:
            originalScript = "game.global_flags[104] == 1";
            return(GetGlobalFlag(104));

        case 1521:
        case 1523:
            originalScript = "pc.skill_level_get(skill_diplomacy) < 8";
            return(pc.GetSkillLevel(SkillId.diplomacy) < 8);

        case 1522:
        case 1524:
            originalScript = "pc.skill_level_get(skill_diplomacy) >= 8";
            return(pc.GetSkillLevel(SkillId.diplomacy) >= 8);

        case 1557:
            originalScript = "game.global_vars[454] & 2**8 != 0";
            return((GetGlobalVar(454) & 0x100) != 0);

        case 1562:
        case 1575:
        case 1805:
        case 1902:
        case 1903:
        case 1905:
            originalScript = "game.party_alignment &  ALIGNMENT_EVIL != 0";
            return(PartyAlignment.IsEvil());

        case 1563:
        case 1576:
        case 1806:
        case 1906:
            originalScript = "game.party_alignment &  ALIGNMENT_GOOD != 0";
            return(PartyAlignment.IsGood());

        case 1564:
        case 1577:
        case 1807:
        case 1907:
            originalScript = "game.party_alignment &  ALIGNMENT_EVIL == 0 and game.party_alignment &  ALIGNMENT_GOOD == 0";
            return(!PartyAlignment.IsEvil() && !PartyAlignment.IsGood());

        case 1574:
        case 1804:
            originalScript = "tpsts(507, 1) == 0";
            return(!ScriptDaemon.tpsts(507, 1));

        default:
            originalScript = null;
            return(true);
        }
    }