المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : System Arena Room 100%


Saad Hydra
2023-10-02, 08:52 PM
بسم الله الرحمان الرحيم
اسلام عليكم ورحمه الله وبركاته

دا سيستم ارينا روم يعني كل واحد يعمل روم ب باسورد خاص بيه
السيستم ده مش موجود ع النت
نخش ع الاضافه

ضيف ده في npc
#region Custom Room
case 45422:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Would You Like to Join Or Make A Custom Room ?!");
dialog.Option("Yes, Please.", 1);
dialog.Option("Have a good day.", 255);
dialog.Send();
break;
}
case 1:
{

dialog.Text("Please Type The Room`s Password");
dialog.Input("Password : ", 2, 15);
dialog.Option("Never mind.", 255);
dialog.Send();
break;
}
case 2:
{
string password = npcRequest.Input;
if (Kernel.CustomRoomMaps.ContainsKey(password))
{
client.Player.CustomRoomScore = 0;
client.Player.Teleport(1005, Kernel.CustomRoomMaps[password], (ushort)Kernel.Random.Next(35, 70), (ushort)Kernel.Random.Next(35, 70));
}
else
{

Map arena = Kernel.Maps[1005];
Map CustomRoom = arena.MakeDynamicMap();
CustomRoom.WasPKFree = true;
Kernel.CustomRoomMaps.Add(password, CustomRoom.ID);
client.Player.CustomRoomScore = 0;
client.Player.Teleport(1005, CustomRoom.ID, (ushort)Kernel.Random.Next(35, 70), (ushort)Kernel.Random.Next(35, 70));
}
break;
}
}
break;
}
#endregion
Entity او Player ضيف ده
public ushort CustomRoomScore;
ضيف ده في kernel
public static Dictionary<string, ushort> CustomRoomMaps = new Dictionary<string, ushort>();
و اخر حاجه ابحث عن ده في Handle
if (!(attacked.Name.Contains("Guard") && attacked.EntityFlag == EntityFlag.Monster))
و ارمي ده فيه

if (Kernel.CustomRoomMaps.Values.Contains(attacker.Ma pID))
{

damage = 1;
attacker.Hitpoints = attacker.MaxHitpoints;
attacked.Hitpoints = attacked.MaxHitpoints;
attacker.CustomRoomScore++;

string[] scoreMessages = new string[50];
scoreMessages[0] = attacker.Name + " : " + attacker.CustomRoomScore;
int count = 0;

Message msg = new Message(scoreMessages[count], System.Drawing.Color.Red, count == 1 ? Message.FirstRightCorner : Message.ContinueRightCorner);
Kernel.SendWorldMessage(msg, Program.Values);
foreach (var client in Program.Values)
{

if (client.Map.ID == attacker.MapID)
{
count++;

scoreMessages[count] = client.Player.Name + " : " + client.Player.CustomRoomScore;
Message msg1 = new Message(scoreMessages[count], System.Drawing.Color.Red, count == 1 ? Message.FirstRightCorner : Message.ContinueRightCorner);
Kernel.SendWorldMessage(msg1, Program.Values);

}
}

}
بس كده و حط الانبسي في القاعده و مبروك عليك