[src] Tutelary Angels System
already calculated on the fly in my files... that's why i dun have this bug...
Anyways i forgot to post the code that removes the stats bonus when you disconnect from the server. The code is almost the same as the one for the release item handler.
Anyways i forgot to post the code that removes the stats bonus when you disconnect from the server. The code is almost the same as the one for the release item handler.
<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 !
Ahhh...diuuude wrote: already calculated on the fly in my files... that's why i dun have this bug...
Anyways i forgot to post the code that removes the stats bonus when you disconnect from the server. The code is almost the same as the one for the release item handler.
That's actually what's missing....and that's why it bugs the characters

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>
Nice Shetar ^^ Maybe you can make it view all your stat bonusses?Shetar wrote: I made a new stat which works the same way as angels:
img
img
img
Just like angels it requires a couple of modifications here and there.
My advice: Be smart and don't let the HG save the extra stats into a char file, just make the HG check at login if you got something equiped which adds stats.
Another advice: Don't let the HG save the LU points, but make it calculate it on the fly, might save some problems.
Like:
STR: 250(+5)
<img src='http://i9.tinypic.com/2vs292h.jpg' border='0' alt='user posted image' />
After we created a couple of main points which we are working on atm we'll renew all the dialog boxes, including the F5 one. We can actually make them better because we're switching to 800*600. The F5 window will also show reputation, given bonusses. (like you said, but not only stats.) I guess showing everything appart is quite handy, currently we've just added the points (like angels) but then again, I'll follow your advice

Helbreath II Project Manager & All round Developer. <br><i>(Don't worry, we're not dead)</i>
I fixed and finished Diuuude's cose for Angels. Looks fine with v351 released sources. Note I changed the way stats are changed.
Instead of really changing the stats, both server & client detect the Angels and adjust the stat's effect but keep the real value ummodified. I found that to be simpler to avoid lu or stats related side-effects/bugs...
1st, server side
Instead of really changing the stats, both server & client detect the Angels and adjust the stat's effect but keep the real value ummodified. I found that to be simpler to avoid lu or stats related side-effects/bugs...
1st, server side
Code: Select all
Game.cpp:
____________________________________________________________________
void CGame::RequestItemUpgradeHandler(int iClientH, int iItemIndex)
In the part that handles Majestic upgrade, add following code.
You may need some variables adjustment/declarations, depending on your sources:
case 46: // Pendants are category 46
if (m_pClientList[iClientH]->m_pItemList[iItemIndex]->m_cItemType != 1)
{ SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMUPGRADEFAIL, 2, NULL, NULL, NULL);
return; // Pendants are type 1
}
if (m_pClientList[iClientH]->m_pItemList[iItemIndex]->m_cEquipPos < 11)
{ SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMUPGRADEFAIL, 2, NULL, NULL, NULL);
return; // Pendants are left finger or more
}
if (m_pClientList[iClientH]->m_pItemList[iItemIndex]->m_sItemEffectType != 14)
{ SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMUPGRADEFAIL, 2, NULL, NULL, NULL);
return; // Pendants are EffectType 14
}
switch (m_pClientList[iClientH]->m_pItemList[iItemIndex]->m_sItemEffectValue1) {
default: // Other items are not upgradable
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMUPGRADEFAIL, 2, NULL, NULL, NULL);
return; // Pendants are EffectType 14
case 16: // AngelicPandent(STR)
case 17: // AngelicPandent(DEX)
case 18: // AngelicPandent(INT)
case 19: // 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 = 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);
}
return;
break;
}
break;
___________________________________________________________________
void CGame::InitPlayerData(int iClientH, char * pData, DWORD dwSize)
Be sure
CalcTotalItemEffect(iClientH, -1, TRUE); is called before bCheckMagicInt(iClientH);
( no to loose spells at every loggin if MAG angel equiped.
___________________________________________________________________
void CGame::MsgProcess()
Add a new case:
case DEF_REQUEST_ANGEL: // Angels by Snoopy...
m_pClientList[iClientH]->m_cMsgCount[1] +=1;
GetAngelHandler(iClientH, pData, dwMsgSize);
break;
___________________________________________________________________
void CGame::RequestStudyMagicHandler(int iClientH, char * pName, BOOL & bSucces, BOOL bIsPurchase)
I sugest to declare:
int iTempInt = m_pClientList[iClientH]->m_iInt;
and if the spell is not a manual: iTempInt = m_pClientList[iClientH]->m_iInt + m_pClientList[iClientH]->m_iAngelicInt;
Then use iTempInt to check for learning success.
This is optional, the aim is to avoid people using a manual then crying because their
ANgel was removed and their precious spell gone.
___________________________________________________________________
void CGame::CalcTotalItemEffect(int iClientH, int iEquipItemID, BOOL bNotify)
Important part!
At the beginning, add:
m_pClientList[iClientH]->m_iAngelicStr = 0; // By Snoopy81
m_pClientList[iClientH]->m_iAngelicInt = 0; // By Snoopy81
m_pClientList[iClientH]->m_iAngelicDex = 0; // By Snoopy81
m_pClientList[iClientH]->m_iAngelicMag = 0; // By Snoopy81
SetAngelFlag(iClientH, DEF_OWNERTYPE_PLAYER, 0, 0);
at case DEF_ITEMEFFECTTYPE_ADDEFFECT:
add more subcase:
case 12: // Adds To Hit Bonus (Xelima Neck)
m_pClientList[iClientH]->m_iHitRatio += m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue2;
break;
case 13: // Magin Ruby Characters Hp recovery rate(% applied) added by the purity formula.
m_pClientList[iClientH]->m_iAddHP += (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemSpecEffectValue2 /5);
break;
case 14: // Magin Diamond Attack probability(physical&magic) added by the purity formula.
m_pClientList[iClientH]->m_iAddAR += (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemSpecEffectValue2 /5);
break;
case 15: // Magin Emerald Magical damage decreased(% applied) by the purity formula.
m_pClientList[iClientH]->m_iAddMagicalDamage += (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemSpecEffectValue2 /10);
break;
/*Functions rates confirm.
Magic Diamond: Completion rate / 5 = Functions rate. ? Maximum 20. (not%)
Magic Ruby: Completion rate / 5 = Functions rate.(%) ? Maximum 20%.
Magic Emerald: Completion rate / 10 = Functions rate.(%) ? Maximum 10%.
Magic Sapphire: Completion rate / 10 = Functions rate.(%) ? Maximum 10%.*/
// ******* Angel Code - Begin ******* //
case 16: // Angel STR//AngelicPandent(STR)
iTemp = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
m_pClientList[iClientH]->m_iAngelicStr = iTemp +1;
SetAngelFlag(iClientH, DEF_OWNERTYPE_PLAYER, 1, iTemp);
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
break;
case 17: // Angel DEX //AngelicPandent(DEX)
iTemp = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
m_pClientList[iClientH]->m_iAngelicDex = iTemp +1;
SetAngelFlag(iClientH, DEF_OWNERTYPE_PLAYER, 2, iTemp);
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
break;
case 18: // Angel INT//AngelicPandent(INT)
iTemp = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
m_pClientList[iClientH]->m_iAngelicInt = iTemp +1;
SetAngelFlag(iClientH, DEF_OWNERTYPE_PLAYER, 3, iTemp);
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
break;
case 19: // Angel MAG//AngelicPandent(MAG)
iTemp = (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwAttribute & 0xF0000000) >> 28;
m_pClientList[iClientH]->m_iAngelicMag = iTemp +1;
SetAngelFlag(iClientH, DEF_OWNERTYPE_PLAYER, 4, iTemp);
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SETTING_SUCCESS, NULL, NULL, NULL, NULL);
break;
At the very end of the function, add:
// Snoopy: Bonus for Angels
m_pClientList[iClientH]->m_iDefenseRatio += m_pClientList[iClientH]->m_iAngelicDex * 2;
if (m_pClientList[iClientH]->m_iHP > iGetMaxHP(iClientH)) m_pClientList[iClientH]->m_iHP = iGetMaxHP(iClientH);
if (m_pClientList[iClientH]->m_iMP > iGetMaxMP(iClientH)) m_pClientList[iClientH]->m_iMP = iGetMaxMP(iClientH);
if (m_pClientList[iClientH]->m_iSP > iGetMaxSP(iClientH)) m_pClientList[iClientH]->m_iSP = iGetMaxSP(iClientH);
___________________________________________________________________
New function: (think to declare it...)
/*********************************************************************************************************************
** BOOL CGame::SetAngelFlag(short sOwnerH, char cOwnerType, int iStatus, iTemp) Snoopy **
** description :: Sets the staus to send or not Angels to every client **
*********************************************************************************************************************/
void CGame::SetAngelFlag(short sOwnerH, char cOwnerType, int iStatus, iTemp)
{ if (cOwnerType != DEF_OWNERTYPE_PLAYER) return;
if (m_pClientList[sOwnerH] == NULL) return;
switch (iStatus) {
case 1: // STR Angel
m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus | 0x00001000;
break;
case 2: // DEX Angel
m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus | 0x00002000;
break;
case 3: // INT Angel
m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus | 0x00004000;
break;
case 4: // MAG Angel
m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus | 0x00008000;
break;
default:
case 0: // Remove all Angels
m_pClientList[sOwnerH]->m_iStatus = m_pClientList[sOwnerH]->m_iStatus & 0xFFFF00FF;
break;
}
if (iTemp >4)
{ int iStars = (iTemp/3)*(iTemp/5);
m_pClientList[ sOwnerH ]->m_iStatus = m_pClientList[ sOwnerH ]->m_iStatus | ( iStars "ShiftLeft" 8); // THe forum refuses the real C++ code !
}
SendEventToNearClient_TypeA(sOwnerH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL);
}
___________________________________________________________________
New function:
/*********************************************************************************************************************
** BOOL CGame::GetAngelHandler(int iClientH, char * pData, DWORD dwMsgSize) **
** description :: Reversed and coded by Snoopy **
*********************************************************************************************************************/
void CGame::GetAngelHandler(int iClientH, char * pData, DWORD dwMsgSize)
{char *cp, cData[256], cTmpName[21];
int iAngel, iItemNbe;
class CItem * pItem;
int iRet, iEraseReq;
short * sp;
WORD * wp;
int * ip;
DWORD * dwp;
if (m_pClientList[iClientH] == NULL) return;
if (m_pClientList[iClientH]->m_bIsInitComplete == FALSE) return;
if (_iGetItemSpaceLeft(iClientH) == 0)
{ SendItemNotifyMsg(iClientH, DEF_NOTIFY_CANNOTCARRYMOREITEM, NULL, NULL);
return;
}
cp = (char *)(pData + DEF_INDEX2_MSGTYPE + 2);
ZeroMemory(cTmpName, sizeof(cTmpName));
strcpy(cTmpName, cp);
cp += 20;
ip = (int *)cp;
iAngel = (int) *ip; // 0x00 l a i
cp += 2;
wsprintf(G_cTxt, "PC(%s) obtained an Angel (%d). %s(%d %d)"
, m_pClientList[iClientH]->m_cCharName
, iAngel
, m_pClientList[iClientH]->m_cMapName
, m_pClientList[iClientH]->m_sX
, m_pClientList[iClientH]->m_sY);
PutLogList(G_cTxt);
switch (iAngel) {
case 1: // STR
iItemNbe = 1108;
break;
case 2: // DEX
iItemNbe = 1109;
break;
case 3: // INT
iItemNbe = 1110;
break;
case 4: // MAG
iItemNbe = 1111;
break;
default:
PutLogList("Gail asked to create a wrong item!");
break;
}
pItem = NULL;
pItem = new class CItem;
if (pItem == NULL) return;
if ((_bInitItemAttr(pItem, iItemNbe) == TRUE))
{ pItem->m_sTouchEffectType = DEF_ITET_UNIQUE_OWNER;
pItem->m_sTouchEffectValue1 = m_pClientList[iClientH]->m_sCharIDnum1;
pItem->m_sTouchEffectValue2 = m_pClientList[iClientH]->m_sCharIDnum2;
pItem->m_sTouchEffectValue3 = m_pClientList[iClientH]->m_sCharIDnum3;
if (_bAddClientItemList(iClientH, pItem, &iEraseReq) == TRUE)
{ ZeroMemory(cData, sizeof(cData));
dwp = (DWORD *)(cData + DEF_INDEX4_MSGID);
*dwp = MSGID_NOTIFY;
wp = (WORD *)(cData + DEF_INDEX2_MSGTYPE);
*wp = DEF_NOTIFY_ITEMOBTAINED;
cp = (char *)(cData + DEF_INDEX2_MSGTYPE + 2);
*cp = 1;
cp++;
memcpy(cp, pItem->m_cName, 20);
cp += 20;
dwp = (DWORD *)cp;
*dwp = pItem->m_dwCount;
cp += 4;
*cp = pItem->m_cItemType;
cp++;
*cp = pItem->m_cEquipPos;
cp++;
*cp = (char)0;
cp++;
sp = (short *)cp;
*sp = pItem->m_sLevelLimit;
cp += 2;
*cp = pItem->m_cGenderLimit;
cp++;
wp = (WORD *)cp;
*wp = pItem->m_wCurLifeSpan;
cp += 2;
wp = (WORD *)cp;
*wp = pItem->m_wWeight;
cp += 2;
sp = (short *)cp;
*sp = pItem->m_sSprite;
cp += 2;
sp = (short *)cp;
*sp = pItem->m_sSpriteFrame;
cp += 2;
*cp = pItem->m_cItemColor;
cp++;
*cp = (char)pItem->m_sItemSpecEffectValue2; // v1.41
cp++;
dwp = (DWORD *)cp;
*dwp = pItem->m_dwAttribute;
cp += 4;
if (iEraseReq == 1) delete pItem;
iRet = m_pClientList[iClientH]->m_pXSock->iSendMsg(cData, 53);
switch (iRet) {
case DEF_XSOCKEVENT_QUENEFULL:
case DEF_XSOCKEVENT_SOCKETERROR:
case DEF_XSOCKEVENT_CRITICALERROR:
case DEF_XSOCKEVENT_SOCKETCLOSED:
DeleteClient(iClientH, TRUE, TRUE);
break;
}
}else
{ m_pMapList[ m_pClientList[iClientH]->m_cMapIndex ]->bSetItem(m_pClientList[iClientH]->m_sX,
m_pClientList[iClientH]->m_sY, pItem);
SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_ITEMDROP, m_pClientList[iClientH]->m_cMapIndex,
m_pClientList[iClientH]->m_sX, m_pClientList[iClientH]->m_sY,
pItem->m_sSprite, pItem->m_sSpriteFrame, pItem->m_cItemColor); // v1.4
dwp = (DWORD *)(cData + DEF_INDEX4_MSGID);
*dwp = MSGID_NOTIFY;
wp = (WORD *)(cData + DEF_INDEX2_MSGTYPE);
*wp = DEF_NOTIFY_CANNOTCARRYMOREITEM;
iRet = m_pClientList[iClientH]->m_pXSock->iSendMsg(cData, 6);
switch (iRet) {
case DEF_XSOCKEVENT_QUENEFULL:
case DEF_XSOCKEVENT_SOCKETERROR:
case DEF_XSOCKEVENT_CRITICALERROR:
case DEF_XSOCKEVENT_SOCKETCLOSED:
DeleteClient(iClientH, TRUE, TRUE);
break;
} }
}else
{ delete pItem;
pItem = NULL;
} }
___________________________________________________________________
And finally the bigger Game.cpp part:
Search for all m_iStr, m_iInt, m_iDex, m_iMag
Some of them a used to send to the client, or logserver, don't touch those.
Many of them have in game effect. I all those cases add corresponding Angelic value:
ie, in:
void CGame::CheckClientResponseTime()
(Activables items delays & resur spell)
BOOL CGame::bEquipItemHandler(..)
(item weight, wearing conditions, speed....)
void CGame::PlayerMagicHandler(..)
( casting proba, Spell strengh)
void CGame::RequestStudyMagicHandler(..)
(Buying spells)
BOOL CGame::bCheckMagicInt(..)
(removing spells)
int CGame::_iCalcMaxLoad(..)
void CGame::CalculateSSN_SkillIndex(..)
void CGame::CalculateSSN_ItemIndex(..)
void CGame::Effect_Damage_Spot(..)
void CGame::Effect_Damage_Spot_DamageMove(..)
BOOL CGame::bCheckResistingMagicSuccess(..)
void CGame::CalcTotalItemEffect(..)
(Maybe is special item conditions set)
int CGame::iGetMaxHP(.. / MP /SP
int CGame::iCalculateAttackEffect(..)
(Obvious !)
BOOL CGame::_bCheckCharacterData(..)
And maybe some more places depending on your server...
___________________________________________________________________
___________________________________________________________________
NetMessages.h
Add a declaration:
// Reversed by Snoopy from real 3.72 client
#define DEF_REQUEST_ANGEL 0x0FC9421E
___________________________________________________________________
Client.h
Add declarations:
int m_iAngelicStr; // By Snoopy81
int m_iAngelicInt; // By Snoopy81
int m_iAngelicDex; // By Snoopy81
int m_iAngelicMag; // By Snoopy81
Client.cpp
Initialise..
m_iAngelicStr = 0; // By Snoopy81
m_iAngelicInt = 0;
m_iAngelicDex = 0;
m_iAngelicMag = 0;
___________________________________________________________________
_\_ _<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
Then, here is the client sided codes. They're designed to meet to C++ 351 sources that I released, of course...
Code: Select all
Game.cpp
_________________________________________________________________________
BOOL CGame::bSendCommand(..)
Add a new case:
case DEF_REQUEST_ANGEL: // to Game Server
dwp = (DWORD *)(cMsg + DEF_INDEX4_MSGID);
*dwp = dwMsgID;
wp = (WORD *)(cMsg + DEF_INDEX2_MSGTYPE);
*wp = NULL;
cp = (char*)(cMsg + 6);
memset( cp, 0, 20 );
memcpy((char *)cp, pString, strlen(pString) + 1);
cp += 20;
ip = (int *)cp;
*ip = iV1; // Angel ID
iRet = m_pGSock->iSendMsg(cMsg, 30, cKey);
break;
_________________________________________________________________________
void CGame::UpdateScreen_OnLoading(bool bActive)
Add sprites in the right places:
m_pSprite[DEF_SPRID_ITEMPACK_PIVOTPOINT+22] = new class CSprite(m_hPakFile, &m_DDraw, "item-pack", 19, FALSE); // Angels
m_pSprite[DEF_SPRID_ITEMGROUND_PIVOTPOINT+22] = new class CSprite(m_hPakFile, &m_DDraw, "item-ground", 19, FALSE);//Angels
MakeSprite( "TutelarAngel1", DEF_SPRID_TUTELARYANGELS_PIVOTPOINT + 50*0, 48, FALSE);//(STR)
MakeSprite( "TutelarAngel2", DEF_SPRID_TUTELARYANGELS_PIVOTPOINT + 50*1, 48, FALSE);//(DEX)
MakeSprite( "TutelarAngel3", DEF_SPRID_TUTELARYANGELS_PIVOTPOINT + 50*2, 48, FALSE);//(INT)
MakeSprite( "TutelarAngel4", DEF_SPRID_TUTELARYANGELS_PIVOTPOINT + 50*3, 48, FALSE);//(MAG)
m_pSprite[DEF_SPRID_ITEMEQUIP_PIVOTPOINT + 22] = new class CSprite(m_hPakFile, &m_DDraw, "item-pack", 19); // Angels
m_pSprite[DEF_SPRID_ITEMEQUIP_PIVOTPOINT + 62] = new class CSprite(m_hPakFile, &m_DDraw, "item-pack", 19); // Angels
_________________________________________________________________________
void CGame::InitPlayerCharacteristics(char * pData)
Initialise data:
// Snoopy: Angels
m_iAngelicStr = 0;
m_iAngelicDex = 0;
m_iAngelicInt = 0;
m_iAngelicMag = 0;
_________________________________________________________________________
void CGame::DrawObject_OnXXXX(..)
Find every "CheckActiveAura2(...)", and add just before:
DrawAngel(...) as stated by Diuuude.
_________________________________________________________________________
void CGame::InitItemList(char * pData)
At the end of reading item loop, add: (not the Bankitem loop ! )
// Add Angelic Stats
if ( (m_pItemList[i]->m_cItemType == 1)
&& (m_bIsItemEquipped[i] == TRUE)
&& (m_pItemList[i]->m_cEquipPos >= 11))
{ if(memcmp(m_pItemList[i]->m_cName, "AngelicPandent(STR)", 19) == 0)
{ iAngelValue = (m_pItemList[i]->m_dwAttribute & 0xF0000000) >> 28;
m_iAngelicStr = 1 + iAngelValue;
}else if(memcmp(m_pItemList[i]->m_cName, "AngelicPandent(DEX)", 19) == 0)
{ iAngelValue = (m_pItemList[i]->m_dwAttribute & 0xF0000000) >> 28;
m_iAngelicDex = 1 + iAngelValue;
}else if(memcmp(m_pItemList[i]->m_cName, "AngelicPandent(INT)", 19) == 0)
{ iAngelValue = (m_pItemList[i]->m_dwAttribute & 0xF0000000) >> 28;
m_iAngelicInt = 1 + iAngelValue;
}else if(memcmp(m_pItemList[i]->m_cName, "AngelicPandent(MAG)", 19) == 0)
{ iAngelValue = (m_pItemList[i]->m_dwAttribute & 0xF0000000) >> 28;
m_iAngelicMag = 1 + iAngelValue;
} } }
& declare iAngelValue at begin of function....
_________________________________________________________________________
void CGame::DrawDialogBox_GaugePannel()
Adjust formulas:
ie: iMaxPoint = m_iVit*3 + m_iLevel*2 + (m_iStr + m_iAngelicStr)/2;
And lower HP if above MaxHP, MP if above maxMP, SP ....
_________________________________________________________________________
void CGame::NotifyMsgHandler(char * pData)
at the end of case DEF_NOTIFY_SPECIALABILITYSTATUS: , add:
else if (sV1 == 4) // Unequiped the SA item
{ AddEventList(NOTIFY_MSG_HANDLER31, 10);//"Special ability has been released."
m_iSpecialAbilityType = 0;
}else if (sV1 == 5) // Angel
{ PlaySound('E', 34, 0);
}
NB: This function is a bit... strange... you may wish to adjust all the case...
_________________________________________________________________________
void CGame::DlbBoxDoubleClick_Character(short msX, short msY)
void CGame::bItemDrop_Inventory(short msX, short msY)
Near the end, just before SendCommand (MSGID_COMMAND_COMMON, DEF_COMMONTYPE_RELEASEITEM, add:
// Remove Angelic Stats
if ( (m_pItemList[m_stMCursor.sSelectedObjectID]->m_cEquipPos >= 11)
&& (m_pItemList[m_stMCursor.sSelectedObjectID]->m_cItemType == 1))
{ char cItemID = m_stMCursor.sSelectedObjectID;
if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(STR)", 19) == 0)
{ m_iAngelicStr = 0;
}else if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(DEX)", 19) == 0)
{ m_iAngelicDex = 0;
}else if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(INT)", 19) == 0)
{ m_iAngelicInt = 0;
}else if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(MAG)", 19) == 0)
{ m_iAngelicMag = 0;
} }
_________________________________________________________________________
void CGame::DrawDialogBox_Character(short msX, short msY)
Adjust HP, MP, SP formulas.(hp, mp, sp, maxload):
// HP
wsprintf(G_cTxt, "%d/%d", iTemp, m_iVit*3 + m_iLevel*2 + (m_iStr + m_iAngelicStr)/2);
PutAlignedString(sX+180, sX+250, sY + 173, G_cTxt, 45,25,25);
// Mp
iTemp = m_iMP;
wsprintf(G_cTxt, "%d/%d", iTemp, (m_iMag + m_iAngelicMag)*2 + m_iLevel*2 + (m_iInt + m_iAngelicInt)/2);
PutAlignedString(sX+180, sX+250, sY + 191, G_cTxt, 45,25,25);
// Sp
iTemp = m_iSP;
wsprintf(G_cTxt, "%d/%d", iTemp, m_iLevel*2 + (m_iStr + m_iAngelicStr)*2);
PutAlignedString(sX+180, sX+250, sY + 208, G_cTxt, 45,25,25);
// Max.Load
wsprintf(G_cTxt, "%d/%d", (_iCalcTotalWeight()/100), ((m_iStr + m_iAngelicStr)*5 + m_iLevel*5));
PutAlignedString(sX+180, sX+250, sY + 240, G_cTxt, 45,25,25);
// Enemy Kills
wsprintf(G_cTxt, "%d", m_iEnemyKillCount);
PutAlignedString(sX+180, sX+250, sY + 257, G_cTxt, 45,25,25);
// Str
if (m_iAngelicStr == 0)
{ wsprintf(G_cTxt, "%d", m_iStr);
PutAlignedString(sX+48, sX+82, sY + 285, G_cTxt, 45,25,25);
}else
{ wsprintf(G_cTxt, "%d", m_iStr + m_iAngelicStr);
PutAlignedString(sX+48, sX+82, sY + 285, G_cTxt, 0,0,192);
}
// Vit
wsprintf(G_cTxt, "%d", m_iVit);
PutAlignedString(sX+218, sX+251, sY + 285, G_cTxt, 45,25,25);
// Dex
if (m_iAngelicDex == 0)
{ wsprintf(G_cTxt, "%d", m_iDex);
PutAlignedString(sX+48, sX+82, sY +302, G_cTxt, 45,25,25);
}else
{ wsprintf(G_cTxt, "%d", m_iDex + m_iAngelicDex);
PutAlignedString(sX+48, sX+82, sY +302, G_cTxt, 0,0,192);
}
// Int
if (m_iAngelicInt == 0)
{ wsprintf(G_cTxt, "%d", m_iInt);
PutAlignedString(sX+135, sX+167, sY +285, G_cTxt, 45,25,25);
}else
{ wsprintf(G_cTxt, "%d", m_iInt + m_iAngelicInt);
PutAlignedString(sX+135, sX+167, sY +285, G_cTxt, 0,0,192);
}
// Mag
if (m_iAngelicMag == 0)
{ wsprintf(G_cTxt, "%d", m_iMag);
PutAlignedString(sX+135, sX+167, sY +302, G_cTxt, 45,25,25);
}else
{ wsprintf(G_cTxt, "%d", m_iMag + m_iAngelicMag);
PutAlignedString(sX+135, sX+167, sY +302, G_cTxt, 0,0,192);
}
_________________________________________________________________________
void CGame::DrawDialogBox_Magic(short msX, short msY, short msZ)
Correct the CP formula:
if ((m_iInt + m_iAngelicInt) > 50) iResult += ((m_iInt + m_iAngelicInt) - 50)/2;
_________________________________________________________________________
void CGame::DrawDialogBox_ItemUpgrade(int msX, int msY)
You may adjust some things....
below "iValue = iValue*(iValue+6)/8 + 2;", add:
if ( (m_pItemList[m_stDialogBoxInfo[34].sV1]->m_cEquipPos >= 11)
&& (m_pItemList[m_stDialogBoxInfo[34].sV1]->m_cItemType == 1))
{ if( (memcmp(m_pItemList[m_stDialogBoxInfo[34].sV1]->m_cName, "AngelicPandent(STR)", 19) == 0)
|| (memcmp(m_pItemList[m_stDialogBoxInfo[34].sV1]->m_cName, "AngelicPandent(DEX)", 19) == 0)
|| (memcmp(m_pItemList[m_stDialogBoxInfo[34].sV1]->m_cName, "AngelicPandent(INT)", 19) == 0)
|| (memcmp(m_pItemList[m_stDialogBoxInfo[34].sV1]->m_cName, "AngelicPandent(MAG)", 19) == 0))
{ iValue = (m_pItemList[m_stDialogBoxInfo[34].sV1]->m_dwAttribute & 0xF0000000) >> 28;
switch (iValue) {
case 0: iValue = 10; break;
case 1: iValue = 11; break;
case 2: iValue = 13; break;
case 3: iValue = 16; break;
case 4: iValue = 20; break;
case 5: iValue = 25; break;
case 6: iValue = 31; break;
case 7: iValue = 38; break;
case 8: iValue = 46; break;
case 9: iValue = 55; break;
} } }
_________________________________________________________________________
void CGame::ReleaseEquipHandler(char cEquipPos)
above GetItemName(..), add:
// Remove Angelic Stats
if ( (cEquipPos >= 11)
&& (m_pItemList[m_sItemEquipmentStatus[cEquipPos]]->m_cItemType == 1))
{ char cItemID = m_sItemEquipmentStatus[cEquipPos];
if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(STR)", 19) == 0)
{ m_iAngelicStr = 0;
}else if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(DEX)", 19) == 0)
{ m_iAngelicDex = 0;
}else if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(INT)", 19) == 0)
{ m_iAngelicInt = 0;
}else if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(MAG)", 19) == 0)
{ m_iAngelicMag = 0;
} }
_________________________________________________________________________
void CGame::ItemEquipHandler(char cItemID)
Adjust for Weight, and add near the end:
// Add Angelic Stats
if ( (m_pItemList[cItemID]->m_cItemType == 1)
&& (m_pItemList[cItemID]->m_cEquipPos >= 11))
{ int iAngelValue = 0;
if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(STR)", 19) == 0)
{ iAngelValue = (m_pItemList[cItemID]->m_dwAttribute & 0xF0000000) >> 28;
m_iAngelicStr = 1 + iAngelValue;
}else if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(DEX)", 19) == 0)
{ iAngelValue = (m_pItemList[cItemID]->m_dwAttribute & 0xF0000000) >> 28;
m_iAngelicDex = 1 + iAngelValue;
}else if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(INT)", 19) == 0)
{ iAngelValue = (m_pItemList[cItemID]->m_dwAttribute & 0xF0000000) >> 28;
m_iAngelicInt = 1 + iAngelValue;
}else if(memcmp(m_pItemList[cItemID]->m_cName, "AngelicPandent(MAG)", 19) == 0)
{ iAngelValue = (m_pItemList[cItemID]->m_dwAttribute & 0xF0000000) >> 28;
m_iAngelicMag = 1 + iAngelValue;
}
_________________________________________________________________________
New function, by Diuuude:
void CGame::DrawAngel(int iSprite, short sX, short sY, char cFrame, DWORD dwTime)
{ if ((_tmp_iStatus & 0x1000) != 0) m_pSprite[DEF_SPRID_TUTELARYANGELS_PIVOTPOINT+iSprite]->PutSpriteFast(sX, sY, cFrame, dwTime); //AngelicPendant(STR)
else if ((_tmp_iStatus & 0x2000) != 0) m_pSprite[DEF_SPRID_TUTELARYANGELS_PIVOTPOINT+(50*1)+iSprite]->PutSpriteFast(sX, sY, cFrame, dwTime); //AngelicPendant(DEX)
else if ((_tmp_iStatus & 0x4000) != 0) m_pSprite[DEF_SPRID_TUTELARYANGELS_PIVOTPOINT+(50*2)+iSprite]->PutSpriteFast(sX, sY-20, cFrame, dwTime);//AngelicPendant(INT)
else if ((_tmp_iStatus & 0x8000) != 0) m_pSprite[DEF_SPRID_TUTELARYANGELS_PIVOTPOINT+(50*3)+iSprite]->PutSpriteFast(sX, sY-20, cFrame, dwTime);//AngelicPendant(MAG)
}
_________________________________________________________________________
2 fixed functions:
/*********************************************************************************************************************
** void DrawDialogBox_CMDHallMenu(short msX, short msY) ( Snoopy ) **
** description : Draw the diag **
**********************************************************************************************************************/
void CGame::DrawDialogBox_CMDHallMenu(short msX, short msY)
{short sX, sY, szX;
char cTxt[120];
sX = m_stDialogBoxInfo[51].sX;
sY = m_stDialogBoxInfo[51].sY;
szX = m_stDialogBoxInfo[51].sSizeX;
DrawNewDialogBox(DEF_SPRID_INTERFACE_ND_GAME2, sX, sY, 2);
switch (m_stDialogBoxInfo[51].cMode) {
case 0: // initial diag
if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 70) && (msY < sY + 95))
PutAlignedString(sX, sX + szX, sY + 70, "Teleport to Battle Field", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 70, "Teleport to Battle Field", 4,0,50);
if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 95) && (msY < sY + 120))
PutAlignedString(sX, sX + szX, sY + 95, "Hire a soldier", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 95, "Hire a soldier", 4,0,50);
if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 120) && (msY < sY + 145))
PutAlignedString(sX, sX + szX, sY + 120, "Taking Flags", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 120, "Taking Flags", 4,0,50);
if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 145) && (msY < sY + 170))
PutAlignedString(sX, sX + szX, sY + 145, "Receive a Tutelary Angel", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 145, "Receive a Tutelary Angel", 4,0,50);
break;
case 1: // TP diag
if( m_iTeleportMapCount > 0 )
{ //PutAlignedString(sX, sX + szX, sY + 50, DRAW_DIALOGBOX_CITYHALL_MENU69, 55,25,25); // "Teleporting to dungeon level 2."
//PutAlignedString(sX, sX + szX, sY + 80, DRAW_DIALOGBOX_CITYHALL_MENU70, 55,25,25); // "5000Gold is required"
//PutAlignedString(sX, sX + szX, sY + 95, DRAW_DIALOGBOX_CITYHALL_MENU71, 55,25,25); //
//PutAlignedString(sX, sX + szX, sY + 110, DRAW_DIALOGBOX_CITYHALL_MENU72, 55,25,25);//
PutString2(sX + 35, sY + 250, DRAW_DIALOGBOX_CITYHALL_MENU72_1, 55,25,25);//"Civilians cannot go some area."
for( int i=0; i<m_iTeleportMapCount; i++ )
{ ZeroMemory( cTxt, sizeof(cTxt) );
GetOfficialMapName( m_stTeleportList[i].mapname, cTxt );
wsprintf( G_cTxt, DRAW_DIALOGBOX_CITYHALL_MENU77, cTxt, m_stTeleportList[i].iCost );
if( (msX >= sX + DEF_LBTNPOSX) && (msX <= sX + DEF_RBTNPOSX + DEF_BTNSZX) && (msY >= sY + 130 + i*15) && (msY <= sY + 144 + i*15) )
PutAlignedString(sX, sX + szX, sY + 130 + i*15, G_cTxt, 255, 255, 255);
else PutAlignedString(sX, sX + szX, sY + 130 + i*15, G_cTxt, 250, 250, 0);
}
}else if( m_iTeleportMapCount == -1 )
{ PutAlignedString(sX, sX + szX, sY + 125, DRAW_DIALOGBOX_CITYHALL_MENU73, 55,25,25);//"Now it's searching for possible area"
PutAlignedString(sX, sX + szX, sY + 150, DRAW_DIALOGBOX_CITYHALL_MENU74, 55,25,25);//"to teleport."
PutAlignedString(sX, sX + szX, sY + 175, DRAW_DIALOGBOX_CITYHALL_MENU75, 55,25,25);//"Please wait for a moment."
}else
{ PutAlignedString(sX, sX + szX, sY + 175, DRAW_DIALOGBOX_CITYHALL_MENU76, 55,25,25);//"There is no area that you can teleport."
}
break;
case 2: // Soldier diag
PutAlignedString(sX, sX + szX, sY + 45, "You will hire a soldier by summon points", 255,255,255);
if ((m_iConstructionPoint >= 2000) && (m_bIsCrusadeMode == FALSE))
{ if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 70) && (msY < sY + 95))
PutAlignedString(sX, sX + szX, sY + 70, "Sorceress 2000 Point", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 70, "Sorceress 2000 Point", 4,0,50);
}else PutAlignedString(sX, sX + szX, sY + 70, "Sorceress 2000 Point", 65,65,65);
if ((m_iConstructionPoint >= 3000) && (m_bIsCrusadeMode == FALSE))
{ if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 95) && (msY < sY + 120))
PutAlignedString(sX, sX + szX, sY + 95, "Ancient Temple Knight 3000 Point", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 95, "Ancient Temple Knight 3000 Point", 4,0,50);
}else PutAlignedString(sX, sX + szX, sY + 95, "Ancient Temple Knight 3000 Point", 65,65,65);
if ((m_iConstructionPoint >= 1500) && (m_bIsCrusadeMode == FALSE))
{ if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 120) && (msY < sY + 145))
PutAlignedString(sX, sX + szX, sY + 120, "Elf Master 1500 Point", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 120, "Elf Master 1500 Point", 4,0,50);
}else PutAlignedString(sX, sX + szX, sY + 120, "Elf Master 1500 Point", 65,65,65);
if ((m_iConstructionPoint >= 3000) && (m_bIsCrusadeMode == FALSE))
{ if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 145) && (msY < sY + 171))
PutAlignedString(sX, sX + szX, sY + 145, "Dark Shadow Knight 3000 Point", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 145, "Dark Shadow Knight 3000 Point", 4,0,50);
}else PutAlignedString(sX, sX + szX, sY + 145, "Dark Shadow Knight 3000 Point", 65,65,65);
if ((m_iConstructionPoint >= 4000) && (m_bIsCrusadeMode == FALSE))
{ if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 170) && (msY < sY + 195))
PutAlignedString(sX, sX + szX, sY + 170, "Heavy Battle Tank 4000 Point", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 170, "Heavy Battle Tank 4000 Point", 4,0,50);
}else PutAlignedString(sX, sX + szX, sY + 170, "Heavy Battle Tank 4000 Point", 65,65,65);
if ((m_iConstructionPoint >= 3000) && (m_bIsCrusadeMode == FALSE))
{ if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 195) && (msY < sY + 220))
PutAlignedString(sX, sX + szX, sY + 195, "Barbarian 3000 Point", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 195, "Barbarian 3000 Point", 4,0,50);
}else PutAlignedString(sX, sX + szX, sY + 195, "Barbarian 3000 Point", 65,65,65);
PutAlignedString(sX, sX + szX, sY + 220,"You should join a guild to hire soldiers.", 4,0,50);
wsprintf(G_cTxt,"Summon points : %d", m_iConstructionPoint);
PutAlignedString(sX, sX + szX, sY + 250, G_cTxt, 4,0,50);
PutAlignedString(sX, sX + szX, sY + 280, "Maximum summon points : 12000 points.", 4,0,50);
PutAlignedString(sX, sX + szX, sY + 300, "Maximum hiring number : 5 ", 4,0,50);
break;
case 3: // Hire a Flag Diag
PutAlignedString(sX, sX + szX, sY + 45,"You may acquire Flags with EK points.", 4,0,50);
PutAlignedString(sX, sX + szX, sY + 70,"Price is 10 EK per Flag.", 4,0,50);
if( (msX >= sX + 35) && (msX <= sX + 220) && (msY >= sY + 140) && (msY <= sY + 165) )
PutAlignedString(sX, sX + szX, sY + 140, "Take a Flag", 255,255,255);
else
PutAlignedString(sX, sX + szX, sY + 140, "Take a Flag", 250,250,0);
break;
case 4: // Tutelar Angel Diag
PutAlignedString(sX, sX + szX, sY + 45, "5 magesty points will be deducted", 4,0,50);
PutAlignedString(sX, sX + szX, sY + 80, "upon receiving the Pendant of Tutelary Angel.", 4,0,50);
PutAlignedString(sX, sX + szX, sY + 105, "Would you like to receive the Tutelary Angel?", 4,0,50);
wsprintf(G_cTxt, DRAW_DIALOGBOX_ITEMUPGRADE11, m_iGizonItemUpgradeLeft);// "Item upgrade point : %d"
PutAlignedString(sX, sX + szX, sY + 140, G_cTxt, 0,0,0);
if ( (msX > sX + 35) && (msX < sX + 220) && (msY > sY + 175) && (msY < sY + 200)
&& (m_iGizonItemUpgradeLeft >4))
PutAlignedString(sX, sX + szX, sY + 175, "Tutelary Angel (STR) will be handed out.", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 175, "Tutelary Angel (STR) will be handed out.", 250,250,0);
if ( (msX > sX + 35) && (msX < sX + 220) && (msY > sY + 200) && (msY < sY + 225)
&& (m_iGizonItemUpgradeLeft >4))
PutAlignedString(sX, sX + szX, sY + 200, "Tutelary Angel (DEX) will be handed out.", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 200, "Tutelary Angel (DEX) will be handed out.", 250,250,0);
if ( (msX > sX + 35) && (msX < sX + 220) && (msY > sY + 225) && (msY < sY + 250)
&& (m_iGizonItemUpgradeLeft >4))
PutAlignedString(sX, sX + szX, sY + 225, "Tutelary Angel (INT) will be handed out.", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 225, "Tutelary Angel (INT) will be handed out.", 250,250,0);
if ( (msX > sX + 35) && (msX < sX + 220) && (msY > sY + 250) && (msY < sY + 275)
&& (m_iGizonItemUpgradeLeft >4))
PutAlignedString(sX, sX + szX, sY + 250, "Tutelary Angel (MAG) will be handed out.", 255,255,255);
else PutAlignedString(sX, sX + szX, sY + 250, "Tutelary Angel (MAG) will be handed out.", 250,250,0);
break;
}
}
/*********************************************************************************************************************
** void DlgBoxClick_CMDHallMenu(short msX, short msY) ( Snoopy ) **
** description : Response of the player if he accepts resurection or not **
**********************************************************************************************************************/
void CGame::DlgBoxClick_CMDHallMenu(short msX, short msY)
{short sX, sY;
sX = m_stDialogBoxInfo[51].sX;
sY = m_stDialogBoxInfo[51].sY;
switch (m_stDialogBoxInfo[51].cMode) {
case 0: // initial diag
if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 70) && (msY < sY + 95))
{ m_stDialogBoxInfo[51].cMode = 1; // TP diag
m_iTeleportMapCount = -1;
bSendCommand(MSGID_REQUEST_HELDENIAN_TP_LIST, NULL, NULL, NULL, NULL, NULL, NULL);
PlaySound('E', 14, 5);
}
if ((msX > sX + 35) && (msX < sX + 220) && (msY > sY + 95) && (msY < sY + 120))
{ m_stDialogBoxInfo[51].cMode = 2; // Soldier Diag
PlaySound('E', 14, 5);
}
if ( (msX > sX + 35) && (msX < sX + 220) && (msY > sY + 120) && (msY < sY + 145)
/*&& (m_iEnemyKillCount >= 3)*/)
{ m_stDialogBoxInfo[51].cMode = 3; // Flag Diag
PlaySound('E', 14, 5);
}
if ( (msX > sX + 35) && (msX < sX + 220) && (msY > sY + 120) && (msY < sY + 145)
/*&& (m_iEnemyKillCount >= 3)*/)
{ m_stDialogBoxInfo[51].cMode = 3; // Flag Diag
PlaySound('E', 14, 5);
}
if ( (msX > sX + 35) && (msX < sX + 220) && (msY > sY + 145) && (msY < sY + 170)
/*&& (m_iGizonItemUpgradeLeft >= 5)*/)
{ m_stDialogBoxInfo[51].cMode = 4; // Flag Diag
PlaySound('E', 14, 5);
}
case 1: // TP now
if( m_iTeleportMapCount > 0 )
{ for( int i=0; i<m_iTeleportMapCount; i++ )
{ if( (msX >= sX + DEF_LBTNPOSX) && (msX <= sX + DEF_RBTNPOSX + DEF_BTNSZX) && (msY >= sY + 130 + i*15) && (msY <= sY + 144 + i*15) )
{ bSendCommand(MSGID_REQUEST_HELDENIAN_TP, NULL, NULL, m_stTeleportList[i].iIndex, NULL, NULL, NULL);
DisableDialogBox(51);
return;
} } }
break;
case 2: // Buy a soldier scroll
if ( (msX >= sX + 35) && (msX <= sX + 220) && (msY > sY + 70) && (msY < sY + 95)
&& (m_iConstructionPoint >= 2000) && (m_bIsCrusadeMode == FALSE)) // Sorceress
{ bSendCommand(MSGID_REQUEST_HELDENIAN_SCROLL, 875, 1, 2, 3, 4, "Gail", 5);
PlaySound('E', 14, 5);
}
if ( (msX >= sX + 35) && (msX <= sX + 220) && (msY > sY + 95) && (msY < sY + 120)
&& (m_iConstructionPoint >= 3000) && (m_bIsCrusadeMode == FALSE)) // ATK
{ bSendCommand(MSGID_REQUEST_HELDENIAN_SCROLL, 876, 0, 0, 0, 0, "Gail", 0);
PlaySound('E', 14, 5);
}
if ( (msX >= sX + 35) && (msX <= sX + 220) && (msY > sY + 120) && (msY < sY + 145)
&& (m_iConstructionPoint >= 1500) && (m_bIsCrusadeMode == FALSE)) // Elf
{ bSendCommand(MSGID_REQUEST_HELDENIAN_SCROLL, 877, 0, 0, 0, 0, "Gail", 0);
PlaySound('E', 14, 5);
}
if ( (msX >= sX + 35) && (msX <= sX + 220) && (msY > sY + 145) && (msY < sY + 170)
&& (m_iConstructionPoint >= 3000) && (m_bIsCrusadeMode == FALSE)) // DSK
{ bSendCommand(MSGID_REQUEST_HELDENIAN_SCROLL, 878, 0, 0, 0, 0, "Gail", 0);
PlaySound('E', 14, 5);
}
if ( (msX >= sX + 35) && (msX <= sX + 220) && (msY > sY + 170) && (msY < sY + 195)
&& (m_iConstructionPoint >= 4000) && (m_bIsCrusadeMode == FALSE)) // HBT
{ bSendCommand(MSGID_REQUEST_HELDENIAN_SCROLL, 879, 0, 0, 0, 0, "Gail", 0);
PlaySound('E', 14, 5);
}
if ( (msX >= sX + 35) && (msX <= sX + 220) && (msY > sY + 195) && (msY < sY + 220)
&& (m_iConstructionPoint >= 3000) && (m_bIsCrusadeMode == FALSE)) // Barbarian
{ bSendCommand(MSGID_REQUEST_HELDENIAN_SCROLL, 880, 0, 0, 0, 0, "Gail", 0);
PlaySound('E', 14, 5);
}
break;
case 3: // Buy a Flag
if ( (msX >= sX + 35) && (msX <= sX + 220) && (msY >= sY + 140) && (msY <= sY + 165)
&& (m_iEnemyKillCount >=3))
{ bSendCommand(MSGID_COMMAND_COMMON, DEF_COMMONTYPE_REQ_GETOCCUPYFLAG, 0, 0, 0, 0, 0, 0);
PlaySound('E', 14, 5);
}
break;
case 4: // Buy an Angel
if ( (msX >= sX + 35) && (msX <= sX + 220) && (msY >= sY + 175) && (msY <= sY + 200)
&& ( m_iGizonItemUpgradeLeft>=5))
{ bSendCommand(DEF_REQUEST_ANGEL, NULL, NULL, 1, NULL, NULL, "Gail", NULL);
PlaySound('E', 14, 5);
}
if ( (msX >= sX + 35) && (msX <= sX + 220) && (msY >= sY + 200) && (msY <= sY + 225)
&& ( m_iGizonItemUpgradeLeft>=5))
{ bSendCommand(DEF_REQUEST_ANGEL, NULL, NULL, 2, NULL, NULL, "Gail", NULL);
PlaySound('E', 14, 5);
}
if ( (msX >= sX + 35) && (msX <= sX + 220) && (msY >= sY + 225) && (msY <= sY + 250)
&& ( m_iGizonItemUpgradeLeft>=5))
{ bSendCommand(DEF_REQUEST_ANGEL, NULL, NULL, 3, NULL, NULL, "Gail", NULL);
PlaySound('E', 14, 5);
}
if ( (msX >= sX + 35) && (msX <= sX + 220) && (msY >= sY + 250) && (msY <= sY + 275)
&& ( m_iGizonItemUpgradeLeft>=5))
{ bSendCommand(DEF_REQUEST_ANGEL, NULL, NULL, 4, NULL, NULL, "Gail", NULL);
PlaySound('E', 14, 5);
}
break;
}
}
_________________________________________________________________________
And of course, must show items on left finger, it really easy:
Find every part of code with "DEF_EQUIPPOS_RFINGER", and duplicate with "DEF_EQUIPPOS_LFINGER".
NB: Right is sX + 32, sY + 193; Left is sX + 98, sY + 182
_________________________________________________________________________
_________________________________________________________________________
Game.h
Declare:
// Snoopy: Added Angels
int m_iAngelicStr, m_iAngelicInt, m_iAngelicDex, m_iAngelicMag;
and the new functions...
_________________________________________________________________________
SpriteID.h:
declare:
#define DEF_SPRID_TUTELARYANGELS_PIVOTPOINT 10800
_________________________________________________________________________
NetMessages.h:
Declare:
// Reversed by Snoopy (real v382 msgid)
#define DEF_REQUEST_ANGEL 0x0FC9421E
_________________________________________________________________________
MapData.cpp:
Function "int CMapData::iObjectFrameCounter(..)"
Find 6 times :
"if ((m_pData[dX][dY].m_cOwnerFrame == 1) || (m_pData[dX][dY].m_cOwnerFrame == 5))
{ if (((m_pData[dX][dY].m_sAppr4 & 0x000F) != 0) && ((m_pData[dX][dY].m_iStatus & 0x10) == 0))
{ m_pGame->bAddNewEffect(54, (m_sPivotX+dX)*32 +(rand()%20-10), (m_sPivotY+dY)*32 -(rand()%50) -5, NULL, NULL, -(rand()%8), 0);
}"
Then add 6 times just after:
if ( (((m_pData[dX][dY].m_iStatus & 0x00000F00) >> 8) > rand()%6) // Angel stars
&& ((m_pData[dX][dY].m_iStatus & 0x0000F000) != 0)
&& ((m_pData[dX][dY].m_iStatus & 0x10) == 0))
{ m_pGame->bAddNewEffect(54, (m_sPivotX+dX)*32 +(rand()%15+10), (m_sPivotY+dY)*32 -(rand()%30) -50, NULL, NULL, -(rand()%8), 0);
}
_________________________________________________________________________
if ( (((m_pData[dX][dY].m_iStatus & 0x00000F00) >> 8) > rand()%6) // Angel stars
_\_ _<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
Them finally some more things:
- Here the item definitions from HBusa:
- My functions DO NOT rely on item number, so you may change them, but instead on item definitions. (I guess many people already added new things to their servers so 908..911 may be in use...)
- Do not change items names or definitions. The server code uses the definitions to detect the pendants, but the client needs unchanged names...
- The way used to show the Angels, was designed by Diuuude, and I've no clue if it's v3.72 compatible.
- The MSGID and msg syntax to buy the pendant, is reversed from v3.72 client. So it should be compatible.
- The Pendant prices and values are from figures given on this forum, (I guess figures from HBusa, but different from inial Siementec statements)
- I added the "Shinning" on Angels. Full shinning for Angel+10, 1/2 Shinning for +9, 1/2 shinning for +6..+8, 1/6 shinning for +5...
I guess it's fine this way, I have no clue of the "official" behaviour here.
- Client side, F5box is adjusted as BLue/red/green bars. An improved stat is shown Blue on F5box.
------------------------------------------------------------
I tested a litttle bit Angels locally, but I'm not sure I'll implement this to my real server, in this exact way. And my server files are very very different from HBx224c release, so there may be some adjustment needed...
- Here the item definitions from HBusa:
Code: Select all
Item = 908 AngelicPandent(STR) 1 11 14 16 0 0 0 0 0 300 0 22 11 -3000 200 -1 0 0 0 60 -10 -1 46 6
Item = 909 AngelicPandent(DEX) 1 11 14 17 0 0 0 0 0 300 0 22 10 -3000 200 -1 0 0 0 60 -10 -1 46 6
Item = 910 AngelicPandent(INT) 1 11 14 18 0 0 0 0 0 300 0 22 12 -3000 200 -1 0 0 0 60 -10 -1 46 6
Item = 911 AngelicPandent(MAG) 1 11 14 19 0 0 0 0 0 300 0 22 13 -3000 200 -1 0 0 0 60 -10 -1 46 6
- Do not change items names or definitions. The server code uses the definitions to detect the pendants, but the client needs unchanged names...
- The way used to show the Angels, was designed by Diuuude, and I've no clue if it's v3.72 compatible.
- The MSGID and msg syntax to buy the pendant, is reversed from v3.72 client. So it should be compatible.
- The Pendant prices and values are from figures given on this forum, (I guess figures from HBusa, but different from inial Siementec statements)
- I added the "Shinning" on Angels. Full shinning for Angel+10, 1/2 Shinning for +9, 1/2 shinning for +6..+8, 1/6 shinning for +5...
I guess it's fine this way, I have no clue of the "official" behaviour here.
- Client side, F5box is adjusted as BLue/red/green bars. An improved stat is shown Blue on F5box.
------------------------------------------------------------
I tested a litttle bit Angels locally, but I'm not sure I'll implement this to my real server, in this exact way. And my server files are very very different from HBx224c release, so there may be some adjustment needed...
_\_ _<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
Thanks a lot snoopy81
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>
Cool but damn.. i just finished my own tooking angels from cmdhall and it took me 2 hours.
<span style='font-size:14pt;line-height:100%'>BIG</span> Thanks for code but LFINGER still arent working
<span style='font-size:14pt;line-height:100%'>BIG</span> Thanks for code but LFINGER still arent working

<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)
And finally the bigger Game.cpp part:
Search for all m_iStr, m_iInt, m_iDex, m_iMag
Some of them a used to send to the client, or logserver, don't touch those.
Many of them have in game effect. I all those cases add corresponding Angelic value:
ie, in:
void CGame::CheckClientResponseTime()
(Activables items delays & resur spell)
BOOL CGame::bEquipItemHandler(..)
(item weight, wearing conditions, speed....)
void CGame::PlayerMagicHandler(..)
( casting proba, Spell strengh)
void CGame::RequestStudyMagicHandler(..)
(Buying spells)
BOOL CGame::bCheckMagicInt(..)
(removing spells)
int CGame::_iCalcMaxLoad(..)
void CGame::CalculateSSN_SkillIndex(..)
void CGame::CalculateSSN_ItemIndex(..)
void CGame::Effect_Damage_Spot(..)
void CGame::Effect_Damage_Spot_DamageMove(..)
BOOL CGame::bCheckResistingMagicSuccess(..)
void CGame::CalcTotalItemEffect(..)
(Maybe is special item conditions set)
int CGame::iGetMaxHP(.. / MP /SP
int CGame::iCalculateAttackEffect(..)
(Obvious !)
BOOL CGame::_bCheckCharacterData(..)
And maybe some more places depending on your server...
lil bit confuse ...
Search for all m_iStr, m_iInt, m_iDex, m_iMag
Some of them a used to send to the client, or logserver, don't touch those.
Many of them have in game effect. I all those cases add corresponding Angelic value:
ie, in:
void CGame::CheckClientResponseTime()
(Activables items delays & resur spell)
BOOL CGame::bEquipItemHandler(..)
(item weight, wearing conditions, speed....)
void CGame::PlayerMagicHandler(..)
( casting proba, Spell strengh)
void CGame::RequestStudyMagicHandler(..)
(Buying spells)
BOOL CGame::bCheckMagicInt(..)
(removing spells)
int CGame::_iCalcMaxLoad(..)
void CGame::CalculateSSN_SkillIndex(..)
void CGame::CalculateSSN_ItemIndex(..)
void CGame::Effect_Damage_Spot(..)
void CGame::Effect_Damage_Spot_DamageMove(..)
BOOL CGame::bCheckResistingMagicSuccess(..)
void CGame::CalcTotalItemEffect(..)
(Maybe is special item conditions set)
int CGame::iGetMaxHP(.. / MP /SP
int CGame::iCalculateAttackEffect(..)
(Obvious !)
BOOL CGame::_bCheckCharacterData(..)
And maybe some more places depending on your server...
lil bit confuse ...

-
- Outpost bitch
- Posts: 517
- Joined: Sat Nov 19, 2005 9:07 pm
- Location: I watch gay porn
- Contact:
Hey about what snoopy posted for taking the Angels from Gail what about if we don't want to add it ? and just let what diuuudes post and we don't take it from Gail ? It won't happen nothing than ?
<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
omg when ill add all things into Client Sources, its everytime fuck my client... something wif function "read"

<img src='http://i19.photobucket.com/albums/b153/s00pr/Pener.jpg' border='0' alt='user posted image' /><br><img src='http://i19.photobucket.com/albums/b153/ ... anner3.jpg' border='0' alt='user posted image' />
-
- Regular
- Posts: 32
- Joined: Mon Mar 15, 2004 8:26 pm
Did anyone by chance get this to work?locobans wrote:Ahhh...diuuude wrote: already calculated on the fly in my files... that's why i dun have this bug...
Anyways i forgot to post the code that removes the stats bonus when you disconnect from the server. The code is almost the same as the one for the release item handler.
That's actually what's missing....and that's why it bugs the characters![]()
I've posted a fix here:Shadoelement wrote: Did anyone by chance get this to work?
<a href='index.php?showtopic=6634&st=0' target='_blank'>index.php?...topic=6634&st=0</a>
====<span style='color:red'><br>Aryes</span><br>====<br><br>HB United: www.hbuonline.net:<br><br><img src="http://hbtop50.com/button.php?u=hbkhispano" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=dcom" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=tinchocba" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=rafha_bernn" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=HB-Tere" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=Kiruku" alt="Helbreath Top 50 - Helbreath Silver" border="0" />
-
- Regular
- Posts: 32
- Joined: Mon Mar 15, 2004 8:26 pm
Thanks for posting that sir but i'll use an example about this:Aryes wrote:I've posted a fix here:Shadoelement wrote: Did anyone by chance get this to work?
<a href='index.php?showtopic=6634&st=0' target='_blank'>index.php?...topic=6634&st=0</a>
I have a max level character, and receive a str angel and upgrade it to +1, I then equip the +1 angel and it disconnects me.
The problem is it takes the +1 out of then LU_Pool then makes it -1 which disconnects you.