mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Locks
* reworked how an dwhen locks on GameObjects and Items are displayed * added structure for LockType.dbc
This commit is contained in:
@@ -481,6 +481,10 @@ define('TEAM_ALLIANCE', 0);
|
||||
define('TEAM_HORDE', 1);
|
||||
define('TEAM_NEUTRAL', 2);
|
||||
|
||||
// Lock Types
|
||||
define('LOCK_TYPE_ITEM', 1);
|
||||
define('LOCK_TYPE_SKILL', 2);
|
||||
|
||||
// Lock-Properties (also categorizes GOs)
|
||||
define('LOCK_PROPERTY_FOOTLOCKER', 1);
|
||||
define('LOCK_PROPERTY_HERBALISM', 2);
|
||||
|
||||
@@ -103,7 +103,7 @@ class GameObjectList extends BaseType
|
||||
if (isset($this->curTpl['lockId']))
|
||||
if ($locks = Lang::getLocks($this->curTpl['lockId']))
|
||||
foreach ($locks as $l)
|
||||
$x .= '<tr><td>'.$l.'</td></tr>';
|
||||
$x .= '<tr><td>'.sprintf(Lang::game('requires'), $l).'</td></tr>';
|
||||
|
||||
$x .= '</table>';
|
||||
|
||||
|
||||
@@ -918,8 +918,8 @@ class ItemList extends BaseType
|
||||
$x .= sprintf(Lang::game('requires'), '<a class="q1" href="?faction='.$reqFac.'">'.FactionList::getName($reqFac).'</a> - '.Lang::game('rep', $this->curTpl['requiredFactionRank'])).'<br />';
|
||||
|
||||
// locked or openable
|
||||
if ($locks = Lang::getLocks($this->curTpl['lockId'], true))
|
||||
$x .= '<span class="q0">'.Lang::item('locked').'<br />'.implode('<br />', $locks).'</span><br />';
|
||||
if ($locks = Lang::getLocks($this->curTpl['lockId'], $arr, true, true))
|
||||
$x .= '<span class="q0">'.Lang::item('locked').'<br />'.implode('<br />', array_map(function($x) { return sprintf(Lang::game('requires'), $x); }, $locks)).'</span><br />';
|
||||
else if ($this->curTpl['flags'] & ITEM_FLAG_OPENABLE)
|
||||
$x .= '<span class="q2">'.Lang::item('openClick').'</span><br />';
|
||||
|
||||
|
||||
@@ -525,21 +525,21 @@ class Util
|
||||
if ($short)
|
||||
{
|
||||
if ($_ = round($d / 364))
|
||||
return $_." ".Lang::timeUnits('ab', 0);
|
||||
return $_." ".Lang::timeUnits('ab', 0);
|
||||
if ($_ = round($d / 30))
|
||||
return $_." ".Lang::timeUnits('ab', 1);
|
||||
return $_." ".Lang::timeUnits('ab', 1);
|
||||
if ($_ = round($d / 7))
|
||||
return $_." ".Lang::timeUnits('ab', 2);
|
||||
return $_." ".Lang::timeUnits('ab', 2);
|
||||
if ($_ = round($d))
|
||||
return $_." ".Lang::timeUnits('ab', 3);
|
||||
return $_." ".Lang::timeUnits('ab', 3);
|
||||
if ($_ = round($h))
|
||||
return $_." ".Lang::timeUnits('ab', 4);
|
||||
return $_." ".Lang::timeUnits('ab', 4);
|
||||
if ($_ = round($m))
|
||||
return $_." ".Lang::timeUnits('ab', 5);
|
||||
return $_." ".Lang::timeUnits('ab', 5);
|
||||
if ($_ = round($s + $ms / 1000, 2))
|
||||
return $_." ".Lang::timeUnits('ab', 6);
|
||||
return $_." ".Lang::timeUnits('ab', 6);
|
||||
if ($ms)
|
||||
return $ms." ".Lang::timeUnits('ab', 7);
|
||||
return $ms." ".Lang::timeUnits('ab', 7);
|
||||
|
||||
return '0 '.Lang::timeUnits('ab', 6);
|
||||
}
|
||||
@@ -547,19 +547,19 @@ class Util
|
||||
{
|
||||
$_ = $d + $h / 24;
|
||||
if ($_ > 1 && !($_ % 364)) // whole years
|
||||
return round(($d + $h / 24) / 364, 2)." ".Lang::timeUnits($d / 364 == 1 && !$h ? 'sg' : 'pl', 0);
|
||||
return round(($d + $h / 24) / 364, 2)." ".Lang::timeUnits($d / 364 == 1 && !$h ? 'sg' : 'pl', 0);
|
||||
if ($_ > 1 && !($_ % 30)) // whole month
|
||||
return round(($d + $h / 24) / 30, 2)." ".Lang::timeUnits($d / 30 == 1 && !$h ? 'sg' : 'pl', 1);
|
||||
return round(($d + $h / 24) / 30, 2)." ".Lang::timeUnits($d / 30 == 1 && !$h ? 'sg' : 'pl', 1);
|
||||
if ($_ > 1 && !($_ % 7)) // whole weeks
|
||||
return round(($d + $h / 24) / 7, 2)." ".Lang::timeUnits($d / 7 == 1 && !$h ? 'sg' : 'pl', 2);
|
||||
return round(($d + $h / 24) / 7, 2)." ".Lang::timeUnits($d / 7 == 1 && !$h ? 'sg' : 'pl', 2);
|
||||
if ($d)
|
||||
return round($d + $h / 24, 2)." ".Lang::timeUnits($d == 1 && !$h ? 'sg' : 'pl', 3);
|
||||
return round($d + $h / 24, 2)." ".Lang::timeUnits($d == 1 && !$h ? 'sg' : 'pl', 3);
|
||||
if ($h)
|
||||
return round($h + $m / 60, 2)." ".Lang::timeUnits($h == 1 && !$m ? 'sg' : 'pl', 4);
|
||||
return round($h + $m / 60, 2)." ".Lang::timeUnits($h == 1 && !$m ? 'sg' : 'pl', 4);
|
||||
if ($m)
|
||||
return round($m + $s / 60, 2)." ".Lang::timeUnits($m == 1 && !$s ? 'sg' : 'pl', 5);
|
||||
return round($m + $s / 60, 2)." ".Lang::timeUnits($m == 1 && !$s ? 'sg' : 'pl', 5);
|
||||
if ($s)
|
||||
return round($s + $ms / 1000, 2)." ".Lang::timeUnits($s == 1 && !$ms ? 'sg' : 'pl', 6);
|
||||
return round($s + $ms / 1000, 2)." ".Lang::timeUnits($s == 1 && !$ms ? 'sg' : 'pl', 6);
|
||||
if ($ms)
|
||||
return $ms." ".Lang::timeUnits($ms == 1 ? 'sg' : 'pl', 7);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user