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

مشاهدة النسخة كاملة : اضافه ال house


محمد ياسر
2019-09-13, 03:56 PM
السلام عليكم ورحمة الله وبركاته
ياعني ايه اضافه ال house
ياعني حضرتك البيت الي بتشتريه من البني ادم الي في الماركت النصاب الي بياخد منك التذكره علشان يتفتح بيت
انا من زمان وفي معظم السورسات البيت مش بيكون مضاف في السورس دلوقتي احنا انضيفه كامل باذن الله

نفتح Game

تمام ونعمل كلاس بأسم

House.cs

ونضيف فيه دول
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Conquer_Online_Server.Database;

namespace Conquer_Online_Server.Game
{
class House//Coded By Bogy
{
public static void createhouse(Client.GameClient client)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("house").Insert("id", client.Entity.UID).Insert("mapdoc", "3024").Insert("type", "7").Insert("weather", "0").Insert("owner", client.Entity.UID).Insert("HouseLevel", "1");

cmd.Execute();

//Conquer_Online_Server.Database.MapsTable.MapInform ation info = new Conquer_Online_Server.Database.MapsTable.MapInform ation();
// info.ID = (ushort)client.Entity.UID;
// info.BaseID = 601;
//info.Status = 7;
// info.Weather = 0;
//info.Owner = client.Entity.UID;
//info.HouseLevel = 1;
//Conquer_Online_Server.Database.MapsTable.MapInform ations.Add(info.ID, info);
bool Success = DMaps.CreateDynamicMap2(client.Entity.UID, 1765, (uint)client.Entity.UID, 1);
return;
}
public static void UpgradeHouse(Client.GameClient client)
{

//ServerBase.Kernel.Maps.Remove((ushort)client.Entit y.UID);
Kernel.Maps.Remove((ushort)client.Entity.UID);
bool Success = DMaps.CreateDynamicMap2(client.Entity.UID, 3024, (uint)client.Entity.UID, 1);
new MySqlCommand(MySqlCommandType.UPDATE).Update("house").Set("HouseLevel", "2").Set("mapdoc", "3024").Where("id", client.Entity.UID).Execute();
return;
}
public static void AddBox(Client.GameClient client)
{

Conquer_Online_Server.Database.MapsTable.MapInform ations.Remove((ushort)client.Entity.UID);
Kernel.Maps.Remove((ushort)client.Entity.UID);
Conquer_Online_Server.Database.MapsTable.MapInform ation info = new Conquer_Online_Server.Database.MapsTable.MapInform ation();
info.ID = (ushort)client.Entity.UID;
info.BaseID = 1099;
info.Status = 7;
info.Weather = 0;
info.Owner = client.Entity.UID;
info.HouseLevel = 2;
info.Box = 1;
info.BoxX = client.Entity.X;
info.BoxY = client.Entity.Y;
Conquer_Online_Server.Database.MapsTable.MapInform ations.Add(info.ID, info);


new MySqlCommand(MySqlCommandType.UPDATE).Update("house").Set("Box", "1").Set("BoxX", client.Entity.X).Set("BoxY", client.Entity.Y).Where("id", client.Entity.UID).Execute();
return;
}

}
}


تمام يسطى كده

هيجيب ايرورات عارف متقولش حاجه

هيطلع 7 ايرورات صح يا معلم

المهم نحل بقى نفهم ونحل

طبعا فى Owner,HouseLevel,Box,BoxY,BoxX,,CreateDynamicMap2,

سهل اوى نحل بقى

نفتح MapsTable.cs

طبعا فى Database

المهم هنلاقى دول فى الاول
public struct MapInformation
{
public ushort ID;
public ushort BaseID;
public uint Status;
public uint Weather;
public uint RaceRecord;
}

تمام كده نخليه كده
public struct MapInformation
{
public ushort ID;
public ushort BaseID;
public uint Status;
public uint Weather;
public uint RaceRecord;
public uint Owner;
public uint HouseLevel;
public uint Box;
public uint BoxX;
public uint BoxY;
}

هيبقى ناقص 2 تمام يا عم نحلهم

نفتح DMaps.cs

فى داتا برضوة

المهم ندور على
public static bool CreateDynamicMap(ushort mapadd, ushort mapneed, uint ownerid)

