From Dark and Darker Wiki

m (testing 2)
m (testing again)
Line 32: Line 32:
record = record .. "<td>" .. (achievement.sub_category or '') .. "</td>\n"
record = record .. "<td>" .. (achievement.sub_category or '') .. "</td>\n"
record = record .. "<td>" .. (achievement.prerequisite or '') .. "</td>\n"
record = record .. "<td>" .. (achievement.prerequisite or '') .. "</td>\n"
record = record .. "<td>" .. (achievement.description) .. is_hidden .. "</td>\n"
record = record .. "<td>" .. (achievement.description) .. tostring(is_hidden) .. "</td>\n"
record = record .. "</tr>\n"
record = record .. "</tr>\n"

Revision as of 04:30, 22 December 2024

Overview

Functions for Data:Achievements.json

Functions

create_achievements_table_body

Creates the body of a html function with 6 pre-set columns

Parameters

  • hidden_or_nonhidden - defaults to nonhidden - must be hidden or nonhidden - Displays only hidden or nonhidden achievements

Examples

Ensure to surround it by html table and its headers:

<table class="wikitable sortable">
<tr>
    <th>Name</th>
    <th>Icon</th>
    <th>Category</th>
    <th>Sub-Category</th>
    <th>Pre-requisite</th>
    <th>Description</th>
