铁血丹心

 找回密码
 我要成为铁血侠客
搜索
查看: 1351|回复: 4

我自己设计的附加发动技能几率 求大神指点

[复制链接]
发表于 2012-7-13 21:11 | 显示全部楼层 |阅读模式

马上注册,结交更多侠友!

您需要 登录 才可以下载或查看,没有账号?我要成为铁血侠客

x
本帖最后由 fff71669 于 2012-7-14 07:49 编辑

我自己设计一个代码 攻击时追加5个技能之1发动不知道有没有错,求大神指点,引用的是二大的山寨版我现在找不到原因无法启动游戏郁闷求指点
  1. if T9ZZL(pid) then --赵子龙枪法,百鸟朝凤枪,七探蛇盘枪,单手十八挑,夹竹梅花枪,落马金钱枪
  2.   if JLSD(0, math.modf(10 + (5 * wgnumber(0, 4))), pid)  then --15%,每学一个特殊多5%
  3.    local word1 = "百鸟朝凤枪"
  4.    WAR.ZZLQF1 = 1
  5.   if juexing() >= 1 then
  6.     WAR.ZZLQF1 = 2
  7.     word1 = "百鸟朝凤枪·改"
  8.    end
  9.   if juexing() >= 2 then
  10.     WAR.ZZLQF1 = 3
  11.     word1 = "真·百鸟朝凤枪"
  12.    end
  13.   if WAR.Person[id][CC.TXWZ1] ~= nil then
  14.     WAR.Person[id][CC.TXWZ1] = WAR.Person[id][CC.TXWZ1] .. "+" ..word1
  15.    else
  16.     WAR.Person[id][CC.TXWZ1] = word1
  17.    end   
  18.     elseif JLSD(0, math.modf(10 + (5 * wgnumber(0, 4))), pid)  then
  19.    local word2 = "七探蛇盘枪"
  20.    WAR.ZZLQF2 = 1
  21.   if juexing() >= 1 then
  22.     WAR.ZZLQF2 = 2
  23.     word2 = "七探蛇盘枪·改"
  24.    end
  25.   if juexing() >= 2 then
  26.     WAR.ZZLQF2 = 3
  27.     word2 = "真·七探蛇盘枪"
  28.    end
  29.   if WAR.Person[id][CC.TXWZ1] ~= nil then
  30.     WAR.Person[id][CC.TXWZ1] = WAR.Person[id][CC.TXWZ1] .. "+" ..word2
  31.    else
  32.     WAR.Person[id][CC.TXWZ1] = word2
  33.    end
  34.   
  35.         elseif JLSD(0, math.modf(10 + (5 * wgnumber(0, 4))), pid)  then
  36.    local word3 = "单手十八挑"
  37.    WAR.ZZLQF3 = 1
  38.   if juexing() >= 1 then
  39.     WAR.ZZLQF3 = 2
  40.     word3 = "单手十八挑·改"
  41.   end
  42.   if juexing() >= 2 then
  43.     WAR.ZZLQF3 = 3
  44.     word3 = "真·单手十八挑"
  45.   end

  46.   if WAR.Person[id][CC.TXWZ1] ~= nil then
  47.     WAR.Person[id][CC.TXWZ1] = WAR.Person[id][CC.TXWZ1] .. "+" ..word3
  48.   else
  49.     WAR.Person[id][CC.TXWZ1] = word3
  50.   end
  51. elseif JLSD(0, math.modf(10 + (5 * wgnumber(0, 4))), pid)  then
  52.    local word4 = "夹竹梅花枪"
  53.    WAR.ZZLQF4 = 1
  54.   if juexing() >= 1 then
  55.     WAR.ZZLQF4 = 2
  56.     word4 = "夹竹梅花枪·改"
  57.   end
  58.   if juexing() >= 2 then
  59.            WAR.ZZLQF4 = 3
  60.     word4 = "真·夹竹梅花枪"
  61.   end
  62.   if WAR.Person[id][CC.TXWZ1] ~= nil then
  63.     WAR.Person[id][CC.TXWZ1] = WAR.Person[id][CC.TXWZ1] .. "+" ..word4
  64.   else
  65.     WAR.Person[id][CC.TXWZ1] = word4
  66.   end
  67.   elseif JLSD(0, math.modf(10 + (5 * wgnumber(0, 4))), pid)  then
  68.    local word5 = "落马金钱枪"
  69.    WAR.ZZLQF5 = 1
  70.    if juexing() >= 1 then
  71.     WAR.ZZLQF5 = 2
  72.     word5 = "落马金钱枪·改"
  73.    end
  74.    if juexing() >= 2 then
  75.     WAR.ZZLQF5 = 3
  76.     word5 = "真·落马金钱枪"
  77.    end
  78.    if WAR.Person[id][CC.TXWZ1] ~= nil then
  79.     WAR.Person[id][CC.TXWZ1] = WAR.Person[id][CC.TXWZ1] .. "+" ..word5
  80.    else
  81.     WAR.Person[id][CC.TXWZ1] = word5
  82.    end     
  83.   end
  84. end