فوقيه نضيف دا
public static Conquer_Online_Server.Game.Map dynamicMap;
public static bool CreateDynamicMap2(ulong mapadd, ushort mapneed, uint ownerid, uint level)
{

bool addedmap = false;
if (Kernel.Maps.ContainsKey(3024))
new Conquer_Online_Server.Game.Map(3024, Database.DMaps.MapPaths[3024]);
Conquer_Online_Server.Game.Map origMap = Kernel.Maps[3024];
//dynamicMap = origMap.CreateDynamicMap2(ownerid);


return addedmap;
}

كده زى الفل اتحلو صح يا معلم سحس هقولك ايوة

نخش فى الان بى سى

#region HouseAdmin
case 30156:
{
switch (npcRequest.OptionID)
{
case 0:
{
if (Kernel.Maps.ContainsKey((ushort)client.Entity.UID ))
{
dialog.Text("Hey there " + client.Entity.Name + " i'm HouseAdmin Would you like to Enter your");
dialog.Text(" House, or maybe wana upgrade ur house by using UpgradeCert?");
dialog.Text(", or buy Tokens and Furniture?");
//dialog.Option("Enter House", 2);
//dialog.Option("Create House", 1);
// dialog.Option("House Upgrade", 3);
dialog.Option("Tokens,Furniture", 4);
dialog.Option("Just Passing By!.", 255);
dialog.Send();
}
else
{
dialog.Text("Hey there " + client.Entity.Name + " i'm HouseAdmin Would you like to create your");
dialog.Text(" House you need to get an HousePermit so i can help you or u can go inside ur house if");
dialog.Text(" you have one already , or maybe wana upgrade ur house by using UpgradeCert?");
//dialog.Option("go to House", 2);
dialog.Option("Create House", 1);
dialog.Option("Enter House", 2);
//dialog.Option("House Upgrade", 3);
dialog.Option("Buy Tokens,Furniture", 4);
dialog.Option("Just Passing By!.", 255);
dialog.Send();
}
break;
}
#region tokens
case 4:
{
dialog.Text("Hey there " + client.Entity.Name + " i'm HouseAdmin Would you like to buy house Tokens?");
dialog.Text(" HousePermit Coast 50k cps and HouseUpgrade Coast 50k cps,");
dialog.Text("ItemBox 50k cps what u want to buy?");
dialog.Option("HousePermit", 5);
//dialog.Option("UpgradeCert", 6);
dialog.Option("ItemBox", 7);
dialog.Option("Just Passing By!.", 255);
dialog.Send();
break;
}
case 5:
{
if (client.Entity.ConquerPoints > 50000)
{
client.Inventory.Add(721170, 0, 1);
client.Entity.ConquerPoints -= 50000;
dialog.Text("Congratulations you got HousePermit Token");
dialog.Option("Thanks!", 255);
dialog.Send();
}
else
{
dialog.Text("sorry you dont have Enough cps to get HousePermit");
dialog.Option("Sorry!", 255);
dialog.Send();
//break;
}
break;
}
case 6:
{
if (client.Entity.ConquerPoints > 50000)
{
client.Inventory.Add(721174, 0, 1);
client.Entity.ConquerPoints -= 50000;
dialog.Text("Congratulations you got UpgradeCert Token");
dialog.Option("Thanks!", 255);
dialog.Send();
}
else
{
dialog.Text("sorry you dont have Enough cps to get UpgradeCert Token");
dialog.Option("Sorry!", 255);
dialog.Send();
//break;
}
break;
}
case 7:
{
if (client.Entity.ConquerPoints > 50000)
{
client.Inventory.Add(721189, 0, 1);
client.Entity.ConquerPoints -= 50000;
dialog.Text("Congratulations you got ItemBox");
dialog.Option("Thanks!", 255);
dialog.Send();
}
else
{
dialog.Text("sorry you dont have Enough cps to get ItemBox");
dialog.Option("Sorry!", 255);
dialog.Send();
//break;
}
break;
}
#endregion
#region Create
case 1:
{
if (Kernel.Maps.ContainsKey((ushort)client.Entity.UID ))
{
dialog.Text("Sorry you already have House cant help you");
dialog.Option("Oh Sorry!.", 255);
dialog.Send();
}
else
{
if (client.Inventory.Contains(721170, 1))
{
client.Inventory.Remove(721170, 1);
Game.House.createhouse(client);
dialog.Text("Congratulations you got New House Goodluck in Caribbean");
dialog.Option("Thanks!", 255);
dialog.Send();
}
else
{
dialog.Text("sorry you dont have HousePermit come again later ");
dialog.Option("sorry!", 255);
dialog.Send();
}
}
break;
}
#endregion
#region Upgrade
case 3:
{
if (Kernel.Maps.ContainsKey((ushort)client.Entity.UID ))
{
dialog.Text("Sorry you dont have House come again later");
dialog.Option("Oh Sorry!.", 255);
dialog.Send();
}
else
{
if (Kernel.Maps[(ushort)client.Entity.UID].Level == 1)
{
if (client.Inventory.Contains(721174, 1))
{
client.Inventory.Remove(721174, 1);
Game.House.UpgradeHouse(client);
dialog.Text("Congratulations your House now Level [2] Goodluck in Caribbean");
dialog.Option("Thanks!", 255);
dialog.Send();
}
else
{
dialog.Text("Sorry you dont have UpgradeCert come again later ");
dialog.Option("sorry!", 255);
dialog.Send();
}
}
else
{
dialog.Text("Sorry your House Already Level 2 Cant upgrade it any more ");
dialog.Option("sorry!", 255);
dialog.Send();
}
}
break;
}
#endregion
#region House Teleport
case 2:
{

if (Kernel.Maps.ContainsKey((ushort)client.Entity.UID ))
{
dialog.Text("Sorry you dont have House you need to create one first");
dialog.Option("Oh Sorry!.", 255);
dialog.Send();
}
else
{

if (client != null)
{
if (client.Team != null && client.Team.TeamLeader)
{
foreach (Client.GameClient Teammate in client.Team.Teammates)
{
if (Teammate != null)
{
if (Teammate != null)
{

Game.Entity entity;
if (client.Screen.TryGetValue(Teammate.Entity.UID, out entity))
{
Teammate.Entity.Teleport(3024, 89, 77);
//client.Entity.Teleport(1765, client.Entity.UID, 79, 58);
}

}
}
}
client.Entity.Teleport(3024, 89, 77);
}
else
{
client.Entity.Teleport(3024, 89, 77);

//client.Entity.Teleport((ushort)client.Entity.UID, 79, 58);
}
}

}
break;
}
#endregion
}
break;
}
#endregion

