| Hazem |
2026-11-19 10:23 PM |
حل ستونات الجناح بعد 12
عفواً لايمكن عرض الروابط إلا بعد الرد على الموضوع
حل مشكلة الجناح اللي مش بيقبل ستونات بعد +12 - سورس قهر موبايل النسخة التانية
السلام عليكم
الجناح في الموبايل بعد ما يوصل +12 بيفضل ليه شريط تقدم لحد 2000000، والكلاينت نفسه بيعرضه في Forging > Compose.
بس لما تحط ستونات وتدوس Compose مكانش بيحصل حاجة، والستونات بتفضل زي ما هي.
السبب
كود الـ Compose بتاع الموبايل في السورس كان بيوقف أي قطعة عند +12 ويصفر التقدم، من غير ما يفرق بين الجناح وباقي العدة.
في سورس الكمبيوتر الجناح كان ليه حالة خاصة: بعد +12 كل ستون بيزود نقطه في التقدم لحد 2000000، والرقم ده بيتحسب في قوة الجناح.
الحل
ملفين في فولدر Server اللي مع الموضوع:
src/Qahr.Mobile.Game/Mobile/Forge/MobileForgeNet.Wing.cs ملف جديد
كود PHP:
// QahrMobile: Forging > Compose of a +12 wing on the mobile client. The client keeps a wing's progress bar after +12
// (CItem::GetNextLevIncExp: lev 12 and IsWing -> GetWingAppExpMax, the wing "append exp" the player spawn carries as
// WingProgress), but Compose stopped every item at +12 and cleared the progress, so the stones were refused. Same rule
// as the PC MsgUpdateItem Wing branch: each +N stone (or +N wing) adds StonePlusPoints(N), capped at WingExtraMax;
// the material's own progress is not added. Hook: MobileForgeNet.Compose.
using System.Collections.Generic;
using Qahr.Mobile.Game.MsgServer;
using Qahr.Mobile.Phone;
namespace Qahr.Mobile.Forge
{
public static partial class MobileForgeNet
{
const byte MaxComposePlus = 12;
const uint WingExtraMax = 2000000;
static bool IsWingPastMax(MsgGameItem item, Role.Flags.ConquerItem pos)
{
return pos == Role.Flags.ConquerItem.Wing && item.Plus >= MaxComposePlus;
}
static void ComposeWingExtra(Client.GameClient c, ServerSockets.Packet s, MsgGameItem wing, List<KeyValuePair<uint, uint>> materials)
{
uint oldProgress = wing.PlusProgress;
int used = 0;
var seen = new HashSet<uint>();
foreach (var m in materials)
{
MsgGameItem mat;
if (wing.PlusProgress >= WingExtraMax) break;
if (m.Key == wing.UID || !seen.Add(m.Key) || !c.Inventory.ClientItems.TryGetValue(m.Key, out mat)) continue;
bool stone = mat.ITEM_ID >= FirstStone && mat.ITEM_ID <= LastStone;
if (!stone && Database.ItemType.ItemPosition(mat.ITEM_ID) != (ushort)Role.Flags.ConquerItem.Wing) continue;
uint stack = mat.StackSize > 1 ? mat.StackSize : 1u;
uint units = stone ? System.Math.Min(System.Math.Max(1u, m.Value), stack) : 1u;
uint points = Database.ItemType.StonePlusPoints(stone ? (byte)(mat.ITEM_ID % 10) : mat.Plus);
uint taken = 0;
for (; taken < units && wing.PlusProgress < WingExtraMax; taken++)
wing.PlusProgress = System.Math.Min(WingExtraMax, wing.PlusProgress + points);
Take(c, s, mat, stone ? taken : stack);
used += (int)taken;
}
if (used == 0 && wing.PlusProgress >= WingExtraMax)
PlayerMsg.Tell(c, "This wing is at its highest progress already.");
wing.Mode = Role.Flags.ItemMode.Update;
wing.Send(c, s);
if (wing.Position != 0) c.Equipment.QueryEquipment(c.Equipment.Alternante);
if (used > 0) Log(c, wing, "wing +12 progress " + oldProgress + " -> " + wing.PlusProgress + " with " + used + " material(s)");
}
}
}
src/Qahr.Mobile.Game/Mobile/Forge/MobileForgeNet.Compose.cs متزود فيه سطر واحد
كود PHP:
// QahrMobile: Forging > Compose on the mobile client (CMsgDataArray 10292 action 0, seen 2026-10-26: count 3 =
// target UID, then (material UID, amount) pairs). Same math as the PC MsgUpdateItem Plus branch (StonePlusPoints /
// ComposePlusPoints), but a +stone stack (mobile stacks to 10000) only loses the amount used, not the whole stack.
using System.Collections.Generic;
using Qahr.Mobile.Game.MsgServer;
namespace Qahr.Mobile.Forge
{
public static partial class MobileForgeNet
{
const uint FirstStone = 730001, LastStone = 730009;
static void Compose(Client.GameClient c, ServerSockets.Packet s, uint uid, List<KeyValuePair<uint, uint>> materials)
{
MsgGameItem item;
if (!c.TryGetItem(uid, out item)) return;
var pos = (Role.Flags.ConquerItem)Database.ItemType.ItemPosition(item.ITEM_ID);
if (!Gear.Contains(pos) && !QualityOnly.Contains(pos)) { item.Send(c, s); return; }
if (IsWingPastMax(item, pos)) { ComposeWingExtra(c, s, item, materials); return; }// QahrMobile: +12 wing progress up to 2,000,000, Mobile/Forge/MobileForgeNet.Wing.cs
byte oldPlus = item.Plus;
int used = 0;
var seen = new HashSet<uint>();
foreach (var m in materials)
{
MsgGameItem mat;
if (item.Plus >= 12 || m.Key == uid || !seen.Add(m.Key) || !c.Inventory.ClientItems.TryGetValue(m.Key, out mat)) continue;
bool stone = mat.ITEM_ID >= FirstStone && mat.ITEM_ID <= LastStone;
if (!stone && Database.ItemType.ItemPosition(mat.ITEM_ID) != (ushort)pos) continue;
uint stack = mat.StackSize > 1 ? mat.StackSize : 1u;
uint units = stone ? System.Math.Min(System.Math.Max(1u, m.Value), stack) : 1u;
byte matPlus = stone ? (byte)(mat.ITEM_ID % 10) : mat.Plus;
uint taken = 0;
for (; taken < units && item.Plus < 12; taken++)
{
item.PlusProgress += Database.ItemType.StonePlusPoints(matPlus) + (stone ? 0 : mat.PlusProgress);
while (item.Plus < 12 && item.PlusProgress >= Database.ItemType.ComposePlusPoints(item.Plus))
{
item.PlusProgress -= Database.ItemType.ComposePlusPoints(item.Plus);
item.Plus++;
}
}
if (item.Plus >= 12) item.PlusProgress = 0;
Take(c, s, mat, stone ? taken : stack);
used += (int)taken;
}
item.Mode = Role.Flags.ItemMode.Update;
item.Send(c, s);
if (item.Position != 0) c.Equipment.QueryEquipment(c.Equipment.Alternante);
if (used > 0) Log(c, item, "compose +" + oldPlus + " -> +" + item.Plus + " (progress " + item.PlusProgress + ") with " + used + " material(s)");
}
/// <summary>Removes n units from one stack (the whole item when n covers it).</summary>
static void Take(Client.GameClient c, ServerSockets.Packet s, MsgGameItem mat, uint n)
{
uint stack = mat.StackSize > 1 ? mat.StackSize : 1u;
if (n == 0) return;
if (n < stack)
{
mat.StackSize = (ushort)(stack - n);
mat.Mode = Role.Flags.ItemMode.Update;
mat.Send(c, s);
}
else
{
mat.StackSize = 1;
c.Inventory.Update(mat, Role.Instance.AddMode.REMOVE, s);
}
}
}
}
انسخهم فوق السورس واعمل Build وشغل السيرفر.
ولو عايز تعدل بإيدك في MobileForgeNet.Compose.cs، تحت السطر ده:
كود PHP:
if (!Gear.Contains(pos) && !QualityOnly.Contains(pos)) { item.Send(c, s); return; }
ضيف:
كود PHP:
if (IsWingPastMax(item, pos)) { ComposeWingExtra(c, s, item, materials); return; }
اللي بيشتغل بعد الحل
كل ستون بيزود نفس نقطه في الكمبيوتر، يعني ستون +8 بيدي 29160.
تقدر تحط جناح تاني مكان الستون وبيدي نقط على قد البلص بتاعه.
Compose و Compose All بيشتغلوا.
لما الشريط يوصل 2000000 السيرفر بيوقف ومياخدش ستونات زيادة، والكلاينت بيكتب Max.
الصور بعد الحل:
الأولى الجناح +12 والشريط 0 من 2000000.
التانية بعد ستون +8 الشريط بقى 29160.
التالتة الشريط اتملى والكلاينت كاتب Max.
|