--lua script --ʹ����ʯ���忨 --#include "data\functions\GlobalMiscExpand\GlobalMisc.txt" once --#include "data\config\item\ConcVipItem.txt" once --[[ --����buff����Ʒ --sysarg:ʵ���ָ�� --itemidx: ��Ʒ��ID --itemPtr: ��Ʒ��ָ�� --ItemTable: ���õIJ����б� --]] function UseConcVipItem(sysarg, count, itemidx, itemPtr,ItemTable, delType, param) --��ʯ���忨��һ����һ������������ --print("UseConcVipItem, itemidx="..itemidx) if(Actor.getItemCount(sysarg, itemidx) == 0) then Actor.sendTipmsg( sysarg, OldLang.Script.comm015, ttFlyTip ) return end local vipType = ItemTable.vipType if not vipType then --������ʯ�������� Actor.sendTipmsg( sysarg,OldLang.Script.vipConc021, ttTipmsgWindow + ttFly) return end local vip = VipConcCfg.Vips[vipType] if not vip then Actor.sendTipmsg( sysarg,OldLang.Script.vipConc021, ttTipmsgWindow + ttFly) return end if Actor.removeItemByPtr(sysarg, itemPtr, 1, true, "ConcVipItem", 233) > 0 then if not Actor.isConcurrentVip( sysarg, vipType ) then if DoBuyConcVip( sysarg, vip, ItemTable.addHour ) then --���� local actorId = Actor.getActorId(sysarg) local actorName = Actor.getName(sysarg) System.sendCommonLog(234, actorId, actorName, vipType, ItemTable.item_id, ConcVipWay.AddByItem, "", "", OldLang.Script.vipConc025) end else if DoRenewalConcVip( sysarg, vip, ItemTable.addHour ) then --���� local actorId = Actor.getActorId(sysarg) local actorName = Actor.getName(sysarg) System.sendCommonLog(234, actorId, actorName, vipType, ItemTable.item_id, ConcVipWay.AddByItem, "", "", OldLang.Script.vipConc026) end end return true end end function UseConcVipItemInit(sysarg) for i = 1,table.getn(ConcVipItemTable) do local x = ConcVipItemTable[i] GlobalItemFn[x.item_id] = { func = UseConcVipItem, params = x } end end table.insert(InitFnTable, UseConcVipItemInit)