كده فله القاعده بقى
عفواً لايمكن عرض الروابط في الإرشيف (عفواً لايمكن عرض الروابط في الإرشيف)

ALz3em
2019-09-13, 04:03 PM
عاش تسلم أيدك

Hassan Emprator
2019-09-13, 04:18 PM
تسلم ايدك يحزومه

abdo1
2019-09-13, 04:49 PM
عاش

Spider
2019-09-13, 05:55 PM
3ash

ابو حمزه9
2019-09-15, 12:46 AM
تسلم ربنا يخليك

mop
2019-11-03, 10:04 AM
تسلم ايدك

سمير
2019-11-04, 04:28 PM
عااااش

TiTo1
2020-02-08, 12:54 PM
تمام

uncelsam
2020-03-05, 05:38 PM
عااااش

A_H_M_E_D
2020-04-25, 02:21 AM
عاش

ViORX
2020-05-09, 12:39 PM
تسلم ايدك

so3da
2020-05-09, 01:30 PM
الله ينور

mohammedshafik
2021-07-28, 10:57 AM
thanks

Gamal Askr
2021-08-15, 05:49 PM
ما شاء الله عليك حقيقي والله كل الشكر والتقدير

Yasser
2022-01-07, 06:08 PM
تسلم

youssef12345
2023-04-21, 07:17 AM
check

MRonlineGvrix
2023-05-23, 08:08 PM
الله ينور يباشا

MRonlineGvrix
2023-05-23, 09:02 PM
يغلق جربتو هو الهوس للسيفر كلو

karem1q
2023-10-12, 06:48 AM
nice

Ahmed3bdElR2ouF
2023-10-19, 09:00 PM
تسلم ايدك <3

jokeregy
2024-02-04, 12:17 AM
ممكن لينك القاعده

tawfiekmr
2024-03-19, 07:18 PM
لسه في ايرور

Shawky Gamal
2024-10-18, 02:16 PM
عاش