Example #1
0
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        if ((GetGlobalFlag(819)))
        {
            attachee.Attack(triggerer);
            return(SkipDefault);
        }

        if ((attachee.GetLeader() != null))
        {
            triggerer.BeginDialog(attachee, 100); // spugnoir in party
        }
        else if ((GetGlobalVar(913) == 32))
        {
            triggerer.BeginDialog(attachee, 140); // have attacked 3 or more farm animals with spugnoir in party
        }
        else if ((SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29)))
        {
            attachee.FloatLine(11004, triggerer); // have lawbreaker or convict or banished from hommlet rep
        }
        else
        {
            triggerer.BeginDialog(attachee, 1); // none of the above
        }

        return(SkipDefault);
    }
Example #2
0
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        attachee.TurnTowards(triggerer);
        if ((attachee.GetLeader() != null))
        {
            triggerer.BeginDialog(attachee, 250); // pishella in party
        }
        else if ((attachee.GetMap() == 5014))
        {
            triggerer.BeginDialog(attachee, 330); // WotGS Hommlet under attack
        }
        else if ((GetGlobalVar(911) == 32 && attachee.GetMap() != 5016 && attachee.GetMap() != 5019))
        {
            triggerer.BeginDialog(attachee, 350); // have attacked 3 or more farm animals with pishella in party and not in castle main hall or parapet interior
        }
        else if ((SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29)))
        {
            attachee.FloatLine(12014, triggerer); // have lawbreaker or convict or banished from hommlet reps
        }
        else if ((GetGlobalFlag(694)))
        {
            triggerer.BeginDialog(attachee, 400); // declined to share information on who is altering construction orders
        }
        else if ((PartyLeader.HasReputation(27)))
        {
            triggerer.BeginDialog(attachee, 180); // have rabble-rouser reputation
        }
        else
        {
            triggerer.BeginDialog(attachee, 1); // none of the above
        }

        return(SkipDefault);
    }
Example #3
0
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        if ((SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29)))
        {
            attachee.FloatLine(11004, triggerer);
        }
        else if ((GetGlobalFlag(61)))
        {
            triggerer.BeginDialog(attachee, 500);
        }
        else if ((attachee.GetLeader() != null))
        {
            triggerer.BeginDialog(attachee, 300);
        }
        else if ((GetGlobalFlag(51)))
        {
            if ((GetQuestState(18) == QuestState.Completed))
            {
                triggerer.BeginDialog(attachee, 220);
            }
            else
            {
                triggerer.BeginDialog(attachee, 210);
            }
        }
        else
        {
            triggerer.BeginDialog(attachee, 1);
        }

        return(SkipDefault);
    }
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        if ((SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29)))
        {
            attachee.FloatLine(11004, triggerer);
        }
        else
        {
            if ((attachee.GetMap() == 5007))
            {
                if ((GetQuestState(19) == QuestState.Unknown))
                {
                    triggerer.BeginDialog(attachee, 1);
                }
                else if ((GetQuestState(19) == QuestState.Mentioned))
                {
                    triggerer.BeginDialog(attachee, 40);
                }
                else if ((GetQuestState(19) == QuestState.Accepted || GetQuestState(19) == QuestState.Botched))
                {
                    triggerer.BeginDialog(attachee, 50);
                }
                else
                {
                    triggerer.BeginDialog(attachee, 60);
                }
            }
            else
            {
                triggerer.BeginDialog(attachee, 90);
            }
        }

        return(SkipDefault);
    }
Example #5
0
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        if ((SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29)))
        {
            attachee.FloatLine(11002, triggerer);
        }
        else
        {
            if ((triggerer.GetStat(Stat.charisma) >= 8 && triggerer.GetGender() == Gender.Female))
            {
                if ((attachee.HasMet(triggerer)))
                {
                    triggerer.BeginDialog(attachee, 70);
                }
                else
                {
                    triggerer.BeginDialog(attachee, 1);
                }
            }
            else
            {
                triggerer.BeginDialog(attachee, 80);
            }
        }

        return(SkipDefault);
    }
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        if ((attachee.GetMap() == 5001 && (SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29))))
        {
            attachee.FloatLine(11004, triggerer);
        }
        else
        {
            if ((!attachee.HasMet(triggerer)))
            {
                if ((!GetGlobalFlag(169)))
                {
                    triggerer.BeginDialog(attachee, 1);
                }
                else
                {
                    triggerer.BeginDialog(attachee, 40);
                }
            }
            else if ((GetGlobalFlag(169)))
            {
                triggerer.BeginDialog(attachee, 100);
            }
            else if ((GetGlobalFlag(170)))
            {
                triggerer.BeginDialog(attachee, 110);
            }
            else
            {
                triggerer.BeginDialog(attachee, 120);
            }
        }

        return(SkipDefault);
    }
