midoazoz |
2019-12-09 03:45 AM |
FreezeWar بفكره جديده
السلام عليكم في البدايه حابب اشكر ريدار معرفش ليه بس بجد انا بتعلم منه جدا واخويا الكبير ومش انا بس الي بقول كده ربنا يجعله في ميزان حسناته
ثانيه
بمناسبه الموضوع ده
عفواً لايمكن عرض الروابط إلا بعد الرد على الموضوع
انا عملته وخلصته بنسبه 90% او اكتر
عموما هفاجاكم قريب
نخش ع الموضوع فريز وار
الي هي دي
عفواً لايمكن عرض الروابط إلا بعد الرد على الموضوع
نخش ع الاضافات ع طول
================================================== ==========================================
خش يباشا ع الان بي سي
كود PHP:
#region freeze war
case 2413124:
case 2413123:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text(" Ahlan Wsahln " + client.Player.Name + " hda5lk elfreeze war bas lazm elwa2t yb2a xx:40 to xx:42");
dialog.Text("enta ma3ak FreezePoints = [ " + client.Player.FreezePoints + " ] ");
dialog.Option("yla da5lny", 1);
dialog.Option("3awz tbadl el Freeze Points ", 2);
dialog.Send();
break;
}
case 1:
{
if (DateTime.Now.Minute >= 40 && DateTime.Now.Minute <= 42)
{
client.Player.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
client.Player.PKMode = Game.Enums.PKMode.PK;
client.Send(new MsgAction(true) { UID = client.Player.UID, ID = MsgAction.Mode.ChangePKMode, dwParam = (uint)client.Player.PKMode });
client.Player.Update(MsgName.Mode.Effect, "zf2-e360", true);
Random R = new Random();
int Nr = R.Next(1, 10);
if (Nr == 1) client.Player.Teleport(1505, 293, 300);
if (Nr == 2) client.Player.Teleport(1505, 298, 284);
if (Nr == 3) client.Player.Teleport(1505, 314, 284);
if (Nr == 4) client.Player.Teleport(1505, 302, 272);
if (Nr == 5) client.Player.Teleport(1505, 291, 267);
if (Nr == 6) client.Player.Teleport(1505, 321, 273);
if (Nr == 7) client.Player.Teleport(1505, 308, 256);
if (Nr == 8) client.Player.Teleport(1505, 292, 258);
if (Nr == 9) client.Player.Teleport(1505, 278, 294);
if (Nr == 10) client.Player.Teleport(1505, 321, 260);
}
else
{
dialog.Text("Yasta Bt5ta8l 3la xx:40 to xx:42 bs ");
dialog.Send();
}
break;
}
case 2:
{
dialog.Text("ta2dar t8ayr El FreezePoints by ay 7aga mn dool , enta ma3ak " + client.Player.FreezePoints + " FreezePoints ");
dialog.Option("P6DragonSoul[Random][500 Points]", 3);
dialog.Option("P7SoulPack[Random][1000Points]", 4);
dialog.Option("P7WeaponSoulPack[YouWant][1500Points]", 5);
dialog.Option("P7EquipmentSoulPack[YouWant][1500Points]", 6);
dialog.Option("SplendidStarStone[300Points]", 7);
dialog.Send();
break;
}
case 3:
{
if (client.Player.FreezePoints >= 500)
{
client.Player.FreezePoints -= 500;
client.Inventory.Add(3003382, 0, 1);
}
else
{
dialog.Text("Lazm yb2a ma3ak 500 Points");
dialog.Send();
}
break;
}
case 4:
{
if (client.Player.FreezePoints >= 1000)
{
client.Player.FreezePoints -= 1000;
client.Inventory.Add(3008055, 0, 1);
}
else
{
dialog.Text("Lazm yb2a ma3ak 1000 Points");
dialog.Send();
}
break;
}
case 5:
{
if (client.Player.FreezePoints >= 1500)
{
client.Player.FreezePoints -= 1500;
client.Inventory.Add(3004247, 0, 1);
}
else
{
dialog.Text("Lazm yb2a ma3ak 1500 Points");
dialog.Send();
}
break;
}
case 6:
{
if (client.Player.FreezePoints >= 1500)
{
client.Player.FreezePoints -= 1500;
client.Inventory.Add(3004248, 0, 1);
}
else
{
dialog.Text("Lazm yb2a ma3ak 1500 Points");
dialog.Send();
}
break;
}
case 7:
{
if (client.Player.FreezePoints >= 300)
{
client.Player.FreezePoints -= 300;
client.Inventory.Add(3009003, 0, 1);
}
else
{
dialog.Text("Lazm yb2a ma3ak 300 Points");
dialog.Send();
}
break;
}
}
break;
}
#endregion
بعدين في
هتبحث عن
كود PHP:
public void Die(Player killer)
ضيف ده تحت القوس
كود PHP:
#region FreezeWar
if (killer.MapID == 1505)
{
DateTime Now64 = DateTime.Now;
if (Now64.Minute >= 42 && Now64.Minute < 45)
{
if (DateTime.Now >= FrozenTime1.AddSeconds(15))
{
for (uint x = 1; x <= 1; x++)
{
X = X;
Y = Y;
killer.FreezePoints += 10;
Hitpoints = MaxHitpoints;
Stamina = 100;
string Mesage = "";
Mesage = "Your FreezePoints .: " + killer.FreezePoints + "";
MsgTalk msg = new MsgTalk(Mesage, System.Drawing.Color.Red, x == 1 ? MsgTalk.FirstRightCorner : MsgTalk.ContinueRightCorner);
killer.Owner.Send(msg);
RemoveFlag((ulong)MsgUpdate.Flags.Dead);
RemoveFlag((ulong)MsgUpdate.Flags.Ghost);
Teleport(1505, X, Y);
AddFlag((ulong)MsgUpdate.Flags.Freeze);
FrozenTime = 15;
MsgRaceTrackStatus update = new MsgRaceTrackStatus(true);
update.UID = UID;
update.Add(MsgRaceTrackStatus.Freeze, 0, 15);
Owner.SendScreen(update, true);
TransformationID = 0;
Ressurect();
FrozenTime1 = DateTime.Now;
FrozenStamp = Time32.Now;
}
}
else
{
TransformationID = 0;
Ressurect();
Stamina = 100;
Hitpoints = MaxHitpoints;
RemoveFlag((ulong)MsgUpdate.Flags.Dead);
RemoveFlag((ulong)MsgUpdate.Flags.Ghost);
}
return;
}
}
#endregion
طبعا ايرورات سهله
ف اول الكلاس ضيف دول
كود PHP:
public DateTime FrozenTime1;
كود PHP:
public uint FreezePoints;
كود PHP:
public Time32 FrozenStamp;
الي موجود منهم خلاص مش لازم تضيفه
نخش thread
كود PHP:
#region freeze war system
if (Now64.Minute == 40 && Now64.Second == 10)
{
Kernel.SendWorldMessage(new MsgTalk("7arb el Freeze war start ma3ak 2 min 34an tsagl feha !", Color.White, MsgTalk.Center), Kernel.GamePool.Values.ToArray());
foreach (var clientX in Kernel.GamePool.Values)
clientX.MessageBox("7arb el Freeze war start, yla sagl bsr3a? ?",
p => {
p.Player.Teleport(1002, 309, 250);
}, null, 60);
}
if (Now64.Minute == 42 && Now64.Second == 00)
{
foreach (var clientX in Kernel.GamePool.Values)
{
if (clientX.Player.MapID == 1505)
{
Constants.PKForbiddenMaps.Remove(1505);
Constants.PKFreeMaps.Add(1505);
clientX.Player.AddFlag((ulong)MsgUpdate.Flags.Freeze);
Kernel.SendWorldMessage(new MsgTalk("El7arb bdat ya rgala kol wa7d b 10 FreezePoints #33 !", Color.White, MsgTalk.Center), Kernel.GamePool.Values.ToArray());
}
}
}
if (Now64.Minute == 45 && Now64.Second == 00)
{
foreach (var clientX in Kernel.GamePool.Values)
{
if (clientX.Player.MapID == 1505)
{
Constants.PKFreeMaps.Remove(1505);
Constants.PKForbiddenMaps.Add(1505);
clientX.Player.Teleport(1002, 309, 250);
Kernel.SendWorldMessage(new MsgTalk("El7arb 5last ya rgala #33 !", Color.White, MsgTalk.Center), Kernel.GamePool.Values.ToArray());
}
}
}
#endregion
هتبحث عن
ضيف فيها
كود PHP:
#region Freeze
if (client.Player.ContainsFlag((ulong)MsgUpdate.Flags.Freeze))
{
if (Now > client.Player.FrozenStamp.AddSeconds(client.Player.FrozenTime))
{
client.Player.FrozenTime = 0;
client.Player.RemoveFlag((ulong)MsgUpdate.Flags.Freeze);
MsgRaceTrackStatus update = new MsgRaceTrackStatus(true);
update.UID = client.Player.UID;
update.Remove(MsgRaceTrackStatus.Freeze);
client.SendScreen(update, true);
}
}
#endregion
هتخش ع constants.cs
هتبحث ع
ضيف فيها 1505
=================================================
كدا خلصت اضافتي انا في السورسات مسج
اضافه السورسات العاديه مقدمه من HassanEmprator
======================
الان بي سي
كود PHP:
#region freeze war
case 2413124:
case 2413123:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text(" Ahlan Wsahln " + client.Entity.Name + " hda5lk elfreeze war bas lazm elwa2t yb2a xx:40 to xx:42");
dialog.Text("enta ma3ak FreezePoints = [ " + client.Entity.FreezePoints + " ] ");
dialog.Option("yla da5lny", 1);
dialog.Option("3awz tbadl el Freeze Points ", 2);
dialog.Send();
break;
}
case 1:
{
if (DateTime.Now.Minute >= 40 && DateTime.Now.Minute <= 42)
{
client.Entity.RemoveFlag(Update.Flags.Ride);
client.Entity.PKMode = Game.Enums.PKMode.PK;
client.Send(new Data(true) { UID = client.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)client.Entity.PKMode });
client.Entity.Update(_String.Effect, "zf2-e360", true);
Random R = new Random();
int Nr = R.Next(1, 10);
if (Nr == 1) client.Entity.Teleport(1505, 293, 300);
if (Nr == 2) client.Entity.Teleport(1505, 298, 284);
if (Nr == 3) client.Entity.Teleport(1505, 314, 284);
if (Nr == 4) client.Entity.Teleport(1505, 302, 272);
if (Nr == 5) client.Entity.Teleport(1505, 291, 267);
if (Nr == 6) client.Entity.Teleport(1505, 321, 273);
if (Nr == 7) client.Entity.Teleport(1505, 308, 256);
if (Nr == 8) client.Entity.Teleport(1505, 292, 258);
if (Nr == 9) client.Entity.Teleport(1505, 278, 294);
if (Nr == 10) client.Entity.Teleport(1505, 321, 260);
}
else
{
dialog.Text("Yasta Bt5ta8l 3la xx:40 to xx:42 bs ");
dialog.Send();
}
break;
}
case 2:
{
dialog.Text("ta2dar t8ayr El FreezePoints by ay 7aga mn dool , enta ma3ak " + client.Entity.FreezePoints + " FreezePoints ");
dialog.Option("P6DragonSoul[Random][500 Points]", 3);
dialog.Option("P7SoulPack[Random][1000Points]", 4);
dialog.Option("P7WeaponSoulPack[YouWant][1500Points]", 5);
dialog.Option("P7EquipmentSoulPack[YouWant][1500Points]", 6);
dialog.Option("SplendidStarStone[300Points]", 7);
dialog.Send();
break;
}
case 3:
{
if (client.Entity.FreezePoints >= 500)
{
client.Entity.FreezePoints -= 500;
client.Inventory.Add(3003382, 0, 1);
}
else
{
dialog.Text("Lazm yb2a ma3ak 500 Points");
dialog.Send();
}
break;
}
case 4:
{
if (client.Entity.FreezePoints >= 1000)
{
client.Entity.FreezePoints -= 1000;
client.Inventory.Add(3008055, 0, 1);
}
else
{
dialog.Text("Lazm yb2a ma3ak 1000 Points");
dialog.Send();
}
break;
}
case 5:
{
if (client.Entity.FreezePoints >= 1500)
{
client.Entity.FreezePoints -= 1500;
client.Inventory.Add(3004247, 0, 1);
}
else
{
dialog.Text("Lazm yb2a ma3ak 1500 Points");
dialog.Send();
}
break;
}
case 6:
{
if (client.Entity.FreezePoints >= 1500)
{
client.Entity.FreezePoints -= 1500;
client.Inventory.Add(3004248, 0, 1);
}
else
{
dialog.Text("Lazm yb2a ma3ak 1500 Points");
dialog.Send();
}
break;
}
case 7:
{
if (client.Entity.FreezePoints >= 300)
{
client.Entity.FreezePoints -= 300;
client.Inventory.Add(3009003, 0, 1);
}
else
{
dialog.Text("Lazm yb2a ma3ak 300 Points");
dialog.Send();
}
break;
}
}
break;
}
#endregion
ال في entity
كود PHP:
#region FreezeWar
if (killer.MapID == 1505)
{
DateTime Now64 = DateTime.Now;
if (Now64.Minute >= 42 && Now64.Minute < 45)
{
if (DateTime.Now >= FrozenTime1.AddSeconds(15))
{
for (uint x = 1; x <= 1; x++)
{
X = X;
Y = Y;
killer.FreezePoints += 10;
Hitpoints = MaxHitpoints;
Stamina = 100;
string Mesage = "";
Mesage = "Your FreezePoints .: " + killer.FreezePoints + "";
Message msg = new Message(Mesage, System.Drawing.Color.Red, x == 1 ? Message.FirstRightCorner : Message.ContinueRightCorner);
killer.Owner.Send(msg);
RemoveFlag(Network.GamePackets.Update.Flags.Dead);
RemoveFlag(Network.GamePackets.Update.Flags.Ghost);
Teleport(1505, X, Y);
AddFlag(Network.GamePackets.Update.Flags.Freeze);
FrozenTime = 15;
GameCharacterUpdates update = new GameCharacterUpdates(true);
update.UID = UID;
update.Add(GameCharacterUpdates.Freeze, 0, 15);
Owner.SendScreen(update, true);
TransformationID = 0;
Ressurect();
FrozenTime1 = DateTime.Now;
FrozenStamp = Time32.Now;
}
}
else
{
TransformationID = 0;
Ressurect();
Stamina = 100;
Hitpoints = MaxHitpoints;
RemoveFlag(Network.GamePackets.Update.Flags.Dead);
RemoveFlag(Network.GamePackets.Update.Flags.Ghost);
}
return;
}
}
#endregion
الي في world
كود PHP:
#region Frozen
if (client.Entity.ContainsFlag(Update.Flags.Freeze))
{
if (Now > client.Entity.FrozenStamp.AddSeconds(client.Entity.FrozenTime))
{
client.Entity.FrozenD = false;
client.Entity.FrozenTime = 0;
client.Entity.RemoveFlag(Update.Flags.Freeze);
GameCharacterUpdates update = new GameCharacterUpdates(true);
update.UID = client.Entity.UID;
update.Remove(GameCharacterUpdates.Freeze);
client.SendScreen(update, true);
}
}
#endregion
و
كود PHP:
if (Now64.Minute == 40 && Now64.Second == 10)
{
Kernel.SendWorldMessage(new Message("7arb el Freeze war start ma3ak 2 min 34an tsagl feha !", Color.White, Message.Center), Kernel.GamePool.Values.ToArray());
foreach (var clientX in Kernel.GamePool.Values)
clientX.MessageBox("7arb el Freeze war start, yla sagl bsr3a? ?",
p => {
p.Entity.Teleport(1002, 309, 250);
}, null, 60);
}
if (Now64.Minute == 42 && Now64.Second == 00)
{
foreach (var clientX in Kernel.GamePool.Values)
{
if (clientX.Entity.MapID == 1505)
{
Constants.PKForbiddenMaps.Remove(1505);
Constants.PKFreeMaps.Add(1505);
clientX.Entity.AddFlag((Update.Flags.Freeze));
Kernel.SendWorldMessage(new Message("El7arb bdat ya rgala kol wa7d b 10 FreezePoints #33 !", Color.White, Message.Center), Kernel.GamePool.Values.ToArray());
}
}
}
if (Now64.Minute == 45 && Now64.Second == 00)
{
foreach (var clientX in Kernel.GamePool.Values)
{
if (clientX.Entity.MapID == 1505)
{
Constants.PKFreeMaps.Remove(1505);
Constants.PKForbiddenMaps.Add(1505);
clientX.Entity.Teleport(1002, 309, 250);
Kernel.SendWorldMessage(new Message("El7arb 5last ya rgala #33 !", Color.White, Message.Center), Kernel.GamePool.Values.ToArray());
}
}
}
والباقي زي مهو عادي يعني من فوق
=========================================
كده خلصنا من السورس ^_^
نخش ع القاعده
عفواً لايمكن عرض الروابط إلا بعد الرد على الموضوع
عفواً لايمكن عرض الروابط إلا بعد الرد على الموضوع
اظن واضح من الصوره
عشان لو الرابط باظ
هتيجي ع entities وتعمل design
وتضيف ده
كود PHP:
FreezePoints bigint 16 0 0 0 -1 0 0 0 0 0 0
بعدين
ضيف الان بي سي
كود PHP:
2413123 FreezeWar 2 15500 1002 309 245
بعدين الماب
يارب تكون الاضافه عجبتكو والسلام عليكم
|