mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[11436] Really save/load item 5/6 objectives counters in quest status.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
06ba42ccba
commit
7237fe7f62
6 changed files with 21 additions and 11 deletions
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
DROP TABLE IF EXISTS `character_db_version`;
|
||||
CREATE TABLE `character_db_version` (
|
||||
`required_11391_01_characters_auction` bit(1) default NULL
|
||||
`required_11436_01_characters_character_queststatus` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
||||
|
||||
--
|
||||
|
|
@ -692,6 +692,8 @@ CREATE TABLE `character_queststatus` (
|
|||
`itemcount2` int(11) unsigned NOT NULL default '0',
|
||||
`itemcount3` int(11) unsigned NOT NULL default '0',
|
||||
`itemcount4` int(11) unsigned NOT NULL default '0',
|
||||
`itemcount5` int(11) unsigned NOT NULL default '0',
|
||||
`itemcount6` int(11) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`guid`,`quest`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System';
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE character_db_version CHANGE COLUMN required_11391_01_characters_auction required_11436_01_characters_character_queststatus bit;
|
||||
|
||||
ALTER TABLE character_queststatus
|
||||
ADD COLUMN itemcount5 int(11) unsigned NOT NULL default '0' AFTER itemcount4,
|
||||
ADD COLUMN itemcount6 int(11) unsigned NOT NULL default '0' AFTER itemcount5;
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ bool LoginQueryHolder::Initialize()
|
|||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,item_guid,spell,stackcount,remaincharges,basepoints0,basepoints1,basepoints2,periodictime0,periodictime1,periodictime2,maxduration,remaintime,effIndexMask FROM character_aura WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSPELLS, "SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS, "SELECT quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4 FROM character_queststatus WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS, "SELECT quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4,itemcount5,itemcount6 FROM character_queststatus WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADDAILYQUESTSTATUS,"SELECT quest FROM character_queststatus_daily WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADWEEKLYQUESTSTATUS,"SELECT quest FROM character_queststatus_weekly WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMONTHLYQUESTSTATUS,"SELECT quest FROM character_queststatus_monthly WHERE guid = '%u'", m_guid.GetCounter());
|
||||
|
|
|
|||
|
|
@ -16393,8 +16393,8 @@ void Player::_LoadQuestStatus(QueryResult *result)
|
|||
|
||||
uint32 slot = 0;
|
||||
|
||||
//// 0 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
//QueryResult *result = CharacterDatabase.PQuery("SELECT quest, status, rewarded, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4 FROM character_queststatus WHERE guid = '%u'", GetGUIDLow());
|
||||
//// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
||||
//QueryResult *result = CharacterDatabase.PQuery("SELECT quest, status, rewarded, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4, itemcount5, itemcount6 FROM character_queststatus WHERE guid = '%u'", GetGUIDLow());
|
||||
|
||||
if(result)
|
||||
{
|
||||
|
|
@ -16444,6 +16444,8 @@ void Player::_LoadQuestStatus(QueryResult *result)
|
|||
questStatusData.m_itemcount[1] = fields[10].GetUInt32();
|
||||
questStatusData.m_itemcount[2] = fields[11].GetUInt32();
|
||||
questStatusData.m_itemcount[3] = fields[12].GetUInt32();
|
||||
questStatusData.m_itemcount[4] = fields[13].GetUInt32();
|
||||
questStatusData.m_itemcount[5] = fields[14].GetUInt32();
|
||||
|
||||
questStatusData.uState = QUEST_UNCHANGED;
|
||||
|
||||
|
|
@ -17640,8 +17642,8 @@ void Player::_SaveQuestStatus()
|
|||
{
|
||||
case QUEST_NEW :
|
||||
{
|
||||
SqlStatement stmt = CharacterDatabase.CreateStatement(insertQuestStatus, "INSERT INTO character_queststatus (guid,quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4) "
|
||||
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
SqlStatement stmt = CharacterDatabase.CreateStatement(insertQuestStatus, "INSERT INTO character_queststatus (guid,quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4,itemcount5,itemcount6) "
|
||||
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
|
||||
stmt.addUInt32(GetGUIDLow());
|
||||
stmt.addUInt32(i->first);
|
||||
|
|
@ -17651,7 +17653,7 @@ void Player::_SaveQuestStatus()
|
|||
stmt.addUInt64(uint64(i->second.m_timer / IN_MILLISECONDS+ sWorld.GetGameTime()));
|
||||
for (int k = 0; k < QUEST_OBJECTIVES_COUNT; ++k)
|
||||
stmt.addUInt32(i->second.m_creatureOrGOcount[k]);
|
||||
for (int k = 0; k < QUEST_OBJECTIVES_COUNT; ++k)
|
||||
for (int k = 0; k < QUEST_ITEM_OBJECTIVES_COUNT; ++k)
|
||||
stmt.addUInt32(i->second.m_itemcount[k]);
|
||||
stmt.Execute();
|
||||
}
|
||||
|
|
@ -17659,7 +17661,7 @@ void Player::_SaveQuestStatus()
|
|||
case QUEST_CHANGED :
|
||||
{
|
||||
SqlStatement stmt = CharacterDatabase.CreateStatement(updateQuestStatus, "UPDATE character_queststatus SET status = ?,rewarded = ?,explored = ?,timer = ?,"
|
||||
"mobcount1 = ?,mobcount2 = ?,mobcount3 = ?,mobcount4 = ?,itemcount1 = ?,itemcount2 = ?,itemcount3 = ?,itemcount4 = ? WHERE guid = ? AND quest = ?");
|
||||
"mobcount1 = ?,mobcount2 = ?,mobcount3 = ?,mobcount4 = ?,itemcount1 = ?,itemcount2 = ?,itemcount3 = ?,itemcount4 = ?,itemcount5 = ?,itemcount6 = ? WHERE guid = ? AND quest = ?");
|
||||
|
||||
stmt.addUInt8(i->second.m_status);
|
||||
stmt.addUInt8(i->second.m_rewarded);
|
||||
|
|
@ -17667,7 +17669,7 @@ void Player::_SaveQuestStatus()
|
|||
stmt.addUInt64(uint64(i->second.m_timer / IN_MILLISECONDS + sWorld.GetGameTime()));
|
||||
for (int k = 0; k < QUEST_OBJECTIVES_COUNT; ++k)
|
||||
stmt.addUInt32(i->second.m_creatureOrGOcount[k]);
|
||||
for (int k = 0; k < QUEST_OBJECTIVES_COUNT; ++k)
|
||||
for (int k = 0; k < QUEST_ITEM_OBJECTIVES_COUNT; ++k)
|
||||
stmt.addUInt32(i->second.m_itemcount[k]);
|
||||
stmt.addUInt32(GetGUIDLow());
|
||||
stmt.addUInt32(i->first);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11435"
|
||||
#define REVISION_NR "11436"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __REVISION_SQL_H__
|
||||
#define __REVISION_SQL_H__
|
||||
#define REVISION_DB_CHARACTERS "required_11391_01_characters_auction"
|
||||
#define REVISION_DB_CHARACTERS "required_11436_01_characters_character_queststatus"
|
||||
#define REVISION_DB_MANGOS "required_11433_01_mangos_item_template"
|
||||
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue