Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- quest system_smocza_alchemia begin
- state start begin
- when 30303.use with pc.is_gm() begin
- cmdchat("openRune 0|0|0|2|0|3|0|5|0|4|0|1")
- cmdchat("setRune "..pc.getqf("rune_0").."#0")
- cmdchat("setRune "..pc.getqf("rune_1").."#1")
- cmdchat("setRune "..pc.getqf("rune_2").."#2")
- cmdchat("setRune "..pc.getqf("rune_3").."#3")
- cmdchat("setRune "..pc.getqf("rune_4").."#4")
- notice(pc.getqf("rune_0").." - "..pc.getqf("rune_1").." - "..pc.getqf("rune_2").." - "..pc.getqf("rune_3").." - "..pc.getqf("rune_4"))
- end
- function getGrade(vnum)
- if table_is_in({33411, 33421, 33431}, vnum) then
- return 1
- elseif table_is_in({33412, 33422, 33432}, vnum) then
- return 2
- elseif table_is_in({33413, 33423, 33433}, vnum) then
- return 3
- elseif table_is_in({33414, 33424, 33434}, vnum) then
- return 4
- else
- return 5
- end
- end
- when letter begin
- cmdchat("przycisk_alchemia "..q.getcurrentquestindex())
- end
- when button or info begin
- cmdchat("openRune 0|0|0|2|0|3|0|5|0|4|0|1")
- cmdchat("setRune "..pc.getqf("rune_0").."#0")
- cmdchat("setRune "..pc.getqf("rune_1").."#1")
- cmdchat("setRune "..pc.getqf("rune_2").."#2")
- cmdchat("setRune "..pc.getqf("rune_3").."#3")
- cmdchat("setRune "..pc.getqf("rune_4").."#4")
- end
- -- ## FIX ## --
- when login or kill begin
- for i = 1, 5 do
- local vnum = pc.getqf("grade_"..i)
- if vnum > 0 and pc.countitem(vnum) < 1 then
- chat(chat_color("[Smocza Alchemia]", "blue").." Nie posiadasz runy: "..chat_color(item_name(vnum), "orange")..". Bonus zostaje zdjęty...")
- affect.new_remove(850+i)
- pc.delqf("grade_"..i)
- pc.setqf("rune_"..(i-1), 0)
- cmdchat("setRune 0#"..(i-1))
- end
- if pc.getqf("fl_rn") == 0 then
- pc.setqf("rune_"..(i-1), vnum)
- cmdchat("setRune "..(i-1).."#"..vnum)
- end
- end
- -- pc.setqf("fl_rn", 1)
- end
- -- ## UŻYCIE ## --
- when 33411.use or 33412.use or 33413.use or 33414.use or 33415.use or
- 33421.use or 33422.use or 33423.use or 33424.use or 33425.use or
- 33431.use or 33432.use or 33433.use or 33434.use or 33435.use begin
- local grade = system_smocza_alchemia.getGrade(item.vnum)
- if pc.getqf("is_active_"..grade) > 0 then
- affect.new_remove(850+grade)
- pc.delqf("is_active_"..grade)
- pc.delqf("grade_"..grade)
- pc.setqf("rune_"..(grade-1), 0)
- cmdchat("setRune 0#"..(grade-1))
- chat(chat_color("[Smocza Alchemia]", "blue").." "..item_name(item.vnum).." została zdezaktywowana.")
- else
- local affects =
- {
- [33411] = {53, 5, 1},
- [33412] = {43, 5, 2},
- [33413] = {6, 1000, 3},
- [33414] = {41, 5, 4},
- [33415] = {40, 5, 5},
- [33421] = {53, 10, 1},
- [33422] = {43, 10, 2},
- [33423] = {6, 2500, 3},
- [33424] = {41, 10, 4},
- [33425] = {40, 10, 5},
- [33431] = {53, 15, 1},
- [33432] = {43, 15, 2},
- [33433] = {6, 5000, 3},
- [33434] = {41, 15, 4},
- [33435] = {40, 15, 5},
- }
- pc.setqf("grade_"..grade, item.vnum)
- affect.new(850+system_smocza_alchemia.getGrade(item.vnum), affects[item.vnum][1], affects[item.vnum][2])
- pc.setqf("is_active_"..grade, 1)
- pc.setqf("rune_"..(affects[item.vnum][3]-1), item.vnum)
- cmdchat("setRune "..item.vnum.."#"..(affects[item.vnum][3]-1))
- chat(chat_color("[Smocza Alchemia]", "blue").." "..item_name(item.vnum).." została aktywowana.")
- end
- end
- -- ## DROP ## --
- when kill with pc.level >= 100 and npc.get_level()+20 > pc.level or pc.level >= 100 and npc.get_level() >= 90 begin
- if number(1, 1000) <= 7 then
- pc.give_item2(33400, 1)
- end
- end
- when 33400.use begin
- if not pc.can_warp() then
- chat(chat_color("[Smocza Skrzynia]", "blue").." Nie możesz teraz tego zrobić, spróbuj za 10 sekund.")
- else
- item.remove_one()
- pc.give_item2(number(33401, 33405), 1)
- end
- end
- -- ## ALCHEMIK ## ==
- when 20001.chat."Smocza Alchemia" begin
- snn()
- say("Cześć!")
- say("Zajmuję się w tym mieście Smoczą Alchemią,")
- say("potężną zdolnością jest możliwość jej wytwarzania.")
- say("Co chciałbyś zrobić?")
- local s = select("Wytwórz Smoczą Runę ", "Ulepsz Smoczą Runę ", "O Smoczej Alchemii...", "Wyjdź ")
- if s == 1 then
- snn()
- say("Wybierz rodzaj:")
- local ss = select("Szmaragdowa (5%/10%/15% Silny na Potwory)", "Onyksowa (5%/10%/15% Silny na Ludzi)", "Rubinowa (1000, 2500, 5000 Maks. PŻ)", "Szafirowa (5%/10%/15% Penetrujące Uderzenie)", "Bursztynowa (5%/10%/15% Krytyczne Uderzenie)", "Anuluj")
- if ss >= 1 and ss <= 5 then
- snn()
- say("Aby wytworzyć:")
- say_item_vnum2(33410+ss, "Smocza Runa")
- say("będziesz potrzebował:")
- say_item_vnum2(33400+ss, "Wymagane: 15")
- say_reward("- 15x Smoczy Kamień ")
- say_reward("- 100.000.000 Yang")
- say()
- say()
- local sss = select("Wytwórz Runę!", "Anuluj")
- if sss == 1 then
- if not pc.can_warp() then
- chat(chat_color("[Alchemik]", "blue").." Nie możesz teraz tego zrobić, spróbuj za 10 sekund.")
- elseif pc.money < 100000000 then
- chat(chat_color("[Alchemik]", "blue").." Nie posiadasz 100.000.000 Yang.")
- elseif pc.countitem(33400+ss) < 15 then
- chat(chat_color("[Alchemik]", "blue").." Nie posiadasz odpowiedniej ilości Smoczych Kamieni. Wymagane: 15.")
- else
- pc.remove_item(33400+ss, 15)
- pc.changemoney(-100000000)
- pc.give_item2(33410+ss, 1)
- chat(chat_color("[Alchemik]", "blue").." Poprawnie wytworzono Smoczą Runę.")
- end
- end
- end
- elseif s == 2 then
- snn()
- say("Aby ulepszyć swoją Smoczą Duszę będziesz potrzebował ")
- say("odpowiednią ilość jednego ze Smoczych Kamieni:")
- say_item_vnum2(number(33401, 33405), "Jeden z pięciu Kamieni")
- say_reward("Na poziom mistyczny: 30")
- say_reward("Na poziom legendarny: 45")
- elseif s == 3 then
- snn()
- say("Smocza Alchemia polega na wytworzeniu pięciu")
- say("rodzai Smoczych Run i ulepszeniu ich")
- say("do poziomu ostatecznego - legendarnego,")
- say("gdzie będą niezwykle silne w walce z przeciwieństwami.")
- say_reward("- Szmaragdowa (5%/10%/15% Silny na Potwory)")
- say_reward("- Onyksowa (5%/10%/15% Silny na Ludzi)")
- say_reward("- Rubinowa (1000, 2000, 3000 Maks. PŻ)")
- say_reward("- Szafirowa (5%/10%/15% Penetrujące Uderzenie)")
- say_reward("- Bursztynowa (5%/10%/15% Krytyczne Uderzenie)")
- say_item_vnum2(number(33431, 33435), "Przykładowa Legendarna Runa")
- wait()
- snn()
- say("Aby wytworzyć jedną z run:")
- say_item_vnum2(33411, "Smocza Runa")
- say("będziesz potrzebował:")
- say_item_vnum2(33401, "Wymagane: 15")
- say_reward("- 15x Smoczy Kamień ")
- say_reward("- 100.000.000 Yang")
- say_reward("Szansa powodzenia: 50%")
- end
- end
- when 20001.take with item.get_vnum() >= 33411 and item.get_vnum() <= 33425 begin
- local grade = system_smocza_alchemia.getGrade(item.vnum)
- local count = 30
- local money = 100000000
- local newruna = item.get_vnum()+10
- if item.vnum >= 33421 then
- count = 45
- money = 200000000
- end
- snn()
- say("Aby ulepszyć swoją runę na lepszą:")
- say_item_vnum2(newruna, "Nowa Smocza Runa")
- say("będziesz potrzebował:")
- say_item_vnum2(33400+grade, "Wymagane: "..count)
- say_reward("- "..count.."x Smoczy Kamień ")
- say_reward("- "..numtomoney(money).." Yang")
- say_reward("Szansa powodzenia: 50%")
- say()
- say()
- local s = select("Ulepsz Runę!", "Anuluj")
- if s == 1 then
- if not pc.can_warp() then
- chat(chat_color("[Alchemik]", "blue").." Nie możesz teraz tego zrobić, spróbuj za 10 sekund.")
- elseif pc.money < money then
- chat(chat_color("[Alchemik]", "blue").." Nie posiadasz "..numtomoney(money).." Yang.")
- elseif pc.countitem(33400+grade) < count then
- chat(chat_color("[Alchemik]", "blue").." Nie posiadasz odpowiedniej ilości Smoczych Kamieni. Wymagane: "..count..".")
- else
- if number(1, 100) <= 50 then
- pc.remove_item(33400+grade, count)
- if newruna < 33411 or newruna > 33435 then return end
- pc.give_item2(newruna, 1)
- item.remove_one()
- pc.changemoney(-money)
- chat(chat_color("[Alchemik]", "blue").." Poprawnie ulepszono Smoczą Runę.")
- else
- pc.remove_item(33400+grade, count)
- pc.changemoney(-money)
- chat(chat_color("[Alchemik]", "blue").." Ulepszanie runy zakończyło się niepowodzeniem.")
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement