[RELEASE]Castle War

03/14/2013 20:55 HaveBeen™#1


PHP Code:
--[[  
    -- 
Castle War   
    
-- Quest Writer By HaveBeen™  
    
-- For EPVP   
]]--  
quest castlewar begin  
    state start begin  
      
    
function check()  
        
local gmlist = {"HaveBeen"} -- Enter the names of GameMaster 
        
for 1,table.getn(gmlist),do  
            if(
gmlist[i] == pc.get_name()) then  
                
return true  
            
else  
                return 
false  
            end  
        end  
    end  
      
    when letter with castlewar
.check() == true begin  
        send_letter
("Castle War")  
    
end  
    when button 
or info begin  
    say_title
("Castle War: ")  
    
say("")  
    --  
    if(
game.get_event_flag("castlewar_status") == 0then  
    say_reward
("Hello "..pc.name)  
    
say_reward("Do you want to open the Battle of the castle? ")  
    
local s select(locale.yes,locale.no)  
    if(
== 2then return end  
    say_title
("Castle War: ")  
    
say("")  
    --  
    
local amount = {100,500,1000,1500} -- Amount of Homicide xD  
    local luck 
number(1,table.getn(amount))  
    
game.set_event_flag("castlewar_kills",amount[luck]) 
    
game.set_event_flag("empire_1",game.get_event_flag("castlewar_kills")) 
    
game.set_event_flag("empire_2",game.get_event_flag("castlewar_kills")) 
    
game.set_event_flag("empire_3",game.get_event_flag("castlewar_kills")) 
    
game.set_event_flag("castlewar_status",1)  
    
say_reward("The castle was opened war.. ")  
    --  
    
notice_all("The Castle was opened war!. ")  
    elseif(
game.get_event_flag("castlewar_status") == 1then  
    say_reward
("Hello "..pc.name)  
    
say_reward("Do you want to turn off the War of the castle? ")  
    
local s select(locale.yes,locale.no)  
    if(
== 2then return end  
    say_title
("Castle War: ")  
    
say("")  
    --  
    
say("Castle war closed.. ")  
    
game.set_event_flag("castlewar_status",0)  
    
game.set_event_flag("castlewar_kills",0)  
    
game.set_event_flag("empire_1",0)  
    
game.set_event_flag("empire_2",0)  
    
game.set_event_flag("empire_3",0)  
        
end  
    end  
      
    when 11001.chat
."Join the Battle of the castle" or 11003.chat."Join the Battle of the castle" or 11005.chat."Join the Battle of the castle" with game.get_event_flag("castlewar_status") == 1 begin  
    say_title
(mob_name(npc.get_race())..":")  
    
say("")  
    ---  
    if(
pc.get_level() < 75then  
    
return say_reward("75 can not go below the level of.. ")  
    
end  
    say
("Do you want to join war? ")  
    
say("")  
    
local s select(locale.yes,locale.no)  
    if(
== 1then  
    pc
.warp(x,y)  
        
end  
    end  
      
    when login with pc
.get_map_index() == xxx begin  
        
if(game.get_event_flag("castlewar_status") == 0then  
            warp_to_village
()  
        else  
            
say_title("Castle War Information: ")  
            
say("")  
            ---  
            
say("Total number of enemies "..game.get_event_flag("castlewar_kills"))
            
say("Good luck.. ")  
        
end  
    end  
      
    when kill with npc
.is_pc() and npc.empire != pc.empire and pc.get_map_index() == xxx begin  
        game
.set_event_flag("empire_"..pc.get_empire(),game.get_event_flag("empire_"..pc.get_empire())+1)  
        
local empirename = {"Shinsoo","Chunjo","Jinno"}  
        
chat(empirename[pc.get_empire()].." "..game.get_event_flag("empire_"..pc.get_empire()).." Points Wins! ")  
        if(
game.get_event_flag("empire_"..pc.get_empire()) == game.get_event_flag("castlewar_kills")) then  
            
if(pc.get_empire() == 1then -- Shinsoo  
                notice_in_map
("Shinsoo Won The War! ")  
                
game.set_event_flag("empire_1",0)  
                
game.set_event_flag("empire_2",0)  
                
game.set_event_flag("empire_3",0)  
                
game.set_event_flag("castlewar_kills",0)  
                
game.set_event_flag("castlewar_status",0)  
                
warp_all_to_village()  
            elseif(
pc.get_empire() == 2then -- Chunjo  
                notice_in_map
("Chunjo Won The War! ")  
                
game.set_event_flag("empire_1",0)  
                
game.set_event_flag("empire_2",0)  
                
game.set_event_flag("empire_3",0)  
                
game.set_event_flag("castlewar_kills",0)  
                
game.set_event_flag("castlewar_status",0)  
                
warp_all_to_village()  
            elseif(
pc.get_empire() == 3then -- Jinno  
                notice_in_map
("Jinno Won The War! ")  
                
game.set_event_flag("empire_1",0)  
                
game.set_event_flag("empire_2",0)  
                
game.set_event_flag("empire_3",0)  
                
game.set_event_flag("castlewar_kills",0)  
                
game.set_event_flag("castlewar_status",0)  
                
warp_all_to_village()  
                
end  
            end  
        end  
    end  
end 
Written for this quest only epvp :cool:

## Edit the mapindex
## Edit the x and y coordinats..

## I'm sorry I forgot something :D

## The number of killings in the table is selected(Automatic)..
## local amount = {100,500,1000,1500} -- Change the number of xD


King Regards
Mfg HaveBeen™

03/14/2013 21:21 LuggexD#2
What should we do with this quest if we don't have the matching map .
03/14/2013 21:22 stσям™#3
Thanks 4 share :D
03/14/2013 21:26 Red Firestar#4
Thanks <3
03/14/2013 21:28 HaveBeen™#5
Quote:
Originally Posted by LuggexD View Post
What should we do with this quest if we don't have the matching map .
:D Threeway use the map :)
03/14/2013 21:31 DocTooR#6
Perfect :D
03/14/2013 21:42 Baum'#7
Thanks 4 share
03/14/2013 22:13 ☆RealPain#8
Thanks 4 Share ;)
*and Nice Work*

☆RealPain
03/14/2013 22:37 -TÜRK-#9
thanks dude ^^
03/14/2013 23:28 LastSpartan300#10
Quote:
Originally Posted by HaveBeen™ View Post


PHP Code:
--[[
    -- 
Castle War 
    
-- Quest Writer By HaveBeen™
    
-- For EPVP 
]]--
quest castlewar begin
    state start begin
    
    
function check()
        
local gmlist = {"HaveBeen"}
        for 
1,table.getn(gmlist),do
            if(
gmlist[i] == pc.get_name()) then
                
return true
            
else
                return 
false
            end
        end
    end
    
    when letter with castlewar
.check() == true begin
        send_letter
("Castle War")
    
end
    when button 
or info begin
    say_title
("Castle War: ")
    
say("")
    --
    if(
game.get_event_flag("castlewar_status") == 0then
    say_reward
("Hello "..pc.name)
    
say_reward("Do you want to open the Battle of the castle? ")
    
local s select(locale.yes,locale.no)
    if(
== 2then return end
    say_title
("Castle War: ")
    
say("")
    --
    
local amount = {100,500,1000,1500} -- Amount of Homicide xD
    local luck 
number(1,table.getn(amount))
    
game.set_event_flag("castlewar_kills",amount[luck])
    
game.set_event_flag("castlewar_status",1)
    
say_reward("The castle was opened war.. ")
    --
    
notice_all("The Castle was opened war!. ")
    elseif(
game.get_event_flag("castlewar_status") == 1then
    say_reward
("Hello "..pc.name)
    
say_reward("Do you want to turn off the War of the castle? ")
    
local s select(locale.yes,locale.no)
    if(
== 2then return end
    say_title
("Castle War: ")
    
say("")
    --
    
say("Castle war closed.. ")
    
game.set_event_flag("castlewar_status",0)
    
game.set_event_flag("castlewar_kills",0)
    
game.set_event_flag("empire_1",0)
    
game.set_event_flag("empire_2",0)
    
game.set_event_flag("empire_3",0)
        
end
    end
    
    when 11001.chat
."Join the Battle of the castle" or 11003.chat."Join the Battle of the castle" or 11005.chat."Join the Battle of the castle" with game.get_event_flag("castlewar_status") == 1 begin
    say_title
(mob_name(npc.get_race())..":")
    
say("")
    ---
    if(
pc.get_level() < 75then
    
return say_reward("75 can not go below the level of.. ")
    
end
    say
("Do you want to join war? ")
    
say("")
    
local s select(locale.yes,locale.no)
    if(
== 1then
    pc
.warp(x,y)
        
end
    end
    
    when login with pc
.get_map_index() == xxx begin
        
if(game.get_event_flag("castlewar_status") == 0then
            warp_to_village
()
        else
            
say_title("Castle War Information: ")
            
say("")
            ---
            
say("Total number of enemies "..game.get_event_flag("empire_"..pc.get_empire()))
            
say("Good luck.. ")
        
end
    end
    
    when kill with npc
.is_pc() and npc.empire != pc.empire and pc.get_map_index() == xxx begin
        game
.set_event_flag("empire_"..pc.get_empire(),game.get_event_flag("empire_"..pc.get_empire())+1)
        
local empirename = {"Shinsoo","Chunjo","Jinno"}
        
chat(empirename[pc.get_empire()].." "..game.get_event_flag("empire_"..pc.get_empire()).." Points Wins! ")
        if(
game.get_event_flag("empire_"..pc.get_empire()) == game.get_event_flag("castlewar_kills")) then
            
if(pc.get_empire() == 1then -- Shinsoo
                notice_in_map
("Shinsoo Won The War! ")
                
game.set_event_flag("empire_1",0)
                
game.set_event_flag("empire_2",0)
                
game.set_event_flag("empire_3",0)
                
game.set_event_flag("castlewar_kills",0)
                
game.set_event_flag("castlewar_status",0)
                
warp_all_to_village()
            elseif(
pc.get_empire() == 2then -- Chunjo
                notice_in_map
("Chunjo Won The War! ")
                
game.set_event_flag("empire_1",0)
                
game.set_event_flag("empire_2",0)
                
game.set_event_flag("empire_3",0)
                
game.set_event_flag("castlewar_kills",0)
                
game.set_event_flag("castlewar_status",0)
                
warp_all_to_village()
            elseif(
pc.get_empire() == 3then -- Jinno
                notice_in_map
("Jinno Won The War! ")
                
game.set_event_flag("empire_1",0)
                
game.set_event_flag("empire_2",0)
                
game.set_event_flag("empire_3",0)
                
game.set_event_flag("castlewar_kills",0)
                
game.set_event_flag("castlewar_status",0)
                
warp_all_to_village()
                
end
            end
        end
    end
end 
Written for this quest only epvp :cool:

## Edit the mapindex
## Edit the x and y coordinats..

King Regards
Mfg HaveBeen™

Thanks for the release... but this quest does not work for me...
03/15/2013 05:58 HaveBeen™#11
Quote:
Originally Posted by LastSpartan300 View Post
Thanks for the release... but this quest does not work for me...
PHP Code:
local gmlist = {"HaveBeen"
Edit this place :cool:
03/15/2013 10:15 Skyƒusioη#12
:awesome:
03/15/2013 10:39 LastSpartan300#13
Quote:
Originally Posted by HaveBeen™ View Post
PHP Code:
local gmlist = {"HaveBeen"
Edit this place :cool:
I edited the name , map index , etc but when i was supposed to choose the "Amount of Homicide" nothing appeared... The quest only starts the war.
And in the npc( 11001, 11003, 11005 ) i am the only one who can see the war button...

Thanks again! :D
03/15/2013 12:17 HaveBeen™#14
Quote:
Originally Posted by LastSpartan300 View Post
I edited the name , map index , etc but when i was supposed to choose the "Amount of Homicide" nothing appeared... The quest only starts the war.
And in the npc( 11001, 11003, 11005 ) i am the only one who can see the war button...

Thanks again! :D
Amount of homicide => the number of enemies killed :)

I'm Sorry fixed now :D try it now ^^
03/16/2013 10:01 KingHunter3#15
nice work :)