منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   تطوير سيرفرات كونكر (https://code.vpscairo.com/forumdisplay.php?f=11)
-   -   ArenaRooms Fijxed (https://code.vpscairo.com/showthread.php?t=5078)

shkaoa 2021-09-05 01:06 AM

ArenaRooms Fijxed
 
اول حجه هتدخل عل Npc

ضيف
#region ArenaRooms
case 65254:
{
dialog.Avatar(220);
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Select any Arena Room you want to fight.\n");
dialog.Option("FB && SS.", 12);
dialog.Option("All skills.", 13);
dialog.Option("No~thanks.", 255);
dialog.Send();
break;
}
case 12:
{
dialog.Text("Hi~" + client.Player.Name + ",~There~is~5~Arena~rooms,~every~one~you~can~join~ but~you~must~pay.\n");
dialog.Text("The~First~Room,~To~able~join~you~must ~pay~100m~CPs.\n");
dialog.Text("The~Second~Room,~To~able~join~you~mus t~pay~200m~CPs.\n");
dialog.Text("The~Third~Room,~To~able~join~you~must ~pay~300m~CPs.\n");
dialog.Text("The~Fourth~Room,~To~able~join~you~mus t~pay~400m~CPs.\n");
dialog.Text("The~Fifth~Room,~To~able~join~you~must ~pay~500m~CPs.\n");
dialog.Option("Select~any~room~you~want.", 1);
dialog.Option("No~thanks.", 255);
dialog.Send();
break;
}
case 13:
{
dialog.Text("Hi~" + client.Player.Name + ",~There~is~5~Arena~rooms,~every~one~you~can~join~ but~you~must~pay.\n");
dialog.Text("The~First~Room,~To~able~join~you~must ~pay~100m~CPs.\n");
dialog.Text("The~Second~Room,~To~able~join~you~mus t~pay~200m~CPs.\n");
dialog.Text("The~Third~Room,~To~able~join~you~must ~pay~300m~CPs.\n");
dialog.Text("The~Fourth~Room,~To~able~join~you~mus t~pay~400m~CPs.\n");
dialog.Text("The~Fifth~Room,~To~able~join~you~must ~pay~500m~CPs.\n");
dialog.Option("Select~any~room~you~want.", 14);
dialog.Option("No~thanks.", 255);
dialog.Send();
break;
}
case 14:
{
dialog.Text("Select one of the five rooms.");
dialog.Option("First~Room [100m CPs]", 15);
dialog.Option("Second~Room [200m CPs]", 16);
dialog.Option("Third~Room [300m CPs]", 17);
dialog.Option("Fourth~Room [400m CPs]", 18);
dialog.Option("Fifth~Room [500m CPs]", 19);
dialog.Option("No thanks.", 255);
dialog.Send();
break;
}
case 1:
{
ConquerItem RightWeapon = client.Equipment.TryGetItem(ConquerItem.RightWeapo n);
ConquerItem LeftWeapon = client.Equipment.TryGetItem(ConquerItem.LeftWeapon );
if (RightWeapon != null && RightWeapon.ID != 0 && !PacketHandler.IsTwoHand(RightWeapon.ID) || LeftWeapon != null && LeftWeapon.ID != 0 && !PacketHandler.IsTwoHand(LeftWeapon.ID))
{
if (RightWeapon.ID.ToString().StartsWith("410") || LeftWeapon.ID.ToString().StartsWith("410") || RightWeapon.ID.ToString().StartsWith("420") || LeftWeapon.ID.ToString().StartsWith("420"))
{
dialog.Text("Select one of the five rooms.");
dialog.Option("First~Room [100m CPs]", 2);
dialog.Option("Second~Room [200m CPs]", 3);
dialog.Option("Third~Room [300m CPs]", 4);
dialog.Option("Fourth~Room [400m CPs]", 5);
dialog.Option("Fifth~Room [500m CPs]", 6);
dialog.Option("No thanks.", 255);
dialog.Send();
}
else
{
dialog.Text("You should wear a Blade or Sword..");
dialog.Option("I'll get one.", 255);
dialog.Send();
}
}
else
{
dialog.Text("You should wear a Blade or Sword..");
dialog.Option("I'll get one.", 255);
dialog.Send();
}
break;
}
case 2:
{
dialog.Text("Are you sure you wanto to pay 100m CPs to join the First Room.");
dialog.Option("Yes i'm sure", 7);
dialog.Option("No no i'm not sure", 255);
dialog.Send();
break;
}
case 3:
{
dialog.Text("Are you sure you wanto to pay 200m CPs to join the Second Room.");
dialog.Option("Yes i'm sure", 8);
dialog.Option("No no i'm not sure", 255);
dialog.Send();
break;
}
case 4:
{
dialog.Text("Are you sure you wanto to pay 300m CPs to join the Third Room.");
dialog.Option("Yes i'm sure", 9);
dialog.Option("No no i'm not sure", 255);
dialog.Send();
break;
}
case 5:
{
dialog.Text("Are you sure you wanto to pay 400m CPs to join the Fourth Room.");
dialog.Option("Yes i'm sure", 10);
dialog.Option("No no i'm not sure", 255);
dialog.Send();
break;
}
case 6:
{
dialog.Text("Are you sure you wanto to pay 500m CPs to join the Fifth Room.");
dialog.Option("Yes i'm sure", 11);
dialog.Option("No no i'm not sure", 255);
dialog.Send();
break;
}
case 7:
{
if (client.Player.ConquerPoints >= 100000000)
{
client.Player.ConquerPoints -= 100000000;
client.Player.Teleport(3001, 50, 50);
}
break;
}
case 8:
{
if (client.Player.ConquerPoints >= 200000000)
{
client.Player.ConquerPoints -= 200000000;
client.Player.Teleport(3002, 50, 50);
}
break;
}
case 9:
{
if (client.Player.ConquerPoints >= 300000000)
{
client.Player.ConquerPoints -= 300000000;
client.Player.Teleport(3003, 50, 50);
}
break;
}
case 10:
{
if (client.Player.ConquerPoints >= 400000000)
{
client.Player.ConquerPoints -= 400000000;
client.Player.Teleport(3004, 50, 50);
}
break;
}
case 11:
{
if (client.Player.ConquerPoints >= 500000000)
{
client.Player.ConquerPoints -= 500000000;
client.Player.Teleport(3005, 50, 50);
}
break;
}
case 15:
{
if (client.Player.ConquerPoints >= 100000000)
{
client.Player.ConquerPoints -= 100000000;
client.Player.Teleport(3006, 50, 50);
}
break;
}
case 16:
{
if (client.Player.ConquerPoints >= 200000000)
{
client.Player.ConquerPoints -= 200000000;
client.Player.Teleport(3007, 50, 50);
}
break;
}
case 17:
{
if (client.Player.ConquerPoints >= 300000000)
{
client.Player.ConquerPoints -= 300000000;
client.Player.Teleport(3008, 50, 50);
}
break;
}
case 18:
{
if (client.Player.ConquerPoints >= 400000000)
{
client.Player.ConquerPoints -= 400000000;
client.Player.Teleport(3009, 50, 50);
}
break;
}
case 19:
{
if (client.Player.ConquerPoints >= 500000000)
{
client.Player.ConquerPoints -= 500000000;
client.Player.Teleport(3010, 50, 50);
}
break;
}
}
break;
}
case 65255:
case 65256:
case 65257:
case 65258:
case 65259:
case 65260:
case 65261:
case 65262:
case 65263:
case 65264:
{
dialog.Avatar(225);
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Hi~" + client.Player.Name + ",~Do you want to leave and take your cps.\n");
dialog.Option("Yes.", 1);
dialog.Option("No, I'll stay here.", 255);
dialog.Send();
break;
}
case 1:
{
if (client.Player.ContainsFlag(Update.Flags.Ghost))
{
return;
}
if (client.Player.Hitpoints >= 1)
{

if (client.Player.MapID == 3001 || client.Player.MapID == 3006)
{
client.Player.Teleport(1002, 295, 266);
client.Player.ConquerPoints += 100000000;
}
}
if (client.Player.ContainsFlag(Update.Flags.Ghost))
{
return;
}
if (client.Player.Hitpoints >= 1)
{
if (client.Player.MapID == 3002 || client.Player.MapID == 3007)
{
client.Player.Teleport(1002, 295, 266);
client.Player.ConquerPoints += 200000000;
}
}
if (client.Player.ContainsFlag(Update.Flags.Ghost))
{
return;
}
if (client.Player.Hitpoints >= 1)
{
if (client.Player.MapID == 3003 || client.Player.MapID == 3008)
{
client.Player.Teleport(1002, 295, 266);
client.Player.ConquerPoints += 300000000;
}
}
if (client.Player.ContainsFlag(Update.Flags.Ghost))
{
return;
}
if (client.Player.Hitpoints >= 1)
{
if (client.Player.MapID == 3004 || client.Player.MapID == 3009)
{
client.Player.Teleport(1002, 295, 266);
client.Player.ConquerPoints += 400000000;
}
}
if (client.Player.ContainsFlag(Update.Flags.Ghost))
{
return;
}
if (client.Player.Hitpoints >= 1)
{
if (client.Player.MapID == 3005 || client.Player.MapID == 3010)
{
client.Player.Teleport(1002, 295, 266);
client.Player.ConquerPoints += 500000000;
}

}

break;
}
}
break;
}
#endregion



