找回密码
 注册
搜索
查看: 2430|回复: 58

华山smy双杀faint机器人的修改

[复制链接]
门派:不明
发表于 2016-12-5 00:49:53 | 显示全部楼层 |阅读模式
趁现在有精神,把这些天修改的东西整理整理. 每个人的思路不一样,因此仅供大家参考,我尽量把代码贴完整
如有遗漏,跟帖我再补充

文件:job.lua
1, 为两个武士添加武器变量
yptjob.skills1_level=1
yptjob.skills2_level=1
yptjob.fengzhao=false
--添加两个武器变量
yptjob.weapon1 = nil
yptjob.weapon2 = nil

2,修改smytrigger
function SmyTrigger()

    DeleteTriggerGroup("gbluAsk")
    create_trigger_t('gbluAsk1',"^(> )*你向鲁有脚打听有关",'','gbluAsk')
    create_trigger_t('gbluAsk2',"^(> )*这里没有这个人。$",'','gbluNobody')
    SetTriggerOption("gbluAsk1","group","gbluAsk")
    SetTriggerOption("gbluAsk2","group","gbluAsk")
    EnableTriggerGroup("gbluAsk",false)
    DeleteTriggerGroup("gbluAccept")
    create_trigger_t('gbluAccept1',"^(> )*鲁有脚说道:「颂摩崖是西夏武士东来的必经之地,你速带几名弟子埋",'','check_food_ypt')
    create_trigger_t('gbluAccept2',"^(> )*鲁有脚说道:「您上次任务辛苦了,还是先休息一下再说吧。",'','gbluBusy')
    create_trigger_t('gbluAccept3',"^(> )*鲁有脚说道:「这个任务我已经交给",'','gbluBusy')
    create_trigger_t('gbluAccept4',"^(> )*鲁有脚说道:「我这里现在没有什么任务可以给你。",'','gbluBusy')
    create_trigger_t('gbluAccept5',"^(> )*鲁有脚说道:「你不是已经接过任务了吗?",'','gbluBusy')
    SetTriggerOption("gbluAccept1","group","gbluAccept")
    SetTriggerOption("gbluAccept2","group","gbluAccept")
    SetTriggerOption("gbluAccept3","group","gbluAccept")
    SetTriggerOption("gbluAccept4","group","gbluAccept")
    SetTriggerOption("gbluAccept5","group","gbluAccept")
    EnableTriggerGroup("gbluAccept",false)
    DeleteTriggerGroup("yptFight")
    create_triggerex_lvl('yptFight1','^看起来(\\D*)想杀死你!','','yptLook')
    create_trigger_t('yptFight4','^(> )*山崖北面的小路上闪出两条人影,你纵身而起,立即和人影战在了一起。','','ypt_kill_imm')
    create_trigger_t('yptFight2','^(> )*远处的山路传来一阵轻啸,隐约听得有人施展轻功飞驰而来。','','yptFightbegin')
    create_trigger_t('yptFight3','^(> )*你孤身一人纵身翻上了崖壁险绝之处。','','yptFightCheck')
    --分段双杀,添加两个触发
    create_trigger_t('yptFight5','^(> )*你把 "action" 设定为 "check_wushi_ok" 成功完成。','','yptKillBegin')
    create_trigger_t('yptFight6','^(> )*你把 "action" 设定为 "perform_zongjue" 成功完成。','','yptPerformZongjue')
    SetTriggerOption("yptFight1","group","yptFightkill")
    SetTriggerOption("yptFight2","group","yptFight")
    SetTriggerOption("yptFight3","group","yptFight")
    SetTriggerOption("yptFight4","group","yptFight")
    SetTriggerOption("yptFight5","group","yptFight")
    SetTriggerOption("yptFight6","group","yptFight")
    job.killer[sxjob.killer1]=false

    EnableTriggerGroup("yptFight",false)
    EnableTriggerGroup("yptFightkill",false)
end

评分

1

查看全部评分

门派:不明
 楼主| 发表于 2016-12-5 00:50:35 | 显示全部楼层
