Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===== eAthena Script =======================================
- //= Lottery Script
- //===== By: ==================================================
- //= Masao
- //===== Current Version: =====================================
- //= 1.0
- //===== Compatible With: =====================================
- //= Any eAthena Version
- //===== Description: =========================================
- //= An Slot Machine like Lottery.
- //===== Additional Comments: =================================
- //= Version 1.0 if there are any Bugs please let me know.
- //============================================================
- maintown,194,232,4 script Mr.Krabs 807,{
- set .@n$,"[Mr.Crabs]";
- setarray @scratch_price,12117,// Lord of Death Prize: Wind Ele. Converter 10ea
- 11502,// Lady Tanee Prize: Light Blue Potion 10ea
- 12999,// Dracula Prize: Dead Branch Box 1ea
- 969,// Orc Hero Prize: Gold 1ea
- 12116,// WhiteSmith Howard Prize: Earth Ele. Converter 10ea
- 13517,// Orc Lord Prize: Yggdrassil Box 1ea
- 7619,// Amon Ra Prize: Enriched Elunium 5ea
- 7620,// Osiris Prize: Enriched Oridecon 5ea
- 12028,// Phreeoni Prize: Box of Thunder 10ea
- 13973,// Dark Snake Lord Prize: Poison Bottle Box 1ea
- 14533,// Baphomet Prize: Field Manual 100% 1ea
- 12103,// Golden Thiefbug Prize: Bloody Branch 1ea
- 12210,// Dark Lord Prize: Bubble Gum 1ea
- 12246; // Thanatos Prize: Mystical Card Album 1ea
- setarray @scratch_amount,10,
- 10,
- 1,
- 1,
- 10,
- 1,
- 5,
- 5,
- 10,
- 1,
- 1,
- 1,
- 1,
- 1;
- setarray @scratch_sign$,"LoD",
- "LaT",
- "Dra",
- "OrH",
- "WSH",
- "OrL",
- "AmR",
- "Osi",
- "Phr",
- "DSL",
- "Bap",
- "GTB",
- "DaL",
- "Tha";
- setarray @scratch_chance,1500, // LoD: 15,0%
- 2000, // LaT: 20,0%
- 1050, // Dra: 10,5%
- 500, // OrH: 5,0%
- 1500, // WSH: 15,0%
- 500, // OrL: 5,0%
- 100, // AmR: 1,0%
- 100, // Osi: 1,0%
- 1500, // Phr: 15,0%
- 1000, // DSL: 10,0%
- 100, // Bap: 1,0%
- 99, // GTB: 0,99%
- 50, // DaL: 0,5%
- 1; // Tha: 0,01%
- for(set .@a,0; .@a < getarraysize(@scratch_chance); set .@a,.@a+1)
- {
- for(set .@b,.@a+1; .@b < getarraysize(@scratch_chance); set .@b,.@b+1)
- {
- set @scratch_chance[.@a],@scratch_chance[.@a]+@scratch_chance[.@b];
- }
- }
- cleararray @slot$,"",9;
- set .@payment,20000;
- function Slotbelegung;
- function checkRow;
- set @menu,0;
- while(@menu!=1)
- {
- mes .@n$;
- mes "Hello "+strcharinfo(0)+",";
- mes "would you like to have an lottery ticket?";
- mes "It costs you only "+.@payment+" zeny";
- mes "^FF0000The Jackpot is an Mystical Card Album!^000000";
- next;
- if(select("Give me one ^^:How do i win?:No, thank you.") > 1)
- {
- if(@menu&1)
- {
- next;
- mes .@n$;
- mes "Ok, have a nice day <3";
- close;
- }
- else
- {
- next;
- mes .@n$;
- mes "You need 3x the same Symbol.";
- mes "The Symbols have to be in one Row.";
- mes "And it doesn't matter if the Symbols are horizontal,";
- mes "vertical or diagonal in a row.";
- next;
- mes .@n$;
- mes "Symbol List:";
- mes "[LoD] Wind Elemental Converter 10ea";
- mes "[LaT] Light Blue Potion 10ea";
- mes "[Dra] Dead Branch Box 1ea";
- mes "[OrH] Gold 1ea";
- mes "[WSH] Earth Elemental Converter 10ea";
- mes "[OrL] Yggdrasil Box 1ea";
- mes "[AmR] Enriched Elunium 5ea";
- mes "[Osi] Enriched Oridecon 5ea";
- mes "[Phr] Box of Thunder 10ea";
- mes "[DSL] Poison Bottle Box 1ea";
- mes "[Bap] Field Manual 100% 1ea";
- mes "[GTB] Bloody Branch 1ea";
- mes "[DaL] Bubble Gum 1ea";
- mes "[Tha] Mystical Card Album 1ea";
- next;
- }
- }
- }
- setarray .@row1,0,1,2;
- setarray .@row2,0,3,6;
- setarray .@row3,0,4,8;
- setarray .@row4,1,4,7;
- setarray .@row5,6,4,2;
- setarray .@row6,2,5,8;
- setarray .@row7,3,4,5;
- setarray .@row8,6,7,8;
- set .@slots,8;
- if(Zeny < .@payment)
- {
- mes .@n$;
- mes "I'm sorry but you do not have enough Zeny to play~";
- close;
- }
- set Zeny,Zeny-.@payment;
- mes .@n$;
- mes "Here you go my Friend <3";
- for(set .@a,0;; set .@a,.@a+1)
- {
- mes "["+@slot$[0]+"] ["+@slot$[1]+"] ["+@slot$[2]+"]";
- mes "["+@slot$[3]+"] ["+@slot$[4]+"] ["+@slot$[5]+"]";
- mes "["+@slot$[6]+"] ["+@slot$[7]+"] ["+@slot$[8]+"]";
- next;
- if(.@a > 8) break;
- Slotbelegung(.@a);
- }
- for(set .@a,0; .@a < .@slots; set .@a,.@a+1)
- {
- set .@win,.@win+checkRow(getd(".@row"+(.@a+1)+"[0]"),getd(".@row"+(.@a+1)+"[1]"),getd(".@row"+(.@a+1)+"[2]"));
- }
- if (.@win)
- {
- next;
- mes .@n$;
- mes "Congratulations you've won!";
- mes "Have Fun with your Price and see you next time <3";
- close;
- }
- mes .@n$;
- mes "Sorry, but you didn't win this time~";
- close;
- function Slotbelegung {
- set .@rand,rand(1,10000);
- for(set .@b,0; .@b < getarraysize(@scratch_sign$)-1; set .@b,.@b+1)
- {
- if(@scratch_chance[(getarraysize(@scratch_sign$)-1-.@b)] >= .@rand) break;
- }
- set @slot$[getarg(0)],@scratch_sign$[(getarraysize(@scratch_sign$)-1-.@b)];
- }
- function checkRow {
- function Win;
- if(@slot$[getarg(0)] == @slot$[getarg(1)] && @slot$[getarg(0)] == @slot$[getarg(2)])
- {
- Win(@slot$[getarg(0)]);
- return 1;
- }
- return 0;
- }
- function Win {
- for(set .@c,0; .@c < getarraysize(@scratch_sign$); set .@c,.@c+1)
- {
- if(getarg(0) == @scratch_sign$[.@c])
- {
- mes "You've got 3 ["+@scratch_sign$[.@c]+"]!";
- getitem @scratch_price[.@c],@scratch_amount[.@c];
- if(@scratch_price[.@c] == 12246)
- {
- logmes "The Player "+strcharinfo(0)+" won an Mystical Card Album at the Lottery!";
- announce "The Player "+strcharinfo(0)+" won an Mystical Card Album at the Lottery!",bc_all;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement