• 1
Sign in to follow this  
Radian

Rolling in the deep

Question

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.

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0
/* 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 ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) {
		if ( @inventorylist_equip[[email protected]] == 0 && @inventorylist_identify[[email protected]] == true && @inventorylist_attribute[[email protected]] == false && @inventorylist_expire[[email protected]] == 0 && @inventorylist_bound[[email protected]] == BOUND_NONE && ( getiteminfo( @inventorylist_id[[email protected]], 2 ) == IT_WEAPON || getiteminfo( @inventorylist_id[[email protected]], 2 ) == IT_ARMOR || getiteminfo( @inventorylist_id[[email protected]], 2 ) == IT_CARD || getiteminfo( @inventorylist_id[[email protected]], 2 ) == IT_PETEGG || getiteminfo( @inventorylist_id[[email protected]], 2 ) == IT_PETARMOR ) ) {
			[email protected]$ = callfunc( "getitemname2", @inventorylist_id[[email protected]], @inventorylist_identify, @inventorylist_refine, @inventorylist_attribute, @inventorylist_card1, @inventorylist_card2, @inventorylist_card3, @inventorylist_card4 );
			[email protected]$ = [email protected]$ + @itemname2_info$ + [email protected]$ +"; "+ @inventorylist_amount[[email protected]] +" ea.:";
			[email protected][[email protected]] = @inventorylist_id[[email protected]];
			[email protected][[email protected]] = @inventorylist_refine[[email protected]];
			[email protected][[email protected]] = @inventorylist_card1[[email protected]];
			[email protected][[email protected]] = @inventorylist_card2[[email protected]];
			[email protected][[email protected]] = @inventorylist_card3[[email protected]];
			[email protected][[email protected]] = @inventorylist_card4[[email protected]];
			[email protected];
		}
	}
	if ( [email protected] ) {
		mes "you don't have anything useful to bet !";
		close;
	}
	[email protected] = select([email protected]$) -1;
	[email protected] = [email protected][[email protected]];
	[email protected] = [email protected][[email protected]];
	[email protected] = [email protected][[email protected]];
	[email protected] = [email protected][[email protected]];
	[email protected] = [email protected][[email protected]];
	[email protected] = [email protected][[email protected]];
	[email protected]$ = callfunc( "getitemname2", [email protected], 1, [email protected], 0, [email protected], [email protected], [email protected], [email protected] );
	mes "Are you sure you want to auction your";
	mes [email protected]$ +" away ?";
	next;
	if ( select( "Yes", "No" ) == 2 ) close;
	mes "select the amount of "+ getitemname( .currency ) +" for the player to bet";
	next;
	if ( input( [email protected], 1, 30000 ) ) {
		mes "you have input invalid value";
		close;
	}
	mes "Confirm ?";
	mes [email protected]$;
	mes [email protected] +"x "+ getitemname( .currency );
	if ( select ( "Yes", "No" ) == 2 ) close;
	close2;
	if ( !countitem2( [email protected], 1, [email protected], 0, [email protected], [email protected], [email protected], [email protected] ) ) {
		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 "+ [email protected]$ +" !!", bc_all;
	delitem2 [email protected], 1, 1, [email protected], 0, [email protected], [email protected], [email protected], [email protected];
	.id = [email protected];
	.refine = [email protected];
	.card1 = [email protected];
	.card2 = [email protected];
	.card3 = [email protected];
	.card4 = [email protected];
	.aid = getcharid(3);
	.cid = getcharid(0);
	.amount = [email protected];
	.itemname$ = [email protected]$;
	.start = true;
	initnpctimer;
	end;
L_StartEvent:
	mes "Currently there are "+ .total_bet +" players betting.";
	for ( [email protected] = 0; [email protected] < .total_bet; [email protected] )
		mes ( [email protected] +1 )+". "+ rid2name(.bet_aid[[email protected]]);
	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;
	}
	[email protected] = 0;
	while ( .bet_aid[[email protected]] != getcharid(3) && [email protected] < .total_bet ) [email protected];
	if ( [email protected] < .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;
	[email protected] = 1; // this stupid mail system ...
	[email protected] = 0;
	[email protected]_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", [email protected], .id, [email protected], .card1, .card2, .card3, .card4;
	}
	else {
		[email protected] = rand(.total_bet);
		announce "The winner is "+ rid2name(.bet_aid[[email protected]]) +" !!", bc_npc|bc_area;
		mail .bet_cid[[email protected]], "Rolling in the Deep", "Prize", "This is your prize.", [email protected], .id, [email protected], .card1, .card2, .card3, .card4;
		mail .cid, "Rolling in the Deep", "Prize", "There were "+ .total_bet +" players bet on your item.", [email protected], .currency, [email protected]_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 @[email protected]

 

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

Share this post


Link to post
Share on other sites
  • 0

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?";
				[email protected] = select("Set fee "+max(1,[email protected][0])+"z","Set amount of players "+max(5,[email protected][1]),"Ready") - 1;
				if([email protected] < 2) {
					input [email protected][[email protected]];
				} 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,[email protected][0]);	// default 1 fee.
						.players = max(5,[email protected][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) {
				[email protected] = inarray(.player_aid,getcharid(3));
				if([email protected] == -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([email protected] < 3) {
		mapannounce "prontera","Roll n°"+([email protected] + 1)+".",bc_map;
		sleep 2000;
		specialeffect2 F_Rand(EF_SPINMOVE,EF_CASTSPIN2);
		sleep 2000;
		[email protected] = rand(.player_n--);
		if([email protected] == 2) {
			mapannounce "prontera","And the winner is...",bc_map;
			sleep 2500;
		}
		mapannounce "prontera",rid2name(.player_aid[[email protected]])+"...",bc_map;
		deletearray .player_aid[[email protected]],1;
		if([email protected] < 2)
			sleep 5000;
		[email protected]++;
	}
	mail .player_cid[[email protected]],"Rolling in the Deep","Prize","Here's your prize from the game",0,.prize_id,.prize_amt;
	setarray [email protected]_id[0],.coin_id;
	setarray [email protected]_amt[0],.players * .fee;
	mail .o_player,"Rolling in the Deep","Coins","Here's the coins",0,[email protected]_id,[email protected]_amt;

	// if 10 mins and nobody started the event.
OnTimer600000:
	stopnpctimer;
	// we try to give the items back in this situation.
	if([email protected]) {
		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

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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$;
	[email protected] = getarg(0);
	[email protected] = getiteminfo( [email protected], 2 );
	[email protected] = getarg(2);
	[email protected][0] = getarg(4);
	[email protected][1] = getarg(5);
	[email protected][2] = getarg(6);
	[email protected][3] = getarg(7);
	[email protected] = getarg(8,0);
	[email protected]$ = ( [email protected] )? "+"+ [email protected] +" " : "" ; // I think no need refinement check for type 4 or 5, the source automatically convert refined etc items into no refinement
	[email protected]$ = ( [email protected] = getitemslots( [email protected] ) )? " ["+ [email protected] +"]" : "" ;

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

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

//	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 [email protected]$;
}

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

	// if 10 mins and nobody started the event.
OnTimer600000:
	stopnpctimer;
	// we try to give the items back in this situation.
	if([email protected]) {
		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([email protected] = 1;[email protected] <= 5;[email protected]++) {
		if([email protected] < 5)
			deletearray getd(".item_card"[email protected]);
		deletearray getd(".item_opt"[email protected]);
		deletearray getd(".item_val"[email protected]);
		deletearray getd(".item_param"[email protected]);
	}
	.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([email protected]_identify[[email protected]]) {

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

Edited by n0tttt
AnnieRuru helped me fix it
  • Upvote 2
  • Love 1

Share this post


Link to post
Share on other sites
  • 0
5 hours ago, 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.

Share this post


Link to post
Share on other sites
  • 0

NVM. It was my mistake

 

Edited by Radian

Share this post


Link to post
Share on other sites
  • -1

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

Edited by melv0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this