⏩ OldSchoolKO ✅ | " VALHALLA " 2.000.000 TL ÖDÜL ⭐ 3 YIL ARADAN SONRA ✅ v.1098 MYKO EFSANESİ ⚔ OFFICIAL 17.05.2024 - 21:00 ⏪
Cuceko

KO Source Skillerin Bazıları

  •         

            

            

            

            

  • HyperFilter | DoS Protection | DDoS Protection | DoS Mitigation | DDoS Mitigation | AntiDoS | AntiDDoS | Proxy Shielding
K Çevrimdışı

Karaeski

Kayıtlı Üye
8 Mart 2012
387
0
16
33
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ığı

Son hali

Pastebin :
Gizli içerik
Bu içeriği görmek için cevap yazmalısınız.
 
S Çevrimdışı

saintx

Kayıtlı Üye
12 Mart 2012
250
0
18
28
başarılı bir makale & paylaşım olmuş efe, teşekkürler
 
bigahega Çevrimdışı

bigahega

Administrator
Yönetici
KoCuce.Com
7 Mart 2012
12,841
376
83
ptable diye gecenler pmagic olarak geciyor sourcede bu arada bilginize bide cogu yerde süslü parantez var yanlıslıklamı koymussun yada hazıra konmasınlar diyemi bilemicem :)
 
P Çevrimdışı

Pterde

Kayıtlı Üye
20 Mart 2012
155
1
18
53
Güzel anlatım teşekkürler, yalnız skill kodlarına göre ayırmaktansa tabloya yeni bi sütun ekleyip ona göre ayırmak daha iyi olurdu sanki
 
K Çevrimdışı

Karaeski

Kayıtlı Üye
8 Mart 2012
387
0
16
33
Güzel anlatım teşekkürler, yalnız skill kodlarına göre ayırmaktansa tabloya yeni bi sütun ekleyip ona göre ayırmak daha iyi olurdu sanki



Ayırman gereken çok fazla skill yok zaten, özel durumlar var sadece. Hem veritabanı bağlantısını yormamış olursun böyle daha sağlıklı bana göre
 
bigahega Çevrimdışı

bigahega

Administrator
Yönetici
KoCuce.Com
7 Mart 2012
12,841
376
83
Cevap: KO Source Skillerin Bazıları



saolasın :)