Jump to content
  • 0

Rebirth System [50 Rebirths]


WhatFT

Question


  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

Can anyone got this kind of script? Or If anyone can make some script like this?

 

What kind of Rebirth System :

 

  • Only works in rAthena.
  • Maximum Rebirth is 50.
  • Each rebirth will give 300 Stat Points until they reach 30th Rebirth.
  • Once they reach the 30th Rebirth, they will now receive Items instead of Stat Points until they reach the 50th Rebirth. 
  • The Rebirth NPC will always check their weight limit before they rebirth, If their weight is quite large then the NPC won't make them rebirth.
  • Players who got to rebirth will be Broadcasted.
  • Players that have finished their Rebirth Stages will reset their Levels back into 1 including their Stat Point (This does not affect the additional Stat Points per rebirth, It will still remain).
  • Players can only Rebirth once they have the Single Item Requirement. (Like Rebirth Ticket)
  • Optional : Saves the rebirth of each character in the logs of Account ID, Character Name, No. of Reborn and IP Address.

 

How the Rebirth System works :

 

  • Each Rebirth will have atleast 5 Item Requirements like (Sample) 512, 513, 514, 515, 516...
  • Each Rebirth will increase the amount of the Item Requirements by 1 until it reaches the 30th Rebirth.
  • Once the player reaches 30th Rebirth, there will be an Additional Item Requirement, (Sample) Item ID 505..

 

Hope someone will share or make some kind of this script... THANK YOU!

Link to comment
Share on other sites

Recommended Posts

  • 0

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

Can anyone got this kind of script? Or If anyone can make some script like this?

 

 

/*
CREATE TABLE IF NOT EXISTS `rebirth_system` (
  `account_id` int(11) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL DEFAULT 'NULL',
  `num_rebirth` int(11) unsigned NOT NULL default '0',
  `last_ip` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`account_id`)
) ENGINE=MyISAM;
*/

prontera,150,170,5	script	Spec	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_rebirth == .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", "~ Good bye^000000" ) ) {
		case 1:
			weightreq();
			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.";
			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` values ( "+ getcharid(3) +", '"+ escape_sql( strcharinfo(0) ) +"', '"+ num_rebirth +"', '"+ getcharip() +"' ) on duplicate key update `num_rebirth` = `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 = 50;		// how much reset max
	.change_reward = 30;	// after 30 rebirth, change reward
	.num_status = 300;		// + X number of status points

// item required <item ID>, <number>
	setarray .item_req, 501, 5,
						502, 2,
						503, 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;
}

EDIT: fix a small typo

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

Can anyone got this kind of script? Or If anyone can make some script like this?

 

 

/*
CREATE TABLE IF NOT EXISTS `rebirth_system` (
  `account_id` int(11) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL DEFAULT 'NULL',
  `num_rebirth` int(11) unsigned NOT NULL default '0',
  `last_ip` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`account_id`)
) ENGINE=MyISAM;
*/

prontera,150,170,5	script	Spec	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_rebirth == .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", "~ Good bye^000000" ) ) {
		case 1:
			weightreq();
			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.";
			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 < 30 )
		StatusPoint = StatusPoint + .num_status * num_rebirth;
	else
		getItemReward();
	query_sql "insert into `rebirth_system` values ( "+ getcharid(3) +", '"+ escape_sql( strcharinfo(0) ) +"', '"+ num_rebirth +"', '"+ getcharip() +"' ) on duplicate key update `num_rebirth` = `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 = 50;		// how much reset max
	.change_reward = 30;	// after 30 rebirth, change reward
	.num_status = 300;		// + X number of status points

// item required <item ID>, <number>
	setarray .item_req, 501, 5,
						502, 2,
						503, 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;
}

Thanks Capuche ! I'll update the script if there is some errors.. THANK YOU!

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

Can anyone got this kind of script? Or If anyone can make some script like this?

 

 

/*
CREATE TABLE IF NOT EXISTS `rebirth_system` (
  `account_id` int(11) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL DEFAULT 'NULL',
  `num_rebirth` int(11) unsigned NOT NULL default '0',
  `last_ip` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`account_id`)
) ENGINE=MyISAM;
*/

Where do you add this?

Link to comment
Share on other sites

  • 0

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

Execute it in mysql

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

Can I remove this if I want no Items to be rewarded?

function getItemReward {
	for ( ; .@i < .size_reward; .@i += 2 )
		getitem .reward[.@i], .reward[ .@i+1 ];
	return;
}
	else
		getItemReward();
	query_sql "insert into `rebirth_system` values ( "+ getcharid(3) +", '"+ escape_sql( strcharinfo(0) ) +"', '"+ num_rebirth +"', '"+ getcharip() +"' ) on duplicate key update `num_rebirth` = `num_rebirth` +1";
	announce "[ Rebirth system ] : "+ strcharinfo(0) +" rebirth for the "+ num_rebirth +" time !", 0;
	close;

Execute it in mysql

Edited by Yudax
Link to comment
Share on other sites

  • 0

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

