Skip to content

Commit

Permalink
[63] Added Provided for, Objective of and Starts blocks for que…
Browse files Browse the repository at this point in the history
…st items in item-info.php
  • Loading branch information
Shadez committed Feb 6, 2010
1 parent 3206800 commit 215d7ab
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 54 deletions.
100 changes: 75 additions & 25 deletions includes/classes/class.items.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 61
* @revision 63
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -314,7 +314,7 @@ public function BuildItemSetInfo($itemset) {
* @todo Currency for
* @return array
**/
public function BuildLootTable($item, $vendor) {
public function BuildLootTable($item, $vendor, $data=false) {
$lootTable = '';
switch($vendor) {
case 'vendor':
Expand All @@ -323,110 +323,160 @@ public function BuildLootTable($item, $vendor) {
FROM `npc_vendor`
WHERE `item`=?", $item);
if(!empty($VendorLoot)) {
$i = 0;
foreach($VendorLoot as $vItem) {
$lootTable[count($lootTable)] = array (
$lootTable[$i] = array (
'name' => Mangos::GetNpcName($vItem['entry']),
'level'=> Mangos::GetNpcInfo($vItem['entry'], 'level'),
'map' => Mangos::GetNpcInfo($vItem['entry'], 'map')
);
$i++;
}
}
break;

break;
case 'boss':
$BossLoot = $this->wDB->select("
SELECT `entry`, `ChanceOrQuestChance`
FROM `creature_loot_template`
WHERE `item`=?", $item);
WHERE `item`=?", $item);
if(!empty($BossLoot)) {
$i = 0;
foreach($BossLoot as $bItem) {
$map_npc = Mangos::GetNpcInfo($bItem['entry'], 'map');
if(!empty($map_npc)) {
$lootTable[count($lootTable)] = array (
$lootTable[$i] = array (
'entry' => $bItem['entry'],
'name' => Mangos::GetNpcName($bItem['entry']),
'level'=> Mangos::GetNpcInfo($bItem['entry'], 'level'),
'boss' => Mangos::GetNpcInfo($bItem['entry'], 'isBoss'),
'map' => $map_npc,
'difficult' => Mangos::GetNpcInfo($bItem['entry'], 'dungeonlevel'),
'drop_percent' => Mangos::DropPercent($bItem['ChanceOrQuestChance'])
'drop_percent' => Mangos::DropPercent($bItem['ChanceOrQuestChance']),
'makro' => '1'
);
$i++;
}
}
}
break;

break;
case 'chest':
$ChestLoot = $this->wDB->select("
SELECT `entry`, `ChanceOrQuestChance`
FROM `gameobject_loot_template`
WHERE `item`=?", $item);
if(!empty($ChestLoot)) {
$i = 0;
foreach($ChestLoot as $cItem) {
$map_chest = Mangos::GameobjectInfo($cItem['entry'], 'map');
if(!empty($map_chest)) {
$lootTable[count($lootTable)] = array (
$lootTable[$i] = array (
'name' => Mangos::GameobjectInfo($cItem['entry'], 'name'),
'map' => $map_chest,
'difficult' => ' ',
'drop_percent' => Mangos::DropPercent($cItem['ChanceOrQuestChance'])
);
$i++;
}
}
}
break;

case 'quest':
break;
case 'questreward':
$QuestLoot = $this->wDB->select("
SELECT `entry`
SELECT `entry`, `MinLevel`
FROM `quest_template`
WHERE `RewChoiceItemId1` = ? OR `RewChoiceItemId2` = ? OR `RewChoiceItemId3` = ? OR
`RewChoiceItemId4` = ? OR `RewChoiceItemId5` = ? OR `RewChoiceItemId6` = ?", $item, $item, $item,
$item, $item, $item);
if(!empty($QuestLoot)) {
$i = 0;
foreach($QuestLoot as $qItem) {
$lootTable[count($lootTable)] = array (
$lootTable[$i] = array (
'title' => Mangos::QuestInfo($qItem['entry'], 'title'),
'reqlevel' => Mangos::QuestInfo($qItem['entry'], 'reqlevel'),
'reqlevel' => $qItem['MinLevel'],
'map' => Mangos::QuestInfo($qItem['entry'], 'map')
);
$i++;
}
}
break;

break;
case 'queststart':
$QuestStart = $this->wDB->selectCell("SELECT `startquest` FROM `item_template` WHERE `entry`=?", $item);
if(!$QuestStart) {
return false;
}
$lootTable[0] = array(
'title' => Mangos::QuestInfo($QuestStart, 'title'),
'reqlevel' => Mangos::QuestInfo($QuestStart, 'reqlevel'),
'map' => Mangos::QuestInfo($QuestStart, 'map')
);
break;
case 'providedfor':
$QuestInfo = $this->wDB->select("SELECT `entry`, `MinLevel` FROM `quest_template` WHERE `SrcItemId`=?", $item);
if(!$QuestInfo) {
return false;
}
$i = 0;
foreach($QuestInfo as $quest) {
$lootTable[$i] = array(
'title' => Mangos::QuestInfo($quest['entry'], 'title'),
'reqlevel' => $quest['MinLevel'],
'map' => Mangos::QuestInfo($quest['entry'], 'map')
);
}
break;
case 'objectiveof':
$QuestInfo = $this->wDB->select("
SELECT `entry`, `MinLevel`
FROM `quest_template`
WHERE `ReqItemId1`=? OR `ReqItemId2`=? OR `ReqItemId3`=?
OR `ReqItemId4`=? OR `ReqItemId5`=?", $item, $item, $item, $item, $item);
if(!$QuestInfo) {
return false;
}
$i = 0;
foreach($QuestInfo as $quest) {
$lootTable[$i] = array(
'title' => Mangos::QuestInfo($quest['entry'], 'title'),
'reqlevel' => $quest['MinLevel'],
'map' => Mangos::QuestInfo($quest['entry'], 'map')
);
}
break;
case 'item':
$ItemLoot = $this->wDB->select("
SELECT `entry`, `ChanceOrQuestChance`
FROM `item_loot_template`
WHERE `item`=?", $item);
if(!empty($ItemLoot)) {
$i = 0;
foreach($ItemLoot as $iItem) {
$lootTable[count($lootTable)] = array (
$lootTable[$i] = array (
'name' => Items::GetItemName($iItem['entry']),
'drop_percent' => Mangos::DropPercent($iItem['ChanceOrQuestChance'])
);
$i++;
}
}
break;

break;
case 'disenchant':
$DisenchantLoot = $this->wDB->select("
SELECT `item`, `ChanceOrQuestChance`, `maxcount`
FROM `disenchant_loot_template`
WHERE `entry`=?", $item);
if(!empty($DisenchantLoot)) {
$i = 0;
foreach($DisenchantLoot as $dItem) {
$lootTable[count($lootTable)] = array (
$lootTable[$i] = array (
'entry' => $dItem['item'],
'name' => $this->GetItemName($dItem['item']),
'drop_percent' => Mangos::DropPercent($dItem['ChanceOrQuestChance']),
'count' => $dItem['maxcount'],
'icon' => $this->GetItemIcon($dItem['item'])
);
$i++;
}
}
break;

break;
case 'craft':
$CraftLoot = $this->aDB->select("
SELECT `Reagent_1`, `Reagent_2`, `Reagent_3`, `Reagent_4`, `Reagent_5`, `Reagent_6`, `Reagent_7`, `Reagent_8`,
Expand Down
44 changes: 34 additions & 10 deletions includes/classes/class.mangos.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 61
* @revision 63
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -70,18 +70,26 @@ public function QuestInfo($quest, $infoType) {
$locale = (isset($_SESSION['armoryLocale'])) ? $_SESSION['armoryLocale'] : $this->armoryconfig['defaultLocale'];
switch($infoType) {
case 'title':
$nameEn = $this->wDB->selectCell("SELECT `Title` FROM `quest_template` WHERE `entry`=?", $quest);
$nameRus = $this->wDB->selectCell("SELECT `Title_loc8` FROM `locales_quest` WHERE `entry`=?", $quest);
$info = ($locale == 'ru_ru') ? $nameRus : $nameEn;
switch($locale) {
case 'en_gb':
$info = $this->wDB->selectCell("SELECT `Title` FROM `quest_template` WHERE `entry`=?", $quest);
break;
case 'ru_ru':
$info = $this->wDB->selectCell("SELECT `Title_loc8` FROM `locales_quest` WHERE `entry`=?", $quest);
if(!$info) {
$info = $this->wDB->selectCell("SELECT `Title` FROM `quest_template` WHERE `entry`=?", $quest);
}
break;
}
break;
case 'reqlevel':
$info = $this->wDB->selectCell("SELECT `MinLevel` FROM `quest_template` WHERE `entry`=?", $quest);
break;
case 'map':
$quester = $this->wDB->selectCell("SELECT `id` FROM `creature_questrelation` WHERE `quest`=?", $quest);
$quester = $this->wDB->selectCell("SELECT `id` FROM `creature_involvedrelation` WHERE `quest`=?", $quest);
$mapID = $this->wDB->selectCell("SELECT `map` FROM `creature` WHERE `id`=?", $quester);
$info = $this->aDB->selectCell("SELECT `name".$locale."` FROM `armory_maps` WHERE `id`=?", $mapID);
break;
$info = $this->aDB->selectCell("SELECT `name_".$locale."` FROM `armory_maps` WHERE `id`=?", $mapID);
break;
}
return $info;
}
Expand Down Expand Up @@ -156,6 +164,12 @@ public function GameobjectInfo($entry, $infoType) {
SELECT `name_loc8`
FROM `locales_gameobject`
WHERE `entry`=?", $entry);
if(!$info) {
$info = $this->wDB->selectCell("
SELECT `name`
FROM `gameobject_template`
WHERE `entry`=?", $entry);
}
default:
$info = $this->wDB->selectCell("
SELECT `name`
Expand Down Expand Up @@ -188,9 +202,19 @@ public function GetNPCName($npc) {
$NPCNameRU = $this->wDB->selectCell("
SELECT `name_loc8`
FROM `locales_creature`
WHERE `entry`=? LIMIT 1", $npc);
$info = ($_locale=='ru_ru') ? $NPCNameRU : $NPCName;
return $info;
WHERE `entry`=? LIMIT 1", $npc);
switch($_locale) {
case 'en_gb':
$name = $this->wDB->selectCell("SELECT `name` FROM `creature_template` WHERE `entry`=? LIMIT 1", $npc);
break;
case 'ru_ru':
$name = $this->wDB->selectCell("SELECT `name_loc8` FROM `locales_creature` WHERE `entry`=? LIMIT 1", $npc);
if(!$name) {
$name = $this->wDB->selectCell("SELECT `name` FROM `creature_template` WHERE `entry`=? LIMIT 1", $npc);
}
break;
}
return $name;
}

/**
Expand Down
7 changes: 5 additions & 2 deletions includes/locales/en_gb.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# File: en_gb.conf
# Last-modified: January 29, 2010
# Last-modified: February 6, 2010
# Author: Shadez
# Locale: English (en_GB)
# Package: World of Warcraft Armory
# File revision: 55
# File revision: 63
# Status: Release Candidate 1

# global strings
Expand Down Expand Up @@ -427,6 +427,9 @@ armory_item_info_reward_from = Reward from
armory_item_info_reward_title = Title
armory_item_info_reward_requires_level = Req level
armory_item_info_reagent_for = Reagent for
armory_item_info_startquestitem = Starts
armory_item_info_providedquestitem = Provided for
armory_item_info_objectivequestitem = Objective of

# guild-info.php
armory_guild_info_guild_roster = Guild Roster
Expand Down
Loading

0 comments on commit 215d7ab

Please sign in to comment.