Jump to content
×
×
  • Create New...

C++ - Informations sur les Entités ( Voir les Drops )


Recommended Posts

Centre de Téléchargement

Télécharger ( Interne )

Bonjour à tous , j'ai décidé de partagé et d'expliquer comment implanter les systèmes que j'ai sur mon DD. (Tous fonctionnel)

 

Aujourd'hui , ce sera un système qui vous permet de voir ce que drop le mob que vous pointez.

 

!!!!! ATTENTION AUX TABULATIONS!!!!!

 

1) Pré-requis:

 

-Source Server/Client

-Un client

 

On va commencer par les sources Serveur:

 

Ouvre le fichier service.h qui ce trouve dans le dossier common :

 

Ajouter:

#define __SEND_TARGET_INFO__
 

Maintenant aller dans game/src puis ouvrez le fichier char.h:

Cherchez:

//////////////////////////////////////////////////////////////////////////////////
// Basic Points
 
Ajoutez en dessous :
#ifdef __SEND_TARGET_INFO__
private:
	DWORD			dwLastTargetInfoPulse;

public:
	DWORD			GetLastTargetInfoPulse() const	{ return dwLastTargetInfoPulse; }
	void			SetLastTargetInfoPulse(DWORD pulse) { dwLastTargetInfoPulse = pulse; }
#endif
 

Ouvrez le dossier char.cpp:

Cherchez:

#include "DragonSoul.h"
 

Puis ajoutez en dessous:

#ifdef __SEND_TARGET_INFO__
#include 
#include 
using namespace std;
#endif
 

Cherchez:

m_dwKillerPID = 0;

 

Puis ajoutez en dessous:

#ifdef __SEND_TARGET_INFO__
dwLastTargetInfoPulse = 0;
#endif
 

Maintenant , ouvrez le fichier input.h

Cherchez:

		void		Roulette(LPCHARACTER ch, const char* c_pData);
 

Ajoutez en dessous:

#ifdef __SEND_TARGET_INFO__
	void		TargetInfoLoad(LPCHARACTER ch, const char* c_pData);
#endif
 

Ouvrez le dossier input_main.cpp:

Cherchez:

static int __deposit_limit()
{
return (1000*10000); // 1õ¸¸
}
 

Ajoutez en dessous:

#ifdef __SEND_TARGET_INFO__
void CInputMain::TargetInfoLoad(LPCHARACTER ch, const char* c_pData)
{
TPacketCGTargetInfoLoad* p = (TPacketCGTargetInfoLoad*)c_pData;
TPacketGCTargetInfo pInfo;
pInfo.header = HEADER_GC_TARGET_INFO;
static std::vector s_vec_item;
s_vec_item.clear();
LPITEM pkInfoItem;
LPCHARACTER m_pkChrTarget = CHARACTER_MANAGER::instance().Find(p->dwVID);

// if (m_pkChrTarget && (m_pkChrTarget->IsMonster() || m_pkChrTarget->IsStone()))
// {
	// if (thecore_heart->pulse - (int) ch->GetLastTargetInfoPulse() < passes_per_sec * 3)
		// return;

	// ch->SetLastTargetInfoPulse(thecore_heart->pulse);

if (ITEM_MANAGER::instance().CreateDropItemVector(m_pkChrTarget, ch, s_vec_item) && (m_pkChrTarget->IsMonster() || m_pkChrTarget->IsStone()))
{
	if (s_vec_item.size() == 0);
	else if (s_vec_item.size() == 1)
	{
		pkInfoItem = s_vec_item[0];
		pInfo.dwVID	= m_pkChrTarget->GetVID();
		pInfo.race = m_pkChrTarget->GetRaceNum();
		pInfo.dwVnum = pkInfoItem->GetVnum();
		pInfo.count = pkInfoItem->GetCount();
		ch->GetDesc()->Packet(&pInfo, sizeof(TPacketGCTargetInfo));
	}
	else
	{
		int iItemIdx = s_vec_item.size() - 1;
		while (iItemIdx >= 0)
		{
			pkInfoItem = s_vec_item[iItemIdx--];

			if (!pkInfoItem)
			{
				sys_err("pkInfoItem null in vector idx %d", iItemIdx + 1);
				continue;
			}

				pInfo.dwVID	= m_pkChrTarget->GetVID();
				pInfo.race = m_pkChrTarget->GetRaceNum();
				pInfo.dwVnum = pkInfoItem->GetVnum();
				pInfo.count = pkInfoItem->GetCount();
				ch->GetDesc()->Packet(&pInfo, sizeof(TPacketGCTargetInfo));
		}
	}
}
// }
}
#endif
 