3,修改 yptLook 函数
function yptLook(n,l,w)

    if job.killer[sxjob.killer1]~=true then
            sxjob.killer1=tostring(w[1])
        yptjob.name1=sxjob.killer1
        job.killer[sxjob.killer1]=true
        fight.time.b=os.time()
        yptteam=yptteam+1
        return
    end

    if job.killer[sxjob.killer1]==true then
        sxjob.killer2=tostring(w[1])
        yptjob.name2=sxjob.killer2
    end

    print(sxjob.killer1,sxjob.killer2)
    sxjob.id1='wu shi'
    sxjob.id2='wu shi'
    yptjob.weapon1 = '气'
    yptjob.weapon2 = '气'

    DeleteTriggerGroup("ypt_fight")
    create_trigger_t('ypt_fight5','^>*\\s*(\\D*)「啪」的一声倒在地上','','ypt_kill_die')
    create_trigger_t('ypt_fight6','^>*\\s*(\\D*)神志迷糊,脚下一个不稳,倒在地上昏了过去。','','ypt_kill_faint')
    create_trigger_t('ypt_fight7','^>*\\s*(看清楚一点,那并不是|你想攻击谁?)','','ypt_kill_over')
    create_trigger_t('ypt_fight8','^>*\\s*\\( 你气息不匀,暂时不能施用外功。\\)','','yptfail')
    create_trigger_t('ypt_fight9','^>*\\s*啊!总算双目没有被真正刺伤,你又可以看见事物啦!','','ypt_cimu')
    create_trigger_t('ypt_catch_id','^>*\\s*西夏一品堂\\s*武士\\s*(\\D*)\\s*\\((\\D*)\\)\\n这是西夏一品堂从江湖上重金招聘的一名武林高手。\\n此人看上去师承\\D*,擅长使用(\\D*)伤敌!','','ypt_define_skills') --new
    SetTriggerOption("ypt_catch_id","multi_line","y") --new
    SetTriggerOption("ypt_catch_id","lines_to_match","3") --new
    EnableTrigger("ypt_catch_id",true) --new

    SetTriggerOption("ypt_fight1","group","ypt_fight")
    SetTriggerOption("ypt_fight2","group","ypt_fight")
    SetTriggerOption("ypt_fight3","group","ypt_fight")
    SetTriggerOption("ypt_fight4","group","ypt_fight")
    SetTriggerOption("ypt_fight5","group","ypt_fight")
    SetTriggerOption("ypt_fight6","group","ypt_fight")
    SetTriggerOption("ypt_fight7","group","ypt_fight")
    SetTriggerOption("ypt_fight8","group","ypt_fight")
    SetTriggerOption("ypt_fight9","group","ypt_fight")

    DeleteTriggerGroup("ypt_weapon")
    create_trigger_t('ypt_weapon1',"^(他|她)装备着:$",'','npcWeapon')
    SetTriggerOption("ypt_weapon1","group","ypt_weapon")
    EnableTriggerGroup("ypt_weapon",true)

    exe('look wu shi 1;look wu shi 2;alias action check_wushi_ok')  --new
end
门派:不明
 楼主| 发表于 2016-12-5 00:57:01 | 显示全部楼层
3,faint 的 ypt_define_skills 函数过于复杂,这里要精简掉,后面有单独的函数写 pfm
--修改后的 ypt_define_skills 仅用来判断武士的优先顺序
function ypt_define_skills(n,l,w)

        if sxjob.killer1==tostring(w[1]) then
                yptjob.weapon1 = nil
                sxjob.id1=string.lower(w[2])  --获取武士一的id
                yptjob.id1=sxjob.id1
                yptjob.skills1=tostring(w[3]) --获取武士二的技能

                --实装武士技能的克制

                if yptteam*1 > 9 then
                        if falsesk[yptjob.skills1] then
                                exe('halt;down')
                                 return yptfail()
                          end
                end
                ----技能分级比较重新规划,优先对付数值最大的技能。
                if Yptlastsk[yptjob.skills1] then
                        sxkiller1=1
                   elseif Yptdangersk9[yptjob.skills1] then
                          sxkiller1=9
                   elseif Yptdangersk8[yptjob.skills1] then
                         sxkiller1=8
                   elseif Yptdangersk7[yptjob.skills1] then
                          sxkiller1=7
                   elseif Yptdangersk6_6[yptjob.skills1] then
                          sxkiller1=6.6
                   elseif Yptdangersk6_5[yptjob.skills1] then
                          sxkiller1=6.5
                   elseif Yptdangersk6[yptjob.skills1] then
                          sxkiller1=6
                   elseif Yptdangersk5_1[yptjob.skills1] then
                          sxkiller1=5.1
                   else
                          sxkiller1=5
                   end

                   yptjob.skills1_level=sxkiller1

           --------------------------------------------------
                if yptteam*1 > 10 then
                        if fearsk[yptjob.skills1] then
                                sxkiller1=0
                          end
                end

                --
        end

        if sxjob.killer2==tostring(w[1]) then
                yptjob.weapon2 = nil
                sxjob.id2=string.lower(w[2])  --获取武士二的id
                yptjob.id2=sxjob.id2
                yptjob.skills2=tostring(w[3]) --获取武士二的技能

                --实装武士技能的克制
                if yptteam*1 > 9 then
                        if falsesk[yptjob.skills2] then
                                exe('halt;down')
                                return yptfail()
                        end
                end
                ----技能分级比较重新规划,优先对付数值最大的技能。

                if Yptlastsk[yptjob.skills2] then
                        sxkiller2=1
                elseif Yptdangersk9[yptjob.skills2] then
                        sxkiller2=9
                elseif Yptdangersk8[yptjob.skills2] then
                        sxkiller2=8
                elseif Yptdangersk7[yptjob.skills2] then
                        sxkiller2=7
                elseif Yptdangersk6_6[yptjob.skills2] then
                        sxkiller2=6.6
                elseif Yptdangersk6_5[yptjob.skills2] then
                        sxkiller2=6.5
                elseif Yptdangersk6[yptjob.skills2] then
                        sxkiller2=6
                elseif Yptdangersk5_1[yptjob.skills2] then
                        sxkiller2=5.1
                else
                        sxkiller2=5
                end
                yptjob.skills2_level=sxkiller2

           --------------------------------------------------
                if yptteam*1 > 10 then
                        if fearsk[yptjob.skills2] then
                                sxkiller2=0
                        end
                end
        end
