HomeUseful information for Helbreath beginnersStatistics overviewSearchMemberlistGalleryRulesRegisterLog in

 

 [CODE] Atribute Stones

Go down 
3 posters
AuthorMessage
ailyn


ailyn

Silver 4
Over 12 posts and comments.

Likes : 7

[CODE] Atribute Stones Empty
#1PostSubject: [CODE] Atribute Stones   [CODE] Atribute Stones 999104/30/2017, 7:57 pm

buenos dias, buenas tarde, buenas noches,

alguien podria decirme si es posible publicar el codigo de 

[CODE] Atribute Stones


porfavor si alguien lo tiene completo lo necesito le agradesco de hacerlo en adelanto
Back to top Go down
ailyn


ailyn

Silver 4
Over 12 posts and comments.

Likes : 7

[CODE] Atribute Stones Empty
#2PostSubject: Re: [CODE] Atribute Stones   [CODE] Atribute Stones 999104/30/2017, 7:59 pm

[CODE] Atribute Stones

Quote :
Atribute Stones By HB-Tere Staff

_________________________

Estos son unos items, que al hacerle doble click y si se?alas un arma o algo por el estilo, le da determinados stats.
_________________________

EN LOS SOURCES DEL HG

+abrir game.cpp

+buscar en la funcion _bDepleteDestTypeItemUseEffect


case DEF_ITEMEFFECTTYPE_ARMORDYE


+agregar despues del ultimo break de ese case->


Codigo:
Código:
[ltr] case DEF_ITEMEFFECTTYPE_SWEAPONATTRIBUTE_STONE:
if ((sDestItemID >= 0) && (sDestItemID < DEF_MAXITEMS)) {
if (m_pClientList[ iClientH ]->m_pItemList[sDestItemID] != NULL) {
if (m_pClientList[ iClientH ]->m_pItemList[sDestItemID]->m_cCategory == 1) {

dwSWEType = (m_pClientList[ iClientH ]->m_pItemList[sDestItemID]->m_dwAttribute & 0x0000F000) >> 12;
dwSWEValue = (m_pClientList[ iClientH ]->m_pItemList[sDestItemID]->m_dwAttribute & 0x00000F00) >> 8;

if (dwSWEValue <= 0) {
DropItemID(iClientH,
m_pClientList[ iClientH ]->m_pItemList[ sDestItemID ]->m_sIDnum,
m_pClientList[ iClientH ]->m_sX,
m_pClientList[ iClientH ]->m_sY,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue1,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue2,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue3);

ItemDepleteHandler(iClientH, sDestItemID, FALSE, FALSE);
}

else {

if ((dwSWEValue >= 1) && ( dwSWEType == m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue1)) {
DropItemID(iClientH,
m_pClientList[ iClientH ]->m_pItemList[ sDestItemID ]->m_sIDnum,
m_pClientList[iClientH]->m_sX,
m_pClientList[iClientH]->m_sY,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue1,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue2 + dwSWEValue,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue3);

ItemDepleteHandler(iClientH, sDestItemID, FALSE, FALSE);
}
else {
wsprintf(cInfo, "El item seleccionado no puede ser mejorado.");
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_IPACCOUNTINFO, NULL, NULL, NULL, cInfo);
return FALSE;
}
}
SummonCelebrate(iClientH);
return TRUE;

}

else {
wsprintf(cInfo, "El item seleccionado no puede ser mejorado.");
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_IPACCOUNTINFO, NULL, NULL, NULL, cInfo);
return FALSE;
}

}
}



