示例#1
0
        public bool Run(params object[] args)
        {
            NWPlayer player = _.GetLastUsedBy();

            if (!player.IsPlayer)
            {
                return(false);
            }

            NWPlaceable placeable = Object.OBJECT_SELF;
            int         keyItemID = placeable.GetLocalInt("KEY_ITEM_ID");

            if (keyItemID <= 0)
            {
                return(false);
            }

            if (_keyItem.PlayerHasKeyItem(player, keyItemID))
            {
                player.SendMessage("You already have this key item.");
                return(false);
            }

            _keyItem.GivePlayerKeyItem(player, keyItemID);

            string visibilityGUID = placeable.GetLocalString("VISIBILITY_OBJECT_ID");

            if (!string.IsNullOrWhiteSpace(visibilityGUID))
            {
                _ovs.AdjustVisibility(player, placeable, false);
            }

            return(true);
        }
示例#2
0
        private void HandleTriggerAndPlaceableQuestLogic(NWPlayer oPC, NWObject oObject)
        {
            if (!oPC.IsPlayer)
            {
                return;
            }
            string questMessage       = oObject.GetLocalString("QUEST_MESSAGE");
            int    questID            = oObject.GetLocalInt("QUEST_ID");
            int    questSequence      = oObject.GetLocalInt("QUEST_SEQUENCE");
            string visibilityObjectID = oObject.GetLocalString("VISIBILITY_OBJECT_ID");

            if (questID <= 0)
            {
                oPC.SendMessage("QUEST_ID variable not set on object. Please inform admin this quest is bugged. (QuestID: " + questID + ")");
                return;
            }

            if (questSequence <= 0)
            {
                oPC.SendMessage("QUEST_SEQUENCE variable not set on object. Please inform admin this quest is bugged. (QuestID: " + questID + ")");
                return;
            }

            PCQuestStatus pcQuestStatus = _data.SingleOrDefault <PCQuestStatus>(x => x.PlayerID == oPC.GlobalID && x.QuestID == questID);

            if (pcQuestStatus == null)
            {
                return;
            }

            QuestState questState = _data.Get <QuestState>(pcQuestStatus.CurrentQuestStateID);

            if (questState.Sequence != questSequence ||
                (questState.QuestTypeID != (int)QuestType.UseObject &&
                 questState.QuestTypeID != (int)QuestType.ExploreArea))
            {
                return;
            }


            if (!string.IsNullOrWhiteSpace(questMessage))
            {
                _.DelayCommand(1.0f, () =>
                {
                    oPC.SendMessage(questMessage);
                });
            }

            AdvanceQuestState(oPC, oObject, questID);

            if (!string.IsNullOrWhiteSpace(visibilityObjectID))
            {
                _ovs.AdjustVisibility(oPC, oObject, false);
            }
        }
示例#3
0
        public bool Run(params object[] args)
        {
            const int   QuestID = 30;
            NWPlaceable crystal = Object.OBJECT_SELF;
            NWPlayer    player  = _.GetLastUsedBy();

            // Check player's current quest state. If they aren't on stage 2 of the quest only show a message.
            var status       = _data.Single <PCQuestStatus>(x => x.PlayerID == player.GlobalID && x.QuestID == QuestID);
            var currentState = _data.Single <QuestState>(x => x.ID == status.CurrentQuestStateID);

            if (currentState.Sequence != 2)
            {
                player.SendMessage("The crystal glows quietly...");
                return(false);
            }

            // Player is on stage 2, so they're able to click the crystal, get a cluster, complete the quest, and teleport back to the cavern.
            int    type = crystal.GetLocalInt("CRYSTAL_COLOR_TYPE");
            string cluster;

            switch (type)
            {
            case 1: cluster = "c_cluster_blue"; break;    // Blue

            case 2: cluster = "c_cluster_red"; break;     // Red

            case 3: cluster = "c_cluster_green"; break;   // Green

            case 4: cluster = "c_cluster_yellow"; break;  // Yellow

            default: throw new Exception("Invalid crystal color type.");
            }

            _.CreateItemOnObject(cluster, player);
            _quest.AdvanceQuestState(player, crystal, QuestID);

            // Hide the "Source of Power?" placeable so the player can't use it again.
            _ovs.AdjustVisibility(player, "81533EBB-2084-4C97-B004-8E1D8C395F56", false);

            NWObject tpWP = _.GetObjectByTag("FORCE_QUEST_LANDING");

            player.AssignCommand(() => _.ActionJumpToLocation(tpWP.Location));

            // Notify the player that new lightsaber perks have unlocked.
            player.FloatingText("You have unlocked the Lightsaber Blueprints perk. Find this under the Engineering category in your perks menu.");

            return(true);
        }
        public void Run(NWPlayer player, NWObject questSource, int questID, string[] args)
        {
            int count = args.Length;

            for (int index = 0; index < count; index++)
            {
                if (string.IsNullOrWhiteSpace(args[index]))
                {
                    return;
                }

                string visibilityObjectID = args[index];

                var obj = _cache.VisibilityObjects.Single(x => x.Key == visibilityObjectID).Value;
                _ovs.AdjustVisibility(player, obj, true);
            }
        }
示例#5
0
        private void DoSlice()
        {
            NWPlaceable self      = Object.OBJECT_SELF;
            int         keyItemID = self.GetLocalInt("KEY_ITEM_ID");

            if (keyItemID <= 0)
            {
                GetPC().SendMessage("ERROR: Improperly configured key item. ID is not set. Notify an admin.");
                return;
            }

            _keyItem.GivePlayerKeyItem(GetPC(), keyItemID);

            string visibilityObjectID = self.GetLocalString("VISIBILITY_OBJECT_ID");

            if (!string.IsNullOrWhiteSpace(visibilityObjectID))
            {
                _ovs.AdjustVisibility(GetPC(), self, false);
            }

            EndConversation();
        }
示例#6
0
 public void Run(NWPlayer player, NWObject questSource, int questID, string[] args)
 {
     _visibility.AdjustVisibility(player, questSource, false);
 }