"/summonguild" Command...

All Helbreath Server Source Discussion here.
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Well, here is the def of the order of summonguild
void CGame::AdminOrder_SummonGuild(int iClientH, char *pData, DWORD dwMsgSize)
{
char  seps[] = "= \t\n";
char  * token, * cp, cBuff[256], cMapName[11], char cGuildName[20];
WORD  *wp;
int    pX, pY, i;
class  CStrTok * pStrTok;
DWORD  dwGoldCount;

if (m_pClientList[iClientH] == NULL) return;
if ((dwMsgSize) <= 0) return;
if (m_pClientList[iClientH]->m_iAdminUserLevel < m_iAdminLevelSummonGuild) {
  // Admin user levelÀÌ ³·¾Æ¼­ ÀÌ ±â´ÉÀ» »ç¿ëÇÒ ¼ö ¾ø´Ù.
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL);
  return;
}

if (m_pClientList[iClientH]->m_iAdminUserLevel == 0) {
  // dwGoldCount = player gold
  dwGoldCount = dwGetItemCount(iClientH, "Gold");
  // if summonguildcost is greater than player gold return
  if (m_iSummonGuildCost > dwGoldCount) {
  return;
  }
  // if summonguildcost is less than player gold
  else {
  // reduce gold by summonguildcost
  SetItemCount(iClientH, "Gold", dwGoldCount - m_iSummonGuildCost);
  }
}

ZeroMemory(cBuff, sizeof(cBuff));
memcpy(cBuff, pData, dwMsgSize);

pStrTok = new class CStrTok(cBuff, seps);
token = pStrTok->pGet();
token = pStrTok->pGet();

if (token == NULL) {
  delete pStrTok;
  return;
}

pX = m_pClientList[iClientH]->m_sX;
pY = m_pClientList[iClientH]->m_sY;
//memcpy(cGuildName, m_pClientList[iClientH]->m_cGuildName, 20);
memcpy(cMapName, m_pMapList[m_pClientList[iClientH]->m_cMapIndex]->m_cName, 11);

if (strlen(token) > 20)
  memcpy(cGuildName, token, 20);
  else memcpy(cGuildName, token, strlen(token));

for (i = 0; i < DEF_MAXCLIENTS; i++)
  if ((m_pClientList != NULL) && (strcmp(m_pClientList->m_cGuildName, token) == 0)) {
  RequestTeleportHandler(i, "2  ", cMapName, pX, pY);
}//m_pClientList->m_cCharName

wsprintf(G_cTxt,"GM Order(%s): PC(%s) Summoned to (%s)", m_pClientList[iClientH]->m_cGuildName, cGuildName, cMapName);
bSendMsgToLS(MSGID_GAMEMASTERLOG, iClientH, FALSE, G_cTxt);

ZeroMemory(cBuff, sizeof(cBuff));
cp = (char *)cBuff;
*cp = GSM_REQUEST_SUMMONGUILD;
cp++;

memcpy(cp, cGuildName, 20);
cp += 20;

memcpy(cp, cMapName, 10);
cp += 10;

wp = (WORD *)cp;
*wp = m_pClientList[iClientH]->m_sX;
cp += 2;

wp = (WORD *)cp;
*wp = m_pClientList[iClientH]->m_sY;
cp += 2;

bStockMsgToGateServer(cBuff, 25);

delete pStrTok;
}


What i am trying to do, is to make that only GuildMaster of the guild can do this command....i been changing some stuff...but no good results, any1 can help me out a bit? :unsure:
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>
omar_omiez
Loyal fan
Posts: 235
Joined: Mon Jul 12, 2004 9:36 am

Post by omar_omiez »

