Same Gender Embrace

==============================================================================
  ETHER SAGA - EMBRACE (CARRY) ANY GENDER
  Nov 23, 2026                                                        
==============================================================================

  Out of the box, Ether Saga only lets a male carry a female. These edits
  remove the gender checks on the server and client so any pair can embrace,
  and the player who clicks Embrace is the one who carries.

  Offsets are for the standard, unmodified files. Builds differ, so check
  every "Was" value before writing. If it doesn't match, stop and find the
  spot by its original bytes instead.

  Files involved: gs (server), elementclient.exe (every player) and, for
  proper carry poses, models.pck (every player).

HOW TO MAKE ANY BYTE EDIT (HxD)
-------------------------------
  1. Install a hex editor such as HxD (Windows: winget install MHNexus.HxD).
     Copy the server files from your server's gamed folder to your PC (WinSCP
     works well for a Linux server).
  2. Make a backup copy of the file. Never edit the only copy.
  3. Open the copy in HxD. Press Ctrl+G, pick "hex", type the offset, press
     OK.
  4. Check the bytes at the cursor match "Was". If not, stop.
  5. Type the "Now" bytes over them (overwrite, never insert). The file size
     must not change.
  6. Ctrl+S. Compare against the backup: fc /b old new (Windows) or cmp -l old
     new (Linux). Only the listed bytes may differ.
  7. Server: stop the server, put the file in place, chmod 755 <file>, start.
     Client: give the file to every player (update the launcher hash if it
     checks one).

BYTE CHEAT SHEET
----------------
  74 / 75       conditional jump ("only if")
  EB            always jump (check removed)
  90            NOP (do nothing)

EDITING FILES INSIDE .PCK ARCHIVES
----------------------------------
  - Ether Saga .pck files often use non-standard keys, so stock Perfect World
    tools (0xA8937462 / 0x59374231) may fail. Use a pck tool that lets you set
    the keys your client uses.
  - Format v2.0.2. Data over 0x7FFFFF00 bytes spills into a .pkx file.
  - Extract the file, edit it, put it back at the same path, repack. Keep text
    files in their original encoding (most are UTF-16 LE with BOM).

  What each part gives you

  Part         Files                         Result
  -----------  ----------------------------  ---------------------------------
  Section 1    gs                            Server accepts embrace between
                                             any genders
  Section 2 A  elementclient.exe             Menu not greyed out; same-gender
                                             works; the clicker carries
  Section 2 B  elementclient.exe (new code)  Roles stay put on mount / wings;
                                             right pose per pair; no item use
                                             while carried
  Section 2 C  models.pck                    Carry attachment points and
                                             animations for every pair

CONTENTS
--------
   1. Server: remove the gender checks  [SERVER]
   2. Client: allow it, fix roles, poses and items  [CLIENT]


==============================================================================
  1. SERVER: REMOVE THE GENDER CHECKS   [SERVER]
==============================================================================
  Files: gs (server)
  Why:   Remove the 7 male/female checks so anyone can carry anyone.

  STEPS
   1. Back up your current gs.
   2. Change each byte below to EB.
   3. cmp -l: exactly 7 bytes differ from your backup.
   4. Install: stop the server, replace gs, chmod 755 gs, start.

  gs — 7 bytes

  Offset  Was  Now  Check removed
  ------  ---  ---  ------------------------------------------
  109BDA  75   EB   Person asking to be carried must be female
  109CDC  74   EB   Person inviting (carrier) must be male
  109DDA  74   EB   Accepting a request: must be male
  109EE6  75   EB   Accepting an invite: must be female
  109FF2  74   EB   Target of a request must be male
  10A060  75   EB   Target of an invite must be female
  10A2E6  74   EB   Safety check: carrier not female

  NOTES
    - These 7 spots don't overlap storage or other common gs patches, so they
      can go on top of an already-patched gs.

  VERIFY IN GAME
    [ ] Same-gender embrace works
    [ ] Female can carry male

==============================================================================
  2. CLIENT: ALLOW IT, FIX ROLES, POSES AND ITEMS   [CLIENT]