you didnt clicked on the scheme that you want to load this sql script .... 

Error Code: 1046. No database selected Select the default DB to be used by double-clicking its name in the SCHEMAS list in the sidebar.
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  248
  • Reputation:   7
  • Joined:  11/27/12
  • Last Seen:  

you didnt clicked on the scheme that you want to load this sql script .... 

Error Code: 1046. No database selected Select the default DB to be used by double-clicking its name in the SCHEMAS list in the sidebar.

Thanks emistry, its all good now. Just some modifications on the script itself.

Link to comment
Share on other sites

  • 0

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

Can I remove this if I want no Items to be rewarded?

Remove

	else
		getItemReward();

 

or comment

setarray .reward, 504, 1;
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  80
  • Topics Per Day:  0.02
  • Content Count:  325
  • Reputation:   76
  • Joined:  03/22/12
  • Last Seen:  

Thanks to this script :)



How to remove

"change reward" if they got 30 time rebirth?

 

i want to still getting status points until 50

Link to comment
Share on other sites

  • 0

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

i want to still getting status points until 50

 

Then change the value to 51

.change_reward = 51;

 

 

Also change this line (I forgot to make it)

if ( num_rebirth < 30 )

to

if ( num_rebirth < .change_reward )
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   1
  • Joined:  09/07/12
  • Last Seen:  

What If I reset stats? I suppose I'm going to lose the points I earned. Any idea about how to prevent that from happening?

Link to comment
Share on other sites

  • 0

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

In your reset stat npc, after a reset add

StatusPoint = StatusPoint + .num_status * num_rebirth;

replacing .num_status defined in this npc :

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

 

With this, you get the status points you earned.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

errouj.jpg

 

I got this error

Link to comment
Share on other sites

  • 0

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

You don't have getcharip() command. So replace the current query by this one :

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";

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  91
  • Topics Per Day:  0.02
  • Content Count:  309
  • Reputation:   6
  • Joined:  04/24/12
  • Last Seen:  

how to change the reward to #cashpoints every rebirth will recieve 50 CASHPOINTS.. .thanks

Link to comment
Share on other sites

  • 0

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

	if ( num_rebirth < .change_reward )
		StatusPoint = StatusPoint + .num_status * num_rebirth;
	else
		getItemReward();

replace by

    if ( num_rebirth < .change_reward )
        StatusPoint = StatusPoint + .num_status * num_rebirth;
    #CASHPOINTS = #CASHPOINTS + 50;
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  49
  • Reputation:   0
  • Joined:  11/30/11
  • Last Seen:  

Can't we just use a regular character variable for the rebirths? 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  91
  • Topics Per Day:  0.02
  • Content Count:  309
  • Reputation:   6
  • Joined:  04/24/12
  • Last Seen:  

	if ( num_rebirth < .change_reward )
		StatusPoint = StatusPoint + .num_status * num_rebirth;
	else
		getItemReward();

replace by

    if ( num_rebirth < .change_reward )
        StatusPoint = StatusPoint + .num_status * num_rebirth;
    #CASHPOINTS = #CASHPOINTS + 50;

Thanks Capuche!

Link to comment
Share on other sites

  • 0

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

Can't we just use a regular character variable for the rebirths? 

num_rebirth (character variable) already count the number of rebirth

Is that you mean?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  49
  • Reputation:   0
  • Joined:  11/30/11
  • Last Seen:  

Well, this might be offtopic but I wanna know what's the difference of using the normal character variable, the one found in global_reg_something, and the one you just made where you create a new table.

Link to comment
Share on other sites

  • 0

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

Well, this might be offtopic but I wanna know what's the difference of using the normal character variable, the one found in global_reg_something, and the one you just made where you create a new table.

This script doesn't use sql query to retrieve the rebirth count in the table. It use a character variable to get/save the value. The sql part is optionnal, it allows you to check the name, ip, count etc.. easily if you need.

 

It's Paulinds's request (first post)

Optional : Saves the rebirth of each character in the logs of Account ID, Character Name, No. of Reborn and IP Address.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

Bump on this, 

 

When it reaches in Rebirth 30, the stat points from the previous 29 rebirths already vanished/doesn't stay at all.

 

About reset stats, resetting the stat points can also reset its rebirth stat points.. how to prevent them from losing? any idea?

Link to comment
Share on other sites

  • 0

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

ur right there is a bug

replace

	else
		jobchange Job_Novice;
	resetlvl 1;
	if ( num_rebirth < .change_reward )
		StatusPoint = StatusPoint + .num_status * num_rebirth;
	else
		getItemReward();

by

	else
		jobchange Job_Novice;
	resetlvl 1;
	if ( num_rebirth < .change_reward )
		StatusPoint = StatusPoint + .num_status * num_rebirth;
	else {
		StatusPoint = StatusPoint + .num_status * .change_reward;
		getItemReward();
	}

 

About reset stats, resetting the stat points can also reset its rebirth stat points.. how to prevent them from losing? any idea?

