Angels Code - Server Side

All helbreath developer topics and releases
Post Reply
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

Well, here is the Angels Code from Aryes, with some fixes and adds by me. You can add it in the next release of the unavised HG.

<span style='color:red'>Game.cpp</span>
in function bEquipItemHandler

Find :

Code: Select all

	if (iGetItemWeight(m_pClientList[iClientH]->m_pItemList[sItemIndex], 1) > m_pClientList[iClientH]->m_iStr*100) return FALSE;

	cEquipPos = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_cEquipPos;
Right After, Add :

Code: Select all

	// ******* Angel Code - Begin ******* //
	if (cEquipPos == DEF_EQUIPPOS_LFINGER) {
  int iValue;
  if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum != NULL) {
  if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 908) {//AngelicPendant(STR)
  	iValue = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
  	if (iValue >= 1) {
  	m_pClientList[iClientH]->m_iStr += iValue;
  	}
  	SetAngelFlag1(iClientH, DEF_OWNERTYPE_PLAYER, TRUE);
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
  }

  else if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 909) {//AngelicPendant(DEX)
  	iValue = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
  	if (iValue >= 1) {
  	m_pClientList[iClientH]->m_iDex += iValue;
  	}
  	SetAngelFlag2(iClientH, DEF_OWNERTYPE_PLAYER, TRUE);
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
  }

  else if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 910) {//AngelicPendant(INT)
  	iValue = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
  	if (iValue >= 1) {
  	m_pClientList[iClientH]->m_iInt += iValue;
  	}
  	SetAngelFlag3(iClientH, DEF_OWNERTYPE_PLAYER, TRUE);
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
  }
  else if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 911) {//AngelicPendant(MAG)
  	iValue = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
  	if (iValue >= 1) {
  	m_pClientList[iClientH]->m_iMag += iValue;
  	}
  	SetAngelFlag4(iClientH, DEF_OWNERTYPE_PLAYER, TRUE);
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
  }
  }
	}
	// ******* Angel Code - End ******* //

In Function RealeaseItemHandler

Find :

Code: Select all

	switch (cEquipPos) {
Right After, Add :

Code: Select all

// ******* Angel Code - Begin ******* //
	case DEF_EQUIPPOS_LFINGER:
  int iValue;
  if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum != NULL) {
  if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 908) {//AngelicPendant(STR)
  	iValue = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
  	if (iValue >= 1) {
  	m_pClientList[iClientH]->m_iStr -= iValue;
  	}
  	SetAngelFlag1(iClientH, DEF_OWNERTYPE_PLAYER, FALSE);
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
  }

  else if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 909) {//AngelicPendant(DEX)
  	iValue = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
  	if (iValue >= 1) {
  	m_pClientList[iClientH]->m_iDex -= iValue;
  	}
  	SetAngelFlag2(iClientH, DEF_OWNERTYPE_PLAYER, FALSE);
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
  }

  else if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 910) {//AngelicPendant(INT)
  	iValue = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
  	if (iValue >= 1) {
  	m_pClientList[iClientH]->m_iInt -= iValue;
  	}
  	SetAngelFlag3(iClientH, DEF_OWNERTYPE_PLAYER, FALSE);
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
  }
  else if (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 911) {//AngelicPendant(MAG)
  	iValue = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
  	if (iValue >= 1) {
  	m_pClientList[iClientH]->m_iMag -= iValue;
  	}
  	SetAngelFlag4(iClientH, DEF_OWNERTYPE_PLAYER, FALSE);
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
  }
  }
  break;
	// ******* Angel Code - End ******* //
In function RequestItemUpgradeHandler

Add :

Code: Select all

