Skip to content

Commit

Permalink
[12225] Implement locales for PortratGiver and PortraitTurnIn
Browse files Browse the repository at this point in the history
Signed-off-by: Yaki Khadafi <elsoldollo@gmail.com>
  • Loading branch information
Zakamurite committed Sep 14, 2012
1 parent 6d075ae commit ed3f894
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 39 deletions.
38 changes: 35 additions & 3 deletions sql/mangos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0',
`required_12216_12_mangos_spell_loot_template"` bit(1) default NULL
`required_12225_02_mangos_quest_template"` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';

--
Expand Down Expand Up @@ -3268,6 +3268,38 @@ CREATE TABLE `locales_quest` (
`ObjectiveText4_loc6` text,
`ObjectiveText4_loc7` text,
`ObjectiveText4_loc8` text,
`PortraitGiverName_loc1` text,
`PortraitGiverName_loc2` text,
`PortraitGiverName_loc3` text,
`PortraitGiverName_loc4` text,
`PortraitGiverName_loc5` text,
`PortraitGiverName_loc6` text,
`PortraitGiverName_loc7` text,
`PortraitGiverName_loc8` text,
`PortraitGiverText_loc1` text,
`PortraitGiverText_loc2` text,
`PortraitGiverText_loc3` text,
`PortraitGiverText_loc4` text,
`PortraitGiverText_loc5` text,
`PortraitGiverText_loc6` text,
`PortraitGiverText_loc7` text,
`PortraitGiverText_loc8` text,
`PortraitTurnInName_loc1` text,
`PortraitTurnInName_loc2` text,
`PortraitTurnInName_loc3` text,
`PortraitTurnInName_loc4` text,
`PortraitTurnInName_loc5` text,
`PortraitTurnInName_loc6` text,
`PortraitTurnInName_loc7` text,
`PortraitTurnInName_loc8` text,
`PortraitTurnInText_loc1` text,
`PortraitTurnInText_loc2` text,
`PortraitTurnInText_loc3` text,
`PortraitTurnInText_loc4` text,
`PortraitTurnInText_loc5` text,
`PortraitTurnInText_loc6` text,
`PortraitTurnInText_loc7` text,
`PortraitTurnInText_loc8` text,
PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Expand Down Expand Up @@ -20614,10 +20646,10 @@ CREATE TABLE `quest_template` (
`RequestItemsText` text,
`EndText` text,
`CompletedText` text,
`PortraitGiverText` text,
`PortraitGiverName` text,
`PortraitTurnInText` text,
`PortraitGiverText` text,
`PortraitTurnInName` text,
`PortraitTurnInText` text,
`ObjectiveText1` text,
`ObjectiveText2` text,
`ObjectiveText3` text,
Expand Down
37 changes: 37 additions & 0 deletions sql/updates/12225_01_mangos_locales_quest.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
ALTER TABLE db_version CHANGE COLUMN required_12216_12_mangos_spell_loot_template required_12225_01_mangos_locales_quest bit;

ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverName_loc1` text AFTER `ObjectiveText4_loc8`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverName_loc2` text AFTER `PortraitGiverName_loc1`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverName_loc3` text AFTER `PortraitGiverName_loc2`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverName_loc4` text AFTER `PortraitGiverName_loc3`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverName_loc5` text AFTER `PortraitGiverName_loc4`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverName_loc6` text AFTER `PortraitGiverName_loc5`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverName_loc7` text AFTER `PortraitGiverName_loc6`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverName_loc8` text AFTER `PortraitGiverName_loc7`;

ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverText_loc1` text AFTER `PortraitGiverName_loc8`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverText_loc2` text AFTER `PortraitGiverText_loc1`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverText_loc3` text AFTER `PortraitGiverText_loc2`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverText_loc4` text AFTER `PortraitGiverText_loc3`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverText_loc5` text AFTER `PortraitGiverText_loc4`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverText_loc6` text AFTER `PortraitGiverText_loc5`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverText_loc7` text AFTER `PortraitGiverText_loc6`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitGiverText_loc8` text AFTER `PortraitGiverText_loc7`;

ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInName_loc1` text AFTER `PortraitGiverText_loc8`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInName_loc2` text AFTER `PortraitTurnInName_loc1`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInName_loc3` text AFTER `PortraitTurnInName_loc2`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInName_loc4` text AFTER `PortraitTurnInName_loc3`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInName_loc5` text AFTER `PortraitTurnInName_loc4`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInName_loc6` text AFTER `PortraitTurnInName_loc5`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInName_loc7` text AFTER `PortraitTurnInName_loc6`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInName_loc8` text AFTER `PortraitTurnInName_loc7`;

ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInText_loc1` text AFTER `PortraitTurnInName_loc8`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInText_loc2` text AFTER `PortraitTurnInText_loc1`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInText_loc3` text AFTER `PortraitTurnInText_loc2`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInText_loc4` text AFTER `PortraitTurnInText_loc3`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInText_loc5` text AFTER `PortraitTurnInText_loc4`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInText_loc6` text AFTER `PortraitTurnInText_loc5`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInText_loc7` text AFTER `PortraitTurnInText_loc6`;
ALTER TABLE `locales_quest` ADD COLUMN `PortraitTurnInText_loc8` text AFTER `PortraitTurnInText_loc7`;
6 changes: 6 additions & 0 deletions sql/updates/12225_02_mangos_quest_template.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ALTER TABLE db_version CHANGE COLUMN required_12225_01_mangos_locales_quest required_12225_02_mangos_quest_template bit;

ALTER TABLE `quest_template` MODIFY COLUMN `PortraitGiverName` text AFTER `CompletedText`;
ALTER TABLE `quest_template` MODIFY COLUMN `PortraitGiverText` text AFTER `PortraitGiverName`;
ALTER TABLE `quest_template` MODIFY COLUMN `PortraitTurnInName` text AFTER `PortraitGiverText`;
ALTER TABLE `quest_template` MODIFY COLUMN `PortraitTurnInText` text AFTER `PortraitTurnInName`;
39 changes: 30 additions & 9 deletions src/game/GossipDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,10 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid guid
std::string Title = pQuest->GetTitle();
std::string Details = pQuest->GetDetails();
std::string Objectives = pQuest->GetObjectives();
std::string PortraitGiverText = pQuest->GetPortraitGiverText();
std::string PortraitGiverName = pQuest->GetPortraitGiverName();
std::string PortraitTurnInText = pQuest->GetPortraitTurnInText();
std::string PortraitGiverText = pQuest->GetPortraitGiverText();
std::string PortraitTurnInName = pQuest->GetPortraitTurnInName();
std::string PortraitTurnInText = pQuest->GetPortraitTurnInText();

int loc_idx = GetMenuSession()->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
Expand All @@ -442,7 +442,14 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid guid
Details = ql->Details[loc_idx];
if (ql->Objectives.size() > (size_t)loc_idx && !ql->Objectives[loc_idx].empty())
Objectives = ql->Objectives[loc_idx];
// TODO: locales for PortraitGiver and PortraitTurnIn
if (ql->PortraitGiverName.size() > (size_t)loc_idx && !ql->PortraitGiverName[loc_idx].empty())
PortraitGiverName = ql->PortraitGiverName[loc_idx];
if (ql->PortraitGiverText.size() > (size_t)loc_idx && !ql->PortraitGiverText[loc_idx].empty())
PortraitGiverText = ql->PortraitGiverText[loc_idx];
if (ql->PortraitTurnInName.size() > (size_t)loc_idx && !ql->PortraitTurnInName[loc_idx].empty())
PortraitTurnInName = ql->PortraitTurnInName[loc_idx];
if (ql->PortraitTurnInText.size() > (size_t)loc_idx && !ql->PortraitTurnInText[loc_idx].empty())
PortraitTurnInText = ql->PortraitTurnInText[loc_idx];
}
}

Expand Down Expand Up @@ -564,10 +571,10 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* pQuest)
Objectives = pQuest->GetObjectives();
EndText = pQuest->GetEndText();
CompletedText = pQuest->GetCompletedText();
PortraitGiverText = pQuest->GetPortraitGiverText();
PortraitGiverName = pQuest->GetPortraitGiverName();
PortraitTurnInText = pQuest->GetPortraitTurnInText();
PortraitGiverText = pQuest->GetPortraitGiverText();
PortraitTurnInName = pQuest->GetPortraitTurnInName();
PortraitTurnInText = pQuest->GetPortraitTurnInText();

for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
ObjectiveText[i] = pQuest->ObjectiveText[i];
Expand All @@ -587,7 +594,14 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* pQuest)
EndText = ql->EndText[loc_idx];
if (ql->CompletedText.size() > (size_t)loc_idx && !ql->CompletedText[loc_idx].empty())
CompletedText = ql->CompletedText[loc_idx];
// TODO: locales for PortraitGiver and PortraitTurnIn
if (ql->PortraitGiverName.size() > (size_t)loc_idx && !ql->PortraitGiverName[loc_idx].empty())
PortraitGiverName = ql->PortraitGiverName[loc_idx];
if (ql->PortraitGiverText.size() > (size_t)loc_idx && !ql->PortraitGiverText[loc_idx].empty())
PortraitGiverText = ql->PortraitGiverText[loc_idx];
if (ql->PortraitTurnInName.size() > (size_t)loc_idx && !ql->PortraitTurnInName[loc_idx].empty())
PortraitTurnInName = ql->PortraitTurnInName[loc_idx];
if (ql->PortraitTurnInText.size() > (size_t)loc_idx && !ql->PortraitTurnInText[loc_idx].empty())
PortraitTurnInText = ql->PortraitTurnInText[loc_idx];

for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
if (ql->ObjectiveText[i].size() > (size_t)loc_idx && !ql->ObjectiveText[i][loc_idx].empty())
Expand Down Expand Up @@ -745,10 +759,10 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, ObjectGuid npcGU
{
std::string Title = pQuest->GetTitle();
std::string OfferRewardText = pQuest->GetOfferRewardText();
std::string PortraitGiverText = pQuest->GetPortraitGiverText();
std::string PortraitGiverName = pQuest->GetPortraitGiverName();
std::string PortraitTurnInText = pQuest->GetPortraitTurnInText();
std::string PortraitGiverText = pQuest->GetPortraitGiverText();
std::string PortraitTurnInName = pQuest->GetPortraitTurnInName();
std::string PortraitTurnInText = pQuest->GetPortraitTurnInText();

int loc_idx = GetMenuSession()->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
Expand All @@ -759,7 +773,14 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, ObjectGuid npcGU
Title = ql->Title[loc_idx];
if (ql->OfferRewardText.size() > (size_t)loc_idx && !ql->OfferRewardText[loc_idx].empty())
OfferRewardText = ql->OfferRewardText[loc_idx];
// TODO: locales for PortraitGiver and PortraitTurnIn
if (ql->PortraitGiverName.size() > (size_t)loc_idx && !ql->PortraitGiverName[loc_idx].empty())
PortraitGiverName = ql->PortraitGiverName[loc_idx];
if (ql->PortraitGiverText.size() > (size_t)loc_idx && !ql->PortraitGiverText[loc_idx].empty())
PortraitGiverText = ql->PortraitGiverText[loc_idx];
if (ql->PortraitTurnInName.size() > (size_t)loc_idx && !ql->PortraitTurnInName[loc_idx].empty())
PortraitTurnInName = ql->PortraitTurnInName[loc_idx];
if (ql->PortraitTurnInText.size() > (size_t)loc_idx && !ql->PortraitTurnInText[loc_idx].empty())
PortraitTurnInText = ql->PortraitTurnInText[loc_idx];
}
}

Expand Down
Loading

0 comments on commit ed3f894

Please sign in to comment.