Cherchez:

		case HEADER_CG_XTRAP_ACK:
		{
			TPacketXTrapCSVerify* p = reinterpret_cast((void*)c_pData);
			CXTrapManager::instance().Verify_CSStep3(d->GetCharacter(), p->bPacketData);
		}
		break;
 

Mettez en dessous :

#ifdef __SEND_TARGET_INFO__
	case HEADER_CG_TARGET_INFO_LOAD:
		{
			TargetInfoLoad(ch, c_pData);
		}
		break;
#endif
 

Ouvre le fichier item_manager.cpp:

Cherchez:

bool ITEM_MANAGER::GetDropPct(LPCHARACTER pkChr, LPCHARACTER pkKiller, OUT int& iDeltaPercent, OUT int& iRandRange)
 

Ajoutez en dessous:

#ifdef __SEND_TARGET_INFO__
bool ITEM_MANAGER::CreateDropItemVector(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector & vec_item)
{
if (pkChr->IsPolymorphed() || pkChr->IsPC())
{
	return false;
}

int iLevel = pkKiller->GetLevel();

BYTE bRank = pkChr->GetMobRank();
LPITEM item = NULL;

std::vector::iterator it = g_vec_pkCommonDropItem[bRank].begin();

while (it != g_vec_pkCommonDropItem[bRank].end())
{
	const CItemDropInfo & c_rInfo = *(it++);

	if (iLevel < c_rInfo.m_iLevelStart || iLevel > c_rInfo.m_iLevelEnd)
		continue;

	TItemTable * table = GetTable(c_rInfo.m_dwVnum);

	if (!table)
		continue;

	item = NULL;

	if (table->bType == ITEM_POLYMORPH)
	{
		if (c_rInfo.m_dwVnum == pkChr->GetPolymorphItemVnum())
		{
			item = CreateItem(c_rInfo.m_dwVnum, 1, 0, true);

			if (item)
				item->SetSocket(0, pkChr->GetRaceNum());
		}
	}
	else
		item = CreateItem(c_rInfo.m_dwVnum, 1, 0, true);

	if (item) vec_item.push_back(item);
}

// Drop Item Group
{
	itertype(m_map_pkDropItemGroup) it;
	it = m_map_pkDropItemGroup.find(pkChr->GetRaceNum());

	if (it != m_map_pkDropItemGroup.end())
	{
		typeof(it->second->GetVector()) v = it->second->GetVector();

		for (DWORD i = 0; i < v.size(); ++i)
		{
			item = CreateItem(v[i].dwVnum, v[i].iCount, 0, true);

			if (item)
			{
				if (item->GetType() == ITEM_POLYMORPH)
				{
					if (item->GetVnum() == pkChr->GetPolymorphItemVnum())
					{
						item->SetSocket(0, pkChr->GetRaceNum());
					}
				}

				vec_item.push_back(item);
			}
		}
	}
}

// MobDropItem Group
{
	itertype(m_map_pkMobItemGroup) it;
	it = m_map_pkMobItemGroup.find(pkChr->GetRaceNum());

	if ( it != m_map_pkMobItemGroup.end() )
	{
		CMobItemGroup* pGroup = it->second;

		// MOB_DROP_ITEM_BUG_FIX
		// 20050805.myevan.MobDropItem ? ???? ?? ?? CMobItemGroup::GetOne() ??? ?? ?? ??
		if (pGroup && !pGroup->IsEmpty())
		{
			const CMobItemGroup::SMobItemGroupInfo& info = pGroup->GetOne();
			item = CreateItem(info.dwItemVnum, info.iCount, 0, true, info.iRarePct);

			if (item) vec_item.push_back(item);
		}
		// END_OF_MOB_DROP_ITEM_BUG_FIX
	}
}

// Level Item Group
{
	itertype(m_map_pkLevelItemGroup) it;
	it = m_map_pkLevelItemGroup.find(pkChr->GetRaceNum());

	if ( it != m_map_pkLevelItemGroup.end() )
	{
		if ( it->second->GetLevelLimit() <= (DWORD)iLevel )
		{
			typeof(it->second->GetVector()) v = it->second->GetVector();

			for ( DWORD i=0; i < v.size(); i++ )
			{
				DWORD dwVnum = v[i].dwVNum;
				item = CreateItem(dwVnum, v[i].iCount, 0, true);
				if ( item ) vec_item.push_back(item);
			}
		}
	}
}

// BuyerTheitGloves Item Group
{
	// by mhh ?? ??? ??? ?? drop ? ???? ??
	if (pkKiller->GetPremiumRemainSeconds(PREMIUM_ITEM) > 0 ||
			pkKiller->IsEquipUniqueGroup(UNIQUE_GROUP_DOUBLE_ITEM))
	{
		itertype(m_map_pkGloveItemGroup) it;
		it = m_map_pkGloveItemGroup.find(pkChr->GetRaceNum());

		if (it != m_map_pkGloveItemGroup.end())
		{
			typeof(it->second->GetVector()) v = it->second->GetVector();

			for (DWORD i = 0; i < v.size(); ++i)
			{

				DWORD dwVnum = v[i].dwVnum;
				item = CreateItem(dwVnum, v[i].iCount, 0, true);
				if (item) vec_item.push_back(item);
			}
		}
	}
}

// ??
if (pkChr->GetMobDropItemVnum())
{
	itertype(m_map_dwEtcItemDropProb) it = m_map_dwEtcItemDropProb.find(pkChr->GetMobDropItemVnum());

	if (it != m_map_dwEtcItemDropProb.end())
	{		
		item = CreateItem(pkChr->GetMobDropItemVnum(), 1, 0, true);
		if (item) vec_item.push_back(item);
	}
}

if (pkChr->IsStone())
{
	if (pkChr->GetDropMetinStoneVnum())
	{
		item = CreateItem(pkChr->GetDropMetinStoneVnum(), 1, 0, true);
		if (item) vec_item.push_back(item);
	}
}

return vec_item.size();
}
#endif
 

