Jump to content
  • 0

Stats Gambler NPC


Kariton Revolution

Question


  • Group:  Members
  • Topic Count:  161
  • Topics Per Day:  0.04
  • Content Count:  429
  • Reputation:   5
  • Joined:  11/21/11
  • Last Seen:  

Can someone help me to do this script?

 

Gambler stats 

 

item needed 607

 

1 607 = to random Bonus allstats :D 

 

 

Link to comment
Share on other sites

24 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

1 607 = to random Bonus allstats :D

Permanent ? how many stats ?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

prontera,155,169,5	script	sdfgddhj	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	.@r = rand( .min_stat,.max_stat );
	for ( .@i = 13; .@i < 19; .@i++ )
		statusup2 .@i, .@r;
	dispbottom "You got +"+ .@r +" allstats";
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	.min_stat = 1;	// min allstats
	.max_stat = 200;	// max
	end;
}

 

Like this ?

Nb. : It's permanent, not a bonus +allstats

        You can't bypass your maxstat defined in battle conf

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  161
  • Topics Per Day:  0.04
  • Content Count:  429
  • Reputation:   5
  • Joined:  11/21/11
  • Last Seen:  

its not working :( im using 3ceam svn 
sorry for late reply 

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Try this one

prontera,155,169,5	script	sdfgddhj	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	set .@r, rand( .min_stat,.max_stat );
	for ( set .@i, 13; .@i < 19; set .@i, .@i +1 )
		statusup2 .@i, .@r;
	dispbottom "You got +"+ .@r +" allstats";
	end;
OnInit:
	set .num_req, 1;	// number item 607 required to gamble
	set .min_stat, 1;	// min allstats
	set .max_stat, 200;	// max
	end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

prontera,155,169,5	script	sdfgddhj	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	.@r = rand( .min_stat,.max_stat );
	for ( .@i = 13; .@i < 19; .@i++ )
		statusup2 .@i, .@r;
	dispbottom "You got +"+ .@r +" allstats";
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	.min_stat = 1;	// min allstats
	.max_stat = 200;	// max
	end;
}

 

Like this ?

Nb. : It's permanent, not a bonus +allstats

        You can't bypass your maxstat defined in battle conf

 

can u make its not permanent ? 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  161
  • Topics Per Day:  0.04
  • Content Count:  429
  • Reputation:   5
  • Joined:  11/21/11
  • Last Seen:  

prontera,155,169,5	script	sdfgddhj	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	.@r = rand( .min_stat,.max_stat );
	for ( .@i = 13; .@i < 19; .@i++ )
		statusup2 .@i, .@r;
	dispbottom "You got +"+ .@r +" allstats";
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	.min_stat = 1;	// min allstats
	.max_stat = 200;	// max
	end;
}

Like this ?

Nb. : It's permanent, not a bonus +allstats

        You can't bypass your maxstat defined in battle conf

 

sir is that possible to make the statspoint given to bonus statspoint? here look the red rectangle :D

post-467-0-40670700-1405955268_thumb.jpg

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

prontera,155,169,5	script	rstat	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	.@r = rand( .min_stat,.max_stat );
	for ( .@i = 203; .@i < 209; .@i++ )
		sc_start .@i,1200000,.@r;
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	.min_stat = 1;	// min allstats
	.max_stat = 200;	// max
	end;	
}

Maybe you can do it this way :)

Edited by Normynator
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  161
  • Topics Per Day:  0.04
  • Content Count:  429
  • Reputation:   5
  • Joined:  11/21/11
  • Last Seen:  

prontera,155,169,5	script	rstat	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	.@r = rand( .min_stat,.max_stat );
	for ( .@i = 203; .@i < 209; .@i++ )
		sc_start .@i,1200000,.@r;
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	.min_stat = 1;	// min allstats
	.max_stat = 200;	// max
	end;	
}

Maybe you can do it this way :)

 

 

prontera,155,169,5	script	rstat	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	.@r = rand( .min_stat,.max_stat );
	for ( .@i = 203; .@i < 209; .@i++ )
		sc_start .@i,1200000,.@r;
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	.min_stat = 1;	// min allstats
	.max_stat = 200;	// max
	end;	
}

Maybe you can do it this way :)

 

how to make this for example

 

my 1st gamble i get 

all stats + 50

i try it to gamble again and my csecond gamble i get 

allstats + 100

