Recall In Source!

All Helbreath Server Source Discussion here.
Post Reply
laizkloom
Regular
Posts: 78
Joined: Sun Feb 27, 2005 8:41 am

Post by laizkloom »

Can anyone tell me how can i change recall spot?If i want to do so that char recalls to shop.
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

Look at this func in game.cpp

RequestTeleportHandler

Code: Select all

switch (pData[0]) {
  case '0':
  case '1':
  	ZeroMemory(cTempMapName, sizeof(cTempMapName));
  	if (m_pClientList[iClientH]->m_cSide == 0) { 
    strcpy(cTempMapName, "default"); 
  	}
  	else if (m_pClientList[iClientH]->m_iLevel > 80) {
    if (m_pClientList[iClientH]->m_cSide == 1) {
    	strcpy(cTempMapName, "aresden");
    }
    else {
    	strcpy(cTempMapName, "elvine");
    }
  	}
  	else if (m_pClientList[iClientH]->m_cSide == 1) {
    strcpy(cTempMapName, "arefarm");
  	}
  	else {
    strcpy(cTempMapName, "elvfarm");
  	}
  	if ((strcmp(m_pClientList[iClientH]->m_cLockedMapName, "NONE") != 0) && (m_pClientList[iClientH]->m_iLockedMapTime > 0)) {
    bIsLockedMapNotify = TRUE;
    ZeroMemory(cTempMapName, sizeof(cTempMapName));
    strcpy(cTempMapName, m_pClientList[iClientH]->m_cLockedMapName);
  	}
  	for (i = 0; i < DEF_MAXMAPS; i++) {
    if ((m_pMapList[i] != NULL) && (memcmp(m_pMapList[i]->m_cName, cTempMapName, 10) == 0)) {
    	GetMapInitialPoint(i, &m_pClientList[iClientH]->m_sX, &m_pClientList[iClientH]->m_sY, m_pClientList[iClientH]->m_cLocation);
    	m_pClientList[iClientH]->m_cMapIndex = i;
    	ZeroMemory(m_pClientList[iClientH]->m_cMapName, sizeof(m_pClientList[iClientH]->m_cMapName));
    	memcpy(m_pClientList[iClientH]->m_cMapName, m_pMapList[i]->m_cName, 10);
    	goto RTH_NEXTSTEP;
    }
  	}
  	m_pClientList[iClientH]->m_sX   = -1;
  	m_pClientList[iClientH]->m_sY   = -1;
  	ZeroMemory(m_pClientList[iClientH]->m_cMapName, sizeof(m_pClientList[iClientH]->m_cMapName));
  	memcpy(m_pClientList[iClientH]->m_cMapName, cTempMapName, 10);
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_MAGICEFFECTOFF, DEF_MAGICTYPE_CONFUSE, m_pClientList[iClientH]->m_cMagicEffectStatus[DEF_MAGICTYPE_CONFUSE], NULL, NULL);
  	SetSlateFlag(iClientH, DEF_NOTIFY_SLATECLEAR, FALSE);	
  	bSendMsgToLS(MSGID_REQUEST_SAVEPLAYERDATA_REPLY, iClientH, FALSE, FALSE);
  	m_pClientList[iClientH]->m_bIsOnServerChange = TRUE;
  	m_pClientList[iClientH]->m_bIsOnWaitingProcess = TRUE;
  	return;

  case '2':
  	if ((strcmp(m_pClientList[iClientH]->m_cLockedMapName, "NONE") != 0) && 
    (m_pClientList[iClientH]->m_iLockedMapTime > 0) &&
    (memcmp(cMapName, "resurr", 6) != 0)) {
    dX = -1;
    dY = -1;
    bIsLockedMapNotify = TRUE;
    ZeroMemory(cTempMapName, sizeof(cTempMapName));
    strcpy(cTempMapName, m_pClientList[iClientH]->m_cLockedMapName);
  	}
  	else {
    ZeroMemory(cTempMapName, sizeof(cTempMapName));
    strcpy(cTempMapName, cMapName);
  	}
  	cMapIndex = iGetMapIndex(cTempMapName);
  	if (cMapIndex == -1) {
    m_pClientList[iClientH]->m_sX   = dX;
    m_pClientList[iClientH]->m_sY   = dY;
    ZeroMemory(m_pClientList[iClientH]->m_cMapName, sizeof(m_pClientList[iClientH]->m_cMapName));
    memcpy(m_pClientList[iClientH]->m_cMapName, cTempMapName, 10);
    SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_MAGICEFFECTOFF, DEF_MAGICTYPE_CONFUSE, m_pClientList[iClientH]->m_cMagicEffectStatus[DEF_MAGICTYPE_CONFUSE], NULL, NULL);
    SetSlateFlag(iClientH, DEF_NOTIFY_SLATECLEAR, FALSE);
    bSendMsgToLS(MSGID_REQUEST_SAVEPLAYERDATA_REPLY, iClientH, FALSE);
    m_pClientList[iClientH]->m_bIsOnServerChange   = TRUE;
    m_pClientList[iClientH]->m_bIsOnWaitingProcess = TRUE;
    return;
  	}
  	m_pClientList[iClientH]->m_sX   = dX;
  	m_pClientList[iClientH]->m_sY   = dY;
  	m_pClientList[iClientH]->m_cMapIndex = cMapIndex;
  	ZeroMemory(m_pClientList[iClientH]->m_cMapName, sizeof(m_pClientList[iClientH]->m_cMapName));
  	memcpy(m_pClientList[iClientH]->m_cMapName, m_pMapList[cMapIndex]->m_cName, 10);  
  	goto RTH_NEXTSTEP;  
  
  case '3':
  	if ((strcmp(m_pClientList[iClientH]->m_cLockedMapName, "NONE") != 0) && 
    (m_pClientList[iClientH]->m_iLockedMapTime > 0) &&
    (memcmp(cMapName, "resurr", 6) != 0)) {
    dX = -1;
    dY = -1;
    bIsLockedMapNotify = TRUE;
    ZeroMemory(cTempMapName, sizeof(cTempMapName));
    strcpy(cTempMapName, m_pClientList[iClientH]->m_cLockedMapName);
  	}
  	else {
    ZeroMemory(cTempMapName, sizeof(cTempMapName));
    strcpy(cTempMapName, cMapName);
  	}
  	cMapIndex = iGetMapIndex(cTempMapName);
  	if (cMapIndex == -1) {
    m_pClientList[iClientH]->m_sX   = dX;
    m_pClientList[iClientH]->m_sY   = dY;
    ZeroMemory(m_pClientList[iClientH]->m_cMapName, sizeof(m_pClientList[iClientH]->m_cMapName));
    memcpy(m_pClientList[iClientH]->m_cMapName, cTempMapName, 10);
    SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_MAGICEFFECTOFF, DEF_MAGICTYPE_CONFUSE, m_pClientList[iClientH]->m_cMagicEffectStatus[DEF_MAGICTYPE_CONFUSE], NULL, NULL);
    SetSlateFlag(iClientH, DEF_NOTIFY_SLATECLEAR, FALSE);
    bSendMsgToLS(MSGID_REQUEST_SAVEPLAYERDATA_REPLY, iClientH, FALSE);
    m_pClientList[iClientH]->m_bIsOnServerChange   = TRUE;
    m_pClientList[iClientH]->m_bIsOnWaitingProcess = TRUE;
    return;
  	}  
  	m_pClientList[iClientH]->m_sX   = dX;
  	m_pClientList[iClientH]->m_sY   = dY;
  	m_pClientList[iClientH]->m_cMapIndex = cMapIndex;
  	ZeroMemory(m_pClientList[iClientH]->m_cMapName, sizeof(m_pClientList[iClientH]->m_cMapName));
  	memcpy(m_pClientList[iClientH]->m_cMapName, m_pMapList[cMapIndex]->m_cName, 10);  
  	goto RTH_NEXTSTEP;
  }
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
laizkloom
Regular
Posts: 78
Joined: Sun Feb 27, 2005 8:41 am

