---
# System prepended metadata

title: Feather DB
tags: [Feather Cracking]

---

# Feather DB
###### tags: `Feather Cracking`

## Todo

### Database 逆向工程
- Account (1 -> 6 Hero)
  > 6 個角色 (Hero)
    - Id (uint)
    - Name (varchar(20))        # 帳號名稱 (登入帳號, 英文/數字)
    - HashedPassword (char(64)) # sha256
    - Status (byte)      # 0~255
    - Hero1Id (FK -> Hero.Id)
    - Hero2Id (FK -> Hero.Id)
    - Hero3Id (FK -> Hero.Id)
    - Hero4Id (FK -> Hero.Id)
    - Hero5Id (FK -> Hero.Id)
    - Hero6Id (FK -> Hero.Id)

- Hero (角色)
    - Id        (uint)
    - Name      (nvarchar(20))  # 角色名稱
    - Role      (ushort)        # 職業
    - Silver    (decimal)     # 銀
    - SilverGold (decimal) # 銀元
    - Gold      (decimal)     # 元寶 (充值點數)
    - Level     (byte)
    - Gender    (ushort) -> 在 Code 中轉換
    - HairStyle (short)
    - HairColor (short)
    - Icon      (short)
    - LocX      (short)
    - LocY      (short)
    - Map       (short)
    - Direction (byte) (面向方向 facing direction)
    - TyLv      (byte) (天元等級 (轉生等級))
    ~~- CultivationLevel (修為等級) (<- 這可以在上線時數中計算, 可以不用存?)~~
    - Vigor     (short) (體力值)
    - Virtue    (int) (功德)
    - HonorPoint (int) (戰績)
    - PK        (int) (PK 值)
    - Vit       (short) (體質)
    - Spir      (short) (精神)
    - Intell    (short) (智力)
    - Str       (short) (力量)
    - Stam      (short) (耐力)
    - BonusPoints (short) (可用屬性配點)
    - Exp       (int) (角色經驗)
    - EquipementBagId (背包 (裝備))
    - TeacherId (int, NULL) (師傅的玩家 Id) # 徒弟 List 從 Hero.TeacherId 中 get
    - -----------------------\<newly added:\>-----------------------
    - MaxPetSlot (byte, default: 4, max: 8) (最大可用寵物欄位)
    - AttackMode (byte, default: 1) (攻擊模式)
    - TribeId (int, NULL, default: NULL, FK -> Tribe.Id) (null 表示沒加入)
    - TribeContribution (int, default: 0) (部落貢獻度)
    - TribeRole (byte, default: 0) (部落職位, 0 = 部眾)
    - BaseLuck  (基礎幸運值)
    - BaseHit   (基礎命中值)
    - BaseCHR   (基礎暴擊率)
    - BaseDodge (基礎回避值)
    - InUseTitleId (FK -> TitleList.Id)(使用中的稱號 Id) # <----- 或者放到 TitleList 中以 "InUse" 代替?
    - TeacherLevel (byte, default: 1, max: 7) (師傅星級)
    - TeacherTitle   (nvarchar(20) , NULL) (師傅宣言標題)
    - TeacherContent (nvarchar(100), NULL) (師傅宣言內容)
    - PetManorID (FK -> PetManorList.Id, NULL, default: NULL) (寵物莊園 ID) @ 0x408FFD

- TitleList (玩家可用稱號列表, CPK, FK -> Hero.Id)
    - HeroId   (CPK, FK -> Hero.Id)
    - TitleId  (CPK, 稱號 Id)
    - ExpiryOn (datetime, NULL = 永久, trigger: delete upon expiry, set to default before delete)

- ItemBar (道具欄, FK -> Hero.Id)
  > 可以放技能 (傳 ASCII 的 skill Id) + 物品 (傳物品中文名稱)
  > 可是...如果那個欄是物品的話, 客戶端會傳 `/use \<itemId\>#`
  > 把背包中第 22 格放到 ItemBar 第 4 Set 第 7 格 (slot 37): `/key 37 星星的泪滴 22`
    - a
    - 
- [先別處理這張表] HeroEffect (人物特效, FK -> Hero.Id)
    - HeroId   (CPK, FK)
    - EffectId (CPK)
    - AniFrameRate
    - 
    - ExpiryOn (datetime, NULL = 永久)
- 
- Bag (背包, 1:n => FK -> Hero.Id)
  > 一個角色有 1 個預設背包, 3 個限時/永久背包 = total 4
  > 外加: 裝備, 生活技能包 Page1 & Page2 = 3
    - Id (uint)
    - ExpiryOn (datetime, NULL = 永久)
- Item (物件, n:1, CPK, FK -> Bag.Id)
  > Coding TODO: 可裝備的物品 Id 及對應的裝備欄位 (如 `戒指` BaseId[`DEADBEEF`] 可裝於`戒指欄`)
    - Id (uint) (CPK)
    - BaseId    (物品基礎 Id (負責名稱 + 部份道具描述))
    - IconId    (物品顯示圖案 Id) [舊稱: ModelId]
    - SlotIndex (byte) (欄位)
    - Binding   (byte) (綁定狀態)
    - Desc      (long text with newlines?) (物品描述) # <--- 或者用 format string Id?
    - Quality   (short) (物品品質)
    - Amount    (short) (物品堆疊數量)
