Jump to content

Search the Community

Showing results for 'lotti'.

  • Search By Author

Content Type


Forums

  • Announcements
    • Rules & Guidelines
    • Community News
    • Development News
    • Ragnarok News
    • Community Crowdfunding
  • Support & Releases
    • General
    • Scripting
    • Database
    • Source
    • Graphic Enhancements
    • Web
    • Client-side
    • Third Party
    • Projects
  • Discussion & Suggestions
    • Database Discussion
    • Script Discussion
    • Source Discussion
    • Renewal Discussion
    • Archives
  • Community
    • rAthena General
    • Arts & Writings
    • Off Topic
  • International Forums
    • Filipino Support
    • German Support
    • Indonesian/Malaysian Support
    • Portuguese Support
    • Russian Support (Русский)
    • Spanish Support

Categories

  • Server Resources
    • Server Managers/Editors
    • Scripts
    • Source Modifications
  • Web Resources
    • General Website Templates
    • Forum Templates
    • FluxCP Themes
    • FluxCP Addons
    • Other Web/CP Scripts
  • Graphics Resources
    • Sprites & Palettes
    • Maps & 3D Resources
    • Other Graphics
  • Client Resources
    • GRF Files
    • Client Tools
    • Spriting & Paletting Tools
    • Texture & Mapping Tools
    • Editors
    • Patchers

Categories

  • Low Rate
  • Mid Rate
  • High Rate
  • Super High Rate

Categories

  • Records Test
  • Complete Installation Guides
  • Client Guides
    • Data Folder
  • MySQL Guides
  • Database Guides
  • Map Guides

Categories

  • rAthena Forums
  • rAthena Development
  • FluxCP Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


Server


Github


Discord


Interests


Website URL


Yahoo


