L2JMobius

Free Users => Solved/Invalid Bug Reports => Topic started by: Maestro on June 12, 2020, 11:53:47 PM

Title: Rebirth System not working
Post by: Maestro on June 12, 2020, 11:53:47 PM
Code: [Select]
# ---------------------------------------------------------------------------
# Rebirth System
# ---------------------------------------------------------------------------
# NPC ID - 55555 - Custom NPC table

# Enable Rebirth system
REBIRTH_ENABLE = True

# Minimum level for Rebirth
REBIRTH_MIN_LEVEL = 80


there is no NPC with id 55555 in the table, when I create it manually, and spawn it, then when I try to activate rebirth, nothing happens.

what am I doing wrong?
Title: Re: Rebirth System not working
Post by: Mobius on June 13, 2020, 04:31:07 AM
Delete your custom_npc table and try this.
Code: [Select]
--
-- Table structure for table `npc`
--
DROP TABLE IF EXISTS `custom_npc`;
CREATE TABLE `custom_npc`(
  `id` decimal(11,0) NOT NULL default '0',
  `idTemplate` int(11) NOT NULL default '0',
  `name` varchar(200) default NULL,
  `serverSideName` int(1) default '0',
  `title` varchar(45) default '',
  `serverSideTitle` int(1) default '0',
  `class` varchar(200) default NULL,
  `collision_radius` decimal(5,2) default NULL,
  `collision_height` decimal(5,2) default NULL,
  `level` decimal(2,0) default NULL,
  `sex` varchar(6) default NULL,
  `type` varchar(20) default NULL,
  `attackrange` int(11) default NULL,
  `hp` decimal(8,0) default NULL,
  `mp` decimal(5,0) default NULL,
  `hpreg` decimal(8,2) default NULL,
  `mpreg` decimal(5,2) default NULL,
  `str` decimal(7,0) default NULL,
  `con` decimal(7,0) default NULL,
  `dex` decimal(7,0) default NULL,
  `int` decimal(7,0) default NULL,
  `wit` decimal(7,0) default NULL,
  `men` decimal(7,0) default NULL,
  `exp` decimal(9,0) default NULL,
  `sp` decimal(8,0) default NULL,
  `patk` decimal(5,0) default NULL,
  `pdef` decimal(5,0) default NULL,
  `matk` decimal(5,0) default NULL,
  `mdef` decimal(5,0) default NULL,
  `atkspd` decimal(3,0) default NULL,
  `aggro` decimal(6,0) default NULL,
  `matkspd` decimal(4,0) default NULL,
  `rhand` decimal(4,0) default NULL,
  `lhand` decimal(4,0) default NULL,
  `armor` decimal(1,0) default NULL,
  `walkspd` decimal(3,0) default NULL,
  `runspd` decimal(3,0) default NULL,
  `faction_id` varchar(40) default NULL,
  `faction_range` decimal(4,0) default NULL,
  `isUndead` int(11) default 0,
  `absorb_level` decimal(2,0) default 0,
  `absorb_type` enum('FULL_PARTY','LAST_HIT','PARTY_ONE_RANDOM') DEFAULT 'LAST_HIT' NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT ignore INTO custom_npc values
('31288', '31228', 'Roy the Cat', '1', 'Class Master', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'ClassMaster', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
('50000', '31228', 'Dom the Cat', '1', 'Merchant', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
('50007', '31324', 'Andromeda', '1', 'Wedding Manager', '1', 'NPC.a_casino_FDarkElf', '8.00', '23.00', '70', 'female', 'WeddingManager', '40', '3862', '1493', '500', '500', '40', '43', '30', '21', '20', '10', '0', '0', '9999', '9999', '999', '999', '278', '0', '333', '316', '0', '0', '55', '132', null, '0', '1', '0', 'LAST_HIT'),
('50008', '31228', 'Rex the Cat', '1', 'Buffer', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'SchemeBuffer', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
('55555', '22124', 'Totor', '1', 'Rebirth Manager', '1', 'NPC.a_fighterguild_master_FHuman', '11.00', '27.00', '83', 'male', 'Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
('70010', '31606', 'Catrina', '1', 'TvT Event Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
('70011', '31606', 'Catretta', '1', 'CTF Event Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
('70012', '31606', 'Catrosa', '1', 'VIP Join Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
('70013', '31606', 'Catrigna', '1', 'VIP End Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
('70014', '31606', 'Catrieta', '1', 'DM Event Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT');
Title: Re: Rebirth System not working
Post by: G-hamsteR on June 13, 2020, 01:00:52 PM
Or just try this, so that you will not lose any custom work.

Code: [Select]
DELETE FROM custom_npc WHERE id = 55555;
INSERT INTO custom_npc values
('55555', '22124', 'Totor', '1', 'Rebirth Manager', '1', 'NPC.a_fighterguild_master_FHuman', '11.00', '27.00', '83', 'male', 'Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT');
Title: Re: Rebirth System not working
Post by: Maestro on June 13, 2020, 02:48:11 PM
Yes, if you execute the command, the desired NPC appears, but as before, there will be nothing left when I click the rebirth button.

(https://i.ibb.co/px9t7My/Shot00001.jpg)
Title: Re: Rebirth System not working
Post by: Maestro on June 14, 2020, 01:49:00 PM
can anyone help me in this matter?
Title: Re: Rebirth System not working
Post by: G-hamsteR on June 14, 2020, 09:32:32 PM
Does any error appear on the gameserver console?
Title: Re: Rebirth System not working
Post by: Maestro on June 14, 2020, 10:27:13 PM
The log is completely clean

Does any error appear on the gameserver console?
Title: Re: Rebirth System not working
Post by: Maestro on June 16, 2020, 03:44:20 PM
Who can help with this issue?
Title: Re: Rebirth System not working
Post by: Helionar on June 16, 2020, 07:07:39 PM
I don't mess around with Mobius Interlude, but I suggest you to go to Rebirth.java and start printing in the log following the bypass flow. For example:

Code: [Select]
public void handleCommand(PlayerInstance player, String command)
{
if (command.startsWith("custom_rebirth_requestrebirth"))
{
displayRebirthWindow(player);
}
else if (command.startsWith("custom_rebirth_confirmrequest"))
{
LOGGER.warning("Reached!"); // PUT THIS
requestRebirth(player);
}
}

If your server console prints "Reached!" when you hit the bypass button, then the bypass is registering correctly, so you have to continue printing inside requestRebirth(player) until you identify the issue. It's a pretty straightforward way of "debugging", so you can give it a try!
Title: Re: Rebirth System not working
Post by: tevsko on June 18, 2020, 11:30:57 AM
may be the problem? I had not seen it since it worked before, before the update
 :-\

Quote
WARNING   181   org.l2jmobius.gameserver.cache.HtmCache   HTML encoding check: File data/html/merchant/55555.htm contains non ASCII content.
Title: Re: Rebirth System not working
Post by: Mobius on August 09, 2020, 07:59:52 PM
Someone try this.
Code: [Select]
Index: dist/game/data/html/merchant/55555.htm
===================================================================
--- dist/game/data/html/merchant/55555.htm (revision 7463)
+++ dist/game/data/html/merchant/55555.htm (working copy)
@@ -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 (listed above), 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>
\ No newline at end of file
Index: java/org/l2jmobius/gameserver/model/entity/Rebirth.java
===================================================================
--- java/org/l2jmobius/gameserver/model/entity/Rebirth.java (revision 7463)
+++ java/org/l2jmobius/gameserver/model/entity/Rebirth.java (working copy)
@@ -125,7 +125,6 @@
  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 @@
 
  // Resets character to first class.
  player.setClassId(player.getBaseClass());
-
  player.broadcastUserInfo();
 
  final byte lvl = Byte.parseByte(returnToLevel + "");
@@ -279,7 +277,7 @@
  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 @@
  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);
  }
  }
Index: java/org/l2jmobius/gameserver/network/clientpackets/RequestBypassToServer.java
===================================================================
--- java/org/l2jmobius/gameserver/network/clientpackets/RequestBypassToServer.java (revision 7463)
+++ java/org/l2jmobius/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
@@ -31,6 +31,7 @@
 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 @@
  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)
  {
Title: Re: Rebirth System not working
Post by: Mobius on August 10, 2020, 08:24:43 AM
Fixed with https://bitbucket.org/MobiusDev/l2j_mobius/commits/feece3e5ed25023dafccaf695ccad71d20f72b57