void CGame::AdminOrder_SummonGuild(int iClientH, char *pData, DWORD dwMsgSize)
{
char  seps[] = "= \t\n";
char  * token, * cp, cBuff[256], cMapName[11], char cGuildName[20];
WORD  *wp;
int    pX, pY, i;
class  CStrTok * pStrTok;
DWORD  dwGoldCount;

if (m_pClientList[iClientH] == NULL) return;
if ((dwMsgSize) <= 0) return;
<span style='color:red'>if (m_pClientList[iClientH]->m_iGuildRank != 1) </span> {
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL);
  return;
}

if (m_pClientList[iClientH]->m_iAdminUserLevel == 0) {
  // dwGoldCount = player gold
  dwGoldCount = dwGetItemCount(iClientH, "Gold");
  // if summonguildcost is greater than player gold return
  if (m_iSummonGuildCost > dwGoldCount) {
  return;
  }
  // if summonguildcost is less than player gold
  else {
  // reduce gold by summonguildcost
  SetItemCount(iClientH, "Gold", dwGoldCount - m_iSummonGuildCost);
  }
}

ZeroMemory(cBuff, sizeof(cBuff));
memcpy(cBuff, pData, dwMsgSize);

pStrTok = new class CStrTok(cBuff, seps);
token = pStrTok->pGet();
token = pStrTok->pGet();

if (token == NULL) {
  delete pStrTok;
  return;
}

pX = m_pClientList[iClientH]->m_sX;
pY = m_pClientList[iClientH]->m_sY;
//memcpy(cGuildName, m_pClientList[iClientH]->m_cGuildName, 20);
memcpy(cMapName, m_pMapList[m_pClientList[iClientH]->m_cMapIndex]->m_cName, 11);

if (strlen(token) > 20)
  memcpy(cGuildName, token, 20);
  else memcpy(cGuildName, token, strlen(token));

for (i = 0; i < DEF_MAXCLIENTS; i++)
  if ((m_pClientList != NULL) && (strcmp(m_pClientList->m_cGuildName, token) == 0)) {
  RequestTeleportHandler(i, "2  ", cMapName, pX, pY);
}//m_pClientList->m_cCharName

wsprintf(G_cTxt,"GM Order(%s): PC(%s) Summoned to (%s)", m_pClientList[iClientH]->m_cGuildName, cGuildName, cMapName);
bSendMsgToLS(MSGID_GAMEMASTERLOG, iClientH, FALSE, G_cTxt);

ZeroMemory(cBuff, sizeof(cBuff));
cp = (char *)cBuff;
*cp = GSM_REQUEST_SUMMONGUILD;
cp++;

memcpy(cp, cGuildName, 20);
cp += 20;

memcpy(cp, cMapName, 10);
cp += 10;

wp = (WORD *)cp;
*wp = m_pClientList[iClientH]->m_sX;
cp += 2;

wp = (WORD *)cp;
*wp = m_pClientList[iClientH]->m_sY;
cp += 2;

bStockMsgToGateServer(cBuff, 25);

delete pStrTok;
}



not sure, try it.
- Tbone<br><a href="http://cyborg.namedecoder.com"><br><img src="http://cyborg.namedecoder.com/webimages ... ng"<br></a>
omar_omiez
Loyal fan
Posts: 235
Joined: Mon Jul 12, 2004 9:36 am

Post by omar_omiez »

so how was it loco? did it work? sry i made the above reply when i was in school. if still cant work i'll help u look into it again.
- Tbone<br><a href="http://cyborg.namedecoder.com"><br><img src="http://cyborg.namedecoder.com/webimages ... ng"<br></a>
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

i do something like this long time ago

Code: Select all

