summaryrefslogblamecommitdiff
path: root/npc/004-1/bgmaster.txt
blob: ce25295f0a5abfbd775550d925021e299daf622a (plain) (tree)
1
2
3
4
5
6
7
8
9



                

                
                                            
         
      
                                  








                                                                                                                       

           
                                             

                                
      
                                 
                                                                                                           







                                                                                                                                          
          
















                                 

                        


          






                                                                             
                 





                                           

                                           
         






                                                              

                                                                                                        








                       




                                                                                                               











                       


                                                              
                                                               

                                                                                                      
            



                       




                                            

        


        







                       










                                                              
          
                                  
                       
                                                                                                                                


                                      

                           
                  


          
                                  
                       



                                                                          

                           
                  











                                                             
                    
                  
      


                            
       
        
 
          
           
                                                              

                                                                                                        


                       



























                                                                                        


                  


























                                                                                         




















































 
                                                 


















                                                                                        
                                                 

































                                                                                    
                         
                    

                                                         





                                                    


                                          






                                          
// TMW2 Scripts.
// Author:
//  Jesusalva

// Original File

004-1,119,96,0	script	Cassia	NPC_FEMALE,{
    mesn;
    /*
    //if ($@BattleOn) goto L_Busy;
    mesq l("Hello! I am @@, currently in charge of the Desert Pass.", .name$);
    next;
    atcommand("@time");
    mesq l("The Fallen Kings challenge ownership of this pass at ##B08:00##b, ##B16:00##b and ##B00:00##b.");
    next;
    mesq l("Right click on one of their representatives, and choose to join a \'Chat\' when it is close of the time!");
    next;
    mesq l("Just as a warning, main chat will change. Use it to discuss the strategy!");
    if (!getgmlevel()) goto L_Close;
    mes "";
    menu
        rif(!$@BattleOn, l("Init!")), L_Init,
        l("Join team 1."), L_T1,
        l("Join team 2."), L_T2;
    */
    if ($@BGMaster1) goto L_Busy;
    mesq l("Hello! I am Cassia, Ambassator. During the Monster War outbreak, Frostia and Halinarzo felt.");
    next;
    mesq l("To train their soldiers, they frequently face one against other in duels. Adventurers are welcome to join their drills.");
    next;
    mesq l("To join a drill, right click on one of the lieutenants and join their Battle Stations. The drill can last up to 10 minutes.");
    next;
    mesq l("The sides accept only one adventurer. You'll also lose access to General Chat upon joining, and will have to use #world.");
    next;
    mesq l("Be sure to have a friend before joining, or you may have to logout in order to be able to move again!");
    close;

L_T1:
    mesn;
    if (bg_join_team($@FK_Team1))
        goto L_SuccessJoin;
    mes "An error happened.";
    goto L_Close;

L_T2:
    mesn;
    if (bg_join_team($@FK_Team1))
        goto L_SuccessJoin;
    mes "An error happened.";
    goto L_Close;

L_SuccessJoin:
    mesq l("Done!");
    next;
    warp "testbg", 0, 0;
    close;

L_Init:
	.@Froz = getwaitingroomstate(0,"Emissary#1");
	.@Hali = getwaitingroomstate(0,"Emissary#2");
    if (!.@Froz || !.@Hali) {
    	mapannounce("004-1", "The Fallen King Event was cancelled.", bc_map);
    }
    mesn;
    next;
    $@BattleOn=1;
    donpcevent("Emissary#1::SendToBattle");
    donpcevent("Emissary#2::SendToBattle");
    //bg_warp $@FK_Team1, "testbg", 13, 4;
    //bg_warp $@FK_Team2, "testbg", 13, 26;
    mesn;
    next;
    mesq str( bg_get_data($@FK_Team1, 0) );
    mesq str( bg_get_data($@FK_Team2, 0) );
    next;
    //setbgteam $@FK_Team1, 1;
    //setbgteam $@FK_Team2, 2;
    //mesn;
    //next;
	mapannounce("testbg", "May the fight begin!", bc_map);
    mesn;
    next;
	$@FKing_T1 = bg_monster($@FK_Team1, "testbg", 1, 1, "FallenKing1", 1079, "Cassia::OnVictor2");
	$@FKing_T2 = bg_monster($@FK_Team2, "testbg", 13, 28, "FallenKing2", 1080, "Cassia::OnVictor1");
    mesn;
    next;
	initnpctimer();
    close;

L_Close:
    close;

L_Busy:
    if ($@BGMaster1 == 2) {
        mesq l("The soldiers are resting. You can join them starting at ##B07:00, 15:00 and 23:00##b in UTC.");
    } else {
        mesq l("People are challenging now.");
    }
    close;

OnPcQuit:
    warp "002-4", 0, 0;
    bg_leave();
    end;

OnPcDeath:
    warp "002-4", 0, 0;
    bg_leave();
    end;

OnTimer60000:
    if (getmapusers("testbg") < 2 || .BGC > 10) goto L_Cancel;

	mapannounce("testbg", "Reinforcements raise!", bc_map);
	$@FKing_T1 = bg_monster($@FK_Team1, "testbg", 1, 1, "FallenGuard1", 1081, "Cassia::OnSkip");
	$@FKing_T2 = bg_monster($@FK_Team2, "testbg", 13, 28, "FallenGuard2", 1082, "Cassia::OnSkip");
    .BGC+=1;
	stopnpctimer();
	initnpctimer();
    end;

// Arena Cooldown (every 8 hours) (CET time)
OnClock0000:
OnClock0800:
OnClock1600:
    if ($@BGMaster1 == 2) $@BGMaster1=0;
    end;

OnSkip:
    end;

L_Skip:
    end;

L_RestartTimer:
	stopnpctimer();
	initnpctimer();
    end;

L_Cancel:
	stopnpctimer();
    announce "The Fallen Kings Duel ended in a draw!", bc_all;
    killmonsterall "testbg";

    mapwarp "testbg", "004-2", 29, 23;
    bg_destroy($@FK_Team1);
    bg_destroy($@FK_Team2);
    $@BGMaster1=2;
    end;

OnVictor1:
    if (!$@BGMaster1) goto L_Skip;
	stopnpctimer();
    announce "Team 1 raises victorious at the Fallen Kings Duel!", bc_all; // TODO: Give players Bronze, Silver and Gold Medals.
    killmonsterall "testbg";

    mapwarp "testbg", "004-2", 29, 23;
    bg_destroy($@FK_Team1);
    bg_destroy($@FK_Team2);
    $@BGMaster1=2;
    end;

OnVictor2:
    if (!$@BGMaster1) goto L_Skip;
	stopnpctimer();
    announce "Team 2 raises victorious at the Fallen Kings Duel!", bc_all;
    killmonsterall "testbg";

    mapwarp "testbg", "004-2", 29, 23;
    bg_destroy($@FK_Team1);
    bg_destroy($@FK_Team2);
    $@BGMaster1=2;
    end;

OnInit:
    .@npcId = getnpcid(0, .name$);
    setunitdata(.@npcId, UDT_HEADTOP, 1322); // Dress
    setunitdata(.@npcId, UDT_HEADMIDDLE, 2204); // Not needed
    setunitdata(.@npcId, UDT_HEADBOTTOM, 1800); // Shoes
    setunitdata(.@npcId, UDT_WEAPON, 3501);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 12);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 5);
    npcsit;

    .sex = G_FEMALE;
    .distance = 7;
    /*
    // This script is TODO
    if (!debug) {
        disablenpc "Cassia";
    }*/
    end;

