summaryrefslogblamecommitdiff
path: root/npc/016-7/main.txt
blob: aa09f690e546ea5f39d1509b985c6913b30a3f1a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                                    
                                                





                                                                           

                                                                                                                        


            
                                               
                                                               
                                                    
                                                                                      
                                                                                                  



          
                                                                          




                                                                  
                                               



                                                 
                                                                      

                                      
                                                            



                             



                             
// TMW2 script
// Author:
//   Saulc
//   Jesusalva
// Description:
//    Handles pirate attacks

016-7,0,0,0	script	#MarineShipAttack	NPC_HIDDEN,117,29,{
    end;

OnEvent:
    warp "016-7", 31, 33;
    dispbottom l("##1The ship is under a pirate's attack! ##BKill all or survive!");
    addtimercount "#MarineShip::OnEvent", 10000;
    addtimer 2000, "#MarineShipAttack::OnStart";
    end;

OnStart:
    // Define number of pirates based on player level.
    // Player count is not important here, as this is run for every player.
    .@c=(BaseLevel/15);
    areamonster "016-7", 23, 25, 51, 30, strmobinfo(1, OceanPirate), OceanPirate, .@c, "#MarineShipAttack::OnPirateDie";
    end;

OnPirateDie:
    addtimercount "#MarineShip::OnEvent", 5000;
    if (!mobcount("016-7", "#MarineShipAttack::OnPirateDie")) {
        addtimercount "#MarineShip::OnEvent", 15000;
        mapannounce "016-7", l("The pirate ship captain appear! TAKE CARE!!"), bc_map;
        monster "016-7", 38, 27, "Pirate Captain", OceanPirate, 1, "#MarineShipAttack::OnVictory";
    }
    end;

OnVictory:
    areatimer("016-7", 23, 25, 52, 35, 10, "#MarineShipAttack::OnReward");
    end;

OnReward:
    // That would give 10% from missing exp, but I didn't like it.
    //getexp ((NextBaseExp-BaseExp)/10), 0;
    addtimercount "#MarineShip::OnEvent", 2500;

    // Lv 40 rewards: 400 exp, 40 jxp, 200~600 GP
    getexp BaseLevel*10, BaseLevel;
    Zeny=Zeny+BaseLevel*rand(5,15);
    //getitem SailorShirt, 1; // I already tried to do this before...?
    dispbottom l("Congratulations!");
    if (isin("016-7", 23, 25, 52, 35))
        addtimer(2000, "#MarineShipAttack::OnResumeTravel");
    end;

OnResumeTravel:
    if (@timer_navio_running)
        warp "016-6", 31, 33;
    end;
}