|
المشاركات 1,940 |
+التقييم 0.94 |
تاريخ التسجيل Apr 2019 |
الاقامة https://www.facebook.com/daany |
نظام التشغيل |
رقم العضوية 1 |
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.MapInformation info = new Conquer_Online_Server.Database.MapsTable.MapInformation();
// 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.MapInformations.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.Entity.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.MapInformations.Remove((ushort)client.Entity.UID);
Kernel.Maps.Remove((ushort)client.Entity.UID);
Conquer_Online_Server.Database.MapsTable.MapInformation info = new Conquer_Online_Server.Database.MapsTable.MapInformation();
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.MapInformations.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;
}
}
}
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;
}
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
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
شرح اضافه وحش BoS | abuhaneen | مشكلات السيرفيرات كونكر الشخصيه | 18 | 2023-10-30 07:21 PM |
WelCome To Server House OF Dragons | MohamedStar2020 | اعلانات السيرفيرات الشخصية | 1 | 2022-03-16 02:17 PM |
اضافه رون | medo2020 | مشكلات السيرفيرات كونكر الشخصيه | 5 | 2020-04-30 06:04 PM |
اضافه الرنز | medo2020 | مشكلات السيرفيرات كونكر الشخصيه | 6 | 2020-04-29 07:51 AM |
اضافه | Hassan Emprator | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2019-07-30 05:08 PM |