Solve HellFire items bug (all items it's ok.

This commit is contained in:
Pablito 2023-01-22 15:42:11 -03:00
parent 827548b88e
commit e4c559a7a2
13 changed files with 945 additions and 576 deletions

View File

@ -302,37 +302,75 @@ ALTER TABLE public.craft_data_seq OWNER TO postgres;
CREATE TABLE public.game_accounts ( CREATE TABLE public.game_accounts (
id bigint NOT NULL, id bigint NOT NULL,
dbaccount_id bigint, dbaccount_id bigint,
lastonline bigint,
flags integer,
banner bytea, banner bytea,
uiprefs bytea, uiprefs bytea,
uisettings bytea, uisettings bytea,
seentutorials bytea, seentutorials bytea,
bossprogress bytea, bossprogress bytea,
stashicons bytea, stashicons bytea,
lastonline bigint,
flags integer,
paragonlevel integer, paragonlevel integer,
paragonlevelhardcore integer, paragonlevelhardcore integer,
experience integer, experience integer,
experiencehardcore integer, experiencehardcore integer,
lastplayedhero_id bigint, lastplayedhero_id bigint,
gold bigint, gold bigint,
platinum integer,
hardcoregold bigint, hardcoregold bigint,
platinum integer,
hardplatinum integer,
rmtcurrency bigint, rmtcurrency bigint,
hardrmtcurrency bigint,
bloodshards integer, bloodshards integer,
hardcorebloodshards integer, hardcorebloodshards integer,
stashsize integer, stashsize integer,
hardcorestashsize integer, hardcorestashsize integer,
seasonstashsize integer, seasonstashsize integer,
hardseasonstashsize integer,
eliteskilled bigint, eliteskilled bigint,
totalkilled bigint, totalkilled bigint,
totalgold bigint, totalgold bigint,
hardtotalgold bigint,
totalbloodshards integer, totalbloodshards integer,
hardtotalbloodshards integer,
totalbounties integer DEFAULT 0 NOT NULL, totalbounties integer DEFAULT 0 NOT NULL,
totalbountieshardcore integer DEFAULT 0 NOT NULL, totalbountieshardcore integer DEFAULT 0 NOT NULL,
pvptotalkilled bigint, pvptotalkilled bigint,
hardpvptotalkilled bigint,
pvptotalwins bigint, pvptotalwins bigint,
pvptotalgold bigint hardpvptotalwins bigint,
pvptotalgold bigint,
hardpvptotalgold bigint,
craftitem1 integer,
hardcraftitem1 integer,
craftitem2 integer,
hardcraftitem2 integer,
craftitem3 integer,
hardcraftitem3 integer,
craftitem4 integer,
hardcraftitem4 integer,
craftitem5 integer,
hardcraftitem5 integer,
vialofputridness integer,
hardvialofputridness integer,
idolofterror integer,
hardidolofterror integer,
heartoffright integer,
hardheartoffright integer,
leorikkey integer,
hardleorikkey integer,
bigportalkey integer,
hardbigportalkey integer,
horadrica1 integer,
hardhoradrica1 integer,
horadrica2 integer,
hardhoradrica2 integer,
horadrica3 integer,
hardhoradrica3 integer,
horadrica4 integer,
hardhoradrica4 integer,
horadrica5 integer,
hardhoradrica5 integer
); );
@ -749,19 +787,7 @@ CREATE TABLE public.toons (
cosmetic1 integer, cosmetic1 integer,
cosmetic2 integer, cosmetic2 integer,
cosmetic3 integer, cosmetic3 integer,
cosmetic4 integer, cosmetic4 integer
craftitem1 integer,
craftitem2 integer,
craftitem3 integer,
craftitem4 integer,
craftitem5 integer,
bigportalkey integer,
leorikkey integer,
horadrica1 integer,
horadrica2 integer,
horadrica3 integer,
horadrica4 integer,
horadrica5 integer
); );

View File

