Esempio n. 1
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        while ((attachee.FindItemByName(8903) != null))
        {
            attachee.FindItemByName(8903).Destroy();
        }

        // if (attachee.d20_query(Q_Is_BreakFree_Possible)): # workaround no longer necessary!
        // create_item_in_inventory( 8903, attachee )
        if ((Utilities.obj_percent_hp(attachee) < 75))
        {
            GameObject found_pc = null;
            foreach (var pc in GameSystems.Party.PartyMembers)
            {
                if (pc.type == ObjectType.pc)
                {
                    found_pc = pc;
                    attachee.AIRemoveFromShitlist(pc);
                }
            }

            if (found_pc != null)
            {
                Co8.StopCombat(attachee, 1);
                found_pc.BeginDialog(attachee, 1);
                DetachScript();
                return(SkipDefault);
            }
        }

        // Spiritual Weapon Shenanigens	#
        CombatStandardRoutines.Spiritual_Weapon_Begone(attachee);
        return(RunDefault);
    }
Esempio n. 2
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        var leader = PartyLeader;

        Co8.StopCombat(attachee, 0);
        leader.BeginDialog(attachee, 4000);
        return(RunDefault);
    }
Esempio n. 3
0
    public override bool OnHeartbeat(GameObject attachee, GameObject triggerer)
    {
        if ((!GameSystems.Combat.IsCombatActive()))
        {
            Co8.StopCombat(attachee, 1);
        }

        return(RunDefault);
    }
Esempio n. 4
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        if ((GetGlobalFlag(537)))
        {
            var leader = PartyLeader;
            Co8.StopCombat(attachee, 0);
            leader.BeginDialog(attachee, 400);
        }

        return(SkipDefault);
    }
Esempio n. 5
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        if ((attachee.GetLeader() != null))
        {
            return(SkipDefault);
        }
        else
        {
            Co8.StopCombat(attachee, 0);
            attachee.FloatLine(1000, triggerer);
            attachee.SetObjectFlag(ObjectFlag.OFF);
        }

        return(RunDefault);
    }
Esempio n. 6
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        if ((GetGlobalVar(538) != 4))
        {
            SetGlobalVar(538, GetGlobalVar(538) + 1);
        }

        if ((GetGlobalVar(538) == 3))
        {
            var leader = PartyLeader;
            Co8.StopCombat(attachee, 0);
            leader.BeginDialog(attachee, 100);
            SetGlobalVar(538, 4);
        }

        return(RunDefault);
    }
Esempio n. 7
0
    public override bool OnFirstHeartbeat(GameObject attachee, GameObject triggerer)
    {
        if ((GetGlobalFlag(372)))
        {
            attachee.SetObjectFlag(ObjectFlag.OFF);
        }
        else
        {
            if ((attachee.GetLeader() == null && !GameSystems.Combat.IsCombatActive()))
            {
                SetGlobalVar(721, 0);
                Co8.StopCombat(attachee, 1);
            }
        }

        return(RunDefault);
    }
Esempio n. 8
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        if ((GetGlobalVar(704) == 8))
        {
            foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_PC))
            {
                Co8.StopCombat(attachee, 0);
                var wilfrick = Utilities.find_npc_near(attachee, 8703);
                attachee.TurnTowards(wilfrick);
                obj.BeginDialog(attachee, 1);
                SetGlobalVar(704, 9);
                return RunDefault;
            }

        }

        return RunDefault;
    }
Esempio n. 9
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        if (((GetGlobalFlag(948)) && (GetGlobalFlag(949)) && (GetGlobalFlag(950)) && (GetGlobalFlag(951)) && (GetGlobalFlag(952)) && (GetGlobalFlag(953)) && (GetGlobalFlag(954))))
        {
            foreach (var obj in ObjList.ListVicinity(attachee.GetLocation(), ObjectListFilter.OLC_PC))
            {
                Co8.StopCombat(attachee, 0);
                obj.BeginDialog(attachee, 20);
                return(RunDefault);
            }
        }
        else
        {
            return(SkipDefault);
        }

        return(RunDefault);
    }
Esempio n. 10
0
    public static bool brawl_end(GameObject attachee, GameObject triggerer, int brawl_state)
    {
        if ((brawl_state == 0))
        {
            attachee.SetReaction(triggerer, 50);
            triggerer.BeginDialog(attachee, 300);
        }
        else if ((brawl_state == 1))
        {
            attachee.SetReaction(triggerer, 50);
            triggerer.BeginDialog(attachee, 330);
        }
        else
        {
            Logger.Info("{0}", "Brawl State:" + brawl_state.ToString());
            attachee.SetReaction(triggerer, 50);
            Co8.StopCombat(attachee, 1);
            triggerer.BeginDialog(attachee, 400);
        }

        return(RunDefault);
    }
