QuestLevel can be -1. Quest with this level are allways show yellow ? above quest giver
--HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
-- Change column QuestLevel to allowed -1 value.
|
||||||
|
ALTER TABLE `quest_template` CHANGE `QuestLevel` `QuestLeveltemp` INT(8);
|
||||||
|
ALTER TABLE `quest_template` ADD `QuestLevel` SMALLINT(3) AFTER `QuestLeveltemp`;
|
||||||
|
UPDATE `quest_template` SET `QuestLevel` = `QuestLeveltemp`;
|
||||||
|
ALTER TABLE `quest_template` DROP `QuestLeveltemp`;
|
||||||
+1
-1
@@ -2430,7 +2430,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(3) 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',
|
||||||
|
|||||||
+1
-1
@@ -1211,7 +1211,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||||||
/*** QUEST SYSTEM ***/
|
/*** QUEST SYSTEM ***/
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
|
|
||||||
uint32 GetQuestLevel( Quest const* pQuest ) const { return pQuest && pQuest->GetQuestLevel() ? pQuest->GetQuestLevel() : getLevel(); }
|
int32 GetQuestLevel( Quest const* pQuest ) const { return pQuest && pQuest->GetQuestLevel() ? pQuest->GetQuestLevel() : getLevel(); }
|
||||||
|
|
||||||
void PrepareQuestMenu( uint64 guid );
|
void PrepareQuestMenu( uint64 guid );
|
||||||
void SendPreparedQuest( uint64 guid );
|
void SendPreparedQuest( uint64 guid );
|
||||||
|
|||||||
@@ -29,7 +29,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();
|
||||||
@@ -167,7 +167,7 @@ uint32 Quest::XPValue( Player *pPlayer ) const
|
|||||||
if( RewMoneyMaxLevel > 0 )
|
if( RewMoneyMaxLevel > 0 )
|
||||||
{
|
{
|
||||||
uint32 pLevel = pPlayer->getLevel();
|
uint32 pLevel = pPlayer->getLevel();
|
||||||
uint32 qLevel = QuestLevel;
|
int32 qLevel = QuestLevel;
|
||||||
float fullxp = 0;
|
float fullxp = 0;
|
||||||
if (qLevel >= 15)
|
if (qLevel >= 15)
|
||||||
fullxp = RewMoneyMaxLevel / 6.0f;
|
fullxp = RewMoneyMaxLevel / 6.0f;
|
||||||
@@ -181,18 +181,18 @@ uint32 Quest::XPValue( Player *pPlayer ) const
|
|||||||
fullxp = RewMoneyMaxLevel / 1.2f;
|
fullxp = RewMoneyMaxLevel / 1.2f;
|
||||||
else if (qLevel >= 1 && qLevel <= 10)
|
else if (qLevel >= 1 && qLevel <= 10)
|
||||||
fullxp = RewMoneyMaxLevel / 0.6f;
|
fullxp = RewMoneyMaxLevel / 0.6f;
|
||||||
else if (qLevel == 0)
|
else if (qLevel <= 0)
|
||||||
fullxp = RewMoneyMaxLevel;
|
fullxp = RewMoneyMaxLevel;
|
||||||
|
|
||||||
if( pLevel <= qLevel + 5 )
|
if ((pLevel <= qLevel + 5) || qLevel == -1)
|
||||||
return (uint32)fullxp;
|
return (uint32)fullxp;
|
||||||
else if( pLevel == qLevel + 6 )
|
else if (pLevel == qLevel + 6)
|
||||||
return (uint32)(fullxp * 0.8f);
|
return (uint32)(fullxp * 0.8f);
|
||||||
else if( pLevel == qLevel + 7 )
|
else if (pLevel == qLevel + 7)
|
||||||
return (uint32)(fullxp * 0.6f);
|
return (uint32)(fullxp * 0.6f);
|
||||||
else if( pLevel == qLevel + 8 )
|
else if (pLevel == qLevel + 8)
|
||||||
return (uint32)(fullxp * 0.4f);
|
return (uint32)(fullxp * 0.4f);
|
||||||
else if( pLevel == qLevel + 9 )
|
else if (pLevel == qLevel + 9)
|
||||||
return (uint32)(fullxp * 0.2f);
|
return (uint32)(fullxp * 0.2f);
|
||||||
else
|
else
|
||||||
return (uint32)(fullxp * 0.1f);
|
return (uint32)(fullxp * 0.1f);
|
||||||
@@ -203,7 +203,7 @@ uint32 Quest::XPValue( Player *pPlayer ) const
|
|||||||
|
|
||||||
int32 Quest::GetRewOrReqMoney() const
|
int32 Quest::GetRewOrReqMoney() const
|
||||||
{
|
{
|
||||||
if(RewOrReqMoney <=0)
|
if(RewOrReqMoney <= 0)
|
||||||
return RewOrReqMoney;
|
return RewOrReqMoney;
|
||||||
|
|
||||||
return int32(RewOrReqMoney * sWorld.getRate(RATE_DROP_MONEY));
|
return int32(RewOrReqMoney * sWorld.getRate(RATE_DROP_MONEY));
|
||||||
|
|||||||
@@ -566,7 +566,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->GetQuestLevel(pQuest) == -1) ? pPlayer->getLevel() : pPlayer->GetQuestLevel(pQuest) + sWorld.getConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF)))
|
||||||
{
|
{
|
||||||
if (pQuest->IsDaily())
|
if (pQuest->IsDaily())
|
||||||
result2 = DIALOG_STATUS_AVAILABLE_REP;
|
result2 = DIALOG_STATUS_AVAILABLE_REP;
|
||||||
|
|||||||
Reference in New Issue
Block a user