|
private void CharactersCallback(GameState client, int time)
#region WardrobeTitles
if (Time32.Now >= client.Player.LastWardrobeStamp.AddMinutes(1)) { client.Player.LastWardrobeStamp = Time32.Now; new TitleStorage().CheckTitles(client); }
#endregion
private void CharactersCallback(GameState client, int time)
#region WardrobeTitles
if (Time32.Now >= client.Player.LastWardrobeStamp.AddMinutes(1)) { client.Player.LastWardrobeStamp = Time32.Now; new TitleStorage().CheckTitles(client); }
#endregion
public void CheckTitles(Client.GameState client)
{
if (client.Player.haveallTitles) { GetAll(client); return; }
#region Titles And Wings Equips
#region Wings
#region Union Emperor
if (client.Union != null)
if (client.Union.IsKingdom())
if (client.Union.IsLeader(client.Player.UID))
new TitleStorage().AddTitle(client, 4001, 1000, false);
else
new TitleStorage().RemoveTitle(client, 4001, 1000, false);
else
new TitleStorage().RemoveTitle(client, 4001, 1000, false);
else
new TitleStorage().RemoveTitle(client, 4001, 1000, false);
#endregion
#region The Champion Of Elite Pk Tournament
if (client.Player.Titles.ContainsKey(TitlePacket.Titles.ElitePKChamption_High))
{
DateTime date = DateTime.Now;
for (int i = DateTime.Now.Day; i < 31; i++)
{
date = new DateTime(DateTime.Now.Year, DateTime.Now.Month, i);
if (date.DayOfWeek == DayOfWeek.Friday)
{
date = new DateTime(DateTime.Now.Year, DateTime.Now.Month, i, 19, 55, 0);
break;
}
}
if (date.Day == DateTime.Now.Day && date.Hour == DateTime.Now.Hour && date.Year == DateTime.Now.Year && date.Minute == date.Minute && DateTime.Now.DayOfWeek != DayOfWeek.Friday)
{
for (int i = 1; i < 31; i++)
{
date = new DateTime(DateTime.Now.Year, DateTime.Now.Month + 1, i);
if (date.DayOfWeek == DayOfWeek.Friday)
{
date = new DateTime(DateTime.Now.Year, DateTime.Now.Month + 1, i, 19, 55, 0);
break;
}
}
}
TimeSpan timespan = date - DateTime.Now;
int time = (int)(timespan.TotalSeconds);
new TitleStorage().AddTitle(client, 6001, 20, false, time);
}
else
new TitleStorage().RemoveTitle(client, 6001, 20, false);
#endregion
#region Own a 5-star garment
if (Database.WardrobeTable.AmountStarGarments(client, 5) >= 1)
{
new TitleStorage().AddTitle(client, 6003, 22, false);
}
else
new TitleStorage().RemoveTitle(client, 6003, 22, false);
#endregion
#region Own a 5-star Mount armor
if (Database.WardrobeTable.AmountStarMounts(client, 5) >= 1)
{
new TitleStorage().AddTitle(client, 6004, 23, false);
}
else
new TitleStorage().RemoveTitle(client, 6004, 23, false);
#endregion
#region Prestige Score reaches 600,000
if (client.Player.TotalPerfectionScore >= 600000)
{
new TitleStorage().AddTitle(client, 2026, 2026, false);
}
else
new TitleStorage().RemoveTitle(client, 2026, 2026, false);
#endregion
#region Stars Score reaches 324
if (client.Equipment.TotalStars >= 324)
{
new TitleStorage().AddTitle(client, 6007, 6007, false);
}
else
new TitleStorage().RemoveTitle(client, 6007, 6007, false);
#endregion
#region Stars Score reaches 216
if (client.Equipment.TotalStars >= 216)
{
new TitleStorage().AddTitle(client, 6008, 6008, false);
}
else
new TitleStorage().RemoveTitle(client, 6008, 6008, false);
#endregion
#endregion
#region Titles
#region Union Emperor
if (client.Union != null)
if (client.Union.IsKingdom())
if (client.Union.IsLeader(client.Player.UID))
new TitleStorage().AddTitle(client, 1, 1000, false);
else
new TitleStorage().RemoveTitle(client, 1, 1000, false);
else
new TitleStorage().RemoveTitle(client, 1, 1000, false);
else
new TitleStorage().RemoveTitle(client, 1, 1000, false);
#endregion
#region VIP
if (client.Player.VIPLevel > 0)
{
switch (client.Player.VIPLevel)
{
case 1:
case 2:
case 3:
case 4:
{
new TitleStorage().AddTitle(client, 2030, 2030, false);
break;
}
case 5:
case 6:
{
new TitleStorage().AddTitle(client, 2029, 2029, false);
break;
}
case 7:
{
new TitleStorage().AddTitle(client, 2031, 2031, false);
break;
}
}
}
else
{
new TitleStorage().RemoveTitle(client, 2030, 2030, false);
new TitleStorage().RemoveTitle(client, 2029, 2029, false);
new TitleStorage().RemoveTitle(client, 2031, 2031, false);
}
#endregion
#region CollectedRandMonkey
if (CollectedRandMonkey(client))
{
new TitleStorage().AddTitle(client, 2013, 14, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2013, 14, false);
}
#endregion
#region Collect 8 kinds of permanent saint monkeys (can be activated via the Wardrobe after the event)
if (Collected8TypesMonkey(client))
{
new TitleStorage().AddTitle(client, 2016, 17, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2016, 17, false);
}
#endregion
#region Collect a permanent Solar Monkey
if (CollectedMonkey(client, 200559))
{
new TitleStorage().AddTitle(client, 2014, 15, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2014, 15, false);
}
#endregion
#region Collect a permanent Lunar Monkey
if (CollectedMonkey(client, 200560))
{
new TitleStorage().AddTitle(client, 2015, 16, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2015, 16, false);
}
#endregion
#region Tulip
if (client.Player.MyFlowers != null && client.Player.MyFlowers.RankTuilps == 1)
{
new TitleStorage().AddTitle(client, 6005, 6005, false);
}
else
{
new TitleStorage().RemoveTitle(client, 6005, 6005, false);
}
#endregion
#region The Total Score of Chi Study Reaches 1.600 Points
if (client.ChiData.DragonPoints == 400 && client.ChiData.PhoenixPoints == 400 && client.ChiData.TigerPoints == 400 && client.ChiData.TurtlePoints == 400)
{
new TitleStorage().AddTitle(client, 2018, 1, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2018, 1, false);
}
#endregion
#region Prestige Score reaches 400,000
if (client.Player.TotalPerfectionScore >= 400000)
{
new TitleStorage().AddTitle(client, 2027, 2027, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2027, 2027, false);
}
#endregion
#region The Total Score Of Jiang hu training reaches 81,000 points(Title)
if (client.Player.MyJiang != null && client.Player.MyJiang.Inner_Strength >= 81000)
{
new TitleStorage().AddTitle(client, 2004, 5, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2004, 5, false);
}
#endregion
#region Complete 320 Achievement
if (client.Player.MyAchievement.Count(client.Player.UID) >= 320)
{
new TitleStorage().AddTitle(client, 2001, 2, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2001, 2, false);
}
#endregion
#region Own 5 garments of 4-star or 5-star
if (Database.WardrobeTable.AmountStarGarments(client, 4) >= 5)
{
new TitleStorage().AddTitle(client, 2005, 6, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2005, 6, false);
}
#endregion
#region Own 5 Mount of 4-star or 5-star
if (Database.WardrobeTable.AmountStarMounts(client, 4) >= 5)
{
new TitleStorage().AddTitle(client, 2006, 7, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2006, 7, false);
}
#endregion
#region CelestialFox(200595)
if (CollectedCelestialFox(client))
{
new TitleStorage().AddTitle(client, 2050, 2050, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2050, 2050, false);
}
#endregion
#region CelestialFox(Fantasy)(200596)
if (CollectedCelestialFoxFantasy(client))
{
new TitleStorage().AddTitle(client, 2051, 2051, false);
}
else
{
new TitleStorage().RemoveTitle(client, 2051, 2051, false);
}
#endregion
#endregion
#endregion
#region GM
/*if (client.Account.State == Database.AccountTable.AccountState.GameMaster)
{
foreach (var title in Database.WardrobeTable.Titles.Values)
{
AddTitle(client, (short)title.Type, (short)title.ID);
}
}*/
#endregion
}
public void GetAll(Client.GameState client)
{
foreach (var title in Database.WardrobeTable.Titles.Values)
{
AddTitle(client, (short)title.Type, (short)title.ID, false);
}
client.Player.haveallTitles = true;
}
public bool haveallTitles = false;
public static bool SaveEntity(Client.GameState c)
using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE).Update("entities"))
{
.Set("HaveAllTitles", e.haveallTitles)
public static bool LoadEntity(Client.GameState client, uint uid = 0)
client.Player.haveallTitles = reader.ReadBoolean("HaveAllTitles");
#region WarDrobe
case 995:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Hello " + client.Player.Name + ", How are you ? I am the manager of the new titles / wings");
dialog.Text("Do you want to buy wings / titles For free?");
dialog.Option("All Wing&Titel", 1);
break;
}
case 1:
{
new TitleStorage().GetAll(client);
break;
}
}
break;
}
#endregion
public void checktitles(client.gamestate client)
{
if (client.player.havealltitles) { getall(client); return; }
#region titles and wings equips
#region wings
#region union emperor
if (client.union != null)
if (client.union.iskingdom())
if (client.union.isleader(client.player.uid))
new titlestorage().addtitle(client, 4001, 1000, false);
else
new titlestorage().removetitle(client, 4001, 1000, false);
else
new titlestorage().removetitle(client, 4001, 1000, false);
else
new titlestorage().removetitle(client, 4001, 1000, false);
#endregion
#region the champion of elite pk tournament
if (client.player.titles.containskey(titlepacket.titles.elitepkchamption_high))
{
datetime date = datetime.now;
for (int i = datetime.now.day; i < 31; i++)
{
date = new datetime(datetime.now.year, datetime.now.month, i);
if (date.dayofweek == dayofweek.friday)
{
date = new datetime(datetime.now.year, datetime.now.month, i, 19, 55, 0);
break;
}
}
if (date.day == datetime.now.day && date.hour == datetime.now.hour && date.year == datetime.now.year && date.minute == date.minute && datetime.now.dayofweek != dayofweek.friday)
{
for (int i = 1; i < 31; i++)
{
date = new datetime(datetime.now.year, datetime.now.month + 1, i);
if (date.dayofweek == dayofweek.friday)
{
date = new datetime(datetime.now.year, datetime.now.month + 1, i, 19, 55, 0);
break;
}
}
}
timespan timespan = date - datetime.now;
int time = (int)(timespan.totalseconds);
new titlestorage().addtitle(client, 6001, 20, false, time);
}
else
new titlestorage().removetitle(client, 6001, 20, false);
#endregion
#region own a 5-star garment
if (database.wardrobetable.amountstargarments(client, 5) >= 1)
{
new titlestorage().addtitle(client, 6003, 22, false);
}
else
new titlestorage().removetitle(client, 6003, 22, false);
#endregion
#region own a 5-star mount armor
if (database.wardrobetable.amountstarmounts(client, 5) >= 1)
{
new titlestorage().addtitle(client, 6004, 23, false);
}
else
new titlestorage().removetitle(client, 6004, 23, false);
#endregion
#region prestige score reaches 600,000
if (client.player.totalperfectionscore >= 600000)
{
new titlestorage().addtitle(client, 2026, 2026, false);
}
else
new titlestorage().removetitle(client, 2026, 2026, false);
#endregion
#region stars score reaches 324
if (client.equipment.totalstars >= 324)
{
new titlestorage().addtitle(client, 6007, 6007, false);
}
else
new titlestorage().removetitle(client, 6007, 6007, false);
#endregion
#region stars score reaches 216
if (client.equipment.totalstars >= 216)
{
new titlestorage().addtitle(client, 6008, 6008, false);
}
else
new titlestorage().removetitle(client, 6008, 6008, false);
#endregion
#endregion
#region titles
#region union emperor
if (client.union != null)
if (client.union.iskingdom())
if (client.union.isleader(client.player.uid))
new titlestorage().addtitle(client, 1, 1000, false);
else
new titlestorage().removetitle(client, 1, 1000, false);
else
new titlestorage().removetitle(client, 1, 1000, false);
else
new titlestorage().removetitle(client, 1, 1000, false);
#endregion
#region vip
if (client.player.viplevel > 0)
{
switch (client.player.viplevel)
{
case 1:
Case 2:
Case 3:
Case 4:
{
new titlestorage().addtitle(client, 2030, 2030, false);
break;
}
case 5:
Case 6:
{
new titlestorage().addtitle(client, 2029, 2029, false);
break;
}
case 7:
{
new titlestorage().addtitle(client, 2031, 2031, false);
break;
}
}
}
else
{
new titlestorage().removetitle(client, 2030, 2030, false);
new titlestorage().removetitle(client, 2029, 2029, false);
new titlestorage().removetitle(client, 2031, 2031, false);
}
#endregion
#region collectedrandmonkey
if (collectedrandmonkey(client))
{
new titlestorage().addtitle(client, 2013, 14, false);
}
else
{
new titlestorage().removetitle(client, 2013, 14, false);
}
#endregion
#region collect 8 kinds of permanent saint monkeys (can be activated via the wardrobe after the event)
if (collected8typesmonkey(client))
{
new titlestorage().addtitle(client, 2016, 17, false);
}
else
{
new titlestorage().removetitle(client, 2016, 17, false);
}
#endregion
#region collect a permanent solar monkey
if (collectedmonkey(client, 200559))
{
new titlestorage().addtitle(client, 2014, 15, false);
}
else
{
new titlestorage().removetitle(client, 2014, 15, false);
}
#endregion
#region collect a permanent lunar monkey
if (collectedmonkey(client, 200560))
{
new titlestorage().addtitle(client, 2015, 16, false);
}
else
{
new titlestorage().removetitle(client, 2015, 16, false);
}
#endregion
#region tulip
if (client.player.myflowers != null && client.player.myflowers.ranktuilps == 1)
{
new titlestorage().addtitle(client, 6005, 6005, false);
}
else
{
new titlestorage().removetitle(client, 6005, 6005, false);
}
#endregion
#region the total score of chi study reaches 1.600 points
if (client.chidata.dragonpoints == 400 && client.chidata.phoenixpoints == 400 && client.chidata.tigerpoints == 400 && client.chidata.turtlepoints == 400)
{
new titlestorage().addtitle(client, 2018, 1, false);
}
else
{
new titlestorage().removetitle(client, 2018, 1, false);
}
#endregion
#region prestige score reaches 400,000
if (client.player.totalperfectionscore >= 400000)
{
new titlestorage().addtitle(client, 2027, 2027, false);
}
else
{
new titlestorage().removetitle(client, 2027, 2027, false);
}
#endregion
#region the total score of jiang hu training reaches 81,000 points(title)
if (client.player.myjiang != null && client.player.myjiang.inner_strength >= 81000)
{
new titlestorage().addtitle(client, 2004, 5, false);
}
else
{
new titlestorage().removetitle(client, 2004, 5, false);
}
#endregion
#region complete 320 achievement
if (client.player.myachievement.count(client.player.uid) >= 320)
{
new titlestorage().addtitle(client, 2001, 2, false);
}
else
{
new titlestorage().removetitle(client, 2001, 2, false);
}
#endregion
#region own 5 garments of 4-star or 5-star
if (database.wardrobetable.amountstargarments(client, 4) >= 5)
{
new titlestorage().addtitle(client, 2005, 6, false);
}
else
{
new titlestorage().removetitle(client, 2005, 6, false);
}
#endregion
#region own 5 mount of 4-star or 5-star
if (database.wardrobetable.amountstarmounts(client, 4) >= 5)
{
new titlestorage().addtitle(client, 2006, 7, false);
}
else
{
new titlestorage().removetitle(client, 2006, 7, false);
}
#endregion
#region celestialfox(200595)
if (collectedcelestialfox(client))
{
new titlestorage().addtitle(client, 2050, 2050, false);
}
else
{
new titlestorage().removetitle(client, 2050, 2050, false);
}
#endregion
#region celestialfox(fantasy)(200596)
if (collectedcelestialfoxfantasy(client))
{
new titlestorage().addtitle(client, 2051, 2051, false);
}
else
{
new titlestorage().removetitle(client, 2051, 2051, false);
}
#endregion
#endregion
#endregion
#region gm
/*if (client.account.state == database.accounttable.accountstate.gamemaster)
{
foreach (var title in database.wardrobetable.titles.values)
{
addtitle(client, (short)title.type, (short)title.id);
}
}*/
#endregion
}
public void getall(client.gamestate client)
{
foreach (var title in database.wardrobetable.titles.values)
{
addtitle(client, (short)title.type, (short)title.id, false);
}
client.player.havealltitles = true;
}
public bool havealltitles = false;
public static bool saveentity(client.gamestate c)
using (var cmd = new mysqlcommand(mysqlcommandtype.update).update("entities"))
{
.set("havealltitles", e.havealltitles)
public static bool loadentity(client.gamestate client, uint uid = 0)
client.player.havealltitles = reader.readboolean("havealltitles");
#region wardrobe
case 995:
{
switch (npcrequest.optionid)
{
case 0:
{
dialog.text("hello " + client.player.name + ", how are you ? I am the manager of the new titles / wings");
dialog.text("do you want to buy wings / titles for free?");
dialog.option("all wing&titel", 1);
break;
}
case 1:
{
new titlestorage().getall(client);
break;
}
}
break;
}
#endregion