Ouvrez le fichier item_manager.h

Cherchez:

		bool			CreateDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector & vec_item);
 

Ajoutez en dessous:

#ifdef __SEND_TARGET_INFO__
	bool			CreateDropItemVector(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector & vec_item);
#endif
 

Ouvrez le fichier packet.h

Cherchez:

	HEADER_GC_TARGET			 	= 63,
 

Mettez en dessous:

#ifdef __SEND_TARGET_INFO__
HEADER_GC_TARGET_INFO			= 58,
HEADER_CG_TARGET_INFO_LOAD		= 59,
#endif
 

Cherchez:

typedef struct packet_target
 

Ajoutez apres la fonction:

#ifdef __SEND_TARGET_INFO__
typedef struct packet_target_info
{
BYTE	header;
DWORD	dwVID;
DWORD	race;
DWORD	dwVnum;
BYTE	count;
} TPacketGCTargetInfo;

typedef struct packet_target_info_load
{
BYTE header;
DWORD dwVID;
} TPacketCGTargetInfoLoad;
#endif
 

Ouvre le fichiez packet_info.cpp

Cherchez:

	Set(HEADER_CG_STATE_CHECKER, sizeof(BYTE), "ServerStateCheck", false);
 

Ajoutez en dessous:

#ifdef __SEND_TARGET_INFO__
Set(HEADER_CG_TARGET_INFO_LOAD, sizeof(TPacketCGTargetInfoLoad), "TargetInfoLoad", true);
#endif
 

Voilà on en a fini avec la partie "Source Server" , maintenant attaquons la partie "Source client":

 

Aller dans le dossier UserInterface:

 

Cherchez le fichier Locale_inc.h

 

Ajoutez:

#define ENABLE_SEND_TARGET_INFO
 

Ouvrez le fichier Packet.h

 

Cherchez:

    HEADER_GC_TARGET                            = 63,
 

Ajoutez en dessous:

#ifdef ENABLE_SEND_TARGET_INFO
HEADER_GC_TARGET_INFO						= 58,
HEADER_CG_TARGET_INFO_LOAD					= 59,
#endif
 

Cherchez:

