[Release/OpenNos] Prestige System

02/06/2019 02:18 InnoTx#61
ou yeah i know what u mean now but idk how to add it on Database.
02/06/2019 02:41 AnayC#62
Quote:
Originally Posted by InnoTx View Post
Session.Character.Save();

Does that awnser ur Question?
Quote:
Originally Posted by InnoTx View Post
ou yeah i know what u mean now but idk how to add it on Database.
Would you know how to do that to add it to the database?
02/06/2019 02:43 InnoTx#63
Quote:
Originally Posted by AnayC View Post
Would you know how to do that to add it to the database?
Sorry how that works idk ...
02/06/2019 04:05 Blowa#64
Quote:
Originally Posted by AnayC View Post
Would you know how to do that to add it to the database?
OpenNos.DAL.EF, go in Entities, edit the Character class, add the things you need to save that are not already in the class, , generate a migration, ensure the mapping from Entity to DTO is done rightly (same naming or custom property value mapping), enjoy.
02/06/2019 04:09 AnayC#65
Quote:
Originally Posted by val77 View Post
OpenNos.DAL.EF, go in Entities, edit the Character class, add the things you need to save that are not already in the class, , generate a migration, ensure the mapping from Entity to DTO is done rightly (same naming or custom property value mapping), enjoy.
Ty +1
:manos abajo:
02/07/2019 16:31 AnayC#66
Someone could help me with saving the +1 in the prestige system, since the PrestigeLevel field is in the Character table, it is imported with migration but the status is not updated to +1 so if someone could give me a query to be able to make the PrestigeLevel field of the table below a picture of the code



code that I use




[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]
02/08/2019 00:55 redbull2905#67
Code:
       public void PrestigeFunction(ItemInstance inv)
        {
            if (Session.Character.MapInstance != null)
            {
                if (Session.Character.Inventory.Any(s => s.Type == InventoryType.Wear))
                {
                    Session.SendPacket(UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("EQ_NOT_EMPTY"), 0));
                    return;
                }

                if (Session.Character.Level == 250 && Session.Character.HeroLevel == 100 && Session.Character.Prestige < 10)
                {
                    Session.Character.Prestige++;
                    ServerManager.Shout(Name + " est passé prestige " + Prestige);
                    Session.SendPacket(Session.Character.GenerateLev());
                    Session.SendPacket(Session.Character.GenerateIn());
                    Session.SendPacket(Session.Character.GenerateCInfo());
                    Session.SendPacket(Session.Character.GenerateStat());
                    Session.Character.Save();
                    Session.Character.Inventory.RemoveItemFromInventory(inv.Id);
                    ServerManager.Instance.ChangeMapInstance(Session.Character.CharacterId,
                    Session.Character.MapInstanceId, Session.Character.PositionX, Session.Character.PositionY,
                    true);

                }
                else
                {
                    Session.SendPacket("msg 4 Tu n'as pas le niveau requis !");
                }
            }
        }
02/08/2019 17:44 AnayC#68
Quote:
Originally Posted by redbull2905 View Post
Code:
       public void PrestigeFunction(ItemInstance inv)
        {
            if (Session.Character.MapInstance != null)
            {
                if (Session.Character.Inventory.Any(s => s.Type == InventoryType.Wear))
                {
                    Session.SendPacket(UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("EQ_NOT_EMPTY"), 0));
                    return;
                }

                if (Session.Character.Level == 250 && Session.Character.HeroLevel == 100 && Session.Character.Prestige < 10)
                {
                    Session.Character.Prestige++;
                    ServerManager.Shout(Name + " est passé prestige " + Prestige);
                    Session.SendPacket(Session.Character.GenerateLev());
                    Session.SendPacket(Session.Character.GenerateIn());
                    Session.SendPacket(Session.Character.GenerateCInfo());
                    Session.SendPacket(Session.Character.GenerateStat());
                    Session.Character.Save();
                    Session.Character.Inventory.RemoveItemFromInventory(inv.Id);
                    ServerManager.Instance.ChangeMapInstance(Session.Character.CharacterId,
                    Session.Character.MapInstanceId, Session.Character.PositionX, Session.Character.PositionY,
                    true);

                }
                else
                {
                    Session.SendPacket("msg 4 Tu n'as pas le niveau requis !");
                }
            }
        }





I'm sorry to tell you that your answer does not solve my problem;) @[Only registered and activated users can see links. Click Here To Register...]
02/08/2019 19:39 moj333#69
Change
Session.Character.Prestige++;
to
Session.Character.PrestigeLevel++;
Redbull just ctrl+c ctrl+v his source.
02/08/2019 21:35 redbull2905#70
my source = opennos-dev ciapa in addition to work

and depends you can prestige ++ or prestigeLevel ++ it depends on you being put
02/12/2019 22:19 InnoTx#71
@[Only registered and activated users can see links. Click Here To Register...] Hey is ur Problem solved if yes could u say how u did it ?

the problem is i can't safe the Prestige...

for example :
if im Prestige 1 and go offline it should Safe it but if i Relog im Prestige 0 again.
02/13/2019 12:18 GGGGame#72
Prestige = input.Prestige.

output.Prestige = input.Prestige

Or something like that, I don't remember :wat:
02/13/2019 12:42 InnoTx#73
Quote:
Originally Posted by GGGGame View Post
Prestige = input.Prestige.

output.Prestige = input.Prestige

Or something like that, I don't remember :wat:
i have that allready but it still dont work ... ;(
02/13/2019 19:27 moj333#74
Do new migration with database. It was somewhere in forum.

[Only registered and activated users can see links. Click Here To Register...]

ps. I dont remeber how to exactly do it.
02/13/2019 23:32 InnoTx#75
Quote:
Originally Posted by moj333 View Post
Do new migration with database. It was somewhere in forum.

[Only registered and activated users can see links. Click Here To Register...]

ps. I dont remeber how to exactly do it.
i have allready a migration with Prestige..... for Database....

Edit: after i Set on Configuration.cs the AutomaticMigrationsEnabled = true; it work