Jump to content
Sign in to follow this  
.hack//ROOTS

system Mostrar arma en introselect

Recommended Posts

eddda03760b47b2d67a39c87de5cf68c.jpg

Quote
root / introselect.py | 32 +++++++++++++++ ---
src_client / source / UserInterface / Defines.h | 1 +
src_client / source / UserInterface / Packet.h | 3 ++
... / UserInterface / PythonCharacterModule.cpp | 18 ++++++++++
... / UserInterface / PythonNetworkStream.cpp | 4 +++
... / UserInterface / PythonNetworkStream.h | 3 ++
... / PythonNetworkStreamModule.cpp | 3 ++
src_server / source / common / service.h | 1 +
src_server / source / common / tables.h | 3 ++
... / source / db / src / ClientManagerLogin.cpp | 9 +++++
... / source / db / src / ClientManagerPlayer.cpp | 21 ++++++++++++
src_server / source / game / src / char.cpp | 7 ++++
 12 arquivos alterados, 103 inserções (+), 4 exclusões (-)

diff --git a / root / introselect.py b / root / introselect.py
índice 3d36faf..6520f76 100644
--- a / root / introselect.py
+++ b / root / introselect.py
@@ -23,6 +23,8 @@
 import interfaceModule
 import uiTaskBar
 importar uiInventory
+ item de importação
 
 LEAVE_BUTTON_FOR_POTAL = FALSE
 NOT_NEED_DELETE_CODE = FALSE
@@ -223,9 +227,10 @@ def Atualizar (auto):
             name = net.GetAccountCharacterSlotDataString (index, net.ACCOUNT_CHARACTER_SLOT_NAME)
             hair = net.GetAccountCharacterSlotDataInteger (index, net.ACCOUNT_CHARACTER_SLOT_HAIR)
             acce = net.GetAccountCharacterSlotDataInteger (índice, net.ACCOUNT_CHARACTER_SLOT_ACCE)
+ arma = net.GetAccountCharacterSlotDataInteger (índice, net.ACCOUNT_CHARACTER_SLOT_WEAPON)
 
             se id:
- self.MakeCharacter (índice, id, nome, raça, forma, cabelo, acesso)
+ self.MakeCharacter (índice, id, nome, raça, forma, cabelo, acesso, arma)
                 self.SelectSlot (índice)
 
         self.SelectSlot (self.slot)
@@ -340,7 +345,7 @@ def SameLoginDisconnect (self):
         self.stream.popupWindow.Open (localeInfo.LOGIN_FAILURE_SAMELOGIN, self.ExitSelect, localeInfo.UI_OK)
         # self.stream.popupWindow.Open (localeInfo.LOGIN_FAILURE_ALREAY, app.Exit, localeInfo.UI_OK)
         
- def MakeCharacter (self, index, id, name, race, form, hair, acce):
+ def MakeCharacter (self, index, id, name, race, form, hair, acce, weapon):
         se 0 == id:
             Retorna
 
@@ -353,10 +358,31 @@ def MakeCharacter (self, index, id, name, race, form, hair, acce):
         chr.SetArmor (formulário)
         chr.SetHair (cabelo)
         chr.SetAcce (acce)
+ chr.SetWeapon (arma)
 
         chr.Refresh ()
-        chr.SetMotionMode(chr.MOTION_MODE_GENERAL)
-        chr.SetLoopMotion(chr.MOTION_INTRO_WAIT)
+
+        item.SelectItem(weapon)
+        itemSubType = item.GetItemSubType()
+
+        if weapon == 0:
+            chr.SetMotionMode(chr.MOTION_MODE_GENERAL)
+        else:
+            if itemSubType == item.WEAPON_SWORD:
+                chr.SetMotionMode(chr.MOTION_MODE_ONEHAND_SWORD)
+            elif itemSubType == item.WEAPON_DAGGER:
+                chr.SetMotionMode(chr.MOTION_MODE_DUALHAND_SWORD)
+            elif itemSubType == item.WEAPON_BOW:
+                chr.SetMotionMode(chr.MOTION_MODE_BOW)
+            elif itemSubType == item.WEAPON_TWO_HANDED:
+                chr.SetMotionMode(chr.MOTION_MODE_TWOHAND_SWORD)
+            elif itemSubType == item.WEAPON_BELL:
+                chr.SetMotionMode(chr.MOTION_MODE_BELL)
+            elif itemSubType == item.WEAPON_FAN:
+                chr.SetMotionMode(chr.MOTION_MODE_FAN)
+
+        chr.SetLoopMotion(chr.MOTION_WAIT)
 
         chr.SetRotation(0.0)
 
