Module:ReceptionData

From Library of Ruina Wiki
Jump to navigation Jump to search

Module documentation: Module:ReceptionData/doc
Data stored in Module:ReceptionData/Data
Pages using this module

Stores Reception data.


Functions

getInvite

Outputs a reception's invitation recipe. Example Usage:

{{#invoke:ReceptionData|getInvite|Liu Association Section 1}}

LiuAssociationIcon.png Book of Lowell
LiuAssociationIcon.png Book of Cecil
LiuAssociationIcon.png Book of Mei


guestsSection

Outputs a tabber with reception information. To change the data displayed, edit the appropriate module or template Example Usage:

{{#invoke:ReceptionData|guestsSection|Liu Association Section 1}}

outputs:

Guests

Formation

Act 1

  • Liu S. Section 1 Fixer ×5

Act 2

  • Xiao ×1
  • Miris ×1
  • Chun ×1
  • Liu S. Section 1 Fixer ×2

Liu S. Section 1 Fixer
Stats
Liu1Fixer.png
HPIcon.png 99 StaggerIcon.png 49 SpeedIcon.png 2~6
SlashNormalIcon.png Normal

PierceNormalIcon.png Normal
BluntNormalIcon.png Normal

SlashStgNormalIcon.png Normal

PierceStgNormalIcon.png Normal
BluntStgNormalIcon.png Normal

Passive Abilities
SkillPurpleIcon.png Speed
Speed Dice Slot +1 (Cannot Overlap)
SkillBlueIcon.png Fervor
Offensive dice gain +1 Power at Emotion Level 3 or above
SkillPurpleIcon.png Singular Strike
When using a Combat Page with one non-Counter die, the die gains +2 Power, and it yields twice as many Emotion Points in a clash.
Drops
Book of Liu Association Section 1 100% 100% 100% 100% 100% 100%
Count 1.4 2 2.6 3 3.5 4.2
Combat Bookshelf
[Switch to Table/Grid]
CardEmotionalTurbulenceArt.png
Emotional Turbulence
CardFrontalAssaultArt.png
Frontal Assault
CardSingle-PointStabArt.png
Single-Point Stab ×3
CardBurningFlashArt.png
Burning Flash ×3





Deck
Page Cost Description
CardEmotionalTurbulenceArt.png
Emotional Turbulence
3 MeleeIcon.png On Use All dice on this page gain +1 Power for every 2 Emotion Levels
BlockDiceIcon.png 4~8 
PierceDiceIcon.png 5~9  On Hit Inflict 2 Burn
SlashDiceIcon.png 4~9  On Hit Inflict 1 Burn
BlockCounterDiceIcon.png 3~7 
CardFrontalAssaultArt.png
Frontal Assault
0 MeleeIcon.png On Use Restore 1 Light
PierceDiceIcon.png 2~7 
PierceDiceIcon.png 1~2 
CardSingle-PointStabArt.png
Single-Point Stab
(3 Copies)
0 MeleeIcon.png On Use At the start of the next Scene, draw all copies of ’Single-Point Stab’ from the deck
PierceDiceIcon.png 3~9  On Hit Inflict 1 Burn
CardBurningFlashArt.png
Burning Flash
(3 Copies)
2 MeleeIcon.png On Use If ’Burning Flash’ is in hand, discard it and draw a page, then add the Offensive dice on the discarded page to this
SlashDiceIcon.png 6~10  On Hit Inflict 1 Burn









Combat Dialogue
Combat Entrance
  • My eyes shall look straight ahead as we advance.
  • We will not expose our back to the enemy.
  • To become a dragon of the battlefield, honorable and courageous!
  • No matter what you do, maintain a sound body and mind.
  • Surely, this can be dealt with in the usual way.
  • I am not afraid. Moving out!
  • The Liu is overpowered by none.
  • We must be quick to go on the offensive!
  • Shall we march forward immediately, Chun, sir?
Victory Cry
  • It’s hardly believable that such amateurs made it to this grade…
  • Regardless, we’ve accomplished the given mission… Let us go back.
  • It’s not a good idea to become overconfident in victory.
  • I won’t take pity on the opponent.
  • A smooth triumph. Let’s take the books we were requested to retrieve and return.
Death
  • I’d hate to drag others down…
  • I don’t want to give in at this point…
  • How rash… A single mistake resulted in this…
  • Hesitation would only be a roadblock…
  • It would seem… I’ve reached my limit.
On Ally Death
  • We can’t afford to dwell on personal feelings.
  • In times like this, we must not let ourselves collapse.
  • It’s still difficult to stay composed over someone’s demise.
  • The offensive must go on! We won’t falter.
  • We can’t back down now, despite the risk.
On Kill
  • We strike where the enemy cannot defend.
  • I wish for the rest of our combat to resolve swimmingly like just now.
  • Inviting people to a fight with such a lax mindset was your mistake.
  • I won’t let a single second pass in vain or let a single foe escape my notice.
  • In moments like this, your weapon is the one thing you can rely on.
  • Such feeble attacks won’t get through.


Xiao
Stats
XiaoCombatIdle.png
HPIcon.png 400 StaggerIcon.png 125 SpeedIcon.png 2~7
SlashNormalIcon.png Normal

PierceEndureIcon.png Endured
BluntNormalIcon.png Normal

SlashStgNormalIcon.png Normal

PierceStgEndureIcon.png Endured
BluntStgNormalIcon.png Normal

Passive Abilities
SkillOrangeIcon.png Speed Ⅱ
Speed Dice Slot +2 (Cannot Overlap)
SkillBlueIcon.png Fervor
Offensive dice gain +1 Power at Emotion Level 3 or above
SkillOrangeIcon.png Force of a Wildfire
On a melee hit, inflict 1 Burn and 'Force of a Wildfire', a status that lasts 2 Scenes.
If an enemy with 'Force of a Wildfire' is Staggered, inflict all other enemies with Burn equal to half of the amount of Burn that enemy had. (Rounded down)
SkillPurpleIcon.png Furious Fire Rending the Skies
At the start of the Scene, two random Combat Pages in hand gain the following effect: 'While this page is being used, inflict twice as much Burn with Combat Page abilities'.
SkillPurpleIcon.png Hugging Fire, Sitting on Brushwood
When targets hit by melee attacks from this character take Burn damage at the end of the Scene they were attacked, they also take Stagger damage equal to half of the Burn damage.
Drops
Does not drop books.
Combat Bookshelf
[Switch to Table/Grid]
CardEmotionalTurbulenceArt.png
Emotional Turbulence ×2
CardRagingStormLoveArt.png
Raging Storm: Love
CardFervidEmotionsArt.png
Fervid Emotions
CardFieryWaltzArt.png
Fiery Waltz
CardViolentFlameArt.png
Violent Flame
CardFrontalAssaultArt.png
Frontal Assault ×3





Deck
Page Cost Description
CardEmotionalTurbulenceArt.png
Emotional Turbulence
(2 Copies)
3 MeleeIcon.png On Use All dice on this page gain +1 Power for every 2 Emotion Levels
BlockDiceIcon.png 4~8 
PierceDiceIcon.png 5~9  On Hit Inflict 2 Burn
SlashDiceIcon.png 4~9  On Hit Inflict 1 Burn
BlockCounterDiceIcon.png 3~7 
CardRagingStormLoveArt.png
Raging Storm: Love
5 MassAttackIcon.png Mass-Individual
Single-use
SlashDiceIcon.png 3~7  On Hit Inflict 2 Burn
SlashDiceIcon.png 8~20  On Hit Inflict 2 Burn
CardFervidEmotionsArt.png
Fervid Emotions
4 MeleeIcon.png On Use All dice on this page gain +1 Power for every 2 Emotion Levels
SlashDiceIcon.png 7~11  On Hit Inflict 1 Burn 2 times
BluntDiceIcon.png 6~11  On Hit Inflict 1 Burn 2 times
SlashCounterDiceIcon.png 3~8 
CardFieryWaltzArt.png
Fiery Waltz
3 MeleeIcon.png EvadeDiceIcon.png 5~9 
SlashDiceIcon.png 6~9  On Hit If target has 4 or more Burn, inflict 1 Burn to all enemies
BluntDiceIcon.png 5~9  On Hit If target has 4 or more Burn, inflict 1 Burn to all enemies
CardViolentFlameArt.png
Violent Flame
1 MeleeIcon.png Combat Start When inflicting Burn using Combat Pages this Scene, inflict 1 additional stack
SlashDiceIcon.png 3~8  On Hit Inflict 1 Burn
PierceDiceIcon.png 3~7 
CardFrontalAssaultArt.png
Frontal Assault
(3 Copies)
0 MeleeIcon.png On Use Restore 1 Light
PierceDiceIcon.png 2~7 
PierceDiceIcon.png 1~2 








Combat Dialogue
Combat Entrance
  • Take control of the enemy’s lives!
  • The key to preventing the foe’s victory always lies within yourself.
  • If you feel that you’re in peril, don’t mind me and retreat.
  • I appreciate you immensely for following me here.
Victory Cry
  • Even though we have won, it does not feel like a victory; it’s ephemeral as a dreamy illusion, transient as a shadow cast by a bubble.
On Ally Death
  • …I want the survivors to secure their own safety before anything.
  • Snap out of it! This isn’t over yet…
  • I shouldn’t be the one to give in… Time to move onward.
On Kill
  • Short and swift is how you exert strength!
  • The momentum of a wild vigor will make the heaviest rocks drift.
  • We won’t drag on. Stay focused, all!
Special Event
  1. !!!

Special Event line notes

  1. Used when fleeing from the reception.

Miris
Stats
MirisCombatIdle.png
HPIcon.png 126 StaggerIcon.png 63 SpeedIcon.png 2~6
SlashNormalIcon.png Normal

PierceEndureIcon.png Endured
BluntNormalIcon.png Normal

SlashStgNormalIcon.png Normal

PierceStgEndureIcon.png Endured
BluntStgNormalIcon.png Normal

Passive Abilities
SkillPurpleIcon.png Speed
Speed Dice Slot +1 (Cannot Overlap)
SkillBlueIcon.png Fervor
Offensive dice gain +1 Power at Emotion Level 3 or above
SkillPurpleIcon.png Hugging Fire, Sitting on Brushwood
When targets hit by melee attacks from this character take Burn damage at the end of the Scene they were attacked, they also take Stagger damage equal to half of the Burn damage.
SkillPurpleIcon.png Singular Strike
When using a Combat Page with one non-Counter die, the die gains +2 Power, and it yields twice as many Emotion Points in a clash.
Drops
Does not drop books.
Combat Bookshelf
[Switch to Table/Grid]
CardEmotionalTurbulenceArt.png
Emotional Turbulence
CardFlamingDragonFistArt.png
Flaming Dragon Fist
CardFervidEmotionsArt.png
Fervid Emotions
CardFieryWaltzArt.png
Fiery Waltz
CardSingle-PointStabArt.png
Single-Point Stab ×3
CardFrontalAssaultArt.png
Frontal Assault ×2





Deck
Page Cost Description
CardEmotionalTurbulenceArt.png
Emotional Turbulence
3 MeleeIcon.png On Use All dice on this page gain +1 Power for every 2 Emotion Levels
BlockDiceIcon.png 4~8 
PierceDiceIcon.png 5~9  On Hit Inflict 2 Burn
SlashDiceIcon.png 4~9  On Hit Inflict 1 Burn
BlockCounterDiceIcon.png 3~7 
CardFlamingDragonFistArt.png
Flaming Dragon Fist
4 MeleeIcon.png Chun and Miris' Exclusive Page
BlockDiceIcon.png 3~8 
BluntDiceIcon.png 13~28  On Hit Inflict 6 Burn
CardFervidEmotionsArt.png
Fervid Emotions
4 MeleeIcon.png On Use All dice on this page gain +1 Power for every 2 Emotion Levels
SlashDiceIcon.png 7~11  On Hit Inflict 1 Burn 2 times
BluntDiceIcon.png 6~11  On Hit Inflict 1 Burn 2 times
SlashCounterDiceIcon.png 3~8 
CardFieryWaltzArt.png
Fiery Waltz
3 MeleeIcon.png EvadeDiceIcon.png 5~9 
SlashDiceIcon.png 6~9  On Hit If target has 4 or more Burn, inflict 1 Burn to all enemies
BluntDiceIcon.png 5~9  On Hit If target has 4 or more Burn, inflict 1 Burn to all enemies
CardSingle-PointStabArt.png
Single-Point Stab
(3 Copies)
0 MeleeIcon.png On Use At the start of the next Scene, draw all copies of ’Single-Point Stab’ from the deck
PierceDiceIcon.png 3~9  On Hit Inflict 1 Burn
CardFrontalAssaultArt.png
Frontal Assault
(2 Copies)
0 MeleeIcon.png On Use Restore 1 Light
PierceDiceIcon.png 2~7 
PierceDiceIcon.png 1~2 








Combat Dialogue
Combat Entrance
  • Your fortress won’t stay strong for long!
  • We should try not to get into any disadvantageous situations.
  • I shall end this in an instant with minimum damage!
Victory Cry
  • This is a relief. …Time to take the books and get out of this place.
On Ally Death
  • …Fires will start from charred ashes.
  • Do not lose hope yet, the battle is far from finished!
  • There has to be some opening… to turn the tide of this battle.
  • Director! Give us your next order…!
On Kill
  • There’s nothing we cannot achieve under our director’s command!
  • Triumph is drawing near!!
  • The enemy is confused. We should take advantage of this opportunity!
  • We shall launch a harder attack on them!
Special Event
  1. Dammit… This might get seriously dangerous… Director!

Special Event line notes

  1. Used when fleeing from the reception.

Chun
Stats
ChunCombatIdle.png
HPIcon.png 126 StaggerIcon.png 62 SpeedIcon.png 2~6
SlashNormalIcon.png Normal

PierceNormalIcon.png Normal
BluntEndureIcon.png Endured

SlashStgNormalIcon.png Normal

PierceStgNormalIcon.png Normal
BluntStgEndureIcon.png Endured

Passive Abilities
SkillPurpleIcon.png Speed
Speed Dice Slot +1 (Cannot Overlap)
SkillBlueIcon.png Fervor
Offensive dice gain +1 Power at Emotion Level 3 or above
SkillPurpleIcon.png Furious Fire Rending the Skies
At the start of the Scene, two random Combat Pages in hand gain the following effect: 'While this page is being used, inflict twice as much Burn with Combat Page abilities'.
SkillGreenIcon.png Blunt Mastery
Blunt Dice Power +1
Drops
Book of Liu Association Section 1 70% 50% 0% 0% 0% 0%
Book of Chun 30% 50% 100% 100% 100% 100%
Count 2 2.2 2.6 3.2 3.7 4.4
Combat Bookshelf
[Switch to Table/Grid]
CardEmotionalTurbulenceArt.png
Emotional Turbulence
CardFlamingDragonFistArt.png
Flaming Dragon Fist ×2
CardFieryWaltzArt.png
Fiery Waltz ×2
CardViolentFlameArt.png
Violent Flame ×2
CardFrontalAssaultArt.png
Frontal Assault ×2





Deck
Page Cost Description
CardEmotionalTurbulenceArt.png
Emotional Turbulence
3 MeleeIcon.png On Use All dice on this page gain +1 Power for every 2 Emotion Levels
BlockDiceIcon.png 4~8 
PierceDiceIcon.png 5~9  On Hit Inflict 2 Burn
SlashDiceIcon.png 4~9  On Hit Inflict 1 Burn
BlockCounterDiceIcon.png 3~7 
CardFlamingDragonFistArt.png
Flaming Dragon Fist
(2 Copies)
4 MeleeIcon.png Chun and Miris' Exclusive Page
BlockDiceIcon.png 3~8 
BluntDiceIcon.png 13~28  On Hit Inflict 6 Burn
CardFieryWaltzArt.png
Fiery Waltz
(2 Copies)
3 MeleeIcon.png EvadeDiceIcon.png 5~9 
SlashDiceIcon.png 6~9  On Hit If target has 4 or more Burn, inflict 1 Burn to all enemies
BluntDiceIcon.png 5~9  On Hit If target has 4 or more Burn, inflict 1 Burn to all enemies
CardViolentFlameArt.png
Violent Flame
(2 Copies)
1 MeleeIcon.png Combat Start When inflicting Burn using Combat Pages this Scene, inflict 1 additional stack
SlashDiceIcon.png 3~8  On Hit Inflict 1 Burn
PierceDiceIcon.png 3~7 
CardFrontalAssaultArt.png
Frontal Assault
(2 Copies)
0 MeleeIcon.png On Use Restore 1 Light
PierceDiceIcon.png 2~7 
PierceDiceIcon.png 1~2 








Combat Dialogue
Combat Entrance
  • Let us begin composedly.
  • We will not let the enemy rule over us.
  • We must fortify ourselves first and foremost against an unwavering opponent.
  • As our director said, we shan’t overstrain ourselves.
Victory Cry
  • Winning a hundred battles has little point when a hundred battles had to be fought.
  • A cunning and prolonged battle is not good to have.
Death
  • …Director. I don’t think I can go on any further.
On Ally Death
  • It may be a hazardous idea to draw out this battle further.
  • We shall press on. There is no retreat!
  • …I suppose we shouldn’t underestimate the enemy’s posture.
  • Like a fierce tiger crouching in the grass… Even if all of us were to die, I trust the director to push through.
On Kill
  • You must strike where the enemy least expects it…
  • One mustn’t let the enemy know where to guard.
  • A solid defense, is about defending where the foe cannot attack.
  • We wouldn’t have come here if we had expected a bleak outcome.


Liu S. Section 1 Fixer
Stats
Liu1Fixer.png
HPIcon.png 99 StaggerIcon.png 49 SpeedIcon.png 2~6
SlashNormalIcon.png Normal

PierceNormalIcon.png Normal
BluntNormalIcon.png Normal

SlashStgNormalIcon.png Normal

PierceStgNormalIcon.png Normal
BluntStgNormalIcon.png Normal

Passive Abilities
SkillPurpleIcon.png Speed
Speed Dice Slot +1 (Cannot Overlap)
SkillBlueIcon.png Fervor
Offensive dice gain +1 Power at Emotion Level 3 or above
SkillPurpleIcon.png Singular Strike
When using a Combat Page with one non-Counter die, the die gains +2 Power, and it yields twice as many Emotion Points in a clash.
Drops
Book of Liu Association Section 1 100% 100% 100% 100% 100% 100%
Count 1.4 2 2.6 3 3.5 4.2
Combat Bookshelf
[Switch to Table/Grid]
CardEmotionalTurbulenceArt.png
Emotional Turbulence
CardFrontalAssaultArt.png
Frontal Assault
CardSingle-PointStabArt.png
Single-Point Stab ×3
CardBurningFlashArt.png
Burning Flash ×3





Deck
Page Cost Description
CardEmotionalTurbulenceArt.png
Emotional Turbulence
3 MeleeIcon.png On Use All dice on this page gain +1 Power for every 2 Emotion Levels
BlockDiceIcon.png 4~8 
PierceDiceIcon.png 5~9  On Hit Inflict 2 Burn
SlashDiceIcon.png 4~9  On Hit Inflict 1 Burn
BlockCounterDiceIcon.png 3~7 
CardFrontalAssaultArt.png
Frontal Assault
0 MeleeIcon.png On Use Restore 1 Light
PierceDiceIcon.png 2~7 
PierceDiceIcon.png 1~2 
CardSingle-PointStabArt.png
Single-Point Stab
(3 Copies)
0 MeleeIcon.png On Use At the start of the next Scene, draw all copies of ’Single-Point Stab’ from the deck
PierceDiceIcon.png 3~9  On Hit Inflict 1 Burn
CardBurningFlashArt.png
Burning Flash
(3 Copies)
2 MeleeIcon.png On Use If ’Burning Flash’ is in hand, discard it and draw a page, then add the Offensive dice on the discarded page to this
SlashDiceIcon.png 6~10  On Hit Inflict 1 Burn









Combat Dialogue
Combat Entrance
  • My eyes shall look straight ahead as we advance.
  • We will not expose our back to the enemy.
  • To become a dragon of the battlefield, honorable and courageous!
  • No matter what you do, maintain a sound body and mind.
  • Surely, this can be dealt with in the usual way.
  • I am not afraid. Moving out!
  • The Liu is overpowered by none.
  • We must be quick to go on the offensive!
  • Shall we march forward immediately, Chun, sir?
Victory Cry
  • It’s hardly believable that such amateurs made it to this grade…
  • Regardless, we’ve accomplished the given mission… Let us go back.
  • It’s not a good idea to become overconfident in victory.
  • I won’t take pity on the opponent.
  • A smooth triumph. Let’s take the books we were requested to retrieve and return.
Death
  • I’d hate to drag others down…
  • I don’t want to give in at this point…
  • How rash… A single mistake resulted in this…
  • Hesitation would only be a roadblock…
  • It would seem… I’ve reached my limit.
On Ally Death
  • We can’t afford to dwell on personal feelings.
  • In times like this, we must not let ourselves collapse.
  • It’s still difficult to stay composed over someone’s demise.
  • The offensive must go on! We won’t falter.
  • We can’t back down now, despite the risk.
On Kill
  • We strike where the enemy cannot defend.
  • I wish for the rest of our combat to resolve swimmingly like just now.
  • Inviting people to a fight with such a lax mindset was your mistake.
  • I won’t let a single second pass in vain or let a single foe escape my notice.
  • In moments like this, your weapon is the one thing you can rely on.
  • Such feeble attacks won’t get through.



dropsSection

Outputs a section with book and keypages obtained. To change the data displayed, edit the appropriate module or template Example Usage:

{{#invoke:ReceptionData|dropsSection |Liu Association Section 1}}

outputs:

Drops

Key Pages Combat Pages
LiuAssociationIcon.png Book of Liu Association Section 1 A Liu Section 1 Fixer’s Page ×4 Single-Point Stab ×7

Violent Flame ×7
Fervid Emotions ×4
Fiery Waltz ×4
Burning Flash ×6

LiuAssociationIcon.png Book of Chun A Liu Section 1 Fixer’s Page ×4

Chun’s Page ×3

Single-Point Stab ×7

Violent Flame ×7
Fervid Emotions ×4
Fiery Waltz ×4
Burning Flash ×3
Flaming Dragon Fist ×1

Combat Pages

Combat Pages
Page Cost Range Description Obtained
CardFlamingDragonFistArt.png
Flaming Dragon Fist
4 MeleeIcon.png Chun and Miris' Exclusive Page
BlockDiceIcon.png 3~8 
BluntDiceIcon.png 13~28  On Hit Inflict 6 Burn
Book of Chun, Book of Miris


CardFervidEmotionsArt.png
Fervid Emotions
4 MeleeIcon.png On Use All dice on this page gain +1 Power for every 2 Emotion Levels
SlashDiceIcon.png 7~11  On Hit Inflict 1 Burn 2 times
BluntDiceIcon.png 6~11  On Hit Inflict 1 Burn 2 times
SlashCounterDiceIcon.png 3~8 
Book of Liu Association Section 1, Book of Chun, Book of Miris


CardFieryWaltzArt.png
Fiery Waltz
3 MeleeIcon.png EvadeDiceIcon.png 5~9 
SlashDiceIcon.png 6~9  On Hit If target has 4 or more Burn, inflict 1 Burn to all enemies
BluntDiceIcon.png 5~9  On Hit If target has 4 or more Burn, inflict 1 Burn to all enemies
Book of Liu Association Section 1, Book of Chun, Book of Miris


CardViolentFlameArt.png
Violent Flame
1 MeleeIcon.png Combat Start When inflicting Burn using Combat Pages this Scene, inflict 1 additional stack
SlashDiceIcon.png 3~8  On Hit Inflict 1 Burn
PierceDiceIcon.png 3~7 
Book of Liu Association Section 1, Book of Chun, Book of Miris


CardSingle-PointStabArt.png
Single-Point Stab
0 MeleeIcon.png On Use At the start of the next Scene, draw all copies of ’Single-Point Stab’ from the deck
PierceDiceIcon.png 3~9  On Hit Inflict 1 Burn
Book of Liu Association Section 1, Book of Chun, Book of Miris


CardBurningFlashArt.png
Burning Flash
2 MeleeIcon.png On Use If ’Burning Flash’ is in hand, discard it and draw a page, then add the Offensive dice on the discarded page to this
SlashDiceIcon.png 6~10  On Hit Inflict 1 Burn
Book of Liu Association Section 1, Book of Chun, Book of Miris



local p = {}
local receptionData = mw.loadData('Module:ReceptionData/Data')


function p.getData(frame)
	if not frame then return '' end
    local ID = frame.args[2]
    ID = string.gsub(ID,"\n","")
    local property = frame.args[1]
	if not (receptionData[ID]) then return frame:preprocess('<!--reception ' .. ID .. ' not found-->') end
	if not (receptionData[ID][property]) then return '' end
    return receptionData[ID][property] or ''
end

function p.getDrops(frame)
	if not frame then return '' end
    local ID = frame.args[2]
    local property = 'drops_' .. frame.args[1]
	if not (receptionData[ID]) then return frame:preprocess('<!--reception ' .. ID .. ' not found-->') end
	if not (receptionData[ID][property]) then return '' end
	local t = receptionData[ID][property]
	local stringtable = {}
    if property == 'drops_book' then
    	for k,v in pairs(t) do
			table.insert(stringtable,"{{Book|" .. v .."}}")
    	end	
    end
    if property == 'drops_keypage' then
    	for k,v in pairs(t) do
			table.insert(stringtable,"{{KeyPage|" .. v .."}}")
    	end	
    end
    if property == 'drops_card' then
    	for k,v in pairs(t) do
			table.insert(stringtable,"{{Card|" .. v .."|noimg}}")
    	end	
    end  
	s = table.concat(stringtable, " <br> \n")
    return frame:preprocess(s)
end

function p.getInvite(frame)
	if not frame then return '' end
    local ID = string.gsub(frame.args[1],"\n","")
	if not (receptionData[ID]) then return 'reception'.. ID .. 'not found' end
	local invite = receptionData[ID]['invite']
	local s = ""
	if receptionData[ID]['invite_type'] == 'Recipe' then
		local stringtable = {}
		for k,v in pairs(invite) do
			table.insert(stringtable,"{{Book|" .. v .."}}")
		end
		s = table.concat(stringtable, " <br> \n")
	else
		s = invite or ''
	end
    return frame:preprocess(s)
end

function depth(array)
    local d = 0
    if pcall(function() isarray=(array[1] == nil) end) then
    if isarray then return d end 
    d = d + 1 + depth(array[1])
    end 
    return d 
end

function tablelength(T)
  local count = 0
  for _ in pairs(T) do count = count + 1 end
  return count
end

function _formationSection(acts)
	local function actFormation(act) 
		local keypageData = mw.loadData('Module:KeyPageData/Data')
		local function phaseFormation(phase)
			local unitnames = {}
			for k,v in pairs(phase) do
			table.insert(unitnames,keypageData[tostring(v)]['name'])
			end
	    	local countedunits = countUnits(unitnames)
	    	local stringtable = {}
	    	for k,v in ipairs(countedunits) do
		    table.insert(stringtable, "*" .. v[1] .. " ×" .. v[2])
	    	end
	    	return table.concat(stringtable, "\n")
		end
		local s = ''
		if depth(act) > 1 then
	        for j in pairs(act) do
	            s = s .. "===== Phase " .. j .. "=====\n"
				s = s .. phaseFormation(act[j])
	            s = s .. "\n"
	        end
	    else s = s .. phaseFormation(act) end
		return s
	end
    local s = '=== Formation === \n'
	for k,v in pairs(acts) do
		if tablelength(acts) > 1 then s = s .. "==== Act " .. k .. "====\n" end
        s = s .. actFormation(v) 
    	s = s .. "\n"
	end
	return s
end

function p.formationSection(frame) 
	if not frame then return '' end
    local ID = frame.args[1]
    ID = string.gsub(ID,"\n","")
	if not (receptionData[ID]) then return 'error: check arguments' end
	local acts = receptionData[ID]['acts']
	return frame:preprocess(_formationSection(acts))
end

function _receptionTabber(acts, descs) 
	local desccount = 1
	local function actTabber(act)
		local s = ''
		local function phaseTabber(phase) 
			local countedunits = countUnits(phase)
	        local s = "{{#tag:tabber| \n"
		    for k,v in ipairs(countedunits) do
		    	local desc = descs[desccount] or ''
		    	desc = mw.text.unstripNoWiki(desc)
		    	desc = string.gsub(desc,"%s*$", "")
		    	local c='|'
		    	if v[2] > 1 then c = c .. 'count=' .. v[2] .. '|' end
		        s = s .. "{{ReceptionUnitTab|" .. v[1] ..  c .. desc .. "}}\n"
		        desccount = desccount +1;
		    end
		    s = s .. "}}\n"
		    return s
		end
		if depth(act) > 1 then
	        s = s .. "{{#tag:tabber|\n"
	        local stringtable = {}
	        for j in pairs(act) do
	        	table.insert(stringtable,"Phase " .. j .. "=\n" .. phaseTabber(act[j]))
	        end
	        s = s .. table.concat(stringtable, "{{!}}-{{!}}\n")
	        s = s .. "}}\n"
	    else
	        s = s .. phaseTabber(act)
		end
		return s
	end
	
	local s = '<div class="receptiontabber-container"> \n' 
	if tablelength(acts) > 1 then
		s = s .. '<tabber> \n' 
		for i in pairs(acts) do
		    s = s .. "Act " .. i .. "=\n"
		    s = s .. actTabber(acts[i])
		    s = s .. "|-|\n"
	    end
		s = s .. "</tabber>"
	else
		s = s .. actTabber(acts[1])	
	end
	s = s .. "</div>"
	return s
end

function p.receptionTabber(frame) 
	if not frame then return '' end
    local ID = frame:getParent().args[1] or frame.args[1]
    ID = string.gsub(ID,"\n","")
	if not (receptionData[ID]) then return 'error: check arguments' end
	local acts = receptionData[ID]['acts']
	local descs = {}
	for i in pairs(frame.args) do
	table.insert(descs,frame.args[i+1])
	end
	return frame:preprocess(_receptionTabber(acts, descs))
end

function p.guestsSection(frame)
	if not frame then return '' end
    local ID = frame:getParent().args[1] or frame.args[1]
    ID = string.gsub(ID,"\n","")
	if not (receptionData[ID]) then return 'error: check arguments' end
	local acts = receptionData[ID]['acts']
	local s = '== Guests == \n' 
	s = s .. _formationSection(acts)
	local descs = {}
	for i in pairs(frame.args) do
	table.insert(descs,frame.args[i+1])
	end
	s = s .. _receptionTabber(acts, descs) 
	return frame:preprocess(s)
end

function p.dropsSection(frame)
	if not frame then return '' end
    local ID = frame.args[1]
    ID = string.gsub(ID,"\n","")
	if not (receptionData[ID]) then return 'error: check arguments' end
	local s = ''
	if frame.args['title'] ~= 'no' then	s = '== Drops =='.. '\n' end
	local books = receptionData[ID]['drops_book']
	local b = '{| class="wikitable" width="100%" style="text-align:center;"'.. '\n'
	b = b .. '! width="30%" |' .. '\n'
	b = b .. '! width="30%" |<b>Key Pages</b>' .. '\n'
	b = b .. '! <b>Combat Pages</b>' .. '\n'
	b = b .. '|-' .. '\n'
	for k,v in pairs(books) do
		b = b .. '{{BookTableRow|' .. v .. '}}' .. '\n'
	end
	b = b .. '|}\n'
	if depth(books) < 1 then b = '' end

	local cards = receptionData[ID]['drops_card']
	local c = '=== Combat Pages ==='
	c = c .. '{{CardListHeader}}\n'
	for k,v in pairs(cards) do
		c = c .. '{{CardListRow|' .. v .. '}}' .. '\n'
	end
	c = c .. '|}\n'
	if depth(cards) < 1 then c = '' end
	
	s = s .. b .. c
	return frame:preprocess(s)
end

function countUnits(array)
	local t = { }
	for k,v in ipairs(array) do
        t[v]=(t[v] or 0)+1
	end
	local it = { }
	for k,v in ipairs(array) do
	    table.insert(it,{v,t[v]})
	    if #it>1 then
	    if it[#it-1][1] == v then table.remove(it,#it) end
	    end
	end
    return it
end

return p