Merge branch 'develop' into feature/creating-role

This commit is contained in:
HungDK
2026-01-22 16:37:59 +07:00
38 changed files with 11899 additions and 1396 deletions
@@ -31,3 +31,5 @@ MonoBehaviour:
prefab: {fileID: 5750242998044155948, guid: ecf0d8daf08db6f4a8d94a4bb07847ec, type: 3}
- id: Win_Inventory
prefab: {fileID: 5910006447059157136, guid: 22d3972b131ebdb4288f9cbdf996d691, type: 3}
- id: Win_Enchase
prefab: {fileID: 5636724581774400035, guid: de6ac6f2630425044a55299c703670f1, type: 3}
@@ -347,7 +347,7 @@ public static class generate_item_temp
itemdataman.set_to_classid(DATA_TYPE.DT_WEAPON_ESSENCE, data, -1);
return 0;
}
private static void generate_magic_defense<RAND_CLASS>(int[] res, List<ARMOR_ESSENCE.MagicDefence> res_list , RAND_CLASS cls,
private static void generate_magic_defense<RAND_CLASS>(int[] res, List<MagicDefence> res_list , RAND_CLASS cls,
bool b_fixed = false) //
{
float[] count_prop = {0.35f,0.25f,0.20f,0.15f,0.05f,0.051f};
@@ -403,6 +403,7 @@ public static class generate_item_temp
data = new byte[size];
int offset = 0;
short hole_num = 0;
if(normal_addon == GEN_ADDON_MODE.ADDON_LIST_DROP)
{
float[] drop_probability_socket = { ess.drop_probability_socket0, ess.drop_probability_socket1, ess.drop_probability_socket2 };
@@ -519,7 +520,7 @@ public static class generate_item_temp
WriteInt(data, ref offset, element_data.RandNormal<RAND_CLASS, LOWER>(ess.mp_enhance_low, ess.mp_enhance_high, cls, LOWER.LOWER_TREND));
WriteInt(data, ref offset, element_data.RandNormal<RAND_CLASS, LOWER>(ess.hp_enhance_low, ess.hp_enhance_high, cls, LOWER.LOWER_TREND));
int[] res = {0,0,0,0,0};
List<ARMOR_ESSENCE.MagicDefence> res_list = ess.magic_defences.ToList();
List<MagicDefence> res_list = ess.magic_defences.ToList();
generate_magic_defense(res, res_list, cls, ess.force_all_magic_defences != 0 || ess.fixed_props!=0);
WriteInt(data, ref offset, res[0]);
WriteInt(data, ref offset, res[1]);
@@ -558,6 +559,366 @@ public static class generate_item_temp
itemdataman.set_to_classid(DATA_TYPE.DT_ARMOR_ESSENCE, data, -1);
return 0;
}
public static int generate_decoration<RAND_CLASS>(uint id, ID_SPACE idspace, out byte[] data, out uint size, RAND_CLASS cls,
GEN_ADDON_MODE normal_addon ,item_tag_t tag,List<int> sa_list = null)
{
DATA_TYPE datatype = DATA_TYPE.DT_INVALID;
int i=0;
data = new byte[0];
size = 0;
object obj = itemdataman._edm.get_data_ptr(id, idspace, ref datatype);
if(obj == null || datatype != DATA_TYPE.DT_DECORATION_ESSENCE)
{
return -1;
}
DECORATION_ESSENCE ess = (DECORATION_ESSENCE)obj;
size = (uint)(Marshal.SizeOf(typeof(item_data)) + Marshal.SizeOf(typeof(_item_content)) + Marshal.SizeOf(typeof(DECORATION_ESSENCE)));
// ׶
uint hole_num = 0; //׶Ŀ
// addons
byte[] addon_buf = new byte[itemdataman.ELEMENTDATAMAN_MAX_NUM_ADDONS*Marshal.SizeOf(typeof(itemdataman._addon))];
float[] probability_addon_num = { ess.probability_addon_num0, ess.probability_addon_num1, ess.probability_addon_num2, ess.probability_addon_num3, ess.probability_addon_num4 };
uint addon_num = (uint)element_data.RandSelect<RAND_CLASS, LOWER>(probability_addon_num.ToList(), cls, LOWER.LOWER_TREND); //ԱĿĿ
uint addon_size = 0;
if(ess.fixed_props != 0)
{
addon_size = itemdataman.generate_equipment_addon_buffer_2(DATA_TYPE.DT_DECORATION_ESSENCE, ess.addons.Select(a => (int)a.id_addon).ToList(), addon_buf,0, addon_num);
}
else
{
if(normal_addon == GEN_ADDON_MODE.ADDON_LIST_DROP)
addon_size = itemdataman.generate_equipment_addon_buffer(DATA_TYPE.DT_DECORATION_ESSENCE, ess.addons.Select(a => (int)a.id_addon).ToList(), 32, addon_buf,0, addon_num);
else if(normal_addon == GEN_ADDON_MODE.ADDON_LIST_PRODUCE)
addon_size = itemdataman.generate_equipment_addon_buffer(DATA_TYPE.DT_DECORATION_ESSENCE, ess.rands.Select(a => (int)a.id_rand).ToList(), 32, addon_buf,0, addon_num);
else if (normal_addon == GEN_ADDON_MODE.ADDON_LIST_SPEC)
{
addon_size = itemdataman.generate_spec_addon_buffer(DATA_TYPE.DT_DECORATION_ESSENCE,addon_buf,0,itemdataman.ELEMENTDATAMAN_MAX_NUM_ADDONS, addon_num,sa_list);
}
else
{
addon_size = 0;
addon_num = 0;
}
}
size += addon_size;
//tag size
//ASSERT(tag_size >= sizeof(short));
size += tag.size;
// allocate the buffer with exact length
data = new byte[size];
int offset = 0;
WriteUInt(data, ref offset, id); //ƷģID
WriteUInt(data, ref offset, 1); //Ʒ
WriteUInt(data, ref offset, (uint)ess.pile_num_max); //ƷĶѵ
object sub_type_temp = itemdataman._edm.get_data_ptr(ess.id_sub_type, ID_SPACE.ID_SPACE_ESSENCE, ref datatype);
if(sub_type_temp == null || datatype != DATA_TYPE.DT_DECORATION_SUB_TYPE)
{
return -1;
}
DECORATION_SUB_TYPE sub_type = (DECORATION_SUB_TYPE)sub_type_temp;
WriteInt(data, ref offset, (int)(sub_type.equip_mask|(addon_num>0?0x40000000:0))); //ƷĿװ־
WriteUInt(data, ref offset, ess.proc_type); //ƷĴʽ
WriteInt(data, ref offset, (int)DATA_TYPE.DT_DECORATION_ESSENCE); //ƷӦID
WriteInt(data, ref offset, (int)DATA_TYPE.DT_DECORATION_ESSENCE); //ƷӦID
if(ess.has_guid == 1){
int g1,g2;
itemdataman.get_item_guid(id,out g1,out g2);
WriteInt(data, ref offset, g1); //ƷӦID guid
WriteInt(data, ref offset, g2); //ƷӦID guid
}
else{
WriteInt(data, ref offset, 0); //ƷӦID guid
WriteInt(data, ref offset, 0); //ƷӦID guid
}
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);
// prerequisition
int require_ptr = offset;
WriteShort(data, ref offset, (short)ess.require_level);
WriteShort(data, ref offset, (short)(ess.character_combo_id&0xFFFF));
WriteShort(data, ref offset, (short)ess.require_strength);
WriteShort(data, ref offset, (short)ess.require_tili);
WriteShort(data, ref offset, (short)ess.require_agility);
WriteShort(data, ref offset, (short)ess.require_energy);
int temp2 = element_data.RandNormal<RAND_CLASS, LOWER>(ess.durability_min, ess.durability_max, cls, LOWER.LOWER_TREND);
int temp;
if(normal_addon != GEN_ADDON_MODE.ADDON_LIST_DROP || (ess.proc_type & 0x1000) != 0)
{
temp = temp2;
}
else
{
temp = element_data.RandNormal<RAND_CLASS, UPPER>(ess.durability_drop_min, ess.durability_drop_max, cls, UPPER.UPPER_TREND);
if(temp > temp2) temp = temp2;
}
WriteInt(data, ref offset, temp); //prerequisition durability
WriteInt(data, ref offset, temp2); //prerequisition max_durability
//߱ǩעǩڱСͱ֮
WriteShort(data, ref offset, (short)Marshal.SizeOf(typeof(DECORATION_ESSENCE))); //װСֽڣ
WriteByte(data, ref offset, tag.type); // MadeFrom
WriteByte(data, ref offset, (byte)tag.size);
//
int essence_ptr = offset;
WriteInt(data, ref offset, element_data.RandNormal<RAND_CLASS, LOWER>(ess.damage_low, ess.damage_high, cls, LOWER.LOWER_TREND)); //int damage;
WriteInt(data, ref offset, element_data.RandNormal<RAND_CLASS, LOWER>(ess.magic_damage_low, ess.magic_damage_high, cls, LOWER.LOWER_TREND)); //int magic_damage;
WriteInt(data, ref offset, element_data.RandNormal<RAND_CLASS, LOWER>(ess.defence_low, ess.defence_high, cls, LOWER.LOWER_TREND)); //int defense;
WriteInt(data, ref offset, element_data.RandNormal<RAND_CLASS, LOWER>(ess.armor_enhance_low, ess.armor_enhance_high, cls, LOWER.LOWER_TREND)); //int armor;
//
int[] res = {0,0,0,0,0};
List<MagicDefence> res_list = ess.magic_defences.ToList<MagicDefence>();
generate_magic_defense(res,res_list,cls,ess.fixed_props!=0);
WriteInt(data, ref offset, res[0]);
WriteInt(data, ref offset, res[1]);
WriteInt(data, ref offset, res[2]);
WriteInt(data, ref offset, res[3]);
WriteInt(data, ref offset, res[4]);
// ׶
WriteShort(data, ref offset, (short)hole_num); //׶Ŀ
WriteShort(data, ref offset, (short)0); //׶
// addon
WriteInt(data, ref offset, (int)addon_num);
int addon_sld = offset;
addon_data addon_data = new addon_data();
prerequisition prerequisition = new prerequisition();
// Read prerequisition from data buffer (where it was written) once before the loop
int require_ptr_copy = require_ptr;
ReadPrerequisition(data, ref require_ptr_copy, out prerequisition);
for(i = 0; i < addon_num; i++)
{
ReadInt(addon_buf, ref addon_sld, out addon_data.id);
ReadAddonData(addon_buf, ref addon_sld, out addon_data);
itemdataman.addon_update_ess_data(addon_data, essence_ptr, Marshal.SizeOf(typeof(_weapon_essence)), prerequisition);
addon_sld += ((addon_data.id & 0x6000)>>13)*sizeof(int)+sizeof(int);
}
itemdataman.update_require_data(ref prerequisition);
int require_ptr_write = require_ptr;
WritePrerequisition(data, ref require_ptr_write, prerequisition);
if(addon_size > 0)
{
Array.Copy(addon_buf, 0, data, offset, (int)addon_size);
offset += (int)addon_size;
}
itemdataman.set_to_classid(DATA_TYPE.DT_DECORATION_ESSENCE, data, -1);
//if id == 335 log all addon data
if(id == 335)
{
BMLogger.Log("Log for item with id: " + id);
for(int j = 0; j < addon_num; j++)
{
ReadInt(addon_buf, ref addon_sld, out addon_data.id);
ReadAddonData(addon_buf, ref addon_sld, out addon_data);
BMLogger.Log("addon_data.id: " + addon_data.id);
}
}
return 0;
}
public static int generate_projectile<RAND_CLASS>(uint id, ID_SPACE idspace, out byte[] data, out uint size, RAND_CLASS cls)
{
DATA_TYPE datatype = DATA_TYPE.DT_INVALID;
data = new byte[0];
size = 0;
object obj = itemdataman._edm.get_data_ptr(id, idspace, ref datatype);
if(obj == null || datatype != DATA_TYPE.DT_PROJECTILE_ESSENCE)
{
return -1;
}
PROJECTILE_ESSENCE ess = (PROJECTILE_ESSENCE)obj;
size = (uint)(Marshal.SizeOf(typeof(item_data)) + Marshal.SizeOf(typeof(_item_content)) + Marshal.SizeOf(typeof(PROJECTILE_ESSENCE)));
byte[] addon_buf = new byte[itemdataman.ELEMENTDATAMAN_MAX_NUM_ADDONS*Marshal.SizeOf(typeof(itemdataman._addon))];
uint addon_num = 4; //ԱĿĿ̶ 4
uint addon_size = 0;
addon_size = itemdataman.generate_equipment_addon_buffer_2(DATA_TYPE.DT_PROJECTILE_ESSENCE, new List<int> { (int)ess.id_addon0, (int)ess.id_addon1, (int)ess.id_addon2, (int)ess.id_addon3 }, addon_buf,0, addon_num);
size += addon_size;
//tag size
size += sizeof(short);
// allocate the buffer with exact length
data = new byte[size];
int offset = 0;
WriteUInt(data, ref offset, id); //ƷģID
WriteUInt(data, ref offset, 1); //Ʒ
WriteUInt(data, ref offset, (uint)ess.pile_num_max); //ƷĶѵ
WriteInt(data, ref offset, (int)(itemdataman.ELEMENTDATAMAN_EQUIP_MASK_PROJECTILE|(addon_num>0?0x40000000:0))); //ƷĿװ־
WriteInt(data, ref offset, (int)ess.proc_type); //ƷĴʽ
WriteInt(data, ref offset, (int)DATA_TYPE.DT_PROJECTILE_ESSENCE); //ƷӦID
if(ess.has_guid == 1){
int g1,g2;
itemdataman.get_item_guid(id,out g1,out g2);
WriteInt(data, ref offset, g1); //ƷӦID guid
WriteInt(data, ref offset, g2); //ƷӦID guid
}
else{
WriteInt(data, ref offset, 0); //ƷӦID guid
WriteInt(data, ref offset, 0); //ƷӦID guid
}
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);
// prerequisition
int require_ptr = offset;
//int6
WriteShort(data, ref offset, 0); //prerequisition level
WriteShort(data, ref offset, -1); // 0xFFFF = -1
WriteShort(data, ref offset, 0);
WriteShort(data, ref offset, 0); //prerequisition strength
WriteShort(data, ref offset, 0); //prerequisition agility
WriteShort(data, ref offset, 0); //prerequisition energy
WriteInt(data, ref offset, 1); //prerequisition durability
WriteInt(data, ref offset, 1); //prerequisition max_durability
WriteShort(data, ref offset, (short)Marshal.SizeOf(typeof(PROJECTILE_ESSENCE))); //װСֽڣ
WriteByte(data, ref offset, (byte)ITEM_MAKE_TAG.IMT_NULL);
WriteByte(data, ref offset, 0);
// projectile_essence
int essence_ptr = offset;
WriteInt(data, ref offset, (int)ess.type); //ҩ
WriteInt(data, ref offset, ess.damage_enhance); //Ĺ
WriteInt(data, ref offset, ess.damage_scale_enhance); //ձӹ
WriteInt(data, ref offset, ess.require_weapon_level_min); //Ҫȼ
WriteInt(data, ref offset, ess.require_weapon_level_max); //Ҫȼ
// ׶
WriteShort(data, ref offset, (short)0);
WriteShort(data, ref offset, (short)0);
// addon
WriteInt(data, ref offset, (int)addon_num);
int addon_sld = offset;
addon_data addon_data = new addon_data();
prerequisition prerequisition = new prerequisition();
// Read prerequisition from data buffer (where it was written) once before the loop
int require_ptr_copy = require_ptr;
ReadPrerequisition(data, ref require_ptr_copy, out prerequisition);
for(int i = 0; i < addon_num; i++)
{
ReadInt(addon_buf, ref addon_sld, out addon_data.id);
ReadAddonData(addon_buf, ref addon_sld, out addon_data);
itemdataman.addon_update_ess_data(addon_data, essence_ptr, Marshal.SizeOf(typeof(_weapon_essence)), prerequisition);
addon_sld += ((addon_data.id & 0x6000)>>13)*sizeof(int)+sizeof(int);
}
itemdataman.update_require_data(ref prerequisition);
int require_ptr_write = require_ptr;
WritePrerequisition(data, ref require_ptr_write, prerequisition);
if(addon_size > 0)
{
Array.Copy(addon_buf, 0, data, offset, (int)addon_size);
offset += (int)addon_size;
}
itemdataman.set_to_classid(DATA_TYPE.DT_PROJECTILE_ESSENCE, data, -1);
return 0;
}
public static int generate_fashion_item<RAND_CLASS>(uint id, ID_SPACE idspace, out byte[] data, out uint size, RAND_CLASS cls, item_tag_t tag)
{
DATA_TYPE datatype = DATA_TYPE.DT_INVALID;
data = new byte[0];
size = 0;
object obj = itemdataman._edm.get_data_ptr(id, idspace, ref datatype);
if(obj == null || datatype != DATA_TYPE.DT_FASHION_ESSENCE)
{
return -1;
}
FASHION_ESSENCE ess = (FASHION_ESSENCE)obj;
size = (uint)(Marshal.SizeOf(typeof(item_data)) + Marshal.SizeOf(typeof(FASHION_ESSENCE)));
//ASSERT(tag_size >= 2);
size += tag.size;
object obj_sub_type = itemdataman._edm.get_data_ptr(ess.id_sub_type, idspace, ref datatype);
if(obj_sub_type == null || datatype != DATA_TYPE.DT_FASHION_SUB_TYPE)
{
return -1;
}
FASHION_SUB_TYPE sub_type = (FASHION_SUB_TYPE)obj_sub_type;
data = new byte[size];
int offset =0;
WriteUInt(data, ref offset, id); //ƷģID
WriteUInt(data, ref offset, 1); //Ʒ
WriteUInt(data, ref offset, (uint)ess.pile_num_max); //ƷĶѵ
WriteUInt(data, ref offset, sub_type.equip_fashion_mask); //ƷĿװ־̶ֵ
WriteInt(data, ref offset, (int)ess.proc_type); //ƷĴʽ
WriteInt(data, ref offset, (int)DATA_TYPE.DT_FASHION_ESSENCE); //ƷӦID
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, 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);
short color = (short)element_data.RandNormal<RAND_CLASS, ANY>(0, 0x7FFF, cls, ANY.ANY_TREND);
WriteShort(data, ref offset, (short)ess.require_level);
WriteShort(data, ref offset, color);
WriteShort(data, ref offset, (short)ess.gender);
WriteByte(data, ref offset, tag.type);
WriteByte(data, ref offset, (byte)tag.size);
itemdataman.set_to_classid(DATA_TYPE.DT_FASHION_ESSENCE, data, -1);
return 0;
}
public static int generate_tasknormalmatter<RAND_CLASS>(uint id, ID_SPACE idspace, out byte[] data, out uint size, RAND_CLASS cls,
GEN_ADDON_MODE normal_addon ,item_tag_t tag,List<int> sa_list = null)
{
@@ -950,6 +1311,51 @@ public static class generate_item_temp
itemdataman.set_to_classid(DATA_TYPE.DT_PET_FOOD_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;
data = new byte[0];
size = 0;
object obj = itemdataman._edm.get_data_ptr(id, idspace, ref datatype);
if(obj == null || datatype != DATA_TYPE.DT_TOWNSCROLL_ESSENCE)
return -1;
TOWNSCROLL_ESSENCE ess = (TOWNSCROLL_ESSENCE)obj;
size = (uint)(Marshal.SizeOf(typeof(item_data)) + Marshal.SizeOf(typeof(TOWNSCROLL_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, 0);
WriteInt(data, ref offset, (int)ess.proc_type);
WriteInt(data, ref offset, (int)DATA_TYPE.DT_TOWNSCROLL_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, 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);
WriteInt(data, ref offset, (int )(ess.use_time * 20)); //ʹʱ
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)
{
@@ -458,6 +458,17 @@ namespace BrewMonster
ret = generate_item_temp.generate_armor(id, ID_SPACE.ID_SPACE_ESSENCE,
out item,out size,SPECIFIC.SPECIFIC_RAND,GEN_ADDON_MODE.ADDON_LIST_SHOP,tag);
break;
case DATA_TYPE.DT_DECORATION_ESSENCE:
ret = generate_item_temp.generate_decoration(id,ID_SPACE.ID_SPACE_ESSENCE,
out item,out size,SPECIFIC.SPECIFIC_RAND,GEN_ADDON_MODE.ADDON_LIST_SHOP,tag);
break;
case DATA_TYPE.DT_PROJECTILE_ESSENCE:
ret = generate_item_temp.generate_projectile(id,ID_SPACE.ID_SPACE_ESSENCE,
out item,out size,SPECIFIC.SPECIFIC_RAND);
break;
case DATA_TYPE.DT_FASHION_ESSENCE:
ret = generate_item_temp.generate_fashion_item(id, ID_SPACE.ID_SPACE_ESSENCE, out item, out size, SPECIFIC.SPECIFIC_RAND, tag);
break;
case DATA_TYPE.DT_TASKNORMALMATTER_ESSENCE:
ret = generate_item_temp.generate_tasknormalmatter(id,ID_SPACE.ID_SPACE_ESSENCE,
out item,out size,SPECIFIC.SPECIFIC_RAND,GEN_ADDON_MODE.ADDON_LIST_SHOP,tag);
@@ -477,6 +488,10 @@ 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_TOWNSCROLL_ESSENCE:
ret = generate_item_temp.generate_townscroll(id, ID_SPACE.ID_SPACE_ESSENCE, out item, out size, SPECIFIC.SPECIFIC_RAND);
break;
default:
ret = -1;
break;
@@ -253,7 +253,12 @@ namespace BrewMonster
+ ByteToStringUtils.ByteArrayToCP936String(file_model_left) + "\n";
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct MagicDefence
{
public int low; // Minimum magic defense
public int high; // Maximum magic defense
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct ARMOR_MAJOR_TYPE
{
@@ -326,12 +331,7 @@ namespace BrewMonster
public int defence_low; // Minimum physical defense
public int defence_high; // Maximum physical defense
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct MagicDefence
{
public int low; // Minimum magic defense
public int high; // Maximum magic defense
}
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public MagicDefence[] magic_defences; // Magic defenses for 5 elements
@@ -495,13 +495,6 @@ namespace BrewMonster
public int defence_low; // Minimum physical defense
public int defence_high; // Maximum physical defense
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct MagicDefence
{
public int low; // Minimum magic defense
public int high; // Maximum magic defense
}
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public MagicDefence[] magic_defences; // Magic defenses for 5 elements
@@ -750,6 +743,7 @@ namespace BrewMonster
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public ushort[] name; // Fashion sub-type name
public string Name => ByteToStringUtils.UshortArrayToCP936String(name);
public uint equip_fashion_mask; // Fashion equipment slot mask
}
@@ -774,6 +768,8 @@ namespace BrewMonster
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_matter; // Matter model file path
public string FileMatter => ByteToStringUtils.ByteArrayToCP936String(file_matter);
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_icon; // Icon file path
@@ -1605,10 +1601,11 @@ namespace BrewMonster
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_matter; // Material file path
public string FileMatter => ByteToStringUtils.ByteArrayToCP936String(file_matter);
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_icon; // Icon file path
public string FileIcon => ByteToStringUtils.ByteArrayToCP936String(file_icon);
public float use_time; // Use time (seconds)
public int price; // Price
@@ -1629,9 +1626,11 @@ namespace BrewMonster
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_matter; // Material file path
public string FileMatter => ByteToStringUtils.ByteArrayToCP936String(file_matter);
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_icon; // Icon file path
public string FileIcon => ByteToStringUtils.ByteArrayToCP936String(file_icon);
public int price; // Price
public int shop_price; // Shop price
@@ -1746,6 +1745,7 @@ namespace BrewMonster
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_icon; // Icon file path
public string FileIcon { get { return ByteToStringUtils.ByteArrayToCP936String(file_icon); } }
public int pile_num_max; // Max stack count
public uint has_guid; // Whether item has GUID
@@ -1762,9 +1762,11 @@ namespace BrewMonster
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_matter; // Material file path
public string FileMatter { get { return ByteToStringUtils.ByteArrayToCP936String(file_matter); } }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_icon; // Icon file path
public string FileIcon { get { return ByteToStringUtils.ByteArrayToCP936String(file_icon); } }
public int price; // Price
public int shop_price; // Shop price
@@ -1854,6 +1856,7 @@ namespace BrewMonster
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public ushort[] name; // name, max 15 chars
public string Name => ByteToStringUtils.UshortArrayToUnicodeString(name);
}
public struct PROJECTILE_ESSENCE
@@ -1866,12 +1869,14 @@ namespace BrewMonster
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_model; // model file path
public string FileModel { get { return ByteToStringUtils.ByteArrayToCP936String(file_model); } }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_matter; // matter file path
public string FileMatter { get { return ByteToStringUtils.ByteArrayToCP936String(file_matter); } }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_icon; // icon file path
public string FileIcon { get { return ByteToStringUtils.ByteArrayToCP936String(file_icon); } }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_firegfx; // fire effect file
@@ -3015,9 +3020,11 @@ namespace BrewMonster
public string FileIcon1 => ByteToStringUtils.ByteArrayToCP936String(file_icon1);
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_icon2; // state 2 icon path
public string FileIcon2 => ByteToStringUtils.ByteArrayToCP936String(file_icon2);
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_icon3; // state 3 icon path
public string FileIcon3 => ByteToStringUtils.ByteArrayToCP936String(file_icon3);
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] file_icon4; // state 4 icon path
@@ -1,19 +1,170 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.IO;
using BrewMonster;
using ModelRenderer.Scripts.Common;
using ModelRenderer.Scripts.GameData;
using UnityEngine;
using PerfectWorld.Scripts.Managers;
using BrewMonster.Network;
using BrewMonster.Scripts.Managers;
using BrewMonster.Scripts;
using CSNetwork.GPDataType;
using System.Runtime.InteropServices;
namespace PerfectWorld.Scripts.Managers
{
/// <summary>
/// Arrow item class (cac loai mui ten)
/// </summary>
public class EC_IvtrArrow : EC_IvtrEquip
{
protected IVTR_ESSENCE_ARROW m_Essence; // Arrow essence data
// Data in database
protected PROJECTILE_TYPE m_pDBType;
protected PROJECTILE_ESSENCE m_pDBEssence;
/// <summary>
/// Not create logic yet (add summary later)
/// Arrow item class (cac loai mui ten)
/// </summary>
/// <param name="tid">Template id</param>
/// <param name="expire_date">Expire date</param>
public EC_IvtrArrow(int tid, int expire_date) : base(tid, expire_date)
{
m_iCID = (int)InventoryClassId.ICID_ARROW;
m_Essence = new IVTR_ESSENCE_ARROW();
// Get database data
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
m_pDBEssence = (PROJECTILE_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
m_pDBType = (PROJECTILE_TYPE)pDB.get_data_ptr((uint)m_pDBEssence.type, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
m_iPileLimit = m_pDBEssence.pile_num_max;
m_iPrice = m_pDBEssence.price;
m_iShopPrice = m_pDBEssence.shop_price;
m_iProcType = (int)m_pDBEssence.proc_type;
m_i64EquipMask = EC_IvtrType.EQUIP_MASK64_PROJECTILE;
}
public EC_IvtrArrow(EC_IvtrArrow other) : base(other)
{
m_pDBType = other.m_pDBType;
m_pDBEssence = other.m_pDBEssence;
m_Essence = other.m_Essence;
}
public override bool SetItemInfo(byte[] pInfoData, int iDataLen)
{
base.SetItemInfo(pInfoData, iDataLen);
if (pInfoData == null || iDataLen == 0)
return true;
try
{
CECDataReader dr = new CECDataReader(pInfoData, iDataLen);
// Skip equip requirements and endurance
dr.Offset(5 * sizeof (int), CECDataReader.SEEK_CUR);
int iEssenceSize = dr.ReadInt();
//ASSERT(iEssenceSize == sizeof (IVTR_ESSENCE_ARROW));
m_Essence = new IVTR_ESSENCE_ARROW(dr.ReadData(iEssenceSize));
}
catch (Exception e)
{
Debug.LogError("CECIvtrArrow::SetItemInfo, data read error (" + e.GetType() + e.StackTrace + ")");
return false;
}
return true;
}
// Get item icon file name
public override string GetIconFile()
{
return m_pDBEssence.FileIcon;
}
// Get item name
public override string GetName()
{
// Try Unicode first (for Vietnamese/wide char names), then fallback to CP936
if (m_pDBEssence.name != null && m_pDBEssence.name.Length > 0)
{
string s = ByteToStringUtils.UshortArrayToUnicodeString(m_pDBEssence.name);
if (!string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
return s;
// Fallback to legacy CP936 if Unicode was empty
s = ByteToStringUtils.UshortArrayToCP936String(m_pDBEssence.name);
if (!string.IsNullOrEmpty(s))
return s;
}
return base.GetName(); // Fallback to base class method
}
// Get item description text
protected override string GetNormalDesc(bool bRepair)
{
if (m_bNeedUpdate)
return "";
// Build addon and refine properties and save it
m_strDesc = "";
BuildAddOnPropDesc(null, null);
string strAddon = m_strDesc;
m_strDesc = "";
// Try to build item description
CECStringTab pDescTab = EC_Game.GetItemDesc();
int white = (int)DescriptipionMsg.ITEMDESC_COL_WHITE;
int namecol = DecideNameCol();
if (m_iCount > 1)
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAMENUMBER), GetName(), m_iCount);
else
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAME), GetName());
AddIDDescText();
AddExpireTimeDesc();
// Weapon requirement
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_WEAPONREQ), m_Essence.iWeaponReqLow,
m_Essence.iWeaponReqHigh, m_pDBType.Name);
// Damage enhance
if (m_pDBEssence.damage_enhance != 0)
{
AddDescText(-1, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_ADDPHYDAMAGE));
AddDescText(-1, true, " %+d", m_pDBEssence.damage_enhance);
}
// Add addon properties
if (strAddon.Length > 0)
m_strDesc += strAddon;
// Price
AddPriceDesc(white, bRepair);
// Suite description
AddSuiteDesc();
// Extend description
AddExtDescText();
return m_strDesc;
}
// Get drop model for shown
public override string GetDropModel()
{
return m_pDBEssence.FileMatter;
}
}
}
File diff suppressed because it is too large Load Diff
@@ -1,8 +1,31 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.IO;
using BrewMonster;
using ModelRenderer.Scripts.Common;
using ModelRenderer.Scripts.GameData;
using UnityEngine;
using PerfectWorld.Scripts.Managers;
using BrewMonster.Network;
using BrewMonster.Scripts.Managers;
using BrewMonster.Scripts;
using CSNetwork.GPDataType;
using System.Runtime.InteropServices;
namespace PerfectWorld.Scripts.Managers
{
public class EC_IvtrFashion : EC_IvtrItem
public class EC_IvtrFashion : EC_IvtrEquip
{
protected int m_iGender; // required gender
protected ushort m_wColor; // color in X1R5G5B5 format
protected uint m_color; // color in X8R8G8B8 format
protected IVTR_ESSENCE_FASHION m_Essence; // Fashion essence data
// Data in database
protected FASHION_MAJOR_TYPE m_pDBMajorType;
protected FASHION_SUB_TYPE m_pDBSubType;
protected FASHION_ESSENCE m_pDBEssence;
/// <summary>
/// Not create logic yet (add summary later)
/// </summary>
@@ -10,10 +33,210 @@ namespace PerfectWorld.Scripts.Managers
/// <param name="expire_date">Expire date</param>
public EC_IvtrFashion(int tid, int expire_date) : base(tid, expire_date)
{
m_iCID = (int)InventoryClassId.ICID_FASHION;
m_Essence = new IVTR_ESSENCE_FASHION();
// Get database data
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
m_pDBEssence = (FASHION_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
m_pDBMajorType = (FASHION_MAJOR_TYPE)pDB.get_data_ptr(m_pDBEssence.id_major_type, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
m_pDBSubType = (FASHION_SUB_TYPE)pDB.get_data_ptr(m_pDBEssence.id_sub_type, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
m_iPileLimit = m_pDBEssence.pile_num_max;
m_iPrice = m_pDBEssence.price;
m_iShopPrice = m_pDBEssence.shop_price;
m_i64EquipMask = m_pDBSubType.equip_fashion_mask;
m_iProcType = (int)m_pDBEssence.proc_type;
// reset the info
DefaultInfo();
}
public EC_IvtrFashion(EC_IvtrFashion other) : base(other)
{
m_pDBEssence = other.m_pDBEssence;
m_pDBMajorType = other.m_pDBMajorType;
m_pDBSubType = other.m_pDBSubType;
m_Essence = other.m_Essence;
m_iGender = other.m_iGender;
m_wColor = other.m_wColor;
m_color = other.m_color;
}
// Set item detail information
public override bool SetItemInfo(byte[] pInfoData, int iDataLen)
{
// Note: because fashion is not an absolute equipment, so skip
// CECIvtrEquip::SetItemInfo().
if (pInfoData == null || iDataLen == 0)
{
m_bNeedUpdate = false;
return true;
}
try
{
CECDataReader dr = new CECDataReader(pInfoData, iDataLen);
var size = Marshal.SizeOf<IVTR_ESSENCE_FASHION>();
m_Essence = new IVTR_ESSENCE_FASHION(dr.ReadData(size));
}
catch (Exception e)
{
Debug.LogError("CECIvtrFashion::SetItemInfo, data read error (" + e.GetType() + e.StackTrace + ")");
return false;
}
LevelReq = m_Essence.require_level;
m_wColor = m_Essence.color;
m_iGender = m_Essence.gender;
m_color = (uint)FASHION_WORDCOLOR_TO_A3DCOLOR(m_wColor).GetHashCode();
m_bNeedUpdate = false;
return true;
}
// Get item default information from database
public override void DefaultInfo()
{
LevelReq = m_pDBEssence.require_level;
m_wColor = 0x7fff;
m_iGender = m_pDBEssence.gender;
m_color = 0xffffffff;
// these data also stored in essence, sync it here
m_Essence.require_level = LevelReq;
m_Essence.color = m_wColor;
m_Essence.gender = (ushort)m_iGender;
}
public static Color FASHION_WORDCOLOR_TO_A3DCOLOR(ushort color)
{
return new Color(((color & (0x1f << 10)) >> 7), ((color & (0x1f << 5)) >> 2), ((color & 0x1f) << 3));
}
public string GetSubTypeName()
{
// Try Unicode first (for Vietnamese/wide char names), then fallback to CP936
if (m_pDBSubType.name != null && m_pDBSubType.name.Length > 0)
{
string s = ByteToStringUtils.UshortArrayToUnicodeString(m_pDBSubType.name);
if (!string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
return s;
// Fallback to legacy CP936 if Unicode was empty
s = ByteToStringUtils.UshortArrayToCP936String(m_pDBSubType.name);
if (!string.IsNullOrEmpty(s))
return s;
}
return "";
}
protected override string GetNormalDesc(bool bRepair)
{
if (m_bNeedUpdate)
return "";
m_strDesc = "";
// Try to build item description
CECStringTab pDescTab = EC_Game.GetItemDesc();
CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer();
int white = (int)DescriptipionMsg.ITEMDESC_COL_WHITE;
int red = (int)DescriptipionMsg.ITEMDESC_COL_RED;
int namecol = DecideNameCol();
// Item name
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAME), GetName());
AddIDDescText();
AddBindDescText();
AddExpireTimeDesc();
// Sub class name
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_CLASSNAME), GetSubTypeName());
// Color
// Use m_iScaleType == SCALE_BUY to judge whether this item is in NPC's pack,
// this may not be a valid way
if (m_pDBEssence.equip_location != (int)enumSkinShow.enumSkinShowArmet && m_pDBEssence.equip_location != (int)enumSkinShow.enumSkinShowHand)
{
if (m_iScaleType == (int)EC_IvtrItem.ScaleType.SCALE_BUY)
{
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_COLOR));
AddDescText(white, true, (" ???"));
}
else
{
// Extract RGB components from m_color (X8R8G8B8 format)
int colorRed = (int)((m_color >> 16) & 0xFF);
int colorGreen = (int)((m_color >> 8) & 0xFF);
int colorBlue = (int)(m_color & 0xFF);
string szCol = string.Format("^{0:X2}{1:X2}{2:X2}", colorRed, colorGreen, colorBlue);
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_COLOR));
m_strDesc += " ";
AddDescText(-1, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_COLORRECT), szCol);
}
}
// Level requirment
if (LevelReq > 0)
{
int lcol = pHost.GetMaxLevelSofar() >= LevelReq ? white : red;
AddDescText(lcol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_LEVELREQ), LevelReq);
}
// fashion weapon profession requirment and weapon action type
if (m_pDBEssence.equip_location == (int)enumSkinShow.enumSkinShowHand)
{
AddDescText(-1, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_LEVEL), m_pDBEssence.level);
AddProfReqDesc(m_pDBEssence.character_combo_id);
AddActionTypeDescText((int)m_pDBEssence.action_type);
}
// Gender requirement
CECStringTab pFixMsg = EC_Game.GetFixedMsgs();
int col = (pHost.GetGender() == m_iGender) ? white : red;
AddDescText(col, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_GENDERREQ));
m_strDesc += " ";
if (m_iGender == (int)GENDER.GENDER_MALE)
AddDescText(col, true, pFixMsg.GetWideString((int)FixedMsg.FIXMSG_GENDER_MALE));
else
AddDescText(col, true, pFixMsg.GetWideString((int)FixedMsg.FIXMSG_GENDER_FEMALE));
// Price
AddPriceDesc(white, bRepair);
// Fashion level
if (m_pDBEssence.level > 0)
{
m_strDesc += "\\r";
m_strDesc += pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_COL_WHITE);
for (int i=0; i < m_pDBEssence.level; i++)
m_strDesc += pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_PENTAGON);
}
// Extend description
AddExtDescText();
return m_strDesc;
}
public bool HasRandomProp()
{
return false;
}
// Get drop model for shown
public override string GetDropModel()
{
return m_pDBEssence.FileMatter;
}
public int GetFashionSuiteID()
{
Dictionary<int, int> suiteEquipTab = EC_Game.GetSuiteEquipTab();
return suiteEquipTab.ContainsKey(TemplateId) ? suiteEquipTab[TemplateId] : 0;
}
}
}
@@ -807,7 +807,8 @@ namespace BrewMonster.Scripts.Managers
var pItem = new EC_IvtrItem(tid, expire_date);
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
object data = ElementDataManProvider.GetElementDataMan().get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
Debug.Log("Create item data: DataType: " + DataType);
//Active this to log the data type of item when creating an item
//Debug.Log("Create item data: DataType: " + DataType + " tid: " + tid );
switch(DataType)
{
case DATA_TYPE.DT_WEAPON_ESSENCE:
@@ -844,7 +845,7 @@ namespace BrewMonster.Scripts.Managers
pItem = new EC_IvtrFlysword(tid, expire_date);
break;
case DATA_TYPE.DT_TOWNSCROLL_ESSENCE:
pItem = new EC_IvtrTownscroll(tid, expire_date);
pItem = new EC_IvtrTownScroll(tid, expire_date);
break;
case DATA_TYPE.DT_UNIONSCROLL_ESSENCE:
pItem = new EC_IvtrUnionscroll(tid, expire_date);
@@ -859,7 +860,7 @@ namespace BrewMonster.Scripts.Managers
pItem = new EC_IvtrTossMat(tid, expire_date);
break;
case DATA_TYPE.DT_TASKMATTER_ESSENCE:
pItem = new EC_IvtrTaskmatter(tid, expire_date);
pItem = new EC_IvtrTaskItem(tid, expire_date);
break;
case DATA_TYPE.DT_STONE_ESSENCE:
pItem = new EC_IvtrStone(tid, expire_date);
@@ -77,7 +77,6 @@ namespace PerfectWorld.Scripts.Managers
CECStringTab pDescTab = EC_Game.GetItemDesc();
int white = (int)DescriptipionMsg.ITEMDESC_COL_WHITE;
int namecol = DecideNameCol();
BMLogger.Log("GetNormalDesc: m_pDBEssence.Name:" + m_pDBEssence.Name + " m_iCount:" + m_iCount);
if (m_iCount > 1)
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAMENUMBER), GetName(), m_iCount);
else
@@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.IO;
using BrewMonster;
using ModelRenderer.Scripts.Common;
using ModelRenderer.Scripts.GameData;
using UnityEngine;
using PerfectWorld.Scripts.Managers;
using BrewMonster.Network;
using BrewMonster.Scripts.Managers;
using BrewMonster.Scripts;
using CSNetwork.GPDataType;
using System.Runtime.InteropServices;
namespace PerfectWorld.Scripts.Managers
{
public class EC_IvtrTaskItem : EC_IvtrItem
{
protected TASKMATTER_ESSENCE m_pDBEssence;
/// <summary>
/// Not create logic yet (add summary later)
/// </summary>
/// <param name="tid">Template id</param>
/// <param name="expire_date">Expire date</param>
public EC_IvtrTaskItem(int tid, int expire_date) : base(tid, expire_date)
{
m_iCID = (int)InventoryClassId.ICID_TASKITEM;
// Get database data
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
m_pDBEssence = (TASKMATTER_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
m_iPileLimit = m_pDBEssence.pile_num_max;
m_iPrice = 0;
m_iShopPrice = 0;
m_iProcType = (int)m_pDBEssence.proc_type;
m_i64EquipMask = 0;
m_bNeedUpdate = false;
}
public EC_IvtrTaskItem(EC_IvtrTaskItem other) : base(other)
{
m_pDBEssence = other.m_pDBEssence;
}
public override bool SetItemInfo(byte[] pInfoData, int iDataLen)
{
base.SetItemInfo(pInfoData, iDataLen);
return true;
}
// Get item icon file name
public override string GetIconFile()
{
return m_pDBEssence.FileIcon;
}
// Get item name
public override string GetName()
{
// Try Unicode first (for Vietnamese/wide char names), then fallback to CP936
if (m_pDBEssence.name != null && m_pDBEssence.name.Length > 0)
{
string s = ByteToStringUtils.UshortArrayToUnicodeString(m_pDBEssence.name);
if (!string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
return s;
// Fallback to legacy CP936 if Unicode was empty
s = ByteToStringUtils.UshortArrayToCP936String(m_pDBEssence.name);
if (!string.IsNullOrEmpty(s))
return s;
}
return base.GetName(); // Fallback to base class method
}
// Get item description text
protected override string GetNormalDesc(bool bRepair)
{
m_strDesc = string.Empty;
// Try to build item description
CECStringTab pDescTab = EC_Game.GetItemDesc();
int white = (int)DescriptipionMsg.ITEMDESC_COL_WHITE;
int namecol = DecideNameCol();
if (m_iCount > 1)
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAMENUMBER), GetName(), m_iCount);
else
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAME), GetName());
AddIDDescText();
AddExpireTimeDesc();
// Task item
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_TASKITEM));
// Extend description
AddExtDescText();
return m_strDesc;
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: ec738837a1a3f40e38926d3365da3df5
@@ -1,20 +1,93 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.IO;
using BrewMonster;
using ModelRenderer.Scripts.Common;
using ModelRenderer.Scripts.GameData;
using UnityEngine;
using PerfectWorld.Scripts.Managers;
using BrewMonster.Network;
using BrewMonster.Scripts.Managers;
using BrewMonster.Scripts;
using CSNetwork.GPDataType;
using System.Runtime.InteropServices;
namespace PerfectWorld.Scripts.Managers
{
/// <summary>
/// Task Normal Matter Item.(non interactable quest item). it is a part of IvtrTaskItem(C++)
/// </summary>
public class EC_IvtrTaskNmMatter : EC_IvtrItem
{
protected TASKNORMALMATTER_ESSENCE m_pDBEssence;
/// <summary>
/// Not create logic yet (add summary later)
/// Constructor for Task Normal Matter Item.
/// </summary>
/// <param name="tid">Template id</param>
/// <param name="expire_date">Expire date</param>
public EC_IvtrTaskNmMatter(int tid, int expire_date) : base(tid, expire_date)
{
m_iCID = (int)InventoryClassId.ICID_TASKNMMATTER;
// Get database data
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
m_pDBEssence = (TASKNORMALMATTER_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
m_iPileLimit = m_pDBEssence.pile_num_max;
m_iPrice = m_pDBEssence.price;
m_iShopPrice = m_pDBEssence.shop_price;
m_iProcType = (int)m_pDBEssence.proc_type;
m_bNeedUpdate = false;
}
public EC_IvtrTaskNmMatter(EC_IvtrTaskNmMatter other) : base(other)
{
m_pDBEssence = other.m_pDBEssence;
}
public override bool SetItemInfo(byte[] pInfoData, int iDataLen)
{
base.SetItemInfo(pInfoData, iDataLen);
return true;
}
// Get item icon file name
public override string GetIconFile()
{
return m_pDBEssence.FileIcon;
}
// Get item description text
protected override string GetNormalDesc(bool bRepair)
{
m_strDesc = string.Empty;
// Try to build item description
CECStringTab pDescTab = EC_Game.GetItemDesc();
int white = (int)DescriptipionMsg.ITEMDESC_COL_WHITE;
int namecol = DecideNameCol();
if (m_iCount > 1)
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAMENUMBER), GetName(), m_iCount);
else
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAME), GetName());
AddIDDescText();
AddExpireTimeDesc();
// Price
AddPriceDesc(white, bRepair);
// Extend description
AddExtDescText();
return m_strDesc;
}
public override string GetDropModel()
{
return m_pDBEssence.FileMatter;
}
}
}
@@ -1,20 +0,0 @@
using BrewMonster.Scripts.Managers;
namespace PerfectWorld.Scripts.Managers
{
public class EC_IvtrTaskmatter : EC_IvtrItem
{
/// <summary>
/// Not create logic yet (add summary later)
/// </summary>
/// <param name="tid">Template id</param>
/// <param name="expire_date">Expire date</param>
public EC_IvtrTaskmatter(int tid, int expire_date) : base(tid, expire_date)
{
}
public EC_IvtrTaskmatter(EC_IvtrTaskmatter other) : base(other)
{
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: ee5181c9a0786409fb452d21d947eab7
@@ -1,20 +1,95 @@
using BrewMonster;
using ModelRenderer.Scripts.GameData;
using BrewMonster.Network;
using BrewMonster.Scripts.Managers;
using BrewMonster.Scripts;
using CSNetwork.GPDataType;
namespace PerfectWorld.Scripts.Managers
{
public class EC_IvtrTownscroll : EC_IvtrItem
/// <summary>
/// Town scroll item class (hoi thanh phu). It is a part of EC_IvtrScroll(c++)
/// TownScroll allow player to teleport to towns inside one map.
/// </summary>
public class EC_IvtrTownScroll : EC_IvtrItem
{
protected TOWNSCROLL_ESSENCE m_pDBEssence;
/// <summary>
/// Not create logic yet (add summary later)
/// Constructor for Town Scroll
/// </summary>
/// <param name="tid">Template id</param>
/// <param name="expire_date">Expire date</param>
public EC_IvtrTownscroll(int tid, int expire_date) : base(tid, expire_date)
public EC_IvtrTownScroll(int tid, int expire_date) : base(tid, expire_date)
{
m_iCID = (int)InventoryClassId.ICID_TOWNSCROLL;
// Get database data
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
m_pDBEssence = (TOWNSCROLL_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
m_iPileLimit = m_pDBEssence.pile_num_max;
m_iPrice = m_pDBEssence.price;
m_iShopPrice = m_pDBEssence.shop_price;
m_iProcType = (int)m_pDBEssence.proc_type;
m_i64EquipMask = 0;
m_bUseable = true;
m_dwUseFlags = (uint)UseCondition.USE_PERSIST;
m_bNeedUpdate = false;
}
public EC_IvtrTownscroll(EC_IvtrTownscroll other) : base(other)
public EC_IvtrTownScroll(EC_IvtrTownScroll other) : base(other)
{
m_pDBEssence = other.m_pDBEssence;
}
public override bool SetItemInfo(byte[] pInfoData, int iDataLen)
{
base.SetItemInfo(pInfoData, iDataLen);
return true;
}
public override string GetIconFile()
{
return m_pDBEssence.FileIcon;
}
// Get item cool time
public int GetCoolTime(ref int piMax)
{
CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer();
return pHost ? pHost.GetCoolTime((int)CoolTimeIndex.GP_CT_TOWNSCROLL, ref piMax) : 0;
}
protected override string GetNormalDesc(bool bRepair)
{
m_strDesc = string.Empty;
// Try to build item description
CECStringTab pDescTab = EC_Game.GetItemDesc();
int white = (int)DescriptipionMsg.ITEMDESC_COL_WHITE;
int namecol = DecideNameCol();
if (m_iCount > 1)
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAMENUMBER), GetName(), m_iCount);
else
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAME), GetName());
AddIDDescText();
AddExpireTimeDesc();
// Price
AddPriceDesc(white, bRepair);
// Extend description
AddExtDescText();
return m_strDesc;
}
// Get drop model for shown
public override string GetDropModel()
{
return m_pDBEssence.FileMatter;
}
}
}
@@ -1,19 +1,104 @@
using BrewMonster;
using ModelRenderer.Scripts.GameData;
using BrewMonster.Network;
using BrewMonster.Scripts.Managers;
using BrewMonster.Scripts;
using CSNetwork.GPDataType;
namespace PerfectWorld.Scripts.Managers
{
/// <summary>
/// Transmit scroll item(Da dich chuyen). It is a part of EC_IvtrConsume(c++)
/// TransmitScroll allow player to teleport to other maps' towns.
/// </summary>
public class EC_IvtrTransmitScroll : EC_IvtrItem
{
protected TRANSMITSCROLL_ESSENCE m_pDBEssence;
/// <summary>
/// Not create logic yet (add summary later)
/// Constructor for Transmit Scroll
/// </summary>
/// <param name="tid">Template id</param>
/// <param name="expire_date">Expire date</param>
public EC_IvtrTransmitScroll(int tid, int expire_date) : base(tid, expire_date)
{
m_iCID = (int)InventoryClassId.ICID_TRANSMITSCROLL;
// Get database data
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
m_pDBEssence = (TRANSMITSCROLL_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
m_iPileLimit = m_pDBEssence.pile_num_max;
m_iPrice = m_pDBEssence.price;
m_iShopPrice = m_pDBEssence.shop_price;
m_iProcType = (int)m_pDBEssence.proc_type;
m_i64EquipMask = 0;
m_bUseable = true;
m_dwUseFlags = (uint)UseCondition.USE_PERSIST;
m_bNeedUpdate = false;
}
public EC_IvtrTransmitScroll(EC_IvtrTransmitScroll other) : base(other)
{
m_pDBEssence = other.m_pDBEssence;
}
public override bool SetItemInfo(byte[] pInfoData, int iDataLen)
{
base.SetItemInfo(pInfoData, iDataLen);
return true;
}
public override string GetIconFile()
{
return m_pDBEssence.FileIcon;
}
public int GetCoolTime(ref int piMax)
{
CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer();
if (!pHost)
return 0;
int iTime = pHost.GetCoolTime((int)CoolTimeIndex.GP_CT_TOWNSCROLL, ref piMax);
return iTime;
}
protected override string GetNormalDesc(bool bRepair)
{
m_strDesc = string.Empty;
// Try to build item description
CECStringTab pDescTab = EC_Game.GetItemDesc();
int white = (int)DescriptipionMsg.ITEMDESC_COL_WHITE;
int namecol = DecideNameCol();
if (m_iCount > 1)
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAMENUMBER), GetName(), m_iCount);
else
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAME), GetName());
AddIDDescText();
AddExpireTimeDesc();
// Price
AddPriceDesc(white, bRepair);
// Extend description
AddExtDescText();
return m_strDesc;
}
// Get drop model for shown
public override string GetDropModel()
{
return m_pDBEssence.FileMatter;
}
// Check item use condition
public override bool CheckUseCondition()
{
if( EC_Game.GetGameRun().GetHostPlayer().IsFighting() )
return false;
return true;
}
}
}
@@ -69,7 +69,6 @@ namespace BrewMonster.Scripts.Managers
public float attack_short_range;
public IVTR_ESSENCE_WEAPON( byte[] data)
{
Debug.Log("IVTR_ESSENCE_WEAPON: data.Length: " + data.Length);
CECDataReader dr = new (data, data.Length);
weapon_type = dr.ReadShort();
weapon_dealy = dr.ReadShort();
@@ -87,12 +86,20 @@ namespace BrewMonster.Scripts.Managers
};
public struct IVTR_ESSENCE_ARROW
{
// TODO : implement data later
// DWORD dwBowMask;
// int iDamage;
// int iDamageScale;
// int iWeaponReqLow;
// int iWeaponReqHigh;
public int dwBowMask;
public int iDamage;
public int iDamageScale;
public int iWeaponReqLow;
public int iWeaponReqHigh;
public IVTR_ESSENCE_ARROW(byte[] data)
{
CECDataReader dr = new (data, data.Length);
dwBowMask = dr.ReadInt();
iDamage = dr.ReadInt();
iDamageScale = dr.ReadInt();
iWeaponReqLow = dr.ReadInt();
iWeaponReqHigh = dr.ReadInt();
}
};
public struct IVTR_ESSENCE_DECORATION
{
@@ -103,7 +110,6 @@ namespace BrewMonster.Scripts.Managers
public int[] resistance;
public IVTR_ESSENCE_DECORATION(byte[] data)
{
Debug.Log("IVTR_ESSENCE_DECORATION: data.Length: " + data.Length);
CECDataReader dr = new (data, data.Length);
damage = dr.ReadInt();
magic_damage = dr.ReadInt();
@@ -141,10 +147,16 @@ namespace BrewMonster.Scripts.Managers
};
public struct IVTR_ESSENCE_FASHION
{
// TODO : implement data later
// int require_level;
// unsigned short color;
// unsigned short gender;
public int require_level;
public ushort color;
public ushort gender;
public IVTR_ESSENCE_FASHION(byte[] data)
{
CECDataReader dr = new (data, data.Length);
require_level = dr.ReadInt();
color = dr.ReadUShort();
gender = dr.ReadUShort();
}
};
public struct IVTR_ESSENCE_FLYSWORD
{
@@ -211,7 +211,6 @@ namespace PerfectWorld.Scripts.Managers
// Get item name
public override string GetName()
{
BMLogger.Log("[THN]EC_IvtrWeapon: GetName: m_pDBEssence.Name: " + m_pDBEssence.Name);
return m_pDBEssence.Name;
}
// Get preview info
@@ -1891,4 +1891,18 @@ namespace BrewMonster
public static byte SKIN_FASHION_FOOT_INDEX = 9;
public static byte NUM_SKIN_INDEX = 10;
}
public enum enumSkinShow
{
enumSkinShowNone = 0,
enumSkinShowUpperBody,
enumSkinShowWrist,
enumSkinShowLowerBody,
enumSkinShowFoot,
enumSkinShowUpperAndLower,
enumSkinShowUpperAndWrist,
enumSkinShowLowerAndFoot,
enumSkinShowUpperLowerAndWrist,
enumSkinShowArmet,
enumSkinShowHand,
};
}
+56 -1
View File
@@ -53,7 +53,6 @@ public class CECNPC : CECObject
[SerializeField] protected NPCVisual npcVisual;
protected static CECStringTab m_ActionNames;
/* public string NameNPC => m_strName;
public string ROLEBASICPROP => m_strName;*/
@@ -69,6 +68,54 @@ public class CECNPC : CECObject
m_pNPCModelPolicy = new CECNPCModelDefaultPolicy(this);
}
// Add this field to CECNPC class
private bool m_bHasRelatedTask = false;
private float _timerCheckTask = 0;
public void UpdateTaskIcon()
{
// Check if npcUI is assigned
if (m_npcUI == null)
{
m_npcUI = GetComponentInChildren<UINPC>();
if (m_npcUI == null) return;
}
// 2. Get Host Player & Interface
var host = CECGameRun.Instance.GetHostPlayer();
if (host == null) return;
var taskInterface = host.GetTaskInterface();
if (taskInterface == null)
{
if (m_bHasRelatedTask) // only update if state changed
{
m_npcUI.SetTaskIconMain(false);
m_bHasRelatedTask = false;
}
return;
}
// Get NPC Template ID
int npcTemplateID = m_NPCInfo.tid;
// Check if there are tasks related to this NPC
bool hasTask = taskInterface.HasTaskRelatedToNPC(npcTemplateID);
// Update icon only if state changed
if (m_bHasRelatedTask != hasTask)
{
m_bHasRelatedTask = hasTask;
m_npcUI.SetTaskIconMain(hasTask);
if (hasTask)
{
Debug.Log($"[Icon] NPC {m_strName} (TID: {npcTemplateID})");
}
}
}
public string GetName()
{
return m_strName;
@@ -180,6 +227,7 @@ public class CECNPC : CECObject
new Vector2(pHost.transform.position.x, pHost.transform.position.z));
}
UpdateTaskIcon();
return true;
}
@@ -513,6 +561,13 @@ public class CECNPC : CECObject
{
StartAdjustTransparency(-1.0f, GetTransparentLimit(), 500);
}
_timerCheckTask += Time.deltaTime;
if (_timerCheckTask > 1.0f)
{
_timerCheckTask = 0;
UpdateTaskIcon();
}
}
private void TickWork_Dead(float deltaTime)
@@ -57,6 +57,8 @@ public class CECNPCServer : CECNPC
transform.position = EC_Utility.ToVector3(info.pos);
StartWork((int)WorkType.WT_NOTHING, (int)WorkID.WORK_STAND);
UpdateTaskIcon();
return true;
}
@@ -300,6 +300,97 @@ namespace BrewMonster.Scripts.Task
return tasks;
}
// Add this method to ATaskTemplMan class if not exists
public List<ATaskTempl> GetAllTopTasks()
{
List<ATaskTempl> topTasks = new List<ATaskTempl>();
// Iterate through all task templates and collect top-level tasks
// Assuming you have a dictionary or collection of all tasks
foreach (var kvp in m_TaskTemplMap) // Replace with your actual collection name
{
var templ = kvp.Value;
if (templ != null && templ.m_pParent == null) // Top-level task has no parent
{
topTasks.Add(templ);
}
}
return topTasks;
}
// Alternative method if you want to check by NPC ID directly
public List<ATaskTempl> GetAvailableTasksForNPC(int npcID)
{
List<ATaskTempl> availableTasks = new List<ATaskTempl>();
foreach (var kvp in m_TaskTemplMap) // Replace with your actual collection name
{
var templ = kvp.Value;
if (templ != null &&
templ.m_pParent == null &&
templ.m_FixedData.m_ulDelvNPC == npcID)
{
availableTasks.Add(templ);
}
}
return availableTasks;
}
// Add this method to ATaskTemplMan class
/// <summary>
/// Get all task templates (for iterating to find available tasks)
/// Lấy tất cả task templates (để duyệt tìm nhiệm vụ có thể nhận)
/// </summary>
public List<ATaskTempl> GetAllTaskTemplates()
{
List<ATaskTempl> allTasks = new List<ATaskTempl>();
// Assuming you have a collection storing all task templates
// Replace m_TaskMap with your actual collection name
if (m_TaskTemplMap != null)
{
foreach (var kvp in m_TaskTemplMap)
{
if (kvp.Value != null)
{
allTasks.Add(kvp.Value);
}
}
}
return allTasks;
}
/// <summary>
/// Get list of tasks delivered by a specific NPC
/// </summary>
public List<ATaskTempl> GetTasksFromNPC(int npcID)
{
var result = new List<ATaskTempl>();
// Check if NPC info map is available
if (m_NPCInfoMap != null && m_NPCInfoMap.TryGetValue((uint)npcID, out var npcInfo))
{
return new List<ATaskTempl>();
}
else
{
// Fallback
foreach (var kvp in m_TaskTemplMap)
{
var templ = kvp.Value;
if (templ != null && templ.m_FixedData.m_ulDelvNPC == npcID)
{
result.Add(templ);
}
}
}
return result;
}
// General method to read a struct from a FileStream
private T ReadStruct<T>(FileStream stream) where T : struct
@@ -1,17 +1,19 @@
using BrewMonster.Managers;
using BrewMonster.Network;
using BrewMonster.Scripts; // For CECNavigateCtrl
using BrewMonster.UI;
using CSNetwork;
using CSNetwork.GPDataType;
using Cysharp.Threading.Tasks;
using PerfectWorld.Scripts.Task;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using BrewMonster.UI;
using CSNetwork;
using Cysharp.Threading.Tasks;
using UnityEngine;
using UnityEngine.Networking;
using System;
using BrewMonster.Scripts; // For CECNavigateCtrl
using static BrewMonster.TASKDICE_ESSENCE;
namespace BrewMonster.Scripts.Task
{
@@ -528,85 +530,164 @@ namespace BrewMonster.Scripts.Task
{
return m_pActiveListBuf;
}
// private void InitActiveTaskList()
// {
// ActiveTaskList pLst = GetActiveTaskList();
// if (pLst == null) return;
//
// ATaskTemplMan pMan = GetTaskTemplMan();
// if (pMan == null) return;
//
// // reset counters
// pLst.m_uTopShowTaskCount = 0;
// pLst.m_uTopHideTaskCount = 0;
// pLst.m_uTitleTaskCount = 0;
//
// byte i = 0;
// while (i < pLst.m_uTaskCount)
// {
// ActiveTaskEntry entry = pLst.m_TaskEntries[i];
// if (entry == null)
// {
// i++;
// continue;
// }
//
// // repair sibling linkage
// if (entry.m_NextSblIndex != (char)0xff)
// {
// ActiveTaskEntry entryNextSbl = pLst.m_TaskEntries[entry.m_NextSblIndex];
// if (entryNextSbl == null || entryNextSbl.m_PrevSblIndex != (char)i)
// {
// entry.m_NextSblIndex = (char)0xff;
// }
// }
//
// // resolve template for top-level entries; children left unresolved in C#
// if (entry.m_ParentIndex == (char)0xff)
// {
// // entry.m_ulTemplAddr = 0u;
// entry.m_ulTemplAddr = pMan.GetTopTaskByID(entry.m_ID) != null ? 1u : 0u;
//
// ATaskTempl topTempl = pMan.GetTopTaskByID(entry.m_ID);
// if (topTempl != null)
// {
// if (topTempl.m_FixedData.m_bHidden)
// pLst.m_uTopHideTaskCount++;
// else if (topTempl.m_FixedData.m_bDisplayInTitleTaskUI)
// pLst.m_uTitleTaskCount++;
// else
// pLst.m_uTopShowTaskCount++;
// }
// }
// else
// {
// entry.m_ulTemplAddr = 0u;
// }
//
// // cap template best-effort (no pointer in managed)
// if (entry.m_uCapTaskId != 0)
// {
// ATaskTempl cap = pMan.GetTopTaskByID(entry.m_uCapTaskId);
// entry.m_ulCapTemplAddr = 0u;
// if (cap == null)
// {
// entry.m_uCapTaskId = 0;
// }
// }
// else
// {
// entry.m_ulCapTemplAddr = 0u;
// }
//
// i++;
// }
//
// // approximate used count
// pLst.m_uUsedCount = pLst.m_uTaskCount;
// }
public void InitActiveTaskList()
// Trong file CECTaskInterface.cs
public bool HasTaskRelatedToNPC(int npcID)
{
// Check tasks is active
ActiveTaskList activeList = GetActiveTaskList();
if (activeList != null && activeList.m_TaskEntries != null)
{
for (int i = 0; i < activeList.m_uTaskCount; i++)
{
var entry = activeList.m_TaskEntries[i];
if (entry == null) continue;
ATaskTempl templ = entry.GetTempl();
if (templ == null) continue;
// Check if this NPC is the target of the task
if (IsNPCTargetOfTask(templ, entry, npcID))
{
return true;
}
}
}
// Check tasks new
ATaskTemplMan taskMan = GetTaskTemplMan();
if (taskMan != null)
{
List<ATaskTempl> npcTasks = taskMan.GetTasksFromNPC(npcID);
if (npcTasks != null)
{
uint ulCurTime = GetCurTime();
foreach (var templ in npcTasks)
{
// Check prerequisite
if (templ.CheckPrerequisite(this, activeList, ulCurTime) == 0)
{
return true;
}
}
}
}
return false;
}
// Check NPC is target of the task
private bool IsNPCTargetOfTask(ATaskTempl templ, ActiveTaskEntry entry, int npcID)
{
var data = templ.m_FixedData;
// Task completed case
if (entry.IsFinished())
{
if (data.m_ulAwardNPC == npcID) return true;
}
else
{
// NPC target
if (data.m_ulNPCMoving == npcID) return true;
// Pos target
if (data.m_ulNPCDestSite == npcID) return true;
// Security target
if (data.m_ulNPCToProtect == npcID) return true;
if (data.m_enumMethod == (ulong)TaskCompletionMethod.enumTMTalkToNPC)
{
if (data.m_ulNPCMoving == 0 && data.m_ulAwardNPC == npcID)
{
return true;
}
}
}
return false;
}
// private void InitActiveTaskList()
// {
// ActiveTaskList pLst = GetActiveTaskList();
// if (pLst == null) return;
//
// ATaskTemplMan pMan = GetTaskTemplMan();
// if (pMan == null) return;
//
// // reset counters
// pLst.m_uTopShowTaskCount = 0;
// pLst.m_uTopHideTaskCount = 0;
// pLst.m_uTitleTaskCount = 0;
//
// byte i = 0;
// while (i < pLst.m_uTaskCount)
// {
// ActiveTaskEntry entry = pLst.m_TaskEntries[i];
// if (entry == null)
// {
// i++;
// continue;
// }
//
// // repair sibling linkage
// if (entry.m_NextSblIndex != (char)0xff)
// {
// ActiveTaskEntry entryNextSbl = pLst.m_TaskEntries[entry.m_NextSblIndex];
// if (entryNextSbl == null || entryNextSbl.m_PrevSblIndex != (char)i)
// {
// entry.m_NextSblIndex = (char)0xff;
// }
// }
//
// // resolve template for top-level entries; children left unresolved in C#
// if (entry.m_ParentIndex == (char)0xff)
// {
// // entry.m_ulTemplAddr = 0u;
// entry.m_ulTemplAddr = pMan.GetTopTaskByID(entry.m_ID) != null ? 1u : 0u;
//
// ATaskTempl topTempl = pMan.GetTopTaskByID(entry.m_ID);
// if (topTempl != null)
// {
// if (topTempl.m_FixedData.m_bHidden)
// pLst.m_uTopHideTaskCount++;
// else if (topTempl.m_FixedData.m_bDisplayInTitleTaskUI)
// pLst.m_uTitleTaskCount++;
// else
// pLst.m_uTopShowTaskCount++;
// }
// }
// else
// {
// entry.m_ulTemplAddr = 0u;
// }
//
// // cap template best-effort (no pointer in managed)
// if (entry.m_uCapTaskId != 0)
// {
// ATaskTempl cap = pMan.GetTopTaskByID(entry.m_uCapTaskId);
// entry.m_ulCapTemplAddr = 0u;
// if (cap == null)
// {
// entry.m_uCapTaskId = 0;
// }
// }
// else
// {
// entry.m_ulCapTemplAddr = 0u;
// }
//
// i++;
// }
//
// // approximate used count
// pLst.m_uUsedCount = pLst.m_uTaskCount;
// }
public void InitActiveTaskList()
{
ActiveTaskList pLst = GetActiveTaskList();
FinishedTaskList pFnsh = GetFinishedTaskList();
@@ -1058,10 +1139,11 @@ namespace BrewMonster.Scripts.Task
// TODO: Expose account total cash on host/session
return 0u;
}
#if _TASK_CLIENT
// Prepare award preview based on task and state
public void GetTaskAwardPreview(uint ulTaskId, ref Task_Award_Preview p, bool bActiveTask=true)
// Prepare award preview based on task and state
public void GetTaskAwardPreview(uint ulTaskId, ref Task_Award_Preview p, bool bActiveTask=true)
{
// Zero and init output
p = default;
@@ -1644,7 +1726,7 @@ namespace BrewMonster.Scripts.Task
{
UnityEngine.Debug.Log($"[CECTaskInterface] OnNewTask: Task {iTaskID} is not a force navigate task (pTempl={pTempl != null}, method={pTempl?.m_FixedData.m_enumMethod})");
}
}
}
public void OnTaskConfirmUpdate()
{
@@ -1676,7 +1758,7 @@ namespace BrewMonster.Scripts.Task
{
UnityEngine.Debug.Log($"[CECTaskInterface] OnCompleteTask: Task {iTaskID} is not a force navigate task");
}
}
}
public void TakeAwayCommonItem(uint ulTemplId, uint ulNum) {}
@@ -1699,7 +1781,7 @@ namespace BrewMonster.Scripts.Task
{
UnityEngine.Debug.Log($"[CECTaskInterface] OnGiveupTask: Task {iTaskID} is not a force navigate task");
}
}
}
// Handle task text click in UI - trigger navigation if it's a force navigate task // 处理任务UI文本点击 - 如果是强制导航任务则触发导航
// This is called when user clicks on task name/link in the task UI // 当用户在任务UI中点击任务名称/链接时调用
@@ -0,0 +1,322 @@
using BrewMonster.Network;
using BrewMonster.Scripts.Managers;
using BrewMonster.Scripts.Task;
using BrewMonster.UI;
using CSNetwork;
using ModelRenderer.Scripts.Common;
using PerfectWorld.Scripts.Managers;
using PerfectWorld.Scripts.Task;
using System;
using System.Collections.Generic;
using System.Text;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace BrewMonster
{
public class DlgInstall : AUIDialog
{
[Header("Slot First")]
[SerializeField] private Transform m_SlotFirstParent;
[SerializeField] private TextMeshProUGUI m_TxtFirstName;
[Header("Slot Second")]
[SerializeField] private Transform m_SlotSecondlParent;
[SerializeField] private TextMeshProUGUI m_TxtSecondName;
[Header("Buttons and Money")]
[SerializeField] private TextMeshProUGUI m_TxtMoney;
[SerializeField] private Button m_BtnInstall;
[SerializeField] private Button m_BtnCancel;
[SerializeField] private Sprite khung_item;
private EC_IvtrItem m_SelectedEquip;
private EC_IvtrItem m_SelectedMaterial;
private int m_FirstInvSlot = -1;
private int m_SecondInvSlot = -1;
public override void Awake()
{
base.Awake();
RegisterDrop(m_SlotFirstParent, OnDropEquip);
RegisterDrop(m_SlotSecondlParent, OnDropMaterial);
RegisterClick(m_SlotFirstParent, OnClickEquipSlot);
RegisterClick(m_SlotSecondlParent, OnClickMaterialSlot);
}
public void OnpenInstall(uint npcId)
{
}
public void CloseInstall()
{
gameObject.SetActive(false);
RestoreInventoryColors();
}
private void RestoreInventoryColors()
{
var canvas = FindFirstObjectByType<Canvas>();
if (canvas == null)
return;
if (m_FirstInvSlot >= 0)
{
var btn = FindInventoryButtonBySlot(m_FirstInvSlot);
SetInventorySlotGray(btn, false);
m_FirstInvSlot = -1;
}
if (m_SecondInvSlot >= 0)
{
var btn = FindInventoryButtonBySlot(m_SecondInvSlot);
SetInventorySlotGray(btn, false);
m_SecondInvSlot = -1;
}
}
private Button FindInventoryButtonBySlot(int slot)
{
var inventoryUI = FindFirstObjectByType<EC_InventoryUI>();
if (inventoryUI == null)
return null;
var field = typeof(EC_InventoryUI)
.GetField("inventoryPackButtons", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
if (field == null)
return null;
var list = field.GetValue(inventoryUI) as List<Button>;
if (list == null || slot < 0 || slot >= list.Count)
return null;
return list[slot];
}
private void RegisterDrop(Transform target, Action<PointerEventData> callback)
{
var trigger = target.GetComponent<EventTrigger>();
if (trigger == null)
trigger = target.gameObject.AddComponent<EventTrigger>();
trigger.triggers.Clear();
var entry = new EventTrigger.Entry
{
eventID = EventTriggerType.Drop
};
entry.callback.AddListener((data) =>
{
callback((PointerEventData)data);
});
trigger.triggers.Add(entry);
}
private void RegisterClick(Transform target, Action<PointerEventData> callback)
{
var trigger = target.GetComponent<EventTrigger>();
if (trigger == null)
trigger = target.gameObject.AddComponent<EventTrigger>();
var entry = new EventTrigger.Entry
{
eventID = EventTriggerType.PointerClick
};
entry.callback.AddListener((data) =>
{
callback((PointerEventData)data);
});
trigger.triggers.Add(entry);
}
private void OnClickEquipSlot(PointerEventData eventData)
{
if (m_SelectedEquip != null)
{
ReturnItemToInventory(m_FirstInvSlot);
ClearEquipSlot();
}
}
private void OnClickMaterialSlot(PointerEventData eventData)
{
if (m_SelectedMaterial != null)
{
ReturnItemToInventory(m_SecondInvSlot);
ClearMaterialSlot();
}
}
private EC_IvtrItem GetItemFromDrag(PointerEventData eventData)
{
if (eventData.pointerDrag == null)
return null;
var btn = eventData.pointerDrag.GetComponent<Button>();
if (btn == null)
return null;
// Slot index
int slotIndex = btn.transform.GetSiblingIndex();
// Inventory package = 0
var host = CECGameRun.Instance?.GetHostPlayer();
if (host == null)
return null;
var inv = host.GetInventory(0);
if (inv == null)
return null;
return inv.GetItem(slotIndex, false);
}
private void OnDropEquip(PointerEventData eventData)
{
if (eventData.pointerDrag == null)
return;
var btn = eventData.pointerDrag.GetComponent<Button>();
if (btn == null)
return;
int slotIndex = btn.transform.GetSiblingIndex();
var item = GetItemFromDrag(eventData);
if (item == null)
return;
EC_IvtrItem detailedItem = EC_IvtrItem.CreateItem(item.m_tid, item.m_expire_date, item.m_iCount);
if (item.Content != null && item.Content.Length > 0)
detailedItem.SetItemInfo(item.Content, item.Content.Length);
else
detailedItem.GetDetailDataFromLocal();
m_SelectedEquip = detailedItem;
m_FirstInvSlot = slotIndex;
m_TxtFirstName.text = detailedItem.GetName();
SetSlotIcon(m_SlotFirstParent, detailedItem);
SetInventorySlotGray(btn, true);
Debug.Log($"[Install] Equipment: {detailedItem.m_tid} from slot {slotIndex}");
}
private void OnDropMaterial(PointerEventData eventData)
{
if (eventData.pointerDrag == null)
return;
var btn = eventData.pointerDrag.GetComponent<Button>();
if (btn == null)
return;
int slotIndex = btn.transform.GetSiblingIndex();
var item = GetItemFromDrag(eventData);
if (item == null)
return;
EC_IvtrItem detailedItem = EC_IvtrItem.CreateItem(item.m_tid, item.m_expire_date, item.m_iCount);
if (item.Content != null && item.Content.Length > 0)
detailedItem.SetItemInfo(item.Content, item.Content.Length);
else
detailedItem.GetDetailDataFromLocal();
m_SelectedMaterial = detailedItem;
m_SecondInvSlot = slotIndex;
m_TxtSecondName.text = detailedItem.GetName();
SetSlotIcon(m_SlotSecondlParent, detailedItem);
SetInventorySlotGray(btn, true);
Debug.Log($"[Install] Material: {detailedItem.m_tid} from slot {slotIndex}");
}
private void SetInventorySlotGray(Button btn, bool gray)
{
if (btn == null)
return;
var img = btn.GetComponent<Image>();
if (img == null)
return;
img.color = gray
? new Color(0.3f, 0.3f, 0.3f, 1f)
: Color.white;
}
private void SetSlotIcon(Transform slot, EC_IvtrItem item)
{
if (slot == null || item == null)
return;
var img = slot.GetComponentInChildren<Image>(true);
if (img == null)
return;
img.sprite = EC_IvtrItemUtils.Instance.ResolveItemIconSprite(item.m_tid);
img.enabled = img.sprite != null;
img.color = Color.white;
img.SetNativeSize();
}
private void ReturnItemToInventory(int slotIndex)
{
if (slotIndex < 0)
return;
var btn = FindInventoryButtonBySlot(slotIndex);
SetInventorySlotGray(btn, false);
}
private void ClearEquipSlot()
{
m_SelectedEquip = null;
m_FirstInvSlot = -1;
m_TxtFirstName.text = "___";
ClearSlotIcon(m_SlotFirstParent);
Debug.Log("[Install] Equipment slot cleared");
}
private void ClearMaterialSlot()
{
m_SelectedMaterial = null;
m_SecondInvSlot = -1;
m_TxtSecondName.text = "___";
ClearSlotIcon(m_SlotSecondlParent);
Debug.Log("[Install] Material slot cleared");
}
private void ClearSlotIcon(Transform slot)
{
if (slot == null)
return;
var img = slot.GetComponentInChildren<Image>(true);
if (img == null)
return;
img.sprite = khung_item;
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0785d9ccbdc425a44b6ae1f4a3afad06
@@ -3403,8 +3403,33 @@ namespace BrewMonster.UI
}
else if (idFunction == (int)SERVICE_TYPE.NPC_INSTALL)
{
pShow1 = m_pAUIManager.GetDialog("Win_Enchase");
pShow2 = m_pAUIManager.GetDialog("Win_Inventory");
if (pCurNPCEssence.HasValue)
{
uint npcID = pCurNPCEssence.Value.id;
DlgInstall dlgInstall = FindFirstObjectByType<DlgInstall>();
if (dlgInstall == null)
{
CECGameUIMan gameUIMan = GetGameUIMan();
DialogScriptTableObject dialogResource = gameUIMan.GetDialogResource();
Canvas canvas = gameUIMan.GetCanvas();
if(dialogResource != null && canvas != null)
{
GameObject ob = dialogResource.GetPrefabDialog("Win_Enchase");
if (ob != null)
{
dlgInstall = GameObject.Instantiate(ob, canvas.transform).GetComponent<DlgInstall>();
}
}
}
if(dlgInstall != null)
{
dlgInstall.OnpenInstall(npcID);
}
}
//pShow1 = m_pAUIManager.GetDialog("Win_Enchase");
//pShow2 = m_pAUIManager.GetDialog("Win_Inventory");
}
else if (idFunction == (int)SERVICE_TYPE.NPC_UNINSTALL)
{
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
@@ -9,6 +10,10 @@ namespace BrewMonster
[SerializeField] private TextMeshProUGUI _nameText;
[SerializeField] private TextMeshProUGUI _healthText;
[SerializeField] private Image _healthImage;
[Header("List Icon Task")]
[SerializeField] private GameObject _iconTaskMain;
// Start is called once before the first execution of Update after the MonoBehaviour is created
public void SetName(string name)
{
@@ -24,5 +29,11 @@ namespace BrewMonster
if(_healthText != null)
_healthText.text = healthText;
}
public void SetTaskIconMain(bool isShow)
{
if(_iconTaskMain != null)
_iconTaskMain.SetActive(isShow);
}
}
}
+2 -3
View File
@@ -11582,13 +11582,12 @@ MonoBehaviour:
detailPanelRoot: {fileID: 1753167144210994885}
detailPanelOffset: {x: 20, y: 0}
hideDetailOnStart: 1
itemInfoRoot: {fileID: 0}
nameText:
legacy: {fileID: 0}
tmp: {fileID: 4926468606842631984}
tmp: {fileID: 7304082661431364846}
descriptionText:
legacy: {fileID: 0}
tmp: {fileID: 0}
tmp: {fileID: 4926468606842631984}
extendedDescText:
legacy: {fileID: 0}
tmp: {fileID: 0}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dcaa1adabe1192947a68c7e0f4edece4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 634 KiB

@@ -0,0 +1,153 @@
fileFormatVersion: 2
guid: d2ab8e4bde76db4478aff9994361b46a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: ChuTuyen_0
rect:
serializedVersion: 2
x: 201
y: 163
width: 618
height: 700
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 42af0f91f2269ff47b862dbb765d32f2
internalID: -338310257
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: f1f78b52002efcf4da3264912e38dddb
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
ChuTuyen_0: -338310257
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 640 KiB

@@ -0,0 +1,130 @@
fileFormatVersion: 2
guid: 7c5f76c428f533d4ca3a449e2bc02ff5
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 568 KiB

@@ -0,0 +1,130 @@
fileFormatVersion: 2
guid: cd36f0d3de378e94caea2807302f7a18
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: de6ac6f2630425044a55299c703670f1
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+85 -4
View File
@@ -49,7 +49,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
namedAnimancer: {fileID: 0}
isDebug: 0
animName1:
--- !u!114 &-5899287755522118344
MonoBehaviour:
@@ -63,11 +62,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: aebb5e19da26bb64c8d5620d35681a2b, type: 3}
m_Name:
m_EditorClassIdentifier:
m_NPCInfo:
nid: 0
tid: 0
vis_tid: 0
m_iMMIndex: 0
m_idAttackTarget: 0
m_npcUI: {fileID: 0}
m_fMoveSpeed: 0
_characterController: {fileID: -1360397627327243963}
isDebug: 0
npcVisual: {fileID: 0}
--- !u!136 &1637622316711963511
CapsuleCollider:
m_ObjectHideFlags: 0
@@ -143,12 +147,13 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3297168817873124018}
m_LocalRotation: {x: 8.102368e-16, y: 1, z: 0.000000046460137, w: -0.000000017439397}
m_LocalRotation: {x: -0.08684798, y: 0.24095127, z: 0.02165367, w: 0.9664011}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5661997413782496610}
- {fileID: 7509779512108699303}
m_Father: {fileID: 8745273338113588215}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@@ -233,6 +238,81 @@ MonoBehaviour:
m_EditorClassIdentifier:
targetCamera: {fileID: 0}
mode: 1
--- !u!1 &5100466107490290627
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7509779512108699303}
- component: {fileID: 397635185778217656}
- component: {fileID: 1609008502916343598}
m_Layer: 0
m_Name: TaskIcon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &7509779512108699303
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5100466107490290627}
m_LocalRotation: {x: 3.7702125e-16, y: -0.97228837, z: -0.23378475, w: 1.5679955e-15}
m_LocalPosition: {x: 0, y: 0, z: 1.2}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8006159455096186264}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 2.36}
m_SizeDelta: {x: 0.5, y: 0.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &397635185778217656
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5100466107490290627}
m_CullTransparentMesh: 1
--- !u!114 &1609008502916343598
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5100466107490290627}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: -338310257, guid: d2ab8e4bde76db4478aff9994361b46a, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &5709911674741944065
GameObject:
m_ObjectHideFlags: 0
@@ -281,6 +361,7 @@ MonoBehaviour:
_nameText: {fileID: 606418994916995261}
_healthText: {fileID: 0}
_healthImage: {fileID: 0}
_iconTaskMain: {fileID: 5100466107490290627}
--- !u!1 &6510845919681767284
GameObject:
m_ObjectHideFlags: 0
@@ -307,7 +388,7 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6510845919681767284}
m_LocalRotation: {x: -0.015657494, y: 0.89469767, z: -0.03145985, w: -0.44528785}
m_LocalRotation: {x: 0.028356783, y: 0.9830809, z: 0.02226828, w: 0.17958853}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0