[src] Tutelary Angels System

Codes already submitted by people of the forums.
Post Reply
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

Here is the Server-Side code for the Tutelary Angels System (TAS). It was coded by Aryes and Fixed by myself, i also added the Majesty upgrade for the Pendants of Tutelary Angels (PTA).

<a href='http://www.unadvised.net/forums/index.p ... =57&t=6634' target='_blank'>Client side part HERE !!!</a>

PTA can be upgraded up to +10 and will give you a +x bonus in the tutelary angel's related stat. You have 70% chances of success rate when trying to upgrade a PTA, and if you fail, you'll loose one Majesty point.

You MUST add some checks in several places in the sources to prevent over-MP, over-HP and over-SP hack detection when you release a PTA. When you equip a STR+10 PTA, your char will be able to have some more HP, and when you'll release this PTA, your maximum allowed HP will be decreased, so your current HP will be > your max HP and you'll get dc by the server for hacking attempt.

This part of the code is the only one that won't be given, even if requested. It will be my way of preventing noobs from having angels on their server. Don't worry, this part is really the easiest one to code and angels works even if you don't code it (atleast it works until you release the PTA...).

Remember that you MUST use the coded client and add the angels code (client-side code that i'll post right after this one) in order to have the angels working, it won't work with 3.7 clients !

You can't request the angels from Gail, you'll have to code it by yourself or find another way to acquire the PTAs. Shop ? /command ? Drops ? ... ?

It's already added in KLKS 3.02 HG Sources but they've not been yet released.


Enjoy and remember that credits and thanks goes to Aryes, who did the biggest part of the work, i only fixed some bugs and added the MJ upgrade.

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

Find :

Code: Select all

	if &#40;iGetItemWeight&#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;, 1&#41; > m_pClientList&#91;iClientH&#93;->m_iStr*100&#41; return FALSE;

	cEquipPos = m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_cEquipPos;
Right After, Add :

Code: Select all

	// ******* Angel Code - Begin ******* //
	if &#40;cEquipPos == DEF_EQUIPPOS_LFINGER&#41; &#123;
 &nbsp;int iValue;
 &nbsp;if &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_sIDnum != NULL&#41; &#123;
 &nbsp;if &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_sIDnum == 908&#41; &#123;//AngelicPendant&#40;STR&#41;
 &nbsp;	iValue = &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_dwAttribute & 0xF0000000&#41; >> 28;
 &nbsp;	if &#40;iValue >= 1&#41; &#123;
 &nbsp;	m_pClientList&#91;iClientH&#93;->m_iStr += iValue;
 &nbsp;	&#125;
 &nbsp;	SetAngelFlag1&#40;iClientH, DEF_OWNERTYPE_PLAYER, TRUE&#41;;
 &nbsp;	SendNotifyMsg&#40;NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL&#41;;
 &nbsp;&#125;

 &nbsp;else if &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_sIDnum == 909&#41; &#123;//AngelicPendant&#40;DEX&#41;
 &nbsp;	iValue = &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_dwAttribute & 0xF0000000&#41; >> 28;
 &nbsp;	if &#40;iValue >= 1&#41; &#123;
 &nbsp;	m_pClientList&#91;iClientH&#93;->m_iDex += iValue;
 &nbsp;	&#125;
 &nbsp;	SetAngelFlag2&#40;iClientH, DEF_OWNERTYPE_PLAYER, TRUE&#41;;
 &nbsp;	SendNotifyMsg&#40;NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL&#41;;
 &nbsp;&#125;

 &nbsp;else if &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_sIDnum == 910&#41; &#123;//AngelicPendant&#40;INT&#41;
 &nbsp;	iValue = &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_dwAttribute & 0xF0000000&#41; >> 28;
 &nbsp;	if &#40;iValue >= 1&#41; &#123;
 &nbsp;	m_pClientList&#91;iClientH&#93;->m_iInt += iValue;
 &nbsp;	&#125;
 &nbsp;	SetAngelFlag3&#40;iClientH, DEF_OWNERTYPE_PLAYER, TRUE&#41;;
 &nbsp;	SendNotifyMsg&#40;NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL&#41;;
 &nbsp;&#125;
 &nbsp;else if &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_sIDnum == 911&#41; &#123;//AngelicPendant&#40;MAG&#41;
 &nbsp;	iValue = &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_dwAttribute & 0xF0000000&#41; >> 28;
 &nbsp;	if &#40;iValue >= 1&#41; &#123;
 &nbsp;	m_pClientList&#91;iClientH&#93;->m_iMag += iValue;
 &nbsp;	&#125;
 &nbsp;	SetAngelFlag4&#40;iClientH, DEF_OWNERTYPE_PLAYER, TRUE&#41;;
 &nbsp;	SendNotifyMsg&#40;NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL&#41;;
 &nbsp;&#125;
 &nbsp;&#125;
	&#125;
	// ******* Angel Code - End ******* //

In Function RealeaseItemHandler

Find :

Code: Select all

	switch &#40;cEquipPos&#41; &#123;
Right After, Add :

Code: Select all

// ******* Angel Code - Begin ******* //
	case DEF_EQUIPPOS_LFINGER&#58;
 &nbsp;int iValue;
 &nbsp;if &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_sIDnum != NULL&#41; &#123;
 &nbsp;if &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_sIDnum == 908&#41; &#123;//AngelicPendant&#40;STR&#41;
 &nbsp;	iValue = &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_dwAttribute & 0xF0000000&#41; >> 28;
 &nbsp;	if &#40;iValue >= 1&#41; &#123;
 &nbsp;	m_pClientList&#91;iClientH&#93;->m_iStr -= iValue;
 &nbsp;	&#125;
 &nbsp;	SetAngelFlag1&#40;iClientH, DEF_OWNERTYPE_PLAYER, FALSE&#41;;
 &nbsp;	SendNotifyMsg&#40;NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL&#41;;
 &nbsp;&#125;

 &nbsp;else if &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_sIDnum == 909&#41; &#123;//AngelicPendant&#40;DEX&#41;
 &nbsp;	iValue = &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_dwAttribute & 0xF0000000&#41; >> 28;
 &nbsp;	if &#40;iValue >= 1&#41; &#123;
 &nbsp;	m_pClientList&#91;iClientH&#93;->m_iDex -= iValue;
 &nbsp;	&#125;
 &nbsp;	SetAngelFlag2&#40;iClientH, DEF_OWNERTYPE_PLAYER, FALSE&#41;;
 &nbsp;	SendNotifyMsg&#40;NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL&#41;;
 &nbsp;&#125;

 &nbsp;else if &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_sIDnum == 910&#41; &#123;//AngelicPendant&#40;INT&#41;
 &nbsp;	iValue = &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_dwAttribute & 0xF0000000&#41; >> 28;
 &nbsp;	if &#40;iValue >= 1&#41; &#123;
 &nbsp;	m_pClientList&#91;iClientH&#93;->m_iInt -= iValue;
 &nbsp;	&#125;
 &nbsp;	SetAngelFlag3&#40;iClientH, DEF_OWNERTYPE_PLAYER, FALSE&#41;;
 &nbsp;	SendNotifyMsg&#40;NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL&#41;;
 &nbsp;&#125;
 &nbsp;else if &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_sIDnum == 911&#41; &#123;//AngelicPendant&#40;MAG&#41;
 &nbsp;	iValue = &#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_dwAttribute & 0xF0000000&#41; >> 28;
 &nbsp;	if &#40;iValue >= 1&#41; &#123;
 &nbsp;	m_pClientList&#91;iClientH&#93;->m_iMag -= iValue;
 &nbsp;	&#125;
 &nbsp;	SetAngelFlag4&#40;iClientH, DEF_OWNERTYPE_PLAYER, FALSE&#41;;
 &nbsp;	SendNotifyMsg&#40;NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL&#41;;
 &nbsp;&#125;
 &nbsp;&#125;
 &nbsp;break;
	// ******* Angel Code - End ******* //
In function RequestItemUpgradeHandler

Add :

Code: Select all

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

 &nbsp;&#125;
 &nbsp;break;
// ******* Angel Code - End ******* //

Now add the following functions in Game.cpp :

Code: Select all

// ******* Angel Code - Begin ******* //
void CGame&#58;&#58;SetAngelFlag1&#40;short sOwnerH, char cOwnerType, BOOL bStatus&#41; 
&#123; 
	switch &#40;cOwnerType&#41; &#123;
 &nbsp;case DEF_OWNERTYPE_PLAYER&#58;
 &nbsp;	if &#40;m_pClientList&#91;sOwnerH&#93; == NULL&#41; return;
 &nbsp; &nbsp;if &#40;bStatus == TRUE&#41;	m_pClientList&#91;sOwnerH&#93;->m_iStatus = m_pClientList&#91;sOwnerH&#93;->m_iStatus | 0x00001000;
 &nbsp; &nbsp;else &nbsp; &nbsp;	m_pClientList&#91;sOwnerH&#93;->m_iStatus = m_pClientList&#91;sOwnerH&#93;->m_iStatus & 0xFFFFEFFF;
 &nbsp; &nbsp;SendEventToNearClient_TypeA&#40;sOwnerH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL&#41;;
 &nbsp;break;
	&#125; &nbsp; &nbsp;
&#125;

void CGame&#58;&#58;SetAngelFlag2&#40;short sOwnerH, char cOwnerType, BOOL bStatus&#41; 
&#123; 
	switch &#40;cOwnerType&#41; &#123;
 &nbsp;case DEF_OWNERTYPE_PLAYER&#58;
 &nbsp;	if &#40;m_pClientList&#91;sOwnerH&#93; == NULL&#41; return;
 &nbsp; &nbsp;if &#40;bStatus == TRUE&#41;	m_pClientList&#91;sOwnerH&#93;->m_iStatus = m_pClientList&#91;sOwnerH&#93;->m_iStatus | 0x00002000;
 &nbsp; &nbsp;else &nbsp; &nbsp;	m_pClientList&#91;sOwnerH&#93;->m_iStatus = m_pClientList&#91;sOwnerH&#93;->m_iStatus & 0xFFFFDFFF;
 &nbsp; &nbsp;SendEventToNearClient_TypeA&#40;sOwnerH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL&#41;;
 &nbsp;break;
	&#125; &nbsp; &nbsp;
&#125;

void CGame&#58;&#58;SetAngelFlag3&#40;short sOwnerH, char cOwnerType, BOOL bStatus&#41; 
&#123; 
	switch &#40;cOwnerType&#41; &#123;
 &nbsp;case DEF_OWNERTYPE_PLAYER&#58;
 &nbsp;	if &#40;m_pClientList&#91;sOwnerH&#93; == NULL&#41; return;
 &nbsp; &nbsp;if &#40;bStatus == TRUE&#41;	m_pClientList&#91;sOwnerH&#93;->m_iStatus = m_pClientList&#91;sOwnerH&#93;->m_iStatus | 0x00004000;
 &nbsp; &nbsp;else &nbsp; &nbsp;	m_pClientList&#91;sOwnerH&#93;->m_iStatus = m_pClientList&#91;sOwnerH&#93;->m_iStatus & 0xFFFFBFFF;
 &nbsp; &nbsp;SendEventToNearClient_TypeA&#40;sOwnerH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL&#41;;
 &nbsp;break;
	&#125; &nbsp; &nbsp;
&#125;

void CGame&#58;&#58;SetAngelFlag4&#40;short sOwnerH, char cOwnerType, BOOL bStatus&#41; 
&#123; 
	switch &#40;cOwnerType&#41; &#123;
 &nbsp;case DEF_OWNERTYPE_PLAYER&#58;
 &nbsp;	if &#40;m_pClientList&#91;sOwnerH&#93; == NULL&#41; return;
 &nbsp; &nbsp;if &#40;bStatus == TRUE&#41;	m_pClientList&#91;sOwnerH&#93;->m_iStatus = m_pClientList&#91;sOwnerH&#93;->m_iStatus | 0x00008000;
 &nbsp; &nbsp;else &nbsp; &nbsp;	m_pClientList&#91;sOwnerH&#93;->m_iStatus = m_pClientList&#91;sOwnerH&#93;->m_iStatus & 0xFFFF7FFF;
 &nbsp; &nbsp;SendEventToNearClient_TypeA&#40;sOwnerH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL&#41;;
 &nbsp;break;
	&#125; &nbsp; &nbsp;
&#125;
// ******* Angel Code - End ******* //
<span style='color:red'>Game.h</span>

Add :

Code: Select all

	void SetAngelFlag1&#40;short sOwnerH, char cOwnerType, BOOL bStatus&#41;;
	void SetAngelFlag2&#40;short sOwnerH, char cOwnerType, BOOL bStatus&#41;;
	void SetAngelFlag3&#40;short sOwnerH, char cOwnerType, BOOL bStatus&#41;;
	void SetAngelFlag4&#40;short sOwnerH, char cOwnerType, BOOL bStatus&#41;;
<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 !
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

Eh the following functions in game.cpp where in game.cpp i add it? :lol:

ow add the following functions in Game.cpp :
CODE
// ******* 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 ******* //
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
Cyrus96
noob
Posts: 10
Joined: Sun Jan 30, 2005 7:40 pm

Post by Cyrus96 »

Dshaked wrote: Eh the following functions in game.cpp where in game.cpp i add it? :lol:

ow add the following functions in Game.cpp :
CODE
// ******* 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 ******* //
Anywhere, where u want. See that code starts with "void", that means u can add it anywhere u want, so add it to end, and add "void SetAngelFlag1(short sOwnerH, char cOwnerType, BOOL bStatus)" to game.h
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

I just fixed one, treeleft.
--------------------Configuration: HGserver - Win32 Release--------------------
Compiling...
Game.cpp
C:&#092;HBFS&#092;Hg source&#092;Game.cpp(54053) : error C2065: 'iValue' : undeclared identifier
C:&#092;HBFS&#092;Hg source&#092;Game.cpp(54059) : error C2065: 'sItemUpgrade' : undeclared identifier
C:&#092;HBFS&#092;Hg source&#092;Game.cpp(54110) : error C2065: 'dwTemp' : undeclared identifier
Error executing cl.exe.

HGserver.exe - 3 error(s), 0 warning(s)
--------------------Configuration: HGserver - Win32 Debug--------------------
Compiling...
Game.cpp
C:&#092;HBFS&#092;Hg source&#092;Game.cpp(54053) : error C2065: 'iValue' : undeclared identifier
C:&#092;HBFS&#092;Hg source&#092;Game.cpp(54059) : error C2065: 'sItemUpgrade' : undeclared identifier
C:&#092;HBFS&#092;Hg source&#092;Game.cpp(54110) : error C2065: 'dwTemp' : undeclared identifier
Error executing cl.exe.

HGserver.exe - 3 error(s), 0 warning(s)

Help plz, I dont know how repair other things : /
I deleted the upgrade funktion and tested orginal 3.72 client. Can see angels sometimes, eh?
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

please dshacked, before posting noob shit, search on google !!!

Let's read some C++ basics and learn how to define an identifier... it will take you less than 5 minutes and you'll stop to waste our time with such stupid questions !


And as i said, YOU MUSTN'T USE ORIGINAL 3.72 !! This code was not written to work with this shit ! Understood now ?
<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 !
EvilHit
Loyal fan
Posts: 356
Joined: Sun Jan 16, 2005 3:20 am

Post by EvilHit »

hey in RequestItemUpgradeHandler where do i put this code

Code: Select all

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

 &#125;
 break;
// ******* Angel Code - End ******* // 
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

pffff...

look at the code already in the function, maybe you'll figure out how to copy and paste a new case in a switch...........

Or you can look for some C++ tutorials on www.google.com
<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 !
EvilHit
Loyal fan
Posts: 356
Joined: Sun Jan 16, 2005 3:20 am

Post by EvilHit »

maybe i keep gettin errors
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

put some gazoline on your comp and throw a burning match on it ;)

