Fixed rebirth system not working.

This commit is contained in:
MobiusDevelopment 2020-08-10 05:18:09 +00:00
parent dfd2258b70
commit fbc6ccfec6
6 changed files with 28 additions and 38 deletions

View File

@ -1,15 +1,8 @@
<html>
<body>
<title>- Rebirth Request Menu -</title>
<html><body><title>- Rebirth Request Menu -</title>
<br>
So, you wish to be Reborn? Being Reborn has it's advantages, and it's disadvantages you know.<br>
When you are Reborn you are granted a new bonus skill, but your character is reset to level 1 and returned to his starting class. So choose wisely.<br>
<br>
<br>
So, you wish to be Reborn? Being Reborn has it's advantages, and it's disadvantages you know. <br>
When you are Reborn you are granted a new bonus skill (listed above), <br>
but your character is reset to level 1 and returned to his starting class. So <br>
choose wisely.<br>
<br>
<br>
<button value=" Request Rebirth " action="bypass -h custom_rebirth_confirmrequest" width=250 height=36 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"/>
</body>
</html>
<center>
<button value="Request Rebirth" action="bypass -h custom_rebirth_confirmrequest" width=95 height=21 back="bigbutton_over" fore="bigbutton"/>
</body></html>

View File

@ -125,7 +125,6 @@ public class Rebirth
player.sendMessage("You do not meet the level requirement for a Rebirth!");
return;
}
else if (player.isSubClassActive())
{
player.sendMessage("Please switch to your Main Class before attempting a Rebirth.");
@ -198,7 +197,6 @@ public class Rebirth
// Resets character to first class.
player.setClassId(player.getBaseClass());
player.broadcastUserInfo();
final byte lvl = Byte.parseByte(returnToLevel + "");
@ -279,7 +277,7 @@ public class Rebirth
final ItemInstance itemNeeded = player.getInventory().getItemByItemId(itemId);
if ((itemNeeded == null) || (itemNeeded.getCount() < itemAmount))
{
player.sendMessage("You need atleast " + itemAmount + " [ " + itemName + " ] to request a Rebirth!");
player.sendMessage("You need at least " + itemAmount + " " + itemName + " to request a Rebirth!");
return false;
}
@ -314,7 +312,7 @@ public class Rebirth
player.addSkill(bonusSkill, false);
// If you'd rather make it simple, simply comment this out and replace with a simple player.sendmessage();
rebirthText = new CreatureSay(0, ChatType.HERO_VOICE, "Rebirth Manager ", " Granted you [ " + bonusSkill.getName() + " ] level [ " + bonusSkill.getLevel() + " ]!");
rebirthText = new CreatureSay(0, ChatType.HERO_VOICE, "Rebirth Manager", "Granted you " + bonusSkill.getName() + " level " + bonusSkill.getLevel() + "!");
player.sendPacket(rebirthText);
}
}

View File

@ -31,6 +31,7 @@ import org.l2jmobius.gameserver.model.actor.instance.ClassMasterInstance;
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.instance.SymbolMakerInstance;
import org.l2jmobius.gameserver.model.entity.Rebirth;
import org.l2jmobius.gameserver.model.entity.event.CTF;
import org.l2jmobius.gameserver.model.entity.event.DM;
import org.l2jmobius.gameserver.model.entity.event.GameEvent;
@ -307,11 +308,14 @@ public class RequestBypassToServer extends GameClientPacket
player.processQuestEvent(p.substring(0, idx), p.substring(idx).trim());
}
}
if (_command.startsWith("OlympiadArenaChange"))
else if (_command.startsWith("OlympiadArenaChange"))
{
Olympiad.bypassChangeArena(_command, player);
}
else if (_command.startsWith("custom_rebirth_"))
{
Rebirth.getInstance().handleCommand(player, _command);
}
}
catch (Exception e)
{

View File

@ -1,15 +1,8 @@
<html>
<body>
<title>- Rebirth Request Menu -</title>
<html><body><title>- Rebirth Request Menu -</title>
<br>
So, you wish to be Reborn? Being Reborn has it's advantages, and it's disadvantages you know.<br>
When you are Reborn you are granted a new bonus skill, but your character is reset to level 1 and returned to his starting class. So choose wisely.<br>
<br>
<br>
So, you wish to be Reborn? Being Reborn has it's advantages, and it's disadvantages you know. <br>
When you are Reborn you are granted a new bonus skill (listed above), <br>
but your character is reset to level 1 and returned to his starting class. So <br>
choose wisely.<br>
<br>
<br>
<button value=" Request Rebirth " action="bypass -h custom_rebirth_confirmrequest" width=250 height=36 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"/>
</body>
</html>
<center>
<button value="Request Rebirth" action="bypass -h custom_rebirth_confirmrequest" width=95 height=21 back="bigbutton_over" fore="bigbutton"/>
</body></html>

View File

@ -125,7 +125,6 @@ public class Rebirth
player.sendMessage("You do not meet the level requirement for a Rebirth!");
return;
}
else if (player.isSubClassActive())
{
player.sendMessage("Please switch to your Main Class before attempting a Rebirth.");
@ -198,7 +197,6 @@ public class Rebirth
// Resets character to first class.
player.setClassId(player.getBaseClass());
player.broadcastUserInfo();
final byte lvl = Byte.parseByte(returnToLevel + "");
@ -279,7 +277,7 @@ public class Rebirth
final ItemInstance itemNeeded = player.getInventory().getItemByItemId(itemId);
if ((itemNeeded == null) || (itemNeeded.getCount() < itemAmount))
{
player.sendMessage("You need atleast " + itemAmount + " [ " + itemName + " ] to request a Rebirth!");
player.sendMessage("You need at least " + itemAmount + " " + itemName + " to request a Rebirth!");
return false;
}
@ -314,7 +312,7 @@ public class Rebirth
player.addSkill(bonusSkill, false);
// If you'd rather make it simple, simply comment this out and replace with a simple player.sendmessage();
rebirthText = new CreatureSay(0, ChatType.HERO_VOICE, "Rebirth Manager ", " Granted you [ " + bonusSkill.getName() + " ] level [ " + bonusSkill.getLevel() + " ]!");
rebirthText = new CreatureSay(0, ChatType.HERO_VOICE, "Rebirth Manager", "Granted you " + bonusSkill.getName() + " level " + bonusSkill.getLevel() + "!");
player.sendPacket(rebirthText);
}
}

View File

@ -31,6 +31,7 @@ import org.l2jmobius.gameserver.model.actor.instance.ClassMasterInstance;
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.instance.SymbolMakerInstance;
import org.l2jmobius.gameserver.model.entity.Rebirth;
import org.l2jmobius.gameserver.model.entity.event.CTF;
import org.l2jmobius.gameserver.model.entity.event.DM;
import org.l2jmobius.gameserver.model.entity.event.GameEvent;
@ -307,11 +308,14 @@ public class RequestBypassToServer extends GameClientPacket
player.processQuestEvent(p.substring(0, idx), p.substring(idx).trim());
}
}
if (_command.startsWith("OlympiadArenaChange"))
else if (_command.startsWith("OlympiadArenaChange"))
{
Olympiad.bypassChangeArena(_command, player);
}
else if (_command.startsWith("custom_rebirth_"))
{
Rebirth.getInstance().handleCommand(player, _command);
}
}
catch (Exception e)
{