复制代码
【武侠.中国】铁血丹心论坛(大武侠):致力于推广和发展武侠文化,让我们一起努力,做全球最大的武侠社区。
可能是目前为止最好的金庸群侠传MOD游戏交流论坛,各种经典武侠游戏等你来玩,各种开源制作工具等你来实现你的游戏开发之梦。
 楼主| 发表于 2012-7-13 21:16 | 显示全部楼层
  1.         if WAR.ZZLQF1 == 1 and T9ZZL(pid) then --赵子龙枪法伤害
  2.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 20
  3.         end
  4.         if WAR.ZZLQF2 == 1 and T9ZZL(pid) then --赵子龙枪法伤害
  5.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 20
  6.         end
  7.         if WAR.ZZLQF3 == 1 and T9ZZL(pid) then --赵子龙枪法伤害
  8.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 20
  9.         end
  10.         if WAR.ZZLQF4 == 1 and T9ZZL(pid) then --赵子龙枪法伤害
  11.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 20
  12.         end
  13.         if WAR.ZZLQF5 == 1 and T9ZZL(pid) then --赵子龙枪法伤害
  14.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 20
  15.         end
  16.         if WAR.ZZLQF1 == 2 and T9ZZL(pid) then --赵子龙枪法伤害
  17.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 50
  18.         end
  19.         if WAR.ZZLQF2 == 2 and T9ZZL(pid) then --赵子龙枪法伤害
  20.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 50
  21.         end
  22.         if WAR.ZZLQF3 == 2 and T9ZZL(pid) then --赵子龙枪法伤害
  23.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 50
  24.         end
  25.         if WAR.ZZLQF4 == 2 and T9ZZL(pid) then --赵子龙枪法伤害
  26.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 50
  27.         end
  28.         if WAR.ZZLQF5 == 2 and T9ZZL(pid) then --赵子龙枪法伤害
  29.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 50
  30.         end
  31.         if WAR.ZZLQF1 == 3 and T9ZZL(pid) then --赵子龙枪法伤害
  32.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 100
  33.         end
  34.         if WAR.ZZLQF2 == 3 and T9ZZL(pid) then --赵子龙枪法伤害
  35.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 100
  36.         end
  37.         if WAR.ZZLQF3 == 3 and T9ZZL(pid) then --赵子龙枪法伤害
  38.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 100
  39.         end
  40.         if WAR.ZZLQF4 == 3 and T9ZZL(pid) then --赵子龙枪法伤害
  41.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 100
  42.         end
  43.         if WAR.ZZLQF5 == 3 and T9ZZL(pid) then --赵子龙枪法伤害
  44.                 hurt = hurt + math.modf(5 * wgnumber(0, 4)) + 100
  45.         end
