محمد ياسر
2019-05-06, 12:56 PM
حرب البلالين الحرب ده قديمه كانت موجوده علي تيم اكسور قبل ما يقفل فانا انزلهالكم دلوقتي
هتعمل كلاس جديد جوا
Database
باسم
LegoBallon.cs
وهتشيل كل اللى جواه وتحط دا مكانو
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LeGoOo.Database
{
class LegoBallon
{
public static string Name = "";
public static uint UID, Point;
public static void LoadRates()
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("LegoBallon").Where("Coder", "LeGoOo");
Mr.Monk.Database.MySqlReader r = new Mr.Monk.Database.MySqlReader(cmd);
if (r.Read())
{
Name = r.ReadString("Name");
UID = r.ReadUInt32("UID");
Point = r.ReadUInt32("Point");
}
Console.WriteLine("Child Day Table Loaded.");
r.Close();
r.Dispose();
}
public static void InsertLegoBallon(Client.GameState Client)
{
MySqlCommand cmds = new MySqlCommand(MySqlCommandType.INSERT);
cmds.Insert("LegoBallon").Insert("UID", Client.Entity.UID).Insert("Name", Client.Entity.Name).Execute();
}
}
}
بعد كدا هتخش على ملف
world.cs
,خط ده
#region LegoBallon Map
if (client.Entity.MapID == 2750)
{
if (client.Entity.Action == Game.Enums.ConquerAction.Jump)
{
client.Send(new LeGoOo.Network.GamePackets.Message("It is forbiden to move", System.Drawing.Color.Red, Network.GamePackets.Message.SistemaVioleta));
client.Entity.Teleport(2750, 051, 049);
}
}
#endregion
وفي Npcs حط
#region LegoBallon
case 14652:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("hello, i can give to you 10 darts to throw towards the colourful ballons.");
dialog.Option("Enter the field", 1);
dialog.Option("Claim 10 darts", 2);
dialog.Option("Prizes", 3);
dialog.Option("View the high scores", 4);
dialog.Option("Sounds interesting", 255);
break;
}
case 1:
{
if (client.Entity.Level >= 80)
{
client.Entity.Teleport(2750, 051, 049);
Database.LegoBallon.InsertLegoBallon(client);
break;
}
else
{
dialog.Text("Sorry you must reach level 80 at first.");
dialog.Option("okey", 255);
break;
}
}
case 2:
{
if (client.Entity.VIPLevel >= 1)
{
client.Inventory.Add(723477, 0, 15);
}
else
{
client.Inventory.Add(723477, 0, 10);
}
break;
}
case 3:
{
dialog.Text("If you are vip member you will get double prize,");
dialog.Text("The high score owner will get the prize.");
dialog.Option("okey", 255);
break;
}
case 4:
{
dialog.Text("Currently ,The best score is " + Database.LegoBallon.Point + " owner " + Database.LegoBallon.Name + ".");
dialog.Option("okey", 255);
break;
}
}
break;
}
#endregion
#region 1-PointBalloon
case 14653:
case 14654:
case 14655:
{
byte[] Buf = new byte[150 + 8];
Writer.WriteUInt16(150, 0, Buf);//Packet Lenght
Writer.WriteUInt16(6005, 2, Buf);//Status Packet Id
Writer.WriteUInt32(client.Entity.UID, 4, Buf);//Client Id
Writer.WriteUInt32(227, 8, Buf);// Switch
Writer.WriteUInt32(164, 20, Buf); //StatusTypes.AzureShield
Writer.WriteUInt32(1, 22, Buf); //StatusTypes.AzureShield
Writer.WriteUInt32(3, 32, Buf);//Time duration for the effect
Writer.WriteUInt32(1, 37, Buf);//Damage Coused by the skill
Writer.WriteUInt32(30, 38, Buf);//Damage Coused by the skill
Writer.WriteString("Throwing", 39, Buf);
client.Send(Buf);
break;
}
#endregion
#region 2-PointBalloon
#endregion
#region 3-PointBalloon
#endregion
#region 5-PointBalloon
#endregion
وبعد كدا نرفع الكام كود دول على النافى كات
-- ----------------------------
-- Table structure for LegoBallon
-- ----------------------------
DROP TABLE IF EXISTS `LegoBallon`;
CREATE TABLE `LegoBallon` (
`Name` char(20) NOT NULL,
`UID` bigint(18) NOT NULL,
`Point` bigint(18) NOT NULL DEFAULT '0',
PRIMARY KEY (`UID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of LegoBallon
-- ----------------------------
INSERT INTO `LegoBallon` VALUES ('LeGoOo[TQ]', '1030525', '0');
INSERT INTO `maps` VALUES ('2750', '1004', '65544', '0000');
INSERT INTO `npcs` VALUES ('14652', '0', '0', 'TigerLee', '0002', '1181', '-1', '1002', '0429', '0389', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0', '0', '0', '0', '', '0000', '00', '00', '0000', '00', null);
INSERT INTO `npcs` VALUES ('14653', '0', '0', '1-PointBalloon', '0000', '9970', '-1', '0000', '2750', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0', '0', '0', '0', '', '0000', '00', '00', '0000', '00', null);
INSERT INTO `npcs` VALUES ('14654', '0', '0', '1-PointBalloon', '0000', '9970', '-1', '0000', '2750', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0', '0', '0', '0', '', '0000', '00', '00', '0000', '00', null);
INSERT INTO `npcs` VALUES ('14655', '0', '0', '1-PointBalloon', '0000', '9970', '-1', '0000', '2750', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0', '0', '0', '0', '', '0000', '00', '00', '0000', '00', null);
هتعمل كلاس جديد جوا
Database
باسم
LegoBallon.cs
وهتشيل كل اللى جواه وتحط دا مكانو
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LeGoOo.Database
{
class LegoBallon
{
public static string Name = "";
public static uint UID, Point;
public static void LoadRates()
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("LegoBallon").Where("Coder", "LeGoOo");
Mr.Monk.Database.MySqlReader r = new Mr.Monk.Database.MySqlReader(cmd);
if (r.Read())
{
Name = r.ReadString("Name");
UID = r.ReadUInt32("UID");
Point = r.ReadUInt32("Point");
}
Console.WriteLine("Child Day Table Loaded.");
r.Close();
r.Dispose();
}
public static void InsertLegoBallon(Client.GameState Client)
{
MySqlCommand cmds = new MySqlCommand(MySqlCommandType.INSERT);
cmds.Insert("LegoBallon").Insert("UID", Client.Entity.UID).Insert("Name", Client.Entity.Name).Execute();
}
}
}
بعد كدا هتخش على ملف
world.cs
,خط ده
#region LegoBallon Map
if (client.Entity.MapID == 2750)
{
if (client.Entity.Action == Game.Enums.ConquerAction.Jump)
{
client.Send(new LeGoOo.Network.GamePackets.Message("It is forbiden to move", System.Drawing.Color.Red, Network.GamePackets.Message.SistemaVioleta));
client.Entity.Teleport(2750, 051, 049);
}
}
#endregion
وفي Npcs حط
#region LegoBallon
case 14652:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("hello, i can give to you 10 darts to throw towards the colourful ballons.");
dialog.Option("Enter the field", 1);
dialog.Option("Claim 10 darts", 2);
dialog.Option("Prizes", 3);
dialog.Option("View the high scores", 4);
dialog.Option("Sounds interesting", 255);
break;
}
case 1:
{
if (client.Entity.Level >= 80)
{
client.Entity.Teleport(2750, 051, 049);
Database.LegoBallon.InsertLegoBallon(client);
break;
}
else
{
dialog.Text("Sorry you must reach level 80 at first.");
dialog.Option("okey", 255);
break;
}
}
case 2:
{
if (client.Entity.VIPLevel >= 1)
{
client.Inventory.Add(723477, 0, 15);
}
else
{
client.Inventory.Add(723477, 0, 10);
}
break;
}
case 3:
{
dialog.Text("If you are vip member you will get double prize,");
dialog.Text("The high score owner will get the prize.");
dialog.Option("okey", 255);
break;
}
case 4:
{
dialog.Text("Currently ,The best score is " + Database.LegoBallon.Point + " owner " + Database.LegoBallon.Name + ".");
dialog.Option("okey", 255);
break;
}
}
break;
}
#endregion
#region 1-PointBalloon
case 14653:
case 14654:
case 14655:
{
byte[] Buf = new byte[150 + 8];
Writer.WriteUInt16(150, 0, Buf);//Packet Lenght
Writer.WriteUInt16(6005, 2, Buf);//Status Packet Id
Writer.WriteUInt32(client.Entity.UID, 4, Buf);//Client Id
Writer.WriteUInt32(227, 8, Buf);// Switch
Writer.WriteUInt32(164, 20, Buf); //StatusTypes.AzureShield
Writer.WriteUInt32(1, 22, Buf); //StatusTypes.AzureShield
Writer.WriteUInt32(3, 32, Buf);//Time duration for the effect
Writer.WriteUInt32(1, 37, Buf);//Damage Coused by the skill
Writer.WriteUInt32(30, 38, Buf);//Damage Coused by the skill
Writer.WriteString("Throwing", 39, Buf);
client.Send(Buf);
break;
}
#endregion
#region 2-PointBalloon
#endregion
#region 3-PointBalloon
#endregion
#region 5-PointBalloon
#endregion
وبعد كدا نرفع الكام كود دول على النافى كات
-- ----------------------------
-- Table structure for LegoBallon
-- ----------------------------
DROP TABLE IF EXISTS `LegoBallon`;
CREATE TABLE `LegoBallon` (
`Name` char(20) NOT NULL,
`UID` bigint(18) NOT NULL,
`Point` bigint(18) NOT NULL DEFAULT '0',
PRIMARY KEY (`UID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of LegoBallon
-- ----------------------------
INSERT INTO `LegoBallon` VALUES ('LeGoOo[TQ]', '1030525', '0');
INSERT INTO `maps` VALUES ('2750', '1004', '65544', '0000');
INSERT INTO `npcs` VALUES ('14652', '0', '0', 'TigerLee', '0002', '1181', '-1', '1002', '0429', '0389', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0', '0', '0', '0', '', '0000', '00', '00', '0000', '00', null);
INSERT INTO `npcs` VALUES ('14653', '0', '0', '1-PointBalloon', '0000', '9970', '-1', '0000', '2750', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0', '0', '0', '0', '', '0000', '00', '00', '0000', '00', null);
INSERT INTO `npcs` VALUES ('14654', '0', '0', '1-PointBalloon', '0000', '9970', '-1', '0000', '2750', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0', '0', '0', '0', '', '0000', '00', '00', '0000', '00', null);
INSERT INTO `npcs` VALUES ('14655', '0', '0', '1-PointBalloon', '0000', '9970', '-1', '0000', '2750', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0', '0', '0', '0', '', '0000', '00', '00', '0000', '00', null);