Jump to content

[Need]Block Shop Quest


Recommended Posts

 

Fuck code, but need to work.

--[[
############################
# Author: VegaS        	   #
# Date: 28/07/2016 | 05:18 #
# Quest: Shop              #
############################
]]

quest shop begin 
	state start begin 
	function pTable(self, pArg)
		for x = 1, table.getn(self) do
			if self[x] == pArg then
				return true	end	end	return false
	end
	function pError(arg1, arg2)
		if arg1 == "err_acces" then	
			syschat(string.format("<Shop> You're in the Kingdom [%s] you can not create a shop in own kingdom.", arg2))
		if arg1 == "err_riding" then
			syschat("<Shop> You can not open a shop while riding!")
		if arg1 == "err_polymorph" then
			syschat("<Shop> You can not open a shop while being transformed!")
			end
		end
	end
end
		when 50200.use begin 
			local pEmpire = {1, 2, 3}	local pMaps_1 = {1, 3}	
                                                        local pMaps_2 = {21, 23}	
                                                        local pMaps_3 = {41, 43}	
	
			if pc.get_empire() == 1 and shop.pTable(pMaps_1, pc.get_map_index()) then	
				shop.pError("err_acces", "Shinsoo")	return
			
			elseif pc.get_empire() == 2 and shop.pTable(pMaps_2, pc.get_map_index()) then	
				shop.pError("err_acces", "Chunjo")	return
			
			elseif pc.get_empire() == 3 and shop.pTable(pMaps_3, pc.get_map_index()) then	
				shop.pError("err_acces", "Jinno")	return
			
			elseif pc.is_mount() or pc.is_riding()	then	
				shop.pError("err_riding")	return
				
			elseif pc.is_polymorphed()	then	
				shop.pError("err_polymorph")	return
				
			elseif pc.count_item(item.get_vnum()) >= 1 then
				pc.remove_item(item.get_vnum(), 1)
				cmdchat("OpenPrivateShop") 
			end
		end 
	end 
end  

 

[File: src/Server/game/src/game/char.cpp]

//Delete this:

	else if (CountSpecifyItem(50200))
		RemoveSpecifyItem(50200, 1);
	else
		return;

 

Go in navicat in player.item_proto and search vnum 50200 and change Type = 18 and SubType = 0.

  • Love 2
Link to comment
Share on other sites

  • 1 month later...
  • Active Member
On 28.07.2016 at 3:51 PM, VegaS said:

 

Fuck code, but need to work.


--[[
############################
# Author: VegaS        	   #
# Date: 28/07/2016 | 05:18 #
# Quest: Shop              #
############################
]]

quest shop begin 
	state start begin 
	function pTable(self, pArg)
		for x = 1, table.getn(self) do
			if self[x] == pArg then
				return true	end	end	return false
	end
	function pError(arg1, arg2)
		if arg1 == "err_acces" then	
			syschat(string.format("<Shop> You're in the Kingdom [%s] you can not create a shop in own kingdom.", arg2))
		if arg1 == "err_riding" then
			syschat("<Shop> You can not open a shop while riding!")
		if arg1 == "err_polymorph" then
			syschat("<Shop> You can not open a shop while being transformed!")
			end
		end
	end
end
		when 50200.use begin 
			local pEmpire = {1, 2, 3}	local pMaps_1 = {1, 3}	
                                                        local pMaps_2 = {21, 23}	
                                                        local pMaps_3 = {41, 43}	
	
			if pc.get_empire() == 1 and shop.pTable(pMaps_1, pc.get_map_index()) then	
				shop.pError("err_acces", "Shinsoo")	return
			
			elseif pc.get_empire() == 2 and shop.pTable(pMaps_2, pc.get_map_index()) then	
				shop.pError("err_acces", "Chunjo")	return
			
			elseif pc.get_empire() == 3 and shop.pTable(pMaps_3, pc.get_map_index()) then	
				shop.pError("err_acces", "Jinno")	return
			
			elseif pc.is_mount() or pc.is_riding()	then	
				shop.pError("err_riding")	return
				
			elseif pc.is_polymorphed()	then	
				shop.pError("err_polymorph")	return
				
			elseif pc.count_item(item.get_vnum()) >= 1 then
				pc.remove_item(item.get_vnum(), 1)
				cmdchat("OpenPrivateShop") 
			end
		end 
	end 
end  

 

[File: src/Server/game/src/game/char.cpp]

//Delete this:


	else if (CountSpecifyItem(50200))
		RemoveSpecifyItem(50200, 1);
	else
		return;

 

Go in navicat in player.item_proto and search vnum 50200 and change Type = 18 and SubType = 0.

@Veagas

I like your coding style, very like!

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.