Jump to content

Official - Polymorph Marble in Chests


Recommended Posts

  • Forum Moderator

Hello folks,

This is not 100% official (because how could we know?) but on the official, you can obtain Polymorph Marbles of certain monsters when opening specific chests.

If we do it by giving a Polymorph Marble, the marble won't polymorph you at all as it won't contain a mob vnum to polymorph you into. So here is a way to do it.

This is the hidden content, please

Have a nice day! 😄

 

  • Metin2 Dev 89
  • Eyes 1
  • Lmao 1
  • Good 15
  • Love 1
  • Love 29

Gurgarath
coming soon

Link to comment
Share on other sites

  • 4 weeks later...
  • Honorable Member

I slightly refactored. You can also specify the poly vnum now. (I skipped the ReadMonsterDropItemGroup part)

Here a patch:

From c5da3c9abf1608347bb5bec5fae06213c75c1ae9 Mon Sep 17 00:00:00 2001
From: Marty Sama <martysama0134@users.noreply.github.com>
Date: Thu, 16 Nov 2023 06:19:28 +0100
Subject: [PATCH] ENABLE_MOB_DROP_POLY

 s3ll_server/Srcs/Server/common/CommonDefines.h     |  1 +
 s3ll_server/Srcs/Server/game/src/char_item.cpp     | 44 ++++++++++++++++++----
 s3ll_server/Srcs/Server/game/src/item_manager.h    |  7 +++-
 .../Server/game/src/item_manager_read_tables.cpp   | 10 ++++-
 4 files changed, 50 insertions(+), 12 deletions(-)

diff --git a/s3ll_server/Srcs/Server/common/CommonDefines.h b/s3ll_server/Srcs/Server/common/CommonDefines.h
index e7bc400c..33b05884 100644
--- a/s3ll_server/Srcs/Server/common/CommonDefines.h
+++ b/s3ll_server/Srcs/Server/common/CommonDefines.h
@@ -91,6 +91,7 @@ enum eCommonDefines {
 ...
 ...
 ...
+#define ENABLE_MOB_DROP_POLY // enable drop type 'poly' for special_item_group.txt (idx drop mobvnum pct customitemvnum)
 ...
 ...
 ...
diff --git a/s3ll_server/Srcs/Server/game/src/char_item.cpp b/s3ll_server/Srcs/Server/game/src/char_item.cpp
index 1900b5c4..a9631838 100644
--- a/s3ll_server/Srcs/Server/game/src/char_item.cpp
+++ b/s3ll_server/Srcs/Server/game/src/char_item.cpp
@@ -2023,11 +2023,16 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
 								case CSpecialItemGroup::POISON:
 									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 									break;
 								#ifdef ENABLE_WOLFMAN_CHARACTER
 								case CSpecialItemGroup::BLEEDING:
 									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 									break;
 								#endif
+								#ifdef ENABLE_MOB_DROP_POLY
+								case CSpecialItemGroup::POLY:
+									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
+									break;
+								#endif
 								case CSpecialItemGroup::MOB_GROUP:
 									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
 									break;
@@ -2107,11 +2112,16 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
 						case CSpecialItemGroup::POISON:
 							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 							break;
 						#ifdef ENABLE_WOLFMAN_CHARACTER
 						case CSpecialItemGroup::BLEEDING:
 							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 							break;
 						#endif
+						#ifdef ENABLE_MOB_DROP_POLY
+						case CSpecialItemGroup::POLY:
+							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
+							break;
+						#endif
 						case CSpecialItemGroup::MOB_GROUP:
 							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
 							break;
@@ -3728,11 +3738,16 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
 											case CSpecialItemGroup::POISON:
 												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 												break;
 											#ifdef ENABLE_WOLFMAN_CHARACTER
 											case CSpecialItemGroup::BLEEDING:
 												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 												break;
 											#endif
+											#ifdef ENABLE_MOB_DROP_POLY
+											case CSpecialItemGroup::POLY:
+												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
+												break;
+											#endif
 											case CSpecialItemGroup::MOB_GROUP:
 												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
 												break;
@@ -7386,14 +7401,27 @@ bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD
 					bSuccess = true;
 				}
 				break;
 			#ifdef ENABLE_WOLFMAN_CHARACTER
 			case CSpecialItemGroup::BLEEDING:
 				{
 					AttackedByBleeding(nullptr);
 					bSuccess = true;
 				}
 				break;
 			#endif
