Jump to content
  • 0

Rebirth system script problem || Always ask to be max lvl/jlvl


AinsLord

Question


  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

here's the script i found here i think its from @Capuche

prontera,164,174,5	script	Rebirth System	833,{
function checkItem;			// check if player have all item required
function colorItemrequired;	// color the text. Red : not enough item, green otherwise
function deleteItem;		// delete all items required
function displayItemneed;	// display all items need at start
function getItemReward;		// give the items reward
//function weightreq;			// check if your current weight is highter than weight high novice


	.@eac = eaclass();
	if ( num_rebirth4 == .reset_max ) {
		mes "You can only rebirth x"+ .reset_max +".";
		emotion e_gasp;
		close;
	}
	else if( NextJobExp || NextBaseExp || !( .@eac&EAJL_2 ) || !Upper ) {
		mes "You must be rebirth max level/max job level.";
		close;
	}

	mes "Items need :";
	displayItemneed();
	next;

	switch( select( "^777777~ Rebirth", "~ Informations", "~ Rebirth ranking", "~ Good bye^000000" ) ) {
		case 1:
			checkItem();
			deleteItem();
			break;
		case 2:
			mes "You can only rebirth ^ff0000x"+ .reset_max +"^000000. You already rebirth ^ff0000x"+ num_rebirth4 +"^000000.";
			mes "Each rebirth you get ^ff0000"+ .num_status +"^000000 status points and after ^ff0000"+ .change_reward +"^000000 rebirth, you get only some items.";
			close;
		case 4:
			mes "Bye.";
			close;
		case 3:
			mes "TOP 50 of rebirth.";
			mes "Name  -  Number of rebirth";
			.@size = query_sql( "select `name`, `num_rebirth4` from `rebirth_system` order by `num_rebirth4` desc limit 50", .@name$, .@value );
			if( .@size ) {
				for( .@i = 0; .@i < .@size; .@i++ )
					mes "^777777"+ ( .@i +1 ) +"^000000 : "+ .@name$[.@i] +" : ^FF0000"+ .@value[.@i] +"^000000";
			}
			else
				mes "^0000ff* the list is empty *^000000";
			close;
	}
	num_rebirth4 += 1;
	if ( Upper ) {	// just in case the user change the setting...
		lastJob = roclass( .@eac&EAJ_UPPERMASK );
		jobchange Job_Novice_High;
	}
	else
		jobchange Job_Novice;
	resetlvl 1;
	if ( num_rebirth < 30 )
		StatusPoint = StatusPoint + .num_status * num_rebirth;
	else
		getItemReward();
	query_sql "insert into `rebirth_system` values ( "+ getcharid(3) +", '"+ escape_sql( strcharinfo(0) ) +"', '"+ num_rebirth4 +"', '"+ getcharip() +"' ) on duplicate key update `num_rebirth4` = `num_rebirth4` +1";
	announce "[ Rebirth system ] : "+ strcharinfo(0) +" Successfully Rebirth!", 0;
	close;



function checkItem {
	for ( ; .@i < .size_item; .@i += 2 )
		if ( countitem( .item_req[.@i] ) < .item_req[ .@i+1 ] + num_rebirth4 ) {
			mes "You don't have enought "+ getitemname( .item_req[.@i] ) +". ^ff0000["+ countitem( .item_req[.@i] ) +"/"+ ( .item_req[ .@i+1 ] + num_rebirth4 ) +"]^000000";
			close;
		}
	if ( num_rebirth4 >= .change_reward )
		if ( .add_item_req[1] + num_rebirth4 - .change_reward > countitem( .add_item_req[0] ) ) {
			mes "You don't have enought "+ getitemname( .add_item_req[0] ) +". ^ff0000["+ countitem( .add_item_req[0] ) +"/"+ ( .add_item_req[1] + num_rebirth4 - .change_reward ) +"]^000000";
			close;
		}
	return;
}

function colorItemrequired {
	if ( countitem( .item_req[ getarg(0) ] ) < .item_req[ getarg(0)+1 ] + num_rebirth4 ) return "^ff0000";
	return "^00ff00";
}

function deleteItem {
	for ( ; .@i < .size_item; .@i += 2 )
		delitem .item_req[.@i], ( .item_req[ .@i+1 ] + num_rebirth4 );
	if ( num_rebirth4 >= .change_reward )
		delitem .add_item_req[0], ( .add_item_req[1] + num_rebirth4 - .change_reward );
	return;
}

function displayItemneed {
	for ( ; .@i < .size_item; .@i += 2 )
		mes colorItemrequired( .@i ) +" - x"+ ( .item_req[ .@i+1 ] + num_rebirth4 ) +" "+ getitemname( .item_req[.@i] );
	if ( num_rebirth4 >= .change_reward ) {
		if ( .add_item_req[1] + num_rebirth4 - .change_reward > countitem( .add_item_req[0] ) )
			.@color$ = "^ff0000";
		else
			.@color$ = "^00ff00";
		mes .@color$ +"- x"+ ( .add_item_req[1] + ( num_rebirth4 - .change_reward ) ) +" "+ getitemname( .add_item_req[0] );
	}
	return;
}

function getItemReward {
	for ( ; .@i < .size_reward; .@i += 2 )
		getitem .reward[.@i], .reward[ .@i+1 ];
	return;
}

function weightreq {
	if ( Weight > 20000 ) {
		mes "You have too much items on you. Your weight will be too high after rebirth.";
		close;
	}
	return;
}

OnInit:
	.reset_max = 17;		// how much reset max
	.change_reward = 15;	// after 30 rebirth, change reward
	.num_status = 500;		// + X number of status points

// item required <item ID>, <number>
	setarray .item_req, 7179, 50,
						20234, 50,
						969, 300;
	.size_item = getarraysize( .item_req );

// additionnal items after rebirth >> .change_reward
// <item ID>, <number>
	setarray .add_item_req, 7179, 100;

// rewards <item ID>, <number>
	setarray .reward, 20234, 50;
	.size_reward = getarraysize( .reward );
	end;
}

