PDA

View Full Version : [KT] Ai giúp em về lỗi này ! túi tân thủ



longauto
29-08-12, 05:47 PM
e vào game k có túi tân thủ! nếu muốn ra nhận túi tân thủ ở lễ quan thì phải làm ntn ạk

nguyenduccu
29-08-12, 06:35 PM
e vào game k có túi tân thủ! nếu muốn ra nhận túi tân thủ ở lễ quan thì phải làm ntn ạk

\gameserver\script\npc\liguan.lua



{"Nhận túi tân thủ", self.tuitanthu, self},





function tbLiGuan:tuitanthu()
local nCount = me.GetItemCountInBags(18,1,351,1);
if (nCount == 0) then
local tbNewPlayerGiftItem = { 18, 1, 351, 1 }
local tbBaseProp = KItem.GetItemBaseProp(unpack(tbNewPlayerGiftItem)) ;
if not tbBaseProp then
return;
end

local tbItem =
{
nGenre = tbNewPlayerGiftItem[1],
nDetail = tbNewPlayerGiftItem[2],
nParticular = tbNewPlayerGiftItem[3],
nLevel = tbNewPlayerGiftItem[4],
nSeries = (tbBaseProp.nSeries > 0) and tbBaseProp.nSeries or 0,
bBind = KItem.IsItemBindByBindType(tbBaseProp.nBindType),
nCount = 1;
};

if (0 == me.CanAddItemIntoBag(tbItem)) then
me.Msg("Hành trang đầy");
return;
end

tbNewPlayerGiftItem[5] = tbItem.nSeries;
me.AddItem(unpack(tbNewPlayerGiftItem));
me.Msg("Nhận được Túi tân thủ !");
else
Dialog:Say("<color=red> Bạn đã có Túi tân thủ <color>");
end
end