vu620
28-10-16, 11:36 AM
Bác nào hảo tâm cho mình xin cái Script Tân mãng phù nuốt vào cái tàn Khuyết nó thành Liên nhung với ! Mình làm mãi không được ! Tks trước =((
-- ´´½¨ÈË[ QUFEI 2007-09-30 21:53 UPDATE BugID 25759 ]
-- ÐÞ¸ÄÈË[ ñÒÉÙ΢ 2008.5.20 Ìí¼Ó102c¤pÉñÆ÷toÕ ðµ ºÏ³ÉÅä·½ ]
-- ѪԡÉñ±øÍêÕûÖ÷²ÄtoÕ ðµ ºÏ³É»úÖÆʵÏÖ (¸Ä³ÉÕýÈ·Tên)
-- ItemID = 30505800~30505805(ÐÂçÉñ·û) 30505806 102c¤pÉñÆ÷
-- 335135
-- Ìá¸ßÉñ·ûÍê³É¶È¼°ÍêÕûÉñ·ûto Õ ðµ ºÏ³É
-- ÎïÆ·¿ÉÒÔʹÓÃ1´Î
-- ʹÓÃÍê¾Íɾ³ýÎïÆ·
--************************************************** ****************************
-- ÒÔϲ¿·ÖC¥n ÐúngC¥n ÐÞ¸ÄtoÕ ðµ ²¿·Ö
--************************************************** ****************************
--½Å±¾ºÅ (¸Ä³ÉÕýÈ·½Å±¾ºÅ)
x335135_g_scriptId = 335135
-- Ôö¼ÓÖµ (¸ù¾ÝÒªÇó¸Äд¾ßÌåÊýÖµ)
x335135_g_CompleteValue = 5 -- Éñ²ÄÔö¼ÓÍê³É¶È -- ñÒÉÙ΢,102ÉñÆ÷.·½±ã²âÊÔµ÷³É� �Ë50,²âÊÔÍê±Ïµ÷»Ø5¼´¿É.
--x335135_g_MaxCompleteValue = 100-- ×î´óÉñ²ÄÍê³É¶ÈÉÏÏÞ
x335135_g_MaxUseCount = 1 -- ×î´óʹÓôÎÊý1´Î
--±ê׼Ч¹ûID (¸Ä³ÉÉñ²ÄºÏ³ÉtoÕ ðµ ÌØЧ)
--g_ImpactID = 0
--Éñ²ÄºÏ³É¶ÔÓ¦±í
x335135_g_ShenCaiTable = {{sjid=30505700,sfid=30505800,lrid=30505900},
{sjid=30505701,sfid=30505801,lrid=30505901},
{sjid=30505702,sfid=30505802,lrid=30505902},
{sjid=30505703,sfid=30505803,lrid=30505903},
{sjid=30505704,sfid=30505804,lrid=30505904},
{sjid=30505705,sfid=30505805,lrid=30505905},
{sjid=30505706,sfid=30505806,lrid=30505906},} -- -- ñÒÉÙ΢ 2008.5.20. 102c¤pÉñÆ÷ÖýÔìͼÑù.²ÐȱtoÕ ðµ Éñ½Ú7c¤p,Tân mãng th¥n phù c¤p 7,Á¬ÈÖÉñ½Ú7c¤p.
x335135_g_MaxCompleteValue = {25,50,75,100,100,100,100}
-- µ±Ç°¿ÉÒԺϳÉtoÕ ðµ Éñ²ÄË÷ÒýºÅ
x335135_g_ShenCaiIndex = 0
-- ʹÓÃÐÂçÉñ·ûÔö¼ÓÍêÕû¶Èʱto Õ ðµ ÌØЧID
x335135_g_Impact_LevelUP = 47
-- ºÏ³É³öÁ¬ÈÖÉñ½ÚʱtoÕ ðµ ÌØЧID
x335135_g_Impact_Complete = 48
-- ñÒÉÙ΢,102ÉñÆ÷
x335135_g_XinMang7JiInfo = "Tân mãng th¥n phù c¤p 7"
--************************************************** ****************************
-- ÒÔÉϲ¿·ÖC¥n ÐúngC¥n ÐÞ¸ÄtoÕ ðµ ²¿·Ö
--************************************************** ****************************
--½Å±¾
--**********************************
--ʼþ½»»¥Èë¿Ú
--**********************************
function x335135_OnDefaultEvent( sceneId, selfId, bagIndex )
-- ²»C¥n Cái này ½Ó¿Ú,µ«Òª±£Áô¿Õº¯Êý
end
--**********************************
--Cái này ÎïÆ·toÕ ðµ ʹÓùý³ÌÐúng·ñÀàËÆÓÚ¼¼ÄÜ:
--H® th¯ng»áTÕi Ö´ÐпªÊ¼Ê±¼ì²âCái này º¯ÊýtoÕ ðµ Tr· v«Öµ,Èç¹ûTr· v«th¤t bÕiÔòºöÂÔºóÃætoÕ ðµ ÀàËƼ¼ÄÜtoÕ ðµ Ö´ÐÐ.
--Tr· v«1: ¼¼ÄÜÀàËÆtoÕ ðµ ÎïÆ·,¿ÉÒÔ¼ÌÐøÀàËƼ¼ÄÜtoÕ ðµ Ö´ÐУ»Tr· v«0: ºöÂÔºóÃætoÕ ðµ ²Ù×÷.
--**********************************
function x335135_IsSkillLikeScript( sceneId, selfId)
return 1 --Cái này ½Å±¾C¥n ¶¯×÷Ö§³Ö
end
--**********************************
--Ìõ¼þ¼ì²âÈë¿Ú:
--H® th¯ng»áTÕi ¼¼Äܼì²âtoÕ ðµ ʱ¼ä ði¬mµ÷ÓÃCái này ½Ó¿Ú,²¢¸ù¾ÝCái này º¯ÊýtoÕ ðµ Tr· v«ÖµXác nh§nÒÔºótoÕ ðµ Á÷³ÌÐúng·ñÖ´ÐÐ.
--Tr· v«1: Ìõ¼þ¼ì²âͨ¹ý,¿ÉÒÔ¼ÌÐøÖ´ÐÐ� �»Tr· v«0: Ìõ¼þ¼ì²âth¤t bÕi,ÖжϺóÐøÖ´ÐÐ.
--**********************************
function x335135_OnConditionCheck( sceneId, selfId )
-- PrintStr("OnConditionCheck...")
--УÑéʹÓÃtoÕ ðµ ÎïÆ·
if(1~=LuaFnVerifyUsedItem(sceneId, selfId)) then
return 0
end
-- ði¬mµ½µ±Ç°ÕýTÕi ʹÓÃtoÕ ðµ ÎïÆ·toÕ ðµ trí tay näi
local nIndex = LuaFnGetBagIndexOfUsedItem( sceneId, selfId )
-- ði¬mµ½µ±Ç°ÕýTÕi ʹÓÃtoÕ ðµ ÎïÆ·toÕ ðµ ID
local Item01 = LuaFnGetItemTableIndexByIndex(sceneId, selfId, nIndex)
-- PrintStr("Item01 ="..Item01)
-- ñÒÉÙ΢ 2008.5.20. 102c¤pÉñÆ÷ÖýÔìͼÑù.ÆßcáiÐÂÃ§É ñ·û.
for i=1, 7 do --for i=1, 6 do
if Item01 == x335135_g_ShenCaiTable[i].sfid then
x335135_g_ShenCaiIndex = i
-- PrintStr("x335135_g_ShenCaiIndex ="..x335135_g_ShenCaiIndex)
break
end
-- PrintStr("sfid ="..x335135_g_ShenCaiTable[i].sfid)
end
-- PrintStr("x335135_g_ShenCaiIndex ="..x335135_g_ShenCaiIndex)
-- ñÒÉÙ΢ 2008.5.20. 102c¤pÉñÆ÷ÖýÔìͼÑù.Ìí¼ÓÐÂtoÕ ðµ ÐÂçÉñ·û
if Item01 < 30505800 or Item01 > 30505806 then -- if Item01 < 30505800 or Item01 > 30505805 then
local strNotice = "Chï có th¬ dùng tân mãng th¥n phù hþp thành" -- ÐÂçÉñ·û
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
-- PrintStr("sjid ="..x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid)
local ItemCount = LuaFnGetAvailableItemCount( sceneId, selfId, x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid )
if ItemCount < 1 then
local strNotice = "Ngß½i c¥n ".."#{_ITEM"..(x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid).."}" -- ²ÐȱtoÕ ðµ Éñ½Ú
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
local bagbegin = GetBasicBagStartPos(sceneId, selfId)
local bagend = GetBasicBagEndPos(sceneId, selfId)
-- PrintStr("bagbegin ="..bagbegin)
-- PrintStr("bagend ="..bagend)
local ItemEX
-- ðÕt ðßþcµ±Ç°¿ÉÒԺϳÉtoÕ ðµ µÚmµt cáiÉñ½ÚTÕi ±³°üÖÐtoÕ ðµ λÖÃ
local sjbagpos = -1
for i=bagbegin, bagend do
if LuaFnIsItemAvailable( sceneId, selfId, i ) == 1 then
ItemEX = LuaFnGetItemTableIndexByIndex(sceneId, selfId, i)
if ItemEX == x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid then
-- PrintStr("ItemEX ="..ItemEX)
sjbagpos = i
break
end
end
end
-- PrintStr("sjbagpos ="..sjbagpos)
if sjbagpos == -1 then
local strNotice = "Ngß½i c¥n ".."#{_ITEM"..(x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid).."}" -- ²ÐȱtoÕ ðµ Éñ½Ú
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
-- PrintStr("sjbagpos ="..sjbagpos)
local CheckParam = GetBagItemParam( sceneId, selfId, sjbagpos, 8, 2 )
-- PrintStr("CheckParam ="..CheckParam)
if CheckParam < x335135_g_MaxCompleteValue[x335135_g_ShenCaiIndex] and CheckParam + x335135_g_CompleteValue >= x335135_g_MaxCompleteValue[x335135_g_ShenCaiIndex] then -- µ±ÍêÕû¶È´ïµ½100ʱÐúng·ñ»¹ÓÐ� �Õ¼ä
local FreeSpace = LuaFnGetPropertyBagSpace( sceneId, selfId )
if( FreeSpace < 1 ) then
local strNotice = "Ô ðÕo cø không có không gian, c¥n sØa sang lÕi."
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
end
-- ñÒÉÙ΢,102ÉñÆ÷.Èç¹ûʹÓÃtoÕ ðµ ÐúngTân mãng th¥n phù c¤p 7
if Item01 == 30505806 then
x335135_g_XinMang7JiInfo = GetBagItemTransfer( sceneId, selfId, nIndex )
--PrintStr(x335135_g_XinMang7JiInfo)
end
return 1; --²»C¥n ÈκÎÌõ¼þ,²¢ÇÒʼÖÕTr· v«1.
end
--**********************************
--ÏûºÄ¼ì²â¼°´¦ÀíÈë¿Ú:
--H® th¯ng»áTÕi ¼¼ÄÜÏûºÄtoÕ ðµ ʱ¼ä ði¬mµ÷ÓÃCái này ½Ó¿Ú,²¢¸ù¾ÝCái này º¯ÊýtoÕ ðµ Tr· v«ÖµXác nh§nÒÔºótoÕ ðµ Á÷³ÌÐúng·ñÖ´ÐÐ.
--Tr· v«1: ÏûºÄ´¦Àíͨ¹ý,¿ÉÒÔ¼ÌÐøÖ´ÐÐ� �»Tr· v«0: ÏûºÄ¼ì²âth¤t bÕi,ÖжϺóÐøÖ´ÐÐ.
--×¢Òâ: Õâ²»¹â¸ºÔðÏûºÄtoÕ ðµ ¼ì²âÒ²¸ºÔðÏûºÄtoÕ ðµ Ö´ÐÐ.
--**********************************
function x335135_OnDeplete( sceneId, selfId )
if(0<LuaFnDepletingUsedItem(sceneId, selfId)) then
return 1
end
return 0
end
--**********************************
--Ö»»áÖ´ÐÐmµt ´ÎÈë¿Ú:
--¾ÛÆøºÍ˲·¢¼¼ÄÜ»áTÕi ÏûºÄÍê³Éºóµ÷ÓÃCái này ½Ó¿Ú(¾ÛÆø½áÊø²¢ÇÒ¸÷ÖÖÌõ¼þ� �¼Thöa mãntoÕ ðµ ʱºò),¶øÒýµ¼
--¼¼ÄÜÒ²»áTÕi ÏûºÄÍê³Éºóµ÷ÓÃCái này ½Ó¿Ú(¼¼ÄÜtoÕ ðµ mµt ¿ªÊ¼,ÏûºÄ³É¹¦Ö´ÐÐÖ®ºó).
--Tr· v«1: ´¦Àí³É¹¦£»Tr· v«0: ´¦Àíth¤t bÕi.
--×¢: ÕâÀïÐúng¼¼ÄÜÉúЧmµt ´ÎtoÕ ðµ Èë¿Ú
--**********************************
function x335135_OnActivateOnce( sceneId, selfId )
-- PrintStr("OnActivateOnce...")
local ItemCount = LuaFnGetAvailableItemCount( sceneId, selfId, x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid )
if ItemCount < 1 then
local strNotice = "Ngß½i c¥n ".."#{_ITEM"..(x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid).."}" -- ²ÐȱtoÕ ðµ Éñ½Ú
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
-- ði¬mµ½µ±Ç°ÕýTÕi ʹÓÃtoÕ ðµ ÎïÆ·toÕ ðµ trí tay näi
local nIndex = LuaFnGetBagIndexOfUsedItem( sceneId, selfId )
-- PrintStr("nIndex ="..nIndex)
-- ði¬mµ½µ±Ç°ÕýTÕi ʹÓÃtoÕ ðµ ÎïÆ·toÕ ðµ ID
local Item01 = x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sfid
-- PrintStr("Item01 ="..Item01)
--ÏûºÄÑ¡ÖÐtoÕ ðµ ÐÂçÉñ·û
-- ret = LuaFnDelAvailableItem(sceneId, selfId, Item01, 1)
local bagbegin = GetBasicBagStartPos(sceneId, selfId)
local bagend = GetBasicBagEndPos(sceneId, selfId)
-- PrintStr("bagbegin ="..bagbegin)
-- PrintStr("bagend ="..bagend)
local ItemEX
-- ðÕt ðßþcµ±Ç°¿ÉÒԺϳÉtoÕ ðµ µÚmµt cáiÉñ½ÚTÕi ±³°üÖÐtoÕ ðµ λÖÃ
local sjbagpos = -1
for i=bagbegin, bagend do
if LuaFnIsItemAvailable( sceneId, selfId, i ) == 1 then
ItemEX = LuaFnGetItemTableIndexByIndex(sceneId, selfId, i)
if ItemEX == x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid then
-- PrintStr("ItemEX ="..ItemEX)
sjbagpos = i
break
end
end
end
-- PrintStr("sjbagpos ="..sjbagpos)
if sjbagpos == -1 then
local strNotice = "Ngß½i c¥n ".."#{_ITEM"..(x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid).."}" -- ²ÐȱtoÕ ðµ Éñ½Ú
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
-- ðÕt ðßþcµ±Ç°ºÏ³ÉtoÕ ðµ Éñ½ÚÍêÕû¶È
local CompleteValue = GetBagItemParam( sceneId, selfId, sjbagpos, 8, 2 )
-- PrintStr("CompleteValue ="..CompleteValue)
if nIndex >= 0 then
-- ¼Ç¼ͳ¼ÆÐÅÏ¢
LuaFnAuditShenCai(sceneId, selfId, Item01)
CompleteValue = CompleteValue + x335135_g_CompleteValue
-- PrintStr("CompleteValue ="..CompleteValue)
SetBagItemParam( sceneId, selfId, sjbagpos, 8, 2, CompleteValue ) --ÉèÖÃÍê³É¶È
-- ñÒÉÙ΢,2008.5.22 Ìí¼ÓÊÀ½çH® th¯ng¹«¸æ #ISØ døng mµt cáiÐÂçÉñ·û#G7c¤p#I,ÀëÖý³É¾øÊÀ ÉñÆ÷ÓÖ½üÁËmµt ²½.
if Item01 == 30505806 then
local playername = GetName(sceneId, selfId)
local strText = format("#{_INFOUSR%s}#{DQSJ_20080512_12}#{_INFOMSG%s}#{DQS J_20080512_13}", playername, x335135_g_XinMang7JiInfo)
BroadMsgByChatPipe(sceneId,selfId, strText, 4)
end
--------------²ÎÊýÉèÖð²È«ÐÔ¼ì²â,ËäÈ»Àí� �ÛÉϲÎÊýÉèÖò»»áth¤t bÕi
local CheckParam = GetBagItemParam( sceneId, selfId, sjbagpos, 8, 2 )
-- PrintStr("CheckParam ="..CheckParam)
if CheckParam ~= CompleteValue then
return 0
end
--------------²ÎÊýÉèÖð²È«ÐÔ¼ì²â,ËäÈ»Àí� �ÛÉϲÎÊýÉèÖò»»áth¤t bÕi
local strNotice = "Cüa ngß½i ".."#{_ITEM"..(x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid).."}".."Ð¥y ðü ðµ gia tång 1 r°i" -- ²ÐȱtoÕ ðµ Éñ½Ú
x335135_ShowMsg( sceneId, selfId, strNotice)
LuaFnRefreshItemInfo( sceneId, selfId, sjbagpos ) --ˢб³°üÐÅÏ¢
if CompleteValue >= x335135_g_MaxCompleteValue[x335135_g_ShenCaiIndex] then -- µ±ÍêÕû¶È´ïµ½100ʱ
local EraseRet = EraseItem( sceneId, selfId, sjbagpos )
if EraseRet < 0 then --Èç¹ûɾ³ýth¤t bÕi,½«²»»á²úÉúÈκÎЧ¹û
return 0
end
-- PrintStr("lrid ="..x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].lrid)
BeginAddItem( sceneId )
AddItem( sceneId, x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].lrid, 1 )
ret = EndAddItem( sceneId, selfId )
if ret > 0 then
TryRecieveItem( sceneId, selfId, x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].lrid, QUALITY_MUST_BE_CHANGE ) -- ·Å²»Ï¾ÍûÓÐÁË
else
BeginEvent(sceneId)
strText = "Ô ðÕo cø ho£c nguyên li®u không ðü không gian, thïnh sØa sang lÕi sau lÕi ðªn lînh."
AddText(sceneId,strText);
EndEvent(sceneId)
DispatchMissionTips(sceneId,selfId)
return 0
end
LuaFnSendSpecificImpactToUnit( sceneId, selfId, selfId, selfId, x335135_g_Impact_Complete, 0 )
else
LuaFnSendSpecificImpactToUnit( sceneId, selfId, selfId, selfId, x335135_g_Impact_LevelUP, 0 )
end
else
local strMsg = "Hþp thành th¤t bÕi"
x335135_ShowMsg( sceneId, selfId, strMsg)
return 0
end
-- Ö÷²ÄºÏ³ÉÍê±Ï
-- LuaFnSendSpecificImpactToUnit(sceneId, selfId, selfId, selfId, g_ImpactID, 0)
return 1
end
--**********************************
--Òýµ¼ÐÄÌø´¦ÀíÈë¿Ú:
--Òýµ¼¼¼ÄÜ»áTÕi ÿ´ÎÐÄÌø½áÊøʱµ÷ÓÃCái này ½Ó¿Ú.
--Tr· v«: 1¼ÌÐøÏ´ÎÐÄÌø£»0: ÖжÏÒýµ¼.
--×¢: ÕâÀïÐúng¼¼ÄÜÉúЧmµt ´ÎtoÕ ðµ Èë¿Ú
--**********************************
function x335135_OnActivateEachTick( sceneId, selfId )
return 1
end
--**********************************
--Ö±½ÓHuÖ böЧ¹û:
--H® th¯ng»áÖ±½Óµ÷ÓÃCái này ½Ó¿Ú,²¢¸ù¾ÝCái này º¯ÊýtoÕ ðµ Tr· v«ÖµXác nh§nÒÔºótoÕ ðµ Á÷³ÌÐúng·ñÖ´ÐÐ.
--Tr· v«1: ÒѾHuÖ bö¶ÔӦЧ¹û,²»ÔÙÖ´ÐкóÐø²Ù× ÷£»Tr· v«0: ûÓмì²âµ½Ïà¹ØЧ¹û,¼ÌÐøÖ´� �Ð.
function x335135_CancelImpacts( sceneId, selfId )
return 0 --²»C¥n Cái này ½Ó¿Ú,µ«Òª±£Áô¿Õº¯Êý,²¢ÇÒʼ ÖÕTr· v«0.
end
function x335135_ShowMsg( sceneId, selfId, strMsg)
BeginEvent( sceneId )
AddText( sceneId, strMsg )
EndEvent( sceneId )
DispatchMissionTips( sceneId, selfId )
end
-- ´´½¨ÈË[ QUFEI 2007-09-30 21:53 UPDATE BugID 25759 ]
-- ÐÞ¸ÄÈË[ ñÒÉÙ΢ 2008.5.20 Ìí¼Ó102c¤pÉñÆ÷toÕ ðµ ºÏ³ÉÅä·½ ]
-- ѪԡÉñ±øÍêÕûÖ÷²ÄtoÕ ðµ ºÏ³É»úÖÆʵÏÖ (¸Ä³ÉÕýÈ·Tên)
-- ItemID = 30505800~30505805(ÐÂçÉñ·û) 30505806 102c¤pÉñÆ÷
-- 335135
-- Ìá¸ßÉñ·ûÍê³É¶È¼°ÍêÕûÉñ·ûto Õ ðµ ºÏ³É
-- ÎïÆ·¿ÉÒÔʹÓÃ1´Î
-- ʹÓÃÍê¾Íɾ³ýÎïÆ·
--************************************************** ****************************
-- ÒÔϲ¿·ÖC¥n ÐúngC¥n ÐÞ¸ÄtoÕ ðµ ²¿·Ö
--************************************************** ****************************
--½Å±¾ºÅ (¸Ä³ÉÕýÈ·½Å±¾ºÅ)
x335135_g_scriptId = 335135
-- Ôö¼ÓÖµ (¸ù¾ÝÒªÇó¸Äд¾ßÌåÊýÖµ)
x335135_g_CompleteValue = 5 -- Éñ²ÄÔö¼ÓÍê³É¶È -- ñÒÉÙ΢,102ÉñÆ÷.·½±ã²âÊÔµ÷³É� �Ë50,²âÊÔÍê±Ïµ÷»Ø5¼´¿É.
--x335135_g_MaxCompleteValue = 100-- ×î´óÉñ²ÄÍê³É¶ÈÉÏÏÞ
x335135_g_MaxUseCount = 1 -- ×î´óʹÓôÎÊý1´Î
--±ê׼Ч¹ûID (¸Ä³ÉÉñ²ÄºÏ³ÉtoÕ ðµ ÌØЧ)
--g_ImpactID = 0
--Éñ²ÄºÏ³É¶ÔÓ¦±í
x335135_g_ShenCaiTable = {{sjid=30505700,sfid=30505800,lrid=30505900},
{sjid=30505701,sfid=30505801,lrid=30505901},
{sjid=30505702,sfid=30505802,lrid=30505902},
{sjid=30505703,sfid=30505803,lrid=30505903},
{sjid=30505704,sfid=30505804,lrid=30505904},
{sjid=30505705,sfid=30505805,lrid=30505905},
{sjid=30505706,sfid=30505806,lrid=30505906},} -- -- ñÒÉÙ΢ 2008.5.20. 102c¤pÉñÆ÷ÖýÔìͼÑù.²ÐȱtoÕ ðµ Éñ½Ú7c¤p,Tân mãng th¥n phù c¤p 7,Á¬ÈÖÉñ½Ú7c¤p.
x335135_g_MaxCompleteValue = {25,50,75,100,100,100,100}
-- µ±Ç°¿ÉÒԺϳÉtoÕ ðµ Éñ²ÄË÷ÒýºÅ
x335135_g_ShenCaiIndex = 0
-- ʹÓÃÐÂçÉñ·ûÔö¼ÓÍêÕû¶Èʱto Õ ðµ ÌØЧID
x335135_g_Impact_LevelUP = 47
-- ºÏ³É³öÁ¬ÈÖÉñ½ÚʱtoÕ ðµ ÌØЧID
x335135_g_Impact_Complete = 48
-- ñÒÉÙ΢,102ÉñÆ÷
x335135_g_XinMang7JiInfo = "Tân mãng th¥n phù c¤p 7"
--************************************************** ****************************
-- ÒÔÉϲ¿·ÖC¥n ÐúngC¥n ÐÞ¸ÄtoÕ ðµ ²¿·Ö
--************************************************** ****************************
--½Å±¾
--**********************************
--ʼþ½»»¥Èë¿Ú
--**********************************
function x335135_OnDefaultEvent( sceneId, selfId, bagIndex )
-- ²»C¥n Cái này ½Ó¿Ú,µ«Òª±£Áô¿Õº¯Êý
end
--**********************************
--Cái này ÎïÆ·toÕ ðµ ʹÓùý³ÌÐúng·ñÀàËÆÓÚ¼¼ÄÜ:
--H® th¯ng»áTÕi Ö´ÐпªÊ¼Ê±¼ì²âCái này º¯ÊýtoÕ ðµ Tr· v«Öµ,Èç¹ûTr· v«th¤t bÕiÔòºöÂÔºóÃætoÕ ðµ ÀàËƼ¼ÄÜtoÕ ðµ Ö´ÐÐ.
--Tr· v«1: ¼¼ÄÜÀàËÆtoÕ ðµ ÎïÆ·,¿ÉÒÔ¼ÌÐøÀàËƼ¼ÄÜtoÕ ðµ Ö´ÐУ»Tr· v«0: ºöÂÔºóÃætoÕ ðµ ²Ù×÷.
--**********************************
function x335135_IsSkillLikeScript( sceneId, selfId)
return 1 --Cái này ½Å±¾C¥n ¶¯×÷Ö§³Ö
end
--**********************************
--Ìõ¼þ¼ì²âÈë¿Ú:
--H® th¯ng»áTÕi ¼¼Äܼì²âtoÕ ðµ ʱ¼ä ði¬mµ÷ÓÃCái này ½Ó¿Ú,²¢¸ù¾ÝCái này º¯ÊýtoÕ ðµ Tr· v«ÖµXác nh§nÒÔºótoÕ ðµ Á÷³ÌÐúng·ñÖ´ÐÐ.
--Tr· v«1: Ìõ¼þ¼ì²âͨ¹ý,¿ÉÒÔ¼ÌÐøÖ´ÐÐ� �»Tr· v«0: Ìõ¼þ¼ì²âth¤t bÕi,ÖжϺóÐøÖ´ÐÐ.
--**********************************
function x335135_OnConditionCheck( sceneId, selfId )
-- PrintStr("OnConditionCheck...")
--УÑéʹÓÃtoÕ ðµ ÎïÆ·
if(1~=LuaFnVerifyUsedItem(sceneId, selfId)) then
return 0
end
-- ði¬mµ½µ±Ç°ÕýTÕi ʹÓÃtoÕ ðµ ÎïÆ·toÕ ðµ trí tay näi
local nIndex = LuaFnGetBagIndexOfUsedItem( sceneId, selfId )
-- ði¬mµ½µ±Ç°ÕýTÕi ʹÓÃtoÕ ðµ ÎïÆ·toÕ ðµ ID
local Item01 = LuaFnGetItemTableIndexByIndex(sceneId, selfId, nIndex)
-- PrintStr("Item01 ="..Item01)
-- ñÒÉÙ΢ 2008.5.20. 102c¤pÉñÆ÷ÖýÔìͼÑù.ÆßcáiÐÂÃ§É ñ·û.
for i=1, 7 do --for i=1, 6 do
if Item01 == x335135_g_ShenCaiTable[i].sfid then
x335135_g_ShenCaiIndex = i
-- PrintStr("x335135_g_ShenCaiIndex ="..x335135_g_ShenCaiIndex)
break
end
-- PrintStr("sfid ="..x335135_g_ShenCaiTable[i].sfid)
end
-- PrintStr("x335135_g_ShenCaiIndex ="..x335135_g_ShenCaiIndex)
-- ñÒÉÙ΢ 2008.5.20. 102c¤pÉñÆ÷ÖýÔìͼÑù.Ìí¼ÓÐÂtoÕ ðµ ÐÂçÉñ·û
if Item01 < 30505800 or Item01 > 30505806 then -- if Item01 < 30505800 or Item01 > 30505805 then
local strNotice = "Chï có th¬ dùng tân mãng th¥n phù hþp thành" -- ÐÂçÉñ·û
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
-- PrintStr("sjid ="..x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid)
local ItemCount = LuaFnGetAvailableItemCount( sceneId, selfId, x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid )
if ItemCount < 1 then
local strNotice = "Ngß½i c¥n ".."#{_ITEM"..(x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid).."}" -- ²ÐȱtoÕ ðµ Éñ½Ú
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
local bagbegin = GetBasicBagStartPos(sceneId, selfId)
local bagend = GetBasicBagEndPos(sceneId, selfId)
-- PrintStr("bagbegin ="..bagbegin)
-- PrintStr("bagend ="..bagend)
local ItemEX
-- ðÕt ðßþcµ±Ç°¿ÉÒԺϳÉtoÕ ðµ µÚmµt cáiÉñ½ÚTÕi ±³°üÖÐtoÕ ðµ λÖÃ
local sjbagpos = -1
for i=bagbegin, bagend do
if LuaFnIsItemAvailable( sceneId, selfId, i ) == 1 then
ItemEX = LuaFnGetItemTableIndexByIndex(sceneId, selfId, i)
if ItemEX == x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid then
-- PrintStr("ItemEX ="..ItemEX)
sjbagpos = i
break
end
end
end
-- PrintStr("sjbagpos ="..sjbagpos)
if sjbagpos == -1 then
local strNotice = "Ngß½i c¥n ".."#{_ITEM"..(x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid).."}" -- ²ÐȱtoÕ ðµ Éñ½Ú
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
-- PrintStr("sjbagpos ="..sjbagpos)
local CheckParam = GetBagItemParam( sceneId, selfId, sjbagpos, 8, 2 )
-- PrintStr("CheckParam ="..CheckParam)
if CheckParam < x335135_g_MaxCompleteValue[x335135_g_ShenCaiIndex] and CheckParam + x335135_g_CompleteValue >= x335135_g_MaxCompleteValue[x335135_g_ShenCaiIndex] then -- µ±ÍêÕû¶È´ïµ½100ʱÐúng·ñ»¹ÓÐ� �Õ¼ä
local FreeSpace = LuaFnGetPropertyBagSpace( sceneId, selfId )
if( FreeSpace < 1 ) then
local strNotice = "Ô ðÕo cø không có không gian, c¥n sØa sang lÕi."
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
end
-- ñÒÉÙ΢,102ÉñÆ÷.Èç¹ûʹÓÃtoÕ ðµ ÐúngTân mãng th¥n phù c¤p 7
if Item01 == 30505806 then
x335135_g_XinMang7JiInfo = GetBagItemTransfer( sceneId, selfId, nIndex )
--PrintStr(x335135_g_XinMang7JiInfo)
end
return 1; --²»C¥n ÈκÎÌõ¼þ,²¢ÇÒʼÖÕTr· v«1.
end
--**********************************
--ÏûºÄ¼ì²â¼°´¦ÀíÈë¿Ú:
--H® th¯ng»áTÕi ¼¼ÄÜÏûºÄtoÕ ðµ ʱ¼ä ði¬mµ÷ÓÃCái này ½Ó¿Ú,²¢¸ù¾ÝCái này º¯ÊýtoÕ ðµ Tr· v«ÖµXác nh§nÒÔºótoÕ ðµ Á÷³ÌÐúng·ñÖ´ÐÐ.
--Tr· v«1: ÏûºÄ´¦Àíͨ¹ý,¿ÉÒÔ¼ÌÐøÖ´ÐÐ� �»Tr· v«0: ÏûºÄ¼ì²âth¤t bÕi,ÖжϺóÐøÖ´ÐÐ.
--×¢Òâ: Õâ²»¹â¸ºÔðÏûºÄtoÕ ðµ ¼ì²âÒ²¸ºÔðÏûºÄtoÕ ðµ Ö´ÐÐ.
--**********************************
function x335135_OnDeplete( sceneId, selfId )
if(0<LuaFnDepletingUsedItem(sceneId, selfId)) then
return 1
end
return 0
end
--**********************************
--Ö»»áÖ´ÐÐmµt ´ÎÈë¿Ú:
--¾ÛÆøºÍ˲·¢¼¼ÄÜ»áTÕi ÏûºÄÍê³Éºóµ÷ÓÃCái này ½Ó¿Ú(¾ÛÆø½áÊø²¢ÇÒ¸÷ÖÖÌõ¼þ� �¼Thöa mãntoÕ ðµ ʱºò),¶øÒýµ¼
--¼¼ÄÜÒ²»áTÕi ÏûºÄÍê³Éºóµ÷ÓÃCái này ½Ó¿Ú(¼¼ÄÜtoÕ ðµ mµt ¿ªÊ¼,ÏûºÄ³É¹¦Ö´ÐÐÖ®ºó).
--Tr· v«1: ´¦Àí³É¹¦£»Tr· v«0: ´¦Àíth¤t bÕi.
--×¢: ÕâÀïÐúng¼¼ÄÜÉúЧmµt ´ÎtoÕ ðµ Èë¿Ú
--**********************************
function x335135_OnActivateOnce( sceneId, selfId )
-- PrintStr("OnActivateOnce...")
local ItemCount = LuaFnGetAvailableItemCount( sceneId, selfId, x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid )
if ItemCount < 1 then
local strNotice = "Ngß½i c¥n ".."#{_ITEM"..(x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid).."}" -- ²ÐȱtoÕ ðµ Éñ½Ú
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
-- ði¬mµ½µ±Ç°ÕýTÕi ʹÓÃtoÕ ðµ ÎïÆ·toÕ ðµ trí tay näi
local nIndex = LuaFnGetBagIndexOfUsedItem( sceneId, selfId )
-- PrintStr("nIndex ="..nIndex)
-- ði¬mµ½µ±Ç°ÕýTÕi ʹÓÃtoÕ ðµ ÎïÆ·toÕ ðµ ID
local Item01 = x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sfid
-- PrintStr("Item01 ="..Item01)
--ÏûºÄÑ¡ÖÐtoÕ ðµ ÐÂçÉñ·û
-- ret = LuaFnDelAvailableItem(sceneId, selfId, Item01, 1)
local bagbegin = GetBasicBagStartPos(sceneId, selfId)
local bagend = GetBasicBagEndPos(sceneId, selfId)
-- PrintStr("bagbegin ="..bagbegin)
-- PrintStr("bagend ="..bagend)
local ItemEX
-- ðÕt ðßþcµ±Ç°¿ÉÒԺϳÉtoÕ ðµ µÚmµt cáiÉñ½ÚTÕi ±³°üÖÐtoÕ ðµ λÖÃ
local sjbagpos = -1
for i=bagbegin, bagend do
if LuaFnIsItemAvailable( sceneId, selfId, i ) == 1 then
ItemEX = LuaFnGetItemTableIndexByIndex(sceneId, selfId, i)
if ItemEX == x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid then
-- PrintStr("ItemEX ="..ItemEX)
sjbagpos = i
break
end
end
end
-- PrintStr("sjbagpos ="..sjbagpos)
if sjbagpos == -1 then
local strNotice = "Ngß½i c¥n ".."#{_ITEM"..(x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid).."}" -- ²ÐȱtoÕ ðµ Éñ½Ú
x335135_ShowMsg( sceneId, selfId, strNotice)
return 0
end
-- ðÕt ðßþcµ±Ç°ºÏ³ÉtoÕ ðµ Éñ½ÚÍêÕû¶È
local CompleteValue = GetBagItemParam( sceneId, selfId, sjbagpos, 8, 2 )
-- PrintStr("CompleteValue ="..CompleteValue)
if nIndex >= 0 then
-- ¼Ç¼ͳ¼ÆÐÅÏ¢
LuaFnAuditShenCai(sceneId, selfId, Item01)
CompleteValue = CompleteValue + x335135_g_CompleteValue
-- PrintStr("CompleteValue ="..CompleteValue)
SetBagItemParam( sceneId, selfId, sjbagpos, 8, 2, CompleteValue ) --ÉèÖÃÍê³É¶È
-- ñÒÉÙ΢,2008.5.22 Ìí¼ÓÊÀ½çH® th¯ng¹«¸æ #ISØ døng mµt cáiÐÂçÉñ·û#G7c¤p#I,ÀëÖý³É¾øÊÀ ÉñÆ÷ÓÖ½üÁËmµt ²½.
if Item01 == 30505806 then
local playername = GetName(sceneId, selfId)
local strText = format("#{_INFOUSR%s}#{DQSJ_20080512_12}#{_INFOMSG%s}#{DQS J_20080512_13}", playername, x335135_g_XinMang7JiInfo)
BroadMsgByChatPipe(sceneId,selfId, strText, 4)
end
--------------²ÎÊýÉèÖð²È«ÐÔ¼ì²â,ËäÈ»Àí� �ÛÉϲÎÊýÉèÖò»»áth¤t bÕi
local CheckParam = GetBagItemParam( sceneId, selfId, sjbagpos, 8, 2 )
-- PrintStr("CheckParam ="..CheckParam)
if CheckParam ~= CompleteValue then
return 0
end
--------------²ÎÊýÉèÖð²È«ÐÔ¼ì²â,ËäÈ»Àí� �ÛÉϲÎÊýÉèÖò»»áth¤t bÕi
local strNotice = "Cüa ngß½i ".."#{_ITEM"..(x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].sjid).."}".."Ð¥y ðü ðµ gia tång 1 r°i" -- ²ÐȱtoÕ ðµ Éñ½Ú
x335135_ShowMsg( sceneId, selfId, strNotice)
LuaFnRefreshItemInfo( sceneId, selfId, sjbagpos ) --ˢб³°üÐÅÏ¢
if CompleteValue >= x335135_g_MaxCompleteValue[x335135_g_ShenCaiIndex] then -- µ±ÍêÕû¶È´ïµ½100ʱ
local EraseRet = EraseItem( sceneId, selfId, sjbagpos )
if EraseRet < 0 then --Èç¹ûɾ³ýth¤t bÕi,½«²»»á²úÉúÈκÎЧ¹û
return 0
end
-- PrintStr("lrid ="..x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].lrid)
BeginAddItem( sceneId )
AddItem( sceneId, x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].lrid, 1 )
ret = EndAddItem( sceneId, selfId )
if ret > 0 then
TryRecieveItem( sceneId, selfId, x335135_g_ShenCaiTable[x335135_g_ShenCaiIndex].lrid, QUALITY_MUST_BE_CHANGE ) -- ·Å²»Ï¾ÍûÓÐÁË
else
BeginEvent(sceneId)
strText = "Ô ðÕo cø ho£c nguyên li®u không ðü không gian, thïnh sØa sang lÕi sau lÕi ðªn lînh."
AddText(sceneId,strText);
EndEvent(sceneId)
DispatchMissionTips(sceneId,selfId)
return 0
end
LuaFnSendSpecificImpactToUnit( sceneId, selfId, selfId, selfId, x335135_g_Impact_Complete, 0 )
else
LuaFnSendSpecificImpactToUnit( sceneId, selfId, selfId, selfId, x335135_g_Impact_LevelUP, 0 )
end
else
local strMsg = "Hþp thành th¤t bÕi"
x335135_ShowMsg( sceneId, selfId, strMsg)
return 0
end
-- Ö÷²ÄºÏ³ÉÍê±Ï
-- LuaFnSendSpecificImpactToUnit(sceneId, selfId, selfId, selfId, g_ImpactID, 0)
return 1
end
--**********************************
--Òýµ¼ÐÄÌø´¦ÀíÈë¿Ú:
--Òýµ¼¼¼ÄÜ»áTÕi ÿ´ÎÐÄÌø½áÊøʱµ÷ÓÃCái này ½Ó¿Ú.
--Tr· v«: 1¼ÌÐøÏ´ÎÐÄÌø£»0: ÖжÏÒýµ¼.
--×¢: ÕâÀïÐúng¼¼ÄÜÉúЧmµt ´ÎtoÕ ðµ Èë¿Ú
--**********************************
function x335135_OnActivateEachTick( sceneId, selfId )
return 1
end
--**********************************
--Ö±½ÓHuÖ böЧ¹û:
--H® th¯ng»áÖ±½Óµ÷ÓÃCái này ½Ó¿Ú,²¢¸ù¾ÝCái này º¯ÊýtoÕ ðµ Tr· v«ÖµXác nh§nÒÔºótoÕ ðµ Á÷³ÌÐúng·ñÖ´ÐÐ.
--Tr· v«1: ÒѾHuÖ bö¶ÔӦЧ¹û,²»ÔÙÖ´ÐкóÐø²Ù× ÷£»Tr· v«0: ûÓмì²âµ½Ïà¹ØЧ¹û,¼ÌÐøÖ´� �Ð.
function x335135_CancelImpacts( sceneId, selfId )
return 0 --²»C¥n Cái này ½Ó¿Ú,µ«Òª±£Áô¿Õº¯Êý,²¢ÇÒʼ ÖÕTr· v«0.
end
function x335135_ShowMsg( sceneId, selfId, strMsg)
BeginEvent( sceneId )
AddText( sceneId, strMsg )
EndEvent( sceneId )
DispatchMissionTips( sceneId, selfId )
end