it keeps on saying you must be rebirth max lvl/max job lvl

my char is 255/120 its maxed already whats wrong

anyone can help me please

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

else if( NextJobExp || NextBaseExp || !( .@eac&EAJL_2 ) || !Upper ) {

change to

else if ( BaseLevel < 255 || JobLevel < 120 || !( .@eac&EAJL_2 ) || !Upper ) {

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

how can i make it available for ninja/gunslinger/Starglad/soul linker?? - SOLVED

EDIT:

got this error after rebirth i already import the sql file of the script - SOLVED

DB error - Unknown column 'num_rebirth4' in 'field list'

now when i reach this no stat points is added my max reset is 15

	.change_reward = 10;	// after 10 rebirth, change reward

can you help me fix this??

another one how can i reset the rankings i tried to delete info on the rebirth table still when i interact with the NPC says im still have like 20 rebirths???

and now it seems it doesnt record it on the sql here my full code script

prontera,141,179,5	script	Rebirth System	531,{
function checkItem;			// check if player have all item required
function colorItemrequired;	// color the text. Red : not enough item, green otherwise
function deleteItem;		// delete all items required
function displayItemneed;	// display all items need at start
function getItemReward;		// give the items reward
//function weightreq;			// check if your current weight is highter than weight high novice


	.@eac = eaclass();
	if ( num_rebirth == .reset_max ) {
		mes "You can only rebirth x"+ .reset_max +".";
		emotion e_gasp;
		close;
	}
	else if( BaseLevel < 255 || JobLevel < 120 || ( !( .@eac&EAJL_2 ) || !Upper ) && ( Class != Job_Ninja && Class != Job_Gunslinger && Class != Job_Soul_Linker && Class != Job_Star_Gladiator) ) {
		mes "You must be rebirth max level/max job level.";
		close;
	}

	mes "Items need :";
	displayItemneed();
	next;

	switch( select( "^777777~ Rebirth", "~ Informations", "~ Rebirth ranking", "~ Good bye^000000" ) ) {
		case 1:
			checkItem();
			deleteItem();
			break;
		case 2:
			mes "You can only rebirth ^ff0000x"+ .reset_max +"^000000. You already rebirth ^ff0000x"+ num_rebirth +"^000000.";
			mes "Each rebirth you get ^ff0000"+ .num_status +"^000000 status points and after ^ff0000"+ .change_reward +"^000000 rebirth, you get only some items.";
			close;
		case 4:
			mes "Bye.";
			close;
		case 3:
			mes "TOP 50 of rebirth.";
			mes "Name  -  Number of rebirth";
			.@size = query_sql( "select `name`, `num_rebirth` from `rebirth_system` order by `num_rebirth` desc limit 50", .@name$, .@value );
			if( .@size ) {
				for( .@i = 0; .@i < .@size; .@i++ )
					mes "^777777"+ ( .@i +1 ) +"^000000 : "+ .@name$[.@i] +" : ^FF0000"+ .@value[.@i] +"^000000";
			}
			else
				mes "^0000ff* the list is empty *^000000";
			close;
	}
	num_rebirth += 1;
	if ( Upper ) {	// just in case the user change the setting...
		lastJob = roclass( .@eac&EAJ_UPPERMASK );
		jobchange Job_Novice_High;
	}
	else
		jobchange Job_Novice;
	resetlvl 1;
	if ( num_rebirth < .change_reward ) { // And it seems if i change this to "num_rebirth >= .change_reward" it records it on the sql
		if ( Class == Job_Novice ) StatusPoint = 48;
		StatusPoint = StatusPoint + .num_status * num_rebirth;
	}
	else {
		StatusPoint = StatusPoint + .num_status * .change_reward;
		getItemReward();
	query_sql "insert into `rebirth_system` ( `account_id`, `name`, `num_rebirth`, `last_ip` ) select "+ getcharid(3) +", '"+ escape_sql( strcharinfo(0) ) +"', '"+ num_rebirth +"',`login`.`last_ip` from `login` where `login`.`account_id` = "+ getcharid(3) +" on duplicate key update `rebirth_system`.`num_rebirth` = `rebirth_system`.`num_rebirth` +1";
	announce "[ Rebirth system ] : "+ strcharinfo(0) +" Successfully Rebirth!", 0;
	close;

}

function checkItem {
	for ( ; .@i < .size_item; .@i += 2 )
		if ( countitem( .item_req[.@i] ) < .item_req[ .@i+1 ] + num_rebirth ) {
			mes "You don't have enought "+ getitemname( .item_req[.@i] ) +". ^ff0000["+ countitem( .item_req[.@i] ) +"/"+ ( .item_req[ .@i+1 ] + num_rebirth ) +"]^000000";
			close;
		}
	if ( num_rebirth >= .change_reward )
		if ( .add_item_req[1] + num_rebirth - .change_reward > countitem( .add_item_req[0] ) ) {
			mes "You don't have enought "+ getitemname( .add_item_req[0] ) +". ^ff0000["+ countitem( .add_item_req[0] ) +"/"+ ( .add_item_req[1] + num_rebirth - .change_reward ) +"]^000000";
			close;
		}
	return;
}

function colorItemrequired {
	if ( countitem( .item_req[ getarg(0) ] ) < .item_req[ getarg(0)+1 ] + num_rebirth ) return "^ff0000";
	return "^00ff00";
}

function deleteItem {
	for ( ; .@i < .size_item; .@i += 2 )
		delitem .item_req[.@i], ( .item_req[ .@i+1 ] + num_rebirth );
	if ( num_rebirth >= .change_reward )
		delitem .add_item_req[0], ( .add_item_req[1] + num_rebirth - .change_reward );
	return;
}

function displayItemneed {
	for ( ; .@i < .size_item; .@i += 2 )
		mes colorItemrequired( .@i ) +" - x"+ ( .item_req[ .@i+1 ] + num_rebirth ) +" "+ getitemname( .item_req[.@i] );
	if ( num_rebirth >= .change_reward ) {
		if ( .add_item_req[1] + num_rebirth - .change_reward > countitem( .add_item_req[0] ) )
			.@color$ = "^ff0000";
		else
			.@color$ = "^00ff00";
		mes .@color$ +"- x"+ ( .add_item_req[1] + ( num_rebirth - .change_reward ) ) +" "+ getitemname( .add_item_req[0] );
	}
	return;
}

function getItemReward {
	for ( ; .@i < .size_reward; .@i += 2 )
		getitem .reward[.@i], .reward[ .@i+1 ];
	return;
}

function weightreq {
	if ( Weight > 20000 ) {
		mes "You have too much items on you. Your weight will be too high after rebirth.";
		close;
	}
	return;
}

OnInit:
	.reset_max = 200;		// how much reset max
	.change_reward = 150;	// after 30 rebirth, change reward
	.num_status = 10;		// + X number of status points

// item required <item ID>, <number>
	setarray .item_req, 7179, 50,
						7227, 50,
						969, 300;
	.size_item = getarraysize( .item_req );

// additionnal items after rebirth >> .change_reward
// <item ID>, <number>
	setarray .add_item_req, 7179, 100;

// rewards <item ID>, <number>
	setarray .reward, 674, 50;
	.size_reward = getarraysize( .reward );
	end;
}
	if ( num_rebirth < .change_reward ) { // And it seems if i change this to "num_rebirth >= .change_reward" it records it on the sql

and i have this one it record on sql but i tried to create new char same account it goes to the 1st char that did reset 1st like test1 resets 100 then i created test2, test2 resets goes to test1 so that makes 101 reset for test1 heres the script

prontera,141,179,5	script	Rebirth System	531,{

function checkItem;	// check if player have all item required

function colorItemrequired;	// color the text. Red : not enough item, green otherwise

function deleteItem;	// delete all items required

function displayItemneed;	// display all items need at start

function getItemReward;	// give the items reward

//function weightreq;	// check if your current weight is highter than weight high novice

.@eac = eaclass();

if ( num_rebirth == .reset_max ) {

mes "You can only rebirth x"+ .reset_max +".";

emotion e_gasp;

close;

}
	else if( BaseLevel < 255 || JobLevel < 120 || ( !( .@eac&EAJL_2 ) || !Upper ) && ( Class != Job_Ninja && Class != Job_Gunslinger && Class != Job_Soul_Linker && Class != Job_Star_Gladiator) ) {

mes "You must be rebirth max level/max job level.";

close;

}

mes "Items need :";

displayItemneed();

next;

	switch( select( "^777777~ Rebirth", "~ Informations", "~ Rebirth ranking", "~ Good bye^000000" ) ) {

case 1:


checkItem();

deleteItem();

break;

case 2:

mes "You can only rebirth ^ff0000x"+ .reset_max +"^000000. You already rebirth ^ff0000x"+ num_rebirth +"^000000.";

mes "Each rebirth you get ^ff0000"+ .num_status +"^000000 status points and after ^ff0000"+ .change_reward +"^000000 rebirth, you get only some items.";

close;

case 3:

mes "Bye.";

case 4:
			mes "TOP 50 of rebirth.";
			mes "Name  -  Number of rebirth";
			.@size = query_sql( "select `name`, `num_rebirth` from `rebirth_system` order by `num_rebirth` desc limit 50", .@name$, .@value );
			if( .@size ) {
				for( .@i = 0; .@i < .@size; .@i++ )
					mes "^777777"+ ( .@i +1 ) +"^000000 : "+ .@name$[.@i] +" : ^FF0000"+ .@value[.@i] +"^000000";
			}
			else
				mes "^0000ff* the list is empty *^000000";
			close;

}

num_rebirth += 1;

if ( Upper ) {	// just in case the user change the setting...

lastJob = roclass( .@eac&EAJ_UPPERMASK );

jobchange Job_Novice_High;

}

else

jobchange Job_Novice;

resetlvl 1;

if ( num_rebirth < .change_reward )

StatusPoint = StatusPoint + .num_status * num_rebirth;

else

getItemReward();

	query_sql "insert into `rebirth_system` ( `account_id`, `name`, `num_rebirth`, `last_ip` ) select "+ getcharid(3) +", '"+ escape_sql( strcharinfo(0) ) +"', '"+ num_rebirth +"',`login`.`last_ip` from `login` where `login`.`account_id` = "+ getcharid(3) +" on duplicate key update `rebirth_system`.`num_rebirth` = `rebirth_system`.`num_rebirth` +1";

announce "[ Rebirth system ] : "+ strcharinfo(0) +" rebirth for the "+ num_rebirth +" time !", 0;

close;

function checkItem {

for ( ; .@i < .size_item; .@i += 2 )

if ( countitem( .item_req[.@i] ) < .item_req[ .@i+1 ] + num_rebirth ) {

mes "You don't have enought "+ getitemname( .item_req[.@i] ) +". ^ff0000["+ countitem( .item_req[.@i] ) +"/"+ ( .item_req[ .@i+1 ] + num_rebirth ) +"]^000000";

close;

}

if ( num_rebirth >= .change_reward )

if ( .add_item_req[1] + num_rebirth - .change_reward > countitem( .add_item_req[0] ) ) {

mes "You don't have enought "+ getitemname( .add_item_req[0] ) +". ^ff0000["+ countitem( .add_item_req[0] ) +"/"+ ( .add_item_req[1] + num_rebirth - .change_reward ) +"]^000000";

close;

}

return;

}

function colorItemrequired {

if ( countitem( .item_req[ getarg(0) ] ) < .item_req[ getarg(0)+1 ] + num_rebirth ) return "^ff0000";

return "^00ff00";

}

function deleteItem {

for ( ; .@i < .size_item; .@i += 2 )

delitem .item_req[.@i], ( .item_req[ .@i+1 ] + num_rebirth );

if ( num_rebirth >= .change_reward )

delitem .add_item_req[0], ( .add_item_req[1] + num_rebirth - .change_reward );

return;

}

function displayItemneed {

for ( ; .@i < .size_item; .@i += 2 )

mes colorItemrequired( .@i ) +" - x"+ ( .item_req[ .@i+1 ] + num_rebirth ) +" "+ getitemname( .item_req[.@i] );

if ( num_rebirth >= .change_reward ) {

if ( .add_item_req[1] + num_rebirth - .change_reward > countitem( .add_item_req[0] ) )

.@color$ = "^ff0000";

else

.@color$ = "^00ff00";

mes .@color$ +"- x"+ ( .add_item_req[1] + ( num_rebirth - .change_reward ) ) +" "+ getitemname( .add_item_req[0] );

}

return;

}

function getItemReward {

for ( ; .@i < .size_reward; .@i += 2 )

getitem .reward[.@i], .reward[ .@i+1 ];

return;

}

function weightreq {

if ( Weight > 20000 ) {

mes "You have too much items on you. Your weight will be too high after rebirth.";

close;

}

return;

}

OnInit:

.reset_max = 200;	// how much reset max

.change_reward = 150;	// after 30 rebirth, change reward

.num_status = 10;	// + X number of status points

// item required <item ID>, <number>

setarray .item_req, 7179, 5,

7227, 2,

969, 3;

.size_item = getarraysize( .item_req );

// additionnal items after rebirth >> .change_reward

// <item ID>, <number>

setarray .add_item_req, 601, 1;

// rewards <item ID>, <number>

setarray .reward, 504, 1;

.size_reward = getarraysize( .reward );

end;

}



Tnx in advance @Emistry

Edited by whodhell
further info
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...