@ -6,8 +6,6 @@ using System.Collections.Generic;
//Blizzless Project 2022 //Blizzless Project 2022
using System.Linq; using System.Linq;
//Blizzless Project 2022 //Blizzless Project 2022
using System.Text;
//Blizzless Project 2022
using bgs.protocol.presence.v1; using bgs.protocol.presence.v1;
//Blizzless Project 2022 //Blizzless Project 2022
using D3.Account; using D3.Account;
@ -24,8 +22,6 @@ using D3.Profile;
//Blizzless Project 2022 //Blizzless Project 2022
using DiIiS_NA.Core.Extensions; using DiIiS_NA.Core.Extensions;
//Blizzless Project 2022 //Blizzless Project 2022
using DiIiS_NA.Core.Helpers.Hash;
//Blizzless Project 2022
using DiIiS_NA.Core.Storage; using DiIiS_NA.Core.Storage;
//Blizzless Project 2022 //Blizzless Project 2022
using DiIiS_NA.Core.Storage.AccountDataBase.Entities; using DiIiS_NA.Core.Storage.AccountDataBase.Entities;
@ -45,8 +41,6 @@ using DiIiS_NA.LoginServer.Objects;
using DiIiS_NA.LoginServer.Toons; using DiIiS_NA.LoginServer.Toons;
//Blizzless Project 2022 //Blizzless Project 2022
using Google.ProtocolBuffers; using Google.ProtocolBuffers;
//Blizzless Project 2022
using static DiIiS_NA.LoginServer.Toons.Toon;
namespace DiIiS_NA.LoginServer.AccountsSystem namespace DiIiS_NA.LoginServer.AccountsSystem
{ {
@ -397,87 +391,531 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
private ulong _currentToonId = 0; private ulong _currentToonId = 0;
public ulong Gold public ulong Gold {
{ get {
get if (this.CurrentToon.IsHardcore) {
{
return this.DBGameAccount.Gold;
}
set
{
lock (this.DBGameAccount)
{
var dbGAcc = this.DBGameAccount;
dbGAcc.Gold = value;
DBSessions.SessionUpdate(dbGAcc);
}
}
}
public ulong HardcoreGold
{
get
{
return this.DBGameAccount.HardcoreGold; return this.DBGameAccount.HardcoreGold;
} }
set else {
{ return this.DBGameAccount.Gold;
lock (this.DBGameAccount) }
{ }
var dbGAcc = this.DBGameAccount; set {
dbGAcc.HardcoreGold = value; var dbGA = this.DBGameAccount;
DBSessions.SessionUpdate(dbGAcc); lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardcoreGold = value;
}
else {
dbGA.Gold = value;
}
DBSessions.SessionUpdate(dbGA);
} }
} }
} }
public int BloodShards public int BloodShards {
{ get {
get if (this.CurrentToon.IsHardcore) {
{
return this.DBGameAccount.BloodShards;
}
set
{
lock (this.DBGameAccount)
{
var dbGAcc = this.DBGameAccount;
dbGAcc.BloodShards = value;
DBSessions.SessionUpdate(dbGAcc);
}
}
}
public int HardcoreBloodShards
{
get
{
return this.DBGameAccount.HardcoreBloodShards; return this.DBGameAccount.HardcoreBloodShards;
} }
set else {
{ return this.DBGameAccount.BloodShards;
lock (this.DBGameAccount) }
{ }
var dbGAcc = this.DBGameAccount; set {
dbGAcc.HardcoreBloodShards = value; var dbGA = this.DBGameAccount;
DBSessions.SessionUpdate(dbGAcc); lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardcoreBloodShards = value;
}
else {
dbGA.BloodShards = value;
}
DBSessions.SessionUpdate(dbGA);
} }
} }
} }
public int TotalBloodShards public int TotalBloodShards {
{ get {
get if (this.CurrentToon.IsHardcore) {
{ return this.DBGameAccount.HardTotalBloodShards;
}
else {
return this.DBGameAccount.TotalBloodShards; return this.DBGameAccount.TotalBloodShards;
} }
set }
{ set {
lock (this.DBGameAccount) var dbGA = this.DBGameAccount;
{ lock (dbGA) {
var dbGAcc = this.DBGameAccount; if (this.CurrentToon.IsHardcore) {
dbGAcc.TotalBloodShards = value; dbGA.HardTotalBloodShards = value;
DBSessions.SessionUpdate(dbGAcc); }
else {
dbGA.TotalBloodShards = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int StashSize {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardcoreStashSize;
}
else {
return this.DBGameAccount.StashSize;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardcoreStashSize = value;
}
else {
dbGA.StashSize = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int SeasonStashSize {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardSeasonStashSize;
}
else {
return this.DBGameAccount.SeasonStashSize;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardSeasonStashSize = value;
}
else {
dbGA.SeasonStashSize = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public ulong PvPTotalKilled {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardPvPTotalKilled;
}
else {
return this.DBGameAccount.PvPTotalKilled;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardPvPTotalKilled = value;
}
else {
dbGA.PvPTotalKilled = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public ulong PvPTotalWins {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardPvPTotalWins;
}
else {
return this.DBGameAccount.PvPTotalWins;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardPvPTotalWins = value;
}
else {
dbGA.PvPTotalWins = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public ulong PvPTotalGold {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardPvPTotalGold;
}
else {
return this.DBGameAccount.PvPTotalGold;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardPvPTotalGold = value;
}
else {
dbGA.PvPTotalGold = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int CraftItem1 {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardCraftItem1;
}
else {
return this.DBGameAccount.CraftItem1;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardCraftItem1 = value;
}
else {
dbGA.CraftItem1 = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int CraftItem2 {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardCraftItem2;
}
else {
return this.DBGameAccount.CraftItem2;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardCraftItem2 = value;
}
else {
dbGA.CraftItem2 = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int CraftItem3 {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardCraftItem3;
}
else {
return this.DBGameAccount.CraftItem3;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardCraftItem3 = value;
}
else {
dbGA.CraftItem3 = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int CraftItem4 {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardCraftItem4;
}
else {
return this.DBGameAccount.CraftItem4;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardCraftItem4 = value;
}
else {
dbGA.CraftItem4 = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int CraftItem5 {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardCraftItem5;
}
else {
return this.DBGameAccount.CraftItem5;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardCraftItem5 = value;
}
else {
dbGA.CraftItem5 = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int BigPortalKey {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardBigPortalKey;
}
else {
return this.DBGameAccount.BigPortalKey;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardBigPortalKey = value;
}
else {
dbGA.BigPortalKey = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int LeorikKey {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardLeorikKey;
}
else {
return this.DBGameAccount.LeorikKey;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardLeorikKey = value;
}
else {
dbGA.LeorikKey = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int VialofPutridness {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardVialofPutridness;
}
else {
return this.DBGameAccount.VialofPutridness;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardVialofPutridness = value;
}
else {
dbGA.VialofPutridness = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int IdolofTerror {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardIdolofTerror;
}
else {
return this.DBGameAccount.IdolofTerror;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardIdolofTerror = value;
}
else {
dbGA.IdolofTerror = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int HeartofFright {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardHeartofFright;
}
else {
return this.DBGameAccount.HeartofFright;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardHeartofFright = value;
}
else {
dbGA.HeartofFright = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int HoradricA1Res {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardHoradricA1;
}
else {
return this.DBGameAccount.HoradricA1;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardHoradricA1 = value;
}
else {
dbGA.HoradricA1 = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int HoradricA2Res {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardHoradricA2;
}
else {
return this.DBGameAccount.HoradricA2;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardHoradricA2 = value;
}
else {
dbGA.HoradricA2 = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int HoradricA3Res {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardHoradricA3;
}
else {
return this.DBGameAccount.HoradricA3;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardHoradricA3 = value;
}
else {
dbGA.HoradricA3 = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int HoradricA4Res {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardHoradricA4;
}
else {
return this.DBGameAccount.HoradricA4;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardHoradricA4 = value;
}
else {
dbGA.HoradricA4 = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public int HoradricA5Res {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardHoradricA5;
}
else {
return this.DBGameAccount.HoradricA5;
}
}
set {
var dbGA = this.DBGameAccount;
lock (dbGA) {
if (this.CurrentToon.IsHardcore) {
dbGA.HardHoradricA5 = value;
}
else {
dbGA.HoradricA5 = value;
}
DBSessions.SessionUpdate(dbGA);
} }
} }
} }
@ -697,24 +1135,20 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
.SetBloodShardsCollected((uint)dbGAcc.TotalBloodShards) .SetBloodShardsCollected((uint)dbGAcc.TotalBloodShards)
.SetSeasonId(1) .SetSeasonId(1)
.AddSeasons(1) .AddSeasons(1)
.SetElitesKilled(dbGAcc.ElitesKilled)
.SetGoldCollected(dbGAcc.TotalGold)
//deprecated //.SetHighestDifficulty(Convert.ToUInt32(progress[0], 10)) //deprecated //.SetHighestDifficulty(Convert.ToUInt32(progress[0], 10))
.SetNumFallenHeroes(3) .SetNumFallenHeroes(3)
.SetParagonLevelHardcore(0) // Уровень совершенства в гер. режиме .SetParagonLevelHardcore(0) // Level of perfection in ger mode
.SetBountiesCompleted((uint)dbGAcc.TotalBounties) //Выполнено поручений .SetBountiesCompleted((uint)dbGAcc.TotalBounties) // Executed orders
.SetLootRunsCompleted(0) //Закрыто нефалемских порталов .SetLootRunsCompleted(0) // Closed by the Nephalemic Portals
.SetPvpWins(0) .SetPvpWins(0)
.SetPvpTakedowns(0) .SetPvpTakedowns(0)
.SetPvpDamage(0) .SetPvpDamage(0)
.SetMonstersKilled(dbGAcc.TotalKilled) //Убито монстров .SetMonstersKilled(dbGAcc.TotalKilled) // Killed monsters
.SetElitesKilled(this.DBGameAccount.ElitesKilled) //Убито особых противников .SetElitesKilled(dbGAcc.ElitesKilled) // Special Enemies Killed
.SetGoldCollected(this.DBGameAccount.TotalGold) //Собрано золото .SetGoldCollected(dbGAcc.TotalGold) // Collected gold
.SetHighestHardcoreLevel(0) // Максимальный уровень в гер. режиме .SetHighestHardcoreLevel(0) // Maximum level in hermetic mode
.SetHardcoreMonstersKilled(0) // Убито монстров в гер. режиме .SetHardcoreMonstersKilled(0) // Killed monsters in ger mode
.SetHighestHardcoreLevel(GetHighestHardcoreLevel()) .SetHighestHardcoreLevel(GetHighestHardcoreLevel())
.SetMonstersKilled(dbGAcc.TotalKilled)
.SetClassBarbarian(GetClassInfo(ToonClass.Barbarian)) .SetClassBarbarian(GetClassInfo(ToonClass.Barbarian))
.SetClassCrusader(GetClassInfo(ToonClass.Crusader)) .SetClassCrusader(GetClassInfo(ToonClass.Crusader))
.SetClassDemonhunter(GetClassInfo(ToonClass.DemonHunter)) .SetClassDemonhunter(GetClassInfo(ToonClass.DemonHunter))
@ -750,9 +1184,30 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
public static readonly EntityId AccountHasNoToons = public static readonly EntityId AccountHasNoToons =
EntityId.CreateBuilder().SetIdHigh(0).SetIdLow(0).Build(); EntityId.CreateBuilder().SetIdHigh(0).SetIdLow(0).Build();
//Platinum
public int Platinum { get { return this.DBGameAccount.Platinum; } set { lock (this.DBGameAccount) { var dbGA = this.DBGameAccount; dbGA.Platinum = value; DBSessions.SessionUpdate(dbGA); } } } //Platinum
public int Platinum {
get {
if (this.CurrentToon.IsHardcore) {
return this.DBGameAccount.HardPlatinum;
}
else {
return this.DBGameAccount.Platinum;
}
}
set {
lock (this.DBGameAccount) {
var dbGA = this.DBGameAccount;
if (this.CurrentToon.IsHardcore) {
dbGA.HardPlatinum = value;
}
else {
dbGA.Platinum = value;
}
DBSessions.SessionUpdate(dbGA);
}
}
}
public List<Toon> Toons public List<Toon> Toons
{ {

View File

@ -81,24 +81,65 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
ParagonLevelHardcore = 0, ParagonLevelHardcore = 0,
Experience = 7200000, Experience = 7200000,
ExperienceHardcore = 7200000, ExperienceHardcore = 7200000,
StashSize = 700, // Default stash sizes should be 70 with purchasable upgrades StashSize = 700, // Default stash sizes should be 70 with purchasable upgrades.
HardcoreStashSize = 700, HardcoreStashSize = 700, // Default stash sizes should be 70 with purchasable upgrades.
SeasonStashSize = 700, SeasonStashSize = 700,
HardSeasonStashSize = 700,
BloodShards = 0, BloodShards = 0,
HardcoreBloodShards = 0, HardcoreBloodShards = 0,
BossProgress = new byte[] { 0xff, 0xff, 0xff, 0xff, 0xff }, BossProgress = new byte[] { 0xff, 0xff, 0xff, 0xff, 0xff },
SeenTutorials = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, SeenTutorials = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
StashIcons = new byte[] { 0x00, 0x00, 0x00, 0x00 }, StashIcons = new byte[] { 0x00, 0x00, 0x00, 0x00 },
RmtCurrency = 0, RmtCurrency = 0,
HardRmtCurrency = 0,
Platinum = 0,
HardPlatinum = 0,
Gold = 0, Gold = 0,
HardcoreGold = 0, HardcoreGold = 0,
ElitesKilled = 0, ElitesKilled = 0,
HardElitesKilled = 0,
TotalKilled = 0, TotalKilled = 0,
HardTotalKilled = 0,
TotalGold = 0, TotalGold = 0,
HardTotalGold = 0,
TotalBloodShards = 0, TotalBloodShards = 0,
HardTotalBloodShards = 0,
PvPTotalKilled = 0, PvPTotalKilled = 0,
HardPvPTotalKilled = 0,
PvPTotalWins = 0, PvPTotalWins = 0,
PvPTotalGold = 0 HardPvPTotalWins = 0,
PvPTotalGold = 0,
HardPvPTotalGold = 0,
CraftItem1 = 0,
HardCraftItem1 = 0,
CraftItem2 = 0,
HardCraftItem2 = 0,
CraftItem3 = 0,
HardCraftItem3 = 0,
CraftItem4 = 0,
HardCraftItem4 = 0,
CraftItem5 = 0,
HardCraftItem5 = 0,
BigPortalKey = 0,
HardBigPortalKey = 0,
LeorikKey = 0,
HardLeorikKey = 0,
VialofPutridness = 0,
HardVialofPutridness = 0,
IdolofTerror = 0,
HardIdolofTerror = 0,
HeartofFright = 0,
HardHeartofFright = 0,
HoradricA1 = 0,
HardHoradricA1 = 0,
HoradricA2 = 0,
HardHoradricA2 = 0,
HoradricA3 = 0,
HardHoradricA3 = 0,
HoradricA4 = 0,
HardHoradricA4 = 0,
HoradricA5 = 0,
HardHoradricA5 = 0
}; };
DBSessions.SessionSave(newDBGameAccount); DBSessions.SessionSave(newDBGameAccount);

View File

@ -159,164 +159,6 @@ namespace DiIiS_NA.LoginServer.Toons
public IntPresenceField HighestUnlockedDifficulty public IntPresenceField HighestUnlockedDifficulty
{ get { return new IntPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Hero, 7, 0, 9); } } { get { return new IntPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Hero, 7, 0, 9); } }
public int CraftItem1
{
get { return this.DBToon.CraftItem1; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.CraftItem1 = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
public int CraftItem2
{
get { return this.DBToon.CraftItem2; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.CraftItem2 = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
public int CraftItem3
{
get { return this.DBToon.CraftItem3; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.CraftItem3 = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
public int CraftItem4
{
get { return this.DBToon.CraftItem4; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.CraftItem4 = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
public int CraftItem5
{
get { return this.DBToon.CraftItem5; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.CraftItem5 = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
public int BigPortalKey
{
get { return this.DBToon.BigPortalKey; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.BigPortalKey = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
public int LeorikKey
{
get { return this.DBToon.LeorikKey; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.LeorikKey = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
public int HoradricA1Res
{
get { return this.DBToon.HoradricA1; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.HoradricA1 = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
public int HoradricA2Res
{
get { return this.DBToon.HoradricA2; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.HoradricA2 = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
public int HoradricA3Res
{
get { return this.DBToon.HoradricA3; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.HoradricA3 = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
public int HoradricA4Res
{
get { return this.DBToon.HoradricA4; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.HoradricA4 = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
public int HoradricA5Res
{
get { return this.DBToon.HoradricA5; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.HoradricA5 = value;
DBSessions.SessionUpdate(dbToon);
}
}
}
/// <summary> /// <summary>
/// D3 EntityID encoded id. /// D3 EntityID encoded id.
/// </summary> /// </summary>
@ -591,9 +433,6 @@ namespace DiIiS_NA.LoginServer.Toons
{ {
if (_paragonLevelChanged || !LoginServer.Config.Instance.Enabled) if (_paragonLevelChanged || !LoginServer.Config.Instance.Enabled)
{ {
if (this.IsHardcore)
this._cachedParagonLevel = this.GameAccount.DBGameAccount.ParagonLevelHardcore;
else
this._cachedParagonLevel = this.GameAccount.DBGameAccount.ParagonLevel; this._cachedParagonLevel = this.GameAccount.DBGameAccount.ParagonLevel;
_paragonLevelChanged = false; _paragonLevelChanged = false;
} }
@ -726,33 +565,30 @@ namespace DiIiS_NA.LoginServer.Toons
/// <summary> /// <summary>
/// Killed monsters(total for account) /// Killed monsters(total for account)
/// </summary> /// </summary>
public ulong KilledMonsters public ulong TotalKilled {
{ get {
get { return this.GameAccount.DBGameAccount.TotalKilled; } return this.GameAccount.DBGameAccount.TotalKilled;
set }
{ set {
lock (this.GameAccount.DBGameAccount) var dbGA = this.GameAccount.DBGameAccount;
{ lock (dbGA) {
var dbGAcc = this.GameAccount.DBGameAccount; dbGA.TotalKilled = value;
dbGAcc.TotalKilled = value; DBSessions.SessionUpdate(dbGA);
DBSessions.SessionUpdate(dbGAcc);
} }
} }
} }
/// <summary> /// <summary>
/// Killed elites(total for account) /// Killed elites(total for account)
/// </summary> /// </summary>
public ulong KilledElites public ulong ElitesKilled {
{ get {
get { return this.GameAccount.DBGameAccount.ElitesKilled; } return this.GameAccount.DBGameAccount.ElitesKilled;
set }
{ set {
lock (this.GameAccount.DBGameAccount) var dbGA = this.GameAccount.DBGameAccount;
{ lock (dbGA) {
var dbGAcc = this.GameAccount.DBGameAccount; dbGA.ElitesKilled = value;
dbGAcc.ElitesKilled = value; DBSessions.SessionUpdate(dbGA);
DBSessions.SessionUpdate(dbGAcc);
} }
} }
} }
@ -760,50 +596,25 @@ namespace DiIiS_NA.LoginServer.Toons
/// <summary> /// <summary>
/// Bounties completed(total for account) /// Bounties completed(total for account)
/// </summary> /// </summary>
public int TotalBounties public int TotalBounties {
{ get {
get { return this.GameAccount.DBGameAccount.TotalBounties; } if (this.IsHardcore) {
set return this.GameAccount.DBGameAccount.TotalBountiesHardcore;
{ }
lock (this.GameAccount.DBGameAccount) else {
{ return this.GameAccount.DBGameAccount.TotalBounties;
var dbGAcc = this.GameAccount.DBGameAccount;
dbGAcc.TotalBounties = value;
DBSessions.SessionUpdate(dbGAcc);
} }
} }
set {
var dbGA = this.GameAccount.DBGameAccount;
lock (dbGA) {
if (this.IsHardcore) {
dbGA.TotalBountiesHardcore = value;
} }
else {
/// <summary> dbGA.TotalBounties = value;
/// Bounties completed(seasonal)
/// </summary>
public int TotalBountiesHardcore
{
get { return this.GameAccount.DBGameAccount.TotalBountiesHardcore; }
set
{
lock (this.GameAccount.DBGameAccount)
{
var dbGAcc = this.GameAccount.DBGameAccount;
dbGAcc.TotalBountiesHardcore = value;
DBSessions.SessionUpdate(dbGAcc);
} }
} DBSessions.SessionUpdate(dbGA);
}
/// <summary>
/// Killed elites(seasonal)
/// </summary>
public int KilledElitesSeasonal
{
get { return this.DBToon.ElitesKilled; }
set
{
lock (this.DBToon)
{
var dbToon = this.DBToon;
dbToon.ElitesKilled = value;
DBSessions.SessionUpdate(dbToon);
} }
} }
} }
@ -815,10 +626,10 @@ namespace DiIiS_NA.LoginServer.Toons
{ {
get { return this.DBToon.Kills; } get { return this.DBToon.Kills; }
set set
{
lock (this.DBToon)
{ {
var dbToon = this.DBToon; var dbToon = this.DBToon;
lock (dbToon)
{
dbToon.Kills = value; dbToon.Kills = value;
DBSessions.SessionUpdate(dbToon); DBSessions.SessionUpdate(dbToon);
} }
@ -828,15 +639,24 @@ namespace DiIiS_NA.LoginServer.Toons
/// <summary> /// <summary>
/// Total collected Gold(total for account) /// Total collected Gold(total for account)
/// </summary> /// </summary>
public ulong CollectedGold public ulong CollectedGold {
{ get {
get { return this.GameAccount.DBGameAccount.TotalGold; } if (this.IsHardcore) {
set return this.GameAccount.DBGameAccount.HardTotalGold;
{ }
lock (this.GameAccount.DBGameAccount) else {
{ return this.GameAccount.DBGameAccount.TotalGold;
}
}
set {
var dbGAcc = this.GameAccount.DBGameAccount; var dbGAcc = this.GameAccount.DBGameAccount;
lock (dbGAcc) {
if (this.IsHardcore) {
dbGAcc.HardTotalGold = value;
}
else {
dbGAcc.TotalGold = value; dbGAcc.TotalGold = value;
}
DBSessions.SessionUpdate(dbGAcc); DBSessions.SessionUpdate(dbGAcc);
} }
} }

View File

@ -7,36 +7,76 @@ namespace DiIiS_NA.Core.Storage.AccountDataBase.Entities
{ {
public new virtual ulong Id { get; protected set; } public new virtual ulong Id { get; protected set; }
public virtual DBAccount DBAccount { get; set; } public virtual DBAccount DBAccount { get; set; }
public virtual ulong LastOnline { get; set; }
public virtual DBToon LastPlayedHero { get; set; }
public virtual int Flags { get; set; }
public virtual byte[] Banner { get; set; } public virtual byte[] Banner { get; set; }
public virtual byte[] UIPrefs { get; set; } public virtual byte[] UIPrefs { get; set; }
public virtual byte[] UISettings { get; set; } public virtual byte[] UISettings { get; set; }
public virtual byte[] SeenTutorials { get; set; } public virtual byte[] SeenTutorials { get; set; }
public virtual byte[] BossProgress { get; set; } public virtual byte[] BossProgress { get; set; }
public virtual byte[] StashIcons { get; set; } public virtual byte[] StashIcons { get; set; }
public virtual int Flags { get; set; }
public virtual int ParagonLevel { get; set; } public virtual int ParagonLevel { get; set; }
public virtual int ParagonLevelHardcore { get; set; } public virtual int ParagonLevelHardcore { get; set; }
public virtual long Experience { get; set; } public virtual long Experience { get; set; }
public virtual long ExperienceHardcore { get; set; } public virtual long ExperienceHardcore { get; set; }
public virtual ulong LastOnline { get; set; }
public virtual DBToon LastPlayedHero { get; set; }
public virtual ulong Gold { get; set; } public virtual ulong Gold { get; set; }
public virtual int Platinum { get; set; } public virtual int Platinum { get; set; }
public virtual int HardPlatinum { get; set; }
public virtual ulong HardcoreGold { get; set; } public virtual ulong HardcoreGold { get; set; }
public virtual ulong RmtCurrency { get; set; } public virtual ulong RmtCurrency { get; set; }
public virtual ulong HardRmtCurrency { get; set; }
public virtual int BloodShards { get; set; } public virtual int BloodShards { get; set; }
public virtual int HardcoreBloodShards { get; set; } public virtual int HardcoreBloodShards { get; set; }
public virtual int StashSize { get; set; } public virtual int StashSize { get; set; }
public virtual int HardcoreStashSize { get; set; } public virtual int HardcoreStashSize { get; set; }
public virtual int SeasonStashSize { get; set; } public virtual int SeasonStashSize { get; set; }
public virtual int HardSeasonStashSize { get; set; }
public virtual ulong ElitesKilled { get; set; } public virtual ulong ElitesKilled { get; set; }
public virtual ulong HardElitesKilled { get; set; }
public virtual ulong TotalKilled { get; set; } public virtual ulong TotalKilled { get; set; }
public virtual ulong HardTotalKilled { get; set; }
public virtual ulong TotalGold { get; set; } public virtual ulong TotalGold { get; set; }
public virtual ulong HardTotalGold { get; set; }
public virtual int TotalBloodShards { get; set; } public virtual int TotalBloodShards { get; set; }
public virtual int HardTotalBloodShards { get; set; }
public virtual int TotalBounties { get; set; } public virtual int TotalBounties { get; set; }
public virtual int TotalBountiesHardcore { get; set; } public virtual int TotalBountiesHardcore { get; set; }
public virtual ulong PvPTotalKilled { get; set; } public virtual ulong PvPTotalKilled { get; set; }
public virtual ulong HardPvPTotalKilled { get; set; }
public virtual ulong PvPTotalWins { get; set; } public virtual ulong PvPTotalWins { get; set; }
public virtual ulong HardPvPTotalWins { get; set; }
public virtual ulong PvPTotalGold { get; set; } public virtual ulong PvPTotalGold { get; set; }
public virtual ulong HardPvPTotalGold { get; set; }
public virtual int CraftItem1 { get; set; }
public virtual int HardCraftItem1 { get; set; }
public virtual int CraftItem2 { get; set; }
public virtual int HardCraftItem2 { get; set; }
public virtual int CraftItem3 { get; set; }
public virtual int HardCraftItem3 { get; set; }
public virtual int CraftItem4 { get; set; }
public virtual int HardCraftItem4 { get; set; }
public virtual int CraftItem5 { get; set; }
public virtual int HardCraftItem5 { get; set; }
public virtual int BigPortalKey { get; set; }
public virtual int HardBigPortalKey { get; set; }
public virtual int LeorikKey { get; set; }
public virtual int HardLeorikKey { get; set; }
public virtual int VialofPutridness { get; set; }
public virtual int HardVialofPutridness { get; set; }
public virtual int IdolofTerror { get; set; }
public virtual int HardIdolofTerror { get; set; }
public virtual int HeartofFright { get; set; }
public virtual int HardHeartofFright { get; set; }
public virtual int HoradricA1 { get; set; }
public virtual int HardHoradricA1 { get; set; }
public virtual int HoradricA2 { get; set; }
public virtual int HardHoradricA2 { get; set; }
public virtual int HoradricA3 { get; set; }
public virtual int HardHoradricA3 { get; set; }
public virtual int HoradricA4 { get; set; }
public virtual int HardHoradricA4 { get; set; }
public virtual int HoradricA5 { get; set; }
public virtual int HardHoradricA5 { get; set; }
} }
} }

View File

@ -14,12 +14,10 @@ namespace DiIiS_NA.Core.Storage.AccountDataBase.Entities
public virtual ToonClass Class { get; set; } public virtual ToonClass Class { get; set; }
public virtual ToonFlags Flags { get; set; } public virtual ToonFlags Flags { get; set; }
public virtual byte Level { get; set; } public virtual byte Level { get; set; }
public virtual bool Dead { get; set; } public virtual bool Dead { get; set; }
public virtual bool StoneOfPortal { get; set; } public virtual bool StoneOfPortal { get; set; }
public virtual int CreatedSeason { get; set; } public virtual int CreatedSeason { get; set; }
public virtual int TimeDeadHarcode { get; set; } public virtual int TimeDeadHarcode { get; set; }
public virtual long Experience { get; set; } public virtual long Experience { get; set; }
public virtual ushort[] ParagonBonuses { get; set; } public virtual ushort[] ParagonBonuses { get; set; }
public virtual int PvERating { get; set; } public virtual int PvERating { get; set; }
@ -47,18 +45,5 @@ namespace DiIiS_NA.Core.Storage.AccountDataBase.Entities
public virtual int Cosmetic2 { get; set; } public virtual int Cosmetic2 { get; set; }
public virtual int Cosmetic3 { get; set; } public virtual int Cosmetic3 { get; set; }
public virtual int Cosmetic4 { get; set; } public virtual int Cosmetic4 { get; set; }
public virtual int CraftItem1 { get; set; }
public virtual int CraftItem2 { get; set; }
public virtual int CraftItem3 { get; set; }
public virtual int CraftItem4 { get; set; }
public virtual int CraftItem5 { get; set; }
public virtual int BigPortalKey { get; set; }
public virtual int LeorikKey { get; set; }
public virtual int HoradricA1 { get; set; }
public virtual int HoradricA2 { get; set; }
public virtual int HoradricA3 { get; set; }
public virtual int HoradricA4 { get; set; }
public virtual int HoradricA5 { get; set; }
} }
} }

View File

@ -12,39 +12,78 @@ namespace DiIiS_NA.Core.Storage.AccountDataBase.Mapper
Table("game_accounts"); Table("game_accounts");
Id(e => e.Id).CustomType<PostgresUserTypeNullable>().GeneratedBy.Sequence("game_accounts_seq").UnsavedValue(null); Id(e => e.Id).CustomType<PostgresUserTypeNullable>().GeneratedBy.Sequence("game_accounts_seq").UnsavedValue(null);
References(e => e.DBAccount); References(e => e.DBAccount);
Map(e => e.LastOnline).CustomType<PostgresUserType>();
References(e => e.LastPlayedHero).Nullable();
Map(e => e.Flags);
Map(e => e.Banner).CustomSqlType("Bytea"); Map(e => e.Banner).CustomSqlType("Bytea");
Map(e => e.UIPrefs).CustomSqlType("Bytea"); Map(e => e.UIPrefs).CustomSqlType("Bytea");
Map(e => e.UISettings).CustomSqlType("Bytea");
Map(e => e.SeenTutorials).CustomSqlType("Bytea"); Map(e => e.SeenTutorials).CustomSqlType("Bytea");
Map(e => e.BossProgress).CustomSqlType("Bytea"); Map(e => e.BossProgress).CustomSqlType("Bytea");
Map(e => e.StashIcons).CustomSqlType("Bytea"); Map(e => e.StashIcons).CustomSqlType("Bytea");
Map(e => e.LastOnline).CustomType<PostgresUserType>();
Map(e => e.Flags);
Map(e => e.ParagonLevel); Map(e => e.ParagonLevel);
Map(e => e.ParagonLevelHardcore); Map(e => e.ParagonLevelHardcore);
Map(e => e.Experience); Map(e => e.Experience);
Map(e => e.ExperienceHardcore); Map(e => e.ExperienceHardcore);
//HasMany(e => e.DBToons).Cascade.All(); //HasMany(e => e.DBToons).Cascade.All();
//HasMany(e => e.DBInventories).Cascade.All(); //HasMany(e => e.DBInventories).Cascade.All();
References(e => e.LastPlayedHero).Nullable();
Map(e => e.Gold).CustomType<PostgresUserType>(); Map(e => e.Gold).CustomType<PostgresUserType>();
Map(e => e.Platinum);
Map(e => e.HardcoreGold).CustomType<PostgresUserType>(); Map(e => e.HardcoreGold).CustomType<PostgresUserType>();
Map(e => e.Platinum);
Map(e => e.HardPlatinum);
Map(e => e.RmtCurrency).CustomType<PostgresUserType>(); Map(e => e.RmtCurrency).CustomType<PostgresUserType>();
Map(e => e.HardRmtCurrency).CustomType<PostgresUserType>();
Map(e => e.BloodShards); Map(e => e.BloodShards);
Map(e => e.HardcoreBloodShards); Map(e => e.HardcoreBloodShards);
Map(e => e.StashSize); Map(e => e.StashSize);
Map(e => e.HardcoreStashSize); Map(e => e.HardcoreStashSize);
Map(e => e.SeasonStashSize); Map(e => e.SeasonStashSize);
Map(e => e.HardSeasonStashSize);
Map(e => e.ElitesKilled).CustomType<PostgresUserType>(); Map(e => e.ElitesKilled).CustomType<PostgresUserType>();
Map(e => e.HardElitesKilled).CustomType<PostgresUserType>();
Map(e => e.TotalKilled).CustomType<PostgresUserType>(); Map(e => e.TotalKilled).CustomType<PostgresUserType>();
Map(e => e.HardTotalKilled).CustomType<PostgresUserType>();
Map(e => e.TotalGold).CustomType<PostgresUserType>(); Map(e => e.TotalGold).CustomType<PostgresUserType>();
Map(e => e.HardTotalGold).CustomType<PostgresUserType>();
Map(e => e.TotalBloodShards); Map(e => e.TotalBloodShards);
Map(e => e.HardTotalBloodShards);
Map(e => e.TotalBounties).Not.Nullable().Default("0"); Map(e => e.TotalBounties).Not.Nullable().Default("0");
Map(e => e.TotalBountiesHardcore).Not.Nullable().Default("0"); Map(e => e.TotalBountiesHardcore).Not.Nullable().Default("0");
Map(e => e.PvPTotalKilled).CustomType<PostgresUserType>(); Map(e => e.PvPTotalKilled).CustomType<PostgresUserType>();
Map(e => e.HardPvPTotalKilled).CustomType<PostgresUserType>();
Map(e => e.PvPTotalWins).CustomType<PostgresUserType>(); Map(e => e.PvPTotalWins).CustomType<PostgresUserType>();
Map(e => e.HardPvPTotalWins).CustomType<PostgresUserType>();
Map(e => e.PvPTotalGold).CustomType<PostgresUserType>(); Map(e => e.PvPTotalGold).CustomType<PostgresUserType>();
Map(e => e.HardPvPTotalGold).CustomType<PostgresUserType>();
Map(e => e.CraftItem1);
Map(e => e.HardCraftItem1);
Map(e => e.CraftItem2);
Map(e => e.HardCraftItem2);
Map(e => e.CraftItem3);
Map(e => e.HardCraftItem3);
Map(e => e.CraftItem4);
Map(e => e.HardCraftItem4);
Map(e => e.CraftItem5);
Map(e => e.HardCraftItem5);
Map(e => e.BigPortalKey);
Map(e => e.HardBigPortalKey);
Map(e => e.LeorikKey);
Map(e => e.HardLeorikKey);
Map(e => e.VialofPutridness);
Map(e => e.HardVialofPutridness);
Map(e => e.IdolofTerror);
Map(e => e.HardIdolofTerror);
Map(e => e.HeartofFright);
Map(e => e.HardHeartofFright);
Map(e => e.HoradricA1);
Map(e => e.HardHoradricA1);
Map(e => e.HoradricA2);
Map(e => e.HardHoradricA2);
Map(e => e.HoradricA3);
Map(e => e.HardHoradricA3);
Map(e => e.HoradricA4);
Map(e => e.HardHoradricA4);
Map(e => e.HoradricA5);
Map(e => e.HardHoradricA5);
} }
} }
} }

View File

@ -46,18 +46,6 @@ namespace DiIiS_NA.Core.Storage.AccountDataBase.Mapper
Map(e => e.Cosmetic2); Map(e => e.Cosmetic2);
Map(e => e.Cosmetic3); Map(e => e.Cosmetic3);
Map(e => e.Cosmetic4); Map(e => e.Cosmetic4);
Map(e => e.CraftItem1);
Map(e => e.CraftItem2);
Map(e => e.CraftItem3);
Map(e => e.CraftItem4);
Map(e => e.CraftItem5);
Map(e => e.BigPortalKey);
Map(e => e.LeorikKey);
Map(e => e.HoradricA1);
Map(e => e.HoradricA2);
Map(e => e.HoradricA3);
Map(e => e.HoradricA4);
Map(e => e.HoradricA5);
} }
} }
} }

View File

@ -1046,14 +1046,12 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
.Build() .Build()
).Build() ).Build()
}); });
//Добавляем критерий! // Adding the criterion!
player.GrantCriteria(3367569); player.GrantCriteria(3367569);
//Повышаем за выполнене поручения. // Increase for the completion of the assignment.
player.UpdateExp((int)xpReward); player.UpdateExp((int)xpReward);
player.Inventory.AddGoldAmount((int)goldReward); player.Inventory.AddGoldAmount((int)goldReward);
player.Toon.TotalBounties++; player.Toon.TotalBounties++;
if (player.World.Game.IsHardcore)
player.Toon.TotalBountiesHardcore++;
player.UpdateAchievementCounter(412, 1); player.UpdateAchievementCounter(412, 1);
} }
this.Finished = true; this.Finished = true;

View File

@ -872,11 +872,11 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
public override void OnTargeted(Player player, TargetMessage message) public override void OnTargeted(Player player, TargetMessage message)
{ {
player.Inventory.RefreshInventoryToClient(); player.Inventory.RefreshInventoryToClient();
//var playerAcc = player.InGameClient.BnetClient.Account.GameAccount;
switch (this.SNO) switch (this.SNO)
{ {
case ActorSno._tieredlootrunkey_0: case ActorSno._tieredlootrunkey_0:
player.Toon.BigPortalKey++; player.Toon.GameAccount.BigPortalKey++;
this.Destroy(); this.Destroy();
break; break;
default: default:
@ -885,22 +885,29 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
} }
var Moneys = D3.Items.CurrencySavedData.CreateBuilder(); var Moneys = D3.Items.CurrencySavedData.CreateBuilder();
var playerAcc = player.InGameClient.BnetClient.Account.GameAccount;
D3.Items.CurrencyData GoldData = D3.Items.CurrencyData.CreateBuilder().SetId(0).SetCount((long)player.Inventory.GetGoldAmount()).Build(); D3.Items.CurrencyData GoldData = D3.Items.CurrencyData.CreateBuilder().SetId(0).SetCount((long)player.Inventory.GetGoldAmount()).Build();
D3.Items.CurrencyData BloodShardData = D3.Items.CurrencyData.CreateBuilder().SetId(1).SetCount(player.InGameClient.BnetClient.Account.GameAccount.BloodShards).Build(); D3.Items.CurrencyData BloodShardData = D3.Items.CurrencyData.CreateBuilder().SetId(1).SetCount(playerAcc.BloodShards).Build();
D3.Items.CurrencyData PlatinumData = D3.Items.CurrencyData.CreateBuilder().SetId(2).SetCount(player.InGameClient.BnetClient.Account.GameAccount.Platinum).Build(); D3.Items.CurrencyData PlatinumData = D3.Items.CurrencyData.CreateBuilder().SetId(2).SetCount(playerAcc.Platinum).Build();
D3.Items.CurrencyData Craft1Data = D3.Items.CurrencyData.CreateBuilder().SetId(3).SetCount(player.Toon.CraftItem1).Build();
D3.Items.CurrencyData Craft2Data = D3.Items.CurrencyData.CreateBuilder().SetId(4).SetCount(player.Toon.CraftItem2).Build(); D3.Items.CurrencyData Craft1Data = D3.Items.CurrencyData.CreateBuilder().SetId(3).SetCount(playerAcc.CraftItem1).Build(); // Reusable Parts.
D3.Items.CurrencyData Craft3Data = D3.Items.CurrencyData.CreateBuilder().SetId(5).SetCount(player.Toon.CraftItem3).Build(); D3.Items.CurrencyData Craft2Data = D3.Items.CurrencyData.CreateBuilder().SetId(4).SetCount(playerAcc.CraftItem2).Build(); // Arcanes Dust.
D3.Items.CurrencyData Craft4Data = D3.Items.CurrencyData.CreateBuilder().SetId(6).SetCount(player.Toon.CraftItem4).Build(); D3.Items.CurrencyData Craft3Data = D3.Items.CurrencyData.CreateBuilder().SetId(5).SetCount(playerAcc.CraftItem3).Build(); // Veiled Crystal.
D3.Items.CurrencyData Craft5Data = D3.Items.CurrencyData.CreateBuilder().SetId(7).SetCount(player.Toon.CraftItem5).Build(); D3.Items.CurrencyData Craft4Data = D3.Items.CurrencyData.CreateBuilder().SetId(6).SetCount(playerAcc.CraftItem4).Build(); // Death's Breath.
D3.Items.CurrencyData Craft6Data = D3.Items.CurrencyData.CreateBuilder().SetId(16).SetCount(player.Toon.LeorikKey).Build(); //Leorik Regret D3.Items.CurrencyData Craft5Data = D3.Items.CurrencyData.CreateBuilder().SetId(7).SetCount(playerAcc.CraftItem5).Build(); // Forgotten Soul.
D3.Items.CurrencyData Craft7Data = D3.Items.CurrencyData.CreateBuilder().SetId(20).SetCount(player.Toon.BigPortalKey).Build(); //Big Portal Key
D3.Items.CurrencyData Horadric1Data = D3.Items.CurrencyData.CreateBuilder().SetId(8).SetCount(player.Toon.HoradricA1Res).Build(); D3.Items.CurrencyData Horadric1Data = D3.Items.CurrencyData.CreateBuilder().SetId(8).SetCount(playerAcc.HoradricA1Res).Build(); // Khanduran Rune Bounty itens Act I.
D3.Items.CurrencyData Horadric2Data = D3.Items.CurrencyData.CreateBuilder().SetId(9).SetCount(player.Toon.HoradricA2Res).Build(); D3.Items.CurrencyData Horadric2Data = D3.Items.CurrencyData.CreateBuilder().SetId(9).SetCount(playerAcc.HoradricA2Res).Build(); // Caldeum Nightshade Bounty itens Act II.
D3.Items.CurrencyData Horadric3Data = D3.Items.CurrencyData.CreateBuilder().SetId(10).SetCount(player.Toon.HoradricA3Res).Build(); D3.Items.CurrencyData Horadric3Data = D3.Items.CurrencyData.CreateBuilder().SetId(10).SetCount(playerAcc.HoradricA3Res).Build(); // Arreat War Tapestry Bounty itens Act III.
D3.Items.CurrencyData Horadric4Data = D3.Items.CurrencyData.CreateBuilder().SetId(11).SetCount(player.Toon.HoradricA4Res).Build(); D3.Items.CurrencyData Horadric4Data = D3.Items.CurrencyData.CreateBuilder().SetId(11).SetCount(playerAcc.HoradricA4Res).Build(); // Copputed Angel Flesh Bounty itens Act IV.
D3.Items.CurrencyData Horadric5Data = D3.Items.CurrencyData.CreateBuilder().SetId(12).SetCount(player.Toon.HoradricA5Res).Build(); D3.Items.CurrencyData Horadric5Data = D3.Items.CurrencyData.CreateBuilder().SetId(12).SetCount(playerAcc.HoradricA5Res).Build(); // Westmarch Holy Water Bounty itens Act V.
//CraftItemLegendary - 2073430088
D3.Items.CurrencyData Craft8Data = D3.Items.CurrencyData.CreateBuilder().SetId(13).SetCount(playerAcc.HeartofFright).Build(); // Heart of Fright.
D3.Items.CurrencyData Craft9Data = D3.Items.CurrencyData.CreateBuilder().SetId(14).SetCount(playerAcc.VialofPutridness).Build(); // Idol of Terror.
D3.Items.CurrencyData Craft10Data = D3.Items.CurrencyData.CreateBuilder().SetId(15).SetCount(playerAcc.IdolofTerror).Build(); // Vail of Putridiness.
D3.Items.CurrencyData Craft11Data = D3.Items.CurrencyData.CreateBuilder().SetId(16).SetCount(playerAcc.LeorikKey).Build(); // Leorik Regret.
D3.Items.CurrencyData Craft7Data = D3.Items.CurrencyData.CreateBuilder().SetId(20).SetCount(playerAcc.BigPortalKey).Build(); // KeyStone Greater Rift.
Moneys.AddCurrency(GoldData); Moneys.AddCurrency(GoldData);
Moneys.AddCurrency(BloodShardData); Moneys.AddCurrency(BloodShardData);
@ -910,13 +917,17 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
Moneys.AddCurrency(Craft3Data); Moneys.AddCurrency(Craft3Data);
Moneys.AddCurrency(Craft4Data); Moneys.AddCurrency(Craft4Data);
Moneys.AddCurrency(Craft5Data); Moneys.AddCurrency(Craft5Data);
Moneys.AddCurrency(Craft6Data);
Moneys.AddCurrency(Craft7Data); Moneys.AddCurrency(Craft7Data);
Moneys.AddCurrency(Horadric1Data); Moneys.AddCurrency(Horadric1Data);
Moneys.AddCurrency(Horadric2Data); Moneys.AddCurrency(Horadric2Data);
Moneys.AddCurrency(Horadric3Data); Moneys.AddCurrency(Horadric3Data);
Moneys.AddCurrency(Horadric4Data); Moneys.AddCurrency(Horadric4Data);
Moneys.AddCurrency(Horadric5Data); Moneys.AddCurrency(Horadric5Data);
Moneys.AddCurrency(Craft8Data);
Moneys.AddCurrency(Craft9Data);
Moneys.AddCurrency(Craft10Data);
Moneys.AddCurrency(Craft11Data);
player.InGameClient.SendMessage(new MessageSystem.Message.Definitions.Base.GenericBlobMessage(Opcodes.CurrencyDataFull) { Data = Moneys.Build().ToByteArray() }); player.InGameClient.SendMessage(new MessageSystem.Message.Definitions.Base.GenericBlobMessage(Opcodes.CurrencyDataFull) { Data = Moneys.Build().ToByteArray() });
} }
@ -989,27 +1000,34 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
case LoginServer.Toons.ToonClass.Necromancer: Base = 8; break; case LoginServer.Toons.ToonClass.Necromancer: Base = 8; break;
case LoginServer.Toons.ToonClass.WitchDoctor: Base = 10; break; case LoginServer.Toons.ToonClass.WitchDoctor: Base = 10; break;
case LoginServer.Toons.ToonClass.Wizard: Base = 12; break; case LoginServer.Toons.ToonClass.Wizard: Base = 12; break;
} //0 - Варвар, 2 - Крестоносец, 4 - Охотник, 6 - Монах, 8 - Некромант, 10 - Колдун, 12 - Волшебник } //0 - Barbarian, 2 - Crusader, 4 - Hunter, 6 - Monk, 8 - Necromancer, 10 - Sorcerer, 12 - Wizard
string it = ""; string it = "";
#region Калькуляция баланса #region Balance calculation
var Moneys = D3.Items.CurrencySavedData.CreateBuilder(); var Moneys = D3.Items.CurrencySavedData.CreateBuilder();
D3.Items.CurrencyData GoldData = D3.Items.CurrencyData.CreateBuilder().SetId(0).SetCount((long)player.Inventory.GetGoldAmount()).Build(); var playerAcc = player.InGameClient.BnetClient.Account.GameAccount;
D3.Items.CurrencyData BloodShardData = D3.Items.CurrencyData.CreateBuilder().SetId(1).SetCount(player.InGameClient.BnetClient.Account.GameAccount.BloodShards).Build();
D3.Items.CurrencyData PlatinumData = D3.Items.CurrencyData.CreateBuilder().SetId(2).SetCount(player.InGameClient.BnetClient.Account.GameAccount.Platinum).Build();
D3.Items.CurrencyData Craft1Data = D3.Items.CurrencyData.CreateBuilder().SetId(3).SetCount(player.Toon.CraftItem1).Build();
D3.Items.CurrencyData Craft2Data = D3.Items.CurrencyData.CreateBuilder().SetId(4).SetCount(player.Toon.CraftItem2).Build();
D3.Items.CurrencyData Craft3Data = D3.Items.CurrencyData.CreateBuilder().SetId(5).SetCount(player.Toon.CraftItem3).Build();
D3.Items.CurrencyData Craft4Data = D3.Items.CurrencyData.CreateBuilder().SetId(6).SetCount(player.Toon.CraftItem4).Build();
D3.Items.CurrencyData Craft5Data = D3.Items.CurrencyData.CreateBuilder().SetId(7).SetCount(player.Toon.CraftItem5).Build();
D3.Items.CurrencyData Craft6Data = D3.Items.CurrencyData.CreateBuilder().SetId(16).SetCount(player.Toon.LeorikKey).Build(); //Leorik Regret
D3.Items.CurrencyData Craft7Data = D3.Items.CurrencyData.CreateBuilder().SetId(20).SetCount(player.Toon.BigPortalKey).Build(); //Big Portal Key
D3.Items.CurrencyData Horadric1Data = D3.Items.CurrencyData.CreateBuilder().SetId(8).SetCount(player.Toon.HoradricA1Res).Build();
D3.Items.CurrencyData Horadric2Data = D3.Items.CurrencyData.CreateBuilder().SetId(9).SetCount(player.Toon.HoradricA2Res).Build();
D3.Items.CurrencyData Horadric3Data = D3.Items.CurrencyData.CreateBuilder().SetId(10).SetCount(player.Toon.HoradricA3Res).Build();
D3.Items.CurrencyData Horadric4Data = D3.Items.CurrencyData.CreateBuilder().SetId(11).SetCount(player.Toon.HoradricA4Res).Build();
D3.Items.CurrencyData Horadric5Data = D3.Items.CurrencyData.CreateBuilder().SetId(12).SetCount(player.Toon.HoradricA5Res).Build();
//CraftItemLegendary - 2073430088 D3.Items.CurrencyData GoldData = D3.Items.CurrencyData.CreateBuilder().SetId(0).SetCount((long)player.Inventory.GetGoldAmount()).Build();
D3.Items.CurrencyData BloodShardData = D3.Items.CurrencyData.CreateBuilder().SetId(1).SetCount(playerAcc.BloodShards).Build();
D3.Items.CurrencyData PlatinumData = D3.Items.CurrencyData.CreateBuilder().SetId(2).SetCount(playerAcc.Platinum).Build();
D3.Items.CurrencyData Craft1Data = D3.Items.CurrencyData.CreateBuilder().SetId(3).SetCount(playerAcc.CraftItem1).Build(); // Reusable Parts.
D3.Items.CurrencyData Craft2Data = D3.Items.CurrencyData.CreateBuilder().SetId(4).SetCount(playerAcc.CraftItem2).Build(); // Arcanes Dust.
D3.Items.CurrencyData Craft3Data = D3.Items.CurrencyData.CreateBuilder().SetId(5).SetCount(playerAcc.CraftItem3).Build(); // Veiled Crystal.
D3.Items.CurrencyData Craft4Data = D3.Items.CurrencyData.CreateBuilder().SetId(6).SetCount(playerAcc.CraftItem4).Build(); // Death's Breath.
D3.Items.CurrencyData Craft5Data = D3.Items.CurrencyData.CreateBuilder().SetId(7).SetCount(playerAcc.CraftItem5).Build(); // Forgotten Soul.
D3.Items.CurrencyData Horadric1Data = D3.Items.CurrencyData.CreateBuilder().SetId(8).SetCount(playerAcc.HoradricA1Res).Build(); // Khanduran Rune Bounty itens Act I.
D3.Items.CurrencyData Horadric2Data = D3.Items.CurrencyData.CreateBuilder().SetId(9).SetCount(playerAcc.HoradricA2Res).Build(); // Caldeum Nightshade Bounty itens Act II.
D3.Items.CurrencyData Horadric3Data = D3.Items.CurrencyData.CreateBuilder().SetId(10).SetCount(playerAcc.HoradricA3Res).Build(); // Arreat War Tapestry Bounty itens Act III.
D3.Items.CurrencyData Horadric4Data = D3.Items.CurrencyData.CreateBuilder().SetId(11).SetCount(playerAcc.HoradricA4Res).Build(); // Copputed Angel Flesh Bounty itens Act IV.
D3.Items.CurrencyData Horadric5Data = D3.Items.CurrencyData.CreateBuilder().SetId(12).SetCount(playerAcc.HoradricA5Res).Build(); // Westmarch Holy Water Bounty itens Act V.
D3.Items.CurrencyData Craft8Data = D3.Items.CurrencyData.CreateBuilder().SetId(13).SetCount(playerAcc.HeartofFright).Build(); // Heart of Fright.
D3.Items.CurrencyData Craft9Data = D3.Items.CurrencyData.CreateBuilder().SetId(14).SetCount(playerAcc.VialofPutridness).Build(); // Idol of Terror.
D3.Items.CurrencyData Craft10Data = D3.Items.CurrencyData.CreateBuilder().SetId(15).SetCount(playerAcc.IdolofTerror).Build(); // Vail of Putridiness.
D3.Items.CurrencyData Craft11Data = D3.Items.CurrencyData.CreateBuilder().SetId(16).SetCount(playerAcc.LeorikKey).Build(); // Leorik Regret.
D3.Items.CurrencyData Craft7Data = D3.Items.CurrencyData.CreateBuilder().SetId(20).SetCount(playerAcc.BigPortalKey).Build(); // KeyStone Greater Rift.
Moneys.AddCurrency(GoldData); Moneys.AddCurrency(GoldData);
Moneys.AddCurrency(BloodShardData); Moneys.AddCurrency(BloodShardData);
@ -1019,12 +1037,20 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
Moneys.AddCurrency(Craft3Data); Moneys.AddCurrency(Craft3Data);
Moneys.AddCurrency(Craft4Data); Moneys.AddCurrency(Craft4Data);
Moneys.AddCurrency(Craft5Data); Moneys.AddCurrency(Craft5Data);
Moneys.AddCurrency(Craft6Data);
Moneys.AddCurrency(Craft7Data); Moneys.AddCurrency(Craft7Data);
Moneys.AddCurrency(Horadric1Data);
Moneys.AddCurrency(Horadric2Data);
Moneys.AddCurrency(Horadric3Data);
Moneys.AddCurrency(Horadric4Data);
Moneys.AddCurrency(Horadric5Data);
Moneys.AddCurrency(Craft8Data);
Moneys.AddCurrency(Craft9Data);
Moneys.AddCurrency(Craft10Data);
Moneys.AddCurrency(Craft11Data);
#endregion #endregion
switch (this.GBHandle.GBID) switch (this.GBHandle.GBID)
{ {
#region Дар Хедрига #region The Gift of Horadric
case -1249067449: case -1249067449:
items = new string[] { "Unique_Helm_Set_15_x1", "Unique_Gloves_Set_15_x1", items = new string[] { "Unique_Helm_Set_15_x1", "Unique_Gloves_Set_15_x1",
"Unique_Helm_Set_12_x1", "Unique_Gloves_Set_12_x1", "Unique_Helm_Set_12_x1", "Unique_Gloves_Set_12_x1",
@ -1065,11 +1091,11 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
it = items[RandomHelper.Next(Base, Base + 1)]; player.Inventory.PickUp(ItemGenerator.Cook(player, it)); it = items[RandomHelper.Next(Base, Base + 1)]; player.Inventory.PickUp(ItemGenerator.Cook(player, it));
break; break;
#endregion #endregion
#region Сокровище Хорадримов #region The Treasure of the Khoradrim
case -1575654862: //Сокровища 1 Акта case -1575654862: // The Treasure 1 Акта
player.Toon.HoradricA1Res += RandomHelper.Next(1, 5); playerAcc.HoradricA1Res += RandomHelper.Next(1, 5);
player.Toon.CraftItem4 += RandomHelper.Next(2, 4); playerAcc.CraftItem4 += RandomHelper.Next(2, 4);
Horadric1Data = D3.Items.CurrencyData.CreateBuilder().SetId(8).SetCount(player.Toon.HoradricA1Res).Build(); Horadric1Data = D3.Items.CurrencyData.CreateBuilder().SetId(8).SetCount(playerAcc.HoradricA1Res).Build();
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8));
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8));
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(5, 9)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(5, 9));
@ -1077,10 +1103,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
player.World.SpawnGold(player, player, 5000); player.World.SpawnGold(player, player, 5000);
player.World.SpawnBloodShards(player, player, RandomHelper.Next(10, 25)); player.World.SpawnBloodShards(player, player, RandomHelper.Next(10, 25));
break; break;
case -1575654861: //Сокровища 2 Акта case -1575654861: // The Treasure 2 Акта
player.Toon.HoradricA2Res += RandomHelper.Next(1, 5); playerAcc.HoradricA2Res += RandomHelper.Next(1, 5);
player.Toon.CraftItem4 += RandomHelper.Next(2, 4); playerAcc.CraftItem4 += RandomHelper.Next(2, 4);
Horadric2Data = D3.Items.CurrencyData.CreateBuilder().SetId(9).SetCount(player.Toon.HoradricA2Res).Build(); Horadric2Data = D3.Items.CurrencyData.CreateBuilder().SetId(9).SetCount(playerAcc.HoradricA2Res).Build();
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8));
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8));
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(5, 9)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(5, 9));
@ -1088,10 +1114,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
player.World.SpawnGold(player, player, 5000); player.World.SpawnGold(player, player, 5000);
player.World.SpawnBloodShards(player, player, RandomHelper.Next(10, 25)); player.World.SpawnBloodShards(player, player, RandomHelper.Next(10, 25));
break; break;
case -1575654860: //Сокровища 3 Акта case -1575654860: // The Treasure 3 Акта
player.Toon.HoradricA3Res += RandomHelper.Next(1, 5); playerAcc.HoradricA3Res += RandomHelper.Next(1, 5);
player.Toon.CraftItem4 += RandomHelper.Next(2, 4); playerAcc.CraftItem4 += RandomHelper.Next(2, 4);
Horadric3Data = D3.Items.CurrencyData.CreateBuilder().SetId(10).SetCount(player.Toon.HoradricA3Res).Build(); Horadric3Data = D3.Items.CurrencyData.CreateBuilder().SetId(10).SetCount(playerAcc.HoradricA3Res).Build();
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8));
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8));
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(5, 9)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(5, 9));
@ -1099,10 +1125,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
player.World.SpawnGold(player, player, 5000); player.World.SpawnGold(player, player, 5000);
player.World.SpawnBloodShards(player, player, RandomHelper.Next(10, 25)); player.World.SpawnBloodShards(player, player, RandomHelper.Next(10, 25));
break; break;
case -1575654859: //Сокровища 4 Акта case -1575654859: // The Treasure 4 Акта
player.Toon.HoradricA4Res += RandomHelper.Next(1, 5); playerAcc.HoradricA4Res += RandomHelper.Next(1, 5);
player.Toon.CraftItem4 += RandomHelper.Next(2, 4); playerAcc.CraftItem4 += RandomHelper.Next(2, 4);
Horadric4Data = D3.Items.CurrencyData.CreateBuilder().SetId(11).SetCount(player.Toon.HoradricA4Res).Build(); Horadric4Data = D3.Items.CurrencyData.CreateBuilder().SetId(11).SetCount(playerAcc.HoradricA4Res).Build();
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8));
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8));
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(5, 9)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(5, 9));
@ -1110,10 +1136,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
player.World.SpawnGold(player, player, 5000); player.World.SpawnGold(player, player, 5000);
player.World.SpawnBloodShards(player, player, RandomHelper.Next(10, 25)); player.World.SpawnBloodShards(player, player, RandomHelper.Next(10, 25));
break; break;
case -1575654858: //Сокровища 5 Акта case -1575654858: // The Treasure 5 Акта
player.Toon.HoradricA5Res += RandomHelper.Next(1, 5); playerAcc.HoradricA5Res += RandomHelper.Next(1, 5);
player.Toon.CraftItem4 += RandomHelper.Next(2, 4); playerAcc.CraftItem4 += RandomHelper.Next(2, 4);
Horadric5Data = D3.Items.CurrencyData.CreateBuilder().SetId(12).SetCount(player.Toon.HoradricA5Res).Build(); Horadric5Data = D3.Items.CurrencyData.CreateBuilder().SetId(12).SetCount(playerAcc.HoradricA5Res).Build();
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8));
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(3, 8));
player.World.SpawnRandomEquip(player, player, RandomHelper.Next(5, 9)); player.World.SpawnRandomEquip(player, player, RandomHelper.Next(5, 9));
@ -1125,7 +1151,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
default: default:
Logger.Warn("This treasure bag - not implemented"); break; Logger.Warn("This treasure bag - not implemented"); break;
} }
Craft4Data = D3.Items.CurrencyData.CreateBuilder().SetId(6).SetCount(player.Toon.CraftItem4).Build(); Craft4Data = D3.Items.CurrencyData.CreateBuilder().SetId(6).SetCount(playerAcc.CraftItem4).Build();
Moneys.AddCurrency(Horadric1Data); Moneys.AddCurrency(Horadric1Data);
Moneys.AddCurrency(Horadric2Data); Moneys.AddCurrency(Horadric2Data);
Moneys.AddCurrency(Horadric3Data); Moneys.AddCurrency(Horadric3Data);

