Jump to content
  • 0

Character Rollback NPC


frankcastle11

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  01/21/18
  • Last Seen:  

Good day! Was wondering if there's a script out there that rolls a character back to being a Novice with Skill and Stat reset back to begining and points deleted to 0? Kinda like a reverse of a Job NPC. You could say I could just create a new character but this is a bit more convenient. I could rollback a character to being a Novice manually by going to the database and resetting everything but it takes a bit of effort. Thank you.

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  118
  • Reputation:   57
  • Joined:  11/24/16
  • Last Seen:  

7 hours ago, frankcastle11 said:

Thanks! It works save for skill_point can't be set to 0. I mean it resets status and skill points but skill points need to be set to 0 if you're starting out as a level 1 Novice otherwise you'd have left over skill points and won't be able to change jobs. I tried it with this:


query_sql "UPDATE `char` SET `skill_point` = 0 WHERE `char_id` = "+ getcharid(0);

It works when you try it straight on the database but not in game on an active character. The base_level and status_point doesn't rollback to level 1 and 25 status points but I was told it's fine as long the status points are reset and can be realocated and it wouldn't be an issue changing jobs.

i see, then just use this, it will reset your stats and skills point to what novice at first time creation

prontera,160,186,6	script	Reset	998,{
	// change to novice
	jobchange 0;
	//  reset all
	resetlvl 1;
	atcommand "@reset";
	end;
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  1167
  • Reputation:   159
  • Joined:  06/12/12
  • Last Seen:  

7 hours ago, frankcastle11 said:

Good day! Was wondering if there's a script out there that rolls a character back to being a Novice with Skill and Stat reset back to begining and points deleted to 0? Kinda like a reverse of a Job NPC. You could say I could just create a new character but this is a bit more convenient. I could rollback a character to being a Novice manually by going to the database and resetting everything but it takes a bit of effort. Thank you.

Why not delete data in char database? so player still could login with their account and create new character with novice job

Link to comment
Share on other sites

  • 0

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

something like..

TRUNCATE TABLE `skill`;
 
UPDATE `char`
SET
	`class` = 0,
	`base_level` = 1,
	`job_level` = 1,
	`base_exp` = 0,
	`job_exp` = 0,
	`str` = 1,
	`agi` = 1,
	`vit` = 1,
	`int` = 1,
	`dex` = 1,
	`luk` = 1,
	`status_point` = 25,
	`skill_point` = 0,	
	`body` = 0,	
	`weapon` = 0,	
	`shield` = 0
;

UPDATE `inventory` SET `equip` = 0;

make sure you backup before execute..

 

@hendra814

maybe he wanted to keep the progress of the char, example quest, variable, ranking or etc...especially anything that tied with char_id

Edited by Emistry
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  1167
  • Reputation:   159
  • Joined:  06/12/12
  • Last Seen:  

7 minutes ago, Emistry said:

something like..


TRUNCATE TABLE `skill`;
 
UPDATE `char`
SET
	`class` = 0,
	`base_level` = 1,
	`job_level` = 1,
	`base_exp` = 0,
	`job_exp` = 0,
	`str` = 1,
	`agi` = 1,
	`vit` = 1,
	`int` = 1,
	`dex` = 1,
	`luk` = 1,
	`status_point` = 25,
	`skill_point` = 0,	
	`body` = 0,	
	`weapon` = 0,	
	`shield` = 0
;

UPDATE `inventory` SET `equip` = 0;

make sure you backup before execute..

 

@hendra814

maybe he wanted to keep the progress of the char, example quest, variable, ranking or etc...especially anything that tied with char_id

ah, i see, thanks for remind me

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  01/21/18
  • Last Seen:  

16 hours ago, Emistry said:

something like..


TRUNCATE TABLE `skill`;
 
UPDATE `char`
SET
	`class` = 0,
	`base_level` = 1,
	`job_level` = 1,
	`base_exp` = 0,
	`job_exp` = 0,
	`str` = 1,
	`agi` = 1,
	`vit` = 1,
	`int` = 1,
	`dex` = 1,
	`luk` = 1,
	`status_point` = 25,
	`skill_point` = 0,	
	`body` = 0,	
	`weapon` = 0,	
	`shield` = 0
;

UPDATE `inventory` SET `equip` = 0;

make sure you backup before execute..

Thank you! It works! However it rolls back the last character listed on the database. Say I'm using character 150002, but there's a character 150003. It will rollback 150003 instead. So I need a way to identify the current char_id for it to rollback. Also it doesn't reset hp and sp but I added that.

Yes. It would be a bit tideous to repeat a whole quest and would like to keep ranking and so on.

Here's what I did:

prontera,160,190,3    script    Rollback#cru    105,{

mes "[Rollback]";
mes "Do you want to rollback to Novice?";
next;
    switch(select("Yes:No")) {
    case 1:
    if (checkfalcon() || checkcart() || checkriding() || ismounting()) {
        mes "Please remove your " +
            ((checkfalcon()) ? "falcon" : "") +
            ((checkcart()) ? "cart" : "") +
            ((checkriding()) ? "Peco" : "") +
            ((ismounting()) ? "mount" : "") +
            " before proceeding.";
        close;
    }
    else {
    mes "Here you go!";
    query_sql "TRUNCATE TABLE `skill`";
    query_sql "UPDATE `inventory` SET `equip` = 0";
    query_sql "UPDATE `char` SET `class` = 0,`base_level` = 1,`job_level` = 1,`base_exp` = 0,`job_exp` = 0,`str` = 1,`agi` = 1,`vit` = 1,`int` = 1,`dex` = 1,`luk` = 1,'max_hp' = 40,'hp' = 40,'max_sp' = 40,'sp' = 40,`status_point` = 25,`skill_point` = 0,`body` = 0,`weapon` = 0,`shield` = 0";
    close;
    break;
    }
    case 2:
    mes "Okay. Good luck on your journey!";
    close;
    break;

    }
}

 