diff --git a/src_client/source/UserInterface/Defines.h b/src_client/source/UserInterface/Defines.h
index 9c38217..38616ba 100644
--- a/src_client/source/UserInterface/Defines.h
+++ b/src_client/source/UserInterface/Defines.h
@@ -45,6 +45,7 @@
+#define ENABLE_CHARACTER_RENEWAL
diff --git a/src_client/source/UserInterface/Packet.h b/src_client/source/UserInterface/Packet.h
index a2e77d7..a494c82 100644
--- a/src_client/source/UserInterface/Packet.h
+++ b/src_client/source/UserInterface/Packet.h
@@ -1049,6 +1049,9 @@ typedef struct SSimplePlayerInformation
     BYTE                bChangeName;
     WORD                wHairPart;
     DWORD                dwAccePart;
+#ifdef ENABLE_CHARACTER_RENEWAL
+    WORD                wWeaponPart;
+#endif
     BYTE                bDummy[4];
     long                x, y;
     LONG                lAddr;

diff --git a/src_client/source/UserInterface/PythonNetworkStream.cpp b/src_client/source/UserInterface/PythonNetworkStream.cpp
index 414a1d3..d4d9cd0 100644
--- a/src_client/source/UserInterface/PythonNetworkStream.cpp
+++ b/src_client/source/UserInterface/PythonNetworkStream.cpp
@@ -401,6 +401,10 @@ UINT CPythonNetworkStream::GetAccountCharacterSlotDatau(UINT iSlot, UINT eType)
             return rkSimplePlayerInfo.wHairPart;
         case ACCOUNT_CHARACTER_SLOT_ACCE:
             return rkSimplePlayerInfo.dwAccePart;
+#ifdef ENABLE_CHARACTER_RENEWAL
+        case ACCOUNT_CHARACTER_SLOT_WEAPON:
+            return rkSimplePlayerInfo.wWeaponPart;
+#endif
             break;
     }
     return 0;
diff --git a/src_client/source/UserInterface/PythonNetworkStream.h b/src_client/source/UserInterface/PythonNetworkStream.h
index 823b202..d02ac40 100644
--- a/src_client/source/UserInterface/PythonNetworkStream.h
+++ b/src_client/source/UserInterface/PythonNetworkStream.h
@@ -57,6 +57,9 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton<CPythonNet
             ACCOUNT_CHARACTER_SLOT_CHANGE_NAME_FLAG,
             ACCOUNT_CHARACTER_SLOT_HAIR,
             ACCOUNT_CHARACTER_SLOT_ACCE,
+#ifdef ENABLE_CHARACTER_RENEWAL
+            ACCOUNT_CHARACTER_SLOT_WEAPON,
+#endif
         };
 
         enum
diff --git a/src_client/source/UserInterface/PythonNetworkStreamModule.cpp b/src_client/source/UserInterface/PythonNetworkStreamModule.cpp
index d7cefc3..64374ba 100644
--- a/src_client/source/UserInterface/PythonNetworkStreamModule.cpp
+++ b/src_client/source/UserInterface/PythonNetworkStreamModule.cpp
@@ -2217,6 +2217,9 @@ void initnet()
     PyModule_AddIntConstant(poModule, "ACCOUNT_CHARACTER_SLOT_CHANGE_NAME_FLAG", CPythonNetworkStream::ACCOUNT_CHARACTER_SLOT_CHANGE_NAME_FLAG);
     PyModule_AddIntConstant(poModule, "ACCOUNT_CHARACTER_SLOT_HAIR", CPythonNetworkStream::ACCOUNT_CHARACTER_SLOT_HAIR);
     PyModule_AddIntConstant(poModule, "ACCOUNT_CHARACTER_SLOT_ACCE", CPythonNetworkStream::ACCOUNT_CHARACTER_SLOT_ACCE);