Post by laizkloom »

ty:)
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

If the modification worked why not add it to the Sources Codes Submission B)
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
Kanar
noob
Posts: 14
Joined: Thu Aug 03, 2006 7:39 pm

Post by Kanar »

How to make that when u recall, it will teleport you to for example Elvine (100, 100), and always only there? I mean.. how to add cords where u will be teleported?
Charles
Loyal fan
Posts: 418
Joined: Wed Nov 26, 2003 8:20 pm

Post by Charles »

look in what diuuude posted up there and you will see how it's done
<i>"Always write good code. Feel bad to write bad code."</i>
Acidx
Member
Posts: 198
Joined: Tue Mar 23, 2004 4:27 am

Post by Acidx »

Well thats pretty easy and self explanatory, in the code that diu posted - >
case '3':
 if ((strcmp(m_pClientList[iClientH]->m_cLockedMapName, "NONE") != 0) &&
  (m_pClientList[iClientH]->m_iLockedMapTime > 0) &&
  (memcmp(cMapName, "resurr", 6) != 0)) {
  dX = -1;
  dY = -1;
  bIsLockedMapNotify = TRUE;
  ZeroMemory(cTempMapName, sizeof(cTempMapName));
  strcpy(cTempMapName, m_pClientList[iClientH]->m_cLockedMapName);
 }
 else {
  ZeroMemory(cTempMapName, sizeof(cTempMapName));
  strcpy(cTempMapName, cMapName);
 }
 cMapIndex = iGetMapIndex(cTempMapName);
 if (cMapIndex == -1) {
<span style='color:blue'>   m_pClientList[iClientH]->m_sX   = dX;
  m_pClientList[iClientH]->m_sY   = dY;</span>
highlighted in blue, This is your X,Y Respectivly
You guys gotta remember, if people ask a queston be as explanatory as you can, some people dont know much about reading code.
<b>-<span style='color:green'>ACiD-x </span><span style='color:red'> Owning PCs Since 1987</span><br><img src='http://img204.imageshack.us/img204/2245/hackertf5.gif' border='0' alt='user posted image' /><br><img src='http://img509.imageshack.us/img509/6697 ... 4sc4ed.png' border='0' alt='user posted image' /><br><span style='color:orange'>i am Pwn NetGAYLORDS !</span></b><br><span style='color:blue'><br>I Pwn HBUSA =)</span>
Post Reply