typedef struct packet_target
 

Ajoutez après la fonction:

#ifdef ENABLE_SEND_TARGET_INFO
typedef struct packet_target_info
{
BYTE	header;
DWORD	dwVID;
DWORD	race;
DWORD	dwVnum;
BYTE	count;
} TPacketGCTargetInfo;

typedef struct packet_target_info_load
{
BYTE header;
DWORD dwVID;
} TPacketCGTargetInfoLoad;
#endif
 

Ouvrez le fichier PythonApplicationModule.cpp

Cherchez:

#ifdef ENABLE_COSTUME_SYSTEM
 

Ajoutez en dessous:

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

Ouvrez le fichier PythonNetworkStream.cpp

Cherchez:

			Set(HEADER_GC_TARGET,		CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCTarget), STATIC_SIZE_PACKET));
 

Ajoutez en dessous:

#ifdef ENABLE_SEND_TARGET_INFO
		Set(HEADER_GC_TARGET_INFO,	CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCTargetInfo), STATIC_SIZE_PACKET));
#endif
 

Ouvrez le fichier PythonNetworkStream.h

 

Cherchez:

		bool RecvDamageInfoPacket();
 

Inserez en dessous :

#ifdef ENABLE_SEND_TARGET_INFO
	bool RecvTargetInfoPacket();

	public:
		bool SendTargetInfoLoadPacket(DWORD dwVID);

	protected:
#endif
 

 

Ouvre le fichier PythonNetworkStreamModule.cpp

Cherchez:

PyObject* netConnectToAccountServer(PyObject* poSelf, PyObject* poArgs)
 

Ajoutez après la fonction :

#ifdef ENABLE_SEND_TARGET_INFO
PyObject* netTargetInfoLoad(PyObject* poSelf, PyObject* poArgs)
{
DWORD dwVID;

if (!PyArg_ParseTuple(poArgs, "i", &dwVID))
{
	return Py_BuildException();
}
if (dwVID < 0)
{
	return Py_BuildNone();
}

CPythonNetworkStream& rns = CPythonNetworkStream::Instance();
rns.SendTargetInfoLoadPacket(dwVID);

return Py_BuildNone();
}
#endif
 

Cherchez:

		{ "ConnectToAccountServer",				netConnectToAccountServer,				METH_VARARGS },
 

Ajoutez en dessous:

#ifdef ENABLE_SEND_TARGET_INFO
	{ "SendTargetInfoLoad",					netTargetInfoLoad,						METH_VARARGS },
#endif
 

Ouvrez le fichier PythonNetworkStreamPhaseGame.cpp

Cherchez:

			case HEADER_GC_TARGET:
 

 

Ajoutez en dessous:

#ifdef ENABLE_SEND_TARGET_INFO
		case HEADER_GC_TARGET_INFO:
			ret = RecvTargetInfoPacket();
			break;
#endif
 

Cherchez :

bool CPythonNetworkStream::RecvTargetPacket()
 

Ajoutez en dessous:

#ifdef ENABLE_SEND_TARGET_INFO
bool CPythonNetworkStream::RecvTargetInfoPacket()
{
TPacketGCTargetInfo pInfoTargetPacket;

if (!Recv(sizeof(TPacketGCTargetInfo), &pInfoTargetPacket))
{
	Tracen("Recv Info Target Packet Error");
	return false;
}

CInstanceBase * pInstPlayer = CPythonCharacterManager::Instance().GetMainInstancePtr();
CInstanceBase * pInstTarget = CPythonCharacterManager::Instance().GetInstancePtr(pInfoTargetPacket.dwVID);
if (pInstPlayer && pInstTarget)
{
	if (!pInstTarget->IsDead())
	{
		if (pInstTarget->IsEnemy() || pInstTarget->IsStone())
		{
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AddTargetMonsterDropInfo", 
			Py_BuildValue("(iii)", pInfoTargetPacket.race, pInfoTargetPacket.dwVnum, pInfoTargetPacket.count));
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_RefreshTargetMonsterDropInfo", Py_BuildValue("(i)", pInfoTargetPacket.race));
		}
		else
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "CloseTargetBoard", Py_BuildValue("()"));

		// m_pInstTarget = pInstTarget;
	}
}
else
{
	PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "CloseTargetBoard", Py_BuildValue("()"));
}

