Load more ItemType
This commit is contained in:
@@ -608,7 +608,140 @@ public static class generate_item_temp
|
||||
itemdataman.set_to_classid(DATA_TYPE.DT_TASKNORMALMATTER_ESSENCE, data, -1);
|
||||
return 0;
|
||||
}
|
||||
public static int generate_medicine<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;
|
||||
int i=0;
|
||||
object obj = itemdataman._edm.get_data_ptr(id, idspace, ref datatype);
|
||||
if(obj == null || datatype != DATA_TYPE.DT_MEDICINE_ESSENCE)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
MEDICINE_ESSENCE ess = (MEDICINE_ESSENCE)obj;
|
||||
|
||||
size = (uint)(Marshal.SizeOf(typeof(item_data)));
|
||||
switch(ess.id_major_type)
|
||||
{
|
||||
case 1794: // ��Ѫ����
|
||||
case 1802: // ��ħ����
|
||||
case 1810: // ��Ѫ��ħ����
|
||||
size += (uint)(Marshal.SizeOf(typeof(uint)) + Marshal.SizeOf(typeof(uint)) + Marshal.SizeOf(typeof(uint)) + Marshal.SizeOf(typeof(int)));
|
||||
break;
|
||||
case 1815: // �ⶾҩ
|
||||
case 2038: // ˲��ⶾҩ
|
||||
size += sizeof(int) + sizeof(int);
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
data = new byte[size];
|
||||
int offset = 0;
|
||||
WriteUInt(data, ref offset, id); //��Ʒ��ģ��ID
|
||||
WriteUInt(data, ref offset, 1); //��Ʒ������
|
||||
WriteInt(data, ref offset, ess.pile_num_max); //��Ʒ�Ķѵ�����
|
||||
WriteInt(data, ref offset, 0); //��Ʒ�Ŀ�װ����־
|
||||
WriteUInt(data, ref offset, ess.proc_type); //��Ʒ�Ĵ�����ʽ
|
||||
WriteInt(data, ref offset, (int)DATA_TYPE.DT_MEDICINE_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);
|
||||
|
||||
switch(ess.id_major_type)
|
||||
{
|
||||
case 1794: // ��Ѫ����
|
||||
if(ess.cool_time < 1000) ess.cool_time *= 100;
|
||||
WriteInt(data, ref offset, ess.hp_add_total);
|
||||
WriteInt(data, ref offset, ess.hp_add_time);
|
||||
WriteInt(data, ref offset, ess.cool_time);
|
||||
WriteInt(data, ref offset, ess.require_level);
|
||||
break;
|
||||
case 1802: // ��ħ����
|
||||
if(ess.cool_time < 1000) ess.cool_time *= 100;
|
||||
WriteInt(data, ref offset, ess.mp_add_total);
|
||||
WriteInt(data, ref offset, ess.mp_add_time);
|
||||
WriteInt(data, ref offset, ess.cool_time);
|
||||
WriteInt(data, ref offset, ess.require_level);
|
||||
break;
|
||||
case 1810: // ��Ѫ��ħ����
|
||||
if(ess.cool_time < 1000) ess.cool_time *= 100;
|
||||
WriteInt(data, ref offset, ess.mp_add_total);
|
||||
WriteInt(data, ref offset, ess.hp_add_total);
|
||||
WriteInt(data, ref offset, ess.cool_time);
|
||||
WriteInt(data, ref offset, ess.require_level);
|
||||
break;
|
||||
case 1815: // �ⶾҩ
|
||||
case 2038: // ˲��ⶾҩ
|
||||
if(ess.cool_time < 1000) ess.cool_time *= 100;
|
||||
WriteInt(data, ref offset, ess.cool_time);
|
||||
WriteInt(data, ref offset, ess.require_level);
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
itemdataman.set_to_classid(DATA_TYPE.DT_MEDICINE_ESSENCE, data, (int)ess.id_major_type);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int generate_material<RAND_CLASS>(uint id, ID_SPACE idspace, out byte[] data, out uint size, RAND_CLASS cls)
|
||||
{
|
||||
DATA_TYPE datatype = DATA_TYPE.DT_INVALID;
|
||||
object obj = itemdataman._edm.get_data_ptr(id, idspace, ref datatype);
|
||||
data = new byte[0];
|
||||
size = 0;
|
||||
if(obj == null || datatype != DATA_TYPE.DT_MATERIAL_ESSENCE)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
MATERIAL_ESSENCE ess = (MATERIAL_ESSENCE)obj;
|
||||
size = (uint)(Marshal.SizeOf(typeof(item_data)));
|
||||
data = new byte[size];
|
||||
int offset = 0;
|
||||
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);
|
||||
}
|
||||
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);
|
||||
|
||||
itemdataman.set_to_classid(DATA_TYPE.DT_MATERIAL_ESSENCE, data, -1);
|
||||
return 0;
|
||||
}
|
||||
#region Write Functions
|
||||
private static void WriteUInt(byte[] buf, ref int offset, uint value)
|
||||
{
|
||||
|
||||
@@ -462,6 +462,12 @@ namespace BrewMonster
|
||||
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);
|
||||
break;
|
||||
case DATA_TYPE.DT_MEDICINE_ESSENCE:
|
||||
ret = generate_item_temp.generate_medicine(id, ID_SPACE.ID_SPACE_ESSENCE, out item, out size, SPECIFIC.SPECIFIC_RAND);
|
||||
break;
|
||||
case DATA_TYPE.DT_MATERIAL_ESSENCE:
|
||||
ret = generate_item_temp.generate_material(id, ID_SPACE.ID_SPACE_ESSENCE, out item, out size, SPECIFIC.SPECIFIC_RAND);
|
||||
break;
|
||||
default:
|
||||
ret = -1;
|
||||
break;
|
||||
|
||||
@@ -55,12 +55,15 @@ namespace BrewMonster
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Weapon sub-type name
|
||||
|
||||
public string Name => ByteToStringUtils.UshortArrayToUnicodeString(name);
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
|
||||
public byte[] file_hitgfx; // Hit effect file path
|
||||
public string FileHitGfx => ByteToStringUtils.ByteArrayToCP936String(file_hitgfx);
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
|
||||
public byte[] file_hitsfx; // Hit sound effect file path
|
||||
|
||||
public string FileHitSfx => ByteToStringUtils.ByteArrayToCP936String(file_hitsfx);
|
||||
public float probability_fastest; // Attack frequency probability: Fastest -0.1
|
||||
public float probability_fast; // Attack frequency probability: Fast -0.05
|
||||
public float probability_normal; // Attack frequency probability: Normal 0
|
||||
@@ -258,6 +261,7 @@ namespace BrewMonster
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Armor major type name
|
||||
public string Name => ByteToStringUtils.UshortArrayToUnicodeString(name);
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
@@ -267,6 +271,7 @@ namespace BrewMonster
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Armor sub-type name
|
||||
public string Name => ByteToStringUtils.UshortArrayToUnicodeString(name);
|
||||
|
||||
public uint equip_mask; // Equipment slot mask
|
||||
}
|
||||
@@ -433,6 +438,8 @@ namespace BrewMonster
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Decoration sub-type name
|
||||
|
||||
public string Name => ByteToStringUtils.UshortArrayToUnicodeString(name);
|
||||
|
||||
public uint equip_mask; // Equipment slot mask
|
||||
}
|
||||
|
||||
@@ -447,16 +454,24 @@ namespace BrewMonster
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Decoration name, max 15 characters
|
||||
|
||||
public string Name => ByteToStringUtils.UshortArrayToUnicodeString(name);
|
||||
|
||||
// Display information
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
|
||||
public byte[] file_model; // Model file path
|
||||
|
||||
public string FileModel => ByteToStringUtils.ByteArrayToCP936String(file_model);
|
||||
|
||||
[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
|
||||
|
||||
public string FileIcon => ByteToStringUtils.ByteArrayToCP936String(file_icon);
|
||||
|
||||
public int level; // Decoration level
|
||||
|
||||
// Equipment requirements
|
||||
@@ -827,6 +842,7 @@ namespace BrewMonster
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Medicine major type name
|
||||
public string Name => ByteToStringUtils.UshortArrayToCP936String(name);
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
@@ -847,13 +863,18 @@ namespace BrewMonster
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Medicine name, max 15 characters
|
||||
public string Name => ByteToStringUtils.UshortArrayToCP936String(name);
|
||||
|
||||
[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
|
||||
|
||||
public string FileIcon => ByteToStringUtils.ByteArrayToCP936String(file_icon);
|
||||
|
||||
public int require_level; // Required level
|
||||
public int cool_time; // Cooldown time (seconds)
|
||||
|
||||
@@ -933,12 +954,18 @@ namespace BrewMonster
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Name, max 15 characters
|
||||
|
||||
public string Name => ByteToStringUtils.UshortArrayToCP936String(name);
|
||||
|
||||
[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
|
||||
|
||||
public string FileIcon => ByteToStringUtils.ByteArrayToCP936String(file_icon);
|
||||
|
||||
public int total_hp; // Total HP recovery
|
||||
public float trigger_amount; // Trigger HP threshold
|
||||
public int cool_time; // Cooldown time (seconds)
|
||||
@@ -959,13 +986,18 @@ namespace BrewMonster
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Name, max 15 characters
|
||||
public string Name => ByteToStringUtils.UshortArrayToCP936String(name);
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
|
||||
public byte[] file_matter; // Matter model file path
|
||||
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
|
||||
|
||||
public string FileIcon => ByteToStringUtils.ByteArrayToCP936String(file_icon);
|
||||
|
||||
public int total_mp; // Total MP recovery
|
||||
public float trigger_amount; // Trigger MP threshold
|
||||
public int cool_time; // Cooldown time (seconds)
|
||||
@@ -1038,6 +1070,7 @@ namespace BrewMonster
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Material major type name
|
||||
public string Name => ByteToStringUtils.UshortArrayToCP936String(name);
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
@@ -1047,6 +1080,7 @@ namespace BrewMonster
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Material sub-type name
|
||||
public string Name => ByteToStringUtils.UshortArrayToCP936String(name);
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
@@ -1058,13 +1092,15 @@ namespace BrewMonster
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // Material name, max 15 characters
|
||||
public string Name => ByteToStringUtils.UshortArrayToCP936String(name);
|
||||
|
||||
[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
|
||||
|
||||
public string FileIcon => ByteToStringUtils.ByteArrayToCP936String(file_icon);
|
||||
public int price; // Base price
|
||||
public int shop_price; // Shop price
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ namespace BrewMonster.Network
|
||||
}
|
||||
public static Dictionary<int, int> GetSuiteEquipTab()
|
||||
{
|
||||
Debug.Log("[EC_Game] GetSuiteEquipTab: " + m_SuiteEquipTab.Count);
|
||||
return m_SuiteEquipTab;
|
||||
}
|
||||
public static bool TryGetItemMsg(int templateId, out int messageId, out int displayMode)
|
||||
|
||||
@@ -64,7 +64,9 @@ using BrewMonster.Scripts;
|
||||
|
||||
namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Armor item class (Mu + Ao + Quan + Giay) / Armor item class (Helmet + Armor + Pants + Boots)
|
||||
/// </summary>
|
||||
public class EC_IvtrArmor : EC_IvtrEquip
|
||||
{
|
||||
//Attributes
|
||||
@@ -75,6 +77,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
protected ARMOR_SUB_TYPE m_pDBSubType;
|
||||
protected ARMOR_ESSENCE m_pDBEssence;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for armor item (Mu + Ao + Quan + Giay) / Constructor for armor item (Helmet + Armor + Pants + Boots)
|
||||
/// </summary>
|
||||
/// <param name="tid">Template id</param>
|
||||
/// <param name="expire_date">Expire date</param>
|
||||
public EC_IvtrArmor(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
m_iCID = (int)InventoryClassId.ICID_ARMOR;
|
||||
@@ -93,6 +100,10 @@ namespace PerfectWorld.Scripts.Managers
|
||||
RepairFee = m_pDBEssence.repairfee;
|
||||
ReputationReq = m_pDBEssence.require_reputation;
|
||||
}
|
||||
/// <summary>
|
||||
/// Copy constructor for armor item (Mu + Ao + Quan + Giay) / Copy constructor for armor item (Helmet + Armor + Pants + Boots)
|
||||
/// </summary>
|
||||
/// <param name="other">Other armor item to copy from</param>
|
||||
public EC_IvtrArmor(EC_IvtrArmor other) : base(other)
|
||||
{
|
||||
m_pDBEssence = other.m_pDBEssence;
|
||||
@@ -382,14 +393,18 @@ namespace PerfectWorld.Scripts.Managers
|
||||
m_strDesc += "\\r";
|
||||
AddIDDescText();
|
||||
AddBindDescText();
|
||||
BMLogger.Log("AddBindDescText: " + m_strDesc);
|
||||
// Is destroying?
|
||||
AddDestroyingDesc((int)m_pDBEssence.id_drop_after_damaged, m_pDBEssence.num_drop_after_damaged);
|
||||
BMLogger.Log("AddDestroyingDesc: " + m_strDesc);
|
||||
AddExpireTimeDesc();
|
||||
BMLogger.Log("AddExpireTimeDesc: " + m_strDesc);
|
||||
// Sub class name
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_CLASSNAME), m_pDBSubType.name.ToString());
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_CLASSNAME), m_pDBSubType.Name);
|
||||
BMLogger.Log("AddDescText: " + m_strDesc);
|
||||
// Weapon level
|
||||
AddDescText(-1, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_LEVEL), m_pDBEssence.level);
|
||||
|
||||
BMLogger.Log("AddDescText: " + m_strDesc);
|
||||
// Physical defence
|
||||
if (m_Essence.defense - aPEEVals[PEEI_PHYDEF] + aRefines[REFINE_PHYDEF] != 0)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrArmorrune : 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_IvtrArmorrune(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrArrow : EC_IvtrEquip
|
||||
{
|
||||
/// <summary>
|
||||
/// Not create logic yet (add summary later)
|
||||
/// </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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,15 +1,174 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Define and Macro
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Reference to External variables and functions
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Local Types and Variables and Global variables
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Local functions
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Implement CECIvtrDecoration
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
using BrewMonster;
|
||||
using ModelRenderer.Scripts.GameData;
|
||||
using System.Collections.Generic;
|
||||
using BrewMonster.Network;
|
||||
using BrewMonster.Scripts.Managers;
|
||||
using BrewMonster.Scripts;
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
using CSNetwork.GPDataType;
|
||||
namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrAutoHp : EC_IvtrItem
|
||||
/// <summary>
|
||||
/// Auto HP item class (tu dong hoi mau). This is a part of CEC_IvtrEquipMatter(C++)
|
||||
/// </summary>
|
||||
public class EC_IvtrAutoHp : EC_IvtrEquip
|
||||
{
|
||||
public IVTR_ESSENCE_AUTOHP m_Essence;
|
||||
|
||||
// Data in database
|
||||
public AUTOHP_ESSENCE m_pDBEssence;
|
||||
/// <summary>
|
||||
/// Constructor for auto HP item (tu dong hoi mau) / Constructor for auto HP item (automatic HP recovery)
|
||||
/// </summary>
|
||||
/// <param name="tid">Template id</param>
|
||||
/// <param name="expire_date">Expire date</param>
|
||||
public EC_IvtrAutoHp(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
m_iCID = (int)InventoryClassId.ICID_AUTOHP;
|
||||
|
||||
// Get database data
|
||||
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
|
||||
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
|
||||
m_pDBEssence = (AUTOHP_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 = (long)EC_IvtrType.EQUIP_MASK64_AUTOHP;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy constructor for auto HP item (tu dong hoi mau) / Copy constructor for auto HP item (automatic HP recovery)
|
||||
/// </summary>
|
||||
/// <param name="other">Other auto HP item to copy from</param>
|
||||
public EC_IvtrAutoHp(EC_IvtrAutoHp other) : base(other)
|
||||
{
|
||||
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);
|
||||
|
||||
m_Essence = new IVTR_ESSENCE_AUTOHP(dr.ReadData(Marshal.SizeOf<IVTR_ESSENCE_AUTOHP>()));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
BMLogger.LogError("CECIvtrAutoHP::SetItemInfo, data read error (" + e.GetType() + ")");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get item icon file name
|
||||
public override string GetIconFile()
|
||||
{
|
||||
return m_pDBEssence.FileIcon;
|
||||
}
|
||||
|
||||
// Get item name
|
||||
public override string GetName()
|
||||
{
|
||||
return m_pDBEssence.Name;
|
||||
}
|
||||
|
||||
|
||||
// Get item description text
|
||||
protected override string GetNormalDesc(bool bRepair)
|
||||
{
|
||||
if (m_bNeedUpdate)
|
||||
return null;
|
||||
|
||||
m_strDesc = string.Empty;
|
||||
|
||||
// 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;
|
||||
|
||||
if (m_iCount > 1)
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAMENUMBER), GetName(), m_iCount);
|
||||
else
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAME), GetName());
|
||||
|
||||
AddIDDescText();
|
||||
|
||||
AddBindDescText();
|
||||
|
||||
AddExpireTimeDesc();
|
||||
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_AUTOHP1), m_Essence.hp_left, m_pDBEssence.total_hp);
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_AUTOHP2), (int)(m_pDBEssence.trigger_amount * 100.0f + 0.5f));
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_COOLTIME), m_pDBEssence.cool_time / 1000);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// Get item cool time
|
||||
public int GetCoolTime(ref int piMax)
|
||||
{
|
||||
CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer();
|
||||
return pHost != null ? pHost.GetCoolTime((int)CoolTimeIndex.GP_CT_AUTOHP, ref piMax) : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,174 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Define and Macro
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Reference to External variables and functions
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Local Types and Variables and Global variables
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Local functions
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Implement CECIvtrDecoration
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
using BrewMonster;
|
||||
using ModelRenderer.Scripts.GameData;
|
||||
using System.Collections.Generic;
|
||||
using BrewMonster.Network;
|
||||
using BrewMonster.Scripts.Managers;
|
||||
using BrewMonster.Scripts;
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
using CSNetwork.GPDataType;
|
||||
namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrAutoMp : EC_IvtrItem
|
||||
/// <summary>
|
||||
/// Auto MP item class (tu dong hoi mana). This is a part of CEC_IvtrEquipMatter(C++)
|
||||
/// </summary>
|
||||
public class EC_IvtrAutoMp : EC_IvtrEquip
|
||||
{
|
||||
public IVTR_ESSENCE_AUTOMP m_Essence;
|
||||
|
||||
// Data in database
|
||||
public AUTOMP_ESSENCE m_pDBEssence;
|
||||
/// <summary>
|
||||
/// Constructor for auto MP item (tu dong hoi mana) / Constructor for auto MP item (automatic MP recovery)
|
||||
/// </summary>
|
||||
/// <param name="tid">Template id</param>
|
||||
/// <param name="expire_date">Expire date</param>
|
||||
public EC_IvtrAutoMp(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
m_iCID = (int)InventoryClassId.ICID_AUTOMP;
|
||||
|
||||
// Get database data
|
||||
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
|
||||
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
|
||||
m_pDBEssence = (AUTOMP_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 = (long)EC_IvtrType.EQUIP_MASK64_AUTOMP;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy constructor for auto MP item (tu dong hoi mana) / Copy constructor for auto MP item (automatic MP recovery)
|
||||
/// </summary>
|
||||
/// <param name="other">Other auto MP item to copy from</param>
|
||||
public EC_IvtrAutoMp(EC_IvtrAutoMp other) : base(other)
|
||||
{
|
||||
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);
|
||||
|
||||
m_Essence = new IVTR_ESSENCE_AUTOMP(dr.ReadData(Marshal.SizeOf<IVTR_ESSENCE_AUTOMP>()));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
BMLogger.LogError("CECIvtrAutoHP::SetItemInfo, data read error (" + e.GetType() + ")");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get item icon file name
|
||||
public override string GetIconFile()
|
||||
{
|
||||
return m_pDBEssence.FileIcon;
|
||||
}
|
||||
|
||||
// Get item name
|
||||
public override string GetName()
|
||||
{
|
||||
return m_pDBEssence.Name;
|
||||
}
|
||||
|
||||
|
||||
// Get item description text
|
||||
protected override string GetNormalDesc(bool bRepair)
|
||||
{
|
||||
if (m_bNeedUpdate)
|
||||
return null;
|
||||
|
||||
m_strDesc = string.Empty;
|
||||
|
||||
// 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;
|
||||
|
||||
if (m_iCount > 1)
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAMENUMBER), GetName(), m_iCount);
|
||||
else
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAME), GetName());
|
||||
|
||||
AddIDDescText();
|
||||
|
||||
AddBindDescText();
|
||||
|
||||
AddExpireTimeDesc();
|
||||
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_AUTOMP1), m_Essence.mp_left, m_pDBEssence.total_mp);
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_AUTOMP2), (int)(m_pDBEssence.trigger_amount * 100.0f + 0.5f));
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_COOLTIME), m_pDBEssence.cool_time / 1000);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// Get item cool time
|
||||
public int GetCoolTime(ref int piMax)
|
||||
{
|
||||
CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer();
|
||||
return pHost != null ? pHost.GetCoolTime((int)CoolTimeIndex.GP_CT_AUTOMP, ref piMax) : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrBible : 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_IvtrBible(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrCertificate : 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_IvtrCertificate(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrCongregate : 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_IvtrCongregate(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrDamagerune : 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_IvtrDamagerune(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -39,7 +39,9 @@ using BrewMonster.Scripts.Managers;
|
||||
using BrewMonster.Scripts;
|
||||
namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Decoration item class (boi + nhan + ) / Decoration item class (various types of decorations)
|
||||
/// </summary>
|
||||
public class EC_IvtrDecoration : EC_IvtrEquip
|
||||
{
|
||||
protected IVTR_ESSENCE_DECORATION m_Essence;
|
||||
@@ -47,6 +49,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
protected DECORATION_SUB_TYPE m_pDBSubType;
|
||||
protected DECORATION_ESSENCE m_pDBEssence;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for decoration item (cac loai trang suc) / Constructor for decoration item (various types of decorations)
|
||||
/// </summary>
|
||||
/// <param name="tid">Template id</param>
|
||||
/// <param name="expire_date">Expire date</param>
|
||||
public EC_IvtrDecoration(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
m_iCID = (int)InventoryClassId.ICID_DECORATION;
|
||||
@@ -66,6 +73,10 @@ namespace PerfectWorld.Scripts.Managers
|
||||
ReputationReq = m_pDBEssence.require_reputation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy constructor for decoration item (cac loai trang suc) / Copy constructor for decoration item (various types of decorations)
|
||||
/// </summary>
|
||||
/// <param name="other">Other decoration item to copy from</param>
|
||||
public EC_IvtrDecoration(EC_IvtrDecoration other) : base(other)
|
||||
{
|
||||
m_pDBEssence = other.m_pDBEssence;
|
||||
@@ -73,7 +84,435 @@ namespace PerfectWorld.Scripts.Managers
|
||||
m_pDBSubType = other.m_pDBSubType;
|
||||
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(6 * sizeof(short), CECDataReader.SEEK_CUR);
|
||||
dr.Offset(2 * sizeof(int), CECDataReader.SEEK_CUR);
|
||||
int iEssenceSize = dr.ReadShort();
|
||||
// Skip maker's information
|
||||
dr.ReadByte();
|
||||
int iMakerLen = dr.ReadByte();
|
||||
dr.Offset(iMakerLen, CECDataReader.SEEK_CUR);
|
||||
byte[] iEssenceData = dr.ReadData(iEssenceSize);
|
||||
m_Essence = new IVTR_ESSENCE_DECORATION(iEssenceData);
|
||||
// ���븽������˵��
|
||||
if(m_pDBEssence.fixed_props != 0 && m_pDBEssence.probability_addon_num0 != 1.0f)
|
||||
{
|
||||
// Get database data
|
||||
elementdataman pDataMan = ElementDataManProvider.GetElementDataMan();
|
||||
CECStringTab PropTab = EC_Game.GetItemExtProp();
|
||||
int i, iSize = 0;
|
||||
for(i=0;i<32;i++)
|
||||
{
|
||||
if(m_pDBEssence.addons[i].id_addon != 0)
|
||||
iSize++;
|
||||
}
|
||||
if(iSize > 0 && Props.Count == 0)
|
||||
{
|
||||
Props.Capacity = iSize;
|
||||
for(i=0;i<32;i++)
|
||||
{
|
||||
if(m_pDBEssence.addons[i].id_addon != 0)
|
||||
{
|
||||
Property Prop = new Property();
|
||||
Prop.Type = (int)m_pDBEssence.addons[i].id_addon;
|
||||
Prop.Embed = false;
|
||||
Prop.Suite = false;
|
||||
Prop.Engraved = false;
|
||||
Prop.Local = false;
|
||||
byte bType = PropTab.GetWideString(Prop.Type) != null ? (byte)0xff : (byte)0xff;
|
||||
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
|
||||
object pData = pDataMan.get_data_ptr(m_pDBEssence.addons[i].id_addon, ID_SPACE.ID_SPACE_ADDON, ref DataType);
|
||||
if (DataType != DATA_TYPE.DT_EQUIPMENT_ADDON)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
EQUIPMENT_ADDON pAddon = (EQUIPMENT_ADDON)pData;
|
||||
Prop.NumParam = pAddon.num_params;
|
||||
for(int j=0; j < Prop.NumParam; j++)
|
||||
{
|
||||
if(j==0)
|
||||
{
|
||||
Prop.Params[0] = pAddon.param1;
|
||||
}
|
||||
else if(j==1)
|
||||
{
|
||||
Prop.Params[1] = pAddon.param2;
|
||||
}
|
||||
else if(j==2)
|
||||
{
|
||||
Prop.Params[2] = pAddon.param3;
|
||||
}
|
||||
}
|
||||
Props.Add(Prop);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch ( System.Exception e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override void DefaultInfo()
|
||||
{
|
||||
LevelReq = m_pDBEssence.require_level;
|
||||
StrengthReq = 0;
|
||||
AgilityReq = 0;
|
||||
ReputationReq = m_pDBEssence.require_reputation;
|
||||
CurEndurance = m_pDBEssence.durability_min * ENDURANCE_SCALE;
|
||||
MaxEndurance = m_pDBEssence.durability_min * ENDURANCE_SCALE;
|
||||
}
|
||||
public override string GetIconFile()
|
||||
{
|
||||
return m_pDBEssence.FileIcon;
|
||||
}
|
||||
// Get item name
|
||||
public override string GetName()
|
||||
{
|
||||
return m_pDBEssence.Name;
|
||||
}
|
||||
public override string GetPreviewInfo()
|
||||
{
|
||||
int[] aPEEVals = new int[MAX_PEEINDEX];
|
||||
int[] aRefines = new int[MAX_REFINEINDEX];
|
||||
for(int i=0; i<MAX_PEEINDEX; i++)
|
||||
aPEEVals[i] = 0;
|
||||
for(int i=0; i<MAX_REFINEINDEX; i++)
|
||||
aRefines[i] = 0;
|
||||
m_strDesc = "";
|
||||
BuildAddOnPropDesc(aPEEVals, aRefines);
|
||||
CECStringTab pDescTab = EC_Game.GetItemDesc();
|
||||
// Add physical damage
|
||||
if (m_Essence.damage - aPEEVals[PEEI_PHYDAMAGE] + aRefines[REFINE_PHYDAMAGE] != 0)
|
||||
{
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, false, EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_PHYDAMAGE));
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, true, " %+d", m_Essence.damage - aPEEVals[PEEI_PHYDAMAGE] + aRefines[REFINE_PHYDAMAGE]);
|
||||
}
|
||||
// Add magic damage
|
||||
if (m_Essence.magic_damage - aPEEVals[PEEI_MAGICDAMAGE] + aRefines[REFINE_MAGICDAMAGE] != 0)
|
||||
{
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, false, EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_MAGICDAMAGE));
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, true, " %+d", m_Essence.magic_damage - aPEEVals[PEEI_MAGICDAMAGE] + aRefines[REFINE_MAGICDAMAGE]);
|
||||
}
|
||||
// Physical defense
|
||||
if (m_Essence.defense - aPEEVals[PEEI_PHYDEF] + aRefines[REFINE_PHYDEF] != 0)
|
||||
{
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, false, EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_PHYDEFENCE));
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, true, " %+d", m_Essence.defense - aPEEVals[PEEI_PHYDEF] + aRefines[REFINE_PHYDEF]);
|
||||
}
|
||||
// Dodge
|
||||
if (m_Essence.armor - aPEEVals[PEEI_DODGE] + aRefines[REFINE_DODGE] != 0)
|
||||
{
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, false, EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_DODGE));
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, true, " %+d", m_Essence.armor - aPEEVals[PEEI_DODGE] + aRefines[REFINE_DODGE]);
|
||||
}
|
||||
//Gold Resistance
|
||||
if (m_Essence.resistance[0] - aPEEVals[PEEI_GOLDDEF] + aRefines[REFINE_GOLDDEF] != 0)
|
||||
{
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, false, EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_GOLDDEFENCE));
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, true, " %+d", m_Essence.resistance[0] - aPEEVals[PEEI_GOLDDEF] + aRefines[REFINE_GOLDDEF]);
|
||||
}
|
||||
//Wood Resistance
|
||||
if (m_Essence.resistance[1] - aPEEVals[PEEI_WOODDEF] + aRefines[REFINE_WOODDEF] != 0)
|
||||
{
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, false, EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_WOODDEFENCE));
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, true, " %+d", m_Essence.resistance[1] - aPEEVals[PEEI_WOODDEF] + aRefines[REFINE_WOODDEF]);
|
||||
}
|
||||
//Water Resistance
|
||||
if (m_Essence.resistance[2] - aPEEVals[PEEI_WATERDEF] + aRefines[REFINE_WATERDEF] != 0)
|
||||
{
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, false, EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_WATERDEFENCE));
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, true, " %+d", m_Essence.resistance[2] - aPEEVals[PEEI_WATERDEF] + aRefines[REFINE_WATERDEF]);
|
||||
}
|
||||
//Fire Resistance
|
||||
if (m_Essence.resistance[3] - aPEEVals[PEEI_FIREDEF] + aRefines[REFINE_FIREDEF] != 0)
|
||||
{
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, false, EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_FIREDEFENCE));
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, true, " %+d", m_Essence.resistance[3] - aPEEVals[PEEI_FIREDEF] + aRefines[REFINE_FIREDEF]);
|
||||
}
|
||||
//Earth Resistance
|
||||
if (m_Essence.resistance[4] - aPEEVals[PEEI_EARTHDEF] + aRefines[REFINE_EARTHDEF] != 0)
|
||||
{
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, false, EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_EARTHDEFENCE));
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, true, " %+d", m_Essence.resistance[4] - aPEEVals[PEEI_EARTHDEF] + aRefines[REFINE_EARTHDEF]);
|
||||
}
|
||||
return m_strDesc;
|
||||
}
|
||||
public override bool GetRefineEffectFor(string strEffect, RefineEffect rhs){
|
||||
strEffect = "";
|
||||
if (!m_bNeedUpdate){
|
||||
switch (rhs.RefineIndex){
|
||||
case REFINE_PHYDAMAGE:
|
||||
strEffect = string.Format("{0}{1} {2}(+{3})",
|
||||
rhs.GetClrAttribute(),
|
||||
EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_PHYDAMAGE),
|
||||
m_Essence.damage - rhs.APEEVals[PEEI_PHYDAMAGE] + rhs.ARefines[REFINE_PHYDAMAGE] + rhs.GetIncEffect(),
|
||||
rhs.GetClrEffect(),
|
||||
rhs.GetIncEffect());
|
||||
break;
|
||||
case REFINE_MAGICDAMAGE:
|
||||
strEffect = string.Format("{0}{1} {2}(+{3})",
|
||||
rhs.GetClrAttribute(),
|
||||
EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_MAGICDAMAGE),
|
||||
m_Essence.magic_damage - rhs.APEEVals[PEEI_MAGICDAMAGE] + rhs.ARefines[REFINE_MAGICDAMAGE] + rhs.GetIncEffect(),
|
||||
rhs.GetClrEffect(),
|
||||
rhs.GetIncEffect());
|
||||
break;
|
||||
case REFINE_PHYDEF:
|
||||
strEffect = string.Format("{0}{1} {2}(+{3})",
|
||||
rhs.GetClrAttribute(),
|
||||
EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_PHYDEFENCE),
|
||||
m_Essence.defense - rhs.APEEVals[PEEI_PHYDEF] + rhs.ARefines[REFINE_PHYDEF] + rhs.GetIncEffect(),
|
||||
rhs.GetClrEffect(),
|
||||
rhs.GetIncEffect());
|
||||
break;
|
||||
case REFINE_DODGE:
|
||||
strEffect = string.Format("{0}{1} {2}(+{3})",
|
||||
rhs.GetClrAttribute(),
|
||||
EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_DODGE),
|
||||
m_Essence.armor - rhs.APEEVals[PEEI_DODGE] + rhs.ARefines[REFINE_DODGE] + rhs.GetIncEffect(),
|
||||
rhs.GetClrEffect(),
|
||||
rhs.GetIncEffect());
|
||||
break;
|
||||
case REFINE_GOLDDEF:
|
||||
strEffect = string.Format("{0}{1} {2}(+{3})",
|
||||
rhs.GetClrAttribute(),
|
||||
EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_GOLDDEFENCE),
|
||||
m_Essence.resistance[0] - rhs.APEEVals[PEEI_GOLDDEF] + rhs.ARefines[REFINE_GOLDDEF] + rhs.GetIncEffect(),
|
||||
rhs.GetClrEffect(),
|
||||
rhs.GetIncEffect());
|
||||
break;
|
||||
case REFINE_WOODDEF:
|
||||
strEffect = string.Format("{0}{1} {2}(+{3})",
|
||||
rhs.GetClrAttribute(),
|
||||
EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_WOODDEFENCE),
|
||||
m_Essence.resistance[1] - rhs.APEEVals[PEEI_WOODDEF] + rhs.ARefines[REFINE_WOODDEF] + rhs.GetIncEffect(),
|
||||
rhs.GetClrEffect(),
|
||||
rhs.GetIncEffect());
|
||||
break;
|
||||
case REFINE_WATERDEF:
|
||||
strEffect = string.Format("{0}{1} {2}(+{3})",
|
||||
rhs.GetClrAttribute(),
|
||||
EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_WATERDEFENCE),
|
||||
m_Essence.resistance[2] - rhs.APEEVals[PEEI_WATERDEF] + rhs.ARefines[REFINE_WATERDEF] + rhs.GetIncEffect(),
|
||||
rhs.GetClrEffect(),
|
||||
rhs.GetIncEffect());
|
||||
break;
|
||||
case REFINE_FIREDEF:
|
||||
strEffect = string.Format("{0}{1} {2}(+{3})",
|
||||
rhs.GetClrAttribute(),
|
||||
EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_FIREDEFENCE),
|
||||
m_Essence.resistance[3] - rhs.APEEVals[PEEI_FIREDEF] + rhs.ARefines[REFINE_FIREDEF] + rhs.GetIncEffect(),
|
||||
rhs.GetClrEffect(),
|
||||
rhs.GetIncEffect());
|
||||
break;
|
||||
case REFINE_EARTHDEF:
|
||||
strEffect = string.Format("{0}{1} {2}(+{3})",
|
||||
rhs.GetClrAttribute(),
|
||||
EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_EARTHDEFENCE),
|
||||
m_Essence.resistance[4] - rhs.APEEVals[PEEI_EARTHDEF] + rhs.ARefines[REFINE_EARTHDEF] + rhs.GetIncEffect(),
|
||||
rhs.GetClrEffect(),
|
||||
rhs.GetIncEffect());
|
||||
break;
|
||||
}
|
||||
}
|
||||
return !string.IsNullOrEmpty(strEffect);
|
||||
}
|
||||
protected override string GetNormalDesc(bool bRepair){
|
||||
if (m_bNeedUpdate)
|
||||
return null;
|
||||
int[] aPEEVals = new int[MAX_PEEINDEX];
|
||||
int[] aRefines = new int[MAX_REFINEINDEX];
|
||||
for(int i=0; i<MAX_PEEINDEX; i++)
|
||||
aPEEVals[i] = 0;
|
||||
for(int i=0; i<MAX_REFINEINDEX; i++)
|
||||
aRefines[i] = 0;
|
||||
m_strDesc = "";
|
||||
BuildAddOnPropDesc(aPEEVals, aRefines);
|
||||
string strAddon = m_strDesc;
|
||||
m_strDesc = "";
|
||||
CECStringTab pDescTab = EC_Game.GetItemDesc();
|
||||
CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer();
|
||||
int white = (int)DescriptipionMsg.ITEMDESC_COL_WHITE;
|
||||
int lblue = (int)DescriptipionMsg.ITEMDESC_COL_LIGHTBLUE;
|
||||
int red = (int)DescriptipionMsg.ITEMDESC_COL_RED;
|
||||
int namecol = DecideNameCol();
|
||||
uint dwPEE = PropEffectEssence();
|
||||
|
||||
AddDescText(namecol, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAME), GetName());
|
||||
|
||||
// Refine level
|
||||
if (RefineLvl > 0)
|
||||
AddDescText(-1, true, "{0} +{1}", pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_LEVEL), RefineLvl);
|
||||
else
|
||||
m_strDesc += "\\r";
|
||||
AddIDDescText();
|
||||
AddBindDescText();
|
||||
// Is destroying?
|
||||
AddDestroyingDesc((int)m_pDBEssence.id_drop_after_damaged, m_pDBEssence.num_drop_after_damaged);
|
||||
AddExpireTimeDesc();
|
||||
// Sub class name
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_CLASSNAME), m_pDBSubType.Name);
|
||||
// Decoration level
|
||||
AddDescText(-1, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_LEVEL), m_pDBEssence.level);
|
||||
|
||||
//add Physical damage
|
||||
if (m_Essence.damage - aPEEVals[PEEI_PHYDAMAGE] + aRefines[REFINE_PHYDAMAGE] != 0)
|
||||
{
|
||||
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_PHYDAMAGE));
|
||||
AddDescText(white, true, " +{0}", m_Essence.damage - aPEEVals[PEEI_PHYDAMAGE] + aRefines[REFINE_PHYDAMAGE]);
|
||||
}
|
||||
//add Magic damage
|
||||
if (m_Essence.magic_damage - aPEEVals[PEEI_MAGICDAMAGE] + aRefines[REFINE_MAGICDAMAGE] != 0)
|
||||
{
|
||||
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_MAGICDAMAGE));
|
||||
AddDescText(white, true, " +{0}", m_Essence.magic_damage - aPEEVals[PEEI_MAGICDAMAGE] + aRefines[REFINE_MAGICDAMAGE]);
|
||||
}
|
||||
// Physical defence
|
||||
if (m_Essence.defense - aPEEVals[PEEI_PHYDEF] + aRefines[REFINE_PHYDEF] != 0)
|
||||
{
|
||||
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_PHYDEFENCE));
|
||||
AddDescText(white, true, " +{0}", m_Essence.defense - aPEEVals[PEEI_PHYDEF] + aRefines[REFINE_PHYDEF]);
|
||||
}
|
||||
// Dodge
|
||||
if (m_Essence.armor - aPEEVals[PEEI_DODGE] + aRefines[REFINE_DODGE] != 0)
|
||||
{
|
||||
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_DODGE));
|
||||
AddDescText(white, true, " +{0}", m_Essence.armor - aPEEVals[PEEI_DODGE] + aRefines[REFINE_DODGE]);
|
||||
}
|
||||
// Gold Resistance
|
||||
if (m_Essence.resistance[0] - aPEEVals[PEEI_GOLDDEF] + aRefines[REFINE_GOLDDEF] != 0)
|
||||
{
|
||||
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_GOLDDEFENCE));
|
||||
AddDescText(white, true, " +{0}", m_Essence.resistance[0] - aPEEVals[PEEI_GOLDDEF] + aRefines[REFINE_GOLDDEF]);
|
||||
}
|
||||
// Wood Resistance
|
||||
if (m_Essence.resistance[1] - aPEEVals[PEEI_WOODDEF] + aRefines[REFINE_WOODDEF] != 0)
|
||||
{
|
||||
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_WOODDEFENCE));
|
||||
AddDescText(white, true, " +{0}", m_Essence.resistance[1] - aPEEVals[PEEI_WOODDEF] + aRefines[REFINE_WOODDEF]);
|
||||
}
|
||||
// Water Resistance
|
||||
if (m_Essence.resistance[2] - aPEEVals[PEEI_WATERDEF] + aRefines[REFINE_WATERDEF] != 0)
|
||||
{
|
||||
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_WATERDEFENCE));
|
||||
AddDescText(white, true, " +{0}", m_Essence.resistance[2] - aPEEVals[PEEI_WATERDEF] + aRefines[REFINE_WATERDEF]);
|
||||
}
|
||||
// Fire Resistance
|
||||
if (m_Essence.resistance[3] - aPEEVals[PEEI_FIREDEF] + aRefines[REFINE_FIREDEF] != 0)
|
||||
{
|
||||
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_FIREDEFENCE));
|
||||
AddDescText(white, true, " +{0}", m_Essence.resistance[3] - aPEEVals[PEEI_FIREDEF] + aRefines[REFINE_FIREDEF]);
|
||||
}
|
||||
// Earth Resistance
|
||||
if (m_Essence.resistance[4] - aPEEVals[PEEI_EARTHDEF] + aRefines[REFINE_EARTHDEF] != 0)
|
||||
{
|
||||
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_EARTHDEFENCE));
|
||||
AddDescText(white, true, " +{0}", m_Essence.resistance[4] - aPEEVals[PEEI_EARTHDEF] + aRefines[REFINE_EARTHDEF]);
|
||||
}
|
||||
// Endurance
|
||||
int col = white;
|
||||
if (CurEndurance == 0)
|
||||
col = red;
|
||||
else if ((dwPEE & PEE_ENDURANCE) != 0)
|
||||
col = lblue;
|
||||
AddDescText(col, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_ENDURANCE));
|
||||
AddDescText(col, true, " {0}/{1}", VisualizeEndurance(CurEndurance), VisualizeEndurance(MaxEndurance));
|
||||
|
||||
// Profession requirement
|
||||
AddProfReqDesc((uint)ProfReq);
|
||||
// Level requirment
|
||||
if (LevelReq != 0)
|
||||
{
|
||||
col = pHost.GetMaxLevelSofar() >= LevelReq ? white : red;
|
||||
AddDescText(col, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_LEVELREQ), LevelReq);
|
||||
}
|
||||
// Strength requirment
|
||||
if (StrengthReq != 0)
|
||||
{
|
||||
col = pHost.GetExtendProps().bs.strength < StrengthReq ? red : ((dwPEE & PEE_STRENGTHREQ) != 0 ? lblue : white);
|
||||
AddDescText(col, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_STRENGTHREQ), StrengthReq);
|
||||
}
|
||||
// Agility requirment
|
||||
if (AgilityReq != 0)
|
||||
{
|
||||
col = pHost.GetExtendProps().bs.agility < AgilityReq ? red : ((dwPEE & PEE_AGILITYREQ) != 0 ? lblue : white);
|
||||
AddDescText(col, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_AGILITYREQ), AgilityReq);
|
||||
}
|
||||
// Vitality requirment
|
||||
if (VitalityReq != 0)
|
||||
{
|
||||
col = pHost.GetExtendProps().bs.vitality < VitalityReq ? red : ((dwPEE & PEE_VITALITYREQ) != 0 ? lblue : white);
|
||||
AddDescText(col, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_VITALITYREQ), VitalityReq);
|
||||
}
|
||||
// Energy requirment
|
||||
if (EnergyReq != 0)
|
||||
{
|
||||
col = pHost.GetExtendProps().bs.energy < EnergyReq ? red : ((dwPEE & PEE_ENERGYREQ) != 0 ? lblue : white);
|
||||
AddDescText(col, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_ENERGYREQ), EnergyReq);
|
||||
}
|
||||
// Reputation requirement
|
||||
AddReputationReqDesc();
|
||||
// Add addon properties
|
||||
if (!string.IsNullOrEmpty(strAddon))
|
||||
m_strDesc += strAddon;
|
||||
// Build tessera description
|
||||
BuildTesseraDesc();
|
||||
if(m_pDBEssence.fixed_props == 0 && m_bIsInNPCPack)
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL2_BRIGHTBLUE, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_HASRANDOM_PROP));
|
||||
// Price
|
||||
AddPriceDesc(white, bRepair);
|
||||
AddSharpenerDesc();
|
||||
AddEngravedDesc();
|
||||
AddMakerDesc();
|
||||
m_strDesc += "\\r";
|
||||
AddSuiteDesc();
|
||||
AddExtDescText();
|
||||
return m_strDesc;
|
||||
}
|
||||
public bool HasRandomProp()
|
||||
{
|
||||
for (int i = 0; i < Props.Count; i++)
|
||||
{
|
||||
if (!Props[i].Embed && !Props[i].Engraved && Props[i].Type == 472)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public int GetRefineMaterialNum()
|
||||
{
|
||||
return m_pDBEssence.material_need;
|
||||
}
|
||||
public override uint GetRefineAddOn()
|
||||
{
|
||||
return (uint)m_pDBEssence.levelup_addon;
|
||||
}
|
||||
public override string GetDropModel()
|
||||
{
|
||||
return m_pDBEssence.FileMatter;
|
||||
}
|
||||
public override bool IsRare()
|
||||
{
|
||||
return base.IsRare() || m_pDBEssence.level >= 6;
|
||||
}
|
||||
public override int GetItemLevel()
|
||||
{
|
||||
return m_pDBEssence.level;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrDestroyingEssence : 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_IvtrDestroyingEssence(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrDoubleExp : 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_IvtrDoubleExp(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrDyeTicket : 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_IvtrDyeTicket(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrDynSkillEquip : EC_IvtrEquip
|
||||
{
|
||||
/// <summary>
|
||||
/// Not create logic yet (add summary later)
|
||||
/// </summary>
|
||||
/// <param name="tid">Template id</param>
|
||||
/// <param name="expire_date">Expire date</param>
|
||||
public EC_IvtrDynSkillEquip(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrElement : 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_IvtrElement(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2346,106 +2346,20 @@ namespace PerfectWorld.Scripts.Managers
|
||||
/// </summary>
|
||||
protected override void AddDescText(int color, bool newLine, string format, params object[] args)
|
||||
{
|
||||
// Add color prefix if color is specified
|
||||
if (color >= 0)
|
||||
{
|
||||
string colorStr = GetColorString((DescriptipionMsg)color);
|
||||
m_strDesc += colorStr;
|
||||
}
|
||||
|
||||
if (args.Length > 0)
|
||||
{
|
||||
// Accept both C#-style ("{0}") and printf-style ("%d", "%+d", "%.2f", "%%") formats
|
||||
string output;
|
||||
if (format.IndexOf('%') >= 0 && format.IndexOf('{') < 0)
|
||||
{
|
||||
output = FormatPrintfLike(format, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
output = string.Format(format, args);
|
||||
}
|
||||
m_strDesc += output;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_strDesc += format;
|
||||
}
|
||||
// Call base implementation for format conversion (handles both {0} and %d styles)
|
||||
base.AddDescText(-1, false, format, args);
|
||||
|
||||
// Add newline if requested (base class uses "\n", but equip uses "\\r")
|
||||
if (newLine)
|
||||
m_strDesc += "\\r";
|
||||
}
|
||||
|
||||
private static string FormatPrintfLike(string fmt, object[] args)
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||
int argIndex = 0;
|
||||
for (int i = 0; i < fmt.Length; i++)
|
||||
{
|
||||
char c = fmt[i];
|
||||
if (c != '%')
|
||||
{
|
||||
sb.Append(c);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i + 1 < fmt.Length && fmt[i + 1] == '%')
|
||||
{
|
||||
sb.Append('%');
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
bool plus = false;
|
||||
int precision = -1;
|
||||
int j = i + 1;
|
||||
if (j < fmt.Length && fmt[j] == '+') { plus = true; j++; }
|
||||
if (j < fmt.Length && fmt[j] == '.')
|
||||
{
|
||||
// precision like %.2f
|
||||
j++;
|
||||
int start = j;
|
||||
while (j < fmt.Length && char.IsDigit(fmt[j])) j++;
|
||||
int.TryParse(fmt.Substring(start, j - start), out precision);
|
||||
}
|
||||
|
||||
if (j < fmt.Length)
|
||||
{
|
||||
char spec = fmt[j];
|
||||
if (spec == 'd')
|
||||
{
|
||||
object val = argIndex < args.Length ? args[argIndex++] : 0;
|
||||
long iv = Convert.ToInt64(val);
|
||||
string s = iv.ToString();
|
||||
if (plus && iv >= 0) s = "+" + s;
|
||||
sb.Append(s);
|
||||
i = j;
|
||||
continue;
|
||||
}
|
||||
else if (spec == 'f')
|
||||
{
|
||||
object val = argIndex < args.Length ? args[argIndex++] : 0.0;
|
||||
double dv = Convert.ToDouble(val);
|
||||
string s = precision >= 0 ? dv.ToString("F" + precision) : dv.ToString("F");
|
||||
if (plus && dv >= 0) s = "+" + s;
|
||||
sb.Append(s);
|
||||
i = j;
|
||||
continue;
|
||||
}
|
||||
else if (spec == 's')
|
||||
{
|
||||
object val = argIndex < args.Length ? args[argIndex++] : "";
|
||||
string s = val != null ? val.ToString() : "";
|
||||
sb.Append(s);
|
||||
i = j;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: treat '%' as literal if format not recognized
|
||||
sb.Append('%');
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get color string for color ID
|
||||
@@ -4277,8 +4191,8 @@ namespace PerfectWorld.Scripts.Managers
|
||||
|
||||
if (!bShowDetail)
|
||||
{
|
||||
m_strDesc = "\\r\\r";
|
||||
AddDescText(iNameCol, true, "{0} {1}/{2}", pSuiteEss.Name, 0, pSuiteEss.max_equips);
|
||||
m_strDesc = "";
|
||||
AddDescText(iNameCol, false, "{0} {1}/{2}", pSuiteEss.Name, 0, pSuiteEss.max_equips);
|
||||
m_strDesc = strCurDesc + m_strDesc;
|
||||
return;
|
||||
}
|
||||
@@ -4310,7 +4224,7 @@ namespace PerfectWorld.Scripts.Managers
|
||||
iItemCnt = hostPlayer.GetEquippedSuiteItem(idSuite,ref aEquipped);
|
||||
if(iItemCnt == 0) return;
|
||||
|
||||
m_strDesc += "\\r\\r";
|
||||
//m_strDesc += "\\r\\r";
|
||||
// Build suite addon properties at first
|
||||
for (int i = 0; i < MAX_NUM; i++)
|
||||
{
|
||||
@@ -4392,7 +4306,7 @@ namespace PerfectWorld.Scripts.Managers
|
||||
AddDescText(red, true, GetItemDescString(DescriptipionMsg.ITEMDESC_EQUIP_DESTROYING));
|
||||
|
||||
AddDescText(red, true, GetItemDescString(DescriptipionMsg.ITEMDESC_EQUIP_REPAIR_NEED_ITEM), essenceName);
|
||||
AddDescText(red, true, GetItemDescString(DescriptipionMsg.ITEMDESC_EQUIP_REPAIR_NEED_ITEMCNT), (int)(Math.Ceiling(num * 1.2)));
|
||||
AddDescText(red, true, GetItemDescString(DescriptipionMsg.ITEMDESC_EQUIP_REPAIR_NEED_ITEMCNT), (int)Math.Ceiling(num * 1.2));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -4647,7 +4561,7 @@ namespace PerfectWorld.Scripts.Managers
|
||||
if (string.IsNullOrEmpty(Maker))
|
||||
return;
|
||||
|
||||
m_strDesc += "\\r";
|
||||
m_strDesc += "\\r";
|
||||
// For signed marks (IMT_SIGN), Maker already contains color codes and formatted text.
|
||||
if (MadeFrom == (byte)ITEM_MAKE_TAG.IMT_SIGN)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrFacePill : 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_IvtrFacePill(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrFaceTicket : 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_IvtrFaceTicket(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrFactionMaterial : 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_IvtrFactionMaterial(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrFashion : 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_IvtrFashion(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrFirework : 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_IvtrFirework(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrFlysword : 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_IvtrFlysword(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrForceToken : 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_IvtrForceToken(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrGeneralCard : 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_IvtrGeneralCard(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrGeneralCardDice : 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_IvtrGeneralCardDice(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrGmGenerator : 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_IvtrGmGenerator(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrGoblin : 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_IvtrGoblin(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrGoblinEquip : EC_IvtrEquip
|
||||
{
|
||||
/// <summary>
|
||||
/// Not create logic yet (add summary later)
|
||||
/// </summary>
|
||||
/// <param name="tid">Template id</param>
|
||||
/// <param name="expire_date">Expire date</param>
|
||||
public EC_IvtrGoblinEquip(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrGoblinExpPill : 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_IvtrGoblinExpPill(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrIncSkillAbility : 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_IvtrIncSkillAbility(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -807,7 +807,7 @@ 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("DataType: " + DataType);
|
||||
Debug.Log("Create item data: DataType: " + DataType);
|
||||
switch(DataType)
|
||||
{
|
||||
case DATA_TYPE.DT_WEAPON_ESSENCE:
|
||||
@@ -1199,9 +1199,11 @@ namespace BrewMonster.Scripts.Managers
|
||||
/// <summary>Add item amount. Returns new amount of item.</summary>
|
||||
public int AddAmount(int iAmount)
|
||||
{
|
||||
Debug.Log($"[EC_IvtrItem] Old Amount: {m_iCount}");
|
||||
m_iCount += iAmount;
|
||||
if (m_iCount < 0) m_iCount = 0;
|
||||
if (m_iCount > m_iPileLimit) m_iCount = m_iPileLimit;
|
||||
//if (m_iCount > m_iPileLimit) m_iCount = m_iPileLimit;
|
||||
Debug.Log($"[EC_IvtrItem] New Amount: {m_iCount}");
|
||||
return m_iCount;
|
||||
}
|
||||
|
||||
@@ -1383,6 +1385,8 @@ namespace BrewMonster.Scripts.Managers
|
||||
CECStringTab pDescTab = EC_Game.GetItemDesc();
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_ERRORITEM));
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_WHITE, false, "({0})", m_tid);
|
||||
m_strDesc += "\\r";
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL_RED, false, "This Item Type is not implemented yet. Type of {0}", this.GetType().Name);
|
||||
|
||||
TrimLastReturn();
|
||||
return m_strDesc;
|
||||
@@ -1401,9 +1405,63 @@ namespace BrewMonster.Scripts.Managers
|
||||
protected virtual void AddPriceDesc(int col, bool bRepair)
|
||||
{
|
||||
// Basic price string using scaled price; color is ignored at this level.
|
||||
int price = GetScaledPrice();
|
||||
if (price <= 0) return;
|
||||
AddDescText(col, true, "Price: {0}", price);
|
||||
if ((!IsEquipment() && bRepair) || m_iPrice == 0 || m_fPriceScale == 0.0f)
|
||||
{
|
||||
TrimLastReturn();
|
||||
return;
|
||||
}
|
||||
|
||||
// use specific color for the item price
|
||||
if((int)DescriptipionMsg.ITEMDESC_COL_WHITE == col)
|
||||
{
|
||||
if( m_iPrice >= 100000000) // 100 million
|
||||
col = (int)DescriptipionMsg.ITEMDESC_COL_GREEN;
|
||||
else if ( m_iPrice >= 10000000) // 10 million
|
||||
col = (int)DescriptipionMsg.ITEMDESC_COL_DARKGOLD;
|
||||
else if ( m_iPrice >= 1000000) // 1 million
|
||||
col = (int)DescriptipionMsg.ITEMDESC_COL_YELLOW;
|
||||
}
|
||||
|
||||
CECStringTab pDescTab = EC_Game.GetItemDesc();
|
||||
if (m_iScaleType == (int)ScaleType.SCALE_OFFLINESHOP)
|
||||
{
|
||||
AddDescText(col, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_PRICE));
|
||||
|
||||
string s1,s2;
|
||||
BuildPriceNumberStr(m_iPrice, out s1);
|
||||
if (GetCount()>1)
|
||||
{
|
||||
s2 = (m_iPrice * (long)GetCount()).ToString();
|
||||
AddDescText(-1, false, " %s (%s)", s1, s2);
|
||||
}
|
||||
else
|
||||
AddDescText(-1, false, " %s", s1);
|
||||
}
|
||||
else if (m_iScaleType == (int)ScaleType.SCALE_BOOTH || m_tid == 21652) // 21651: yinpiao
|
||||
{
|
||||
string s1;
|
||||
BuildPriceNumberStr(m_iPrice, out s1);
|
||||
|
||||
AddDescText(col, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_UNITPRICE));
|
||||
AddDescText(-1, false, " %s", s1);
|
||||
}
|
||||
else if (m_iScaleType == (int)ScaleType.SCALE_SELL && m_iCount > 1 && m_tid != 21652)
|
||||
{
|
||||
string s1, s2;
|
||||
BuildPriceNumberStr(m_iPrice, out s1);
|
||||
BuildPriceNumberStr(GetScaledPrice(), out s2);
|
||||
|
||||
AddDescText(col, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_PRICE));
|
||||
AddDescText(-1, false, " %s (%s)", s1, s2);
|
||||
}
|
||||
else
|
||||
{
|
||||
string s1;
|
||||
BuildPriceNumberStr(GetScaledPrice(), out s1);
|
||||
|
||||
AddDescText(col, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_PRICE));
|
||||
AddDescText(-1, false, " %s", s1);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void AddProfReqDesc(uint iProfReq)
|
||||
@@ -1445,12 +1503,104 @@ namespace BrewMonster.Scripts.Managers
|
||||
|
||||
protected virtual void AddDescText(int iCol, bool bRet, string szText, params object[] args)
|
||||
{
|
||||
string line = (args != null && args.Length > 0) ? string.Format(szText, args) : szText;
|
||||
string line;
|
||||
if (args != null && args.Length > 0)
|
||||
{
|
||||
// Accept both C#-style ("{0}") and printf-style ("%d", "%+d", "%.2f", "%%") formats
|
||||
if (szText.IndexOf('%') >= 0 && szText.IndexOf('{') < 0)
|
||||
{
|
||||
line = FormatPrintfLike(szText, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
line = string.Format(szText, args);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
line = szText;
|
||||
}
|
||||
m_strDesc += line;
|
||||
if (bRet)
|
||||
m_strDesc += "\n";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Format string using printf-style format specifiers (%d, %+d, %.2f, %s, etc.)
|
||||
/// Converts printf-style formats to C# string formatting
|
||||
/// </summary>
|
||||
private static string FormatPrintfLike(string fmt, object[] args)
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||
int argIndex = 0;
|
||||
for (int i = 0; i < fmt.Length; i++)
|
||||
{
|
||||
char c = fmt[i];
|
||||
if (c != '%')
|
||||
{
|
||||
sb.Append(c);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i + 1 < fmt.Length && fmt[i + 1] == '%')
|
||||
{
|
||||
sb.Append('%');
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
bool plus = false;
|
||||
int precision = -1;
|
||||
int j = i + 1;
|
||||
if (j < fmt.Length && fmt[j] == '+') { plus = true; j++; }
|
||||
if (j < fmt.Length && fmt[j] == '.')
|
||||
{
|
||||
// precision like %.2f
|
||||
j++;
|
||||
int start = j;
|
||||
while (j < fmt.Length && char.IsDigit(fmt[j])) j++;
|
||||
int.TryParse(fmt.Substring(start, j - start), out precision);
|
||||
}
|
||||
|
||||
if (j < fmt.Length)
|
||||
{
|
||||
char spec = fmt[j];
|
||||
if (spec == 'd')
|
||||
{
|
||||
object val = argIndex < args.Length ? args[argIndex++] : 0;
|
||||
long iv = Convert.ToInt64(val);
|
||||
string s = iv.ToString();
|
||||
if (plus && iv >= 0) s = "+" + s;
|
||||
sb.Append(s);
|
||||
i = j;
|
||||
continue;
|
||||
}
|
||||
else if (spec == 'f')
|
||||
{
|
||||
object val = argIndex < args.Length ? args[argIndex++] : 0.0;
|
||||
double dv = Convert.ToDouble(val);
|
||||
string s = precision >= 0 ? dv.ToString("F" + precision) : dv.ToString("F");
|
||||
if (plus && dv >= 0) s = "+" + s;
|
||||
sb.Append(s);
|
||||
i = j;
|
||||
continue;
|
||||
}
|
||||
else if (spec == 's')
|
||||
{
|
||||
object val = argIndex < args.Length ? args[argIndex++] : "";
|
||||
string s = val != null ? val.ToString() : "";
|
||||
sb.Append(s);
|
||||
i = j;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: treat '%' as literal if format not recognized
|
||||
sb.Append('%');
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
// Add extend description to description string / 添加扩展描述到描述字符串
|
||||
protected void AddExtDescText()
|
||||
{
|
||||
@@ -1467,22 +1617,9 @@ namespace BrewMonster.Scripts.Managers
|
||||
var pDescTab = EC_Game.GetItemDesc();
|
||||
// Note: ITEMDESC_COL2_BRIGHTBLUE constant - adjust based on actual string table / 注意:ITEMDESC_COL2_BRIGHTBLUE常量 - 根据实际字符串表调整
|
||||
int green = (int)DescriptipionMsg.ITEMDESC_COL2_BRIGHTBLUE; // ITEMDESC_COL2_BRIGHTBLUE placeholder - adjust this value
|
||||
if(typeof(EC_IvtrArmor) == this.GetType())
|
||||
{
|
||||
Debug.Log("This is an armor");
|
||||
}
|
||||
|
||||
Debug.Log("armor m_iCID: " + m_iCID);
|
||||
Debug.Log("armor m_iProcType: " + m_iProcType);
|
||||
|
||||
if (m_iCID != (int)InventoryClassId.ICID_GOBLIN) // goblin does not need to display these special properties / 地精不需要显示这些特殊属性
|
||||
{
|
||||
Debug.Log("m_iCID != (int)InventoryClassId.ICID_GOBLIN");
|
||||
Debug.Log("m_iProcType: " + m_iProcType);
|
||||
Debug.Log("m_iProcType & (int)ProcType.PROC_NO_USER_TRASH: " + (m_iProcType & (int)ProcType.PROC_NO_USER_TRASH));
|
||||
Debug.Log("!((m_iProcType & (int)ProcType.PROC_BINDING) != 0): " + !((m_iProcType & (int)ProcType.PROC_BINDING) != 0));
|
||||
Debug.Log("((m_iProcType & (int)ProcType.PROC_DROPWHENDIE) != 0): " + ((m_iProcType & (int)ProcType.PROC_DROPWHENDIE) != 0));
|
||||
Debug.Log("((m_iProcType & (int)ProcType.PROC_DROPPABLE) != 0): " + ((m_iProcType & (int)ProcType.PROC_DROPPABLE) != 0));
|
||||
Debug.Log("((m_iProcType & (int)ProcType.PROC_SELLABLE) != 0): " + ((m_iProcType & (int)ProcType.PROC_SELLABLE) != 0));
|
||||
// Exact C++ logic: (PROC_NO_USER_TRASH) || (!PROC_BINDING && (PROC_DROPWHENDIE || ...))
|
||||
// 精确的C++逻辑:(PROC_NO_USER_TRASH) || (!PROC_BINDING && (PROC_DROPWHENDIE || ...))
|
||||
if ((m_iProcType & (int)ProcType.PROC_NO_USER_TRASH) != 0
|
||||
@@ -1506,8 +1643,6 @@ namespace BrewMonster.Scripts.Managers
|
||||
m_strDesc += szCol;
|
||||
}
|
||||
}
|
||||
Debug.Log("m_iProcType: " + m_iProcType);
|
||||
Debug.Log("m_iProcType & (int)ProcType.PROC_DROPWHENDIE: " + (m_iProcType & (int)ProcType.PROC_DROPWHENDIE));
|
||||
if ((m_iProcType & (int)ProcType.PROC_DROPWHENDIE) != 0)
|
||||
{
|
||||
m_strDesc += "\\r";
|
||||
@@ -1517,10 +1652,7 @@ namespace BrewMonster.Scripts.Managers
|
||||
if (!string.IsNullOrEmpty(desc))
|
||||
m_strDesc += desc;
|
||||
}
|
||||
Debug.Log("m_strDesc: " + m_strDesc);
|
||||
}
|
||||
Debug.Log("m_iProcType: " + m_iProcType);
|
||||
Debug.Log("m_iProcType & (int)ProcType.PROC_DROPPABLE: " + (m_iProcType & (int)ProcType.PROC_DROPPABLE));
|
||||
if ((m_iProcType & (int)ProcType.PROC_DROPPABLE) != 0)
|
||||
{
|
||||
m_strDesc += "\\r";
|
||||
@@ -1532,8 +1664,6 @@ namespace BrewMonster.Scripts.Managers
|
||||
}
|
||||
Debug.Log("m_strDesc: " + m_strDesc);
|
||||
}
|
||||
Debug.Log("m_iProcType: " + m_iProcType);
|
||||
Debug.Log("m_iProcType & (int)ProcType.PROC_SELLABLE: " + (m_iProcType & (int)ProcType.PROC_SELLABLE));
|
||||
if ((m_iProcType & (int)ProcType.PROC_SELLABLE) != 0)
|
||||
{
|
||||
m_strDesc += "\\r";
|
||||
@@ -1543,10 +1673,7 @@ namespace BrewMonster.Scripts.Managers
|
||||
if (!string.IsNullOrEmpty(desc))
|
||||
m_strDesc += desc;
|
||||
}
|
||||
Debug.Log("m_strDesc: " + m_strDesc);
|
||||
}
|
||||
Debug.Log("m_iProcType: " + m_iProcType);
|
||||
Debug.Log("m_iProcType & (int)ProcType.PROC_TRADEABLE: " + (m_iProcType & (int)ProcType.PROC_TRADEABLE));
|
||||
if ((m_iProcType & (int)ProcType.PROC_TRADEABLE) != 0)
|
||||
{
|
||||
m_strDesc += "\\r";
|
||||
@@ -1556,10 +1683,7 @@ namespace BrewMonster.Scripts.Managers
|
||||
if (!string.IsNullOrEmpty(desc))
|
||||
m_strDesc += desc;
|
||||
}
|
||||
Debug.Log("m_strDesc: " + m_strDesc);
|
||||
}
|
||||
Debug.Log("m_iProcType: " + m_iProcType);
|
||||
Debug.Log("m_iProcType & (int)ProcType.PROC_DISAPEAR: " + (m_iProcType & (int)ProcType.PROC_DISAPEAR));
|
||||
if ((m_iProcType & (int)ProcType.PROC_DISAPEAR) != 0)
|
||||
{
|
||||
m_strDesc += "\\r";
|
||||
@@ -1569,10 +1693,7 @@ namespace BrewMonster.Scripts.Managers
|
||||
if (!string.IsNullOrEmpty(desc))
|
||||
m_strDesc += desc;
|
||||
}
|
||||
Debug.Log("m_strDesc: " + m_strDesc);
|
||||
}
|
||||
Debug.Log("m_iProcType: " + m_iProcType);
|
||||
Debug.Log("m_iProcType & (int)ProcType.PROC_USE: " + (m_iProcType & (int)ProcType.PROC_USE));
|
||||
if ((m_iProcType & (int)ProcType.PROC_USE) != 0)
|
||||
{
|
||||
m_strDesc += "\\r";
|
||||
@@ -1582,10 +1703,7 @@ namespace BrewMonster.Scripts.Managers
|
||||
if (!string.IsNullOrEmpty(desc))
|
||||
m_strDesc += desc;
|
||||
}
|
||||
Debug.Log("m_strDesc: " + m_strDesc);
|
||||
}
|
||||
Debug.Log("m_iProcType: " + m_iProcType);
|
||||
Debug.Log("m_iProcType & (int)ProcType.PROC_DEADDROP: " + (m_iProcType & (int)ProcType.PROC_DEADDROP));
|
||||
if ((m_iProcType & (int)ProcType.PROC_DEADDROP) != 0)
|
||||
{
|
||||
m_strDesc += "\\r";
|
||||
@@ -1595,10 +1713,7 @@ namespace BrewMonster.Scripts.Managers
|
||||
if (!string.IsNullOrEmpty(desc))
|
||||
m_strDesc += desc;
|
||||
}
|
||||
Debug.Log("m_strDesc: " + m_strDesc);
|
||||
}
|
||||
Debug.Log("m_iProcType: " + m_iProcType);
|
||||
Debug.Log("m_iProcType & (int)ProcType.PROC_OFFLINE: " + (m_iProcType & (int)ProcType.PROC_OFFLINE));
|
||||
if ((m_iProcType & (int)ProcType.PROC_OFFLINE) != 0)
|
||||
{
|
||||
m_strDesc += "\\r";
|
||||
@@ -1608,10 +1723,7 @@ namespace BrewMonster.Scripts.Managers
|
||||
if (!string.IsNullOrEmpty(desc))
|
||||
m_strDesc += desc;
|
||||
}
|
||||
Debug.Log("m_strDesc: " + m_strDesc);
|
||||
}
|
||||
Debug.Log("m_iProcType: " + m_iProcType);
|
||||
Debug.Log("m_iProcType & (int)ProcType.PROC_UNREPAIRABLE: " + (m_iProcType & (int)ProcType.PROC_UNREPAIRABLE));
|
||||
if ((m_iProcType & (int)ProcType.PROC_UNREPAIRABLE) != 0)
|
||||
{
|
||||
m_strDesc += "\\r";
|
||||
@@ -1621,10 +1733,7 @@ namespace BrewMonster.Scripts.Managers
|
||||
if (!string.IsNullOrEmpty(desc))
|
||||
m_strDesc += desc;
|
||||
}
|
||||
Debug.Log("m_strDesc: " + m_strDesc);
|
||||
}
|
||||
Debug.Log("m_iProcType: " + m_iProcType);
|
||||
Debug.Log("m_iProcType & (int)ProcType.PROC_NO_USER_TRASH: " + (m_iProcType & (int)ProcType.PROC_NO_USER_TRASH));
|
||||
if ((m_iProcType & (int)ProcType.PROC_NO_USER_TRASH) != 0)
|
||||
{
|
||||
m_strDesc += "\\r";
|
||||
@@ -1634,12 +1743,10 @@ namespace BrewMonster.Scripts.Managers
|
||||
if (!string.IsNullOrEmpty(desc))
|
||||
m_strDesc += desc;
|
||||
}
|
||||
Debug.Log("m_strDesc: " + m_strDesc);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("m_iCID == (int)InventoryClassId.ICID_GOBLIN");
|
||||
TrimLastReturn();
|
||||
}
|
||||
}
|
||||
@@ -1673,7 +1780,10 @@ namespace BrewMonster.Scripts.Managers
|
||||
protected void AddIDDescText()
|
||||
{
|
||||
// Optional: show internal id for debugging
|
||||
AddDescText(0, true, "ID: {0}", m_tid);
|
||||
#if UNITY_EDITOR
|
||||
AddDescText(0, true, "ID: {0}", m_tid);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
protected void AddBindDescText()
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrLookInfoItem : 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_IvtrLookInfoItem(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,15 +1,105 @@
|
||||
using BrewMonster.Scripts.Managers;
|
||||
using BrewMonster;
|
||||
using BrewMonster.Scripts;
|
||||
using ModelRenderer.Scripts.GameData;
|
||||
using ModelRenderer.Scripts.Common;
|
||||
using BrewMonster.Network;
|
||||
namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrMaterial : EC_IvtrItem
|
||||
{
|
||||
protected MATERIAL_MAJOR_TYPE m_pDBMajorType;
|
||||
protected MATERIAL_SUB_TYPE m_pDBSubType;
|
||||
protected MATERIAL_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_IvtrMaterial(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
m_iCID = (int)InventoryClassId.ICID_MATERIAL;
|
||||
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
|
||||
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
|
||||
m_pDBEssence = (MATERIAL_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
|
||||
m_pDBMajorType = (MATERIAL_MAJOR_TYPE)pDB.get_data_ptr(m_pDBEssence.id_major_type, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
|
||||
m_pDBSubType = (MATERIAL_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_iProcType = (int)m_pDBEssence.proc_type;
|
||||
m_i64EquipMask = 0;
|
||||
m_bNeedUpdate = false;
|
||||
}
|
||||
|
||||
public EC_IvtrMaterial(EC_IvtrMaterial other) : base(other)
|
||||
{
|
||||
m_pDBEssence = other.m_pDBEssence;
|
||||
m_pDBMajorType = other.m_pDBMajorType;
|
||||
m_pDBSubType = other.m_pDBSubType;
|
||||
}
|
||||
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 = "";
|
||||
|
||||
// Try to build item description
|
||||
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
|
||||
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,15 +1,192 @@
|
||||
using BrewMonster;
|
||||
using ModelRenderer.Scripts.GameData;
|
||||
using System.Collections.Generic;
|
||||
using BrewMonster.Network;
|
||||
using BrewMonster.Scripts.Managers;
|
||||
using BrewMonster.Scripts;
|
||||
using CSNetwork.GPDataType;
|
||||
namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
/// <summary>
|
||||
/// Medicine item class (cac loai thuoc).
|
||||
/// This is a part of CEC_IvtrConsume(C++)
|
||||
/// </summary>
|
||||
public class EC_IvtrMedicine : EC_IvtrItem
|
||||
{
|
||||
protected MEDICINE_MAJOR_TYPE m_pDBMajorType;
|
||||
protected MEDICINE_SUB_TYPE m_pDBSubType;
|
||||
protected MEDICINE_ESSENCE m_pDBEssence;
|
||||
|
||||
protected int m_iLevelReq;
|
||||
/// <summary>
|
||||
/// Create medicine item (cac loai thuoc)
|
||||
/// </summary>
|
||||
/// <param name="tid">Template id</param>
|
||||
/// <param name="expire_date">Expire date</param>
|
||||
public EC_IvtrMedicine(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
m_iCID = (int)InventoryClassId.ICID_MEDICINE;
|
||||
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
|
||||
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
|
||||
m_pDBEssence = (MEDICINE_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
|
||||
m_pDBMajorType = (MEDICINE_MAJOR_TYPE)pDB.get_data_ptr(m_pDBEssence.id_major_type, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
|
||||
m_pDBSubType = (MEDICINE_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 = 0;
|
||||
m_iLevelReq = m_pDBEssence.require_level;
|
||||
m_iProcType = (int)m_pDBEssence.proc_type;
|
||||
m_bUseable = true;
|
||||
m_bNeedUpdate = false;
|
||||
}
|
||||
|
||||
public EC_IvtrMedicine(EC_IvtrMedicine other) : base(other)
|
||||
{
|
||||
m_pDBEssence = other.m_pDBEssence;
|
||||
m_pDBMajorType = other.m_pDBMajorType;
|
||||
m_pDBSubType = other.m_pDBSubType;
|
||||
m_iLevelReq = other.m_iLevelReq;
|
||||
}
|
||||
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()
|
||||
{
|
||||
return m_pDBEssence.Name;
|
||||
}
|
||||
public int GetCoolTime(ref int piMax/* NULL */)
|
||||
{
|
||||
CECHostPlayer pHost = CECGameRun.Instance.GetHostPlayer();
|
||||
if (!pHost)
|
||||
return 0;
|
||||
|
||||
int iTime = 0;
|
||||
|
||||
switch (m_pDBMajorType.id)
|
||||
{
|
||||
case 1810: iTime = pHost.GetCoolTime((int)CoolTimeIndex.GP_CT_REJUVENATION_POTION, ref piMax); break;
|
||||
case 1794: iTime = pHost.GetCoolTime((int)CoolTimeIndex.GP_CT_HP_POTION, ref piMax); break;
|
||||
case 1802: iTime = pHost.GetCoolTime((int)CoolTimeIndex.GP_CT_MP_POTION, ref piMax); break;
|
||||
case 1815:
|
||||
case 2038: iTime = pHost.GetCoolTime((int)CoolTimeIndex.GP_CT_ANTIDOTE_POTION, ref piMax); break;
|
||||
}
|
||||
|
||||
return iTime;
|
||||
}
|
||||
// Get item description text
|
||||
protected override string GetNormalDesc(bool bRepair)
|
||||
{
|
||||
m_strDesc = string.Empty;
|
||||
|
||||
BMLogger.Log("EC_IvtrMedicine: GetNormalDesc: m_iLevelReq: " + m_iLevelReq);
|
||||
// Level requirement
|
||||
if (m_iLevelReq > 0)
|
||||
{
|
||||
BMLogger.Log("EC_IvtrMedicine: m_iLevelReq: " + m_iLevelReq);
|
||||
BMLogger.Log("EC_IvtrMedicine: GetMaxLevelSofar: " + CECGameRun.Instance.GetHostPlayer().GetMaxLevelSofar());
|
||||
int col = CECGameRun.Instance.GetHostPlayer().GetMaxLevelSofar() >= m_iLevelReq ? (int)DescriptipionMsg.ITEMDESC_COL_WHITE : (int)DescriptipionMsg.ITEMDESC_COL_RED;
|
||||
AddDescText(col, true, EC_Game.GetItemDesc().GetWideString((int)DescriptipionMsg.ITEMDESC_LEVELREQ), m_iLevelReq);
|
||||
}
|
||||
|
||||
// Build effect description
|
||||
BuildEffectDesc();
|
||||
|
||||
// Price
|
||||
AddPriceDesc((int)DescriptipionMsg.ITEMDESC_COL_WHITE, bRepair);
|
||||
|
||||
// Extend description
|
||||
AddExtDescText();
|
||||
|
||||
return m_strDesc;
|
||||
}
|
||||
|
||||
// Build medicine effect description
|
||||
protected void BuildEffectDesc()
|
||||
{
|
||||
CECStringTab pDescTab = EC_Game.GetItemDesc();
|
||||
int white = (int)DescriptipionMsg.ITEMDESC_COL_WHITE;
|
||||
|
||||
AddDescText(white, false, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_USEEFFECT));
|
||||
|
||||
switch (m_pDBMajorType.id)
|
||||
{
|
||||
case 1794: // Recruit HP
|
||||
|
||||
if (m_pDBEssence.hp_add_total > 0)
|
||||
{
|
||||
BMLogger.Log("EC_IvtrMedicine: BuildEffectDesc: m_pDBEssence.hp_add_total: " + m_pDBEssence.hp_add_total);
|
||||
BMLogger.Log("EC_IvtrMedicine: BuildEffectDesc: m_pDBEssence.hp_add_time: " + m_pDBEssence.hp_add_time);
|
||||
if (m_pDBEssence.hp_add_time > 0)
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_ADDHPINTIME), m_pDBEssence.hp_add_time, m_pDBEssence.hp_add_total);
|
||||
else
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_RECRUITHP), m_pDBEssence.hp_add_total);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1802: // Recruit MP
|
||||
|
||||
if (m_pDBEssence.mp_add_total > 0)
|
||||
{
|
||||
if (m_pDBEssence.mp_add_time > 0)
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_ADDMPINTIME), m_pDBEssence.mp_add_time, m_pDBEssence.mp_add_total);
|
||||
else
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_RECRUITMP), m_pDBEssence.mp_add_total);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1810: // Recruit HP and MP
|
||||
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_RECRUITHPMP), m_pDBEssence.hp_add_total, m_pDBEssence.mp_add_total);
|
||||
break;
|
||||
|
||||
case 1815:
|
||||
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_DECHALFPOISON));
|
||||
break;
|
||||
|
||||
case 2038:
|
||||
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_ANTIDOTE));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
BMLogger.LogError("EC_IvtrMedicine: Unknown major type: " + m_pDBMajorType.id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check item use condition
|
||||
protected bool CheckUseCondition()
|
||||
{
|
||||
CECHostPlayer pHost = CECGameRun.Instance.GetHostPlayer();
|
||||
|
||||
if (pHost.GetMaxLevelSofar() < m_iLevelReq)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get drop model for shown
|
||||
public override string GetDropModel()
|
||||
{
|
||||
return m_pDBEssence.FileMatter;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrMoneyConvertible : 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_IvtrMoneyConvertible(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrMonsterSpirit : 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_IvtrMonsterSpirit(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrPetEgg : 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_IvtrPetEgg(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrPetFaceTicket : 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_IvtrPetFaceTicket(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrPetFood : 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_IvtrPetFood(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrRecipe : 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_IvtrRecipe(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrRefineTicket : 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_IvtrRefineTicket(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrRevScroll : 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_IvtrRevScroll(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrSharpener : 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_IvtrSharpener(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrShopToken : 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_IvtrShopToken(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrSkillMat : 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_IvtrSkillMat(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrSkilltome : 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_IvtrSkilltome(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrSpeaker : 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_IvtrSpeaker(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrStone : 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_IvtrStone(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrTargetItem : 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_IvtrTargetItem(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrTaskDice : 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_IvtrTaskDice(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrTaskNmMatter : 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_IvtrTaskNmMatter(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ 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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrTossMat : 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_IvtrTossMat(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrTownscroll : 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_IvtrTownscroll(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrTransmitScroll : 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_IvtrTransmitScroll(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -95,11 +95,11 @@ namespace BrewMonster.Scripts.Managers
|
||||
};
|
||||
public struct IVTR_ESSENCE_DECORATION
|
||||
{
|
||||
int damage;
|
||||
int magic_damage;
|
||||
int defense;
|
||||
int armor;
|
||||
int[] resistance;
|
||||
public int damage;
|
||||
public int magic_damage;
|
||||
public int defense;
|
||||
public int armor;
|
||||
public int[] resistance;
|
||||
public IVTR_ESSENCE_DECORATION(byte[] data)
|
||||
{
|
||||
Debug.Log("IVTR_ESSENCE_DECORATION: data.Length: " + data.Length);
|
||||
@@ -168,15 +168,25 @@ namespace BrewMonster.Scripts.Managers
|
||||
};
|
||||
public struct IVTR_ESSENCE_AUTOHP
|
||||
{
|
||||
// TODO : implement data later
|
||||
// int hp_left;
|
||||
// float trigger;
|
||||
public int hp_left;
|
||||
public float trigger;
|
||||
public IVTR_ESSENCE_AUTOHP(byte[] data)
|
||||
{
|
||||
CECDataReader dr = new (data, data.Length);
|
||||
hp_left = dr.ReadInt();
|
||||
trigger = dr.ReadFloat();
|
||||
}
|
||||
};
|
||||
public struct IVTR_ESSENCE_AUTOMP
|
||||
{
|
||||
// TODO : implement data later
|
||||
// int mp_left;
|
||||
// float trigger;
|
||||
public int mp_left;
|
||||
public float trigger;
|
||||
public IVTR_ESSENCE_AUTOMP(byte[] data)
|
||||
{
|
||||
CECDataReader dr = new (data, data.Length);
|
||||
mp_left = dr.ReadInt();
|
||||
trigger = dr.ReadFloat();
|
||||
}
|
||||
};
|
||||
public struct IVTR_ESSENCE_PETEGG
|
||||
{
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrUnionscroll : 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_IvtrUnionscroll(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrUniversalToken : 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_IvtrUniversalToken(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrUnknown : 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_IvtrUnknown(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrWarTankCallin : 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_IvtrWarTankCallin(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -64,7 +64,9 @@ using BrewMonster.Scripts;
|
||||
|
||||
namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Weapon item class (cac loai vu khi)
|
||||
/// </summary>
|
||||
public class EC_IvtrWeapon : EC_IvtrEquip
|
||||
{
|
||||
//Attributes
|
||||
@@ -75,6 +77,10 @@ namespace PerfectWorld.Scripts.Managers
|
||||
protected WEAPON_SUB_TYPE m_pDBSubType;
|
||||
protected WEAPON_ESSENCE m_pDBEssence;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for weapon item (cac loai vu khi)
|
||||
/// </summary>
|
||||
/// <param name="tid">Template id</param>
|
||||
public EC_IvtrWeapon(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
m_iCID = (int)InventoryClassId.ICID_WEAPON;
|
||||
@@ -126,7 +132,6 @@ namespace PerfectWorld.Scripts.Managers
|
||||
dr.Offset(iMakerLen, CECDataReader.SEEK_CUR);
|
||||
byte[] iEssenceData = dr.ReadData(iEssenceSize);
|
||||
m_Essence = new IVTR_ESSENCE_WEAPON(iEssenceData);
|
||||
BMLogger.Log("[thn] weapon addon m_Essence: " + m_Essence.ToString());
|
||||
// ���븽������˵��
|
||||
if(m_pDBEssence.fixed_props != 0 && m_pDBEssence.probability_addon_num0 != 1.0f)
|
||||
{
|
||||
@@ -293,7 +298,7 @@ namespace PerfectWorld.Scripts.Managers
|
||||
AddDestroyingDesc((int)m_pDBEssence.id_drop_after_damaged, m_pDBEssence.num_drop_after_damaged);
|
||||
AddExpireTimeDesc();
|
||||
// Sub class name
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_CLASSNAME), m_pDBSubType.name.ToString());
|
||||
AddDescText(white, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_CLASSNAME), m_pDBSubType.Name);
|
||||
// Weapon level
|
||||
AddDescText(-1, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_LEVEL), m_Essence.weapon_level);
|
||||
// Attack speed
|
||||
@@ -380,11 +385,17 @@ namespace PerfectWorld.Scripts.Managers
|
||||
AddDescText((int)DescriptipionMsg.ITEMDESC_COL2_BRIGHTBLUE, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_HASRANDOM_PROP));
|
||||
// Price
|
||||
AddPriceDesc(white, bRepair);
|
||||
BMLogger.Log("AddPriceDesc: " + m_strDesc);
|
||||
AddSharpenerDesc();
|
||||
BMLogger.Log("AddSharpenerDesc: " + m_strDesc);
|
||||
AddEngravedDesc();
|
||||
BMLogger.Log("AddEngravedDesc: " + m_strDesc);
|
||||
AddMakerDesc();
|
||||
BMLogger.Log("AddMakerDesc: " + m_strDesc);
|
||||
AddSuiteDesc();
|
||||
BMLogger.Log("AddSuiteDesc: " + m_strDesc);
|
||||
AddExtDescText();
|
||||
BMLogger.Log("AddExtDescText: " + m_strDesc);
|
||||
return m_strDesc;
|
||||
}
|
||||
// Get weapon attack speed index
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrWeddingBookCard : EC_IvtrEquip
|
||||
{
|
||||
/// <summary>
|
||||
/// Not create logic yet (add summary later)
|
||||
/// </summary>
|
||||
/// <param name="tid">Template id</param>
|
||||
/// <param name="expire_date">Expire date</param>
|
||||
public EC_IvtrWeddingBookCard(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrWeddingInviteCard : EC_IvtrEquip
|
||||
{
|
||||
/// <summary>
|
||||
/// Not create logic yet (add summary later)
|
||||
/// </summary>
|
||||
/// <param name="tid">Template id</param>
|
||||
/// <param name="expire_date">Expire date</param>
|
||||
public EC_IvtrWeddingInviteCard(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@ namespace PerfectWorld.Scripts.Managers
|
||||
{
|
||||
public class EC_IvtrWing : EC_IvtrEquip
|
||||
{
|
||||
/// <summary>
|
||||
/// Not create logic yet (add summary later)
|
||||
/// </summary>
|
||||
/// <param name="tid">Template id</param>
|
||||
/// <param name="expire_date">Expire date</param>
|
||||
public EC_IvtrWing(int tid, int expire_date) : base(tid, expire_date)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
@@ -631,7 +631,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
|
||||
Reference in New Issue
Block a user