viewing paste Unknown #14646 | 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 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337
//===== 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,147,190,4  script  Map Of The Week 914,{
function MO_NoContractk;
function MO_ContractEnd;
function MO_NoContract;
function MO_Nothing;
function MO_NoZeny;
function MOTW_Name;
 
 
    set @motwcost, 1000000;  //The cost for the contract per @motwkill kills.
    set @motwkill, 350;  //Kills available while the contract is purchased for @motwcost Zeny.
    
    mes "[Map Of The Week]";
    mes "Map Of The Week or simply ^FF0000MOTW^000000 lets you enjoy your time on tbRO more excitingly as it would let you ^FF0000win prizes for every monster you kill on the assigned map^000000! Sounds cool right?";
    mes " ";
    mes " Now, what do you want to do?";
    switch(select("- Main Information / Mechanics","- Check Rewards","- Contract Status","- Sign a Contract","- Commands","- Cancel"))
    {
    case 1:
        next;
        if($MOTW$ == ""){
        mes "The Map Of The Week has not been assigned.";
        mes "--------------------------";
        mes " Mechanics:";
        mes " 1. Once Map Of The Week (MOTW) is set, you could win prizes depending on chance for every monster you kill on that map.";
        mes " 2. To be eligible for receiving prizes, you have to buy a contract that's good for 400 kills in one whole week.";
        mes " 3. The contract costs ^FF0000300x Poring Coins^000000 and would mean you can receive prizes for 400 kills you make on the MOTW.";
        mes " 4. Prizes you can get from 1 kill could be anything from the ff: ^FF00005x SPECs, 15x SPECs, 30x SPECs.^000000";
        mes " 5. For available commands, you can do the following: ^FF0000whisper npc:Map Of The Week (case-sensitive) and enter keywords 'kills' [or] 'map' [or] 'contract'.^000000 ";
        mes " ";
        close;
        }
        mes "[Map Of The Week]";
        mes "The Map Of The Week Is ^FF0000"+$MOTW$+"^000000.";
        mes "--------------------------";
        mes " Mechanics:";
        mes " 1. Once Map Of The Week (MOTW) is set, you could win prizes depending on chance for every monster you kill on that map.";
        mes " 2. To be eligible for receiving prizes, you have to buy a contract that's good for 400 kills in one whole week.";
        mes " 3. The contract costs ^FF0000300x Poring Coins^000000 and would mean you can receive prizes for 400 kills you make on the MOTW.";
        mes " 4. Prizes you can get from 1 kill could be anything from the ff: ^FF00005x SPECs, 15x SPECs, 30x SPECs.^000000";
        mes " 5. For available commands, you can do the following: ^FF0000whisper npc:Map Of The Week (case-sensitive) and enter keywords 'kills' [or] 'map' [or] 'contract'.^000000 ";
        mes " ";
        close;
    case 2:
        next;
        mes "[Map Of The Week]";
        mes "Prizes you can get from 1 kill could be anything from the ff: ^FF00005x SPECs, 15x SPECs, 30x SPECs^000000.";
        close;
    case 3:
        next;
        mes "[Map Of The Week]";
        mes "Please wait while we check your deeds if any.";
        progressbar "green",3;
        if(!#MOTWC) {
        next;
        mes "[Map Of The Week]";
        mes "You currently don't have a contract.";
        close;
        }
        mes "Your contract will expire after ^FF0000"+(@motwkill-#MOTWKI)+"^000000 kills.";
        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 "Come back again!";
            close;
        }else{
            mes "[Map Of The Week]";
            mes "It would cost ^FF0000300x Poring Coins^000000 for ^FF0000"+@motwkill+" kills^000000.";
            if(select("We have a deal!:Nevermind")-1) {
                mes "[Map Of The Week]";
                mes "Come back again!";
                close;
                }else{
                if (countitem(7539) < 300) MO_NoZeny;
                delitem 7539,300;
                set #MOTWC, 1;
                set #MOTWKI, 0;
                next;
                mes "[Map Of The Week]";
                mes "^008800Congratulations! Your contract has been signed.^000000";
                mes " ";
                mes "You can renew your contract anywhere by calling the NPC.";
                mes "Whisper ^FF0000npc:Map Of The Week^000000 (case-sensitive) and enter keywords such as kills, map or contract.";
                close;
                }
            }
    case 5:
        next;
        mes "[Map Of The Week]";
        mes "Whisper ^FF0000NPC:Map Of The Week^000000 (case-sensitive)";
        mes "Available Keywords :";
        mes "- ^FF0000kills^000000: the no. of kills left.";
        mes "- ^FF0000contract^000000: to renew or buy contract.";
        mes "- ^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(@whispervar0$ == "kills") {
            if(#MOTWC != 1) {
                mes "[Map Of The Week]";
                mes "You are not under a contract.";
                close;
                end;
            }
            mes "[Map Of The Week]";
            mes "You can still kill "+(@motwkill- #MOTWKI)+" monsters!";
            next;
            mes "Good Luck";
            close;
            end;
        }
        
        if(compare(@whispervar0$,"contract")) {
            if(#MOTWC != 1) {
                mes "[Map Of The Week]";
                mes "You currently don't have a contract. Do you want to buy one?";
                if(select("Yes:NO")-1) {
                    mes "[Map Of The Week]";
                    mes "Come back again!";
                    close;
                    end;
                }else{
                    mes "[Map Of The Week]";
                    mes "It would cost ^FF0000500x Poring Coins^000000 for ^FF0000"+@motwkill+" kills.^000000";
                    if(select("Sure I Will Pay:No")-1) {
                        mes "[Map Of The Week]";
                        mes "Come back again!";
                        close;
                        end;
                    }else{
                        if (countitem(7539) < 300) MO_NoZeny;
                        delitem 7539,300;
                            set #MOTWC, 1;
                            set #MOTWKI, 0;
                            mes "[Map Of The Week]";
                            mes "^008800Congratulations! Your contract has been signed.^000000";
                            close;
                            end;
                    }
                }
            }else{
                mes "You are already under contract!";
                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 "[Map Of The Week] The MOTW is "+$MOTW$+"! Kill any mobs in this map with active contract and you could get anywhere within 1,500 up to 5,000 SPECs for the whole week!";
                next;
                mes "[Map Of The Week]";
                mes "The Map Of The Week is ^FF0000"+$MOTW$+"^000000!!!!";
                close;
            case 2:
                MOTW_Name;
            case 3:
                next;
                mes "[Map Of The Week]";
                mes "Destroyed All Contracts";
                query_sql ("DELETE FROM `trincli0232`.`global_reg_value` WHERE `global_reg_value`.`str` = '#MOTWC' ");
                query_sql ("DELETE FROM `trincli0232`.`global_reg_value` WHERE `global_reg_value`.`str` = '#MOTWKI' ");
                close;
            case 4:
                next;
                mes "[Map Of The Week]";
                mes "Come back when you are free again.";
                close;
            }
        }
        close;
        end;
        
    MO_Nothing:
        mes "[Map Of The Week]";
        mes "Available Keywords:";
        mes "- ^FF0000kills^000000: the no. of kills left";
        mes "- ^FF0000contract^000000: to renew or buy contract";
        mes "- ^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 enough Poring Coins.";
        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 has 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) {
            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) MO_NoContractk;
        if (#MOTWKI >= @motwkill) MO_ContractEnd;
        set #MOTWKI, #MOTWKI+1;
        switch(rand(10)){
        case 0:
            getitem 6153,5;
            break;
        case 1:
            getitem 6153,15;
            break;
        case 2:
            getitem 6153,30;
            break;
 
        }
}
Viewed 567 times, submitted by Guest.