Jump to content

Change Attribute on Alchemy


Recommended Posts

Hi,

This is a item witch can change dragon soul attributes, I made it with subtype but you can easily do it by vnum. Here you have the case for subtype:
(If in DragonSoul.h function PutAttributes is on private move it on public.)

 

Spoiler

#ifdef USE_CHANGE_ATTRIBUTE_DS
					case USE_C_ATTRIBUTE_DS:
					{
						LPITEM pDS;
						if (!IsValidItemPosition(DestCell) || !(pDS = GetItem(DestCell)))
							return false;
 
						if (pDS->IsExchanging() || pDS->IsEquipped())
						{
							ChatPacket(CHAT_TYPE_INFO, "Alchimia este echipata, dezechipeaz-o pentru a folosi bonusul.");
							return false;
						}
 
						if (pDS->IsDragonSoul())
						{
							pDS->ClearAttribute();
							DSManager::instance().PutAttributes(pDS);
							item->SetCount(item->GetCount() - 1);
							ChatPacket(CHAT_TYPE_INFO, "Bonusul a fost schimbat cu succes.");
						}
						else
						{
							ChatPacket(CHAT_TYPE_INFO, "Itemul se poate folosi doar pe alchimie.");
							return false;
						}
					}
#endif

 

https://pastebin.com/0cNA0Xtj

  • Metin2 Dev 12
  • Confused 1
  • Scream 1
  • Good 4
  • Love 2
  • Love 4
Link to comment
Share on other sites

  • 1 year later...

it has an small bug, it can sometimes switch double boni

 

abae812b6f.png

 

"Kraft der Dunkelheit" switched 2 times on it (Strenght of darkness, new elementar boni)

 

you need to fix the ClearAttribute function, its bugged from default on, it lefts the fifth bonus always on the item so you can double them.

better make a new clearattribute function only for DS

Edited by Metin2 Dev
Core X - External 2 Internal
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.