OnDoEvent:
    .BGC=0;
	mapannounce("testbg", "May the fight begin!", bc_map);
	$@FKing_T1 = bg_monster($@FK_Team1, "testbg", 1, 1, "FallenKing1", 1079, "Cassia::OnVictor2");
	$@FKing_T2 = bg_monster($@FK_Team2, "testbg", 13, 28, "FallenKing2", 1080, "Cassia::OnVictor1");
	initnpctimer();
    end;
}






// This script is TODO WIP
/*
004-1,115,93,0	script	Emissary#1	NPC_ELF,{
    hello;

OnSendToBattle:
    $@FK_Team1=waitingroom2bg("testbg", 13, 4, "Cassia::OnPcQuit", "Cassia::OnPcDeath");
    setbgteam $@FK_Team1, 1;
    bg_warp $@FK_Team1, "testbg", 13, 4;
    end;

OnInit:
    .@npcId = getnpcid(0, .name$);
    setunitdata(.@npcId, UDT_HEADTOP, 1312); // Light armor
    setunitdata(.@npcId, UDT_HEADMIDDLE, 2212); // Pants
    setunitdata(.@npcId, UDT_HEADBOTTOM, 1800); // Shoes
    setunitdata(.@npcId, UDT_WEAPON, 3501);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 13);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 7);

	waitingroom("Winterfall", 30, "Cassia::OnSkip", 1);
    .sex = G_OTHER;
    .distance = 5;
    end;
}


004-1,117,93,0	script	Emissary#2	NPC_ELF,{
    hello;

OnSendToBattle:
    $@FK_Team2=waitingroom2bg("testbg", 13, 26, "Cassia::OnPcQuit", "Cassia::OnPcDeath");
    setbgteam $@FK_Team2, 2;
    bg_warp $@FK_Team2, "testbg", 13, 26;
    end;

OnInit:
    .@npcId = getnpcid(0, .name$);
    setunitdata(.@npcId, UDT_HEADTOP, 1311); // Terran armor
    setunitdata(.@npcId, UDT_HEADMIDDLE, 2212); // Pants
    setunitdata(.@npcId, UDT_HEADBOTTOM, 1800); // Shoes
    setunitdata(.@npcId, UDT_WEAPON, 3501);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 13);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 7);

	waitingroom("Summerfall", 30, "Cassia::OnSkip", 1);
    .sex = G_OTHER;
    .distance = 5;
    end;

}
*/





















