you wont have any more compile errors !
<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 !
EvilHit
Loyal fan
Posts: 356
Joined: Sun Jan 16, 2005 3:20 am

Post by EvilHit »

what about u jump off a bridge
BlueChristmas
Loyal fan
Posts: 216
Joined: Wed Apr 19, 2006 12:19 am

Post by BlueChristmas »

EvilHit wrote: maybe i keep gettin errors
I got no errors on compiling both client and source parts
<img src='http://img114.imageshack.us/img114/8618 ... 2dy3lx.jpg' border='0' alt='user posted image' />
Cleroth
Loyal fan
Posts: 416
Joined: Wed Jun 16, 2004 7:08 pm

Post by Cleroth »

EvilHit wrote: what about u jump off a bridge
What about you stop bragging and work on your own shit instead of trying to 'work' on something which is beyond your comprehension.
<img src='http://ic1.deviantart.com/fs11/i/2006/1 ... leroth.gif' border='0' alt='user posted image' />
Shadoelement
Regular
Posts: 32
Joined: Mon Mar 15, 2004 8:26 pm

Post by Shadoelement »

Very nice release Diuuude and everyone else. A LOT of people appreciate the good work you do.

Btw, I thought Evilhits already had the source for Angels? Anywho, Thanks a lot and dont get discouraged by these people.
EvilHit
Loyal fan
Posts: 356
Joined: Sun Jan 16, 2005 3:20 am

Post by EvilHit »

What about you stop bragging and work on your own shit instead of trying to 'work' on something which is beyond your comprehension.
who said i was bragging ive got other source code that i was goin to release but i dont think i will now like lockin cast hackers to the map then a bot kills them and gives them a warning
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Nice thanks a lot diuude.
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