my stats point will be 150 

i want to make it if the 1st gamble i received 50 statspoint and if i gamble again the 1st and the 2nd gamble will not add i want only 100 allstats will affect and the 50 will not be affect

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

So everytime you gamble should set new stats and throw the old stats?

1st Gamble = 50

2nd Gamble = 70

== keep 2nd, throw 1st

Right ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  161
  • Topics Per Day:  0.04
  • Content Count:  429
  • Reputation:   5
  • Joined:  11/21/11
  • Last Seen:  

yes 

 

So everytime you gamble should set new stats and throw the old stats?

1st Gamble = 50

2nd Gamble = 70

== keep 2nd, throw 1st

Right ?

yes thats it :D!

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

Ok I'll change it, update in around an hour ;)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  161
  • Topics Per Day:  0.04
  • Content Count:  429
  • Reputation:   5
  • Joined:  11/21/11
  • Last Seen:  

Ok I'll change it, update in around an hour ;)

Thankyou so much ! :D!

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

Update:

prontera,155,169,5	script	rstat	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	.@r = rand( .min_stat,.max_stat );
	for ( .@i = 203; .@i < 209; .@i++ )
		 sc_end .@i;
	for ( .@i = 203; .@i < 209; .@i++ )
		sc_start .@i,1200000, .@r;
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	.min_stat = 1;	// min allstats
	.max_stat = 200;	// max
	end;	
}

i hope its fine now :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  161
  • Topics Per Day:  0.04
  • Content Count:  429
  • Reputation:   5
  • Joined:  11/21/11
  • Last Seen:  

Update:

prontera,155,169,5	script	rstat	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	.@r = rand( .min_stat,.max_stat );
	for ( .@i = 203; .@i < 209; .@i++ )
		 sc_end .@i;
	for ( .@i = 203; .@i < 209; .@i++ )
		sc_start .@i,1200000, .@r;
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	.min_stat = 1;	// min allstats
	.max_stat = 200;	// max
	end;	
}

i hope its fine now :)

THANKYOU so much SIR :D!

sir for the last :D LUK is not working and how i can make a percent like

300 allstats = 10% chance

200 Allstats = 15% chance

100 Allstats - 20% Chance

30 allstats = 50%

20 Allstats = 70%

3 Allstats = 90% 

is this possible sir ? :D thankyou very much 

 

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

Luk works for me...

prontera,155,169,5	script	rstat	56,{
	.@r = rand(0,100);
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	
	for ( .@i = 203; .@i < 209; .@i++ )
		sc_end .@i;
	
	if ( .@r >= 90 ) {
		.@s = 300;
	}else if (.@r >= 85){
		.@s = 200;
	}else if (.@r >= 80){
		.@s = 100;
	}else if (.@r >= 50){
		.@s = 30;
	}else if (.@r >= 30){
		.@s = 20;
	}else if (.@r >= 10){
		.@s = 3;
	}else{
		mes "Statbonus Failed";
		close;
	}
	
	mes "Stats changed: " + .@s;
	//mes .@r + "  " + .@s;
	//.@r = rand( .min_stat,.max_stat );
	for ( .@i = 203; .@i < 209; .@i++ )
		sc_start .@i,1200000, .@s;
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	end;	
}

I hope new script works :)

Sry for changing the original soo much :(

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

I made it yesterday, untested. Just to give my version

prontera,155,169,5	script	rstat	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	delitem 607,1;
	.@r = rand( .min_stat,.max_stat );
	if ( .@r < stat_bonus ) {
		dispbottom "you only get "+ .@r +", your previous bonus were "+ stat_bonus;
		end;
	}
	dispbottom "your new bonus stat are "+ .@r +". Equip something to see your news stats";
	stat_bonus = .@r;
	end;
OnPCStatCalcEvent:
	bonus bAllStats, stat_bonus;
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	.min_stat = 1;	// min allstats
	.max_stat = 200;	// max
	end;	
}
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

 

I made it yesterday, untested. Just to give my version

prontera,155,169,5	script	rstat	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	delitem 607,1;
	.@r = rand( .min_stat,.max_stat );
	if ( .@r < stat_bonus ) {
		dispbottom "you only get "+ .@r +", your previous bonus were "+ stat_bonus;
		end;
	}
	dispbottom "your new bonus stat are "+ .@r +". Equip something to see your news stats";
	stat_bonus = .@r;
	end;