- Ride (坐騎, n:1, FK -> Hero.Id)
  > 技能要 runtime 轉換成 天賦/通用/專屬
    - Id
    - Name   (nvarchar(20))
    - Yield  (nvarchar(50))
    - Generation (n 代目, default: 0) # 分享屬性比例 (0: 25%, 1: 50%, 2: 100%)
    - Level  (等級)
    - Exp    (經驗值)
    - Vit    (short) (體質)
    - Spir   (short) (精神)
    - Intell (short) (智力)
    - Str    (short) (力量)
    - Stam   (short) (耐力)
    - BonusPoints (short) (可用屬性配點)
    - \<TODO: 坐騎技能\>
- Pet (寵物, n:1, FK -> Hero.Id)
    - Id
    - Name     (nvarchar(20))
    - Loyalty  (忠誠度)
    - Level    (等級)
    - Exp      (經驗值)
    - TalentPA (short) (攻擊資質)
    - TalentMA (short) (法攻資質)
    - TalentPD (short) (防禦資質)
    - TalentMD (short) (法防資質)
    - TalentMP (short) (法力資質)
    - TalentHP (short) (體力資質)
    - CHRate   (int) (暴擊率, default: 100 = display 0.01%)
    - Life     (壽命)
    - Vit      (short) (體質)
    - Spir     (short) (精神)
    - Intell   (short) (智力)
    - Str      (short) (力量)
    - Stam     (short) (耐力)
    - BonusPoints (short) (可用屬性配點)
    - Skill1   (寵物技能 1)
    - Skill2   (寵物技能 2)
    - Skill3   (寵物技能 3)
    - Skill4   (寵物技能 4)
    - Skill5   (寵物技能 5)
    - Skill6   (寵物技能 6)
    - Skill7   (寵物技能 7)
    - Skill8   (寵物技能 8)
    - Skill9   (寵物技能 9)
    - Skill10  (寵物技能 10)
    - IsInPetCaring (已放在寵物醫生欄位)
    - PetTrainingStartTime (datetime, default: NULL)
    - PetTrainingEndTime   (datetime, default: NULL)
- FriendList (好友名單)
  > Coding TODO: 親密度對應的稱呼 (同一隊伍 & 地圖下, 殺 100 隻怪 = +1)
  > + FmtStrId: 5612 君子之交 10000
  > + FmtStrId: 5613 情同手足 ~5000
  > + FmtStrId: 5614 至交好友 ~2000
  > + FmtStrId: 5621 海内知己 ~1000
  > + FmtStrId: 5622 萍水相逢 ~400
  > + FmtStrId: 5623 普通朋友 ~0
    - HeroId       (CPK, FK -> Hero.Id) (邀請者)
    - TargetHeroId (CPK, FK -> Hero.Id) (被邀請者)
    - Intimacy     (short, max: 10000) (好友親密度)
- BlackList (黑名單)
    - HeroId       (CPK, FK -> Hero.Id) (加入者)
    - TargetHeroId (CPK, FK -> Hero.Id) (被拉黑者)
- Team (隊伍)
    - Id
    - DropItemMode (byte) (隊伍物品分配模式)
    - DropQuanlity (byte) (分配顏色設定 (藍色/金色))
    - Member1 (FK -> Hero.Id)
    - Member2 (FK -> Hero.Id)
    - Member3 (FK -> Hero.Id)
    - Member4 (FK -> Hero.Id)
    - Member5 (FK -> Hero.Id)
    - LeaderId (隊長的 Hero.Id (誰是隊長))
- Skill (技能, n:1, FK -> Hero.Id)
    - HeroId (FK -> Hero.Id)
    - SkillId (可以是 TreeId, From HardCode)
    - Level (short)
    
- Tribe (部落) [TODO: 確定 column list]
  > 會員名單: 以 Hero.TribeId 中取得會員名單, 以及當中的 1. 角色名稱, 2. 角色職業, 3. 部落職位, 4. 角色等級, 5. 部落貢獻度
    - Id
    - Name (部落名稱)
    - Funds (資金)
    - MilitaryLv (軍事)
    - SecurityLv (治安)
    - Level (部落等級)
    - StrengthLv (實力)
    - ProsperityLv (繁榮)
    - TechnologyLv (科技)
    - Resource (資源)
    - MaxMember (最大會員數)
    - (已開啟技能?)
    - (已開啟強化技能?)
    - HasVault  (byte) (default: 0 (未有部落倉庫))
    - Vault1    (byte) (default: 3) (部落倉庫一號倉可用頁面數) [tribe lv5 max: 8, lv4 max: 6]
    - Vault2    (byte) (default: 0) (部落倉庫二號倉可用頁面數) [max: 8, unlock by Gold]
- TribeVaultItem
    - TribeId (CPK, FK -> Tribe.Id)
    - SlotIndex (short) ()
    - 
- TribeLog ()
- PetManorList (寵物莊園)
    - TODO feature :D, so fking hard :D

## Timers
1. DropItem remove timer
2. Hero rest timer (坐下 -> 每 3 秒回 12 點 HP & 12 點 MP)
3. Skill CD timer
    + Hero
    + Pet
    + Ride
    + Mob/Boss


## Values
### Teacher attack multiplier:
lv1: +10%
lv2: +15%
lv3: +20%
lv4: +25%
lv5: +30%
lv6: +35%
lv7: +40%

### Teacher virtue to exp exchange:
lv1: 10000
lv2: 15000
lv3: 20000
lv4: 25000
lv5: 30000
lv6: 35000
lv7: 40000

### Pet Doctor training:
13200 silver & 11mins per lv

## Packets TODO
capture:
- [ ] pet training UI
- [ ] pet warehouse UI
- [ ] skill & effects
- [ ] 

# Event List
- [ ] OnPlayerJoinGame
    + query db for <>
    + send online message to friends
    + 
- [ ] OnPlayerLeaveGame
    + send offline message to friends
- [ ] a