找回密码
 注册
搜索
楼主: xyxs@tj

sz蝶梦楼和血钻兑换

[复制链接]
门派:明教
发表于 2021-3-9 15:50:42 | 显示全部楼层
xyxs@tj 发表于 2021-3-9 15:45
恩,这个我知道的
大家自己改一下吧
path_consider()函数

是room.lua,这里——

  1. function SjMap:getPath(from, to, try)
  2.         --TraceOut("SjMap:getPath: from = " .. from .. " ,to = " .. to)
  3.         local parents,distances = self:lookPath(from)
  4.         local length = distances[to]
  5.         local path = {""}
  6.         local room = to
  7.         repeat
  8.                 local parentInfo = parents[room]
  9.                 local fromRoom = map.rooms[from]
  10.                 local toRoom = map.rooms[to]
  11.                 if parentInfo == nil then
  12.                         if not try then
  13.                                 --Note("从:" .. fromRoom .. " 至:" .. toRoom .. ",无法到达。")
  14.                         end
  15.                         return false
  16.                 end
  17.                 local parent = parentInfo.parent
  18.                 local route = parentInfo.route
  19.                 local parentRoom = map.rooms[parent]
  20.                 local precmds = parentRoom.precmds
  21.                 local precmd = precmds and precmds[route]
  22.                 local postcmds = parentRoom.postcmds
  23.                 local postcmd = postcmds and postcmds[route]
  24.                 local blocks = parentRoom.blocks
  25.                 local block = blocks and blocks[route]
  26.                 local lengths = parentRoom.lengths
  27.                 local len = lengths and lengths[route]
  28.                 if postcmd then
  29.                         table.insert(path,1,";")
  30.                         table.insert(path,1,postcmd)
  31.                 end
  32.                 table.insert(path,1,";")
  33.                 table.insert(path,1,route)
  34.                 if precmd then
  35.                         table.insert(path,1,";")
  36.                         table.insert(path,1,precmd)
  37.                 end
  38.                 if block then
  39.                         for _, b in pairs(block) do
  40.                                 local sameParty = b.party and b.party == score.party
  41.                                 local cond = b.cond and b.cond()
  42.                                 if not sameParty and not cond then
  43.                                         if hp.exp < b.exp then
  44.                                                 return false
  45.                                         else
  46.                                                 table.insert(path,1,";")
  47.                                                 table.insert(path,1,"#wipe " .. b.id)
  48.                                         end
  49.                                 end
  50.                         end
  51.                 end
  52.                 if len then
  53.                    local isStr = len and type(len) == "string" or false
  54.                    if isStr then
  55.                       if not loadstring(len)() then return false end
  56.                    end
  57.                 end
  58.                 room = parent
  59.         until room == from
  60.         table.insert(path,1,";")
  61.         table.insert(path,1,"halt")
  62.         local p = table.concat(path)
  63.         --print("length="..length)
  64.         return p, length
  65. end
复制代码


table.insert(path,1,"halt")
门派:华山派
 楼主| 发表于 2021-3-9 16:15:48 | 显示全部楼层
kkfromch@tj 发表于 2021-3-9 15:50
是room.lua,这里——

我这个函数已经不是这样了,所以大家还是按自己的代码改。
门派:明教
发表于 2021-3-9 19:18:46 | 显示全部楼层
xyxs@tj 发表于 2021-3-9 16:15
我这个函数已经不是这样了,所以大家还是按自己的代码改。

对啊!得说明一下,公版的小白抄过去肯定要出问题的。
门派:桃花岛
发表于 2021-3-9 22:18:00 | 显示全部楼层
这可如何是好,虽然我不换血钻。
门派:桃花岛
发表于 2021-3-9 22:21:37 | 显示全部楼层
大神们一出手,就是造福玩家的代码。
门派:明教
发表于 2021-3-15 18:17:09 来自手机 | 显示全部楼层
学习学习,我是直接用dhsome
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|书剑永恒MUD ( 闽ICP备14012032号|闽公网安备 35050202000162号 )

GMT+8, 2025-6-4 20:51 , Processed in 0.049662 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表