- script Faction_System -1,{ end; OnInit: bindatcmd ("factionstart","Faction_System::OnFactionStart"); bindatcmd ("factionend","Faction_System::OnFactionEnd"); OnMinute00: set .Faction,0; StartLoop: if(gettime(4)==$FactionEndDay[.Faction]&&gettime(3)==$FactionEndTime[.Faction]) { goto FactionActualEnd; end; } if(gettime(4)==$FactionStartDay[.Faction]&&gettime(3)>=$FactionStartTime[.Faction]&&(gettime(3)<$FactionEndTime[.Faction] || $FactionStartDay[.Faction]!=$FactionEndDay[.Faction])) { goto FactionActualStart; end; } set .Faction,.Faction+1; if(.Faction>7) { goto StartLoopEnd; } goto StartLoop; end; FactionActualStart: if($FactionStatus==1) { end; } set $FactionStatus,1; donpcevent "CastleSpawn::OnCastleDESpawn"; disablenpc "Kamui"; fvfon "mocg_cas01"; initnpctimer; if($FactionName!=0) { announce "The Faction War has begun! The Current Castle Owner is ["+factioninfo($FactionName,0)+"] Faction.",bc_all|bc_woe; } else { announce "Faction War has began! Which Faction will prove their worth?",bc_all|bc_woe; } if(getmapusers("mocg_cas01")>0) { mapwarp "mocg_cas01","prontera",155,182,0; } monster "mocg_cas01",142,291,"Faction Stone",15000,1,"Faction_System::OnFactionBreak"; enablenpc "FactionWarp"; //enablenpc "FactionInfo"; end; StartLoopEnd: set .Faction,0; EndLoop: if((gettime(4)==$FactionEndDay[.Faction])&&(gettime(3)==$FactionEndTime[.Faction])) { goto FactionActualEnd; end; } if($FactionEndDay[.Faction]==0&&$FactionStartTime[.Faction]==0&&$FactionEndTime[.Faction]==0) { end; } set .Faction,.Faction+1; if(.Faction>7) { end; } goto EndLoop; end; FactionActualEnd: if($FactionStatus==0) { end; } set $FactionStatus,0; stopnpctimer; if(getmapusers("mocg_cas01")>0) { mapwarp "mocg_cas01","prontera",155,182,0; } if($FactionName!=0) { announce "The Faction War has ended! The Faction Castle Owner is ["+factioninfo($FactionName,0)+"] Faction.",bc_all|bc_woe; } else { announce "Faction War has ended! No faction has proven themselves in the Faction Wat!",bc_all|bc_woe; } disablenpc "FactionWarp"; killmonsterall "mocg_cas01"; donpcevent "CastleSpawn::OnCastleSpawn"; enablenpc "Kamui"; fvfoff "mocg_cas01"; end; OnFactionBreak: if( killedrid == 15000 || getcharid(5) > 0 ){ set $FactionName,getcharid(5); set $winner_faction_id,getcharid(5); mapannounce "mocg_cas01",""+strcharinfo(0)+" has broken the Faction Stone for the ["+factioninfo($FactionName,0)+"] Faction.",bc_map|bc_woe,"0x00CCFF",FW_NORMAL,12; maprespawnfactionid "mocg_cas01",$winner_faction_id,6; sleep2 10000; monster "mocg_cas01",142,291,"Faction Stone " +factioninfo(getcharid(5),0)+"",15000,1,"Faction_System::OnFactionBreak"; } else { dispbottom "Killed by a None Faction char"; mapannounce "mocg_cas01",""+strcharinfo(0)+" has broken the Faction Stone for the without a Faction. Faction Stone will Respawn",bc_map|bc_woe,"0x00CCFF",FW_NORMAL,12; monster "mocg_cas01",142,291,"Faction Stone",15000,1,"Faction_System::OnFactionBreak"; } end; OnFactionStart: if (getgroupid() < 10) {end;} if($FactionStatus==1) { dispbottom "Faction War is already running."; end; } goto FactionActualStart; end; OnFactionEnd: if (getgroupid() < 10) {end;} if($FactionStatus==0) { dispbottom "Faction War is currently not running."; end; } goto FactionActualEnd; end; OnTimer900000: announce "Faction System: [Faction War] Runs since 15 minutes",0; end; OnTimer1800000: announce "Faction System: [Faction War] Runs since 30 minutes",0; end; OnTimer2700000: announce "Faction System: [Faction War] Runs since 45 minutes",0; end; OnTimer3300000: announce "Faction System: [Faction War] Only 5 minutes till Faction War ends",0; end; } //================================================================================== //--------|Faction War Hole|---------------------------------- //================================================================================== mocg_cas01,141,183,1 script WoEHole -1,6,6,{ OnTouch: set Hp, 1; set Sp, 1; specialeffect2 668; sleep2(400); atcommand "@load"; } //================================================================================== //--------|Faction War Protection|---------------------------------- //================================================================================== - script FactionProtection -1,{ OnInit: end; OnPCLoadMapEvent: if(strcharinfo(3)=="mocg_cas01" && getcharid(5) == 0) { announce "You must be in a Faction to enter the Faction War!",bc_self; warp "SavePoint",0,0; end; } end; } //================================================================================== //--------|Faction War Castle Spawn|---------------------------------- //================================================================================== - script CastleSpawn -1,{ OnInit: monster "mocg_cas01",0,0,"Evil Druid",1117,10; monster "mocg_cas01",0,0,"Khalitzburg",1132,4; monster "mocg_cas01",0,0,"Abysmal Knight",1219,3; monster "mocg_cas01",0,0,"Executioner",1205,1; monster "mocg_cas01",0,0,"Penomena",1216,10; monster "mocg_cas01",0,0,"Alarm",1193,18; monster "mocg_cas01",0,0,"Clock",1269,9; monster "mocg_cas01",0,0,"Raydric Archer",1276,12; monster "mocg_cas01",0,0,"Wanderer",1208,3; monster "mocg_cas01",0,0,"Alice",1275,1; monster "mocg_cas01",0,0,"Bloody Knight",1268,2; monster "mocg_cas01",0,0,"Dark Lord",1272,2; monster "mocg_cas01",0,0,"Tower Keeper",1270,4; end; OnCastleSpawn: monster "mocg_cas01",0,0,"Evil Druid",1117,10; monster "mocg_cas01",0,0,"Khalitzburg",1132,4; monster "mocg_cas01",0,0,"Abysmal Knight",1219,3; monster "mocg_cas01",0,0,"Executioner",1205,1; monster "mocg_cas01",0,0,"Penomena",1216,10; monster "mocg_cas01",0,0,"Alarm",1193,18; monster "mocg_cas01",0,0,"Clock",1269,9; monster "mocg_cas01",0,0,"Raydric Archer",1276,12; monster "mocg_cas01",0,0,"Wanderer",1208,3; monster "mocg_cas01",0,0,"Alice",1275,1; monster "mocg_cas01",0,0,"Bloody Knight",1268,2; monster "mocg_cas01",0,0,"Dark Lord",1272,2; monster "mocg_cas01",0,0,"Tower Keeper",1270,4; end; OnCastleDESpawn: killmonsterall "mocg_cas01"; end; } //================================================================================== //--------|Faction War Warper|---------------------------------- //================================================================================== prontera,172,201,0 script FactionWarp 45,1,1,{ OnTouch: if ($FactionStatus == 1) { if (getcharid(5)==0) { mes "[Notice:]"; mes " "; mes "You must be in a Faction to enter the Faction War!"; close; } else { warp "moc_gld",195,200; } } else { mes "Currently No Faction War Running."; close; } end; OnInit: disablenpc "FactionWarp"; end; } //================================================================================== //--------|Faction War Info|---------------------------------- //================================================================================== prontera,169,201,0 script FactionInfo 836,{ if ($FactionStatus == 1) { // Faction War set .@name$,"[Faction War]"; mes .@name$; mes "INFO XXXXX"; close; end; } else { mes "Currently no Faction War is running."; close; } end; OnInit: disablenpc "FactionInfo"; end; } //================================================================================== //--------| Warp To Faction Dungen NPC |-------------------------------------------- //================================================================================== mocg_cas01,150,52,0 script Kamui 1_M_01,{ if ( getcharid(5) == $winner_faction_id) { mes "^3355FFThis is the Stronghold"; mes "Teleport Service. Would"; mes "you like to teleport to the"; mes "Convenience Facility for"; mes "guild members?^000000"; switch(select("Go to Convenience Facility:Cancel")) { case 1: warp "mocg_cas01",321,65; end; case 2: close; } } end; } //================================================================================== //--------|Map Flags|--------------------------------------------------------------- //================================================================================== // -- Iset Mapflags moc_gld mapflag nightenabled moc_gld mapflag nobranch mocg_cas01 mapflag nobranch mocg_cas01 mapflag noicewall mocg_cas01 mapflag nomemo mocg_cas01 mapflag nosave SavePoint mocg_cas01 mapflag noteleport mocg_cas01 mapflag nowarp mocg_cas01 mapflag nowarpto