بعد كدا هتدخل عل

GameState.cs

هتبحث عن private void ShutDown()
{

ضيف دول تحتها

بعدا كدا هتدخل عل

Entity.cs

هتحبث عن

public void Die(Entity killer)
{
try
{

ضيف دول تحتها

#region Arena Rooms
if (EntityFlag == EntityFlag.Entity)
{
if (killer.EntityFlag == EntityFlag.Entity)
{
if (killer.MapID == 3001 || killer.MapID == 3006)
{
PacketHandler.WorldMessage("Congratulations! " + killer.Name + " has attack " + Owner.Player.Name + " in Arena Room and win 200,000,000 Cps.");
killer.ConquerPoints += 200000000;
killer.Teleport(1002, 295, 266);
killer.Action = Enums.ConquerAction.Angry;
Data buffer = new Data(true) { UID = killer.UID, dwParam = killer.Action };
killer.SendScreen(buffer);
Owner.Player.Teleport(1002, 295, 268);
}
if (killer.MapID == 3002 || killer.MapID == 3007)
{
PacketHandler.WorldMessage("Congratulations! " + killer.Name + " has attack " + Owner.Player.Name + " in Arena Room and win 400,000,000 Cps.");
killer.ConquerPoints += 400000000;
killer.Teleport(1002, 295, 266);
killer.Action = Enums.ConquerAction.Angry;
Data buffer = new Data(true) { UID = killer.UID, dwParam = killer.Action };
killer.SendScreen(buffer);
Owner.Player.Teleport(1002, 295, 268);
}
if (killer.MapID == 3003 || killer.MapID == 3008)
{
PacketHandler.WorldMessage("Congratulations! " + killer.Name + " has attack " + Owner.Player.Name + " in Arena Room and win 600,000,000 Cps.");
killer.ConquerPoints += 600000000;
killer.Teleport(1002, 295, 266);
killer.Action = Enums.ConquerAction.Angry;
Data buffer = new Data(true) { UID = killer.UID, dwParam = killer.Action };
killer.SendScreen(buffer);
Owner.Player.Teleport(1002, 295, 268);
}
if (killer.MapID == 3004 || killer.MapID == 3009)
{
PacketHandler.WorldMessage("Congratulations! " + killer.Name + " has attack " + Owner.Player.Name + " in Arena Room and win 800,000,000 Cps.");
killer.ConquerPoints += 800000000;
killer.Teleport(1002, 295, 266);
killer.Action = Enums.ConquerAction.Angry;
Data buffer = new Data(true) { UID = killer.UID, dwParam = killer.Action };
killer.SendScreen(buffer);
Owner.Player.Teleport(1002, 295, 268);
}
if (killer.MapID == 3005 || killer.MapID == 3010)
{
PacketHandler.WorldMessage("Congratulations! " + killer.Name + " has attack " + Owner.Player.Name + " in Arena Room and win 1,000,000,000 Cps.");
killer.ConquerPoints += 1000000000;
killer.Teleport(1002, 295, 266);
killer.Action = Enums.ConquerAction.Angry;
Data buffer = new Data(true) { UID = killer.UID, dwParam = killer.Action };
killer.SendScreen(buffer);
Owner.Player.Teleport(1002, 295, 268);
}
}
}
#endregion

بعد كدا اعمل كلاس وسميه

CrossPoker.cs

ضيف دول في

using ProtoBuf;
using Mrkhled.Client;
using Mrkhled.Network;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class CMsgTexasExMatchFieldList
{
public enum MatchFieldListAction : uint
{
View = 1
}
[ProtoContract]
public class TexasExMatchFieldList
{
[ProtoMember(1, IsRequired = true)]
public MatchFieldListAction Action;
[ProtoMember(2, IsRequired = true)]
public Room[] Rooms;
}
[ProtoContract]
public class Room
{
[ProtoMember(1, IsRequired = true)]
public uint ID;
[ProtoMember(2, IsRequired = true)]
public uint PlayersCount;
}
public void Tabele(GameState client)
{
var tele = new TexasExMatchFieldList();
tele.Action = MatchFieldListAction.View;
tele.Rooms = new Room[10];
tele.Rooms[0] = new Room() { ID = 1003, PlayersCount = 101 };
tele.Rooms[1] = new Room() { ID = 1010, PlayersCount = 102 };
tele.Rooms[2] = new Room() { ID = 1017, PlayersCount = 103 };
tele.Rooms[3] = new Room() { ID = 1031, PlayersCount = 104 };
tele.Rooms[4] = new Room() { ID = 1038, PlayersCount = 105 };
tele.Rooms[5] = new Room() { ID = 1045, PlayersCount = 106 };
tele.Rooms[6] = new Room() { ID = 1053, PlayersCount = 107 };
tele.Rooms[7] = new Room() { ID = 1060, PlayersCount = 108 };
tele.Rooms[8] = new Room() { ID = 1173, PlayersCount = 109 };
tele.Rooms[9] = new Room() { ID = 1180, PlayersCount = 110 };
client.Send(SendPacket(tele));
}
public static byte[] SendPacket(TexasExMatchFieldList obj)
{
byte[] buffer;
using (var ms = new System.IO.MemoryStream())
{
ProtoBuf.Serializer.Serialize<Room[]>(ms, obj.Rooms);
buffer = ms.ToArray();
}
byte[] array = new byte[4 + 8 + buffer.Length];
System.Buffer.BlockCopy(buffer, 0, array, 4, buffer.Length);
// Writer.WriteUInt16((ushort)(array.Length - 😎, 0, array);
Writer.WriteUInt16(Mrkhled.Network.GamePackets.Pac ketID.CMsgTexasExMatchFieldList, 2, array);
return array;
}
}


بس كدا تمام الاضافه كلها فول فكسد

تدخل بقا عل النفي كات

65254 الايدي ArenaRoom الاسم 2 ايدي عادي 24076 لوك فيس 1002 ماب تون سيتي 292 293 مكان ال هتحط في الراجل ف التون وشكرا

:harhar1:

badroobot 2022-03-06 01:58 AM

رد: ArenaRooms Fijxed
 
عاش

shekovevo21 2022-03-06 02:26 AM

رد: ArenaRooms Fijxed
 
مفيش لسورس اليكس


الساعة الآن 08:24 AM

مرحبا بكم في منتدي اكواد لتطوير الالعاب