end
门派:不明
 楼主| 发表于 2016-12-5 01:02:16 | 显示全部楼层
4,保存2个武士的武器的部分
function npcWeapon()
        DeleteTriggerGroup("npcWeapon")
        create_trigger_t('npcWeapon1',"^  □(\\D*)\\(",'','npcWP')
        SetTriggerOption("npcWeapon1","group","npcWeapon")
        EnableTriggerGroup("npcWeapon",true)
        EnableTrigger("xueshan_guard4",true)
end



function npcWP(n,l,w)
        local n_words=tostring(w[1])
        local po_set = '掌'
        if string.find(n_words,"铁棍") then
                po_set = '枪'
        elseif string.find(n_words,"钢杖") then
                po_set = '枪'
        elseif string.find(n_words,"竹棒") then
                job.weapon='stick'
                po_set = '枪'
        elseif string.find(n_words,"长剑") then
                job.weapon='sword'
                po_set = '剑'
        elseif string.find(n_words,"箫") then
                job.weapon='xiao'
                po_set = '剑'
        elseif string.find(n_words,"针") then
                po_set = '剑'
        elseif string.find(n_words,"钢刀") then
                job.weapon='blade'
                po_set = '刀'
        elseif string.find(n_words,"鞭") then
                job.weapon='whip'
                po_set = '索'
        elseif string.find(n_words,"石") then
                po_set = '箭'
        elseif string.find(n_words,"匕首") then
                po_set = '鞭'
        elseif string.find(n_words,"钢斧") then
                po_set = '鞭'
        elseif string.find(n_words,"流星锤") then
                po_set = '鞭'
        elseif string.find(n_words,"铁令") then
                job.weapon='dagger'
                po_set = '鞭'
        elseif string.find(n_words,"单钩") then
                po_set = '鞭'
        elseif string.find(n_words,"**") then
                po_set = '鞭'
        elseif string.find(n_words,"铁笔") then
                po_set = '鞭'
        else
                job.weapon='unarmed'
                po_set = '掌'
        end

        --其他任务还是要用到 set po 的
        if job.name~='songmoya' then
                    exe('set po '..po_set)
        end
        --记录两个武士的物品,并分别保存到对应的 yptjob.weapon1 和 yptjob.weapon2
        if yptjob.weapon1 == nil then
                yptjob.weapon1 = po_set
                Note('武士1 的 po 是 '..yptjob.weapon1 )
           elseif yptjob.weapon2 == nil then
                yptjob.weapon2 = po_set
                Note('武士1 的 po 是 '..yptjob.weapon1..' 武士2 的 po 是'..yptjob.weapon2)
           end

            EnableTrigger("npcWeapon1",false)
        DeleteTriggerGroup("npcWeapon")
end
门派:不明
 楼主| 发表于 2016-12-5 01:09:01 | 显示全部楼层
5, yptlook 执行后就会 alias action check_wushi_ok,,并触发函数 yptKillBegin
执行 yptKillbegin 函数的时候,我们已经知道了武士的优先级,武士的武器信息

yptkillbegin 主要是预先设置一些信息,方便后面使用,如果两个武士的武器相同,我也是在这里设置 po

