Jump to content
  • 0

Where is Max Mob Def/Magic Def located?


Gouki

Question


  • Group:  Members
  • Topic Count:  83
  • Topics Per Day:  0.06
  • Content Count:  245
  • Reputation:   12
  • Joined:  08/12/20
  • Last Seen:  

Hi All,

I'm trying to increase the max def and max magic def in pre-renewal, does anyone know where I can find this in SRC?

image.png.594f9db473fa244dc512fd3089522506.png

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 1

  • Group:  Developer
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  839
  • Reputation:   239
  • Joined:  01/30/13
  • Last Seen:  

There's no point to give a monster more than 100 DEF in pre-renewal because 100 DEF means 100% damage reduction, so damage is already 0.

What are you trying to do?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  83
  • Topics Per Day:  0.06
  • Content Count:  245
  • Reputation:   12
  • Joined:  08/12/20
  • Last Seen:  

well, I just migrated re mobs to be activated on pre but i understand that I wont be using them all, so instead of manually editing def and magic def 1 by 1 to make it in pre renewal calc, I plan to increase the max def and max magic def so it wont recognize it as error.

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  839
  • Reputation:   239
  • Joined:  01/30/13
  • Last Seen:  

What you actually need to do it detect which mobs are renewal mobs by their ID and then when you read in the data, you recalculate their stats from renewal to pre-renewal.

I'm not at home right now, but I'll try to remember to post a sample solution later.

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  839
  • Reputation:   239
  • Joined:  01/30/13
  • Last Seen:  

  

Attached you can find a patch file that shows how to do it. The patch file contains a few more things and is not up-to-date to latest rAthena (it's from May 2024).

What is in the patch:

- Replace all unknown drops with Apple and all unknown MVP drops with Elunium

- Remove random option feature (doesn't work in pre-re)

- Recalculate renewal DEF to pre-renewal DEF if monster ID is 2083 or higher

- Recalculate renewal MDEF to pre-renewal MDEF if monster ID is 2083 or higher

- Recalculate renewal ATK/ATK2 to pre-renewal ATK/ATK2

- Replace all unknown monster skills with NPC_EMOTION

 

If you are only interested in the DEF/MDEF part, you can only take over those changes:

@@ -4561,6 +4570,12 @@ uint64 MobDatabase::parseBodyNode(const ryml::NodeRef& node) {
 		if (!this->asUInt16(node, "Defense", def))
 			return 0;
 
+#ifndef RENEWAL
+		// Renewal to pre-re conversion
+		if (mob_id >= 2083)
+			def = static_cast<uint16>(100.0 - ((4000.0 + def) / (4000.0 + def * 10.0) * 100.0));
+#endif
+
 		if (def < DEFTYPE_MIN || def > DEFTYPE_MAX) {
 			this->invalidWarning(node["Defense"], "Invalid monster defense %d, capping...\n", def);
 			def = cap_value(def, DEFTYPE_MIN, DEFTYPE_MAX);
@@ -4575,6 +4590,12 @@ uint64 MobDatabase::parseBodyNode(const ryml::NodeRef& node) {
 		if (!this->asUInt16(node, "MagicDefense", def))
 			return 0;
 
+#ifndef RENEWAL
+		// Renewal to pre-re conversion
+		if (mob_id >= 2083)
+			def = static_cast<uint16>(100.0 - ((1000.0 + def) / (1000.0 + def * 10.0) * 100.0));
+#endif
+
 		if (def < DEFTYPE_MIN || def > DEFTYPE_MAX) {
 			this->invalidWarning(node["MagicDefense"], "Invalid monster magic defense %d, capping...\n", def);
 			def = cap_value(def, DEFTYPE_MIN, DEFTYPE_MAX);

Hope this helps!

I mainly wrote this patch so I can use all renewal monsters directly in pre-re by copying them over without having to worry about unsupported features and changes of functionality of stats.

load_re_mobs_in_prere.patch

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  83
  • Topics Per Day:  0.06
  • Content Count:  245
  • Reputation:   12
  • Joined:  08/12/20
  • Last Seen:  

On 9/3/2024 at 8:02 PM, Playtester said:

  

Attached you can find a patch file that shows how to do it. The patch file contains a few more things and is not up-to-date to latest rAthena (it's from May 2024).

What is in the patch:

- Replace all unknown drops with Apple and all unknown MVP drops with Elunium

- Remove random option feature (doesn't work in pre-re)

- Recalculate renewal DEF to pre-renewal DEF if monster ID is 2083 or higher

- Recalculate renewal MDEF to pre-renewal MDEF if monster ID is 2083 or higher

- Recalculate renewal ATK/ATK2 to pre-renewal ATK/ATK2

- Replace all unknown monster skills with NPC_EMOTION

 

If you are only interested in the DEF/MDEF part, you can only take over those changes:

@@ -4561,6 +4570,12 @@ uint64 MobDatabase::parseBodyNode(const ryml::NodeRef& node) {
 		if (!this->asUInt16(node, "Defense", def))
 			return 0;
 
+#ifndef RENEWAL
+		// Renewal to pre-re conversion
+		if (mob_id >= 2083)
+			def = static_cast<uint16>(100.0 - ((4000.0 + def) / (4000.0 + def * 10.0) * 100.0));
+#endif
+
 		if (def < DEFTYPE_MIN || def > DEFTYPE_MAX) {
 			this->invalidWarning(node["Defense"], "Invalid monster defense %d, capping...\n", def);
 			def = cap_value(def, DEFTYPE_MIN, DEFTYPE_MAX);
@@ -4575,6 +4590,12 @@ uint64 MobDatabase::parseBodyNode(const ryml::NodeRef& node) {
 		if (!this->asUInt16(node, "MagicDefense", def))
 			return 0;
 
+#ifndef RENEWAL
+		// Renewal to pre-re conversion
+		if (mob_id >= 2083)
+			def = static_cast<uint16>(100.0 - ((1000.0 + def) / (1000.0 + def * 10.0) * 100.0));
+#endif
+
 		if (def < DEFTYPE_MIN || def > DEFTYPE_MAX) {
 			this->invalidWarning(node["MagicDefense"], "Invalid monster magic defense %d, capping...\n", def);
 			def = cap_value(def, DEFTYPE_MIN, DEFTYPE_MAX);

Hope this helps!

I mainly wrote this patch so I can use all renewal monsters directly in pre-re by copying them over without having to worry about unsupported features and changes of functionality of stats.

load_re_mobs_in_prere.patch 3.38 kB · 0 downloads

Hi @Playtester,

I think you understood what I wanted to imply.

Currently what I did was my Pre-RE mob DB are all RE mobs and added the pre-re mob db to import.

 will have a test at it and give feedback after.

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...