Edited by frankcastle11
Added script
Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1614
  • Joined:  03/26/12
  • Last Seen:  

You're missing the WHERE clause in your SQL statement.

query_sql("~code~ WHERE `char_id` = "+ getcharid(0));

Otherwise your script will execute for a character that you didn't mean to change /gg 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  01/21/18
  • Last Seen:  

Well it works. However it doesn't fully work when you're using the character you're trying to rollback. Like it doesn't unequip items, base level, skills, hp, sp doesn't rollback and you have to log out and log back in inorder for the changes to take effect. The queries work though if you try it directly on the database so it must be something else.

Link to comment
Share on other sites

  • 0

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

these query should be executed during the char isn't online ...preferable during shutdown/maintenance of server.

its useless to execute this query when the char is online, the server will simply re-insert the exact same data into the server when the char relog

which is why its not provided as a npc script in the first place.

Edited by Emistry
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  01/21/18
  • Last Seen:  

3 minutes ago, Emistry said:

these query should be executed during the char isn't online ...preferable during shutdown/maintenance of server.

its useless to execute this query when the char is online, the server will simply re-insert the exact same data into the server when the char relog

which is why its not provided as a npc script in the first place.

Understood. All in all I'm happy that it works and takes time off manually editing each entry. Thanks for the inputs!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  118
  • Reputation:   57
  • Joined:  11/24/16
  • Last Seen:  

why not just do like this?

prontera,160,186,6	script	Reset	998,{
	// change to novice
	jobchange 0;
	// reset status point and skills
	atcommand "@reset";
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  01/21/18
  • Last Seen:  

11 hours ago, Hurtsky said:

why not just do like this?


prontera,160,186,6	script	Reset	998,{
	// change to novice
	jobchange 0;
	// reset status point and skills
	atcommand "@reset";
	end;
}

 

Thanks! It works save for skill_point can't be set to 0. I mean it resets status and skill points but skill points need to be set to 0 if you're starting out as a level 1 Novice otherwise you'd have left over skill points and won't be able to change jobs. I tried it with this:

query_sql "UPDATE `char` SET `skill_point` = 0 WHERE `char_id` = "+ getcharid(0);

It works when you try it straight on the database but not in game on an active character. The base_level and status_point doesn't rollback to level 1 and 25 status points but I was told it's fine as long the status points are reset and can be realocated and it wouldn't be an issue changing jobs.

Edited by frankcastle11
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  01/21/18
  • Last Seen:  

15 hours ago, Hurtsky said:

i see, then just use this, it will reset your stats and skills point to what novice at first time creation


prontera,160,186,6	script	Reset	998,{
	// change to novice
	jobchange 0;
	//  reset all
	resetlvl 1;
	atcommand "@reset";
	end;
}

 

Now this is what I'm talking about! It works perfectly so far! Resets everything clean! I'm gonna test this out extensively though. But so far it is perfect! Thank you!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  118
  • Reputation:   57
  • Joined:  11/24/16
  • Last Seen:  

10 hours ago, frankcastle11 said:

Now this is what I'm talking about! It works perfectly so far! Resets everything clean! I'm gonna test this out extensively though. But so far it is perfect! Thank you!

just tick that reply as answer and upvote it. thats will help another user also :)

Edited by Hurtsky
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...