mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Compare commits
2 Commits
b764200c2a
...
10ef33f709
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10ef33f709 | ||
|
|
ae1b6c59b1 |
@@ -318,6 +318,7 @@ class NpcBaseResponse extends TemplateResponse implements ICache
|
||||
// tab: abilities / tab_controlledabilities (dep: VehicleId)
|
||||
$tplSpells = [];
|
||||
$genSpells = [];
|
||||
$spellClick = [];
|
||||
$conditions = ['OR'];
|
||||
|
||||
for ($i = 1; $i < 9; $i++)
|
||||
@@ -339,6 +340,12 @@ class NpcBaseResponse extends TemplateResponse implements ICache
|
||||
if ($genSpells)
|
||||
$conditions[] = ['id', $genSpells];
|
||||
|
||||
if ($spellClick = DB::World()->select('SELECT `spell_id` AS ARRAY_KEY, `cast_flags` AS "0", `user_type` AS "1" FROM npc_spellclick_spells WHERE `npc_entry` = ?d', $this->typeId))
|
||||
{
|
||||
$genSpells = array_merge($genSpells, array_keys($spellClick));
|
||||
$conditions[] = ['id', array_keys($spellClick)];
|
||||
}
|
||||
|
||||
// Pet-Abilities
|
||||
if (($_typeFlags & NPC_TYPEFLAG_TAMEABLE) && ($_ = $this->subject->getField('family')))
|
||||
{
|
||||
@@ -376,6 +383,9 @@ class NpcBaseResponse extends TemplateResponse implements ICache
|
||||
|
||||
foreach ($controled as $id => $values)
|
||||
{
|
||||
if (isset($spellClick[$id]))
|
||||
$values['spellclick'] = $spellClick[$id];
|
||||
|
||||
if (in_array($id, $genSpells))
|
||||
{
|
||||
$normal[$id] = $values;
|
||||
|
||||
@@ -1304,7 +1304,7 @@ class QuestBaseResponse extends TemplateResponse implements ICache
|
||||
['reqQ', array('OR', ['AND', ['nextQuestId', $this->typeId], ['exclusiveGroup', 0, '<']], ['AND', ['id', $this->subject->getField('prevQuestId')], ['nextQuestIdChain', $this->typeId, '!']])],
|
||||
|
||||
// Requires one of these quests (Requires one of the quests to choose from)
|
||||
['reqOneQ', array('OR', ['AND', ['exclusiveGroup', 0, '>'], ['nextQuestId', $this->typeId]], ['breadCrumbForQuestId', $this->typeId])],
|
||||
['reqOneQ', array('OR', ['AND', ['exclusiveGroup', 0, '>='], ['nextQuestId', $this->typeId]], ['breadCrumbForQuestId', $this->typeId])],
|
||||
|
||||
// Opens Quests (Quests that become available only after complete this quest (optionally only one))
|
||||
['opensQ', array('OR', ['AND', ['prevQuestId', $this->typeId], ['id', $this->subject->getField('nextQuestIdChain'), '!']], ['id', $this->subject->getField('nextQuestId')], ['id', $this->subject->getField('breadcrumbForQuestId')])],
|
||||
|
||||
@@ -835,6 +835,9 @@ class SpellBaseResponse extends TemplateResponse implements ICache
|
||||
if ($auras = DB::World()->selectCol('SELECT `entry` FROM creature_template_addon WHERE `auras` REGEXP ?', '\\b'.$this->typeId.'\\b'))
|
||||
$conditions[] = ['id', $auras];
|
||||
|
||||
if ($spellClick = DB::World()->selectCol('SELECT `npc_entry` FROM npc_spellclick_spells WHERE `spell_id` = ?d', $this->typeId))
|
||||
$conditions[] = ['id', $spellClick];
|
||||
|
||||
$ubCreature = new CreatureList($conditions);
|
||||
if (!$ubCreature->error)
|
||||
{
|
||||
|
||||
2
setup/sql/updates/1763760598_01.sql
Normal file
2
setup/sql/updates/1763760598_01.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' globaljs');
|
||||
UPDATE `aowow_dbversion` SET `sql` = CONCAT(IFNULL(`sql`, ''), ' spell');
|
||||
@@ -2635,6 +2635,30 @@ Listview.templates = {
|
||||
}
|
||||
$WH.ae(wrapper, d);
|
||||
}
|
||||
else if (spell.spellclick) {
|
||||
td.style.position = 'relative';
|
||||
|
||||
[flags, who] = spell.spellclick;
|
||||
|
||||
let buff = 'onClick';
|
||||
if (who == 1) // Friendly
|
||||
buff += $WH.sprintf(LANG.qty, g_reputation_standings[4]);
|
||||
else if (who == 2) // Raid
|
||||
buff += $WH.sprintf(LANG.qty, g_quest_types[62]);
|
||||
else if (who == 3) // Party
|
||||
buff += $WH.sprintf(LANG.qty, g_quest_types[1]);
|
||||
|
||||
buff += LANG.colon + '<span class="breadcrumb-arrow">' + (flags & 0x1 ? g_world_object_types[4] : g_pageInfo.name) + '</span>';
|
||||
buff += flags & 0x2 ? g_world_object_types[4] : g_pageInfo.name;
|
||||
|
||||
$(td).append($('<div>', {class: 'small'})
|
||||
.css('fontStyle', 'italic')
|
||||
.css('position', 'absolute')
|
||||
.css('right', '3px')
|
||||
.css('bottom', '3px')
|
||||
.html(buff)
|
||||
);
|
||||
}
|
||||
$WH.ae(td, wrapper);
|
||||
},
|
||||
getVisibleText: function(spell) {
|
||||
|
||||
@@ -600,7 +600,8 @@ CLISetup::registerSetup("sql", new class extends SetupScript
|
||||
// npc spells (-8) (run as last! .. missing from npc_scripts? "enum Spells { \s+(\w\d_)+\s+=\s(\d+) }" and "#define SPELL_(\d\w_)+\s+(\d+)") // RAID_MODE(1, 2[, 3, 4]) - macro still not considered
|
||||
$world = DB::World()->selectCol(
|
||||
'SELECT ss.`action_param1` FROM smart_scripts ss WHERE ss.`action_type` IN (?a) UNION
|
||||
SELECT cts.`Spell` FROM creature_template_spell cts',
|
||||
SELECT cts.`Spell` FROM creature_template_spell cts UNION
|
||||
SELECT nscs.`spell_id` FROM npc_spellclick_spells nscs',
|
||||
[SmartAction::ACTION_CAST, SmartAction::ACTION_ADD_AURA, SmartAction::ACTION_SELF_CAST, SmartAction::ACTION_CROSS_CAST]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user