EskiKnightOnline.net | v.1098 MYKO | 400.000 TL Ödül Havuzu | Official : 14 Haziran 2024 - 22:00 !
Cuceko
Cuceko
Cuceko

1534, 1886 Party ile np dağılımı [KOD]

  •         

            

            

            

            

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

Karaeski

Kayıtlı Üye
8 Mart 2012
387
1
18
33
Kod biraz eksik ama çalışıyor işinizi görür..

İçerik Açılmıştır Teşekkürler :)
Kod:
void CUser::LoyaltyDivide(short tid)

{

	

	int send_index = 0;

	char send_buff[256]; memset( send_buff, NULL, 256 );

	short loyalty_source = 0; short loyalty_target = 0; 

	short loyaltymonthly_source = 0; short loyaltymonthly_target = 0; 

	BYTE total_member = 0;



	CUser* pUser = NULL;

	_PARTY_GROUP* pParty = NULL;

	if( m_sPartyIndex < 0 ) return;

	pParty = m_pMain->m_PartyArray.GetData( m_sPartyIndex );

	if( !pParty ) return;



	CUser* pTUser = NULL ;

	if(tid < 0 || tid >= MAX_USER) return;



	pTUser = (CUser*)m_pMain->m_Iocport.m_SockArray[tid];

	if( !pTUser ) return;

	if(pTUser->m_pUserData->m_bZone == 21) return;

	

	for( int i = 0; i < 8; i++ ) {

		if( pParty->uid[i] != -1 ) {

			total_member++;			

		}

	}



	if( total_member <= 0 ) {

		return;

	}



	loyalty_target = -50;

	loyaltymonthly_target = -50;



	if( total_member == 2 ) {

		loyaltymonthly_source = 36;

		loyalty_source	      = 36;

	}

	else if( total_member == 3 ) {

		loyaltymonthly_source = 28;

		loyalty_source	      = 28;	

	}

	else if( total_member == 4 ) {

		loyaltymonthly_source = 24;

		loyalty_source	      = 24;	

	}

	else if( total_member == 5 ) {

		loyaltymonthly_source = 22;

		loyalty_source	      = 22;	

	} else if( total_member == 6 ) {

		loyaltymonthly_source = 20;

		loyalty_source	      = 20;	

	}

	else if( total_member == 7 ) {

		loyaltymonthly_source = 18;

		loyalty_source	      = 18;	

	}

	else if(total_member == 8) {

		loyaltymonthly_source = 16;

		loyalty_source	      = 16;	

	}

	else {

		return; 

	}



	for (int j = 0 ; j < 8 ; j++) {



		if( pParty->uid[j] != -1) {



			if( pParty->uid[j] < 0 || pParty->uid[j] >= MAX_USER ) {

				continue;

			}

		

			pUser = (CUser*)m_pMain->m_Iocport.m_SockArray[pParty->uid[j]];

			if( !pUser ) {

				continue;

			}



			pUser->m_pUserData->m_iLoyalty += loyalty_source;

			pUser->m_pUserData->m_iLoyaltyMonthly += loyaltymonthly_source;



			if ( pUser->m_pUserData->m_iLoyalty < 0 ) {

				pUser->m_pUserData->m_iLoyalty = 0;

			}

			

			if ( pUser->m_pUserData->m_iLoyaltyMonthly < 0 ) {

				pUser->m_pUserData->m_iLoyaltyMonthly = 0;

			}



			memset( send_buff, NULL, 256 ); send_index = 0;	

			

			SetByte( send_buff, WIZ_LOYALTY_CHANGE, send_index );

			SetByte( send_buff, 0x01, send_index );

			SetDWORD( send_buff, pTUser->m_pUserData->m_iLoyalty, send_index ); 

			SetDWORD( send_buff, pTUser->m_pUserData->m_iLoyaltyMonthly, send_index ); 

			SetDWORD( send_buff, 3, send_index ); // Eksik - Clan save count

			SetDWORD( send_buff, 3, send_index ); // Eksik - Extra premium amount			

			pUser->Send( send_buff, send_index ); 

		} 

	}



	pTUser->m_pUserData->m_iLoyalty += loyalty_target;

	pTUser->m_pUserData->m_iLoyaltyMonthly += loyalty_target;

	

	memset( send_buff, NULL, 256 ); send_index = 0;	

	SetByte( send_buff, WIZ_LOYALTY_CHANGE, send_index );

	SetByte( send_buff, 0x01, send_index );

	SetDWORD( send_buff, pTUser->m_pUserData->m_iLoyalty, send_index ); 

	SetDWORD( send_buff, pTUser->m_pUserData->m_iLoyaltyMonthly, send_index ); 

	SetDWORD( send_buff, 3, send_index ); // Eksik - Clan save count

	SetDWORD( send_buff, 3, send_index ); // Eksik - Extra premium amount			

	pTUser->Send( send_buff, send_index );

}
 
K Çevrimdışı

Karaeski

Kayıtlı Üye
8 Mart 2012
387
1
18
33
Kardeşim tabloya girilmez bu, C++ kodları kaynak kodun olması lazım yani ebenezer'i oluşturan kodlara sahip olman lazım eğer yoksa yapabileceğimiz bir şey yok :/
 
V Çevrimdışı

Via

Yeni Cüce
22 Nisan 2013
10
0
1
30
Cevap: 1534, 1886 Party ile np dağılımı [KOD]



Bu kodlar yanlış görmediysem "+zone 21 (Moradon) için geçerli.

Andream,Ronark Land Base veya savaş alanları için geçerli değil.

Geçerlilik için "if(pTUser->m_pUserData->m_bZone == 21) return;" ,21 yerine savaş alanı numaraları değiştirilerek uygulanmalı.
 
K Çevrimdışı

Karaeski

Kayıtlı Üye
8 Mart 2012
387
1
18
33
Cevap: 1534, 1886 Party ile np dağılımı [KOD]



Tam tersi,

Eğer kullanıcı moradonda ise geri dön, moradon gibi bir alanda NP gelip gidemez demek;



if( pTUser->m_pUserData->m_bZone == 21 ) return;

Hedef kullanici->kullanici bilgileri->zonesi eşit ise 21'e geri dön np dağılımı ile ilgili herhangi bir işlem yapma demek.
 
1 Çevrimdışı

12z

Kayıtlı Üye
10 Kasım 2012
141
0
16
31
Cevap: 1534, 1886 Party ile np dağılımı [KOD]



tskrler