function yptKillBegin()

        EnableTriggerGroup("yptFightkill",false)
        --下面3个在这里定义就可以了
        yptjob.zj = nil
        yptjob.p1 = nil
        yptjob.p2 = nil
        yptjob.pfmyun = 0

        messageShow('当前组第一个武士:姓名【'..sxjob.killer1..'】,ID【'..sxjob.id1..'】,使用技能【'..yptjob.skills1..'】!')
        messageShow('当前组第一个武士:姓名【'..sxjob.killer2..'】,ID【'..sxjob.id2..'】,使用技能【'..yptjob.skills2..'】!')

        --独孤九剑,只攻不守
        --下面的代码是针对华山的技能做的,其他门派也可以在这里设置一些预定信息
        --主要是根据2个武士的属性,来选择最优的技能组合
        if yptjob.weapon1 == yptjob.weapon2 then
                if yptjob.skills1 == yptjob.skills2 then
                        --技能武器都相同
                        if skillsjineng10[yptjob.skills1] then
                                --都是圣火令法
                                yptjob.zj = "po_hs"
                        else
                                if skillsjineng2[yptjob.skills1] or skillsjineng4[yptjob.skills1] or skillsjineng5[yptjob.skills1] or skillsjineng7[yptjob.skills1] then
                                        yptjob.zj = "po"
                                else
                                        yptjob.zj = "po_hs"
                                end
                        end
                else
                        --技能不同,但是相同武器
                        if skillsjineng10[yptjob.skills1] then
                                yptjob.p1 = "po_hs"
                                if skillsjineng2[yptjob.skills2] or skillsjineng4[yptjob.skills2] or skillsjineng5[yptjob.skills2] or skillsjineng7[yptjob.skills2] then
                                        yptjob.p2 = "po"
                                else
                                        yptjob.p2 = "po_hs"
                                end
                        elseif skillsjineng10[yptjob.skills2] then
                                yptjob.p2 = "huayue"
                                if skillsjineng2[yptjob.skills1] or skillsjineng4[yptjob.skills1] or skillsjineng5[yptjob.skills1] or skillsjineng7[yptjob.skills1] then
                                        yptjob.p1 = "po"
                                else
                                        yptjob.p1 = "po_hs"
                                end
                        else
                                --没有圣火令法捣乱
                                local lockfy = yptjob.skills1
                                if sxkiller2 > sxkiller1 then
                                        lockfy = yptjob.skills2
                                end

                                if skillsjineng2[lockfy] or skillsjineng4[lockfy] or skillsjineng5[lockfy] or skillsjineng7[lockfy] then
                                        yptjob.zj = "po"
                                else
                                        yptjob.zj = "po_hs"
                                end
                        end
                end
        else
                --武器不相同的情况下,分别击杀
                if skillsjineng10[yptjob.skills1] then
                        yptjob.p1 = "po_hs"
                elseif skillsjineng2[yptjob.skills1] or skillsjineng4[yptjob.skills1] or skillsjineng5[yptjob.skills1] or skillsjineng7[yptjob.skills1] then
                        yptjob.p1 = "po"
                else
                        --收招采用 huashan-jianfa
                        yptjob.p1 = "po_hs"
                end

                if skillsjineng10[yptjob.skills2] then
                        yptjob.p2 = "huayue"
                elseif skillsjineng2[yptjob.skills2] or skillsjineng4[yptjob.skills2] or skillsjineng5[yptjob.skills2] or skillsjineng7[yptjob.skills2] then
                        yptjob.p2 = "po"
                else
                        --收招采用 huashan-jianfa
                        yptjob.p2 = "po_hs"
                end       
        end
        --如果不设置这些东西,也是可以的,上面的代码不是必须的

        --如果两个武士是相同的武器,那么预先设置好 po ,否者在杀怪过程中单独设置
        if yptjob.zj ~= nil then
                if yptjob.zj == "po" or yptjob.zj == "po_hs" then
                        if yptjob.weapon1 ~= nil then
                                exe('set po '..yptjob.weapon1)
                        else
                                exe('set po 气')
                        end
                end
        end
       

            EnableTrigger("yptFight1",false)
            EnableTrigger("ypt_fight1",false)
            EnableTrigger("ypt_fight2",false)
           EnableTrigger("ypt_fight3",false)
           EnableTrigger("ypt_fight4",false)

           exe('kill '..sxjob.id1)
           exe('kill '..sxjob.id2)
        return checkWait(yptKillgo,0.1)  --1秒后开始杀人,触发光环效果
end
门派:不明
 楼主| 发表于 2016-12-5 01:10:17 | 显示全部楼层
上面补充一下,
return checkWait(yptKillgo,0.1)  --1秒后开始杀人,触发光环效果

原来是等待1秒
return checkWait(yptKillgo,1)  --1秒后开始杀人,触发光环效果

因为我自己没有光环,所以就不等待了,即使有,我也不建议等待
门派:不明
 楼主| 发表于 2016-12-5 01:12:34 | 显示全部楼层
6, yptkillgo 函数对我来说没什么用,因此精简一下