+			#ifdef ENABLE_MOB_DROP_POLY
+			case CSpecialItemGroup::POLY:
+				{
+					const auto polyVnum = iRarePct ? iRarePct : 70104;
+					item_get = AutoGiveItem(polyVnum, 1, 0);
+					if (item_get)
+					{
+						item_get->SetSocket(0, dwCount);
+						bSuccess = true;
+					}
+				}
+				break;
+			#endif
 			case CSpecialItemGroup::MOB_GROUP:
 				{
 					const int sx = GetX() - number(300, 500);
diff --git a/s3ll_server/Srcs/Server/game/src/item_manager.h b/s3ll_server/Srcs/Server/game/src/item_manager.h
index 0c1e19ec..d8e604b9 100644
--- a/s3ll_server/Srcs/Server/game/src/item_manager.h
+++ b/s3ll_server/Srcs/Server/game/src/item_manager.h
@@ -39,9 +39,12 @@ class CSpecialItemGroup
 			DRAIN_HP,
 			POISON,
 			MOB_GROUP,
 			#ifdef ENABLE_WOLFMAN_CHARACTER
 			BLEEDING,
 			#endif
+			#ifdef ENABLE_MOB_DROP_POLY
+			POLY,
+			#endif
 		};

 		enum ESIGType { NORMAL, PCT, QUEST, SPECIAL };
diff --git a/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp b/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp
index 2a921bfb..d7c67863 100644
--- a/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp
+++ b/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp
@@ -239,12 +239,18 @@ bool ITEM_MANAGER::ReadSpecialDropItemFile(const char * c_pszFileName)
 						{
 							dwVnum = CSpecialItemGroup::POISON;
 						}
 						#ifdef ENABLE_WOLFMAN_CHARACTER
 						else if (name == "bleeding")
 						{
 							dwVnum = CSpecialItemGroup::BLEEDING;
 						}
 						#endif
