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

烈焰充值元宝提取自动返利脚本的用途及修改方案

发表时间:2017-03-20 12:09点击人气:责任编辑:admin
烈焰充值提取自动返利脚本摘要
今天小编写这篇文章的目的是,不少烈焰的GM来问我,怎么样才可以让玩家充值元宝提取时,自动返利给他,省去手动操作的麻烦呢?小编略懂烈焰服务端的脚本.所以今天就来说说怎么改写这个功能实现.

首先,我们要知道,烈焰充值元宝后提取元宝是哪个部分的功能脚本实现的.所以先要找到这个文件lua.

在烈焰服务端scripts文件夹内,找到player.lua文件,用notepad++,或者editplus去打开,切记不要用记事本直接打开,这个小编已经提醒了好多次,下次就不再重复说这个注意点了.

然后我们使用快捷查找方式 CRTL+F 来调用查找窗口. 在查找目标的输入框内 输入

function OnUseVip(player,player_type,itemid,remain_time)

点击查找下一个,我们将会来到这个玩家点击提取元宝时触发的处理过程

function OnUseVip(player,player_type,itemid,remain_time)        --充值元宝触发
    local t = tonumber(os.date("%m%d",os.time()));
    player:set_param(333,player:get_param(333) + remain_time);
---------------------我是增加区域------------------------------

local new_rate = 10; ---设置返利的百分比 10即为10%,这个根据自己的服的情况定义
local new_bl = 10000; ---设置自己服的比例,这个根据自己的服的情况定义
local give_val = 100;--起送的金额是多少,这里设置为100元,记住哦,是金额,不是元宝数
---本次修改的提起元宝返利是以当天单笔充值的返利.下节课我们将讲解当天充值的返利

if (remain_time >= new_bl*give_val) then
   player:add_vcoin(remain_time/100*new_rate);
   g_alert("[<font color='#FF0000'>"..player:GetName().."</font>],充值超过"..give_val.."元,领取了"..(remain_time/100*new_rate).."返利元宝",2,1000,0,1);
else
player:alert(0,0,0,"真是可惜,本单只差"..(give_val*new_bl-remain_time)/new_bl.."元就可以领取返利元宝了");    
end

---------------------我是增加区域------------------------------
    if player:get_vcoin_worth() >= 20000000 and player_type <= 9 then
        player:set_vip_status(10,0,5);
        player:set_situ_revive_num(12);
        g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]成为本服VIP会员,充值1000元宝即可成为VIP会员哦",2,1000,0,1);
        return;
    end

    if player:get_vcoin_worth() >= 13000000 and player_type <= 8 then
        player:set_vip_status(9,0,5);
        player:set_situ_revive_num(10);
        g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]成为本服VIP会员,充值1000元宝即可成为VIP会员哦",2,1000,0,1);
        return;
    end

    if player:get_vcoin_worth() >= 9000000 and player_type <= 7 then
        player:set_vip_status(8,0,5);
        player:set_situ_revive_num(9);
        g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]成为本服VIP会员,充值1000元宝即可成为VIP会员哦",2,1000,0,1);
        return;
    end
    if player:get_vcoin_worth() >= 5000000 and player_type <= 6 then
        player:set_vip_status(7,0,5);
        player:set_situ_revive_num(8);
        g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]成为本服VIP会员,充值1000元宝即可成为VIP会员哦",2,1000,0,1);
        return;
    end
    if player:get_vcoin_worth() >= 3200000 and player_type <= 5 then
        player:set_vip_status(6,0,5);
        player:set_situ_revive_num(7);
        g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]成为本服VIP会员,充值1000元宝即可成为VIP会员哦",2,1000,0,1);
        return;
    end
    if player:get_vcoin_worth() >= 1600000 and player_type <= 4 then
        player:set_vip_status(5,0,5);
        player:set_situ_revive_num(6);
        g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]成为本服VIP会员,充值1000元宝即可成为VIP会员哦",2,1000,0,1);
        return;
    end
    if player:get_vcoin_worth() >= 800000 and player_type <= 3 then
        player:set_vip_status(4,0,5);
        player:set_situ_revive_num(5);
        g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]成为本服VIP会员,充值1000元宝即可成为VIP会员哦",2,1000,0,1);
        return;
    end
    if player:get_vcoin_worth() >= 400000 and player_type <= 2 then
        player:set_vip_status(3,0,5);
        player:set_situ_revive_num(4);
        g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]成为本服VIP会员,充值1000元宝即可成为VIP会员哦",2,1000,0,1);
        return;
    end
    if player:get_vcoin_worth() >= 200000 and player_type <= 1 then
        player:set_vip_status(2,0,5);
        player:set_situ_revive_num(3);
        g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]成为本服VIP会员,充值1000元宝即可成为VIP会员哦",2,1000,0,1);
        return;
    end
    if player:get_vcoin_worth() >= 1000 and player_type <= 0 then
        player:set_vip_status(1,0,5);
        player:set_situ_revive_num(2);
        g_alert("[<font color='#FF0000'>"..player:GetName().."</font>]成为本服VIP会员,充值1000元宝即可成为VIP会员哦",2,1000,0,1);
        return;
    end
end