case DEF_ITEMEFFECTTYPE_PWEAPONATTRIBUTE_STONE:
if ((sDestItemID >= 0) && (sDestItemID < DEF_MAXITEMS)) {
if (m_pClientList[ iClientH ]->m_pItemList[sDestItemID] != NULL) {
if (m_pClientList[ iClientH ]->m_pItemList[sDestItemID]->m_cCategory == 1) {

dwSWEType = (m_pClientList[ iClientH ]->m_pItemList[sDestItemID]->m_dwAttribute & 0x00F00000) >> 20;
dwSWEValue = (m_pClientList[ iClientH ]->m_pItemList[sDestItemID]->m_dwAttribute & 0x000F0000) >> 16;

if (dwSWEValue <= 0) {
DropItemID(iClientH,
m_pClientList[ iClientH ]->m_pItemList[ sDestItemID ]->m_sIDnum,
m_pClientList[ iClientH ]->m_sX,
m_pClientList[ iClientH ]->m_sY,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue1,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue2,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue3);

ItemDepleteHandler(iClientH, sDestItemID, FALSE, FALSE);
}

else {

if ((dwSWEValue >= 1) && ( dwSWEType == m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue1)) {
DropItemID(iClientH,
m_pClientList[ iClientH ]->m_pItemList[ sDestItemID ]->m_sIDnum,
m_pClientList[iClientH]->m_sX,
m_pClientList[iClientH]->m_sY,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue1,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue2 + dwSWEValue,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue3);

ItemDepleteHandler(iClientH, sDestItemID, FALSE, FALSE);
}
else {
wsprintf(cInfo, "El item seleccionado no puede ser mejorado.");
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_IPACCOUNTINFO, NULL, NULL, NULL, cInfo);
return FALSE;
}
}
SummonCelebrate(iClientH);
return TRUE;

}

else {
wsprintf(cInfo, "El item seleccionado no puede ser mejorado.");
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_IPACCOUNTINFO, NULL, NULL, NULL, cInfo);
return FALSE;
}

}
}[/ltr]

+ en item.h agregar:

Codigo:
Código:
[ltr]#define DEF_ITEMEFFECTTYPE_SWEAPONATTRIBUTE_STONE 34
#define DEF_ITEMEFFECTTYPE_PWEAPONATTRIBUTE_STONE 35[/ltr]

+ en game.cpp agregar:

Codigo:
Código:
[ltr]void CGame::DropItemID(int iClientH,int iItemID,int iX, int iY, int dwType, int dwValue,int cColor) {
class CItem * pItem;
pItem = new class CItem;
if (_bInitItemAttr(pItem, iItemID) == FALSE) {
delete pItem;
}
else {
if (dwType <= 10){

pItem->m_dwAttribute = NULL;
dwType = dwType << 20;
dwValue = dwValue << 16;
pItem->m_dwAttribute = pItem->m_dwAttribute | dwType | dwValue;
}
else if (dwType > 10){

dwType = dwType << 12;
dwValue = dwValue << 8;
pItem->m_dwAttribute = pItem->m_dwAttribute | dwType | dwValue;
}
pItem->m_cItemColor = cColor;
m_pMapList[ m_pClientList[iClientH]->m_cMapIndex ]->bSetItem(iX, iY, pItem);
SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_ITEMDROP, m_pClientList[iClientH]->m_cMapIndex,iX, iY, pItem->m_sSprite, pItem->m_sSpriteFrame, pItem->m_cItemColor, pItem->m_dwAttribute); // v1.4
}
}

