Load item info for flysword.
This commit is contained in:
@@ -1349,6 +1349,7 @@ public static class generate_item_temp
|
||||
content_length = (int)(size - offset);
|
||||
WriteInt(data, ref content_length_ptr, content_length);
|
||||
WriteInt(data, ref item_content, offset);
|
||||
|
||||
WriteInt(data, ref offset, ess.food_type); //��Ʒ�Ŀ�װ����־
|
||||
WriteInt(data, ref offset, ess.hornor); //��Ʒ��Ӧ�����ID guid
|
||||
|
||||
@@ -1357,7 +1358,69 @@ public static class generate_item_temp
|
||||
itemdataman.set_to_classid(DATA_TYPE.DT_PET_FOOD_ESSENCE, data, -1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int generate_flysword<RAND_CLASS>(uint id, ID_SPACE idspace, out byte[] data, out uint size, RAND_CLASS cls,item_tag_t tag)
|
||||
{
|
||||
data = new byte[0];
|
||||
size = 0;
|
||||
|
||||
DATA_TYPE datatype = DATA_TYPE.DT_INVALID;
|
||||
object obj = itemdataman._edm.get_data_ptr(id, idspace, ref datatype);
|
||||
if(obj == null || datatype != DATA_TYPE.DT_FLYSWORD_ESSENCE)
|
||||
return -1;
|
||||
FLYSWORD_ESSENCE ess = (FLYSWORD_ESSENCE)obj;
|
||||
size = (uint)(Marshal.SizeOf(typeof(item_data)) + Marshal.SizeOf(typeof(FLYSWORD_ESSENCE)));
|
||||
data = new byte[size];
|
||||
int offset = 0;
|
||||
WriteUInt(data, ref offset, id);
|
||||
WriteUInt(data, ref offset, 1);
|
||||
WriteUInt(data, ref offset, (uint)ess.pile_num_max);
|
||||
WriteInt(data, ref offset, (int)itemdataman.ELEMENTDATAMAN_EQUIP_MASK_FLYSWORD);
|
||||
WriteInt(data, ref offset, (int)ess.proc_type);
|
||||
WriteInt(data, ref offset, (int)DATA_TYPE.DT_FLYSWORD_ESSENCE);
|
||||
if(ess.has_guid == 1){
|
||||
int g1,g2;
|
||||
itemdataman.get_item_guid(id,out g1,out g2);
|
||||
WriteInt(data, ref offset, g1);
|
||||
WriteInt(data, ref offset, g2);
|
||||
}
|
||||
else{
|
||||
WriteInt(data, ref offset, 0);
|
||||
}
|
||||
WriteInt(data, ref offset, ess.price);
|
||||
WriteInt(data, ref offset, 0); //����ʱ��
|
||||
|
||||
int content_length = 0;
|
||||
int content_length_ptr = offset;
|
||||
WriteInt(data, ref offset, 0);
|
||||
int item_content = offset;
|
||||
WriteInt(data, ref offset, 0);
|
||||
content_length = (int)(size - offset);
|
||||
WriteInt(data, ref content_length_ptr, content_length);
|
||||
WriteInt(data, ref item_content, offset);
|
||||
|
||||
int t = element_data.RandNormal<RAND_CLASS, LOWER>((int)ess.time_max_min, (int)ess.time_max_max, cls, LOWER.LOWER_TREND);
|
||||
|
||||
// essence
|
||||
WriteInt(data, ref offset, (int)(t*0.5f));
|
||||
WriteInt(data, ref offset, (int)t);
|
||||
WriteShort(data, ref offset, (short)ess.require_player_level_min);
|
||||
WriteByte(data, ref offset, (byte)ess.level);
|
||||
WriteByte(data, ref offset, 0);
|
||||
WriteInt(data, ref offset, (int)ess.character_combo_id);
|
||||
WriteInt(data, ref offset, (int)ess.time_increase_per_element);
|
||||
|
||||
float speed = element_data.Rand<RAND_CLASS, LOWER>(ess.speed_increase_min, ess.speed_increase_max, cls, LOWER.LOWER_TREND);
|
||||
WriteFloat(data, ref offset, speed);
|
||||
speed = element_data.Rand<RAND_CLASS, LOWER>(ess.speed_rush_increase_min, ess.speed_rush_increase_max, cls, LOWER.LOWER_TREND);
|
||||
WriteFloat(data, ref offset, speed);
|
||||
|
||||
//���������߱�ǩ
|
||||
WriteByte(data, ref offset, tag.type);
|
||||
WriteByte(data, ref offset, (byte)tag.size);
|
||||
|
||||
itemdataman.set_to_classid(DATA_TYPE.DT_FLYSWORD_ESSENCE, data, -1);
|
||||
return 0;
|
||||
}
|
||||
public static int generate_townscroll<RAND_CLASS>(uint id, ID_SPACE idspace, out byte[] data, out uint size, RAND_CLASS cls)
|
||||
{
|
||||
DATA_TYPE datatype = DATA_TYPE.DT_INVALID;
|
||||
@@ -1402,6 +1465,7 @@ public static class generate_item_temp
|
||||
itemdataman.set_to_classid(DATA_TYPE.DT_TOWNSCROLL_ESSENCE, data, -1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#region Write Functions
|
||||
private static void WriteUInt(byte[] buf, ref int offset, uint value)
|
||||
{
|
||||
|
||||
@@ -491,6 +491,9 @@ namespace BrewMonster
|
||||
case DATA_TYPE.DT_PET_FOOD_ESSENCE:
|
||||
ret = generate_item_temp.generate_pet_food(id, ID_SPACE.ID_SPACE_ESSENCE, out item, out size, SPECIFIC.SPECIFIC_RAND);
|
||||
break;
|
||||
case DATA_TYPE.DT_FLYSWORD_ESSENCE:
|
||||
ret = generate_item_temp.generate_flysword(id, ID_SPACE.ID_SPACE_ESSENCE, out item, out size, SPECIFIC.SPECIFIC_RAND, tag);
|
||||
break;
|
||||
case DATA_TYPE.DT_TOWNSCROLL_ESSENCE:
|
||||
ret = generate_item_temp.generate_townscroll(id, ID_SPACE.ID_SPACE_ESSENCE, out item, out size, SPECIFIC.SPECIFIC_RAND);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user