Jump to content

[Tutorial] Collection by Tierri Lopes (3/20)


Guest Ezrekith
 Share

Recommended Posts

Hi folks!

I decided to start spending my time creating tutorial to Tierri Lopes Collection!

 

This topic will be updated when i will have time!

#1 / Costume Attr System

Spoiler

Client / Python

root / uiinventory.py


#Search for this:

USE_TYPE_TUPLE

#Replace with this:

	if app.ENABLE_COSTUME_ATTR_SYSTEM:
		USE_TYPE_TUPLE = ("USE_CLEAN_SOCKET", "USE_CHANGE_ATTRIBUTE", "USE_ADD_ATTRIBUTE", "USE_ADD_ATTRIBUTE2", "USE_ADD_ACCESSORY_SOCKET", "USE_PUT_INTO_ACCESSORY_SOCKET", "USE_PUT_INTO_BELT_SOCKET", "USE_PUT_INTO_RING_SOCKET", "USE_COSTUME_ENCHANT", "USE_COSTUME_TRANSFORM")
	else:
		USE_TYPE_TUPLE = ("USE_CLEAN_SOCKET", "USE_CHANGE_ATTRIBUTE", "USE_ADD_ATTRIBUTE", "USE_ADD_ATTRIBUTE2", "USE_ADD_ACCESSORY_SOCKET", "USE_PUT_INTO_ACCESSORY_SOCKET", "USE_PUT_INTO_BELT_SOCKET", "USE_PUT_INTO_RING_SOCKET")

        
#Search for this:

elif "USE_PUT_INTO_RING_SOCKET" == useType:
  
#Replace with this:

			elif useType == "USE_COSTUME_ENCHANT" or useType == "USE_COSTUME_TRANSFORM":
				if not app.ENABLE_COSTUME_ATTR_SYSTEM:
					return FALSE
				
				dstItemVNum = player.GetItemIndex(dstSlotPos)
				item.SelectItem(dstItemVNum)
				if item.GetItemType() == item.ITEM_TYPE_COSTUME:
					return TRUE
                  

Client / Binary

GameLib / ItemData.cpp


//Add this to the includes if you don't have:

#include "../UserInterface/Locale_inc.h"

//Search for this:

return DEF_STR(USE_PUT_INTO_RING_SOCKET);

//Add under:

#ifdef ENABLE_COSTUME_ATTR_SYSTEM
		case USE_COSTUME_ENCHANT:
			return DEF_STR(USE_COSTUME_ENCHANT);
		case USE_COSTUME_TRANSFORM:
			return DEF_STR(USE_COSTUME_TRANSFORM);
#endif

Client / Binary

GameLib / ItemData.h


//Add this to the includes if you don't have:

#include "../UserInterface/Locale_inc.h"


//Search for this:
  
USE_PUT_INTO_RING_SOCKET,

//Add under:

#ifdef ENABLE_COSTUME_ATTR_SYSTEM
			USE_COSTUME_ENCHANT,
			USE_COSTUME_TRANSFORM,
#endif

Client / Binary

Userinterface / PythonApplicationModule.cpp


//Add this to the includes if you don't have:

#include "Locale_inc.h"

//Search for:

PyModule_AddIntConstant(poModule, "CAMERA_STOP",			CPythonApplication::CAMERA_STOP);

//Add under:

#ifdef ENABLE_COSTUME_ATTR_SYSTEM
	PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_ATTR_SYSTEM", 1);
#else
	PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_ATTR_SYSTEM", 0);
#endif

Client / Binary

Userinterface / Locale_inc.h


#define ENABLE_COSTUME_ATTR_SYSTEM

Server / Source

Common / item_length.h


//Add this to the includes if you don't have:

#include "service.h"

//Search for this:

USE_PUT_INTO_RING_SOCKET,

// Add under:

#ifdef __COSTUME_ATTR_SYSTEM__
	USE_COSTUME_ENCHANT,
	USE_COSTUME_TRANSFORM,
#endif

Server / Source

Common / service.h



#define __COSTUME_ATTR_SYSTEM__

Server / Source

Db / ProtoReader.cpp


//Search for this:

"USE_PUT_INTO_RING_SOCKET"
  
//Add this things after that:
  
"USE_COSTUME_ENCHANT", "USE_COSTUME_TRANSFORM",

Server / Source

Game / char_item.cpp


//Add this to the includes if you don't have:

#include "../common/service.h"

//Search for this:

case USE_BAIT:

//Add above:

