mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 15:44:01 +00:00
auto add girl to room & favor to lvl 500
This commit is contained in:
@@ -375,6 +375,9 @@ public class PlayerInstance(PlayerGameData data)
|
|||||||
yield return (4, guide.ID, 999);
|
yield return (4, guide.ID, 999);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (uint favor = 1; favor <= 50; favor++)
|
||||||
|
yield return (101, favor * 50, 500);
|
||||||
|
|
||||||
// Main Scene 0 mean default scene
|
// Main Scene 0 mean default scene
|
||||||
yield return (132, 1, 0);
|
yield return (132, 1, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,15 @@ public class GirlRegister : IHouseFuncHandler
|
|||||||
if (root == null) return;
|
if (root == null) return;
|
||||||
|
|
||||||
var girlId = HouseJson.NumField(root, "GirlId");
|
var girlId = HouseJson.NumField(root, "GirlId");
|
||||||
|
var floorId = HouseJson.NumField(root, "FloorId");
|
||||||
var sync = new NtfSyncPlayer();
|
var sync = new NtfSyncPlayer();
|
||||||
if (girlId > 0)
|
if (girlId > 0)
|
||||||
|
{
|
||||||
|
var bedroomSid = HouseAttr.GetNextBedroomSid(connection.Player!, (uint)floorId);
|
||||||
await HouseAttr.SetAsync(connection, HouseAttr.GirlRoomNumSid(girlId), HouseAttr.BedroomRegisteredNoRoom, sync);
|
await HouseAttr.SetAsync(connection, HouseAttr.GirlRoomNumSid(girlId), HouseAttr.BedroomRegisteredNoRoom, sync);
|
||||||
|
if (bedroomSid != 0) await HouseAttr.SetAsync(connection, bedroomSid, (uint)girlId, sync);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
await CallGSRouter.SendScript(connection, "House_Request", HouseRequestScript.Synthesize(root), sync);
|
await CallGSRouter.SendScript(connection, "House_Request", HouseRequestScript.Synthesize(root), sync);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ internal static class HouseAttr
|
|||||||
internal const uint BedroomStartSid = 2550;
|
internal const uint BedroomStartSid = 2550;
|
||||||
internal const uint BedroomRegisteredNoRoom = 100;
|
internal const uint BedroomRegisteredNoRoom = 100;
|
||||||
internal const uint PlayerRingInfoSidBase = 3174;
|
internal const uint PlayerRingInfoSidBase = 3174;
|
||||||
|
internal const uint BedroomPerFloor = 8;
|
||||||
|
|
||||||
internal static uint Read(PlayerInstance player, uint sid)
|
internal static uint Read(PlayerInstance player, uint sid)
|
||||||
{
|
{
|
||||||
@@ -175,6 +176,25 @@ internal static class HouseAttr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static uint GetNextBedroomSid(PlayerInstance player, uint floorId)
|
||||||
|
{
|
||||||
|
var floorStartSid = BedroomStartSid + ((floorId - 2) * BedroomPerFloor) + 1;
|
||||||
|
|
||||||
|
for (uint i = 0; i < BedroomPerFloor; i++)
|
||||||
|
{
|
||||||
|
var sid = floorStartSid + i;
|
||||||
|
|
||||||
|
var exists = player.Data.Attrs.Any(x =>
|
||||||
|
x.Gid == Gid &&
|
||||||
|
x.Sid == sid);
|
||||||
|
|
||||||
|
if (!exists)
|
||||||
|
return sid;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
internal static uint PackArcadePropUse(int type, int id, ushort count) =>
|
internal static uint PackArcadePropUse(int type, int id, ushort count) =>
|
||||||
(((uint)count & 0xffffu) << 16) | (((uint)id & 0xffu) << 8) | ((uint)type & 0xffu);
|
(((uint)count & 0xffffu) << 16) | (((uint)id & 0xffu) << 8) | ((uint)type & 0xffu);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user