==============================================================================
  Files: elementclient.exe + models.pck (every player)
  Why:   The client also blocks same-gender embrace, swaps roles on
         mount/wings and has no poses for new pairs.

  STEPS
   1. A. Simple byte edits (enough for embrace to work for every pair; the
      clicker carries).
   2. B. Advanced edits add NEW code in empty space at the end of .text (file
      5DE200 onward). These need assembly: at each spot, jump to your new
      code, do the job listed, then jump back. The table lists each spot, its
      original bytes and what the new code must do. Part A works without them.
   3. C. models.pck: open the standard female (女) and male (男) player body
      models under Models\Players\形象\, add the carry attachment points and
      animations (tables below), then repack models.pck and give it to every
      player.

  A. Simple edits

  Offset  Was                      Now                      What
  ------  -----------------------  -----------------------  --------------------
  16AFE4  74 1F                    90 90                    Embrace no longer
                                                            greyed out in the
                                                            menu
  5F13E   74 AC                    90 90                    Clicking a same-
                                                            gender player works
  5F1AE   75 1D                    90 90                    Whoever clicks
                                                            Embrace carries
  8C2C7   8B 85 28 05 00 00 85 C0  80 BD 81 06 00 00 01 90  Only the player the
                                                            server chose as
                                                            carrier attaches

  B. Advanced (new code) — first enlarge the code section

  Offset  Original bytes                          New code does
  ------  --------------------------------------  ----------------------------
  268     C5 D1 5D 00 → 00 E0 5D 00               Code section size (required
                                                  for everything below)
  6C69C   8B 57 01 47 89 96 7C 06 00 00 83 C7 04  Read server role byte (1
                                                  carrier, 2 carried) +
                                                  partner id; store role at
                                                  [player+0x681]
  92E80   8B 54 24 08 8B                          When a link starts: partner
                                                  is me → role 2, else role 1
  8C2F8   0F 85 11 02 00 00                       Remove "carried must be
                                                  female"; store partner
                                                  gender at [player+0x682]
  8FC8B   68 0C A1 A7 00                          Pick linked animation name
                                                  by role + gender + partner
                                                  gender
  8FBE7   68 2C A1 A7 00                          Pick linked kiss animation
                                                  the same way
  24E2E0  56 6A 0A E8 B8                          Item use (cmd 40): blocked
                                                  while carried
  24E340  56 6A 0A E8 58                          Item use (cmd 45): blocked
                                                  while carried
  24F7B0  53 55 56 8B 74 24 24                    Item use (cmd 113): blocked
                                                  while carried

  Animation names chosen by the new code

  Who                           Body animation           Kiss
  ----------------------------  -----------------------  --------------------
  Carried, male                 %s_被抱_通用             亲吻_被抱_通用
  Carried, female, by a female  %s_被女抱_通用           亲吻_被女抱_通用
  Carrying, female              %s_抱人_通用             亲吻_抱人_通用
  Anything else                 %s_绑定_通用 (original)  —

  C. Models used (standard player bodies in models.pck)

  Model              Location inside models.pck                      Files
  -----------------  ----------------------------------------------  --------------------
  Female body (女)   Models\Players\形象\女\躯干\                    女.bon · 女.smd ·
                                                                     女.ecm
  Male body (男)     Models\Players\形象\男\躯干\                    男.bon · 男.smd ·
                                                                     男.ecm
  Female animations  tcks_女 folder (goes with the female skeleton)  .stck files
  Male animations    tcks_男 folder (goes with the male skeleton)    .stck files

  C. What to change in each model file

  File                             Change
  -------------------------------  -------------------------------------------
  女\躯干\女.bon                   Add attachment point HH_Bind (carry point,
                                   spine)
  男\躯干\男.bon                   Add CC_Bind (carried point, hips) and
                                   CC_ride2 (seat)
  女\躯干\女.smd                   Add 15 "_抱人_通用" and 15 "_被女抱_通用" actions
  男\躯干\男.smd                   Add 15 "_被抱_通用" actions
  女\躯干\女.ecm / 男\躯干\男.ecm  List the same new actions
  tcks_女 / tcks_男                Add the .stck animation files for those
                                   actions

  NOTES
    - The 15 actions per set: kiss, run, sit-hover, sit-fly, stand-hover,
      stand, stand-fly, wings-hover, wings-fly, walk, jump start, jump loop,
      landing, ride-hover, ride-fly.
    - You need carry animation sets made for these skeletons. Keep the bone
      files and animations from the same set; don't mix in older "_绑定_抱人" /
      "_绑定_被抱" files. Keep edited model files in your repack folder so a
      repack doesn't restore originals.
    - Side effect of B: no potions while being carried.

  VERIFY IN GAME
    [ ] F carries M
    [ ] M carries F
    [ ] F carries F
    [ ] M carries M
    [ ] Each pair using mount and using wings — roles don't swap
    [ ] Carried player can't summon mount / wings / aircraft

==============================================================================
  RULES
==============================================================================
  ! Back up every file before editing. Edit a copy, never the only one.
  ! Section 1 + Section 2 A are the minimum for embrace to work for every
    pair. B and C are polish.
  ! Every player needs the new elementclient.exe and models.pck (update your
    launcher hash if it checks one).
  ! Stop the server → back up → swap gs → chmod 755 → start → test on
    throwaway characters.


Revision #2
Created 2026-11-24 23:04:51 UTC by Akane
Updated 2026-11-24 23:05:23 UTC by Akane