|
|
المشاركات 151 |
+التقييم 0.07 |
تاريخ التسجيل Apr 2019 |
الاقامة Egypt |
نظام التشغيل Designer and Programmer |
رقم العضوية 11 |
public uint VirtuePoints;
public DateTime LastLotteryEntry;
public byte LotteryEntries;
public bool InLottery;
public static bool LoadEntity
client.HeadgearClaim = reader.ReadBoolean("HeadgearClaim");
client.InLottery = reader.ReadBoolean("InLottery");
client.LotteryEntries = reader.ReadByte("LotteryEntries");
client.LastLotteryEntry = DateTime.FromBinary(reader.ReadInt64("LastLotteryEntry"));
client.ExpBalls = 0;
client.LotteryEntries = 0;
ResetExpball(client);
ResetLottery(client);
public static void ResetExpball
public static void ResetLottery(Client.GameState client)
{
UpdateData(client, "LotteryEntries", 0);
}
.Set("Class", e.Class)
.Set("InLottery", c.InLottery)
.Set("LotteryEntries", c.LotteryEntries)
.Set("LastLotteryEntry", c.LastLotteryEntry.Ticks)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Conquer_Online_Server.Database
{
public class LotteryTable
{
public class LotteryItem
{
public int Rank, Chance;
public string Name;
public uint ID;
public byte Color;
public byte Sockets;
public byte Plus;
public uint NPCID;
}
public static List<LotteryItem> LotteryItems = new List<LotteryItem>();
public static void Load()
{
using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("lottery"))
using (var reader = cmd.CreateReader())
{
while (reader.Read())
{
LotteryItem item = new LotteryItem();
item.Rank = reader.ReadInt32("Rank");
item.Chance = reader.ReadInt32("Chance");
item.Name = reader.ReadString("Prize_Name");
item.ID = reader.ReadUInt32("Prize_Item");
item.Color = reader.ReadByte("Color");
item.Sockets = reader.ReadByte("Hole_Num");
item.Plus = reader.ReadByte("Addition_Lev");
LotteryItems.Add(item);
}
}
Console.WriteLine("Lottery items loaded.");
}
}
}
public Time32 FreezeStamp;
public uint LotteryItemID = 0;
public byte LotteryJadeAdd;
public uint LotteryItemPlus;
public uint LotteryItemSocket1;
public uint LotteryItemSoc2;
public uint LotteryItemColor;
public ConquerItem LotteryPrize;
public LotteryTable.LotteryItem LotoItem;
public bool UseItem = false;
public uint LotteryItemSoc1;
mapName = "OfflineTG";
case 700:
mapName = "LotteryMap";
break;
mapName = "DesertArena";
case 0x760:
mapName = "LotteryHouse";
break;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Conquer_Online_Server.Network.GamePackets;
using Conquer_Online_Server.Interfaces;
namespace Conquer_Online_Server.Game
{
public class Lottery
{
public static void LotteryRewardMessage(Conquer_Online_Server.Client.GameState Hero, ConquerItem i)
{
string str = "";
string str2 = "";
string str3 = "";
if ((Conquer_Online_Server.Game.Enums.ItemQuality)(i.ID % 10) >= Conquer_Online_Server.Game.Enums.ItemQuality.Elite)
{
str = "Elite ";
if ((Conquer_Online_Server.Game.Enums.ItemQuality)(i.ID % 10) >= Conquer_Online_Server.Game.Enums.ItemQuality.Super)
{
str = "Super ";
}
if (Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[i.ID].Name.Contains("MoneyBag"))
{
str = "";
}
}
if (i.SocketOne > 0)
{
str2 = "1-Socket ";
if (i.SocketTwo > 0)
{
str2 = "2-Socket ";
}
}
if (i.Plus > 0)
{
str3 = "(+" + i.Plus + ")";
}
string str4 = str + str2 + Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[i.ID].Name + str3;
string msg = string.Format("{0} won a {1} from the Lottery!", Hero.Entity.Name, str4);
if ((Conquer_Online_Server.Game.Enums.ItemQuality)(i.ID % 10) >= Conquer_Online_Server.Game.Enums.ItemQuality.Elite)
{
Kernel.SendWorldMessage(new Message(msg, System.Drawing.Color.Red, Conquer_Online_Server.Network.GamePackets.Message.Talk), Program.Values);
}
else
{
Hero.Send(new Message(msg, System.Drawing.Color.White, Message.Talk));
}
}
public static void GiveLotteryPrize(Conquer_Online_Server.Client.GameState Hema)
{
LotteryRewardMessage(Hema, Hema.Entity.LotteryPrize);
Conquer_Online_Server.Database.ConquerItemInformation Itemd = new Conquer_Online_Server.Database.ConquerItemInformation(Hema.Entity.LotteryItemID, 0);
//var Itemd = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[Hema.Entity.LotteryItemID];
ConquerItem Item = new ConquerItem(true);
Item.ID = Hema.Entity.LotteryItemID;
Item.Plus = (byte)Hema.Entity.LotteryItemPlus;
Item.Color = Conquer_Online_Server.Game.Enums.Color.Blue;
if (Hema.Entity.LotteryItemSoc1 > 0)
{
Item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
Hema.Entity.LotteryItemSoc1 = 0;
}
if (Hema.Entity.LotteryItemSoc2 > 0)
{
Item.SocketTwo = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
Hema.Entity.LotteryItemSoc2 = 0;
}
Item.Durability = Item.MaximDurability = Itemd.BaseInformation.Durability;
Hema.Inventory.Add(Item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd);
Hema.Entity.LotteryItemID = 0;
Hema.Entity.LotteryJadeAdd = 0;
}
public static void LuckyBox(uint npcID, Conquer_Online_Server.Client.GameState h, bool jade)
{
if (jade || h.Inventory.Contains(0xadb50, 3))
{
if (!jade)
{
h.LotteryEntries += 1;
h.Activenes.SendSinglePacket(h, Activeness.Types.LotteryTask, h.LotteryEntries);
}
else
{
h.Entity.LotteryJadeAdd++;
}
if ((npcID != 0) && !jade)
{
_String packet = new _String(true);
packet.UID = npcID;
packet.TextsCount = 1;
packet.Type = _String.Effect;
packet.Texts.Add("lottery");
h.Send(packet);
}
tryagain:
int rand = Kernel.Random.Next(Conquer_Online_Server.Database.LotteryTable.LotteryItems.Count);
var item = Conquer_Online_Server.Database.LotteryTable.LotteryItems[rand];
var Itemd = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
if (Itemd == null || item == null)
goto tryagain;
if (item.NPCID != npcID && Kernel.Rate(70))
goto tryagain;
if (!(Network.PacketHandler.GetPositionFromID(item.ID) != Network.PacketHandler.Positions.Garment && Network.PacketHandler.GetPositionFromID(item.ID) != 0 && Kernel.Rate(99)))
{
ConquerItem Item = new ConquerItem(true);
Item.ID = item.ID;
h.Entity.LotteryItemID = item.ID;
h.Entity.LotteryItemPlus = item.Plus;
h.Entity.LotteryItemColor = (byte)Conquer_Online_Server.Game.Enums.Color.Blue;
Item.Plus = item.Plus;
Item.Color = Conquer_Online_Server.Game.Enums.Color.Blue;
if (item.Sockets > 0)
{
Item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
h.Entity.LotteryItemSoc1 = 255;
}
if (item.Sockets > 1)
{
Item.SocketTwo = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
h.Entity.LotteryItemSoc2 = 255;
}
Item.Durability = Item.MaximDurability = Itemd.Durability;
// h.Inventory.Add(Item, Game.Enums.ItemUse.Add);
//h.Entity.LotteryPrize = Item;
if ((Item != null))
{
if (!jade)
{
if (h.Inventory.Contains(0xadb50, 3))
{
h.Inventory.Remove(0xadb50, 3);
}
else
{
return;
}
}
else
{
if (h.Inventory.Contains(0xadb50, 1))
{
h.Inventory.Remove(0xadb50, 1);
}
else
{
return;
}
}
h.Entity.LotteryPrize = Item;
Conquer_Online_Server.Network.GamePackets.Lottery lottery = new Conquer_Online_Server.Network.GamePackets.Lottery
{
//Chances = (byte)(10 - h.LotteryEntries),
Color = Item.Color,
Plus = Item.Plus,
Prize = Item.ID,
SocketOne = (byte)Item.SocketOne,
SocketTwo = (byte)Item.SocketTwo,
AddJadeChances = h.Entity.LotteryJadeAdd,
Type = Conquer_Online_Server.Network.GamePackets.Lottery.LotteryTypes.ShowGUI
};
h.Send((byte[])lottery);
}
else
{
// string msg = string.Format("Error generating lottery prize.", h.Entity.Name, h.Entity.Name);
// h.Send(new Message(msg, System.Drawing.Color.White, Message.Talk));
}
}
else
goto tryagain;
}
else
{
string msg = string.Format("You need 3 Small Lottery Tickets to try at the lottery!", h.Entity.Name, h.Entity.Name);
h.Send(new Message(msg, System.Drawing.Color.White, Message.Talk));
}
}
public static void Handle(byte[] Data, Conquer_Online_Server.Client.GameState Client)
{
Conquer_Online_Server.Network.GamePackets.Lottery lottery = new Conquer_Online_Server.Network.GamePackets.Lottery(Data);
if (Client != null)
{
switch (lottery.Type)
{
case Conquer_Online_Server.Network.GamePackets.Lottery.LotteryTypes.Accept:
GiveLotteryPrize(Client);
break;
case Conquer_Online_Server.Network.GamePackets.Lottery.LotteryTypes.AddJade:
if ((Client.Entity.LotteryJadeAdd < 2) && Client.Inventory.Contains(0xadb50, 1))
{
LuckyBox(0, Client, true);
}
break;
case Conquer_Online_Server.Network.GamePackets.Lottery.LotteryTypes.Continue:
LuckyBox(0, Client, false);
break;
}
}
}
}
}
public enum VIPExtras
BonusLottery = 0x8000,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Conquer_Online_Server.Network.GamePackets
{
internal class Lottery
{
private byte[] mData;
public enum LotteryTypes
{
Accept = 0,
AddJade = 1,
Continue = 2,
SocketOne = 7,
SocketTwo = 8,
ShowGUI = 0x103
}
public Lottery()
{
this.mData = new byte[26 + 8];
Writer.Write(26, 0, this.mData);
Writer.Write((ushort)1314, 2, this.mData);
Writer.Write((byte)1, 6, this.mData);
}
public Lottery(byte[] d)
{
this.mData = new byte[d.Length];
d.CopyTo(this.mData, 0);
}
public static implicit operator byte[](Lottery d)
{
return d.mData;
}
public byte AddJadeChances
{
get
{
return this.mData[11];
}
set
{
this.mData[11] = value;
}
}
public byte Chances
{
get
{
return this.mData[12];
}
set
{
this.mData[12] = value;
}
}
public Game.Enums.Color Color
{
get
{
return (Game.Enums.Color)((byte)BitConverter.ToUInt16(this.mData, 10));
}
set
{
Writer.Write((ushort)value, 10, this.mData);
}
}
public byte Plus
{
get
{
return this.mData[9];
}
set
{
Writer.Write(value, 9, this.mData);
}
}
public uint Prize
{
get
{
return BitConverter.ToUInt32(this.mData, 12);
}
set
{
Writer.Write(value, 12, this.mData);
}
}
public byte SocketOne
{
get
{
return this.mData[7];
}
set
{
Writer.Write(value, 7, this.mData);
}
}
public byte SocketTwo
{
get
{
return this.mData[8];
}
set
{
Writer.Write(value, 8, this.mData);
}
}
public LotteryTypes Type
{
get
{
return (LotteryTypes)BitConverter.ToUInt16(this.mData, 4);
}
set
{
Writer.Write((ushort)value, 4, this.mData);
}
}
}
}
#region PK Explorer
#region Lottery (1314)
case 1314:
{
Game.Lottery.Handle(packet, client);
break;
}
#endregion
#region Gates
#region SmallLotteryTicketPack
case 724002:
{
client.Inventory.Remove(item, Game.Enums.ItemUse.RemoveFromStack);
client.Inventory.Add(711504, 0, 3);
break;
}
#endregion
#region LadyLuck
case 923:
case 924:
{
switch (npcRequest.OptionID)
{
case 0:
{
if (client.InLottery)
{
dialog.Text("Look!~Here~is~the~LuckyBox,~a~kind~of~magical~box~which~makes~your~dream~come~true.");
dialog.Option("Get~me~out~of~here!", 4);
dialog.Option("Tell~me~more~about~it~please.", 5);
dialog.Option("Exchange~Small~Lottery~Ticket.", 2);
dialog.Option("Really?~I~don`t~believe~it.", 255);
dialog.Avatar(159);
dialog.Send();
}
else
{
dialog.Text("Welcome to the Lottery Center! There are many Lucky Boxes here, each containing incredible treasures! Pay me 3 Small Lottery Tickets to draw from the Lucky Box in the Lottery Center. You are allowed to enter the Lottery Center and try your luck upto 10");
dialog.Text("~times a day. You will have extra lottery chances if you are a VIP player. If you are new to this place, let me show you around the Lottery Center, first!");
dialog.Option("Let`s~try~my~luck!", 1);
dialog.Option("Exchange~Small~Lottery~Ticket.", 2);
dialog.Option("May~I~know~the~rules~first?", 3);
dialog.Option("How~about~the~VIP~privilege?", 6);
dialog.Option("Nice~to~see~you.", 255);
dialog.Avatar(123);
dialog.Send();
}
break;
}
case 1:
{
if (client.Entity.Level >= 70)
{
client.InLottery = true;
client.LotteryEntries++;
client.Entity.Teleport(700, 40, 47);
}
else
{
dialog.Text("You may not join the lottery , you need level 70 first.");
dialog.Option("Ahh sorry.", 255);
dialog.Send();
}
break;
}
case 2:
{
if (!client.Inventory.Contains(711504, 3))
{
dialog.Text("You don`t have 3 Lottery Tickets to exchange for the Small Lottery Tickets.");
dialog.Option("Oops.", 255);
dialog.Avatar(123);
dialog.Send();
}
else
{
client.Inventory.Remove(711504, 3);
client.Inventory.Add(3008856, 0, 1);
}
break;
}
case 3:
{
dialog.Text("There are many Lucky Boxes in the Lottery Center. Pay 3 Small Lottery Tickets, and you can draw from the Lucky Box! If you are not satisfied with the item you get, you can pay 1 more Small Lottery Ticket to change the item you drew. However, you can");
dialog.Text("~only pay and change the item for 2 times. Each player is allowed to draw from the Lottery up to 10 times, each day.");
dialog.Option("Okay,~I~see.", 255);
dialog.Avatar(123);
dialog.Send();
break;
}
case 4:
{
client.Entity.Teleport(1036, 219, 193);
client.InLottery = false;
break;
}
case 5:
{
dialog.Text("You~have~chance~to~get~whatever~you~desire~from~a~LuckyBox.~It~May~be~a~Dragonball,~+8~weapon,~or");
dialog.Text("~two-socket~boot,~you~don`t~know~what~you~will~get~from~the~Box,~it~totally~depends~on~your~luck.~Well,");
dialog.Text("~let`s~get~started~now.~Good~luck!");
dialog.Option("Thanks~a~lot.", 255);
dialog.Avatar(159);
dialog.Send();
break;
}
case 6:
{
dialog.Text("Each player can draw from the Lottery up to 10 times, each day. But if you are a VIP, you will have extra chances to play! Level 1 VIP: 10 extra chances. Level 2 VIP: 20 extra chances. Level 3 VIP: 30 extra chances.");
dialog.Text("~Level 4 VIP: 40 extra chances. Level 5 VIP: 50 extra chances. Level 6 VIP: 60 extra chances.");
dialog.Option("Got~it!", 255);
dialog.Avatar(123);
dialog.Send();
break;
}
}
break;
}
#endregion
#region LuckyBox
case 943:
case 937:
case 944:
case 939:
case 931:
{
Game.Lottery.LuckyBox(client.ActiveNpc, client, false);
break;
}
#endregion
923 LadyLuck 2 9230 1036 212 188
924 LadyLuck 2 9236 700 40 50
944 lucky box 2 9287 700 45 56
943 lucky box 2 9287 700 56 56
939 lucky box 2 9287 700 45 45
937 lucky box 2 9287 700 51 51
931 lucky box 2 9287 700 56 45
700 700 66124 0
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50045
Source Host : localhost:3306
Source Database : tq
Target Server Type : MYSQL
Target Server Version : 50045
File Encoding : 65001
Date: 2017-05-18 03:22:25
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `lottery`
-- ----------------------------
DROP TABLE IF EXISTS `lottery`;
CREATE TABLE `lottery` (
`id` int(4) unsigned NOT NULL default '0',
`type` int(4) unsigned NOT NULL default '0',
`rank` tinyint(1) unsigned NOT NULL default '0',
`chance` int(4) unsigned NOT NULL default '0',
`prize_name` char(32) NOT NULL default '',
`prize_item` int(4) unsigned NOT NULL default '0',
`color` tinyint(1) unsigned NOT NULL default '0',
`hole_num` tinyint(1) unsigned NOT NULL default '0',
`addition_lev` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of lottery
-- ----------------------------
INSERT INTO `lottery` VALUES ('1', '1', '8', '100', '+1Stone', '730001', '1', '0', '1');
INSERT INTO `lottery` VALUES ('3', '1', '8', '100', 'DisguiseAmulet', '723724', '3', '0', '0');
INSERT INTO `lottery` VALUES ('4', '1', '8', '100', 'LifeFruitBasket', '723725', '3', '0', '0');
INSERT INTO `lottery` VALUES ('5', '1', '8', '60', 'PenitenceAmulet', '723727', '4', '0', '0');
INSERT INTO `lottery` VALUES ('7', '1', '8', '70', 'Class1MoneyBag', '723713', '5', '0', '0');
INSERT INTO `lottery` VALUES ('8', '1', '7', '100', '+2Stone', '730002', '3', '0', '2');
INSERT INTO `lottery` VALUES ('9', '1', '7', '100', 'ExpPotion', '723017', '4', '0', '0');
INSERT INTO `lottery` VALUES ('10', '1', '7', '100', 'ExpBall', '723700', '5', '0', '0');
INSERT INTO `lottery` VALUES ('12', '1', '7', '70', 'Class2MoneyBag', '723714', '1', '0', '0');
INSERT INTO `lottery` VALUES ('13', '1', '6', '50', 'RefinedMoonGem', '700062', '3', '0', '0');
INSERT INTO `lottery` VALUES ('14', '1', '6', '10', 'RefinedFuryGem', '700022', '3', '0', '0');
INSERT INTO `lottery` VALUES ('15', '1', '6', '30', 'RefinedVioletGem', '700052', '3', '0', '0');
INSERT INTO `lottery` VALUES ('16', '1', '6', '100', '+1StonePack', '723712', '4', '0', '0');
INSERT INTO `lottery` VALUES ('17', '1', '6', '1', 'MeteorTearPack', '723711', '5', '0', '0');
INSERT INTO `lottery` VALUES ('18', '1', '6', '70', 'Class3MoneyBag', '723715', '2', '0', '0');
INSERT INTO `lottery` VALUES ('19', '1', '5', '100', '+3Stone', '730003', '4', '0', '3');
INSERT INTO `lottery` VALUES ('20', '1', '5', '80', 'RefinedDragonGem', '700012', '3', '0', '0');
INSERT INTO `lottery` VALUES ('21', '1', '5', '80', 'RefinedPhoenixGem', '700002', '3', '0', '0');
INSERT INTO `lottery` VALUES ('22', '1', '5', '80', 'RefinedRainbowGem', '700032', '2', '0', '0');
INSERT INTO `lottery` VALUES ('23', '1', '5', '70', 'Class4MoneyBag', '723716', '1', '0', '0');
INSERT INTO `lottery` VALUES ('24', '1', '4', '60', 'DragonBall', '1088000', '5', '0', '0');
INSERT INTO `lottery` VALUES ('25', '1', '4', '80', '+4Stone', '730004', '3', '0', '4');
INSERT INTO `lottery` VALUES ('26', '1', '4', '100', 'PrayingStone(S)', '1200000', '2', '0', '0');
INSERT INTO `lottery` VALUES ('27', '1', '4', '100', 'BlackTulip', '723584', '2', '0', '0');
INSERT INTO `lottery` VALUES ('28', '1', '4', '100', 'SashToken(S)', '722840', '1', '0', '0');
INSERT INTO `lottery` VALUES ('29', '1', '4', '70', 'Class5MoneyBag', '723717', '4', '0', '0');
INSERT INTO `lottery` VALUES ('30', '1', '4', '50', 'WhitePhoenix', '181305', '3', '0', '0');
INSERT INTO `lottery` VALUES ('31', '1', '4', '50', 'BrownPhoenix', '181405', '3', '0', '0');
INSERT INTO `lottery` VALUES ('32', '1', '4', '50', 'BlackPhoenix', '181505', '3', '0', '0');
INSERT INTO `lottery` VALUES ('33', '1', '4', '50', 'RedPhoenix', '181605', '3', '0', '0');
INSERT INTO `lottery` VALUES ('34', '1', '4', '50', 'GreenPhoenix', '181705', '3', '0', '0');
INSERT INTO `lottery` VALUES ('35', '1', '4', '50', 'BluePhoenix', '181805', '3', '0', '0');
INSERT INTO `lottery` VALUES ('36', '1', '4', '50', 'PurplePhoenix', '181905', '3', '0', '0');
INSERT INTO `lottery` VALUES ('37', '1', '4', '50', 'WhiteElegance', '181315', '3', '0', '0');
INSERT INTO `lottery` VALUES ('38', '1', '4', '50', 'BrownElegance', '181415', '3', '0', '0');
INSERT INTO `lottery` VALUES ('39', '1', '4', '50', 'BlackElegance', '181515', '3', '0', '0');
INSERT INTO `lottery` VALUES ('40', '1', '4', '50', 'RedElegance', '181615', '5', '0', '0');
INSERT INTO `lottery` VALUES ('41', '1', '4', '50', 'GreenElegance', '181715', '5', '0', '0');
INSERT INTO `lottery` VALUES ('42', '1', '4', '50', 'BlueElegance', '181815', '5', '0', '0');
INSERT INTO `lottery` VALUES ('43', '1', '4', '50', 'PurpleElegance', '181915', '5', '0', '0');
INSERT INTO `lottery` VALUES ('44', '1', '4', '50', 'WhiteCelestial', '181325', '5', '0', '0');
INSERT INTO `lottery` VALUES ('45', '1', '4', '50', 'BrownCelestial', '181425', '5', '0', '0');
INSERT INTO `lottery` VALUES ('46', '1', '4', '50', 'BlackCelestial', '181525', '5', '0', '0');
INSERT INTO `lottery` VALUES ('47', '1', '4', '50', 'RedCelestial', '181625', '5', '0', '0');
INSERT INTO `lottery` VALUES ('48', '1', '4', '50', 'GreenCelestial', '181725', '3', '0', '0');
INSERT INTO `lottery` VALUES ('49', '1', '4', '50', 'BlueCelestial', '181825', '3', '0', '0');
INSERT INTO `lottery` VALUES ('50', '1', '4', '50', 'PurpleCelestial', '181925', '3', '0', '0');
INSERT INTO `lottery` VALUES ('51', '1', '4', '50', 'WeddingGown', '181335', '4', '0', '0');
INSERT INTO `lottery` VALUES ('52', '1', '4', '50', 'ColorfulDress', '181345', '4', '0', '0');
INSERT INTO `lottery` VALUES ('53', '1', '4', '50', 'DarkWizard', '181355', '4', '0', '0');
INSERT INTO `lottery` VALUES ('54', '1', '4', '50', 'PrairieWind', '181365', '4', '0', '0');
INSERT INTO `lottery` VALUES ('55', '1', '4', '50', 'SongofTianshan', '181375', '2', '0', '0');
INSERT INTO `lottery` VALUES ('56', '1', '4', '50', 'RoyalDignity', '181385', '2', '0', '0');
INSERT INTO `lottery` VALUES ('57', '1', '4', '50', 'Daisy', '181395', '2', '0', '0');
INSERT INTO `lottery` VALUES ('58', '1', '4', '50', 'SouthofCloud', '182305', '2', '0', '0');
INSERT INTO `lottery` VALUES ('59', '1', '4', '50', 'BonfireNight', '182315', '4', '0', '0');
INSERT INTO `lottery` VALUES ('60', '1', '4', '50', 'AngelicalDress', '182325', '4', '0', '0');
INSERT INTO `lottery` VALUES ('61', '1', '3', '80', '+5Stone', '730005', '5', '0', '5');
INSERT INTO `lottery` VALUES ('62', '1', '3', '100', 'PrayingStone(L)', '1200002', '3', '0', '0');
INSERT INTO `lottery` VALUES ('63', '1', '3', '100', 'SuperTortoiseGem', '700073', '4', '0', '0');
INSERT INTO `lottery` VALUES ('64', '1', '3', '100', 'MagicalBottle', '2100045', '2', '0', '0');
INSERT INTO `lottery` VALUES ('65', '1', '3', '120', 'ExemptionToken', '723701', '2', '0', '0');
INSERT INTO `lottery` VALUES ('66', '1', '3', '120', 'Class6MoneyBag', '723718', '3', '0', '0');
INSERT INTO `lottery` VALUES ('67', '1', '3', '70', 'Class7MoneyBag', '723719', '3', '0', '0');
INSERT INTO `lottery` VALUES ('68', '1', '3', '100', 'SuperWarArmor', '130089', '2', '0', '0');
INSERT INTO `lottery` VALUES ('69', '1', '3', '100', 'SuperMonkCoronet', '118089', '1', '0', '0');
INSERT INTO `lottery` VALUES ('70', '1', '3', '100', 'SuperBasaltArmor', '131089', '1', '0', '0');
INSERT INTO `lottery` VALUES ('71', '1', '3', '100', 'SuperViolentHelmet', '111089', '1', '0', '0');
INSERT INTO `lottery` VALUES ('72', '1', '3', '100', 'SuperRhinoCoat', '133079', '1', '0', '0');
INSERT INTO `lottery` VALUES ('73', '1', '3', '100', 'SuperAntlerHat', '113069', '1', '0', '0');
INSERT INTO `lottery` VALUES ('74', '1', '3', '100', 'SuperConquestGown', '134099', '1', '0', '0');
INSERT INTO `lottery` VALUES ('75', '1', '3', '100', 'SuperStarCap', '114099', '5', '0', '0');
INSERT INTO `lottery` VALUES ('76', '1', '3', '70', 'SuperGoldBag', '121189', '5', '0', '0');
INSERT INTO `lottery` VALUES ('77', '1', '3', '70', 'SuperDragonNecklace', '120189', '5', '0', '0');
INSERT INTO `lottery` VALUES ('78', '1', '3', '70', 'SuperBlueBracelet', '152189', '5', '0', '0');
INSERT INTO `lottery` VALUES ('79', '1', '3', '70', 'SuperJadeEarring', '117089', '5', '0', '0');
INSERT INTO `lottery` VALUES ('80', '1', '3', '70', 'SuperDiamondRing', '150199', '5', '0', '0');
INSERT INTO `lottery` VALUES ('81', '1', '3', '90', 'SuperJetHeavyRing', '151179', '5', '0', '0');
INSERT INTO `lottery` VALUES ('82', '1', '3', '70', 'SuperKylinBoots', '160199', '5', '0', '0');
INSERT INTO `lottery` VALUES ('83', '1', '3', '70', 'SuperCloudBacksword', '421199', '5', '0', '0');
INSERT INTO `lottery` VALUES ('84', '1', '3', '70', 'SuperRosewoodBow', '500189', '5', '0', '0');
INSERT INTO `lottery` VALUES ('85', '1', '3', '100', 'SuperThornShield', '900089', '5', '0', '0');
INSERT INTO `lottery` VALUES ('86', '1', '3', '70', 'SuperRainbowBlade', '410199', '5', '0', '0');
INSERT INTO `lottery` VALUES ('87', '1', '3', '70', 'SuperLoyalSword', '420199', '1', '0', '0');
INSERT INTO `lottery` VALUES ('88', '1', '3', '100', 'SuperDemonHook', '430199', '2', '0', '0');
INSERT INTO `lottery` VALUES ('89', '1', '3', '100', 'SuperLightningWhip', '440199', '2', '0', '0');
INSERT INTO `lottery` VALUES ('90', '1', '3', '100', 'SuperGoldAxe', '450199', '2', '0', '0');
INSERT INTO `lottery` VALUES ('91', '1', '3', '100', 'SuperShiningHammer', '460199', '2', '0', '0');
INSERT INTO `lottery` VALUES ('92', '1', '3', '70', 'SuperSnakeClub', '480199', '2', '0', '0');
INSERT INTO `lottery` VALUES ('93', '1', '3', '100', 'SuperThunderScepter', '481199', '2', '0', '0');
INSERT INTO `lottery` VALUES ('94', '1', '3', '100', 'SuperRainbowDagger', '490199', '2', '0', '0');
INSERT INTO `lottery` VALUES ('95', '1', '3', '100', 'SuperTigerGlaive', '510199', '2', '0', '0');
INSERT INTO `lottery` VALUES ('96', '1', '3', '100', 'SuperGrimPoleaxe', '530199', '2', '0', '0');
INSERT INTO `lottery` VALUES ('97', '1', '3', '100', 'SuperPetalLongHammer', '540199', '2', '0', '0');
INSERT INTO `lottery` VALUES ('98', '1', '3', '100', 'SuperLance', '560199', '1', '0', '0');
INSERT INTO `lottery` VALUES ('99', '1', '3', '100', 'SuperSilverHalbert', '580199', '1', '0', '0');
INSERT INTO `lottery` VALUES ('100', '1', '3', '100', 'SuperCopperWand', '561199', '1', '0', '0');
INSERT INTO `lottery` VALUES ('101', '1', '3', '70', '2Socket-EliteIronBacksword', '421088', '3', '2', '0');
INSERT INTO `lottery` VALUES ('102', '1', '3', '70', '2Socket-EliteQinBow', '500088', '3', '2', '0');
INSERT INTO `lottery` VALUES ('103', '1', '3', '70', '2Socket-EliteRattanShield', '900018', '3', '2', '0');
INSERT INTO `lottery` VALUES ('104', '1', '3', '70', '2Socket-EliteMoonBlade', '410098', '3', '2', '0');
INSERT INTO `lottery` VALUES ('105', '1', '3', '100', '2Socket-EliteFangSword', '420098', '3', '2', '0');
INSERT INTO `lottery` VALUES ('106', '1', '3', '100', '2Socket-EliteAntlerHook', '430098', '3', '2', '0');
INSERT INTO `lottery` VALUES ('107', '1', '3', '100', '2Socket-EliteTwinWhip', '440098', '3', '2', '0');
INSERT INTO `lottery` VALUES ('108', '1', '3', '100', '2Socket-ElitePeaceAxe', '450098', '3', '2', '0');
INSERT INTO `lottery` VALUES ('109', '1', '3', '100', '2Socket-EliteMelonHammer', '460098', '4', '2', '0');
INSERT INTO `lottery` VALUES ('110', '1', '3', '70', '2Socket-EliteWarClub', '480098', '4', '2', '0');
INSERT INTO `lottery` VALUES ('111', '1', '3', '100', '2Socket-EliteWishScepter', '481098', '4', '2', '0');
INSERT INTO `lottery` VALUES ('112', '1', '3', '100', '2Socket-EliteCaoDagger', '490098', '4', '2', '0');
INSERT INTO `lottery` VALUES ('113', '1', '3', '100', '2Socket-EliteUnionGlaive', '510098', '4', '2', '0');
INSERT INTO `lottery` VALUES ('114', '1', '3', '100', '2Socket-EliteTwinPoleaxe', '530098', '4', '2', '0');
INSERT INTO `lottery` VALUES ('115', '1', '3', '100', '2Socket-EliteGreatLongHammer', '540098', '4', '2', '0');
INSERT INTO `lottery` VALUES ('116', '1', '3', '100', '2Socket-EliteLuckSpear', '560098', '4', '2', '0');
INSERT INTO `lottery` VALUES ('117', '1', '3', '100', '2Socket-EliteGoldHalbert', '580098', '3', '2', '0');
INSERT INTO `lottery` VALUES ('118', '1', '3', '100', '2Socket-EliteShaolinWand', '561098', '3', '2', '0');
INSERT INTO `lottery` VALUES ('119', '1', '2', '80', '+6Stone', '730006', '2', '0', '6');
INSERT INTO `lottery` VALUES ('120', '1', '2', '100', 'MiraculousGourd', '2100025', '3', '0', '0');
INSERT INTO `lottery` VALUES ('121', '1', '2', '100', 'Sash(L)', '1100009', '3', '0', '0');
INSERT INTO `lottery` VALUES ('124', '1', '2', '100', '1Socket-EliteDemonArmor', '130058', '5', '1', '0');
INSERT INTO `lottery` VALUES ('125', '1', '2', '100', '1Socket-EliteGoldCoronet', '118058', '5', '1', '0');
INSERT INTO `lottery` VALUES ('126', '1', '2', '100', '1Socket-EliteChainedArmor', '131058', '5', '1', '0');
INSERT INTO `lottery` VALUES ('127', '1', '2', '100', '1Socket-ElitePearlHelmet', '111058', '5', '1', '0');
INSERT INTO `lottery` VALUES ('128', '1', '2', '100', '1Socket-EliteApeCoat', '133048', '5', '1', '0');
INSERT INTO `lottery` VALUES ('129', '1', '2', '100', '1Socket-EliteLeopardHat', '113038', '5', '1', '0');
INSERT INTO `lottery` VALUES ('130', '1', '2', '100', '1Socket-ElitePowerGown', '134058', '5', '1', '0');
INSERT INTO `lottery` VALUES ('131', '1', '2', '100', '1Socket-EliteSharkCap', '114068', '5', '1', '0');
INSERT INTO `lottery` VALUES ('132', '1', '2', '70', '1Socket-EliteAmbergrisBag', '121128', '1', '1', '0');
INSERT INTO `lottery` VALUES ('133', '1', '2', '70', '1Socket-ElitePlatinaNecklace', '120128', '1', '1', '0');
INSERT INTO `lottery` VALUES ('134', '1', '2', '70', '1Socket-EliteBoneBracelet', '152128', '1', '1', '0');
INSERT INTO `lottery` VALUES ('135', '1', '2', '70', '1Socket-EliteHeartofOcean', '117068', '1', '1', '0');
INSERT INTO `lottery` VALUES ('136', '1', '2', '70', '1Socket-EliteJadeRing', '150118', '1', '1', '0');
INSERT INTO `lottery` VALUES ('137', '1', '2', '90', '1Socket-EliteDarkHeavyRing', '151118', '2', '1', '0');
INSERT INTO `lottery` VALUES ('138', '1', '2', '70', '1Socket-EliteLightBoots', '160098', '2', '1', '0');
INSERT INTO `lottery` VALUES ('174', '1', '1', '100', '2Socket-EliteDipperArmor', '130048', '5', '2', '0');
INSERT INTO `lottery` VALUES ('175', '1', '1', '100', '2Socket-EliteJadeCoronet', '118048', '5', '2', '0');
INSERT INTO `lottery` VALUES ('176', '1', '1', '100', '2Socket-EliteBrightArmor', '131048', '5', '2', '0');
INSERT INTO `lottery` VALUES ('177', '1', '1', '100', '2Socket-EliteSyeniticHelmet', '111048', '5', '2', '0');
INSERT INTO `lottery` VALUES ('178', '1', '1', '100', '2Socket-EliteWolfCoat', '133028', '1', '2', '0');
INSERT INTO `lottery` VALUES ('179', '1', '1', '100', '2Socket-EliteJackalHat', '113028', '1', '2', '0');
INSERT INTO `lottery` VALUES ('180', '1', '1', '100', '2Socket-ElitePureGown', '134048', '1', '2', '0');
INSERT INTO `lottery` VALUES ('181', '1', '1', '100', '2Socket-EliteCloudCap', '114048', '1', '2', '0');
INSERT INTO `lottery` VALUES ('182', '1', '1', '70', '2Socket-EliteBeanBag', '121098', '1', '2', '0');
INSERT INTO `lottery` VALUES ('183', '1', '1', '70', '2Socket-EliteGoldNecklace', '120098', '1', '2', '0');
INSERT INTO `lottery` VALUES ('184', '1', '1', '70', '2Socket-EliteGoldBracelet', '152088', '1', '2', '0');
INSERT INTO `lottery` VALUES ('185', '1', '1', '70', '2Socket-EliteTasselEarring', '117048', '3', '2', '0');
INSERT INTO `lottery` VALUES ('186', '1', '1', '70', '2Socket-EliteIvoryRing', '150098', '3', '2', '0');
INSERT INTO `lottery` VALUES ('187', '1', '1', '70', '2Socket-EliteBoneHeavyRing', '151098', '3', '2', '0');
INSERT INTO `lottery` VALUES ('188', '1', '1', '70', '2Socket-EliteCrocodileBoots', '160118', '2', '2', '0');
INSERT INTO `lottery` VALUES ('189', '1', '3', '100', 'BlueDream', '182335', '1', '0', '0');
INSERT INTO `lottery` VALUES ('190', '1', '3', '100', 'MoonOrchid', '182345', '2', '0', '0');
INSERT INTO `lottery` VALUES ('191', '1', '3', '100', 'FlyingFeather', '182355', '3', '0', '0');
INSERT INTO `lottery` VALUES ('192', '1', '3', '100', 'HeavenScent', '182365', '4', '0', '0');
INSERT INTO `lottery` VALUES ('122', '1', '2', '150', 'Class8MoneyBag', '723720', '4', '0', '0');
INSERT INTO `lottery` VALUES ('123', '1', '2', '70', 'Class9MoneyBag', '723721', '4', '0', '0');
INSERT INTO `lottery` VALUES ('139', '1', '1', '120', 'Class10MoneyBag', '723722', '3', '0', '0');
INSERT INTO `lottery` VALUES ('140', '1', '1', '70', 'TopMoneyBag', '723723', '3', '0', '0');
public uint virtuepoints;
public datetime lastlotteryentry;
public byte lotteryentries;
public bool inlottery;
public static bool loadentity
client.headgearclaim = reader.readboolean("headgearclaim");
client.inlottery = reader.readboolean("inlottery");
client.lotteryentries = reader.readbyte("lotteryentries");
client.lastlotteryentry = datetime.frombinary(reader.readint64("lastlotteryentry"));
client.expballs = 0;
client.lotteryentries = 0;
resetexpball(client);
resetlottery(client);
public static void resetexpball
public static void resetlottery(client.gamestate client)
{
updatedata(client, "lotteryentries", 0);
}
.set("class", e.class)
.set("inlottery", c.inlottery)
.set("lotteryentries", c.lotteryentries)
.set("lastlotteryentry", c.lastlotteryentry.ticks)
using system;
using system.collections.generic;
using system.linq;
using system.text;
namespace conquer_online_server.database
{
public class lotterytable
{
public class lotteryitem
{
public int rank, chance;
public string name;
public uint id;
public byte color;
public byte sockets;
public byte plus;
public uint npcid;
}
public static list<lotteryitem> lotteryitems = new list<lotteryitem>();
public static void load()
{
using (var cmd = new mysqlcommand(mysqlcommandtype.select).select("lottery"))
using (var reader = cmd.createreader())
{
while (reader.read())
{
lotteryitem item = new lotteryitem();
item.rank = reader.readint32("rank");
item.chance = reader.readint32("chance");
item.name = reader.readstring("prize_name");
item.id = reader.readuint32("prize_item");
item.color = reader.readbyte("color");
item.sockets = reader.readbyte("hole_num");
item.plus = reader.readbyte("addition_lev");
lotteryitems.add(item);
}
}
console.writeline("lottery items loaded.");
}
}
}
public time32 freezestamp;
public uint lotteryitemid = 0;
public byte lotteryjadeadd;
public uint lotteryitemplus;
public uint lotteryitemsocket1;
public uint lotteryitemsoc2;
public uint lotteryitemcolor;
public conqueritem lotteryprize;
public lotterytable.lotteryitem lotoitem;
public bool useitem = false;
public uint lotteryitemsoc1;
mapname = "offlinetg";
case 700:
Mapname = "lotterymap";
break;
mapname = "desertarena";
case 0x760:
Mapname = "lotteryhouse";
break;
using system;
using system.collections.generic;
using system.linq;
using system.text;
using conquer_online_server.network.gamepackets;
using conquer_online_server.interfaces;
namespace conquer_online_server.game
{
public class lottery
{
public static void lotteryrewardmessage(conquer_online_server.client.gamestate hero, conqueritem i)
{
string str = "";
string str2 = "";
string str3 = "";
if ((conquer_online_server.game.enums.itemquality)(i.id % 10) >= conquer_online_server.game.enums.itemquality.elite)
{
str = "elite ";
if ((conquer_online_server.game.enums.itemquality)(i.id % 10) >= conquer_online_server.game.enums.itemquality.super)
{
str = "super ";
}
if (conquer_online_server.database.conqueriteminformation.baseinformations[i.id].name.contains("moneybag"))
{
str = "";
}
}
if (i.socketone > 0)
{
str2 = "1-socket ";
if (i.sockettwo > 0)
{
str2 = "2-socket ";
}
}
if (i.plus > 0)
{
str3 = "(+" + i.plus + ")";
}
string str4 = str + str2 + conquer_online_server.database.conqueriteminformation.baseinformations[i.id].name + str3;
string msg = string.format("{0} won a {1} from the lottery!", hero.entity.name, str4);
if ((conquer_online_server.game.enums.itemquality)(i.id % 10) >= conquer_online_server.game.enums.itemquality.elite)
{
kernel.sendworldmessage(new message(msg, system.drawing.color.red, conquer_online_server.network.gamepackets.message.talk), program.values);
}
else
{
hero.send(new message(msg, system.drawing.color.white, message.talk));
}
}
public static void givelotteryprize(conquer_online_server.client.gamestate hema)
{
lotteryrewardmessage(hema, hema.entity.lotteryprize);
conquer_online_server.database.conqueriteminformation itemd = new conquer_online_server.database.conqueriteminformation(hema.entity.lotteryitemid, 0);
//var itemd = conquer_online_server.database.conqueriteminformation.baseinformations[hema.entity.lotteryitemid];
conqueritem item = new conqueritem(true);
item.id = hema.entity.lotteryitemid;
item.plus = (byte)hema.entity.lotteryitemplus;
item.color = conquer_online_server.game.enums.color.blue;
if (hema.entity.lotteryitemsoc1 > 0)
{
item.socketone = conquer_online_server.game.enums.gem.emptysocket;
hema.entity.lotteryitemsoc1 = 0;
}
if (hema.entity.lotteryitemsoc2 > 0)
{
item.sockettwo = conquer_online_server.game.enums.gem.emptysocket;
hema.entity.lotteryitemsoc2 = 0;
}
item.durability = item.maximdurability = itemd.baseinformation.durability;
hema.inventory.add(item, conquer_online_server.game.enums.itemuse.createandadd);
hema.entity.lotteryitemid = 0;
hema.entity.lotteryjadeadd = 0;
}
public static void luckybox(uint npcid, conquer_online_server.client.gamestate h, bool jade)
{
if (jade || h.inventory.contains(0xadb50, 3))
{
if (!jade)
{
h.lotteryentries += 1;
h.activenes.sendsinglepacket(h, activeness.types.lotterytask, h.lotteryentries);
}
else
{
h.entity.lotteryjadeadd++;
}
if ((npcid != 0) && !jade)
{
_string packet = new _string(true);
packet.uid = npcid;
packet.textscount = 1;
packet.type = _string.effect;
packet.texts.add("lottery");
h.send(packet);
}
tryagain:
Int rand = kernel.random.next(conquer_online_server.database.lotterytable.lotteryitems.count);
var item = conquer_online_server.database.lotterytable.lotteryitems[rand];
var itemd = conquer_online_server.database.conqueriteminformation.baseinformations[item.id];
if (itemd == null || item == null)
goto tryagain;
if (item.npcid != npcid && kernel.rate(70))
goto tryagain;
if (!(network.packethandler.getpositionfromid(item.id) != network.packethandler.positions.garment && network.packethandler.getpositionfromid(item.id) != 0 && kernel.rate(99)))
{
conqueritem item = new conqueritem(true);
item.id = item.id;
h.entity.lotteryitemid = item.id;
h.entity.lotteryitemplus = item.plus;
h.entity.lotteryitemcolor = (byte)conquer_online_server.game.enums.color.blue;
item.plus = item.plus;
item.color = conquer_online_server.game.enums.color.blue;
if (item.sockets > 0)
{
item.socketone = conquer_online_server.game.enums.gem.emptysocket;
h.entity.lotteryitemsoc1 = 255;
}
if (item.sockets > 1)
{
item.sockettwo = conquer_online_server.game.enums.gem.emptysocket;
h.entity.lotteryitemsoc2 = 255;
}
item.durability = item.maximdurability = itemd.durability;
// h.inventory.add(item, game.enums.itemuse.add);
//h.entity.lotteryprize = item;
if ((item != null))
{
if (!jade)
{
if (h.inventory.contains(0xadb50, 3))
{
h.inventory.remove(0xadb50, 3);
}
else
{
return;
}
}
else
{
if (h.inventory.contains(0xadb50, 1))
{
h.inventory.remove(0xadb50, 1);
}
else
{
return;
}
}
h.entity.lotteryprize = item;
conquer_online_server.network.gamepackets.lottery lottery = new conquer_online_server.network.gamepackets.lottery
{
//chances = (byte)(10 - h.lotteryentries),
color = item.color,
plus = item.plus,
prize = item.id,
socketone = (byte)item.socketone,
sockettwo = (byte)item.sockettwo,
addjadechances = h.entity.lotteryjadeadd,
type = conquer_online_server.network.gamepackets.lottery.lotterytypes.showgui
};
h.send((byte[])lottery);
}
else
{
// string msg = string.format("error generating lottery prize.", h.entity.name, h.entity.name);
// h.send(new message(msg, system.drawing.color.white, message.talk));
}
}
else
goto tryagain;
}
else
{
string msg = string.format("you need 3 small lottery tickets to try at the lottery!", h.entity.name, h.entity.name);
h.send(new message(msg, system.drawing.color.white, message.talk));
}
}
public static void handle(byte[] data, conquer_online_server.client.gamestate client)
{
conquer_online_server.network.gamepackets.lottery lottery = new conquer_online_server.network.gamepackets.lottery(data);
if (client != null)
{
switch (lottery.type)
{
case conquer_online_server.network.gamepackets.lottery.lotterytypes.accept:
Givelotteryprize(client);
break;
case conquer_online_server.network.gamepackets.lottery.lotterytypes.addjade:
If ((client.entity.lotteryjadeadd < 2) && client.inventory.contains(0xadb50, 1))
{
luckybox(0, client, true);
}
break;
case conquer_online_server.network.gamepackets.lottery.lotterytypes.continue:
Luckybox(0, client, false);
break;
}
}
}
}
}
public enum vipextras
bonuslottery = 0x8000,
using system;
using system.collections.generic;
using system.linq;
using system.text;
namespace conquer_online_server.network.gamepackets
{
internal class lottery
{
private byte[] mdata;
public enum lotterytypes
{
accept = 0,
addjade = 1,
continue = 2,
socketone = 7,
sockettwo = 8,
showgui = 0x103
}
public lottery()
{
this.mdata = new byte[26 + 8];
writer.write(26, 0, this.mdata);
writer.write((ushort)1314, 2, this.mdata);
writer.write((byte)1, 6, this.mdata);
}
public lottery(byte[] d)
{
this.mdata = new byte[d.length];
d.copyto(this.mdata, 0);
}
public static implicit operator byte[](lottery d)
{
return d.mdata;
}
public byte addjadechances
{
get
{
return this.mdata[11];
}
set
{
this.mdata[11] = value;
}
}
public byte chances
{
get
{
return this.mdata[12];
}
set
{
this.mdata[12] = value;
}
}
public game.enums.color color
{
get
{
return (game.enums.color)((byte)bitconverter.touint16(this.mdata, 10));
}
set
{
writer.write((ushort)value, 10, this.mdata);
}
}
public byte plus
{
get
{
return this.mdata[9];
}
set
{
writer.write(value, 9, this.mdata);
}
}
public uint prize
{
get
{
return bitconverter.touint32(this.mdata, 12);
}
set
{
writer.write(value, 12, this.mdata);
}
}
public byte socketone
{
get
{
return this.mdata[7];
}
set
{
writer.write(value, 7, this.mdata);
}
}
public byte sockettwo
{
get
{
return this.mdata[8];
}
set
{
writer.write(value, 8, this.mdata);
}
}
public lotterytypes type
{
get
{
return (lotterytypes)bitconverter.touint16(this.mdata, 4);
}
set
{
writer.write((ushort)value, 4, this.mdata);
}
}
}
}
#region pk explorer
#region lottery (1314)
case 1314:
{
game.lottery.handle(packet, client);
break;
}
#endregion
#region gates
#region smalllotteryticketpack
case 724002:
{
client.inventory.remove(item, game.enums.itemuse.removefromstack);
client.inventory.add(711504, 0, 3);
break;
}
#endregion
#region ladyluck
case 923:
Case 924:
{
switch (npcrequest.optionid)
{
case 0:
{
if (client.inlottery)
{
dialog.text("look!~here~is~the~luckybox,~a~kind~of~magical~box~which~makes~your~dream~come~true.");
dialog.option("get~me~out~of~here!", 4);
dialog.option("tell~me~more~about~it~please.", 5);
dialog.option("exchange~small~lottery~ticket.", 2);
dialog.option("really?~i~don`t~believe~it.", 255);
dialog.avatar(159);
dialog.send();
}
else
{
dialog.text("welcome to the lottery center! There are many lucky boxes here, each containing incredible treasures! Pay me 3 small lottery tickets to draw from the lucky box in the lottery center. You are allowed to enter the lottery center and try your luck upto 10");
dialog.text("~times a day. You will have extra lottery chances if you are a vip player. If you are new to this place, let me show you around the lottery center, first!");
dialog.option("let`s~try~my~luck!", 1);
dialog.option("exchange~small~lottery~ticket.", 2);
dialog.option("may~i~know~the~rules~first?", 3);
dialog.option("how~about~the~vip~privilege?", 6);
dialog.option("nice~to~see~you.", 255);
dialog.avatar(123);
dialog.send();
}
break;
}
case 1:
{
if (client.entity.level >= 70)
{
client.inlottery = true;
client.lotteryentries++;
client.entity.teleport(700, 40, 47);
}
else
{
dialog.text("you may not join the lottery , you need level 70 first.");
dialog.option("ahh sorry.", 255);
dialog.send();
}
break;
}
case 2:
{
if (!client.inventory.contains(711504, 3))
{
dialog.text("you don`t have 3 lottery tickets to exchange for the small lottery tickets.");
dialog.option("oops.", 255);
dialog.avatar(123);
dialog.send();
}
else
{
client.inventory.remove(711504, 3);
client.inventory.add(3008856, 0, 1);
}
break;
}
case 3:
{
dialog.text("there are many lucky boxes in the lottery center. Pay 3 small lottery tickets, and you can draw from the lucky box! If you are not satisfied with the item you get, you can pay 1 more small lottery ticket to change the item you drew. However, you can");
dialog.text("~only pay and change the item for 2 times. Each player is allowed to draw from the lottery up to 10 times, each day.");
dialog.option("okay,~i~see.", 255);
dialog.avatar(123);
dialog.send();
break;
}
case 4:
{
client.entity.teleport(1036, 219, 193);
client.inlottery = false;
break;
}
case 5:
{
dialog.text("you~have~chance~to~get~whatever~you~desire~from~a~luckybox.~it~may~be~a~dragonball,~+8~weapon,~or");
dialog.text("~two-socket~boot,~you~don`t~know~what~you~will~get~from~the~box,~it~totally~depends~on~your~luck.~well,");
dialog.text("~let`s~get~started~now.~good~luck!");
dialog.option("thanks~a~lot.", 255);
dialog.avatar(159);
dialog.send();
break;
}
case 6:
{
dialog.text("each player can draw from the lottery up to 10 times, each day. But if you are a vip, you will have extra chances to play! Level 1 vip: 10 extra chances. Level 2 vip: 20 extra chances. Level 3 vip: 30 extra chances.");
dialog.text("~level 4 vip: 40 extra chances. Level 5 vip: 50 extra chances. Level 6 vip: 60 extra chances.");
dialog.option("got~it!", 255);
dialog.avatar(123);
dialog.send();
break;
}
}
break;
}
#endregion
#region luckybox
case 943:
Case 937:
Case 944:
Case 939:
Case 931:
{
game.lottery.luckybox(client.activenpc, client, false);
break;
}
#endregion
923 ladyluck 2 9230 1036 212 188
924 ladyluck 2 9236 700 40 50
944 lucky box 2 9287 700 45 56
943 lucky box 2 9287 700 56 56
939 lucky box 2 9287 700 45 45
937 lucky box 2 9287 700 51 51
931 lucky box 2 9287 700 56 45
700 700 66124 0
/*
navicat mysql data transfer
source server : Localhost_3306
source server version : 50045
source host : Localhost:3306
source database : Tq
target server type : Mysql
target server version : 50045
file encoding : 65001
date: 2017-05-18 03:22:25
*/
set foreign_key_checks=0;
-- ----------------------------
-- table structure for `lottery`
-- ----------------------------
drop table if exists `lottery`;
create table `lottery` (
`id` int(4) unsigned not null default '0',
`type` int(4) unsigned not null default '0',
`rank` tinyint(1) unsigned not null default '0',
`chance` int(4) unsigned not null default '0',
`prize_name` char(32) not null default '',
`prize_item` int(4) unsigned not null default '0',
`color` tinyint(1) unsigned not null default '0',
`hole_num` tinyint(1) unsigned not null default '0',
`addition_lev` tinyint(1) unsigned not null default '0',
primary key (`id`)
) engine=myisam default charset=utf8;
-- ----------------------------
-- records of lottery
-- ----------------------------
insert into `lottery` values ('1', '1', '8', '100', '+1stone', '730001', '1', '0', '1');
insert into `lottery` values ('3', '1', '8', '100', 'disguiseamulet', '723724', '3', '0', '0');
insert into `lottery` values ('4', '1', '8', '100', 'lifefruitbasket', '723725', '3', '0', '0');
insert into `lottery` values ('5', '1', '8', '60', 'penitenceamulet', '723727', '4', '0', '0');
insert into `lottery` values ('7', '1', '8', '70', 'class1moneybag', '723713', '5', '0', '0');
insert into `lottery` values ('8', '1', '7', '100', '+2stone', '730002', '3', '0', '2');
insert into `lottery` values ('9', '1', '7', '100', 'exppotion', '723017', '4', '0', '0');
insert into `lottery` values ('10', '1', '7', '100', 'expball', '723700', '5', '0', '0');
insert into `lottery` values ('12', '1', '7', '70', 'class2moneybag', '723714', '1', '0', '0');
insert into `lottery` values ('13', '1', '6', '50', 'refinedmoongem', '700062', '3', '0', '0');
insert into `lottery` values ('14', '1', '6', '10', 'refinedfurygem', '700022', '3', '0', '0');
insert into `lottery` values ('15', '1', '6', '30', 'refinedvioletgem', '700052', '3', '0', '0');
insert into `lottery` values ('16', '1', '6', '100', '+1stonepack', '723712', '4', '0', '0');
insert into `lottery` values ('17', '1', '6', '1', 'meteortearpack', '723711', '5', '0', '0');
insert into `lottery` values ('18', '1', '6', '70', 'class3moneybag', '723715', '2', '0', '0');
insert into `lottery` values ('19', '1', '5', '100', '+3stone', '730003', '4', '0', '3');
insert into `lottery` values ('20', '1', '5', '80', 'refineddragongem', '700012', '3', '0', '0');
insert into `lottery` values ('21', '1', '5', '80', 'refinedphoenixgem', '700002', '3', '0', '0');
insert into `lottery` values ('22', '1', '5', '80', 'refinedrainbowgem', '700032', '2', '0', '0');
insert into `lottery` values ('23', '1', '5', '70', 'class4moneybag', '723716', '1', '0', '0');
insert into `lottery` values ('24', '1', '4', '60', 'dragonball', '1088000', '5', '0', '0');
insert into `lottery` values ('25', '1', '4', '80', '+4stone', '730004', '3', '0', '4');
insert into `lottery` values ('26', '1', '4', '100', 'prayingstone(s)', '1200000', '2', '0', '0');
insert into `lottery` values ('27', '1', '4', '100', 'blacktulip', '723584', '2', '0', '0');
insert into `lottery` values ('28', '1', '4', '100', 'sashtoken(s)', '722840', '1', '0', '0');
insert into `lottery` values ('29', '1', '4', '70', 'class5moneybag', '723717', '4', '0', '0');
insert into `lottery` values ('30', '1', '4', '50', 'whitephoenix', '181305', '3', '0', '0');
insert into `lottery` values ('31', '1', '4', '50', 'brownphoenix', '181405', '3', '0', '0');
insert into `lottery` values ('32', '1', '4', '50', 'blackphoenix', '181505', '3', '0', '0');
insert into `lottery` values ('33', '1', '4', '50', 'redphoenix', '181605', '3', '0', '0');
insert into `lottery` values ('34', '1', '4', '50', 'greenphoenix', '181705', '3', '0', '0');
insert into `lottery` values ('35', '1', '4', '50', 'bluephoenix', '181805', '3', '0', '0');
insert into `lottery` values ('36', '1', '4', '50', 'purplephoenix', '181905', '3', '0', '0');
insert into `lottery` values ('37', '1', '4', '50', 'whiteelegance', '181315', '3', '0', '0');
insert into `lottery` values ('38', '1', '4', '50', 'brownelegance', '181415', '3', '0', '0');
insert into `lottery` values ('39', '1', '4', '50', 'blackelegance', '181515', '3', '0', '0');
insert into `lottery` values ('40', '1', '4', '50', 'redelegance', '181615', '5', '0', '0');
insert into `lottery` values ('41', '1', '4', '50', 'greenelegance', '181715', '5', '0', '0');
insert into `lottery` values ('42', '1', '4', '50', 'blueelegance', '181815', '5', '0', '0');
insert into `lottery` values ('43', '1', '4', '50', 'purpleelegance', '181915', '5', '0', '0');
insert into `lottery` values ('44', '1', '4', '50', 'whitecelestial', '181325', '5', '0', '0');
insert into `lottery` values ('45', '1', '4', '50', 'browncelestial', '181425', '5', '0', '0');
insert into `lottery` values ('46', '1', '4', '50', 'blackcelestial', '181525', '5', '0', '0');
insert into `lottery` values ('47', '1', '4', '50', 'redcelestial', '181625', '5', '0', '0');
insert into `lottery` values ('48', '1', '4', '50', 'greencelestial', '181725', '3', '0', '0');
insert into `lottery` values ('49', '1', '4', '50', 'bluecelestial', '181825', '3', '0', '0');
insert into `lottery` values ('50', '1', '4', '50', 'purplecelestial', '181925', '3', '0', '0');
insert into `lottery` values ('51', '1', '4', '50', 'weddinggown', '181335', '4', '0', '0');
insert into `lottery` values ('52', '1', '4', '50', 'colorfuldress', '181345', '4', '0', '0');
insert into `lottery` values ('53', '1', '4', '50', 'darkwizard', '181355', '4', '0', '0');
insert into `lottery` values ('54', '1', '4', '50', 'prairiewind', '181365', '4', '0', '0');
insert into `lottery` values ('55', '1', '4', '50', 'songoftianshan', '181375', '2', '0', '0');
insert into `lottery` values ('56', '1', '4', '50', 'royaldignity', '181385', '2', '0', '0');
insert into `lottery` values ('57', '1', '4', '50', 'daisy', '181395', '2', '0', '0');
insert into `lottery` values ('58', '1', '4', '50', 'southofcloud', '182305', '2', '0', '0');
insert into `lottery` values ('59', '1', '4', '50', 'bonfirenight', '182315', '4', '0', '0');
insert into `lottery` values ('60', '1', '4', '50', 'angelicaldress', '182325', '4', '0', '0');
insert into `lottery` values ('61', '1', '3', '80', '+5stone', '730005', '5', '0', '5');
insert into `lottery` values ('62', '1', '3', '100', 'prayingstone(l)', '1200002', '3', '0', '0');
insert into `lottery` values ('63', '1', '3', '100', 'supertortoisegem', '700073', '4', '0', '0');
insert into `lottery` values ('64', '1', '3', '100', 'magicalbottle', '2100045', '2', '0', '0');
insert into `lottery` values ('65', '1', '3', '120', 'exemptiontoken', '723701', '2', '0', '0');
insert into `lottery` values ('66', '1', '3', '120', 'class6moneybag', '723718', '3', '0', '0');
insert into `lottery` values ('67', '1', '3', '70', 'class7moneybag', '723719', '3', '0', '0');
insert into `lottery` values ('68', '1', '3', '100', 'superwararmor', '130089', '2', '0', '0');
insert into `lottery` values ('69', '1', '3', '100', 'supermonkcoronet', '118089', '1', '0', '0');
insert into `lottery` values ('70', '1', '3', '100', 'superbasaltarmor', '131089', '1', '0', '0');
insert into `lottery` values ('71', '1', '3', '100', 'superviolenthelmet', '111089', '1', '0', '0');
insert into `lottery` values ('72', '1', '3', '100', 'superrhinocoat', '133079', '1', '0', '0');
insert into `lottery` values ('73', '1', '3', '100', 'superantlerhat', '113069', '1', '0', '0');
insert into `lottery` values ('74', '1', '3', '100', 'superconquestgown', '134099', '1', '0', '0');
insert into `lottery` values ('75', '1', '3', '100', 'superstarcap', '114099', '5', '0', '0');
insert into `lottery` values ('76', '1', '3', '70', 'supergoldbag', '121189', '5', '0', '0');
insert into `lottery` values ('77', '1', '3', '70', 'superdragonnecklace', '120189', '5', '0', '0');
insert into `lottery` values ('78', '1', '3', '70', 'superbluebracelet', '152189', '5', '0', '0');
insert into `lottery` values ('79', '1', '3', '70', 'superjadeearring', '117089', '5', '0', '0');
insert into `lottery` values ('80', '1', '3', '70', 'superdiamondring', '150199', '5', '0', '0');
insert into `lottery` values ('81', '1', '3', '90', 'superjetheavyring', '151179', '5', '0', '0');
insert into `lottery` values ('82', '1', '3', '70', 'superkylinboots', '160199', '5', '0', '0');
insert into `lottery` values ('83', '1', '3', '70', 'supercloudbacksword', '421199', '5', '0', '0');
insert into `lottery` values ('84', '1', '3', '70', 'superrosewoodbow', '500189', '5', '0', '0');
insert into `lottery` values ('85', '1', '3', '100', 'superthornshield', '900089', '5', '0', '0');
insert into `lottery` values ('86', '1', '3', '70', 'superrainbowblade', '410199', '5', '0', '0');
insert into `lottery` values ('87', '1', '3', '70', 'superloyalsword', '420199', '1', '0', '0');
insert into `lottery` values ('88', '1', '3', '100', 'superdemonhook', '430199', '2', '0', '0');
insert into `lottery` values ('89', '1', '3', '100', 'superlightningwhip', '440199', '2', '0', '0');
insert into `lottery` values ('90', '1', '3', '100', 'supergoldaxe', '450199', '2', '0', '0');
insert into `lottery` values ('91', '1', '3', '100', 'supershininghammer', '460199', '2', '0', '0');
insert into `lottery` values ('92', '1', '3', '70', 'supersnakeclub', '480199', '2', '0', '0');
insert into `lottery` values ('93', '1', '3', '100', 'superthunderscepter', '481199', '2', '0', '0');
insert into `lottery` values ('94', '1', '3', '100', 'superrainbowdagger', '490199', '2', '0', '0');
insert into `lottery` values ('95', '1', '3', '100', 'supertigerglaive', '510199', '2', '0', '0');
insert into `lottery` values ('96', '1', '3', '100', 'supergrimpoleaxe', '530199', '2', '0', '0');
insert into `lottery` values ('97', '1', '3', '100', 'superpetallonghammer', '540199', '2', '0', '0');
insert into `lottery` values ('98', '1', '3', '100', 'superlance', '560199', '1', '0', '0');
insert into `lottery` values ('99', '1', '3', '100', 'supersilverhalbert', '580199', '1', '0', '0');
insert into `lottery` values ('100', '1', '3', '100', 'supercopperwand', '561199', '1', '0', '0');
insert into `lottery` values ('101', '1', '3', '70', '2socket-eliteironbacksword', '421088', '3', '2', '0');
insert into `lottery` values ('102', '1', '3', '70', '2socket-eliteqinbow', '500088', '3', '2', '0');
insert into `lottery` values ('103', '1', '3', '70', '2socket-eliterattanshield', '900018', '3', '2', '0');
insert into `lottery` values ('104', '1', '3', '70', '2socket-elitemoonblade', '410098', '3', '2', '0');
insert into `lottery` values ('105', '1', '3', '100', '2socket-elitefangsword', '420098', '3', '2', '0');
insert into `lottery` values ('106', '1', '3', '100', '2socket-eliteantlerhook', '430098', '3', '2', '0');
insert into `lottery` values ('107', '1', '3', '100', '2socket-elitetwinwhip', '440098', '3', '2', '0');
insert into `lottery` values ('108', '1', '3', '100', '2socket-elitepeaceaxe', '450098', '3', '2', '0');
insert into `lottery` values ('109', '1', '3', '100', '2socket-elitemelonhammer', '460098', '4', '2', '0');
insert into `lottery` values ('110', '1', '3', '70', '2socket-elitewarclub', '480098', '4', '2', '0');
insert into `lottery` values ('111', '1', '3', '100', '2socket-elitewishscepter', '481098', '4', '2', '0');
insert into `lottery` values ('112', '1', '3', '100', '2socket-elitecaodagger', '490098', '4', '2', '0');
insert into `lottery` values ('113', '1', '3', '100', '2socket-eliteunionglaive', '510098', '4', '2', '0');
insert into `lottery` values ('114', '1', '3', '100', '2socket-elitetwinpoleaxe', '530098', '4', '2', '0');
insert into `lottery` values ('115', '1', '3', '100', '2socket-elitegreatlonghammer', '540098', '4', '2', '0');
insert into `lottery` values ('116', '1', '3', '100', '2socket-eliteluckspear', '560098', '4', '2', '0');
insert into `lottery` values ('117', '1', '3', '100', '2socket-elitegoldhalbert', '580098', '3', '2', '0');
insert into `lottery` values ('118', '1', '3', '100', '2socket-eliteshaolinwand', '561098', '3', '2', '0');
insert into `lottery` values ('119', '1', '2', '80', '+6stone', '730006', '2', '0', '6');
insert into `lottery` values ('120', '1', '2', '100', 'miraculousgourd', '2100025', '3', '0', '0');
insert into `lottery` values ('121', '1', '2', '100', 'sash(l)', '1100009', '3', '0', '0');
insert into `lottery` values ('124', '1', '2', '100', '1socket-elitedemonarmor', '130058', '5', '1', '0');
insert into `lottery` values ('125', '1', '2', '100', '1socket-elitegoldcoronet', '118058', '5', '1', '0');
insert into `lottery` values ('126', '1', '2', '100', '1socket-elitechainedarmor', '131058', '5', '1', '0');
insert into `lottery` values ('127', '1', '2', '100', '1socket-elitepearlhelmet', '111058', '5', '1', '0');
insert into `lottery` values ('128', '1', '2', '100', '1socket-eliteapecoat', '133048', '5', '1', '0');
insert into `lottery` values ('129', '1', '2', '100', '1socket-eliteleopardhat', '113038', '5', '1', '0');
insert into `lottery` values ('130', '1', '2', '100', '1socket-elitepowergown', '134058', '5', '1', '0');
insert into `lottery` values ('131', '1', '2', '100', '1socket-elitesharkcap', '114068', '5', '1', '0');
insert into `lottery` values ('132', '1', '2', '70', '1socket-eliteambergrisbag', '121128', '1', '1', '0');
insert into `lottery` values ('133', '1', '2', '70', '1socket-eliteplatinanecklace', '120128', '1', '1', '0');
insert into `lottery` values ('134', '1', '2', '70', '1socket-elitebonebracelet', '152128', '1', '1', '0');
insert into `lottery` values ('135', '1', '2', '70', '1socket-eliteheartofocean', '117068', '1', '1', '0');
insert into `lottery` values ('136', '1', '2', '70', '1socket-elitejadering', '150118', '1', '1', '0');
insert into `lottery` values ('137', '1', '2', '90', '1socket-elitedarkheavyring', '151118', '2', '1', '0');
insert into `lottery` values ('138', '1', '2', '70', '1socket-elitelightboots', '160098', '2', '1', '0');
insert into `lottery` values ('174', '1', '1', '100', '2socket-elitedipperarmor', '130048', '5', '2', '0');
insert into `lottery` values ('175', '1', '1', '100', '2socket-elitejadecoronet', '118048', '5', '2', '0');
insert into `lottery` values ('176', '1', '1', '100', '2socket-elitebrightarmor', '131048', '5', '2', '0');
insert into `lottery` values ('177', '1', '1', '100', '2socket-elitesyenitichelmet', '111048', '5', '2', '0');
insert into `lottery` values ('178', '1', '1', '100', '2socket-elitewolfcoat', '133028', '1', '2', '0');
insert into `lottery` values ('179', '1', '1', '100', '2socket-elitejackalhat', '113028', '1', '2', '0');
insert into `lottery` values ('180', '1', '1', '100', '2socket-elitepuregown', '134048', '1', '2', '0');
insert into `lottery` values ('181', '1', '1', '100', '2socket-elitecloudcap', '114048', '1', '2', '0');
insert into `lottery` values ('182', '1', '1', '70', '2socket-elitebeanbag', '121098', '1', '2', '0');
insert into `lottery` values ('183', '1', '1', '70', '2socket-elitegoldnecklace', '120098', '1', '2', '0');
insert into `lottery` values ('184', '1', '1', '70', '2socket-elitegoldbracelet', '152088', '1', '2', '0');
insert into `lottery` values ('185', '1', '1', '70', '2socket-elitetasselearring', '117048', '3', '2', '0');
insert into `lottery` values ('186', '1', '1', '70', '2socket-eliteivoryring', '150098', '3', '2', '0');
insert into `lottery` values ('187', '1', '1', '70', '2socket-eliteboneheavyring', '151098', '3', '2', '0');
insert into `lottery` values ('188', '1', '1', '70', '2socket-elitecrocodileboots', '160118', '2', '2', '0');
insert into `lottery` values ('189', '1', '3', '100', 'bluedream', '182335', '1', '0', '0');
insert into `lottery` values ('190', '1', '3', '100', 'moonorchid', '182345', '2', '0', '0');
insert into `lottery` values ('191', '1', '3', '100', 'flyingfeather', '182355', '3', '0', '0');
insert into `lottery` values ('192', '1', '3', '100', 'heavenscent', '182365', '4', '0', '0');
insert into `lottery` values ('122', '1', '2', '150', 'class8moneybag', '723720', '4', '0', '0');
insert into `lottery` values ('123', '1', '2', '70', 'class9moneybag', '723721', '4', '0', '0');
insert into `lottery` values ('139', '1', '1', '120', 'class10moneybag', '723722', '3', '0', '0');
insert into `lottery` values ('140', '1', '1', '70', 'topmoneybag', '723723', '3', '0', '0');
|
الذين يشاهدون محتوى الموضوع الآن : 2 ( الأعضاء 0 والزوار 2) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
اضافه Lottery كامل | محمد ياسر | تطوير سيرفرات كونكر | 34 | 2024-08-27 11:48 PM |
مشكله في Lottery | TiTo1 | مشكلات السيرفيرات كونكر الشخصيه | 8 | 2020-03-10 10:35 AM |
مشكلة في lottery | salahsayed | مشكلات السيرفيرات كونكر الشخصيه | 5 | 2019-05-09 01:31 PM |
مشكلة في lottery | salahsayed | مشكلات السيرفيرات كونكر الشخصيه | 21 | 2019-04-28 12:54 PM |