004-1,115,93,0	script	Lt. Randy	NPC_ELF,{
    hello;

OnInit:
    .@npcId = getnpcid(0, .name$);
    setunitdata(.@npcId, UDT_HEADTOP, 1312); // Light armor
    setunitdata(.@npcId, UDT_HEADMIDDLE, 2212); // Pants
    setunitdata(.@npcId, UDT_HEADBOTTOM, 1800); // Shoes
    setunitdata(.@npcId, UDT_WEAPON, 3501);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 13);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 7);

	waitingroom("Battle Station", 2, "start#bat_a02::OnReadyCheck", 1);
	end;

OnEnterBG:
	$@FK_Team1 = waitingroom2bg("testbg",13, 4,"start#bat_a02::OnGuillaumeQuit","");
	end;
}

004-1,117,93,0	script	Lt. Gerry	NPC_ELF,{
    hello;

OnInit:
    .@npcId = getnpcid(0, .name$);
    setunitdata(.@npcId, UDT_HEADTOP, 1311); // Terranite armor
    setunitdata(.@npcId, UDT_HEADMIDDLE, 2212); // Pants
    setunitdata(.@npcId, UDT_HEADBOTTOM, 1800); // Shoes
    setunitdata(.@npcId, UDT_WEAPON, 3501);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 13);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 7);

	waitingroom("Battle Station", 2, "start#bat_a02::OnReadyCheck", 1);
	end;

OnEnterBG:
	$@FK_Team2 = waitingroom2bg("testbg",13,28,"start#bat_a02::OnCroixQuit","");
	end;
}

//== Tierra Gorge Battleground Engine ======================
testbg,15,15,3	script	start#bat_a02	NPC_HIDDEN,{
OnInit:
	//mapwarp "bat_a02","bat_room",154,150;
	end;

OnEnable:
	end;

OnGuillaumeQuit:
OnCroixQuit:
	bg_leave;
	end;

OnReadyCheck:
	if( $@BGMaster1 )
		end;
	.@Guillaume = getwaitingroomstate(0,"Lt. Randy");
	.@Croix = getwaitingroomstate(0,"Lt. Gerry");
	if( !.@Guillaume && !.@Croix ) {
		donpcevent "#bat_a02_timer::OnStop";
		end;
	}
	else if( .@Guillaume < 1 || .@Croix < 1 )
		end;
	$@BGMaster1 = 1;
	donpcevent "Lt. Randy::OnEnterBG";
	donpcevent "Lt. Gerry::OnEnterBG";
	donpcevent "Cassia::OnDoEvent";
	bg_warp $@FK_Team1,"testbg",13,4;
	bg_warp $@FK_Team2,"testbg",13,28;
	//initnpctimer;
	end;
}