Some of those are already been released by me but still have PMs asking for them so i'll try to collect them in one thread (if i missed any feel free to post it here or tell me about it and i'll add it)
Note:- you may need to edit the NPCs IDs coz some of them are not in the main Data base and u have to add them
So what is in this thread ?!
1-Some useful Voids and Functions
2-Proficiency God
3-ArtisanOu
4-MagicArtisan
5-Weapon Master
6-Black Smith Lee
7-CelestialTao
8-Ethereal
9-DisCity
10-Fixed Socketgem.cs (have Thunder and Glory Gems And remove gem from socket
11-Lottery System
12-Socketing Talismans
13-Some Skills
14-Honor Ranks (TopTrojan,Worrior,....) [Only registered and activated users can see links. Click Here To Register...]
15-Reborn
16-Ware House password system
17-DropMoney
some voids and functions u may need (go to NPcTalk.cs)
notice that i added a variable at the AddItem void after "CSocket" ,here u have 3 options to do
A:-Keep ur old one and use mine too so u wont have any errors
B:-Keep urs without using mine that will need to remove the last number from each additem call in my codes
C:-Replace urs with my one but u will need to edit all AddItem calls and add the number of items to add for each call u had be4
now some NPcs
*-Proficiency God
*-ArtisanOu
*-MagicArtisan
For the magic artisan u will need to replace your NextLevelEquip.cs with the one i attached coz too many asked for upgrade level fix and it also contains the Metneed and dbneed functions ,or u can just replace all the code inside it with the following
*-Weapon Master
*-Black Smith Lee
*-CelestialTao
*-Ethereal
and for Ethereal you will need the Enchant packet (put it anywhere under Packets folder )
and then add this code under PacketProcessor.cs packet type 1009
*DisCity
NPcTalk
and u will need this void also to give exp to players per stage
and this at anywhere under calculation folder (mine at Exp.cs)
and this to teleport all players at some map to another
now to get this work there are somethings to do
A- add a new variable at Character.cs called
B- add a new bool variable and byte variable at Nano.cs called
C-i guess u already have the globaltimer ,r8??
if not then u will need to figure a way to calac the DisCity time
or add this global timer at Nano.cs main definitions
then at startserver void just be4 " ConsoleCommands();" add
you can use this global timer for many many things u can even use it to add stamina instead of timer for each player,u can also use it to calc the xp skill counter and many other things
then add at the end of it's delegate the next code
of course u may need to change times as u want
D- find
r8 after it add
* Fixed SocketGem.CS
and here is the PacketProcessor case for it
*Lottery System
it has all co2 lotto items and fixed as possible i could make
-first add a new variable at Character.cs named
-then put the lotto.txt file i attached at yourSource folder/CoEmu v2 GameServer/bin/debug
-At Nano.cs -->StartServer void add
-At Databse folder -->Database.cs add this void
-Lastly add/replace this cases to NPcTalk
-Save and Go
Damn , it said the text is too long :p i couldn't add the Talismans here so c post 3
Note:- you may need to edit the NPCs IDs coz some of them are not in the main Data base and u have to add them
So what is in this thread ?!
1-Some useful Voids and Functions
2-Proficiency God
3-ArtisanOu
4-MagicArtisan
5-Weapon Master
6-Black Smith Lee
7-CelestialTao
8-Ethereal
9-DisCity
10-Fixed Socketgem.cs (have Thunder and Glory Gems And remove gem from socket
11-Lottery System
12-Socketing Talismans
13-Some Skills
14-Honor Ranks (TopTrojan,Worrior,....) [Only registered and activated users can see links. Click Here To Register...]
15-Reborn
16-Ware House password system
17-DropMoney
some voids and functions u may need (go to NPcTalk.cs)
Code:
public static void AddItem(int itemid, int bless, int dura, int enchant, int plus,int Progress, int position, int soc1, int soc2, int color, ClientSocket CSocket,byte Count)
{
for (byte t = 0; t < Count; t++)
{
Struct.ItemInfo Item = new Struct.ItemInfo();
if (dura == 255)
{
Item.Dura = Item.MaxDura;
}
else
{
Item.Dura = dura;
}
Item.Bless = bless;
Item.Enchant = enchant;
Item.ItemID = itemid;
Item.Plus = plus;
Item.Progress = Progress;
Item.Position = position;
Item.Soc1 = soc1;
Item.Soc2 = soc2;
Item.Color = color;
Item.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(Item, CSocket);
while (!created)
{
Item.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(Item, CSocket);
}
CSocket.Client.Inventory.Add(Item.UID, Item);
CSocket.Send(ConquerPacket.ItemInfo(Item.UID, Item.ItemID, Item.Plus, Item.Progress, Item.Bless, Item.Enchant, Item.Soc1, Item.Soc2, Item.Dura, Item.MaxDura, Item.Position, Item.Color,0,0));
}
}
public static bool HasItem(int ItemId, byte Count, ClientSocket CSocket)
{
//720027 MeteorScroll ,720028 DBScroll, 1088001 Meteor, 1088000 DragonBall, 1080001 Emerald
byte ItemsFound = 0;
foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
{
if (ItemsFound < Count)
{
if (Item.ItemID == ItemId) ItemsFound++;
}
else break;
}
if (ItemsFound >= Count) return true;
return false;
}
public static void DeleteItem(int ItemID, byte Count, ClientSocket CSocket)
{
int[] Uids = new int[Count]; byte ItemsFound = 0;
foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
{
if (Item.ItemID == ItemID)
{
Uids[ItemsFound] = Item.UID; ItemsFound++;
}
if (ItemsFound == Count) break;
}
for (byte t = 0; t < Count; t++)
{
CSocket.Client.Inventory.Remove(Uids[t]);
CSocket.Send(ConquerPacket.ItemUsage(Uids[t], 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(Uids[t]);
}
}
A:-Keep ur old one and use mine too so u wont have any errors
B:-Keep urs without using mine that will need to remove the last number from each additem call in my codes
C:-Replace urs with my one but u will need to edit all AddItem calls and add the number of items to add for each call u had be4
*-Proficiency God
Code:
#region ProficiencyGod
case 941://Charges CPs 27*ProfLevel
{
if (LinkBack == 0)
{
Text("Hey i can help u improving your prof,choose a type", CSocket);
Link("One Hand", 1, CSocket);
Link("Two Hand", 2, CSocket);
Link("Thnks", 255, CSocket);
Face(65, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
Text("Choose your One Hand weapon prof", CSocket);
Link("Club", 11, CSocket);
Link("Sword", 12, CSocket);
Link("Blade", 13, CSocket);
Link("BackSword", 14, CSocket);
Link("Katana", 15, CSocket);
Link("Hook", 16, CSocket);
Link("Axe", 17, CSocket);
Face(65, CSocket);
End(CSocket);
}
else if (LinkBack == 2)
{
Text("Choose your Two Hand weapon prof", CSocket);
Link("Bow", 20, CSocket);
Link("Wand", 21, CSocket);
Link("Spear", 22, CSocket);
Link("Poleaxe", 23, CSocket);
Link("Glave", 24, CSocket);
Link("LongHammer", 25, CSocket);
Link("Halberet", 26, CSocket);
Face(65, CSocket);
End(CSocket);
}
else if (LinkBack > 10 && LinkBack < 30)
{
int WeaponId = 480;//Club
if (LinkBack == 12) WeaponId = 420;//Sword ,BS=421
else if (LinkBack == 13) WeaponId = 410;//Blade
else if (LinkBack == 14) WeaponId = 421;//BackSword
else if (LinkBack == 15) WeaponId = 601;//Katana
else if (LinkBack == 16) WeaponId = 430;//Hook
else if (LinkBack == 17) WeaponId = 450;//Axe
else if (LinkBack == 20) WeaponId = 500;//Bow
else if (LinkBack == 21) WeaponId = 561;//Wand
else if (LinkBack == 22) WeaponId = 560;//Spear
else if (LinkBack == 23) WeaponId = 530;//Poleaxe
else if (LinkBack == 24) WeaponId = 510;//Glave
else if (LinkBack == 25) WeaponId = 540;//LongHammer
else if (LinkBack == 26) WeaponId = 580;//Poleaxe
int WeaponLevel = 0;
if (CSocket.Client.Profs.ContainsKey(WeaponId))
{
WeaponLevel = CSocket.Client.Profs[WeaponId].Level;
}
if (CSocket.Client.CPs >= (WeaponLevel + 1) * 27)
{
if (CSocket.Client.Profs.ContainsKey(WeaponId))
{
Struct.CharProf Prof = CSocket.Client.Profs[WeaponId];
Prof.Level = WeaponLevel + 1;
Prof.Exp = 0;
CPs(-(Prof.Level * 27), CSocket);
Database.Database.UpdateProf(Prof.ID, Prof.Level, Prof.Exp, CSocket.Client.ID);
}
else
{
Struct.CharProf Prof = new Struct.CharProf();
Prof.Level = 1;
Prof.ID = WeaponId;
CPs(-(Prof.Level * 27), CSocket);
CSocket.Client.Profs.Add(Prof.ID, Prof);
Database.Database.NewProf(WeaponId, 1, 0, CSocket.Client.ID);
}
CSocket.Send(ConquerPacket.Prof(WeaponId, WeaponLevel+1, 0));
Text("Congratz your profeciency has been upgraded", CSocket);
Link("Thanks", 255, CSocket);
Face(65, CSocket);
End(CSocket);
}
else
{
Text("Sorry i need " + ((WeaponLevel + 1) * 27).ToString() + " Cps To Give you that level", CSocket);
Link("Oh , i'll be back later", 255, CSocket);
Face(65, CSocket);
End(CSocket);
}
}
break;
}
#endregion ProficiencyGod
*-ArtisanOu
Code:
#region ArtisanOu SocketerMan at bird island
case 41://Using CPs
{
if (LinkBack == 0)
{
Text("Hello there ,i am the amazing socketer u heard about :P", CSocket);
Text("i never fail sockiting your weapon,tho i am a littel expinsive", CSocket);
Text("the first socket costs 215 CPS,,, the second costs 1075", CSocket);
Link("First Socket", 1, CSocket);
Link("Second Socket", 2, CSocket);
Link("R u kidding, bye", 255, CSocket);
Face(60, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (CSocket.Client.CPs > 214)
{
if (CSocket.Client.Equipment.ContainsKey(4))
{
if (CSocket.Client.Equipment[4].Soc1 == 0)
{
CPs(-215, CSocket);
CSocket.Client.Equipment[4].Soc1 = 255;int Uid=CSocket.Client.Equipment[4].UID;
ItemUnequip(4, Uid, CSocket);
ItemEquip(4, Uid, CSocket);
Text("Here you go check your weapon", CSocket);
Link("Nice great man,thanks", 255, CSocket);
Face(60, CSocket);
End(CSocket);
}
else
{
Text("Are You crazy ,your weapon has the socket!!!!", CSocket);
Link("Aw just kidding,bye", 255, CSocket);
Face(60, CSocket);
End(CSocket);
}
}
else
{
Text("Put the weapon on first you dumb", CSocket);
Link("Oh,4got that ", 255, CSocket);
End(CSocket);
}
}
else
{
Text("So you just came to bother me ??you dont have the CPs", CSocket);
Text("i'll bay back , heyyyyy catsh that thief", CSocket);
Face(60, CSocket);
End(CSocket);
}
}
else if (LinkBack == 2)
{
if (CSocket.Client.CPs > 1074)
{
if (CSocket.Client.Equipment.ContainsKey(4))
{
if (CSocket.Client.Equipment[4].Soc2 == 0)
{
CPs(-1074, CSocket);
CSocket.Client.Equipment[4].Soc2 = 255; int Uid = CSocket.Client.Equipment[4].UID;
ItemUnequip(4, Uid, CSocket);
ItemEquip(4, Uid, CSocket);
Text("Here you go check your weapon", CSocket);
Link("Nice great man,thanks", 255, CSocket);
Face(60, CSocket);
End(CSocket);
}
else
{
Text("Are You crazy ,your weapon has the socket!!!!", CSocket);
Link("Aw just kidding,bye", 255, CSocket);
Face(60, CSocket);
End(CSocket);
}
}
else
{
Text("Put the weapon on first you dumb", CSocket);
Link("Oh,4got that ", 255, CSocket);
End(CSocket);
}
}
else
{
Text("So you just came to bother me ??you dont have the CPs", CSocket);
Text("i'll bay back , heyyyyy catsh that thief", CSocket);
Face(60, CSocket);
End(CSocket);
}
}
break;
}
#endregion
*-MagicArtisan
Code:
#region MagicArtisan
case 10062: //Magic Artisan
{
if (LinkBack == 0)
{
Text("Hi. i can help u upgrading your gears ,choose the upgrade type plz", CSocket);
Link("Upgrade Level", 10, CSocket);
Link("Upgrade quality", 20, CSocket);
Face(55, CSocket);
End(CSocket);
}
#region Upgrade level
else if (LinkBack == 10)
{
Text("Hi. i can help u upgrading your gears level using the meteor pwoer,", CSocket);
Text("\n choose which one u want to upgrade", CSocket);
Link("HeadGear", 1, CSocket);
Link("Nicklase/Bags", 2, CSocket);
Link("Armor/Coat", 3, CSocket);
Link("Weapons", 4, CSocket);
Link("Ring/Bracelete", 6, CSocket);
Link("Boots", 8, CSocket);
Link("Nevermind", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else if (LinkBack > 0 && LinkBack < 9)
{
if (CSocket.Client.Equipment.ContainsKey(LinkBack))
{
int ItemId = CSocket.Client.Equipment[LinkBack].ItemID; byte Plus = (byte)CSocket.Client.Equipment[LinkBack].Plus;
byte MetsNeed = Calculation.MetsNeeded(ItemId, Plus);
if (MetsNeed < 1)
{
Text("Oh sorry this item is very high for me to deal with", CSocket);
Text("Try your luck with WeaponMaster beside me,or ArtisanWind at TC", CSocket);
Link("Looser ", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else
{
if (HasItem(1088001, MetsNeed, CSocket))
{
int NewItemId = Calculation.NextEquipLevel(ItemId);
if (NewItemId != ItemId && ReqLvl(NewItemId, CSocket))
{
CSocket.Client.Equipment[LinkBack].ItemID = NewItemId;
DeleteItem(1088001, MetsNeed, CSocket); ItemId = CSocket.Client.Equipment[LinkBack].UID;
ItemUnequip(LinkBack, ItemId, CSocket);
ItemEquip(LinkBack, ItemId, CSocket);
Text("Congratulations your item has been upgraded", CSocket);
Link("Awesome, thanks man", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else
{
Text("Oops, i can not upgrade that item ,it gives me invalid level for u to use", CSocket);
Link("Oh,damn", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
}
else
{
Text("Sorry you don't have enough mets, this items costs " + MetsNeed + " Meteors", CSocket);
Link("Oh bye", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
}
}
else
{
Text("Are you joking,how will i upgrade a none existing item", CSocket);
Text("Please wear your item first", CSocket);
Link("Oh,sorry forgot to wear it", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
}
#endregion
#region Upgrade quality
else if (LinkBack == 20)
{
Text("I can help u upgrading your gears quality using the pwoer of dragonballs ", CSocket);
Text("\n choose which one u want to upgrade", CSocket);
Link("HeadGear", 21, CSocket);
Link("Nicklase/Bags", 22, CSocket);
Link("Armor/Coat", 23, CSocket);
Link("Weapons", 24, CSocket);
Link("Ring/Bracelete", 26, CSocket);
Link("Boots", 28, CSocket);
Link("StarTwoer", 31, CSocket);
Link("HeavenFan", 30, CSocket);
Face(55, CSocket);
End(CSocket);
}
else if (LinkBack > 20)
{
LinkBack -= 20;
if (CSocket.Client.Equipment.ContainsKey(LinkBack))
{
int ItemId = CSocket.Client.Equipment[LinkBack].ItemID;
byte DbNeed = Calculation.DbNeeded(ItemId);
if (DbNeed < 1)
{
Text("Oh this item has reached the highest quality or i do not have it's difenesion", CSocket);
Link("Looser ", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else
{
if (HasItem(1088000, DbNeed, CSocket))
{
int NewItemId = ItemId + 1;
CSocket.Client.Equipment[LinkBack].ItemID = NewItemId;
DeleteItem(1088000, DbNeed, CSocket); ItemId = CSocket.Client.Equipment[LinkBack].UID;
ItemUnequip(LinkBack, ItemId, CSocket);
ItemEquip(LinkBack, ItemId, CSocket);
Text("Congratulations your item has been upgraded", CSocket);
Link("Awesome, thanks man", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else
{
Text("Sorry you don't have enough DragonBalls, this items costs " + DbNeed + " DBs", CSocket);
Link("Oh bye", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
}
}
else
{
Text("Are you joking,how will i upgrade a none existing item", CSocket);
Text("Please wear your item first", CSocket);
Link("Oh,sorry forgot to wear it", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
}
#endregion
break;
}
#endregion
Code:
/*
* Created by SharpDevelop.
* User: sams
* Date: 3/29/2009
* Time: 1:24 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using CoEmu_v2_GameServer.Connections;
using CoEmu_v2_GameServer.Entities;
using CoEmu_v2_GameServer.Structs;
using CoEmu_v2_GameServer.Packets;
using CoEmu_v2_GameServer.Calculations;
using CoEmu_v2_GameServer.Database;
namespace CoEmu_v2_GameServer.Calculations
{
public partial class Calculation
{
/// <summary>
/// Generates the next item equip level.
/// </summary>
/// <param name="ItemID">The current item id to level</param>
/// <returns>the new item id</returns>
public static int NextEquipLevel(int ItemId)
{
int NewItem = ItemId;
Struct.ItemData Item = Nano.Items[ItemId];
if(ArmorType(ItemId) == false || WeaponType(Convert.ToString(ItemId)) == 117)
{
if (Type2(Convert.ToString(ItemId)) != 12 && Type2(Convert.ToString(ItemId)) != 15 && Type2(Convert.ToString(ItemId)) != 16 || Item.Level == 45 && Type2(Convert.ToString(ItemId)) == 12 || Item.Level >= 112 && Type2(Convert.ToString(ItemId)) == 12)
NewItem += 10;
else if (Type2(Convert.ToString(ItemId)) == 12 && Item.Level < 45)
NewItem += 20;
else if (Type2(Convert.ToString(ItemId)) == 12 && Item.Level >= 52 && Item.Level < 112)
NewItem += 30;
else if (Type2(Convert.ToString(ItemId)) == 15 && Item.Level == 1 || Type2(Convert.ToString(ItemId)) == 15 && Item.Level >= 110)
NewItem += 10;
else if (Type2(Convert.ToString(ItemId)) == 15)
NewItem += 20;
else if (Type2(Convert.ToString(ItemId)) == 16 && Item.Level < 124)
NewItem += 20;
else if (Type2(Convert.ToString(ItemId)) == 16)
NewItem += 10;
if (WeaponType(Convert.ToString(NewItem)) == 421)
{
NewItem = ItemId;
if (Item.Level == 45 || Item.Level == 55)
NewItem += 20;
else
NewItem += 10;
}
}
else if (Type2(Convert.ToString(ItemId)) != 12 && Type2(Convert.ToString(ItemId)) != 15)
{
if (Item.Class == 21)
if (Type2(Convert.ToString(ItemId)) == 13)
{
if (Item.Level <= 110)
NewItem += 10;
else
NewItem += 5000;
}
if (Item.Class == 11)
if (Type2(Convert.ToString(ItemId)) == 13)
{
if (Item.Level <= 110)
NewItem += 10;
else
NewItem += 5000;
}
if (Item.Class == 40)
if (Type2(Convert.ToString(ItemId)) == 13)
{
if (Item.Level <= 112)
NewItem += 10;
else
NewItem += 5000;
}
if (Item.Class == 190)
if (Type2(Convert.ToString(ItemId)) == 13)
{
if (Item.Level <= 115)
NewItem += 10;
else
NewItem += 5000;
}
if (Item.Class == 21)
if (Type2(Convert.ToString(ItemId)) == 11)
{
if (Item.Level< 112)
NewItem += 10;
else
NewItem += 920;
}
if (Item.Class == 11)
if (Type2(Convert.ToString(ItemId)) == 11)
{
if (Item.Level < 112)
NewItem += 10;
else
NewItem -= 6010;
}
if (Item.Class == 40)
if (Type2(Convert.ToString(ItemId)) == 11)
{
if (Item.Level < 117)
NewItem += 10;
else
NewItem -= 1060;
}
if (Item.Class == 190)
if (Type2(Convert.ToString(ItemId)) == 11)
{
if (Item.Level < 112)
NewItem += 10;
else
NewItem -= 2050;
}
}
if (ItemId == 500301)
NewItem = 500005;
if (ItemId == 410301)
NewItem = 410005;
return NewItem;
}
public static byte MetsNeeded(int ItemId,byte Plus)
{
byte MetsNeeded = 0;
Struct.ItemData Item = Nano.Items[ItemId];
if (Item.Level < 40) MetsNeeded = 2;
else if (Item.Level < 60) MetsNeeded = 4;
else if (Item.Level < 75) MetsNeeded = 5;
else if (Item.Level < 85) MetsNeeded = 7;
else if (Item.Level < 95) MetsNeeded = 9;
else if (Item.Level < 100) MetsNeeded = 11;
else if (Item.Level < 112) MetsNeeded = 18;
else if (Item.Level >= 112) return 0;
if (Item.Quality == 9) MetsNeeded += 4;
else if (Item.Quality == 8) MetsNeeded += 2;
else if (Item.Quality == 7) MetsNeeded += 1;
if (Plus > 2) MetsNeeded += Plus;
return MetsNeeded;
}
public static byte DbNeeded(int ItemId)
{
byte DbNeeded = 0;
Struct.ItemData Item = Nano.Items[ItemId];
if (Item.Level < 60) DbNeeded = 2;
else if (Item.Level < 100) DbNeeded = 4;
else DbNeeded = 6;
if (Item.Quality == 9) return 0;
else if (Item.Quality > 5) DbNeeded += (byte)(Item.Quality - 5);
else DbNeeded = 1;
return DbNeeded;
}
}
}
*-Weapon Master
Code:
#region WeaponMaster // Market
case 7050://WeaponMaster
{
if (LinkBack == 0)
{
Text("Hi. i never fail upgrading your gears ,so i am a littel expensive ", CSocket);
Text("\n i'll charge you a DragonBall for each level, if agree with that Click an item", CSocket);
Link("HeadGear", 1, CSocket);
Link("Nicklase/Bags", 2, CSocket);
Link("Armor/Coat", 3, CSocket);
Link("Weapons", 4, CSocket);
Link("Ring/Bracelete", 6, CSocket);
Link("Boots", 8, CSocket);
Link("Nevermind", 255, CSocket);
Face(60, CSocket);
End(CSocket);
}
else if (LinkBack > 0 && LinkBack < 9)
{
if (CSocket.Client.Equipment.ContainsKey(LinkBack))
{
if (HasItem(1088000, 1, CSocket))
{
int ItemId = CSocket.Client.Equipment[LinkBack].ItemID; //byte Plus = (byte)CSocket.Client.Equipment[LinkBack].Plus;
int NewItemId = Calculation.NextEquipLevel(ItemId);
if (NewItemId != ItemId && ReqLvl(NewItemId, CSocket))
{
CSocket.Client.Equipment[LinkBack].ItemID = NewItemId;
DeleteItem(1088000, 1, CSocket); ItemId = CSocket.Client.Equipment[LinkBack].UID;
ItemUnequip(LinkBack, ItemId, CSocket);
ItemEquip(LinkBack, ItemId, CSocket);
Text("Congratulations your item has been upgraded", CSocket);
Link("Awesome, thanks man", 255, CSocket);
Face(60, CSocket);
End(CSocket);
}
else
{
Text("Oops, i can not upgrade that item ,it gives me invalid level for u to use", CSocket);
Link("Oh,damn", 255, CSocket);
Face(60, CSocket);
End(CSocket);
}
}
else
{
Text("Sorry you don't have any Dragonballs", CSocket);
Link("Oh bye", 255, CSocket);
Face(60, CSocket);
End(CSocket);
}
}
else
{
Text("Are you joking,how will i upgrade a none existing item", CSocket);
Text("Please wear your item first", CSocket);
Link("Oh,sorry forgot to wear it", 255, CSocket);
Face(60, CSocket);
End(CSocket);
}
}
break;
}
#endregion
*-Black Smith Lee
Code:
#region BlackSmithLee socketer man at market
case 451: //BlackSmithLee socketer man
{
if (LinkBack == 0)
{
Text("Hey did you hear about me, i can put a socket to any item u want", CSocket);
Text("Just tell me what do u want me to do", CSocket);
Link("Open First socket", 1, CSocket);
Link("2nd socket using ToughDrill", 2, CSocket);
Link("2nd socket using 7 StarDrill", 3, CSocket);
Link("Never mind", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
Text("Well the first socket is easy so it costs only 12 DBs", CSocket);
Text("Choose your item here", CSocket);
Link("HeadGear", 11, CSocket);
Link("Nicklase/Bags", 12, CSocket);
Link("Armor/Coat", 13, CSocket);
Link("Ring/Bracelete", 16, CSocket);
Link("Boots", 18, CSocket);
Link("Nevermind", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
else if (LinkBack > 10 && LinkBack < 20)
{
LinkBack -= 10;
if (CSocket.Client.Equipment.ContainsKey(LinkBack))
{
if (CSocket.Client.Equipment[LinkBack].Soc1>0)
{
Text("Your item has the first socket already", CSocket);
Link("I know", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
else
{
if (HasItem(1088000,12, CSocket))
{
CSocket.Client.Equipment[LinkBack].Soc1= 255;
DeleteItem(1088000, 12, CSocket); int UId = CSocket.Client.Equipment[LinkBack].UID;
ItemUnequip(LinkBack, UId, CSocket);
ItemEquip(LinkBack, UId, CSocket);
Text("Congratulations your item has the first socket now", CSocket);
Link("Awesome, thanks man", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
else
{
Text("Sorry you don't have enough Dragonballs, ", CSocket);
Link("Oh bye", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
}
}
else
{
Text("Are you joking,how will i upgrade a none existing item", CSocket);
Text("Please wear your item first", CSocket);
Link("Oh,sorry forgot to wear it", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
}
else if (LinkBack == 2)
{
Text("Well u will try your luck !!", CSocket);
Text("Choose your item", CSocket);
Link("HeadGear", 21, CSocket);
Link("Nicklase/Bags", 22, CSocket);
Link("Armor/Coat", 23, CSocket);
Link("Ring/Bracelete", 26, CSocket);
Link("Boots", 28, CSocket);
Link("Nevermind", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
else if (LinkBack > 20 && LinkBack < 30)
{
LinkBack -= 20;
if (CSocket.Client.Equipment.ContainsKey(LinkBack))
{
if (CSocket.Client.Equipment[LinkBack].Soc1 > 0)
{
if (CSocket.Client.Equipment[LinkBack].Soc2 > 0)
{
Text("Your item has the second socket already", CSocket);
Link("I know", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
else
{
if (HasItem(1200005, 1, CSocket))
{
byte Chan =(byte) Nano.Rand.Next(255);
if (Chan > 240) //about 6% success chance
{
CSocket.Client.Equipment[LinkBack].Soc2 = 255;
DeleteItem(1200005, 1, CSocket); int UId = CSocket.Client.Equipment[LinkBack].UID;
ItemUnequip(LinkBack, UId, CSocket);
ItemEquip(LinkBack, UId, CSocket);
Text("Congratulations your item has the second socket now", CSocket);
Link("Awesome, thanks man", 255, CSocket);
Face(100, CSocket);
End(CSocket);
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "All", "Waaaaaaw " + CSocket.Client.Name + " is so lucky to open the second socket using a Tough Drill", Struct.ChatType.Center), 0);
}
else
{
DeleteItem(1200005, 1, CSocket);
AddItem(1200006, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket, 1);
Text("O-o, Bad luck bunny you lost the drill for nothing", CSocket);
Link("I hate u", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
}
else
{
Text("Sorry you don't have any ToughDrills ", CSocket);
Link("Oh bye", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
}
}
else
{
Text("you need to open the first socket be4 u ask for the second you dumb", CSocket);
Link("you are the dumb", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
}
else
{
Text("Are you joking,how will i upgrade a none existing item", CSocket);
Text("Please wear your item first", CSocket);
Link("Oh,sorry forgot to wear it", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
}
else if (LinkBack == 3)
{
Text("Aha granted is granted", CSocket);
Text("\n Choose your item", CSocket);
Link("HeadGear", 31, CSocket);
Link("Nicklase/Bags", 32, CSocket);
Link("Armor/Coat", 33, CSocket);
Link("Ring/Bracelete", 36, CSocket);
Link("Boots", 38, CSocket);
Link("Nevermind", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
else if (LinkBack > 30 && LinkBack < 40)
{
LinkBack -= 30;
if (CSocket.Client.Equipment.ContainsKey(LinkBack))
{
if (CSocket.Client.Equipment[LinkBack].Soc1 > 0)
{
if (CSocket.Client.Equipment[LinkBack].Soc2 > 0)
{
Text("Your item has the second socket already", CSocket);
Link("I know", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
else
{
if (HasItem(1200006, 7, CSocket))
{
CSocket.Client.Equipment[LinkBack].Soc2 = 255;
DeleteItem(1200006, 7, CSocket); int UId = CSocket.Client.Equipment[LinkBack].UID;
ItemUnequip(LinkBack, UId, CSocket);
ItemEquip(LinkBack, UId, CSocket);
Text("Congratulations your item has the second socket now", CSocket);
Link("Awesome, thanks man", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
else
{
Text("Sorry you don't have 7 StarDrills ", CSocket);
Link("Oh bye", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
}
}
else
{
Text("you need to open the first socket be4 u ask for the second you dumb", CSocket);
Link("you are the dumb", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
}
else
{
Text("Are you joking,how will i upgrade a none existing item", CSocket);
Text("Please wear your item first", CSocket);
Link("Oh,sorry forgot to wear it", 255, CSocket);
Face(100, CSocket);
End(CSocket);
}
}
break;
}
#endregion
*-CelestialTao
Code:
#region CelestialTao
case 350050:
{
if (LinkBack == 0)
{
Text("Hello sweet face ,i can help u reallot your points if u want", CSocket);
Text("\n you may need to reallot them to customize your attributes", CSocket);
Text("\n but i will charge you one Dragon Ball ,so are you ready?", CSocket);
Link("Yes let's do it", 1, CSocket);
Link("Nuh i am poor", 255, CSocket);
Face(63, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (HasItem(1088000, 1, CSocket))
{
DeleteItem(1088000, 1, CSocket);
CSocket.Client.StatPoints += CSocket.Client.Strength;
CSocket.Client.StatPoints += CSocket.Client.Dexterity;
CSocket.Client.StatPoints += CSocket.Client.Spirit;
CSocket.Client.StatPoints += CSocket.Client.Vitality;
CSocket.Client.Strength = CSocket.Client.Dexterity = CSocket.Client.Spirit = CSocket.Client.Vitality = 0;
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Strength, Struct.StatusTypes.StrengthStatPoints));
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Dexterity, Struct.StatusTypes.DexterityStatPoints));
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Vitality, Struct.StatusTypes.VitalityStatPoints));
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Spirit, Struct.StatusTypes.ManaStatPoints));
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.StatPoints, Struct.StatusTypes.AttributePoints));
Calculation.Vitals(CSocket, false); Calculation.Attack(CSocket);
Text("Congratz your points has been reset", CSocket);
Link("Ok,thanks", 255, CSocket);
Face(63, CSocket);
End(CSocket);
}
else
{
Text("Sorry you do not have any Dragon balls", CSocket);
Link("Oh sorry i'll be back", 255, CSocket);
Face(63, CSocket);
End(CSocket);
}
}
break;
}
#endregion
*-Ethereal
Code:
#region Ethereal //Enchanted & +10 Man
case 450: //Ethereal
{
if (LinkBack == 0)
{
Text("Hey sweety, what is up ?", CSocket);
Text("\n I can help you having some extra HP", CSocket);
Text("\n reduce the damage on you", CSocket);
Text("\n or upgrade your gears 10-12", CSocket);
Link("Enchant my gears", 1, CSocket);
Link("Bless my gears", 2, CSocket);
Link("Compose my gears", 3, CSocket);
Link("Nothing, l8er :P", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else if (LinkBack == 1) CSocket.Send(ConquerPacket.Enchant(CSocket.Client.ID));
else if (LinkBack == 2)
{
Text("Ok here we go , here you are my Price List", CSocket);
Text("\n 1 Super Tortoise Gem if your item has no bless or -1", CSocket);
Text("\n 3 Super Tortoise Gem if your item is -3 to be -5", CSocket);
Text("\n 5 Super Tortoise Gem if your item is -5 to be -7", CSocket);
Text("\n If you agree with that choose your item", CSocket);
Link("HeadGear", 21, CSocket);
Link("Nicklase/Bags", 22, CSocket);
Link("Armor/Coat", 23, CSocket);
Link("Weapons", 24, CSocket);
Link("Ring/Bracelete", 26, CSocket);
Link("Boots", 28, CSocket);
Link("Nevermind", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else if (LinkBack > 20 && LinkBack < 30)
{
LinkBack -= 20;
if (CSocket.Client.Equipment.ContainsKey(LinkBack))
{
byte StgNeeded = 0;
if (CSocket.Client.Equipment[LinkBack].Bless <3) StgNeeded = 1;
else if (CSocket.Client.Equipment[LinkBack].Bless == 3) StgNeeded = 3;
else if (CSocket.Client.Equipment[LinkBack].Bless == 5) StgNeeded = 5;
if (StgNeeded < 1)
{
Text("Oh sorry your item has reached the max bless i can give", CSocket);
Link("ok,bye ", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else
{
if (HasItem(700073, StgNeeded, CSocket))
{
if (CSocket.Client.Equipment[LinkBack].Bless == 0) CSocket.Client.Equipment[LinkBack].Bless = -1;
CSocket.Client.Equipment[LinkBack].Bless +=2;
DeleteItem(700073, StgNeeded, CSocket); int UId = CSocket.Client.Equipment[LinkBack].UID;
ItemUnequip(LinkBack, UId, CSocket);
ItemEquip(LinkBack, UId, CSocket);
Text("Congratulations your item has been upgraded", CSocket);
Link("Awesome, thanks man", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else
{
Text("Sorry you don't have enough Tortois Gems, this items costs " + StgNeeded + " STGs", CSocket);
Link("Oh bye", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
}
}
else
{
Text("Are you joking,how will i upgrade a none existing item", CSocket);
Text("Please wear your item first", CSocket);
Link("Oh,sorry forgot to wear it", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
}
else if (LinkBack == 3)
{
Text("Ok here we go , here you are my Price List", CSocket);
Text("\n 1 DragonBall Scroll to get your item to +10", CSocket);
Text("\n 3 DragonBall Scroll to get your item to +11", CSocket);
Text("\n 5 DragonBall Scroll to get your item to +12", CSocket);
Text("\n If you agree with that choose your item", CSocket);
Link("HeadGear", 31, CSocket);
Link("Nicklase/Bags", 32, CSocket);
Link("Armor/Coat", 33, CSocket);
Link("Weapons", 34, CSocket);
Link("Ring/Bracelete", 36, CSocket);
Link("Boots", 38, CSocket);
Link("Nevermind", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else if (LinkBack > 30 && LinkBack < 40)
{
LinkBack -= 30;
if (CSocket.Client.Equipment.ContainsKey(LinkBack))
{
byte DBSNeeded = 0;
if (CSocket.Client.Equipment[LinkBack].Plus ==9) DBSNeeded = 1;
else if (CSocket.Client.Equipment[LinkBack].Plus == 10) DBSNeeded = 3;
else if (CSocket.Client.Equipment[LinkBack].Plus == 11) DBSNeeded = 5;
else if (CSocket.Client.Equipment[LinkBack].Plus < 9)
{
Text("You have to get your item to +9 first then come back here", CSocket);
Link("Damn,i was in hurry", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
if (DBSNeeded == 0)
{
Text("Oh sorry your item has reached the max bless i can give", CSocket);
Link("ok,bye ", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else if (DBSNeeded>0)
{
if (HasItem(720028, DBSNeeded, CSocket))
{
CSocket.Client.Equipment[LinkBack].Plus ++;
DeleteItem(720028, DBSNeeded, CSocket); int UId = CSocket.Client.Equipment[LinkBack].UID;
ItemUnequip(LinkBack, UId, CSocket);
ItemEquip(LinkBack, UId, CSocket);
Text("Congratulations your item has been upgraded", CSocket);
Link("Awesome, thanks man", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
else
{
Text("Sorry you don't have enough DBScrolls, this items costs " + DBSNeeded + "DBScroll(s)", CSocket);
Link("Oh bye", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
}
}
else
{
Text("Are you joking,how will i upgrade a none existing item", CSocket);
Text("Please wear your item first", CSocket);
Link("Oh,sorry forgot to wear it", 255, CSocket);
Face(55, CSocket);
End(CSocket);
}
}
break;
}
#endregion
Code:
public static byte[] Enchant(int PlayerID)
{
PacketBuilder Packet = new PacketBuilder(1010, 24);
Packet.Int(64);
Packet.Int(3);
Packet.Int(170);
Packet.Int(99);
Packet.Long(PlayerID);
Packet.Long(1091);
Packet.Int(223);
Packet.Int(0);
Packet.Int(58);
Packet.Int(1);
Packet.Short(7);
Packet.Short(116);
return Packet.getFinal();
}
Code:
case 28://Enchant
{
int ItemId = ReadLong(Data, 4); int GemID = ReadLong(Data, 8);
byte GemType = 0; byte EnchantToGive = 0;
if (CSocket.Client.Inventory.ContainsKey(ItemId))
{
if (CSocket.Client.Inventory.ContainsKey(GemID))
{
GemType = (byte)(CSocket.Client.Inventory[GemID].ItemID - 700000);
if (GemType.ToString().EndsWith("1")) EnchantToGive = (byte)Nano.Rand.Next(5, 50);
else if (GemType.ToString().EndsWith("2")) EnchantToGive = (byte)Nano.Rand.Next(50, 150);
else if (GemType == 13) EnchantToGive = (byte)Nano.Rand.Next(210, 255);//SDG
else if (GemType.ToString().EndsWith("3")) EnchantToGive = (byte)Nano.Rand.Next(150, 225);
if (EnchantToGive > 0)
{
Handler.DeleteItem(CSocket.Client.Inventory[GemID].ItemID, 1, CSocket);
if (CSocket.Client.Inventory[ItemId].Enchant <= EnchantToGive)
{
CSocket.Client.Inventory[ItemId].Enchant = EnchantToGive; Struct.ItemInfo NewIt = CSocket.Client.Inventory[ItemId];
CSocket.Send(ConquerPacket.ItemUsage(NewIt.UID, 0, Struct.ItemUsage.UpdateItem));
CSocket.Send(ConquerPacket.ItemInfo(CSocket.Client.Inventory[ItemId]));
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Waw you Gain extra HP by " + EnchantToGive, Struct.ChatType.Top));
}
else
{
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Your gem gave a lower Enchanted than that ur item has , Better luck next time!", Struct.ChatType.Top));
}
}
}
else
{
CSocket.Send(ConquerPacket.Chat(0, "System", "you", "Cant find the gem", Struct.ChatType.Top));
}
}
else CSocket.Send(ConquerPacket.Chat(0, "System", "you", "Cant find the Item", Struct.ChatType.Top));
break;
}
*DisCity
NPcTalk
Code:
#region Solar Saint
case 3215://Enter Stage1
{
if (LinkBack == 0)
{
Text("Our ancestors exerted their utmost efforts and defeated the demons.", CSocket);
Text("\n Since then the world has been kept in peace for", CSocket);
Text("\n hundreds of years. Now the demons have come back and the world is getting into turbulence again.", CSocket);
Link("Would you tell me more?", 1, CSocket);
Link("I am here to drive away the evils!", 2, CSocket);
Link("I`d better leave.", 255, CSocket);
Face(89, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
Text("The decisive battle between human and demon broke out here.", CSocket);
Text("\n The ferocious battle lasted for seven days and.", CSocket);
Text("\n nights. Countless heroes lost their lives. And the justise won.",CSocket);
Text("\n Afterwards we can live in peace for hundreds of years.", CSocket);
Link("And then?", 3,CSocket);
Link("Long story bye", 255, CSocket);
Face(89, CSocket);
End(CSocket);
}
else if (LinkBack == 2)
{
if (Nano.DisCityTime)
{
Teleport(2021, 190, 340, 0, CSocket);
GiveExpBall(33, CSocket);
}
else
{
Text("I`m glad to see that you are such a knightly person.", CSocket);
Text("\n but it's not the right time, please come here at the r8 time.", CSocket);
Link("Ok,i'll come back at then", 255, CSocket);
Face(89, CSocket);
End(CSocket);
}
}
else if (LinkBack == 3)
{
Text("UltimatePluto, leader of the demons sworn to take revenge in one thousand years before he managed to run away. To",CSocket);
Text("\n prevent the demons coming back, I have been scouting their land cautiously. Yesterday I found something unwanted.",CSocket);
Text("\n It seems that UltimatePluto has come round to endanger humans again.",CSocket);
Link("What should we do?", 4,CSocket);
Link("I`d better leave.", 255, CSocket);
Face(89, CSocket);
End(CSocket);
}
else if (LinkBack == 4)
{
Text("Fortunately UltimatePluto is still unfledged. He must resort to a Battle Formation for the moment. So I am about",CSocket);
Text("to organize an army to infiltrate his land and destroy his formation before he becomes stronger.",CSocket);
Link("I`ll join you.", 2,CSocket);
Link("Sigh, I`m helpless.", 255,CSocket);
Face(89, CSocket);
End(CSocket);
}
break;
}
case 3213://To stage2
{
if (LinkBack == 0)
{
Text("Hello hero so did u collect the rquired souls?", CSocket);
Link("Yes,here you are", 1, CSocket);
Link("No,i'll be back", 255, CSocket);
Face(89, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (HasItem(723085, 5, CSocket))
{
DeleteItem(723085, 5, CSocket);
Teleport(2022, 240, 340, 0, CSocket);
GiveExpBall(66, CSocket);
}
else
{
Text("Sweety you have to collect at least 5 Soul Stones,try harder", CSocket);
Link("Ok,i'll try my best", 255, CSocket);
Face(89, CSocket);
End(CSocket);
}
}
break;
}
case 3214://ToStage3
{
if (LinkBack == 0)
{
short Required = 600; byte Class = (byte)CSocket.Client.Class;
if (Class < 16) Required = 800;
else if (Class > 19 && Class < 26) Required = 900;
else if (Class > 39 && Class < 46) Required = 1300;
else if (Class > 49 && Class < 56) Required = 800;
else if (Class > 139 && Class < 146) Required = 1000;
if (CSocket.Client.DisCityMobs >= Required)
{
Text("Great my hero u did a great fight there,choose your formation map", CSocket);
Link("Right", 1, CSocket);
Link("Left", 2, CSocket);
Face(89, CSocket);
End(CSocket);
}
else
{
Text("Ooh , tierd so fast ?!,get your ass back to the battle ", CSocket);
Text("\n you still need to kill " + (Required - CSocket.Client.DisCityMobs) + " more monsters", CSocket);
Link("kk, i'll go now master", 255, CSocket);
Face(89, CSocket);
End(CSocket);
}
}
else if (LinkBack == 1)
{
if (Nano.PlayersOnDisCity3 > 8)
TeleportAll(2021, 1020, 565, 565);
else if (Nano.PlayersOnDisCity3 > 15)
TeleportAll(2023, 2024, 150, 290);
Teleport(2023, 300, 660, 0, CSocket); Nano.PlayersOnDisCity3++;
GiveExpBall(100, CSocket);
}
break;
}
#endregion
Code:
public static void GiveExpBall(short PerCent,ClientSocket CSocket)
{
int ExpGain = (int)Math.Floor(600000 * (1 + ((CSocket.Client.Level - 1) * 0.4)));
ExpGain =(ExpGain* PerCent) / 100;
Calculation.ExpAdd(CSocket, (ulong)ExpGain, false);
}
Code:
public static void ExpAdd(ClientSocket CSocket,ulong Exp, bool Add)
{
if (Add)
{
CSocket.Client.Exp += Exp;
if (CSocket.Client.Exp > NeededExp(CSocket.Client.Level))
{
GiveLevel(CSocket);
}
else CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Exp, Struct.StatusTypes.Exp));
}
else
{
CSocket.Client.Exp -= Exp;
}
}
Code:
public static void TeleportAll(short From, short To, short X, short Y)
{
foreach (KeyValuePair<int, ClientSocket> Clients in Nano.ClientPool)
{
ClientSocket CSocket = Clients.Value;
if ((short)CSocket.Client.Map == From) Teleport(To, X, Y, 0, CSocket);
}
}
A- add a new variable at Character.cs called
Code:
public short DisCityMobs = 0;
Code:
public static bool DisCityTime = false; public static byte PlayersOnDisCity3 = 0;
if not then u will need to figure a way to calac the DisCity time
or add this global timer at Nano.cs main definitions
Code:
public static System.Timers.Timer GlobalTimer = new System.Timers.Timer();
Code:
GlobalTimer.Interval = 1000;
GlobalTimer.Elapsed += delegate
{
};
GlobalTimer.Start();
then add at the end of it's delegate the next code
Code:
#region Check Events
//Saturday 20:30 to 21:10 Weekly PK war http://co.91.com/guide/quests/pkwar.shtml
//Class PK war http://co.91.com/guide/quests/propkwar.shtml
DateTime TimeNow = DateTime.Now; string Hours = TimeNow.TimeOfDay.ToString();
switch (TimeNow.DayOfWeek.ToString())
{
case "Saturday":
{
if (Hours.Remove(5) == "20:30") WeeklyPkWar = true;
else if (Hours.Remove(5) == "21:10")
{
WeeklyPkWar = false;
}
break;
}
case "Sunday":
{
if (Hours.Remove(5) == "20:00") PKTournament = true;
else if (Hours.Remove(5) == "20:59") PKTournament = false;
break;
}
case "Monday":
{
if (Hours.Remove(5) == "14:00" || Hours.Remove(5) == "22:00") ClassPkWar = 10;
else if (Hours.Remove(5) == "14:30" || Hours.Remove(5) == "22:30") ClassPkWar = 0;
break;
}
case "Tuesday":
{
if (Hours.Remove(5) == "14:00" || Hours.Remove(5) == "22:00") ClassPkWar = 20;
else if (Hours.Remove(5) == "14:30" || Hours.Remove(5) == "22:30") ClassPkWar = 0;
if (!DisCityTime)
{
if (Hours.Remove(4) == "8:55" || Hours.Remove(5) == "20:55")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "5 minuts left for DisCity,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
}
else if (Hours.Remove(4) == "8:56" || Hours.Remove(5) == "20:56")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "4 minuts left for DisCity,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
}
else if (Hours.Remove(4) == "8:57" || Hours.Remove(5) == "20:57")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "3 minuts left for DisCity,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
}
else if (Hours.Remove(4) == "8:58" || Hours.Remove(5) == "20:58")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "Only 2 minuts left for DisCity,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
}
else if (Hours.Remove(4) == "8:59" || Hours.Remove(5) == "20:59")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "Only 1 minuts left for DisCity,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
}
else if (Hours.Remove(4) == "9:00" || Hours.Remove(5) == "21:00")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "DisCity quest starts now ,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
DisCityTime = true;
}
else if (Hours.Remove(4) == "9:59" || Hours.Remove(5) == "21:59")
{
DisCityTime = false;
}
}
break;
}
case "Wednesday":
{
if (Hours.Remove(5) == "14:00" || Hours.Remove(5) == "22:00") ClassPkWar = 40;
else if (Hours.Remove(5) == "14:30" || Hours.Remove(5) == "22:30") ClassPkWar = 0;
break;
}
case "Thursday":
{
if (Hours.Remove(5) == "14:00" || Hours.Remove(5) == "22:00") ClassPkWar = 130;
else if (Hours.Remove(5) == "14:30" || Hours.Remove(5) == "22:30") ClassPkWar = 0;
if (!DisCityTime)
{
if (Hours.Remove(4) == "8:55" || Hours.Remove(5) == "20:55")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "5 minuts left for DisCity,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
}
else if (Hours.Remove(4) == "8:56" || Hours.Remove(5) == "20:56")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "4 minuts left for DisCity,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
}
else if (Hours.Remove(4) == "8:57" || Hours.Remove(5) == "20:57")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "3 minuts left for DisCity,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
}
else if (Hours.Remove(4) == "8:58" || Hours.Remove(5) == "20:58")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "Only 2 minuts left for DisCity,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
}
else if (Hours.Remove(4) == "8:59" || Hours.Remove(5) == "20:59")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "Only 1 minuts left for DisCity,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
}
else if (Hours.Remove(4) == "9:00" || Hours.Remove(5) == "21:00")
{
ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "ALLUSERS", "DisCity quest starts now ,Find Solar Saint at Ape City to join the quest", Struct.ChatType.Top), 0);
DisCityTime = true;
}
else if (Hours.Remove(4) == "9:59" || Hours.Remove(5) == "21:59")
{
DisCityTime = false;
}
}
break;
}
case "Friday":
{
if (Hours.Remove(5) == "14:00" || Hours.Remove(5) == "22:00") ClassPkWar = 50;
else if (Hours.Remove(5) == "14:30" || Hours.Remove(5) == "22:30") ClassPkWar = 0;
break;
}
}
#endregion
D- find
Code:
AttackedMob.Die(CSocket.Client.ID);
Code:
if ((int)CSocket.Client.Map == 2022)
{
if (AttackedMob.Info.Name == "HellTroll") CSocket.Client.DisCityMobs += 3;
else CSocket.Client.DisCityMobs++;
}
* Fixed SocketGem.CS
Code:
public static void SocketGem(int ItemID, int GItemID, byte Socket,byte Type, ClientSocket CSocket)
{
if(CSocket.Client.Inventory.ContainsKey(ItemID) )
{
Struct.ItemInfo Item = CSocket.Client.Inventory[ItemID];
if (Type == 0 && CSocket.Client.Inventory.ContainsKey(GItemID))
{
int SocGem = Convert.ToInt32(CSocket.Client.Inventory[GItemID].ItemID.ToString().Substring(3));
if (Socket == 1)
{
Item.Soc1 = SocGem;
}
else if (Socket == 2 && Item.Soc1 > 0)
{
Item.Soc2 = SocGem;
}
else if (Socket == 2 && Item.Soc1 == 0)
{
Item.Soc1 = SocGem;
}
Database.Database.DeleteItem(GItemID);
CSocket.Client.Inventory.Remove(GItemID);
CSocket.Send(ConquerPacket.ItemUsage(GItemID, 255, Struct.ItemUsage.RemoveItem));
}
else if (Type == 1)
{
if (Socket == 1) Item.Soc1 = 255;
else if (Socket == 2) Item.Soc2 = 255;
}
Database.Database.UpdateItem(Item);
CSocket.Send(ConquerPacket.ItemUsage(ItemID, 255, Struct.ItemUsage.RemoveItem));
CSocket.Send(ConquerPacket.ItemInfo(Item.UID, Item.ItemID, Item.Plus, Item.Progress, Item.Bless, Item.Enchant, Item.Soc1, Item.Soc2, Item.Dura, Item.MaxDura, Item.Position, Item.Color, Item.Locked, Item.Free));
}
else
{
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[ERROR] The item does not exist.", Struct.ChatType.Top));
}
}
Code:
#region SocketGem 1027
case 1027:
{
int ItemID = (Data[11] << 24) + (Data[10] << 16) + (Data[9] << 8) + (Data[8]);
int GemID = (Data[15] << 24) + (Data[14] << 16) + (Data[13] << 8) + (Data[12]);
byte socket = (byte)((Data[17] << 8) + (Data[16])); byte Type_ = Data[18];
Handler.SocketGem(ItemID, GemID, socket,Type_, CSocket);
break;
}
#endregion
*Lottery System
it has all co2 lotto items and fixed as possible i could make
-first add a new variable at Character.cs named
Code:
public bool Lotto = false;
-At Nano.cs -->StartServer void add
Code:
Database.Database.LoadLottoItems();
Code:
internal static void LoadLottoItems()
{
string[] Lotto = System.IO.File.ReadAllLines("Lotto.txt");
for (short Cur = 0; Cur < Lotto.Length; Cur++)
{
if (Lotto[Cur] != null && Lotto[Cur] != "")
{
string[] Item = Lotto[Cur].Split(',');
Struct.ItemInfo TheItem = new Struct.ItemInfo();
TheItem.ItemID = int.Parse(Item[0]); TheItem.Plus = int.Parse(Item[1]);
TheItem.Soc1 = int.Parse(Item[2]); TheItem.Soc2 = int.Parse(Item[3]);
//TheItem.MaxDura = TheItem.Dura = 50;
TheItem.Bless = TheItem.Progress = TheItem.Enchant = TheItem.Free = TheItem.Locked = 0;
if (Nano.Items.ContainsKey(TheItem.ItemID))
{
Nano.Lotto.Add(Cur, TheItem);
}
}
}
}
Code:
#region Lotto
case 923:// Lady Luck enter
{
if (LinkBack == 0)
{
Text("Welcome to the Lottery Center! There are meny LuckyBoxes which have innumerable treasure such as super gems,two-socket gears, up to 500,000,000 silvers etc. in them. If you are level 70 or above, you are allowed to enter the Lottery Center and try your luck at most ten times a day.", CSocket);
Text("And I charge you only 27 CPs for each admission.Come on, Try your luck right now!", CSocket);
Link("Wow, good deal!", 1, CSocket);
Link("May I know the rules first?", 2, CSocket);
Link("No Thanks!", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (CSocket.Client.Level >= 70)
{
if (CSocket.Client.Inventory.Count < 40)
{
if (CSocket.Client.CPs >= 27)
{
Teleport(700, 40, 50, 0, CSocket);
CPs(-27, CSocket); CSocket.Client.Lotto = true;
}
else
{
Text("I'm sorry you do not have the required CPs.", CSocket);
Link("Okay, I will be back when I have 27 CPs.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
}
else
{
Text("Please free one slot in your item box first", CSocket);
Link("Ah,ok be r8 back", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
}
else
{
Text("I'm sorry you do not have the required Level 70.", CSocket);
Link("Okay, I will be back when I have level 70.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
}
if (LinkBack == 2)
{
Text("you will be teleported to Lottery Center where there are menny LuckyBoxes after you pay me 27 CPs. You may choose one box to try your luck at your will.", CSocket);
Text(" Remeber you have only one chance to open a LuckyBox every time. If you want to open another box, you have to leave the room to re-enrol in Market.", CSocket);
Link("OK I see.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
break;
}
case 924: // LadyLuck
{
if (LinkBack == 0)
{
Text("Do you want to leave Lottery Center and go back to the Market?.", CSocket);
Link("Yes Please,", 1, CSocket);
Link("No Thank you I want to stay.", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
Teleport(1036, 220, 193, 0, CSocket);
}
break;
}
case 3952:
{
Text("Sorry, I'm off duty at the moment.", CSocket);
Link("Lazy son of a...", 255, CSocket);
End(CSocket);
break;
}
case 925:
case 926:
case 927:
case 928:
case 929:
case 930:
case 931:
case 932:
case 933:
case 934:
case 935:
case 936:
case 937:
case 938:
case 939:
case 940:
case 942:
case 943:
case 944:
case 945:
{
if (CSocket.Client.Lotto)
{
bool Found = false; short Chance = 0;string ItemName="";
while (!Found)
{
Chance = (short)Nano.Rand.Next(Nano.Lotto.Count);
if (Chance > 999) Chance = (short)Nano.Rand.Next(Nano.Lotto.Count);
if (Nano.Lotto.ContainsKey(Chance)) Found = true;
}
if (Found)
{
CSocket.Client.Lotto = false;
Struct.ItemInfo It = Nano.Lotto[Chance];
AddItem(It.ItemID, 0, It.Dura, 0, It.Plus, 0, 0, It.Soc1, It.Soc2, It.Color, CSocket,1);
if (It.ItemID.ToString().EndsWith("8"))
{
if (It.Soc1>0||It.Plus==8)
{
ItemName = "An Elite ";
if (It.Soc2 > 0) ItemName += "2 socket ";
else if (It.Soc1 > 0) ItemName += "one socket ";
else if (It.Plus == 8) ItemName += "+8 ";
}
}
else if (It.ItemID.ToString().EndsWith("9") && It.ItemID != 723719) ItemName = "A Super ";
if (Nano.Items.ContainsKey(It.ItemID)) ItemName += Nano.Items[It.ItemID].Name;
CSocket.Send(ConquerPacket.Chat(0, "System", "", "Congratz you have won " + ItemName, Struct.ChatType.Top));
if (Chance > 510) ConquerPacket.ToServer(ConquerPacket.Chat(0, "System", "All", CSocket.Client.Name + " was so lucky to won " + ItemName + " from lady luck at Market", Struct.ChatType.Yell), 0);
}
}
break;
}
#endregion
Damn , it said the text is too long :p i couldn't add the Talismans here so c post 3