viewing paste MVP vs MVP | Athena

Posted on the
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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
-   script  MVPBet  -1,{
    function GetReward;
    
    function GetReward {
        .id = getarg(0, 0);
        
        addrid(5, 0, "1@dth3");
        
        if (.id == mvp_bet) {
            dispbottom .npc$ + " Congratulations! You won the event, Good choice!";
            Zeny += .bet_reward * .bet_multiplier;
            specialeffect2 68;
        }
        
        mvp_bet = 0;
        setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
        
        end;
    }
    
    OnBlockPlayers:
        addrid(5, 0, "1@dth3");
        setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, true;
        end;
    
    OnMinute00:
        if ((gettime(DT_HOUR) % 2) || .start) end;
        donpcevent strnpcinfo(1) + "::OnStart";
        end;
        
    OnStart:
        mapwarp "1@dth3", "prontera", 150, 150;
        killmonster "1@dth3", "All";
        .start = 1;
        announce .npc$ + " We are going to have a MVP vs MVP Event.", 0;
        sleep 10000;
        announce .npc$ + " For those who want to join, you can participate by using @mvpjoin", 0;
        sleep 10000;
        announce .npc$ + " We will start the event after 1 minute", 0;
        sleep 10000;
        announce .npc$ + " Please note that you must remove your item before joining the event or else you will be warped back and can't participate again", 0;
        sleep 50000;
        announce .npc$ + " The entry to the event is now closed", 0;
        .start = 2;
        sleep 10000;
        if (getmapusers("1@dth3") < 1) {
            announce .npc$ + " Not enough participants to continue the event", 0;
            .start = 0;
            end;
        }
        mapannounce "1@dth3", .npc$ + " The rules for this event is simple", bc_map;
        sleep 10000;
        mapannounce "1@dth3", .npc$ + " Two MVP's will spawn at the center of the map and will attack each other", bc_map;
        sleep 10000;
        mapannounce "1@dth3", .npc$ + " Before these MVP's spawn, I will give you 1 minute to make a bet", bc_map;
        sleep 10000;
        mapannounce "1@dth3", .npc$ + " The bet cost is " + F_InsertComma(.bet_cost) + "z and if your MVP won the round you will get as much as " + F_InsertComma(.bet_reward*.bet_multiplier) + "z !!!", bc_map;
        sleep 10000;
        mapannounce "1@dth3", .npc$ + " All good?? Let's start betting !!!", bc_map;
        sleep 10000;
        mapannounce "1@dth3", .npc$ + " To make a bet please use @mvpbet command, I will give 1 minute for you guys to make a bet", bc_map;
        .start = 3;
        sleep 60000;
        .start = 4;
        sleep 5000;
        donpcevent strnpcinfo(1) + "::OnBlockPlayers";
        mapannounce "1@dth3", "Ladies and Gentlemen, Let's get ready to rumble!!!!!!!", bc_map;
        sleep 5000;
        .@mid = .MVP[rand(.size)];
        monster "1@dth3", 68, 68, "MVP A", .@mid, 1, strnpcinfo(1) + "::OnDie1", Size_Small, AI_NONE;
        monster "1@dth3", 71, 68, "MVP B", .@mid, 1, strnpcinfo(1) + "::OnDie2", Size_Small, AI_ATTACK;
        end;
        
        OnDie1:
            mapannounce "1@dth3", "[MVP B] Mwahaha! Such a weakling!~", bc_map;
            sleep 3000;
            killmonster "1@dth3", "All";
            .start = 0;
            GetReward(2);
            end;
        
        OnDie2:
            mapannounce "1@dth3", "[MVP A] Mwahaha! Such a weakling!~", bc_map;
            sleep 3000;
            killmonster "1@dth3", "All";
            .start = 0;
            GetReward(1);
            end;
            
        end;
        
    OnEventBet:
        mes .npc$;
        if (!.start) {
            mes "The event is not yet started.";
            close;
        } else if (.start != 3) {
            mes "You're not supposed to bet at the moment. Please wait for the event to start.";
            close;
        } else if (Zeny < .bet_cost) {
            mes "You need " + F_InsertComma(.bet_cost) + " in order to place a bet.";
            close;
        } else if (mvp_bet) {
            mes "You already placed your bet.";
            close;
        }
        mes "Which mvp will you bet on this match???";
        next;
        .@s = select("~ MVP A:~ MVP B");
        mes .npc$;
        mes "Are you sure you want to bet " + F_InsertComma(.bet_cost) + " on " + (.@s == 1 ? "MVP A" : "MVP B") + "?";
        next;
        if (select("~ Yes:~ No") & 2) end;
        if (.start != 3) {
            // additional check in case players try to bug the event
            mvp_bet = 0;
            Zeny -= .bet_cost; // deduct zeny as penalty
            
            setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
            
            end;
        }
        mes .npc$;
        mes "Good luck and have fun!";
        Zeny -= .bet_cost;
        mvp_bet = .@s; // 1 = MVP A | 2 = MVP B
        end;
    
    OnEventJoin:
        if (!.start) {
            dispbottom .npc$ + " The event is not yet started.";
            end;
        } else if (.start != 1) {
            dispbottom .npc$ + " The event is not yet allowing participants to enter.";
            end;
        }
        switch (rand(1,4)) {
            case 1:
                warp "1@dth3", 49, 50;
                break;
            case 2:
                warp "1@dth3", 49, 88;
                break;
            case 3:
                warp "1@dth3", 89, 88;
                break;
            case 4:
                warp "1@dth3", 89, 50;
                break;
        }
        end;
    
    OnPCLoginEvent:
        if (!.start && (getpcblock() & (PCBLOCK_ATTACK | PCBLOCK_IMMUNE)))
            setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
        end;
        
    OnInit:
        .npc$ = "[MVP vs MVP Event]";
        
        // List of MVP's
        setarray .MVP[0], 1112, 1115, 1147, 1150, 1157, 1159;
        .size = getarraysize(.MVP);
        
        // Bet cost
        .bet_cost = 5000;
        
        // Winning amount will be .bet_reward * .bet_multiplier
        .bet_reward = 5000;
        .bet_multiplier = 200;
        
        bindatcmd "mvpjoin", strnpcinfo(1) + "::OnEventJoin";
        bindatcmd "mvpbet", strnpcinfo(1) + "::OnEventBet";
        bindatcmd "mvpstart", strnpcinfo(1) + "::OnStart", 99, 99;
        
        end;
}
 
1@dth3  mapflag monster_noteleport
1@dth3  mapflag noskill
1@dth3  mapflag noloot
1@dth3  mapflag noitemconsumption
1@dth3  mapflag nomemo
1@dth3  mapflag nosave  SavePoint
1@dth3  mapflag nowarpto
1@dth3  mapflag noteleport
Viewed 617 times, submitted by Guest.