quest horse_upgrade begin state start begin when 20349.chat.gameforge.horse_upgrade2._10_npcChat with horse.get_grade()==1 and horse.get_level()==10 begin if horse.is_dead() then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._10_say) elseif pc.level<=34 then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._20_say) elseif horse.get_level()<=9 then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._30_say) elseif pc.countitem("50050")<1 then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade2._50_say) setstate(need_item50050) elseif pc.countitem("50051")<1 then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._40_say) elseif horse.get_level()==10 and not horse.is_dead() and pc.countitem("50050")>=1 and pc.level>=35 then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._50_say) local b= select(gameforge.find_brother_article._90_select, gameforge.find_brother_article._100_select) if 1==b then if pc.countitem("50050")>=1 then pc.removeitem("50050", 1) setstate(test) end elseif 2==b then say(gameforge.horse_upgrade._60_say) else say(string.format(gameforge.horse_upgrade._70_say, b)) end else say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._80_say) end end end state need_item50050 begin when login or levelup or enter with pc.countitem("50050") >= 1 begin set_state(start) end when letter begin setskin(NOWINDOW) makequestbutton(gameforge.horse_upgrade2._100_makequestbutton) q.set_title(gameforge.horse_upgrade2._100_makequestbutton) q.start() end when button begin say_title(gameforge.horse_upgrade2._100_makequestbutton) say_reward(gameforge.horse_upgrade._90_sayReward) setstate(start) q.done() end when info begin say_title(gameforge.horse_upgrade2._100_makequestbutton) say_reward(gameforge.horse_upgrade._90_sayReward) setstate(start) q.done() end when 20349.chat.gameforge.horse_upgrade2._10_npcChat with horse.get_grade()==1 and horse.get_level()==10 begin if horse.is_dead() then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._10_say) elseif pc.level<=34 then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._20_say) elseif horse.get_level()<=9 then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._30_say) elseif pc.countitem("50050")<1 then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade2._50_say) elseif pc.countitem("50051")<1 then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._40_say) elseif horse.get_level()==10 and not horse.is_dead() and pc.countitem("50050")>=1 and pc.level>=35 then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._50_say) local b= select(gameforge.find_brother_article._90_select, gameforge.find_brother_article._100_select) if 1==b then if pc.countitem("50050")>=1 then pc.removeitem("50050", 1) setstate(test) end elseif 2==b then say(gameforge.horse_upgrade._60_say) else say(string.format(gameforge.horse_upgrade._70_say, b)) end else say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._80_say) end end end state test begin when letter begin q.set_counter(gameforge.horse_upgrade._test_2015_count, 100-pc.getqf("kill_count")) end when 2105.party_kill begin pc.setqf("kill_count", pc.getqf("kill_count")+1) q.set_counter(gameforge.horse_upgrade._test_2015_count, 100-pc.getqf("kill_count")) if get_time()>=pc.getqf("limit_time") then setstate(failure) end end when 2107.party_kill begin pc.setqf("kill_count", pc.getqf("kill_count")+1) q.set_counter(gameforge.horse_upgrade._test_2107_count, 100-pc.getqf("kill_count")) if get_time()>=pc.getqf("limit_time") then setstate(failure) q.done() end end when letter begin q.set_clock(gameforge.horse_upgrade2.rest_time, pc.getqf("limit_time")-get_time()) end when enter begin pc.setqf("limit_time", get_time()+30*60) pc.setqf("kill_count", 0) end when leave begin q.done() end when letter begin setskin(NOWINDOW) makequestbutton(gameforge.horse_upgrade._100_makequestbutton) q.set_title(gameforge.horse_upgrade._100_makequestbutton) q.start() end when button begin say_title(gameforge.horse_upgrade._100_makequestbutton) say_reward(gameforge.horse_upgrade._110_sayReward) say_reward(gameforge.horse_upgrade2._140_sayReward) end when info begin say_title(gameforge.horse_upgrade._100_makequestbutton) say_reward(gameforge.horse_upgrade._110_sayReward) say_reward(gameforge.horse_upgrade2._140_sayReward) end when 2105.party_kill with pc.getqf("kill_count") >= 100 and pc.getqf("kill_count") >= 100 and pc.getqf("limit_time")>=get_time() begin setstate(report) end when 2107.party_kill with pc.getqf("kill_count") >= 100 and pc.getqf("kill_count") >= 100 and pc.getqf("limit_time")>=get_time() begin setstate(report) end when 20349.chat.gameforge.horse_upgrade._120_npcChat begin say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._130_say) local b= select(gameforge.locale.levelup.prev_quest_go, gameforge.locale.cancel) if 1==b then elseif 2==b then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade2._170_say) local b= select(gameforge.horse_upgrade2._180_select, gameforge.horse_upgrade2._190_select) if 1==b then say_title(gameforge.horse_levelup._240_sayTitle) say(gameforge.horse_upgrade2._200_say) setstate(start) q.done() elseif 2==b then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._140_say) else say(string.format(gameforge.horse_upgrade2._220_say, b)) end else say(string.format(gameforge.horse_upgrade2._220_say, b)) end end end state report begin when letter begin setskin(NOWINDOW) makequestbutton(gameforge.horse_upgrade2._230_makequestbutton) q.set_title(gameforge.horse_upgrade2._230_makequestbutton) q.start() end when button begin say_title(gameforge.horse_upgrade2._230_makequestbutton) say_reward(gameforge.horse_upgrade2._240_sayReward) end when info begin say_title(gameforge.horse_upgrade2._230_makequestbutton) say_reward(gameforge.horse_upgrade2._240_sayReward) end when 20349.chat.gameforge.horse_upgrade._150_npcChat with horse.get_grade()!=1 begin setstate(start) q.done() end when 20349.chat.gameforge.horse_upgrade._160_npcChat with horse.get_grade()==1 begin say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._170_say) if is_test_server() then pc.setqf("make_time", get_time()+10) else pc.setqf("make_time", get_time()+number(8, 16)*60*60) end setstate(wait) end end state wait begin when letter begin setskin(NOWINDOW) makequestbutton(gameforge.horse_upgrade._180_makequestbutton) q.set_title(gameforge.horse_upgrade._180_makequestbutton) q.start() end when button begin say_title(gameforge.horse_upgrade._180_makequestbutton) say_reward(gameforge.horse_upgrade._190_sayReward) end when info begin say_title(gameforge.horse_upgrade._180_makequestbutton) say_reward(gameforge.horse_upgrade._190_sayReward) end when login with get_time()>=pc.getqf("make_time") begin setstate(buy) end when 20349.chat.gameforge.horse_upgrade2._300_npcChat with horse.get_grade()!=1 begin setstate(start) q.done() end when 20349.chat.gameforge.horse_upgrade._200_npcChat with horse.get_grade()==1 begin say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._210_say) end end state buy begin when letter begin setskin(NOWINDOW) makequestbutton(gameforge.horse_upgrade2._330_makequestbutton) q.set_title(gameforge.horse_upgrade2._330_makequestbutton) q.start() end when button begin say_title(gameforge.horse_upgrade2._330_makequestbutton) say_reward(gameforge.horse_upgrade._220_sayReward) end when info begin say_title(gameforge.horse_upgrade2._330_makequestbutton) say_reward(gameforge.horse_upgrade._230_sayReward) end when 20349.chat.gameforge.horse_upgrade2._300_npcChat with horse.get_grade()!=1 begin setstate(start) q.done() end when 20349.chat.gameforge.horse_upgrade2._300_npcChat with horse.get_grade()==1 and horse.get_level()!=10 begin setstate(start) q.done() end when 20349.chat.gameforge.horse_upgrade._240_npcChat with horse.get_grade()==1 and horse.get_level()==10 begin say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._250_say) local b= select(gameforge.horse_upgrade2._370_select, gameforge.horse_upgrade2._380_select, gameforge.horse_upgrade2._385_select) if 1==b then if pc.money>=500000 then if pc.countitem("50051")>=1 then char_log(0, "HORSE_UPGRADE", "BEGIN") pc.changemoney(-500000) char_log(0, "HORSE_UPGRADE", "DEC money 500000") pc.removeitem("50051", 1) char_log(0, "HORSE_UPGRADE", "DEC 50051 1") horse.unride() horse.advance() horse.ride() char_log(0, "HORSE_UPGRADE", "INC horse_advance 1") pc.give_item2("50052", 1) char_log(0, "HORSE_UPGRADE", "INC 50052 1") char_log(0, "HORSE_UPGRADE", "END") say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._260_say) setstate(start) q.done() else say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._270_say) end else say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._280_say) end elseif 2==b then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._290_say) elseif 3==b then say_title(gameforge.horse_exchange_ticket._20_sayTitle) say(gameforge.horse_upgrade._300_say) local b= select(gameforge.locale.guild.yes, gameforge.locale.guild.no) if 1==b then setstate(start) q.done() elseif 2==b then else say(string.format(gameforge.horse_upgrade2._220_say, b)) end else say(string.format(gameforge.horse_upgrade2._220_say, b)) end end end state failure begin when letter begin setskin(NOWINDOW) makequestbutton(gameforge.horse_upgrade2._440_makequestbutton) q.set_title(gameforge.horse_upgrade2._440_makequestbutton) q.start() end when button begin say_title(gameforge.horse_upgrade2._440_makequestbutton) say_reward(gameforge.horse_upgrade._310_sayReward) say_reward(gameforge.horse_upgrade2._460_sayReward) setstate(start) q.done() end when info begin say_title(gameforge.horse_upgrade2._440_makequestbutton) say_reward(gameforge.horse_upgrade._310_sayReward) say_reward(gameforge.horse_upgrade2._460_sayReward) setstate(start) q.done() end end state __COMPLETE__ begin when enter begin q.done() end end end