mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Mails
* apply table quest_mail_sender to display correct mail source * fixed mails from mailtemplate.dbc for achievement rewards
This commit is contained in:
@@ -63,11 +63,13 @@ class AchievementList extends BaseType
|
||||
{
|
||||
$_curTpl = array_merge($rewards[$_id], $_curTpl);
|
||||
|
||||
$_curTpl['mailTemplate'] = $rewards[$_id]['MailTemplateID'];
|
||||
|
||||
if ($rewards[$_id]['MailTemplateID'])
|
||||
{
|
||||
// using class Loot creates an inifinite loop cirling between Loot, ItemList and SpellList or something
|
||||
// $mailSrc = new Loot();
|
||||
// $mailSrc->getByContainer(LOOT_MAIL, $rewards[$_id]['mailTemplate']);
|
||||
// $mailSrc->getByContainer(LOOT_MAIL, $rewards[$_id]['MailTemplateID']);
|
||||
// foreach ($mailSrc->iterate() as $loot)
|
||||
// $_curTpl['rewards'][] = [TYPE_ITEM, $loot['id']];
|
||||
|
||||
|
||||
@@ -1236,17 +1236,16 @@ class QuestPage extends GenericPage
|
||||
'subject' => Util::parseHtmlText(Util::localizedString($letter, 'subject'))
|
||||
);
|
||||
|
||||
foreach ($startEnd as $se)
|
||||
{
|
||||
if (!($se['method'] & 0x2) || $se['type'] != TYPE_NPC)
|
||||
continue;
|
||||
$senderTypeId = 0;
|
||||
if ($_= DB::World()->selectCell('SELECT RewardMailSenderEntry FROM quest_mail_sender WHERE QuestId = ?d', $this->typeId))
|
||||
$senderTypeId = $_;
|
||||
else
|
||||
foreach ($startEnd as $se)
|
||||
if (($se['method'] & 0x2) && $se['type'] == TYPE_NPC)
|
||||
$senderTypeId = $se['typeId'];
|
||||
|
||||
if ($ti = CreatureList::getName($se['typeId']))
|
||||
{
|
||||
$mail['sender'] = sprintf(Lang::quest('mailBy'), $se['typeId'], $ti);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($ti = CreatureList::getName($senderTypeId))
|
||||
$mail['sender'] = sprintf(Lang::quest('mailBy'), $senderTypeId, $ti);
|
||||
|
||||
// while mail attachemnts are handled as loot, it has no variance. Always 100% chance, always one item.
|
||||
$mailLoot = new Loot();
|
||||
|
||||
Reference in New Issue
Block a user