// ******* Angel Code - Begin ******* //
	case 46:
  switch (m_pClientList[iClientH]->m_pItemList[iItemIndex]->m_sIDnum) {
  	case 908: // AngelicPandent(STR)
  	case 909: // AngelicPandent(DEX)
  	case 910: // AngelicPandent(INT)
  	case 911: // AngelicPandent(MAG)
    if (m_pClientList[iClientH]->m_iGizonItemUpgradeLeft <= 0) {
    	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMUPGRADEFAIL, 3, NULL, NULL, NULL);
    	return;
    }
    if(iValue >= 10){
    	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMUPGRADEFAIL, 3, NULL, NULL, NULL);
    	return;
    }
    switch (iValue){
    	case 0:
      sItemUpgrade = 10;
      break;
    	case 1:
      sItemUpgrade = 11;
      break;
    	case 2:
      sItemUpgrade = 13;
      break;
    	case 3:
      sItemUpgrade = 16;
      break;
    	case 4:
      sItemUpgrade = 20;
      break;
    	case 5:
      sItemUpgrade = 25;
      break;
    	case 6:
      sItemUpgrade = 31;
      break;
    	case 7:
      sItemUpgrade = 38;
      break;
    	case 8:
      sItemUpgrade = 46;
      break;
    	case 9:
      sItemUpgrade = 55;
      break;
    	default:
      SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMUPGRADEFAIL, 3, NULL, NULL, NULL);
      return;
      break;
    }
    if ((m_pClientList[iClientH]->m_pItemList[iItemIndex]->m_sTouchEffectValue1 != m_pClientList[iClientH]->m_sCharIDnum1) ||
    	(m_pClientList[iClientH]->m_pItemList[iItemIndex]->m_sTouchEffectValue2 != m_pClientList[iClientH]->m_sCharIDnum2) ||
    	(m_pClientList[iClientH]->m_pItemList[iItemIndex]->m_sTouchEffectValue3 != m_pClientList[iClientH]->m_sCharIDnum3))	{
    	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMUPGRADEFAIL, 2, NULL, NULL, NULL);
    	return; 
    }
    if (( m_pClientList[iClientH]->m_iGizonItemUpgradeLeft - sItemUpgrade ) < 0) { 
    	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMUPGRADEFAIL, 3, NULL, NULL, NULL);
    	return; 
    }
    int iDicePTA;
    iDicePTA = iDice(1,100);
    if(iDicePTA <= 70){
    	m_pClientList[iClientH]->m_iGizonItemUpgradeLeft -= sItemUpgrade; 
    	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_GIZONITEMUPGRADELEFT, m_pClientList[iClientH]->m_iGizonItemUpgradeLeft, NULL, NULL, NULL);
    	iValue++;
    	if (iValue > 10) iValue = 10;
    	dwTemp = m_pClientList[iClientH]->m_pItemList[iItemIndex]->m_dwAttribute;
    	dwTemp = dwTemp & 0x0FFFFFFF;
    	m_pClientList[iClientH]->m_pItemList[iItemIndex]->m_dwAttribute = dwTemp | (iValue << 28);
    	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMATTRIBUTECHANGE, iItemIndex, m_pClientList[iClientH]->m_pItemList[iItemIndex]->m_dwAttribute, NULL, NULL);
    	_bItemLog(DEF_ITEMLOG_UPGRADESUCCESS, iClientH, (int) -1, m_pClientList[iClientH]->m_pItemList[iItemIndex]);
    }
    else{
    	m_pClientList[iClientH]->m_iGizonItemUpgradeLeft--;
    	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_GIZONITEMUPGRADELEFT, m_pClientList[iClientH]->m_iGizonItemUpgradeLeft, NULL, NULL, NULL);
    	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMUPGRADEFAIL, 3, NULL, NULL, NULL);
    }
    break;

  }
  break;
// ******* Angel Code - End ******* //

Now add the following functions in Game.cpp :

Code: Select all

// ******* Angel Code - Begin ******* //
void CGame::SetAngelFlag1(short sOwnerH, char cOwnerType, BOOL bStatus) 
{ 
	switch (cOwnerType) {
  case DEF_OWNERTYPE_PLAYER:
  	if (m_pClientList[sOwnerH] == NULL) return;
    if (bStatus == TRUE)	m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus | 0x00001000;
    else    	m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus & 0xFFFFEFFF;
    SendEventToNearClient_TypeA(sOwnerH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL);
  break;
	}    
}

void CGame::SetAngelFlag2(short sOwnerH, char cOwnerType, BOOL bStatus) 
{ 
	switch (cOwnerType) {
  case DEF_OWNERTYPE_PLAYER:
  	if (m_pClientList[sOwnerH] == NULL) return;
    if (bStatus == TRUE)	m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus | 0x00002000;
    else    	m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus & 0xFFFFDFFF;
    SendEventToNearClient_TypeA(sOwnerH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL);
  break;
	}    
}

void CGame::SetAngelFlag3(short sOwnerH, char cOwnerType, BOOL bStatus) 
{ 
	switch (cOwnerType) {
  case DEF_OWNERTYPE_PLAYER:
  	if (m_pClientList[sOwnerH] == NULL) return;
    if (bStatus == TRUE)	m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus | 0x00004000;
    else    	m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus & 0xFFFFBFFF;
    SendEventToNearClient_TypeA(sOwnerH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL);
  break;
	}    
}

void CGame::SetAngelFlag4(short sOwnerH, char cOwnerType, BOOL bStatus) 
{ 
	switch (cOwnerType) {
  case DEF_OWNERTYPE_PLAYER:
  	if (m_pClientList[sOwnerH] == NULL) return;
    if (bStatus == TRUE)	m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus | 0x00008000;
    else    	m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus & 0xFFFF7FFF;
    SendEventToNearClient_TypeA(sOwnerH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL);
  break;
	}    
}
// ******* Angel Code - End ******* //
<span style='color:red'>Game.h</span>

Add :

Code: Select all

	void SetAngelFlag1(short sOwnerH, char cOwnerType, BOOL bStatus);
	void SetAngelFlag2(short sOwnerH, char cOwnerType, BOOL bStatus);
	void SetAngelFlag3(short sOwnerH, char cOwnerType, BOOL bStatus);
	void SetAngelFlag4(short sOwnerH, char cOwnerType, BOOL bStatus);
<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 !
KLKS
Loyal fan
Posts: 218
Joined: Sun Feb 22, 2004 2:32 pm

Post by KLKS »

aight i'll be adding it, tnx :)
snoopy81
Loyal fan
Posts: 338
Joined: Mon Jul 12, 2004 7:13 pm

Post by snoopy81 »

is it usefull I take time to code client side myself or should that be released soon?

I looked the sprites, and I guess it could be used as a mob too.

What about a "familliar" for magicians ?

I'll think about the playability...
_\_ _<br> / , \__/ . \ Admin of Equilibrium Project<br> II\ \___ . O<br> III \_/ \ _ / <a href='http://www.equiprojet.com' target='_blank'>http://www.equiprojet.com</a><br> II I¯I
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

i can give the code now, but i thinks it's better to haven't any bug before releasing... PM sent !
<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 !
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Um...wondering if you will release angels as a snippet and in sources at the same time...for both codes client angels/crafting...or I will have to rip it off your sources :blink:
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>
Post Reply