return true;
}
#endif
 

Cherchez :

bool CPythonNetworkStream::RecvObserverAddPacket()
 

Ajoutez après la fonction:

#ifdef ENABLE_SEND_TARGET_INFO
bool CPythonNetworkStream::SendTargetInfoLoadPacket(DWORD dwVID)
{
TPacketCGTargetInfoLoad TargetInfoLoadPacket;
TargetInfoLoadPacket.header = HEADER_CG_TARGET_INFO_LOAD;
TargetInfoLoadPacket.dwVID = dwVID;

if (!Send(sizeof(TargetInfoLoadPacket), &TargetInfoLoadPacket))
	return false;

return SendSequence();
}
#endif
 

Ouvrez le fichier PythonNonPlayer.cpp

Cherchez:

void CPythonNonPlayer::GetMatchableMobList(int iLevel, int iInterval, TMobTableList * pMobTableList)
 

Ajoutez après la fonction:

#ifdef ENABLE_SEND_TARGET_INFO
DWORD CPythonNonPlayer::GetMonsterMaxHP(DWORD dwVnum)
{
const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
if (!c_pTable)
{
	DWORD dwMaxHP = 0;
	return dwMaxHP;
}

return c_pTable->dwMaxHP;
}

DWORD CPythonNonPlayer::GetMonsterRaceFlag(DWORD dwVnum)
{
const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
if (!c_pTable)
{
	DWORD dwRaceFlag = 0;
	return dwRaceFlag;
}

return c_pTable->dwRaceFlag;
}

DWORD CPythonNonPlayer::GetMonsterLevel(DWORD dwVnum)
{
const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
if (!c_pTable)
{
	DWORD level = 0;
	return level;
}

return c_pTable->bLevel;
}

DWORD CPythonNonPlayer::GetMonsterDamage1(DWORD dwVnum)
{
const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
if (!c_pTable)
{
	DWORD range = 0;
	return range;
}

return c_pTable->dwDamageRange[0];
}

DWORD CPythonNonPlayer::GetMonsterDamage2(DWORD dwVnum)
{
const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
if (!c_pTable)
{
	DWORD range = 0;
	return range;
}

return c_pTable->dwDamageRange[1];
}

DWORD CPythonNonPlayer::GetMonsterExp(DWORD dwVnum)
{
const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
if (!c_pTable)
{
	DWORD dwExp = 0;
	return dwExp;
}

return c_pTable->dwExp;
}

float CPythonNonPlayer::GetMonsterDamageMultiply(DWORD dwVnum)
{
const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
if (!c_pTable)
{
	DWORD fDamMultiply = 0;
	return fDamMultiply;
}

return c_pTable->fDamMultiply;
}

DWORD CPythonNonPlayer::GetMonsterST(DWORD dwVnum)
{
const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
if (!c_pTable)
{
	DWORD bStr = 0;
	return bStr;
}

return c_pTable->bStr;
}

DWORD CPythonNonPlayer::GetMonsterDX(DWORD dwVnum)
{
const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
if (!c_pTable)
{
	DWORD bDex = 0;
	return bDex;
}

return c_pTable->bDex;
}

bool CPythonNonPlayer::IsMonsterStone(DWORD dwVnum)
{
const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
if (!c_pTable)
{
	DWORD bType = 0;
	return bType;
}

return c_pTable->bType == 2;
}
#endif
 

Ouvrez le fichier PythonNonPlayer.h

Cherchez:

		const char*			GetMonsterName(DWORD dwVnum);
 

Ajoutez en dessous :

#ifdef ENABLE_SEND_TARGET_INFO
	// TARGET_INFO
	DWORD				GetMonsterMaxHP(DWORD dwVnum);
	DWORD				GetMonsterRaceFlag(DWORD dwVnum);
	DWORD				GetMonsterLevel(DWORD dwVnum);
	DWORD				GetMonsterDamage1(DWORD dwVnum);
	DWORD				GetMonsterDamage2(DWORD dwVnum);
	DWORD				GetMonsterExp(DWORD dwVnum);
	float				GetMonsterDamageMultiply(DWORD dwVnum);
	DWORD				GetMonsterST(DWORD dwVnum);
	DWORD				GetMonsterDX(DWORD dwVnum);
	bool				IsMonsterStone(DWORD dwVnum);
