wow芒果从spell.dbc中提取技能名称

 

    昨天闲着无聊把wow2.33中的技能说明都给提取了出来,想在自己单机版的武器上添加绿字技能玩,下面是代码(我比较懒所以只提取的技能ID,名称和说明部分,好多地方的实现不是很好)
Spell.dbc结构:

Header(文件头20字节)

Records.................行数(4字节)
Fields....................列数(4字节)
Record Size...............每行所占字节(4字节)
String Block Size.....字符区所占字节(4字节)

Data(数据区 共Records * Record Size字节)-----存技能各种数据

row1.....(占Record Size字节)
row2.....(占Record Size字节)

Text(字符区 共String Block Size字节)------存技能文字说明等字符信息

第一行总为/0,后面的遇到/0为一行
例:技能名称提取  先由Data中找出技能名称所在字段,在127列*4byte=508byte位置得到技能名称在Text区的偏移量,String Block Size+偏移量就能得到技能名称的位置

------------------------------------------------------------------------------------------
using  System;
using  System.IO;
using  System.Collections;
using  System.Collections.Generic;
using  System.Text;
using  System.Xml.Serialization;
using  System.Runtime.Serialization;
using  System.Runtime.Serialization.Formatters.Binary;

namespace  WowItemTool
{
    [Serializable]
    
public class spellInfo
    
{
        
public int id;
        
public string name, type, memo;
    }


    
class spell
    
{

        
private byte[] m_stringTable;
        
private byte[] rowData;

        
public List<spellInfo> GetSpellList()
        
{
            
int rows, cols, rlen, tlen;

            List
<spellInfo> list=new List<spellInfo>();
            
            
//打开文件
            FileStream file = new FileStream("c:/dbc/spell.dbc",FileMode.Open,FileAccess.Read);
            BinaryReader br
= new BinaryReader(file);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值