add theses lines in your resetter after resetlvl command to give the extra statpoints

	if ( num_rebirth < getvariableofnpc( .change_reward,"Spec" ) )
		StatusPoint = StatusPoint + getvariableofnpc( .num_status,"Spec" ) * num_rebirth;
	else
		StatusPoint = StatusPoint + getvariableofnpc( .num_status,"Spec" ) * getvariableofnpc( .change_reward,"Spec" );

(change the "Spec" into your npcname)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

ur right there is a bug

replace

	else
		jobchange Job_Novice;
	resetlvl 1;
	if ( num_rebirth < .change_reward )
		StatusPoint = StatusPoint + .num_status * num_rebirth;
	else
		getItemReward();

by

	else
		jobchange Job_Novice;
	resetlvl 1;
	if ( num_rebirth < .change_reward )
		StatusPoint = StatusPoint + .num_status * num_rebirth;
	else {
		StatusPoint = StatusPoint + .num_status * .change_reward;
		getItemReward();
	}

 

About reset stats, resetting the stat points can also reset its rebirth stat points.. how to prevent them from losing? any idea?

add theses lines in your resetter after resetlvl command to give the extra statpoints

	if ( num_rebirth < getvariableofnpc( .change_reward,"Spec" ) )
		StatusPoint = StatusPoint + getvariableofnpc( .num_status,"Spec" ) * num_rebirth;
	else
		StatusPoint = StatusPoint + getvariableofnpc( .num_status,"Spec" ) * getvariableofnpc( .change_reward,"Spec" );

(change the "Spec" into your npcname)

 

The script works fine but It has quite a few problem. The Rebirth NPC doesn't make the EXPANDED JOBS reborn.

 

Here is my actual script..

//Only works in rAthena.
//Maximum Rebirth is 50.
//Each rebirth will give 300 Stat Points until they reach 30th Rebirth.
//Once they reach the 30th Rebirth, they will now receive Items instead of Stat Points until they reach the 50th Rebirth. 
//The Rebirth NPC will always check their weight limit before they rebirth, If their weight is quite large then the NPC won't make them rebirth.
//Players who got to rebirth will be Broadcasted.
//Players that have finished their Rebirth Stages will reset their Levels back into 1 including their Stat Point (This does not affect the additional Stat Points per rebirth, It will still remain).
//Players can only Rebirth once they have the Single Item Requirement. (Like Rebirth Ticket)
//Saves the rebirth of each character in the logs of Account ID, Character Name, No. of Reborn and IP Address.
//=================================================================================================
//*/
//CREATE TABLE IF NOT EXISTS `rebirth_system` (
//  `account_id` int(11) unsigned NOT NULL default '0',
//  `name` varchar(255) NOT NULL DEFAULT 'NULL',
//  `num_rebirth` int(11) unsigned NOT NULL default '0',
// `last_ip` varchar(100) NOT NULL default '',
//  PRIMARY KEY  (`account_id`)
//) ENGINE=MyISAM;
//*/

prontera,163,190,5	script	Rebirth	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_rebirth == .reset_max ) {
		mes "You can only rebirth x"+ .reset_max +".";
		emotion e_gasp;
		close;
	}
	else if( NextJobExp || NextBaseExp || !( .@eac&EAJL_2 ) || !Upper ) {
		mes "Your Base & Job Lv must be maximum before you rebirth.";
		close;
	}

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

	switch( select( "^777777~ Rebirth", "~ Informations", "~ Good bye^000000" ) ) {
		case 1:
			weightreq();
			checkItem();
			deleteItem();
			break;
		case 2:
			mes "You can only rebirth ^ff0000x"+ .reset_max +"^000000. You already have ^ff0000x"+ num_rebirth +"^000000 Rebirth.";
			mes "Each rebirth you get ^ff0000"+ .num_status +"^000000 Stat Points and after ^ff0000"+ .change_reward +"^000000 rebirth, you can receive 5x Donate Ticket as a reward!";
			close;
		case 3:
			mes "Bye.";
			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 {
		StatusPoint = StatusPoint + .num_status * .change_reward;
		getItemReward();
	}
	query_sql "insert into `rebirth_system` values ( "+ getcharid(3) +", '"+ escape_sql( strcharinfo(0) ) +"', '"+ num_rebirth +"', '"+ getcharip() +"' ) on duplicate key update `num_rebirth` = `num_rebirth` +1";
	announce "[ Rebirth system ] : "+ strcharinfo(0) +" has been reborn for "+ num_rebirth +" times !", 0;
	set ClassHelper,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 = 50;		// how much reset max
	.change_reward = 30;	// after 30 rebirth, change reward
	.num_status = 100;		// + X number of status points

// item required <item ID>, <number>
	setarray .item_req, 7230, 8,
						7730, 1,
						7259, 3;
	.size_item = getarraysize( .item_req );

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

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

Thank You :)

Bump!

Link to comment
Share on other sites

  • 0

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

Add an exception for the expanded class in the line

else if( NextJobExp || NextBaseExp || !( .@eac&EAJL_2 ) || !Upper ) {
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...