ffunction yptKillgo()  --如何发pfm这里是关键
        Note('开始杀武士')
        if yptteam*1 > 10 then
                if sxkiller1*1==0 and sxkiller2*1==0 then
                        exe('halt;down')
                        return yptfail()
                end
        end
        --我们设置pfm的地方
        yptPerform(-1)
end
门派:不明
 楼主| 发表于 2016-12-5 01:17:10 | 显示全部楼层
7, pfm 设置,这里我是针对华山来做的,其他门派可以根据自己的技能专门修改这个函数

function yptPerform( lockobj )

        if yptjob.name2 == "武士无威胁能力" and yptjob.name1 == "武士无威胁能力" then
                return
        end

        local set_po1 = yptjob.weapon1
        if set_po1 == nil then
                set_po1 = '气'
        end

        local set_po2 = yptjob.weapon2
        if set_po2 == nil then
                set_po2 = '气'
        end
       
        -- 当前组数 yptteam
        -- 当前和气 yptjob.heqi
        local heqi = yptjob.heqi

        -- lockobj 是优先击杀对象
        if lockobj == -1 then
                Note('起手式')
                --初次pfm,慎重选择
                local sCmd = 'halt;kill '..sxjob.id1..';perform wushuang '..sxjob.id1..';halt;kill '..sxjob.id2..';perform wushuang '..sxjob.id2..';kill '..sxjob.id1..';hp;alias action perform_zongjue'               
                if yptteam < 11 then
                        sCmd = 'halt;kill '..sxjob.id1..';perform cangsong '..sxjob.id1..';halt;kill '..sxjob.id2..';perform cangsong '..sxjob.id2..';kill '..sxjob.id1..';hp;alias action perform_zongjue'
                end
                --local sCmd = 'halt;kill '..sxjob.id1..';perform yangwu '..sxjob.id1..';unwield jian;perform cuff.leidong '..sxjob.id1..'halt;kill '..sxjob.id2..';wield jian;perform yangwu '..sxjob.id2..';unwield jian;perform cuff.leidong '..sxjob.id2..';kill '..sxjob.id1..';hp;alias action perform_zongjue'
                exe( sCmd )
        elseif lockobj == 0 then
                Note('总决试')
                --当前状态为huashan-jifa
                --两个武士应该都没死,还没有出手
                if yptteam > 12 then
                        if heqi < 240 then
                                Note('起手失败')
                                exe('set wimpycmd halt\\down;set wimpy 100;halt;down')
                                return
                        end
                else                       
                        if heqi < 120 then
                                Note('起手失败')
                                exe('set wimpycmd halt\\down;set wimpy 100;halt;down')
                                return
                        end
                end

                --当需要发2个leidong +id 时,这里确定先后顺序
                local firstid = sxjob.id1
                local lastid = sxjob.id2
                if skillsjineng4[yptjob.skills2] then
                        firstid = sxjob.id2
                        lostid = sxjob.id1
                end

                if yptteam <= 12 then
                        --采用相同方式,如果有雷动,就不需要用君子,否则使用1-2个君子
                        if Yptlastsk[yptjob.skills1] and Yptlastsk[yptjob.skills2] then
                                if heqi >= 480 then
                                        create_alias('yptpfm1','yptpfm1','alias p1 '..'unwield jian;bei none;jifa parry dugu-jiujian;bei poyu-quan;perform cuff.leidong '..firstid..';perform cuff.leidong '..lastid..';perform cuff.leidong;bei none;bei strike;perform strike.wuji;perform strike.wuji;perform strike.wuji;perform strike.wuji;unwield jian')
                                else
                                        if heqi >= 320 then
                                                create_alias('yptpfm1','yptpfm1','alias p1 '..'unwield jian;bei none;jifa parry dugu-jiujian;bei poyu-quan;perform cuff.leidong '..firstid..';perform cuff.leidong '..lastid..';bei none;bei strike;perform strike.wuji;perform strike.wuji;perform strike.wuji;perform strike.wuji;unwield jian')
                                        else
                                                create_alias('yptpfm1','yptpfm1','alias p1 '..'unwield jian;bei none;jifa parry dugu-jiujian;bei poyu-quan;perform cuff.leidong '..lastid..';bei none;bei strike;perform strike.wuji;perform strike.wuji;perform strike.wuji;perform strike.wuji;unwield jian')
                                        end
                                end
                        elseif Yptlastsk[yptjob.skills1] then
                                create_alias('yptpfm1','yptpfm1','alias p1 '..'unwield jian;bei none;jifa parry dugu-jiujian;bei poyu-quan;perform cuff.leidong '..sxjob.id1..';perform cuff.leidong '..sxjob.id2..';bei none;bei strike;wield wuji sword;jifa sword dugu-jiujian;set po '..set_po2..';perform po '..sxjob.id2..';perform strike.wuji;perform strike.wuji;perform strike.wuji;perform strike.wuji;unwield jian')
                        elseif Yptlastsk[yptjob.skills2] then
                                create_alias('yptpfm1','yptpfm1','alias p1 '..'unwield jian;bei none;jifa parry dugu-jiujian;bei poyu-quan;perform cuff.leidong '..sxjob.id1..';perform cuff.leidong '..sxjob.id2..';bei none;bei strike;wield wuji sword;jifa sword dugu-jiujian;set po '..set_po1..';perform po '..sxjob.id1..';perform strike.wuji;perform strike.wuji;perform strike.wuji;perform strike.wuji;unwield jian')
                        else
                                local sjunzi = nil
                                if heqi > 480 then
                                        sjunzi = 'perform junzi;perform junzi;perform junzi;jifa sword dugu-jiujian'
                                elseif heqi >= 360 then
                                        sjunzi = 'perform junzi;perform junzi;jifa sword dugu-jiujian'
                                elseif heqi >= 280 then
                                        sjunzi = 'perform junzi;jifa sword dugu-jiujian'
                                else
                                        sjunzi = 'jifa sword dugu-jiujian'
                                end

                                local s9j = nil
                                if yptjob.zj ~= nil then
                                        s9j = sjunzi..';perform po;perform po;perform po;perform po;perform po;perform po;perform po'
                                else
                                        s9j = sjunzi..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';jifa sword huashan-jianfa;perform lianhuan;perform lianhuan;perform lianhuan;perform lianhuan'
                                end

                                create_alias('yptpfm1','yptpfm1','alias p1 '..s9j )
                        end
                else
                        --尽可能堆命中
                        if Yptlastsk[yptjob.skills1] and Yptlastsk[yptjob.skills2] then
                                if heqi >= 480 then
                                        create_alias('yptpfm1','yptpfm1','alias p1 '..'unwield jian;bei none;jifa parry dugu-jiujian;bei poyu-quan;perform cuff.leidong '..lastid..';perform cuff.leidong '..lastid..';perform cuff.leidong;bei none;bei strike;perform strike.wuji;perform strike.wuji;perform strike.wuji;perform strike.wuji;unwield jian')
                                else
                                        create_alias('yptpfm1','yptpfm1','alias p1 '..'unwield jian;bei none;jifa parry dugu-jiujian;bei poyu-quan;perform cuff.leidong '..lastid..';perform cuff.leidong '..lastid..';bei none;bei strike;perform strike.wuji;perform strike.wuji;perform strike.wuji;perform strike.wuji;unwield jian')
                                end
                        elseif Yptlastsk[yptjob.skills1] then
                                create_alias('yptpfm1','yptpfm1','alias p1 '..'unwield jian;bei none;jifa parry dugu-jiujian;bei poyu-quan;perform cuff.leidong '..sxjob.id2..';perform cuff.leidong '..sxjob.id1..';perform cuff.leidong;bei none;bei strike;wield wuji sword;jifa sword dugu-jiujian;set po '..set_po2..';perform po '..sxjob.id2..';perform strike.wuji;perform strike.wuji;perform strike.wuji;perform strike.wuji')
                        elseif Yptlastsk[yptjob.skills2] then
                                create_alias('yptpfm1','yptpfm1','alias p1 '..'unwield jian;bei none;jifa parry dugu-jiujian;bei poyu-quan;perform cuff.leidong '..sxjob.id1..';perform cuff.leidong '..sxjob.id2..';perform cuff.leidong;bei none;bei strike;wield wuji sword;jifa sword dugu-jiujian;set po '..set_po1..';perform po '..sxjob.id1..';perform strike.wuji;perform strike.wuji;perform strike.wuji;perform strike.wuji')
                        else
                                local s9j = nil
                                if heqi >= 720 then
                                        --pfm 600
                                        s9j = 'perform junzi;perform junzi;perform junzi;unwield jian;perform cuff.leidong '..sxjob.id1..';perform cuff.leidong '..sxjob.id2..';perform cuff.leidong;wield wuji sword;jifa sword dugu-jiujian;set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';jifa sword huashan-jianfa;perform lianhuan;perform lianhuan'
                                elseif heqi >= 600 then
                                        --120+360 = 480
                                        s9j = 'perform junzi;perform junzi;unwield jian;perform cuff.leidong '..sxjob.id1..';perform cuff.leidong '..sxjob.id2..';perform cuff.leidong;wield wuji sword;jifa sword dugu-jiujian;set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';jifa sword huashan-jianfa;perform lianhuan;perform lianhuan'
                                elseif heqi >= 480 then
                                        s9j = 'perform junzi;perform junzi;unwield jian;perform cuff.leidong '..sxjob.id1..';perform cuff.leidong '..sxjob.id2..';wield wuji sword;jifa sword dugu-jiujian;set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';jifa sword huashan-jianfa;perform lianhuan;perform lianhuan'
                                elseif heqi >= 400 then
                                        s9j = 'perform junzi;unwield jian;perform cuff.leidong '..sxjob.id1..';perform cuff.leidong '..sxjob.id2..';wield wuji sword;jifa sword dugu-jiujian;set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';jifa sword huashan-jianfa;perform lianhuan;perform lianhuan'
                                elseif heqi >= 280 then
                                        s9j = 'perform junzi;unwield jian;perform cuff.leidong;wield wuji sword;jifa sword dugu-jiujian;set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';jifa sword huashan-jianfa;perform lianhuan;perform lianhuan'
                                elseif heqi >= 240 then
                                        s9j = 'unwield jian;perform cuff.leidong;wield wuji sword;jifa sword dugu-jiujian;set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';jifa sword huashan-jianfa;perform lianhuan;perform lianhuan'
                                elseif heqi >= 160 then
                                        s9j = 'perform junzi;jifa sword dugu-jiujian;set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';set po '..set_po1..';perform po '..sxjob.id1..';set po '..set_po2..';perform po '..sxjob.id2..';jifa sword huashan-jianfa;perform lianhuan;perform lianhuan'
                                end
                               
                                create_alias('yptpfm1','yptpfm1','alias p1 '..s9j )
                        end

                end

                exe('yptpfm1')
                exe('set wimpycmd p1\\hp;set wimpy 100')
        else
                Note('破招式')
                -- 总绝之后,死亡一个,补杀另外一个
                local lockid = sxjob.id2
                local lockskills = yptjob.skills2
                local lockweapon = yptjob.weapon2
                if lockobj == 1 then
                        lockid = sxjob.id1
                        lockskills = yptjob.skills1
                        lockweapon = yptjob.weapon1
                end

                if yptteam <= 12 then
                        if Yptlastsk[lockskills] then
                                create_alias('yptpfm1','yptpfm1','alias p1 '..'unwield jian;bei none;bei poyu-quan;perform cuff.leidong '..lockid..';perform cuff.leidong '..lockid..';bei none;bei strike;perform strike.wuji;perform strike.wuji')
                        else
                                local sjunzi = nil
                                if heqi > 480 then
                                        sjunzi = 'get wuji sword;wield wuji sword;jifa sword huashan-jianfa;jifa parry huashan-jianfa;perform junzi;perform junzi;perform junzi;jifa sword dugu-jiujian'
                                elseif heqi >= 360 then
                                        sjunzi = 'get wuji sword;wield wuji sword;jifa sword huashan-jianfa;jifa parry huashan-jianfa;perform junzi;perform junzi;jifa sword dugu-jiujian'
                                elseif heqi >= 280 then
                                        sjunzi = 'get wuji sword;wield wuji sword;jifa parry huashan-jianfa;perform junzi;jifa sword dugu-jiujian'
                                else
                                        sjunzi = 'get wuji sword;wield wuji sword;jifa sword dugu-jiujian;jifa parry dugu-jiujian'
                                end

                                local s9j = nil
                                if yptjob.zj ~= nil then
                                        s9j = sjunzi..';perform po;perform po;perform po'
                                else
                                        s9j = sjunzi..';set po '..lockweapon..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid
                                end

                                create_alias('yptpfm1','yptpfm1','alias p1 '..s9j )
                        end
                else
                        --尽可能堆命中
                        if Yptlastsk[lockskills] then
                                create_alias('yptpfm1','yptpfm1','alias p1 '..'unwield jian;bei none;bei poyu-quan;perform cuff.leidong '..lockid..';perform cuff.leidong '..lockid..';perform cuff.leidong;bei none;bei strike;perform strike.wuji;perform strike.wuji;perform strike.wuji;perform strike.wuji')
                        else
                                local s9j = nil
                                if heqi >= 720 then
                                        --pfm 600
                                        s9j = 'wield wuji sword;jifa sword huashan-jianfa;jifa parry huashan-jianfa;perform junzi;perform junzi;perform junzi;unwield jian;bei none;bei poyu-quan;perform cuff.leidong '..lockid..';perform cuff.leidong '..lockid..';perform cuff.leidong;wield wuji sword;jifa sword dugu-jiujian;set po '..lockweapon..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid
                                elseif heqi >= 600 then
                                        --120+360 = 480
                                        s9j = 'wield wuji sword;jifa sword huashan-jianfa;jifa parry huashan-jianfa;perform junzi;perform junzi;unwield jian;bei none;bei poyu-quan;perform cuff.leidong '..lockid..';perform cuff.leidong '..lockid..';perform cuff.leidong;wield wuji sword;jifa sword dugu-jiujian;set po '..lockweapon..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid
                                elseif heqi >= 480 then
                                        s9j = 'wield wuji sword;jifa sword huashan-jianfa;jifa parry huashan-jianfa;perform junzi;perform junzi;unwield jian;bei none;bei poyu-quan;perform cuff.leidong '..lockid..';perform cuff.leidong '..lockid..';wield wuji sword;jifa sword dugu-jiujian;set po '..lockweapon..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid
                                elseif heqi >= 400 then
                                        s9j = 'wield wuji sword;jifa sword huashan-jianfa;jifa parry huashan-jianfa;perform junzi;unwield jian;bei none;bei poyu-quan;perform cuff.leidong '..lockid..';perform cuff.leidong '..lockid..';wield wuji sword;jifa sword dugu-jiujian;set po '..lockweapon..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid
                                elseif heqi >= 280 then
                                        s9j = 'wield wuji sword;jifa sword huashan-jianfa;jifa parry huashan-jianfa;perform junzi;unwield jian;bei none;bei poyu-quan;perform cuff.leidong '..lockid..';wield wuji sword;jifa sword dugu-jiujian;set po '..lockweapon..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid
                                elseif heqi >= 240 then
                                        s9j = 'unwield jian;bei none;bei poyu-quan;perform cuff.leidong '..lockid..';wield wuji sword;jifa sword dugu-jiujian;set po '..lockweapon..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid
                                elseif heqi >= 160 then
                                        s9j = 'wield wuji sword;jifa sword huashan-jianfa;jifa parry huashan-jianfa;perform junzi;jifa sword dugu-jiujian;set po '..lockweapon..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid
                                else
                                        s9j = 'wield wuji sword;jifa sword dugu-jiujian;set po '..lockweapon..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid..';perform po '..lockid
                                end
                               
                                create_alias('yptpfm1','yptpfm1','alias p1 '..s9j )
                        end

                end

                exe('yptpfm1')
                exe('set wimpycmd p1\\hp;set wimpy 100')
        end