#endif
 

 

Enfin , ouvrez le fichier PythonNonPlayerModule.cpp

Cherchez:

PyObject * nonplayerLoadNonPlayerData(PyObject * poSelf, PyObject * poArgs)
 

Ajoutez après la fonction:

#ifdef ENABLE_SEND_TARGET_INFO
PyObject * nonplayerGetMonsterMaxHP(PyObject * poSelf, PyObject * poArgs)
{
int race;
if (!PyTuple_GetInteger(poArgs, 0, &race))
	return Py_BuildException();

CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();

return Py_BuildValue("i", rkNonPlayer.GetMonsterMaxHP(race));
}

PyObject * nonplayerGetRaceNumByVID(PyObject * poSelf, PyObject * poArgs)
{
int iVirtualID;
if (!PyTuple_GetInteger(poArgs, 0, &iVirtualID))
	return Py_BuildException();

CInstanceBase * pInstance = CPythonCharacterManager::Instance().GetInstancePtr(iVirtualID);

if (!pInstance)
	return Py_BuildValue("i", -1);

const CPythonNonPlayer::TMobTable * pMobTable = CPythonNonPlayer::Instance().GetTable(pInstance->GetVirtualNumber());

if (!pMobTable)
	return Py_BuildValue("i", -1);

return Py_BuildValue("i", pMobTable->dwVnum);
}

PyObject * nonplayerGetMonsterRaceFlag(PyObject * poSelf, PyObject * poArgs)
{
int race;
if (!PyTuple_GetInteger(poArgs, 0, &race))
	return Py_BuildException();

CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();

return Py_BuildValue("i", rkNonPlayer.GetMonsterRaceFlag(race));
}

PyObject * nonplayerGetMonsterLevel(PyObject * poSelf, PyObject * poArgs)
{
int race;
if (!PyTuple_GetInteger(poArgs, 0, &race))
	return Py_BuildException();

CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();

return Py_BuildValue("i", rkNonPlayer.GetMonsterLevel(race));
}

PyObject * nonplayerGetMonsterDamage(PyObject * poSelf, PyObject * poArgs)
{
int race;
if (!PyTuple_GetInteger(poArgs, 0, &race))
	return Py_BuildException();

CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();

DWORD dmg1 = rkNonPlayer.GetMonsterDamage1(race);
DWORD dmg2 = rkNonPlayer.GetMonsterDamage2(race);

return Py_BuildValue("ii", dmg1,dmg2);
}

PyObject * nonplayerGetMonsterExp(PyObject * poSelf, PyObject * poArgs)
{
int race;
if (!PyTuple_GetInteger(poArgs, 0, &race))
	return Py_BuildException();

CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();

return Py_BuildValue("i", rkNonPlayer.GetMonsterExp(race));
}

PyObject * nonplayerGetMonsterDamageMultiply(PyObject * poSelf, PyObject * poArgs)
{
int race;
if (!PyTuple_GetInteger(poArgs, 0, &race))
	return Py_BuildException();

CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();

return Py_BuildValue("f", rkNonPlayer.GetMonsterDamageMultiply(race));
}

PyObject * nonplayerGetMonsterST(PyObject * poSelf, PyObject * poArgs)
{
int race;
if (!PyTuple_GetInteger(poArgs, 0, &race))
	return Py_BuildException();

CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();

return Py_BuildValue("i", rkNonPlayer.GetMonsterST(race));
}

PyObject * nonplayerGetMonsterDX(PyObject * poSelf, PyObject * poArgs)
{
int race;
if (!PyTuple_GetInteger(poArgs, 0, &race))
	return Py_BuildException();

CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();

return Py_BuildValue("i", rkNonPlayer.GetMonsterDX(race));
}

PyObject * nonplayerIsMonsterStone(PyObject * poSelf, PyObject * poArgs)
{
int race;
if (!PyTuple_GetInteger(poArgs, 0, &race))
	return Py_BuildException();

CPythonNonPlayer& rkNonPlayer = CPythonNonPlayer::Instance();

return Py_BuildValue("i", rkNonPlayer.IsMonsterStone(race) ? 1 : 0);
}
#endif
 

Cherchez:

		{ "GetMonsterName",				nonplayerGetMonsterName,			METH_VARARGS },
 

