Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/20/23 in Posts

  1. file generator needed to implement custom item on the server, in addition to having a custom renaming system by AI. Shows how to add a custom item in a quick and practical way, without the need to insert it file by file sistema.mp4
    1 point
  2. Fix both char right now show their dice //===== rAthena Script ======================================= //= Dicebet Gambling //===== By: ================================================== //= Technoken //= LearningRO //===== Current Version: ===================================== //= 1.2 //===== Features: ============================================ //= Gamble with other players using dicebet. //= This idea came from GTA Samp gamble system //= New atcommands: //= @dicebet <opponent name> <amount to bet> //= - sends a dicebet invitation to another player //= @acceptdb - accepts the dicebet invitation //= @declinedb - declines the dicebet invitation //= @resetdb - resets the dicebet invitation //===== Features: ============================================ // //= THIS IS A FREE SCRIPT // //===== Change Logs: ========================================= //= 1.0 First version. //= 1.1 Updated script to work on rAthena Hash ea88ea5 //= 1.2 Both Char right now show their own DICE! //============================================================ - script DicebetGambling -1,{ OnInit: .MinBet = 1; // Minimum amount to bet .MaxBet = 500000000; // Maximum amount to bet NOTE: If you increase it by 500m, make sure that max zeny allowed per char is > 1b bindatcmd("dicebet","DicebetGambling::OnAtcommandDicebet",0,99); bindatcmd("acceptdb","DicebetGambling::OnAtcommandAcceptDB",0,99); bindatcmd("declinedb","DicebetGambling::OnAtcommandDeclineDB",0,99); bindatcmd("resetdb","DicebetGambling::OnAtcommandResetDB",0,99); end; OnAtcommandDicebet: if( .@atcmd_numparameters < 2 ) { message strcharinfo(0),"Silakan memasukan format yang benar (format: @dicebet <nama player> <jumlah taruhan>)"; message strcharinfo(0),"@dicebet gagal."; end; } .@tmp$ = implode(.@atcmd_parameters$," "); .@eil = getstrlen(.@atcmd_parameters$[.@atcmd_numparameters-1]) + 1; .@charName$ = substr(.@tmp$, 0, (getstrlen(.@tmp$) - .@eil) - 1); @oppRID = getcharid(3,.@charName$); @oppCID = getcharid(0,.@charName$); setd "$var$",strcharinfo(0); if( !isloggedin(@oppRID,@oppCID) ) { message strcharinfo(0),"Nama Karakter tidak ditemukan."; message strcharinfo(0),"Karakter sedang offline atau tidak ada."; message strcharinfo(0),"@dicebet gagal."; end; } if( @oppRID == getcharid(3) ) { message strcharinfo(0),"Kamu tidak dapat mengajak dirimu bertaruh."; message strcharinfo(0),"@dicebet gagal."; end; } if( @onbet || @diceDealerCID ) { // Prevents from offering another one message strcharinfo(0),"1x taruhan dalam sekali."; message strcharinfo(0),"@dicebet gagal."; end; } getmapxy(.@map$,.@x,.@y,BL_PC); getmapxy(.@map1$,.@x1,.@y1,BL_PC,rid2name(@oppRID)); if( distance( .@x, .@y, .@x1, .@y1 ) > 3 ) { // 3 cells distance message strcharinfo(0),"You must be near to your opponent."; message strcharinfo(0),"@dicebet failed."; end; } .@oppInviter = getvar(@onbet,@oppCID); // Opponent already invite someone .@oppInvited = getvar(@diceDealerCID,@oppCID); // Opponent is already invited by someone if( .@oppInviter || .@oppInvited ) { // Prevents from dealing inviters and someone whos already on a bet message strcharinfo(0),.@charName$+" sedang bertaruh dengan yang lain."; message strcharinfo(0),"@dicebet failed."; end; } .@bet = .@atcmd_parameters$[.@atcmd_numparameters-1]; if( .@bet > .MaxBet || .@bet < .MinBet ) { message strcharinfo(0),"Minimum Taruhan: "+.MinBet+"z"; message strcharinfo(0),"Maximum Taruhan: "+.MaxBet+"z"; message strcharinfo(0),"@dicebet gagal."; end; } // Checks if the opponent has right amount of zeny to bet .@oppZeny = readparam(Zeny,@oppCID); if( .@oppZeny < .@bet ) { message strcharinfo(0),"Lawanmu tidak memiliki cukup zeny."; message strcharinfo(0),"@dicebet gagal."; end; } if( Zeny < .@bet ) { message strcharinfo(0),"Kamu tidak memiliki cukup zeny untuk bertaruh."; message strcharinfo(0),"@dicebet gagal."; end; } set(@dicebet,.@bet,@oppCID); // Sets the bet set(@diceDealerCID,getcharid(0),@oppCID); // Sets who's the dealer set(@diceDealerRID,getcharid(3),@oppCID); @onbet = 1; // Sets to 1 when the player already dicebet someone dispbottom "Kamu telah mengajak "+rid2name(@oppRID)+" taruhan sebesar "+.@bet+"z.",0x63D1F4; dispbottom strcharinfo(0)+" telah menawarkan taruhan sebesar "+.@bet+"z. Apakah kamu ingin menerima ? (Gunakan @acceptdb/@declinedb)",0x63D1F4,@oppCID; end; OnAtcommandAcceptDB: if( @rolling ) { message strcharinfo(0),"Kamu sedang memutar dice"; message strcharinfo(0),"@acceptdb gagal."; end; } if( !@diceDealerCID ) { message strcharinfo(0),"Tidak ada yang mengajak kamu bertaruh."; message strcharinfo(0),"@acceptdb gagal."; end; } if( .@atcmd_numparameters != 0 ) { message strcharinfo(0),"Silakan memasukan format yang benar (format: @acceptdb)"; message strcharinfo(0),"@acceptdb gagal."; end; } if( !isloggedin(@diceDealerRID,@diceDealerCID) ) { message strcharinfo(0),"Lawanmu telah offline."; message strcharinfo(0),"@acceptdb gagal."; goto D_Reset; end; } if( Zeny < @dicebet ) { message strcharinfo(0),"Kamu tidak memiliki cukup zeny untuk menerima taruhan."; message strcharinfo(0),"@acceptdb gagal."; end; } .@oppZeny = readparam(Zeny,@diceDealerCID); // Checks if the opponent still has the zeny that he bet if( .@oppZeny < @dicebet ) { message strcharinfo(0),"Lawanmu tidak memiliki cukup zeny untuk bertaruh."; message strcharinfo(0),"@dicebet gagal."; end; } getmapxy(.@map$,.@x,.@y,BL_PC); getmapxy(.@map1$,.@x1,.@y1,BL_PC,rid2name(@diceDealerRID)); if( distance( .@x, .@y, .@x1, .@y1 ) > 3 ) { message strcharinfo(0),"Kamu harus dekat dengan lawan."; message strcharinfo(0),"@acceptdb gagal."; end; } getmapxy(.@map$,.@x,.@y,BL_PC); .@bet = @dicebet; .@ownRID = getattachedrid(); .@diceDealerRID = @diceDealerRID; @rolling = 1; dispbottom strcharinfo(0)+" menerima taruhan sebesar "+@dicebet+"z.",0x63D1F4,@diceDealerCID; setarray .@dice[1],ET_DICE1,ET_DICE2,ET_DICE3,ET_DICE4,ET_DICE5,ET_DICE6; .@rand = rand(1,6); emotion .@dice[.@rand],strcharinfo(0); detachrid; attachrid(.@diceDealerRID); .@rand1 = rand(1,6); emotion .@dice[.@rand1],.@diceDealerRID; detachrid; attachrid(.@ownRID); sleep2 1200; if( !isloggedin(@diceDealerRID) || !@diceDealerCID ) { // Checks if the inviter logged out dispbottom strcharinfo(0,@diceDealerCID)+" logout dan batalkan taruhan.",0x63D1F4; goto D_Reset; end; } //.@diceDealerRID = @diceDealerRID; while( .@i < 2 ) { // Checks Zeny again if( Zeny < .@bet ) { areaannounce .@map$,.@x-3,.@y-3,.@x+3,.@y+3,"Taruhan telah dibatalkan karena zeny "+strcharinfo(0)+" telah habis !",0,0x63D1F4; .@t++; } detachrid; if( .@i == 0 ) attachrid(.@diceDealerRID); else attachrid(.@ownRID); .@i++; } if( !.@t ) { areaannounce .@map$,.@x-3,.@y-3,.@x+3,.@y+3,"* * "+strcharinfo(0,@diceDealerCID)+" memutar dice dan mendapatkan angka "+.@rand1+" * *",0,0x63D1F4; areaannounce .@map$,.@x-3,.@y-3,.@x+3,.@y+3,"* * "+strcharinfo(0)+" memutar dice dan mendapatkan angka "+.@rand+" * *",0,0x63D1F4; if( .@rand == .@rand1 ) // Both dice lands on same number areaannounce .@map$,.@x-3,.@y-3,.@x+3,.@y+3,"Tidak ada yg memenangkan "+.@bet+"z karena draw.",0,0x63D1F4; else { if( .@rand > .@rand1 ) { // I WON Zeny += .@bet; .@winner$ = strcharinfo(0); detachrid; attachrid(.@diceDealerRID); Zeny -= .@bet; } else { // I LOSE Zeny -= .@bet; detachrid; attachrid(.@diceDealerRID); .@winner$ = strcharinfo(0); Zeny += .@bet; } detachrid; attachrid(.@ownRID); areaannounce .@map$,.@x-3,.@y-3,.@x+3,.@y+3,.@winner$+" telah memenangkan taruhan sebesar "+.@bet+"z.",0,0x63D1F4; } } set(@onbet,0,@diceDealerCID); goto D_Reset; end; OnAtcommandDeclineDB: if( @rolling ) { message strcharinfo(0),"Kamu sedang memutar dice."; message strcharinfo(0),"@declinedb gagal."; end; } if( .@atcmd_numparameters != 0 ) { message strcharinfo(0),"Silakan memasukan format yang benar (format: @declinedb)"; message strcharinfo(0),"@declinedb gagal."; end; } if( !@diceDealerCID ) { message strcharinfo(0),"Tidak ada yang mengajak kamu bertaruh."; message strcharinfo(0),"@declinedb gagal."; end; } dispbottom "Taruhan telah ditolak.",0x63D1F4; dispbottom strcharinfo(0)+" menolak untuk bertaruh.",0x63D1F4,@diceDealerCID; set(@onbet,0,@diceDealerCID); goto D_Reset; end; OnAtcommandResetDB: if( @oppCID ) .@rolling = getvar(@rolling,@oppCID); else .@rolling = 0; if( .@rolling ) { message strcharinfo(0),"Kamu sedang memutar dice."; message strcharinfo(0),"@resetdb gagal."; end; } if( !@onbet ) { message strcharinfo(0),"Kamu tidak memiliki undangan yang tertunda."; message strcharinfo(0),"@resetdb gagal."; end; } @onbet = 0; dispbottom "Undangan yang tertunda telah direset."; detachrid; attachrid(@oppRID); dispbottom "Pending dicebet invitation has been cancelled."; goto D_Reset; end; OnPCLogoutEvent: if( @onbet ) { detachrid; attachrid(@oppRID); goto D_Reset; } if( @diceDealerCID ) { // When the one who use @acceptdb logged out dispbottom strcharinfo(0)+" logged out and cancels the dice bet.",0x63D1F4,@diceDealerCID; set(@onbet,0,@diceDealerCID); } end; D_Reset: @dicebet = 0; @diceDealerCID = 0; @diceDealerRID = 0; @rolling = 0; end; }
    1 point
×
×
  • Create New...