最新最全最权威的各类手游,端游,页游游戏信息开服信息,尽在游民之家. 订阅微信

烈焰autorun.lua增了刷怪脚本却没刷新的解决方案

发表时间:2015-11-23 12:12点击人气:责任编辑:admin
autorun.lua 脚本所在文件夹GameServerscripts
有些GM问我,我在autorun.lua脚本内增加了定时刷怪的脚本.为何到点了却没有刷新出来呢?

我大概看了下该烈焰私服GM发给我的脚本。知道了问题所在。既然我遇到了,那就发出来给大家看看
      
if hour == 20 then
if min==30 then
            g_mon_gen(99,19,21,4020,5004,"元宝守卫",10,10,1);
            g_mon_gen(99,22,30,4021,5037,"元宝之王",2,5,1);
            g_alert("元宝之家BOSS已刷新.请各路勇士前往击杀",2,1000,0,1);
        end
end
初看这段代码没有任何问题 指定脚本在20:30分刷怪.是的,这段代码确实没有任何问题.
但是看代码不要只看这一段,要上下联系着判断.
我往上找,找到一段代码
    if hour == 20 then
        if min == 30 then
            if new == 1 then
                g_mon_gen(13,113,109,5410,5410,"九幽蛇王",1,0,1);
            end
            if new >= 2 and new <= 3 then
                g_mon_gen(13,113,109,5411,5410,"九幽蛇王",1,0,1);
            end
            if new >= 4 and new <= 6 then
                g_mon_gen(13,113,109,5412,5410,"九幽蛇王",1,0,1);
            end
            if new >= 7 and new <= 10 then
                g_mon_gen(13,113,109,5413,5410,"九幽蛇王",1,0,1);
            end
            if new >= 11 and new <= 15 then
                g_mon_gen(13,113,109,5414,5410,"九幽蛇王",1,0,1);
            end
            if new >= 16 and new <= 20 then
                g_mon_gen(13,113,109,5415,5410,"九幽蛇王",1,0,1);
            end
            if new >= 21 and new <= 27 then
                g_mon_gen(13,113,109,5416,5410,"九幽蛇王",1,0,1);
            end
            if new >= 28 and new <= 35 then
                g_mon_gen(13,113,109,5417,5410,"九幽蛇王",1,0,1);
            end
            if new >= 36 then
                g_mon_gen(13,113,109,5418,5410,"九幽蛇王",1,0,1);
            end
            g_broadcast(14,0,0,"九幽蛇王正在袭击皇城,请勇士们速速前往消灭!");
            g_openpanel(107,70);
            return;
        end
    end

可能有人会说,这段代码也没有问题.没错,没有问题。
但是这段和上段代码联系起来后,你会发现,2个时间都是一个点上。当然这个也不会引起问题。问题就在于,刷新九幽蛇王的代码在刷新元宝BOSS之前.
而且,刷新完就有蛇王,代码直接给返回 不再往下
 return;
这个才是关键所在.
想要元宝BOSS也在这个点刷新.那么请注视 return;

 --return;
这样就能解决该问题了.
以上内容由yeyo6.com -老MAN 原创发布,禁止转载.