</tr>
{{#invoke:Achievements|create_achievements_table_body}}
</table>

Name Icon Category Sub-Category Pre-requisite Description
Crawl Into Darkness Icon Achievement Level.png Classes Reach level 5 on any character.false
Dungeon Delver Icon Achievement Level.png Classes Crawl Into Darkness Reach level 10 on any character.false
Journeyman Explorer Icon Achievement Level.png Classes Dungeon Delver Reach level 20 on any character.false
Veteran Adventurer Icon Achievement Level.png Classes Journeyman Explorer Reach level 50 on any character.false
Herald of the Depths Icon Achievement Level.png Classes Veteran Adventurer Reach level 100 on any character.false
Warden of the Damned Icon Achievement Level.png Classes Herald of the Depths Reach level 200 on any character.false
Crown of Despair Icon Achievement Level.png Classes Warden of the Damned Reach level 300 on any character.false
Fully Equipped Icon Achievement SetPerks.png Classes Fill every perk slot.false
Fighter Initiate Icon Achievement Fighter.png Classes Fighter Reach level 20 as a Fighter.false
Sword for Hire Icon Achievement Fighter.png Classes Fighter Fighter Initiate Reach level 100 as a Fighter.false
Weapon Master Icon Achievement Fighter.png Classes Fighter Sword for Hire Reach level 200 as a Fighter.false
Champion of Arms Icon Achievement Fighter.png Classes Fighter Weapon Master Reach level 300 as a Fighter.false
Barbarian Whelp Icon Achievement Barbarian.png Classes Barbarian Reach level 20 as a Barbarian.false
Barbarian Brute Icon Achievement Barbarian.png Classes Barbarian Barbarian Whelp Reach level 100 as a Barbarian.false
Savage Barbarian Icon Achievement Barbarian.png Classes Barbarian Barbarian Brute Reach level 200 as a Barbarian.false
Barbarian Chieftain Icon Achievement Barbarian.png Classes Barbarian Savage Barbarian Reach level 300 as a Barbarian.false
Novice Rogue Icon Achievement Rogue.png Classes Rogue Reach level 20 as a Rogue.false
Seasoned Rogue Icon Achievement Rogue.png Classes Rogue Novice Rogue Reach level 100 as a Rogue.false
Veteran of Deception Icon Achievement Rogue.png Classes Rogue Seasoned Rogue Reach level 200 as a Rogue.false
Master Thief Icon Achievement Rogue.png Classes Rogue Veteran of Deception Reach level 300 as a Rogue.false
Apprentice Ranger Icon Achievement Ranger.png Classes Ranger Reach level 20 as a Ranger.false
Bow Bearer Icon Achievement Ranger.png Classes Ranger Apprentice Ranger Reach level 100 as a Ranger.false
Veteran Hunter Icon Achievement Ranger.png Classes Ranger Bow Bearer Reach level 200 as a Ranger.false
Eagle Eye Icon Achievement Ranger.png Classes Ranger Veteran Hunter Reach level 300 as a Ranger.false
Novice Spellcaster Icon Achievement Wizard.png Classes Wizard Reach level 20 as a Wizard.false
Adept Mystic Icon Achievement Wizard.png Classes Wizard Novice Spellcaster Reach level 100 as a Wizard.false
Archmage Icon Achievement Wizard.png Classes Wizard Adept Mystic Reach level 200 as a Wizard.false
Master Magus Icon Achievement Wizard.png Classes Wizard Archmage Reach level 300 as a Wizard.false
Acolyte of Light Icon Achievement Cleric.png Classes Cleric Reach level 20 as a Cleric.false
Adept Clinician Icon Achievement Cleric.png Classes Cleric Acolyte of Light Reach level 100 as a Cleric.false
Archpriest Icon Achievement Cleric.png Classes Cleric Adept Clinician Reach level 200 as a Cleric.false
Divine Crusader Icon Achievement Cleric.png Classes Cleric Archpriest Reach level 300 as a Cleric.false
Minstrel of Melody Icon Achievement Bard.png Classes Bard Reach level 20 as a Bard.false
Adept Troubadour Icon Achievement Bard.png Classes Bard Minstrel of Melody Reach level 100 as a Bard.false
Songweaver Icon Achievement Bard.png Classes Bard Adept Troubadour Reach level 200 as a Bard.false
Balladeer Maestro Icon Achievement Bard.png Classes Bard Songweaver Reach level 300 as a Bard.false
Coven Initiate Icon Achievement Warlock.png Classes Warlock Reach level 20 as a Warlock.false
Conduit of Blood Icon Achievement Warlock.png Classes Warlock Coven Initiate Reach level 100 as a Warlock.false
Dark Disciple Icon Achievement Warlock.png Classes Warlock Conduit of Blood Reach level 200 as a Warlock.false
Elder of the Pact Icon Achievement Warlock.png Classes Warlock Dark Disciple Reach level 300 as a Warlock.false
Keeper of Sprouts Icon Achievement Druid.png Classes Druid Reach level 20 as a Druid.false
Adept Shapeshifter Icon Achievement Druid.png Classes Druid Keeper of Sprouts Reach level 100 as a Druid.false
Nature's Emissary Icon Achievement Druid.png Classes Druid Adept Shapeshifter Reach level 200 as a Druid.false
Avatar of the Grove Icon Achievement Druid.png Classes Druid Nature's Emissary Reach level 300 as a Druid.false
Sorcerer's Apprentice Icon Achievement Sorcerer.png Classes Sorcerer Reach level 20 as a Sorcerer.false
Master Caster Icon Achievement Sorcerer.png Classes Sorcerer Sorcerer's Apprentice Reach level 100 as a Sorcerer.false
Power Overwhelming Icon Achievement Sorcerer.png Classes Sorcerer Master Caster Reach level 200 as a Sorcerer.false
Sorcerer Supreme Icon Achievement Sorcerer.png Classes Sorcerer Power Overwhelming Reach level 300 as a Sorcerer.false
Light at the End Icon Achievement Escape.png Dungeon Escape Successfully escape for the first time.false
Run It Back Icon Achievement Escape.png Dungeon Escape Light at the End Successfully escape twice.false
The Quick and the Dead Icon Achievement Escape.png Dungeon Escape Run It Back Successfully escape 10 times.false
Edge of Escape Icon Achievement Escape.png Dungeon Escape The Quick and the Dead Successfully escape 100 times.false
Painted in Red Icon Achievement EliteMonster.png Dungeon Monster Kill any Elite monster.false
The Nightmare Ends Icon Achievement NightmareMonster.png Dungeon Monster Kill any Nightmare monster.false
Crowned with Ash Icon Achievement BossMonster.png Dungeon Monster Kill any Boss monster.false
Court Wizard's Demise Icon Achievement Lich.png Dungeon Monster Kill the Lich.false
Banished Beyond Icon Achievement GhostKing.png Dungeon Monster Kill the Ghost King.false
Breaker of Bone Thrones Icon Achievement SkeletonWarload.png Dungeon Monster Kill the Skeleton Warlord.false
The Bigger They Are, The Harder They Fall Icon Achievement Troll.png Dungeon Monster Kill the Cave Troll.false
Eye for an Eye Icon Achievement Cyclops.png Dungeon Monster Kill the Cyclops.false
Cold Case Closed Icon Achievement Wyvern.png Dungeon Monster Kill the Frost Wyvern.false
Silence the Specter Icon Achievement SpectralKnight.png Dungeon Monster Kill the Spectral Knight.false
She Screams No More Icon Achievement Banshee.png Dungeon Monster Kill the Banshee.false
Undead Slayer Icon Achievement UndeadSlayer.png Dungeon Monster Kill 1000 undead enemies.false
Demon Slayer Icon Achievement DemonSlayer.png Dungeon Monster Kill 1000 demonic enemies.false
Beast Slayer Icon Achievement BeastSlayer.png Dungeon Monster Kill 1000 beast-type enemies.false
Insect Slayer Icon Achievement InsectSlayer.png Dungeon Monster Kill 1000 insectoid enemies.false
Goblin Slayer Icon Achievement GoblinSlayer.png Dungeon Monster Kill 1000 goblins.false
Kobold Slayer Icon Achievement KoboldSlayer.png Dungeon Monster Kill 1000 kobolds.false
Giant Slayer Icon Achievement GiantSlayer.png Dungeon Monster Kill 1000 giants.false
A Quick Fix Icon Achievement Bandage.png Dungeon Consumable Use 10 Bandages.false
Field Medic Icon Achievement Bandage.png Dungeon Consumable A Quick Fix Use 50 Bandages.false
Master of Mending Icon Achievement Bandage.png Dungeon Consumable Field Medic Use 100 Bandages.false
First Sip Icon Achievement Potion.png Dungeon Consumable Use 10 Potions of Healing.false
Potion Lover Icon Achievement Potion.png Dungeon Consumable First Sip Use 50 Potions of Healing.false
Elixir Addict Icon Achievement Potion.png Dungeon Consumable Potion Lover Use 100 Potions of Healing.false
Steady Hand Icon Achievement SurgicalKit.png Dungeon Consumable Use 10 Surgical Kits.false
Trauma Technician Icon Achievement SurgicalKit.png Dungeon Consumable Steady Hand Use 100 Surgical Kits.false
Sparks of Survival Icon Achievement Campfire.png Dungeon Consumable Use 10 Campfire Kits.false
Fire Starter Icon Achievement Campfire.png Dungeon Consumable Sparks of Survival Use 100 Campfire Kits.false
The First Cut Icon Achievement KillPlayer.png Dungeon Challenge Kill an enemy player for the first time.false
Keeper of the Eternal's Fall Icon Achievement LichHR.png High-Roller Monster Kill the Lich in High-Roller.false
Kingbreaker Icon Achievement GhostKingHR.png High-Roller Monster Kill the Ghost King in High-Roller.false
Deliverer of Judgment Icon Achievement SkeletonWarloadHR.png High-Roller Monster Kill the Skeleton Warlord in High-Roller.false
Crusher of the Colossus Icon Achievement TrollHR.png High-Roller Monster Kill the Cave Troll in High-Roller.false
Bringer of Blindness Icon Achievement CyclopsHR.png High-Roller Monster Kill the Cyclops in High-Roller.false
Cold-Blooded Killer Icon Achievement WyvernHR.png High-Roller Monster Kill the Frost Wyvern in High-Roller.false
Chivalry Shattered Icon Achievement SpectralKnightHR.png High-Roller Monster Kill the Spectral Knight in High-Roller.false
The Last Wail Icon Achievement BansheeHR.png High-Roller Monster Kill the Banshee in High-Roller.false
Gravebound No More Icon Achievement RankNeophyte.png High-Roller High-Roller Rank Reach the Neophyte rank in High-Roller.false
Apprentice of the Abyss Icon Achievement RankApprentice.png High-Roller High-Roller Rank Reach the Apprentice rank in High-Roller.false
A Curious Wanderer Icon Achievement RankWanderer.png High-Roller High-Roller Rank Reach the Wanderer rank in High-Roller.false
Trailblazer Icon Achievement RankPathfinder.png High-Roller High-Roller Rank Reach the Pathfinder rank in High-Roller.false
Herald of Paths Icon Achievement RankVoyager.png High-Roller High-Roller Rank Reach the Voyager rank in High-Roller.false
Paragon of Excellence Icon Achievement RankExemplar.png High-Roller High-Roller Rank Reach the Exemplar rank in High-Roller.false
Mortal No More Icon Achievement RankDemigod.png High-Roller High-Roller Rank Reach the Demigod rank in High-Roller.false
First Blood Icon Achievement WinningArena.png Arena Win an Arena match for the first time.false
Rising Challenger Icon Achievement WinningArena.png Arena First Blood Win an Arena match 10 times.false
Bloodstained Champion Icon Achievement WinningArena.png Arena Rising Challenger Win an Arena match 50 times.false
Legend of the Arena Icon Achievement WinningArena.png Arena Bloodstained Champion Win an Arena match 100 times.false
Lucky Streak Icon Achievement ConsecutiveArena.png Arena Win in the Arena 2 times consecutively.false
You're on Fire Icon Achievement ConsecutiveArena.png Arena Lucky Streak Win in the Arena 5 times consecutively.false
Unstoppable Icon Achievement ConsecutiveArena.png Arena You're on Fire Win in the Arena 10 times consecutively.false
Relentless Executioner Icon Achievement ConsecutiveArena.png Arena Unstoppable Win in the Arena 20 times consecutively.false
Fresh Meat Icon Achievement ArenaRankTiro.png Arena Arena Rank Reach the Tiro rank in Arena.false
Pit Scrapper Icon Achievement ArenaRankScrapper.png Arena Arena Rank Reach the Scrapper rank in Arena.false
Gladiator Icon Achievement ArenaRankGladiator.png Arena Arena Rank Reach the Gladiator rank in Arena.false
Veteran of the Pit Icon Achievement ArenaRankVeteran.png Arena Arena Rank Reach the Veteran rank in Arena.false
Contending Challenger Icon Achievement ArenaRankContender.png Arena Arena Rank Reach the Contender rank in Arena.false
The Crimson Vanquisher Icon Achievement ArenaRankVanquisher.png Arena Arena Rank Reach the Vanquisher rank in Arena.false
Rise of the Warlord Icon Achievement ArenaRankWarload.png Arena Arena Rank Reach the Warlords rank in Arena.false
It's a Start... Icon Achievement EquipItemGrade.png Item Gear Equip Uncommon grade items or higher in your main slots.false
Fit Check Icon Achievement EquipItemGrade.png Item Gear Equip Rare grade items or higher in your main slots.false
Nice Threads Icon Achievement EquipItemGrade.png Item Gear Equip Epic grade items or higher in your main slots.false
Flawless Drip Icon Achievement EquipItemGrade.png Item Gear Equip Legendary grade items or higher in your main slots.false
Dagger Wielder Icon Achievement KillDagger.png Item Gear Kill 100 enemies with a Dagger type weapon.false
Dagger Expert Icon Achievement KillDagger.png Item Gear Dagger Wielder Kill 500 enemies with a Dagger type weapon.false
Bloodletter Icon Achievement KillDagger.png Item Gear Dagger Expert Kill 1000 enemies with a Dagger type weapon.false
Sword Wielder Icon Achievement KillSword.png Item Gear Kill 100 enemies with a Sword type weapon.false
Sword Expert Icon Achievement KillSword.png Item Gear Sword Wielder Kill 500 enemies with a Sword type weapon.false
Blade of Woe Icon Achievement KillSword.png Item Gear Sword Expert Kill 1000 enemies with a Sword type weapon.false
Axe Wielder Icon Achievement KillAxe.png Item Gear Kill 100 enemies with a Axe type weapon.false
Axe Expert Icon Achievement KillAxe.png Item Gear Axe Wielder Kill 500 enemies with a Axe type weapon.false
Bone Cutter Icon Achievement KillAxe.png Item Gear Axe Expert Kill 1000 enemies with a Axe type weapon.false
Mace Wielder Icon Achievement KillMace.png Item Gear Kill 100 enemies with a Mace type weapon.false
Mace Expert Icon Achievement KillMace.png Item Gear Mace Wielder Kill 500 enemies with a Mace type weapon.false
Deliverer of Justice Icon Achievement KillMace.png Item Gear Mace Expert Kill 1000 enemies with a Mace type weapon.false
Polearm Wielder Icon Achievement KillPolearm.png Item Gear Kill 100 enemies with a Polearm type weapon.false
Polearm Expert Icon Achievement KillPolearm.png Item Gear Polearm Wielder Kill 500 enemies with a Polearm type weapon.false
Spear of Judgment Icon Achievement KillPolearm.png Item Gear Polearm Expert Kill 1000 enemies with a Polearm type weapon.false
Staff Wielder Icon Achievement KillStaff.png Item Gear Kill 100 enemies with a Staff type weapon.false
Staff Expert Icon Achievement KillStaff.png Item Gear Staff Wielder Kill 500 enemies with a Staff type weapon.false
Arcane Arbiter Icon Achievement KillStaff.png Item Gear Staff Expert Kill 1000 enemies with a Staff type weapon.false
Bow Wielder Icon Achievement KillBow.png Item Gear Kill 100 enemies with a Bow type weapon.false
Bow Expert Icon Achievement KillBow.png Item Gear Bow Wielder Kill 500 enemies with a Bow type weapon.false
Deadeye Icon Achievement KillBow.png Item Gear Bow Expert Kill 1000 enemies with a Bow type weapon.false
Crossbow Wielder Icon Achievement KillCrossbow.png Item Gear Kill 100 enemies with a Crossbow type weapon.false
Crossbow Expert Icon Achievement KillCrossbow.png Item Gear Crossbow Wielder Kill 500 enemies with a Crossbow type weapon.false
Trigger Finger Icon Achievement KillCrossbow.png Item Gear Crossbow Expert Kill 1000 enemies with a Crossbow type weapon.false
Coin Snatcher Icon Achievement LootedCoins.png Item Loot Collect 100 Gold Coins in the Dungeon.false
Gold Hoarder Icon Achievement LootedCoins.png Item Loot Coin Snatcher Collect 1000 Gold Coins in the Dungeon.false
Wealth Enthusiast Icon Achievement LootedCoins.png Item Loot Gold Hoarder Collect 10000 Gold Coins in the Dungeon.false
Plunderer Icon Achievement InteractHoard.png Item Loot Interact with a treasure hoard.false
Prospect Miner Icon Achievement Mining.png Item Loot Succeed in mining 10 times.false
King of the Quarry Icon Achievement Mining.png Item Loot Prospect Miner Succeed in mining 100 times.false
Gold Digger Icon Achievement GoldOre.png Item Loot Succeed mining for Gold Ore.false
Lobster Bait Icon Achievement RubysilverOre.png Item Loot Succeed mining for Rubysilver Ore.false
Iced Out Icon Achievement FroststoneOre.png Item Loot Succeed mining for Froststone Ore.false
Epic Spoils Icon Achievement LootedItemGrade.png Item Loot Collect Epic grade items of Looted state.false
Legendary Bounty Icon Achievement LootedItemGrade.png Item Loot Collect Legendary grade items of Looted state.false
Uniquely Yours Icon Achievement LootedItemGrade.png Item Loot Collect Unique grade items of Looted state.false
A Barrel of Stories Icon Achievement QuestComplete.png Quest Complete all of the Tavern Master's quests offered during the Season.false
The Fortune's End Icon Achievement QuestComplete.png Quest Complete all of the Treasurer's quests offered during the Season.false
Connoisseur of Curiosities Icon Achievement QuestComplete.png Quest Complete all of the Collector's quests offered during the Season.false
Gobbo's Favorite Fleshy Icon Achievement QuestCompleteGoblin.png Quest Complete all of the Goblin Merchant's quests offered during the Season.false
The Old Man's Determination Icon Achievement QuestComplete.png Quest Complete all of the Leathersmith's quests offered during the Season.false
Lifelong Regrets Icon Achievement QuestComplete.png Quest Complete all of the Armourer's quests offered during the Season.false
Fabric of Trust Icon Achievement QuestComplete.png Quest Complete all of the Tailor's quests offered during the Season.false
A Friend of the Forge Icon Achievement QuestComplete.png Quest Complete all of the Weaponsmith's quests offered during the Season.false
Bonding Roots Icon Achievement QuestComplete.png Quest Complete all of the Woodsman's quests offered during the Season.false
A Younger Brother's Tale Icon Achievement QuestComplete.png Quest Complete all of the Surgeon's quests offered during the Season.false
An Older Brother's Tale Icon Achievement QuestComplete.png Quest Complete all of the Alchemist's quests offered during the Season.false
Seeker of Secrets Icon Achievement QuestComplete.png Quest Complete all of the Fortune Teller's quests offered during the Season.false
Friends in High Places Icon Achievement FriendlyAffinity.png Merchant Raise the affinity of any merchant to "Friendly" grade or higher.false
Crafting Initiate Icon Achievement Crafting.png Merchant Successfully craft your first item.false
Crafting Virtuoso Icon Achievement Crafting.png Merchant Crafting Initiate Successfully craft 10 times.false
Stackin' Up Icon Achievement GoldCoinPouch.png Merchant Craft a Gold Coin Pouch.false
Bag It Up Icon Achievement GoldCoinBag.png Merchant Craft a Gold Coin Bag.false
Not Today Icon Achievement AltarOfSacrifice.png Community Use the Altar of Sacrifice for the first time.false
Devote your hearts! Icon Achievement AltarOfSacrifice.png Community Not Today Use the Altar of Sacrifice 10 times.false
The Eternal Reviver Icon Achievement AltarOfSacrifice.png Community Devote your hearts! Use the Altar of Sacrifice 100 times.false
Cane Collector Icon Achievement CollectCandyCane.png Event Winter Holiday Collect 10 Candy Canes of Looted state.false
King of Canes Icon Achievement CollectCandyCane.png Event Winter Holiday Cane Collector Collect 100 Candy Canes of Looted state.false
The Forbidden Pear Icon Achievement HoneyblissPear.png Feat Collect a Honeybliss Pear of Looted state.false
Baked for the Taking Icon Achievement ChocolateChipMuffin.png Feat Collect a Chocolate Chip Muffin of Looted state.false
Beginning of the End Icon Achievement MidnightStag.png Feat Kill the Midnight Stag.false




Example of hidden achievements only

<table class="wikitable mw-collapsible mw-collapsed">
<tr>
    <th>Name</th>
    <th>Icon</th>
    <th>Category</th>
    <th>Sub-Category</th>
    <th>Pre-requisite</th>
    <th>Description</th>
</tr>
{{#invoke:Achievements|create_achievements_table_body|hidden}}
</table>

Name Icon Category Sub-Category Pre-requisite Description

local p = {}
local achievements = mw.loadJsonData("Data:Achievements.json")

function p.create_achievements_table_body(frame)
	local hidden_or_nonhidden = frame.args[1]
	if hidden_or_nonhidden == nil then 
		hidden_or_nonhidden = "nonhidden"
	elseif hidden_or_nonhidden ~= "nonhidden" then
		hidden_or_nonhidden = "hidden"
	end
	
	local html = ""
	local record
	
	for index, achievement in ipairs(achievements) do
		-- Ensure only the hidden or nonhidden are shown depending on parameter
		local is_hidden
		if achievement.hidden == 'true' then
			is_hidden = true
		else
			is_hidden = false
		end
		if (is_hidden and hidden_or_nonhidden == "nonhidden") or 
			(not is_hidden and hidden_or_nonhidden == "hidden") then
			break
		end
		
		record = "<tr>\n"
		record = record .. "<td>" .. (achievement.localized_name) .. "</td>\n"
		record = record .. "<td>" .. "[[File:" .. achievement.icon .. ".png|45px]]"  .. "</td>\n"
		record = record .. "<td>" .. (achievement.main_category or '') .. "</td>\n"
		record = record .. "<td>" .. (achievement.sub_category or '') .. "</td>\n"
		record = record .. "<td>" .. (achievement.prerequisite or '') .. "</td>\n"
		record = record .. "<td>" .. (achievement.description) .. tostring(is_hidden) .. "</td>\n"
		record = record .. "</tr>\n"
		
		html = html .. record .. "\n"
	end
	
	return mw.getCurrentFrame():preprocess(html)
end

return p