Esempio n. 11
0
    public override bool OnHeartbeat(GameObject attachee, GameObject triggerer)
    {
        if ((!GameSystems.Combat.IsCombatActive()))
        {
            Co8.StopCombat(attachee, 1);
            if ((GetQuestState(20) == QuestState.Completed))
            {
                foreach (var pc in GameSystems.Party.PartyMembers)
                {
                    if (pc.HasFollowerByName(8001))
                    {
                        pc.RemoveFollower(attachee);
                        DetachScript();
                    }
                }
            }
            else if ((GetGlobalVar(902) >= 3))
            {
                if ((attachee != null))
                {
                    var leader = attachee.GetLeader();
                    if ((leader != null))
                    {
                        leader.RemoveFollower(attachee);
                        attachee.FloatLine(22000, triggerer);
                        if ((attachee.GetMap() == 5001))
                        {
                            SetQuestState(20, QuestState.Completed);
                            SetGlobalFlag(38, true);
                        }
                    }
                }
            }
        }

        return(RunDefault);
    }
Esempio n. 12
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        Logger.Info("Iuz start combat");
        SetGlobalVar(32, GetGlobalVar(32) + 1);
        if ((GetGlobalFlag(328)))
        {
            // cuthbert has already talked and iuz shouldn't be there
            attachee.RemoveFromInitiative();
            attachee.SetObjectFlag(ObjectFlag.OFF);
            AttachParticles("sp-Magic Circle against Good-END", attachee);
            Sound(4043, 1);
            return(SkipDefault);
        }
        else
        {
            // cuthbert has not appeared
            if ((Utilities.find_npc_near(triggerer, 8032) != null))
            {
                Logger.Info("{0}", ("py00172iuz: Found Hedrack nearby"));
                // hedrack is near
                if ((GetGlobalVar(32) >= 4 && !attachee.D20Query(D20DispatcherKey.QUE_Prone)))
                {
                    Logger.Info("{0}", ("py00172iuz: 4th round or higher and is not prone"));
                    // 4th round of combat or higher and Iuz is not prone
                    var ST_CUTHBERT_PROTO = 14267;
                    var ST_CUTHBERT_NAME  = 8043;
                    var cuthbert          = Utilities.find_npc_near(attachee, ST_CUTHBERT_NAME);
                    if ((cuthbert == null))
                    {
                        Logger.Info("{0}", ("py00172iuz: Cuthbert not nearby, spawning"));
                        cuthbert = GameSystems.MapObject.CreateObject(
                            ST_CUTHBERT_PROTO,
                            attachee.GetLocation().OffsetTiles(-2, 0)
                            );
                    }

                    AttachParticles("hit-LAW-medium", cuthbert);
                    attachee.TurnTowards(cuthbert);
                    cuthbert.TurnTowards(attachee);
                    Co8.StopCombat(attachee, 0);
                    foreach (var pc in GameSystems.Party.PartyMembers)
                    {
                        if (pc.type == ObjectType.pc)
                        {
                            attachee.AIRemoveFromShitlist(pc);
                        }
                    }

                    var delegatePc = Utilities.GetDelegatePc(attachee, 35);
                    Sound(4134, 1);
                    if ((delegatePc != null))
                    {
                        delegatePc.TurnTowards(cuthbert);
                        attachee.TurnTowards(delegatePc);
                        delegatePc.BeginDialog(cuthbert, 1);
                        DetachScript();
                        return(SkipDefault);
                    }
                }
            }

            var strategy = RandomRange(453, 460);
            if ((strategy == 453))
            {
                attachee.SetInt(obj_f.critter_strategy, 453);
            }
            else if ((strategy == 454))
            {
                attachee.SetInt(obj_f.critter_strategy, 454);
            }
            else if ((strategy == 455))
            {
                attachee.SetInt(obj_f.critter_strategy, 455);
            }
            else if ((strategy == 456))
            {
                attachee.SetInt(obj_f.critter_strategy, 456);
            }
            else if ((strategy == 457))
            {
                attachee.SetInt(obj_f.critter_strategy, 457);
            }
            else if ((strategy == 458))
            {
                attachee.SetInt(obj_f.critter_strategy, 458);
            }
            else if ((strategy == 459))
            {
                attachee.SetInt(obj_f.critter_strategy, 459);
            }
            else if ((strategy == 460))
            {
                attachee.SetInt(obj_f.critter_strategy, 460);
            }
        }

        return(RunDefault);
    }
