print("寻找火山雪山\n星空露珠工作室制作")
local blockbing=120 --冰山
local blockhuo=124 -- 火山
local bing={}
local huo={}
local m,n=0,0
local ra=0
local run=0
local function o(e)
if run==-1 then return end
run=-1
local objid=e.eventobjid--点击方块的玩家
local moveType=1--移动方式:1飞行 2默认
--设置玩家的移动方式为飞行
Player:changPlayerMoveType(objid, moveType)
local y=127
---9987.-7939
--9987.-6915
for i=-10,10 do
for j=-10,10 do
local x,z=1000*i+25,1000*j
Player:setPosition(objid,x,y,z)
local result,areaid=Area:createAreaRect({x=x,y=y,z=z},{x=60,y=80,z=60})
threadpool:wait(0.3)
local result=Area:blockInArea(areaid,blockbing)
local result0=Area:blockInArea(areaid,blockhuo)
if result==0 then threadpool:wait(5) table.insert(bing,{x=x,y=y,z=z}) m=m+1 end
if result0==0 then threadpool:wait(5) table.insert(huo,{x=x,y=y,z=z}) n=n+1 end
end
end
print(m,n)
print(bing)
print(huo)
Player:teleportHome(objid)
Player:changPlayerMoveType(objid,2)
if m>0 then Chat:sendSystemMsg("冰山个数:"..tostring(m))
for k,v in pairs(bing) do
print(v)
Chat:sendSystemMsg("第"..tostring(k).."个冰山坐标x,z:"..tostring(v.x)..","..tostring(v.z))
end
else Chat:sendSystemMsg("冰山个数:0")
end
if n>0 then Chat:sendSystemMsg("火山个数:"..tostring(n))
for k,v in pairs(huo) do
print(v)
Chat:sendSystemMsg("第"..tostring(k).."个火山坐标x,z:"..tostring(v.x)..","..tostring(v.z))
end
else Chat:sendSystemMsg("火山个数:0")
end
Chat:sendSystemMsg('点击快捷键道具即可传送')
end
ScriptSupportEvent:registerEvent("Player.UseItem",o)
local function p(e)
ra=ra+1
local objid=e.eventobjid--点击方块的玩家
local moveType=1--移动方式:1飞行 2默认
--设置玩家的移动方式为飞行
Player:changPlayerMoveType(objid, moveType)
if ra<m then
Player:setPosition(objid,bing[ra].x,120,bing[ra].z)
Chat:sendSystemMsg("雪山编号:"..tostring(ra))
else
if ra>m+n then ra=0 Chat:sendSystemMsg("已经溜达了一遍")
else Player:setPosition(objid,huo[ra-m].x,120,huo[ra-n].z)
Chat:sendSystemMsg("火山编号:"..tostring(ra-m))
end
end
threadpool:wait(60)
Player:changPlayerMoveType(objid,2)
end
ScriptSupportEvent:registerEvent("Player.SelectShortcut",p)