Example #7
0
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        if ((SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29)))
        {
            attachee.FloatLine(11004, triggerer);
        }
        else
        {
            if ((attachee.GetLeader() != null))
            {
                if ((GetGlobalFlag(207)))
                {
                    triggerer.BeginDialog(attachee, 80);
                }
                else
                {
                    triggerer.BeginDialog(attachee, 100);
                }
            }
            else if ((GetGlobalFlag(207)))
            {
                triggerer.BeginDialog(attachee, 50);
            }
            else if ((attachee.HasMet(triggerer)))
            {
                triggerer.BeginDialog(attachee, 30);
            }
            else
            {
                triggerer.BeginDialog(attachee, 1);
            }
        }

        return(SkipDefault);
    }
Example #8
0
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        if ((SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29)))
        {
            attachee.FloatLine(11004, triggerer);
        }
        else
        {
            triggerer.BeginDialog(attachee, 1);
        }

        return(SkipDefault);
    }
Example #9
0
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 1001:
            originalScript = "game.leader.reputation_has(25) == 0";
            return(!SelectedPartyLeader.HasReputation(25));

        case 1002:
            originalScript = "game.leader.reputation_has(25) == 1";
            return(SelectedPartyLeader.HasReputation(25));

        default:
            originalScript = null;
            return(true);
        }
    }
Example #10
0
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        if ((SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29)))
        {
            attachee.FloatLine(11004, triggerer);
        }
        else
        {
            if ((GetGlobalVar(9) >= 2 && triggerer.GetGender() == Gender.Female))
            {
                SetGlobalVar(9, 2 + StoryState);
            }

            triggerer.BeginDialog(attachee, 1);
        }

        return(SkipDefault);
    }
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        attachee.TurnTowards(triggerer);
        if ((SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29)))
        {
            attachee.FloatLine(11004, triggerer);
        }
        else if ((attachee.GetMap() == 5001) && (GetGlobalVar(4) <= 4))
        {
            triggerer.BeginDialog(attachee, 110);
        }
        else if ((attachee.GetMap() == 5001) && (GetGlobalVar(4) == 6))
        {
            triggerer.BeginDialog(attachee, 200);
        }
        else
        {
            triggerer.BeginDialog(attachee, 1);
        }

        return(SkipDefault);
    }
Example #12
0
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        attachee.TurnTowards(triggerer);
        if ((SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29)))
        {
            attachee.FloatLine(11004, triggerer);
        }
        else if (((GetQuestState(3) == QuestState.Completed) || (GetQuestState(4) == QuestState.Completed)))
        {
            triggerer.BeginDialog(attachee, 20);
        }
        else if (((attachee.HasMet(triggerer)) || (GetQuestState(3) == QuestState.Accepted) || (GetQuestState(4) == QuestState.Accepted)))
        {
            triggerer.BeginDialog(attachee, 10);
        }
        else
        {
            triggerer.BeginDialog(attachee, 1);
        }

        return(SkipDefault);
    }
Example #13
0
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 2:
        case 4:
            originalScript = "game.party_alignment != LAWFUL_EVIL and game.party_alignment != NEUTRAL_EVIL and game.party_alignment != CHAOTIC_EVIL";
            return(PartyAlignment != Alignment.LAWFUL_EVIL && PartyAlignment != Alignment.NEUTRAL_EVIL && PartyAlignment != Alignment.CHAOTIC_EVIL);

        case 3:
        case 5:
            originalScript = "game.party_alignment == LAWFUL_EVIL or game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL or game.leader.reputation_has(32) == 1 or game.leader.reputation_has(30) == 1 or game.leader.reputation_has(29) == 1";
            return(PartyAlignment == Alignment.LAWFUL_EVIL || PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL || SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29));

        case 25:
        case 26:
        case 71:
        case 72:
            originalScript = "pc.skill_level_get(npc, skill_sense_motive) >= 10";
            return(pc.GetSkillLevel(npc, SkillId.sense_motive) >= 10);

        default:
            originalScript = null;
            return(true);
        }
    }
