Herkese Merhaba Knight Online Genei Sistem kaynak kodlarını paylaşıyorum

struct _GENIE_DATA



{

uint16 SkillCount;

uint32 SkillData[23];



bool AttackMode; // Attack Mode

bool RecoveryMode; // Recovery Mode





uint8 SkillRecoveryPercent; // User recovery skill at %%

uint8 AttackRange; // Attack range

uint8 ActivitiesRange; // Range of activities





bool HpRecovery; // HP Recovery On/Off

uint8 HpPotionPercent; // at %% consume potion





bool MpRecovery; // Mp Recovery On/Off

uint8 MpPotionPercent; // at %% consume potion





bool PetPotionRecovery; // Pet Recovery On/Off

uint8 PetPotionPercent; // at %% consume potion





bool AutomaticSkillParty; // Set the automatic use of 2nd skill



bool PartyNumber[12]; // Party Number





/*

1 - Return to town when Item is lower then % HP Recovery

2 - Return to town when Item is lower then % MP Recovery

3 - When there's not enough arrows you will be returned to town (only for Rogues)

4 - When the party breaks up you will be returned to town

5 - When you are the only survivor of the party, you'll be moved to town

6 - When the weapon durability is 0 you'll be moved to town

7 - With the magic hammer, you will be able to repair weapons with the durability of 100

8 - When Knight Genie point is 1, automatically use the Genie Spirit (When Genie Spirit is present)

9 - Automatically feed when Familiar's hunger level is 5

*/

bool Options[9];





uint8 ReturnHPTownPercent; // Return to town when Item is lower then % HP Recovery

uint8 ReturnMPTownPercent; // Return to town when Item is lower then % MP Recovery





_GENIE_DATA()

{

for (int i = 0; i < 23; i++)

SkillData = 0;





SkillCount = 0;

AttackMode = false;

RecoveryMode = false;

SkillRecoveryPercent = 0;

AttackRange = 0;

ActivitiesRange = 0;

HpRecovery = false;

HpPotionPercent = 0;

MpRecovery = false;

MpPotionPercent = 0;

PetPotionRecovery = false;

PetPotionPercent = 0;

AutomaticSkillParty = false;





for (int i = 0; i < 12; i++)

PartyNumber = false;





for (int i = 0; i < 9; i++)

Options = false;





ReturnHPTownPercent = 0;

ReturnMPTownPercent = 0;

}

};





void CUser::LoadGenieData()

{

Packet result(WIZ_GENIE, uint8(1));

result << uint8(2);





result << GenieData.SkillCount;

for (int i = 0; i < GenieData.SkillCount; i++)

result << GenieData.SkillData;





result << uint16(35); // Sabit





result << GenieData.AttackMode

<< GenieData.RecoveryMode

<< GenieData.SkillRecoveryPercent

<< GenieData.AttackRange

<< GenieData.ActivitiesRange

<< GenieData.HpRecovery

<< GenieData.HpPotionPercent

<< GenieData.MpRecovery

<< GenieData.MpPotionPercent

<< GenieData.PetPotionRecovery

<< GenieData.PetPotionPercent

<< GenieData.AutomaticSkillParty;





for (int i = 0; i < 12; i++)

result << GenieData.PartyNumber;





for (int i = 0; i < 9; i++)

{

result << GenieData.Options;



if (i == 0) result << GenieData.ReturnHPTownPercent;

if (i == 1) result << GenieData.ReturnMPTownPercent;

}



Send(&result);





/*

result << uint16(3) // Count

<< uint8(0x1D)

<< uint8(0x8C)

<< uint8(0x81)

<< uint8(0)

<< uint8(0x5D)

<< uint8(0xCE)

<< uint8(0x90)

<< uint8(0)

<< uint8(0xA2)

<< uint8(0x10)

<< uint8(0xA0)

<< uint8(0)

<< uint16(0x23) // Count alt taraf için toplam byte adeti

<< uint8(0) // Attack Mode

<< uint8(0) // Recovery Mode

<< uint8(0x1E) // User recovery skill at %%

<< uint8(0x46) // Attack range

<< uint8(0x32) // Range of activities

<< uint8(0) // HP Recovery On/Off

<< uint8(60) // at %% consume potion

<< uint8(0) // Mp Recovery On/Off

<< uint8(61) // at %% consume potion

<< uint8(0) // Pet Recovery On/Off

<< uint8(62) // at %% consume potion

<< uint8(1) // Set the automatic use of 2nd skill

<< uint8(1) // Party Number 1

<< uint8(1) // Party Number 2

<< uint8(1) // Party Number 3

<< uint8(1) // Party Number 4

<< uint8(1) // Party Number 5

<< uint8(1) // Party Number 6

<< uint8(1) // Party Number 7

<< uint8(1) // Party Number 8

<< uint8(1) // Party Number 9

<< uint8(1) // Party Number 10

<< uint8(1) // Party Number 11

<< uint8(1) // Party Number 12

<< uint8(1) // Return to town when Item is lower then % HP Recovery

<< uint8(0x0A) // Üsttekinin değeri

<< uint8(1) // Return to town when Item is lower then % MP Recovery

<< uint8(0x10) // Üsttekinin değeri

<< uint8(1) // When there's not enough arrows you will be returned to town (only for Rogues)

<< uint8(1) // When the party breaks up you will be returned to town

<< uint8(1) // When you are the only survivor of the party, you'll be moved to town

<< uint8(1) // When the weapon durability is 0 you'll be moved to town

<< uint8(1) // With the magic hammer, you will be able to repair weapons with the durability of 100

<< uint8(1) // When Knight Genie point is 1, automatically use the Genie Spirit (When Genie Spirit is present)

<< uint8(1); // Automatically feed when Familiar's hunger level is 5

*/

}



void CUser::SaveGenieData(Packet & pkt)

{

pkt >> GenieData.SkillCount;



for (int i = 0; i < GenieData.SkillCount; i++)

pkt >> GenieData.SkillData;





uint16 TotalCount = 0;

pkt >> TotalCount;





pkt >> GenieData.AttackMode

>> GenieData.RecoveryMode

>> GenieData.SkillRecoveryPercent

>> GenieData.AttackRange

>> GenieData.ActivitiesRange

>> GenieData.HpRecovery

>> GenieData.HpPotionPercent

>> GenieData.MpRecovery

>> GenieData.MpPotionPercent

>> GenieData.PetPotionRecovery

>> GenieData.PetPotionPercent

>> GenieData.AutomaticSkillParty;





for (int i = 0; i < 12; i++)

pkt >> GenieData.PartyNumber;





for (int i = 0; i < 9; i++)

{

pkt >> GenieData.Options;



if (i == 0) pkt >> GenieData.ReturnHPTownPercent;

if (i == 1) pkt >> GenieData.ReturnMPTownPercent;

}

}[/REPLYANDTHANKS]