DB/Emotes

* added emotes to DB .. why? just because!
  * also added to search
  * cross-linked achievements and emotes
  * data is generated via: php aowow --sql=emotes
  * setup requires GlobalStrings.lua (see README.md)
This commit is contained in:
Sarjuuk
2015-07-21 00:26:49 +02:00
parent 5239cbd293
commit 6f59afe8e6
27 changed files with 569 additions and 14 deletions

BIN
README.md

Binary file not shown.

View File

@@ -24,7 +24,9 @@ define('TYPE_CLASS', 13);
define('TYPE_RACE', 14);
define('TYPE_SKILL', 15);
define('TYPE_CURRENCY', 17);
define('TYPE_USER', 100); // internal use only
// internal types (not published to js)
define('TYPE_USER', 500);
define('TYPE_EMOTE', 501);
define('CACHE_TYPE_NONE', 0); // page will not be cached
define('CACHE_TYPE_PAGE', 1);
@@ -711,7 +713,7 @@ define('ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION', 46);
// define('ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT', 51);
define('ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS', 52);
define('ACHIEVEMENT_CRITERIA_TYPE_HK_RACE', 53);
// define('ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE', 54);
define('ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE', 54);
// define('ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE', 55);
// define('ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS', 56);
define('ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM', 57);

View File

@@ -1,6 +1,6 @@
<?php
define('AOWOW_REVISION', 8);
define('AOWOW_REVISION', 9);
define('CLI', PHP_SAPI === 'cli');

View File

@@ -0,0 +1,42 @@
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
class EmoteList extends BaseType
{
use ListviewHelper;
public static $type = TYPE_EMOTE;
public static $brickFile = 'emote';
protected $queryBase = 'SELECT *, e.id AS ARRAY_KEY FROM ?_emotes e';
public function getListviewData()
{
$data = [];
foreach ($this->iterate() as $__)
{
$data[$this->id] = array(
'id' => $this->curTpl['id'],
'name' => $this->curTpl['cmd'],
'preview' => $this->getField('self', true) ?: ($this->getField('noTarget', true) ?: $this->getField('target', true))
);
// [nyi] sounds
}
return $data;
}
public function getJSGlobals($addMask = GLOBALINFO_ANY)
{
return [];
}
public function renderTooltip() { }
}
?>

View File

@@ -29,6 +29,8 @@ switch ($pageCall)
case 'currency':
case 'currencies':
case 'compare': // tool: item comparison
case 'emote':
case 'emotes':
case 'event':
case 'events':
case 'faction':

View File

