viewing paste Unknown #14411 | 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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
//===== rAthena Script ======================================================================
//= Map Of The Week v4.4
//===== Original By =========================================================================
//= Kaushik
//===== Current Version: ====================================================================
//= 1.0 - Script Release.
//= 1.1 - Added GM selection of Map Of The Week.
//= 1.2 - Fixed Timer Selection of the Map is on Sunday @ 24:00 server time.
//= 2.0 - Added Contract System.
//= 2.1 - Fixed Contract Expiry (Set #MOTWC to 0 once contract is expired).
//= 2.2 - Cleaned Script to remove some unneeded repertition and script. [ToastOfDoom]
//= 2.3 - Added Bottle Grenade ingredients to the script as it was missed.
//= 2.4 - Decreased the drop rate.
//= 2.5 - Changed announce and dispbottom.
//= 3.0 - Added Whisper Functions. (map, kills, contract, gm).
//= 3.1 - Changed to dynamic Cost and Kills - @motwcost & @motwkill to your desired numbers.
//= 3.2 - Added Menu To The NPC.
//= 4.0 - Added GM commands to change random map, selected map & to Destroy all contracts.
//= 4.1 - Removed SQL unwanted variable.
//= 4.2 - Fixed script contract count variable.
//= 4.3 - Fixed tweet to not give out contract if no map of the week is assigned.
//= 4.4 - Fixed NPC Whisper
//= 5.0 - Changed rewards to dynamic rewards [WIP].
//===== Compatible With: ====================================================================
//= Tested in SQL Revision 14435
//===== Description: ========================================================================
//= A Random Map Will be selected and edp, acid demo bottle ingredients are rewarded.
//===========================================================================================
prontera,150,150,1  script  MOTW    411,{
    set @motwcost, 200000;  //The cost for the contract per @motwkill kills.
    set @motwkill, 10000;  //Kills available while the contract is purchased for @motwcost Zeny.
    
    mes "[Map Of The Week]";
    mes "What do you want to do";
    switch(select("^00FF00-^000000Check Map Of The Week","^00FF00-^000000Check Rewards","^00FF00-^000000Contract Status","^00FF00-^000000Sign a Contract","^00FF00-^000000Commands","^FF0000-^000000Nothing"))
    {
    case 1:
        next;
        if($MOTW$ == ""){
        mes "The Map Of The Week has not been assigned.";
        close;
        }
        mes "[Map Of The Week]";
        mes "The Map Of The Week Is ^FF0000"+$MOTW$+"^000000.";
        close;
    case 2:
        next;
        mes "[Map Of The Week]";
        mes "The rewards are ^FF0000Poison Bottles, Acid Bottles, Grenade Bottles^000000 Ingredients.";
        close;
    case 3:
        next;
        mes "[Map Of The Week]";
        mes "Please wait while we check your deeds if any.";
        progressbar "green",5;
        if(!#MOTWC) {
        next;
        mes "[Map Of The Week]";
        mes "You dont have a contract";
        close;
        }
        mes "Your Contract Expires on ^FF0000"+(@motwkill-#MOTWKI)+"^000000";
        close;
    case 4:
        next;
        mes "[Map Of The Week]";
        if($MOTW$ == ""){
        mes "The Map Of The Week has not been assigned. You cannot purchase a contract at this time.";
        close;
        }
        mes "Do you want to buy a contract?";
        if(select("Yes:NO")-1) {
            mes "[Map Of The Week]";
            mes "So Long Looser";
            atcommand "@die";
            close;
            } 
        else {
            mes "[Map Of The Week]";
            mes "It Would Cost ^FF0000"+@motwcost+" Zeny^000000 for ^FF0000"+@motwkill+" kills^000000";
            if(select("Sure I Will Pay:No")-1) {
                mes "[Map Of The Week]";
                mes "So Long Looser";
                atcommand "@die";
                close;
                }
            else {
                if (Zeny < @motwcost) goto MO_NoZeny;
                set Zeny,Zeny-@motwcost;
                set #MOTWC, 1;
                set #MOTWKI, 0;
                next;
                mes "[Map Of The Week]";
                mes "Your contract has been signed";
                mes "You can renew your contract anywhere by calling the npc";
                mes "whisper ^FF0000NPC:MOTW^000000";
                close;
                }
            }
    case 5:
        next;
        mes "[Map Of The Week]";
        mes "Wisper ^FF0000NPC:MOTW^000000";
        mes "Available Keywords :";
        mes "^00FF00-^000000^FF0000kills^000000 : the no. of kills left";
        mes "^00FF00-^000000^FF0000contract^000000 : to renew or buy contract";
        mes "^00FF00-^000000^FF0000map^000000 : to know the Map Of The Week";
        close;
    case 6:
        next;
        mes "[Map Of The Week]";
        mes "Come Back When You are free again";
        close;
    }
 
    OnWhisperGlobal:    
        if(compare(@whispervar0$,"map")) {
            dispbottom "MOTW : The Map Of The Week is "+$MOTW$;
            end;
        }
        
        if(compare(@whispervar0$,"kills")) {
            if(#MOTWC != 1) goto MO_NoContract;
            mes "[Map Of The Week]";
            mes "You can still kill ^FF0000"+(@motwkill-#MOTWKI)+"^000000 monsters.!!";
            close;
            end;
        }
        
        if(compare(@whispervar0$,"contract")) {
            mes "[Map Of The Week]";
            mes "Do you want to buy a contract?";
            if(select("Yes:NO")-1) {
                mes "[Map Of The Week]";
                mes "So Long Looser";
                atcommand "@die";
                close;
                end;
                } 
            else {
                mes "[Map Of The Week]";
                mes "It Would Cost ^FF0000"+@motwcost+" Zeny^000000 for ^FF0000"+@motwkill+" Kills^000000";
                if(select("Sure I Will Pay:No")-1) {
                    mes "[Map Of The Week]";
                    mes "So Long Looser";
                    atcommand "@die";
                    close;
                    end;
                    }
                else {
                    if (Zeny < @motwcost) goto MO_NoZeny;
                    set Zeny,Zeny-@motwcost;
                    set #MOTWC, 1;
                    set #MOTWKI, 0;
                    mes "[Map Of The Week]";
                    mes "Your contract has been signed";
                    close;
                    end;
                    }
                }
        }
        
        if(compare(@whispervar0$,"gm")) {
            if(getgmlevel() < 90) end;
            mes "[Map Of The Week]";
            mes "What do you want to do "+strcharinfo(0)+"?";
            switch(select("^00FF00-^000000Random MOTW","^00FF00-^000000Enter MOTW","^FF0000-^000000Destroy All Contracts","^FF0000-^000000Nothing"))
            {
            case 1:
                switch(rand(3)){
                    case 0:
                        set $@MOTWS, rand(1,11);
                        set $mapotw$, "pay_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
                        set $MOTW$, "Payon Forest "+$@MOTWS;
                        break;
                
                    case 1:
                        set $@MOTWS, rand(0,11);
                        set $mapotw$, "prt_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
                        set $MOTW$, "Prontera Field "+$@MOTWS;
                        break;
                
                    case 2:
                        set $@MOTWS, rand(1,22);
                        set $mapotw$, "moc_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
                        set $MOTW$, "Sograt Desert "+$@MOTWS;
                        break;
                    }
                announce "MOTW : The Map Of The Week is "+$MOTW$+"!!!!",0;
                next;
                mes "[Map Of The Week]";
                mes "The Map Of The Week is ^FF0000"+$MOTW$+"^000000!!!!";
                close;
            case 2:
                goto MOTW_Name;
            case 3:
                next;
                mes "[Map Of The Week]";
                mes "Destroyed All Contracts";
                query_sql "DELETE FROM global_reg_value where str = '#MOTWC'";
                query_sql "DELETE FROM global_reg_value where str = '#MOTWKI'";
                close;
            case 4:
                next;
                mes "[Map Of The Week]";
                mes "Come Back When You are free again";
                close;
            }
        }
        
    MO_Nothing:
        mes "[Map Of The Week]";
        mes "Available Keywords :";
        mes "^0000FF-^000000^FF0000kills^000000 : the no. of kills left";
        mes "^0000FF-^000000^FF0000contract^000000 : to renew or buy contract";
        mes "^0000FF-^000000^FF0000map^000000 : to know the Map Of The Week";
        close;
        end;
        
    MO_NoZeny:
        next;
        mes "[Map Of The Week]";
        mes "Come back when you have zeny";
        close;
        end;
        
    MO_NoContract:
        next;
        mes "[Map Of The Week]";
        mes "You are not under a contract";
        close;
        end;
        
    MO_ContractEnd:
        dispbottom "MOTW : Your contract is expired";
        set #MOTWC,0;
        end;
        
    MO_NoContractk:
        dispbottom "MOTW : You are not under a contract";
        end;
        
    MOTW_Name:
        mes "[Map Of The Week]";
        mes "Enter the map name";
        input $MOTWGM$;
        mes "The map you entered is ^FF0000"+$MOTWGM$+"^000000";
        mes "Is this the correct map";
        if(select("Yes:No")-1) {
            goto MOTW_Name;
            }
        else {
            set $mapotw$, $MOTWGM$;
            set $MOTW$, $MOTWGM$;
            announce "MOTW : The Map Of The Week is "+$MOTW$+"!!!!",0;
            close;
            end;
            }
            
            
    OnClock2400:
        if(gettime(4)!=0) end;
        switch(rand(3)){
            case 0:
                set $@MOTWS, rand(1,11);
                set $mapotw$, "pay_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
                set $MOTW$, "Payon Forest "+$@MOTWS;
                break;
                
            case 1:
                set $@MOTWS, rand(0,11);
                set $mapotw$, "prt_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
                set $MOTW$, "Prontera Field "+$@MOTWS;
                break;
                
            case 2:
                set $@MOTWS, rand(1,22);
                set $mapotw$, "moc_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
                set $MOTW$, "Sograt Desert "+$@MOTWS;
                break;
        }
        announce "MOTW : The Map Of The Week is "+$MOTW$+"!!!!",0;
        end;
        
    OnNPCKillEvent:
        getmapxy(.@map$,.@x,.@y,0);
        if (.@map$ != $mapotw$) end;
        if (!#MOTWC) goto MO_NoContractk;
        if (#MOTWKI >= @motwkill) goto MO_ContractEnd;
        set #MOTWKI, #MOTWKI+1;
        switch(rand(10)){
        case 0:
            getitem 937,1;
            getitem 939,1;
            getitem 952,1;
            getitem 972,1;
            getitem 7033,1;
            break;
        case 1:
            getitem 929,1;
            break;
        case 2:
            getitem 970,1;
            getitem 1059,1;
            break;
        default:
            announce "MOTW : You Got Nothing HAHAH!!!",bc_yellow|bc_self;
            break;
        }
}
Viewed 744 times, submitted by Guest.