end
门派:不明
 楼主| 发表于 2016-12-5 01:19:09 | 显示全部楼层
8 , 漏了一个触发用的函数,这个是起手招数用掉后,全力击杀2个武士用

function yptPerformZongjue()
        yptPerform(0)
end
门派:不明
 楼主| 发表于 2016-12-5 01:24:32 | 显示全部楼层
9,下面几个函数精简一下

function ypt_kill_faint(n,l,w)
        exe('unset wimpy')
        if w[1]==sxjob.killer1 then
                exe('kill '..sxjob.id1)
                yptjob.name1='武士无威胁能力'
                if yptjob.name2 ~= '武士无威胁能力' then
                        yptPerform(2)
                end
        end

        if w[1]==sxjob.killer2 then
                exe('kill '..sxjob.id2)
                yptjob.name2='武士无威胁能力'
                if yptjob.name1~='武士无威胁能力' then
                        yptPerform(1)
                end
        end   
end

function ypt_kill_die(n,l,w)
        exe('set wimpy 100')
        if w[1]==sxjob.killer1 then
                yptjob.name1='武士无威胁能力'
                if yptjob.name2 ~= '武士无威胁能力' then
                        yptPerform(2)
                end
                wait.make(function()
                        wait.time(1)
                        exe('fight '.. sxjob.id2)
                        end)
         end

        if w[1]==sxjob.killer2 then
                yptjob.name2='武士无威胁能力'
                if yptjob.name1 ~= '武士无威胁能力' then
                        yptPerform(1)
                end
                wait.make(function()
                        wait.time(1)
                        exe('fight '.. sxjob.id1)
                end)
        end
end

function ypt_kill_over()

        EnableTrigger("ypt_weapon1",false)
        EnableTriggerGroup("ypt_weapon",false)
        fight.time.e=os.time()
        fight.time.over=fight.time.e-fight.time.b
        messageShowT('报效国家任务:当前死亡次数【'.. smydie ..'】次!杀死第【'..yptteam..'】组武士,战斗用时:【'..fight.time.over..'】秒。')
        print('正在颂摩崖任务中,当前死亡次数【'.. smydie ..'】次!杀死第【'.. yptteam ..'】组武士完成。设定杀死武士组数上限为【'.. smyteam ..'】组。')
        if yptteam*1 >= smyteam*1 then
                return check_halt(fangqiypt)
        end
        EnableTrigger("yptFight1",true)
        job.killer={}
        EnableTriggerGroup("yptdz",true)
        exe('yun jing;yun jingli;yun qi;hp')
        return check_busy(ckypt)
end
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-10-22 03:37 , Processed in 0.054547 second(s), 27 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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