@@ -29,6 +29,8 @@ class Lang
private static $title;
private static $zone;
private static $emote;
public static function load($loc)
{
if (!file_exists('localization/locale_'.$loc.'.php'))

View File

@@ -173,6 +173,8 @@ $lang = array(
'difficulty' => "Modus",
'dispelType' => "Bannart",
'duration' => "Dauer",
'emote' => "Emote",
'emotes' => "Emotes",
'object' => "Objekt",
'objects' => "Objekte",
'glyphType' => "Glyphenart",
@@ -378,6 +380,15 @@ $lang = array(
'recoverUser' => ["Benutzernamenanfrage", "Folgt diesem Link um euch anzumelden.\r\n\r\n".HOST_URL."?account=signin&token=%s\r\n\r\nFalls Ihr diese Mail nicht angefordert habt kann sie einfach ignoriert werden."],
'resetPass' => ["Kennwortreset", "Folgt diesem Link um euer Kennwort zurückzusetzen.\r\n\r\n".HOST_URL."?account=forgotpassword&token=%s\r\n\r\nFalls Ihr diese Mail nicht angefordert habt kann sie einfach ignoriert werden."]
),
'emote' => array(
'notFound' => "Dieses Emote existiert nicht.",
'self' => "An Euch selbst",
'target' => "An Andere mit Ziel",
'noTarget' => "An Andere ohne Ziel",
'isAnimated' => "Besitzt eine Animation",
'aliases' => "Aliasse",
'noText' => "Dieses Emote besitzt keinen Text.",
),
'gameObject' => array(
'notFound' => "Dieses Objekt existiert nicht.",
'cat' => [0 => "Anderes", 9 => "Bücher", 3 => "Behälter", -5 => "Truhen", 25 => "Fischschwärme", -3 => "Kräuter", -4 => "Erzadern", -2 => "Quest", -6 => "Werkzeuge"],

View File

@@ -168,6 +168,8 @@ $lang = array(
'difficulty' => "Difficulty",
'dispelType' => "Dispel type",
'duration' => "Duration",
'emote' => "Emote",
'emotes' => "Emotes",
'object' => "object",
'objects' => "Objects",
'glyphType' => "Glyph type",
@@ -373,6 +375,15 @@ $lang = array(
'recoverUser' => ["User Recovery", "Follow this link to log in.\r\n\r\n".HOST_URL."?account=signin&token=%s\r\n\r\nIf you did not request this mail simply ignore it."],
'resetPass' => ["Password Reset", "Follow this link to reset your password.\r\n\r\n".HOST_URL."?account=forgotpassword&token=%s\r\n\r\nIf you did not request this mail simply ignore it."]
),
'emote' => array(
'notFound' => "This Emote doesn't exist.",
'self' => "To Yourself",
'target' => "To others with a target",
'noTarget' => "To others without a target",
'isAnimated' => "Uses an animation",
'aliases' => "Aliases",
'noText' => "This Emote has no text.",
),
'gameObject' => array(
'notFound' => "This object doesn't exist.",
'cat' => [0 => "Other", 9 => "Books", 3 => "Containers", -5 => "Chests", 25 => "Fishing Pools", -3 => "Herbs", -4 => "Mineral Veins", -2 => "Quest", -6 => "Tools"],

View File

@@ -173,6 +173,8 @@ $lang = array(
'difficulty' => "Dificultad",
'dispelType' => "Tipo de disipación",
'duration' => "Duración",
'emote' => "Emoción",
'emotes' => "Emociones",
'object' => "entidad",
'objects' => "Entidades",
'glyphType' => "Tipo de glifo",
@@ -379,6 +381,15 @@ $lang = array(
'recoverUser' => ["User Recovery", "Follow this link to log in.\r\n\r\n".HOST_URL."?account=signin&token=%s\r\n\r\nIf you did not request this mail simply ignore it."],
'resetPass' => ["Password Reset", "Follow this link to reset your password.\r\n\r\n".HOST_URL."?account=forgotpassword&token=%s\r\n\r\nIf you did not request this mail simply ignore it."]
),
'emote' => array(
'notFound' => "[This Emote doesn't exist.]",
'self' => "[To Yourself]",
'target' => "[To others with a target]",
'noTarget' => "[To others without a target]",
'isAnimated' => "[Uses an animation]",
'aliases' => "[Aliases]",
'noText' => "[This Emote has no text.]",
),
'gameObject' => array(
'notFound' => "Este entidad no existe.",
'cat' => [0 => "Otros", 9 => "Libros", 3 => "Contenedores", -5 => "Cofres", 25 => "Bancos de peces", -3 => "Hierbas", -4 => "Venas de minerales", -2 => "Misiones", -6 => "Herramientas"],

View File

@@ -173,6 +173,8 @@ $lang = array(
'difficulty' => "Difficulté",
'dispelType' => "Type de dissipation",
'duration' => "Durée",
'emote' => "Emote",
'emotes' => "Emotes",
'object' => "entité",
'objects' => "Entités",
'glyphType' => "Type de glyphe",
@@ -378,6 +380,15 @@ $lang = array(
'recoverUser' => ["User Recovery", "Follow this link to log in.\r\n\r\n".HOST_URL."?account=signin&token=%s\r\n\r\nIf you did not request this mail simply ignore it."],
'resetPass' => ["Password Reset", "Follow this link to reset your password.\r\n\r\n".HOST_URL."?account=forgotpassword&token=%s\r\n\r\nIf you did not request this mail simply ignore it."]
),
'emote' => array(
'notFound' => "[This Emote doesn't exist.]",
'self' => "[To Yourself]",
'target' => "[To others with a target]",
'noTarget' => "[To others without a target]",
'isAnimated' => "[Uses an animation]",
'aliases' => "[Aliases]",
'noText' => "[This Emote has no text.]",
),
'gameObject' => array(
'notFound' => "Cette entité n'existe pas.",
'cat' => [0 => "Autre", 9 => "Livres", 3 => "Conteneurs", -5 => "Coffres", 25 => "Bancs de poissons", -3 => "Herbes", -4 => "Filons de minerai", -2 => "Quêtes", -6 => "Outils"],

View File

@@ -173,6 +173,8 @@ $lang = array(
'difficulty' => "Сложность",
'dispelType' => "Тип рассеивания",
'duration' => "Длительность",
'emote' => "Эмоция",
'emotes' => "Эмоции",
'object' => "объект",
'objects' => "Объекты",
'glyphType' => "Тип символа",
@@ -378,6 +380,15 @@ $lang = array(
'recoverUser' => ["User Recovery", "Follow this link to log in.\r\n\r\n".HOST_URL."?account=signin&token=%s\r\n\r\nIf you did not request this mail simply ignore it."],
'resetPass' => ["Password Reset", "Follow this link to reset your password.\r\n\r\n".HOST_URL."?account=forgotpassword&token=%s\r\n\r\nIf you did not request this mail simply ignore it."]
),
'emote' => array(
'notFound' => "[This Emote doesn't exist.]",
'self' => "[To Yourself]",
'target' => "[To others with a target]",
'noTarget' => "[To others without a target]",
'isAnimated' => "[Uses an animation]",
'aliases' => "[Aliases]",
'noText' => "[This Emote has no text.]",
),
'gameObject' => array(
'notFound' => "Такой объект не существует.",
'cat' => [0 => "Другое", 9 => "Книги", 3 => "Контейнеры", -5 => "Сундуки", 25 => "Рыболовные лунки",-3 => "Травы", -4 => "Полезные ископаемые", -2 => "Задания", -6 => "Инструменты"],

View File

@@ -418,6 +418,13 @@ class AchievementPage extends GenericPage
'text' => $crtName,
);
break;
// link to emote
case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE:
$tmp['link'] = array(
'href' => '?emote='.$obj,
'text' => $crtName,
);
break;
default:
// Add a gold coin icon if required
$tmp['extraText'] = $displayMoney ? Util::formatMoney($qty) : $crtName;

106
pages/emote.php Normal file
View File

@@ -0,0 +1,106 @@
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
// menuId 8: Pets g_initPath()
// tabid 0: Database g_initHeader()
class EmotePage extends GenericPage
{
use DetailPage;
protected $type = TYPE_PET;
protected $typeId = 0;
protected $tpl = 'detail-page-generic';
protected $path = [0, 100];
protected $tabId = 0;
protected $mode = CACHE_TYPE_PAGE;
public function __construct($pageCall, $id)
{
parent::__construct($pageCall, $id);
$this->typeId = intVal($id);
$this->subject = new EmoteList(array(['id', $this->typeId]));
if ($this->subject->error)
$this->notFound(Util::ucFirst(Lang::game('emote')), Lang::emote('notFound'));
$this->name = Util::ucFirst($this->subject->getField('cmd'));
}
protected function generatePath() { }
protected function generateTitle()
{
array_unshift($this->title, $this->name, Util::ucFirst(Lang::game('emote')));
}
protected function generateContent()
{
/***********/
/* Infobox */
/***********/
$infobox = [];
// has Animation
if ($this->subject->getField('isAnimated'))
$infobox[] = Lang::emote('isAnimated');
/****************/
/* Main Content */
/****************/
$text = '';
if ($aliasses = DB::Aowow()->selectCol('SELECT command FROM ?_emotes_aliasses WHERE id = ?d AND locales & ?d', $this->typeId, 1 << User::$localeId))
{
$text .= '[h3]'.Lang::emote('aliases').'[/h3][ul]';
foreach ($aliasses as $a)
$text .= '[li]/'.$a.'[/li]';
$text .= '[/ul][br][br]';
}
$texts = [];
if ($_ = $this->subject->getField('self', true))
$texts[Lang::emote('self')] = $_;
if ($_ = $this->subject->getField('target', true))
$texts[Lang::emote('target')] = $_;
if ($_ = $this->subject->getField('noTarget', true))
$texts[Lang::emote('noTarget')] = $_;
if (!$texts)
$text .= '[div][i class=q0]'.Lang::emote('noText').'[/i][/div]';
else
foreach ($texts as $h => $t)
$text .= '[pad][b]'.$h.'[/b][ul][li][span class=s4]'.preg_replace('/%\d?\$?s/', '<'.Util::ucFirst(Lang::main('name')).'>', $t).'[/span][/li][/ul]';
$this->extraText = $text;
$this->infobox = '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]';
/**************/
/* Extra Tabs */
/**************/
// tab: achievement
$condition = array(
['ac.type', ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE],
['ac.value1', $this->typeId],
);
$acv = new AchievementList($condition);
$this->lvTabs[] = array(
'file' => 'achievement',
'data' => $acv->getListviewData(),
'params' => []
);
$this->extendGlobalData($acv->getJsGlobals());
}
}
?>

48
pages/emotes.php Normal file
View File

@@ -0,0 +1,48 @@
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
// menuId 8: Pets g_initPath()
// tabid 0: Database g_initHeader()
class EmotesPage extends GenericPage
{
use ListPage;
protected $type = TYPE_EMOTE;
protected $tpl = 'list-page-generic';
protected $path = [0, 100];
protected $tabId = 0;
protected $mode = CACHE_TYPE_PAGE;
public function __construct($pageCall, $pageParam)
{
parent::__construct($pageCall, $pageParam);
$this->name = Util::ucFirst(Lang::game('emotes'));
}
protected function generateContent()
{
$emotes = new EmoteList();
if (!$emotes->error)
{
$this->lvTabs[] = array(
'file' => 'emote',
'data' => $emotes->getListviewData(),
'params' => []
);
};
}
protected function generateTitle()
{
array_unshift($this->title, $this->name);
}
protected function generatePath() { }
}
?>

View File

@@ -52,6 +52,7 @@ class SearchPage extends GenericPage
['_searchProficiency'], ['_searchProfession'], ['_searchCompanion'], ['_searchMount'], ['_searchCreature'],
['_searchQuest'], ['_searchAchievement'], ['_searchStatistic'], ['_searchZone'], ['_searchObject'],
['_searchFaction'], ['_searchSkill'], ['_searchPet'], ['_searchCreatureAbility'], ['_searchSpell'],
['_searchEmote']
);
public function __construct($pageCall, $pageParam)
@@ -1409,9 +1410,30 @@ class SearchPage extends GenericPage
return $result;
}
// private function _searchCharacter($cndBase) { } // 25 Characters $searchMask & 0x2000000
// private function _searchGuild($cndBase) { } // 26 Guilds $searchMask & 0x4000000
// private function _searchArenaTeam($cndBase) { } // 27 Arena Teams $searchMask & 0x8000000
private function _searchEmote($cndBase) // 25 Emotes $searchMask & 0x2000000
{
$result = [];
$cnd = array_merge($cndBase, [$this->createLookup(['cmd', 'self_loc'.User::$localeId, 'target_loc'.User::$localeId, 'noTarget_loc'.User::$localeId])]);
$emote = new EmoteList($cnd);
if ($data = $emote->getListviewData())
{
$result = array(
'type' => TYPE_EMOTE,
'appendix' => ' (Emote)',
'matches' => $emote->getMatches(),
'file' => EmoteList::$brickFile,
'data' => $data,
'params' => []
);
}
return $result;
}
// private function _searchCharacter($cndBase) { } // 26 Characters $searchMask & 0x4000000
// private function _searchGuild($cndBase) { } // 27 Guilds $searchMask & 0x8000000
// private function _searchArenaTeam($cndBase) { } // 28 Arena Teams $searchMask & 0x10000000
}
?>

View File

@@ -518,6 +518,52 @@ CREATE TABLE `aowow_currencies` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `aowow_emotes`
--
DROP TABLE IF EXISTS `aowow_emotes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `aowow_emotes` (
`id` smallint(5) unsigned NOT NULL,
`cmd` varchar(15) NOT NULL,
`isAnimated` tinyint(1) unsigned NOT NULL,
`target_loc0` varchar(65) NULL DEFAULT NULL,
`target_loc2` varchar(70) NULL DEFAULT NULL,
`target_loc3` varchar(95) NULL DEFAULT NULL,
`target_loc6` varchar(90) NULL DEFAULT NULL,
`target_loc8` varchar(70) NULL DEFAULT NULL,
`noTarget_loc0` varchar(65) NULL DEFAULT NULL,
`noTarget_loc2` varchar(110) NULL DEFAULT NULL,
`noTarget_loc3` varchar(85) NULL DEFAULT NULL,
`noTarget_loc6` varchar(75) NULL DEFAULT NULL,
`noTarget_loc8` varchar(60) NULL DEFAULT NULL,
`self_loc0` varchar(65) NULL DEFAULT NULL,
`self_loc2` varchar(115) NULL DEFAULT NULL,
`self_loc3` varchar(85) NULL DEFAULT NULL,
`self_loc6` varchar(75) NULL DEFAULT NULL,
`self_loc8` varchar(70) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `aowow_emotes_aliasses`
--
DROP TABLE IF EXISTS `aowow_emotes_aliasses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `aowow_emotes_aliasses` (
`id` smallint(6) unsigned NOT NULL,
`locales` smallint(6) unsigned NOT NULL,
`command` varchar(15) NOT NULL,
UNIQUE INDEX `id_command` (`id`, `command`),
INDEX `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `aowow_errors`
--

View File

@@ -58,6 +58,9 @@ class DBC
'dungeonmap' => 'niiffffi',
'durabilitycosts' => 'niiiiiiiiixiiiiiiiiiiixiiiixix',
'durabilityquality' => 'nf',
'emotes' => 'nxixxxx',
'emotestext' => 'nsiixxxixixxxxxxxxx',
'emotestextdata' => 'nsxssxxsxsxxxxxxxx',
'faction' => 'nixxxxxxxxxxxxixxxiffixsxssxxsxsxxxxxxxxxxxxxxxxxxxxxxxxx',
'factiontemplate' => 'nixiiiiiiiiiii',
'gemproperties' => 'nixxi',
@@ -137,6 +140,9 @@ class DBC
'dungeonmap' => 'Id,mapId,floor,minY,maxY,minX,maxX,areaId',
'durabilitycosts' => 'Id,w0,w1,w2,w3,w4,w5,w6,w7,w8,w10,w11,w12,w13,w14,w15,w16,w17,w18,w19,w20,a1,a2,a3,a4,a6',
'durabilityquality' => 'Id,mod',
'emotes' => 'Id,animationId',
'emotestext' => 'Id,command,emoteId,targetId,noTargetId,selfId',
'emotestextdata' => 'Id,text_loc0,text_loc2,text_loc3,text_loc6,text_loc8',
'faction' => 'Id,repIdx,repFlags1,parentFaction,spilloverRateIn,spilloverRateOut,spilloverMaxRank,name_loc0,name_loc2,name_loc3,name_loc6,name_loc8',
'factiontemplate' => 'Id,factionId,ourMask,friendlyMask,hostileMask,enemyFactionId1,enemyFactionId2,enemyFactionId3,enemyFactionId4,friendFactionId1,friendFactionId2,friendFactionId3,friendFactionId4',
'gemproperties' => 'Id,enchantmentId,colorMask',

View File

@@ -45,6 +45,7 @@ class SqlGen
'races' => [null, null, null, null],
'shapeshiftforms' => [null, null, null, null],
'skillline' => [null, null, null, null],
'emotes' => [null, null, null, null],
'achievement' => [null, null, null, ['dbc_achievement']],
'creature' => [null, null, null, ['creature_template', 'locales_creature', 'creature_classlevelstats', 'instance_encounters']],
'currencies' => [null, null, null, ['item_template', 'locales_item']],

View File

@@ -0,0 +1,90 @@
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
if (!CLI)
die('not in cli mode');
$customData = array(
);
$reqDBC = ['emotes', 'emotestext', 'emotestextdata' /*, 'emotestextsound' */];
function emotes(/*array $ids = [] */)
{
$globStrPath = CLISetup::$srcDir.'%sInterface/FrameXML/GlobalStrings.lua';
$allOK = true;
$locPath = [];
foreach (CLISetup::$localeIds as $lId)
{
DB::Aowow()->query('TRUNCATE ?_emotes_aliasses');
$path = sprintf($globStrPath, Util::$localeStrings[$lId].'/');
if (CLISetup::fileExists($path))
{
$locPath[$lId] = $path;
continue;
}
// locale not found, try base mpqData
$path = sprintf($globStrPath, '');
if (CLISetup::fileExists($path))
{
$locPath[$lId] = $path;
continue;
}
CLISetup::log('GlobalStrings.lua not found for selected locale '.CLISetup::bold(Util::$localeStrings[$lId]), CLISetup::LOG_WARN);
$allOK = false;
}
DB::Aowow()->query('REPLACE INTO ?_emotes SELECT
et.Id,
LOWER(et.command),
IF(e.animationId, 1, 0),
etdT.text_loc0, etdT.text_loc2, etdT.text_loc3, etdT.text_loc6, etdT.text_loc8,
etdNT.text_loc0, etdNT.text_loc2, etdNT.text_loc3, etdNT.text_loc6, etdNT.text_loc8,
etdS.text_loc0, etdS.text_loc2, etdS.text_loc3, etdS.text_loc6, etdS.text_loc8
FROM
dbc_emotestext et
LEFT JOIN
dbc_emotes e ON e.Id = et.emoteId
LEFT JOIN
dbc_emotestextdata etdT ON etdT.Id = et.targetId
LEFT JOIN
dbc_emotestextdata etdNT ON etdNT.Id = et.noTargetId
LEFT JOIN
dbc_emotestextdata etdS ON etdS.Id = et.selfId'
);
// i have no idea, how the indexing in this file works.
// sometimes the \d+ after EMOTE is the emoteTextId, but not nearly often enough
$aliasses = [];
foreach ($locPath as $lId => $path)
foreach (file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $line)
if (preg_match('/^EMOTE(\d+)_CMD\d+\s=\s\"\/([^"]+)\";$/', $line, $m))
$aliasses[$m[1]][] = [$lId, $m[2]];
$emotes = DB::Aowow()->selectCol('SELECT id AS ARRAY_KEY, cmd FROM ?_emotes');
foreach($emotes as $eId => $cmd)
{
foreach ($aliasses as $gsId => $data)
{
if (in_array($cmd, array_column($data, 1)))
{
foreach ($data as $d)
DB::Aowow()->query('INSERT IGNORE INTO ?_emotes_aliasses VALUES (?d, ?d, ?) ON DUPLICATE KEY UPDATE locales = locales | ?d', $eId, (1 << $d[0]), strtolower($d[1]), (1 << $d[0]));
break;
}
}
}
return $allOK;
}
?>

View File

@@ -0,0 +1,31 @@
DROP TABLE IF EXISTS `aowow_emotes`;
CREATE TABLE `aowow_emotes` (
`id` SMALLINT(5) UNSIGNED NOT NULL,
`cmd` VARCHAR(15) NOT NULL,
`isAnimated` TINYINT(1) UNSIGNED NOT NULL,
`target_loc0` VARCHAR(65) NULL DEFAULT NULL,
`target_loc2` VARCHAR(70) NULL DEFAULT NULL,
`target_loc3` VARCHAR(95) NULL DEFAULT NULL,
`target_loc6` VARCHAR(90) NULL DEFAULT NULL,
`target_loc8` VARCHAR(70) NULL DEFAULT NULL,
`noTarget_loc0` VARCHAR(65) NULL DEFAULT NULL,
`noTarget_loc2` VARCHAR(110) NULL DEFAULT NULL,
`noTarget_loc3` VARCHAR(85) NULL DEFAULT NULL,
`noTarget_loc6` VARCHAR(75) NULL DEFAULT NULL,
`noTarget_loc8` VARCHAR(60) NULL DEFAULT NULL,
`self_loc0` VARCHAR(65) NULL DEFAULT NULL,
`self_loc2` VARCHAR(115) NULL DEFAULT NULL,
`self_loc3` VARCHAR(85) NULL DEFAULT NULL,
`self_loc6` VARCHAR(75) NULL DEFAULT NULL,
`self_loc8` VARCHAR(70) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `aowow_emotes_aliasses`;
CREATE TABLE `aowow_emotes_aliasses` (
`id` SMALLINT(6) UNSIGNED NOT NULL,
`locales` SMALLINT(6) UNSIGNED NOT NULL,
`command` VARCHAR(15) NOT NULL,
UNIQUE INDEX `id_command` (`id`, `command`),
INDEX `id` (`id`)
) ENGINE=MyISAM;

View File

@@ -836,6 +836,7 @@ var mn_database = [
[15,"Währungen","?currencies",mn_currencies],
[11,"Weltereignisse","?events",mn_holidays],
[1,"Zauber","?spells",mn_spells],
[100,"Emotes","?emotes",null]
];
var mn_tools = [
[0,"Talentrechner","?talent",mn_talentCalc],

View File

@@ -881,7 +881,8 @@ var mn_database = [
[1,"Spells","?spells",mn_spells],
[10,"Titles","?titles",mn_titles],
[11,"World Events","?events",mn_holidays],
[6,"Zones","?zones",mn_zones]
[6,"Zones","?zones",mn_zones],
[100,"Emotes","?emotes",null]
];
var mn_tools = [
[0,"Talent Calculator","?talent",mn_talentCalc],

View File

@@ -835,7 +835,8 @@ var mn_database = [
[1,"Hechizos","?spells",mn_spells],
[10,"Títulos","?titles",mn_titles],
[11,"Eventos del mundo","?events",mn_holidays],
[6,"Zonas","?zones",mn_zones]
[6,"Zonas","?zones",mn_zones],
[100,"Emociones","?emotes",null]
];
var mn_tools = [
[0,"Calculadora de talentos","?talent",mn_talentCalc],

View File

@@ -835,7 +835,8 @@ var mn_database = [
[1,"Sorts","?spells",mn_spells],
[10,"Titres","?titles",mn_titles],
[11,"Évènements mondiaux","?events",mn_holidays],
[6,"Zones","?zones",mn_zones]
[6,"Zones","?zones",mn_zones],
[100,"Emotes","?emotes",null]
];
var mn_tools = [
[0,"Calculateur de talents","?talent",mn_talentCalc],

View File

@@ -835,7 +835,8 @@ var mn_database = [
[1,"Заклинания","?spells",mn_spells],
[10,"Звания","?titles",mn_titles],
[11,"Игровые события","?events",mn_holidays],
[6,"Местности","?zones",mn_zones]
[6,"Местности","?zones",mn_zones],
[100,"Эмоции", "?emotes", null]
];
var mn_tools = [
[0,"Расчёт талантов","?talent",mn_talentCalc],

View File

@@ -0,0 +1,90 @@
Listview.templates.emote = {
sort: [1],
searchable: 1,
filtrable: 1,
columns: [
{
id: 'name',
name: LANG.name,
type: 'text',
align: 'left',
value: 'name',
compute: function(emote, td, tr) {
var wrapper = $WH.ce('div');
var a = $WH.ce('a');
a.style.fontFamily = 'Verdana, sans-serif';
a.href = this.getItemLink(emote);
$WH.ae(a, $WH.ct(emote.name));
$WH.ae(wrapper, a);
$WH.ae(td, wrapper);
},
sortFunc: function(a, b, col) {
return $WH.strcmp(a.name, b.name);
},
getVisibleText: function(emote) {
return emote.name;
}
},
{
id: 'preview',
name: LANG.preview,
type: 'text',
align: 'left',
value: 'name',
compute: function(emote, td, tr) {
var prev = '';
if (emote.preview) {
td.className = 's4';
prev = emote.preview.replace(/%\d?\$?s/g, '<' + LANG.name + '>');
$WH.ae(td, $WH.ct(prev));
}
else {
td.className = 'q0';
td.style.textAlign = 'right';
td.style.Align = 'right';
var
sm = $WH.ce('small'),
i = $WH.ce('i');
sm.style.paddingRight = '8px';
$WH.ae(i, $WH.ct(LANG.lvnodata));
$WH.ae(sm, i);
$WH.ae(td, sm);
}
},
sortFunc: function(a, b, col) {
return $WH.strcmp(a.preview.replace(/%\d?\$?s/g, ''), b.preview.replace(/%\d?\$?s/g, ''));
},
getVisibleText: function(emote) {
return emote.preview.replace(/%\d?\$?s/g, '');
}
}
],
getItemLink: function(emote) {
return '?emote=' + emote.id;
}
}
new Listview({
template:'emote',
<?php
echo !isset($params['id']) ? "id:'emote'," : null;
echo !isset($params['name']) ? "name:'".Util::ucFirst(Lang::game('emotes'))."'," : null;
echo !isset($params['parent']) ? "parent:'lv-generic'," : null;
foreach ($params as $k => $v):
if ($v[0] == '$'):
echo $k.':'.substr($v, 1).',';
elseif ($v):
echo $k.":'".$v."',";
endif;
endforeach;
?>
data:<?php echo json_encode(array_values($data), JSON_NUMERIC_CHECK); ?>
});

View File

@@ -174,7 +174,7 @@ if ($g = $this->gains):
echo " <ul>\n";
if (!empty($g['xp'])):
echo ' <li><div>'.number_format($g['xp']).' '.Lang::quest('experience')."</div></li>\n";
echo ' <li><div>'.Lang::nf($g['xp']).' '.Lang::quest('experience')."</div></li>\n";
endif;
if (!empty($g['rep'])):