找回密码
 注册/Sign up
搜索
楼主: ahsin

改进版佣兵

[复制链接]

发表于 2021-12-27 03:29:42 来自手机 | 显示全部楼层
跃动幽助 发表于 2021-12-27 03:23
可以了  但是楼上的 ,佣兵依然没有带宠物啊

因为你的data里没有佣兵的宠物id.要更改下,还有宠物技能也要添加

发表于 2021-12-27 03:49:31 | 显示全部楼层
用了楼主大佬的全套LUA,已经成功体验了佣兵,非常不错。

能召唤佣兵,并且能完成自动战斗,已经具备了佣兵系统的核心功能了,相信有各位大佬的努力,佣兵系统会越来越完善

看到了zaza32167大佬 完善了佣兵的武器防具问题和宠物问题,等有时间体验一下

奈何自己什么都不懂  也帮不上什么忙   只会通过大神的LUA  修改一下简单的参数 或者照葫芦画瓢加点东西

我现在最想解决的问题就是   找到纯净的LUA新框架   按照自己需要 加入自己已经修改好的LUA模块   和佣兵系统

自己的技术太菜了   对LUA太陌生了    稍不留神就会崩端

除了用大神的全套LUA    自己想单独加佣兵就会崩端

我看了几天帖子  现在新框架有 0.1.16   0.1.17  最新版0.1.22   我都不清楚该用哪个   甚至不知道这些是不是能拿来直接用的 或是需要修改

我发现魔法师佣兵的伤害很低  打不到100  应该是没有装备杖导致没魔攻的问题吧

我是不是需要为佣兵定制一把魔攻320的杖  等级为1级   这样无论多少等级的角色  召唤的魔法师佣兵都能有满魔攻   因为佣兵无法切换武

器  所以感觉只有这样设置  才能满足1到10级魔法都是最大伤害

另一种方法就是给法师佣兵添加   自定义编号的魔法技能  不受魔攻限制   这样也就不用杖了    我测试过   魔攻只对原版skill编号的魔法技

能有加成   对自制编号的魔法没有加成    应该是被GMSV写死了   所以自制SKILL  提高魔法AR  达到和正常带杖的法师一样伤害就可以了

发表于 2021-12-27 04:06:02 | 显示全部楼层
zaza32167 发表于 2021-12-27 02:20
根据大佬的yb.lua ,进一步更新了一些内容!
主要几点:
1.佣兵防御过低,初始佣兵增加少量防御BP

大神太有心了,还给佣兵加入了火把和实验药。
刚才还在想怎么才能带着佣兵去打树精长老   实在没招还要改掉火把限制
大神真是雪中送炭
发表于 2021-12-27 08:37:18 | 显示全部楼层
lisongdwzdn 发表于 2021-12-27 03:49
用了楼主大佬的全套LUA,已经成功体验了佣兵,非常不错。

能召唤佣兵,并且能完成自动战斗,已经具备了佣 ...

尽量最新,老版本大半会有bug

发表于 2021-12-27 11:43:17 | 显示全部楼层
lisongdwzdn 发表于 2021-12-27 03:49
用了楼主大佬的全套LUA,已经成功体验了佣兵,非常不错。

能召唤佣兵,并且能完成自动战斗,已经具备了佣 ...

使用大佬的最新框架,直接加载yb.lua即可
佣兵目前默认只能装备2100编号的国民弓,无法装备其他武器,防具还没测试,估计也一样
魔法师佣兵会出现超魔法只打一个的情况,你可以测试一下
------------------
魔法伤害问题,可以直接调用大佬的伤害框架给魔法加成

 楼主| 发表于 2021-12-28 18:10:44 | 显示全部楼层
本帖最后由 ahsin 于 2021-12-28 18:11 编辑

饿,是这样。
1、佣兵带宠会浪费很多战斗时间,所以我也没启用宠物,鲸鱼兄弟的佣兵版本有带宠的。
2、关于佣兵,其实并不用考虑太多复杂的细节,毕竟佣兵无需和人完全一样。如果觉得佣兵弱了给他bp再加点即可,装备不改也一样的。新版代码中,佣兵的bp根据人的150%~190%来了。
3、然后我最近还更新了一个小细节,比如佣兵能力低于40以下的按照40级的能力来,主要服里(我这里目标为超超超超超超变态)新人觉得佣兵太弱打不过gbl。



  1. ---模块类
  2. local ybModule = ModuleBase:createModule('yb')
  3. local allyb = 0
  4. -- 普通玩家命令
  5. --local commandsNormal = {}
  6. wanjia = {}--玩家表
  7. for bbb = 0,800 do
  8.         wanjia[bbb] = {}
  9.         wanjia[bbb][0] = 0--ai统计
  10.         wanjia[bbb][1] = -1
  11.         wanjia[bbb][2] = -1
  12.         wanjia[bbb][3] = -1
  13.         wanjia[bbb][4] = -1
  14.         wanjia[bbb][5] = -1
  15.         wanjia[bbb][6] = -1
  16. end
  17. Delegate.RegDelTalkEvent("yb_TalkEvent");--说话触发
  18. Delegate.RegDelAllOutEvent("yboffline");--玩家下线触发
  19. Delegate.RegDelAfterWarpEvent("ybwarp");--玩家传送触发
  20. function ybwarp(player,map,floor,x,y,aftermap,afterfloor,afterx,aftery)--传送后若ai掉队则加回队伍来
  21.         print("player NO: "..player.."")
  22.         if Char.PartyNum(wanjia[player][1]) == -1 then
  23.                 Char.Warp(wanjia[player][1],aftermap,afterfloor,afterx,aftery)
  24.                 Char.JoinParty(wanjia[player][1],player);
  25.         end
  26.         if Char.PartyNum(wanjia[player][2]) == -1 then
  27.                 Char.Warp(wanjia[player][2],aftermap,afterfloor,afterx,aftery)
  28.                 Char.JoinParty(wanjia[player][2],player);
  29.         end
  30.         if Char.PartyNum(wanjia[player][3]) == -1 then
  31.                 Char.Warp(wanjia[player][3],aftermap,afterfloor,afterx,aftery)
  32.                 Char.JoinParty(wanjia[player][3],player);
  33.         end
  34.         if Char.PartyNum(wanjia[player][4]) == -1 then
  35.                 Char.Warp(wanjia[player][4],aftermap,afterfloor,afterx,aftery)
  36.                 Char.JoinParty(wanjia[player][4],player);
  37.         end
  38.         if Char.PartyNum(wanjia[player][5]) == -1 then
  39.                 Char.Warp(wanjia[player][5],aftermap,afterfloor,afterx,aftery)
  40.                 Char.JoinParty(wanjia[player][5],player);
  41.         end
  42.         if Char.PartyNum(wanjia[player][6]) == -1 then
  43.                 Char.Warp(wanjia[player][6],aftermap,afterfloor,afterx,aftery)
  44.                 Char.JoinParty(wanjia[player][6],player);
  45.         end
  46. end
  47. function yboffline(player)--玩家下线清空自己召唤的ai
  48. if wanjia[player][1] > 0 then
  49.         Char.DelDummy(wanjia[player][1])
  50.         wanjia[player][0] = 0
  51. end
  52. if wanjia[player][2] > 0 then
  53.         Char.DelDummy(wanjia[player][2])
  54.         wanjia[player][0] = 0
  55. end
  56. if wanjia[player][3] > 0 then
  57.         Char.DelDummy(wanjia[player][3])
  58.         wanjia[player][0] = 0
  59. end
  60. if wanjia[player][4] > 0 then
  61.         Char.DelDummy(wanjia[player][4])
  62.         wanjia[player][0] = 0
  63. end
  64. if wanjia[player][5] > 0 then
  65.         Char.DelDummy(wanjia[player][5])
  66.         wanjia[player][0] = 0
  67. end
  68. if wanjia[player][6] > 0 then
  69.         Char.DelDummy(wanjia[player][6])
  70.         wanjia[player][0] = 0
  71. end
  72. wanjia[player][0] = 0
  73. end
  74. --function commandsNormal.yb01(player, args)
  75. function yb_TalkEvent(player,msg,color,range,size)
  76. suiji = math.random(130,190)--生成130~190的随机数--然后ai参考裸体人物bp的130%~190%生成浮动bp
  77. if Char.GetData(player,%对象_等级%) < 40 then--如果玩家等级小于40,ai等级为40
  78. rlv = 40
  79. else
  80. rlv = Char.GetData(player,%对象_等级%)
  81. end
  82. --rlv = rlv /100 * suiji
  83. rx = Char.GetData(player,%对象_体力%)
  84. rx = rx / 100 * suiji
  85. if Char.GetData(player,%对象_魔法%) < 100000 then--如果玩家魔法bp小于1000,ai魔法bp为1000
  86. rm = 100000
  87. else--否则130%~190%生成浮动bp
  88. rm = Char.GetData(player,%对象_魔法%)
  89. rm = rm / 100 * suiji
  90. end
  91. if Char.GetData(player,%对象_力量%) < 20000 then--如果玩家力量bp小于200,ai力量bp为200
  92. rg = 20000
  93. else--否则130%~190%生成浮动bp
  94. rg = Char.GetData(player,%对象_力量%)
  95. rg = rg / 100 * suiji
  96. end
  97. --print(rg)
  98. if Char.GetData(player,%对象_强度%) < 10000 then--如果玩家防御bp小于100,ai防御bp为100
  99. rf = 10000
  100. else--否则130%~190%生成浮动bp
  101. rf = Char.GetData(player,%对象_强度%)
  102. rf = rf / 100 * suiji
  103. end--否则130%~190%生成浮动bp
  104. if Char.GetData(player,%对象_速度%) < 10000 then--如果玩家速度bp小于100,ai速度bp为100
  105. rs = 10000
  106. else--否则130%~190%生成浮动bp
  107. rs = Char.GetData(player,%对象_速度%)
  108. rs = rs / 100 * suiji
  109. end
  110. --print(rm)
  111. if msg == "/aiback" or msg == "、aiback" then
  112.         wjmap = Char.GetData(player,%对象_MAP%)
  113.         wjfloor = Char.GetData(player,%对象_地图%)
  114.         wjx = Char.GetData(player,%对象_X%)
  115.         wjy = Char.GetData(player,%对象_Y%)
  116.         if Char.PartyNum(wanjia[player][1]) == -1 then
  117.                 Char.Warp(wanjia[player][1],wjmap,wjfloor,wjx,wjy)
  118.                 Char.JoinParty(wanjia[player][1],player);
  119.                 --print(Char.IsDummy(wanjia[player][1]))
  120.         end
  121.         if Char.PartyNum(wanjia[player][2]) == -1 then
  122.                 Char.Warp(wanjia[player][2],wjmap,wjfloor,wjx,wjy)
  123.                 Char.JoinParty(wanjia[player][2],player);
  124.         end
  125.         if Char.PartyNum(wanjia[player][3]) == -1 then
  126.                 Char.Warp(wanjia[player][3],wjmap,wjfloor,wjx,wjy)
  127.                 Char.JoinParty(wanjia[player][3],player);
  128.         end
  129.         if Char.PartyNum(wanjia[player][4]) == -1 then
  130.                 Char.Warp(wanjia[player][4],wjmap,wjfloor,wjx,wjy)
  131.                 Char.JoinParty(wanjia[player][4],player);
  132.         end
  133.         if Char.PartyNum(wanjia[player][5]) == -1 then
  134.                 Char.Warp(wanjia[player][5],wjmap,wjfloor,wjx,wjy)
  135.                 Char.JoinParty(wanjia[player][5],player);
  136.         end
  137.         if Char.PartyNum(wanjia[player][6]) == -1 then
  138.                 Char.Warp(wanjia[player][6],wjmap,wjfloor,wjx,wjy)
  139.                 Char.JoinParty(wanjia[player][6],player);
  140.         end
  141. end
  142. if msg == "/killai" or msg == "、killai" then--干掉ai的命令
  143. if wanjia[player][1] > 0 then
  144.         Char.DelDummy(wanjia[player][1])
  145.         wanjia[player][1] = -1
  146.         wanjia[player][0] = 0
  147. end
  148. if wanjia[player][2] > 0 then
  149.         Char.DelDummy(wanjia[player][2])
  150.         wanjia[player][2] = -1
  151.         wanjia[player][0] = 0
  152. end
  153. if wanjia[player][3] > 0 then
  154.         Char.DelDummy(wanjia[player][3])
  155.         wanjia[player][3] = -1
  156.         wanjia[player][0] = 0
  157. end
  158. if wanjia[player][4] > 0 then
  159.         Char.DelDummy(wanjia[player][4])
  160.         wanjia[player][4] = -1
  161.         wanjia[player][0] = 0
  162. end
  163. if wanjia[player][5] > 0 then
  164.         Char.DelDummy(wanjia[player][5])
  165.         wanjia[player][5] = -1
  166.         wanjia[player][0] = 0
  167. end
  168. if wanjia[player][6] > 0 then
  169.         Char.DelDummy(wanjia[player][6])
  170.         wanjia[player][6] = -1
  171.         wanjia[player][0] = 0
  172. end
  173. NLG.SystemMessage(player, '已开除所有佣兵。' )
  174. end
  175. if msg == "/aig" or msg == "、aig" then--召唤弓箭手佣兵
  176.         if wanjia[player][0] > 3 then
  177.         NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
  178.         elseif Char.GetData(player,%对象_战宠%) == -1 then
  179.         NLG.SystemMessage(player, '不带宠,无法召唤佣兵。' )
  180.         elseif allyb > 750 then
  181.         NLG.SystemMessage(player, '当前线路人口爆满,无法添加佣兵了。' )
  182.         else
  183.         if wanjia[player][1] <= 0 then
  184.         local charIndex1 = Char.CreateDummy()--生成ai佣兵
  185.         wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
  186.         allyb = charIndex1
  187.         print("编号:"..charIndex1.."")
  188.         wanjia[player][1] = charIndex1
  189.        
  190.         Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
  191.         Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
  192.         Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
  193.         Char.SetData(charIndex1, CONST.CHAR_名字, '恶魔猎手');
  194.         Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
  195.         Char.SetData(charIndex1, CONST.CHAR_形象, 100269);
  196.         Char.SetData(charIndex1, CONST.CHAR_原形, 105791);
  197.         Char.SetData(charIndex1, CONST.CHAR_原始图档, 100269);
  198.         print('charIndex1', charIndex1)
  199.         --print(player)
  200.         Char.SetData(charIndex1, CONST.CHAR_体力, rx);
  201.         Char.SetData(charIndex1, CONST.CHAR_力量, rg);
  202.         Char.SetData(charIndex1, CONST.CHAR_强度, rf);
  203.         Char.SetData(charIndex1, CONST.CHAR_速度, rs);
  204.         Char.SetData(charIndex1, CONST.CHAR_魔法, rm);
  205.         Char.SetData(charIndex1, CONST.CHAR_风属性, 100);
  206.         Char.SetData(charIndex1, CONST.CHAR_闪躲, 30);
  207.         Char.SetData(charIndex1, CONST.CHAR_魅力, 100);
  208.         Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
  209.         Char.SetData(charIndex1, CONST.CHAR_种族, 0);
  210.         NLG.UpChar(charIndex1);
  211.         Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
  212.         Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
  213.         Char.GiveItem(charIndex1, 2100, 1, false);
  214.         Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
  215.         Char.SetData(charIndex1, CONST.CHAR_职业, 44);
  216.         Char.SetData(charIndex1, CONST.CHAR_职类ID, 40);
  217.         Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
  218.         Char.AddSkill(charIndex1, 95);
  219.         --Char.GivePet(charIndex1, 3004);
  220.         --Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
  221.         --Char.SetData(charIndex1, CONST.CHAR_战宠, 0);
  222.         --local petIndex = Char.GetPet(charIndex1, 0);
  223.         --Char.SetData(petIndex, CONST.PET_DepartureBattleStatus, CONST.PET_STATE_战斗);
  224.         NLG.SystemMessage(player, '召唤佣兵: 弓箭手' )
  225.         Char.JoinParty(charIndex1, player);
  226.         else
  227.         NLG.SystemMessage(player, '只能召唤1位弓箭手。' )
  228.         end
  229.         end
  230. elseif msg == "/aij" or msg == "、aij" then
  231.         if wanjia[player][0] > 3 then
  232.         NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
  233.         elseif Char.GetData(player,%对象_战宠%) == -1 then
  234.         NLG.SystemMessage(player, '不带宠,无法召唤佣兵。' )
  235.         elseif allyb > 750 then
  236.         NLG.SystemMessage(player, '当前线路人口爆满,无法添加佣兵了。' )
  237.         else
  238.         if wanjia[player][2] <= 0 then
  239.         local charIndex1 = Char.CreateDummy()--生成ai佣兵
  240.         wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
  241.         allyb = charIndex1
  242.         print("编号:"..charIndex1.."")
  243.         wanjia[player][2] = charIndex1
  244. Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
  245. Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
  246. Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
  247. Char.SetData(charIndex1, CONST.CHAR_名字, '剑圣');
  248. Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
  249. Char.SetData(charIndex1, CONST.CHAR_形象, 100528);
  250. Char.SetData(charIndex1, CONST.CHAR_原形, 101127);
  251. Char.SetData(charIndex1, CONST.CHAR_原始图档, 100528);
  252. print('charIndex1', charIndex1)
  253. Char.SetData(charIndex1, CONST.CHAR_体力, rx);
  254. Char.SetData(charIndex1, CONST.CHAR_力量, rg);
  255. Char.SetData(charIndex1, CONST.CHAR_强度, rf);
  256. Char.SetData(charIndex1, CONST.CHAR_速度, rs);
  257. Char.SetData(charIndex1, CONST.CHAR_魔法, rm);
  258. Char.SetData(charIndex1, CONST.CHAR_地属性, 100);
  259. Char.SetData(charIndex1, CONST.CHAR_命中, 30);
  260. Char.SetData(charIndex1, CONST.CHAR_魅力, 100);
  261. Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
  262. Char.SetData(charIndex1, CONST.CHAR_种族, 0);
  263. NLG.UpChar(charIndex1);
  264. Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
  265. Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
  266. --Char.GiveItem(charIndex1, 900048, 1, false);
  267. --Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
  268. Char.SetData(charIndex1, CONST.CHAR_职业, 14);
  269. Char.SetData(charIndex1, CONST.CHAR_职类ID, 10);
  270. Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
  271. Char.AddSkill(charIndex1, 1006);
  272. --Char.GivePet(charIndex1, 3004);
  273. --Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
  274. --Char.SetData(charIndex1, CONST.CHAR_战宠, 0);
  275. --local petIndex = Char.GetPet(charIndex1, 0);
  276. --Char.SetData(petIndex, CONST.PET_DepartureBattleStatus, CONST.PET_STATE_战斗);
  277. NLG.SystemMessage(player, '召唤佣兵: 剑士' )
  278. Char.JoinParty(charIndex1, player);
  279. else
  280.         NLG.SystemMessage(player, '只能召唤1位剑士。' )
  281.         end
  282.         end
  283. elseif msg == "/aif" or msg == "、aif" then
  284.         if wanjia[player][0] > 3 then
  285.         NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
  286.         elseif Char.GetData(player,%对象_战宠%) == -1 then
  287.         NLG.SystemMessage(player, '不带宠,无法召唤佣兵。' )
  288.         elseif allyb > 750 then
  289.         NLG.SystemMessage(player, '当前线路人口爆满,无法添加佣兵了。' )
  290.         else
  291.         if wanjia[player][3] <= 0 then
  292.         local charIndex1 = Char.CreateDummy()--生成ai佣兵
  293.         wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
  294.         allyb = charIndex1
  295.         print("编号:"..charIndex1.."")
  296.         wanjia[player][3] = charIndex1
  297. Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
  298. Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
  299. Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
  300. Char.SetData(charIndex1, CONST.CHAR_名字, '法国榔头');
  301. Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
  302. Char.SetData(charIndex1, CONST.CHAR_形象, 100125);
  303. Char.SetData(charIndex1, CONST.CHAR_原形, 105997);
  304. Char.SetData(charIndex1, CONST.CHAR_原始图档, 100125);
  305. print('charIndex1', charIndex1)
  306. Char.SetData(charIndex1, CONST.CHAR_体力, rx);
  307. Char.SetData(charIndex1, CONST.CHAR_力量, rg);
  308. Char.SetData(charIndex1, CONST.CHAR_强度, rf);
  309. Char.SetData(charIndex1, CONST.CHAR_速度, rs);
  310. Char.SetData(charIndex1, CONST.CHAR_魔法, rm);
  311. Char.SetData(charIndex1, CONST.CHAR_火属性, 100);
  312. Char.SetData(charIndex1, CONST.CHAR_必杀, 30);
  313. Char.SetData(charIndex1, CONST.CHAR_魅力, 100);
  314. Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
  315. Char.SetData(charIndex1, CONST.CHAR_种族, 0);
  316. NLG.UpChar(charIndex1);
  317. Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
  318. Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
  319. --Char.GiveItem(charIndex1, 900049, 1, false);
  320. --Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
  321. Char.SetData(charIndex1, CONST.CHAR_职业, 24);
  322. Char.SetData(charIndex1, CONST.CHAR_职类ID, 20);
  323. Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
  324. Char.AddSkill(charIndex1, 3);
  325. --Char.GivePet(charIndex1, 3004);
  326. --Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
  327. --Char.SetData(charIndex1, CONST.CHAR_战宠, 0);
  328. --local petIndex = Char.GetPet(charIndex1, 0);
  329. --Char.SetData(petIndex, CONST.PET_DepartureBattleStatus, CONST.PET_STATE_战斗);
  330. NLG.SystemMessage(player, '召唤佣兵: 战斧' )
  331. Char.JoinParty(charIndex1, player);
  332. else
  333.         NLG.SystemMessage(player, '只能召唤1位战斧。' )
  334.         end
  335.         end
  336. elseif msg == "/aiq" or msg == "、aiq" then
  337.         if wanjia[player][0] > 3 then
  338.         NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
  339.         elseif Char.GetData(player,%对象_战宠%) == -1 then
  340.         NLG.SystemMessage(player, '不带宠,无法召唤佣兵。' )
  341.         elseif allyb > 750 then
  342.         NLG.SystemMessage(player, '当前线路人口爆满,无法添加佣兵了。' )
  343.         else
  344.         if wanjia[player][4] <= 0 then
  345.         local charIndex1 = Char.CreateDummy()--生成ai佣兵
  346.         wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
  347.         allyb = charIndex1
  348.         print("编号:"..charIndex1.."")
  349.         wanjia[player][4] = charIndex1
  350. Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
  351. Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
  352. Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
  353. Char.SetData(charIndex1, CONST.CHAR_名字, 'Archer');
  354. Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
  355. Char.SetData(charIndex1, CONST.CHAR_形象, 100073);
  356. Char.SetData(charIndex1, CONST.CHAR_原形, 101142);
  357. Char.SetData(charIndex1, CONST.CHAR_原始图档, 100073);
  358. print('charIndex1', charIndex1)
  359. Char.SetData(charIndex1, CONST.CHAR_体力, rx);
  360. Char.SetData(charIndex1, CONST.CHAR_力量, rg);
  361. Char.SetData(charIndex1, CONST.CHAR_强度, rf);
  362. Char.SetData(charIndex1, CONST.CHAR_速度, rs);
  363. Char.SetData(charIndex1, CONST.CHAR_魔法, rm);
  364. Char.SetData(charIndex1, CONST.CHAR_水属性, 100);
  365. Char.SetData(charIndex1, CONST.CHAR_反击, 30);
  366. Char.SetData(charIndex1, CONST.CHAR_魅力, 100);
  367. Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
  368. Char.SetData(charIndex1, CONST.CHAR_种族, 0);
  369. NLG.UpChar(charIndex1);
  370. Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
  371. Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
  372. --Char.GiveItem(charIndex1, 2100, 1, false);
  373. --Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
  374. Char.SetData(charIndex1, CONST.CHAR_职业, 34);
  375. Char.SetData(charIndex1, CONST.CHAR_职类ID, 30);
  376. Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
  377. Char.AddSkill(charIndex1, 1);
  378. --Char.GivePet(charIndex1, 3004);
  379. --Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
  380. --Char.SetData(charIndex1, CONST.CHAR_战宠, 0);
  381. --local petIndex = Char.GetPet(charIndex1, 0);
  382. --Char.SetData(petIndex, CONST.PET_DepartureBattleStatus, CONST.PET_STATE_战斗);
  383. NLG.SystemMessage(player, '召唤佣兵: 骑士' )
  384. Char.JoinParty(charIndex1, player);
  385. else
  386.         NLG.SystemMessage(player, '只能召唤1位骑士。' )
  387.         end
  388.         end
  389. elseif msg == "/aigd" or msg == "、aigd" then
  390.         if wanjia[player][0] > 3 then
  391.         NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
  392.         elseif Char.GetData(player,%对象_战宠%) == -1 then
  393.         NLG.SystemMessage(player, '不带宠,无法召唤佣兵。' )
  394.         elseif allyb > 750 then
  395.         NLG.SystemMessage(player, '当前线路人口爆满,无法添加佣兵了。' )
  396.         else
  397.         if wanjia[player][5] <= 0 then
  398.         local charIndex1 = Char.CreateDummy()--生成ai佣兵
  399.         wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
  400.         allyb = charIndex1
  401.         print("编号:"..charIndex1.."")
  402.         wanjia[player][5] = charIndex1
  403. Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
  404. Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
  405. Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
  406. Char.SetData(charIndex1, CONST.CHAR_名字, '加盐纯净水');
  407. Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
  408. Char.SetData(charIndex1, CONST.CHAR_形象, 100108);
  409. Char.SetData(charIndex1, CONST.CHAR_原形, 119500);
  410. Char.SetData(charIndex1, CONST.CHAR_原始图档, 100108);
  411. print('charIndex1', charIndex1)
  412. Char.SetData(charIndex1, CONST.CHAR_体力, rx);
  413. Char.SetData(charIndex1, CONST.CHAR_力量, rg);
  414. Char.SetData(charIndex1, CONST.CHAR_强度, rf);
  415. Char.SetData(charIndex1, CONST.CHAR_速度, rs);
  416. Char.SetData(charIndex1, CONST.CHAR_魔法, rm);
  417. Char.SetData(charIndex1, CONST.CHAR_地属性, 100);
  418. Char.SetData(charIndex1, CONST.CHAR_命中, 30);
  419. Char.SetData(charIndex1, CONST.CHAR_魅力, 100);
  420. Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
  421. Char.SetData(charIndex1, CONST.CHAR_种族, 0);
  422. NLG.UpChar(charIndex1);
  423. Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
  424. Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
  425. --Char.GiveItem(charIndex1, 2100, 1, false);
  426. --Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
  427. Char.SetData(charIndex1, CONST.CHAR_职业, 144);
  428. Char.SetData(charIndex1, CONST.CHAR_职类ID, 140);
  429. Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
  430. Char.AddSkill(charIndex1, 4);
  431. --Char.GivePet(charIndex1, 3004);
  432. --Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
  433. --Char.SetData(charIndex1, CONST.CHAR_战宠, 0);
  434. --local petIndex = Char.GetPet(charIndex1, 0);
  435. --Char.SetData(petIndex, CONST.PET_DepartureBattleStatus, CONST.PET_STATE_战斗);
  436. NLG.SystemMessage(player, '召唤佣兵: 格斗' )
  437. Char.JoinParty(charIndex1, player);
  438. else
  439.         NLG.SystemMessage(player, '只能召唤1位格斗。' )
  440.         end
  441.         end
  442. elseif msg == "/aim" or msg == "、aim" then
  443.         if wanjia[player][0] > 3 then
  444.         NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
  445.         elseif Char.GetData(player,%对象_战宠%) == -1 then
  446.         NLG.SystemMessage(player, '不带宠,无法召唤佣兵。' )
  447.         elseif allyb > 750 then
  448.         NLG.SystemMessage(player, '当前线路人口爆满,无法添加佣兵了。' )
  449.         else
  450.         if wanjia[player][6] <= 0 then
  451.         local charIndex1 = Char.CreateDummy()--生成ai佣兵
  452.         wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
  453.         allyb = charIndex1
  454.         print("编号:"..charIndex1.."")
  455.         wanjia[player][6] = charIndex1
  456. Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
  457. Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
  458. Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
  459. Char.SetData(charIndex1, CONST.CHAR_名字, '马猴烧酒');
  460. Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
  461. Char.SetData(charIndex1, CONST.CHAR_形象, 100322);
  462. Char.SetData(charIndex1, CONST.CHAR_原形, 104968);
  463. Char.SetData(charIndex1, CONST.CHAR_原始图档, 100322);
  464. print('charIndex1', charIndex1)
  465. Char.SetData(charIndex1, CONST.CHAR_体力, rx/2);
  466. Char.SetData(charIndex1, CONST.CHAR_力量, 0);
  467. Char.SetData(charIndex1, CONST.CHAR_强度, rf);
  468. Char.SetData(charIndex1, CONST.CHAR_速度, rs);
  469. Char.SetData(charIndex1, CONST.CHAR_魔法, rm*10);
  470. Char.SetData(charIndex1, CONST.CHAR_风属性, 100);
  471. Char.SetData(charIndex1, CONST.CHAR_闪躲, 30);
  472. Char.SetData(charIndex1, CONST.CHAR_魅力, 100);
  473. Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
  474. Char.SetData(charIndex1, CONST.CHAR_种族, 0);
  475. NLG.UpChar(charIndex1);
  476. Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
  477. Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
  478. --Char.GiveItem(charIndex1, 2100, 1, false);
  479. --Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
  480. Char.SetData(charIndex1, CONST.CHAR_职业, 74);
  481. Char.SetData(charIndex1, CONST.CHAR_职类ID, 70);
  482. Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
  483. Char.AddSkill(charIndex1, 22);
  484. --Char.GivePet(charIndex1, 3004);
  485. --Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
  486. --Char.SetData(charIndex1, CONST.CHAR_战宠, 0);
  487. --local petIndex = Char.GetPet(charIndex1, 0);
  488. --Char.SetData(petIndex, CONST.PET_DepartureBattleStatus, CONST.PET_STATE_战斗);
  489. NLG.SystemMessage(player, '召唤佣兵: 法师')
  490. Char.JoinParty(charIndex1, player);
  491. else
  492.         NLG.SystemMessage(player, '只能召唤1位法师。' )
  493.         end
  494.         end
  495. end
  496. end
  497. --[[
  498. function ybModule:handleTalkEvent(player, msg)
  499. local command = msg:match('^/([%w]+)')
  500.   if commandsNormal[command] then
  501.   local arg = msg:match('^/[%w]+ +(.+)$')
  502.     arg = arg and string.split(arg, ' ') or {}
  503.     commandsNormal[command](player, arg);
  504.     return
  505.   end
  506.   return 1;
  507. end
  508. ]]
  509. --- 加载模块钩子
  510. function ybModule:onLoad()
  511.   self:logInfo('load')
  512.   self:regCallback('TalkEvent', Func.bind(self.handleTalkEvent, self))
  513. end
  514. --- 卸载模块钩子
  515. function ybModule:onUnload()
  516.   self:logInfo('unload')
  517. end
  518. return ybModule;
