1860 KO Source Skilleri Mantığı Ve Gerekenleri

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Katılım
11 Ocak 2012
Mesajlar
12,813
Kod:
###------------------------------------------------------###

 switch (pType->bBuffType) 

    {    

        case 1 :

        if( pType->sMaxHp =! 0 )

        {

            if ( magicid == 111654 || magicid == 112654 || magicid == 211654 || magicid == 212654 || magicid == 500054) // Undying                                                                                             

            { // Undying buff

                int undHP = (pTUser->m_sMaxHPAmount * 60) / 100;

                pTUser->m_sMaxHPAmount = undHP;

                pTUser->m_sDuration1 = pType->sDuration;

                pTUser->m_fStartTime1 = TimeGet(); 

            }

            else

            {  // Normal buff

                pTUser->m_sMaxHPAmount = pType->sMaxHP;

                pTUser->m_sDuration1 = pType->sDuration;

                pTUser->m_fStartTime1 = TimeGet();

            }

        }

        else

        if( magicid == 111727 || magicid == 211727 || magicid == 112727 || magicid == 211727 ) // Reserve Life

        {

                pTUser->m_sMaxHPAmount = pTUser->m_sMaxHPAmount

                pTUser->m_sDuration1 = pType->sDuration;

                pTUser->m_fStartTime1 = TimeGet();

        }

        else

        if( magicid == 111745 || magicid == 211745|| magicid == 212745 || magicid == 112745) // Parasite

        {

                int Parasite = pTUser->m_sMaxHPAmount - (pTUser->m_sMaxHPAmount * 20) / 100;

                pTUser->m_sMaxHPAmount = Parasite;

                pTUser->m_sDuration1 = pType->sDuration;

                pTUser->m_fStartTime1 = TimeGet();    

        }

        else

        if( magicid == 212771 || magicid == 112771 ) // Superior Parasite

        {

                int sParasite = pTUser->m_sMaxHPAmount - (pTUser->m_sMaxHPAmount * 30) / 100;

                pTUser->m_sMaxHPAmount = sParasite;

                pTUser->m_sDuration1 = pType->sDuration;

                pTUser->m_fStartTime1 = TimeGet();

        }    

        break;

        

        case 2: // -> Increase/Decrease Defans 

        // 1 - Malice

        if( magicid == 111703 || magicid == 112703 ||magicid == 211703 || magicid == 212703 )

        {

            int Malice = (pTUser->m_sACAmount * 20) /100;

            pTUser->m_sACAmount = Malice;

            pTUser->m_sDuration2 = pType->sDuration;

            pTUser->m_fStartTime2 = TimeGet();}

        }

            // 2 - Torment

            else if( magicid == 111757 || magicid == 112757 || magicid == 211757 || magicid == 212757 )

        {

            int Torment = (pTUser->m_sACAmount * 20) /100;

            pTUser->m_sACAmount = Torment;

            pTUser->m_sDuration2 = pType->sDuration;

            pTUser->m_fStartTime2 = TimeGet();}

        }

            // 3 - Normal

            else

        {

            pTUser->m_sACAmount = pType->sAC;

            pTUser->m_sDuration2 = pType->sDuration;

            pTUser->m_fStartTime2 = TimeGet();

        }

        break;

        case 3: // -> Resizing char size 

        if ( magicid == 490034 )

        {

            memset( send_buff, NULL, 128); 

            send_index = 0;

            SetByte(send_buff, 3, send_index); 

            SetByte(send_buff, ABNORMAL_GIANT, send_index); // 1 - Big

            pTUser->StateChange(send_buff);                    

            memset( send_buff, NULL, 128); 

            send_index = 0;

        }

            else if( magicid == 490035 )

        {

            memset( send_buff, NULL, 128); 

            send_index = 0 ;

            SetByte(send_buff, 3, send_index);

            SetByte(send_buff, ABNORMAL_DWARF, send_index);  // 2 - Small

            pTUser->StateChange(send_buff);                        

            memset( send_buff, NULL, 128); 

            send_index = 0;

        }

        pTUser->m_sDuration3 = pTable->bReCastTime;

        pTUser->m_fStartTime3 = TimeGet();

        break;

        case 4: // -> Increase/Decrease Attack Damage

        if( magicid == 111760 || magicid == 112760 || magicid == 211760 || magicid == 212760 || magicid == 112770 || magicid == 212770)

        {

            pTUser->m_bAttackAmount = pTUser->m_bAttackAmount;    

            pTUser->m_sDuration4 = pTable->bReCastTime;

            pTUser->m_fStartTime4 = TimeGet();

        } 

            else

        {

            pTUser->m_bAttackAmount = pType->bAttack;

            pTUser->m_sDuration4 = pTable->bReCastTime;

            pTUser->m_fStartTime4 = TimeGet();

        }

        break;



###--------------------------------------------------------------###



Skill çalışma mantığı MagicType4'deki skillerin 33 ayrı tipi var bu sadece 4 tanesi 29 tane daha yazmanız lazım mantığı inceleyin



##############

İlk Case'i Anlatayım..

##############



If pType->sMaxHP != 0 Eğer kullanıcı HP'si 0 değilse yani Ölmemiş ise skill kullanabiliyor.

if(Magicid == 111654 .....) ve devamı db'deki tüm Undying skillerinin id'leri, yani eğer kullanıcı undying kullandıysa, Normalde Case 1 buffları ve debuffları belirtir ancak undy'nin db'de HP verdiği değer 0 olduğu için hesaplamak zorundayız.



int undHP = (pTUser->m_sMaxHPAmount * 60) / 100; // Kullanıcı HP'sinin %60'i

pTUser->m_sMaxHPAmount = m_sMaxHPAmount + undHP; // Kullanıcıya Kullanıcı HP'sinin %60'i kadar can ver

pTUser->m_sDuration1 = pType->sDuration; // Buff'in süresi 

pTUser->m_fStartTime1 = TimeGet(); // Ne zaman başladığı
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst Alt
Reklam
Reklam