void CGame::SummonCelebrate(int iClientH) {
char seps[] = "= \t\n";
char cOwnerType;
short sOwnerH, sType;
int dX1, dY1, dX2, dX3, dY2, dY3;
int ix, iy;

if (m_pClientList[iClientH] == NULL) return;
if (m_pClientList[iClientH]->m_bIsInitComplete == FALSE) return;
if (m_pClientList[iClientH]->m_bIsKilled == TRUE) return;
if (m_pClientList[iClientH]->m_bIsOnServerChange == TRUE) return;

sType = 14;

dX1 = m_pClientList[iClientH]->m_sX;
dX2 = m_pClientList[iClientH]->m_sX - 1;
dX3 = m_pClientList[iClientH]->m_sX + 1;

dY1 = m_pClientList[iClientH]->m_sY;
dY2 = m_pClientList[iClientH]->m_sY - 1;
dY3 = m_pClientList[iClientH]->m_sY + 1;

switch (m_pMagicConfigList[sType]->m_sType) {
case DEF_MAGICTYPE_HPUP_SPOT:
m_pMapList[m_pClientList[iClientH]->m_cMapIndex]->GetOwner(&sOwnerH, &cOwnerType, dX1, dY1);
Effect_HpUp_Spot(iClientH, DEF_OWNERTYPE_PLAYER, sOwnerH, cOwnerType, m_pMagicConfigList[sType]->m_sValue4, m_pMagicConfigList[sType]->m_sValue5, m_pMagicConfigList[sType]->m_sValue6);

SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex,
m_pClientList[iClientH]->m_sX, m_pClientList[iClientH]->m_sY, dX1, dY1, (sType + 100), m_pClientList[iClientH]->m_sType);

break;
case DEF_MAGICTYPE_SPDOWN_AREA:
m_pMapList[m_pClientList[iClientH]->m_cMapIndex]->GetOwner(&sOwnerH, &cOwnerType, dX1, dY1);

if (bCheckResistingMagicSuccess(m_pClientList[iClientH]->m_cDir, sOwnerH, cOwnerType, 95) == FALSE) {
Effect_SpDown_Spot(iClientH, DEF_OWNERTYPE_PLAYER, sOwnerH, cOwnerType, m_pMagicConfigList[sType]->m_sValue4, m_pMagicConfigList[sType]->m_sValue5, m_pMagicConfigList[sType]->m_sValue6);
}

for (iy = (dY1 - m_pMagicConfigList[sType]->m_sValue3); iy <= (dY1 + m_pMagicConfigList[sType]->m_sValue3); iy++)
for (ix = (dX1 - m_pMagicConfigList[sType]->m_sValue2); ix <= (dX1 + m_pMagicConfigList[sType]->m_sValue2); ix++) {
m_pMapList[m_pClientList[iClientH]->m_cMapIndex]->GetOwner(&sOwnerH, &cOwnerType, ix, iy);

if (bCheckResistingMagicSuccess(m_pClientList[iClientH]->m_cDir, sOwnerH, cOwnerType, 95) == FALSE) {
Effect_SpDown_Spot(iClientH, DEF_OWNERTYPE_PLAYER, sOwnerH, cOwnerType, m_pMagicConfigList[sType]->m_sValue7, m_pMagicConfigList[sType]->m_sValue8, m_pMagicConfigList[sType]->m_sValue9);
}

SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, m_pClientList[iClientH]->m_sX, m_pClientList[iClientH]->m_sY, dX1, dY1, (sType + 100), m_pClientList[iClientH]->m_sType);
}

break;
}
}[/ltr]

+ en game.h declarar:

Codigo:
[code]void SummonCelebrate(int iClientH);
void DropItemID(int iClientH,int iItemID,int iX, int iY, int dwType, int dwValue,int cColor);
Y ahora los items que tienen que agregar son:

Codigo:
Código:
[ltr]Item = 1019 AncientStone 11 0 35 9 1 8 0 0 0 1 0 6 157 -110 1 -1 0 0 0 0 0 -1 42 6
Item = 1020 SharpStone 11 0 35 7 1 6 0 0 0 1 0 6 160 -110 1 -1 0 0 0 0 0 -1 42 0
Item = 1021 ExpStone 11 0 34 11 1 7 0 0 0 1 0 6 158 -110 1 -1 0 0 0 0 0 -1 42 0
Item = 1022 LuckyStone 11 0 34 12 1 7 0 0 0 1 0 6 161 -110 1 -1 0 0 0 0 0 -1 42 0[/ltr]

_____________


Sprites necesarios:

DESCARGAR

esta publicacion era del helbreathss pero ya no esta online en fin no logro poner este codigo siempre me da errores que no entiendo
Back to top Go down
LifeX


LifeX

