
打印信息("洛阳抢打造图脚本,请准备足够的金币和足够的材料栏空格")
打印信息("默认只买9、10级打造图，如需更改请用记事本修改脚本文件/洛阳打造图.lua文件")

local olditemID = -1
local itemID = -1

--脚本修改后请另存到电脑其它位置备份,下次版本更新时复制回本目录覆盖即可

--下边是默认抢购的打造图名称,如需增加其它打造图,照以下格式复制添加即可 比如增加 {name = "护符打造图6级"},  将此句插入以下列表中任意位置即可(看表头部示例)
g_ItemInfo = {
	--{name = "护符打造图6级"},
	
	--注意添加时不要掉了结尾的 ","符号
	--两个减号"--"开头,表示将这行注释掉,也就是此行不起作用
	

	-- {name = "帽子打造图6级"},
	-- {name = "帽子打造图7级"},
	-- {name = "帽子打造图8级"},
	{name = "帽子打造图9级"},
	{name = "帽子打造图10级"},
	
	-- {name = "衣服打造图6级"},
	-- {name = "衣服打造图7级"},
	-- {name = "衣服打造图8级"},
	{name = "衣服打造图9级"},
	{name = "衣服打造图10级"},
	
	-- {name = "手套打造图6级"},
	-- {name = "手套打造图7级"},
	-- {name = "手套打造图8级"},
	{name = "手套打造图9级"},
	{name = "手套打造图10级"},	
	
	-- {name = "鞋子打造图6级"},
	-- {name = "鞋子打造图7级"},
	-- {name = "鞋子打造图8级"},
	{name = "鞋子打造图9级"},
	{name = "鞋子打造图10级"},
	
	
	-- {name = "项链打造图6级"},
	-- {name = "项链打造图7级"},
	-- {name = "项链打造图8级"},
	{name = "项链打造图9级"},
	{name = "项链打造图10级"},
	
	-- {name = "戒指打造图6级"},
	-- {name = "戒指打造图7级"},
	-- {name = "戒指打造图8级"},
	{name = "戒指打造图9级"},
	{name = "戒指打造图10级"},
	
	-- {name = "护符打造图6级"},
	-- {name = "护符打造图7级"},
	-- {name = "护符打造图8级"},
	{name = "护符打造图9级"},
	{name = "护符打造图10级"},
	
	-- {name = "护腕打造图6级"},
	-- {name = "护腕打造图7级"},
	-- {name = "护腕打造图8级"},
	{name = "护腕打造图9级"},
	{name = "护腕打造图10级"},
	
	-- {name = "护肩打造图6级"},
	-- {name = "护肩打造图7级"},
	-- {name = "护肩打造图8级"},
	{name = "护肩打造图9级"},
	{name = "护肩打造图10级"},
	
	-- {name = "腰带打造图6级"},
	-- {name = "腰带打造图7级"},
	-- {name = "腰带打造图8级"},
	{name = "腰带打造图9级"},
	{name = "腰带打造图10级"},
	
}

g_NpcPos = {
	{x = 169, z = 236, scene = 0},
	{x = 204, z = 289, scene = 0},
	{x = 333, z = 269, scene = 0}
}

g_nIndex = 1

function RobCreateMap()
	if 取地图名() ~= "洛阳" or 取距离(169, 236) > 20 then
		召唤坐骑(1)	
	end
	ID_寻路(169, 236, 0)
	--ID_寻路(333,269,0)
	while true do
		if g_nIndex > 3 then
			g_nIndex = 1
		end
		local _,_,g_NpcId = 搜索目标("赛鲁班",1)
		while g_NpcId ~= -1 do
			if 取角色门派() == 7 then
				使用技能("金蝉脱壳",-1)
				延迟(1000)
			end

			local spaceNum = GetBackpackNull(2)
			if spaceNum == 0 then 
				打印信息("抢打造图：背包满!!")
				return
			end
			_,_,g_NpcId = 搜索目标("赛鲁班",1)
			--打印信息("g_NpcId = "..g_NpcId)
			if g_NpcId ~= -1 then
				ID_对话npc(g_NpcId)
			end
			local c = 0
			local nCallNum = GetBoothList_Num()--获取商店所有物品种类
			--打印信息("商店共存在"..nCallNum.."种物品!!!")
			while c < nCallNum do
				local nIndex, strName, nPrice, site = GetShopData(c) --获取商店数据
				if GetRoleMoney() < nPrice then 打印信息("抢打造图：人物金钱不足!!") return end
				if nIndex > 0 then
					for i = 1, 100 do
						if g_ItemInfo[i] == nil then
							break
						else
							if g_ItemInfo[i].name == strName then
								购买物品EX(g_NpcId,site,1)
								break
							end
						end
					end
				end
				c = c + 1
			end
			延迟(50)
		end
		if g_NpcId == -1 then
			ID_寻路(g_NpcPos[g_nIndex].x, g_NpcPos[g_nIndex].z, g_NpcPos[g_nIndex].scene)
			g_nIndex = g_nIndex + 1
		end
	end
end

RobCreateMap()