As you know, the portals created in mapnameSwhmap.txt don't have names to identify them, only the teleport function itself. Well, today I'll show you how to name them; it's simple. Upon reviewing that, I realized that the client already supported the name for that type of entity, it was just that the server was sending the name.
Src/Libraries/common/include/SwitchMapRecord.h:
Reemplace this:
With this
Src/Libraries/common/src/SwitchMapRecord.cpp
search for this:
Add this right below:
Src/Server/GameServer/src/EntitySpawn.cpp
search: CMapSwitchEntitySpawn::Load
and just below:
add this :
and Done, Enjoy!
now can change name on mapnameSwhmap.txt
Src/Libraries/common/include/SwitchMapRecord.h:
Reemplace this:
C++:
class CSwitchMapRecord : public CRawDataInfo
{
public:
long lID;
long lEntityID;
long lEventID;
Point SEntityPos;
short sAngle;
_TCHAR szTarMapName[defMAP_NAME_LEN];
Point STarPos;
};
With this
Code:
class CSwitchMapRecord : public CRawDataInfo
{
public:
long lID;
long lEntityID;
long lEventID;
Point SEntityPos;
short sAngle;
_TCHAR szTarMapName[defMAP_NAME_LEN];
Point STarPos;
char szName[64]; //map name
};
Src/Libraries/common/src/SwitchMapRecord.cpp
search for this:
C++:
n = Util_ResolveTextLine(strLine.c_str(),strList,80,',');
pInfo->STarPos.x = Str2Int(strList[0]);
pInfo->STarPos.y = Str2Int(strList[1]);
Add this right below:
C++:
// Activate Determinant Requirement
m++;
// Portal Name
_tcsncpy(pInfo->szName,ParamList[m++].c_str(),63);
pInfo->szName[63] = '\0';
return TRUE;
}
Src/Server/GameServer/src/EntitySpawn.cpp
search: CMapSwitchEntitySpawn::Load
and just below:
C++:
CEvtCont.SetTableRec(pCSwitchMapRecord);
add this :
C++:
CEvtCont.SetName(pCSwitchMapRecord->szName);
and Done, Enjoy!
now can change name on mapnameSwhmap.txt
Code:
//ID binded entity ID incident type entity placement location entity placement direction Target map name Target map location Activate Determinant Requirement Name
3 193 1 26875,178275 -1 lonetower 35178,37078 1 Sacred Forest - Lone Tower 1