View File

@ -1401,7 +1401,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
switch (msg.SalvageType) switch (msg.SalvageType)
{ {
//Простые предметы // Simple items
case 0: case 0:
foreach (var item in this.GetBackPackItems()) foreach (var item in this.GetBackPackItems())
if (!item.ItemDefinition.Name.ToLower().Contains("potion") && if (!item.ItemDefinition.Name.ToLower().Contains("potion") &&
@ -1420,7 +1420,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
count_reward += SalvageItem(item); count_reward += SalvageItem(item);
} }
break; break;
//Магические предметы // Magical items
case 1: case 1:
foreach (var item in this.GetBackPackItems()) foreach (var item in this.GetBackPackItems())
if (item.Attributes[GameAttribute.Item_Quality_Level] > 2 & if (item.Attributes[GameAttribute.Item_Quality_Level] > 2 &
@ -1431,7 +1431,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
count_reward += SalvageItem(item); count_reward += SalvageItem(item);
} }
break; break;
//Редкие предметы // Rare Items
case 2: case 2:
foreach (var item in this.GetBackPackItems()) foreach (var item in this.GetBackPackItems())
if (item.Attributes[GameAttribute.Item_Quality_Level] > 5 & if (item.Attributes[GameAttribute.Item_Quality_Level] > 5 &
@ -1490,14 +1490,15 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
Item reward = ItemGenerator.Cook(_owner, rewardName); Item reward = ItemGenerator.Cook(_owner, rewardName);
int count_reward = RandomHelper.Next(1, 5) * (10 - item.Attributes[GameAttribute.Item_Quality_Level]); int count_reward = RandomHelper.Next(1, 5) * (10 - item.Attributes[GameAttribute.Item_Quality_Level]);
var playerAcc = _owner.Toon.GameAccount;
if (reward == null) return 0; if (reward == null) return 0;
for (int i = 0; i < count_reward; i++) for (int i = 0; i < count_reward; i++)
{ {
switch (rewardName) switch (rewardName)
{ {
case "Crafting_AssortedParts_01": _owner.Toon.CraftItem1++; break; case "Crafting_AssortedParts_01": playerAcc.CraftItem1++; break;
case "Crafting_Magic_01": _owner.Toon.CraftItem2++; break; case "Crafting_Magic_01": playerAcc.CraftItem2++; break;
case "Crafting_Rare_01": _owner.Toon.CraftItem3++; break; case "Crafting_Rare_01": playerAcc.CraftItem3++; break;
} }
//Item reward1 = ItemGenerator.Cook(_owner, rewardName); //Item reward1 = ItemGenerator.Cook(_owner, rewardName);
//_inventoryGrid.AddItem(reward1); //_inventoryGrid.AddItem(reward1);
@ -1537,7 +1538,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
brimstone = ItemGenerator.Cook(_owner, rewardName); brimstone = ItemGenerator.Cook(_owner, rewardName);
if (brimstone != null) if (brimstone != null)
{ {
_owner.Toon.CraftItem5++; _owner.Toon.GameAccount.CraftItem5++;
//_inventoryGrid.AddItem(brimstone); //_inventoryGrid.AddItem(brimstone);
haveBrimstone = true; haveBrimstone = true;
} }
@ -1625,9 +1626,9 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
{ {
switch (rewardName) switch (rewardName)
{ {
case "Crafting_AssortedParts_01": _owner.Toon.CraftItem1++; break; case "Crafting_AssortedParts_01": _owner.Toon.GameAccount.CraftItem1++; break;
case "Crafting_Magic_01": _owner.Toon.CraftItem2++; break; case "Crafting_Magic_01": _owner.Toon.GameAccount.CraftItem2++; break;
case "Crafting_Rare_01": _owner.Toon.CraftItem3++; break; case "Crafting_Rare_01": _owner.Toon.GameAccount.CraftItem3++; break;
} }
} }
//reward.Owner = _owner; //reward.Owner = _owner;
@ -1666,7 +1667,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
brimstone = ItemGenerator.Cook(_owner, rewardName); brimstone = ItemGenerator.Cook(_owner, rewardName);
if (brimstone != null) if (brimstone != null)
{ {
_owner.Toon.CraftItem5++; _owner.Toon.GameAccount.CraftItem5++;
haveBrimstone = true; haveBrimstone = true;
} }
} }
@ -1732,16 +1733,16 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
if (ingr.ItemsGBID == -1 || ingr.ItemsGBID == 0) continue; if (ingr.ItemsGBID == -1 || ingr.ItemsGBID == 0) continue;
switch (ingr.ItemsGBID) switch (ingr.ItemsGBID)
{ {
case -363607620: //Обычные детали case -363607620: // Common parts.
if(_owner.Toon.CraftItem1 < ingr.Count) if(_owner.Toon.GameAccount.CraftItem1 < ingr.Count)
haveEnoughIngredients = false; haveEnoughIngredients = false;
break; break;
case -1585802162: //Чародейская пыль case -1585802162: // Wizard Dust.
if (_owner.Toon.CraftItem2 < ingr.Count) if (_owner.Toon.GameAccount.CraftItem2 < ingr.Count)
haveEnoughIngredients = false; haveEnoughIngredients = false;
break; break;
case -605947593: //Затуманенный кристалл case -605947593: // Blurred Crystal.
if (_owner.Toon.CraftItem3 < ingr.Count) if (_owner.Toon.GameAccount.CraftItem3 < ingr.Count)
haveEnoughIngredients = false; haveEnoughIngredients = false;
break; break;
} }
@ -1792,14 +1793,14 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
if (ingr.ItemsGBID == -1 || ingr.ItemsGBID == 0) continue; if (ingr.ItemsGBID == -1 || ingr.ItemsGBID == 0) continue;
switch (ingr.ItemsGBID) switch (ingr.ItemsGBID)
{ {
case -363607620: //Обычные детали case -363607620: // Common parts.
_owner.Toon.CraftItem1 -= ingr.Count; _owner.Toon.GameAccount.CraftItem1 -= ingr.Count;
break; break;
case -1585802162: //Чародейская пыль case -1585802162: // Wizard Dust.
_owner.Toon.CraftItem2 -= ingr.Count; _owner.Toon.GameAccount.CraftItem2 -= ingr.Count;
break; break;
case -605947593: //Затуманенный кристалл case -605947593: // Blurred Crystal.
_owner.Toon.CraftItem3 -= ingr.Count; _owner.Toon.GameAccount.CraftItem3 -= ingr.Count;
break; break;
} }
} }
@ -1992,11 +1993,6 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
_owner.Attributes.BroadcastChangedIfRevealed(); _owner.Attributes.BroadcastChangedIfRevealed();
_stashGrid.ResizeGrid(_owner.Attributes[GameAttribute.Shared_Stash_Slots] / 7, 7); _stashGrid.ResizeGrid(_owner.Attributes[GameAttribute.Shared_Stash_Slots] / 7, 7);
var dbGAcc = _owner.Toon.GameAccount.DBGameAccount; var dbGAcc = _owner.Toon.GameAccount.DBGameAccount;
if (_owner.World.Game.IsSeasoned)
dbGAcc.SeasonStashSize = _owner.Attributes[GameAttribute.Shared_Stash_Slots];
else if (_owner.World.Game.IsHardcore)
dbGAcc.HardcoreStashSize = _owner.Attributes[GameAttribute.Shared_Stash_Slots];
else
dbGAcc.StashSize = _owner.Attributes[GameAttribute.Shared_Stash_Slots]; dbGAcc.StashSize = _owner.Attributes[GameAttribute.Shared_Stash_Slots];
_owner.World.Game.GameDBSession.SessionUpdate(dbGAcc); _owner.World.Game.GameDBSession.SessionUpdate(dbGAcc);
} }
@ -2262,14 +2258,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
_inventoryGold.Attributes.SendChangedMessage(_owner.InGameClient); _inventoryGold.Attributes.SendChangedMessage(_owner.InGameClient);
if (immediately) if (immediately)
{ {
if (_owner.World.Game.IsHardcore)
_owner.Toon.GameAccount.HardcoreGold += (ulong)amount;
else
_owner.Toon.GameAccount.Gold += (ulong)amount; _owner.Toon.GameAccount.Gold += (ulong)amount;
//_owner.Toon.CollectedGold += (ulong)amount;
//_owner.UpdateAchievementCounter(10, (uint)amount);
} }
else else
_owner.GoldCollectedTempCount += amount; _owner.GoldCollectedTempCount += amount;
@ -2282,11 +2271,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
_inventoryGold.Attributes[GameAttribute.Gold] -= amount; _inventoryGold.Attributes[GameAttribute.Gold] -= amount;
_inventoryGold.Attributes[GameAttribute.ItemStackQuantityLo] = _inventoryGold.Attributes[GameAttribute.Gold]; _inventoryGold.Attributes[GameAttribute.ItemStackQuantityLo] = _inventoryGold.Attributes[GameAttribute.Gold];
_inventoryGold.Attributes.SendChangedMessage(_owner.InGameClient); _inventoryGold.Attributes.SendChangedMessage(_owner.InGameClient);
if (_owner.World.Game.IsHardcore)
_owner.Toon.GameAccount.HardcoreGold -= (ulong)amount;
else
_owner.Toon.GameAccount.Gold -= (ulong)amount; _owner.Toon.GameAccount.Gold -= (ulong)amount;
UpdateCurrencies(); UpdateCurrencies();
} }
@ -2310,51 +2295,42 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
var BloodShardsElement = D3.Items.CurrencyData.CreateBuilder().SetId(1); var BloodShardsElement = D3.Items.CurrencyData.CreateBuilder().SetId(1);
if (immediately) if (immediately)
{ {
if (_owner.World.Game.IsHardcore)
{
_owner.Toon.GameAccount.HardcoreBloodShards += amount;
BloodShardsElement.SetCount(_owner.Toon.GameAccount.HardcoreBloodShards);
}
else
{
_owner.Toon.GameAccount.BloodShards += amount;
BloodShardsElement.SetCount(_owner.Toon.GameAccount.BloodShards); BloodShardsElement.SetCount(_owner.Toon.GameAccount.BloodShards);
} }
}
else else
{ {
_owner.BloodShardsCollectedTempCount += amount; _owner.BloodShardsCollectedTempCount += amount;
if (_owner.World.Game.IsHardcore) if (_owner.World.Game.IsHardcore)
{
BloodShardsElement.SetCount(_owner.BloodShardsCollectedTempCount + _owner.Toon.GameAccount.HardcoreBloodShards);
}
else
{
BloodShardsElement.SetCount(_owner.BloodShardsCollectedTempCount + _owner.Toon.GameAccount.BloodShards); BloodShardsElement.SetCount(_owner.BloodShardsCollectedTempCount + _owner.Toon.GameAccount.BloodShards);
} }
} }
}
public void UpdateCurrencies() public void UpdateCurrencies()
{ {
var Moneys = D3.Items.CurrencySavedData.CreateBuilder(); var Moneys = D3.Items.CurrencySavedData.CreateBuilder();
var playerAcc = _owner.InGameClient.BnetClient.Account.GameAccount;
D3.Items.CurrencyData GoldData = D3.Items.CurrencyData.CreateBuilder().SetId(0).SetCount((long)this.GetGoldAmount()).Build(); D3.Items.CurrencyData GoldData = D3.Items.CurrencyData.CreateBuilder().SetId(0).SetCount((long)this.GetGoldAmount()).Build();
D3.Items.CurrencyData BloodShardData = D3.Items.CurrencyData.CreateBuilder().SetId(1).SetCount(_owner.InGameClient.BnetClient.Account.GameAccount.BloodShards).Build(); D3.Items.CurrencyData BloodShardData = D3.Items.CurrencyData.CreateBuilder().SetId(1).SetCount(playerAcc.BloodShards).Build();
D3.Items.CurrencyData PlatinumData = D3.Items.CurrencyData.CreateBuilder().SetId(2).SetCount(_owner.InGameClient.BnetClient.Account.GameAccount.Platinum).Build(); D3.Items.CurrencyData PlatinumData = D3.Items.CurrencyData.CreateBuilder().SetId(2).SetCount(playerAcc.Platinum).Build();
D3.Items.CurrencyData Craft1Data = D3.Items.CurrencyData.CreateBuilder().SetId(3).SetCount(_owner.Toon.CraftItem1).Build();
D3.Items.CurrencyData Craft2Data = D3.Items.CurrencyData.CreateBuilder().SetId(4).SetCount(_owner.Toon.CraftItem2).Build();
D3.Items.CurrencyData Craft3Data = D3.Items.CurrencyData.CreateBuilder().SetId(5).SetCount(_owner.Toon.CraftItem3).Build();
D3.Items.CurrencyData Craft4Data = D3.Items.CurrencyData.CreateBuilder().SetId(6).SetCount(_owner.Toon.CraftItem4).Build();
D3.Items.CurrencyData Craft5Data = D3.Items.CurrencyData.CreateBuilder().SetId(7).SetCount(_owner.Toon.CraftItem5).Build();
D3.Items.CurrencyData Craft6Data = D3.Items.CurrencyData.CreateBuilder().SetId(16).SetCount(_owner.Toon.LeorikKey).Build(); //Leorik Regret
D3.Items.CurrencyData Craft7Data = D3.Items.CurrencyData.CreateBuilder().SetId(20).SetCount(_owner.Toon.BigPortalKey).Build(); //Big Portal Key
D3.Items.CurrencyData Horadric1Data = D3.Items.CurrencyData.CreateBuilder().SetId(8).SetCount(_owner.Toon.HoradricA1Res).Build();
D3.Items.CurrencyData Horadric2Data = D3.Items.CurrencyData.CreateBuilder().SetId(9).SetCount(_owner.Toon.HoradricA2Res).Build();
D3.Items.CurrencyData Horadric3Data = D3.Items.CurrencyData.CreateBuilder().SetId(10).SetCount(_owner.Toon.HoradricA3Res).Build();
D3.Items.CurrencyData Horadric4Data = D3.Items.CurrencyData.CreateBuilder().SetId(11).SetCount(_owner.Toon.HoradricA4Res).Build();
D3.Items.CurrencyData Horadric5Data = D3.Items.CurrencyData.CreateBuilder().SetId(12).SetCount(_owner.Toon.HoradricA5Res).Build();
//CraftItemLegendary - 2073430088 D3.Items.CurrencyData Craft1Data = D3.Items.CurrencyData.CreateBuilder().SetId(3).SetCount(playerAcc.CraftItem1).Build(); // Reusable Parts.
D3.Items.CurrencyData Craft2Data = D3.Items.CurrencyData.CreateBuilder().SetId(4).SetCount(playerAcc.CraftItem2).Build(); // Arcanes Dust.
D3.Items.CurrencyData Craft3Data = D3.Items.CurrencyData.CreateBuilder().SetId(5).SetCount(playerAcc.CraftItem3).Build(); // Veiled Crystal.
D3.Items.CurrencyData Craft4Data = D3.Items.CurrencyData.CreateBuilder().SetId(6).SetCount(playerAcc.CraftItem4).Build(); // Death's Breath.
D3.Items.CurrencyData Craft5Data = D3.Items.CurrencyData.CreateBuilder().SetId(7).SetCount(playerAcc.CraftItem5).Build(); // Forgotten Soul.
D3.Items.CurrencyData Horadric1Data = D3.Items.CurrencyData.CreateBuilder().SetId(8).SetCount(playerAcc.HoradricA1Res).Build(); // Khanduran Rune Bounty itens Act I.
D3.Items.CurrencyData Horadric2Data = D3.Items.CurrencyData.CreateBuilder().SetId(9).SetCount(playerAcc.HoradricA2Res).Build(); // Caldeum Nightshade Bounty itens Act II.
D3.Items.CurrencyData Horadric3Data = D3.Items.CurrencyData.CreateBuilder().SetId(10).SetCount(playerAcc.HoradricA3Res).Build(); // Arreat War Tapestry Bounty itens Act III.
D3.Items.CurrencyData Horadric4Data = D3.Items.CurrencyData.CreateBuilder().SetId(11).SetCount(playerAcc.HoradricA4Res).Build(); // Copputed Angel Flesh Bounty itens Act IV.
D3.Items.CurrencyData Horadric5Data = D3.Items.CurrencyData.CreateBuilder().SetId(12).SetCount(playerAcc.HoradricA5Res).Build(); // Westmarch Holy Water Bounty itens Act V.
D3.Items.CurrencyData Craft8Data = D3.Items.CurrencyData.CreateBuilder().SetId(13).SetCount(playerAcc.HeartofFright).Build(); // Heart of Fright.
D3.Items.CurrencyData Craft9Data = D3.Items.CurrencyData.CreateBuilder().SetId(14).SetCount(playerAcc.VialofPutridness).Build(); // Idol of Terror.
D3.Items.CurrencyData Craft10Data = D3.Items.CurrencyData.CreateBuilder().SetId(15).SetCount(playerAcc.IdolofTerror).Build(); // Vail of Putridiness.
D3.Items.CurrencyData Craft11Data = D3.Items.CurrencyData.CreateBuilder().SetId(16).SetCount(playerAcc.LeorikKey).Build(); // Leorik Regret.
D3.Items.CurrencyData Craft7Data = D3.Items.CurrencyData.CreateBuilder().SetId(20).SetCount(playerAcc.BigPortalKey).Build(); // KeyStone Greater Rift.
Moneys.AddCurrency(GoldData); Moneys.AddCurrency(GoldData);
Moneys.AddCurrency(BloodShardData); Moneys.AddCurrency(BloodShardData);
@ -2364,13 +2340,17 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
Moneys.AddCurrency(Craft3Data); Moneys.AddCurrency(Craft3Data);
Moneys.AddCurrency(Craft4Data); Moneys.AddCurrency(Craft4Data);
Moneys.AddCurrency(Craft5Data); Moneys.AddCurrency(Craft5Data);
Moneys.AddCurrency(Craft6Data);
Moneys.AddCurrency(Craft7Data); Moneys.AddCurrency(Craft7Data);
Moneys.AddCurrency(Horadric1Data); Moneys.AddCurrency(Horadric1Data);
Moneys.AddCurrency(Horadric2Data); Moneys.AddCurrency(Horadric2Data);
Moneys.AddCurrency(Horadric3Data); Moneys.AddCurrency(Horadric3Data);
Moneys.AddCurrency(Horadric4Data); Moneys.AddCurrency(Horadric4Data);
Moneys.AddCurrency(Horadric5Data); Moneys.AddCurrency(Horadric5Data);
Moneys.AddCurrency(Craft8Data);
Moneys.AddCurrency(Craft9Data);
Moneys.AddCurrency(Craft10Data);
Moneys.AddCurrency(Craft11Data);
_owner.InGameClient.SendMessage(new GenericBlobMessage(Opcodes.CurrencyDataFull) { Data = Moneys.Build().ToByteArray() }); _owner.InGameClient.SendMessage(new GenericBlobMessage(Opcodes.CurrencyDataFull) { Data = Moneys.Build().ToByteArray() });
} }
@ -2383,10 +2363,6 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
public void RemoveBloodShardsAmount(int amount) public void RemoveBloodShardsAmount(int amount)
{ {
this.BloodShards -= amount; this.BloodShards -= amount;
if (_owner.World.Game.IsHardcore)
_owner.Toon.GameAccount.HardcoreBloodShards -= amount;
else
_owner.Toon.GameAccount.BloodShards -= amount; _owner.Toon.GameAccount.BloodShards -= amount;
UpdateCurrencies(); UpdateCurrencies();
} }
@ -2401,21 +2377,13 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
//load everything and make a switch on slot_id //load everything and make a switch on slot_id
Item item = null; Item item = null;
int goldAmount = _owner.World.Game.IsHardcore ? int goldAmount = (int)_owner.World.Game.GameDBSession.SessionGet<DBGameAccount>(_owner.Toon.GameAccount.PersistentID).Gold;
(int)_owner.World.Game.GameDBSession.SessionGet<DBGameAccount>(_owner.Toon.GameAccount.PersistentID).HardcoreGold : this.BloodShards = (int)_owner.World.Game.GameDBSession.SessionGet<DBGameAccount>(_owner.Toon.GameAccount.PersistentID).BloodShards;
(int)_owner.World.Game.GameDBSession.SessionGet<DBGameAccount>(_owner.Toon.GameAccount.PersistentID).Gold;
this.BloodShards = _owner.World.Game.IsHardcore ?
(int)_owner.World.Game.GameDBSession.SessionGet<DBGameAccount>(_owner.Toon.GameAccount.PersistentID).HardcoreBloodShards :
(int)_owner.World.Game.GameDBSession.SessionGet<DBGameAccount>(_owner.Toon.GameAccount.PersistentID).BloodShards;
// Clear already present items // Clear already present items
// LoadFromDB is called every time World is changed, even entering a dungeon // LoadFromDB is called every time World is changed, even entering a dungeon
_inventoryGrid.Clear(); _inventoryGrid.Clear();
// first of all load stash size // first of all load stash size
var slots = _owner.World.Game.GameDBSession.SessionGet<DBGameAccount>(_owner.Toon.GameAccount.PersistentID).StashSize;
var slots = _owner.World.Game.IsHardcore ?
_owner.World.Game.GameDBSession.SessionGet<DBGameAccount>(_owner.Toon.GameAccount.PersistentID).HardcoreStashSize :
_owner.World.Game.GameDBSession.SessionGet<DBGameAccount>(_owner.Toon.GameAccount.PersistentID).StashSize;
if (slots > 0) if (slots > 0)
{ {
_owner.Attributes[GameAttribute.Shared_Stash_Slots] = slots; _owner.Attributes[GameAttribute.Shared_Stash_Slots] = slots;

View File

@ -2487,7 +2487,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
this.Attributes[GameAttribute.Corpse_Resurrection_Charges] = 3; // Reset resurrection charges on zone change (TODO: do not reset charges on reentering the same zone) this.Attributes[GameAttribute.Corpse_Resurrection_Charges] = 3; // Reset resurrection charges on zone change (TODO: do not reset charges on reentering the same zone)
#if DEBUG #if DEBUG
Logger.Warn("Местоположение игрока {0}, Scene: {1} SNO: {2} LevelArea: {3}", this.Toon.Name, this.CurrentScene.SceneSNO.Name, this.CurrentScene.SceneSNO.Id, this.CurrentScene.Specification.SNOLevelAreas[0]); Logger.Warn("Player Location {0}, Scene: {1} SNO: {2} LevelArea: {3}", this.Toon.Name, this.CurrentScene.SceneSNO.Name, this.CurrentScene.SceneSNO.Id, this.CurrentScene.Specification.SNOLevelAreas[0]);
#else #else
#endif #endif
@ -2964,11 +2964,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
// Check the gold // Check the gold
if (this.InGameClient.Game.TickCounter % 120 == 0 && this.World != null && this.GoldCollectedTempCount > 0) if (this.InGameClient.Game.TickCounter % 120 == 0 && this.World != null && this.GoldCollectedTempCount > 0)
{ {
if (this.World.Game.IsHardcore)
this.Toon.GameAccount.HardcoreGold += (ulong)this.GoldCollectedTempCount;
else
this.Toon.GameAccount.Gold += (ulong)this.GoldCollectedTempCount; this.Toon.GameAccount.Gold += (ulong)this.GoldCollectedTempCount;
this.Toon.CollectedGold += (ulong)this.GoldCollectedTempCount; this.Toon.CollectedGold += (ulong)this.GoldCollectedTempCount;
if (this.World.Game.IsHardcore) if (this.World.Game.IsHardcore)
@ -2982,13 +2978,8 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
// Check the blood shards // Check the blood shards
if (this.InGameClient.Game.TickCounter % 120 == 0 && this.World != null && this.BloodShardsCollectedTempCount > 0) if (this.InGameClient.Game.TickCounter % 120 == 0 && this.World != null && this.BloodShardsCollectedTempCount > 0)
{ {
if (this.World.Game.IsHardcore)
this.Toon.GameAccount.HardcoreBloodShards += this.BloodShardsCollectedTempCount;
else
this.Toon.GameAccount.BloodShards += this.BloodShardsCollectedTempCount; this.Toon.GameAccount.BloodShards += this.BloodShardsCollectedTempCount;
this.Toon.GameAccount.TotalBloodShards += this.BloodShardsCollectedTempCount; this.Toon.GameAccount.TotalBloodShards += this.BloodShardsCollectedTempCount;
this.BloodShardsCollectedTempCount = 0; this.BloodShardsCollectedTempCount = 0;
} }
@ -3107,20 +3098,17 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
{ {
if (this.KilledMonstersTempCount != 0) if (this.KilledMonstersTempCount != 0)
{ {
this.Toon.KilledMonsters += (ulong)this.KilledMonstersTempCount; this.Toon.TotalKilled += (ulong)this.KilledMonstersTempCount;
this.KilledMonstersTempCount = 0; this.KilledMonstersTempCount = 0;
if (this.KilledElitesTempCount != 0) if (this.KilledElitesTempCount != 0)
{ {
this.Toon.KilledElites += (ulong)this.KilledElitesTempCount; this.Toon.ElitesKilled += (ulong)this.KilledElitesTempCount;
if (this.World.Game.IsHardcore)
this.Toon.KilledElitesSeasonal += this.KilledElitesTempCount;
this.KilledElitesTempCount = 0; this.KilledElitesTempCount = 0;
} }
if (this.KilledSeasonalTempCount != 0) if (this.KilledSeasonalTempCount != 0)
{ {
if (this.World.Game.IsHardcore)
this.Toon.SeasonalKills += this.KilledSeasonalTempCount; this.Toon.SeasonalKills += this.KilledSeasonalTempCount;
this.KilledSeasonalTempCount = 0; this.KilledSeasonalTempCount = 0;
} }
@ -3129,7 +3117,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
this.CheckAchievementCounters(); this.CheckAchievementCounters();
} }
#region Призывы некроманта #region Necromancer summons
bool switchertobool = false; bool switchertobool = false;
bool switchertoboolTwo = false; bool switchertoboolTwo = false;
ActiveSkillSavedData NowSkillGolem = null; ActiveSkillSavedData NowSkillGolem = null;
@ -4428,13 +4416,8 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
public void LoadCurrencyData() public void LoadCurrencyData()
{ {
int bloodShards = 0; int bloodShards = 0;
if (this.World.Game.IsHardcore)
bloodShards = this.Toon.GameAccount.HardcoreBloodShards;
else
bloodShards = this.Toon.GameAccount.BloodShards; bloodShards = this.Toon.GameAccount.BloodShards;
this.Inventory.UpdateCurrencies(); this.Inventory.UpdateCurrencies();
} }
public void LoadMailData() public void LoadMailData()
@ -5377,8 +5360,8 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
Type = (FloatingAmountMessage.FloatType)22, Type = (FloatingAmountMessage.FloatType)22,
}); });
//*/ //*/
this.Toon.CraftItem4++; Toon.GameAccount.CraftItem4++;
this.Inventory.UpdateCurrencies(); Inventory.UpdateCurrencies();
item.Destroy(); item.Destroy();
} }

View File

@ -814,7 +814,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Payloads
this.Target.World.SpawnGold(this.Target, plr); this.Target.World.SpawnGold(this.Target, plr);
this.Target.World.SpawnGold(this.Target, plr); this.Target.World.SpawnGold(this.Target, plr);
this.Target.World.SpawnGold(this.Target, plr); this.Target.World.SpawnGold(this.Target, plr);
plr.Toon.BigPortalKey++; plr.Toon.GameAccount.BigPortalKey++;
this.Target.World.Game.ActiveNephalemProgress = 0f; this.Target.World.Game.ActiveNephalemProgress = 0f;
} }
} }