Jump to content
  • 1

Rolling in the deep


Radian

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Hey guys how's it going? 

I just want to request a script that works like this.

  1. Player talk to the npc give a specific item.
  2. Player select how much is the fee and how many people can join.
  3. Verify the owner if he wants to continue or check if everything is correct.
  4. Announce to everyone that "Player1" is having a raffle for 1 coin per entry only 10 people can join. The item is Very Very Very Strong Angra Manyu !!
  5. When 10 people paid the amount of coin npc will start by rolling 3 times and in the last round the player that has been selected will be the winner. (send the item via mail)
  6. When raffle is done and everything is complete. all of the coins will be sent to "Player1" via mail. (to prevent issue like: over weight)

I think that's everything. Willing to pay if need but released it on public and I'll send you the payment for it.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  


/* can only bet these item types
- `IT_WEAPON`: 4
- `IT_ARMOR`: 5
- `IT_CARD`: 6
- `IT_PETEGG`: 7
- `IT_PETARMOR`: 8
*/
prontera,155,185,5	script	sfksfjhsfj	1_F_MARIA,{
	if ( .start == 1 ) goto L_StartEvent; // goto is evil, but it actually helps make script higher readability
	else if ( .start == 2 ) {
		mes "Currently rolling dice ... please be patient";
		close;
	}
	mes "select an item from your inventory to bet";
	next;
	getinventorylist;
	for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) {
		if ( @inventorylist_equip[.@i] == 0 && @inventorylist_identify[.@i] == true && @inventorylist_attribute[.@i] == false && @inventorylist_expire[.@i] == 0 && @inventorylist_bound[.@i] == BOUND_NONE && ( getiteminfo( @inventorylist_id[.@i], 2 ) == IT_WEAPON || getiteminfo( @inventorylist_id[.@i], 2 ) == IT_ARMOR || getiteminfo( @inventorylist_id[.@i], 2 ) == IT_CARD || getiteminfo( @inventorylist_id[.@i], 2 ) == IT_PETEGG || getiteminfo( @inventorylist_id[.@i], 2 ) == IT_PETARMOR ) ) {
			.@itemname$ = callfunc( "getitemname2", @inventorylist_id[.@i], @inventorylist_identify, @inventorylist_refine, @inventorylist_attribute, @inventorylist_card1, @inventorylist_card2, @inventorylist_card3, @inventorylist_card4 );
			.@menu$ = .@menu$ + @itemname2_info$ + .@itemname$ +"; "+ @inventorylist_amount[.@i] +" ea.:";
			.@id[.@c] = @inventorylist_id[.@i];
			.@refine[.@c] = @inventorylist_refine[.@i];
			.@card1[.@c] = @inventorylist_card1[.@i];
			.@card2[.@c] = @inventorylist_card2[.@i];
			.@card3[.@c] = @inventorylist_card3[.@i];
			.@card4[.@c] = @inventorylist_card4[.@i];
			++.@c;
		}
	}
	if ( !.@c ) {
		mes "you don't have anything useful to bet !";
		close;
	}
	.@s = select(.@menu$) -1;
	.@id = .@id[.@s];
	.@refine = .@refine[.@s];
	.@card1 = .@card1[.@s];
	.@card2 = .@card2[.@s];
	.@card3 = .@card3[.@s];
	.@card4 = .@card4[.@s];
	.@itemname$ = callfunc( "getitemname2", .@id, 1, .@refine, 0, .@card1, .@card2, .@card3, .@card4 );
	mes "Are you sure you want to auction your";
	mes .@itemname$ +" away ?";
	next;
	if ( select( "Yes", "No" ) == 2 ) close;
	mes "select the amount of "+ getitemname( .currency ) +" for the player to bet";
	next;
	if ( input( .@amount, 1, 30000 ) ) {
		mes "you have input invalid value";
		close;
	}
	mes "Confirm ?";
	mes .@itemname$;
	mes .@amount +"x "+ getitemname( .currency );
	if ( select ( "Yes", "No" ) == 2 ) close;
	close2;
	if ( !countitem2( .@id, 1, .@refine, 0, .@card1, .@card2, .@card3, .@card4 ) ) {
		dispbottom "please don't hack";
		end;
	}
	if ( .start != 0 ) {
		dispbottom "Too slow, somebody make it faster than you";
		end;
	}
	announce strcharinfo(0) +" is trying to auction "+ .@itemname$ +" !!", bc_all;
	delitem2 .@id, 1, 1, .@refine, 0, .@card1, .@card2, .@card3, .@card4;
	.id = .@id;
	.refine = .@refine;
	.card1 = .@card1;
	.card2 = .@card2;
	.card3 = .@card3;
	.card4 = .@card4;
	.aid = getcharid(3);
	.cid = getcharid(0);
	.amount = .@amount;
	.itemname$ = .@itemname$;
	.start = true;
	initnpctimer;
	end;
L_StartEvent:
	mes "Currently there are "+ .total_bet +" players betting.";
	for ( .@i = 0; .@i < .total_bet; ++.@i )
		mes ( .@i +1 )+". "+ rid2name(.bet_aid[.@i]);
	next;
	if ( getcharid(3) == .aid ) {
		mes "You are the one who placed this bet";
		close;
	}
	if ( .total_bet >= .register_limit ) {
		mes "only accept 10 maximum bets";
		close;
	}
	.@i = 0;
	while ( .bet_aid[.@i] != getcharid(3) && .@i < .total_bet ) ++.@i;
	if ( .@i < .total_bet ) {
		mes "You already placed the bet";
		close;
	}
	mes "Are you sure you want bet";
	mes .amount +"x "+ getitemname( .currency ) +" for ";
	mes .itemname$ +" ?";
	next;
	if ( select ( "Yes", "No" ) == 2 ) close;
	if ( countitem( .currency ) < .amount ) {
		mes "the minimum bet is "+ .amount +"x "+ getitemname( .currency );
		close;
	}
	if ( .start != 1 ) {
		mes "Too late";
		close;
	}
	delitem .currency, .amount;
	announce strcharinfo(0) +" has placed "+( ( Sex )? "his":"her" )+" bet for "+ .itemname$, bc_npc|bc_area;
	.bet_aid[.total_bet] = getcharid(3);
	.bet_cid[.total_bet] = getcharid(0);
	++.total_bet;
	close;
OnTimer15000: // 15 seconds
	stopnpctimer;
	.start = 2;
	announce "betting is now close. Start counting now", bc_npc|bc_area;
	sleep 1000;
	announce "There are "+ .total_bet +" players bet on "+ .itemname$, bc_npc|bc_area;
	sleep 1000;
	.@amount = 1; // this stupid mail system ...
	.@zeny = 0;
	.@give_amount = .amount * .total_bet; // why do I have to make these stupid variables ??
	if ( !.total_bet ) {
		announce "this auction has failed because nobody is joining", bc_npc|bc_area;
		mail .cid, "Rolling in the Deep", "Prize", "Nobody bet on your item, you get a refund", .@zeny, .id, .@amount, .card1, .card2, .card3, .card4;
	}
	else {
		.@r = rand(.total_bet);
		announce "The winner is "+ rid2name(.bet_aid[.@r]) +" !!", bc_npc|bc_area;
		mail .bet_cid[.@r], "Rolling in the Deep", "Prize", "This is your prize.", .@zeny, .id, .@amount, .card1, .card2, .card3, .card4;
		mail .cid, "Rolling in the Deep", "Prize", "There were "+ .total_bet +" players bet on your item.", .@zeny, .currency, .@give_amount;
	}
	.start = false;
	.id = 0;
	.refine = 0;
	.card1 = 0;
	.card2 = 0;
	.card3 = 0;
	.card4 = 0;
	.aid = 0;
	.amount = 0;
	.itemname$ = "";
	deletearray .bet_aid;
	deletearray .bet_cid;
	.total_bet = 0;
	end;
OnInit:
	.currency = 7539; // Poring_Coin
	.register_limit = 10; // only 10 people can join
	end;
}

 

LOL when I saw n0ttt post came out I was like ... WAH~~
somebody can actually finish script faster than me @_@

 

EDIT: forgot to tell the getitemname2 function, not from this topic ... 2.3
but from hercules ones
, 2.4
https://herc.ws/board/topic/11275-getitemname2/

rathena one is version 2.3 made on 2013
hercules has version 2.4 made on 2015

 

EDIT2: Radian say cannot bet equipped items, so just add @inventorylist_equip check

Edited by AnnieRuru
  • Upvote 1
  • Love 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

