|
|
المشاركات 2,362 |
+التقييم 0.85 |
تاريخ التسجيل Apr 2019 |
الاقامة Egypt |
نظام التشغيل windows 7 |
رقم العضوية 1 |

// 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)");
}
}
}
// 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);
}
}
}
}
if (!Gear.Contains(pos) && !QualityOnly.Contains(pos)) { item.Send(c, s); return; }
if (IsWingPastMax(item, pos)) { ComposeWingExtra(c, s, item, materials); return; }
| الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
| أدوات الموضوع | |
|
| الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
| اذاي تخلي الحصان و الجناح يزيد بروجريس بعد +12 عشان يبقي في تنافس | Rider | تطوير سيرفرات كونكر | 5 | 2020-08-03 07:56 PM |
| مشكلة بخصوص الجناح ارجو الحل ضروري جدا بعد اذنكم | Abod ayman | مشكلات السيرفيرات كونكر الشخصيه | 5 | 2020-04-04 08:10 PM |
| حل مشكلة ان الجناح مبيتحطش عليه الا جمايه جلوري | Rider | تطوير سيرفرات كونكر | 2 | 2019-07-20 11:50 PM |
| حل مشكله السوكت فى الجناح والاسطفه العاديه | Hazem | تطوير سيرفرات كونكر | 1 | 2019-04-23 04:56 PM |
| خلي الجناح يقبل استونات بعد بلص 12 | Hazem | تطوير سيرفرات كونكر | 0 | 2019-04-23 03:27 PM |