- Mesaj
- 225
- Çözümler
- 2
- Beğeni
- 182
- Puan
- 731
- Ticaret Puanı
- 0
- Herhangi bir oyuncu npc'den duello eventini başlatır genel'den notice geçer xxx kişisi duelloyu başlattı şeklinde diğer 10 kişi npc ye gelip duelloya ismini kayıt ettirir 10 kişi 2 dakika içerisinde tamamlarsa belirlenen kişiler sizin seçtiğiniz map'e ışınlanır ölen şehre gönderilir sona kalana ise ödül verilir (isteğe bağlı) duello 3 dakika içinde bitmezse otomatik şehre ışınlanırlar questteki buglar giderilmiştir örn: oyuncu ismini kayıt ettikten sonra oyundan çıkması gibi.
Quest:
questlib.lua'ya eklenecek kodlar
quest_functions'a eklenecek kod
Quest:
Lua (Quest):
quest duello begin
state start begin
when login begin
if pc.get_map_index() == 191 then
cmdchat("duello 1 0")
if game.get_event_flag("duellohp_"..pc.get_name()) > pc.get_hp() then
affect . add_collect ( 10 , game.get_event_flag("duellohp_"..pc.get_name()) , 4 )
end
game.set_event_flag("katilim", game.get_event_flag("katilim")+1)
game.set_event_flag("derece_"..pc.get_name(), pc.get_real_alignment())
game.set_event_flag("duello_"..pc.get_name(), "1")
timer("sayac4", 2)
timer("sayac6", 180)
end
end
when logout begin
if pc.get_map_index() == 191 then
cmdchat("duello 0 1")
game.set_event_flag("duello_"..pc.get_name(), "0")
game.set_event_flag("katilim", game.get_event_flag("katilim")-1)
if pc.get_real_alignment()!= game.get_event_flag("derece_"..pc.get_name()) then
pc.change_alignment(game.get_event_flag("derece_"..pc.get_name()))
end
if game.get_event_flag("katilim") == 0 and game.get_event_flag("katilim_1") == 0 then
game.set_event_flag("katilim_1","1")
game.set_event_flag("katilim", "0")
game.set_event_flag("duello_toplam", "0")
global_setvarchar("duello_name_1","")
global_setvarchar("duello_name_2","")
global_setvarchar("duello_name_3","")
global_setvarchar("duello_name_4","")
global_setvarchar("duello_name_5","")
global_setvarchar("duello_name_6","")
global_setvarchar("duello_name_7","")
global_setvarchar("duello_name_8","")
global_setvarchar("duello_name_9","")
global_setvarchar("duello_name_10","")
game.set_event_flag("duello_open", "1")
game.set_event_flag("duello_toplam_katilim","0")
cmdchat("duello 0 1")
end
end
end
when 20092.chat."Duello iptal et ve baslat" with pc.is_gm() begin
say("")
say("")
say("")
local b=select("Başlat.", "Reddet.")
if 1==b then
game.set_event_flag("katilim", "0")
game.set_event_flag("duello_toplam", "0")
game.set_event_flag("duello_toplam_katilim",0)
global_setvarchar("duello_name_1","")
global_setvarchar("duello_name_2","")
global_setvarchar("duello_name_3","")
global_setvarchar("duello_name_4","")
global_setvarchar("duello_name_5","")
global_setvarchar("duello_name_6","")
global_setvarchar("duello_name_7","")
global_setvarchar("duello_name_8","")
global_setvarchar("duello_name_9","")
global_setvarchar("duello_name_10","")
end
end
when 20092.chat."Duello baslatmak istiyorum." with game.get_event_flag("duello_open") == 1 begin
say("")
say("")
say("")
local b=select("Başlat.", "Reddet.")
if 1==b and game.get_event_flag("duello_open") == 1 then
game.set_event_flag("katilim_1","0")
game.set_event_flag("katilim", "0")
game.set_event_flag("duello_toplam", "0")
game.set_event_flag("duello_toplam_katilim","0")
global_setvarchar("duello_name_2","")
global_setvarchar("duello_name_3","")
global_setvarchar("duello_name_4","")
global_setvarchar("duello_name_5","")
global_setvarchar("duello_name_6","")
global_setvarchar("duello_name_7","")
global_setvarchar("duello_name_8","")
global_setvarchar("duello_name_9","")
global_setvarchar("duello_name_10","")
global_setvarchar("duello_name_1",pc.get_name())
game.set_event_flag("duello_toplam","1")
game.set_event_flag("duello_open", "0")
timer("sayac1", 3)
timer("sayac3", 120)
notice_all(pc.get_name().." kisisi duello eventini baslatti Elizabeth npcsinden katiliniz.")
chat("Duelloya katildin katilimci sayisi 10 oldugunda otomatik isinlanacaksin.")
end
end
when 20092.chat."Duelloya katilmak istiyorum." with game.get_event_flag("duello_open") == 0 begin
say("")
say("")
say("")
local b=select("Katil.", "Katilma.")
if 1==b then
if game.get_event_flag("duello_toplam") < 11 then
if global_getvarchar("duello_name_1") != pc.get_name() and global_getvarchar("duello_name_2") != pc.get_name() and global_getvarchar("duello_name_3") != pc.get_name() and global_getvarchar("duello_name_4") != pc.get_name() and global_getvarchar("duello_name_5") != pc.get_name() and global_getvarchar("duello_name_6") != pc.get_name() and global_getvarchar("duello_name_7") != pc.get_name() and global_getvarchar("duello_name_8") != pc.get_name() and global_getvarchar("duello_name_9") != pc.get_name() and global_getvarchar("duello_name_10") != pc.get_name() then
local d = game.get_event_flag("duello_toplam")
global_setvarchar("duello_name_"..d+1,pc.get_name())
game.set_event_flag("duello_toplam", d+1)
chat("Duelloya katildin katilimci sayisi 10 oldugunda otomatik isinlanacaksin.")
timer("sayac1", 3)
end
else
say("Katilimlar doldu baska sefere iyi oyunlar.")
end
end
end
when 20092.chat."Duello katilimcilari" with game.get_event_flag("duello_open") == 0 begin
say("Katilimci listesi:")
say("")
say("1. >>>> "..global_getvarchar("duello_name_1"))
say("2. >>>> "..global_getvarchar("duello_name_2"))
say("3. >>>> "..global_getvarchar("duello_name_3"))
say("4. >>>> "..global_getvarchar("duello_name_4"))
say("5. >>>> "..global_getvarchar("duello_name_5"))
say("6. >>>> "..global_getvarchar("duello_name_6"))
say("7. >>>> "..global_getvarchar("duello_name_7"))
say("8. >>>> "..global_getvarchar("duello_name_8"))
say("9. >>>> "..global_getvarchar("duello_name_9"))
say("10. >>>> "..global_getvarchar("duello_name_10"))
say("")
end
when sayac1.timer begin
if global_getvarchar("duello_name_1") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_2") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_3") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_4") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_5") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_6") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_7") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_8") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_9") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_10") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
end
if game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duello_toplam_katilim",1)
end
timer("sayac2", 3)
end
when sayac2.timer begin
if global_getvarchar("duello_name_1") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_2") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_3") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_4") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_5") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_6") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_7") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_8") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_9") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
elseif global_getvarchar("duello_name_10") == pc.get_name() and game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duellohp_"..pc.get_name(),pc.get_hp())
pc.warp("741200","249200")
end
if game.get_event_flag("duello_toplam") == 10 then
game.set_event_flag("duello_toplam_katilim",1)
end
timer("sayac1", 3)
end
when sayac3.timer begin
if game.get_event_flag("duello_toplam") != 10 and game.get_event_flag("duello_toplam_katilim") == 0 then
game.set_event_flag("katilim", "0")
game.set_event_flag("duello_toplam_katilim",1)
game.set_event_flag("duello_toplam", "0")
global_setvarchar("duello_name_1","")
global_setvarchar("duello_name_2","")
global_setvarchar("duello_name_3","")
global_setvarchar("duello_name_4","")
global_setvarchar("duello_name_5","")
global_setvarchar("duello_name_6","")
global_setvarchar("duello_name_7","")
global_setvarchar("duello_name_8","")
global_setvarchar("duello_name_9","")
global_setvarchar("duello_name_10","")
game.set_event_flag("duello_open", "1")
end
end
when sayac4.timer begin
if pc.get_map_index() == 191 then
if false == pc.is_dead() and game.get_event_flag("katilim") == 1 and game.get_event_flag("duello_"..pc.get_name()) == 1 then
game.set_event_flag("katilim_1",0)
game.set_event_flag("duello_"..pc.get_name(), "0")
if game.get_event_flag("item_ver") == 1 then
local d = game.get_event_flag("item_kodu1")
local c = game.get_event_flag("item_kodu2")
pc.give_item2(d,1)
pc.give_item2(c,1)
end
if pc.get_empire() == 1 then
pc.warp(469300,964200)
elseif pc.get_empire() == 2 then
pc.warp(55700,157900)
elseif pc.get_empire() == 3 then
pc.warp(969600,278400)
end
end
if true == pc.is_dead() then
cmdchat("duello 0 1")
if pc.get_empire() == 1 then
pc.warp(469300,964200)
elseif pc.get_empire() == 2 then
pc.warp(55700,157900)
elseif pc.get_empire() == 3 then
pc.warp(969600,278400)
end
game.set_event_flag("duello_"..pc.get_name(), "0")
end
timer("sayac5", 2)
end
end
when sayac5.timer begin
if pc.get_map_index() == 191 then
if false == pc.is_dead() and game.get_event_flag("katilim") == 1 and game.get_event_flag("duello_"..pc.get_name()) == 1 then
game.set_event_flag("katilim_1",0)
game.set_event_flag("duello_"..pc.get_name(), "0")
if game.get_event_flag("item_ver") == 1 then
local d = game.get_event_flag("item_kodu1")
local c = game.get_event_flag("item_kodu2")
pc.give_item2(d,1)
pc.give_item2(c,1)
end
if pc.get_empire() == 1 then
pc.warp(469300,964200)
elseif pc.get_empire() == 2 then
pc.warp(55700,157900)
elseif pc.get_empire() == 3 then
pc.warp(969600,278400)
end
end
if true == pc.is_dead() then
cmdchat("duello 0 1")
if pc.get_empire() == 1 then
pc.warp(469300,964200)
elseif pc.get_empire() == 2 then
pc.warp(55700,157900)
elseif pc.get_empire() == 3 then
pc.warp(969600,278400)
end
game.set_event_flag("duello_"..pc.get_name(), "0")
end
timer("sayac4", 2)
end
end
when sayac6.timer begin
if pc.get_map_index() == 191 and game.get_event_flag("katilim") != 1 then
game.set_event_flag("katilim_1",0)
if pc.get_empire() == 1 then
pc.warp(469300,964200)
elseif pc.get_empire() == 2 then
pc.warp(55700,157900)
elseif pc.get_empire() == 3 then
pc.warp(969600,278400)
end
end
end
end
end
questlib.lua'ya eklenecek kodlar
Lua (Quest):
function setvarchar(name, var)
local laenge = string.len (var)
local setchar = 0
local save_name = 0
local letter = 0
while laenge > setchar do
setchar = setchar + 1
letter = string.sub (var, setchar, setchar)
letter = string.byte(letter, 1)
save_name = ""..name.."_char_"..setchar..""
pc.setqf(save_name, letter)
end
local save_laenge=""..name.."laenge"
pc.setqf(save_laenge, laenge)
end
function getvarchar(name)
local save_laenge = ""..name.."laenge"
local laenge = pc.getqf(save_laenge)
local save_name = 0
local var = ""
local letter = 0
local getchar = 0
while laenge > getchar do
getchar = getchar + 1
save_name = ""..name.."_char_"..getchar..""
letter = pc.getqf(save_name)
if letter!=0 then
letter = string.char(letter)
else
letter = ""
end
var = ""..var..""..letter..""
end
return var
end
function delvarchar(name)
local save_laenge = ""..name.."laenge"
local laenge = pc.getqf(save_laenge)
local getchar = 0
while laenge > getchar do
getchar = getchar + 1
local save_name = ""..name.."_char_"..getchar..""
pc.delqf(save_name)
end
pc.delqf(save_laenge)
end
function global_setvarchar(name, var)
local laenge = string.len (var)
local setchar = 0
local save_name = 0
local letter = 0
while laenge > setchar do
setchar = setchar + 1
letter = string.sub (var, setchar, setchar)
letter = string.byte(letter)
if letter==91 or letter==93 then
letter=32
end
save_name = ""..name.."_char_"..setchar..""
game.set_event_flag(save_name, letter)
end
local save_laenge=""..name.."laenge"
game.set_event_flag(save_laenge, laenge)
end
function global_getvarchar(name)
local save_laenge = ""..name.."laenge"
local laenge = game.get_event_flag(save_laenge)
local save_name = 0
local var = ""
local letter = 0
local getchar = 0
while laenge > getchar do
getchar = getchar + 1
save_name = ""..name.."_char_"..getchar..""
letter = game.get_event_flag(save_name)
if letter!=0 then
letter = string.char(letter)
else
letter = ""
end
var = ""..var..""..letter..""
end
return var
end
quest_functions'a eklenecek kod
Kod:
pc.is_dead