I don't know if I undertstood well and I don't know if this will work (can't test)

prontera,150,150,4	script	Rolling in the Deep	100,{

	if(!.status) {
		if(countitem(.item_id)) {
			disable_items;
			while(true) {
				clear;
				mes "What do you want to do?";
				.@s = select("Set fee "+max(1,.@option[0])+"z","Set amount of players "+max(5,.@option[1]),"Ready") - 1;
				if(.@s < 2) {
					input .@option[.@s];
				} else {
					mes "Do you want to continue or check if everything is correct?";
					if(select("Check if everything is correct","Continue") == 2) {
						.fee = max(1,.@option[0]);	// default 1 fee.
						.players = max(5,.@option[1]);	// default 5 players.
						.status = true;
						.player_aid[0] = getcharid(3);
						.o_player = getcharid(0);
						delitem .item_id,1;
						break;
					}
				}
			}
			announce strcharinfo(0)+" is having a raffle for "+.fee+" coin per entry only "+.players+" people can join.",bc_all;
			stopnpctimer;
			initnpctimer;
			close;
		} else {
			mes "You need "+getitemname(.item_id)+" to talk to me.";
		}
	} else if(!.rolling) {
		if(.player_n < .players) {
			if(countitem(.coin_id) >= .fee) {
				.@i = inarray(.player_aid,getcharid(3));
				if(.@i == -1) {
					mes "Do you want to join this game? Fee: "+.fee+" coins.";
					if(select("No","Yes") == 2) {
						if(countitem(.coin_id) >= .fee) {
							delitem .coin_id,.fee;
							.player_aid[++.player_n] = getcharid(3);
							.player_cid[.player_n - 1] = getcharid(0);
							if(.player_n >= .players)
								donpcevent strnpcinfo(0)+"::OnSpin";
						}
					}
				} else {
					mes "You're already participating. Wait for the event to start.";
				}
			} else {
				mes "You need "+.fee+" coins to join this game.";
			}
		} else {
			mes "Everyone is registered.";
		}
	} else if(.rolling) {
		mes "The game is spinning right now. Pay attention.";
	}
	close;

OnSpin:

	stopnpctimer;
	// We delete the player who started the event (we had him in the array to avoid joining him).
	deletearray .player_aid[0],1;
	.player_n--;
	while(.@rolls < 3) {
		mapannounce "prontera","Roll n°"+(.@rolls + 1)+".",bc_map;
		sleep 2000;
		specialeffect2 F_Rand(EF_SPINMOVE,EF_CASTSPIN2);
		sleep 2000;
		.@r = rand(.player_n--);
		if(.@rolls == 2) {
			mapannounce "prontera","And the winner is...",bc_map;
			sleep 2500;
		}
		mapannounce "prontera",rid2name(.player_aid[.@r])+"...",bc_map;
		deletearray .player_aid[.@r],1;
		if(.@rolls < 2)
			sleep 5000;
		.@rolls++;
	}
	mail .player_cid[.@r],"Rolling in the Deep","Prize","Here's your prize from the game",0,.prize_id,.prize_amt;
	setarray .@item_id[0],.coin_id;
	setarray .@item_amt[0],.players * .fee;
	mail .o_player,"Rolling in the Deep","Coins","Here's the coins",0,.@item_id,.@item_amt;

	// if 10 mins and nobody started the event.
OnTimer600000:
	stopnpctimer;
	// we try to give the items back in this situation.
	if(!.@rolls) {
		if(isloggedin(.player_aid[0],.o_player))
			getitem .item_id,1,.o_player;
	}
	.players_n = 0;
	.o_player = 0;
	deletearray .player_aid;
	deletearray .player_cid;
	.status = false;
	.rolling = false;
	end;

OnInit:

	.item_id = 512;		// item required to start.
	.coin_id = 7539;	// coin id.

	// Prizes for the winner
	setarray .prize_id[0],513;
	setarray .prize_amt[0],5;
	end;

}

 

  • Love 3
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

I've tested the script it works but on the players point of view that wants to make a new raffle. they'll need to select an item from their own inventory.

Nvm, works perfectly now.
 

Edited by Radian
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Annie put that one faster. Well, I put my version (not tested, again: I don't have a test server). This one supports random option and has a sell window (if it works, of course).

I grabbed the getitemname2 function by AnnieRuru and F_RandOptDist by Stolao. Credits.

//===== Hercules Script =====================================
//= [Function] getitemname2
//===== By: =================================================
//= AnnieRuru
//===== Current Version: ====================================
//= 2.4
//===== Compatible With: ====================================
//= hercules 2015-11-27
//===== Description: ========================================
//= custom function to show item names just like in game
//===== Topic: ==============================================
//= http://herc.ws/board/topic/11275-getitemname2/
//===== Additional Comments: ================================
//= callfunc( "getitemname2", ItemID, Identify, Refine, Broken, Card1, Card2, Card3, Card4 {, Bound } )
//= it also creates a player array : @itemname2_info$
//= [0] = color
//=     ^000000 (black)  = normal equipment/items
//=     ^999999 (gray)   = unidentify equipment
//=     ^FF0000 (red)    = broken equipment
//=     ^66CC00 (green)  = enchanted equipment (1)
//=     ^0066CC (blue)   = enchanted equipment (2)
//=     ^CC6600 (brown)  = enchanted equipment (3)
//=     ^CC44CC (purple) = enchanted equipment (4)
//=     ^CCCC00 (yellow) = bounded equipment
//= [1] = ID information
//=     Equipment = Char ID
//=     Pet egg = Pet ID
//= [2] = return full item name if unidentified ( used in unidentified items only )
//= [3] = amount of star crumb used, return in number ( used in crafted item only )
//= [4] = weapon element, return in string ( used in crafted item only )
//= [5] = bound type, return in string
//===========================================================
function	script	getitemname2	{
	freeloop true;
	deletearray @itemname2_info$;
	.@id = getarg(0);
	.@type = getiteminfo( .@id, 2 );
	.@refine = getarg(2);
	.@card[0] = getarg(4);
	.@card[1] = getarg(5);
	.@card[2] = getarg(6);
	.@card[3] = getarg(7);
	.@bound = getarg(8,0);
	.@ref$ = ( .@refine )? "+"+ .@refine +" " : "" ; // I think no need refinement check for type 4 or 5, the source automatically convert refined etc items into no refinement
	.@slots$ = ( .@slot = getitemslots( .@id ) )? " ["+ .@slot +"]" : "" ;

	if ( .@bound ) {
		@itemname2_info$[0] = "^CCAA00"; // this condition always get overwritten ...
		if ( .@bound == 1 ) @itemname2_info$[5] = "Account";
		else if ( .@bound == 2 ) @itemname2_info$[5] = "Guild";
		else if ( .@bound == 3 ) @itemname2_info$[5] = "Party";
		else if ( .@bound == 4 ) @itemname2_info$[5] = "Character";
	}

	if ( .@type != IT_WEAPON && .@type != IT_ARMOR && .@card[0] != 254 ) { // non-equipable item that isn't signed
		.@pid = .@card[1] + ( ( .@card[1] >= 0 )? 0 : 1 << 16 ) + .@card[2] * ( 1 << 16 );
		@itemname2_info$[1] = ( .@pid )? .@pid : "";
		.@return$ = getitemname( .@id );
	}
	else if ( ( .@type == IT_WEAPON || .@type == IT_ARMOR ) && !.@card[0] && !.@card[1] && !.@card[2] && !.@card[3] ) // equipment with no card, for reduce gotocount
		.@return$ = .@ref$ + getitemname( .@id ) + .@slots$;
	else if ( ( .@type == IT_WEAPON || .@type == IT_ARMOR ) && ( .@card[0] || .@card[1] || .@card[2] || .@card[3] ) && .@card[0] != 254 && .@card[0] != 255 ) { // equipment that has cards, but not a signed item
		.@string$ = "#"+ .@card[0] +"##"+ .@card[1] +"##"+ .@card[2] +"##"+ .@card[3] +"#";
		.@i = 0;
		while ( .@i < 4 ) {
			if ( !compare( .@counted$, "#"+ .@card[.@i] +"#" ) ) {
				.@cnt[.@i] = countstr( .@string$, "#"+ .@card[.@i] +"#" );
				.@counted$ = .@counted$ +"#"+ .@card[.@i] +"#";
			}
			if ( getstrlen( $@cardprefix$[.@card[.@i]] ) && .@cnt[.@i] ) {
				if ( .@cnt[.@i] == 2 )
					.@cnt$[.@i] = "Double";
				else if ( .@cnt[.@i] == 3 )
					.@cnt$[.@i] = "Triple";
				else if ( .@cnt[.@i] == 4 )
					.@cnt$[.@i] = "Quadruple";
				if ( !compare( $@cardprefix$[.@card[.@i]], "of " ) )
					.@prefix$ = .@prefix$ + .@cnt$[.@i] +( ( getstrlen(.@cnt$[.@i]) )? " ": "" )+ $@cardprefix$[.@card[.@i]] +" ";
				else
					.@postfix$ = .@postfix$ +" "+ $@cardprefix$[.@card[.@i]] +( ( getstrlen(.@cnt$[.@i]) )? " ": "" )+ .@cnt$[.@i];
			}
			.@enchant = .@enchant + ( .@card[.@i] && .@i >= .@slot && ( .@card[.@i] /100 ) != 47 && ( .@card[.@i] /100 ) != 48 );
			.@i++;
		}
		if ( .@enchant == 1 )
			@itemname2_info$[0] = "^66CC00";
		else if ( .@enchant == 2 )
			@itemname2_info$[0] = "^0066CC";
		else if ( .@enchant == 3 )
			@itemname2_info$[0] = "^CC6600";
		else if ( .@enchant == 4 )
			@itemname2_info$[0] = "^CC44CC";
		.@return$ = .@ref$ + .@prefix$ + getitemname( .@id ) + .@postfix$ + .@slots$;
	}
	else if ( .@card[0] == 254 || .@card[0] == 255 ) { // signed items
		.@cid = @itemname2_info$[1] = .@card[2] + ( ( .@card[2] >= 0 )? 0 : 1 << 16 ) + .@card[3] * ( 1 << 16 );
		if ( !query_sql("select name from `char` where char_id = "+ .@cid, .@name$) )
			.@name$ = "Unknown";
		.@sc = .@card[1] / 10;
		if ( .@sc == 128 ) {
			.@sc$ = "Very Strong ";
			@itemname2_info$[3] = "1";
		}
		else if ( .@sc == 256 ) {
			.@sc$ = "Very Very Strong ";
			@itemname2_info$[3] = "2";
		}
		else if ( .@sc == 384 ) {
			.@sc$ = "Very Very Very Strong ";
			@itemname2_info$[3] = "3";
		}
		.@ele = .@card[1] % 10;
		if ( .@ele == 1 )
			.@ele$ = @itemname2_info$[4] = "Ice ";
		else if ( .@ele == 2 )
			.@ele$ = @itemname2_info$[4] = "Earth ";
		else if ( .@ele == 3 )
			.@ele$ = @itemname2_info$[4] = "Fire ";
		else if ( .@ele == 4 )
			.@ele$ = @itemname2_info$[4] = "Wind ";
		.@return$ = .@ref$ + .@sc$ + .@name$ +"'s "+ .@ele$ + getitemname( .@id );
	}

//	else if ( getarg(3) ) // broken equipment ... seems no longer show red
//		@itemname2_info$[0] = "^FF0000";

	if ( !getstrlen( @itemname2_info$[0] ) )
		@itemname2_info$[0] = "^000000";

	return .@return$;
}

-	script	itemname2_prefix	-1,{
OnInit:
	$@cardprefix$[4001] = "Lucky";
	$@cardprefix$[4002] = "Vital";
	$@cardprefix$[4003] = "Hard";
	$@cardprefix$[4004] = "Dexterous";
	$@cardprefix$[4005] = "Hallowed";
	$@cardprefix$[4006] = "Lucky";
	$@cardprefix$[4007] = "Beholder";
	$@cardprefix$[4008] = "Extra";
	$@cardprefix$[4009] = "Light";
	$@cardprefix$[4010] = "Wise";
	$@cardprefix$[4011] = "Dynamic";
	$@cardprefix$[4012] = "Rigid";
	$@cardprefix$[4013] = "Excellent";
	$@cardprefix$[4014] = "of Champion";
	$@cardprefix$[4015] = "Quick";
	$@cardprefix$[4016] = "Speedy";
	$@cardprefix$[4017] = "Stun";
	$@cardprefix$[4018] = "Smart";
	$@cardprefix$[4019] = "Martyr";
	$@cardprefix$[4020] = "Blink";
	$@cardprefix$[4021] = "Skillful";
	$@cardprefix$[4022] = "of Spore";
	$@cardprefix$[4023] = "of Desert";
	$@cardprefix$[4024] = "Drowsy";
	$@cardprefix$[4025] = "Keen";
	$@cardprefix$[4026] = "Shrewd";
	$@cardprefix$[4027] = "Athletic";
	$@cardprefix$[4028] = "Double-forced";
	$@cardprefix$[4029] = "Wolverine";
	$@cardprefix$[4030] = "Windy";
	$@cardprefix$[4031] = "of Ares";
	$@cardprefix$[4032] = "of Athena";
	$@cardprefix$[4033] = "Detoxication";
	$@cardprefix$[4034] = "Clever";
	$@cardprefix$[4035] = "Bloody";
	$@cardprefix$[4036] = "Robust";
	$@cardprefix$[4037] = "Untouchable";
	$@cardprefix$[4038] = "of Health";
	$@cardprefix$[4039] = "of Aristotle";
	$@cardprefix$[4040] = "Teleport";
	$@cardprefix$[4041] = "of Sandman";
	$@cardprefix$[4042] = "of Heman";
	$@cardprefix$[4043] = "Hurricane";
	$@cardprefix$[4044] = "Hiding";
	$@cardprefix$[4045] = "Heavy";
	$@cardprefix$[4046] = "of Cleric";
	$@cardprefix$[4047] = "Ghost";
	$@cardprefix$[4048] = "Poison";
	$@cardprefix$[4049] = "Flammable";
	$@cardprefix$[4050] = "of Hermes";
	$@cardprefix$[4051] = "of Flash";
	$@cardprefix$[4052] = "Erudite";
	$@cardprefix$[4053] = "Healing";
	$@cardprefix$[4054] = "Holy";
	$@cardprefix$[4055] = "Ice";
	$@cardprefix$[4056] = "of Warmth";
	$@cardprefix$[4057] = "Silence";
	$@cardprefix$[4058] = "Cranial";
	$@cardprefix$[4059] = "of Cadi";
	$@cardprefix$[4060] = "Clamorous";
	$@cardprefix$[4061] = "Immortal";
	$@cardprefix$[4062] = "Envenom";
	$@cardprefix$[4063] = "Insecticide";
	$@cardprefix$[4064] = "Nimble";
	$@cardprefix$[4065] = "Underneath";
	$@cardprefix$[4066] = "Brutal";
	$@cardprefix$[4067] = "Atomic";
	$@cardprefix$[4068] = "Chemical";
	$@cardprefix$[4069] = "Saharic";
	$@cardprefix$[4070] = "of Witch";
	$@cardprefix$[4071] = "Angelic";
	$@cardprefix$[4072] = "Solid";
	$@cardprefix$[4073] = "Discount";
	$@cardprefix$[4074] = "of Gargantua";
	$@cardprefix$[4075] = "Hypnotic";
	$@cardprefix$[4076] = "Cursing";
	$@cardprefix$[4077] = "Under a Cast";
	$@cardprefix$[4078] = "of Recovery";
	$@cardprefix$[4079] = "of Muscle";
	$@cardprefix$[4080] = "Fisher";
	$@cardprefix$[4081] = "Glorious";
	$@cardprefix$[4082] = "Gigantic";
	$@cardprefix$[4083] = "Homer's";
	$@cardprefix$[4084] = "Blast";
	$@cardprefix$[4085] = "Damned";
	$@cardprefix$[4086] = "Critical";
	$@cardprefix$[4087] = "Order";
	$@cardprefix$[4088] = "Guard";
	$@cardprefix$[4089] = "Aqua";
	$@cardprefix$[4090] = "Amulet";
	$@cardprefix$[4091] = "of Counter";
	$@cardprefix$[4092] = "Boned";
	$@cardprefix$[4093] = "Cure";
	$@cardprefix$[4094] = "Kingbird";
	$@cardprefix$[4095] = "Genie's";
	$@cardprefix$[4096] = "Venomer's";
	$@cardprefix$[4097] = "Green";
	$@cardprefix$[4098] = "of Zephyrus";
	$@cardprefix$[4099] = "of Ifrit";
	$@cardprefix$[4100] = "Soul-Enchanted";
	$@cardprefix$[4101] = "of Gnome";
	$@cardprefix$[4102] = "Mocking";
	$@cardprefix$[4103] = "Clairvoyant";
	$@cardprefix$[4104] = "Chaos";
	$@cardprefix$[4105] = "Unfrozen";
	$@cardprefix$[4106] = "Ancient";
	$@cardprefix$[4107] = "Fledged";
	$@cardprefix$[4108] = "Innoxious";
	$@cardprefix$[4109] = "Flameguard";
	$@cardprefix$[4110] = "Viper's";
	$@cardprefix$[4111] = "Decussate";
	$@cardprefix$[4112] = "Peerless";
	$@cardprefix$[4113] = "of Ghost";
	$@cardprefix$[4114] = "Poisoning";
	$@cardprefix$[4115] = "Malicious";
	$@cardprefix$[4116] = "Divine";
	$@cardprefix$[4117] = "Hybrid";
	$@cardprefix$[4118] = "Dragoon";
	$@cardprefix$[4119] = "Evil";
	$@cardprefix$[4120] = "of Dragoon";
	$@cardprefix$[4121] = "Perfect";
	$@cardprefix$[4122] = "Adurate";
	$@cardprefix$[4123] = "Bearer's";
	$@cardprefix$[4124] = "Plasterer's";
	$@cardprefix$[4125] = "Aqua";
	$@cardprefix$[4126] = "Titan";
	$@cardprefix$[4127] = "Insomniac";
	$@cardprefix$[4128] = "of Deaf";
	$@cardprefix$[4129] = "of Rogue";
	$@cardprefix$[4130] = "Divine";
	$@cardprefix$[4131] = "Hasty";
	$@cardprefix$[4132] = "of Gemstone";
	$@cardprefix$[4133] = "Immune";
	$@cardprefix$[4134] = "Spiritual";
	$@cardprefix$[4135] = "Mirror";
	$@cardprefix$[4136] = "from Hell";
	$@cardprefix$[4137] = "of Infinity";
	$@cardprefix$[4138] = "Satanic";
	$@cardprefix$[4139] = "of Moonlight";
	$@cardprefix$[4140] = "Liberation";
	$@cardprefix$[4141] = "Deadly";
	$@cardprefix$[4142] = "of Berserk";
	$@cardprefix$[4143] = "Neutral";
	$@cardprefix$[4144] = "of Eternity";
	$@cardprefix$[4145] = "of Bigmouth";
	$@cardprefix$[4146] = "Reflect";
	$@cardprefix$[4147] = "Scythe-like";
	$@cardprefix$[4148] = "of Kirin";
	$@cardprefix$[4149] = "of Serenity";
	$@cardprefix$[4150] = "Spell-Proof";
	$@cardprefix$[4151] = "Havoc Bringer's";
	$@cardprefix$[4152] = "Sprightly";
	$@cardprefix$[4153] = "of Cancer";
	$@cardprefix$[4154] = "Sweet Scented";
	$@cardprefix$[4155] = "Deadly Goblin's";
	$@cardprefix$[4156] = "of Fatal Flame";
	$@cardprefix$[4157] = "Piercing";
	$@cardprefix$[4158] = "Slaughter";
	$@cardprefix$[4159] = "Deluxe";
	$@cardprefix$[4160] = "Superior";
	$@cardprefix$[4161] = "Anti-Magic";
	$@cardprefix$[4162] = "Sightless";
	$@cardprefix$[4163] = "Wild";
	$@cardprefix$[4164] = "Fisherman's";
	$@cardprefix$[4165] = "of Insect Soul Eater";
	$@cardprefix$[4166] = "of Jinx";
	$@cardprefix$[4167] = "of Beast Soul Eater";
	$@cardprefix$[4168] = "of Doom";
	$@cardprefix$[4169] = "Spell Master's";
	$@cardprefix$[4170] = "Solidifying";
	$@cardprefix$[4171] = "Soul Draining";
	$@cardprefix$[4172] = "Slicing";
	$@cardprefix$[4173] = "Mesmerizing";
	$@cardprefix$[4174] = "Deviant";
	$@cardprefix$[4175] = "Shoving";
	$@cardprefix$[4176] = "Fatal Serpentine";
	$@cardprefix$[4177] = "Green Stone";
	$@cardprefix$[4178] = "Bow-Master's";
	$@cardprefix$[4179] = "of Highlight";
	$@cardprefix$[4180] = "of Dragon Soul Eater";
	$@cardprefix$[4181] = "Soundless";
	$@cardprefix$[4182] = "of Demon Soul Eater";
	$@cardprefix$[4183] = "Werewolf";
	$@cardprefix$[4184] = "Crushing";
	$@cardprefix$[4185] = "of Wisdom";
	$@cardprefix$[4186] = "Strenuous";
	$@cardprefix$[4187] = "of the Spooky Night";
	$@cardprefix$[4188] = "Red Stone";
	$@cardprefix$[4189] = "of Misfortune";
	$@cardprefix$[4190] = "of Last Laugh";
	$@cardprefix$[4191] = "of the Stix";
	$@cardprefix$[4192] = "of Fatal Pisces";
	$@cardprefix$[4193] = "of Patience";
	$@cardprefix$[4194] = "Overpowering";
	$@cardprefix$[4195] = "Blue Stone";
	$@cardprefix$[4196] = "of Jellopy";
	$@cardprefix$[4197] = "Lucky Streak";
	$@cardprefix$[4198] = "of True Sight";
	$@cardprefix$[4199] = "Dashing";
	$@cardprefix$[4200] = "of Mystical Resistance";
	$@cardprefix$[4201] = "Crippling";
	$@cardprefix$[4202] = "of Exorcism";
	$@cardprefix$[4203] = "Blazing";
	$@cardprefix$[4204] = "Poacher's";
	$@cardprefix$[4205] = "Blue Cubic";
	$@cardprefix$[4206] = "Cubic";
	$@cardprefix$[4207] = "Anti-Small";
	$@cardprefix$[4208] = "Energetic";
	$@cardprefix$[4209] = "Fiddler's";
	$@cardprefix$[4210] = "Pressure";
	$@cardprefix$[4211] = "Virtuoso's";
	$@cardprefix$[4212] = "of Knock-Back";
	$@cardprefix$[4213] = "of Reticence";
	$@cardprefix$[4214] = "Man-Eater's";
	$@cardprefix$[4215] = "Rationing";
	$@cardprefix$[4216] = "Freezing";
	$@cardprefix$[4217] = "Rejuvenating";
	$@cardprefix$[4218] = "Nightmarish";
	$@cardprefix$[4219] = "Magic Stone";
	$@cardprefix$[4220] = "Faithful";
	$@cardprefix$[4221] = "Insect Collector's";
	$@cardprefix$[4222] = "of Sleep";
	$@cardprefix$[4223] = "Stun-Proof";
	$@cardprefix$[4224] = "Monsoon";
	$@cardprefix$[4225] = "Slingshot";
	$@cardprefix$[4226] = "Supreme";
	$@cardprefix$[4227] = "Roast Scented";
	$@cardprefix$[4228] = "of Siesta";
	$@cardprefix$[4229] = "of Torment";
	$@cardprefix$[4230] = "Coward's";
	$@cardprefix$[4231] = "Charging";
	$@cardprefix$[4232] = "Refreshing";
	$@cardprefix$[4233] = "Lucky Fluke";
	$@cardprefix$[4234] = "of Clarity";
	$@cardprefix$[4235] = "Fallen Angel's";
	$@cardprefix$[4236] = "Protective";
	$@cardprefix$[4237] = "of Godly Wrath";
	$@cardprefix$[4238] = "of Doubled Power";
	$@cardprefix$[4239] = "Veteran Hunter's";
	$@cardprefix$[4240] = "Magic-Proof";
	$@cardprefix$[4241] = "Miraculous";
	$@cardprefix$[4242] = "Prime";
	$@cardprefix$[4243] = "of Escape";
	$@cardprefix$[4244] = "Seeker's";
	$@cardprefix$[4245] = "Assassinator's";
	$@cardprefix$[4246] = "Killing";
	$@cardprefix$[4247] = "Starfish's";
	$@cardprefix$[4248] = "Shining Cross";
	$@cardprefix$[4249] = "Witch Doctor's";
	$@cardprefix$[4250] = "Anti-Large";
	$@cardprefix$[4251] = "Invasion";
	$@cardprefix$[4252] = "Four Leaf Clover";
	$@cardprefix$[4253] = "of Royal Guard";
	$@cardprefix$[4254] = "Anti-Medium";
	$@cardprefix$[4255] = "Smashing";
	$@cardprefix$[4256] = "Desirable";
	$@cardprefix$[4257] = "Wing";
	$@cardprefix$[4258] = "Prodigy";
	$@cardprefix$[4259] = "of Nature";
	$@cardprefix$[4260] = "Confusion Resistant";
	$@cardprefix$[4261] = "Bleed Resistant";
	$@cardprefix$[4262] = "Dark Sky";
	$@cardprefix$[4263] = "Bloodlust";
	$@cardprefix$[4264] = "Thunderbolt";
	$@cardprefix$[4265] = "of Dawn";
	$@cardprefix$[4266] = "Magic Resistant";
	$@cardprefix$[4267] = "Dragon Slayer's";
	$@cardprefix$[4268] = "Extending";
	$@cardprefix$[4269] = "Fatasm";
	$@cardprefix$[4270] = "of Venom";
	$@cardprefix$[4271] = "Yellow Stone";
	$@cardprefix$[4272] = "Swift";
	$@cardprefix$[4273] = "Shell";
	$@cardprefix$[4274] = "of Undead Soul Eater";
	$@cardprefix$[4275] = "Undead Killer's";
	$@cardprefix$[4276] = "Crucial";
	$@cardprefix$[4277] = "Dominatrix";
	$@cardprefix$[4278] = "of Magical Immunity";
	$@cardprefix$[4279] = "Soul Collector's";
	$@cardprefix$[4280] = "Blessed";
	$@cardprefix$[4281] = "Diligent";
	$@cardprefix$[4282] = "of Reservoir";
	$@cardprefix$[4283] = "Mana Sphere";
	$@cardprefix$[4284] = "of Caress";
	$@cardprefix$[4285] = "Elven-Enchanted";
	$@cardprefix$[4286] = "Terrorizing";
	$@cardprefix$[4287] = "Magically Shielded";
	$@cardprefix$[4288] = "Maestro";
	$@cardprefix$[4289] = "of Plant Soul Eater";
	$@cardprefix$[4290] = "Mirror";
	$@cardprefix$[4291] = "Deadly Kobold's";
	$@cardprefix$[4292] = "Deadly Plant's";
	$@cardprefix$[4293] = "of Chance";
	$@cardprefix$[4294] = "Sneaky";
	$@cardprefix$[4295] = "of Blackout";
	$@cardprefix$[4296] = "Greedy";
	$@cardprefix$[4297] = "Poaching";
	$@cardprefix$[4298] = "of Mayhem";
	$@cardprefix$[4299] = "Guardian's";
	$@cardprefix$[4300] = "Venomous Charge";
	$@cardprefix$[4301] = "Traumatic";
	$@cardprefix$[4302] = "High Risk";
	$@cardprefix$[4303] = "Mystic";
	$@cardprefix$[4304] = "Shield Master's";
	$@cardprefix$[4305] = "Explosive";
	$@cardprefix$[4306] = "King's";
	$@cardprefix$[4307] = "of Marine Soul Eater";
	$@cardprefix$[4308] = "Power Draining";
	$@cardprefix$[4309] = "Reinforced";
	$@cardprefix$[4310] = "Fatally Evil";
	$@cardprefix$[4311] = "Anti-Evil";
	$@cardprefix$[4312] = "of the Soul";
	$@cardprefix$[4313] = "Bogie";
	$@cardprefix$[4314] = "Fire-Proof";
	$@cardprefix$[4315] = "of Stone Curse";
	$@cardprefix$[4316] = "of Angel Soul Eater";
	$@cardprefix$[4317] = "Aural";
	$@cardprefix$[4318] = "Storm-Bringer's";
	$@cardprefix$[4319] = "Sword-Master's";
	$@cardprefix$[4320] = "Meteoric";
	$@cardprefix$[4321] = "Polymorphic";
	$@cardprefix$[4322] = "of Retaliation";
	$@cardprefix$[4323] = "of Frost";
	$@cardprefix$[4324] = "Arctic";
	$@cardprefix$[4325] = "Vicious";
	$@cardprefix$[4326] = "Ocean Scented";
	$@cardprefix$[4327] = "Spell Flow";
	$@cardprefix$[4328] = "Hyper";
	$@cardprefix$[4329] = "Soul Gain";
	$@cardprefix$[4330] = "Curse Lift";
	$@cardprefix$[4331] = "Evasion";
	$@cardprefix$[4332] = "of Talent";
	$@cardprefix$[4333] = "of Chaotic Venom";
	$@cardprefix$[4334] = "Anti-Sniping";
	$@cardprefix$[4335] = "Gnome";
	$@cardprefix$[4336] = "of Vitality";
	$@cardprefix$[4337] = "of Wildcat";
	$@cardprefix$[4338] = "of Vital Switching";
	$@cardprefix$[4339] = "of Stone Wall";
	$@cardprefix$[4340] = "of Requiem";
	$@cardprefix$[4341] = "Disarm";
	$@cardprefix$[4342] = "Mammoth";
	$@cardprefix$[4343] = "of Creator";
	$@cardprefix$[4344] = "of Value";
	$@cardprefix$[4345] = "Sylph";
	$@cardprefix$[4346] = "of Power Switching";
	$@cardprefix$[4347] = "Stamina";
	$@cardprefix$[4348] = "Gangster";
	$@cardprefix$[4349] = "Anti-Arrow";
	$@cardprefix$[4350] = "Undine";
	$@cardprefix$[4351] = "Low Level";
	$@cardprefix$[4352] = "of Regeneration";
	$@cardprefix$[4353] = "of Rejuvenation";
	$@cardprefix$[4354] = "of Stability";
	$@cardprefix$[4355] = "Healthy";
	$@cardprefix$[4356] = "Magic Cancel";
	$@cardprefix$[4357] = "of Fury";
	$@cardprefix$[4358] = "Lost-Power";
	$@cardprefix$[4359] = "of Shadow";
	$@cardprefix$[4360] = "Assassin";
	$@cardprefix$[4361] = "of Hollgrehenn";
	$@cardprefix$[4362] = "Heat";
	$@cardprefix$[4363] = "Protection";
	$@cardprefix$[4364] = "of Magic Sealing";
	$@cardprefix$[4365] = "of Tempest";
	$@cardprefix$[4366] = "of Caster";
	$@cardprefix$[4367] = "of Squeezing";
	$@cardprefix$[4368] = "Rapid";
	$@cardprefix$[4369] = "of Luck Switching";
	$@cardprefix$[4370] = "Weakening";
	$@cardprefix$[4371] = "of Paladin";
	$@cardprefix$[4372] = "Life Stream";
	$@cardprefix$[4373] = "Cursed";
	$@cardprefix$[4374] = "of Vision";
	$@cardprefix$[4375] = "Extra High Level";
	$@cardprefix$[4376] = "Manful";
	$@cardprefix$[4377] = "Sweetie";
	$@cardprefix$[4378] = "Low Level";
	$@cardprefix$[4379] = "Low Level";
	$@cardprefix$[4380] = "Salamander";
	$@cardprefix$[4381] = "of Wanderer";
	$@cardprefix$[4382] = "of Scholar";
	$@cardprefix$[4383] = "Chaotic";
	$@cardprefix$[4384] = "Magic Eater";
	$@cardprefix$[4385] = "Drink";
	$@cardprefix$[4386] = "of Magic Shelter";
	$@cardprefix$[4387] = "of Agility Switching";
	$@cardprefix$[4388] = "Soul";
	$@cardprefix$[4389] = "Elemental";
	$@cardprefix$[4390] = "Blooding";
	$@cardprefix$[4391] = "Snack";
	$@cardprefix$[4392] = "of Dexterity Switching";
	$@cardprefix$[4393] = "of Intelligence Switching";
	$@cardprefix$[4394] = "Divine Cross";
	$@cardprefix$[4395] = "Slug";
	$@cardprefix$[4396] = "Dull";
	$@cardprefix$[4397] = "Stupidity";
	$@cardprefix$[4398] = "Darkness";
	$@cardprefix$[4399] = "Penetration";
	$@cardprefix$[4400] = "of Temptation";
	$@cardprefix$[4401] = "Swift";
	$@cardprefix$[4402] = "Strange";
	$@cardprefix$[4403] = "of Reload";
	$@cardprefix$[4404] = "of Chaotic Bleeding";
	$@cardprefix$[4405] = "of Magic Mirror";
	$@cardprefix$[4406] = "Twinkle";
	$@cardprefix$[4407] = "of Elimination";
	$@cardprefix$[4408] = "Abyss";
	$@cardprefix$[4409] = "Panic";
	$@cardprefix$[4410] = "Madness";
	$@cardprefix$[4411] = "Arta's";
	$@cardprefix$[4412] = "Aria";
	$@cardprefix$[4413] = "Resistance";
	$@cardprefix$[4414] = "Gorgon's";
	$@cardprefix$[4415] = "Sweet";
	$@cardprefix$[4416] = "of Grain";
	$@cardprefix$[4417] = "of Flow";
	$@cardprefix$[4418] = "of Hail";
	$@cardprefix$[4419] = "Jack Frost";
	$@cardprefix$[4420] = "of Comfort";
	$@cardprefix$[4421] = "of Chinook";
	$@cardprefix$[4422] = "Breeze";
	$@cardprefix$[4423] = "of Sharkia";
	$@cardprefix$[4424] = "Stony";
	$@cardprefix$[4425] = "Beast";
	$@cardprefix$[4426] = "Exceeding";
	$@cardprefix$[4427] = "of Force";
	$@cardprefix$[4428] = "of Shaft";
	$@cardprefix$[4429] = "Nessus's";
	$@cardprefix$[4430] = "of Inferno";
	$@cardprefix$[4431] = "Stygian";
	$@cardprefix$[4432] = "Scorching";
	$@cardprefix$[4433] = "of Ignis";
	$@cardprefix$[4434] = "Miner's";
	$@cardprefix$[4435] = "Outrageous";
	$@cardprefix$[4436] = "Lunatic";
	$@cardprefix$[4437] = "Rabid";
	$@cardprefix$[4438] = "Mental";
	$@cardprefix$[4439] = "of Anathema";
	$@cardprefix$[4440] = "of Ignoring";
	$@cardprefix$[4441] = "Arrogant";
	$@cardprefix$[4442] = "of Basis";
	$@cardprefix$[4443] = "of Underneath";
	$@cardprefix$[4444] = "of Saharic";
	$@cardprefix$[4445] = "of Windy";
	$@cardprefix$[4447] = "of Envenom";
	$@cardprefix$[4448] = "of Damned";
	$@cardprefix$[4449] = "of Hallowed";
	$@cardprefix$[4450] = "Surplus";
	$@cardprefix$[4451] = "of Excess";
	$@cardprefix$[4452] = "Magical";
	$@cardprefix$[4453] = "Fierce";
	$@cardprefix$[4454] = "Sorry";
	$@cardprefix$[4455] = "Love";
	$@cardprefix$[4457] = "Psychic";
	$@cardprefix$[4458] = "of Illusion";
	$@cardprefix$[4459] = "of Fast";
	$@cardprefix$[4460] = "of Healing";
	$@cardprefix$[4461] = "of Sharp";
	$@cardprefix$[4462] = "Prime Defense";
	$@cardprefix$[4463] = "Prime Attack";
	$@cardprefix$[4464] = "Fatal";
	$@cardprefix$[4465] = "Sweeping";
	$@cardprefix$[4466] = "Straight Shooting";
	$@cardprefix$[4467] = "Heavy";
	$@cardprefix$[4468] = "Polution";
	$@cardprefix$[4469] = "Marine";
	$@cardprefix$[4470] = "Botany";
	$@cardprefix$[4471] = "Draco";
	$@cardprefix$[4472] = "Carnivore";
	$@cardprefix$[4473] = "Undead";
	$@cardprefix$[4474] = "Mortal";
	$@cardprefix$[4475] = "Intangible";
	$@cardprefix$[4476] = "Entomic";
	$@cardprefix$[4477] = "Demonic";
	$@cardprefix$[4480] = "Of Halfreload";
	$@cardprefix$[4481] = "Half Jack Frost";
	$@cardprefix$[4482] = "Of Half regeneration";
	$@cardprefix$[4483] = "Half Spiritual";
	$@cardprefix$[4484] = "Of Half Gemstone";
	$@cardprefix$[4485] = "Half Abyss";
	$@cardprefix$[4991] = "Carefree";
	$@cardprefix$[4998] = "of Valor";
	$@cardprefix$[4999] = "of Aegis";
	$@cardprefix$[4505] = "of Mad Witch";
	$@cardprefix$[4506] = "of Archer";
	$@cardprefix$[4507] = "Scaraba";
	$@cardprefix$[4508] = "of Mad Berserker";
	$@cardprefix$[4509] = "Insectproof";
	$@cardprefix$[4510] = "Black-out";
	$@cardprefix$[4511] = "Silentium";
	$@cardprefix$[4512] = "of Acolyte";
	$@cardprefix$[4513] = "of Thief";
	$@cardprefix$[4514] = "Exorcism";
	$@cardprefix$[4515] = "Flora";
	$@cardprefix$[4516] = "of Stone wall";
	$@cardprefix$[4517] = "of Magician";
	$@cardprefix$[4518] = "Burning";
	$@cardprefix$[4519] = "Seraphim";
	$@cardprefix$[4520] = "Screaming";
	$@cardprefix$[4521] = "Mortal Blow";
	$@cardprefix$[4522] = "Cold";
	$@cardprefix$[4523] = "Aquarius";
	$@cardprefix$[4524] = "of Swordman";
	$@cardprefix$[4525] = "Sweeping";
	$@cardprefix$[4526] = "of Magic Defense";
	$@cardprefix$[4527] = "of Defense";
	$@cardprefix$[4528] = "Spirit";
	$@cardprefix$[4529] = "Physical";
	$@cardprefix$[4530] = "of Merchant";
	$@cardprefix$[4531] = "Under Curse";
	$@cardprefix$[4532] = "Sprinting";
	$@cardprefix$[4533] = "Blinding";
	$@cardprefix$[4534] = "Water Bomb";
	$@cardprefix$[4493] = "Half High Risk";
	$@cardprefix$[4582] = "Endurance";
	$@cardprefix$[4583] = "Of poisonous weeds";
	$@cardprefix$[4584] = "Vampire";
	$@cardprefix$[4585] = "Of Curse";
	$@cardprefix$[4586] = "Wind";
	$@cardprefix$[4587] = "Slasher";
	$@cardprefix$[4588] = "Of Powerful";
	$@cardprefix$[4589] = "Of Reach";
	$@cardprefix$[4590] = "Of Lethargy";
	$@cardprefix$[4591] = "Of Blood";
	$@cardprefix$[4592] = "Of Chemical";
	end;
}

//===== EinherjarRO Scripts ================================== 
//= F_RandOptDisp
//===== By: ================================================== 
//= Stolao
//===== Current Version: ===================================== 
//= 1.01
//===== Compatible With: ===================================== 
//= rAthena SVN
//===== Description: ========================================= 
//= Converts random option int values into human readable
//===== Comments: ============================================
//= Optmize more?
//===== Additional Comments: =================================
//= 1.00 Original Make
//= 1.01 Added 'Blank' for 'missing' rndoptions client side
//===== Contact Ifo: =========================================
//= [Stolao] 
//= Email: [email protected]
//============================================================
function	script	F_RandOptDisp	{
// callfunc("F_RandOptDisp",id,value,paramater);
	setarray .@RNDOptions$[1],"Max Hp +"+getarg(1,0)+"","Max Sp +"+getarg(1,0)+"","Str +"+getarg(1,0)+"","Agi +"+getarg(1,0)+"","Vit +"+getarg(1,0)+"",
				"Int +"+getarg(1,0)+"","Dex +"+getarg(1,0)+"","Luk +"+getarg(1,0)+"","Max Hp +"+getarg(1,0)+"%","Max Sp +"+getarg(1,0)+"%",
				"Increases natural HP regeneration by "+getarg(1,0)+"%","Increases natural SP regeneration by "+getarg(1,0)+"%","ATK +"+getarg(1,0)+"%","MATK +"+getarg(1,0)+"%","ASPD +"+getarg(1,0)+"",
				"Increases attack speed (reduce delay after attack by "+getarg(1,0)+"%)","ATK +"+getarg(1,0)+"","HIT +"+getarg(1,0)+"","MATK +"+getarg(1,0)+"","DEF +"+getarg(1,0)+"",
				"MDEF +"+getarg(1,0)+"","FLEE +"+getarg(1,0)+"","Perfect dodge +"+getarg(1,0)+"","CRIT +"+getarg(1,0)+"","Resistance to Neutral "+getarg(1,0)+"%",
				"Resistance to Water "+getarg(1,0)+"%","Resistance to Earth "+getarg(1,0)+"%","Resistance to Fire "+getarg(1,0)+"%","Resistance to Wind "+getarg(1,0)+"%","Resistance to Poison "+getarg(1,0)+"%",
				"Resistance to Holy "+getarg(1,0)+"%","Resistance to Shadow "+getarg(1,0)+"%","Resistance to Ghost "+getarg(1,0)+"%","Resistance to Undead "+getarg(1,0)+"%","Resistance to all elements "+getarg(1,0)+"%",
				"Resistance to Neutral monster "+getarg(1,0)+"%","Physical damage to Neutral monsters "+getarg(1,0)+"%","Resistance to Water monsters "+getarg(1,0)+"%","Physical damage to Water monsters "+getarg(1,0)+"%","Resistance to Earth monsters "+getarg(1,0)+"%",
				"Physical damage to Earth monsters "+getarg(1,0)+"%","Resistance to Fire monsters "+getarg(1,0)+"%","Physical damage to Fire monsters "+getarg(1,0)+"%","Resistance to Wind monsters "+getarg(1,0)+"%","Physical damage to Wind monsters "+getarg(1,0)+"%",
				"Resistance to Poison monsters "+getarg(1,0)+"%","Physical damage to Poison monsters "+getarg(1,0)+"%","Resistance to Holy monsters "+getarg(1,0)+"%","Physical damage to Holy monsters "+getarg(1,0)+"%","Resistance to Shadow monsters "+getarg(1,0)+"%",
				"Physical damage to Shadow monsters "+getarg(1,0)+"%","Resistance to Ghost monsters "+getarg(1,0)+"%","Physical damage to Ghost monsters "+getarg(1,0)+"%","Resistance to Undead monsters "+getarg(1,0)+"%","Physical damage to Undead monsters "+getarg(1,0)+"%",
				"Magical recistance to Neutral monsters "+getarg(1,0)+"%","Magical damage to Neutral monsters "+getarg(1,0)+"%","Magical recistance to Water monsters "+getarg(1,0)+"%","Magical damage to Water monsters "+getarg(1,0)+"%","Magical recistance to Earth monsters "+getarg(1,0)+"%",
				"Magical damage to Earth monsters "+getarg(1,0)+"%","Magical recistance to Fire monsters "+getarg(1,0)+"%","Magical damage to Fire monsters "+getarg(1,0)+"%","Magical recistance to Wind monsters "+getarg(1,0)+"%","Magical damage to Wind monsters "+getarg(1,0)+"%",
				"Magical recistance to Poison monsters "+getarg(1,0)+"%","Magical damage to Poison monsters "+getarg(1,0)+"%","Magical recistance to Holy monsters "+getarg(1,0)+"%","Magical damage to Holy monsters "+getarg(1,0)+"%","Magical recistance to Shadow monsters "+getarg(1,0)+"%",
				"Magical damage to Shadow monsters "+getarg(1,0)+"%","Magical recistance to Ghost monsters "+getarg(1,0)+"%","Magical damage to Ghost monsters "+getarg(1,0)+"%","Magical recistance to Undead monsters "+getarg(1,0)+"%","Magical damage to Undead monsters "+getarg(1,0)+"%",
				"Enchants armor with Neutral property","Enchants armor with Water property","Enchants armor with Earth property","Enchants armor with Fire property","Enchants armor with Wind property",
				"Enchants armor with Poison property","Enchants armor with Holy property","Enchants armor with Shadow property","Enchants armor with Ghost property","Enchants armor with Undead property",
				"Blank",
				"Resistance to Formless monsters "+getarg(1,0)+"%","Resistance to Undead monsters "+getarg(1,0)+"%","Resistance to Brute monsters "+getarg(1,0)+"%","Resistance to Plant monsters "+getarg(1,0)+"%","Resistance to Insect monsters "+getarg(1,0)+"%",
				"Resistance to Fish monsters "+getarg(1,0)+"%","Resistance to Demon monsters "+getarg(1,0)+"%","Resistance to Demihuman monsters "+getarg(1,0)+"%","Resistance to Angel monsters "+getarg(1,0)+"%","Resistance to Dragon monsters "+getarg(1,0)+"%",
				"Physical damage to Formless monsters "+getarg(1,0)+"%","Physical damage to Undead monsters "+getarg(1,0)+"%","Physical damage to Brute monsters "+getarg(1,0)+"%","Physical damage to Plant monsters "+getarg(1,0)+"%","Physical damage to Insect monsters "+getarg(1,0)+"%",
				"Physical damage to Fish monsters "+getarg(1,0)+"%","Physical damage to Demon monsters "+getarg(1,0)+"%","Physical damage to Demihuman monsters "+getarg(1,0)+"%","Physical damage to Angel monsters "+getarg(1,0)+"%","Physical damage to Dragon monsters "+getarg(1,0)+"%",
				"Magical damage to Formless monsters "+getarg(1,0)+"%","Magical damage to Undead monsters "+getarg(1,0)+"%","Magical damage to Brute monsters "+getarg(1,0)+"%","Magical damage to Plant monsters "+getarg(1,0)+"%","Magical damage to Insect monsters "+getarg(1,0)+"%",
				"Magical damage to Fish monsters "+getarg(1,0)+"%","Magical damage to Devil monsters "+getarg(1,0)+"%","Magical damage to Demihuman monsters "+getarg(1,0)+"%","Magical damage to Angel monsters "+getarg(1,0)+"%","Magical damage to Dragon monsters "+getarg(1,0)+"%",
				"CRIT +"+getarg(1,0)+"/10 to Formless monsters","CRIT +"+getarg(1,0)+"/10 to Undead monsters","CRIT +"+getarg(1,0)+"/10 to Brute monsters","CRIT +"+getarg(1,0)+"/10 to Plant monsters","CRIT +"+getarg(1,0)+"/10 to Insect monsters",
				"CRIT +"+getarg(1,0)+"/10 to Fish monsters","CRIT +"+getarg(1,0)+"/10 to Demon monsters","CRIT +"+getarg(1,0)+"/10 to Demihuman monsters","CRIT +"+getarg(1,0)+"/10 to Angel monsters","CRIT +"+getarg(1,0)+"/10 to Dragon monsters",
				"Ignores "+getarg(1,0)+"% Def of Formless monster","Ignores "+getarg(1,0)+"% Def of Undead monster","Ignores "+getarg(1,0)+"% Def of Brute monster","Ignores "+getarg(1,0)+"% Def of Plant monster","Ignores "+getarg(1,0)+"% Def of Insect monster",
				"Ignores "+getarg(1,0)+"% Def of Fish monster","Ignores "+getarg(1,0)+"% Def of Demon monster","Ignores "+getarg(1,0)+"% Def of Demihuman monster","Ignores "+getarg(1,0)+"% Def of Angel monster","Ignores "+getarg(1,0)+"% Def of Dragon monster",
				"Ignores "+getarg(1,0)+"% Mdef of Formless monster","Ignores "+getarg(1,0)+"% Mdef of Undead monster","Ignores "+getarg(1,0)+"% Mdef of Brute monster","Ignores "+getarg(1,0)+"% Mdef of Plant monster","Ignores "+getarg(1,0)+"% Mdef of Insect monster",
				"Ignores "+getarg(1,0)+"% Mdef of Fish monster","Ignores "+getarg(1,0)+"% Mdef of Demon monster","Ignores "+getarg(1,0)+"% Mdef of Demihuman monster","Ignores "+getarg(1,0)+"% Mdef of Angel monster","Ignores "+getarg(1,0)+"% Mdef of Dragon monster",
				"Physical damage to Normal monsters "+getarg(1,0)+"%","Physical damage to Boss monsters "+getarg(1,0)+"%","Resistance to Normal monsters "+getarg(1,0)+"%","Resistance to Boss monsters "+getarg(1,0)+"%","Magical damage to Normal monsters "+getarg(1,0)+"%",
				"Magical damage to Boss monsters "+getarg(1,0)+"%","Ignores "+getarg(1,0)+"% Def of Normal monster","Ignores "+getarg(1,0)+"% Def of Boss monster","Ignores "+getarg(1,0)+"% Mdef of Normal monster","Ignores "+getarg(1,0)+"% Mdef of Boss monster",
				"Damage to Small size monsters "+getarg(1,0)+"%","Damage to Medium size monsters "+getarg(1,0)+"%","Damage to Large size monsters "+getarg(1,0)+"%","Resistance to Small size monsters "+getarg(1,0)+"%","Resistance to Medium size monsters "+getarg(1,0)+"%",
				"Resistance to Large size monsters "+getarg(1,0)+"%","Nullify weapon's damage size penalty","Increases critical damage by "+getarg(1,0)+"%","Decreases critical damage by "+getarg(1,0)+"%","Increases ranged physical damage "+getarg(1,0)+"%",
				"Decreases ranged physical damage "+getarg(1,0)+"%","Increases Healing skills by "+getarg(1,0)+"%","Increases Healing skills by "+getarg(1,0)+"%","Reduces cast time by "+getarg(1,0)+"%","Reduces cast delay by "+getarg(1,0)+"%",
				"Decreases SP consumption by "+getarg(1,0)+"%",
				"Blank","Blank",
				"Enchants weapon with Neutral property","Enchants weapon with Water property","Enchants weapon with Earth property","Enchants weapon with Fire property",
				"Enchants weapon with Wind property","Enchants weapon with Poison property","Enchants weapon with Holy property","Enchants weapon with Shadow property","Enchants weapon with Ghost property",
				"Enchants weapon with Undead property","Indestructible","Indestructible";
	return .@RNDOptions$[getarg(0,0)];
}


prontera,150,150,4	script	Rolling in the Deep	100,{

	if(!.status && getgmlevel() >= .gm_lvl) {
		mes "Do you want to start the raffle?";
		if(select("No","Yes") == 2) {
			clear;
			mes "Sell me the items you want to give.";
			mes "Please don't put unidentified items.";
			close2;
			callshop "rolling_shop",2;
			end;
		}
	} else if(.status == 1) {
		if(.player_n < .players) {
			if(countitem(.coin_id) >= .fee) {
				.@i = inarray(.player_aid,getcharid(3));
				if(.@i == -1) {
					mes "Do you want to join this game? Fee: "+.fee+" coins.";
					mes "Prize:";
					.@size = getarraysize(.item_id);
					for(.@i = 0;.@i < .@size;.@i++) {
						.@has_option = false;
						mes @itemname2_info$ + getitemname2(.item_id[.@i],1,.item_ref[.@i],0,.item_card1[.@i],.item_card2[.@i],.item_card3[.@i],.item_card4[.@i]);
						for(.@j = 1;.@j <= 5;.@j++) {
							.@opt$ = F_RandOptDisp(getd(".item_opt"+.@j+"["+.@i+"]"),getd(".item_val"+.@j+"["+.@i+"]"),getd(".item_param"+.@j+"["+.@i+"]"));
							if(.@opt$ != "") {
								if(!.@has_option) {
									.@has_option = true;
									mes "^ff0000Item Options:^000000";
								}
								mes .@opt$;
							}
						}
					}
					if(select("No","Yes") == 2) {
						if(countitem(.coin_id) >= .fee) {
							delitem .coin_id,.fee;
							.player_aid[++.player_n] = getcharid(3);
							.player_cid[.player_n - 1] = getcharid(0);
							.player_name$[.player_n - 1] = strcharinfo(0);
							if(.player_n >= .players)
								donpcevent strnpcinfo(0)+"::OnSpin";
						}
					}
				} else {
					mes "You're already participating. Wait for the event to start.";
				}
			} else {
				mes "You need "+.fee+" coins to join this game.";
			}
		} else {
			mes "Everyone is registered.";
		}
	} else if(.status == 2) {
		mes "The game is spinning right now. Pay attention.";
	} else {
		mes "I'm sorry but this game isn't active right now.";
	}
	close;

OnSellItem:

	disable_items;
	.@size = getarraysize(@sold_nameid);
	for(.@i = 0;.@i < .@size;.@i++) {
		if(!@sold_identify[.@i]) {
			deletearray @sold_nameid[.@i],1;
			deletearray @sold_quantity[.@i],1;
			deletearray @sold_refine[.@i],1;
			deletearray @sold_identify[.@i],1;
			for(.@j = 1;.@j <= 5;.@j++) {
				if(.@j < 5)
					deletearray getd("@sold_card"+.@j+"["+.@i+"]"),1;
				deletearray getd("@sold_opt"+.@j+"["+.@i+"]"),1;
				deletearray getd("@sold_val"+.@j+"["+.@i+"]"),1;
				deletearray getd("@sold_param"+.@j+"["+.@i+"]"),1;
			}
			.@size--;
			.@i--;
		}
	}
	if(.@size) {
		while(true) {
			clear;
			mes "What do you want to do?";
			.@s = select("Set fee ("+max(1,.@option[0])+"z)","Set amount of players ("+max(5,.@option[1])+")","Ready") - 1;
			if(.@s < 2) {
				input .@option[.@s];
			} else {
				mes "Do you want to continue or check if everything is correct?";
				if(select("Check if everything is correct","Continue") == 2 && !.status) {
					.fee = max(1,.@option[0]);	// default 1 fee.
					.players = max(5,.@option[1]);	// default 5 players.
					.status = true;
					.player_aid[0] = getcharid(3);
					.o_player = getcharid(0);
					for(.@i = 0;.@i < .@size;.@i++)
						delitem @sold_nameid[.@i],@sold_quantity[.@i];
					copyarray .item_id[0],@sold_nameid[0],.@size;
					copyarray .item_amt[0],@sold_quantity[0],.@size;
					copyarray .item_ref[0],@sold_refine[0],.@size;
					for(.@i = 1;.@i <= 5;.@i++) {
						if(.@i < 5)
							copyarray getd(".item_card"+.@i+"[0]"),getd("@sold_card"+.@i+"[0]"),.@size;
						copyarray getd(".item_opt"+.@i+"[0]"),getd("@sold_option_id"+.@i+"[0]"),.@size;
						copyarray getd(".item_val"+.@i+"[0]"),getd("@sold_option_id"+.@i+"[0]"),.@size;
						copyarray getd(".item_param"+.@i+"[0]"),getd("@sold_option_id"+.@i+"[0]"),.@size;
					}
					announce strcharinfo(0)+" is having a raffle for "+.fee+" coin per entry only "+.players+" people can join.",bc_all;
					if(.@size == 1)
						announce "The prize is "+@sold_quantity[0]+" "+getitemname2(@sold_nameid[0], @sold_identify[0], @sold_refine[0], @sold_attribute[0], @sold_card1[0], @sold_card2[0], @sold_card3[0], @sold_card4[0], @sold_bound[0])+".",bc_all;
					else
						announce "There're multiple prizes. Check them in the NPC!",bc_all;
					stopnpctimer;
					initnpctimer;
					break;
				} else if(.status) {
					mes "Sorry but someone started before you.";
					break;
				}
			}
		}
	} else {
		mes "You put no valid item.";
	}
	close;

OnSpin:

	stopnpctimer;
	.status = 2;
	// We delete the player who started the event (we had him in the array to avoid joining him).
	deletearray .player_aid[0],1;
	.player_n--;
	while(.@rolls < 3) {
		mapannounce "prontera","Roll n°"+(.@rolls + 1)+".",bc_map;
		sleep 2000;
		specialeffect2 F_Rand(EF_SPINMOVE,EF_CASTSPIN2);
		sleep 2000;
		.@r = rand(.player_n--);
		if(.@rolls == 2) {
			mapannounce "prontera","And the winner is...",bc_map;
			sleep 2500;
		}
		mapannounce "prontera",.player_name$[.@r]+"...",bc_map;
		deletearray .player_aid[.@r],1;
		deletearray .player_cid[.@r],1;
		deletearray .player_name$[.@r],1;
		if(.@rolls < 2)
			sleep 5000;
		.@rolls++;
	}
	mail .player_cid[.@r],"Rolling in the Deep","Prize","Here's your prize from the game",0,.item_id,.item_amt,.item_card1,.item_card2,.item_card3,.item_card4,.item_opt1,.item_val1,.item_param1,.item_opt2,.item_val2,.item_param2,.item_opt3,.item_val3,.item_param3,.item_opt4,.item_val4,.item_param4,.item_opt5,.item_val5,.item_param5;
	setarray .@item_id[0],.coin_id;
	setarray .@item_amt[0],.players * .fee;
	mail .o_player,"Rolling in the Deep","Coins","Here's the coins",0,.@item_id,.@item_amt;

	// if 10 mins and nobody started the event.
OnTimer600000:
	stopnpctimer;
	// we try to give the items back in this situation.
	if(!.@rolls) {
		if(isloggedin(.player_aid[0],.o_player))
			mail .o_player,"Rolling in the Deep","Items back","No game was started and your items were given back",0,.item_id,.item_amt,.item_card1,.item_card2,.item_card3,.item_card4,.item_opt1,.item_val1,.item_param1,.item_opt2,.item_val2,.item_param2,.item_opt3,.item_val3,.item_param3,.item_opt4,.item_val4,.item_param4,.item_opt5,.item_val5,.item_param5;
	}
	.players_n = 0;
	.o_player = 0;
	deletearray .player_aid;
	deletearray .player_cid;
	deletearray .player_name$;
	deletearray .item_id;
	deletearray .item_amt;
	deletearray .item_ref;
	for(.@i = 1;.@i <= 5;.@i++) {
		if(.@i < 5)
			deletearray getd(".item_card"+.@i);
		deletearray getd(".item_opt"+.@i);
		deletearray getd(".item_val"+.@i);
		deletearray getd(".item_param"+.@i);
	}
	.fee = 0;
	.players = 0;
	.status = false;
	end;

OnInit:

	.coin_id = 7539;	// coin id.
	.gm_lvl  = 0;

	npcshopattach "rolling_shop";
	end;

}

-	shop	rolling_shop	-1,512:-1

Edit: forgot to say you can add some checks

if(!@sold_identify[.@i]) {

to avoid "crap" items, like only an item with at least a card, or >= x refine, etc.

 

On 1/14/2019 at 4:30 PM, melv0 said:

btw how to make only GM to set the item? player only can bet 

Added a new config for that. Also tried to clean some things.

Hope it works.

Edited by n0tttt
AnnieRuru helped me fix it
  • Upvote 2
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

NVM. It was my mistake

 

Edited by Radian
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

On 1/14/2019 at 4:22 AM, AnnieRuru said:

/* can only bet these item types
- `IT_WEAPON`: 4
- `IT_ARMOR`: 5
- `IT_CARD`: 6
- `IT_PETEGG`: 7
- `IT_PETARMOR`: 8
*/
prontera,155,185,5	script	sfksfjhsfj	1_F_MARIA,{
	if ( .start == 1 ) goto L_StartEvent; // goto is evil, but it actually helps make script higher readability
	else if ( .start == 2 ) {
		mes "Currently rolling dice ... please be patient";
		close;
	}
	mes "select an item from your inventory to bet";
	next;
	getinventorylist;
	for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) {
		if ( @inventorylist_equip[.@i] == 0 && @inventorylist_identify[.@i] == true && @inventorylist_attribute[.@i] == false && @inventorylist_expire[.@i] == 0 && @inventorylist_bound[.@i] == BOUND_NONE && ( getiteminfo( @inventorylist_id[.@i], 2 ) == IT_WEAPON || getiteminfo( @inventorylist_id[.@i], 2 ) == IT_ARMOR || getiteminfo( @inventorylist_id[.@i], 2 ) == IT_CARD || getiteminfo( @inventorylist_id[.@i], 2 ) == IT_PETEGG || getiteminfo( @inventorylist_id[.@i], 2 ) == IT_PETARMOR ) ) {
			.@itemname$ = callfunc( "getitemname2", @inventorylist_id[.@i], @inventorylist_identify, @inventorylist_refine, @inventorylist_attribute, @inventorylist_card1, @inventorylist_card2, @inventorylist_card3, @inventorylist_card4 );
			.@menu$ = .@menu$ + @itemname2_info$ + .@itemname$ +"; "+ @inventorylist_amount[.@i] +" ea.:";
			.@id[.@c] = @inventorylist_id[.@i];
			.@refine[.@c] = @inventorylist_refine[.@i];
			.@card1[.@c] = @inventorylist_card1[.@i];
			.@card2[.@c] = @inventorylist_card2[.@i];
			.@card3[.@c] = @inventorylist_card3[.@i];
			.@card4[.@c] = @inventorylist_card4[.@i];
			++.@c;
		}
	}
	if ( !.@c ) {
		mes "you don't have anything useful to bet !";
		close;
	}
	.@s = select(.@menu$) -1;
	.@id = .@id[.@s];
	.@refine = .@refine[.@s];
	.@card1 = .@card1[.@s];
	.@card2 = .@card2[.@s];
	.@card3 = .@card3[.@s];
	.@card4 = .@card4[.@s];
	.@itemname$ = callfunc( "getitemname2", .@id, 1, .@refine, 0, .@card1, .@card2, .@card3, .@card4 );
	mes "Are you sure you want to auction your";
	mes .@itemname$ +" away ?";
	next;
	if ( select( "Yes", "No" ) == 2 ) close;
	mes "select the amount of "+ getitemname( .currency ) +" for the player to bet";
	next;
	if ( input( .@amount, 1, 30000 ) ) {
		mes "you have input invalid value";
		close;
	}
	mes "Confirm ?";
	mes .@itemname$;
	mes .@amount +"x "+ getitemname( .currency );
	if ( select ( "Yes", "No" ) == 2 ) close;
	close2;
	if ( !countitem2( .@id, 1, .@refine, 0, .@card1, .@card2, .@card3, .@card4 ) ) {
		dispbottom "please don't hack";
		end;
	}
	if ( .start != 0 ) {
		dispbottom "Too slow, somebody make it faster than you";
		end;
	}
	announce strcharinfo(0) +" is trying to auction "+ .@itemname$ +" !!", bc_all;
	delitem2 .@id, 1, 1, .@refine, 0, .@card1, .@card2, .@card3, .@card4;
	.id = .@id;
	.refine = .@refine;
	.card1 = .@card1;
	.card2 = .@card2;
	.card3 = .@card3;
	.card4 = .@card4;
	.aid = getcharid(3);
	.cid = getcharid(0);
	.amount = .@amount;
	.itemname$ = .@itemname$;
	.start = true;
	initnpctimer;
	end;
L_StartEvent:
	mes "Currently there are "+ .total_bet +" players betting.";
	for ( .@i = 0; .@i < .total_bet; ++.@i )
		mes ( .@i +1 )+". "+ rid2name(.bet_aid[.@i]);
	next;
	if ( getcharid(3) == .aid ) {
		mes "You are the one who placed this bet";
		close;
	}
	if ( .total_bet >= .register_limit ) {
		mes "only accept 10 maximum bets";
		close;
	}
	.@i = 0;
	while ( .bet_aid[.@i] != getcharid(3) && .@i < .total_bet ) ++.@i;
	if ( .@i < .total_bet ) {
		mes "You already placed the bet";
		close;
	}
	mes "Are you sure you want bet";
	mes .amount +"x "+ getitemname( .currency ) +" for ";
	mes .itemname$ +" ?";
	next;
	if ( select ( "Yes", "No" ) == 2 ) close;
	if ( countitem( .currency ) < .amount ) {
		mes "the minimum bet is "+ .amount +"x "+ getitemname( .currency );
		close;
	}
	if ( .start != 1 ) {
		mes "Too late";
		close;
	}
	delitem .currency, .amount;
	announce strcharinfo(0) +" has placed "+( ( Sex )? "his":"her" )+" bet for "+ .itemname$, bc_npc|bc_area;
	.bet_aid[.total_bet] = getcharid(3);
	.bet_cid[.total_bet] = getcharid(0);
	++.total_bet;
	close;
OnTimer15000: // 15 seconds
	stopnpctimer;
	.start = 2;
	announce "betting is now close. Start counting now", bc_npc|bc_area;
	sleep 1000;
	announce "There are "+ .total_bet +" players bet on "+ .itemname$, bc_npc|bc_area;
	sleep 1000;
	.@amount = 1; // this stupid mail system ...
	.@zeny = 0;
	.@give_amount = .amount * .total_bet; // why do I have to make these stupid variables ??
	if ( !.total_bet ) {
		announce "this auction has failed because nobody is joining", bc_npc|bc_area;
		mail .cid, "Rolling in the Deep", "Prize", "Nobody bet on your item, you get a refund", .@zeny, .id, .@amount, .card1, .card2, .card3, .card4;
	}
	else {
		.@r = rand(.total_bet);
		announce "The winner is "+ rid2name(.bet_aid[.@r]) +" !!", bc_npc|bc_area;
		mail .bet_cid[.@r], "Rolling in the Deep", "Prize", "This is your prize.", .@zeny, .id, .@amount, .card1, .card2, .card3, .card4;
		mail .cid, "Rolling in the Deep", "Prize", "There were "+ .total_bet +" players bet on your item.", .@zeny, .currency, .@give_amount;
	}
	.start = false;
	.id = 0;
	.refine = 0;
	.card1 = 0;
	.card2 = 0;
	.card3 = 0;
	.card4 = 0;
	.aid = 0;
	.amount = 0;
	.itemname$ = "";
	deletearray .bet_aid;
	deletearray .bet_cid;
	.total_bet = 0;
	end;
OnInit:
	.currency = 7539; // Poring_Coin
	.register_limit = 10; // only 10 people can join
	end;
}

 

LOL when I saw n0ttt post came out I was like ... WAH~~
somebody can actually finish script faster than me @_@

 

EDIT: forgot to tell the getitemname2 function, not from this topic ... 2.3
but from hercules ones
, 2.4
https://herc.ws/board/topic/11275-getitemname2/

rathena one is version 2.3 made on 2013
hercules has version 2.4 made on 2015

 

EDIT2: Radian say cannot bet equipped items, so just add @inventorylist_equip check

hi Annie how to change item currency into zeny?

Link to comment
Share on other sites

  • -1

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

btw how to make only GM to set the item? player only can bet 

Edited by melv0
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...