复制代码


发表于 2021-12-30 17:07:35 | 显示全部楼层
zaza32167 发表于 2021-12-27 03:29
因为你的data里没有佣兵的宠物id.要更改下,还有宠物技能也要添加

Char.GivePet(charIndex1, 325);
        Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
        petIndex = Char.GetPet(charIndex1, 0);
        Char.SetData(petIndex, %对象_体力%, rx);
        Char.SetData(petIndex, %对象_力量%, rg);
        Char.SetData(petIndex, %对象_强度%, rf);
        Char.SetData(petIndex, %对象_速度%, rs);
        Char.SetData(petIndex, %对象_魔法%, rm);
                Char.SetData(petIndex, %对象_等级%, rlv);
        Pet.UpPet(petIndex, petIndex)
        Char.SetData(petIndex, %对象_血%, Char.GetData(petIndex, %对象_最大血%));
        Char.SetData(petIndex, %对象_魔%, Char.GetData(petIndex, %对象_最大魔%));
改成325也不出宠物啊?请大神指教

发表于 2022-1-4 15:05:22 来自手机 | 显示全部楼层
901584 发表于 2021-12-30 17:07
Char.GivePet(charIndex1, 325);
        Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
        p ...

你的端里有325编号的宠物吗?宠物编号要对应才可以

发表于 2022-1-4 15:07:57 来自手机 | 显示全部楼层
最新佣兵武器测试,装备武器防具水晶首饰都没有问题,前提是道具已鉴定!这个问题困扰了我好久,终于解决了!现在可以制作驯兽,饲养,舞者佣兵了

发表于 2022-1-4 18:44:04 | 显示全部楼层
哪位大佬能发布一个整合好的引擎啊,谢谢了
您需要登录后才可以回帖 登录 | 注册/Sign up

本版积分规则

手机版|cgmsv引擎论坛

GMT+8, 2026-6-5 09:08 , Processed in 0.032677 second(s), 2 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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