Ma puteti ajuta sa adaug functia inchide porti la un quest?
----------------------------------------------------
----- Quest: Lupta intre ragate -----
----- Server: Rise of the Unknown -----
----- Author: Nica Virgil -----
----------------------------------------------------
quest forked_road begin
state start begin
when login begin
if forked.isforkedmapindex( pc.get_map_index() ) == 1 then
if game.get_event_flag("threeway_war") == 0 then
warp_to_village()
return
end
if forked.issungzimapindex(pc.get_map_index())==0 then
say_title( " Bãtãlia Regatelor " )
say ( "" )
say( " Trebuie sã omori Regele Tigru Galben " )
say( " El detine sigiliul acestei hãrti! " )
say( " Farã el nu poti sã treci mai departe: " )
say_item( " Acesta este sigiliul!",50089," ");
else
say( " Bun venit la Bãtãlia Regatelor! " )
say( " Aici te porti întalni cu alte regate " )
say( " pentru a vã duela pentru suprematie!! " )
end
end
end
when 11001.chat." Bãtãlia Regatelor " or 11003.chat." Bãtãlia Regatelor " or 11005.chat." Bãtãlia Regatelor " begin
if game.get_event_flag("threeway_war")==0 then
say_title(" Bãtãlia Regatelor ")
say("")
say(" Protile regatelor de luptã ")
say(" Sunt închise pentru moment! ")
return
end
say_title(" Bãtãlia Regatelor ")
say("")
say(" Bunã! ")
say(" Portile de luptã sunt deschise! ")
say(" Vrei sa intrii? ")
local s = select(" Da "," Nu! ")
if s == 2 then return end
say_title(" Bãtãlia Regatelor ")
if pc.get_level() < 50 then
say(" Nivelul tãu este prea mic.Vino când o sa ai peste level 50! ")
return
end
forked.setdeadcount()
if pc.get_empire()==1 then
if game.get_event_flag("threeway_war_open_gate1" )==0 then
say(" Aceasta este o Tarã Sfântã. [ENTER] Unde cei mai buni pot intra aici! " );
return
end
elseif pc.get_empire()==2 then
if game.get_event_flag("threeway_war_open_gate2")==0 then
say(" Aceasta este o Tarã Sfântã. [ENTER] Unde cei mai buni pot intra aici! " );
return
end
elseif pc.get_empire()==3 then
if game.get_event_flag("threeway_war_open_gate3" )==0 then
say(" Aceasta este o Tarã Sfântã. [ENTER] Unde cei mai buni pot intra aici! " );
return
end
end
say(" Ok, vom merge! ")
wait()
pc.warp(forked.get_pass_start_pos())
end
when 1306.kill begin
game.drop_item(50089, 1)
notice_in_map(" Tigrul Galebn a dat sigilil! [ENTER] Acum puteti intra în luptã! ")
end
when razboiul_regatelor_sigiliu.take with item.vnum == 50089 begin
notice_in_map(" Sigiliul a fost emis, se deschide sigiliul... ")
npc.purge()
item.remove()
forked.initkillcount()
if pc.get_empire()==1 then
game.set_event_flag("threeway_war_open_gate1", 0)
notice_all(" Imperiul Rosu a deschis sigiliul! ")
elseif pc.get_empire()==2 then
game.set_event_flag("threeway_war_open_gate2", 0 )
notice_all(" Imperiul Galben a deschis sigiliul! ")
elseif pc.getempire()==3 then
game.set_event_flag("threeway_war_open_gate3", 0 )
notice_all(" Imperiul Albastru a deschis sigiliul! ")
end
local x, y = forked.get_sungzi_start_pos()
forked.warp_all_in_map(pc.get_map_index(), forked.getsungzimapindex(), x, y, 10)
end
when 11001.chat." Manager Lupte Regat " or 11003.chat." Manager Lupte Regat " or 11005.chat." Manager Lupte Regat " with pc.is_gm() begin
local s = select(" Lupta Regatelor Start " , " Lupta Regatelor Sfârsit ", " Închide " )
if s==3 then
return
end
if s==1 then
kill_all_in_map( forked.getsungzimapindex() )
kill_all_in_map( forked.getpassmapindexbyempire(1) )
kill_all_in_map( forked.getpassmapindexbyempire(2) )
kill_all_in_map( forked.getpassmapindexbyempire(3) )
forked.initforked()
regen_in_map( forked.getpassmapindexbyempire(1), forked.getpasspathbyempire(1) .."regen.txt" )
regen_in_map( forked.getpassmapindexbyempire(1), forked.getpasspathbyempire(1) .."npc.txt" )
regen_in_map( forked.getpassmapindexbyempire(2), forked.getpasspathbyempire(2) .."regen.txt" )
regen_in_map( forked.getpassmapindexbyempire(2), forked.getpasspathbyempire(2) .."npc.txt" )
regen_in_map( forked.getpassmapindexbyempire(3), forked.getpasspathbyempire(3) .."regen.txt" )
regen_in_map( forked.getpassmapindexbyempire(3), forked.getpasspathbyempire(3) .."npc.txt" )
game.set_event_flag("threeway_war",1)
game.set_event_flag("threeway_war_dead_count", 5)
game.set_event_flag("threeway_war_mob_count", 150)
game.set_event_flag("threeway_war_kill_count", 500)
game.set_event_flag("threeway_war_kill_boss_count", 1)
game.set_event_flag("threeway_war_open_gate1", 1)
game.set_event_flag("threeway_war_open_gate2", 1)
game.set_event_flag("threeway_war_open_gate3", 1)
notice_all(" Lupta Regatelor a început chiar acum! ")
notice_all(" Fie ca cel mai bun sã câstige, Echipa Metin2Neleus! ")
else
game.set_event_flag("threeway_war", 0)
notice_all(" Lupta Regatelor a luat sfârsit! ")
forked.purge_all_monsters()
warp_all_to_village(forked.getsungzimapindex(), 1)
warp_all_to_village(forked.getpassmapindexbyempire(1), 1)
warp_all_to_village(forked.getpassmapindexbyempire(2), 1)
warp_all_to_village(forked.getpassmapindexbyempire(3), 1)
end
end
when 11001.chat." Sungzi Deschis " or 11003.chat." Sungzi Deschis " or 11005.chat." Sungzi Deschis " with pc.is_gm() begin
game.set_event_flag("threeway_war",1)
game.set_event_flag("threeway_war_dead_count", 5)
game.set_event_flag("threeway_war_mob_count", 150 )
game.set_event_flag("threeway_war_kill_count", 200 )
game.set_event_flag("threeway_war_kill_boss_count", 1 );
game.set_event_flag("threeway_war_open_gate1", 1 )
game.set_event_flag("threeway_war_open_gate2", 1 )
game.set_event_flag("threeway_war_open_gate3", 1 )
command("warp 9463 254")
end
end
end



