local H=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local u=require((H:WaitForChild("\080\114\111\106\101\099\116")):WaitForChild("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101"))local z=require((H:WaitForChild("\080\114\111\106\101\099\116")):WaitForChild("\083\101\114\118\101\114\083\099\114\105\112\116\083\101\114\118\105\099\101"))local A=u:GetResource("\071\097\109\101\068\097\116\097\046\073\116\101\109\046\073\116\101\109\115")local Z=u:GetResource("\071\097\109\101\068\097\116\097\046\071\101\110\101\114\097\116\105\111\110\046\078\080\067\076\111\099\097\116\105\111\110\115")local W=u:GetResource("\071\097\109\101\068\097\116\097\046\081\117\101\115\116\046\081\117\101\115\116\115")local s=z:GetResource("\083\101\114\118\105\099\101\046\081\117\101\115\116\083\101\114\118\105\099\101")local V=z:GetResource("\083\101\114\118\105\099\101\046\073\110\118\101\110\116\111\114\121\083\101\114\118\105\099\101")return{Keyword="\115\097\116\105\115\102\121\099\117\114\114\101\110\116\113\117\101\115\116",Description="\083\097\116\105\115\102\105\101\115 \116\104\101 \114\101\113\117\105\114\101\109\101\110\116\115 \102\111\114 \097 \113\117\101\115\116\046 \068\111\101\115\110\'\116 \099\111\109\112\108\101\116\101 \116\104\101 \113\117\101\115\116 \116\111 \097\108\108\111\119 \116\101\115\116\105\110\103 \111\102 \116\104\101 \100\105\097\108\111\103\115\046",Arguments={{Type="\110\101\120\117\115\065\100\109\105\110\080\108\097\121\101\114\115",Name="\080\108\097\121\101\114\115";Description="\080\108\097\121\101\114\115 \116\111 \115\097\116\105\115\102\121 \116\104\101 \115\101\108\101\099\116\101\100 \113\117\101\115\116\046"}};Run=function(H,u,z)for H,u in pairs(z)do local z=s.PlayerQuests[u]local U=z.QuestData.SelectedQuest if U then local H=W[U]if H then if H.QuestType=="\073\116\101\109\115"then local z=H.RequiredItems[1]for H=1,z.Amount,1 do V:AddItem(u,z.Name)end elseif H.QuestType=="\068\114\101\115\115\117\112"then local z=H.RequiredSet.Name local Z=V:GetInventory(u)for H,u in pairs(A)do if u.CostumeName==z then Z.Inventory[u.ItemType]={Name=H}end end Z:Save()elseif H.QuestType=="\077\111\110\115\116\101\114\115"then local u=H.RequiredMonsters[1]for H=1,u.Amount,1 do z:RegisterMonsterKill(u.Name)end elseif H.QuestType=="\078\080\067"then local z=H.RequiredNPC.Name local A=Z[z]local W=((CFrame.new(A.CellX*100,4,A.CellY*100)*A.OffsetCFrame)*CFrame.new(0,0,-3))*CFrame.Angles(0,math.pi,0)local s=u.Character if s then local H=s:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if H then H.CFrame=W end end end end end end end}
--[[
TheNexusAvenger

Data for a command for giving items to players.
--]]

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ReplicatedStorageProject = require(ReplicatedStorage:WaitForChild("Project"):WaitForChild("ReplicatedStorage"))
local ServerScriptServiceProject = require(ReplicatedStorage:WaitForChild("Project"):WaitForChild("ServerScriptService"))
local ItemData = ReplicatedStorageProject:GetResource("GameData.Item.Items")
local NPCLocations = ReplicatedStorageProject:GetResource("GameData.Generation.NPCLocations")
local QuestData = ReplicatedStorageProject:GetResource("GameData.Quest.Quests")
local QuestService = ServerScriptServiceProject:GetResource("Service.QuestService")
local InventoryService = ServerScriptServiceProject:GetResource("Service.InventoryService")



return {
    Keyword = "satisfycurrentquest",
    Description = "Satisfies the requirements for a quest. Doesn't complete the quest to allow testing of the dialogs.",
    Arguments = {
        {
            Type = "nexusAdminPlayers",
            Name = "Players",
            Description = "Players to satisfy the selected quest.",
        },
    },
    Run = function(self,CommandContext,Players)
        for _,Player in pairs(Players) do
            local PlayerQuests = QuestService.PlayerQuests[Player]
            local SelectedQuestName = PlayerQuests.QuestData.SelectedQuest
            if SelectedQuestName then
                local SelectedQuest = QuestData[SelectedQuestName]
                if SelectedQuest then
                    if SelectedQuest.QuestType == "Items" then
                        --Give the remaining items for the quest.
                        local RequiredItems = SelectedQuest.RequiredItems[1]
                        for i = 1,RequiredItems.Amount do
                            InventoryService:AddItem(Player,RequiredItems.Name)
                        end
                    elseif SelectedQuest.QuestType == "Dressup" then
                        --Set the pet item slots to the pet costume.
                        local RequiredSet = SelectedQuest.RequiredSet.Name
                        local PlayerInventory = InventoryService:GetInventory(Player)
                        for ItemName,Data in pairs(ItemData) do
                            if Data.CostumeName == RequiredSet then
                                PlayerInventory.Inventory[Data.ItemType] = {Name=ItemName}
                            end
                        end
                        PlayerInventory:Save()
                    elseif SelectedQuest.QuestType == "Monsters" then
                        --Add monster kills for the quest.
                        local RequiredMonsters = SelectedQuest.RequiredMonsters[1]
                        for i = 1,RequiredMonsters.Amount do
                            PlayerQuests:RegisterMonsterKill(RequiredMonsters.Name)
                        end
                    elseif SelectedQuest.QuestType == "NPC" then
                        --Teleport the player to the NPC.
                        local RequiredNPC = SelectedQuest.RequiredNPC.Name
                        local Location = NPCLocations[RequiredNPC]
                        local TargetCFrame = CFrame.new(Location.CellX * 100,4,Location.CellY * 100) * Location.OffsetCFrame * CFrame.new(0,0,-3) * CFrame.Angles(0,math.pi,0)
                        local Character = Player.Character
                        if Character then
                            local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
                            if HumanoidRootPart then
                                HumanoidRootPart.CFrame = TargetCFrame
                            end
                        end
                    end
                end
            end 
        end
    end
}