void CGame::AdminOrder_SummonGuild(int iClientH, char *pData, DWORD dwMsgSize)
{
	char   seps[] = "= \t\n";
	char   * cBuff[256], cLocation[11]; 
	int    pX, pY, i;
//	class  CStrTok * pStrTok;
	char buff [100];
	if (m_pClientList[iClientH] == NULL) return;
	if ((dwMsgSize)	<= 0) return;

	//if (m_pClientList[iClientH]->m_iAdminUserLevel < 3) {
  // Admin user level+ã+þ T-T¦T¬+ŠT-T¦ +ã+þ T-+¡T++Û+ãTÈ TÈ+×TÈ+è+š+ò T-+T T¬+¬T++Í.
//  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL);
	//	return;
	//}

	ZeroMemory(cBuff, sizeof(cBuff));
	memcpy(cBuff, pData, dwMsgSize);

	pX = m_pClientList[iClientH]->m_sX;
	pY = m_pClientList[iClientH]->m_sY;
	memcpy(cLocation, m_pMapList[m_pClientList[iClientH]->m_cMapIndex]->m_cName, 11);
	wsprintf(buff,"Summon-Guild: %s (%s) %s %d %d",m_pClientList[iClientH]->m_cCharName,m_pClientList[iClientH]->m_cGuildName,cLocation,pX,pY);
	PutLogList(buff);
	for (i = 0; i < DEF_MAXCLIENTS; i++)
  
  if ((m_pClientList[i] != NULL) && (strcmp(m_pClientList[i]->m_cGuildName,m_pClientList[iClientH]->m_cGuildName) == 0) && (i != iClientH)) {
  	RequestTeleportHandler(i, "2   ", cLocation, pX, pY);
  }//m_pClientList[i]->m_cCharName
	//	delete pStrTok;
}

and usage

Code: Select all


  if (memcmp(cp, "/summonguild", 12) == 0) {
  	if ((!m_bIsCrusadeMode) || (m_pClientList[iClientH]->m_iGuildRank == 0)) {    
  	if (m_pClientList[iClientH]->m_iGuildRank == 0) {    
    if (dwGetItemCount(iClientH, "Gold") >= 5000)  {
    SetItemCount(iClientH, "Gold", dwGetItemCount(iClientH, "Gold") - 5000);
    AdminOrder_SummonGuild(iClientH, cp, dwMsgSize - 21);
  	return;
  	}
  	}
  	}
  }
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
Pamupe
noob
Posts: 15
Joined: Thu Jun 02, 2005 7:40 pm

Post by Pamupe »

where do i put all these commands? i like this command, where do i put it? plz tell
<img src='http://img32.echo.cx/img32/9993/pamupe24wu.png' border='0' alt='user posted image' />
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

The Drawjer's code works good, so didint had to use yours omars ^^_^^ tho thx for replying :)
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>
omar_omiez
Loyal fan
Posts: 235
Joined: Mon Jul 12, 2004 9:36 am

Post by omar_omiez »

drajwer is pwnage programmer.

i am nooblet.

wahahahahahahahahahaha.

- Tbone<br><a href="http://cyborg.namedecoder.com"><br><img src="http://cyborg.namedecoder.com/webimages ... ng"<br></a>
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

B)

ps. it summons players only on same hgserver
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
Pamupe
noob
Posts: 15
Joined: Thu Jun 02, 2005 7:40 pm

Post by Pamupe »

how do i add this code? where?
<img src='http://img32.echo.cx/img32/9993/pamupe24wu.png' border='0' alt='user posted image' />
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

to game.cpp and game.h and put command in commands section
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Drajwer wrote: to game.cpp and game.h and put command in commands section
I realize that...

Tho would be pretty more useful if can do it, even on diff. HGservers 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>
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Drajwer wrote: B)

ps. it summons players only on same hgserver
I realize that...

Tho, i would like to summon also players in not same HGserver :unsure:
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>
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

edit /goto. i dont need finding on other hgservers cuz i use only one on my servr :P
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Drajwer wrote: edit /goto. i dont need finding on other hgservers cuz i use only one on my servr :P
Help?
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>
Daryl
Regular
Posts: 74
Joined: Thu Dec 16, 2004 1:54 am

Post by Daryl »

Loco, if you having any more problems with the /summonguild command.


Let me know. this is one of the pices of code i developed and added to the HBX source.

Post Reply