sm

立即登录 | 账号注册

积分: 0 |用户组: 游客

搜索
服务器租用 传奇3一条龙 支付平台源码 无法下载点击此处反馈
查看: 1390|回复: 10

[战神引擎] 战神引擎Mir2明文全套lua源文件

[复制链接]

826

主题

36

回帖

23万

积分

霸王教主

积分
234697
发表于 2023-2-26 09:17:41 | 显示全部楼层 |阅读模式
  1. local bigmap = {
  2.     maps = {},
  3.     group = {},
  4.     scriptPath = {}
  5. }

  6. function bigmap:loadLike(map)
  7.     self.maps[map] = self.maps[map] or {}
  8.     local mapCache = cache.getBigmap(map)
  9.     local likes = {}

  10.     if mapCache and mapCache.likes then
  11.         likes = mapCache.likes
  12.     end

  13.     if not self.maps[map].likes then
  14.         self.maps[map].likes = likes
  15.     end
  16. end

  17. function bigmap:isExistLike(map, x, y)
  18.     if not map or map == "" then
  19.         return
  20.     end

  21.     self:loadLike(map)

  22.     for i, v in ipairs(self.maps[map].likes) do
  23.         if v.x == x and v.y == y then
  24.             return true
  25.         end
  26.     end
  27. end

  28. function bigmap:addLike(map, name, x, y)
  29.     if not map or map == "" then
  30.         return
  31.     end

  32.     self:loadLike(map)

  33.     for i, v in ipairs(self.maps[map].likes) do
  34.         if v.x == x and v.y == y then
  35.             return
  36.         end
  37.     end

  38.     self.maps[map].likes[#self.maps[map].likes + 1] = {
  39.         name = name,
  40.         x = x,
  41.         y = y
  42.     }

  43.     cache.saveBigmap(map)
  44. end

  45. function bigmap:removeLike(map, x, y)
  46.     if not map or map == "" then
  47.         return
  48.     end

  49.     self:loadLike(map)

  50.     for i, v in ipairs(self.maps[map].likes) do
  51.         if v.x == x and v.y == y then
  52.             table.remove(self.maps[map].likes, i)
  53.             self:removeLike(map, x, y)
  54.             cache.saveBigmap(map)
  55.         end
  56.     end
  57. end

  58. function bigmap:getLikes(map)
  59.     self:loadLike(map)

  60.     return self.maps[map].likes
  61. end

  62. function bigmap:loadNpcs(map)
  63.     self.maps[map] = self.maps[map] or cache.getBigmap(map) or {}
  64.     self.maps[map].npcs = self.maps[map].npcs or {}
  65. end

  66. function bigmap:addNpcs(msg, buf, bufLen)
  67.     local title = g_data.client.npcMap.title
  68.     self.maps[title] = self.maps[title] or {}
  69.     self.maps[title].npcs = {}
  70.     local npc = nil

  71.     for i = 1, msg.tag do
  72.         npc, buf, bufLen = net.record("TNpcDesc", buf, bufLen)
  73.         npc.destMapid = g_data.client.npcMap.id
  74.         self.maps[title].npcs<i> = npc
  75.     end
  76. end

  77. function bigmap:getNpcs(map)
  78.     if not self.maps[map] then
  79.         return nil
  80.     else
  81.         return self.maps[map].npcs
  82.     end
  83. end

  84. function bigmap:getGroupInfo(msg, buf, bufLen)
  85.     self.group = {}
  86.     local mem = nil

  87.     for i = 1, msg.param do
  88.         mem, buf, bufLen = net.record("TGroupMemPosition", buf, bufLen)
  89.         self.group[#self.group + 1] = mem
  90.     end
  91. end

  92. function bigmap:scriptAutoPath(msg, buf, bufLen)
  93.     self.scriptPath = {}
  94.     local tmp = nil

  95.     for i = 1, msg.recog do
  96.         tmp, buf, bufLen = net.record("TMapPathNode", buf, bufLen)
  97.         self.scriptPath[#self.scriptPath + 1] = tmp
  98.     end
  99. end

  100. function bigmap:getScriptPath(mapid)
  101.     if #self.scriptPath > 0 then
  102.         local tmp = nil

  103.         for i, v in ipairs(self.scriptPath) do
  104.             if v.name == mapid then
  105.                 return v
  106.             end
  107.         end
  108.     end
  109. end

  110. return bigmap</i>
复制代码
战神引擎.png
游客,如果您要查看本帖隐藏内容请回复





上一篇:战神引擎初级打宝脚本
下一篇:传奇大乱斗脚本,战神引擎大乱斗PK脚本
回复

使用道具 举报

0

主题

7

回帖

216

积分

旋风流星刀

积分
216
发表于 2023-8-28 20:00:19 | 显示全部楼层
:(下载来看看ADS
回复 支持 反对

使用道具 举报

1

主题

412

回帖

535

积分

旋风流星刀

积分
535
发表于 2023-8-29 06:25:41 | 显示全部楼层
感谢分享
回复

使用道具 举报

1

主题

412

回帖

535

积分

旋风流星刀

积分
535
发表于 2023-8-30 07:51:36 | 显示全部楼层
支持楼主
回复

使用道具 举报

1

主题

412

回帖

535

积分

旋风流星刀

积分
535
发表于 2023-9-22 08:07:37 | 显示全部楼层
感谢楼主分享
回复 支持 反对

使用道具 举报

0

主题

4

回帖

187

积分

旋风流星刀

积分
187
发表于 2023-10-12 16:29:06 | 显示全部楼层
23421423大大撒地方 懂法守法多少度
回复 支持 反对

使用道具 举报

0

主题

3

回帖

199

积分

旋风流星刀

积分
199
发表于 2023-11-2 14:20:43 | 显示全部楼层
支持楼主
回复

使用道具 举报

0

主题

9

回帖

292

积分

旋风流星刀

积分
292
发表于 2023-11-5 23:09:57 | 显示全部楼层
66666666666666666666666
回复 支持 反对

使用道具 举报

1

主题

252

回帖

1070

积分

旋风流星刀

积分
1070
QQ
发表于 2023-12-4 09:43:41 | 显示全部楼层
积分任务
回复

使用道具 举报

0

主题

7

回帖

81

积分

旋风流星刀

积分
81
发表于 2024-1-11 13:30:33 | 显示全部楼层
感谢分享
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|美林GM论坛 ( 蜀ICP备2020030293号-2 )|网站地图

禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.如遇版权问题,请及时QQ联系

GMT+8, 2024-4-20 19:32 , Processed in 0.344926 second(s), 99 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024, Tencent Cloud.

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