viewing paste topic/11156- poring_summoner_fix | Athena

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
//===== Hercules Script =======================================
//= Poring Summoner
//===== Created By: ===========================================
//= Mysterious
//===== Current Version: ======================================
//= 1.2
//===== Link: =================================================
//= Old - http://www.eathena.ws/board/index.php?showtopic=236779
//===== Description: ==========================================
//= Basically what this event does is summon a set of Normal
//= and Special Porings. Normal Porings don't drop anything,
//= Special Porings do.
//=============================================================
prontera,158,185,5      script  Poring Summoner 1_F_MARIA,{
        mes "[Poring Summoner]";
        if ( getgmlevel() < 10 ) {
                if ( .Event )
                        mes "There is no Poring Summon Event on now.";
                else {
                        mes "There is a Poring Summon Event on now!";
                        mes "Location: " + .Map$;
                        mes "Special Porings: " + .SpecialPorings;
                        mes "Normal Porings: " + .NormalPorings;
                }
                close;
        }
        mes "Please customize the Poring Summon Event:";
        next;
Main:
        mes "[Poring Summoner]";
        switch ( select (
                "Item [" + getitemname($poring_summon_ItemID) + "]",
                "Special Porings [" + $poring_summon_Special + "]",
                "Normal Porings [" + $poring_summon_Normal + "]:Start Event:End Event" ) ) {
        case 1:
                mes "Which item would you like Special Porings to drop?";
                mes "Please input the item ID:";
                input .@itemid;
                if ( getitemname( .@itemid ) == "null" ) {
                        mes "invalid item ID";
                        next;
                        goto Main;
                }
                $poring_summon_ItemID = .@itemid;
                next;
                goto Main;
        case 2:
                mes "How many Special Porings would you like me to summon?";
                input $poring_summon_Special, 1, 1000;
                next;
                goto Main;
        case 3:
                mes "How many Normal Porings would you like me to summon?";
                input $poring_summon_Normal, 1, 1000;
                next;
                goto Main;
        case 4:
                mes "Starting the event now...";
                donpcevent strnpcinfo(0) +"::OnStartEvent";
                close;
        case 5:
                mes "Ending the event now...";
                donpcevent strnpcinfo(0) +"::OnEndEvent";
                close;
        }
        close;
OnStartEvent:
OnHour02: //CHANGE THIS TO THE HOUR YOU WOULD LIKE THIS EVENT TO LOAD!
OnHour05:
OnHour09:
OnHour14:
OnHour17:
OnHour20:
OnHour23:
        .Map$ = callfunc( "F_Rand",
                "dic_fild01",
                "dic_fild02",
                "izlude",
                "payon",
                "geffen",
                "morocc",
                "prontera" );
//      "guild_vs5" );
        .Event = true;
        .SpecialPorings = $poring_summon_Special;
        .NormalPorings = $poring_summon_Normal;
        monster .Map$, 0,0, "Poring", 1002, .SpecialPorings, "Poring Summoner::OnSpecialKill";
        monster .Map$, 0,0, "Poring", 1002, .NormalPorings, "Poring Summoner::OnNormalKill";
        announce "The Poring Event has begun!",bc_all;
        announce "Location: " + .Map$,bc_all;
        announce "Special Porings: " + .SpecialPorings, bc_all;
        announce "Normal Porings: " + .NormalPorings, bc_all;
        initnpctimer;
        end;
OnEndEvent:
        if ( .Event )
                announce "The Poring Summon Event is now over!", bc_all;
        killmonster .Map$, "All";
        .Event = false;
        end;
//OnTimer216000000: .. LOL 6 hours
OnTimer1800000:
        announce "Poring Summoner has ended. No one killed the Porings.", bc_all;
        killmonster .Map$, "All";
        .Event = false;
        stopnpctimer;
        end;
 
OnNormalKill:
        .NormalPorings--;
        goto PoringCount;
OnSpecialKill:
        .SpecialPorings--;
        announce strcharinfo(0) + " got a " + getitemname($poring_summon_ItemID) + "!", bc_map;
        getitem $poring_summon_ItemID, 1;
        goto PoringCount;
PoringCount:
        announce "Special Porings: " + .SpecialPorings + " || Normal Porings: " + .NormalPorings, bc_map;
        if ( !.SpecialPorings )
                goto OnEndEvent;
        end;
OnInit:
        if ( !$poring_summon_ItemID && !$poring_summon_Special && !$poring_summon_Normal ) { // initialize the value
                $poring_summon_ItemID = Poring_Coin;
                $poring_summon_Special = 20;
                $poring_summon_Normal = 40;
        }
        end;
}
Viewed 934 times, submitted by AnnieRuru.