+#ifdef ENABLE_CHARACTER_RENEWAL
+    PyModule_AddIntConstant(poModule, "ACCOUNT_CHARACTER_SLOT_WEAPON", CPythonNetworkStream::ACCOUNT_CHARACTER_SLOT_WEAPON);
+#endif
 
     PyModule_AddIntConstant(poModule, "SERVER_COMMAND_LOG_OUT",    CPythonNetworkStream::SERVER_COMMAND_LOG_OUT);
     PyModule_AddIntConstant(poModule, "SERVER_COMMAND_RETURN_TO_SELECT_CHARACTER",    CPythonNetworkStream::SERVER_COMMAND_RETURN_TO_SELECT_CHARACTER);
diff --git a/src_server/source/common/service.h b/src_server/source/common/service.h
index fad567b..71e3fab 100644
--- a/src_server/source/common/service.h
+++ b/src_server/source/common/service.h
@@ -43,6 +43,7 @@
+#define ENABLE_CHARACTER_RENEWAL
diff --git a/src_server/source/common/tables.h b/src_server/source/common/tables.h
index e974a6b..052050f 100644
--- a/src_server/source/common/tables.h
+++ b/src_server/source/common/tables.h
@@ -229,6 +229,9 @@ typedef struct SSimplePlayer
     BYTE        bChangeName;
     WORD        wHairPart;
     DWORD        dwAccePart;
+#ifdef ENABLE_CHARACTER_RENEWAL
+    WORD        wWeaponPart;
+#endif
     BYTE        bDummy[4];
     long        x, y;
     long        lAddr;
diff --git a/src_server/source/db/src/ClientManagerLogin.cpp b/src_server/source/db/src/ClientManagerLogin.cpp
index 1921f43..86ade6f 100644
--- a/src_server/source/db/src/ClientManagerLogin.cpp
+++ b/src_server/source/db/src/ClientManagerLogin.cpp
@@ -205,6 +205,9 @@ void CClientManager::RESULT_LOGIN_BY_KEY(CPeer * peer, SQLMsg * msg)
             "part_main,"
             "part_hair,"
             "part_acce,"
+#ifdef ENABLE_CHARACTER_RENEWAL
+            "part_weapon,"
+#endif
             "x,"
             "y,"
             "skill_group,"
@@ -300,6 +303,9 @@ void CreateAccountPlayerDataFromRes(MYSQL_RES * pRes, TAccountTable * pkTab)
                     pkTab->players[j].wMainPart        = pt->parts[PART_MAIN];
                     pkTab->players[j].wHairPart        = pt->parts[PART_HAIR];
                     pkTab->players[j].dwAccePart    = pt->parts[PART_ACCE];
+#ifdef ENABLE_CHARACTER_RENEWAL
+                    pkTab->players[j].wWeaponPart    = pt->parts[PART_WEAPON];
+#endif
                     pkTab->players[j].x                = pt->x;
                     pkTab->players[j].y                = pt->y;
                     pkTab->players[j].skill_group    = pt->skill_group;
@@ -394,6 +400,9 @@ void CClientManager::RESULT_LOGIN(CPeer * peer, SQLMsg * msg)
                 "part_main,"
                 "part_hair," 
                 "part_acce,"
+#ifdef ENABLE_CHARACTER_RENEWAL
+                "part_weapon,"
+#endif
                 "x,"
                 "y,"
                 "skill_group,"
