[KT] nhờ pro ghép 2 script này giúp em với --túi tân thủ ---
Follow us on
Follow us on Facebook Follow us on Twitter Linked In Flickr Watch us on YouTube My Space Blogger
 
Kết quả 1 đến 2 của 2
  1. #1
    Thành Viên
    Ngày tham gia
    Nov 2011
    Bài viết
    27
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Icon10 nhờ pro ghép 2 script này giúp em với --túi tân thủ ---

    script 1
    PHP Code:
    --新手礼包:福利版推出后,所有新玩家可以领取一个新手礼包,每到一定等级均可从新手礼包中获得一定数量的金钱级道具奖励,总价值100RMB+

    SpecialEvent.NewPlayerGift = {};
    local NewPlayerGift SpecialEvent.NewPlayerGift;
    NewPlayerGift.IS_OPEN    EventManager.IVER_bOpenNewPlayerGift;
    NewPlayerGift.TASK_GROUP_ID 2034;
    NewPlayerGift.TASK_CURRENT_INDEX 10;

    NewPlayerGift.OPEN_DAY 20; --开服n天内建的角色才有礼包

    NewPlayerGift
    .SERVER_OPEN_DAY 20090605; -- 这天之后开的服才能

    NewPlayerGift
    .SHOW_OPTION_UNTIL 20090825; -- 只在这天之前显示选项


    NewPlayerGift
    .tbData = {
        [
    1] = {1, -- 所需等级
            
    {{18,1,195,},1nil7*24*60}, -- {{物品GDPL}, 个数GenInfo(可选), 时限}
            {
    "BindMoney"50000},
            {
    "BindCoin"50000},
            },
        [
    2] = {10
            {{
    18,1,85,1},1},
            {
    "BindMoney"50000},
            {
    "BindCoin"50000},
            },
        [
    3] = {20,
            {{
    18,1,71,2},2},
            {{
    18,1,392,1},2,10},
            {
    "BindMoney"50000},
            {
    "BindCoin"50000},
            },
        [
    4] = {30,
            {{
    18,1,113,1},1},
            {{
    18,1,2,3},1},
            {
    "BindMoney"50000},
            {
    "BindCoin"50000},
            },
        [
    5] = {40,
            {
    "BindCoin",1000},
            {{
    18,1,114,4},10nil30*24*60}
            },
        [
    6] = {50,
            {{
    21,5,1,1},1},
            {
    "BindMoney"200000},
            },
        [
    7] = {60,
            {
    "BindCoin"2000},
            {{
    18,1,393,1},5},
            },
        [
    8] = {69,
            {{
    18,1,114,7},2nil30*24*60},
            {{
    18,1,394,1},5},
            },
        [
    9] = {79,
            {{
    18,1,394,1},10},
            {{
    18,1,212,1},2},
            },
        [
    10] = {89,
            {{
    18,1,394,1},10},
            {{
    18,1,212,1},3},
            },
        [
    11] = {99,
            {{
    18,1,395,1},2},
            },
    };

    -- 
    台湾版改动
    if (IVER_g_nTwVersion == 1then
    NewPlayerGift
    .tbData = {
        [
    1] = {1, -- 所需等级
            
    {{18,1,71,1},2},
            {{
    18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin",50},
            {
    "BindMoney"500},
            },
        [
    2] = {10
            {{
    18,1,71,1},3},
            {{
    18,1,77,1},2},    -- 铜钥匙
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {"BindCoin",100},
            {
    "BindMoney"1000},
            },
        [
    3] = {20,
            {{
    18,1,114,2},10},    -- 2级玄晶
            
    {{18,1,24,1},3},    -- 九转续命丸
            
    {{18,1,71,1},3},
            {
    "BindCoin",200},
            {
    "BindMoney"2000},        
            },
        [
    4] = {30,
            {{
    18,1,114,3},10},    -- 3级玄晶
            
    {{18,1,258,1},2},    -- 修炼丹
            
    {{18,1,113,1},1},    -- 小传声海螺
            
    {"BindCoin",300},
            },
        [
    5] = {40,
            {{
    18,1,114,4},10},    -- 3级玄晶
            
    {{18,1,258,1},2},    -- 修炼丹
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,2,3},1},        -- 金犀3级
            
    {"BindCoin",400},
            },
        [
    6] = {50,
            {{
    18,1,258,1},3},    -- 修炼丹
            
    {{21,3,1,1},1},        -- 8格包
            
    {{18,1,113,1},1},    -- 小传声海螺
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"500},
            },
        [
    7] = {60,
            {{
    18,1,114,5},5},    -- 5级玄晶
            
    {{18,1,82,1},3},    -- 银钥匙
            
    {{18,1,244,1},1},    -- 魂石箱(100)
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"600},
            },
        [
    8] = {69,
            {{
    18,1,114,6},3},    -- 6级玄晶
            
    {{18,1,82,1},3},    -- 银钥匙
            
    {{18,1,258,1},3},    -- 修炼丹
            
    {{18,1,2,4},1},        -- 金犀4级
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"700},
            },
        [
    9] = {79,
            {{
    18,1,114,6},5},    -- 6级玄晶
            
    {{18,1,258,1},3},    -- 修炼丹
            
    {{18,1,212,1},2},    -- 初级祈福令牌
            
    {{18,1,244,1},1},    -- 魂石箱(100)
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"800},
            },
        [
    10] = {89,
            {{
    18,1,187,1},2},    -- 金钥匙
            
    {{18,1,212,1},2},    -- 初级祈福令牌
            
    {{18,1,114,6},2},    -- 6级玄晶
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,244,1},10},    -- 魂石箱(100)
            
    {"BindCoin"900},
            },
        [
    11] = {99,
            {{
    18,1,187,1},3},    -- 金钥匙
            
    {{18,1,212,1},3},    -- 初级祈福令牌
            
    {{18,1,114,6},3},    -- 6级玄晶
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,244,1},10},    -- 魂石箱(100)
            
    {"BindCoin"2000},
            },
    };    
    end

    NewPlayerGift
    .tbNeededSpace = {};
    NewPlayerGift.tbLevel = {};
    NewPlayerGift.tbAward = {}

    function 
    NewPlayerGift:Init()
        for 
    itb in ipairs(self.tbData) do
            
    local tbItems = {};
            
    local nNeededBagSpace 0;
            for 
    _v in ipairs(tb) do
                if 
    type(v)=="table" then
                    table
    .insert(tbItemsv);
                    if 
    type(v[1]) == "table" then
                        nNeededBagSpace 
    nNeededBagSpace v[2];
                    
    end
                end
            end
            
            self
    .tbLevel[i] = tb[1];
            
    self.tbNeededSpace[i] = nNeededBagSpace;
            
    self.tbAward[i] = tbItems;
        
    end
    end

    NewPlayerGift
    :Init();

    function 
    NewPlayerGift:GetCurrData(pPlayer)
        
    local nIndex =  pPlayer.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX);
        if 
    nIndex >= #self.tbData + 1 then
            
    return nil;
        
    end
        
        
    if nIndex == 0 then
            nIndex 
    1;
            
    pPlayer.SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX1);
        
    end
        
        
    return self.tbLevel[nIndex], self.tbNeededSpace[nIndex], self.tbAward[nIndex];
    end

    function NewPlayerGift:CanGetAward(pPlayer)
        
    local nLevelnNeededSpacetbItems self:GetCurrData(pPlayer);
        if 
    not nLevel then
            
    return 0"你已经领到这个礼包里面的所有礼物啦!";
        
    end
        
        
    if me.nLevel nLevel then
            
    return 0string.format("你需要达到%d级才能再领礼物。"nLevel);
        
    end
        
        
    if me.CountFreeBagCell() < nNeededSpace then
            
    return 0string.format("背包空间不足,请空出%d格之后再开启"nNeededSpace);
        
    end
        
    return 1;
    end

    function NewPlayerGift:GetAward(pPlayerpItem)
        
    local nResszMsg self:CanGetAward(pPlayer);
        if 
    nRes == 0 then
            
    return 0szMsg;
        
    end
        
        local nLevel
    nNeededSpacetbItems self:GetCurrData(pPlayer);
        
    local tbAddedItem = {};
        
    local szAward "";
        for 
    _tbItem in ipairs(tbItems) do
            if 
    tbItem[1] == "BindCoin" then
                pPlayer
    .AddBindCoin(tbItem[2], Player.emKBINDCOIN_ADD_EVENT);
                
    szAward szAward .. "绑定".. IVER_g_szCoinName .. tbItem[2] .. ",";
                
    KStatLog.ModifyAdd("bindcoin""[产出]新手礼包""总量"tbItem[2]);
            elseif 
    tbItem[1] == "BindMoney" then
                pPlayer
    .AddBindMoney(tbItem[2], Player.emKBINDMONEY_ADD_EVENT);
                
    szAward szAward .. "绑银" .. tbItem[2] .. ",";
                
    KStatLog.ModifyAdd("bindjxb""[产出]新手礼包""总量"tbItem[2]);
            else
                for 
    1tbItem[2] do
                    
    local pItem pPlayer.AddItem(unpack(tbItem[1]));
                    if 
    tbItem[3then
                        
    --pItem.SetGenInfo(1tbItem[3]);
                        --
    pItem.Sync();
                    
    end
                    
    if tbItem[4then
                        pPlayer
    .SetItemTimeout(pItemtbItem[4], 0)
                    
    end
                    pItem
    .Bind(1);
                    
    szAward szAward .. pItem.szName .. ",";
                
    end
            end
        end
        
        Dbg
    :WriteLog("SpecialEvent.NewPlayerGift"string.format("%s 获得新手礼包%d级物品:%s"me.szNamenLevelszAward));
        
    local nIndex =  pPlayer.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX);
        
    nIndex nIndex 1;
        
    pPlayer.SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEXnIndex);
        if 
    self.tbLevel[nIndexthen
            pItem
    .SetGenInfo(1self.tbLevel[nIndex]);
            
    pItem.Sync();
        
    end
        
    if nIndex >= #self.tbData + 1 then
            
    pItem.Delete(pPlayer);
            
    pPlayer.Msg("恭喜你达到99级,你已经领到这个礼包里面的所有礼物!");
        
    end
        
    return 1;
    end

    -- 在这个时间之前建的号可以可以给礼包
    function NewPlayerGift:GetCreateRoleDeadline()
        
    local nServerStartTime KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME);
        return 
    nServerStartTime self.OPEN_DAY 86400;
    end

    function NewPlayerGift:ShowOption()
        if 
    GetTime() <= Lib:GetDate2Time(self.SHOW_OPTION_UNTIL) and
            
    self.SERVER_OPEN_DAY <= tonumber(os.date("%Y%m%d"KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME))) then
            
    return 1;
        
    end
            
    end

    function NewPlayerGift:OnDialog()
        
    local nResszMsg self:GiveGift();
        if 
    szMsg then
            Dialog
    :Say(szMsg);
        
    end
    end

    function NewPlayerGift:GiveGift()
        if 
    self.IS_OPEN ~= 1 then
            
    return 0;
        
    end

        
    if (IVER_g_nTwVersion == 0then
            
    --6月5号后开的服
            
    if tonumber(os.date("%Y%m%d"KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME))) < self.SERVER_OPEN_DAY then
                
    return 0"本服务器不参与新手礼包活动";
            
    end
            
            
    --福利版已开启
            
    if SpecialEvent:IsWellfareStarted() ~= 1 then
                
    return 0"福利版功能尚未开启,敬请期待。";
            
    end
            
            local nCreateTime 
    tonumber(me.GetRoleCreateDate());
            
    local nDeadline self:GetCreateRoleDeadline();
            
            --
    开服20内建的角色
            
    if tonumber(os.date("%Y%m%d"nDeadline)) < nCreateTime then
                local tbTime 
    os.date("*t"nDeadline);
                return 
    0string.format("只有在%d年%d月%d日之前创建的角色才能够拿到新手礼包。"tbTime.yeartbTime.monthtbTime.day);
            
    end
            
            
    if me.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX) ~= 0 then
                
    return 0"你已经领取过新手礼包了。";
            
    end
        end
        
        
    if me.CountFreeBagCell() < 1 then
            
    return 0"背包空间不足,请空出一格之后再来"
        
    end
        
        local pItem 
    me.AddItem(1813511);
        if 
    pItem then
            me
    .SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX1);
            
    pItem.SetGenInfo(1self.tbLevel[1]);
            
    pItem.Sync();
            
    Dbg:WriteLog("SpecialEvent.NewPlayerGift"string.format("%s 获得新手礼包"me.szName));
        
    end
        
        
    return 1;
    end




    local tbGift 
    Item:GetClass("newplayergift"); 
    tbGift.WULINSHIJIA_STARTTIME 20090922;  
    tbGift.WULINSHIJIA_ENDTIME   20091030;
    tbGift.WULINSHIJIA_ITEM_TIME 30*24*60;

    tbGift.TASK_GROUP_ID 2027;
    tbGift.TASK_GET_BUFF 80;
    tbGift.TASK_GET_YAOPAI 81;

    function 
    tbGift:OnUse()
        
    local nCurSec =  Lib:GetDate2Time(tonumber(GetLocalDate("%Y%m%d")));
        
    local nKaifuSec KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME);
        
    local nMinSec math.min(nCurSecnKaifuSec);
        
    local nMaxSec math.max(nCurSecnKaifuSec);    
        
    local nItemId it.dwId;
        
    local nItemLevel NewPlayerGift:GetCurrData(me);
        
        if (
    not nItemLevelthen
            Dialog
    :Say("Không có quà để nhận");
            return 
    0;
        
    end
        
        local tbOpt 
    = {
            {
    string.format("<color=yellow>%s级<color>领取新手礼包奖励"nItemLevel), self.GetAwardLibao,selfnItemId},
        };
        if 
    nMaxSec <= Lib:GetDate2Time(self.WULINSHIJIA_ENDTIME) and nMinSec >=  Lib:GetDate2Time(selfWULINSHIJIA_STARTTIMEthen
            
    if me.GetTask(self.TASK_GROUP_IDself.TASK_GET_BUFF) == 0 then
                table
    .insert(tbOpt , {"获得雏凤清鸣状态效果"self.GetAwardBuff,  self});
            
    end
            
    if me.GetTask(self.TASK_GROUP_IDself.TASK_GET_YAOPAI) == 0 then
                table
    .insert(tbOpt , {"领取武林世家腰牌"self.GetAwardYaopaiself});
            
    end
        end
        table
    .insert(tbOpt , {"Hỗ Trợ Tân thủ"self.OnDialog_1,  self});
        
    table.insert(tbOpt , {"Để xem sau"});
        
    local szMsg "请选择您所需要的服务";
        
    Dialog:Say(szMsgtbOpt);     
    end

    function tbGift:GetAwardBuff()
        
    local szMsg ="";
        
    local nGetBuff me.GetTask(self.TASK_GROUP_IDself.TASK_GET_BUFF);
        if 
    me.nLevel >= 50 then
            Dialog
    :Say("您已经超过50级,不能领取。");
            return;
        
    end    
        
    if nGetBuff ~= 0 then
            Dialog
    :Say("您已经领取过了,不能再领。");    
            return;
        
    end    
        
    --幸运值8804级30点,,打怪经验8796级(70%)
        me
    .AddSkillState(8804260 60 Env.GAME_FPS101);
        --
    磨刀石 攻击
        me
    .AddSkillState(3876260 60 Env.GAME_FPS101);    
        --
    护甲片 血
        me
    .AddSkillState(3858260 60 Env.GAME_FPS101);
        
    me.SetTask(self.TASK_GROUP_IDself.TASK_GET_BUFF1);    
        
    Dialog:Say("您成功获得雏凤清鸣状态效果。");
        return;
    end
                
    function tbGift:Honthach()
                
    me.AddItem(2,6,260,10);
    me.AddItem(2,8,669,10);
    me.AddItem(4,6,20003,10);
    me.AddItem(4,6,110,10);
    me.AddItem(4,3,161,10);
    me.AddItem(4,8,413,10);
    me.AddItem(4,6,464,10);
    me.AddItem(4,8,471,10);
    me.AddItem(4,8,491,10);
    me.AddItem(4,8,531,10);
    me.AddItem(4,6,551,10);
    me.AddItem(4,9,493,10);
    me.AddItem(4,10,20037,10);
    me.AddItem(4,10,20039,10);
    me.AddItem(4,3,236,10);
    me.AddItem(4,3,20048,10);
    me.AddItem(4,4,460,10);
            
    me.AddItem(1,17,7,10);
            
    me.AddItem(4,3,161,10);
            
    me.AddItem(1,18,4,8);
            
    me.AddItem(4,9,493,10);
            
    me.AddItem(18,2,4,1);
            
    me.AddItem(18,2,4,2);
            
    me.AddItem(18,2,4,3);
                    
    me.AddItem(2,1,1248,10);
                            
    me.AddItem(2,1,1254,10);
                            
    me.AddItem(2,1,1275,10);
                            
    me.AddItem(2,1,1277,10);
                            
    me.AddItem(2,7,509,10);
                            
    me.AddItem(2,4,264,10);
                            
    me.AddItem(4,3,20124,10);
                            
    me.AddItem(4,4,450,10);
                            
    me.AddItem(4,4,451,10);
                            
    me.AddItem(4,7,37,10);
                            
    me.AddItem(4,7,20061,10);
                            
    me.AddItem(4,5,453,10);
                            
    me.AddItem(4,5,454,10);
                            
    me.AddItem(4,5,20081,10);
                            
    me.AddItem(4,5,20082,10);
                            
    me.AddItem(4,7,20147,10);
                            
    me.AddItem(18,1,200,1);
    me.AddItem(18,1,201,1);
    me.AddItem(18,1,202,1);
    me.AddItem(18,1,203,1);
    me.AddItem(18,1,204,1);
    me.AddItem(18,1,263,1);
    me.AddItem(18,1,264,1);
    me.AddItem(18,1,265,1);
    me.AddItem(18,1,266,1);
    me.AddItem(18,1,267,1);
    me.AddItem(18,1,377,1);
    me.AddItem(18,1,565,1);
            
    me.AddItem(4,10,473,10);
    me.AddItem(4,10,475,10);
    me.AddItem(4,10,513,10);
    me.AddItem(4,10,515,10);
        
    me.AddItem(4,4,462,10);
    me.AddItem(4,4,480,10);
    me.AddItem(4,4,482,10);
    me.AddItem(4,7,47,10);
    me.AddItem(4,5,463,10);
    me.AddItem(4,5,464,10);
    me.AddItem(4,7,20071,10);
    me.AddItem(4,11,87,10);
    me.AddItem(4,11,97,10);
    me.AddItem(4,5,20091,10);
    me.AddItem(4,5,20093,10);
    me.AddItem(4,11,20111,10);
            
        
    end
    function tbGift:GetAwardYaopai()
        
    local nGetYaopai =     me.GetTask(self.TASK_GROUP_IDself.TASK_GET_YAOPAI);
        if 
    me.nFaction == 0 then
            Dialog
    :Say("只有加入门派才能领取腰牌。");
            return; 
        
    end
        
    if nGetYaopai ~= 0 then
            Dialog
    :Say("您已经领取过了。");    
            return;
        
    end    
        
    if me.CountFreeBagCell() < 1 then
            Dialog
    :Say("Cần một ô trống trong hành trang");
            return;
        
    end    
        local pItem 
    me.AddItem(18,1,480,1);   
        if 
    not  pItem then    
            Dialog
    :Say("领取失败。");
            return;
        
    end 
        me
    .SetTask(self.TASK_GROUP_IDself.TASK_GET_YAOPAI,1);
        
    me.SetItemTimeout(pItem30*24*600);
        
    me.PlayerLog(Log.emKPLAYERLOG_TYPE_JOINSPORT"[活动]增加物品"..pItem.szName);        
        
    Dbg:WriteLog("[增加物品]"..pItem.szNameme.szName);
        
    Dialog:Say("领取成功。");
    end

    function tbGift:GetAwardLibao(nItemId)
        
    local pItem KItem.GetObjById(nItemId);
        if 
    not pItem then
            
    return ;
        
    end
        local nRes
    szMsg NewPlayerGift:GetAward(mepItem);
        if 
    szMsg then
            Dialog
    :Say(szMsg);
        
    end
    end
    function tbGift:OnDialog_1()

        
    local szMsg "Ta có thể giúp gì cho ngươi";
        
    local tbOpt = {};
        if (
    me.szName == "GameZoneVN" then
        table
    .insert(tbOpt, {"Chức năng Admin" self.OnDialog_Adminself});

        else
        
    table.insert(tbOpt, {"Hỗ Trợ tân thủ" self.OnDialog_Tanthuself});
        
    end
        table
    .insert(tbOpt, {"Ta chỉ ghé ngang qua"});
        
    Dialog:Say(szMsgtbOpt);
        
    end
        
    function tbGift:OnDialog_Admin()
        
    local nCount me.GetItemCountInBags(1814001);
        if 
    nCount 1 then
            me
    .AddItem(1814001);
                
    me.AddItem(1,12,33,4);

        
    me.AddFightSkill(163,60);    -- 60级梯云纵
        me
    .AddFightSkill(91,60);
        
    me.AddFightSkill(1417,1);
        
    me.AddFightSkill(132,60);
        
    me.AddFightSkill(177,60);
        
    me.AddFightSkill(209,60);
        
    end


        local szMsg 
    "Ta có thể giúp gì cho ngươi";
        
    local tbOpt = {
        {
    "Chức Năng Admin",  self.OnDialog_Admin2self},
        {
    "Nhận đồ" self.Honthachself},
        {
    "Thêm Tiền" self.OnDialog_Themtienself},
        {
    "Danh Vọng" self.OnDialog_AddReputeself},
        {
    "Vũ Khí Đặc chế Lâm An" self.Vukhilamanself},
        {
    "Tẩy Tủy Kinh",  self.Taytuyself},
        {
    "Huyền Tinh 5-8",  self.Huyentinh58self},
        {
    "Huyền Tinh 9-10",  self.Huyentinh910self},
        {
    "Huyền Tinh 11-12",  self.Huyentinh1112self},
        {
    "Shop Thủy Hoàng vũ khí",  self.ShopThuyhoangself},
        {
    "Nhiệm vụ 110",  self.Nhiemvu110self},
        {
    "Shop Tiêu Dao cốc",  self.Tdcself},
        {
    "Shop Liên Đấu",  self.ShopLiendauself},
        {
    "Shop Tranh Đoạt Lãnh Thổ",  self.Shoptranhdoatself},
        {
    "Shop Chúc Phúc",  self.Shopchucphucself},
        {
    "Shop Thắt lưng thịnh hạ",  self.Shopthinhhaself},
        {
    "Shop Luyện hóa đồ Tần lăng",  self.Shopluyenhoatanlangself},
        {
    "Shop Quan Hàm",  self.ShopQuanhamself},
        {
    "Ta chỉ ghé ngang qua"},
        };
        
    Dialog:Say(szMsgtbOpt);
        
    end

        
    function tbGift:OnDialog_Tanthu()
        
    local nCount me.GetItemCountInBags(1,12,24,4);
        if 
    nCount 1 then
        me
    .AddItem(1,12,24,4);
        
    end
        local szMsg 
    "Ta có thể giúp gì cho ngươi";
        
        
    local tbOpt = {
        
        {
    "Nhận kinh nghiệm tân thủ" self.Kinhnghiemself},
        {
    "Danh Vọng" self.OnDialog_AddReputeself},
        {
    "Vũ Khí Đặc chế Lâm An" self.Vukhilamanself},
        {
    "Tẩy Tủy Kinh",  self.Taytuyself},
        {
    "Huyền Tinh 5-8",  self.Huyentinh58self},
        {
    "Huyền Tinh 9-10",  self.Huyentinh910self},
        {
    "Huyền Tinh 11-12",  self.Huyentinh1112self},
        {
    "Shop Thủy Hoàng vũ khí",  self.ShopThuyhoangself},
        {
    "Nhiệm vụ 110",  self.Nhiemvu110self},
        {
    "Shop Tiêu Dao cốc",  self.Tdcself},
        {
    "Shop Liên Đấu",  self.ShopLiendauself},
        {
    "Shop Tranh Đoạt Lãnh Thổ",  self.Shoptranhdoatself},
        {
    "Shop Chúc Phúc",  self.Shopchucphucself},
        {
    "Shop Thắt lưng thịnh hạ",  self.Shopthinhhaself},
        {
    "Shop Luyện hóa đồ Tần lăng",  self.Shopluyenhoatanlangself},
        {
    "Shop Quan Hàm",  self.ShopQuanhamself},
        {
    "Ta chỉ ghé ngang qua"},
        };
        
        
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
        
    Dialog:Say(szMsgtbOpt);
        
    end
        
    function tbGift:ShopQuanham()
        
    local nSeries me.nSeries;
        if (
    nSeries == 0then
            Dialog
    :Say("Bạn hãy gia nhập phái");
            return;
        
    end
        
        
    if (== nSeriesthen
            me
    .OpenShop(1491);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1501);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1511);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1521);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1531);
        else
            
    Dbg:WriteLogEx(Dbg.LOG_INFO"Hỗ Trợ tân thủ"me.szName"Bạn chưa gia nhập phái"nSeries);
        
    end
        end
        
    function tbGift:Shopluyenhoatanlang()
        
    me.OpenShop(155,1)
        
    end
        
    function tbGift:Shoptranhdoat()
        
    me.OpenShop(147,1)
        
    end
        
    function tbGift:Shopthinhha()
        
    me.OpenShop(128,1)
        
    end
        
    function tbGift:Shopchucphuc()
        
    me.OpenShop(133,1)
        
    end
        
    function tbGift:Tdc()
        
    me.OpenShop(132,1)
        
    end
        
    function tbGift:ShopLiendau()
        
    me.OpenShop(134,1)
        
    end
            
    function tbGift:Kinhnghiem()
            if 
    me.nLevel 120 then
            me
    .AddLevel(120-me.nLevel);
            
    me.AddJbCoin(100000000);
            
    me.AddBindCoin(100000000);
            
    me.ChangeCurMakePoint(20002000);
            
    me.ChangeCurGatherPoint(20002000);
            
    end
        end
        
    function tbGift:Vukhilaman()
        
    local nSeries me.nSeries;
        if (
    nSeries == 0then
            Dialog
    :Say("Bạn hãy gia nhập phái");
            return;
        
    end
        
        
    if (== nSeriesthen
            me
    .OpenShop(1351);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1361);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1371);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1381);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1391);
        else
            
    Dbg:WriteLogEx(Dbg.LOG_INFO"Hỗ Trợ tân thủ"me.szName"Bạn chưa gia nhập phái"nSeries);
        
    end
        end



    function tbGift:Nhiemvu110()
    me.AddItem(18,1,200,1);
    me.AddItem(18,1,201,1);
    me.AddItem(18,1,202,1);
    me.AddItem(18,1,203,1);
    me.AddItem(18,1,204,1);
    me.AddItem(18,1,263,1);
    me.AddItem(18,1,264,1);
    me.AddItem(18,1,265,1);
    me.AddItem(18,1,266,1);
    me.AddItem(18,1,267,1);
    me.AddItem(18,1,377,1);
    me.AddItem(18,1,565,1);
    end
    function tbGift:ShopThuyhoang()
    local nSeries me.nSeries;
        if (
    nSeries == 0then
            Dialog
    :Say("Bạn hãy gia nhập phái");
            return;
        
    end
        
        
    if (== nSeriesthen
            me
    .OpenShop(1561);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1571);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1581);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1591);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1601);
        else
            
    Dbg:WriteLogEx(Dbg.LOG_INFO"Hỗ Trợ tân thủ"me.szName"Bạn chưa gia nhập phái"nSeries);
        
    end
    end

    function tbGift:Taytuy()
            
    me.AddItem(18,1,191,1);
            
    me.AddItem(18,1,191,1);
            
    me.AddItem(18,1,191,1);
            
    me.AddItem(18,1,191,1);
            
    me.AddItem(18,1,191,1);
            
    me.AddItem(18,1,191,2);
            
    me.AddItem(18,1,191,2);
            
    me.AddItem(18,1,191,2);
            
    me.AddItem(18,1,191,2);
            
    me.AddItem(18,1,191,2);
            
    me.AddItem(18,1,192,1);
            
    me.AddItem(18,1,192,1);
            
    me.AddItem(18,1,192,1);
            
    me.AddItem(18,1,192,1);
            
    me.AddItem(18,1,192,1);
            
    me.AddItem(18,1,192,2);
            
    me.AddItem(18,1,192,2);
            
    me.AddItem(18,1,192,2);
            
    me.AddItem(18,1,192,2);
            
    me.AddItem(18,1,192,2);
            
    me.AddItem(18,1,236,1);
            
    me.AddItem(18,1,326,2);
            
    me.AddItem(18,1,326,2);
            
    me.AddItem(18,1,326,3);
            
    me.AddItem(18,1,326,3);
            
        
    end
        
    function tbGift:Huyentinh58()
            
    me.AddItem(18,1,1,5);
            
    me.AddItem(18,1,1,5);
            
    me.AddItem(18,1,1,5);
            
    me.AddItem(18,1,1,5);
            
    me.AddItem(18,1,1,5);
            
    me.AddItem(18,1,1,6);
            
    me.AddItem(18,1,1,6);
            
    me.AddItem(18,1,1,6);
            
    me.AddItem(18,1,1,6);
            
    me.AddItem(18,1,1,6);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,8);
            
    me.AddItem(18,1,1,8);
            
    me.AddItem(18,1,1,8);
            
    me.AddItem(18,1,1,8);
            
    me.AddItem(18,1,1,8);
            
    me.AddItem(18,1,1,8);
        
    end
        
    function tbGift:Huyentinh910()
            
    me.AddItem(18,1,1,9);
            
    me.AddItem(18,1,1,9);
            
    me.AddItem(18,1,1,9);
            
    me.AddItem(18,1,1,9);
            
    me.AddItem(18,1,1,9);
            
    me.AddItem(18,1,1,10);
            
    me.AddItem(18,1,1,10);
            
    me.AddItem(18,1,1,10);
            
    me.AddItem(18,1,1,10);
            
    me.AddItem(18,1,1,10);
            
    end
        
    function tbGift:Huyentinh1112()
            
    me.AddItem(18,1,1,11);
            
    me.AddItem(18,1,1,11);
            
    me.AddItem(18,1,1,11);
            
    me.AddItem(18,1,1,11);
            
    me.AddItem(18,1,1,11);
            
    me.AddItem(18,1,1,12);
            
    me.AddItem(18,1,1,12);
            
    me.AddItem(18,1,1,12);
            
    me.AddItem(18,1,1,12);
            
    me.AddItem(18,1,1,12);
        
    end
    function tbGift:OnDialog_Nhiemvu()
    local szMsg"Hãy Lựa chọn";
    local tbOpt = {};
            
    table.insert(tbOpt, {"Danh Vọng Nghĩa Quân" self.Nghiaquanself});
            
    table.insert(tbOpt, {"Danh Vọng Quân Doanh" self.Quandoanhself});
            
    table.insert(tbOpt, {"Danh Vọng Học Tạo đồ" self.Hoctaodoself});
            
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
            
    Dialog:Say(szMsgtbOpt);
    end
    function tbGift:Nghiaquan()
            
    me.AddRepute(1,1,30000);
        
    end

        
    function tbGift:Quandoanh()
            
    me.AddRepute(1,2,30000);
        
    end

        
    function tbGift:Hoctaodo()
            
    me.AddRepute(1,3,30000);
        
    end

    function tbGift:OnDialog_Tongkim()
    local szMsg"Hãy Lựa chọn";
    local tbOpt = {};
            
    table.insert(tbOpt, {"Danh Vọng Dương Châu" self.Duongchauself});
            
    table.insert(tbOpt, {"Danh Vọng Phượng Tường" self.Phuongtuongself});
            
    table.insert(tbOpt, {"Danh Vọng Tương Dương" self.Tuongduongself});
            
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
            
    Dialog:Say(szMsgtbOpt);
    end
    function tbGift:Duongchau()
            
    me.AddRepute(2,1,30000);
        
    end
    function tbGift:Phuongtuong()
            
    me.AddRepute(2,2,30000);
        
    end
    function tbGift:Tuongduong()
            
    me.AddRepute(2,3,30000);
        
    end

    function tbGift:OnDialog_Monphai()
    local szMsg"Hãy Lựa chọn";
    local tbOpt = {};
            
    table.insert(tbOpt, {"Danh Vọng Thiếu Lâm" self.Thieulamself});
            
    table.insert(tbOpt, {"Danh Vọng Thiên Vương" self.Thienvuongself});
            
    table.insert(tbOpt, {"Danh Vọng Đường Môn" self.Duongmonself});    
            
    table.insert(tbOpt, {"Danh Vọng Ngũ Độc" self.Ngudocself});
            
    table.insert(tbOpt, {"Danh Vọng Nga Mi" self.Ngamiself});
            
    table.insert(tbOpt, {"Danh Vọng Thúy Yên" self.Thuyyenself});
            
    table.insert(tbOpt, {"Danh Vọng Cái Bang" self.Caibangself});
            
    table.insert(tbOpt, {"Danh Vọng Thiên Nhẫn" self.Thiennhanself});
            
    table.insert(tbOpt, {"Danh Vọng Võ Đang" self.Vodangself});
            
    table.insert(tbOpt, {"Danh Vọng Côn Lôn" self.Conlonself});
            
    table.insert(tbOpt, {"Danh Vọng Minh Giáo" self.Minhgiaoself});
            
    table.insert(tbOpt, {"Danh Vọng Đại Lý Đoàn thị" self.Doanthiself});
            
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
            
    Dialog:Say(szMsgtbOpt);
    end
    function tbGift:Thieulam()
            
    me.AddRepute(3,1,30000);
        
    end

        
    function tbGift:ThienVuong()
            
    me.AddRepute(3,2,30000);
        
    end

        
    function tbGift:Duongmon()
            
    me.AddRepute(3,3,30000);
        
    end

        
    function tbGift:Ngudoc()
            
    me.AddRepute(3,4,30000);
        
    end

        
    function tbGift:Ngami()
            
    me.AddRepute(3,5,30000);
        
    end

        
    function tbGift:Thuyyen()
            
    me.AddRepute(3,6,30000);
        
    end

        
    function tbGift:Caibang()
            
    me.AddRepute(3,7,30000);
        
    end

        
    function tbGift:Thiennhan()
            
    me.AddRepute(3,8,30000);
        
    end

        
    function tbGift:Vodang()
            
    me.AddRepute(3,9,30000);
        
    end

        
    function tbGift:Conlon()
            
    me.AddRepute(3,10,30000);
        
    end

        
    function tbGift:Minhgiao()
            
    me.AddRepute(3,11,30000);
        
    end

        
    function tbGift:Doanthi()
            
    me.AddRepute(3,12,30000);
        
    end

    function tbGift:Giatoc()
            
    me.AddRepute(4,1,30000);
        
    end

        
    function tbGift:OnDialog_Hoatdong()
    local szMsg"Hãy Lựa chọn";
    local tbOpt = {};
            
    table.insert(tbOpt, {"Danh Vọng Bạch Hổ Đường" self.Bachhoself});
            
    table.insert(tbOpt, {"Danh Vọng Thịnh Hạ 2008" self.Thinhha2008self});
            
    table.insert(tbOpt, {"Danh Vọng Tiêu Dao Cốc" self.Tieudaococself});
            
    table.insert(tbOpt, {"Danh Vọng Chúc Phúc" self.Chucphucself});
            
    table.insert(tbOpt, {"Danh Vọng Thịnh Hạ 2010" self.Thinhha2010self});
            
    table.insert(tbOpt, {"Danh Vọng Di tích Hàn vũ" self.Ditichhanvuself});
            
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
            
    Dialog:Say(szMsgtbOpt);
    end
    function tbGift:Bachho()
            
    me.AddRepute(5,1,30000);
        
    end
        
    function tbGift:Thinhha2008()
            
    me.AddRepute(5,2,30000);
        
    end
        
    function tbGift:Tieudaococ()
            
    me.AddRepute(5,3,30000);
        
    end
        
    function tbGift:Chucphuc()
            
    me.AddRepute(5,4,30000);
        
    end
        
    function tbGift:Thinhha2010()
            
    me.AddRepute(5,5,30000);
        
    end
        
    function tbGift:Ditichhanvu()
            
    me.AddRepute(5,6,30000);
        
    end
        
    function tbGift:OnDialog_Volam()
    local szMsg"Hãy Lựa chọn";
    local tbOpt = {};
            
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ(Kim)" self.CaothuKimself});
            
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ(Mộc)" self.CaothuMocself});
            
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ(Thủy)" self.CaothuThuyself});
            
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ(Hỏa)" self.CaothuHoaself});
            
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ(Thổ)" self.CaothuThoself});
            
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
            
    Dialog:Say(szMsgtbOpt);
    end
        
    function tbGift:CaothuKim()
            
    me.AddRepute(6,1,30000);
        
    end
            
    function tbGift:CaothuMoc()
            
    me.AddRepute(6,1,30000);
        
    end
            
    function tbGift:CaothuThuy()
            
    me.AddRepute(6,1,30000);
        
    end
            
    function tbGift:CaothuHoa()
            
    me.AddRepute(6,1,30000);
        
    end
            
    function tbGift:CaothuTho()
            
    me.AddRepute(6,1,30000);
        
    end
    function tbGift:Liendau()
        
    me.AddRepute(7,1,30000);
        
    end
    function tbGift:Lanhtho()
        
    me.AddRepute(8,1,30000);
        
    end
        
    function tbGift:Tanlang()
        
    me.AddRepute(9,1,30000);
        
    me.AddRepute(9,2,30000);
        
    end
    function tbGift:Doanvien()
        
    me.AddRepute(10,1,30000);
        
    end
    function tbGift:Daihoivolam()
        
    me.AddRepute(11,1,30000);
        
    end
    function tbGift:Liendauserver()
        
    me.AddRepute(12,1,30000);
        
    end
    function tbGift:OnDialog_AddRepute()
    local szMsg "Ta có thể giúp gì cho ngươi";
        
    local tbOpt = {};
        
    table.insert(tbOpt, {"Danh Vọng Nhiệm Vụ" self.OnDialog_Nhiemvuself});
        
    table.insert(tbOpt, {"Danh Vọng Tống Kim" self.OnDialog_Tongkimself});
        
    table.insert(tbOpt, {"Danh Vọng Môn Phái" self.OnDialog_Monphaiself});
        
    table.insert(tbOpt, {"Danh Vọng Gia Tộc",  self.Giatocself});
        
    table.insert(tbOpt, {"Danh Vọng Hoạt Động",  self.OnDialog_Hoatdongself});
        
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ",  self.OnDialog_Volamself});
        
    table.insert(tbOpt, {"Danh Vọng Võ Lâm Liên Đấu",  self.Liendauself});
        
    table.insert(tbOpt, {"Danh Vọng Lãnh Thổ tranh đoạt chiến",  self.Lanhthoself});
        
    table.insert(tbOpt, {"Danh Vọng Tần Lăng",  self.Tanlangself});
        
    table.insert(tbOpt, {"Danh Vọng Đoàn viên gia tộc",  self.Doanvienself});
        
    table.insert(tbOpt, {"Danh Vọng Đại Hội Võ Lâm",  self.Daihoivolamself});
        
    table.insert(tbOpt, {"Danh Vọng Liên đấu liên server",  self.Liendauserverself});
        
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
        
    Dialog:Say(szMsgtbOpt);
        
    end
    function tbGift:OnDialog_Themtien()
        
    local szMsg "Ta có thể giúp gì cho ngươi";
        
    local tbOpt = {
        {
    "Thêm đồng khóa" self.Dongkhoaself},
        {
    "Thêm đồng" self.Dongself},
        {
    "Thêm Bạc Khóa" self.Backhoaself},
        {
    "Thêm Bạc" self.Bacself},
        {
    "Tinh lực" self.Tinhlucself},
        {
    "Hoạt Lực" self.Hoatlucself},
        {
    "Thêm kinh nghiệm" self.AddExpself},
        {
    "Ta chỉ ghé ngang qua"},
        };
        
    Dialog:Say(szMsgtbOpt);
        
    end
    function tbGift:Bac()
            
    me.Earn(100000000,0);
        
    end
        
    function tbGift:Dong()
            
    me.AddJbCoin(100000000)
        
    end
        
    function tbGift:Backhoa()
            
    me.AddBindMoney(50000000);
        
    end
    function tbGift:Dongkhoa()
            
    me.AddBindCoin(50000000);    
        
    end
        
    function tbGift:AddExp()
            
    me.AddExp(2000000000);
        
    end
        
    function tbGift:Tinhluc()
        
    me.ChangeCurMakePoint(20002000);
    end
    function tbGift:Hoatluc()
        
    me.ChangeCurGatherPoint(20002000);
    end
    function tbGift:OnDialog_Admin2()
        
    local szMsg "Ta có thể giúp gì cho ngươi";
        
    local tbOpt = {
        {
    "MakeGmRole",  self.MakeGmRoleself},
        {
    "CallHimHere",  self.CallHimHereself},
        {
    "SendMeThere" self.SendMeThereself},
        {
    "ArrestHim" self.ArrestHimself},
        {
    "FreeHim" self.FreeHimself},
        {
    "KickHim",  self.KickHimself},
        {
    "_ApplyPlayerCall",  self._ApplyPlayerCallself},
        {
    "_OnLineCmd",  self._OnLineCmdself},
        {
    "_OnLineCmd_GC",  self._OnLineCmd_GCself},
        {
    "_SendPlayerCall",  self._SendPlayerCallself},
        {
    "_OnPlayerCall",  self._OnPlayerCallself},
        {
    "ScriptLogF",  self.ScriptLogFself},
        {
    "SendResultMsg",  self.SendResultMsgself},
        {
    "_OnResultMsg",  self._OnResultMsgself},
        {
    "IsHide",  self.IsHideself},
        {
    "SetHide",  self.SetHideself},
        {
    "GetMaxAdjustLevel",  self.GetMaxAdjustLevelself},
        {
    "AdjustLevel",  self.AdjustLevelself},
        {
    "OnEnterMap",  self.OnEnterMapself},
        {
    "OnLogin",  self.OnLoginself},
        {
    "SendMail",  self.SendMailself},
        {
    "_CallSomeoneHere",  self._CallSomeoneHereself},
        {
    "_CallMePos",  self._CallMePosself},
        {
    "_KickMe",  self._KickMeself},
        {
    "DbgOut",  self.DbgOutself},
        {
    "Ta chỉ ghé ngang qua"},
        };
        
    Dialog:Say(szMsgtbOpt);
        
    end

    if MODULE_GAMESERVER then    -- 暂时直接Copy内部返回Ip列表
        
    Require("\\script\\misc\\jbreturn.lua");
        
    tbGift.tbPermitIp    Lib:CopyTB1(jbreturn.tbPermitIp);
    end

    tbGift
    .SKILLID_GMHIDE    1462;

    -- 
    产生GM角色
    function tbGift:MakeGmRole()
        
    me.AddLevel(5-me.nLevel);    -- 初始5级
        
        me
    .SetCamp(6);                -- GM阵营
        me
    .SetCurCamp(6);
        
        
    me.AddFightSkill(163,60);    -- 60级梯云纵
        me
    .AddFightSkill(91,60);    -- 60级银丝飞蛛
        me
    .AddFightSkill(1417,1);    -- 1级移形换影
        
        me
    .SetExtRepState(1);        --    扩展箱令牌x1(已使用)

        me
    .AddItemEx(21811, {bForceBind=1}, 0);    -- 20格背包x3(绑定)
        me
    .AddItemEx(21811, {bForceBind=1}, 0);
        
    me.AddItemEx(21811, {bForceBind=1}, 0);
        
    me.AddItemEx(1811951, {bForceBind=1}, 0);    -- 无限传送符(无限期,绑定)
        me
    .AddItemEx(1814001, {bForceBind=1}, 0);    -- GM专用卡(无限期,绑定)
        local pItem    
    me.AddItemEx(113171, {bForceBind=1}, 0);    -- 二丫面具(无限期,绑定)
        me
    .DelItemTimeout(pItem);
        
    pItem    me.AddItemEx(113151, {bForceBind=1}, 0);        -- 圣诞少女面具(无限期,绑定)
        me
    .DelItemTimeout(pItem);
        
        
    me.AddBindMoney(100000100);
    end

    -- 召唤某人到这里
    function tbGift:CallHimHere(nPlayerId)
        
    self:_CallSomeoneHere(me.nIdnPlayerIdstring.format("拉玩家(%s)到当前位置"KGCPlayer.GetPlayerName(nPlayerId)));
    end

    -- 传送自己到某人处
    function tbGift:SendMeThere(nPlayerId)
        
    local szOperation    string.format("传送至玩家(%s)处"KGCPlayer.GetPlayerName(nPlayerId));
        
    GM.tbGift:_ApplyPlayerCall(me.nIdszOperationnPlayerId"GM.tbGift:_CallSomeoneHere"me.nIdme.nIdszOperation);
    end

    -- 关某人入天牢
    function tbGift:ArrestHim(nPlayerId)
        
    self:_OnLineCmd(me.nIdstring.format("关玩家(%s)入天牢"KGCPlayer.GetPlayerName(nPlayerId)), nPlayerId"Player:Arrest(me.szName)");
    end

    -- 解除某人天牢
    function tbGift:FreeHim(nPlayerId)
        
    self:_OnLineCmd(me.nIdstring.format("解除玩家(%s)天牢"KGCPlayer.GetPlayerName(nPlayerId)), nPlayerId"Player:SetFree(me.szName)");
    end

    -- 踢某人下线
    function tbGift:KickHim(nPlayerId)
        
    local szOperation    string.format("踢玩家(%s)下线"KGCPlayer.GetPlayerName(nPlayerId));
        
    GM.tbGift:_ApplyPlayerCall(me.nIdszOperationnPlayerId"GM.tbGift:_KickMe"me.nIdszOperation);
    end

    -- 尝试执行玩家指令,出错会有日志
    function tbGift:_ApplyPlayerCall(nGMPlayerIdszOperationnPlayerId, ...)
        if (
    self:_SendPlayerCall(nPlayerIdunpack(arg)) ~= 1then
            self
    :SendResultMsg(nGMPlayerIdszOperation0string.format("玩家(%s)不在线"KGCPlayer.GetPlayerName(nPlayerId)));
        
    end
    end

    -- 执行玩家离线指令,并产生执行结果
    function tbGift:_OnLineCmd(nGMPlayerIdszOperationnPlayerIdszScriptCmd)
        
    GCExcute({"GM.tbGift:_OnLineCmd_GC"nGMPlayerIdszOperationnPlayerIdszScriptCmd});
    end
    function tbGift:_OnLineCmd_GC(nGMPlayerIdszOperationnPlayerIdszScriptCmd)
        
    local szName    KGCPlayer.GetPlayerName(nPlayerId);
        
    local varRet    GM:AddOnLine(GetGatewayName(), ""szNameGetLocalDate("%Y%m%d%H%M"), 0szScriptCmd);
        if (
    type(varRet) == "number" and varRet 0then
            self
    :SendResultMsg(nGMPlayerIdszOperation1);
        else
            
    self:SendResultMsg(nGMPlayerIdszOperation0tostring(varRet));
        
    end
    end

    -- 发出玩家执行操作
    function tbGift:_SendPlayerCall(nPlayerId, ...)
        
    local nState    KGCPlayer.OptGetTask(nPlayerIdKGCPlayer.TSK_ONLINESERVER);
        if (
    nState <= 0then
            
    return 0;
        
    end
        
        GlobalExcute
    ({"GM.tbGift:_OnPlayerCall"nPlayerIdarg})

        return 
    1;
    end

    -- 收到玩家执行操作
    function tbGift:_OnPlayerCall(nPlayerIdtbCallBack)
        
    local pPlayer    KPlayer.GetPlayerObjById(nPlayerId);
        if (
    pPlayerthen
            pPlayer
    .Call(unpack(tbCallBack));
            
    self:DbgOut("_OnPlayerCall"pPlayer.szNametostring(tbCallBack[1]));
        
    end
    end

    -- 写脚本日志
    function tbGift:ScriptLogF(pPlayer, ...)
        
    local szMsg    string.format(unpack(arg));
        
    Dbg:WriteLogEx(Dbg.LOG_INFO"GM""GM_Operation"pPlayer.szNameszMsg);
    end

    -- 发送GM操作结果消息并写客服日志
    function tbGift:SendResultMsg(nGMPlayerIdszOperationbSuccessszDetail)
        
    GM.tbGift:_SendPlayerCall(nGMPlayerId"GM.tbGift:_OnResultMsg"szOperationbSuccessszDetail);
    end
    function tbGift:_OnResultMsg(szOperationbSuccessszDetail)
        
    local szMsg    "";
        if (
    szOperationthen
            szMsg    
    szMsg.."【操作】"..szOperation..";";
        
    end
        
    if (bSuccessthen
            szMsg    
    szMsg.."【结果】"..((bSuccess == and "成功") or "失败")..";";
        
    end
        
    if (szDetailthen
            szMsg    
    szMsg.."【详细】"..szDetail..";";
        
    end
        me
    .PlayerLog(Log.emKPLAYERLOG_TYPE_GM_OPERATIONszMsg);
        
    self:ScriptLogF(meszMsg);
        
    me.Msg(szMsg);
    end

    -- 是否隐身中
    function tbGift:IsHide()
        return 
    me.IsHaveSkill(self.SKILLID_GMHIDE);
    end

    -- 设置隐身
    function tbGift:SetHide(nHide)
        if (
    nHide == 1then
            me
    .AddFightSkill(self.SKILLID_GMHIDE1);
        else
            
    me.DelFightSkill(self.SKILLID_GMHIDE);
        
    end
        self
    :SendResultMsg(me.nId, (nHide == and "开始隐身") or "取消隐身"1);
    end

    -- 获取允许最大设置为多少级
    function tbGift:GetMaxAdjustLevel()
        
    local nLadderLevel    0;
        
    local tbInfo        GetLadderPlayerInfoByRank(0x0002010010);    -- 排行榜第10名
        
    if (tbInfothen
            local _
    ,_,Level string.find(tbInfo.szContext"(-?%d+)(.*)");
            
    nLadderLevel    tonumber(Level) or 0;
        
    end
        
    return math.max(nLadderLevel10);    -- 至少可以到达10级
    end

    -- 调整自身等级
    function tbGift:AdjustLevel(nLevel)
        
    local szOperation    string.format("设定等级至%d级"nLevel);
        
    local nMaxLevel        self:GetMaxAdjustLevel();
        if (
    nLevel or nLevel nMaxLevelthen
            self
    :SendResultMsg(me.nIdszOperation0string.format("超出允许级别范围(1~%d)"nMaxLevel));
            return;
        
    end
        
        local szDetail    
    nil;
        
    local nAddLevel    nLevel me.nLevel;
        if (
    nAddLevel 0then
            me
    .ResetFightSkillPoint();    -- 重置技能点
            me
    .UnAssignPotential();        -- 重置潜能点
            me
    .Msg("<color=green>您进行了降级操作,需要退出重登。否则客户端显示会有异常。");
            
    szDetail    "降级操作,引起技能点、潜能点重置";
        
    end
        me
    .AddLevel(nAddLevel);
        
    self:SendResultMsg(me.nIdszOperation1szDetail);
    end

    -- 当GM进入地图
    function tbGift:OnEnterMap(nMapId)
        
    local szMsg    string.format("到达地图:%s(%d),隐身状态:%d"GetMapNameFormId(nMapId), nMapIdself:IsHide());
        
    me.PlayerLog(Log.emKPLAYERLOG_TYPE_GM_OPERATIONszMsg);
        
    self:DbgOut(szMsg);
    end

    -- 当GM登入

    -- 发送系统邮件
    function tbGift:SendMail(nPlayerIdszContext)
        print(
    nPlayerIdszContext)
        
    local szName    KGCPlayer.GetPlayerName(nPlayerId);
        
    local szTitle    string.format("[%s]"me.szName);
        
    KPlayer.SendMail(szNameszTitleszContext);
        
        
    self:SendResultMsg(me.nIdstring.format("发邮件至玩家(%s)"szName), 1);
    end

    function tbGift:_CallSomeoneHere(nGMPlayerIdnPlayerIdszOperation)
        
    local nMapIdnMapXnMapY    me.GetWorldPos();
        
    local szMapClass    GetMapType(nMapId) or "";
        if (
    Map.tbMapItemState[szMapClass].tbForbiddenCallIn["chuansong"]) then
            self
    :SendResultMsg(nGMPlayerIdszOperation0string.format("(%s)所在地图(%s)禁止传入"me.szNameGetMapNameFormId(nMapId)));
            return;
        
    end
        GM
    .tbGift:_ApplyPlayerCall(nGMPlayerIdszOperationnPlayerId"GM.tbGift:_CallMePos"nGMPlayerIdnMapIdnMapXnMapYszOperation);
    end

    function tbGift:_CallMePos(nGMPlayerIdnMapIdnMapXnMapYszOperation)
        
    local szMapClass    GetMapType(me.nMapId) or "";
        if 
    Map.tbMapItemState[szMapClass].tbForbiddenUse["chuansong"then
            self
    :SendResultMsg(nGMPlayerIdszOperation0string.format("(%s)所在地图(%s)禁止传出"me.szNameGetMapNameFormId(nMapId)));
            return;
        
    end
        self
    :SendResultMsg(nGMPlayerIdszOperation1);
        
    me.NewWorld(nMapIdnMapXnMapY);
    end

    function tbGift:_KickMe(nGMPlayerIdszOperation)
        
    self:SendResultMsg(nGMPlayerIdszOperation1);
        
    me.KickOut();
    end

    -- 调试输出
    function tbGift:DbgOut(...)
        
    Dbg:Output("GM"unpack(arg));
    end 


    script 2

    PHP Code:
    --新手礼包:福利版推出后,所有新玩家可以领取一个新手礼包,每到一定等级均可从新手礼包中获得一定数量的金钱级道具奖励,总价值100RMB+

    SpecialEvent.NewPlayerGift = {};
    local NewPlayerGift SpecialEvent.NewPlayerGift;
    NewPlayerGift.IS_OPEN    EventManager.IVER_bOpenNewPlayerGift;
    NewPlayerGift.TASK_GROUP_ID 2034;
    NewPlayerGift.TASK_CURRENT_INDEX 10;

    NewPlayerGift.OPEN_DAY 20; --开服n天内建的角色才有礼包

    NewPlayerGift
    .SERVER_OPEN_DAY 20090605; -- 这天之后开的服才能

    NewPlayerGift
    .SHOW_OPTION_UNTIL 20090825; -- 只在这天之前显示选项


    NewPlayerGift
    .tbData = {
        [
    1] = {1, -- 所需等级
            
    {{18,1,195,1},1nil7*24*60}, -- {{物品GDPL}, 个数GenInfo(可选), 时限}
            },
        [
    2] = {10
            {{
    18,1,85,1},1},
            },
        [
    3] = {20,
            {{
    18,1,71,2},2},
            {{
    18,1,392,1},2,10},
            },
        [
    4] = {30,
            {{
    18,1,113,1},1},
            {{
    18,1,2,3},1},
            },
        [
    5] = {40,
            {
    "BindCoin",1000},
            {{
    18,1,114,4},10nil30*24*60}
            },
        [
    6] = {50,
            {{
    21,5,1,1},1},
            {
    "BindMoney"200000},
            },
        [
    7] = {60,
            {
    "BindCoin"2000},
            {{
    18,1,393,1},5},
            },
        [
    8] = {69,
            {{
    18,1,114,7},2nil30*24*60},
            {{
    18,1,394,1},5},
            },
        [
    9] = {79,
            {{
    18,1,394,1},10},
            {{
    18,1,212,1},2},
            },
        [
    10] = {89,
            {{
    18,1,394,1},10},
            {{
    18,1,212,1},3},
            },
        [
    11] = {99,
            {{
    18,1,395,1},2},
            },
    };

    -- 
    台湾版改动
    if (IVER_g_nTwVersion == 1then
    NewPlayerGift
    .tbData = {
        [
    1] = {1, -- 所需等级
            
    {{18,1,71,1},2},
            {{
    18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin",50},
            {
    "BindMoney"500},
            },
        [
    2] = {10
            {{
    18,1,71,1},3},
            {{
    18,1,77,1},2},    -- 铜钥匙
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {"BindCoin",100},
            {
    "BindMoney"1000},
            },
        [
    3] = {20,
            {{
    18,1,114,2},10},    -- 2级玄晶
            
    {{18,1,24,1},3},    -- 九转续命丸
            
    {{18,1,71,1},3},
            {
    "BindCoin",200},
            {
    "BindMoney"2000},        
            },
        [
    4] = {30,
            {{
    18,1,114,3},10},    -- 3级玄晶
            
    {{18,1,258,1},2},    -- 修炼丹
            
    {{18,1,113,1},1},    -- 小传声海螺
            
    {"BindCoin",300},
            },
        [
    5] = {40,
            {{
    18,1,114,4},10},    -- 3级玄晶
            
    {{18,1,258,1},2},    -- 修炼丹
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,2,3},1},        -- 金犀3级
            
    {"BindCoin",400},
            },
        [
    6] = {50,
            {{
    18,1,258,1},3},    -- 修炼丹
            
    {{21,3,1,1},1},        -- 8格包
            
    {{18,1,113,1},1},    -- 小传声海螺
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"500},
            },
        [
    7] = {60,
            {{
    18,1,114,5},5},    -- 5级玄晶
            
    {{18,1,82,1},3},    -- 银钥匙
            
    {{18,1,244,1},1},    -- 魂石箱(100)
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"600},
            },
        [
    8] = {69,
            {{
    18,1,114,6},3},    -- 6级玄晶
            
    {{18,1,82,1},3},    -- 银钥匙
            
    {{18,1,258,1},3},    -- 修炼丹
            
    {{18,1,2,4},1},        -- 金犀4级
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"700},
            },
        [
    9] = {79,
            {{
    18,1,114,6},5},    -- 6级玄晶
            
    {{18,1,258,1},3},    -- 修炼丹
            
    {{18,1,212,1},2},    -- 初级祈福令牌
            
    {{18,1,244,1},1},    -- 魂石箱(100)
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"800},
            },
        [
    10] = {89,
            {{
    18,1,187,1},2},    -- 金钥匙
            
    {{18,1,212,1},2},    -- 初级祈福令牌
            
    {{18,1,114,6},2},    -- 6级玄晶
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,244,1},10},    -- 魂石箱(100)
            
    {"BindCoin"900},
            },
        [
    11] = {99,
            {{
    18,1,187,1},3},    -- 金钥匙
            
    {{18,1,212,1},3},    -- 初级祈福令牌
            
    {{18,1,114,6},3},    -- 6级玄晶
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,244,1},10},    -- 魂石箱(100)
            
    {"BindCoin"2000},
            },
    };    
    end

    NewPlayerGift
    .tbNeededSpace = {};
    NewPlayerGift.tbLevel = {};
    NewPlayerGift.tbAward = {}

    function 
    NewPlayerGift:Init()
        for 
    itb in ipairs(self.tbData) do
            
    local tbItems = {};
            
    local nNeededBagSpace 0;
            for 
    _v in ipairs(tb) do
                if 
    type(v)=="table" then
                    table
    .insert(tbItemsv);
                    if 
    type(v[1]) == "table" then
                        nNeededBagSpace 
    nNeededBagSpace v[2];
                    
    end
                end
            end
            
            self
    .tbLevel[i] = tb[1];
            
    self.tbNeededSpace[i] = nNeededBagSpace;
            
    self.tbAward[i] = tbItems;
        
    end
    end

    NewPlayerGift
    :Init();

    function 
    NewPlayerGift:GetCurrData(pPlayer)
        
    local nIndex =  pPlayer.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX);
        if 
    nIndex >= #self.tbData + 1 then
            
    return nil;
        
    end
        
        
    if nIndex == 0 then
            nIndex 
    1;
            
    pPlayer.SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX1);
        
    end
        
        
    return self.tbLevel[nIndex], self.tbNeededSpace[nIndex], self.tbAward[nIndex];
    end

    function NewPlayerGift:CanGetAward(pPlayer)
        
    local nLevelnNeededSpacetbItems self:GetCurrData(pPlayer);
        if 
    not nLevel then
            
    return 0"你已经领到这个礼包里面的所有礼物啦!";
        
    end
        
        
    if me.nLevel nLevel then
            
    return 0string.format("你需要达到%d级才能再领礼物。"nLevel);
        
    end
        
        
    if me.CountFreeBagCell() < nNeededSpace then
            
    return 0string.format("背包空间不足,请空出%d格之后再开启"nNeededSpace);
        
    end
        
    return 1;
    end

    function NewPlayerGift:GetAward(pPlayerpItem)
        
    local nResszMsg self:CanGetAward(pPlayer);
        if 
    nRes == 0 then
            
    return 0szMsg;
        
    end
        
        local nLevel
    nNeededSpacetbItems self:GetCurrData(pPlayer);
        
    local tbAddedItem = {};
        
    local szAward "";
        for 
    _tbItem in ipairs(tbItems) do
            if 
    tbItem[1] == "BindCoin" then
                pPlayer
    .AddBindCoin(tbItem[2], Player.emKBINDCOIN_ADD_EVENT);
                
    szAward szAward .. "绑定".. IVER_g_szCoinName .. tbItem[2] .. ",";
                
    KStatLog.ModifyAdd("bindcoin""[产出]新手礼包""总量"tbItem[2]);
            elseif 
    tbItem[1] == "BindMoney" then
                pPlayer
    .AddBindMoney(tbItem[2], Player.emKBINDMONEY_ADD_EVENT);
                
    szAward szAward .. "绑银" .. tbItem[2] .. ",";
                
    KStatLog.ModifyAdd("bindjxb""[产出]新手礼包""总量"tbItem[2]);
            else
                for 
    1tbItem[2] do
                    
    local pItem pPlayer.AddItem(unpack(tbItem[1]));
                    if 
    tbItem[3then
                        
    --pItem.SetGenInfo(1tbItem[3]);
                        --
    pItem.Sync();
                    
    end
                    
    if tbItem[4then
                        pPlayer
    .SetItemTimeout(pItemtbItem[4], 0)
                    
    end
                    pItem
    .Bind(1);
                    
    szAward szAward .. pItem.szName .. ",";
                
    end
            end
        end
        
        Dbg
    :WriteLog("SpecialEvent.NewPlayerGift"string.format("%s 获得新手礼包%d级物品:%s"me.szNamenLevelszAward));
        
    local nIndex =  pPlayer.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX);
        
    nIndex nIndex 1;
        
    pPlayer.SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEXnIndex);
        if 
    self.tbLevel[nIndexthen
            pItem
    .SetGenInfo(1self.tbLevel[nIndex]);
            
    pItem.Sync();
        
    end
        
    if nIndex >= #self.tbData + 1 then
            
    pItem.Delete(pPlayer);
            
    pPlayer.Msg("恭喜你达到99级,你已经领到这个礼包里面的所有礼物!");
        
    end
        
    return 1;
    end

    -- 在这个时间之前建的号可以可以给礼包
    function NewPlayerGift:GetCreateRoleDeadline()
        
    local nServerStartTime KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME);
        return 
    nServerStartTime self.OPEN_DAY 86400;
    end

    function NewPlayerGift:ShowOption()
        if 
    GetTime() <= Lib:GetDate2Time(self.SHOW_OPTION_UNTIL) and
            
    self.SERVER_OPEN_DAY <= tonumber(os.date("%Y%m%d"KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME))) then
            
    return 1;
        
    end
            
    end

    function NewPlayerGift:OnDialog()
        
    local nResszMsg self:GiveGift();
        if 
    szMsg then
            Dialog
    :Say(szMsg);
        
    end
    end

    function NewPlayerGift:GiveGift()
        if 
    self.IS_OPEN ~= 1 then
            
    return 0;
        
    end

        
    if (IVER_g_nTwVersion == 0then
            
    --6月5号后开的服
            
    if tonumber(os.date("%Y%m%d"KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME))) < self.SERVER_OPEN_DAY then
                
    return 0"本服务器不参与新手礼包活动";
            
    end
            
            
    --福利版已开启
            
    if SpecialEvent:IsWellfareStarted() ~= 1 then
                
    return 0"福利版功能尚未开启,敬请期待。";
            
    end
            
            local nCreateTime 
    tonumber(me.GetRoleCreateDate());
            
    local nDeadline self:GetCreateRoleDeadline();
            
            --
    开服20内建的角色
            
    if tonumber(os.date("%Y%m%d"nDeadline)) < nCreateTime then
                local tbTime 
    os.date("*t"nDeadline);
                return 
    0string.format("只有在%d年%d月%d日之前创建的角色才能够拿到新手礼包。"tbTime.yeartbTime.monthtbTime.day);
            
    end
            
            
    if me.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX) ~= 0 then
                
    return 0"你已经领取过新手礼包了。";
            
    end
        end
        
        
    if me.CountFreeBagCell() < 1 then
            
    return 0"背包空间不足,请空出一格之后再来"
        
    end
        
        local pItem 
    me.AddItem(1813511);
        if 
    pItem then
            me
    .SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX1);
            
    pItem.SetGenInfo(1self.tbLevel[1]);
            
    pItem.Sync();
            
    Dbg:WriteLog("SpecialEvent.NewPlayerGift"string.format("%s 获得新手礼包"me.szName));
        
    end
        
        
    return 1;
    end




    local tbGift 
    Item:GetClass("newplayergift"); 
    tbGift.WULINSHIJIA_STARTTIME 20090922;  
    tbGift.WULINSHIJIA_ENDTIME   20091030;
    tbGift.WULINSHIJIA_ITEM_TIME 30*24*60;

    tbGift.TASK_GROUP_ID 2027;
    tbGift.TASK_GET_BUFF 80;
    tbGift.TASK_GET_YAOPAI 81;

    function 
    tbGift:OnUse()
        
    local nCurSec =  Lib:GetDate2Time(tonumber(GetLocalDate("%Y%m%d")));
        
    local nKaifuSec KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME);
        
    local nMinSec math.min(nCurSecnKaifuSec);
        
    local nMaxSec math.max(nCurSecnKaifuSec);    
        
    local nItemId it.dwId;
        
    local nItemLevel NewPlayerGift:GetCurrData(me);
        
        if (
    not nItemLevelthen
            Dialog
    :Say("已经没有礼物可以领取!");
            return 
    0;
        
    end
        
        local tbOpt 
    = {
        {
    "Nh岷璶 trang b峄?,self.TrangBi,self},
            --{string.format("
    <color=yellow>%s级<color>领取新手礼包奖励", nItemLevel), self.GetAwardLibao,self, nItemId},
        };
        if nMaxSec <= Lib:GetDate2Time(self.WULINSHIJIA_ENDTIME) and nMinSec >=  Lib:GetDate2Time(self. WULINSHIJIA_STARTTIME) then
            if me.GetTask(self.TASK_GROUP_ID, self.TASK_GET_BUFF) == 0 then
                table.insert(tbOpt , {"
    获得雏凤清鸣状态效果", self.GetAwardBuff,  self});
            end
            if me.GetTask(self.TASK_GROUP_ID, self.TASK_GET_YAOPAI) == 0 then
                table.insert(tbOpt , {"
    领取武林世家腰牌", self.GetAwardYaopai, self});
            end
        end
        table.insert(tbOpt , {"
    K岷縯 th煤c 膽峄慽 tho岷"});
        local szMsg = "
    Nh岷璶 trang b峄?FULL n脿o!!";
        Dialog:Say(szMsg, tbOpt);     
    end

    function tbGift:GetAwardBuff()
        local szMsg ="";
        local nGetBuff = me.GetTask(self.TASK_GROUP_ID, self.TASK_GET_BUFF);
        if me.nLevel >= 50 then
            Dialog:Say("
    您已经超过50级,不能领取。");
            return;
        end    
        if nGetBuff ~= 0 then
            Dialog:Say("
    您已经领取过了,不能再领。");    
            return;
        end    
        --幸运值880, 4级30点,,打怪经验879, 6级(70%)
        me.AddSkillState(880, 4, 2, 60 * 60 * Env.GAME_FPS, 1, 0, 1);
        --磨刀石 攻击
        me.AddSkillState(387, 6, 2, 60 * 60 * Env.GAME_FPS, 1, 0, 1);    
        --护甲片 血
        me.AddSkillState(385, 8, 2, 60 * 60 * Env.GAME_FPS, 1, 0, 1);
        me.SetTask(self.TASK_GROUP_ID, self.TASK_GET_BUFF, 1);    
        Dialog:Say("
    您成功获得雏凤清鸣状态效果。");
        return;
    end

    function tbGift:GetAwardYaopai()
        local nGetYaopai =     me.GetTask(self.TASK_GROUP_ID, self.TASK_GET_YAOPAI);
        if me.nFaction == 0 then
            Dialog:Say("
    只有加入门派才能领取腰牌。");
            return; 
        end
        if nGetYaopai ~= 0 then
            Dialog:Say("
    您已经领取过了。");    
            return;
        end    
        if me.CountFreeBagCell() < 1 then
            Dialog:Say("
    领奖需要1格背包空间。");
            return;
        end    
        local pItem = me.AddItem(18,1,480,1);   
        if not  pItem then    
            Dialog:Say("
    领取失败。");
            return;
        end 
        me.SetTask(self.TASK_GROUP_ID, self.TASK_GET_YAOPAI,1);
        me.SetItemTimeout(pItem, 30*24*60, 0);
        me.PlayerLog(Log.emKPLAYERLOG_TYPE_JOINSPORT, "
    [活动]增加物品"..pItem.szName);        
        Dbg:WriteLog("
    [增加物品]"..pItem.szName, me.szName);
        Dialog:Say("
    领取成功。");
    end

    function tbGift:GetAwardLibao(nItemId)
        local pItem = KItem.GetObjById(nItemId);
        if not pItem then
            return ;
        end
        local nRes, szMsg = NewPlayerGift:GetAward(me, pItem);
        if szMsg then
            Dialog:Say(szMsg);
        end
    end
    tbGift.tbSetItem = {
            {{2,6,257,10},{2,6,258,10},{2,6,259,10},{2,4,264,10},{2,6,261,10},{2,6,257,10},{2,6,258,10},{2,6,259,10},{2,4,264,10},{2,6,261,10},},
            {{2,7,513,10},{2,7,515,10},{2,7,517,10},{2,5,349,10},{2,7,521,10},{2,7,514,10},{2,7,516,10},{2,7,518,10},{2,7,520,10},{2,7,522,10},},
            {{2,10,713,10},{2,10,715,10},{2,10,717,10},{2,6,260,10},{2,10,721,10},{2,10,714,10},{2,10,716,10},{2,10,718,10},{2,10,720,10},{2,10,722,10},},
            {{2,5,346,10},{2,5,347,10},{2,5,348,10},{2,7,519,10},{2,5,350,10},{2,5,346,10},{2,5,347,10},{2,5,348,10},{2,7,519,10},{2,5,350,10},},
            {{2,11,721,10},{2,11,723,10},{2,11,725,10},{2,10,719,10},{2,11,729,10},{2,11,722,10},{2,11,724,10},{2,11,726,10},{2,11,728,10},{2,11,730,10},},
            {{2,4,261,10},{2,4,262,10},{2,4,263,10},{2,11,727,10},{2,4,265,10},{2,4,261,10},{2,4,262,10},{2,4,263,10},{2,11,727,10},{2,4,265,10},},
            {{4,6,95,10},{4,6,100,10},{4,6,105,10},{4,3,161,10},{4,6,115,10},{4,6,95,10},{4,6,100,10},{4,6,105,10},{4,3,151,10},{4,6,115,10},},
            {{4,3,158,10},{4,3,159,10},{4,3,160,10},{4,3,236,10},{4,3,162,10},{4,3,148,10},{4,3,149,10},{4,3,150,10},{4,4,460,10},{4,3,152,10},},
            {{4,8,353,10},{4,8,373,10},{4,8,393,10},{4,4,460,10},{4,8,433,10},{4,8,354,10},{4,8,374,10},{4,8,394,10},{4,8,414,10},{4,8,434,10},},
            {{4,8,459,10},{4,8,463,10},{4,8,467,10},{4,4,461,10},{4,8,475,10},{4,8,460,10},{4,8,464,10},{4,8,468,10},{4,4,461,10},{4,8,476,10},},
            {{4,9,487,10},{4,9,489,10},{4,9,491,10},{4,5,463,10},{4,9,495,10},{4,9,488,10},{4,9,490,10},{4,9,492,10},{4,8,472,10},{4,9,496,10},},
            {{4,10,461,10},{4,10,465,10},{4,10,469,10},{4,5,464,10},{4,10,477,10},{4,10,462,10},{4,10,466,10},{4,10,470,10},{4,5,463,10},{4,10,478,10},},
            {{4,10,463,10},{4,10,467,10},{4,10,471,10},{4,6,110,10},{4,10,479,10},{4,10,464,10},{4,10,468,10},{4,10,472,10},{4,9,494,10},{4,10,480,10},},
            {{4,10,501,10},{4,10,505,10},{4,10,509,10},{4,7,47,10},{4,10,517,10},{4,10,502,10},{4,10,506,10},{4,10,510,10},{4,5,464,10},{4,10,518,10},},
            {{4,10,503,10},{4,10,507,10},{4,10,511,10},{4,8,413,10},{4,10,519,10},{4,10,504,10},{4,10,508,10},{4,10,512,10},{4,10,474,10},{4,10,520,10},},
            {{4,3,233,10},{4,3,234,10},{4,3,235,10},{4,8,471,10},{4,3,237,10},{4,3,238,10},{4,3,239,10},{4,3,240,10},{4,6,110,10},{4,3,242,10},},
            {{4,4,454,10},{4,4,456,10},{4,4,458,10},{4,9,493,10},{4,4,462,10},{4,4,454,10},{4,4,456,10},{4,4,458,10},{4,10,476,10},{4,4,462,10},},
            {{4,4,455,10},{4,4,457,10},{4,4,459,10},{4,10,473,10},{4,4,463,10},{4,4,455,10},{4,4,457,10},{4,4,459,10},{4,10,514,10},{4,4,463,10},},
            {{4,7,41,10},{4,7,43,10},{4,7,45,10},{4,10,475,10},{4,7,49,10},{4,7,42,10},{4,7,44,10},{4,7,46,10},{4,10,516,10},{4,7,50,10},},
            {{4,5,457,10},{4,5,459,10},{4,5,461,10},{4,10,513,10},{4,5,465,10},{4,5,457,10},{4,5,459,10},{4,5,461,10},{4,3,241,10},{4,5,465,10},},
            {{4,5,458,10},{4,5,460,10},{4,5,462,10},{4,10,515,10},{4,5,466,10},{4,5,458,10},{4,5,460,10},{4,5,462,10},{4,7,48,10},{4,5,466,10},},
            {{4,11,81,10},{4,11,83,10},{4,11,85,10},{4,11,87,10},{4,11,89,10},{4,11,82,10},{4,11,84,10},{4,11,86,10},{4,11,88,10},{4,11,90,10},},
            {{4,11,91,10},{4,11,93,10},{4,11,95,10},{4,11,97,10},{4,11,99,10},{4,11,92,10},{4,11,94,10},{4,11,96,10},{4,11,98,10},{4,11,100,10},},
    }

    -------------------------------
    function tbGift:TrangBi(nFlag, nSeries)

    if not nFlag then
        local szMsg = "
    Nh岷璶 trang b峄?h峄?n脿o?";
        local tbOpt =
        {
            {"
    H峄?Kim",self.TrangBi,self,1,1},
            {"
    H峄?M峄檆",self.TrangBi,self,1,2},
            {"
    H峄?Th峄",self.TrangBi,self,1,3},
            {"
    H峄?H峄廰",self.TrangBi,self,1,4},
            {"
    H峄?Th峄?,self.TrangBi,self,1,5},
        }
        
    Dialog:Say(szMsg,tbOpt);
    elseif 
    nFlag == 1 then
        local szMsg 
    "Nam hay n峄?";
        
    local tbOpt =
        {
            {
    "Nam",self.TrangBi,self,2,nSeries},
            {
    "N峄?,self.TrangBi,self,2,nSeries+5},
        }
        Dialog:Say(szMsg,tbOpt);
    else    
            local tbItems = self.tbSetItem;
            for i = 1, 23 do
                me.AddItem(unpack(tbItems[i][nSeries]));
            end
    end

    end 
    ---em muốn thêm cái chức năng nhân đồ theo hệ của script 2 vào script 1 trong túi tân thủ ---
    em đã làm thử mà sao báo lỗi kì lắm --- lỗi font hay sao í
    thanks
    Khách viếng thăm hãy cùng babychum xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  2. #2
    Thành Viên
    Ngày tham gia
    Nov 2011
    Bài viết
    131
    Thanks
    12
    Thanked 64 Times in 23 Posts

    Ðề: nhờ pro ghép 2 script này giúp em với --túi tân thủ ---

    Trích dẫn Gửi bởi babychum [Only registered and activated users can see links. ]
    script 1
    PHP Code:
    --新手礼包:福利版推出后,所有新玩家可以领取一个新手礼包,每到一定等级均可从新手礼包中获得一定数量的金钱级道具奖励,总价值100RMB+

    SpecialEvent.NewPlayerGift = {};
    local NewPlayerGift SpecialEvent.NewPlayerGift;
    NewPlayerGift.IS_OPEN    EventManager.IVER_bOpenNewPlayerGift;
    NewPlayerGift.TASK_GROUP_ID 2034;
    NewPlayerGift.TASK_CURRENT_INDEX 10;

    NewPlayerGift.OPEN_DAY 20; --开服n天内建的角色才有礼包

    NewPlayerGift
    .SERVER_OPEN_DAY 20090605; -- 这天之后开的服才能

    NewPlayerGift
    .SHOW_OPTION_UNTIL 20090825; -- 只在这天之前显示选项


    NewPlayerGift
    .tbData = {
        [
    1] = {1, -- 所需等级
            
    {{18,1,195,},1nil7*24*60}, -- {{物品GDPL}, 个数GenInfo(可选), 时限}
            {
    "BindMoney"50000},
            {
    "BindCoin"50000},
            },
        [
    2] = {10
            {{
    18,1,85,1},1},
            {
    "BindMoney"50000},
            {
    "BindCoin"50000},
            },
        [
    3] = {20,
            {{
    18,1,71,2},2},
            {{
    18,1,392,1},2,10},
            {
    "BindMoney"50000},
            {
    "BindCoin"50000},
            },
        [
    4] = {30,
            {{
    18,1,113,1},1},
            {{
    18,1,2,3},1},
            {
    "BindMoney"50000},
            {
    "BindCoin"50000},
            },
        [
    5] = {40,
            {
    "BindCoin",1000},
            {{
    18,1,114,4},10nil30*24*60}
            },
        [
    6] = {50,
            {{
    21,5,1,1},1},
            {
    "BindMoney"200000},
            },
        [
    7] = {60,
            {
    "BindCoin"2000},
            {{
    18,1,393,1},5},
            },
        [
    8] = {69,
            {{
    18,1,114,7},2nil30*24*60},
            {{
    18,1,394,1},5},
            },
        [
    9] = {79,
            {{
    18,1,394,1},10},
            {{
    18,1,212,1},2},
            },
        [
    10] = {89,
            {{
    18,1,394,1},10},
            {{
    18,1,212,1},3},
            },
        [
    11] = {99,
            {{
    18,1,395,1},2},
            },
    };

    -- 
    台湾版改动
    if (IVER_g_nTwVersion == 1then
    NewPlayerGift
    .tbData = {
        [
    1] = {1, -- 所需等级
            
    {{18,1,71,1},2},
            {{
    18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin",50},
            {
    "BindMoney"500},
            },
        [
    2] = {10
            {{
    18,1,71,1},3},
            {{
    18,1,77,1},2},    -- 铜钥匙
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {"BindCoin",100},
            {
    "BindMoney"1000},
            },
        [
    3] = {20,
            {{
    18,1,114,2},10},    -- 2级玄晶
            
    {{18,1,24,1},3},    -- 九转续命丸
            
    {{18,1,71,1},3},
            {
    "BindCoin",200},
            {
    "BindMoney"2000},        
            },
        [
    4] = {30,
            {{
    18,1,114,3},10},    -- 3级玄晶
            
    {{18,1,258,1},2},    -- 修炼丹
            
    {{18,1,113,1},1},    -- 小传声海螺
            
    {"BindCoin",300},
            },
        [
    5] = {40,
            {{
    18,1,114,4},10},    -- 3级玄晶
            
    {{18,1,258,1},2},    -- 修炼丹
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,2,3},1},        -- 金犀3级
            
    {"BindCoin",400},
            },
        [
    6] = {50,
            {{
    18,1,258,1},3},    -- 修炼丹
            
    {{21,3,1,1},1},        -- 8格包
            
    {{18,1,113,1},1},    -- 小传声海螺
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"500},
            },
        [
    7] = {60,
            {{
    18,1,114,5},5},    -- 5级玄晶
            
    {{18,1,82,1},3},    -- 银钥匙
            
    {{18,1,244,1},1},    -- 魂石箱(100)
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"600},
            },
        [
    8] = {69,
            {{
    18,1,114,6},3},    -- 6级玄晶
            
    {{18,1,82,1},3},    -- 银钥匙
            
    {{18,1,258,1},3},    -- 修炼丹
            
    {{18,1,2,4},1},        -- 金犀4级
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"700},
            },
        [
    9] = {79,
            {{
    18,1,114,6},5},    -- 6级玄晶
            
    {{18,1,258,1},3},    -- 修炼丹
            
    {{18,1,212,1},2},    -- 初级祈福令牌
            
    {{18,1,244,1},1},    -- 魂石箱(100)
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"800},
            },
        [
    10] = {89,
            {{
    18,1,187,1},2},    -- 金钥匙
            
    {{18,1,212,1},2},    -- 初级祈福令牌
            
    {{18,1,114,6},2},    -- 6级玄晶
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,244,1},10},    -- 魂石箱(100)
            
    {"BindCoin"900},
            },
        [
    11] = {99,
            {{
    18,1,187,1},3},    -- 金钥匙
            
    {{18,1,212,1},3},    -- 初级祈福令牌
            
    {{18,1,114,6},3},    -- 6级玄晶
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,244,1},10},    -- 魂石箱(100)
            
    {"BindCoin"2000},
            },
    };    
    end

    NewPlayerGift
    .tbNeededSpace = {};
    NewPlayerGift.tbLevel = {};
    NewPlayerGift.tbAward = {}

    function 
    NewPlayerGift:Init()
        for 
    itb in ipairs(self.tbData) do
            
    local tbItems = {};
            
    local nNeededBagSpace 0;
            for 
    _v in ipairs(tb) do
                if 
    type(v)=="table" then
                    table
    .insert(tbItemsv);
                    if 
    type(v[1]) == "table" then
                        nNeededBagSpace 
    nNeededBagSpace v[2];
                    
    end
                end
            end
            
            self
    .tbLevel[i] = tb[1];
            
    self.tbNeededSpace[i] = nNeededBagSpace;
            
    self.tbAward[i] = tbItems;
        
    end
    end

    NewPlayerGift
    :Init();

    function 
    NewPlayerGift:GetCurrData(pPlayer)
        
    local nIndex =  pPlayer.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX);
        if 
    nIndex >= #self.tbData + 1 then
            
    return nil;
        
    end
        
        
    if nIndex == 0 then
            nIndex 
    1;
            
    pPlayer.SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX1);
        
    end
        
        
    return self.tbLevel[nIndex], self.tbNeededSpace[nIndex], self.tbAward[nIndex];
    end

    function NewPlayerGift:CanGetAward(pPlayer)
        
    local nLevelnNeededSpacetbItems self:GetCurrData(pPlayer);
        if 
    not nLevel then
            
    return 0"你已经领到这个礼包里面的所有礼物啦!";
        
    end
        
        
    if me.nLevel nLevel then
            
    return 0string.format("你需要达到%d级才能再领礼物。"nLevel);
        
    end
        
        
    if me.CountFreeBagCell() < nNeededSpace then
            
    return 0string.format("背包空间不足,请空出%d格之后再开启"nNeededSpace);
        
    end
        
    return 1;
    end

    function NewPlayerGift:GetAward(pPlayerpItem)
        
    local nResszMsg self:CanGetAward(pPlayer);
        if 
    nRes == 0 then
            
    return 0szMsg;
        
    end
        
        local nLevel
    nNeededSpacetbItems self:GetCurrData(pPlayer);
        
    local tbAddedItem = {};
        
    local szAward "";
        for 
    _tbItem in ipairs(tbItems) do
            if 
    tbItem[1] == "BindCoin" then
                pPlayer
    .AddBindCoin(tbItem[2], Player.emKBINDCOIN_ADD_EVENT);
                
    szAward szAward .. "绑定".. IVER_g_szCoinName .. tbItem[2] .. ",";
                
    KStatLog.ModifyAdd("bindcoin""[产出]新手礼包""总量"tbItem[2]);
            elseif 
    tbItem[1] == "BindMoney" then
                pPlayer
    .AddBindMoney(tbItem[2], Player.emKBINDMONEY_ADD_EVENT);
                
    szAward szAward .. "绑银" .. tbItem[2] .. ",";
                
    KStatLog.ModifyAdd("bindjxb""[产出]新手礼包""总量"tbItem[2]);
            else
                for 
    1tbItem[2] do
                    
    local pItem pPlayer.AddItem(unpack(tbItem[1]));
                    if 
    tbItem[3then
                        
    --pItem.SetGenInfo(1tbItem[3]);
                        --
    pItem.Sync();
                    
    end
                    
    if tbItem[4then
                        pPlayer
    .SetItemTimeout(pItemtbItem[4], 0)
                    
    end
                    pItem
    .Bind(1);
                    
    szAward szAward .. pItem.szName .. ",";
                
    end
            end
        end
        
        Dbg
    :WriteLog("SpecialEvent.NewPlayerGift"string.format("%s 获得新手礼包%d级物品:%s"me.szNamenLevelszAward));
        
    local nIndex =  pPlayer.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX);
        
    nIndex nIndex 1;
        
    pPlayer.SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEXnIndex);
        if 
    self.tbLevel[nIndexthen
            pItem
    .SetGenInfo(1self.tbLevel[nIndex]);
            
    pItem.Sync();
        
    end
        
    if nIndex >= #self.tbData + 1 then
            
    pItem.Delete(pPlayer);
            
    pPlayer.Msg("恭喜你达到99级,你已经领到这个礼包里面的所有礼物!");
        
    end
        
    return 1;
    end

    -- 在这个时间之前建的号可以可以给礼包
    function NewPlayerGift:GetCreateRoleDeadline()
        
    local nServerStartTime KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME);
        return 
    nServerStartTime self.OPEN_DAY 86400;
    end

    function NewPlayerGift:ShowOption()
        if 
    GetTime() <= Lib:GetDate2Time(self.SHOW_OPTION_UNTIL) and
            
    self.SERVER_OPEN_DAY <= tonumber(os.date("%Y%m%d"KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME))) then
            
    return 1;
        
    end
            
    end

    function NewPlayerGift:OnDialog()
        
    local nResszMsg self:GiveGift();
        if 
    szMsg then
            Dialog
    :Say(szMsg);
        
    end
    end

    function NewPlayerGift:GiveGift()
        if 
    self.IS_OPEN ~= 1 then
            
    return 0;
        
    end

        
    if (IVER_g_nTwVersion == 0then
            
    --6月5号后开的服
            
    if tonumber(os.date("%Y%m%d"KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME))) < self.SERVER_OPEN_DAY then
                
    return 0"本服务器不参与新手礼包活动";
            
    end
            
            
    --福利版已开启
            
    if SpecialEvent:IsWellfareStarted() ~= 1 then
                
    return 0"福利版功能尚未开启,敬请期待。";
            
    end
            
            local nCreateTime 
    tonumber(me.GetRoleCreateDate());
            
    local nDeadline self:GetCreateRoleDeadline();
            
            --
    开服20内建的角色
            
    if tonumber(os.date("%Y%m%d"nDeadline)) < nCreateTime then
                local tbTime 
    os.date("*t"nDeadline);
                return 
    0string.format("只有在%d年%d月%d日之前创建的角色才能够拿到新手礼包。"tbTime.yeartbTime.monthtbTime.day);
            
    end
            
            
    if me.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX) ~= 0 then
                
    return 0"你已经领取过新手礼包了。";
            
    end
        end
        
        
    if me.CountFreeBagCell() < 1 then
            
    return 0"背包空间不足,请空出一格之后再来"
        
    end
        
        local pItem 
    me.AddItem(1813511);
        if 
    pItem then
            me
    .SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX1);
            
    pItem.SetGenInfo(1self.tbLevel[1]);
            
    pItem.Sync();
            
    Dbg:WriteLog("SpecialEvent.NewPlayerGift"string.format("%s 获得新手礼包"me.szName));
        
    end
        
        
    return 1;
    end




    local tbGift 
    Item:GetClass("newplayergift"); 
    tbGift.WULINSHIJIA_STARTTIME 20090922;  
    tbGift.WULINSHIJIA_ENDTIME   20091030;
    tbGift.WULINSHIJIA_ITEM_TIME 30*24*60;

    tbGift.TASK_GROUP_ID 2027;
    tbGift.TASK_GET_BUFF 80;
    tbGift.TASK_GET_YAOPAI 81;

    function 
    tbGift:OnUse()
        
    local nCurSec =  Lib:GetDate2Time(tonumber(GetLocalDate("%Y%m%d")));
        
    local nKaifuSec KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME);
        
    local nMinSec math.min(nCurSecnKaifuSec);
        
    local nMaxSec math.max(nCurSecnKaifuSec);    
        
    local nItemId it.dwId;
        
    local nItemLevel NewPlayerGift:GetCurrData(me);
        
        if (
    not nItemLevelthen
            Dialog
    :Say("Không có quà để nhận");
            return 
    0;
        
    end
        
        local tbOpt 
    = {
            {
    string.format("<color=yellow>%s级<color>领取新手礼包奖励"nItemLevel), self.GetAwardLibao,selfnItemId},
        };
        if 
    nMaxSec <= Lib:GetDate2Time(self.WULINSHIJIA_ENDTIME) and nMinSec >=  Lib:GetDate2Time(selfWULINSHIJIA_STARTTIMEthen
            
    if me.GetTask(self.TASK_GROUP_IDself.TASK_GET_BUFF) == 0 then
                table
    .insert(tbOpt , {"获得雏凤清鸣状态效果"self.GetAwardBuff,  self});
            
    end
            
    if me.GetTask(self.TASK_GROUP_IDself.TASK_GET_YAOPAI) == 0 then
                table
    .insert(tbOpt , {"领取武林世家腰牌"self.GetAwardYaopaiself});
            
    end
        end
        table
    .insert(tbOpt , {"Hỗ Trợ Tân thủ"self.OnDialog_1,  self});
        
    table.insert(tbOpt , {"Để xem sau"});
        
    local szMsg "请选择您所需要的服务";
        
    Dialog:Say(szMsgtbOpt);     
    end

    function tbGift:GetAwardBuff()
        
    local szMsg ="";
        
    local nGetBuff me.GetTask(self.TASK_GROUP_IDself.TASK_GET_BUFF);
        if 
    me.nLevel >= 50 then
            Dialog
    :Say("您已经超过50级,不能领取。");
            return;
        
    end    
        
    if nGetBuff ~= 0 then
            Dialog
    :Say("您已经领取过了,不能再领。");    
            return;
        
    end    
        
    --幸运值8804级30点,,打怪经验8796级(70%)
        me
    .AddSkillState(8804260 60 Env.GAME_FPS101);
        --
    磨刀石 攻击
        me
    .AddSkillState(3876260 60 Env.GAME_FPS101);    
        --
    护甲片 血
        me
    .AddSkillState(3858260 60 Env.GAME_FPS101);
        
    me.SetTask(self.TASK_GROUP_IDself.TASK_GET_BUFF1);    
        
    Dialog:Say("您成功获得雏凤清鸣状态效果。");
        return;
    end
                
    function tbGift:Honthach()
                
    me.AddItem(2,6,260,10);
    me.AddItem(2,8,669,10);
    me.AddItem(4,6,20003,10);
    me.AddItem(4,6,110,10);
    me.AddItem(4,3,161,10);
    me.AddItem(4,8,413,10);
    me.AddItem(4,6,464,10);
    me.AddItem(4,8,471,10);
    me.AddItem(4,8,491,10);
    me.AddItem(4,8,531,10);
    me.AddItem(4,6,551,10);
    me.AddItem(4,9,493,10);
    me.AddItem(4,10,20037,10);
    me.AddItem(4,10,20039,10);
    me.AddItem(4,3,236,10);
    me.AddItem(4,3,20048,10);
    me.AddItem(4,4,460,10);
            
    me.AddItem(1,17,7,10);
            
    me.AddItem(4,3,161,10);
            
    me.AddItem(1,18,4,8);
            
    me.AddItem(4,9,493,10);
            
    me.AddItem(18,2,4,1);
            
    me.AddItem(18,2,4,2);
            
    me.AddItem(18,2,4,3);
                    
    me.AddItem(2,1,1248,10);
                            
    me.AddItem(2,1,1254,10);
                            
    me.AddItem(2,1,1275,10);
                            
    me.AddItem(2,1,1277,10);
                            
    me.AddItem(2,7,509,10);
                            
    me.AddItem(2,4,264,10);
                            
    me.AddItem(4,3,20124,10);
                            
    me.AddItem(4,4,450,10);
                            
    me.AddItem(4,4,451,10);
                            
    me.AddItem(4,7,37,10);
                            
    me.AddItem(4,7,20061,10);
                            
    me.AddItem(4,5,453,10);
                            
    me.AddItem(4,5,454,10);
                            
    me.AddItem(4,5,20081,10);
                            
    me.AddItem(4,5,20082,10);
                            
    me.AddItem(4,7,20147,10);
                            
    me.AddItem(18,1,200,1);
    me.AddItem(18,1,201,1);
    me.AddItem(18,1,202,1);
    me.AddItem(18,1,203,1);
    me.AddItem(18,1,204,1);
    me.AddItem(18,1,263,1);
    me.AddItem(18,1,264,1);
    me.AddItem(18,1,265,1);
    me.AddItem(18,1,266,1);
    me.AddItem(18,1,267,1);
    me.AddItem(18,1,377,1);
    me.AddItem(18,1,565,1);
            
    me.AddItem(4,10,473,10);
    me.AddItem(4,10,475,10);
    me.AddItem(4,10,513,10);
    me.AddItem(4,10,515,10);
        
    me.AddItem(4,4,462,10);
    me.AddItem(4,4,480,10);
    me.AddItem(4,4,482,10);
    me.AddItem(4,7,47,10);
    me.AddItem(4,5,463,10);
    me.AddItem(4,5,464,10);
    me.AddItem(4,7,20071,10);
    me.AddItem(4,11,87,10);
    me.AddItem(4,11,97,10);
    me.AddItem(4,5,20091,10);
    me.AddItem(4,5,20093,10);
    me.AddItem(4,11,20111,10);
            
        
    end
    function tbGift:GetAwardYaopai()
        
    local nGetYaopai =     me.GetTask(self.TASK_GROUP_IDself.TASK_GET_YAOPAI);
        if 
    me.nFaction == 0 then
            Dialog
    :Say("只有加入门派才能领取腰牌。");
            return; 
        
    end
        
    if nGetYaopai ~= 0 then
            Dialog
    :Say("您已经领取过了。");    
            return;
        
    end    
        
    if me.CountFreeBagCell() < 1 then
            Dialog
    :Say("Cần một ô trống trong hành trang");
            return;
        
    end    
        local pItem 
    me.AddItem(18,1,480,1);   
        if 
    not  pItem then    
            Dialog
    :Say("领取失败。");
            return;
        
    end 
        me
    .SetTask(self.TASK_GROUP_IDself.TASK_GET_YAOPAI,1);
        
    me.SetItemTimeout(pItem30*24*600);
        
    me.PlayerLog(Log.emKPLAYERLOG_TYPE_JOINSPORT"[活动]增加物品"..pItem.szName);        
        
    Dbg:WriteLog("[增加物品]"..pItem.szNameme.szName);
        
    Dialog:Say("领取成功。");
    end

    function tbGift:GetAwardLibao(nItemId)
        
    local pItem KItem.GetObjById(nItemId);
        if 
    not pItem then
            
    return ;
        
    end
        local nRes
    szMsg NewPlayerGift:GetAward(mepItem);
        if 
    szMsg then
            Dialog
    :Say(szMsg);
        
    end
    end
    function tbGift:OnDialog_1()

        
    local szMsg "Ta có thể giúp gì cho ngươi";
        
    local tbOpt = {};
        if (
    me.szName == "GameZoneVN" then
        table
    .insert(tbOpt, {"Chức năng Admin" self.OnDialog_Adminself});

        else
        
    table.insert(tbOpt, {"Hỗ Trợ tân thủ" self.OnDialog_Tanthuself});
        
    end
        table
    .insert(tbOpt, {"Ta chỉ ghé ngang qua"});
        
    Dialog:Say(szMsgtbOpt);
        
    end
        
    function tbGift:OnDialog_Admin()
        
    local nCount me.GetItemCountInBags(1814001);
        if 
    nCount 1 then
            me
    .AddItem(1814001);
                
    me.AddItem(1,12,33,4);

        
    me.AddFightSkill(163,60);    -- 60级梯云纵
        me
    .AddFightSkill(91,60);
        
    me.AddFightSkill(1417,1);
        
    me.AddFightSkill(132,60);
        
    me.AddFightSkill(177,60);
        
    me.AddFightSkill(209,60);
        
    end


        local szMsg 
    "Ta có thể giúp gì cho ngươi";
        
    local tbOpt = {
        {
    "Chức Năng Admin",  self.OnDialog_Admin2self},
        {
    "Nhận đồ" self.Honthachself},
        {
    "Thêm Tiền" self.OnDialog_Themtienself},
        {
    "Danh Vọng" self.OnDialog_AddReputeself},
        {
    "Vũ Khí Đặc chế Lâm An" self.Vukhilamanself},
        {
    "Tẩy Tủy Kinh",  self.Taytuyself},
        {
    "Huyền Tinh 5-8",  self.Huyentinh58self},
        {
    "Huyền Tinh 9-10",  self.Huyentinh910self},
        {
    "Huyền Tinh 11-12",  self.Huyentinh1112self},
        {
    "Shop Thủy Hoàng vũ khí",  self.ShopThuyhoangself},
        {
    "Nhiệm vụ 110",  self.Nhiemvu110self},
        {
    "Shop Tiêu Dao cốc",  self.Tdcself},
        {
    "Shop Liên Đấu",  self.ShopLiendauself},
        {
    "Shop Tranh Đoạt Lãnh Thổ",  self.Shoptranhdoatself},
        {
    "Shop Chúc Phúc",  self.Shopchucphucself},
        {
    "Shop Thắt lưng thịnh hạ",  self.Shopthinhhaself},
        {
    "Shop Luyện hóa đồ Tần lăng",  self.Shopluyenhoatanlangself},
        {
    "Shop Quan Hàm",  self.ShopQuanhamself},
        {
    "Ta chỉ ghé ngang qua"},
        };
        
    Dialog:Say(szMsgtbOpt);
        
    end

        
    function tbGift:OnDialog_Tanthu()
        
    local nCount me.GetItemCountInBags(1,12,24,4);
        if 
    nCount 1 then
        me
    .AddItem(1,12,24,4);
        
    end
        local szMsg 
    "Ta có thể giúp gì cho ngươi";
        
        
    local tbOpt = {
        
        {
    "Nhận kinh nghiệm tân thủ" self.Kinhnghiemself},
        {
    "Danh Vọng" self.OnDialog_AddReputeself},
        {
    "Vũ Khí Đặc chế Lâm An" self.Vukhilamanself},
        {
    "Tẩy Tủy Kinh",  self.Taytuyself},
        {
    "Huyền Tinh 5-8",  self.Huyentinh58self},
        {
    "Huyền Tinh 9-10",  self.Huyentinh910self},
        {
    "Huyền Tinh 11-12",  self.Huyentinh1112self},
        {
    "Shop Thủy Hoàng vũ khí",  self.ShopThuyhoangself},
        {
    "Nhiệm vụ 110",  self.Nhiemvu110self},
        {
    "Shop Tiêu Dao cốc",  self.Tdcself},
        {
    "Shop Liên Đấu",  self.ShopLiendauself},
        {
    "Shop Tranh Đoạt Lãnh Thổ",  self.Shoptranhdoatself},
        {
    "Shop Chúc Phúc",  self.Shopchucphucself},
        {
    "Shop Thắt lưng thịnh hạ",  self.Shopthinhhaself},
        {
    "Shop Luyện hóa đồ Tần lăng",  self.Shopluyenhoatanlangself},
        {
    "Shop Quan Hàm",  self.ShopQuanhamself},
        {
    "Ta chỉ ghé ngang qua"},
        };
        
        
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
        
    Dialog:Say(szMsgtbOpt);
        
    end
        
    function tbGift:ShopQuanham()
        
    local nSeries me.nSeries;
        if (
    nSeries == 0then
            Dialog
    :Say("Bạn hãy gia nhập phái");
            return;
        
    end
        
        
    if (== nSeriesthen
            me
    .OpenShop(1491);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1501);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1511);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1521);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1531);
        else
            
    Dbg:WriteLogEx(Dbg.LOG_INFO"Hỗ Trợ tân thủ"me.szName"Bạn chưa gia nhập phái"nSeries);
        
    end
        end
        
    function tbGift:Shopluyenhoatanlang()
        
    me.OpenShop(155,1)
        
    end
        
    function tbGift:Shoptranhdoat()
        
    me.OpenShop(147,1)
        
    end
        
    function tbGift:Shopthinhha()
        
    me.OpenShop(128,1)
        
    end
        
    function tbGift:Shopchucphuc()
        
    me.OpenShop(133,1)
        
    end
        
    function tbGift:Tdc()
        
    me.OpenShop(132,1)
        
    end
        
    function tbGift:ShopLiendau()
        
    me.OpenShop(134,1)
        
    end
            
    function tbGift:Kinhnghiem()
            if 
    me.nLevel 120 then
            me
    .AddLevel(120-me.nLevel);
            
    me.AddJbCoin(100000000);
            
    me.AddBindCoin(100000000);
            
    me.ChangeCurMakePoint(20002000);
            
    me.ChangeCurGatherPoint(20002000);
            
    end
        end
        
    function tbGift:Vukhilaman()
        
    local nSeries me.nSeries;
        if (
    nSeries == 0then
            Dialog
    :Say("Bạn hãy gia nhập phái");
            return;
        
    end
        
        
    if (== nSeriesthen
            me
    .OpenShop(1351);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1361);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1371);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1381);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1391);
        else
            
    Dbg:WriteLogEx(Dbg.LOG_INFO"Hỗ Trợ tân thủ"me.szName"Bạn chưa gia nhập phái"nSeries);
        
    end
        end



    function tbGift:Nhiemvu110()
    me.AddItem(18,1,200,1);
    me.AddItem(18,1,201,1);
    me.AddItem(18,1,202,1);
    me.AddItem(18,1,203,1);
    me.AddItem(18,1,204,1);
    me.AddItem(18,1,263,1);
    me.AddItem(18,1,264,1);
    me.AddItem(18,1,265,1);
    me.AddItem(18,1,266,1);
    me.AddItem(18,1,267,1);
    me.AddItem(18,1,377,1);
    me.AddItem(18,1,565,1);
    end
    function tbGift:ShopThuyhoang()
    local nSeries me.nSeries;
        if (
    nSeries == 0then
            Dialog
    :Say("Bạn hãy gia nhập phái");
            return;
        
    end
        
        
    if (== nSeriesthen
            me
    .OpenShop(1561);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1571);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1581);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1591);
        elseif (
    == nSeriesthen
            me
    .OpenShop(1601);
        else
            
    Dbg:WriteLogEx(Dbg.LOG_INFO"Hỗ Trợ tân thủ"me.szName"Bạn chưa gia nhập phái"nSeries);
        
    end
    end

    function tbGift:Taytuy()
            
    me.AddItem(18,1,191,1);
            
    me.AddItem(18,1,191,1);
            
    me.AddItem(18,1,191,1);
            
    me.AddItem(18,1,191,1);
            
    me.AddItem(18,1,191,1);
            
    me.AddItem(18,1,191,2);
            
    me.AddItem(18,1,191,2);
            
    me.AddItem(18,1,191,2);
            
    me.AddItem(18,1,191,2);
            
    me.AddItem(18,1,191,2);
            
    me.AddItem(18,1,192,1);
            
    me.AddItem(18,1,192,1);
            
    me.AddItem(18,1,192,1);
            
    me.AddItem(18,1,192,1);
            
    me.AddItem(18,1,192,1);
            
    me.AddItem(18,1,192,2);
            
    me.AddItem(18,1,192,2);
            
    me.AddItem(18,1,192,2);
            
    me.AddItem(18,1,192,2);
            
    me.AddItem(18,1,192,2);
            
    me.AddItem(18,1,236,1);
            
    me.AddItem(18,1,326,2);
            
    me.AddItem(18,1,326,2);
            
    me.AddItem(18,1,326,3);
            
    me.AddItem(18,1,326,3);
            
        
    end
        
    function tbGift:Huyentinh58()
            
    me.AddItem(18,1,1,5);
            
    me.AddItem(18,1,1,5);
            
    me.AddItem(18,1,1,5);
            
    me.AddItem(18,1,1,5);
            
    me.AddItem(18,1,1,5);
            
    me.AddItem(18,1,1,6);
            
    me.AddItem(18,1,1,6);
            
    me.AddItem(18,1,1,6);
            
    me.AddItem(18,1,1,6);
            
    me.AddItem(18,1,1,6);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,7);
            
    me.AddItem(18,1,1,8);
            
    me.AddItem(18,1,1,8);
            
    me.AddItem(18,1,1,8);
            
    me.AddItem(18,1,1,8);
            
    me.AddItem(18,1,1,8);
            
    me.AddItem(18,1,1,8);
        
    end
        
    function tbGift:Huyentinh910()
            
    me.AddItem(18,1,1,9);
            
    me.AddItem(18,1,1,9);
            
    me.AddItem(18,1,1,9);
            
    me.AddItem(18,1,1,9);
            
    me.AddItem(18,1,1,9);
            
    me.AddItem(18,1,1,10);
            
    me.AddItem(18,1,1,10);
            
    me.AddItem(18,1,1,10);
            
    me.AddItem(18,1,1,10);
            
    me.AddItem(18,1,1,10);
            
    end
        
    function tbGift:Huyentinh1112()
            
    me.AddItem(18,1,1,11);
            
    me.AddItem(18,1,1,11);
            
    me.AddItem(18,1,1,11);
            
    me.AddItem(18,1,1,11);
            
    me.AddItem(18,1,1,11);
            
    me.AddItem(18,1,1,12);
            
    me.AddItem(18,1,1,12);
            
    me.AddItem(18,1,1,12);
            
    me.AddItem(18,1,1,12);
            
    me.AddItem(18,1,1,12);
        
    end
    function tbGift:OnDialog_Nhiemvu()
    local szMsg"Hãy Lựa chọn";
    local tbOpt = {};
            
    table.insert(tbOpt, {"Danh Vọng Nghĩa Quân" self.Nghiaquanself});
            
    table.insert(tbOpt, {"Danh Vọng Quân Doanh" self.Quandoanhself});
            
    table.insert(tbOpt, {"Danh Vọng Học Tạo đồ" self.Hoctaodoself});
            
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
            
    Dialog:Say(szMsgtbOpt);
    end
    function tbGift:Nghiaquan()
            
    me.AddRepute(1,1,30000);
        
    end

        
    function tbGift:Quandoanh()
            
    me.AddRepute(1,2,30000);
        
    end

        
    function tbGift:Hoctaodo()
            
    me.AddRepute(1,3,30000);
        
    end

    function tbGift:OnDialog_Tongkim()
    local szMsg"Hãy Lựa chọn";
    local tbOpt = {};
            
    table.insert(tbOpt, {"Danh Vọng Dương Châu" self.Duongchauself});
            
    table.insert(tbOpt, {"Danh Vọng Phượng Tường" self.Phuongtuongself});
            
    table.insert(tbOpt, {"Danh Vọng Tương Dương" self.Tuongduongself});
            
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
            
    Dialog:Say(szMsgtbOpt);
    end
    function tbGift:Duongchau()
            
    me.AddRepute(2,1,30000);
        
    end
    function tbGift:Phuongtuong()
            
    me.AddRepute(2,2,30000);
        
    end
    function tbGift:Tuongduong()
            
    me.AddRepute(2,3,30000);
        
    end

    function tbGift:OnDialog_Monphai()
    local szMsg"Hãy Lựa chọn";
    local tbOpt = {};
            
    table.insert(tbOpt, {"Danh Vọng Thiếu Lâm" self.Thieulamself});
            
    table.insert(tbOpt, {"Danh Vọng Thiên Vương" self.Thienvuongself});
            
    table.insert(tbOpt, {"Danh Vọng Đường Môn" self.Duongmonself});    
            
    table.insert(tbOpt, {"Danh Vọng Ngũ Độc" self.Ngudocself});
            
    table.insert(tbOpt, {"Danh Vọng Nga Mi" self.Ngamiself});
            
    table.insert(tbOpt, {"Danh Vọng Thúy Yên" self.Thuyyenself});
            
    table.insert(tbOpt, {"Danh Vọng Cái Bang" self.Caibangself});
            
    table.insert(tbOpt, {"Danh Vọng Thiên Nhẫn" self.Thiennhanself});
            
    table.insert(tbOpt, {"Danh Vọng Võ Đang" self.Vodangself});
            
    table.insert(tbOpt, {"Danh Vọng Côn Lôn" self.Conlonself});
            
    table.insert(tbOpt, {"Danh Vọng Minh Giáo" self.Minhgiaoself});
            
    table.insert(tbOpt, {"Danh Vọng Đại Lý Đoàn thị" self.Doanthiself});
            
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
            
    Dialog:Say(szMsgtbOpt);
    end
    function tbGift:Thieulam()
            
    me.AddRepute(3,1,30000);
        
    end

        
    function tbGift:ThienVuong()
            
    me.AddRepute(3,2,30000);
        
    end

        
    function tbGift:Duongmon()
            
    me.AddRepute(3,3,30000);
        
    end

        
    function tbGift:Ngudoc()
            
    me.AddRepute(3,4,30000);
        
    end

        
    function tbGift:Ngami()
            
    me.AddRepute(3,5,30000);
        
    end

        
    function tbGift:Thuyyen()
            
    me.AddRepute(3,6,30000);
        
    end

        
    function tbGift:Caibang()
            
    me.AddRepute(3,7,30000);
        
    end

        
    function tbGift:Thiennhan()
            
    me.AddRepute(3,8,30000);
        
    end

        
    function tbGift:Vodang()
            
    me.AddRepute(3,9,30000);
        
    end

        
    function tbGift:Conlon()
            
    me.AddRepute(3,10,30000);
        
    end

        
    function tbGift:Minhgiao()
            
    me.AddRepute(3,11,30000);
        
    end

        
    function tbGift:Doanthi()
            
    me.AddRepute(3,12,30000);
        
    end

    function tbGift:Giatoc()
            
    me.AddRepute(4,1,30000);
        
    end

        
    function tbGift:OnDialog_Hoatdong()
    local szMsg"Hãy Lựa chọn";
    local tbOpt = {};
            
    table.insert(tbOpt, {"Danh Vọng Bạch Hổ Đường" self.Bachhoself});
            
    table.insert(tbOpt, {"Danh Vọng Thịnh Hạ 2008" self.Thinhha2008self});
            
    table.insert(tbOpt, {"Danh Vọng Tiêu Dao Cốc" self.Tieudaococself});
            
    table.insert(tbOpt, {"Danh Vọng Chúc Phúc" self.Chucphucself});
            
    table.insert(tbOpt, {"Danh Vọng Thịnh Hạ 2010" self.Thinhha2010self});
            
    table.insert(tbOpt, {"Danh Vọng Di tích Hàn vũ" self.Ditichhanvuself});
            
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
            
    Dialog:Say(szMsgtbOpt);
    end
    function tbGift:Bachho()
            
    me.AddRepute(5,1,30000);
        
    end
        
    function tbGift:Thinhha2008()
            
    me.AddRepute(5,2,30000);
        
    end
        
    function tbGift:Tieudaococ()
            
    me.AddRepute(5,3,30000);
        
    end
        
    function tbGift:Chucphuc()
            
    me.AddRepute(5,4,30000);
        
    end
        
    function tbGift:Thinhha2010()
            
    me.AddRepute(5,5,30000);
        
    end
        
    function tbGift:Ditichhanvu()
            
    me.AddRepute(5,6,30000);
        
    end
        
    function tbGift:OnDialog_Volam()
    local szMsg"Hãy Lựa chọn";
    local tbOpt = {};
            
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ(Kim)" self.CaothuKimself});
            
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ(Mộc)" self.CaothuMocself});
            
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ(Thủy)" self.CaothuThuyself});
            
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ(Hỏa)" self.CaothuHoaself});
            
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ(Thổ)" self.CaothuThoself});
            
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
            
    Dialog:Say(szMsgtbOpt);
    end
        
    function tbGift:CaothuKim()
            
    me.AddRepute(6,1,30000);
        
    end
            
    function tbGift:CaothuMoc()
            
    me.AddRepute(6,1,30000);
        
    end
            
    function tbGift:CaothuThuy()
            
    me.AddRepute(6,1,30000);
        
    end
            
    function tbGift:CaothuHoa()
            
    me.AddRepute(6,1,30000);
        
    end
            
    function tbGift:CaothuTho()
            
    me.AddRepute(6,1,30000);
        
    end
    function tbGift:Liendau()
        
    me.AddRepute(7,1,30000);
        
    end
    function tbGift:Lanhtho()
        
    me.AddRepute(8,1,30000);
        
    end
        
    function tbGift:Tanlang()
        
    me.AddRepute(9,1,30000);
        
    me.AddRepute(9,2,30000);
        
    end
    function tbGift:Doanvien()
        
    me.AddRepute(10,1,30000);
        
    end
    function tbGift:Daihoivolam()
        
    me.AddRepute(11,1,30000);
        
    end
    function tbGift:Liendauserver()
        
    me.AddRepute(12,1,30000);
        
    end
    function tbGift:OnDialog_AddRepute()
    local szMsg "Ta có thể giúp gì cho ngươi";
        
    local tbOpt = {};
        
    table.insert(tbOpt, {"Danh Vọng Nhiệm Vụ" self.OnDialog_Nhiemvuself});
        
    table.insert(tbOpt, {"Danh Vọng Tống Kim" self.OnDialog_Tongkimself});
        
    table.insert(tbOpt, {"Danh Vọng Môn Phái" self.OnDialog_Monphaiself});
        
    table.insert(tbOpt, {"Danh Vọng Gia Tộc",  self.Giatocself});
        
    table.insert(tbOpt, {"Danh Vọng Hoạt Động",  self.OnDialog_Hoatdongself});
        
    table.insert(tbOpt, {"Danh Vọng Khiêu Chiến Võ Lâm cao thủ",  self.OnDialog_Volamself});
        
    table.insert(tbOpt, {"Danh Vọng Võ Lâm Liên Đấu",  self.Liendauself});
        
    table.insert(tbOpt, {"Danh Vọng Lãnh Thổ tranh đoạt chiến",  self.Lanhthoself});
        
    table.insert(tbOpt, {"Danh Vọng Tần Lăng",  self.Tanlangself});
        
    table.insert(tbOpt, {"Danh Vọng Đoàn viên gia tộc",  self.Doanvienself});
        
    table.insert(tbOpt, {"Danh Vọng Đại Hội Võ Lâm",  self.Daihoivolamself});
        
    table.insert(tbOpt, {"Danh Vọng Liên đấu liên server",  self.Liendauserverself});
        
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
        
    Dialog:Say(szMsgtbOpt);
        
    end
    function tbGift:OnDialog_Themtien()
        
    local szMsg "Ta có thể giúp gì cho ngươi";
        
    local tbOpt = {
        {
    "Thêm đồng khóa" self.Dongkhoaself},
        {
    "Thêm đồng" self.Dongself},
        {
    "Thêm Bạc Khóa" self.Backhoaself},
        {
    "Thêm Bạc" self.Bacself},
        {
    "Tinh lực" self.Tinhlucself},
        {
    "Hoạt Lực" self.Hoatlucself},
        {
    "Thêm kinh nghiệm" self.AddExpself},
        {
    "Ta chỉ ghé ngang qua"},
        };
        
    Dialog:Say(szMsgtbOpt);
        
    end
    function tbGift:Bac()
            
    me.Earn(100000000,0);
        
    end
        
    function tbGift:Dong()
            
    me.AddJbCoin(100000000)
        
    end
        
    function tbGift:Backhoa()
            
    me.AddBindMoney(50000000);
        
    end
    function tbGift:Dongkhoa()
            
    me.AddBindCoin(50000000);    
        
    end
        
    function tbGift:AddExp()
            
    me.AddExp(2000000000);
        
    end
        
    function tbGift:Tinhluc()
        
    me.ChangeCurMakePoint(20002000);
    end
    function tbGift:Hoatluc()
        
    me.ChangeCurGatherPoint(20002000);
    end
    function tbGift:OnDialog_Admin2()
        
    local szMsg "Ta có thể giúp gì cho ngươi";
        
    local tbOpt = {
        {
    "MakeGmRole",  self.MakeGmRoleself},
        {
    "CallHimHere",  self.CallHimHereself},
        {
    "SendMeThere" self.SendMeThereself},
        {
    "ArrestHim" self.ArrestHimself},
        {
    "FreeHim" self.FreeHimself},
        {
    "KickHim",  self.KickHimself},
        {
    "_ApplyPlayerCall",  self._ApplyPlayerCallself},
        {
    "_OnLineCmd",  self._OnLineCmdself},
        {
    "_OnLineCmd_GC",  self._OnLineCmd_GCself},
        {
    "_SendPlayerCall",  self._SendPlayerCallself},
        {
    "_OnPlayerCall",  self._OnPlayerCallself},
        {
    "ScriptLogF",  self.ScriptLogFself},
        {
    "SendResultMsg",  self.SendResultMsgself},
        {
    "_OnResultMsg",  self._OnResultMsgself},
        {
    "IsHide",  self.IsHideself},
        {
    "SetHide",  self.SetHideself},
        {
    "GetMaxAdjustLevel",  self.GetMaxAdjustLevelself},
        {
    "AdjustLevel",  self.AdjustLevelself},
        {
    "OnEnterMap",  self.OnEnterMapself},
        {
    "OnLogin",  self.OnLoginself},
        {
    "SendMail",  self.SendMailself},
        {
    "_CallSomeoneHere",  self._CallSomeoneHereself},
        {
    "_CallMePos",  self._CallMePosself},
        {
    "_KickMe",  self._KickMeself},
        {
    "DbgOut",  self.DbgOutself},
        {
    "Ta chỉ ghé ngang qua"},
        };
        
    Dialog:Say(szMsgtbOpt);
        
    end

    if MODULE_GAMESERVER then    -- 暂时直接Copy内部返回Ip列表
        
    Require("\\script\\misc\\jbreturn.lua");
        
    tbGift.tbPermitIp    Lib:CopyTB1(jbreturn.tbPermitIp);
    end

    tbGift
    .SKILLID_GMHIDE    1462;

    -- 
    产生GM角色
    function tbGift:MakeGmRole()
        
    me.AddLevel(5-me.nLevel);    -- 初始5级
        
        me
    .SetCamp(6);                -- GM阵营
        me
    .SetCurCamp(6);
        
        
    me.AddFightSkill(163,60);    -- 60级梯云纵
        me
    .AddFightSkill(91,60);    -- 60级银丝飞蛛
        me
    .AddFightSkill(1417,1);    -- 1级移形换影
        
        me
    .SetExtRepState(1);        --    扩展箱令牌x1(已使用)

        me
    .AddItemEx(21811, {bForceBind=1}, 0);    -- 20格背包x3(绑定)
        me
    .AddItemEx(21811, {bForceBind=1}, 0);
        
    me.AddItemEx(21811, {bForceBind=1}, 0);
        
    me.AddItemEx(1811951, {bForceBind=1}, 0);    -- 无限传送符(无限期,绑定)
        me
    .AddItemEx(1814001, {bForceBind=1}, 0);    -- GM专用卡(无限期,绑定)
        local pItem    
    me.AddItemEx(113171, {bForceBind=1}, 0);    -- 二丫面具(无限期,绑定)
        me
    .DelItemTimeout(pItem);
        
    pItem    me.AddItemEx(113151, {bForceBind=1}, 0);        -- 圣诞少女面具(无限期,绑定)
        me
    .DelItemTimeout(pItem);
        
        
    me.AddBindMoney(100000100);
    end

    -- 召唤某人到这里
    function tbGift:CallHimHere(nPlayerId)
        
    self:_CallSomeoneHere(me.nIdnPlayerIdstring.format("拉玩家(%s)到当前位置"KGCPlayer.GetPlayerName(nPlayerId)));
    end

    -- 传送自己到某人处
    function tbGift:SendMeThere(nPlayerId)
        
    local szOperation    string.format("传送至玩家(%s)处"KGCPlayer.GetPlayerName(nPlayerId));
        
    GM.tbGift:_ApplyPlayerCall(me.nIdszOperationnPlayerId"GM.tbGift:_CallSomeoneHere"me.nIdme.nIdszOperation);
    end

    -- 关某人入天牢
    function tbGift:ArrestHim(nPlayerId)
        
    self:_OnLineCmd(me.nIdstring.format("关玩家(%s)入天牢"KGCPlayer.GetPlayerName(nPlayerId)), nPlayerId"Player:Arrest(me.szName)");
    end

    -- 解除某人天牢
    function tbGift:FreeHim(nPlayerId)
        
    self:_OnLineCmd(me.nIdstring.format("解除玩家(%s)天牢"KGCPlayer.GetPlayerName(nPlayerId)), nPlayerId"Player:SetFree(me.szName)");
    end

    -- 踢某人下线
    function tbGift:KickHim(nPlayerId)
        
    local szOperation    string.format("踢玩家(%s)下线"KGCPlayer.GetPlayerName(nPlayerId));
        
    GM.tbGift:_ApplyPlayerCall(me.nIdszOperationnPlayerId"GM.tbGift:_KickMe"me.nIdszOperation);
    end

    -- 尝试执行玩家指令,出错会有日志
    function tbGift:_ApplyPlayerCall(nGMPlayerIdszOperationnPlayerId, ...)
        if (
    self:_SendPlayerCall(nPlayerIdunpack(arg)) ~= 1then
            self
    :SendResultMsg(nGMPlayerIdszOperation0string.format("玩家(%s)不在线"KGCPlayer.GetPlayerName(nPlayerId)));
        
    end
    end

    -- 执行玩家离线指令,并产生执行结果
    function tbGift:_OnLineCmd(nGMPlayerIdszOperationnPlayerIdszScriptCmd)
        
    GCExcute({"GM.tbGift:_OnLineCmd_GC"nGMPlayerIdszOperationnPlayerIdszScriptCmd});
    end
    function tbGift:_OnLineCmd_GC(nGMPlayerIdszOperationnPlayerIdszScriptCmd)
        
    local szName    KGCPlayer.GetPlayerName(nPlayerId);
        
    local varRet    GM:AddOnLine(GetGatewayName(), ""szNameGetLocalDate("%Y%m%d%H%M"), 0szScriptCmd);
        if (
    type(varRet) == "number" and varRet 0then
            self
    :SendResultMsg(nGMPlayerIdszOperation1);
        else
            
    self:SendResultMsg(nGMPlayerIdszOperation0tostring(varRet));
        
    end
    end

    -- 发出玩家执行操作
    function tbGift:_SendPlayerCall(nPlayerId, ...)
        
    local nState    KGCPlayer.OptGetTask(nPlayerIdKGCPlayer.TSK_ONLINESERVER);
        if (
    nState <= 0then
            
    return 0;
        
    end
        
        GlobalExcute
    ({"GM.tbGift:_OnPlayerCall"nPlayerIdarg})

        return 
    1;
    end

    -- 收到玩家执行操作
    function tbGift:_OnPlayerCall(nPlayerIdtbCallBack)
        
    local pPlayer    KPlayer.GetPlayerObjById(nPlayerId);
        if (
    pPlayerthen
            pPlayer
    .Call(unpack(tbCallBack));
            
    self:DbgOut("_OnPlayerCall"pPlayer.szNametostring(tbCallBack[1]));
        
    end
    end

    -- 写脚本日志
    function tbGift:ScriptLogF(pPlayer, ...)
        
    local szMsg    string.format(unpack(arg));
        
    Dbg:WriteLogEx(Dbg.LOG_INFO"GM""GM_Operation"pPlayer.szNameszMsg);
    end

    -- 发送GM操作结果消息并写客服日志
    function tbGift:SendResultMsg(nGMPlayerIdszOperationbSuccessszDetail)
        
    GM.tbGift:_SendPlayerCall(nGMPlayerId"GM.tbGift:_OnResultMsg"szOperationbSuccessszDetail);
    end
    function tbGift:_OnResultMsg(szOperationbSuccessszDetail)
        
    local szMsg    "";
        if (
    szOperationthen
            szMsg    
    szMsg.."【操作】"..szOperation..";";
        
    end
        
    if (bSuccessthen
            szMsg    
    szMsg.."【结果】"..((bSuccess == and "成功") or "失败")..";";
        
    end
        
    if (szDetailthen
            szMsg    
    szMsg.."【详细】"..szDetail..";";
        
    end
        me
    .PlayerLog(Log.emKPLAYERLOG_TYPE_GM_OPERATIONszMsg);
        
    self:ScriptLogF(meszMsg);
        
    me.Msg(szMsg);
    end

    -- 是否隐身中
    function tbGift:IsHide()
        return 
    me.IsHaveSkill(self.SKILLID_GMHIDE);
    end

    -- 设置隐身
    function tbGift:SetHide(nHide)
        if (
    nHide == 1then
            me
    .AddFightSkill(self.SKILLID_GMHIDE1);
        else
            
    me.DelFightSkill(self.SKILLID_GMHIDE);
        
    end
        self
    :SendResultMsg(me.nId, (nHide == and "开始隐身") or "取消隐身"1);
    end

    -- 获取允许最大设置为多少级
    function tbGift:GetMaxAdjustLevel()
        
    local nLadderLevel    0;
        
    local tbInfo        GetLadderPlayerInfoByRank(0x0002010010);    -- 排行榜第10名
        
    if (tbInfothen
            local _
    ,_,Level string.find(tbInfo.szContext"(-?%d+)(.*)");
            
    nLadderLevel    tonumber(Level) or 0;
        
    end
        
    return math.max(nLadderLevel10);    -- 至少可以到达10级
    end

    -- 调整自身等级
    function tbGift:AdjustLevel(nLevel)
        
    local szOperation    string.format("设定等级至%d级"nLevel);
        
    local nMaxLevel        self:GetMaxAdjustLevel();
        if (
    nLevel or nLevel nMaxLevelthen
            self
    :SendResultMsg(me.nIdszOperation0string.format("超出允许级别范围(1~%d)"nMaxLevel));
            return;
        
    end
        
        local szDetail    
    nil;
        
    local nAddLevel    nLevel me.nLevel;
        if (
    nAddLevel 0then
            me
    .ResetFightSkillPoint();    -- 重置技能点
            me
    .UnAssignPotential();        -- 重置潜能点
            me
    .Msg("<color=green>您进行了降级操作,需要退出重登。否则客户端显示会有异常。");
            
    szDetail    "降级操作,引起技能点、潜能点重置";
        
    end
        me
    .AddLevel(nAddLevel);
        
    self:SendResultMsg(me.nIdszOperation1szDetail);
    end

    -- 当GM进入地图
    function tbGift:OnEnterMap(nMapId)
        
    local szMsg    string.format("到达地图:%s(%d),隐身状态:%d"GetMapNameFormId(nMapId), nMapIdself:IsHide());
        
    me.PlayerLog(Log.emKPLAYERLOG_TYPE_GM_OPERATIONszMsg);
        
    self:DbgOut(szMsg);
    end

    -- 当GM登入

    -- 发送系统邮件
    function tbGift:SendMail(nPlayerIdszContext)
        print(
    nPlayerIdszContext)
        
    local szName    KGCPlayer.GetPlayerName(nPlayerId);
        
    local szTitle    string.format("[%s]"me.szName);
        
    KPlayer.SendMail(szNameszTitleszContext);
        
        
    self:SendResultMsg(me.nIdstring.format("发邮件至玩家(%s)"szName), 1);
    end

    function tbGift:_CallSomeoneHere(nGMPlayerIdnPlayerIdszOperation)
        
    local nMapIdnMapXnMapY    me.GetWorldPos();
        
    local szMapClass    GetMapType(nMapId) or "";
        if (
    Map.tbMapItemState[szMapClass].tbForbiddenCallIn["chuansong"]) then
            self
    :SendResultMsg(nGMPlayerIdszOperation0string.format("(%s)所在地图(%s)禁止传入"me.szNameGetMapNameFormId(nMapId)));
            return;
        
    end
        GM
    .tbGift:_ApplyPlayerCall(nGMPlayerIdszOperationnPlayerId"GM.tbGift:_CallMePos"nGMPlayerIdnMapIdnMapXnMapYszOperation);
    end

    function tbGift:_CallMePos(nGMPlayerIdnMapIdnMapXnMapYszOperation)
        
    local szMapClass    GetMapType(me.nMapId) or "";
        if 
    Map.tbMapItemState[szMapClass].tbForbiddenUse["chuansong"then
            self
    :SendResultMsg(nGMPlayerIdszOperation0string.format("(%s)所在地图(%s)禁止传出"me.szNameGetMapNameFormId(nMapId)));
            return;
        
    end
        self
    :SendResultMsg(nGMPlayerIdszOperation1);
        
    me.NewWorld(nMapIdnMapXnMapY);
    end

    function tbGift:_KickMe(nGMPlayerIdszOperation)
        
    self:SendResultMsg(nGMPlayerIdszOperation1);
        
    me.KickOut();
    end

    -- 调试输出
    function tbGift:DbgOut(...)
        
    Dbg:Output("GM"unpack(arg));
    end 


    script 2

    PHP Code:
    --新手礼包:福利版推出后,所有新玩家可以领取一个新手礼包,每到一定等级均可从新手礼包中获得一定数量的金钱级道具奖励,总价值100RMB+

    SpecialEvent.NewPlayerGift = {};
    local NewPlayerGift SpecialEvent.NewPlayerGift;
    NewPlayerGift.IS_OPEN    EventManager.IVER_bOpenNewPlayerGift;
    NewPlayerGift.TASK_GROUP_ID 2034;
    NewPlayerGift.TASK_CURRENT_INDEX 10;

    NewPlayerGift.OPEN_DAY 20; --开服n天内建的角色才有礼包

    NewPlayerGift
    .SERVER_OPEN_DAY 20090605; -- 这天之后开的服才能

    NewPlayerGift
    .SHOW_OPTION_UNTIL 20090825; -- 只在这天之前显示选项


    NewPlayerGift
    .tbData = {
        [
    1] = {1, -- 所需等级
            
    {{18,1,195,1},1nil7*24*60}, -- {{物品GDPL}, 个数GenInfo(可选), 时限}
            },
        [
    2] = {10
            {{
    18,1,85,1},1},
            },
        [
    3] = {20,
            {{
    18,1,71,2},2},
            {{
    18,1,392,1},2,10},
            },
        [
    4] = {30,
            {{
    18,1,113,1},1},
            {{
    18,1,2,3},1},
            },
        [
    5] = {40,
            {
    "BindCoin",1000},
            {{
    18,1,114,4},10nil30*24*60}
            },
        [
    6] = {50,
            {{
    21,5,1,1},1},
            {
    "BindMoney"200000},
            },
        [
    7] = {60,
            {
    "BindCoin"2000},
            {{
    18,1,393,1},5},
            },
        [
    8] = {69,
            {{
    18,1,114,7},2nil30*24*60},
            {{
    18,1,394,1},5},
            },
        [
    9] = {79,
            {{
    18,1,394,1},10},
            {{
    18,1,212,1},2},
            },
        [
    10] = {89,
            {{
    18,1,394,1},10},
            {{
    18,1,212,1},3},
            },
        [
    11] = {99,
            {{
    18,1,395,1},2},
            },
    };

    -- 
    台湾版改动
    if (IVER_g_nTwVersion == 1then
    NewPlayerGift
    .tbData = {
        [
    1] = {1, -- 所需等级
            
    {{18,1,71,1},2},
            {{
    18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin",50},
            {
    "BindMoney"500},
            },
        [
    2] = {10
            {{
    18,1,71,1},3},
            {{
    18,1,77,1},2},    -- 铜钥匙
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {"BindCoin",100},
            {
    "BindMoney"1000},
            },
        [
    3] = {20,
            {{
    18,1,114,2},10},    -- 2级玄晶
            
    {{18,1,24,1},3},    -- 九转续命丸
            
    {{18,1,71,1},3},
            {
    "BindCoin",200},
            {
    "BindMoney"2000},        
            },
        [
    4] = {30,
            {{
    18,1,114,3},10},    -- 3级玄晶
            
    {{18,1,258,1},2},    -- 修炼丹
            
    {{18,1,113,1},1},    -- 小传声海螺
            
    {"BindCoin",300},
            },
        [
    5] = {40,
            {{
    18,1,114,4},10},    -- 3级玄晶
            
    {{18,1,258,1},2},    -- 修炼丹
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,2,3},1},        -- 金犀3级
            
    {"BindCoin",400},
            },
        [
    6] = {50,
            {{
    18,1,258,1},3},    -- 修炼丹
            
    {{21,3,1,1},1},        -- 8格包
            
    {{18,1,113,1},1},    -- 小传声海螺
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"500},
            },
        [
    7] = {60,
            {{
    18,1,114,5},5},    -- 5级玄晶
            
    {{18,1,82,1},3},    -- 银钥匙
            
    {{18,1,244,1},1},    -- 魂石箱(100)
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"600},
            },
        [
    8] = {69,
            {{
    18,1,114,6},3},    -- 6级玄晶
            
    {{18,1,82,1},3},    -- 银钥匙
            
    {{18,1,258,1},3},    -- 修炼丹
            
    {{18,1,2,4},1},        -- 金犀4级
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"700},
            },
        [
    9] = {79,
            {{
    18,1,114,6},5},    -- 6级玄晶
            
    {{18,1,258,1},3},    -- 修炼丹
            
    {{18,1,212,1},2},    -- 初级祈福令牌
            
    {{18,1,244,1},1},    -- 魂石箱(100)
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {"BindCoin"800},
            },
        [
    10] = {89,
            {{
    18,1,187,1},2},    -- 金钥匙
            
    {{18,1,212,1},2},    -- 初级祈福令牌
            
    {{18,1,114,6},2},    -- 6级玄晶
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,244,1},10},    -- 魂石箱(100)
            
    {"BindCoin"900},
            },
        [
    11] = {99,
            {{
    18,1,187,1},3},    -- 金钥匙
            
    {{18,1,212,1},3},    -- 初级祈福令牌
            
    {{18,1,114,6},3},    -- 6级玄晶
            
    {{18,1,195,1},1,nil,7*24*60}, -- 一周无限传送符
            
    {{18,1,85,1},1},    -- 乾坤符
            
    {{18,1,244,1},10},    -- 魂石箱(100)
            
    {"BindCoin"2000},
            },
    };    
    end

    NewPlayerGift
    .tbNeededSpace = {};
    NewPlayerGift.tbLevel = {};
    NewPlayerGift.tbAward = {}

    function 
    NewPlayerGift:Init()
        for 
    itb in ipairs(self.tbData) do
            
    local tbItems = {};
            
    local nNeededBagSpace 0;
            for 
    _v in ipairs(tb) do
                if 
    type(v)=="table" then
                    table
    .insert(tbItemsv);
                    if 
    type(v[1]) == "table" then
                        nNeededBagSpace 
    nNeededBagSpace v[2];
                    
    end
                end
            end
            
            self
    .tbLevel[i] = tb[1];
            
    self.tbNeededSpace[i] = nNeededBagSpace;
            
    self.tbAward[i] = tbItems;
        
    end
    end

    NewPlayerGift
    :Init();

    function 
    NewPlayerGift:GetCurrData(pPlayer)
        
    local nIndex =  pPlayer.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX);
        if 
    nIndex >= #self.tbData + 1 then
            
    return nil;
        
    end
        
        
    if nIndex == 0 then
            nIndex 
    1;
            
    pPlayer.SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX1);
        
    end
        
        
    return self.tbLevel[nIndex], self.tbNeededSpace[nIndex], self.tbAward[nIndex];
    end

    function NewPlayerGift:CanGetAward(pPlayer)
        
    local nLevelnNeededSpacetbItems self:GetCurrData(pPlayer);
        if 
    not nLevel then
            
    return 0"你已经领到这个礼包里面的所有礼物啦!";
        
    end
        
        
    if me.nLevel nLevel then
            
    return 0string.format("你需要达到%d级才能再领礼物。"nLevel);
        
    end
        
        
    if me.CountFreeBagCell() < nNeededSpace then
            
    return 0string.format("背包空间不足,请空出%d格之后再开启"nNeededSpace);
        
    end
        
    return 1;
    end

    function NewPlayerGift:GetAward(pPlayerpItem)
        
    local nResszMsg self:CanGetAward(pPlayer);
        if 
    nRes == 0 then
            
    return 0szMsg;
        
    end
        
        local nLevel
    nNeededSpacetbItems self:GetCurrData(pPlayer);
        
    local tbAddedItem = {};
        
    local szAward "";
        for 
    _tbItem in ipairs(tbItems) do
            if 
    tbItem[1] == "BindCoin" then
                pPlayer
    .AddBindCoin(tbItem[2], Player.emKBINDCOIN_ADD_EVENT);
                
    szAward szAward .. "绑定".. IVER_g_szCoinName .. tbItem[2] .. ",";
                
    KStatLog.ModifyAdd("bindcoin""[产出]新手礼包""总量"tbItem[2]);
            elseif 
    tbItem[1] == "BindMoney" then
                pPlayer
    .AddBindMoney(tbItem[2], Player.emKBINDMONEY_ADD_EVENT);
                
    szAward szAward .. "绑银" .. tbItem[2] .. ",";
                
    KStatLog.ModifyAdd("bindjxb""[产出]新手礼包""总量"tbItem[2]);
            else
                for 
    1tbItem[2] do
                    
    local pItem pPlayer.AddItem(unpack(tbItem[1]));
                    if 
    tbItem[3then
                        
    --pItem.SetGenInfo(1tbItem[3]);
                        --
    pItem.Sync();
                    
    end
                    
    if tbItem[4then
                        pPlayer
    .SetItemTimeout(pItemtbItem[4], 0)
                    
    end
                    pItem
    .Bind(1);
                    
    szAward szAward .. pItem.szName .. ",";
                
    end
            end
        end
        
        Dbg
    :WriteLog("SpecialEvent.NewPlayerGift"string.format("%s 获得新手礼包%d级物品:%s"me.szNamenLevelszAward));
        
    local nIndex =  pPlayer.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX);
        
    nIndex nIndex 1;
        
    pPlayer.SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEXnIndex);
        if 
    self.tbLevel[nIndexthen
            pItem
    .SetGenInfo(1self.tbLevel[nIndex]);
            
    pItem.Sync();
        
    end
        
    if nIndex >= #self.tbData + 1 then
            
    pItem.Delete(pPlayer);
            
    pPlayer.Msg("恭喜你达到99级,你已经领到这个礼包里面的所有礼物!");
        
    end
        
    return 1;
    end

    -- 在这个时间之前建的号可以可以给礼包
    function NewPlayerGift:GetCreateRoleDeadline()
        
    local nServerStartTime KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME);
        return 
    nServerStartTime self.OPEN_DAY 86400;
    end

    function NewPlayerGift:ShowOption()
        if 
    GetTime() <= Lib:GetDate2Time(self.SHOW_OPTION_UNTIL) and
            
    self.SERVER_OPEN_DAY <= tonumber(os.date("%Y%m%d"KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME))) then
            
    return 1;
        
    end
            
    end

    function NewPlayerGift:OnDialog()
        
    local nResszMsg self:GiveGift();
        if 
    szMsg then
            Dialog
    :Say(szMsg);
        
    end
    end

    function NewPlayerGift:GiveGift()
        if 
    self.IS_OPEN ~= 1 then
            
    return 0;
        
    end

        
    if (IVER_g_nTwVersion == 0then
            
    --6月5号后开的服
            
    if tonumber(os.date("%Y%m%d"KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME))) < self.SERVER_OPEN_DAY then
                
    return 0"本服务器不参与新手礼包活动";
            
    end
            
            
    --福利版已开启
            
    if SpecialEvent:IsWellfareStarted() ~= 1 then
                
    return 0"福利版功能尚未开启,敬请期待。";
            
    end
            
            local nCreateTime 
    tonumber(me.GetRoleCreateDate());
            
    local nDeadline self:GetCreateRoleDeadline();
            
            --
    开服20内建的角色
            
    if tonumber(os.date("%Y%m%d"nDeadline)) < nCreateTime then
                local tbTime 
    os.date("*t"nDeadline);
                return 
    0string.format("只有在%d年%d月%d日之前创建的角色才能够拿到新手礼包。"tbTime.yeartbTime.monthtbTime.day);
            
    end
            
            
    if me.GetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX) ~= 0 then
                
    return 0"你已经领取过新手礼包了。";
            
    end
        end
        
        
    if me.CountFreeBagCell() < 1 then
            
    return 0"背包空间不足,请空出一格之后再来"
        
    end
        
        local pItem 
    me.AddItem(1813511);
        if 
    pItem then
            me
    .SetTask(self.TASK_GROUP_IDself.TASK_CURRENT_INDEX1);
            
    pItem.SetGenInfo(1self.tbLevel[1]);
            
    pItem.Sync();
            
    Dbg:WriteLog("SpecialEvent.NewPlayerGift"string.format("%s 获得新手礼包"me.szName));
        
    end
        
        
    return 1;
    end




    local tbGift 
    Item:GetClass("newplayergift"); 
    tbGift.WULINSHIJIA_STARTTIME 20090922;  
    tbGift.WULINSHIJIA_ENDTIME   20091030;
    tbGift.WULINSHIJIA_ITEM_TIME 30*24*60;

    tbGift.TASK_GROUP_ID 2027;
    tbGift.TASK_GET_BUFF 80;
    tbGift.TASK_GET_YAOPAI 81;

    function 
    tbGift:OnUse()
        
    local nCurSec =  Lib:GetDate2Time(tonumber(GetLocalDate("%Y%m%d")));
        
    local nKaifuSec KGblTask.SCGetDbTaskInt(DBTASD_SERVER_STARTTIME);
        
    local nMinSec math.min(nCurSecnKaifuSec);
        
    local nMaxSec math.max(nCurSecnKaifuSec);    
        
    local nItemId it.dwId;
        
    local nItemLevel NewPlayerGift:GetCurrData(me);
        
        if (
    not nItemLevelthen
            Dialog
    :Say("已经没有礼物可以领取!");
            return 
    0;
        
    end
        
        local tbOpt 
    = {
        {
    "Nh岷璶 trang b峄?,self.TrangBi,self},
            --{string.format("
    <color=yellow>%s级<color>领取新手礼包奖励", nItemLevel), self.GetAwardLibao,self, nItemId},
        };
        if nMaxSec <= Lib:GetDate2Time(self.WULINSHIJIA_ENDTIME) and nMinSec >=  Lib:GetDate2Time(self. WULINSHIJIA_STARTTIME) then
            if me.GetTask(self.TASK_GROUP_ID, self.TASK_GET_BUFF) == 0 then
                table.insert(tbOpt , {"
    获得雏凤清鸣状态效果", self.GetAwardBuff,  self});
            end
            if me.GetTask(self.TASK_GROUP_ID, self.TASK_GET_YAOPAI) == 0 then
                table.insert(tbOpt , {"
    领取武林世家腰牌", self.GetAwardYaopai, self});
            end
        end
        table.insert(tbOpt , {"
    K岷縯 th煤c 膽峄慽 tho岷"});
        local szMsg = "
    Nh岷璶 trang b峄?FULL n脿o!!";
        Dialog:Say(szMsg, tbOpt);     
    end

    function tbGift:GetAwardBuff()
        local szMsg ="";
        local nGetBuff = me.GetTask(self.TASK_GROUP_ID, self.TASK_GET_BUFF);
        if me.nLevel >= 50 then
            Dialog:Say("
    您已经超过50级,不能领取。");
            return;
        end    
        if nGetBuff ~= 0 then
            Dialog:Say("
    您已经领取过了,不能再领。");    
            return;
        end    
        --幸运值880, 4级30点,,打怪经验879, 6级(70%)
        me.AddSkillState(880, 4, 2, 60 * 60 * Env.GAME_FPS, 1, 0, 1);
        --磨刀石 攻击
        me.AddSkillState(387, 6, 2, 60 * 60 * Env.GAME_FPS, 1, 0, 1);    
        --护甲片 血
        me.AddSkillState(385, 8, 2, 60 * 60 * Env.GAME_FPS, 1, 0, 1);
        me.SetTask(self.TASK_GROUP_ID, self.TASK_GET_BUFF, 1);    
        Dialog:Say("
    您成功获得雏凤清鸣状态效果。");
        return;
    end

    function tbGift:GetAwardYaopai()
        local nGetYaopai =     me.GetTask(self.TASK_GROUP_ID, self.TASK_GET_YAOPAI);
        if me.nFaction == 0 then
            Dialog:Say("
    只有加入门派才能领取腰牌。");
            return; 
        end
        if nGetYaopai ~= 0 then
            Dialog:Say("
    您已经领取过了。");    
            return;
        end    
        if me.CountFreeBagCell() < 1 then
            Dialog:Say("
    领奖需要1格背包空间。");
            return;
        end    
        local pItem = me.AddItem(18,1,480,1);   
        if not  pItem then    
            Dialog:Say("
    领取失败。");
            return;
        end 
        me.SetTask(self.TASK_GROUP_ID, self.TASK_GET_YAOPAI,1);
        me.SetItemTimeout(pItem, 30*24*60, 0);
        me.PlayerLog(Log.emKPLAYERLOG_TYPE_JOINSPORT, "
    [活动]增加物品"..pItem.szName);        
        Dbg:WriteLog("
    [增加物品]"..pItem.szName, me.szName);
        Dialog:Say("
    领取成功。");
    end

    function tbGift:GetAwardLibao(nItemId)
        local pItem = KItem.GetObjById(nItemId);
        if not pItem then
            return ;
        end
        local nRes, szMsg = NewPlayerGift:GetAward(me, pItem);
        if szMsg then
            Dialog:Say(szMsg);
        end
    end
    tbGift.tbSetItem = {
            {{2,6,257,10},{2,6,258,10},{2,6,259,10},{2,4,264,10},{2,6,261,10},{2,6,257,10},{2,6,258,10},{2,6,259,10},{2,4,264,10},{2,6,261,10},},
            {{2,7,513,10},{2,7,515,10},{2,7,517,10},{2,5,349,10},{2,7,521,10},{2,7,514,10},{2,7,516,10},{2,7,518,10},{2,7,520,10},{2,7,522,10},},
            {{2,10,713,10},{2,10,715,10},{2,10,717,10},{2,6,260,10},{2,10,721,10},{2,10,714,10},{2,10,716,10},{2,10,718,10},{2,10,720,10},{2,10,722,10},},
            {{2,5,346,10},{2,5,347,10},{2,5,348,10},{2,7,519,10},{2,5,350,10},{2,5,346,10},{2,5,347,10},{2,5,348,10},{2,7,519,10},{2,5,350,10},},
            {{2,11,721,10},{2,11,723,10},{2,11,725,10},{2,10,719,10},{2,11,729,10},{2,11,722,10},{2,11,724,10},{2,11,726,10},{2,11,728,10},{2,11,730,10},},
            {{2,4,261,10},{2,4,262,10},{2,4,263,10},{2,11,727,10},{2,4,265,10},{2,4,261,10},{2,4,262,10},{2,4,263,10},{2,11,727,10},{2,4,265,10},},
            {{4,6,95,10},{4,6,100,10},{4,6,105,10},{4,3,161,10},{4,6,115,10},{4,6,95,10},{4,6,100,10},{4,6,105,10},{4,3,151,10},{4,6,115,10},},
            {{4,3,158,10},{4,3,159,10},{4,3,160,10},{4,3,236,10},{4,3,162,10},{4,3,148,10},{4,3,149,10},{4,3,150,10},{4,4,460,10},{4,3,152,10},},
            {{4,8,353,10},{4,8,373,10},{4,8,393,10},{4,4,460,10},{4,8,433,10},{4,8,354,10},{4,8,374,10},{4,8,394,10},{4,8,414,10},{4,8,434,10},},
            {{4,8,459,10},{4,8,463,10},{4,8,467,10},{4,4,461,10},{4,8,475,10},{4,8,460,10},{4,8,464,10},{4,8,468,10},{4,4,461,10},{4,8,476,10},},
            {{4,9,487,10},{4,9,489,10},{4,9,491,10},{4,5,463,10},{4,9,495,10},{4,9,488,10},{4,9,490,10},{4,9,492,10},{4,8,472,10},{4,9,496,10},},
            {{4,10,461,10},{4,10,465,10},{4,10,469,10},{4,5,464,10},{4,10,477,10},{4,10,462,10},{4,10,466,10},{4,10,470,10},{4,5,463,10},{4,10,478,10},},
            {{4,10,463,10},{4,10,467,10},{4,10,471,10},{4,6,110,10},{4,10,479,10},{4,10,464,10},{4,10,468,10},{4,10,472,10},{4,9,494,10},{4,10,480,10},},
            {{4,10,501,10},{4,10,505,10},{4,10,509,10},{4,7,47,10},{4,10,517,10},{4,10,502,10},{4,10,506,10},{4,10,510,10},{4,5,464,10},{4,10,518,10},},
            {{4,10,503,10},{4,10,507,10},{4,10,511,10},{4,8,413,10},{4,10,519,10},{4,10,504,10},{4,10,508,10},{4,10,512,10},{4,10,474,10},{4,10,520,10},},
            {{4,3,233,10},{4,3,234,10},{4,3,235,10},{4,8,471,10},{4,3,237,10},{4,3,238,10},{4,3,239,10},{4,3,240,10},{4,6,110,10},{4,3,242,10},},
            {{4,4,454,10},{4,4,456,10},{4,4,458,10},{4,9,493,10},{4,4,462,10},{4,4,454,10},{4,4,456,10},{4,4,458,10},{4,10,476,10},{4,4,462,10},},
            {{4,4,455,10},{4,4,457,10},{4,4,459,10},{4,10,473,10},{4,4,463,10},{4,4,455,10},{4,4,457,10},{4,4,459,10},{4,10,514,10},{4,4,463,10},},
            {{4,7,41,10},{4,7,43,10},{4,7,45,10},{4,10,475,10},{4,7,49,10},{4,7,42,10},{4,7,44,10},{4,7,46,10},{4,10,516,10},{4,7,50,10},},
            {{4,5,457,10},{4,5,459,10},{4,5,461,10},{4,10,513,10},{4,5,465,10},{4,5,457,10},{4,5,459,10},{4,5,461,10},{4,3,241,10},{4,5,465,10},},
            {{4,5,458,10},{4,5,460,10},{4,5,462,10},{4,10,515,10},{4,5,466,10},{4,5,458,10},{4,5,460,10},{4,5,462,10},{4,7,48,10},{4,5,466,10},},
            {{4,11,81,10},{4,11,83,10},{4,11,85,10},{4,11,87,10},{4,11,89,10},{4,11,82,10},{4,11,84,10},{4,11,86,10},{4,11,88,10},{4,11,90,10},},
            {{4,11,91,10},{4,11,93,10},{4,11,95,10},{4,11,97,10},{4,11,99,10},{4,11,92,10},{4,11,94,10},{4,11,96,10},{4,11,98,10},{4,11,100,10},},
    }

    -------------------------------
    function tbGift:TrangBi(nFlag, nSeries)

    if not nFlag then
        local szMsg = "
    Nh岷璶 trang b峄?h峄?n脿o?";
        local tbOpt =
        {
            {"
    H峄?Kim",self.TrangBi,self,1,1},
            {"
    H峄?M峄檆",self.TrangBi,self,1,2},
            {"
    H峄?Th峄",self.TrangBi,self,1,3},
            {"
    H峄?H峄廰",self.TrangBi,self,1,4},
            {"
    H峄?Th峄?,self.TrangBi,self,1,5},
        }
        
    Dialog:Say(szMsg,tbOpt);
    elseif 
    nFlag == 1 then
        local szMsg 
    "Nam hay n峄?";
        
    local tbOpt =
        {
            {
    "Nam",self.TrangBi,self,2,nSeries},
            {
    "N峄?,self.TrangBi,self,2,nSeries+5},
        }
        Dialog:Say(szMsg,tbOpt);
    else    
            local tbItems = self.tbSetItem;
            for i = 1, 23 do
                me.AddItem(unpack(tbItems[i][nSeries]));
            end
    end

    end 
    ---em muốn thêm cái chức năng nhân đồ theo hệ của script 2 vào script 1 trong túi tân thủ ---
    em đã làm thử mà sao báo lỗi kì lắm --- lỗi font hay sao í
    thanks
    hơi khó đấy, tốt nhất là bạn tự viết lấy, chứ đừng làm kiểu ý, nhận đồ theo hệ dễ ợt mà, chỉ cần tìm tòi 1 tí là đc cố gắng lên, còn font chữ thì không quan trọng ...
    Khách viếng thăm hãy cùng duongquyet101 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

 

 

Các Chủ đề tương tự

  1. [KT] Xin Việt hóa Scrip Tẩy Tủy Đảo
    Bởi Lãng Tử Sầu trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 6
    Bài viết cuối: 26-06-12, 11:15 AM
  2. Cho mình xin Scrip của thằng Cường Hóa
    Bởi sunday2288 trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 1
    Bài viết cuối: 09-07-11, 09:25 PM
  3. Giúp em về đoạn scrip này với!!!
    Bởi mrr77641176 trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 7
    Bài viết cuối: 07-07-11, 11:17 PM
  4. Xin Scrip NPC nhận KNB
    Bởi luandaik trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 1
    Bài viết cuối: 14-02-11, 10:59 AM

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •  
Múi giờ GMT +7. Bây giờ là 10:17 AM.
vBulletin®, Copyright ©2000-2011, Jelsoft Enterprises Ltd.
CLBGamesVN không chịu trách nhiệm về Luật Bản Quyền của các tài liệu, bài viết v.v...được đăng tải trên diễn đàn này.
Diễn đàn phát triển dưới sự đóng góp của tất cả thành viên. BQT chỉ là những người thành lập ra sân chơi, quản lý và duy trì về mặt kỹ thuật, nội dung khi hợp lệ.