#ifdef __COSTUME_ATTR_SYSTEM__
					case USE_COSTUME_ENCHANT:
					case USE_COSTUME_TRANSFORM:
						{
							LPITEM item2;
							if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell)))
								return false;
							
							if (item2->IsEquipped())
							{
								BuffOnAttr_RemoveBuffsFromItem(item2);
							}
							
							if (item2->IsExchanging() || item2->IsEquipped())
								return false;
							
							if (item2->GetType() != ITEM_COSTUME)
							{
								ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can use this just on costumes."));
								return false;
							}
							
							if (item2->GetAttributeCount() == 0)
							{
								ChatPacket(CHAT_TYPE_INFO, LC_TEXT("This costume doesn't have any bonus."));
								return false;
							}
							
							switch (item->GetSubType())
							{
								case USE_COSTUME_ENCHANT:
									{
										int aiChangeProb[ITEM_ATTRIBUTE_MAX_LEVEL] = {100, 100, 100, 100, 100};
										item2->ChangeAttribute(aiChangeProb);
										ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You enchant succesfully the costume."));
										{
											char buf[21];
											snprintf(buf, sizeof(buf), "%u", item2->GetID());
											LogManager::instance().ItemLog(this, item, "USE_COSTUME_ENCHANT", buf);
										}
										
										item->SetCount(item->GetCount() - 1);
									}
									break;
								case USE_COSTUME_TRANSFORM:
									{
										item2->ClearAttribute();
										int iCostumePercent = number(1, 3);
										for (int i = 0; i < iCostumePercent; ++i)
										{
											item2->AddAttribute();
										}
										
										int aiChangeProb[ITEM_ATTRIBUTE_MAX_LEVEL] = {100, 100, 100, 100, 100};
										item2->ChangeAttribute(aiChangeProb);
										ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You transform succesfully the costume."));
										{
											char buf[21];
											snprintf(buf, sizeof(buf), "%u", item2->GetID());
											LogManager::instance().ItemLog(this, item, "USE_COSTUME_TRANSFORM", buf);
										}
										
										item->SetCount(item->GetCount() - 1);
									}
									break;
							}
						}
						break;
#endif

Tools / DumpProto

Dump_Proto / ItemCSVReader.cpp


//Search for this:

"USE_PUT_INTO_RING_SOCKET"
  
//Add this things after that:
  
"USE_COSTUME_ENCHANT", "USE_COSTUME_TRANSFORM",

DON'T FORGET TO DOWNLOAD THIS FILES:
Consumables - Costume Attr.rar

#2 / Max Yang (This isn't that one what was in the collection, because that wasnt completed!)

#3 / Costume Weapon (This isn't that one what was in the collection, because that was with 7 + type and thats ugly as hell.. Istead of  COSTUME_WEAPON_XY use ITEM_COSTUME and COSTUME_WEAPON!)

 

Edited by Ezrekith
Link to comment
Share on other sites

COSTUME WEAPON ADDED TO THE LIST!

 

Sorry for being inactive, i have some crazy ideas and i'd like to create them so it takes alot of my free time, but im still helping on Skype and here if you'd like to ask something! :) 

Link to comment
Share on other sites

  • 2 years later...
  • 2 weeks later...
  • 7 months later...
Em 21/10/2017 em 01:11, Convidado Ezrekith disse:

Hi folks!

I decided to start spending my time creating tutorial to Tierri Lopes Collection!

 

This topic will be updated when i will have time!

#1 / Costume Attr System

  Mostrar conteúdo oculto

Client / Python

root / uiinventory.py

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

Client / Binary

GameLib / ItemData.cpp

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

Client / Binary

GameLib / ItemData.h

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

Client / Binary

Userinterface / PythonApplicationModule.cpp

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

Client / Binary

Userinterface / Locale_inc.h

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

Server / Source

Common / item_length.h

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

Server / Source

Common / service.h

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

Server / Source

Db / ProtoReader.cpp

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

Server / Source

Game / char_item.cpp

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

Tools / DumpProto

Dump_Proto / ItemCSVReader.cpp

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

DON'T FORGET TO DOWNLOAD THIS FILES:

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

 

#2 / Max Yang (This isn't that one what was in the collection, because that wasnt completed!)

  Mostrar conteúdo oculto

 

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

 

#3 / Costume Weapon (This isn't that one what was in the collection, because that was with 7 + type and thats ugly as hell.. Istead of  COSTUME_WEAPON_XY use ITEM_COSTUME and COSTUME_WEAPON!)

  Mostrar conteúdo oculto

 

Hidden Content

  • Give reaction or reply to this topic to see the hidden content.

 

 

ty

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...