Example #14
0
    public override bool OnDialog(GameObject attachee, GameObject triggerer)
    {
        var st = attachee.GetInt(obj_f.npc_pad_i_5);

        attachee.TurnTowards(triggerer);
        if ((attachee.GetMap() == 5013))
        {
            attachee.FloatLine(23000, triggerer);
        }
        else if ((GetGlobalVar(915) == 32))
        {
            triggerer.BeginDialog(attachee, 570); // have attacked 3 or more farm animals with ronald in party
        }
        else if ((SelectedPartyLeader.HasReputation(32) || SelectedPartyLeader.HasReputation(30) || SelectedPartyLeader.HasReputation(29)))
        {
            attachee.FloatLine(11004, triggerer);
        }
        else if ((attachee.HasMet(triggerer)))
        {
            if (GetGlobalVar(692) == 2 && GetGlobalVar(693) == 3 && (attachee.GetLeader() == null))
            {
                attachee.FloatLine(600, triggerer); // not in party, Gruumsh
                return(SkipDefault);
            }
            else if (GetGlobalVar(692) == 1 && (attachee.GetLeader() == null))
            {
                triggerer.BeginDialog(attachee, 260); // not in party, Lareth
                return(SkipDefault);
            }
            else if (GetGlobalVar(692) == 3 && (GetGlobalVar(693) == 1 || GetGlobalVar(692) == 2) && (attachee.GetLeader() == null))
            {
                triggerer.BeginDialog(attachee, 90); // not in party, orcs present after issues
                return(SkipDefault);
            }
            else if (GetGlobalVar(692) == 3 && GetGlobalVar(693) == 0 && (attachee.GetLeader() == null))
            {
                triggerer.BeginDialog(attachee, 355); // not in party, orcs gone after issues
                return(SkipDefault);
            }
            else if ((GetGlobalVar(692) >= 5 && GetGlobalVar(692) <= 7) && (attachee.GetLeader() == null))
            {
                triggerer.BeginDialog(attachee, 100); // return with money
                return(SkipDefault);
            }
            else if (GetGlobalVar(692) == 0 && (attachee.GetLeader() == null))
            {
                triggerer.BeginDialog(attachee, 200); // return with no grudges
                return(SkipDefault);
            }
            else if (GetGlobalVar(692) == 2 && GetGlobalVar(693) == 0 && (attachee.GetLeader() == null))
            {
                triggerer.BeginDialog(attachee, 355); // not in party, returning after Gruumsh, Gruumsh gone
                return(SkipDefault);
            }
            else if (GetGlobalVar(692) == 8 && (attachee.GetLeader() == null))
            {
                triggerer.BeginDialog(attachee, 900); // not in party, left because party didn't pay for resurrection - not done yet!!!!
                return(SkipDefault);
            }
            else if (GetGlobalVar(692) == 9 && (attachee.GetLeader() == null))
            {
                attachee.FloatLine(600, triggerer); // left because hates party's guts, won't talk
                return(SkipDefault);
            }
            else if (GetGlobalVar(692) == 10 && (attachee.GetLeader() == null))
            {
                triggerer.BeginDialog(attachee, 2150); // done, left to talk to Dad
                return(SkipDefault);
            }
            else if (GetGlobalVar(692) == 11 && (attachee.GetLeader() == null))
            {
                triggerer.BeginDialog(attachee, 2200); // chatted with Dad, ready to go
                return(SkipDefault);
            }
            else if ((attachee.GetLeader() != null && st == 1))
            {
                triggerer.BeginDialog(attachee, 2060); // in party, wanting to resurrect
                return(SkipDefault);
            }
            else if ((attachee.GetLeader() != null && st == 0))
            {
                triggerer.BeginDialog(attachee, 120); // in party, not resurrecting yet
                return(SkipDefault);
            }
            else if ((attachee.GetLeader() != null && st == 2))
            {
                triggerer.BeginDialog(attachee, 2250); // back in party, post parents
                return(SkipDefault);
            }
            else
            {
                attachee.FloatLine(600, triggerer); // anything else he just won't talk
                return(SkipDefault);
            }
        }
        else
        {
            if ((GetGlobalVar(5) > 7) && !triggerer.HasReputation(2))
            {
                attachee.FloatLine(600, triggerer);
            }
            else
            {
                triggerer.BeginDialog(attachee, 1); // none of the above
            }
        }

        return(SkipDefault);
    }
    public bool CheckPrecondition(GameObject npc, GameObject pc, int lineNumber, out string originalScript)
    {
        switch (lineNumber)
        {
        case 4:
            originalScript = "game.global_vars[963] == 1";
            return(GetGlobalVar(963) == 1);

        case 5:
        case 16:
            originalScript = "game.global_vars[963] == 0";
            return(GetGlobalVar(963) == 0);

        case 6:
        case 21:
            originalScript = "game.global_flags[807] == 1";
            return(GetGlobalFlag(807));

        case 13:
            originalScript = "game.global_vars[963] == 8 and not get_2(npc)";
            return(GetGlobalVar(963) == 8 && !Scripts.get_2(npc));

        case 14:
            originalScript = "(game.quests[83].state == qs_mentioned or game.quests[83].state == qs_botched) and not get_1(npc)";
            return((GetQuestState(83) == QuestState.Mentioned || GetQuestState(83) == QuestState.Botched) && !Scripts.get_1(npc));

        case 15:
            originalScript = "game.global_vars[963] == 1 and game.leader.reputation_has(37) == 0 and game.leader.reputation_has(38) == 0";
            return(GetGlobalVar(963) == 1 && !SelectedPartyLeader.HasReputation(37) && !SelectedPartyLeader.HasReputation(38));

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

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

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

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

        case 101:
            originalScript = "pc.money_get() >= 10000000";
            return(pc.GetMoney() >= 10000000);

        case 102:
            originalScript = "pc.money_get() <= 9999900";
            return(pc.GetMoney() <= 9999900);

        case 151:
        case 171:
            originalScript = "pc.money_get() >= 5500000";
            return(pc.GetMoney() >= 5500000);

        case 152:
        case 172:
            originalScript = "pc.money_get() <= 5499900";
            return(pc.GetMoney() <= 5499900);

        case 211:
            originalScript = "pc.money_get() >= 8250000";
            return(pc.GetMoney() >= 8250000);

        case 212:
            originalScript = "pc.money_get() <= 8249900";
            return(pc.GetMoney() <= 8249900);

        case 271:
        case 311:
        case 321:
        case 331:
        case 341:
        case 351:
        case 361:
        case 371:
        case 381:
        case 391:
        case 401:
        case 411:
        case 421:
        case 431:
        case 441:
        case 451:
        case 461:
        case 471:
        case 481:
        case 491:
        case 501:
        case 511:
        case 521:
        case 531:
        case 541:
        case 601:
        case 641:
        case 681:
            originalScript = "game.global_vars[899] <= 24 and game.global_flags[810] == 0";
            return(GetGlobalVar(899) <= 24 && !GetGlobalFlag(810));

        case 272:
        case 312:
        case 322:
        case 332:
        case 342:
        case 352:
        case 362:
        case 372:
        case 382:
        case 392:
        case 402:
        case 412:
        case 422:
        case 432:
        case 442:
        case 452:
        case 462:
        case 472:
        case 482:
        case 492:
        case 502:
        case 512:
        case 522:
        case 532:
        case 542:
        case 602:
        case 642:
        case 682:
            originalScript = "game.global_vars[899] <= 24 and game.global_flags[810] == 1";
            return(GetGlobalVar(899) <= 24 && GetGlobalFlag(810));

        case 273:
        case 573:
        case 603:
        case 643:
        case 693:
            originalScript = "game.global_vars[899] == 0";
            return(GetGlobalVar(899) == 0);

        case 274:
        case 574:
        case 604:
        case 644:
        case 694:
            originalScript = "game.global_vars[899] == 1";
            return(GetGlobalVar(899) == 1);

        case 275:
        case 575:
        case 605:
        case 645:
        case 695:
            originalScript = "game.global_vars[899] == 2";
            return(GetGlobalVar(899) == 2);

        case 276:
        case 576:
        case 606:
        case 646:
        case 696:
            originalScript = "game.global_vars[899] == 3";
            return(GetGlobalVar(899) == 3);

        case 277:
        case 577:
        case 607:
        case 647:
        case 697:
            originalScript = "game.global_vars[899] == 4";
            return(GetGlobalVar(899) == 4);

        case 278:
        case 578:
        case 608:
        case 648:
        case 698:
            originalScript = "game.global_vars[899] == 5";
            return(GetGlobalVar(899) == 5);

        case 279:
        case 579:
        case 609:
        case 649:
        case 699:
            originalScript = "game.global_vars[899] == 6";
            return(GetGlobalVar(899) == 6);

        case 280:
        case 580:
        case 610:
        case 650:
        case 700:
            originalScript = "game.global_vars[899] == 7";
            return(GetGlobalVar(899) == 7);

        case 281:
        case 581:
        case 611:
        case 651:
        case 701:
            originalScript = "game.global_vars[899] == 8";
            return(GetGlobalVar(899) == 8);

        case 282:
        case 582:
        case 612:
        case 652:
        case 702:
            originalScript = "game.global_vars[899] == 9";
            return(GetGlobalVar(899) == 9);

        case 283:
        case 583:
        case 613:
        case 653:
        case 703:
            originalScript = "game.global_vars[899] == 10";
            return(GetGlobalVar(899) == 10);

        case 284:
        case 584:
        case 614:
        case 654:
        case 704:
            originalScript = "game.global_vars[899] == 11";
            return(GetGlobalVar(899) == 11);

        case 285:
        case 585:
        case 615:
        case 655:
        case 705:
            originalScript = "game.global_vars[899] == 12";
            return(GetGlobalVar(899) == 12);

        case 286:
        case 586:
        case 616:
        case 656:
        case 706:
            originalScript = "game.global_vars[899] == 13";
            return(GetGlobalVar(899) == 13);

        case 287:
        case 587:
        case 617:
        case 657:
        case 707:
            originalScript = "game.global_vars[899] == 14";
            return(GetGlobalVar(899) == 14);

        case 288:
        case 588:
        case 618:
        case 658:
        case 708:
            originalScript = "game.global_vars[899] == 15";
            return(GetGlobalVar(899) == 15);

        case 289:
        case 589:
        case 619:
        case 659:
        case 709:
            originalScript = "game.global_vars[899] == 16";
            return(GetGlobalVar(899) == 16);

        case 290:
        case 590:
        case 620:
        case 660:
        case 710:
            originalScript = "game.global_vars[899] == 17";
            return(GetGlobalVar(899) == 17);

        case 291:
        case 591:
        case 621:
        case 661:
        case 711:
            originalScript = "game.global_vars[899] == 18";
            return(GetGlobalVar(899) == 18);

        case 292:
        case 592:
        case 622:
        case 662:
        case 712:
            originalScript = "game.global_vars[899] == 19";
            return(GetGlobalVar(899) == 19);

        case 293:
        case 593:
        case 623:
        case 663:
        case 713:
            originalScript = "game.global_vars[899] == 20";
            return(GetGlobalVar(899) == 20);

        case 294:
        case 594:
        case 624:
        case 664:
        case 714:
            originalScript = "game.global_vars[899] == 21";
            return(GetGlobalVar(899) == 21);

        case 295:
        case 595:
        case 625:
        case 665:
        case 715:
            originalScript = "game.global_vars[899] == 22";
            return(GetGlobalVar(899) == 22);

        case 296:
        case 596:
        case 626:
        case 666:
        case 716:
            originalScript = "game.global_vars[899] == 23";
            return(GetGlobalVar(899) == 23);

        case 297:
        case 597:
        case 627:
        case 667:
        case 717:
            originalScript = "game.global_vars[899] == 24";
            return(GetGlobalVar(899) == 24);

        case 298:
        case 299:
        case 313:
        case 323:
        case 333:
        case 343:
        case 353:
        case 363:
        case 373:
        case 383:
        case 393:
        case 403:
        case 413:
        case 423:
        case 433:
        case 443:
        case 453:
        case 463:
        case 473:
        case 483:
        case 493:
        case 503:
        case 513:
        case 523:
        case 533:
        case 543:
        case 598:
        case 628:
        case 629:
        case 668:
        case 669:
        case 683:
        case 718:
            originalScript = "game.global_vars[899] == 25";
            return(GetGlobalVar(899) == 25);

        case 721:
            originalScript = "(game.party_alignment == LAWFUL_NEUTRAL or game.party_alignment == LAWFUL_GOOD or game.party_alignment == NEUTRAL_GOOD) and game.global_flags[807] == 1";
            return((PartyAlignment == Alignment.LAWFUL_NEUTRAL || PartyAlignment == Alignment.LAWFUL_GOOD || PartyAlignment == Alignment.NEUTRAL_GOOD) && GetGlobalFlag(807));

        case 722:
            originalScript = "(game.party_alignment == LAWFUL_EVIL or game.party_alignment == TRUE_NEUTRAL or game.party_alignment == CHAOTIC_GOOD) and game.global_flags[807] == 1";
            return((PartyAlignment == Alignment.LAWFUL_EVIL || PartyAlignment == Alignment.NEUTRAL || PartyAlignment == Alignment.CHAOTIC_GOOD) && GetGlobalFlag(807));

        case 723:
            originalScript = "(game.party_alignment == NEUTRAL_EVIL or game.party_alignment == CHAOTIC_EVIL or game.party_alignment == CHAOTIC_NEUTRAL) and game.global_flags[807] == 1";
            return((PartyAlignment == Alignment.NEUTRAL_EVIL || PartyAlignment == Alignment.CHAOTIC_EVIL || PartyAlignment == Alignment.CHAOTIC_NEUTRAL) && GetGlobalFlag(807));

        default:
            originalScript = null;
            return(true);
        }
    }
    public static bool should_display_dialog_node(string node_name)
    {
        var cur_map = SelectedPartyLeader.GetMap();

        if (node_name == "Temple Entrance")
        {
            if (cur_map == 5064)
            {
                return(false);
            }
        }
        else if (node_name == "Temple Tower Exterior")
        {
            if (cur_map == 5113)
            {
                return(false);
            }

            if (ScriptDaemon.get_f("visited_temple_tower_exterior"))
            {
                return(true);
            }
        }
        else if (node_name == "More Upper Proper")
        {
            var option_count = 0;
            if (cur_map != 5064)
            {
                option_count += 1;
            }

            if (cur_map != 5113 && ScriptDaemon.get_f("visited_temple_tower_exterior"))
            {
                option_count += 1;
            }

            if (cur_map != 5065 && ScriptDaemon.get_f("visited_temple_tower_interior"))
            {
                option_count += 1;
            }

            if (cur_map != 5093 && ScriptDaemon.get_f("visited_temple_burnt_farmhouse"))
            {
                option_count += 1;
            }

            if (cur_map != 5092 && ScriptDaemon.get_f("visited_temple_escape_tunnel"))
            {
                option_count += 1;
            }

            if (cur_map != 5112 && ScriptDaemon.get_f("visited_temple_ruined_building"))
            {
                option_count += 1;
            }

            return(option_count >= 5);
        }
        else if (node_name == "Level 1")
        {
            if (cur_map == 5066)
            {
                return(false);
            }

            if (ScriptDaemon.get_f("visited_level_1_north_entrance") || ScriptDaemon.get_f("visited_level_1_south_entrance") || ScriptDaemon.get_f("visited_level_1_south_entrance") || SelectedPartyLeader.HasReputation(11) || ScriptDaemon.get_f("visited_secret_spiral_staircase"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 1 - North")
        {
            if (ScriptDaemon.get_f("visited_level_1_north_entrance"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 1 - South")
        {
            if (ScriptDaemon.get_f("visited_level_1_south_entrance"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 1 - Romag")
        {
            if (SelectedPartyLeader.HasReputation(11))
            {
                return(true);
            }
        }
        else if (node_name == "Secret Spiral Staircase")
        {
            if (ScriptDaemon.get_f("visited_secret_spiral_staircase"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 2")
        {
            if (cur_map == 5067)
            {
                return(false);
            }

            if (ScriptDaemon.get_f("visited_level_2_north_west_entrance") || ScriptDaemon.get_f("visited_level_2_centre_entrance") || SelectedPartyLeader.HasReputation(13) || SelectedPartyLeader.HasReputation(12) || SelectedPartyLeader.HasReputation(10))
            {
                return(true);
            }
        }
        else if (node_name == "Level 2 - North West")
        {
            if (ScriptDaemon.get_f("visited_level_2_north_west_entrance"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 2 - Centre")
        {
            if (ScriptDaemon.get_f("visited_level_2_centre_entrance"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 2 - Alrrem")
        {
            if (SelectedPartyLeader.HasReputation(13))
            {
                return(true);
            }
        }
        else if (node_name == "Level 2 - Belsornig")
        {
            if (SelectedPartyLeader.HasReputation(12))
            {
                return(true);
            }
        }
        else if (node_name == "Level 2 - Kelno")
        {
            if (SelectedPartyLeader.HasReputation(10))
            {
                return(true);
            }
        }
        else if (node_name == "Level 2 More")
        {
            var option_count = 0;
            if (ScriptDaemon.get_f("visited_level_2_north_west_entrance"))
            {
                option_count += 1;
            }

            if (ScriptDaemon.get_f("visited_level_2_centre_entrance"))
            {
                option_count += 1;
            }

            if (SelectedPartyLeader.HasReputation(13))
            {
                option_count += 1;
            }

            if (SelectedPartyLeader.HasReputation(12))
            {
                option_count += 1;
            }

            if (SelectedPartyLeader.HasReputation(10))
            {
                option_count += 1;
            }

            return(option_count >= 5);
        }
        else if (node_name == "Secret Spiral Staircase")
        {
            if (ScriptDaemon.get_f("visited_secret_spiral_staircase"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 3")
        {
            if (cur_map == 5105)
            {
                return(false);
            }

            if (ScriptDaemon.get_f("visited_level_3_east_entrance") || ScriptDaemon.get_f("visited_level_3_west_entrance") || ScriptDaemon.get_f("visited_level_3_south_west_entrance") || ScriptDaemon.get_f("visited_level_3_falrinth"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 3 - East")
        {
            if (ScriptDaemon.get_f("visited_level_3_east_entrance"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 3 - West")
        {
            if (ScriptDaemon.get_f("visited_level_3_west_entrance"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 3 - South")
        {
            if (ScriptDaemon.get_f("visited_level_3_south_west_entrance"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 3 - Falrinth")
        {
            if (ScriptDaemon.get_f("visited_level_3_falrinth"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 4")
        {
            if (cur_map == 5080)
            {
                return(false);
            }

            if (ScriptDaemon.get_f("visited_level_4_main_entrance") || ScriptDaemon.get_f("visited_level_4_nexus") || ScriptDaemon.get_f("visited_level_4_hedrack"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 4 - Main")
        {
            if (ScriptDaemon.get_f("visited_level_4_main_entrance"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 4 - Nexus")
        {
            if (ScriptDaemon.get_f("visited_level_4_nexus"))
            {
                return(true);
            }
        }
        else if (node_name == "Level 4 - Hedrack")
        {
            if (ScriptDaemon.get_f("visited_level_4_hedrack"))
            {
                return(true);
            }
        }
        else if (node_name == "Nodes")
        {
            if (ScriptDaemon.get_f("visited_air_node") || ScriptDaemon.get_f("visited_earth_node") || ScriptDaemon.get_f("visited_fire_node") || ScriptDaemon.get_f("visited_water_node"))
            {
                return(true);
            }
        }
        else if (node_name == "Air Node")
        {
            if (ScriptDaemon.get_f("visited_air_node"))
            {
                return(true);
            }
        }
        else if (node_name == "Earth Node")
        {
            if (ScriptDaemon.get_f("visited_earth_node"))
            {
                return(true);
            }
        }
        else if (node_name == "Fire Node")
        {
            if (ScriptDaemon.get_f("visited_fire_node"))
            {
                return(true);
            }
        }
        else if (node_name == "Water Node")
        {
            if (ScriptDaemon.get_f("visited_water_node"))
            {
                return(true);
            }
        }
        else if (node_name == "Zuggtmoy Level")
        {
            if (cur_map == 5079)
            {
                return(false);
            }

            if (ScriptDaemon.get_f("visited_zuggtmoy_level"))
            {
                return(true);
            }
        }

        return(true);
    }
Example #17
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);
        }
    }