复制代码
【武侠.中国】铁血丹心论坛(大武侠):致力于推广和发展武侠文化,让我们一起努力,做全球最大的武侠社区。
可能是目前为止最好的金庸群侠传MOD游戏交流论坛,各种经典武侠游戏等你来玩,各种开源制作工具等你来实现你的游戏开发之梦。
 楼主| 发表于 2012-7-13 21:20 | 显示全部楼层
  1.            if pid==0 and T9ZZL(0) and WAR.ZZLQF4==3 and math.random(10)<=2  then  --特效20%迟缓
  2.                    bch=1
  3.         end        
复制代码
  1.    if pid==0 and T9ZZL(0) and  WAR.ZZLQF2 ==3 and math.random(10)<=2 then --特效20%流血
  2.           WAR.BLX = 1
  3.   end
复制代码
  1.     if pid==0 and T9ZZL(0) and  WAR.ZZLQF5 ==3 and math.random(10)<=2 then --特效20%
  2.           WAR.BFX = 1
  3.   end
复制代码
  1.              if pid==0 and T9ZZL(0) and WAR.ZZLQF3 == 3 then
  2.                WAR.BJ = 1
  3.                 end  
  4.    
复制代码
  1.     if pid == 0 and T9ZZL(0) and WAR.ZZLQF1 == 3 then
  2.             fightnum = 2
  3.         end  
复制代码
【武侠.中国】铁血丹心论坛(大武侠):致力于推广和发展武侠文化,让我们一起努力,做全球最大的武侠社区。
可能是目前为止最好的金庸群侠传MOD游戏交流论坛,各种经典武侠游戏等你来玩,各种开源制作工具等你来实现你的游戏开发之梦。
发表于 2012-7-13 22:56 | 显示全部楼层
本帖最后由 二宫和也 于 2012-7-13 22:58 编辑

一运行直接跳出一般都是因为格式语法错误,比如你1楼的那一堆else xxxx,其实应该写成elseif xxxx

写代码的时候一定要小心再小心,保存代码之后一定要先运行一下游戏看看会不会出错,如果出错还可以用撤销来恢复。我曾经试过少了一个then然后游戏死都运行不起来,偏偏我还找不到哪里出错害得我想直接把游戏删掉放弃...

ps. 竟然做赵子龙,你在抢我生意咩

点评

知道啦 改好了..  发表于 2012-7-14 01:14
把if inteam(pid) and WAR.Person[p]["我方"] then改成if WAR.Person[p]["我方"] then就好了  发表于 2012-7-14 00:14
我有个问题,请教一下。怎么让友方NPC可控  发表于 2012-7-13 23:24
我也是百度搜来的。。  发表于 2012-7-13 23:24
【武侠.中国】铁血丹心论坛(大武侠):致力于推广和发展武侠文化,让我们一起努力,做全球最大的武侠社区。
可能是目前为止最好的金庸群侠传MOD游戏交流论坛,各种经典武侠游戏等你来玩,各种开源制作工具等你来实现你的游戏开发之梦。
发表于 2012-7-13 23:09 | 显示全部楼层
推荐你使用LuaEditor 这个工具来编写lua代码。编完之后按F7可以帮你检查语法。

点评

简直感谢...要不是你告诉我有这软件 我还真的查不出来我那个位置做错了 竟然是另外一个技能语句多了个break;当时顺手加的..晕死了  发表于 2012-7-14 07:48
原来还真有检查语法的软件呃....我一直都在用notepad++.....  发表于 2012-7-13 23:17
【武侠.中国】铁血丹心论坛(大武侠):致力于推广和发展武侠文化,让我们一起努力,做全球最大的武侠社区。
可能是目前为止最好的金庸群侠传MOD游戏交流论坛,各种经典武侠游戏等你来玩,各种开源制作工具等你来实现你的游戏开发之梦。

本版积分规则

小黑屋|手机版|铁血丹心

GMT+8, 2024-5-19 10:39

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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