Ajoutez en dessous:

#ifdef ENABLE_SEND_TARGET_INFO
	// TARGET_INFO
	{ "GetRaceNumByVID",			nonplayerGetRaceNumByVID,			METH_VARARGS },
	{ "GetMonsterMaxHP",			nonplayerGetMonsterMaxHP,			METH_VARARGS },
	{ "GetMonsterRaceFlag",			nonplayerGetMonsterRaceFlag,		METH_VARARGS },
	{ "GetMonsterLevel",			nonplayerGetMonsterLevel,			METH_VARARGS },
	{ "GetMonsterDamage",			nonplayerGetMonsterDamage,			METH_VARARGS },
	{ "GetMonsterExp",				nonplayerGetMonsterExp,				METH_VARARGS },
	{ "GetMonsterDamageMultiply",	nonplayerGetMonsterDamageMultiply,	METH_VARARGS },
	{ "GetMonsterST",				nonplayerGetMonsterST,				METH_VARARGS },
	{ "GetMonsterDX",				nonplayerGetMonsterDX,				METH_VARARGS },
	{ "IsMonsterStone",				nonplayerIsMonsterStone,			METH_VARARGS },
#endif
 

Voilà , nous avons enfin terminez la partie Source , pour le coté Client , vous devez depacker locale et root , les choses à modifier sont dans l'archive à télécharger : https://mega.nz/#!kwcBEChS!-Vb3vlboPwLMNnOuY797eu5N7O5_u0CDDo7UD9o1ZII

 

EDIT:

 

Screen:

223301Capture6.PNG

 

Source: FreaksGamers

  • Funky Emulation 5
  • J'adore 26
  • J'aime 1
Link to comment
  • 11 months later...
  • 3 weeks later...
  • 4 weeks later...
  • 1 month later...
  • 1 year later...

I managed to fix, at least for the moment it is working!

 

in packet_info.cpp

 

#ifdef __SEND_TARGET_INFO__
	Set(HEADER_CG_TARGET_INFO_LOAD, sizeof(TPacketCGTargetInfoLoad), "TargetInfoLoad", false);
#endif

 

for

 

#ifdef __SEND_TARGET_INFO__
	Set(HEADER_CG_TARGET_INFO_LOAD, sizeof(TPacketCGTargetInfoLoad), "TargetInfoLoad", true);
#endif

(false >> true)

 

--------------------------------------------------------------------------

 

Help!

 

Checked several times game / exe, everything is as in the tutorial, even so, when I click the game is closed. If I give /m 101, it opens normal, but after a few seconds closed, then whenever I try to open, it is closed.

 

 

Process: UNKNOWN HEADER: 247, LAST HEADER: 59(5), REMAIN BYTES: 1, fd: 23
Process: UNKNOWN HEADER: 132, LAST HEADER: 0(0), REMAIN BYTES: 7, fd: 23
Process: UNKNOWN HEADER: 84, LAST HEADER: 59(5), REMAIN BYTES: 1, fd: 23
Process: UNKNOWN HEADER: 172, LAST HEADER: 0(0), REMAIN BYTES: 18, fd: 23
Process: UNKNOWN HEADER: 37, LAST HEADER: 59(5), REMAIN BYTES: 1, fd: 23
 

Edited by Klaus
Solved
Link to comment
  • 1 year later...

Bonjour,

Petit blocage sur la modification sur la partie modification client du uitootip. 

## Search for:
        self.AddItemData(itemVnum, metinSlot, attrSlot) 

Dans mon tooltip j'ai 3 ou 4 lignes comme celle ci, faut-il ajouter en dessous de chacune ? Si non, quelle ligne est concernée ? Merci d'avance.

Link to comment
  • 3 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


  • Flux d'Activité

    1. 2

      Site internet (CMS) compatible avec tous les emulateurs 1.29 (Azuriom)

    2. 2

      Site internet (CMS) compatible avec tous les emulateurs 1.29 (Azuriom)

    3. 84

      Granny

    4. 32

      Rodnia.net | PVM | International | The Great Conqueror |

    5. 16

      Map The OpenWorld Metin2

    6. 0
    7. 6

      [V2]Gurgarath Resurgence

  • Recently Browsing

    • No registered users viewing this page.

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.