Esempio n. 13
0
    public override bool OnStartCombat(GameObject attachee, GameObject triggerer)
    {
        Logger.Info("Hedrack san_start_combat");
        if ((attachee != null && !Utilities.critter_is_unconscious(attachee) && !attachee.D20Query(D20DispatcherKey.QUE_Prone)))
        {
            SetGlobalVar(744, GetGlobalVar(744) + 1);
            if ((GetGlobalVar(744) == 3 && !GetGlobalFlag(823) && !GetGlobalFlag(147) && !GetGlobalFlag(990)))
            {
                var shocky_backup = GameSystems.MapObject.CreateObject(14233, attachee.GetLocation().OffsetTiles(-8, 0));
                shocky_backup.TurnTowards(attachee);
                Sound(4035, 1);
                AttachParticles("sp-Teleport", shocky_backup);
                var racky = attachee.GetInitiative();
                shocky_backup.AddToInitiative();
                shocky_backup.SetInitiative(racky);
                UiSystems.Combat.Initiative.UpdateIfNeeded();
                foreach (var obj in ObjList.ListVicinity(shocky_backup.GetLocation(), ObjectListFilter.OLC_PC))
                {
                    shocky_backup.Attack(obj);
                }

                SetGlobalFlag(823, true);
            }

            if ((Utilities.obj_percent_hp(attachee) <= 50))
            {
                if ((!GetGlobalFlag(377)))
                {
                    Co8.StopCombat(attachee, 0);
                    var delegatePc = Utilities.GetDelegatePc(attachee);
                    Logger.Info("{0}", "Hedrack: Stopping combat. Delegate PC selected for dialog is " + delegatePc.ToString());
                    foreach (var pc in GameSystems.Party.PartyMembers)
                    {
                        attachee.AIRemoveFromShitlist(pc);
                    }

                    if ((delegatePc != null))
                    {
                        delegatePc.TurnTowards(attachee);
                        attachee.TurnTowards(delegatePc);
                        delegatePc.BeginDialog(attachee, 190);
                        SetGlobalFlag(377, true);
                        return(SkipDefault);
                    }
                }
                else
                {
                    if ((GetGlobalVar(781) <= 5))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 469);
                        SetGlobalVar(781, GetGlobalVar(781) + 1);
                    }
                    else if ((GetGlobalVar(780) <= 8))
                    {
                        if ((GetGlobalVar(782) >= 5))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 470);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 468);
                        }

                        SetGlobalVar(780, GetGlobalVar(780) + 1);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 472);
                    }
                }
            }
            else if ((Utilities.obj_percent_hp(attachee) >= 51 && Utilities.obj_percent_hp(attachee) <= 75))
            {
                if ((!GetGlobalFlag(377)))
                {
                    if ((GetGlobalVar(781) <= 5))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 469);
                        SetGlobalVar(781, GetGlobalVar(781) + 1);
                    }
                    else if ((GetGlobalVar(780) <= 8))
                    {
                        if ((GetGlobalVar(782) >= 5))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 470);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 468);
                        }

                        SetGlobalVar(780, GetGlobalVar(780) + 1);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 472);
                    }
                }
                else
                {
                    if ((GetGlobalVar(781) <= 5))
                    {
                        attachee.SetInt(obj_f.critter_strategy, 469);
                        SetGlobalVar(781, GetGlobalVar(781) + 1);
                    }
                    else if ((GetGlobalVar(780) <= 8))
                    {
                        if ((GetGlobalVar(782) >= 5))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 470);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 468);
                        }

                        SetGlobalVar(780, GetGlobalVar(780) + 1);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 472);
                    }
                }
            }
            else
            {
                if ((!GetGlobalFlag(377)))
                {
                    if ((GetGlobalVar(780) <= 8))
                    {
                        if ((GetGlobalVar(782) >= 5))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 470);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 468);
                        }

                        SetGlobalVar(780, GetGlobalVar(780) + 1);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 472);
                    }
                }
                else
                {
                    if ((GetGlobalVar(780) <= 8))
                    {
                        if ((GetGlobalVar(782) >= 5))
                        {
                            attachee.SetInt(obj_f.critter_strategy, 470);
                        }
                        else
                        {
                            attachee.SetInt(obj_f.critter_strategy, 468);
                        }

                        SetGlobalVar(780, GetGlobalVar(780) + 1);
                    }
                    else
                    {
                        attachee.SetInt(obj_f.critter_strategy, 472);
                    }
                }
            }
        }

        return(RunDefault);
    }