X
X

Metin2 ramazan event questi

AnasayfaYazılarMetin2 QuestMetin2 ramazan event questi

state start begin
function is_running()
return (game.get_event_flag("event_ramazan") > 0) --npc spawn
end
function reward_period()
return (game.get_event_flag("ramadan_reward") > 0) --reward menu appear
end
function setting()
return {
["bread"] = 30315,
["candy"] = 50183,
["plate"] = 30316,
["iftar"] = 30317,
["fruit"] = 30318,
["box"] = 50182,
["horse1"] = 71131,
["horse2"] = 71132,
["horse3"] = 71133,
["horse4"] = 71134
}
end

when 33002.chat.gameforge.event_ramadan._010_npcChat with pc.getf("event_ramazan", "first_notice")==0 begin
local setting = event_ramadan.setting()
say_title(gameforge.event_ramadan._020_sayTitle)
say("")
say(gameforge.event_ramadan._030_say)
wait()

say_pc_name()
say(gameforge.event_ramadan._040_say)
wait()

say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._050_say)
wait()

say_pc_name()
say(gameforge.event_ramadan._060_say)

pc.setqf("first_notice", 1)
end

when 33002.chat.gameforge.event_ramadan._070_npcChat with pc.getf("event_ramadan", "first_notice")==1 begin
local setting = event_ramadan.setting()
if pc.count_item(setting.bread) == 0 then
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._80_say)
local s=select(gameforge.event_ramadan._90_select_1 ,gameforge.event_ramadan._90_select_2)
if 2==s then
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._100_say)
return
end
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._110_say)
wait()
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._120_say)
local s=select(gameforge.event_ramadan._130_select_1,gameforge.event_ramadan._130_select_2)
if 2==s then
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._100_say)
return
end
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._140_say)
elseif pc.count_item(setting.bread) > 0 and pc.count_item(setting.bread) < 10 then
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._150_say)
elseif pc.count_item(setting.bread) >= 10 then
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._160_say)
wait()
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._170_say)
pc.give_item2(setting.candy,1)
pc.remove_item(setting.bread,10)
end
if not event_ramadan.is_running() then
npc.purge()
end
end --when

when 33002.chat.gameforge.event_ramadan._180_npcChat with pc.getqf("first_notice")== 1 begin
local setting = event_ramadan.setting()
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._180_say)
say(gameforge.event_ramadan._190_say)
say(gameforge.event_ramadan._200_say)
say_item_vnum(setting.plate)
wait()
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._210_say)
end

when 33003.chat.gameforge.event_ramadan._220_npcChat or 33004.chat.gameforge.event_ramadan._220_npcChat or 33005.chat.gameforge.event_ramadan._220_npcChat or 33006.chat.gameforge.event_ramadan._220_npcChat or 33007.chat.gameforge.event_ramadan._220_npcChat begin
local setting = event_ramadan.setting()
if pc.count_item(setting.iftar) == 0 then
say_title(gameforge.event_ramadan._230_sayTitle)
say("")
say(gameforge.event_ramadan._240_say)
elseif pc.count_item(setting.iftar) > 0 then
say_title(gameforge.event_ramadan._230_sayTitle)
say("")
say(gameforge.event_ramadan._250_say)
local s = select(gameforge.event_ramadan._260_select_1,gameforge.event_ramadan._260_select_2)
if 2==s then
say_title(gameforge.event_ramadan._230_sayTitle)
say("")
say(gameforge.event_ramadan._270_say)
return
end
say_title(gameforge.event_ramadan._230_sayTitle)
say("")
say(gameforge.event_ramadan._280_say)

pc.give_item2(setting.box,1)
pc.remove_item(setting.iftar,1)
end

if not event_ramadan.is_running() then
npc.purge()
end
end

when 33002.chat.gameforge.event_ramadan._290_npcChat with pc.getf("event_ramadan","fig_exchange")==0 begin
local setting = event_ramadan.setting()
if get_time() > pc.getqf("duration") then
say_title(gameforge.event_ramadan._020_sayTitle)
say("")
say(gameforge.event_ramadan._300_say)
pc.give_item2(setting.fruit)
pc.setqf("duration",get_time()+60*60*24) --24h
else
say_title(gameforge.event_ramadan._020_sayTitle)
say(gameforge.event_ramadan._310_say)
end
end

when 33002.chat.gameforge.event_ramadan._320_npcChat with event_ramadan.reward_period() and pc.getf("event_ramadan","fig_exchange")==0 begin
local setting = event_ramadan.setting()
say_title(gameforge.event_ramadan._020_sayTitle)
say("")
say(gameforge.event_ramadan._330_say)
wait()
if pc.count_item(setting.fruit)>= 5 then --more than 5
say_title(gameforge.event_ramadan._020_sayTitle)
say("")
say(string.format(gameforge.event_ramadan._340_say, pc.count_item(setting.fruit)))
say(gameforge.event_ramadan._350_say)
local s=select(gameforge.event_ramadan._360_select_1, gameforge.event_ramadan._360_select_2)
if 2==s then
say_title(gameforge.event_ramadan._020_sayTitle)
say("")
say(gameforge.event_ramadan._370_say)
return
end
say_title(gameforge.event_ramadan._020_sayTitle)
say("")
say(gameforge.event_ramadan._380_say)
say_reward(gameforge.event_ramadan._390_sayReward)
say("")
if pc.count_item(setting.fruit)>= 5 and pc.count_item(setting.fruit)<= 10 then
pc.give_item2(setting.horse1,1)
elseif pc.count_item(setting.fruit)>= 11 and pc.count_item(setting.fruit)<= 19 then
pc.give_item2(setting.horse2,1)
elseif pc.count_item(setting.fruit)>= 20 and pc.count_item(setting.fruit)<= 27 then
pc.give_item2(setting.horse3,1)
elseif pc.count_item(setting.fruit)>= 28 then
pc.give_item2(setting.horse4,1)
end
pc.remove_item(setting.fruit,pc.count_item(setting.fruit))
pc.setqf("fig_exchange",1)
else --less than 5
say_title(gameforge.event_ramadan._020_sayTitle)
say("")
say(gameforge.event_ramadan._400_say)
end
end

when 30316.use begin
local setting = event_ramadan.setting()
if pc.count_item(setting.bread) >= 10 then
pc.remove_item(setting.bread, 10)
pc.remove_item(setting.plate, 1)
pc.give_item2(setting.iftar, 1)
end
end

end --state


Top