mirror of
https://github.com/MikuLeaks/KianaBH3.git
synced 2025-12-12 21:04:41 +01:00
feat: add stigmata to inventory & giveall command
This commit is contained in:
@@ -24,13 +24,13 @@ public class ItemData
|
||||
public int Count { get; set; }
|
||||
public int Level { get; set; }
|
||||
public int Exp { get; set; }
|
||||
public bool Locked { get; set; }
|
||||
public bool AffixIdentify { get; set; }
|
||||
public bool IsLocked { get; set; }
|
||||
public bool IsAffixIdentify { get; set; }
|
||||
public uint CancelLockedTime { get; set; }
|
||||
public bool Extracted { get; set; }
|
||||
public int SlotNum { get; set; }
|
||||
public int Refine { get; set; }
|
||||
public int Promote { get; set; }
|
||||
public int RefineValue { get; set; }
|
||||
public int PromoteTimes { get; set; }
|
||||
public int Homology { get; set; }
|
||||
public List<int> QuantumBranchLists { get; set; } = [];
|
||||
public List<Rune> RuneLists { get; set; } = [];
|
||||
@@ -56,10 +56,57 @@ public class ItemData
|
||||
UniqueId = (uint)UniqueId,
|
||||
Level = (uint)Level,
|
||||
Exp = (uint)Exp,
|
||||
IsProtected = Locked,
|
||||
IsProtected = IsLocked,
|
||||
IsExtracted = Extracted,
|
||||
};
|
||||
}
|
||||
|
||||
public Stigmata ToStigmataProto()
|
||||
{
|
||||
return new Stigmata
|
||||
{
|
||||
Id= (uint)ItemId,
|
||||
UniqueId= (uint)UniqueId,
|
||||
Level= (uint)Level,
|
||||
Exp= (uint)Exp,
|
||||
SlotNum = (uint)SlotNum,
|
||||
RefineValue = (uint)RefineValue,
|
||||
PromoteTimes = (uint)PromoteTimes,
|
||||
IsProtected= IsLocked,
|
||||
IsAffixIdentify = IsAffixIdentify,
|
||||
RuneList =
|
||||
{
|
||||
RuneLists.Select(x => new StigmataRune
|
||||
{
|
||||
RuneId = (uint)x.RuneId,
|
||||
StrengthPercent = (uint)x.Strength,
|
||||
})
|
||||
},
|
||||
WaitSelectRuneList =
|
||||
{
|
||||
WaitSelectRuneLists.Select(x => new StigmataRune
|
||||
{
|
||||
RuneId = (uint)x.RuneId,
|
||||
StrengthPercent = (uint)x.Strength,
|
||||
})
|
||||
},
|
||||
WaitSelectRuneGroupList =
|
||||
{
|
||||
WaitSelectRuneGroupLists.Select(x => new StigmataRuneGroup
|
||||
{
|
||||
UniqueId = (uint)x.UniqueId,
|
||||
RuneList =
|
||||
{
|
||||
RuneLists.Select(l => new StigmataRune
|
||||
{
|
||||
RuneId = (uint)l.RuneId,
|
||||
StrengthPercent = (uint)l.Strength,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class RuneGroup
|
||||
|
||||
@@ -35,21 +35,13 @@ public class ServerTextEN
|
||||
/// </summary>
|
||||
public class WordTextEN
|
||||
{
|
||||
public string Rank => "Rank";
|
||||
public string Avatar => "Avatar";
|
||||
public string Star => "Star";
|
||||
public string Valk => "Valkyrie";
|
||||
public string Material => "Material";
|
||||
public string Pet => "Pet";
|
||||
public string Relic => "Relic";
|
||||
public string Stigmata => "Stigmata";
|
||||
public string Weapon => "Weapon";
|
||||
public string Talent => "Talent";
|
||||
public string Banner => "Gacha";
|
||||
public string Activity => "Activity";
|
||||
public string CdKey => "CdKey";
|
||||
public string VideoKey => "VideoKey";
|
||||
public string Buff => "Blessing";
|
||||
public string Miracle => "Curio";
|
||||
public string Unlock => "Luxury";
|
||||
public string TrainParty => "TrainParty";
|
||||
|
||||
// server info
|
||||
public string Config => "Config File";
|
||||
@@ -60,8 +52,6 @@ public class WordTextEN
|
||||
public string CustomData => "Custom Data";
|
||||
public string Database => "Database";
|
||||
public string Command => "Command";
|
||||
public string SSL => "SSL";
|
||||
public string Ec2b => "Ec2b";
|
||||
public string SdkServer => "Web Server";
|
||||
public string Handler => "Packet Handler";
|
||||
public string Dispatch => "Global Dispatch";
|
||||
@@ -69,39 +59,6 @@ public class WordTextEN
|
||||
public string Handbook => "Handbook";
|
||||
public string NotFound => "Not Found";
|
||||
public string Error => "Error";
|
||||
public string FloorInfo => "Floor File";
|
||||
public string FloorGroupInfo => "Floor Group File";
|
||||
public string FloorMissingResult => "Teleportation and World Generation";
|
||||
public string FloorGroupMissingResult => "Teleportation, Monster Battles, and World Generation";
|
||||
public string Mission => "Mission";
|
||||
public string MissionInfo => "Mission File";
|
||||
public string SubMission => "Sub Mission";
|
||||
public string SubMissionInfo => "Sub Mission File";
|
||||
public string MazeSkill => "Maze Skill";
|
||||
public string MazeSkillInfo => "Maze Skill File";
|
||||
public string Dialogue => "Simulated Universe Event";
|
||||
public string DialogueInfo => "Simulated Universe Event File";
|
||||
public string Performance => "Performance";
|
||||
public string PerformanceInfo => "Performance File";
|
||||
public string RogueChestMap => "Simulated Universe Map";
|
||||
public string RogueChestMapInfo => "Simulated Universe Map File";
|
||||
public string ChessRogueRoom => "Simulated Universe DLC";
|
||||
public string ChessRogueRoomInfo => "Simulated Universe DLC File";
|
||||
public string SummonUnit => "Summon Unit";
|
||||
public string SummonUnitInfo => "Summon Unit File";
|
||||
public string RogueTournRoom => "Divergent Rogue Room";
|
||||
public string RogueTournRoomInfo => "Divergent Rogue Room File";
|
||||
public string TypesOfRogue => "types of rogue";
|
||||
public string RogueMagicRoom => "Unknowable Domain Room";
|
||||
public string RogueMagicRoomInfo => "Unknowable Domain Room File";
|
||||
public string RogueDiceSurface => "Dice Surface Effect";
|
||||
public string RogueDiceSurfaceInfo => "Dice Surface Effect File";
|
||||
public string AdventureModifier => "AdventureModifier";
|
||||
public string AdventureModifierInfo => "AdventureModifier File";
|
||||
public string RogueMapGen => "RogueMapGen File";
|
||||
public string RogueMiracleGroup => "RogueMiracleGroup File";
|
||||
public string RogueMiracleEffectGen => "RogueMiracleEffectGen File";
|
||||
|
||||
public string DatabaseAccount => "Database Account";
|
||||
public string Tutorial => "Tutorial";
|
||||
}
|
||||
@@ -245,10 +202,11 @@ public class ValkTextEN
|
||||
public class GiveAllTextEN
|
||||
{
|
||||
public string Desc => "Give all items of specified type\n" +
|
||||
"weapon: weapons";
|
||||
"weapon,stigmata";
|
||||
|
||||
public string Usage =>
|
||||
"Usage: /giveall weapon";
|
||||
"Usage: /giveall weapon\n\n" +
|
||||
"Usage: /giveall stigmata";
|
||||
|
||||
public string GiveAllItems => "Granted all {0}";
|
||||
}
|
||||
|
||||
@@ -16,7 +16,19 @@ public class CommandGiveall : ICommands
|
||||
{
|
||||
var item = await arg.Target!.Player!.InventoryManager!.AddItem(conf.ID, 1, ItemMainTypeEnum.Weapon, conf.MaxLv, sync:false);
|
||||
}
|
||||
await arg.Target!.Player!.SyncWeapon();
|
||||
await arg.Target!.Player!.SyncInventory();
|
||||
await arg.SendMsg(I18NManager.Translate("Game.Command.GiveAll.GiveAllItems", I18NManager.Translate("Word.Weapon")));
|
||||
}
|
||||
|
||||
[CommandMethod("stigmata")]
|
||||
public async ValueTask GiveStigmata(CommandArg arg)
|
||||
{
|
||||
if (!await arg.CheckOnlineTarget()) return;
|
||||
foreach (var conf in GameData.StigmataData.Values.Where(stigmata => stigmata.Rarity == stigmata.MaxRarity))
|
||||
{
|
||||
var item = await arg.Target!.Player!.InventoryManager!.AddItem(conf.ID, 1, ItemMainTypeEnum.Stigmata, conf.MaxLv, sync: false);
|
||||
}
|
||||
await arg.Target!.Player!.SyncInventory();
|
||||
await arg.SendMsg(I18NManager.Translate("Game.Command.GiveAll.GiveAllItems", I18NManager.Translate("Word.Stigmata")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,10 @@ public class InventoryManager(PlayerInstance player) : BasePlayerManager(player)
|
||||
if (weaponConfig == null) return null;
|
||||
itemData = await PutItem(itemId, 1, type, level, equipAvatar: equipAvatar, uniqueId: ++Data.NextUniqueId);
|
||||
break;
|
||||
case ItemMainTypeEnum.Stigmata:
|
||||
GameData.StigmataData.TryGetValue(itemId, out var stigmataConfig);
|
||||
itemData = await PutItem(itemId, 1, type, level, uniqueId: ++Data.NextUniqueId);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -63,7 +67,6 @@ public class InventoryManager(PlayerInstance player) : BasePlayerManager(player)
|
||||
item = oldItem;
|
||||
break;
|
||||
}
|
||||
|
||||
Data.MaterialItems.Add(item);
|
||||
break;
|
||||
case ItemMainTypeEnum.Weapon:
|
||||
@@ -71,7 +74,6 @@ public class InventoryManager(PlayerInstance player) : BasePlayerManager(player)
|
||||
{
|
||||
return item;
|
||||
}
|
||||
|
||||
Data.WeaponItems.Add(item);
|
||||
break;
|
||||
case ItemMainTypeEnum.Stigmata:
|
||||
|
||||
@@ -111,7 +111,7 @@ public class PlayerInstance(PlayerData data)
|
||||
return Data.ToProto();
|
||||
}
|
||||
|
||||
public async ValueTask SyncWeapon()
|
||||
public async ValueTask SyncInventory()
|
||||
{
|
||||
await SendPacket(new PacketGetEquipmentDataRsp(this));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ using Google.Protobuf.Collections;
|
||||
using KianaBH.Data;
|
||||
using KianaBH.KcpSharp;
|
||||
using KianaBH.Proto;
|
||||
using KianaBH.Util.Extensions;
|
||||
|
||||
namespace KianaBH.GameServer.Server.Packet.Send.Activity;
|
||||
|
||||
@@ -31,8 +30,6 @@ public class PacketGeneralActivityGetMainInfoRsp : BasePacket
|
||||
ExchangeTimes = 1,
|
||||
};
|
||||
|
||||
|
||||
|
||||
return activity;
|
||||
});
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@ public class PacketGetEquipmentDataRsp : BasePacket
|
||||
{
|
||||
var proto = new GetEquipmentDataRsp
|
||||
{
|
||||
WeaponList = { player.InventoryManager!.Data.WeaponItems.Select(weapon => weapon.ToWeaponProto()) }
|
||||
WeaponList = { player.InventoryManager!.Data.WeaponItems.Select(weapon => weapon.ToWeaponProto()) },
|
||||
StigmataList = { player.InventoryManager!.Data.StigmataItems.Select(stigmata => stigmata.ToStigmataProto()) },
|
||||
MaterialList = { player.InventoryManager!.Data.MaterialItems.Select(material => material.ToMaterialProto()) }
|
||||
};
|
||||
|
||||
SetData(proto);
|
||||
|
||||
Reference in New Issue
Block a user