Jump to content

I can't add to ticket for Orc Maze


Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Premium

Here are some functions that can help you out. I have some global variables for dungeon types so you might wanna adapt that to your own needs.

		function CheckMembersItem()
			if (is_test_server()) then
				syschat("Skipping group item check due to debugging mode being enabled.")
				return true
			end
			
			local not_allowed_users = {}
			local pids = {party.get_member_pids()}
			
			local item_vnum = ITEM_VNUM_HERE
			
			for i = 1, table.getn(pids) do
				q.begin_other_pc_block(pids[i])
				if (pc.count_item(item_vnum) < 1) then --and not pc.is_gm() then
					table.insert(not_allowed_users, pc.get_name())
				end
				q.end_other_pc_block()
			end

			if table.getn(not_allowed_users) == 0 then
				return true
			end

			if table.getn(not_allowed_users) > 0 then
				say_npc()
				say("The following players do not meet the item")
				say("requirements.")
				say("")
				say("")
				say_item_vnum(item_vnum)
				say("")
				say("")
				for x = 1, table.getn(not_allowed_users), 1 do
					say(color(1,1,0), "    " .. not_allowed_users[x])
				end
				return false
			end
			
			-- Should never happen
			return false
		end
		
		function remove_entrance_item(dungeon_type)
			local item_vnum = ITEM_VNUM_HERE
			
			if dungeon_type != DUNGEON_TYPE_SOLO then
				local pids = {party.get_member_pids()}
				
				for i = 1, table.getn(pids) do
					q.begin_other_pc_block(pids[i])
					if not pc.is_gm() then
						pc.remove_item(item_vnum, 1)
					end
					q.end_other_pc_block()
				end
			else
				pc.remove_item(item_vnum, 1)
			end
		end

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.