Change player stats

Hey there,

i try to chance the player stats (int, str, etc.) in the characters_playerstats, but i did not found a command like “.modify int xx”. Did i fail to see the command or do not exist a command like that?

If a command do not exist, then i want to create new command which change the attributes, but i do not know how i write a function which write a value into the database. Is there a code example for “write into database”?

wrong forum.

Are you kidding? There’s 1000’s of lines of code in the core. Most likely one or two of them write data into the database.

https://github.com/TrinityCore/TrinityCore/blob/master/src/server/shared/Database/Implementation/WorldDatabase.cpp#L40

https://github.com/TrinityCore/TrinityCore/blob/master/src/server/scripts/Commands/cs_npc.cpp#L312

Thank you for the links, but i do not understand how the statement get the values (GUID and MovementType) from the cs_npc.cpp. I do not see that the function “WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);” passed two values (GUID and MovementType).

Huh?

[CODE] // Update movement type
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);

    stmt->setUInt8(0, uint8(WAYPOINT_MOTION_TYPE));
    stmt->setUInt32(1, lowGuid);

    WorldDatabase.Execute(stmt);

[/CODE]

If you’re going to be quoting and discussing code then this should be moved to Custom Code and Requests.

Help and Support is supposed to be for people who have problems getting the core running, not people having problems understanding C++ while trying to modify the code.

But to give the OP a hint, take a look at the prepared statement itself. You will see that it is expecting two fields which as Guybrush showed are set by referencing the index of the field.