diff --git a/src_server/source/db/src/ClientManagerPlayer.cpp b/src_server/source/db/src/ClientManagerPlayer.cpp
index d14c049..932bdcd 100644
--- a/src_server/source/db/src/ClientManagerPlayer.cpp
+++ b/src_server/source/db/src/ClientManagerPlayer.cpp
@@ -119,6 +119,9 @@ size_t CreatePlayerSaveQuery(char * pszQuery, size_t querySize, TPlayerTable * p
             "part_main = %d, "
             "part_hair = %d, "
             "part_acce = %d, "
+#ifdef ENABLE_CHARACTER_RENEWAL
+            "part_weapon = %d, "
+#endif
             "last_play = NOW(), "
             "skill_group = %d, "
             "alignment = %ld, "
@@ -165,6 +168,9 @@ size_t CreatePlayerSaveQuery(char * pszQuery, size_t querySize, TPlayerTable * p
         pkTab->parts[PART_MAIN],
         pkTab->parts[PART_HAIR],
         pkTab->parts[PART_ACCE],
+#ifdef ENABLE_CHARACTER_RENEWAL
+        pkTab->parts[PART_WEAPON],
+#endif
         pkTab->skill_group,
         pkTab->lAlignment,
         pkTab->horse.bLevel,
@@ -410,6 +416,9 @@ void CClientManager::QUERY_PLAYER_LOAD(CPeer * peer, DWORD dwHandle, TPlayerLoad
                 "gold,level,level_step,st,ht,dx,iq,exp,"
                 "stat_point,skill_point,sub_skill_point,stat_reset_count,part_base,part_hair,"
                 "part_acce,"
+#ifdef ENABLE_CHARACTER_RENEWAL
+                "part_weapon,"
+#endif
                 "skill_level,quickslot,skill_group,alignment,horse_level,horse_riding,horse_hp,horse_hp_droptime,horse_stamina,"
                 "UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(last_play),horse_skill_point"
 #ifdef ENABLE_SPECIALTY
@@ -557,6 +566,9 @@ bool CreatePlayerTableFromRes(MYSQL_RES * res, TPlayerTable * pkTab)
     str_to_number(pkTab->part_base, row[col++]);
     str_to_number(pkTab->parts[PART_HAIR], row[col++]);
     str_to_number(pkTab->parts[PART_ACCE], row[col++]);
+#ifdef ENABLE_CHARACTER_RENEWAL
+    str_to_number(pkTab->parts[PART_WEAPON], row[col++]);
+#endif
 
     if (row[col])
         thecore_memcpy(pkTab->skills, row[col], sizeof(pkTab->skills));
@@ -953,6 +965,9 @@ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerC
             "part_main, "
             "part_hair, "
             "part_acce, "
+#ifdef ENABLE_CHARACTER_RENEWAL
+            "part_weapon, "
+#endif
             "gold, "
             "playtime, "
             "skill_level, "
@@ -985,6 +1000,9 @@ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerC
             "%d, "
             "%d, "
             "%d, "
+#ifdef ENABLE_CHARACTER_RENEWAL
+            "%d, "
+#endif
             "0, "
             "%lld, "
             "0, "
@@ -1012,6 +1030,9 @@ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerC
             packet->player_table.part_base,
             packet->player_table.part_base,
             packet->player_table.part_base,
+#ifdef ENABLE_CHARACTER_RENEWAL
+            packet->player_table.part_base,
+#endif
             packet->player_table.gold);
 
     sys_log(0, "PlayerCreate accountid %d name %s level %d gold %lld, st %d ht %d job %d",packet->account_id, packet->player_table.name, packet->player_table.level, packet->player_table.gold, packet->player_table.st, packet->player_table.ht, packet->player_table.job);
diff --git a/src_server/source/game/src/char.cpp b/src_server/source/game/src/char.cpp
index 91f3dc2..8553cec 100644
--- a/src_server/source/game/src/char.cpp
+++ b/src_server/source/game/src/char.cpp
@@ -2206,6 +2206,9 @@ void CHARACTER::SetPlayerProto(const TPlayerTable * t)
     m_pointsInstant.bBasePart = t->part_base;
     SetPart(PART_HAIR, t->parts[PART_HAIR]);
     SetPart(PART_ACCE, t->parts[PART_ACCE]);
+#ifdef ENABLE_CHARACTER_RENEWAL
+    SetPart(PART_WEAPON, t->parts[PART_WEAPON]);
+#endif
 
     m_points.iRandomHP = t->sRandomHP;
     m_points.iRandomSP = t->sRandomSP;
@@ -4701,6 +4704,10 @@ DWORD CHARACTER::GetOriginalPart(BYTE bPartPos) const
         case PART_ACCE:
             return GetPart(PART_ACCE);
 
+#ifdef ENABLE_CHARACTER_RENEWAL
+        case PART_WEAPON:
+            return GetPart(PART_WEAPON);
+#endif
         default:
             return 0;
     }

 

como no lo considero raro, quiero lanzarlo. No se ha probado al 100%, pero debería funcionar hasta ahora.

Esto puede causar problemas para algunos (principalmente en db src). Puedo ver esto a pedido.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...