+						#ifdef ENABLE_MOB_DROP_POLY
+						else if (name == "poly")
+						{
+							dwVnum = CSpecialItemGroup::POLY;
+						}
+						#endif
 						else if (name == "group")
 						{
 							dwVnum = CSpecialItemGroup::MOB_GROUP;

 

 

Result:

QNsV1vH.png

LlmKLs2.png

1a6lKuP.png

 

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Good 3
  • Love 1
Link to comment
Share on other sites

  • Forum Moderator
On 11/16/2023 at 5:31 AM, martysama0134 said:
Spoiler

I slightly refactored. You can also specify the poly vnum now. (I skipped the ReadMonsterDropItemGroup part)

Here a patch:

From c5da3c9abf1608347bb5bec5fae06213c75c1ae9 Mon Sep 17 00:00:00 2001
From: Marty Sama <martysama0134@users.noreply.github.com>
Date: Thu, 16 Nov 2023 06:19:28 +0100
Subject: [PATCH] ENABLE_MOB_DROP_POLY

 s3ll_server/Srcs/Server/common/CommonDefines.h     |  1 +
 s3ll_server/Srcs/Server/game/src/char_item.cpp     | 44 ++++++++++++++++++----
 s3ll_server/Srcs/Server/game/src/item_manager.h    |  7 +++-
 .../Server/game/src/item_manager_read_tables.cpp   | 10 ++++-
 4 files changed, 50 insertions(+), 12 deletions(-)

diff --git a/s3ll_server/Srcs/Server/common/CommonDefines.h b/s3ll_server/Srcs/Server/common/CommonDefines.h
index e7bc400c..33b05884 100644
--- a/s3ll_server/Srcs/Server/common/CommonDefines.h
+++ b/s3ll_server/Srcs/Server/common/CommonDefines.h
@@ -91,6 +91,7 @@ enum eCommonDefines {
 ...
 ...
 ...
+#define ENABLE_MOB_DROP_POLY // enable drop type 'poly' for special_item_group.txt (idx drop mobvnum pct customitemvnum)
 ...
 ...
 ...
diff --git a/s3ll_server/Srcs/Server/game/src/char_item.cpp b/s3ll_server/Srcs/Server/game/src/char_item.cpp
index 1900b5c4..a9631838 100644
--- a/s3ll_server/Srcs/Server/game/src/char_item.cpp
+++ b/s3ll_server/Srcs/Server/game/src/char_item.cpp
@@ -2023,11 +2023,16 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
 								case CSpecialItemGroup::POISON:
 									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 									break;
 								#ifdef ENABLE_WOLFMAN_CHARACTER
 								case CSpecialItemGroup::BLEEDING:
 									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 									break;
 								#endif
+								#ifdef ENABLE_MOB_DROP_POLY
+								case CSpecialItemGroup::POLY:
+									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
+									break;
+								#endif
 								case CSpecialItemGroup::MOB_GROUP:
 									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
 									break;
@@ -2107,11 +2112,16 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
 						case CSpecialItemGroup::POISON:
 							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 							break;
 						#ifdef ENABLE_WOLFMAN_CHARACTER
 						case CSpecialItemGroup::BLEEDING:
 							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 							break;
 						#endif
+						#ifdef ENABLE_MOB_DROP_POLY
+						case CSpecialItemGroup::POLY:
+							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
+							break;
+						#endif
 						case CSpecialItemGroup::MOB_GROUP:
 							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
 							break;
@@ -3728,11 +3738,16 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
 											case CSpecialItemGroup::POISON:
 												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 												break;
 											#ifdef ENABLE_WOLFMAN_CHARACTER
 											case CSpecialItemGroup::BLEEDING:
 												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
 												break;
 											#endif
+											#ifdef ENABLE_MOB_DROP_POLY
+											case CSpecialItemGroup::POLY:
+												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
+												break;
+											#endif
 											case CSpecialItemGroup::MOB_GROUP:
 												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
 												break;
@@ -7386,14 +7401,27 @@ bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD
 					bSuccess = true;
 				}
 				break;
 			#ifdef ENABLE_WOLFMAN_CHARACTER
 			case CSpecialItemGroup::BLEEDING:
 				{
 					AttackedByBleeding(nullptr);
 					bSuccess = true;
 				}
 				break;
 			#endif
+			#ifdef ENABLE_MOB_DROP_POLY
+			case CSpecialItemGroup::POLY:
+				{
+					const auto polyVnum = iRarePct ? iRarePct : 70104;
+					item_get = AutoGiveItem(polyVnum, 1, 0);
+					if (item_get)
+					{
+						item_get->SetSocket(0, dwCount);
+						bSuccess = true;
+					}
+				}
+				break;
+			#endif
 			case CSpecialItemGroup::MOB_GROUP:
 				{
 					const int sx = GetX() - number(300, 500);
diff --git a/s3ll_server/Srcs/Server/game/src/item_manager.h b/s3ll_server/Srcs/Server/game/src/item_manager.h
index 0c1e19ec..d8e604b9 100644
--- a/s3ll_server/Srcs/Server/game/src/item_manager.h
+++ b/s3ll_server/Srcs/Server/game/src/item_manager.h
@@ -39,9 +39,12 @@ class CSpecialItemGroup
 			DRAIN_HP,
 			POISON,
 			MOB_GROUP,
 			#ifdef ENABLE_WOLFMAN_CHARACTER
 			BLEEDING,
 			#endif
+			#ifdef ENABLE_MOB_DROP_POLY
+			POLY,
+			#endif
 		};

 		enum ESIGType { NORMAL, PCT, QUEST, SPECIAL };
diff --git a/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp b/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp
index 2a921bfb..d7c67863 100644
--- a/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp
+++ b/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp
@@ -239,12 +239,18 @@ bool ITEM_MANAGER::ReadSpecialDropItemFile(const char * c_pszFileName)
 						{
 							dwVnum = CSpecialItemGroup::POISON;
 						}
 						#ifdef ENABLE_WOLFMAN_CHARACTER
 						else if (name == "bleeding")
 						{
 							dwVnum = CSpecialItemGroup::BLEEDING;
 						}
 						#endif
+						#ifdef ENABLE_MOB_DROP_POLY
+						else if (name == "poly")
+						{
+							dwVnum = CSpecialItemGroup::POLY;
+						}
+						#endif
 						else if (name == "group")
 						{
 							dwVnum = CSpecialItemGroup::MOB_GROUP;

 

 

Result:

QNsV1vH.png

LlmKLs2.png

1a6lKuP.png

 

Good patch, thank you! The only reason I didn't do it this way is that I don't think people use the other polymorph marbles so I kept it simple. I personally do, but not like this, so I simply created a small helper function that I call to determine the adequate vnum. However, AutoGiveItem is better!

uint32_t CHARACTER::GetAdequatePolymorphMarbleVnum(uint32_t dwMobVnum)
Edited by Gurgarath

Gurgarath
coming soon

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.