forked from metin2/server
126 lines
3.4 KiB
Plaintext
126 lines
3.4 KiB
Plaintext
quest make_herb_lv15 begin
|
|
state start begin
|
|
when login or levelup with pc.get_level() ==15 begin
|
|
set_state(information)
|
|
end
|
|
end
|
|
|
|
state information begin
|
|
when letter begin
|
|
local v = find_npc_by_vnum(20084)
|
|
if v != 0 then
|
|
target.vid("__TARGET__", v, gameforge.collect_herb_lv10._10_targetVid)
|
|
end
|
|
send_letter(gameforge.collect_herb_lv10._20_sendLetter)
|
|
end
|
|
|
|
when button or info begin
|
|
say_title(gameforge.collect_herb_lv10._20_sendLetter)
|
|
say(gameforge.collect_herb_lv15._10_say)
|
|
end
|
|
|
|
when __TARGET__.target.click or 20084.chat.gameforge.collect_herb_lv15._20_npcChat begin
|
|
target.delete("__TARGET__")
|
|
say_title(gameforge.collect_herb_lv10._50_sayTitle)
|
|
say(gameforge.collect_herb_lv15._30_say)
|
|
wait()
|
|
say_title(gameforge.collect_herb_lv10._50_sayTitle)
|
|
say(gameforge.collect_herb_lv15._40_say)
|
|
set_state(go_to_disciple)
|
|
pc.setqf("collect_count",0)--Current number of items
|
|
pc.setqf("drink_drug",0) --when take the Potion of Daze
|
|
end
|
|
end
|
|
|
|
state go_to_disciple begin
|
|
when letter begin
|
|
send_letter(gameforge.collect_herb_lv15._50_sendLetter)
|
|
|
|
end
|
|
when button or info begin
|
|
say_title(gameforge.collect_herb_lv15._60_sayTitle)
|
|
say(gameforge.collect_herb_lv15._70_say)
|
|
say_item_vnum(50704)
|
|
say_reward(string.format(gameforge.collect_herb_lv15._80_sayReward, pc.getqf("collect_count")))
|
|
end
|
|
|
|
when 71035.use begin --Potion of Daze
|
|
|
|
if pc.getqf("drink_drug")==1 then
|
|
say_title(gameforge.collect_herb_lv10._50_sayTitle)
|
|
say(gameforge.collect_herb_lv10._120_say)
|
|
|
|
return
|
|
end
|
|
if pc.count_item(50704)==0 then
|
|
say_title(gameforge.collect_herb_lv10._50_sayTitle)
|
|
say(gameforge.collect_herb_lv15._90_say)
|
|
return
|
|
end
|
|
pc.remove_item(71035, 1)
|
|
pc.setqf("drink_drug",1)
|
|
end
|
|
|
|
|
|
when 181.kill begin
|
|
if pc.count_item(50704)<5- pc.getqf("collect_count")then
|
|
pc.give_item2(50704, 1)
|
|
end
|
|
end
|
|
|
|
when 20084.chat.gameforge.collect_herb_lv15._100_npcChat with pc.count_item(50704) >0 begin
|
|
say_title(gameforge.collect_herb_lv10._150_sayTitle)
|
|
say(gameforge.collect_herb_lv15._110_say)
|
|
pc.remove_item(50704, 1)
|
|
wait()
|
|
|
|
local pass_percent
|
|
if pc.getqf("drink_drug")==0 then
|
|
pass_percent=90
|
|
else
|
|
pass_percent=100
|
|
end
|
|
|
|
local s= number(1,100)
|
|
if s<= pass_percent then
|
|
if pc.getqf("collect_count")< 4 then --Less than 5
|
|
local index =pc.getqf("collect_count")+1
|
|
pc.setqf("collect_count",index) --you got one, so you would get +1
|
|
say_title(gameforge.collect_herb_lv10._50_sayTitle)
|
|
say(string.format(gameforge.collect_herb_lv15._120_say, 5-pc.getqf("collect_count")))
|
|
pc.setqf("drink_drug",0) --Initialize the potions
|
|
return
|
|
end
|
|
say_title(gameforge.collect_herb_lv10._50_sayTitle)
|
|
say(gameforge.collect_herb_lv15._130_say)
|
|
say_title(gameforge.buy_fishrod._210_sayTitle)
|
|
say_reward(gameforge.collect_herb_lv15._140_sayReward)
|
|
|
|
pc.setqf("collect_count",0)
|
|
pc.setqf("drink_drug",0)
|
|
|
|
clear_letter()
|
|
set_state(__complete)
|
|
|
|
pc.give_item2(17023)
|
|
pc.change_money(10000)
|
|
pc.give_exp2(25000)
|
|
set_quest_state("levelup","run")
|
|
|
|
return
|
|
else
|
|
say_title(gameforge.collect_herb_lv10._50_sayTitle)
|
|
say(gameforge.collect_herb_lv15._150_say)
|
|
pc.setqf("drink_drug",0) --please get me another ones
|
|
return
|
|
end
|
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
state __complete begin
|
|
end
|
|
end
|