please help me,Give Rubber Piece did not get UFO!
http://i2.muimg.com/1949/a75287e13aad40cc.png
http://i2.muimg.com/1949/a8f91d86a4d9ee54.png
Printable View
please help me,Give Rubber Piece did not get UFO!
http://i2.muimg.com/1949/a75287e13aad40cc.png
http://i2.muimg.com/1949/a8f91d86a4d9ee54.png
upload event luas and ill check it cuz there is something wrong with it
Try this one, it's the quest script for that event from latest jSRO.
sn_qev_101216_1.lua
Note: Make sure the item code's are correct!Code:----------------------------------------------------------------------------
-- 이벤트 셋팅 SetupConfig
-- QEV_CH_EVENT_CLOWN_101216_1 축제 이벤트
-- QUEST_ID = 10186
----------------------------------------------------------------------------
function QEV_CH_EVENT_CLOWN_101216_1() -- 이벤트 코드네임. 차 후 다른 이벤트 만들 경우, KISAENG_ 뒤쪽(지금은 GLOBAL2011_1)을 새로운 이벤트 코드로 전체변환 하면 됨.
EventID = 10186 -- 이벤트 ID. 넘버링 문서를 보고 새로운 이벤트를 만들때마다 스크립트에 있는 전체 EventID를 다 바꿔줘야함.
SetEventOne(EventID,"SN_QEV_CH_EVENT_CLOWN_101216_1",1,1,1) -- 인자값 : EventID, 소옥이한테 대화 걸 때 뜨는 이벤트 이름 스트링, 1, 1, 드랍템 개수)
SetEventTwo(2,"SN_TALK_QEV_CH_EVENT_CLOWN_101216_B","SN_TALK_COMMON_EXIT")
-- 이벤트 진행 시 나올 선택문 선언. 인자값 : 선택문개수, 첫번째 선택문(보상을 받는다.), 대화를 종료한다.
NPC_COUNT = 1 -- 이벤트에 연결 될 NPC 개수. 어지간하면 1
LuaInsertNpc(NPC_COUNT,"NPC_CH_EVENT_CLOWN_BALLOON") -- 이벤트가 연결 될 NPC. 어지간하면 소옥.
InsertPayItemCodeName(1, -- 보상 ITEM 개수
"ITEM_ETC_E101216_BALLOON_UNICORN" -- 보상 리스트
)
LuaInsertDropItem_Rent(1, "ITEM_ETC_E101216_RUBBER", 1.5,"RENT_ITEM_ETC_E101216_RUBBER")
InsertMenuStringList("NPC_CH_EVENT_CLOWN_BALLOON",5,
"EVENT_MENUSTRING_GREETING","SN_NPC_CH_EVENT_CLOWN_QS", -- 0 소옥이 만났을 때
"EVENT_MENUSTRING_REQUEST_ACCEPT_QUEST","SN_TALK_QEV_CH_EVENT_CLOWN_101216_A", -- 5 이벤트 첫 안내 대사
"EVENT_MENUSTRING_NOT_ACHIEVED","SN_TALK_QEV_CH_EVENT_CLOWN_101216_E", -- 1 아이템이 없음
"EVENT_MENUSTRING_INVENTORY_FULL","SN_TALK_QEV_CH_EVENT_CLOWN_101216_D", -- 2 인벤토리공간이 부족함
"EVENT_MENUSTRING_ACHIEVED","SN_TALK_QEV_CH_EVENT_CLOWN_101216_C" -- 3 이벤트 완료
)
CONVERSATION_SINGLE = 0
LuaInsertFunctionStringList(1,"CONVERSATION_SINGLE","CLOWN_101216_1_Conversation") -- 대화 호출
end
function CLOWN_101216_1_ItemCheck() -- 보상을 지급받기 위한 드랍템을 유저가 가지고 있는가 체크.
if (LuaEventInQuireSameItem(0,"ITEM_ETC_E101216_RUBBER",INQUIRE_SAMEITEM_OP_COUNT_ALL_SAMEITEM,-1) > 9) then
return 0 -- 이 드랍템이 다 있으면 0을 리턴
else
return 1 -- 하나라도 없으면 1을 리턴
end
end
function CLOWN_101216_1_ItemDel() -- 보상 지급받고 드랍템을 삭제하는 함수.
for i=1, 10 do
if LuaEventInQuireSameItem(0,"ITEM_ETC_E101216_RUBBER",INQUIRE_SAMEITEM_OP_COUNT_ALL_SAMEITEM,0) > 0 then
slot = LuaEventInQuireSameItem(0,"ITEM_ETC_E101216_RUBBER",INQUIRE_SAMEITEM_OP_FIND_FIRST_SLOT,0)
LuaDelItem_EXT(0,slot,1,SYSOP_REASON_Event,0)
end
end
end
function CLOWN_101216_1_GiveEventRewardItem() -- 보상을 지급해주는 함수.
bGiveItemNum = 0
btErrorCode = 0
SYSOP_REASON_Event = 0
EventID = 10186
RewardItemCount = 1 -- 각 아이템마다의 지급 수량
RewardItemRent = "RENT_ITEM_ETC_E101216_BALLOON_UNICORN"
--[[ nDropItemCount = LuaEventInQuireSameItem(0,"ITEM_ETC_E101216_RUBBER",INQUIRE_SAMEITEM_OP_COUNT_FIRST_ITEM,-1)
nRequireDropItemToPay = 10
-- Conversation단에서 고무조각이 적어도 10개는 존재한다는 조건을 통과한 후라 과감히 '/' 한다.
nPayItemCount = nDropItemCount / nRequireDropItemToPay
nEmptySlotCount = LuaGetCountEmptyInventory(0,-1)
for nIndex = 1, nPayItemCount do -- 교환할 아이템 수만큼 돌며 인벤토리 체크 후 아이템 지급
if LuaGetCountEmptyInventory(0,-1) < 1 then
return
else
LuaAddItem_EXT_Rent(EventID,0,RewardItemCount,SYSOP_REASON_Event,FALSE,FALSE,1,RewardItemRent)
CLOWN_101216_1_ItemDel()
end
end
]]
nEmptySlotCount = LuaGetCountEmptyInventory(0,-1)
if nEmptySlotCount < 1 then
return
else
for i=1, nEmptySlotCount do
if CLOWN_101216_1_ItemCheck() == 0 then
LuaAddItem_EXT_Rent(EventID,0,RewardItemCount,SYSOP_REASON_Event,FALSE,FALSE,1,RewardItemRent)
CLOWN_101216_1_ItemDel()
else
break
end
end
end
--[[
nGive = LuaRanged_rand_f(1,10000) -- 1부터 10,000까지 랜덤
for i=1, RewardItemMax do
if (nGive > RewardItemRatio[i]) and (nGive <= RewardItemRatio[i+1]) then
LuaAddItem_EXT_Rent(EventID,0,RewardItemCount[i],SYSOP_REASON_Event,FALSE,FALSE,i,RewardItemRent[nGive]) -- 인자값 : 이벤트ID, 0, 지급하는 아이템 수량, SYSOP_REASON_Event, FALSE, FALSE, 지급 아이템 넘버링(맨 위 보상 아이템 설정할 때 그 순서와 그대로 매칭되는 아이템을 호출)
CLOWN_101216_1_ItemDel() -- 지급 했으면 드랍템 삭제하고
break -- 루프 빠져나감
end
end
]]
-- LuaAddItem_EXT_Rent(EventID,0,RewardItemCount,SYSOP_REASON_Event,FALSE,FALSE,1,RewardItemRent)
-- CLOWN_101216_1_ItemDel()
-- end
end
---- 이벤트 실행 Conversation
function CLOWN_101216_1_Conversation(EventID_Sub,CharName)
CONVERSATION_START = 0
CONVERSATION_RESPONSE = 2
EventID = 10186
EventID_Message = EventID_Sub
NpcHandlerNum = LuaNpcHandlerNum()
if CONVERSATION_START == EventID_Sub then
if CharName == "NPC_CH_EVENT_CLOWN_BALLOON" then
CurPage = 1
LuaSetCurPage(CurPage)
CurString = 5
SelectionList_CommonIndex = 0
Button = 2
LuaShowMenu(CurString,EventID,SelectionList_CommonIndex,Button,NpcHandlerNum)
return
end
end
----------------이 위까지는 어지간하면 바꿀 일 없음
if CONVERSATION_RESPONSE == EventID_Sub then
if LuaGetCurPage() == 1 then
MenuOffset = LuaGetEventMenuResponse()
MenuOffset = MenuOffset - TALK_RESPONSE_LIST_BASE
if MenuOffset == 0 then
if CLOWN_101216_1_ItemCheck() == 0 then -- 위에서 만든 ItemCheck를 돌려서 아이템이 다 있으면(0이 리턴되면) 아래 루틴을 탐
if LuaGetCountEmptyInventory(0,-1) > 0 then -- ItemCheck도 통과했는데 인벤토리도 한칸 이상 여유공간이 있으면 조건이 다 맞는거임
CurPage = 2
SelectionList_CommonIndex = 1
Button = 1
LuaSetCurPage(CurPage)
CurString = 3 -- 아이템 지급해줬다는 스트링(3번) 호출
LuaShowMenu(CurString,EventID,SelectionList_CommonIndex,Button,NpcHandlerNum)
CLOWN_101216_1_GiveEventRewardItem() -- 위에서 만든 보상 지급하는 함수를 호출
return
else -- 인벤 여유공간이 없으면
CurPage = 2
SelectionList_CommonIndex = 1
Button = 1
LuaSetCurPage(CurPage)
CurString = 2 -- 인벤 부족하다는 스트링(2번) 호출
LuaShowMenu(CurString,EventID,SelectionList_CommonIndex,Button,NpcHandlerNum)
return
end
else -- ItemCheck를 통과 못했으면
CurPage = 2
SelectionList_CommonIndex = 1
Button = 1
LuaSetCurPage(CurPage)
CurString = 1 -- 아이템이 없다는 스트링(1번) 호출
LuaShowMenu(CurString,EventID,SelectionList_CommonIndex,Button,NpcHandlerNum)
return
end
elseif MenuOffset == 1 then
LuaTerminateMenu()
return
end
else
LuaTerminateMenu()
return
end
end
end