- implemented factions basics (search, listview and details)

- added forgotten shared brick for tooltips
This commit is contained in:
Sarjuuk
2014-01-22 10:32:31 +01:00
parent c7c6028adf
commit 91ecc21e8c
26 changed files with 784 additions and 197 deletions

View File

@@ -112,7 +112,7 @@ class QuestList extends BaseType
return $data;
}
public function getListviewData()
public function getListviewData($extraFactionId = 0) // i should formulate a propper parameter..
{
$data = [];
@@ -170,6 +170,7 @@ class QuestList extends BaseType
$data[$this->id]['weekly'] = true;
// flags & 64: Hostile - there are quests, that flag the player for pvp when taken .. where is that set..?
// wflags: &1: disabled/historical; &32: AutoAccept; &64: Hostile(?)
if ($this->curTpl['Flags'] & 0x4000) // Unavailable (todo (med): get disables)
{
$data[$this->id]['historical'] = true; // post 5.0
@@ -179,7 +180,23 @@ class QuestList extends BaseType
if ($this->curTpl['Flags'] & 0x80000) // Auto Accept
$data[$this->id]['wflags'] |= 0x20;
// todo reprewards .. accesses QuestFactionReward.dbc
$data[$this->id]['reprewards'] = [];
for ($i = 1; $i < 6; $i++)
{
$foo = $this->curTpl['RewardFactionId'.$i];
$bar = $this->curTpl['RewardFactionValueIdOverride'.$i] / 100;
if (!$bar && ($_ = $this->curTpl['RewardFactionValueId'.$i]))
$bar = Util::$questFactionReward[abs($_)] * ($_ < 0 ? -1 : 1);
if ($foo && $bar)
{
$data[$this->id]['reprewards'][] = [$foo, $bar];
if ($extraFactionId == $foo)
$data[$this->id]['reputation'] = $bar;
}
}
}
return $data;