Skype

  1. Hi Guys, For those who are familiar with Lotti Girl NPC. Is there a way for the NPC to draw like 5x or 10x so that players will not click the NPC one at a time?. It would be cool if players can enter the number of times they can pull on the Lotti NPC. This is the script that I'm using on my server: https://pastebin.com/y0hjpBjX Thanks!
  2. Dear All, I took and modify the script below for gacha pull @500.000 z for each pull and gain reward as described. I want to modify the npc so we can customize the number of pull and charged based on the number of pull Need to add check of the zeny as well to check if zeny amount owned is sufficient. So the flow will be npc init -> show the dialog -> how many pull ? -> Insert number -> Check zeny -> Give reward based on how many pull I hope anyone can help to modify the script or you also may contribute to revamp the script. xxx,167,163,4 script Lotto 72,{ mes "[Lotto]"; mes "I'm Lotto! I'll exchange"; mes "Random Prizes for every"; mes "^ff0000500,000 zeny^000000."; next; mes "[Lotti Girl]"; mes "Our Grand prize is:"; mes "^ff0000 x1 TCG Card^000000"; mes "^ff0000 x1 Costume set^000000"; mes "Consolations are:"; mes "^ff0000 x?? Gold Coin^000000"; mes "^ff0000 x?? Gold^000000"; mes "^ff0000 x?? Treasure Box^000000"; mes "^ff0000 x?? Oridecon^000000"; mes "^ff0000 x?? Elunium^000000"; mes "And many more!!"; if (Zeny < 500000) close; next; if(select("Let's Do This!!:No thanks...")==2) close; mes "[Lotti Girl]"; mes "Here we go..."; set Zeny, Zeny - 500000; set .@Total,15; //<%>,<ItemID>,<Amount> setarray .@P1[0],1,35031,1; //demoniac mid setarray .@P2[0],1,35081,1; //demoniac upper setarray .@P3[0],1,35099,1; //demoniac low setarray .@P4[0],2,7227,1; //tcg setarray .@P5[0],5,7539,rand(1,2); //diablocoin setarray .@P6[0],8,969,rand(1,3); //gold setarray .@P7[0],10,604,rand(1,3); //deadbranch setarray .@P8[0],8,7444,rand(1,3); //treasurebox setarray .@P9[0],8,12208,rand(1,2); //battle manual setarray .@P10[0],20,985,rand(3,8); //elu setarray .@P11[0],25,7063,rand(2,5); //alice apron setarray .@P12[0],25,7047,rand(2,5); // soft feather setarray .@P13[0],20,984,rand(3,8); //ori setarray .@P14[0],15,748,rand(1,3); //witherless setarray .@Default[0],rand(901,926),rand(5,15); set .@i, rand(1,.@Total); if (rand(1,100) > getd(".@P"+.@i+"[0]")) { for(set .@j,0; .@j<getarraysize(.@Default); set .@j,.@j+2) { getitem .@Default[.@j], .@Default[.@j+1]; if(!.@k[0]) setarray .@k[0], .@Default[.@j], .@Default[.@j+1]; } } else{ for(set .@j,1; .@j<getarraysize(getd(".@P"+.@i)); set .@j,.@j+2) { getitem getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]"); if (!.@k[0]) { set .@gz,.@i; setarray .@k[0], getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]"); break; } } } if(1<=.@gz&&.@gz<=4) announce "Hey! "+strcharinfo(0)+" just received "+getitemname(.@k[0])+" x "+.@k[1]+" from Lotti Girl!",0; specialeffect2 248; close; OnInit: delwaitingroom; waitingroom "Try your Luck?",0; end; }
  3. Hi , Can someone write my a code that can bulky gacha at one time , This is example code if can implement together , Example : 100x at once lotti.txt
  4. if(.item_Rate[.@i] == <chance you want>){ announce "[ Lotti Girl ]: Player "+ .@name$ +" obtained 1 x "+ getitemname(.item_ID[.@i]) +" with "+ .item_Rate[.@i] +"%.",bc_map; }
  5. to just announce on map, change announce "[ Lotti Girl ]: Player "+ .@name$ +" obtained 1 x "+ getitemname(.item_ID[.@i]) +" with "+ .item_Rate[.@i] +"%.",0; to announce "[ Lotti Girl ]: Player "+ .@name$ +" obtained 1 x "+ getitemname(.item_ID[.@i]) +" with "+ .item_Rate[.@i] +"%.",bc_map; then if you want it to only announce by specific chances do something like, if(.item_Rate[.@i] == <chance you want>){ announce part of the script }
  6. How can i make this lotti girl script only announce to map and only announce low chance items 10% chance blow prt_gld,168,91,4 script Lotti Girl 4_F_KAFRA7,{ function LinkItem_; if(Weight >= MaxWeight/2) goto Low; .@name$ = strcharinfo(0); .@rand = rand(.chances); .@i = 0; if( countitem(.itm_p) < .itm_a ){ mes .n$; mes "You don't have any"; mes .itm_a+" x "+.itm_n$; mes "in your inventory."; mes " "; mes "Please come back to me if you have it already."; close; } mes .n$; mes rand(2) ? ""+callfunc("F_Hi")+" ^0000FFI'm Lotti Girl^000000, of Prontera ." : ""+callfunc("F_Hi")+" ^0000FFI'm Lotti Girl^000000, of Prontera ."; mes "Required Item: "+.itm_a+" x "+(.itm_n$)+""; mes " "; mes "Would you risk to play this game?"; next; if( select("- Play Game","- Cancel") == 2 ) { mes .n$; mes "Alright! "+ strcharinfo(0) +" come back anytime you want."; close; } while (( .@rand -= .item_Rate[.@i] ) >= 0 ) .@i++; progressbar "0x11CC99",.loading; specialeffect2 EF_REMOVETRAP; getitem .item_ID[.@i], 1; delitem .itm_p, 1; announce "[ Lotti Girl ]: Player "+ .@name$ +" obtained 1 x "+ getitemname(.item_ID[.@i]) +" with "+ .item_Rate[.@i] +"%.",0; mes .n$; mes "You have obtained 1 x ^FF3000"+ getitemname(.item_ID[.@i]) +"^000000 with "+ .item_Rate[.@i] +"%."; close; function LinkItem_ { .@id = getarg(0); .@showslot = getarg(1,0); .@slot = getitemslots(.@id); return "<ITEM>"+(.@slot&&.@showslot?getitemname(.@id)+" ["+.@slot+"]":getitemname(.@id))+"<INFO>"+.@id+"</INFO></ITEM>"; } Low: mes "You are Overweight!"; close; OnInit: .n$ = "[ Lotti Girl ]"; .loading = 0; // 0 = No Delay .itm_p = 30040; // Required Item .itm_a = 1; // Required Amount .itm_n$ = LinkItem_(.itm_p); setarray .item_ID, 607,502,503,504,505,506,507,508,509; // Item ID List setarray .item_Rate, 100,10,10,10,3,10,10,10,10; // Item ID Chances .@i = 0; while ( .item_ID[.@i] ) { .chances += .item_Rate[.@i]; .@i++; } end; }
  7. //===== Hercules Script ====================================== //= Lotti Girl //===== By: ================================================== //= AnnieRuru //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= Hercules 2019-02-22 //===== Description: ========================================= //= Roll a lottery ticket and get some cool items //= even if you get all the trash items, you still collecting points to buy in lotti shop //===== Topic ================================================ //= http://herc.ws/board/topic/16579-lotti-girl/ //===== Additional Comments: ================================= //= //============================================================ function script F_MesItemInfo { .@item = getarg(0); .@itemname$ = getitemname(.@item); if (.@itemname$ != "null") { .@itemslot = getitemslots(.@item); if (.@itemslot) .@itemname$ = sprintf("%s [%d]", .@itemname$, .@itemslot); } else .@itemname$ = "Unknown Item"; if (PACKETVER >= 20150729) return sprintf("<ITEM>%s<INFO>%d</INFO></ITEM>", .@itemname$, .@item); else if (PACKETVER >= 20130130) return sprintf("<ITEMLINK>%s<INFO>%d</INFO></ITEMLINK>", .@itemname$, .@item); else return .@itemname$; } /* create table lotti_rank ( char_id int(11), name varchar(24), lotti_point int(11), primary key (char_id), key (lotti_point) ) engine = innodb; */ prontera,160,179,5 script Lotti Girl 1_F_MARIA,{ goto L_talk; OnInit: // Announce to the server when player roll on a rare item .rare_announcement = 1; // Default 1 : means any item with 0.00%~0.99% // Amount of points gain for each roll .lotti_points = 1; // If the player choose to Roll Repeatedly, what is the maximum amount of Roll in the input .max_roll = 100; setarray .item, 7400, // Item ID requirement 1, // amount of the Item needed 100, // chance of not getting any items // chance of getting the items // <Item ID>, <amount>, <chance> 501, 10, 500, 502, 5, 100, 503, 5, 100, 504, 5, 100, 505, 5, 100; setarray .itemshop, // Item sold in the shop // <Item ID>, <Lotti Points needed> 601, 2, 602, 2, 603, 2, 604, 2, 605, 2; // ========================================================================================================= .size = getarraysize(.item); for ( .@i = 2; .@i < .size; .@i += 3 ) .totalchance += .item[.@i]; for ( .@i = 2; .@i < .size; .@i += 3 ) { .@chance = .item[.@i] *10000 / .totalchance; .@division = .@chance / 100; .@remainder$ = .@chance % 100; while ( getstrlen(.@remainder$) < 2 ) .@remainder$ = insertchar(.@remainder$, "0", 0); .chance_display$[.@i] = .@division +"."+ .@remainder$ +"%"; if ( .@division < .rare_announcement ) .announce[.@i] = true; } .shop_size = getarraysize(.itemshop); npcshopdelitem "Lotti#hidden", 512; for ( .@i = 0; .@i < .shop_size; .@i += 2 ) npcshopadditem "Lotti#hidden", .itemshop[.@i], .itemshop[.@i +1]; npcshopattach "Lotti#hidden"; .npcname$ = "[ "+strnpcinfo(3)+" ]"; end; L_talk: mes .npcname$; mes "Hello, do you want to play lottery ?"; next; switch( select( "Deal me in!", "More Information", "Lotti Shop", "Lotti Ranking" ) ) { mes .npcname$; case 1: mes "It costs "+.item[1]+"x "+F_MesItemInfo( .item[0] )+" to play."; if ( countitem( .item[0] ) < .item[1] ) close; next; if ( select( "Play", "Roll Repeatedly" ) == 1 ) { mes .npcname$; while ( true ) { mes "Here we go..."; mes " "; .@r = rand(.totalchance); for ( .@i = 2; ( .@r -= .item[.@i] ) >= 0; .@i += 3 ); if ( checkweight( .item[.@i -2], .item[.@i -1] ) == false ) { mes "It appears you have overweight"; break; } delitem .item[0], .item[1]; if ( .@i == 2 ) mes "You get nothing..."; else { mes "You get "+.item[.@i -1]+"x "+F_MesItemInfo(.item[.@i -2]); getitem .item[.@i -2], .item[.@i -1]; if ( .announce[.@i] ) announce sprintf (( "Lotti Girl: Player [%s] has roll on [%s](%s)" ), strcharinfo(0), getitemname(.item[.@i -2]), .chance_display$[.@i] ), bc_all, C_PINK; } lotti_points += .lotti_points; query_sql "insert into lotti_rank values ( "+ getcharid(CHAR_ID_CHAR) +", '"+ escape_sql( strcharinfo(PC_NAME) ) +"', "+ .lotti_points +" ) on duplicate key update lotti_point = lotti_point + "+ .lotti_points; mes " "; mes "wanna try again ?"; next; if ( select( "Yes", "No" ) == 2 ) break; mes .npcname$; if ( countitem( .item[0] ) < .item[1] ) { mes " "; mes "It appears you have ran out of "+F_MesItemInfo( .item[0] ); break; } } } else { mes .npcname$; mes "Input how many rounds to roll"; mes "Currently you have "+countitem( .item[0] )+" "+F_MesItemInfo( .item[0] ); next; input .@roll_input, 1, min( countitem( .item[0] ) / .item[1], .max_roll ); mes .npcname$; mes "Are you sure you want to roll "+.@roll_input+" times ?"; next; if ( select( "Yes", "No" ) == 2 ) close; mes .npcname$; mes "Here we go..."; mes " "; // freeloop true; for ( .@j = 0; .@j < .@roll_input; ++.@j ) { .@r = rand(.totalchance); for ( .@i = 2; ( .@r -= .item[.@i] ) >= 0; .@i += 3 ); if ( checkweight( .item[.@i -2], .item[.@i -1] ) == false ) { mes "It appears you have overweight"; break; } delitem .item[0], .item[1]; if ( .@i == 2 ) mes "You get nothing..."; else { mes "You get "+.item[.@i -1]+"x "+F_MesItemInfo(.item[.@i -2]); getitem .item[.@i -2], .item[.@i -1]; if ( .announce[.@i] ) announce sprintf(( "Lotti Girl: Player [%s] has roll on [%s](%s)" ), strcharinfo(0), getitemname(.item[.@i -2]), .chance_display$[.@i] ), bc_all, C_PINK; } ++.@roll; sleep2 1; // prevent lag the server } lotti_points += .lotti_points * .@roll; query_sql "insert into lotti_rank values ( "+ getcharid(CHAR_ID_CHAR) +", '"+ escape_sql( strcharinfo(PC_NAME) ) +"', "+ .lotti_points +" ) on duplicate key update lotti_point = lotti_point + "+( .lotti_points * .@roll ); mes "Total roll : "+.@roll+" times."; } mes " "; mes "Thank you for using Lotti service~"; close; case 2: freeloop true; mes "Item required: "+.item[1]+"x "+F_MesItemInfo(.item[0]); if ( .item[2] ) mes "Chance to gain ^FF0000nothing^000000 : " + .chance_display$[2]; mes "Possible gains:"; for ( .@i = 3; .@i < .size; .@i += 3 ) mes " > "+F_MesItemInfo(.item[.@i])+" : "+ .chance_display$[.@i +2]; next; mes .npcname$; mes "Each time you roll, will gain "+.lotti_points+" Lotti Point(s)."; mes "Which can be use to buy rare items in Lotti Shop."; close; case 3: mes "You currently have ^0000FF"+lotti_points+"^000000 Lotti Point(s)."; dispbottom "You currently have "+lotti_points+" Lotti Point(s)."; close2; callshop "Lotti#hidden", 1; end; case 4: .@query$ = "SELECT `name`, IF(@d=t.`lotti_point`, @r, @r:=@i), @d:=t.`lotti_point`, @i:=@i+1 "; .@query$ += "FROM `lotti_rank` t, (SELECT @d:=0, @r:=0, @i:=1)q "; .@query$ += "ORDER BY `lotti_point` DESC LIMIT 5"; .@nb = query_sql(.@query$, .@name$, .@rank, .@points, .@dummy); if ( !.@nb ) { mes "There's no ranking yet ~"; close; } for ( .@i = 0; .@i < .@nb; ++.@i ) mes ""+.@rank[.@i]+". "+.@name$[.@i]+" : "+.@points[.@i]+" Point(s)"; mes " "; if ( !query_sql( "SELECT `lotti_point`, 1+(SELECT COUNT(1) FROM `lotti_rank` t1 WHERE t1.lotti_point > t2.lotti_point) FROM `lotti_rank` t2 WHERE `char_id` = "+ getcharid(CHAR_ID_CHAR), .@points, .@rank ) ) { mes "You are not in the rank."; close; } mes "Your current :"; mes " > Rank : "+.@rank; mes " > Point : "+.@points+" Point(s)."; close; } end; // shouldn't reach OnBuyItem: mes .npcname$; if ( !@bought_quantity ) end; if ( checkweight2( @bought_nameid, @bought_quantity ) == false ) { mes "It appears you can't carry them all"; close; } .@size = getarraysize( @bought_nameid ); for ( .@i = 0; .@i < .@size; .@i++ ) { for ( .@j = 0; .@j < .shop_size; .@j += 2 ) if ( @bought_nameid[.@i] == .itemshop[.@j] ) break; .@itemcost += .itemshop[.@j +1] * @bought_quantity[.@i]; } if ( .@itemcost > lotti_points ) { mes "You don't have enough Lotti Points"; close; } lotti_points -= .@itemcost; for ( .@i = 0; .@i < .@size; ++.@i ) getitem @bought_nameid[.@i], @bought_quantity[.@i]; deletearray @bought_nameid; deletearray @bought_quantity; mes "Thanks for buying ~"; close; } - shop Lotti#hidden -1,512:1000
  8. function script F_MesItemInfo { .@item = getarg(0); .@itemname$ = getitemname(.@item); if (.@itemname$ != "null") { .@itemslot = getitemslots(.@item); if (.@itemslot) .@itemname$ = sprintf("%s [%d]", .@itemname$, .@itemslot); } else .@itemname$ = "Unknown Item"; if (PACKETVER >= 20150729) return sprintf("<ITEM>%s<INFO>%d</INFO></ITEM>", .@itemname$, .@item); else if (PACKETVER >= 20130130) return sprintf("<ITEMLINK>%s<INFO>%d</INFO></ITEMLINK>", .@itemname$, .@item); else return .@itemname$; } //===== Hercules Script ====================================== //= Lotti Girl //===== By: ================================================== //= AnnieRuru //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= Hercules 2019-02-22 //===== Description: ========================================= //= Roll a lottery ticket and get some cool items //= even if you get all the trash items, you still collecting points to buy in lotti shop //===== Topic ================================================ //= http://herc.ws/board/topic/16579-lotti-girl/ //===== Additional Comments: ================================= //= //============================================================ /* create table lotti_rank ( char_id int(11), name varchar(24), lotti_point int(11), primary key (char_id), key (lotti_point) ) engine = innodb; */ prontera,155,180,5 script Lotti Girl 1_F_MARIA,{ goto L_talk; OnInit: // Announce to the server when player roll on a rare item .rare_announcement = 1; // Default 1 : means any item with 0.00%~0.99% // Amount of points gain for each roll .lotti_points = 1; // If the player choose to Roll Repeatedly, what is the maximum amount of Roll in the input .max_roll = 100; setarray .item, Id_Lottery_Ticket, // Item ID requirement 1, // amount of the Item needed 0, // chance of not getting any items // chance of getting the items // <Item ID>, <amount>, <chance> Apple, 10, 1000, Red_Potion, 5, 50, Orange_Potion, 4, 40, Yellow_Potion, 3, 30, White_Potion, 2, 20, Blue_Potion, 1, 10; setarray .itemshop, // Item sold in the shop // <Item ID>, <Lotti Points needed> Red_Potion, 100, Orange_Potion, 200, Yellow_Potion, 300, White_Potion, 400, Blue_Potion, 500; // ========================================================================================================= .size = getarraysize(.item); for ( .@i = 2; .@i < .size; .@i += 3 ) .totalchance += .item[.@i]; for ( .@i = 2; .@i < .size; .@i += 3 ) { .@chance = .item[.@i] *10000 / .totalchance; .@division = .@chance / 100; .@remainder$ = .@chance % 100; while ( getstrlen(.@remainder$) < 2 ) .@remainder$ = insertchar(.@remainder$, "0", 0); .chance_display$[.@i] = .@division +"."+ .@remainder$ +"%"; if ( .@division < .rare_announcement ) .announce[.@i] = true; } .shop_size = getarraysize(.itemshop); npcshopdelitem "Lotti#hidden", 512; for ( .@i = 0; .@i < .shop_size; .@i += 2 ) npcshopadditem "Lotti#hidden", .itemshop[.@i], .itemshop[.@i +1]; npcshopattach "Lotti#hidden"; .npcname$ = "["+ strnpcinfo(NPC_NAME) +"]"; end; L_talk: mes .npcname$; mes "Hello, do you want to play lottery ?"; next; switch( select( "Deal me in!", "More Information", "Lotti Shop", "Lotti Ranking" ) ) { mes .npcname$; case 1: mesf "It costs %dx %s to play.", .item[1], F_MesItemInfo( .item[0] ); if ( countitem( .item[0] ) < .item[1] ) close; next; if ( select( "Play", "Roll Repeatedly" ) == 1 ) { mes .npcname$; while ( true ) { mes "Here we go..."; mes " "; .@r = rand(.totalchance); for ( .@i = 2; ( .@r -= .item[.@i] ) >= 0; .@i += 3 ); if ( checkweight( .item[.@i -2], .item[.@i -1] ) == false ) { mes "It appears you have overweight"; break; } delitem .item[0], .item[1]; if ( .@i == 2 ) mes "You get nothing..."; else { mesf "You get %s%dx%s %s", F_MesColor(C_TEAL), .item[.@i -1], F_MesColor(C_BLACK), F_MesItemInfo(.item[.@i -2]); getitem .item[.@i -2], .item[.@i -1]; if ( .announce[.@i] ) announce sprintf( _$( "Lotti Girl: Player [%s] has roll on [%s](%s)" ), strcharinfo(0), getitemname(.item[.@i -2]), .chance_display$[.@i] ), bc_all, C_PINK; } lotti_points += .lotti_points; query_sql "insert into lotti_rank values ( "+ getcharid(CHAR_ID_CHAR) +", '"+ escape_sql( strcharinfo(PC_NAME) ) +"', "+ .lotti_points +" ) on duplicate key update lotti_point = lotti_point + "+ .lotti_points; mes " "; mes "wanna try again ?"; next; if ( select( "Yes", "No" ) == 2 ) break; mes .npcname$; if ( countitem( .item[0] ) < .item[1] ) { mes " "; mesf "It appears you have ran out of %s", F_MesItemInfo( .item[0] ); break; } } } else { mes .npcname$; mes "Input how many rounds to roll"; mesf "Currently you have %dx %s", countitem( .item[0] ), F_MesItemInfo( .item[0] ); next; input .@roll_input, 1, min( countitem( .item[0] ) / .item[1], .max_roll ); mes .npcname$; mesf "Are you sure you want to roll %d times ?", .@roll_input; next; if ( select( "Yes", "No" ) == 2 ) close; mes .npcname$; mes "Here we go..."; mes " "; // freeloop true; for ( .@j = 0; .@j < .@roll_input; ++.@j ) { .@r = rand(.totalchance); for ( .@i = 2; ( .@r -= .item[.@i] ) >= 0; .@i += 3 ); if ( checkweight( .item[.@i -2], .item[.@i -1] ) == false ) { mes "It appears you have overweight"; break; } delitem .item[0], .item[1]; if ( .@i == 2 ) mes "You get nothing..."; else { mesf "You get %s%dx%s %s", F_MesColor(C_TEAL), .item[.@i -1], F_MesColor(C_BLACK), F_MesItemInfo(.item[.@i -2]); getitem .item[.@i -2], .item[.@i -1]; if ( .announce[.@i] ) announce sprintf( _$( "Lotti Girl: Player [%s] has roll on [%s](%s)" ), strcharinfo(0), getitemname(.item[.@i -2]), .chance_display$[.@i] ), bc_all, C_PINK; } ++.@roll; sleep2 1; // prevent lag the server } lotti_points += .lotti_points * .@roll; query_sql "insert into lotti_rank values ( "+ getcharid(CHAR_ID_CHAR) +", '"+ escape_sql( strcharinfo(PC_NAME) ) +"', "+ .lotti_points +" ) on duplicate key update lotti_point = lotti_point + "+( .lotti_points * .@roll ); mesf "Total roll : %d times.", .@roll; } mes " "; mes "Thank you for using Lotti service~"; close; case 2: freeloop true; mesf "Item required: %s%dx%s %s", F_MesColor(C_TEAL), .item[1], F_MesColor(C_BLACK), F_MesItemInfo(.item[0]); if ( .item[2] ) mesf "Chance to gain nothing : %s%s%s", F_MesColor(C_CHOCOLATE), .chance_display$[2], F_MesColor(C_BLACK); mes "Possible gains:"; for ( .@i = 3; .@i < .size; .@i += 3 ) mesf "%s%dx%s %s (%s%s%s)", F_MesColor(C_TEAL), .item[.@i +1], F_MesColor(C_BLACK), F_MesItemInfo(.item[.@i]), F_MesColor(C_CHOCOLATE), .chance_display$[.@i +2], F_MesColor(C_BLACK); next; mes .npcname$; mesf "Each time you roll, will gain %d Lotti Points.", .lotti_points; mes "Which can be use to buy rare items in Lotti Shop."; close; case 3: mesf "You currently have %s Lotti Points.", lotti_points; dispbottom sprintf( _$("You currently have %s Lotti Points."), lotti_points ); close2; callshop "Lotti#hidden", 1; end; case 4: .@query$ = "SELECT `name`, IF(@d=t.`lotti_point`, @r, @r:=@i), @d:=t.`lotti_point`, @i:=@i+1 "; .@query$ += "FROM `lotti_rank` t, (SELECT @d:=0, @r:=0, @i:=1)q "; .@query$ += "ORDER BY `lotti_point` DESC LIMIT 5"; .@nb = query_sql(.@query$, .@name$, .@rank, .@points, .@dummy); if ( !.@nb ) { mes "There's no ranking yet ~"; close; } for ( .@i = 0; .@i < .@nb; ++.@i ) mesf "%d. %s%s %s%d%s Points", .@rank[.@i], F_MesColor(C_TEAL), .@name$[.@i], F_MesColor(C_CHOCOLATE), .@points[.@i], F_MesColor(C_BLACK); mes " "; if ( !query_sql( "SELECT `lotti_point`, 1+(SELECT COUNT(1) FROM `lotti_rank` t1 WHERE t1.lotti_point > t2.lotti_point) FROM `lotti_rank` t2 WHERE `char_id` = "+ getcharid(CHAR_ID_CHAR), .@points, .@rank ) ) { mes "You are not in the rank."; close; } mesf "Your current Point > %d", .@points; mesf "Your current Rank > %d", .@rank; close; } end; // shouldn't reach OnBuyItem: mes .npcname$; if ( !@bought_quantity ) end; if ( checkweight2( @bought_nameid, @bought_quantity ) == false ) { mes "It appears you can't carry them all"; close; } .@size = getarraysize( @bought_nameid ); for ( .@i = 0; .@i < .@size; .@i++ ) { for ( .@j = 0; .@j < .shop_size; .@j += 2 ) if ( @bought_nameid[.@i] == .itemshop[.@j] ) break; .@itemcost += .itemshop[.@j +1] * @bought_quantity[.@i]; } if ( .@itemcost > lotti_points ) { mes "You don't have enough Lotti Points"; close; } lotti_points -= .@itemcost; for ( .@i = 0; .@i < .@size; ++.@i ) getitem @bought_nameid[.@i], @bought_quantity[.@i]; deletearray @bought_nameid; deletearray @bought_quantity; mes "Thanks for buying ~"; close; } - shop Lotti#hidden -1,512:1000 Help Translate in Rathena, got an error in mesf
  9. Good Day Rathenians, I am currently using this Lotti Girl Script that i've found somewhere around here and was trying to add multiple items as requirement to play; however it always ended up needing just 1 item needed only. in addition to that, item quantity seems not working as set too as when i've changed it to 10; player are still able to play by using 1 quantity only instead of 10 quantity. Here's my script that im currently using. Thanking you in advance for your kind help and support. lottigirl.txt
  10. for ( .@i = 0; .@i < .itemsize[.@r]; ++.@i ) { getitem .@itemid[.@i], .@itemamount[.@i]; if (getd( ".p"+ .@r +"[0]" ) < 10) announce "<Lotti> "+strcharinfo(0)+" obtained "+.@itemamount[.@i]+"x "+getitemname(.@itemid[.@i]), bc_all; // <----- THIS LINE } only announce 10% or below. for ( .@i = 0; .@i < .itemsize[.@r]; ++.@i ) { getitem .@itemid[.@i], .@itemamount[.@i]; announce "<Lotti> "+strcharinfo(0)+" obtained "+.@itemamount[.@i]+"x "+getitemname(.@itemid[.@i]), bc_all; // <----- THIS LINE } announce all items
  11. I use this Lotti Girl script but this script don't have announcement when get item with low chance (such as < 5%) and i want to have the announcement so other player can read it anyone can help me? thank you in advance lotti.txt
  12. prontera,170,181,3 script Lotti Girl 714,{ mes "[Lotti Girl]"; mes "Hello Sir! Are you out"; mes "shopping in the city?!"; next; mes "[Lotti Girl]"; mes "I'm Lotti! I'll exchange cool"; mes "random prizes for every"; if(.LottoID && .LottoAmt) mes "^ff0000"+.LottoAmt+" "+getitemname(.LottoID)+"^000000."; if(.ZenyPay) mes "^ff0000"+callfunc("F_InsertComma",.ZenyPay)+"z"; next; mes "[Lotti Girl]"; if(getarraysize(.P1)<4){ mes "Our Grand prize is:"; mes "^ff0000"+.P1[2]+" "+getitemname(.P1[1])+"^000000"; } else { mes "Random Grand prize:"; for(.@i=1;.@i<getarraysize(.P1);.@i+=2) mes "^ff0000"+.P1[.@i+1]+" "+getitemname(.P1[.@i])+"^000000"; } if(getarraysize(.P2)<4){ mes "Special prize is:"; mes "^ff0000"+.P2[2]+" "+getitemname(.P2[1])+"^000000"; } else { mes "Random Special prize:"; for(.@i=1;.@i<getarraysize(.P2);.@i+=2) mes "^ff0000"+.P2[.@i+1]+" "+getitemname(.P2[.@i])+"^000000"; } next; mes "[Lotti Girl]"; mes "You can still get random item"; mes "if you failed to get the grand"; mes "prize and special prizes."; if(.LottoID && .LottoAmt && (countitem(.LottoID) < .LottoAmt)) close; if(.Zeny && Zeny < .Zeny) close; next; if(select("Deal me in!:No way...")==2) close; L_Roll: if (Zeny < .ZenyPay) { mes "[Lotti Girl]"; mes "You don't have enough zeny."; close; } mes "[Lotti Girl]"; mes "Here we go..."; if(.LottoID && .LottoAmt) delitem .LottoID,.LottoAmt; if(.ZenyPay) Zeny -= .ZenyPay; set .@i, rand(1,.Total); set .@rand,rand(10000); for(.@j=.Total;.@j>=1;.@j--) if( getd(".P"+.@j+"[0]") >= .@rand) .@i = .@j; next; if ( .@rand > getd(".P"+.@i+"[0]")){ .@iid = rand(getarraysize(.Default)/2); setarray .@get,.Default[(.@iid*2)],.Default[((.@iid*2)+1)]; } else { .@iid = rand(getarraysize(getd(".P"+.@i))/2); setarray .@get,getd(".P"+.@i+"["+((.@iid*2)+1)+"]"),getd(".P"+.@i+"["+((.@iid*2)+2)+"]"); } close2; getitem .@get[0],.@get[1]; if(inarray(.AnnouncedID,.@get) >=0 ) announce "Congratulations! "+strcharinfo(0)+" just received "+getitemname(.@get[0])+" x "+.@get[1]+" from Lotti Girl ("+.map$+" "+.x+" "+.y+")!",0; specialeffect2 248; if(.LottoID && .LottoAmt && (countitem(.LottoID) < .LottoAmt)) close; if(.Zeny && Zeny < .Zeny) close; next; mes "[Lotti Girl]"; mes "Want to roll again?"; if(select("Roll again:Nope, No luck!")==1){ clear(); goto L_Roll; } close; OnInit: //No need to edit the main script. all editable are here. .ZenyPay = 100000; //Zeny to Pay [0 = Disable] .LottoID = 0; //ItemID to Roll [0 = Disable] .LottoAmt = 0; //Amount of LottoID Per Roll[0 = Disable] set .Total,4; setarray .AnnouncedID,501,502,512,513; //To reduce announcement. let's not announce common items. //setarray .P#[0],<% chance(1-10000)>,<ItemID>,<Amount> setarray .P1[0],100,501,1; //Grand Prize setarray .P2[0],1000,502,1,512,2,513,3; //Special Prizes setarray .P3[0],5000,503,1; setarray .P4[0],7500,504,1,514,4; setarray .Default[0],505,5,506,1; getmapxy(.map$,.x,.y,BL_NPC); end; }
  13. Hi everyone, i got the script of @Haruka Mayumi Lotti npc it works fine just getting stuck on this part when you have enough zeny to play the lotti, i wish it would just tell the player that he/she doesn't have enough zeny or enough item to play the lotti game. prontera,170,181,3 script Lotti Girl 714,{ mes "[Lotti Girl]"; mes "Hello Sir! Are you out"; mes "shopping in the city?!"; next; mes "[Lotti Girl]"; mes "I'm Lotti! I'll exchange cool"; mes "random prizes for every"; if(.LottoID && .LottoAmt) mes "^ff0000"+.LottoAmt+" "+getitemname(.LottoID)+"^000000."; if(.ZenyPay) mes "^ff0000"+callfunc("F_InsertComma",.ZenyPay)+"z"; next; mes "[Lotti Girl]"; if(getarraysize(.P1)<4){ mes "Our Grand prize is:"; mes "^ff0000"+.P1[2]+" "+getitemname(.P1[1])+"^000000"; } else { mes "Random Grand prize:"; for(.@i=1;.@i<getarraysize(.P1);.@i+=2) mes "^ff0000"+.P1[.@i+1]+" "+getitemname(.P1[.@i])+"^000000"; } if(getarraysize(.P2)<4){ mes "Special prize is:"; mes "^ff0000"+.P2[2]+" "+getitemname(.P2[1])+"^000000"; } else { mes "Random Special prize:"; for(.@i=1;.@i<getarraysize(.P2);.@i+=2) mes "^ff0000"+.P2[.@i+1]+" "+getitemname(.P2[.@i])+"^000000"; } next; mes "[Lotti Girl]"; mes "You can still get random item"; mes "if you failed to get the grand"; mes "prize and special prizes."; if(.LottoID && .LottoAmt && (countitem(.LottoID) < .LottoAmt)) close; if(.Zeny && Zeny < .Zeny) close; next; if(select("Deal me in!:No way...")==2) close; L_Roll: mes "[Lotti Girl]"; mes "Here we go..."; if(.LottoID && .LottoAmt) delitem .LottoID,.LottoAmt; if(.ZenyPay) Zeny -= .ZenyPay; set .@i, rand(1,.Total); set .@rand,rand(10000); for(.@j=.Total;.@j>=1;.@j--) if( getd(".P"+.@j+"[0]") >= .@rand) .@i = .@j; next; if ( .@rand > getd(".P"+.@i+"[0]")){ .@iid = rand(getarraysize(.Default)/2); setarray .@get,.Default[(.@iid*2)],.Default[((.@iid*2)+1)]; } else { .@iid = rand(getarraysize(getd(".P"+.@i))/2); setarray .@get,getd(".P"+.@i+"["+((.@iid*2)+1)+"]"),getd(".P"+.@i+"["+((.@iid*2)+2)+"]"); } getitem .@get[0],.@get[1]; if(inarray(.AnnouncedID,.@get) >=0 ) announce "Congratulations! "+strcharinfo(0)+" just received "+getitemname(.@get[0])+" x "+.@get[1]+" from Lotti Girl ("+.map$+" "+.x+" "+.y+")!",0; specialeffect2 248; if(.LottoID && .LottoAmt && (countitem(.LottoID) < .LottoAmt)) close; if(.Zeny && Zeny < .Zeny) close; next; mes "[Lotti Girl]"; mes "Want to roll again?"; if(select("Roll again:Nope, No luck!")==1){ clear(); goto L_Roll; } close; OnInit: //No need to edit the main script. all editable are here. .ZenyPay = 100000; //Zeny to Pay [0 = Disable] .LottoID = 0; //ItemID to Roll [0 = Disable] .LottoAmt = 0; //Amount of LottoID Per Roll[0 = Disable] set .Total,4; setarray .AnnouncedID,501,502,512,513; //To reduce announcement. let's not announce common items. //setarray .P#[0],<% chance(1-10000)>,<ItemID>,<Amount> setarray .P1[0],100,501,1; //Grand Prize setarray .P2[0],1000,502,1,512,2,513,3; //Special Prizes setarray .P3[0],5000,503,1; setarray .P4[0],7500,504,1,514,4; setarray .Default[0],505,5,506,1; getmapxy(.map$,.x,.y,BL_NPC); end; }
  14. Hi there, I've been trying to modify my lotti script into not have a default prize (If you lose you get this item). I just want a Lotti / Gacha script that will take the payment, then randomly select a reward (items that I set) with their respective chances. As my current lotti script goes (the one from rathena) when you roll and if you don't get any of the set rewards you will be rewarded with a DEFAULT prize. I don't want to get default prize, I just want to get the items that are set by how high the chance to get them. Just roll me all the items, highest chance to lowest chance. Thank you for the help This is the script // http://rathena.org/board/topic/83017-pro-lotti-girl-refine-master/ turbo_room,135,97,3 script Lotti Girl 720,{ mes "[Lotti Girl]"; mes "I'm Lotti! I'll exchange"; mes "Random Prizes for every"; mes "^ff000050,000 zeny^000000."; next; mes "[Lotti Girl]"; mes "Our Grand prize is:"; mes "^ff0000 +4 Refine Ticket^000000"; mes "Consolations are:"; mes "^ff0000 x1 Silver Coin^000000"; mes "^ff0000 x1 Bronze Coin^000000"; mes "^ff0000 x?? War Badges^000000"; mes "And many more!!"; if (Zeny < 50000) close; next; if(select("Let's Do This!!:No thanks...")==2) close; mes "[Lotti Girl]"; mes "Here we go..."; set Zeny, Zeny - 50000; set .@Total,5; //<%>,<ItemID>,<Amount> setarray .@P1[0],2,6456,1; setarray .@P2[0],3,675,1; setarray .@P3[0],4,673,1; setarray .@P4[0],5,7773,rand(1,2); setarray .@Default[0],11502,rand(1,3); set .@i, rand(1,.@Total); if (rand(1,100) > getd(".@P"+.@i+"[0]")) { for(set .@j,0; .@j<getarraysize(.@Default); set .@j,.@j+2) { getitem .@Default[.@j], .@Default[.@j+1]; if(!.@k[0]) setarray .@k[0], .@Default[.@j], .@Default[.@j+1]; } } else{ for(set .@j,1; .@j<getarraysize(getd(".@P"+.@i)); set .@j,.@j+2) { getitem getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]"); if (!.@k[0]) { set .@gz,.@i; setarray .@k[0], getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]"); break; } } } if(1<=.@gz&&.@gz<=2) announce "Hey! "+strcharinfo(0)+" just received "+getitemname(.@k[0])+" x "+.@k[1]+" from Lotti Girl!",0; specialeffect2 248; close; }
  15. Is it possible to call cuttin on item collection? I have an idea to make npc or box item (Like OBB or Lotti NPC) But i want to create the random item animation show up is there a way to do it? Sorry if i post on wrong section
  16. Hi, This script works perfectly well, kudos to the owner of this script, I forgot who I apologize but just wondering if we can make the Default prize on random as well? For example: Set default prize on random of red, yellow, white potion. instead of 1 default prize of red potion only. Gotta make setarray .@Default[0],19578,1; random, not just the 19578. function script Get_MysteryBox { set .@Total,7; //<%>,<ItemID>,<Amount> setarray .@P1[0],50,19543,1; setarray .@P2[0],90,19525,1; setarray .@P3[0],90,31171,1; setarray .@P4[0],90,19620,1; setarray .@P5[0],90,19527,1; setarray .@P6[0],90,19733,1; setarray .@P7[0],90,20057,1; setarray .@Default[0],19578,1; set .@i, rand(1,.@Total); if (rand(1,100) > getd(".@P"+.@i+"[0]")) { for(set .@j,0; .@j<getarraysize(.@Default); set .@j,.@j+2) { getitem .@Default[.@j], .@Default[.@j+1]; if(!.@k[0]) setarray .@k[0], .@Default[.@j], .@Default[.@j+1]; } } else{ for(set .@j,1; .@j<getarraysize(getd(".@P"+.@i)); set .@j,.@j+2) { getitem getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]"); if (!.@k[0]) { set .@gz,.@i; setarray .@k[0], getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]"); break; } } } if(1<=.@gz&&.@gz<=1) announce "Congratulations! "+strcharinfo(0)+" just received "+getitemname(.@k[0])+" x "+.@k[1]+" from the Mystery Costume Box!",0; specialeffect2 248; close; }
  17. this script is from lotti npc right? is it alright to use this in random box?? what is the difference between this 2 script...
  18. set .@Total,12; setarray .@P1[0],1,1230,1; //Ice Pick setarray .@P2[0],1,5135,1; //Cyclops setarray .@P3[0],1,4365,1; // HW Card setarray .@P4[0],1,4451,1; // Crothen Card setarray .@P5[0],1,18885,1; // Jejecap setarray .@P6[0],1,20036,1; // Sword Master Crown setarray .@P7[0],1,4357,1; // LK Card setarray .@P8[0],1,4403,1; // kiel card setarray .@P9[0],20,12210,20; // BGUM setarray .@P10[0],30,7227,20; // TCG setarray .@P11[0],100,7227,2; // TCG setarray .@P12[0],100,7227,2; // TCG do{ set .@i, rand(1,.@Total); }while( rand(1,100) > getd(".@P"+.@i+"[0]") ); for(set .@j,1; .@j<getarraysize(getd(".@P"+.@i)); set .@j,.@j+2) { getitem getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]"); if (!.@k[0]) { set .@gz,.@i; setarray .@k[0], getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]"); break; } } if( .@gz && .@gz <= 10 ) // 10% equal or below will announce announce "Congratulations! "+strcharinfo(0)+" just received "+getitemname(.@k[0])+" x "+.@k[1]+" from Lotti Girl",0; specialeffect2 248; close;
  19. Good Day rAthena ! ---------------------------------------------------------------------------------------- Released Scripts Most of my script is not mine but since its too old i make it work to latest rAthena scripting . But i also made my few script for my own server . I will separate my NPC script to ( 3 ) Different Type of Server ("Low Rate","Mid Rate","High Rate") EVENTS - Mid Rate / High rate Alon Event Bombring Event Dice Event Fabre Punch Event Free For All Event Goblin Invasion Event Mushroom Event MVP Event Poring Catcher Event Racing Event Soccerball Event Stop the Clock Event Town Invasion Event Treasure Box Event True or False Event Event Control Manager Shower Event Whos Online Event ---------------------------------------------------------------------------------------- Utilities - Low Rate / Mid Rate / High rate ---------------------------------------------------------------------------------------- CoolEvent Corp. Employee ( PRO Style - Coupon ) HOT! Lotti Girl ( PRO Style ) HOT Stats Seller HOT Time Play HOT Instant Job / Baby Changer HOT Event Whisper HOT GM LOGIN HOT GOD ITEM HOT Server Time Freebies Farm Zone Berry Changer Server Announcer Attendance Banker Broadcaster with Delay and Payment Change Gender Change Name Enter to Channel System Emperium Breaker Test Emperium Breaker Ladder with Points Changer Guild Ladder no need SQL MVP Top Hunter Ladder no need SQL Healer & Linker Moving Waiting Room ---------------------------------------------------------------------------------------- Quest - Low Rate / Mid Rate / High rate ---------------------------------------------------------------------------------------- Bubble Gum Quest Halter Berzebub Card Quest ---------------------------------------------------------------------------------------- SECURITY - Low Rate / Mid Rate / High rate ---------------------------------------------------------------------------------------- AntiBot System HOT! PAID NPC Notes I am a bit lazy to write all those Script Descriptions, i do believe that all of you able to get how this script works. Im tired now i will update this post on next few days to update all my working script need to update first and test to work to latest rAthena . Most of the NPC that already here already have a updated version so to get that you need to directly send me a message it will be gonna a paid script or you can request so i will put it on rAthena Download section and make it a paid NPC Enjoy!
  20. function script F_MesItemInfo { .@item = getarg(0); .@itemname$ = getitemname(.@item); if (.@itemname$ != "null") { .@itemslot = getitemslots(.@item); if (.@itemslot) .@itemname$ = sprintf("%s [%d]", .@itemname$, .@itemslot); } else .@itemname$ = "Unknown Item"; if (PACKETVER >= 20150729) return sprintf("<ITEM>%s<INFO>%d</INFO></ITEM>", .@itemname$, .@item); else if (PACKETVER >= 20130130) return sprintf("<ITEMLINK>%s<INFO>%d</INFO></ITEMLINK>", .@itemname$, .@item); else return .@itemname$; } //===== Hercules Script ====================================== //= Lotti Girl //===== By: ================================================== //= AnnieRuru //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= Hercules 2019-02-22 //===== Description: ========================================= //= Roll a lottery ticket and get some cool items //= even if you get all the trash items, you still collecting points to buy in lotti shop //===== Topic ================================================ //= http://herc.ws/board/topic/16579-lotti-girl/ //===== Additional Comments: ================================= //= //============================================================ /* create table lotti_rank ( char_id int(11), name varchar(24), lotti_point int(11), primary key (char_id), key (lotti_point) ) engine = innodb; */ prontera,155,180,5 script Lotti Girl 1_F_MARIA,{ goto L_talk; OnInit: // Announce to the server when player roll on a rare item .rare_announcement = 1; // Default 1 : means any item with 0.00%~0.99% // Amount of points gain for each roll .lotti_points = 1; // If the player choose to Roll Repeatedly, what is the maximum amount of Roll in the input .max_roll = 100; setarray .item, Id_Lottery_Ticket, // Item ID requirement 1, // amount of the Item needed 0, // chance of not getting any items // chance of getting the items // <Item ID>, <amount>, <chance> Apple, 10, 1000, Red_Potion, 5, 50, Orange_Potion, 4, 40, Yellow_Potion, 3, 30, White_Potion, 2, 20, Blue_Potion, 1, 10; setarray .itemshop, // Item sold in the shop // <Item ID>, <Lotti Points needed> Red_Potion, 100, Orange_Potion, 200, Yellow_Potion, 300, White_Potion, 400, Blue_Potion, 500; // ========================================================================================================= .size = getarraysize(.item); for ( .@i = 2; .@i < .size; .@i += 3 ) .totalchance += .item[.@i]; for ( .@i = 2; .@i < .size; .@i += 3 ) { .@chance = .item[.@i] *10000 / .totalchance; .@division = .@chance / 100; .@remainder$ = .@chance % 100; while ( getstrlen(.@remainder$) < 2 ) .@remainder$ = insertchar(.@remainder$, "0", 0); .chance_display$[.@i] = .@division +"."+ .@remainder$ +"%"; if ( .@division < .rare_announcement ) .announce[.@i] = true; } .shop_size = getarraysize(.itemshop); npcshopdelitem "Lotti#hidden", 512; for ( .@i = 0; .@i < .shop_size; .@i += 2 ) npcshopadditem "Lotti#hidden", .itemshop[.@i], .itemshop[.@i +1]; npcshopattach "Lotti#hidden"; .npcname$ = "["+ strnpcinfo(NPC_NAME) +"]"; end; L_talk: mes .npcname$; mes "Hello, do you want to play lottery ?"; next; switch( select( "Deal me in!", "More Information", "Lotti Shop", "Lotti Ranking" ) ) { mes .npcname$; case 1: mesf "It costs %dx %s to play.", .item[1], F_MesItemInfo( .item[0] ); if ( countitem( .item[0] ) < .item[1] ) close; next; if ( select( "Play", "Roll Repeatedly" ) == 1 ) { mes .npcname$; while ( true ) { mes "Here we go..."; mes " "; .@r = rand(.totalchance); for ( .@i = 2; ( .@r -= .item[.@i] ) >= 0; .@i += 3 ); if ( checkweight( .item[.@i -2], .item[.@i -1] ) == false ) { mes "It appears you have overweight"; break; } delitem .item[0], .item[1]; if ( .@i == 2 ) mes "You get nothing..."; else { mesf "You get %s%dx%s %s", F_MesColor(C_TEAL), .item[.@i -1], F_MesColor(C_BLACK), F_MesItemInfo(.item[.@i -2]); getitem .item[.@i -2], .item[.@i -1]; if ( .announce[.@i] ) announce sprintf( _$( "Lotti Girl: Player [%s] has roll on [%s](%s)" ), strcharinfo(0), getitemname(.item[.@i -2]), .chance_display$[.@i] ), bc_all, C_PINK; } lotti_points += .lotti_points; query_sql "insert into lotti_rank values ( "+ getcharid(CHAR_ID_CHAR) +", '"+ escape_sql( strcharinfo(PC_NAME) ) +"', "+ .lotti_points +" ) on duplicate key update lotti_point = lotti_point + "+ .lotti_points; mes " "; mes "wanna try again ?"; next; if ( select( "Yes", "No" ) == 2 ) break; mes .npcname$; if ( countitem( .item[0] ) < .item[1] ) { mes " "; mesf "It appears you have ran out of %s", F_MesItemInfo( .item[0] ); break; } } } else { mes .npcname$; mes "Input how many rounds to roll"; mesf "Currently you have %dx %s", countitem( .item[0] ), F_MesItemInfo( .item[0] ); next; input .@roll_input, 1, min( countitem( .item[0] ) / .item[1], .max_roll ); mes .npcname$; mesf "Are you sure you want to roll %d times ?", .@roll_input; next; if ( select( "Yes", "No" ) == 2 ) close; mes .npcname$; mes "Here we go..."; mes " "; // freeloop true; for ( .@j = 0; .@j < .@roll_input; ++.@j ) { .@r = rand(.totalchance); for ( .@i = 2; ( .@r -= .item[.@i] ) >= 0; .@i += 3 ); if ( checkweight( .item[.@i -2], .item[.@i -1] ) == false ) { mes "It appears you have overweight"; break; } delitem .item[0], .item[1]; if ( .@i == 2 ) mes "You get nothing..."; else { mesf "You get %s%dx%s %s", F_MesColor(C_TEAL), .item[.@i -1], F_MesColor(C_BLACK), F_MesItemInfo(.item[.@i -2]); getitem .item[.@i -2], .item[.@i -1]; if ( .announce[.@i] ) announce sprintf( _$( "Lotti Girl: Player [%s] has roll on [%s](%s)" ), strcharinfo(0), getitemname(.item[.@i -2]), .chance_display$[.@i] ), bc_all, C_PINK; } ++.@roll; sleep2 1; // prevent lag the server } lotti_points += .lotti_points * .@roll; query_sql "insert into lotti_rank values ( "+ getcharid(CHAR_ID_CHAR) +", '"+ escape_sql( strcharinfo(PC_NAME) ) +"', "+ .lotti_points +" ) on duplicate key update lotti_point = lotti_point + "+( .lotti_points * .@roll ); mesf "Total roll : %d times.", .@roll; } mes " "; mes "Thank you for using Lotti service~"; close; case 2: freeloop true; mesf "Item required: %s%dx%s %s", F_MesColor(C_TEAL), .item[1], F_MesColor(C_BLACK), F_MesItemInfo(.item[0]); if ( .item[2] ) mesf "Chance to gain nothing : %s%s%s", F_MesColor(C_CHOCOLATE), .chance_display$[2], F_MesColor(C_BLACK); mes "Possible gains:"; for ( .@i = 3; .@i < .size; .@i += 3 ) mesf "%s%dx%s %s (%s%s%s)", F_MesColor(C_TEAL), .item[.@i +1], F_MesColor(C_BLACK), F_MesItemInfo(.item[.@i]), F_MesColor(C_CHOCOLATE), .chance_display$[.@i +2], F_MesColor(C_BLACK); next; mes .npcname$; mesf "Each time you roll, will gain %d Lotti Points.", .lotti_points; mes "Which can be use to buy rare items in Lotti Shop."; close; case 3: mesf "You currently have %s Lotti Points.", lotti_points; dispbottom sprintf( _$("You currently have %s Lotti Points."), lotti_points ); close2; callshop "Lotti#hidden", 1; end; case 4: .@query$ = "SELECT `name`, IF(@d=t.`lotti_point`, @r, @r:=@i), @d:=t.`lotti_point`, @i:=@i+1 "; .@query$ += "FROM `lotti_rank` t, (SELECT @d:=0, @r:=0, @i:=1)q "; .@query$ += "ORDER BY `lotti_point` DESC LIMIT 5"; .@nb = query_sql(.@query$, .@name$, .@rank, .@points, .@dummy); if ( !.@nb ) { mes "There's no ranking yet ~"; close; } for ( .@i = 0; .@i < .@nb; ++.@i ) mesf "%d. %s%s %s%d%s Points", .@rank[.@i], F_MesColor(C_TEAL), .@name$[.@i], F_MesColor(C_CHOCOLATE), .@points[.@i], F_MesColor(C_BLACK); mes " "; if ( !query_sql( "SELECT `lotti_point`, 1+(SELECT COUNT(1) FROM `lotti_rank` t1 WHERE t1.lotti_point > t2.lotti_point) FROM `lotti_rank` t2 WHERE `char_id` = "+ getcharid(CHAR_ID_CHAR), .@points, .@rank ) ) { mes "You are not in the rank."; close; } mesf "Your current Point > %d", .@points; mesf "Your current Rank > %d", .@rank; close; } end; // shouldn't reach OnBuyItem: mes .npcname$; if ( !@bought_quantity ) end; if ( checkweight2( @bought_nameid, @bought_quantity ) == false ) { mes "It appears you can't carry them all"; close; } .@size = getarraysize( @bought_nameid ); for ( .@i = 0; .@i < .@size; .@i++ ) { for ( .@j = 0; .@j < .shop_size; .@j += 2 ) if ( @bought_nameid[.@i] == .itemshop[.@j] ) break; .@itemcost += .itemshop[.@j +1] * @bought_quantity[.@i]; } if ( .@itemcost > lotti_points ) { mes "You don't have enough Lotti Points"; close; } lotti_points -= .@itemcost; for ( .@i = 0; .@i < .@size; ++.@i ) getitem @bought_nameid[.@i], @bought_quantity[.@i]; deletearray @bought_nameid; deletearray @bought_quantity; mes "Thanks for buying ~"; close; } - shop Lotti#hidden -1,512:1000 how to work this on rathena? error on mesf lines
  21. prontera,157,180,5 script test item_reward#3 2_VENDING_MACHINE1,{ if ( !countitem(.itemuse) ) { mes "A "+ getitemname(.itemuse) +" is needed to use this machine"; close; } delitem .itemuse, 1; .@r = rand(.totalchance); for ( .@i = 0; ( .@r -= .itemchance[.@i] ) >= 0; ++.@i ); getitem .itemid[.@i], 1; end; OnInit: .itemuse = 7539; // poring coin setarray .itemid, 501,502,503,504,505,506,507,508,509; setarray .itemchance, 10,10,10,10,3,10,10,10,10; for ( .@i = 0; .itemid[.@i]; ++.@i ) .totalchance += .itemchance[.@i]; end; } btw this script is call "lotti girl" https://rathena.org/board/search/?&amp;q=lotti&amp;search_and_or=and&amp;sortby=relevancy a lot of results return from it
  22. @AnnieRuru i try on ramod i got error this https://imgur.com/a/jabaBAw so i try on latest Rathena First Problem i won the Gym Pass Box setarray .p2, 70, 13710,1; https://imgur.com/a/qsMjlDs the point should be Only 1 because on chance code setarray .chance, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1; setarray .points, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100; Lotti Shop if have 0 zeny even i have lotti points i cant buy items on shop https://imgur.com/a/kjp6uHr
  23. @AnnieRuru can you Add more ideas and Option Menu? switch(select("Play","Lotti Ranking","Lotti Shop")) Play Option Every Play of Lotti Girl you gain 1 Lotti Ladder Point and Lotti Shop Point Points System 10% = 10Points Lotti Ladder Points & Lotti Shop Points 9% = 20Points Lotti Ladder Points & Lotti Shop Points 8% = 30Points Lotti Ladder Points & Lotti Shop Points 7% = 40Points Lotti Ladder Points & Lotti Shop Points 6% = 50Points Lotti Ladder Points & Lotti Shop Points 5% = 60Points Lotti Ladder Points & Lotti Shop Points 4% = 70Points Lotti Ladder Points & Lotti Shop Points 3% = 80Points Lotti Ladder Points & Lotti Shop Points 2% = 90Points Lotti Ladder Points & Lotti Shop Points 1% = 100Points Lotti Ladder Points & Lotti Shop Points Lotti Ladder System 1 > Name > Lotti Ladder Points 2 > Name > Lotti Ladder Points 3 > Name > Lotti Ladder Points 4 > Name > Lotti Ladder Points 5 > Name > Lotti Ladder Points Lotti Shop Players can use there Lotti Shop Points to buy any items on Lotti Shop
  24. Hello Guys Lotti Girl NPC kindly Useful @ 255 Server Using This Script : and i want to add some ideas @AnnieRuru can you Add more ideas and Option Menu? switch(select("Play","Lotti Ranking","Lotti Shop")) Play Option Every Play of Lotti Girl you gain 1 Lotti Ladder Point and Lotti Shop Point Points System 10% = 10Points Lotti Ladder Points & Lotti Shop Points 9% = 20Points Lotti Ladder Points & Lotti Shop Points 8% = 30Points Lotti Ladder Points & Lotti Shop Points 7% = 40Points Lotti Ladder Points & Lotti Shop Points 6% = 50Points Lotti Ladder Points & Lotti Shop Points 5% = 60Points Lotti Ladder Points & Lotti Shop Points 4% = 70Points Lotti Ladder Points & Lotti Shop Points 3% = 80Points Lotti Ladder Points & Lotti Shop Points 2% = 90Points Lotti Ladder Points & Lotti Shop Points 1% = 100Points Lotti Ladder Points & Lotti Shop Points Lotti Ladder System 1 > Name > Lotti Ladder Points 2 > Name > Lotti Ladder Points 3 > Name > Lotti Ladder Points 4 > Name > Lotti Ladder Points 5 > Name > Lotti Ladder Points Lotti Shop Players can use there Lotti Shop Points to buy any items on Lotti Shop
  25. here's my script // http://rathena.org/board/topic/83017-pro-lotti-girl-refine-master/ prontera,164,164,3 script Lotti Girl 714,{ mes "[Lotti Girl]"; mes "Hello Sir! Are you out"; mes "shopping in the city?!"; next; mes "[Lotti Girl]"; mes "I'm Lotti! I'll exchange cool"; mes "random prizes for every"; mes "^ff00001 Lottery Ticket^000000."; next; mes "[Lotti Girl]"; mes "Our Grand prize is:"; mes "^ff0000Costume Kirin Wing^000000"; mes "Special prizes are:"; mes "^ff0000Costume Flying Angel Wing^000000"; mes "^ff0000____^000000"; mes "and ^ff0000____^000000"; next; mes "[Lotti Girl]"; mes "You can still get random item"; mes "if you failed to get the grand"; mes "prize and special prizes."; if (countitem(7528) < 1) close; next; if(Weight >= MaxWeight/2) goto Low; Low: mes "You are Overweight!"; close; next; if(select("Deal me in!:No way...")==2) close; mes "[Lotti Girl]"; mes "Here we go..."; delitem 7528,1; set .@Total,8; //<%>,<ItemID>,<Amount> setarray .@P1[0],0,8012,1; setarray .@P2[0],1,8011,1; setarray .@P3[0],5,8006,1; setarray .@P4[0],20,8010,1; setarray .@P5[0],90,13517,5; setarray .@P6[0],80,12080,10; setarray .@P7[0],90,30110,5; setarray .@P8[0],80,12075,10; setarray .@Default[0],30095,5; set .@i, rand(1,.@Total); if (rand(1,100) > getd(".@P"+.@i+"[0]")) { for(set .@j,0; .@j<getarraysize(.@Default); set .@j,.@j+2) { getitem .@Default[.@j], .@Default[.@j+1]; if(!.@k[0]) setarray .@k[0], .@Default[.@j], .@Default[.@j+1]; } } else{ for(set .@j,1; .@j<getarraysize(getd(".@P"+.@i)); set .@j,.@j+2) { getitem getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]"); if (!.@k[0]) { set .@gz,.@i; setarray .@k[0], getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]"); break; } } } if(1<=.@gz&&.@gz<=4) announce "Congratulations! "+strcharinfo(0)+" just received "+getitemname(.@k[0])+" x "+.@k[1]+" from Lotti Girl (prontera 139 173)!",0; specialeffect2 248; close; OnInit: waitingroom "[Lotti Girl]",0; } }
×
×
  • Create New...