public function renderTooltip() { if (!$this->curTpl) { return null; } $title = Util::jsEscape($this->getField('name', true)); $level = $this->curTpl['level']; if ($level < 0) { $level = 0; } $x = ''; if ($level) { $level = sprintf(Lang::quest('questLevel'), $level); if ($this->curTpl['flags'] & QUEST_FLAG_DAILY) { // daily $level .= ' ' . Lang::quest('daily'); } $x .= '<table><tr><td><table width="100%"><tr><td><b class="q">' . $title . '</b></td><th><b class="q0">' . $level . '</b></th></tr></table></td></tr></table>'; } else { $x .= '<table><tr><td><b class="q">' . $title . '</b></td></tr></table>'; } $x .= '<table><tr><td><br />' . $this->parseText('objectives'); $xReq = ''; for ($i = 1; $i < 5; $i++) { $ot = $this->getField('objectiveText' . $i, true); $rng = $this->curTpl['reqNpcOrGo' . $i]; $rngQty = $this->curTpl['reqNpcOrGoCount' . $i]; if ($rngQty < 1 && (!$rng || $ot)) { continue; } if ($ot) { $name = $ot; } else { $name = $rng > 0 ? CreatureList::getName($rng) : GameObjectList::getName(-$rng); } $xReq .= '<br /> - ' . Util::jsEscape($name) . ($rngQty > 1 ? ' x ' . $rngQty : null); } for ($i = 1; $i < 7; $i++) { $ri = $this->curTpl['reqItemId' . $i]; $riQty = $this->curTpl['reqItemCount' . $i]; if (!$ri || $riQty < 1) { continue; } $xReq .= '<br /> - ' . Util::jsEscape(ItemList::getName($ri)) . ($riQty > 1 ? ' x ' . $riQty : null); } if ($et = $this->getField('end', true)) { $xReq .= '<br /> - ' . Util::jsEscape($et); } if ($_ = $this->getField('rewardOrReqMoney')) { if ($_ < 0) { $xReq .= '<br /> - ' . Lang::quest('money') . Lang::main('colon') . Util::formatMoney(abs($_)); } } if ($xReq) { $x .= '<br /><br /><span class="q">' . Lang::quest('requirements') . Lang::main('colon') . '</span>' . $xReq; } $x .= '</td></tr></table>'; return $x; }