mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8770] Fix dynamic quest levels.
QuestLevel -1 is now to be used for dynamic quest level instead of older 0. DB support needed for update of quests. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
e078d0dd03
commit
71c031b478
11 changed files with 21 additions and 14 deletions
|
|
@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`creature_ai_version` varchar(120) default NULL,
|
`creature_ai_version` varchar(120) default NULL,
|
||||||
`cache_id` int(10) default '0',
|
`cache_id` int(10) default '0',
|
||||||
`required_8769_01_mangos_mail_level_reward` bit(1) default NULL
|
`required_8770_01_mangos_quest_template` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -13621,7 +13621,7 @@ CREATE TABLE `quest_template` (
|
||||||
`ZoneOrSort` smallint(6) NOT NULL default '0',
|
`ZoneOrSort` smallint(6) NOT NULL default '0',
|
||||||
`SkillOrClass` smallint(6) NOT NULL default '0',
|
`SkillOrClass` smallint(6) NOT NULL default '0',
|
||||||
`MinLevel` tinyint(3) unsigned NOT NULL default '0',
|
`MinLevel` tinyint(3) unsigned NOT NULL default '0',
|
||||||
`QuestLevel` tinyint(3) unsigned NOT NULL default '0',
|
`QuestLevel` smallint(6) NOT NULL default '0',
|
||||||
`Type` smallint(5) unsigned NOT NULL default '0',
|
`Type` smallint(5) unsigned NOT NULL default '0',
|
||||||
`RequiredRaces` smallint(5) unsigned NOT NULL default '0',
|
`RequiredRaces` smallint(5) unsigned NOT NULL default '0',
|
||||||
`RequiredSkillValue` smallint(5) unsigned NOT NULL default '0',
|
`RequiredSkillValue` smallint(5) unsigned NOT NULL default '0',
|
||||||
|
|
|
||||||
4
sql/updates/8770_01_mangos_quest_template.sql
Normal file
4
sql/updates/8770_01_mangos_quest_template.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_8769_01_mangos_mail_level_reward required_8770_01_mangos_quest_template bit;
|
||||||
|
|
||||||
|
ALTER TABLE quest_template
|
||||||
|
CHANGE COLUMN QuestLevel QuestLevel smallint(6) NOT NULL DEFAULT 0;
|
||||||
|
|
@ -147,6 +147,7 @@ pkgdata_DATA = \
|
||||||
8731_01_mangos_creature_template.sql \
|
8731_01_mangos_creature_template.sql \
|
||||||
8749_01_mangos_mail_loot_template.sql \
|
8749_01_mangos_mail_loot_template.sql \
|
||||||
8769_01_mangos_mail_level_reward.sql \
|
8769_01_mangos_mail_level_reward.sql \
|
||||||
|
8770_01_mangos_quest_template.sql \
|
||||||
README
|
README
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
|
|
@ -274,4 +275,5 @@ EXTRA_DIST = \
|
||||||
8731_01_mangos_creature_template.sql \
|
8731_01_mangos_creature_template.sql \
|
||||||
8749_01_mangos_mail_loot_template.sql \
|
8749_01_mangos_mail_loot_template.sql \
|
||||||
8769_01_mangos_mail_level_reward.sql \
|
8769_01_mangos_mail_level_reward.sql \
|
||||||
|
8770_01_mangos_quest_template.sql \
|
||||||
README
|
README
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ void PlayerMenu::SendGossipMenu( uint32 TitleTextId, uint64 npcGUID )
|
||||||
|
|
||||||
data << uint32(questID);
|
data << uint32(questID);
|
||||||
data << uint32(qItem.m_qIcon);
|
data << uint32(qItem.m_qIcon);
|
||||||
data << uint32(pSession->GetPlayer()->GetQuestLevel(pQuest));
|
data << int32(pQuest->GetQuestLevel());
|
||||||
std::string Title = pQuest->GetTitle();
|
std::string Title = pQuest->GetTitle();
|
||||||
|
|
||||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||||
|
|
@ -400,7 +400,7 @@ void PlayerMenu::SendQuestGiverQuestList( QEmote eEmote, const std::string& Titl
|
||||||
|
|
||||||
data << uint32(questID);
|
data << uint32(questID);
|
||||||
data << uint32(qmi.m_qIcon);
|
data << uint32(qmi.m_qIcon);
|
||||||
data << uint32(pSession->GetPlayer()->GetQuestLevel(pQuest));
|
data << int32(pQuest->GetQuestLevel());
|
||||||
data << title;
|
data << title;
|
||||||
}
|
}
|
||||||
pSession->SendPacket( &data );
|
pSession->SendPacket( &data );
|
||||||
|
|
@ -547,7 +547,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
|
||||||
|
|
||||||
data << uint32(pQuest->GetQuestId()); // quest id
|
data << uint32(pQuest->GetQuestId()); // quest id
|
||||||
data << uint32(pQuest->GetQuestMethod()); // Accepted values: 0, 1 or 2. 0==IsAutoComplete() (skip objectives/details)
|
data << uint32(pQuest->GetQuestMethod()); // Accepted values: 0, 1 or 2. 0==IsAutoComplete() (skip objectives/details)
|
||||||
data << uint32(pQuest->GetQuestLevel()); // may be 0, static data, in other cases must be used dynamic level: Player::GetQuestLevel
|
data << int32(pQuest->GetQuestLevel()); // may be -1, static data, in other cases must be used dynamic level: Player::GetQuestLevelForPlayer (0 is not known, but assuming this is no longer valid for quest intended for client)
|
||||||
data << uint32(pQuest->GetZoneOrSort()); // zone or sort to display in quest log
|
data << uint32(pQuest->GetZoneOrSort()); // zone or sort to display in quest log
|
||||||
|
|
||||||
data << uint32(pQuest->GetType()); // quest type
|
data << uint32(pQuest->GetType()); // quest type
|
||||||
|
|
|
||||||
|
|
@ -5917,7 +5917,7 @@ void Player::RewardReputation(Quest const *pQuest)
|
||||||
{
|
{
|
||||||
if(pQuest->RewRepFaction[i] && pQuest->RewRepValue[i] )
|
if(pQuest->RewRepFaction[i] && pQuest->RewRepValue[i] )
|
||||||
{
|
{
|
||||||
int32 rep = CalculateReputationGain(GetQuestLevel(pQuest), pQuest->RewRepValue[i], pQuest->RewRepFaction[i], true);
|
int32 rep = CalculateReputationGain(GetQuestLevelForPlayer(pQuest), pQuest->RewRepValue[i], pQuest->RewRepFaction[i], true);
|
||||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->RewRepFaction[i]);
|
FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->RewRepFaction[i]);
|
||||||
if(factionEntry)
|
if(factionEntry)
|
||||||
GetReputationMgr().ModifyReputation(factionEntry, rep);
|
GetReputationMgr().ModifyReputation(factionEntry, rep);
|
||||||
|
|
|
||||||
|
|
@ -1280,7 +1280,8 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
/*** QUEST SYSTEM ***/
|
/*** QUEST SYSTEM ***/
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
|
|
||||||
uint32 GetQuestLevel( Quest const* pQuest ) const { return pQuest && pQuest->GetQuestLevel() ? pQuest->GetQuestLevel() : getLevel(); }
|
// Return player level when QuestLevel is dynamic (-1)
|
||||||
|
uint32 GetQuestLevelForPlayer(Quest const* pQuest) const { return pQuest && (pQuest->GetQuestLevel() > 0) ? (uint32)pQuest->GetQuestLevel() : getLevel(); }
|
||||||
|
|
||||||
void PrepareQuestMenu( uint64 guid );
|
void PrepareQuestMenu( uint64 guid );
|
||||||
void SendPreparedQuest( uint64 guid );
|
void SendPreparedQuest( uint64 guid );
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ Quest::Quest(Field * questRecord)
|
||||||
ZoneOrSort = questRecord[2].GetInt32();
|
ZoneOrSort = questRecord[2].GetInt32();
|
||||||
SkillOrClass = questRecord[3].GetInt32();
|
SkillOrClass = questRecord[3].GetInt32();
|
||||||
MinLevel = questRecord[4].GetUInt32();
|
MinLevel = questRecord[4].GetUInt32();
|
||||||
QuestLevel = questRecord[5].GetUInt32();
|
QuestLevel = questRecord[5].GetInt32();
|
||||||
Type = questRecord[6].GetUInt32();
|
Type = questRecord[6].GetUInt32();
|
||||||
RequiredRaces = questRecord[7].GetUInt32();
|
RequiredRaces = questRecord[7].GetUInt32();
|
||||||
RequiredSkillValue = questRecord[8].GetUInt32();
|
RequiredSkillValue = questRecord[8].GetUInt32();
|
||||||
|
|
@ -169,7 +169,7 @@ uint32 Quest::XPValue( Player *pPlayer ) const
|
||||||
if( RewMoneyMaxLevel > 0 )
|
if( RewMoneyMaxLevel > 0 )
|
||||||
{
|
{
|
||||||
uint32 pLevel = pPlayer->getLevel();
|
uint32 pLevel = pPlayer->getLevel();
|
||||||
uint32 qLevel = QuestLevel;
|
uint32 qLevel = QuestLevel > 0 ? (uint32)QuestLevel : 0;
|
||||||
float fullxp = 0;
|
float fullxp = 0;
|
||||||
if (qLevel >= 15)
|
if (qLevel >= 15)
|
||||||
fullxp = RewMoneyMaxLevel / 6.0f;
|
fullxp = RewMoneyMaxLevel / 6.0f;
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ class Quest
|
||||||
int32 GetZoneOrSort() const { return ZoneOrSort; }
|
int32 GetZoneOrSort() const { return ZoneOrSort; }
|
||||||
int32 GetSkillOrClass() const { return SkillOrClass; }
|
int32 GetSkillOrClass() const { return SkillOrClass; }
|
||||||
uint32 GetMinLevel() const { return MinLevel; }
|
uint32 GetMinLevel() const { return MinLevel; }
|
||||||
uint32 GetQuestLevel() const { return QuestLevel; }
|
int32 GetQuestLevel() const { return QuestLevel; }
|
||||||
uint32 GetType() const { return Type; }
|
uint32 GetType() const { return Type; }
|
||||||
uint32 GetRequiredRaces() const { return RequiredRaces; }
|
uint32 GetRequiredRaces() const { return RequiredRaces; }
|
||||||
uint32 GetRequiredSkillValue() const { return RequiredSkillValue; }
|
uint32 GetRequiredSkillValue() const { return RequiredSkillValue; }
|
||||||
|
|
@ -274,7 +274,7 @@ class Quest
|
||||||
int32 ZoneOrSort;
|
int32 ZoneOrSort;
|
||||||
int32 SkillOrClass;
|
int32 SkillOrClass;
|
||||||
uint32 MinLevel;
|
uint32 MinLevel;
|
||||||
uint32 QuestLevel;
|
int32 QuestLevel;
|
||||||
uint32 Type;
|
uint32 Type;
|
||||||
uint32 RequiredRaces;
|
uint32 RequiredRaces;
|
||||||
uint32 RequiredSkillValue;
|
uint32 RequiredSkillValue;
|
||||||
|
|
|
||||||
|
|
@ -606,7 +606,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
|
||||||
{
|
{
|
||||||
if ( pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && pPlayer->getQuestStatusMap()[quest_id].m_rewarded))
|
if ( pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && pPlayer->getQuestStatusMap()[quest_id].m_rewarded))
|
||||||
result2 = DIALOG_STATUS_REWARD_REP;
|
result2 = DIALOG_STATUS_REWARD_REP;
|
||||||
else if (pPlayer->getLevel() <= pPlayer->GetQuestLevel(pQuest) + sWorld.getConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF) )
|
else if (pPlayer->getLevel() <= pPlayer->GetQuestLevelForPlayer(pQuest) + sWorld.getConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF) )
|
||||||
{
|
{
|
||||||
if (pQuest->HasFlag(QUEST_FLAGS_DAILY))
|
if (pQuest->HasFlag(QUEST_FLAGS_DAILY))
|
||||||
result2 = DIALOG_STATUS_AVAILABLE_REP;
|
result2 = DIALOG_STATUS_AVAILABLE_REP;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8769"
|
#define REVISION_NR "8770"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __REVISION_SQL_H__
|
#ifndef __REVISION_SQL_H__
|
||||||
#define __REVISION_SQL_H__
|
#define __REVISION_SQL_H__
|
||||||
#define REVISION_DB_CHARACTERS "required_8721_01_characters_guild"
|
#define REVISION_DB_CHARACTERS "required_8721_01_characters_guild"
|
||||||
#define REVISION_DB_MANGOS "required_8769_01_mangos_mail_level_reward"
|
#define REVISION_DB_MANGOS "required_8770_01_mangos_quest_template"
|
||||||
#define REVISION_DB_REALMD "required_8728_01_realmd_account"
|
#define REVISION_DB_REALMD "required_8728_01_realmd_account"
|
||||||
#endif // __REVISION_SQL_H__
|
#endif // __REVISION_SQL_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue