#include "stdafx.h" #include #include #include #include #include #include #include #include #include #include "CreatureStructure.h" #include #include "GMMemory.h" EliteBonus::EliteBonusData::EliteBonusData() : m_cNation(CClass::MAX_RACE), m_cLevel(0) { } EliteBonus::EliteBonusData::EliteBonusData(char cNation, unsigned char cLevel) : m_cNation(cNation), m_cLevel(cLevel) { } MotionInfo::MotionInfo() : m_fDirection(0.0f), m_fVelocity(0.0f), m_wAction(0), m_dwFrame(0) { } CharacterStatus::CharacterStatus() : m_nSTR(0), m_nDEX(0), m_nCON(0), m_nINT(0), m_nWIS(0) { } CharacterStatus::CharacterStatus(CHAR_INFOST& characterDBData) : m_nSTR(characterDBData.STR), m_nDEX(characterDBData.DEX), m_nCON(characterDBData.CON), m_nINT(characterDBData.INT), m_nWIS(characterDBData.WIS) { } EnchantInfo::EnchantInfo() { ClearFlag(); } void EnchantInfo::SetFlag(unsigned char cSpellKind) { m_dwStatusFlag[cSpellKind / ULONG_BIT] |= (1 << cSpellKind % ULONG_BIT); } void EnchantInfo::ResetFlag(unsigned char cSpellKind) { m_dwStatusFlag[cSpellKind / ULONG_BIT] &= ~(1 << cSpellKind % ULONG_BIT); } void EnchantInfo::ClearFlag(void) { std::fill_n(m_dwStatusFlag, int(MAX_ARRAY), 0); } bool EnchantInfo::GetFlag(unsigned char cSpellKind) const { return m_dwStatusFlag[cSpellKind / ULONG_BIT] & (1 << cSpellKind % ULONG_BIT); } void CharacterStatus::Init(CHAR_INFOST& characterDBData) { m_nSTR = characterDBData.STR; m_nDEX = characterDBData.DEX; m_nCON = characterDBData.CON; m_nINT = characterDBData.INT; m_nWIS = characterDBData.WIS; } CreatureStatus::CreatureStatus() : m_nLevel(0), m_nExp(0), m_nNowHP(0), m_nNowMP(0) { } CreatureStatus::CreatureStatus(CHAR_INFOST& characterDBData) : m_nLevel(characterDBData.Level), m_nExp(characterDBData.Exp), m_nNowHP(characterDBData.HP), m_nNowMP(characterDBData.MP) { } void CreatureStatus::Init(CHAR_INFOST& characterDBData) { m_nLevel = characterDBData.Level; m_nExp = characterDBData.Exp; m_nNowHP = characterDBData.HP; m_nNowMP = characterDBData.MP; } FightStatus::FightStatus() : m_lMinDamage(0), m_lMaxDamage(0), m_wArmor(0), m_wHitRate(0), m_wEvade(0), m_nMaxHP(0), m_wHPRegen(0), m_nMaxMP(0), m_wMPRegen(0), m_wCritical(0), m_wBlock(0), m_wSpeed(0), m_wCoolDownRevision(0), m_wSkillPoint(0), m_wMagicPower(0), m_wMagicResist(0), m_wLuck(0), m_wFrost(0), m_wFire(0), m_wElectro(0), m_wDarkness(0), m_fDefenceRate(0), m_fCriticalMagnification(0), m_fCriticalRate(0), m_fBlockRate(0), m_fSpeedRate(0), m_fCoolDownRevisionRate(0), m_fMagicResistRate(0), m_fLevelExplosion(0), m_fLuckResistRate(0), m_cCriticalType(0), m_cComboCount(0), m_cCalculateState(CS_NONE) { } using namespace Item; /* // edith 2008.05.18 ij¸¯ÅÍÀÇ º¸³Ê½º ´É·ÂÄ¡ // ¼Ò½º°¡ °¡·Î·Î ³Ê¹« ±æ¾îÁ®¼­ ¸¶¹ý¼ö¸¦ »ç¿ëÇÕ´Ï´Ù. // (STR : 1, DEX : 2, CON : 3, INT : 4, WIS : 5) const unsigned char aryClassBonusStat[CClass::MAX_CLASS][Attribute::MAX_ATTRIBUTE_NUM] = { // MinDam. MaxDam. Armor HitRate Evade MaxHP HPRegen MaxMP MPRegen Cri. Block Speed M.Power M.Res. Rune CoolDw. SkillPt Frost Fire Electro Dark { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { 0, 1, 1, 3, 1, 1, 3, 3, 5, 5, 0, 0, 2, 5, 5, 0, 0, 0, 0, 0, 0, 0, }, // ÆÄÀÌÅÍ (STR 1,CON 1) { 0, 1, 1, 3, 2, 2, 3, 3, 5, 5, 0, 0, 2, 5, 5, 0, 0, 0, 0, 0, 0, 0, }, // ·Î±× (DEX 1,STR 1) { 0, 2,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Rate[CClass::MAX_CLASS][Attribute::MAX_ATTRIBUTE_NUM] = { // MinDam. MaxDam. Armor HitRate Evade MaxHP HPRegen MaxMP MPRegen Cri. Block Speed M.Power M.Res. Rune CoolDw. SkillPt Frost Fire Electro Dark { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { 0, 0, 0, 0, 1, 0.4f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ÆÄÀÌÅÍ { 0, 0, 0, 0, 1, 0.4f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ·Î±× { 0, 0, 0, 0, 1, 0.4f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ¸ÞÀÌÁö { 0, 0, 0, 0, 1, 0.4f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ¾îÄݶóÀÌÆ® { 0, 0, 0.1f, 0.5f, 2, 0.6f, 0.2f, 0.01f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // µðÆæ´õ { 0, 0.2f, 0.3f, 0, 3, 0.2f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ¿ö¸®¾î { 0, 0, 0.1f, 0, 1, 0.4f, 0, 0.01f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ¾î½Ø½Å { 0, 0, 0.1f, 0, 1, 0.4f, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ¾ÆÃ³ { 0, 0.4f, 0.5f, 0, 1, 0.2f, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ¼Ò¼­·¯ { 0, 0.4f, 0.5f, 0, 1, 0.2f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 0, 0, 0, 0, 0, 0, 0, }, // °Å³Ê = ¾ÆÃ³ { 0, 0.4f, 0.5f, 0, 1, 0.2f, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ·é¿ÀÇÁ = ¼Ò¼­·¯ { 0, 0.5f, 0.7f, 0, 1, 0.2f, 0, 0, 0.03f, 0.003f, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, }, // ¶óÀÌÇÁ¿ÀÇÁ = Ŭ·¹¸¯ { 0, 0, 0.1f, 0, 1, 0.4f, 0, 0.01f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, } // ½¦µµ¿ì¿ÀÇÁ = ¾î½Ø½Å }; */ /* // (STR : 1, DEX : 2, CON : 3, INT : 4, WIS : 5) const unsigned char aryClassBonusStat[CClass::MAX_CLASS][Attribute::MAX_ATTRIBUTE_NUM] = { // MinDam. MaxDam. Armor HitRate Evade MaxHP HPRegen MaxMP MPRegen Cri. Block Speed M.Power M.Res. Rune CoolDw. SkillPt Frost Fire Electro Dark { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { 0, 1, 1, 3, 1, 1, 3, 3, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, }, // ÆÄÀÌÅÍ { 0, 1, 1, 3, 1, 1, 3, 3, 1, 1, 0, 0, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, }, // ·Î±× { 0, 2, 2, 3, 2, 2, 1, 1, 1, 2, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, }, // ¸ÞÀÌÁö { 0, 5, 5, 3, 5, 3, 1, 1, 1, 2, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, }, // ¾îÄݶóÀÌÆ® { 0, 1, 1, 3, 1, 1, 3, 3, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0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, }, // ¿ÀÇǼ¼ÀÌÅÍ { 0, 1, 1, 3, 1, 1, 3, 3, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, }, // ÅÛÇ÷¯ { 0, 1, 1, 1, 1, 1, 3, 3, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, }, // ¾îÅÂÄ¿ { 0, 1, 1, 3, 2, 2, 1, 1, 1, 1, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, }, // °Å³Ê { 0, 2, 2, 3, 2, 2, 2, 2, 4, 4, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, }, // ·é¿ÀÇÁ { 0, 2, 2, 2, 2, 2, 2, 2, 5, 5, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, }, // ¶óÀÌÇÁ¿ÀÇÁ { 0, 1, 1, 3, 2, 2, 1, 1, 1, 1, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, } // ½¦µµ¿ì¿ÀÇÁ }; const float aryClassBonusRate[CClass::MAX_CLASS][Attribute::MAX_ATTRIBUTE_NUM] = { // MinDam. MaxDam. Armor HitRate Evade MaxHP HPRegen MaxMP MPRegen Cri. Block Speed M.Power M.Res. Rune CoolDw. SkillPt Frost Fire Electro Dark { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { 0, 0.4f, 0.5f, 0, 2, 0.2f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ÆÄÀÌÅÍ { 0, 0.4f, 0.5f, 0, 2, 0.2f, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ·Î±× { 0, 0.4f, 0.5f, 0, 2, 0.2f, 0, 0, 0, 0, 0, 0, 0, 0.5f, 0.6f, 0, 0, 0, 0, 0, 0, 0, }, // ¸ÞÀÌÁö {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0, 0, 0.1f, 0, 0.2f, 0, 0, 0, 0, 0, 0, 0, } // ½¦µµ¿ì¿ÀÇÁ }; */ const unsigned char aryClassBonusStat[CClass::MAX_CLASS][Attribute::MAX_ATTRIBUTE_NUM] = { // MinDam. MaxDam. Armor HitRate Evade MaxHP HPRegen MaxMP MPRegen Cri. Block Speed M.Power M.Res. Rune CoolDw. SkillPt Frost Fire Electro Dark { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { 0, 1, 1, 3, 1, 1, 3, 3, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, }, // ÆÄÀÌÅÍ { 0, 1, 1, 3, 1, 1, 3, 3, 1, 1, 0, 0, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, }, // ·Î±× { 0, 2, 2, 3, 2, 2, 1, 1, 1, 2, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, }, // ¸ÞÀÌÁö { 0, 3, 3, 3, 3, 3, 1, 1, 1, 2, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, }, // ¾îÄݶóÀÌÆ® { 0, 1, 1, 3, 1, 1, 3, 3, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, }, // µðÆæ´õ { 0, 1, 1, 1, 1, 1, 3, 3, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, }, // ¿ö¸®¾î { 0, 1, 1, 3, 2, 2, 1, 1, 1, 1, 2, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, }, // ¾î½Ø½Å { 0, 1, 1, 3, 2, 2, 1, 1, 1, 1, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, }, // ¾ÆÃ³ { 0, 2, 2, 3, 2, 2, 2, 2, 4, 4, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, }, // ¼Ò¼­·¯ { 0, 2, 2, 3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, 2, 2, 2, 2, 2, 2, 5, 5, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, }, // ¶óÀÌÇÁ¿ÀÇÁ { 0, 1, 1, 3, 2, 2, 1, 1, 1, 1, 2, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, } // ½¦µµ¿ì¿ÀÇÁ }; const float aryClassBonusRate[CClass::MAX_CLASS][Attribute::MAX_ATTRIBUTE_NUM] = { // MinDam. MaxDam. Armor HitRate Evade MaxHP HPRegen MaxMP MPRegen Cri. Block Speed M.Power M.Res. Rune CoolDw. SkillPt Frost Fire Electro Dark { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { 0, 0.4f, 0.5f, 0, 2, 0.2f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ÆÄÀÌÅÍ { 0, 0.4f, 0.5f, 0, 2, 0.2f, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // ·Î±× { 0, 0.4f, 0.5f, 0, 2, 0.2f, 0, 0, 0, 0, 0, 0, 0, 0.5f, 0.6f, 0, 0, 0, 0, 0, 0, 0, }, // ¸ÞÀÌÁö { 0, 0.4f, 0.5f, 0, 2, 0.2f, 0, 0, 0, 0, 0, 0, 0, 0.5f, 0.6f, 0, 0, 0, 0, 0, 0, 0, }, // ¾îÄݶóÀÌÆ® { 0, 0.55f, 0.65f, 0.6f, 6, 0.4f, 0.6f, 0.03f, 0.05f, 0.05f, 0, 0, 0, 0, 0.2f, 0, 0, 0, 0, 0, 0, 0, }, // µðÆæ´õ { 0, 0.65f, 0.75f, 0.1f, 4, 0.4f, 0.4f, 0.015f, 0.05f, 0, 0, 0, 0.2f, 0, 0.2f, 0, 0, 0, 0, 0, 0, 0, }, // ¿ö¸®¾î { 0, 0.55f, 0.65f, 0, 5, 0.6f, 0.08f, 0.005f, 0.2f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 0, 0, 0, 1, 1.2f, 0, 0, 0, 0, 0, 0, 0, }, // ¿ÀÇǼ¼ÀÌÅÍ { 0, 0.55f, 0.65f, 0.6f, 6, 0.4f, 0.6f, 0.03f, 0.05f, 0.05f, 0, 0, 0, 0, 0.2f, 0, 0, 0, 0, 0, 0, 0, }, // ÅÛÇ÷¯ { 0, 0.65f, 0.75f, 0.1f, 4, 0.4f, 0.4f, 0.015f, 0.05f, 0, 0, 0, 0.2f, 0, 0.2f, 0, 0, 0, 0, 0, 0, 0, }, // ¾îÅÂÄ¿ { 0, 0.41f, 0.51f, 0, 4, 0.6f, 0.1f, 0.01f, 0.15f, 0.01f, 0, 0, 0.1f, 0, 0.2f, 0, 0, 0, 0, 0, 0, 0, }, // °Å³Ê { 0, 0.15f, 0.25f, 0, 2, 0.4f, 0.3f, 0.02f, 0.45f, 0.04f, 0, 0, 0, 1.1f, 0.8f, 0, 0, 0, 0, 0, 0, 0, }, // ·é¿ÀÇÁ { 0, 0.7f, 0.8f, 0.3f, 3, 0.2f, 0.15f, 0.015f, 0.25f, 0.025f, 0, 0, 0, 1, 0.8f, 0, 0, 0, 0, 0, 0, 0, }, // ¶óÀÌÇÁ¿ÀÇÁ { 0, 0.55f, 0.65f, 0, 5, 0.6f, 0.08f, 0.005f, 0.2f, 0.02f, 0.5f, 0, 0.1f, 0, 0.2f, 0, 0, 0, 0, 0, 0, 0, } // ½¦µµ¿ì¿ÀÇÁ }; using namespace Skill::SpellID; bool FightStatus::CalculateBaseInfo(const CharacterStatus& characterStatus, const unsigned short wLevel, const unsigned char cClass) { if (CS_NONE != m_cCalculateState) { return false; } short aryStatus[CClass::MAX_TYPE] = { 0, }; // ½ÇÁ¦ ¿¬»ê¿¡¼± ±âº»°ª 20À» »« °ªÀ» »ç¿ëÇÕ´Ï´Ù. aryStatus[CClass::STR] = characterStatus.m_nSTR - 20; aryStatus[CClass::DEX] = characterStatus.m_nDEX - 20; aryStatus[CClass::CON] = characterStatus.m_nCON - 20; aryStatus[CClass::INT] = characterStatus.m_nINT - 20; aryStatus[CClass::WIS] = characterStatus.m_nWIS - 20; // Àü Ŭ·¡½º °øÅë m_lMinDamage = static_cast(aryStatus[CClass::STR]); m_lMaxDamage = static_cast(aryStatus[CClass::STR]); m_wArmor = 0; m_wHitRate = static_cast(1 + (aryStatus[CClass::STR]+aryStatus[CClass::DEX])*0.5f); m_wEvade = static_cast((aryStatus[CClass::STR]+aryStatus[CClass::DEX])*0.1f); m_nMaxHP = static_cast(150 + 25 * wLevel + (aryStatus[CClass::CON] * 0.2f * wLevel)); m_nMaxMP = static_cast(150 + 12 * wLevel + (aryStatus[CClass::INT] * 0.4f * wLevel) + (aryStatus[CClass::WIS] * 0.4f * wLevel)); m_wHPRegen = static_cast(4 + (wLevel + aryStatus[CClass::CON])/2); m_wMPRegen = static_cast(4 + (wLevel + aryStatus[CClass::INT] + aryStatus[CClass::WIS])/2); m_wCritical = static_cast(6 + (aryStatus[CClass::DEX] * 0.4f)); m_wBlock = 0; m_wSpeed = 34 + static_cast(aryStatus[CClass::DEX] * 0.75f); m_wCoolDownRevision = aryStatus[CClass::DEX]; m_wSkillPoint = wLevel;//static_cast(wLevel + (aryStatus[CClass::INT] * 0.1f)); // m_wSkillPoint = static_cast(wLevel + (aryStatus[CClass::INT] * 0.1f)); m_wMagicPower = static_cast(aryStatus[CClass::INT] + aryStatus[CClass::WIS]) * 2; m_wMagicResist = static_cast((aryStatus[CClass::INT] + aryStatus[CClass::WIS]) * 0.8f); m_fLevelExplosion = 1 + 0.02f * wLevel; // Ŭ·¡½ºº° º¸³Ê½º ·¹ÀÌÆÃ m_lMinDamage += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::MIN_DAMAGE]] * aryClassBonusRate[cClass][Attribute::MIN_DAMAGE]); m_lMaxDamage += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::MAX_DAMAGE]] * aryClassBonusRate[cClass][Attribute::MAX_DAMAGE]); m_wArmor += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::ARMOR]] * aryClassBonusRate[cClass][Attribute::ARMOR]); m_wHitRate += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::HIT_RATE]] * aryClassBonusRate[cClass][Attribute::HIT_RATE]); m_wEvade += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::EVADE]] * aryClassBonusRate[cClass][Attribute::EVADE]); const unsigned short wAddMaxHP = static_cast((aryStatus[aryClassBonusStat[cClass][Attribute::MAX_HP]] * aryClassBonusRate[cClass][Attribute::MAX_HP] * wLevel) + 0.1f); m_nMaxHP = ((USHRT_MAX - m_nMaxHP) <= wAddMaxHP) ? USHRT_MAX : m_nMaxHP + wAddMaxHP; const unsigned short wAddMaxMP = static_cast((aryStatus[aryClassBonusStat[cClass][Attribute::MAX_MP]] * aryClassBonusRate[cClass][Attribute::MAX_MP] * wLevel) + 0.1f); m_nMaxMP = ((USHRT_MAX - m_nMaxMP) <= wAddMaxMP) ? USHRT_MAX : m_nMaxMP + wAddMaxMP; m_wHPRegen += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::HP_REGEN]] * aryClassBonusRate[cClass][Attribute::HP_REGEN]); m_wMPRegen += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::MP_REGEN]] * aryClassBonusRate[cClass][Attribute::MP_REGEN]); m_wCritical += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::CRITICAL]] * aryClassBonusRate[cClass][Attribute::CRITICAL]); m_wBlock += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::BLOCK]] * aryClassBonusRate[cClass][Attribute::BLOCK]); m_wSpeed += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::SPEED]] * aryClassBonusRate[cClass][Attribute::SPEED]); m_wMagicPower += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::MAGIC_POWER]] * aryClassBonusRate[cClass][Attribute::MAGIC_POWER]); m_wMagicResist += static_cast(aryStatus[aryClassBonusStat[cClass][Attribute::MAGIC_RESIST]] * aryClassBonusRate[cClass][Attribute::MAGIC_RESIST]); // ·°Å° Âù½º´Â ±âº» 10 m_wLuck = 10; m_wCoolDownRevision += 0; m_wSkillPoint += 0; CalculateSubStatus(); m_cComboCount = 4; m_cCalculateState = CS_BASE_INFO; return true; } bool FightStatus::CalculateEquipInfo(const Item::CEquipment** ppEquip, const bool bFirstWeaponSlot, const bool bRightHand, const bool bRideFlag, const SKILL& skill, const unsigned char cLevel, const unsigned short wRiderAbility, const unsigned short wLuckAbility, const unsigned short wLevelAbility, const CharacterStatus& characterStatus, const unsigned char cClass, FightStatus& resultStatus) const { if (CS_BASE_INFO != m_cCalculateState) { return false; } // edith 2010.01.02 Àåºñº¸Á¤ Ãß°¡ float fEquipCorr = (100.0f / CServerSetup::GetInstance().GetEquipCorrDefault()); resultStatus = *this; short wRideSpeed = 0; // Àåºñ È¿°ú for (unsigned char cEquipIndex = 0; cEquipIndex < EquipmentPos::MAX_EQUPMENT_POS; ++cEquipIndex) { // ¸»À» ¾ÈÅÀÀ¸¸é EQÀÇ AVATA´Â ¹«½ÃÇÑ´Ù. if(bRideFlag == false && cEquipIndex == EquipmentPos::AVATA) continue; // ÈÞ¸ÕÀÇ °æ¿ì ¹«±â/¹æÆÐ ½½·ÔÀÌ 2°³¾¿ ÀÖ´Ù. if (true == bFirstWeaponSlot) { if (cEquipIndex == EquipmentPos::WEAPON_HAND2 || cEquipIndex == EquipmentPos::SHIELD_HAND2) { continue; } } else { if (cEquipIndex == EquipmentPos::WEAPON_HAND1 || cEquipIndex == EquipmentPos::SHIELD_HAND1) { continue; } } // ¿Þ¼Õ/¿À¸¥¼ÕÀÇ ±¸ºÐ (¸î¸î ½ºÅÈÀº ¹«±â·Î »ç¿ëµÉ ¶§¸¸ È¿´ÉÀ» ¹ßÈÖÇÑ´Ù.) bool bUseWeapon = true; if (EquipmentPos::RINGL != cEquipIndex && EquipmentPos::RINGR != cEquipIndex && EquipmentPos::NECKLACE != cEquipIndex) { if (true == bRightHand) { if (cEquipIndex == EquipmentPos::SHIELD_HAND1 || cEquipIndex == EquipmentPos::SHIELD_HAND2) { bUseWeapon = false; } } else { if (cEquipIndex == EquipmentPos::WEAPON_HAND1 || cEquipIndex == EquipmentPos::WEAPON_HAND2) { bUseWeapon = false; } } } const Item::CEquipment* lpEquipment = *(ppEquip + cEquipIndex); if (NULL != lpEquipment) { // ÀåÂøÀÌ °¡´ÉÇÑ ÀåºñÀÎÁö üũÇÑ´Ù. if (false == CheckEquipable(lpEquipment, characterStatus, cClass, cLevel, wLevelAbility)) { continue; } short aryAttribute[Attribute::MAX_ATTRIBUTE_NUM]; const_cast(lpEquipment)->GetAttribute(aryAttribute, Attribute::MAX_ATTRIBUTE_NUM); resultStatus.m_wArmor += (short)(aryAttribute[Attribute::ARMOR] * fEquipCorr); resultStatus.m_wEvade += (short)(aryAttribute[Attribute::EVADE] * fEquipCorr); resultStatus.m_wMagicPower += (short)(aryAttribute[Attribute::MAGIC_POWER] * fEquipCorr); resultStatus.m_wMagicResist += (short)(aryAttribute[Attribute::MAGIC_RESIST] * fEquipCorr); // Àåºñ ÃÖ´ë HP, ÃÖ´ë MP´Â °ªÀÌ * 10À¸·Î µé¾î°¨ const unsigned short wAddMaxHP = aryAttribute[Attribute::MAX_HP] * 10; resultStatus.m_nMaxHP = ((USHRT_MAX - resultStatus.m_nMaxHP) <= wAddMaxHP) ? USHRT_MAX : resultStatus.m_nMaxHP + wAddMaxHP; const unsigned short wAddMaxMP = aryAttribute[Attribute::MAX_MP] * 10; resultStatus.m_nMaxMP = ((USHRT_MAX - resultStatus.m_nMaxMP) <= wAddMaxMP) ? USHRT_MAX : resultStatus.m_nMaxMP + wAddMaxMP; resultStatus.m_wHPRegen += (short)(aryAttribute[Attribute::HP_REGEN] * fEquipCorr); resultStatus.m_wMPRegen += (short)(aryAttribute[Attribute::MP_REGEN] * fEquipCorr); resultStatus.m_wBlock += (short)(aryAttribute[Attribute::BLOCK] * fEquipCorr); // ¶óÀÌ´õ¸¦ ÅÀÀ¸¸é ½ºÇǵ带 ¹«½ÃÇÑ´Ù. if(cEquipIndex == EquipmentPos::AVATA) wRideSpeed = aryAttribute[Attribute::SPEED]+wRiderAbility; else resultStatus.m_wSpeed += aryAttribute[Attribute::SPEED]; // ·°Å°Âù½º ÀúÀå resultStatus.m_wLuck += aryAttribute[Attribute::LUCKCHANCE]; resultStatus.m_wCoolDownRevision += aryAttribute[Attribute::COOLDOWN]; resultStatus.m_wSkillPoint += aryAttribute[Attribute::SKILL_POINT]; resultStatus.m_wFrost += (short)(aryAttribute[Attribute::FROST] * fEquipCorr); resultStatus.m_wFire += (short)(aryAttribute[Attribute::FIRE] * fEquipCorr); resultStatus.m_wElectro += (short)(aryAttribute[Attribute::ELECTRO] * fEquipCorr); resultStatus.m_wDarkness += (short)(aryAttribute[Attribute::DARKNESS] * fEquipCorr); if (true == bUseWeapon) { resultStatus.m_lMinDamage += static_cast(aryAttribute[Attribute::MIN_DAMAGE] * fEquipCorr); resultStatus.m_lMaxDamage += static_cast(aryAttribute[Attribute::MAX_DAMAGE] * fEquipCorr); resultStatus.m_wHitRate += (short)(aryAttribute[Attribute::HIT_RATE] * fEquipCorr); resultStatus.m_wCritical += (short)(aryAttribute[Attribute::CRITICAL] * fEquipCorr); resultStatus.m_cCriticalType = lpEquipment->GetItemInfo().m_DetailData.m_cCriticalType; } } } if(true == bRideFlag && wRideSpeed > resultStatus.m_wSpeed) resultStatus.m_wSpeed = wRideSpeed; if(wLuckAbility) resultStatus.m_wLuck += wLuckAbility; if (true == bRightHand) { const Item::CEquipment* lpEquipment = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::WEAPON_HAND1) : *(ppEquip + EquipmentPos::WEAPON_HAND2); // ½ºÅÂÇÁ, »çÀ̵åÀÇ ÃÖ´ë ÄÞº¸¼ö Á¦ÇÑ if (NULL != lpEquipment) { if (ItemType::STAFF == lpEquipment->GetItemInfo().m_DetailData.m_cItemType || ItemType::OPP_SYTHE == lpEquipment->GetItemInfo().m_DetailData.m_cItemType) { resultStatus.m_cComboCount = 2; } } // ¸Ç¼ÕÀÏ ¶§ ÃÖ´ë ÄÞº¸¼ö Á¦ÇÑ else { resultStatus.m_cComboCount = 0; } } // µ¥¹ÌÁö¿¡ ·¹º§ ÀͽºÇ÷ÎÁ¯ È¿°ú Àû¿ë resultStatus.m_lMinDamage = static_cast(resultStatus.m_lMinDamage * m_fLevelExplosion); resultStatus.m_lMaxDamage = static_cast(resultStatus.m_lMaxDamage * m_fLevelExplosion); // edith 2008.11.14 MinMaxµ¥¹ÌÁö°ª°è»ê // µ¥¹ÌÁö °ªÁß min max °ªÀÌ µÚÁýÇûÀ»¶§¸¦ ´ëºñÇÑ º¸¾ÈÄÚµå if(resultStatus.m_lMinDamage > resultStatus.m_lMaxDamage) { ERRLOG2(g_Log, "Status °è»ê ¿À·ù : Min:%d, Max:%d", resultStatus.m_lMinDamage, resultStatus.m_lMaxDamage); long TempMax = resultStatus.m_lMinDamage; resultStatus.m_lMinDamage = resultStatus.m_lMaxDamage; resultStatus.m_lMaxDamage = TempMax; } // ÆÐ½Ãºê ½ºÅ³ È¿°ú for (unsigned char cSlotIndex = 0; cSlotIndex < skill.wSlotNum; ++cSlotIndex) { const SKILLSLOT& SkillSlot = skill.SSlot[cSlotIndex]; unsigned short wSkillID = SkillSlot.SKILLINFO.wSkill; // ¾ÙÅÍ³ÊÆ¼ºê ½ºÅ³ÀÇ °æ¿ì const Skill::ProtoType* lpProtoType = CSkillMgr::GetInstance().GetSkillProtoType(wSkillID); if (NULL != lpProtoType) { if (0 != lpProtoType->m_usChildSkill) { wSkillID = lpProtoType->m_usChildSkill; } } #define MasteryAffect(SkillLevel, SkillLockCount, Level) \ resultStatus.m_lMinDamage += static_cast((3 * SkillLevel + SkillLockCount * 18) * (1 + Level * 0.02f)); \ resultStatus.m_lMaxDamage += static_cast((3 * SkillLevel + SkillLockCount * 18) * (1 + Level * 0.02f)); \ resultStatus.m_wHitRate += 3 * SkillLevel + SkillLockCount * 18; switch (wSkillID) { // ¼Òµå ¸¶½ºÅ͸® case 0x8102: { const Item::CEquipment* lpRight = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::WEAPON_HAND1) : *(ppEquip + EquipmentPos::WEAPON_HAND2); const Item::CEquipment* lpLeft = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::SHIELD_HAND1) : *(ppEquip + EquipmentPos::SHIELD_HAND2); if (NULL != lpRight) { if (ItemType::ONEHANDED_SWORD == lpRight->GetItemInfo().m_DetailData.m_cItemType || ItemType::TWOHANDED_SWORD == lpRight->GetItemInfo().m_DetailData.m_cItemType) { if (true == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } if (NULL == lpLeft || (ItemType::ONEHANDED_SWORD != lpLeft->GetItemInfo().m_DetailData.m_cItemType && ItemType::ONEHANDED_AXE != lpLeft->GetItemInfo().m_DetailData.m_cItemType && ItemType::ONEHANDED_BLUNT != lpLeft->GetItemInfo().m_DetailData.m_cItemType)) { if (true == bRightHand) { resultStatus.m_cComboCount += SkillSlot.SKILLINFO.cLockCount; } } else { if (false == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } } } } break; } // ¾×½º ¸¶½ºÅ͸® case 0x8103: { const Item::CEquipment* lpRight = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::WEAPON_HAND1) : *(ppEquip + EquipmentPos::WEAPON_HAND2); const Item::CEquipment* lpLeft = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::SHIELD_HAND1) : *(ppEquip + EquipmentPos::SHIELD_HAND2); if (NULL != lpRight) { if (ItemType::ONEHANDED_AXE == lpRight->GetItemInfo().m_DetailData.m_cItemType || ItemType::TWOHANDED_AXE == lpRight->GetItemInfo().m_DetailData.m_cItemType) { if (true == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } if (NULL == lpLeft || (ItemType::ONEHANDED_SWORD != lpLeft->GetItemInfo().m_DetailData.m_cItemType && ItemType::ONEHANDED_AXE != lpLeft->GetItemInfo().m_DetailData.m_cItemType && ItemType::ONEHANDED_BLUNT != lpLeft->GetItemInfo().m_DetailData.m_cItemType)) { if (true == bRightHand) { resultStatus.m_cComboCount += SkillSlot.SKILLINFO.cLockCount; } } else { if (false == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } } } } break; } // edith 2008.05.29 ºí·±Æ® ¸¶½ºÅ͸® Ãß°¡ // ºí·±Æ® ¸¶½ºÅ͸® case 0x8105: { const Item::CEquipment* lpRight = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::WEAPON_HAND1) : *(ppEquip + EquipmentPos::WEAPON_HAND2); const Item::CEquipment* lpLeft = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::SHIELD_HAND1) : *(ppEquip + EquipmentPos::SHIELD_HAND2); if (NULL != lpRight) { if (ItemType::ONEHANDED_BLUNT == lpRight->GetItemInfo().m_DetailData.m_cItemType || ItemType::TWOHANDED_BLUNT == lpRight->GetItemInfo().m_DetailData.m_cItemType) { if (true == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } if (NULL == lpLeft || (ItemType::ONEHANDED_SWORD != lpLeft->GetItemInfo().m_DetailData.m_cItemType && ItemType::ONEHANDED_AXE != lpLeft->GetItemInfo().m_DetailData.m_cItemType && ItemType::ONEHANDED_BLUNT != lpLeft->GetItemInfo().m_DetailData.m_cItemType)) { if (true == bRightHand) { resultStatus.m_cComboCount += SkillSlot.SKILLINFO.cLockCount; } } else { if (false == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } } } } break; } // ´ë°Å ¸¶½ºÅ͸® case 0x8705: { const Item::CEquipment* lpRight = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::WEAPON_HAND1) : *(ppEquip + EquipmentPos::WEAPON_HAND2); const Item::CEquipment* lpLeft = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::SHIELD_HAND1) : *(ppEquip + EquipmentPos::SHIELD_HAND2); if (NULL != lpRight) { if (ItemType::DAGGER == lpRight->GetItemInfo().m_DetailData.m_cItemType) { if (true == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } if (NULL == lpLeft || ItemType::DAGGER != lpLeft->GetItemInfo().m_DetailData.m_cItemType) { if (true == bRightHand) { resultStatus.m_cComboCount += SkillSlot.SKILLINFO.cLockCount; } } else { if (false == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } } } } break; } // Å©·¯½¬ ¿þÆù case 0x9102: { const Item::CEquipment* lpRight = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::WEAPON_HAND1) : *(ppEquip + EquipmentPos::WEAPON_HAND2); const Item::CEquipment* lpLeft = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::SHIELD_HAND1) : *(ppEquip + EquipmentPos::SHIELD_HAND2); if (NULL != lpRight) { if (ItemType::COM_BLUNT == lpRight->GetItemInfo().m_DetailData.m_cItemType || ItemType::OPP_HAMMER == lpRight->GetItemInfo().m_DetailData.m_cItemType || ItemType::OPP_AXE == lpRight->GetItemInfo().m_DetailData.m_cItemType) { if (true == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } if (NULL == lpLeft || ItemType::SKILL_A_ATTACK != lpLeft->GetItemInfo().m_DetailData.m_cItemType) { if (true == bRightHand) { resultStatus.m_cComboCount += SkillSlot.SKILLINFO.cLockCount; } } else { if (false == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } } } } break; } // ºí·¹À̵å case 0x9105: { const Item::CEquipment* lpRight = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::WEAPON_HAND1) : *(ppEquip + EquipmentPos::WEAPON_HAND2); const Item::CEquipment* lpLeft = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::SHIELD_HAND1) : *(ppEquip + EquipmentPos::SHIELD_HAND2); if (NULL != lpRight) { if (ItemType::COM_SWORD == lpRight->GetItemInfo().m_DetailData.m_cItemType || ItemType::OPP_SLUSHER == lpRight->GetItemInfo().m_DetailData.m_cItemType) { if (true == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } if (NULL == lpLeft || ItemType::SKILL_A_ATTACK != lpLeft->GetItemInfo().m_DetailData.m_cItemType) { if (true == bRightHand) { resultStatus.m_cComboCount += SkillSlot.SKILLINFO.cLockCount; } } else { if (false == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } } } } break; } // Ŭ·Î¿ì ¸¶½ºÅ͸® case 0x9207: { const Item::CEquipment* lpRight = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::WEAPON_HAND1) : *(ppEquip + EquipmentPos::WEAPON_HAND2); const Item::CEquipment* lpLeft = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::SHIELD_HAND1) : *(ppEquip + EquipmentPos::SHIELD_HAND2); if (NULL != lpRight) { if (ItemType::OPP_TALON == lpRight->GetItemInfo().m_DetailData.m_cItemType) { if (true == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } if (NULL == lpLeft || ItemType::SKILL_A_KNIFE != lpLeft->GetItemInfo().m_DetailData.m_cItemType) { if (true == bRightHand) { resultStatus.m_cComboCount += SkillSlot.SKILLINFO.cLockCount; } } else { if (false == bRightHand) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); } } } } break; } // ¿¢½ºÆ®¶ó ¶óÀÌÇÁ case 0x9107: { const unsigned short wAddMaxHP = cLevel * (SkillSlot.SKILLINFO.cSkillLevel * 2 + SkillSlot.SKILLINFO.cLockCount * 12); resultStatus.m_nMaxHP = ((USHRT_MAX - resultStatus.m_nMaxHP) <= wAddMaxHP) ? USHRT_MAX : resultStatus.m_nMaxHP + wAddMaxHP; break; } // µà¾ó Àªµå ¸¶½ºÅ͸® case 0x8604: case 0x8706: { const Item::CEquipment* lpRight = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::WEAPON_HAND1) : *(ppEquip + EquipmentPos::WEAPON_HAND2); const Item::CEquipment* lpLeft = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::SHIELD_HAND1) : *(ppEquip + EquipmentPos::SHIELD_HAND2); if (NULL != lpRight && NULL != lpLeft) { if(((ItemType::ONEHANDED_SWORD == lpRight->GetItemInfo().m_DetailData.m_cItemType || ItemType::ONEHANDED_AXE == lpRight->GetItemInfo().m_DetailData.m_cItemType || ItemType::DAGGER == lpRight->GetItemInfo().m_DetailData.m_cItemType) && (ItemType::ONEHANDED_SWORD == lpLeft->GetItemInfo().m_DetailData.m_cItemType || ItemType::ONEHANDED_AXE == lpLeft->GetItemInfo().m_DetailData.m_cItemType || ItemType::DAGGER == lpLeft->GetItemInfo().m_DetailData.m_cItemType))) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); resultStatus.m_cComboCount += SkillSlot.SKILLINFO.cLockCount; } } break; } // ½ºÅ³¾Ï ÆÄÀÌÆ® case 0x9405: case 0x9803: { const Item::CEquipment* lpRight = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::WEAPON_HAND1) : *(ppEquip + EquipmentPos::WEAPON_HAND2); const Item::CEquipment* lpLeft = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::SHIELD_HAND1) : *(ppEquip + EquipmentPos::SHIELD_HAND2); if (NULL != lpRight && NULL != lpLeft) { if (((ItemType::COM_BLUNT == lpRight->GetItemInfo().m_DetailData.m_cItemType || ItemType::COM_SWORD == lpRight->GetItemInfo().m_DetailData.m_cItemType) && ItemType::SKILL_A_ATTACK == lpLeft->GetItemInfo().m_DetailData.m_cItemType) || (ItemType::OPP_TALON == lpRight->GetItemInfo().m_DetailData.m_cItemType && ItemType::SKILL_A_KNIFE == lpLeft->GetItemInfo().m_DetailData.m_cItemType)) { MasteryAffect(SkillSlot.SKILLINFO.cSkillLevel, SkillSlot.SKILLINFO.cLockCount, cLevel); resultStatus.m_cComboCount += SkillSlot.SKILLINFO.cLockCount; } } break; } // ¾ÖÅ¥·¯½Ã case 0x8806: { if (true == bRightHand) { const Item::CEquipment* lpRight = (true == bFirstWeaponSlot) ? *(ppEquip + EquipmentPos::WEAPON_HAND1) : *(ppEquip + EquipmentPos::WEAPON_HAND2); if (NULL != lpRight) { if (ItemType::BOW == lpRight->GetItemInfo().m_DetailData.m_cItemType || ItemType::CROSSBOW == lpRight->GetItemInfo().m_DetailData.m_cItemType) { // Ÿ ¸¶½ºÅ͸®¿Í´Â ¼ö½ÄÀÌ ´Ù¸£´Ù. resultStatus.m_lMinDamage += static_cast( (2 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 12) * (1 + cLevel * 0.02f)); resultStatus.m_lMaxDamage += static_cast( (2 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 12) * (1 + cLevel * 0.02f)); resultStatus.m_wHitRate += 2 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 12; } } } break; } // ÅÍÇÁ´Ï½º case 0x8107: case 0x9110: { resultStatus.m_wArmor += static_cast( (3 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 18) * (1 + cLevel * 0.02f)); break; } // ÀªÆÄ¿ö case 0x8106: case 0x9109: { resultStatus.m_wMPRegen += static_cast( (2 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 12) * (1 + cLevel * 0.02f)); // edith 2009.06.13 ÀªÆÄ¿ö ¹ë·±½º ¼öÁ¤ // resultStatus.m_wMagicResist += 2 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 12; resultStatus.m_wMagicResist += static_cast( (3 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 18) * (1 + cLevel * 0.02f) ); break; } // À̺£ÀÌÁ¯ case 0x8203: case 0x9213: { resultStatus.m_wEvade += static_cast( (3 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 18) * (1 + cLevel * 0.02f)); break; } // ÀÓÇÁ·çºêµå Å©¸®Æ¼Äà case 0x8202: case 0x9108: { resultStatus.m_wCritical += static_cast( (2 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 12) * (1 + cLevel * 0.02f)); break; } // ¼­·¹³ÊƼ case 0x8306: case 0x9212: { const unsigned short wAddMaxMP = cLevel * (SkillSlot.SKILLINFO.cSkillLevel * 2 + SkillSlot.SKILLINFO.cLockCount * 12); resultStatus.m_nMaxMP = ((USHRT_MAX - resultStatus.m_nMaxMP) <= wAddMaxMP) ? USHRT_MAX : resultStatus.m_nMaxMP + wAddMaxMP; resultStatus.m_wCoolDownRevision += 2 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 12; break; } // ÆäÀ̽º case 0x8402: { resultStatus.m_wMPRegen += static_cast( (1 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 6) * (1 + cLevel * 0.02f)); resultStatus.m_wMagicPower += static_cast( (2 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 12) * (1 + cLevel * 0.02f)); break; } // À̳ʻçÀÌÆ® case 0x9214: { resultStatus.m_wHPRegen += static_cast( (1 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 6) * (1 + cLevel * 0.02f)); resultStatus.m_wMPRegen += static_cast( (1 * SkillSlot.SKILLINFO.cSkillLevel + SkillSlot.SKILLINFO.cLockCount * 6) * (1 + cLevel * 0.02f)); break; } } } if( resultStatus.m_cComboCount > 6 ) resultStatus.m_cComboCount = 6; resultStatus.CalculateSubStatus(); resultStatus.m_cCalculateState = CS_EQUIP_INFO; return true; } using namespace Skill::SpellID; bool FightStatus::CalculateEnchantInfo(const unsigned short* aryEnchantLevel, FightStatus& resultStatus) const { // edith 2008.02.20 ÀÎþƮ°¡ ¹ß»ýÇßÀ»¶§ °è»êµÇ´Â °è»ê°ø½Ä if (CS_EQUIP_INFO != m_cCalculateState) { return false; } resultStatus = *this; float fHPPercent = 0.0f; float fMPPercent = 0.0f; float fHPSubPercent = 0.0f; float fMPSubPercent = 0.0f; for (unsigned char cSpellIndex = 0; cSpellIndex < MAX_SPELL_TYPE; ++cSpellIndex) { unsigned short wEnchantLevel = *(aryEnchantLevel + cSpellIndex); if (0 != wEnchantLevel) { switch (cSpellIndex) { case BattleSong: resultStatus.m_lMinDamage += wEnchantLevel * 2; resultStatus.m_lMaxDamage += wEnchantLevel * 2; resultStatus.m_wHitRate += wEnchantLevel; break; case MaintenanceChant: resultStatus.m_wArmor += wEnchantLevel; resultStatus.m_wEvade += static_cast(wEnchantLevel * 0.1f); resultStatus.m_wHPRegen += static_cast(wEnchantLevel * 0.2f); break; case AccelerationChant: resultStatus.m_lMinDamage += wEnchantLevel * 2; resultStatus.m_lMaxDamage += wEnchantLevel * 2; resultStatus.m_wHitRate += wEnchantLevel; resultStatus.m_wMPRegen += static_cast(wEnchantLevel * 0.2f); break; case LifeAura: resultStatus.m_wHPRegen += static_cast(wEnchantLevel * 0.4f); resultStatus.m_wMPRegen += static_cast(wEnchantLevel * 0.4f); break; case SpeedBuff: resultStatus.m_wSpeed += wEnchantLevel * 2; break; case ExpOrb: break; case Regeneration: resultStatus.m_wHPRegen += static_cast(wEnchantLevel * 0.4f); break; case DemagePotion: { if(wEnchantLevel > 50) { resultStatus.m_lMinDamage += wEnchantLevel; resultStatus.m_lMaxDamage += wEnchantLevel; break; } unsigned short add = static_cast((float)m_lMinDamage*((float)wEnchantLevel/100.0f)); resultStatus.m_lMinDamage += add; resultStatus.m_lMaxDamage += add; } break; case ArmorPotion: { if(wEnchantLevel > 50) { resultStatus.m_wArmor += wEnchantLevel; break; } unsigned short add = static_cast((float)m_wArmor*((float)wEnchantLevel/100.0f)); resultStatus.m_wArmor += add; } break; case HitRatePotion: { if(wEnchantLevel > 50) { resultStatus.m_wHitRate += wEnchantLevel; break; } unsigned short add = static_cast((float)m_wHitRate*((float)wEnchantLevel/100.0f)); resultStatus.m_wHitRate += add; } break; case EvadePotion: { if(wEnchantLevel > 50) { resultStatus.m_wEvade += wEnchantLevel; break; } unsigned short add = static_cast((float)m_wEvade*((float)wEnchantLevel/100.0f)); resultStatus.m_wEvade += add; } break; case MaxHPPotion: { if(wEnchantLevel > 50) { resultStatus.m_nMaxHP += wEnchantLevel; break; } unsigned short add = static_cast((float)m_nMaxHP*((float)wEnchantLevel/100.0f)); resultStatus.m_nMaxHP += add; } break; case MaxMPPotion: { if(wEnchantLevel > 50) { resultStatus.m_nMaxMP += wEnchantLevel; break; } unsigned short add = static_cast((float)m_nMaxMP*((float)wEnchantLevel/100.0f)); resultStatus.m_nMaxMP += add; } break; case HPRegenPotion: { if(wEnchantLevel > 50) { resultStatus.m_wHPRegen += wEnchantLevel; break; } unsigned short add = static_cast((float)m_wHPRegen*((float)wEnchantLevel/100.0f)); resultStatus.m_wHPRegen += add; } break; case MPRegenPotion: { if(wEnchantLevel > 50) { resultStatus.m_wMPRegen += wEnchantLevel; break; } unsigned short add = static_cast((float)m_wMPRegen*((float)wEnchantLevel/100.0f)); resultStatus.m_wMPRegen += add; } break; case CriticalPotion: { if(wEnchantLevel > 50) { resultStatus.m_wCritical += wEnchantLevel; break; } unsigned short add = static_cast((float)m_wCritical*((float)wEnchantLevel/100.0f)); resultStatus.m_wCritical += add; } break; case BlockPotion: { if(wEnchantLevel > 50) { resultStatus.m_wBlock += wEnchantLevel; break; } unsigned short add = static_cast((float)m_wBlock*((float)wEnchantLevel/100.0f)); resultStatus.m_wBlock += add; } break; case SpeedPotion: { if(wEnchantLevel > 50) { resultStatus.m_wSpeed += wEnchantLevel; break; } unsigned short add = static_cast((float)m_wSpeed*((float)wEnchantLevel/100.0f)); resultStatus.m_wSpeed += add; } break; case DeCoolDownPotion: { if(wEnchantLevel > 50) { resultStatus.m_wCoolDownRevision += wEnchantLevel; break; } unsigned short add = static_cast((float)m_wCoolDownRevision*((float)wEnchantLevel/100.0f)); resultStatus.m_wCoolDownRevision += add; } break; case MagicPowerPotion: { if(wEnchantLevel > 50) { resultStatus.m_wMagicPower += wEnchantLevel; break; } unsigned short add = static_cast((float)m_wMagicPower*((float)wEnchantLevel/100.0f)); resultStatus.m_wMagicPower += add; } break; case MagicResistPotion: { if(wEnchantLevel > 50) { resultStatus.m_wMagicResist += wEnchantLevel; break; } unsigned short add = static_cast((float)m_wMagicResist*((float)wEnchantLevel/100.0f)); resultStatus.m_wMagicResist += add; } break; case Slow: resultStatus.m_wSpeed = 13; break; case ArmorBroken: resultStatus.m_wArmor = (resultStatus.m_wArmor > wEnchantLevel) ? resultStatus.m_wArmor - wEnchantLevel : 0; break; case Blaze: resultStatus.m_wSpeed += 50; resultStatus.m_wHitRate += static_cast(wEnchantLevel * 0.5f); resultStatus.m_wEvade = (resultStatus.m_wEvade > static_cast(wEnchantLevel * 0.1f)) ? resultStatus.m_wEvade - static_cast(wEnchantLevel * 0.1f) : 0; resultStatus.m_wMagicResist += static_cast(wEnchantLevel * 0.1f); break; case Charging: resultStatus.m_wSpeed += 50; resultStatus.m_wArmor += static_cast(wEnchantLevel * 0.5f); resultStatus.m_wMagicResist += static_cast(wEnchantLevel * 0.1f); break; case Stealth: resultStatus.m_wSpeed = wEnchantLevel * 10; break; case ManaShell: break; case Encourage: resultStatus.m_lMinDamage += wEnchantLevel; resultStatus.m_lMaxDamage += wEnchantLevel; resultStatus.m_wHitRate += wEnchantLevel; resultStatus.m_wArmor += static_cast(wEnchantLevel * 0.5f); resultStatus.m_wEvade += static_cast(wEnchantLevel * 0.25f); break; case EnchantWeapon: resultStatus.m_lMinDamage += wEnchantLevel * 4; resultStatus.m_lMaxDamage += wEnchantLevel * 4; resultStatus.m_wHitRate += wEnchantLevel; break; case BrightArmor: resultStatus.m_wArmor += static_cast(wEnchantLevel * 2.5f); break; case HardenSkin: resultStatus.m_wArmor += static_cast(wEnchantLevel * 2.5f); break; case Flexibility: break; case Guard: resultStatus.m_wBlock += wEnchantLevel; break; case Hold: break; case Stun: break; case Frozen: resultStatus.m_wSpeed = 13; resultStatus.m_wCoolDownRevision = 0; break; case Poisoned: resultStatus.m_lMinDamage = (resultStatus.m_lMinDamage > (wEnchantLevel * 4)) ? resultStatus.m_lMinDamage - (wEnchantLevel * 4) : 0; resultStatus.m_lMaxDamage = (resultStatus.m_lMaxDamage > (wEnchantLevel * 4)) ? resultStatus.m_lMaxDamage - (wEnchantLevel * 4) : 0; resultStatus.m_wHitRate = (resultStatus.m_wHitRate > wEnchantLevel) ? resultStatus.m_wHitRate - wEnchantLevel : 0; break; case LowerStrength: resultStatus.m_lMinDamage = (resultStatus.m_lMinDamage > (wEnchantLevel * 4)) ? resultStatus.m_lMinDamage - (wEnchantLevel * 4) : 0; resultStatus.m_lMaxDamage = (resultStatus.m_lMaxDamage > (wEnchantLevel * 4)) ? resultStatus.m_lMaxDamage - (wEnchantLevel * 4) : 0; resultStatus.m_wHitRate = (resultStatus.m_wHitRate > wEnchantLevel) ? resultStatus.m_wHitRate - wEnchantLevel : 0; resultStatus.m_wArmor = (resultStatus.m_wArmor > wEnchantLevel) ? resultStatus.m_wArmor - wEnchantLevel : 0; resultStatus.m_wEvade = (resultStatus.m_wEvade > static_cast(wEnchantLevel * 0.25f)) ? resultStatus.m_wEvade - static_cast(wEnchantLevel * 0.25f) : 0; break; case Invincible: break; case Hide: break; case LuckyOrb: break; case StoneForm: resultStatus.m_wEvade = 0; resultStatus.m_wBlock = 0; resultStatus.m_wArmor = SHRT_MAX; resultStatus.m_wMagicResist = SHRT_MAX; break; case CounterAttack: break; case Envenom: break; case BombSet: break; case KarterantWorldBuff: case MerkadiaWorldBuff: fHPPercent += 0.05f; fMPPercent += 0.05f; break; case KarterantWorldDeBuff: case MerkadiaWorldDeBuff: fHPSubPercent += 0.05f; fMPSubPercent += 0.05f; break; case PowerStatue: // ÈûÀÇ ¼®»ó fHPPercent += wEnchantLevel * 0.01f; break; case IntStatue: // °æÇèÀÇ ¼®»ó fMPPercent += wEnchantLevel * 0.01f; break; case ExpStatue: // °æÇèÀÇ ¼®»ó break; case WealthStatue: // ºÎÀÇ ¼®»ó break; case RealmHP: // ·¼¸§ HP fHPPercent += wEnchantLevel * 0.05f; break; case RealmMP: // ·¼¸§ MP fMPPercent += wEnchantLevel * 0.05f; break; case Concentration: // break; /* case Chocolate: resultStatus.m_lMinDamage += 60; resultStatus.m_lMaxDamage += 60; resultStatus.m_wHitRate += 150; break; */ case TasteWine: resultStatus.m_wArmor += 30; resultStatus.m_wEvade += 30; break; case WifeCracker: break; /* case StaminaPotion: // ü·ÂÀÇ ¸¶¹ý ½Ã¾à. switch(wEnchantLevel) { case 1: fHPPercent += 0.2f; fMPPercent += 0.1f; break; case 2: fHPPercent += 0.3f; fMPPercent += 0.2f; break; case 3: fHPPercent += 0.5f; fMPPercent += 0.3f; resultStatus.m_wArmor += 150; resultStatus.m_wMagicPower += 250; resultStatus.m_lMinDamage += 400; resultStatus.m_lMaxDamage += 400; break; } break; */ case Fired: resultStatus.m_lMinDamage = (resultStatus.m_lMinDamage > (wEnchantLevel * 4)) ? resultStatus.m_lMinDamage - (wEnchantLevel * 4) : 0; resultStatus.m_lMaxDamage = (resultStatus.m_lMaxDamage > (wEnchantLevel * 4)) ? resultStatus.m_lMaxDamage - (wEnchantLevel * 4) : 0; resultStatus.m_wHitRate = (resultStatus.m_wHitRate > wEnchantLevel) ? resultStatus.m_wHitRate - wEnchantLevel : 0; break; case CurseOfBlind: resultStatus.m_lMinDamage = (resultStatus.m_lMinDamage > (wEnchantLevel * 4)) ? resultStatus.m_lMinDamage - (wEnchantLevel * 4) : 0; resultStatus.m_lMaxDamage = (resultStatus.m_lMaxDamage > (wEnchantLevel * 4)) ? resultStatus.m_lMaxDamage - (wEnchantLevel * 4) : 0; resultStatus.m_wHitRate = (resultStatus.m_wHitRate > wEnchantLevel) ? resultStatus.m_wHitRate - wEnchantLevel : 0; resultStatus.m_wArmor = (resultStatus.m_wArmor > wEnchantLevel) ? resultStatus.m_wArmor - wEnchantLevel : 0; resultStatus.m_wEvade = (resultStatus.m_wEvade > static_cast(wEnchantLevel * 0.25f)) ? resultStatus.m_wEvade - static_cast(wEnchantLevel * 0.25f) : 0; break; case HundredLevel: break; case Drunk: break; case DeCoolDown: resultStatus.m_wCoolDownRevision += wEnchantLevel * 2; break; case StealHand: break; case MichaelBless: break; } } } // --------------------------------------------------------- // ¿ùµå ¿þÆù, ¼®»ó È¿°ú µîÀÇ Ã³¸® unsigned short wOriginalMaxHP = resultStatus.m_nMaxHP; unsigned short wOriginalMaxMP = resultStatus.m_nMaxMP; resultStatus.m_nMaxHP -= static_cast( wOriginalMaxHP * fHPSubPercent ); resultStatus.m_nMaxMP -= static_cast( wOriginalMaxMP * fMPSubPercent ); unsigned short wAddMaxHP = static_cast( wOriginalMaxHP * fHPPercent ); if(wAddMaxHP>MAX_INCHANT_HP) wAddMaxHP = MAX_INCHANT_HP; resultStatus.m_nMaxHP = ((USHRT_MAX - resultStatus.m_nMaxHP) <= wAddMaxHP) ? USHRT_MAX : resultStatus.m_nMaxHP + wAddMaxHP; unsigned short wAddMaxMP = static_cast( wOriginalMaxMP * fMPPercent ); if(wAddMaxHP>MAX_INCHANT_MP) wAddMaxHP = MAX_INCHANT_MP; resultStatus.m_nMaxMP = ((USHRT_MAX - resultStatus.m_nMaxMP) <= wAddMaxMP) ? USHRT_MAX : resultStatus.m_nMaxMP + wAddMaxMP; // --------------------------------------------------------- resultStatus.CalculateSubStatus(); resultStatus.m_cCalculateState = CS_ENCHANT_INFO; return true; } void FightStatus::CalculateSubStatus(void) { m_fDefenceRate = static_cast((99 * m_wArmor / 4.0f) / (m_wArmor / 4.0f + 50) * 100) / 100.0f; m_fCriticalMagnification = 1.4f + m_wCritical / 600.0f; m_fCriticalRate = static_cast((99 * m_wCritical / 2.0f) / static_cast(m_wCritical / 2.0f + 50) * 100) / 100.0f; m_fBlockRate = static_cast((99 * m_wBlock) / (m_wBlock + 50) * 50) / 100.0f; m_fSpeedRate = static_cast((99 * m_wSpeed) / static_cast(m_wSpeed + 50) * 250) / 100.0f; m_fCoolDownRevisionRate = 100 - static_cast((99 * m_wCoolDownRevision) / static_cast(m_wCoolDownRevision + 50) * 50) / 100.0f; m_fMagicResistRate = static_cast((99 * (static_cast(m_wMagicResist) * 0.85f)) / ((static_cast(m_wMagicResist) * 0.85f) + 50) * 100) / 100.0f - 2.0f; if ( m_fMagicResistRate <= 0.0f ) m_fMagicResistRate = 0.0f ; // ·°Å°Âù½º ·¹ÀÌÆ® m_fLuckResistRate = (float)m_wLuck / 3.0f; } bool FightStatus::CheckEquipable(const Item::CEquipment* lpEquip, const CharacterStatus& characterStatus, const unsigned char cClass, const unsigned char cLevel, const unsigned short wLevelAbility) { using namespace Item; if (NULL == lpEquip) { return false; } // ³»±¸µµ Á¦ÇÑ if (0 == lpEquip->GetNumOrDurability()) { return false; } // 2009.08.18 ÀåÂø·¹º§ Á¦ÇÑ (LimitStatus Á¦ÇÑ) int iCurLevel = cLevel; if(3 == ((CEquipment*)lpEquip)->GetSeasonRecord()) // ½ÃÁð·¹ÄÚµå 3ÀÌ¸é ·¹º§Á¦ÇÑÀ» 5 ´Ù¿î½ÃŲ´Ù) { iCurLevel = cLevel+((CEquipment*)lpEquip)->GetCoreLevel(); } // ¾îºô¸®Æ¼ º¸³Ê½º iCurLevel += wLevelAbility; unsigned short wValue = lpEquip->GetItemInfo().m_UseLimit.m_wLimitValue; switch (lpEquip->GetItemInfo().m_UseLimit.m_cLimitStatus) { case StatusLimit::STR: if (characterStatus.m_nSTR < wValue) { return false; } break; case StatusLimit::DEX: if (characterStatus.m_nDEX < wValue) { return false; } break; case StatusLimit::CON: if (characterStatus.m_nCON < wValue) { return false; } break; case StatusLimit::INT: if (characterStatus.m_nINT < wValue) { return false; } break; case StatusLimit::WIS: if (characterStatus.m_nWIS < wValue) { return false; } break; case StatusLimit::LEVEL: if (iCurLevel < wValue) { return false; } break; } // Ŭ·¡½º Á¦ÇÑ if (0 == (lpEquip->GetItemInfo().m_UseLimit.m_dwClassLimit & (0x00000001 << (cClass - 1)))) { return false; } // ÀåÂø ·¹º§ Á¦ÇÑ // 2009.08.18 ÀåÂø·¹º§ Á¦ÇÑ if(lpEquip->GetItemInfo().m_DetailData.m_wLowLimitLevel || lpEquip->GetItemInfo().m_DetailData.m_wHighLimitLevel) { if(iCurLevel < lpEquip->GetItemInfo().m_DetailData.m_wLowLimitLevel || iCurLevel > lpEquip->GetItemInfo().m_DetailData.m_wHighLimitLevel) { return false; } } // ·éÀÌ ÀåÂøµÇ¾îÀÖÀ¸¸é ·¹º§Á¦ÇÑ ÀåÂøÁ¦ÇÑ °Ë»ç¸¦ ÇÑ´Ù. if(cLevelGetRuneEquipLimitLevel()) { return false; } return true; }