OnPCStatCalcEvent:
	bonus bAllStats, stat_bonus;
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	.min_stat = 1;	// min allstats
	.max_stat = 200;	// max
	end;	
}

I tried the

bonus bType, delta

too, but it is only for itemscripts and it wont work :( unfortunetly

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

 

OnPCStatCalcEvent:

This special label triggers when a player's stats are recalculated, such as when

changing stats, equipment, or maps, as well as when logging in, leveling up, and

mounting a job mount. This can be used to grant additional item bonuses to certain

player groups, for instance.

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  161
  • Topics Per Day:  0.04
  • Content Count:  429
  • Reputation:   5
  • Joined:  11/21/11
  • Last Seen:  

 

I made it yesterday, untested. Just to give my version

prontera,155,169,5	script	rstat	56,{
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	delitem 607,1;
	.@r = rand( .min_stat,.max_stat );
	if ( .@r < stat_bonus ) {
		dispbottom "you only get "+ .@r +", your previous bonus were "+ stat_bonus;
		end;
	}
	dispbottom "your new bonus stat are "+ .@r +". Equip something to see your news stats";
	stat_bonus = .@r;
	end;
OnPCStatCalcEvent:
	bonus bAllStats, stat_bonus;
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	.min_stat = 1;	// min allstats
	.max_stat = 200;	// max
	end;	
}

sir capuche :) its not adding  the statspoint i get on gambler :D 

Luk works for me...

prontera,155,169,5	script	rstat	56,{
	.@r = rand(0,100);
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	
	for ( .@i = 203; .@i < 209; .@i++ )
		sc_end .@i;
	
	if ( .@r >= 90 ) {
		.@s = 300;
	}else if (.@r >= 85){
		.@s = 200;
	}else if (.@r >= 80){
		.@s = 100;
	}else if (.@r >= 50){
		.@s = 30;
	}else if (.@r >= 30){
		.@s = 20;
	}else if (.@r >= 10){
		.@s = 3;
	}else{
		mes "Statbonus Failed";
		close;
	}
	
	mes "Stats changed: " + .@s;
	//mes .@r + "  " + .@s;
	//.@r = rand( .min_stat,.max_stat );
	for ( .@i = 203; .@i < 209; .@i++ )
		sc_start .@i,1200000, .@s;
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	end;	
}

I hope new script works :)

Sry for changing the original soo much :(

 

Luk works for me...

prontera,155,169,5	script	rstat	56,{
	.@r = rand(0,100);
	if ( countitem( 607 ) < .num_req ) {
		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
		end;
	}
	else if ( select( "Gamble", "Leave" ) -1 ) end;
	
	for ( .@i = 203; .@i < 209; .@i++ )
		sc_end .@i;
	
	if ( .@r >= 90 ) {
		.@s = 300;
	}else if (.@r >= 85){
		.@s = 200;
	}else if (.@r >= 80){
		.@s = 100;
	}else if (.@r >= 50){
		.@s = 30;
	}else if (.@r >= 30){
		.@s = 20;
	}else if (.@r >= 10){
		.@s = 3;
	}else{
		mes "Statbonus Failed";
		close;
	}
	
	mes "Stats changed: " + .@s;
	//mes .@r + "  " + .@s;
	//.@r = rand( .min_stat,.max_stat );
	for ( .@i = 203; .@i < 209; .@i++ )
		sc_start .@i,1200000, .@s;
	end;
OnInit:
	.num_req = 1;	// number item 607 required to gamble
	end;	
}

I hope new script works :)

Sry for changing the original soo much :(

thankyou sir normynator :D! luk is not working on me :D but its ok  thankyou so much sir

i will both of your script on my server thankyou so much sir normynator and sir capuche!

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

Oh ok :( I'll try to fix it soon ^^

@capuche: I tried your script as well and I don't understand why it's not working

I'll test this:

http://rathena.org/board/topic/75332-addting-stats/

Edited by Normynator
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

It's working, you just need to relog or equip something to update yours stats bonus

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

ah ok, well i see... sry

 

@Kariton Revolution:

- go to db/const.txt

- search "SC_LUKFOOD"

 

then tell me the number.

it should be:  SC_LUKFOOD 208

Edited by Normynator
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  168
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

how can this be permanent .. even i log out , Reset stats , Or dead thanks

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...