Diamond 1
Over 144 posts and comments.
High Engagement
Great Mentor
Great Contributions
10th Anniversary
Earned after being a member for 10 years.

Likes : 26

[CODE] Atribute Stones Empty
#3PostSubject: Re: [CODE] Atribute Stones   [CODE] Atribute Stones 999105/1/2017, 3:07 pm

After reviewing the code, there are some restriction and glitches in it, but overall its good in those specs. There is a lot for me to explain in terms of its restriction based on the code above, but with a bit of studying and coding, you can add and edit more stuffs. Just some corrections to make sure the code above works perfectly.

You will need to declare 

DWORD dwSWEType, dwSWEValue;

At the beginning of function _bDepleteDestTypeItemUseEffect

And you need to include

break;

in both the end function of the case 

DEF_ITEMEFFECTTYPE_SWEAPONATTRIBUTE_STONE
DEF_ITEMEFFECTTYPE_PWEAPONATTRIBUTE_STONE

in _bDepleteDestTypeItemUseEffect

Well shared.
Back to top Go down
Centuu.-


Centuu.-

Diamond 1
Over 144 posts and comments.
High Engagement
Great Contributions
Great Mentor
Moderator
10th Anniversary
Earned after being a member for 10 years.

Likes : 18

[CODE] Atribute Stones Empty
#4PostSubject: Re: [CODE] Atribute Stones   [CODE] Atribute Stones 999105/1/2017, 4:57 pm

And, of course, we need the sprites.
Back to top Go down
ailyn


ailyn

Silver 4
Over 12 posts and comments.

Likes : 7

[CODE] Atribute Stones Empty
#5PostSubject: Re: [CODE] Atribute Stones   [CODE] Atribute Stones 999105/2/2017, 12:20 am

este es el error que me esta dando, ya he puesto el codigo desde que lo publique, no me explique cuando mensione la palabra error, el error consiste en que cuando le doy el atributo a un item permitido, entonces ese no se borra sino que se queda y hace un nuevo con el status ancient ejemplo..

Back to top Go down
LifeX


LifeX

Diamond 1
Over 144 posts and comments.
High Engagement
Great Mentor
Great Contributions
10th Anniversary
Earned after being a member for 10 years.

Likes : 26

[CODE] Atribute Stones Empty
#6PostSubject: Re: [CODE] Atribute Stones   [CODE] Atribute Stones 999105/4/2017, 2:10 pm

Well, I don't have that issue. Probably you need to check and see if you have change any other codes.

DropItemID would be the function to give stats and also to drop the item on the floor.

The function is not dropping the item but instead adding a new item on it. Check the function.
Back to top Go down
ailyn


ailyn

Silver 4
Over 12 posts and comments.

Likes : 7

[CODE] Atribute Stones Empty
#7PostSubject: Re: [CODE] Atribute Stones   [CODE] Atribute Stones 999105/4/2017, 8:58 pm

LifeX wrote:
Well, I don't have that issue. Probably you need to check and see if you have change any other codes.

DropItemID would be the function to give stats and also to drop the item on the floor.

The function is not dropping the item but instead adding a new item on it. Check the function.




if ((dwSWEValue >= 1) && ( dwSWEType == m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue1)) {
DropItemID(iClientH,
m_pClientList[ iClientH ]->m_pItemList[ sDestItemID ]->m_sIDnum,
m_pClientList[iClientH]->m_sX,
m_pClientList[iClientH]->m_sY,

m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue1,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue2 + dwSWEValue,
m_pClientList[ iClientH ]->m_pItemList[sItemIndex]->m_sItemEffectValue3);

ItemDepleteHandler(iClientH, sDestItemID, FALSE, FALSE);

}
Back to top Go down
Sponsored content






[CODE] Atribute Stones Empty
#8PostSubject: Re: [CODE] Atribute Stones   [CODE] Atribute Stones 99910

Back to top Go down
 
[CODE] Atribute Stones
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Join Helbreath :: Development :: Deleted & Closed Posts-
Jump to: