Explorable Lairs and other changes I'm trying

Marnok

Marnok
Joined
Mar 24, 2008
Messages
506
I have started to implement some changes to the way ruins and barrows work, to suit my own tastes. (As I previously discussed in another thread, I like playing no settler/wildlands. These changes are a result of my plans aided by responders to that thread, thanks again all!)

  • Changed CIV4ImprovementInfos.xml
    • Set <bPermanent>1</bPermanent> for <Type>IMPROVEMENT_BARROW</TYpe> and <Type>IMPROVEMENT_RUINS</Type>
    • set <iAppearanceProbability>750</iAppearanceProbability> for each so there would be plenty to test. I will lower this, but still leave it higher than original, for play.
  • Added to CIV4SpellInfos.xml :
    Spoiler :
    <SpellInfo>
    <Type>SPELL_MARNOK_DUNGEONEER</Type>
    <Description>TXT_KEY_SPELL_MARNOK_DUNGEONEER</Description>
    <Civilopedia>TXT_KEY_SPELL_PLACEHOLDER_PEDIA</Civilopedia>
    <Strategy>NONE</Strategy>
    <Help>TXT_KEY_SPELL_MARNOK_DUNGEONEER_HELP</Help>
    <PromotionPrereq1>NONE</PromotionPrereq1>
    <PromotionPrereq2>NONE</PromotionPrereq2>
    <UnitPrereq>NONE</UnitPrereq>
    <UnitClassPrereq>NONE</UnitClassPrereq>
    <UnitCombatPrereq>NONE</UnitCombatPrereq>
    <UnitInStackPrereq>NONE</UnitInStackPrereq>
    <CivilizationPrereq>NONE</CivilizationPrereq>
    <ReligionPrereq>NONE</ReligionPrereq>
    <StateReligionPrereq>NONE</StateReligionPrereq>
    <TechPrereq>NONE</TechPrereq>
    <bAllowAI>1</bAllowAI>
    <bAdjacentToWaterOnly>0</bAdjacentToWaterOnly>
    <bCausesWar>0</bCausesWar>
    <bGlobal>0</bGlobal>
    <bInBordersOnly>0</bInBordersOnly>
    <bInCityOnly>0</bInCityOnly>
    <iAIWeight>5</iAIWeight>
    <bDisplayWhenDisabled>0</bDisplayWhenDisabled>
    <bHasCasted>1</bHasCasted>
    <bIgnoreHasCasted>0</bIgnoreHasCasted>
    <bResistable>0</bResistable>
    <iRange>0</iRange>
    <iResistModify>0</iResistModify>
    <iDamage>0</iDamage>
    <iDamageLimit>0</iDamageLimit>
    <DamageType>NONE</DamageType>
    <AddPromotionType1>NONE</AddPromotionType1>
    <AddPromotionType2>NONE</AddPromotionType2>
    <AddPromotionType3>NONE</AddPromotionType3>
    <RemovePromotionType1>NONE</RemovePromotionType1>
    <RemovePromotionType2>NONE</RemovePromotionType2>
    <RemovePromotionType3>NONE</RemovePromotionType3>
    <bBuffCasterOnly>0</bBuffCasterOnly>
    <ConvertUnitType>NONE</ConvertUnitType>
    <CreateBuildingType>NONE</CreateBuildingType>
    <CreateFeatureType>NONE</CreateFeatureType>
    <CreateImprovementType>NONE</CreateImprovementType>
    <SpreadReligion>NONE</SpreadReligion>
    <CreateUnitType>NONE</CreateUnitType>
    <iCreateUnitNum>0</iCreateUnitNum>
    <bPermanentUnitCreate>0</bPermanentUnitCreate>
    <CreateUnitPromotion>NONE</CreateUnitPromotion>
    <bImmuneTeam>0</bImmuneTeam>
    <bImmuneNeutral>0</bImmuneNeutral>
    <bImmuneEnemy>0</bImmuneEnemy>
    <bImmuneFlying>0</bImmuneFlying>
    <bImmuneNotAlive>0</bImmuneNotAlive>
    <bDispel>0</bDispel>
    <bPush>0</bPush>
    <bRemoveHasCasted>0</bRemoveHasCasted>
    <bSacrificeCaster>0</bSacrificeCaster>
    <iChangePopulation>0</iChangePopulation>
    <iCost>0</iCost>
    <iImmobileTurns>0</iImmobileTurns>
    <iMiscastChance>0</iMiscastChance>
    <PyMiscast></PyMiscast>
    <PyResult>spellMarnokDungeoneer(pCaster)</PyResult>
    <PyRequirement>reqMarnokDungeoneer(pCaster)</PyRequirement>
    <Effect>EFFECT_SPELL1</Effect>
    <Sound>AS3D_SPELL_SANCTIFY</Sound>
    <HotKey></HotKey>
    <bAltDown>0</bAltDown>
    <bShiftDown>0</bShiftDown>
    <bCtrlDown>0</bCtrlDown>
    <bGraphicalOnly>0</bGraphicalOnly>
    <iHotKeyPriority>0</iHotKeyPriority>
    <Button>Art/Interface/Buttons/Spells/Rob Grave.dds</Button>
    </SpellInfo>
    <SpellInfo>
    <Type>SPELL_MARNOK_BARBARIAN_ALLY_DUNGEONEER</Type>
    <Description>TXT_KEY_SPELL_MARNOK_BARB_DUNGEONEER</Description>
    <Civilopedia>TXT_KEY_SPELL_PLACEHOLDER_PEDIA</Civilopedia>
    <Strategy>NONE</Strategy>
    <Help>TXT_KEY_SPELL_MARNOK_BARB_DUNGEONEER_HELP</Help>
    <PromotionPrereq1>NONE</PromotionPrereq1>
    <PromotionPrereq2>NONE</PromotionPrereq2>
    <UnitPrereq>NONE</UnitPrereq>
    <UnitClassPrereq>NONE</UnitClassPrereq>
    <UnitCombatPrereq>NONE</UnitCombatPrereq>
    <UnitInStackPrereq>NONE</UnitInStackPrereq>
    <CivilizationPrereq>NONE</CivilizationPrereq>
    <ReligionPrereq>NONE</ReligionPrereq>
    <StateReligionPrereq>NONE</StateReligionPrereq>
    <TechPrereq>NONE</TechPrereq>
    <bAllowAI>1</bAllowAI>
    <bAdjacentToWaterOnly>0</bAdjacentToWaterOnly>
    <bCausesWar>0</bCausesWar>
    <bGlobal>0</bGlobal>
    <bInBordersOnly>0</bInBordersOnly>
    <bInCityOnly>0</bInCityOnly>
    <iAIWeight>5</iAIWeight>
    <bDisplayWhenDisabled>0</bDisplayWhenDisabled>
    <bHasCasted>1</bHasCasted>
    <bIgnoreHasCasted>0</bIgnoreHasCasted>
    <bResistable>0</bResistable>
    <iRange>0</iRange>
    <iResistModify>0</iResistModify>
    <iDamage>0</iDamage>
    <iDamageLimit>0</iDamageLimit>
    <DamageType>NONE</DamageType>
    <AddPromotionType1>NONE</AddPromotionType1>
    <AddPromotionType2>NONE</AddPromotionType2>
    <AddPromotionType3>NONE</AddPromotionType3>
    <RemovePromotionType1>NONE</RemovePromotionType1>
    <RemovePromotionType2>NONE</RemovePromotionType2>
    <RemovePromotionType3>NONE</RemovePromotionType3>
    <bBuffCasterOnly>0</bBuffCasterOnly>
    <ConvertUnitType>NONE</ConvertUnitType>
    <CreateBuildingType>NONE</CreateBuildingType>
    <CreateFeatureType>NONE</CreateFeatureType>
    <CreateImprovementType>NONE</CreateImprovementType>
    <SpreadReligion>NONE</SpreadReligion>
    <CreateUnitType>NONE</CreateUnitType>
    <iCreateUnitNum>0</iCreateUnitNum>
    <bPermanentUnitCreate>0</bPermanentUnitCreate>
    <CreateUnitPromotion>NONE</CreateUnitPromotion>
    <bImmuneTeam>0</bImmuneTeam>
    <bImmuneNeutral>0</bImmuneNeutral>
    <bImmuneEnemy>0</bImmuneEnemy>
    <bImmuneFlying>0</bImmuneFlying>
    <bImmuneNotAlive>0</bImmuneNotAlive>
    <bDispel>0</bDispel>
    <bPush>0</bPush>
    <bRemoveHasCasted>0</bRemoveHasCasted>
    <bSacrificeCaster>0</bSacrificeCaster>
    <iChangePopulation>0</iChangePopulation>
    <iCost>0</iCost>
    <iImmobileTurns>0</iImmobileTurns>
    <iMiscastChance>0</iMiscastChance>
    <PyMiscast></PyMiscast>
    <PyResult>spellMarnokBarbarianAllyDungeoneer(pCaster)</PyResult>
    <PyRequirement>reqMarnokBarbarianAllyDungeoneer(pCaster)</PyRequirement>
    <Effect>EFFECT_SPELL1</Effect>
    <Sound>AS3D_SPELL_SANCTIFY</Sound>
    <HotKey></HotKey>
    <bAltDown>0</bAltDown>
    <bShiftDown>0</bShiftDown>
    <bCtrlDown>0</bCtrlDown>
    <bGraphicalOnly>0</bGraphicalOnly>
    <iHotKeyPriority>0</iHotKeyPriority>
    <Button>Art/Interface/Buttons/Spells/Rob Grave.dds</Button>
    </SpellInfo>
  • Added to CvSpellInterface.py:
    Spoiler :
    def reqMarnokDungeoneer(caster):
    pPlot = caster.plot()
    if pPlot.getImprovementType() != gc.getInfoTypeForString('MARNOK_HILLGIANT_STEADING') and pPlot.getImprovementType() != gc.getInfoTypeForString('IMPROVEMENT_BARROW') and pPlot.getImprovementType() != gc.getInfoTypeForString('IMPROVEMENT_RUINS'):
    return False
    pPlayer = gc.getPlayer(caster.getOwner())
    eTeam = gc.getTeam(gc.getPlayer(gc.getBARBARIAN_PLAYER()).getTeam())
    iTeam = pPlayer.getTeam()
    if eTeam.isAtWar(iTeam) == False:
    if pPlayer.isBarbarian():
    return False
    return True


    def spellMarnokDungeoneer(caster):
    iPlayer = caster.getOwner()
    pPlot = caster.plot()
    pPlot.setImprovementType(-1)
    pPlayer = gc.getPlayer(caster.getOwner())
    iRnd = CyGame().getSorenRandNum(100, "Rob Grave")
    if iRnd < 20:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_LOW_GOLD'), caster)
    if iRnd >= 20 and iRnd < 30:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_HIGH_GOLD'), caster)
    if iRnd >= 30 and iRnd < 40:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_TECH'), caster)
    if iRnd >= 40 and iRnd < 45:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_MAP'), caster)
    if iRnd >= 45 and iRnd < 55:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_SKELETONS'), caster)
    if iRnd >= 55 and iRnd < 65:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_BARBARIANS_WEAK'), caster)
    if iRnd >= 65 and iRnd < 75:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_BARBARIANS_STRONG'), caster)
    if iRnd >= 75 and iRnd < 80:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_LIZARDMEN_STRONG'), caster)
    if iRnd >= 80 and iRnd < 85:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_SPIDER'), caster)
    if iRnd >= 85 and iRnd < 90:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_HILLGIANT'), caster)
    if iRnd >= 90 and iRnd < 99:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_SPECTRE'), caster)
    if iRnd >= 99:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_BONUS_GEMS'), caster)
    pPlot.setBonusType(gc.getInfoTypeForString('BONUS_GEMS'))

    def reqMarnokBarbarianAllyDungeoneer(caster):
    pPlot = caster.plot()
    if pPlot.getImprovementType() != gc.getInfoTypeForString('IMPROVEMENT_BARROW') and pPlot.getImprovementType() != gc.getInfoTypeForString('IMPROVEMENT_RUINS'):
    return False
    pPlayer = gc.getPlayer(caster.getOwner())
    if pPlayer.getGold() < 50:
    return False
    if pPlayer.hasTrait(gc.getInfoTypeForString('TRAIT_BARBARIAN')):
    return True
    return False

    def spellMarnokBarbarianAllyDungeoneer(caster):
    pPlot = caster.plot()
    pPlayer = gc.getPlayer(caster.getOwner())
    pPlayer.changeGold(-50)
    iRnd = CyGame().getSorenRandNum(100, "Rob Grave")
    if iRnd < 20:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_BARBARIANS_WEAK'), caster)
    if iRnd >= 20 and iRnd < 30:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_BARBARIANS_STRONG'), caster)
    if iRnd >= 30 and iRnd < 40:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_EXPERIENCE'), caster)
    if iRnd >= 40 and iRnd < 45:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_SPIDER'), caster)
    if iRnd >= 45 and iRnd < 55:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_HILLGIANT'), caster)
    if iRnd >= 55 and iRnd < 65:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_BARBARIANS_WEAK'), caster)
    if iRnd >= 65:
    pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_NOTHING'), caster)
  • Added to CIV4GameText_FFH2.xml
    Spoiler :
    <TEXT>
    <Tag>TXT_KEY_SPELL_MARNOK_DUNGEONEER</Tag>
    <English>Assault the lair to destroy it and see what treasures can be found!</English>
    <French>Assault the lair to destroy it and see what treasures can be found!</French>
    <German>Assault the lair to destroy it and see what treasures can be found!</German>
    <Italian>Assault the lair to destroy it and see what treasures can be found!</Italian>
    <Spanish>Assault the lair to destroy it and see what treasures can be found!</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_SPELL_MARNOK_BARB_DUNGEONEER</Tag>
    <English>Pay 50 gold and attempt to assist the lair, or see what they can do for you.</English>
    <French>Pay 50 gold and attempt to assist the lair, or see what they can do for you.</French>
    <German>Pay 50 gold and attempt to assist the lair, or see what they can do for you.</German>
    <Italian>Pay 50 gold and attempt to assist the lair, or see what they can do for you.</Italian>
    <Spanish>Pay 50 gold and attempt to assist the lair, or see what they can do for you.</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_BONUS_GEMS</Tag>
    <English>You find a rich source of gems beneath the lair.</English>
    <French>You find a rich source of gems beneath the lair.</French>
    <German>You find a rich source of gems beneath the lair.</German>
    <Italian>You find a rich source of gems beneath the lair.</Italian>
    <Spanish>You find a rich source of gems beneath the lair.</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_SKELETONS</Tag>
    <English>You encounter skeletons!</English>
    <French>You encounter skeletons!</French>
    <German>You encounter skeletons!</German>
    <Italian>You encounter skeletons!</Italian>
    <Spanish>You encounter skeletons!</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_SPECTRE</Tag>
    <English>You awaken a resting spirit!</English>
    <French>You awaken a resting spirit!</French>
    <German>You awaken a resting spirit!</German>
    <Italian>You awaken a resting spirit!</Italian>
    <Spanish>You awaken a resting spirit!</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_SPIDER</Tag>
    <English>A gargantuan spider crawls from its lair...</English>
    <French>A gargantuan spider crawls from its lair...</French>
    <German>A gargantuan spider crawls from its lair...</German>
    <Italian>A gargantuan spider crawls from its lair...</Italian>
    <Spanish>A gargantuan spider crawls from its lair...</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_HILLGIANT</Tag>
    <English>Fee, Fi, Foe, Fum!</English>
    <French>Fee, Fi, Foe, Fum!</French>
    <German>Fee, Fi, Foe, Fum!</German>
    <Italian>Fee, Fi, Foe, Fum!</Italian>
    <Spanish>Fee, Fi, Foe, Fum!</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_LIZARDMEN</Tag>
    <English>You disturb a group of Lizardmen.</English>
    <French>You disturb a group of Lizardmen.</French>
    <German>You disturb a group of Lizardmen.</German>
    <Italian>You disturb a group of Lizardmen.</Italian>
    <Spanish>You disturb a group of Lizardmen.</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_MAP</Tag>
    <English>You discover a treasure map!</English>
    <French>You discover a treasure map!</French>
    <German>You discover a treasure map!</German>
    <Italian>You discover a treasure map!</Italian>
    <Spanish>You discover a treasure map!</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_GOLD</Tag>
    <English>The treasure hoard is plundered!</English>
    <French>The treasure hoard is plundered!</French>
    <German>The treasure hoard is plundered!</German>
    <Italian>The treasure hoard is plundered!</Italian>
    <Spanish>The treasure hoard is plundered!</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_BARBARIANS</Tag>
    <English>Orcs burst forth from the lair, intent on pillage!</English>
    <French>Orcs burst forth from the lair, intent on pillage!</French>
    <German>Orcs burst forth from the lair, intent on pillage!</German>
    <Italian>Orcs burst forth from the lair, intent on pillage!</Italian>
    <Spanish>Orcs burst forth from the lair, intent on pillage!</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_TECH</Tag>
    <English>Ancient tablets reveal mysterious secrets.</English>
    <French>Ancient tablets reveal mysterious secrets.</French>
    <German>Ancient tablets reveal mysterious secrets.</German>
    <Italian>Ancient tablets reveal mysterious secrets.</Italian>
    <Spanish>Ancient tablets reveal mysterious secrets.</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_NOTHING</Tag>
    <English>Your efforts are fruitless.</English>
    <French>Your efforts are fruitless.</French>
    <German>Your efforts are fruitless.</German>
    <Italian>Your efforts are fruitless.</Italian>
    <Spanish>Your efforts are fruitless.</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_GOODY_MARNOK_EXPERIENCE</Tag>
    <English>Your unit emerges victorious after many fearsome battles.</English>
    <French>Your unit emerges victorious after many fearsome battles.</French>
    <German>Your unit emerges victorious after many fearsome battles.</German>
    <Italian>Your unit emerges victorious after many fearsome battles.</Italian>
    <Spanish>Your unit emerges victorious after many fearsome battles.</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_SPELL_MARNOK_DUNGEONEER_HELP</Tag>
    <English>Explore the dungeon.</English>
    <French>Explore the dungeon.</French>
    <German>Explore the dungeon.</German>
    <Italian>Explore the dungeon.</Italian>
    <Spanish>Explore the dungeon.</Spanish>
    </TEXT>
    <TEXT>
    <Tag>TXT_KEY_SPELL_MARNOK_BARB_DUNGEONEER_HELP</Tag>
    <English>Explore the dungeon.</English>
    <French>Explore the dungeon.</French>
    <German>Explore the dungeon.</German>
    <Italian>Explore the dungeon.</Italian>
    <Spanish>Explore the dungeon.</Spanish>
    </TEXT>
  • Added to CIV4GoodyInfo.xml:
    Spoiler :
    <GoodyInfo>
    <Type>GOODY_MARNOK_BONUS_GEMS</Type>
    <Description>TXT_KEY_GOODY_MARNOK_BONUS_GEMS</Description>
    <Sound/>
    <iGold>10</iGold>
    <iGoldRand1>10</iGoldRand1>
    <iGoldRand2>10</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>0</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>NONE</BarbarianClass>
    <iBarbarianUnitProb>0</iBarbarianUnitProb>
    <iMinBarbarians>0</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_NOTHING</Type>
    <Description>TXT_KEY_GOODY_MARNOK_NOTHING</Description>
    <Sound/>
    <iGold>0</iGold>
    <iGoldRand1>0</iGoldRand1>
    <iGoldRand2>0</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>0</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>NONE</BarbarianClass>
    <iBarbarianUnitProb>0</iBarbarianUnitProb>
    <iMinBarbarians>0</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_TECH</Type>
    <Description>TXT_KEY_GOODY_MARNOK_TECH</Description>
    <Sound/>
    <iGold>0</iGold>
    <iGoldRand1>0</iGoldRand1>
    <iGoldRand2>0</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>1</bTech>
    <bBad>0</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>NONE</BarbarianClass>
    <iBarbarianUnitProb>0</iBarbarianUnitProb>
    <iMinBarbarians>0</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_BARBARIANS_WEAK</Type>
    <Description>TXT_KEY_GOODY_MARNOK_BARBARIANS</Description>
    <Sound>AS2D_GOODY_HOSTILE</Sound>
    <iGold>0</iGold>
    <iGoldRand1>0</iGoldRand1>
    <iGoldRand2>0</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>1</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>UNITCLASS_WARRIOR</BarbarianClass>
    <iBarbarianUnitProb>20</iBarbarianUnitProb>
    <iMinBarbarians>1</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_BARBARIANS_STRONG</Type>
    <Description>TXT_KEY_GOODY_MARNOK_BARBARIANS</Description>
    <Sound>AS2D_GOODY_HOSTILE</Sound>
    <iGold>0</iGold>
    <iGoldRand1>0</iGoldRand1>
    <iGoldRand2>0</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>1</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>UNITCLASS_WARRIOR</BarbarianClass>
    <iBarbarianUnitProb>40</iBarbarianUnitProb>
    <iMinBarbarians>2</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_LIZARDMEN_STRONG</Type>
    <Description>TXT_KEY_GOODY_MARNOK_LIZARDMEN</Description>
    <Sound>AS2D_GOODY_HOSTILE</Sound>
    <iGold>0</iGold>
    <iGoldRand1>0</iGoldRand1>
    <iGoldRand2>0</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>1</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>UNITCLASS_HUNTER</BarbarianClass>
    <iBarbarianUnitProb>40</iBarbarianUnitProb>
    <iMinBarbarians>2</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_SPIDER</Type>
    <Description>TXT_KEY_GOODY_MARNOK_SPIDER</Description>
    <Sound>AS2D_GOODY_HOSTILE</Sound>
    <iGold>0</iGold>
    <iGoldRand1>0</iGoldRand1>
    <iGoldRand2>0</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>1</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>UNITCLASS_GIANT_SPIDER</BarbarianClass>
    <iBarbarianUnitProb>20</iBarbarianUnitProb>
    <iMinBarbarians>1</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_HILLGIANT</Type>
    <Description>TXT_KEY_GOODY_MARNOK_HILLGIANT</Description>
    <Sound>AS2D_GOODY_HOSTILE</Sound>
    <iGold>0</iGold>
    <iGoldRand1>0</iGoldRand1>
    <iGoldRand2>0</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>1</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>UNITCLASS_HILL_GIANT</BarbarianClass>
    <iBarbarianUnitProb>5</iBarbarianUnitProb>
    <iMinBarbarians>1</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_SKELETONS</Type>
    <Description>TXT_KEY_GOODY_MARNOK_SKELETONS</Description>
    <Sound>AS2D_GOODY_HOSTILE</Sound>
    <iGold>0</iGold>
    <iGoldRand1>0</iGoldRand1>
    <iGoldRand2>0</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>1</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>UNITCLASS_SKELETON</BarbarianClass>
    <iBarbarianUnitProb>20</iBarbarianUnitProb>
    <iMinBarbarians>1</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_SPECTRE</Type>
    <Description>TXT_KEY_GOODY_MARNOK_SPECTRE</Description>
    <Sound>AS2D_GOODY_HOSTILE</Sound>
    <iGold>0</iGold>
    <iGoldRand1>0</iGoldRand1>
    <iGoldRand2>0</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>1</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>UNITCLASS_SPECTRE</BarbarianClass>
    <iBarbarianUnitProb>20</iBarbarianUnitProb>
    <iMinBarbarians>1</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_EXPERIENCE</Type>
    <Description>TXT_KEY_GOODY_MARNOK_EXPERIENCE</Description>
    <Sound>AS2D_GOODY_XP</Sound>
    <iGold>0</iGold>
    <iGoldRand1>0</iGoldRand1>
    <iGoldRand2>0</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>5</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>0</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>NONE</BarbarianClass>
    <iBarbarianUnitProb>0</iBarbarianUnitProb>
    <iMinBarbarians>0</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_LOW_GOLD</Type>
    <Description>TXT_KEY_GOODY_MARNOK_GOLD</Description>
    <Sound>AS2D_GOODY_GOLD</Sound>
    <iGold>20</iGold>
    <iGoldRand1>21</iGoldRand1>
    <iGoldRand2>21</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>0</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>NONE</BarbarianClass>
    <iBarbarianUnitProb>0</iBarbarianUnitProb>
    <iMinBarbarians>0</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_HIGH_GOLD</Type>
    <Description>TXT_KEY_GOODY_MARNOK_GOLD</Description>
    <Sound>AS2D_GOODY_GOLD</Sound>
    <iGold>20</iGold>
    <iGoldRand1>51</iGoldRand1>
    <iGoldRand2>51</iGoldRand2>
    <iMapOffset>0</iMapOffset>
    <iMapRange>0</iMapRange>
    <iMapProb>0</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>0</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>NONE</BarbarianClass>
    <iBarbarianUnitProb>0</iBarbarianUnitProb>
    <iMinBarbarians>0</iMinBarbarians>
    </GoodyInfo>
    <GoodyInfo>
    <Type>GOODY_MARNOK_MAP</Type>
    <Description>TXT_KEY_GOODY_MARNOK_MAP</Description>
    <Sound>AS2D_GOODY_MAP</Sound>
    <iGold>20</iGold>
    <iGoldRand1>101</iGoldRand1>
    <iGoldRand2>101</iGoldRand2>
    <iMapOffset>4</iMapOffset>
    <iMapRange>4</iMapRange>
    <iMapProb>100</iMapProb>
    <iExperience>0</iExperience>
    <iHealing>0</iHealing>
    <iDamagePrereq>0</iDamagePrereq>
    <bTech>0</bTech>
    <bBad>0</bBad>
    <UnitClass>NONE</UnitClass>
    <BarbarianClass>NONE</BarbarianClass>
    <iBarbarianUnitProb>0</iBarbarianUnitProb>
    <iMinBarbarians>0</iMinBarbarians>
    </GoodyInfo>

Now, instead of just walking onto a ruin or barrow to destroy it, the player must take some effort and risk. When a unit is on the lair, they gain a spell which allows them to assult the "dungeon". Horrid monsters may emerge, or great rewards may be found.
Because this didn't seem thematically correct for the Clan, I gave them a different spell/action while they are still at peace with the barbarians, which allows them to spend money to attempt to stir up the nest of monsters. The money might be wasted, or the result might be something hostile to the Clan, so there is still a risk. Later I will add units which join the player nstead of just being Barb, and a few more intersting results.
Note, at the moment this Clan option remains even once at war, but the Clan gets the option to plunder the lair too. I left it like that for now, there may be value to risking a payment even when at war with the barbs.

Small problem at present : It is possible to build a city on a lair, and explore it repeatedly... while this is Waterdeepy fun, I think it is too abusable. I might try and make a result which makes a city turn Barb and fill it with monsters!
 
I Hit "Submit" insead of "Preview". Nevermind... reply to self, not crazy-looking at all.

Plans for future:
  • Add more options to each result table. Make more variety or types of results.
  • Make result categories (small monster, big bad monster, treasure, minerals, etc) to make it easier to slot new entries in. So, the python will first generate a random category, then roll within the category to get the result.
  • Perhaps make a special categories 'religion', 'civics', 'leader' and so on, so that different empires woild get different sub-results in each category.
  • Similarly, make changes based on the type of lair explored and the terrain the lair is in.
  • Add extra minor magic items to be found as treasure.
  • Make some category sub-results affected by AC.
  • Add more Lair types. I am experimenting with Hill Giant Steading - hill giants can sometimes occupy a lair or ancient tower and turn it into their castle, where they can periodically use a spell which creates monsters.
  • Create a similar spell/action to deal with Goody Huts. They would then act more like independant villages. I have a few ideas:
    Spoiler :
    • If within your border, pay money to attempt to turn them into a Town.
    • Send a unit to "Survey" the village, pay money, chance a resource will appear. (This village is known for its fine horses. For X gold, would you like to establish a pasture with horses?)
    • Plunder the village
    • Enslave the villagers
    • Rarely, a village can be turned into a city - perhaps this requires a great person?
    • Fortify the village, turning it into a Fort
    • Convince the villagers to move to your nearest city for +popultaion
    ... etc. The idea is, players can "negotiate" with these minor villages or just conquer them - any attempted action might result in failure, or hostility, or both. I might make a weak goody-effect whenever units enter the village, a sort of non-destructive version of the current effect with more focus on minor monetary gains, maps, healing and the like, and less chance of being taught how to fish by a desert village you just destroyed! I would like to somehow track if the village was just liberated from a barbarian monster, I'll look into that later.

I post this in case anyone else might enjoy it, and also welcome opinions/advice/ideas on how I can have even more fun with FFH2!
 
* If within your border, pay money to attempt to turn them into a Town.
* Send a unit to "Survey" the village, pay money, chance a resource will appear. (This village is known for its fine horses. For X gold, would you like to establish a pasture with horses?)
* Plunder the village
* Enslave the villagers
* Rarely, a village can be turned into a city - perhaps this requires a great person?
* Fortify the village, turning it into a Fort
* Convince the villagers to move to your nearest city for +popultaion

... etc. The idea is, players can "negotiate" with these minor villages or just conquer them - any attempted action might result in failure, or hostility, or both. I might make a weak goody-effect whenever units enter the village, a sort of non-destructive version of the current effect with more focus on minor monetary gains, maps, healing and the like, and less chance of being taught how to fish by a desert village you just destroyed! I would like to somehow track if the village was just liberated from a barbarian monster, I'll look into that later.

This would be amazing!

Anyway, nice work. Where is the download link?
 
I've not done a download link yet - at the moment you will need to backup the files and copy/paste the stuff in the spoilers into those files by hand. I'll make a proper modmod (if that is the right term) when I have finalised things a bit more.
 
I've not done a download link yet - at the moment you will need to backup the files and copy/paste the stuff in the spoilers into those files by hand. I'll make a proper modmod (if that is the right term) when I have finalised things a bit more.

Excellent work - dungeons :D

Not sure "modmod" even counts as a word strictly, but it's the one we're all using :)
 
Very sweet :) I had actually forgotten the old thread, but was very fond of the idea when it came up.

You know you could use a python requirement to block the Clan spell from being used when you are not at peace with the Barbarians? And that would let you open it up to the other Barbarian Trait Leaders as well. Could be interesting to let similar spells be cast even on Hellfire :)


Any intention to write some code to make the lairs appear randomly throughout the game? Or possibly provide various Barbarian Units the ability to create them?
 
Thanks for the quick PM reply - I'll start adding it into FF shortly.

I'm planning on adding the following to the mechanic for that version, so I thought I'd post it here as well in case you wanted to use it yourself.


Adventurer Promotion
Better results from exploring lairs.

Granted by default to all Grigori Adventurers (and by extension, their upgrades).
Also granted by the GOODY_MARNOK_EXPERIENCE result ("Your unit emerges victorious after many fearsome battles.").

For the implementation, I'm just going to rearrange the random lookup-tables so that the poor results are at the bottom of the range (0-40 or so) and the positive results are at the top, then check for the promotion and add a fixed value (+20?) to the random number before looking up the result.

The result is that the Adventurer units cannot trigger the very worst results, and receive the best results more often.
 
Any intention to write some code to make the lairs appear randomly throughout the game? Or possibly provide various Barbarian Units the ability to create them?

I'm glad you asked.

One thing is, at the moment I am writing/testing Hill Giant lairs - they can take over a lair or ancient tower and start causing mayhem.

Another thing I had in mind was, if two units of the same monster type are together in a vacant tile, they could settle down and form a new lair together. Double chances of settling if you are playing on Valentine's day.

See? It doesn't have to be all monsters and violence. There's room for sweet romantic lurve in this mod.
... lizardman lurve though, so... ewww.
 
See? It doesn't have to be all monsters and violence. There's room for sweet romantic lurve in this mod.
... lizardman lurve though, so... ewww.

What's wrong with Lizard-luvvin? See I knew this Mazatl girl once that...

I'll stop now.
 
Hmm...I wonder if I'd want that for Adventurers in my modmod, instead of the hero promotion. When combined with my "And Now For something Completely Different" spell (allowing Grigori Heroes to revert again to adventurers and upgrade to a different unit type of unit, keeping the promotions from its previous forms and so letting them be knights/beastmasters/archmages/luonnatar, for example) hero seems too strong. This is largely because upgrading to arcane units over and over again keeps giving them free promotions.

An adventurer promotion that does what you said, plus gives them extra xp from combat and allows heroic strength/defense (an or requirement for these promos) seems like it might fit them better. It would also stop Nietz from being an Archmage/luonnatar/beastmaster.
 
Thanks for the quick PM reply - I'll start adding it into FF shortly.

I'm planning on adding the following to the mechanic for that version, so I thought I'd post it here as well in case you wanted to use it yourself.


Adventurer Promotion
Better results from exploring lairs.

Granted by default to all Grigori Adventurers (and by extension, their upgrades).
Also granted by the GOODY_MARNOK_EXPERIENCE result ("Your unit emerges victorious after many fearsome battles.").

For the implementation, I'm just going to rearrange the random lookup-tables so that the poor results are at the bottom of the range (0-40 or so) and the positive results are at the top, then check for the promotion and add a fixed value (+20?) to the random number before looking up the result.

The result is that the Adventurer units cannot trigger the very worst results, and receive the best results more often.

That's a nice idea, I was trying to think of something like that, some way to make adventurers better at dungeon-delving.

Soon I will sort the results tables into categories, when I do that I'll arrange them in order as you suggest. Also within each category, the "best" results will be at the top. Maybe even special results for Adventurers.
 
Hmm...I wonder if I'd want that for Adventurers in my modmod, instead of the hero promotion. When combined with my "And Now For something Completely Different" spell (allowing Grigori Heroes to revert again to adventurers and upgrade to a different unit type of unit, keeping the promotions from its previous forms and so letting them be knights/beastmasters/archmages/luonnatar, for example) hero seems too strong. This is largely because upgrading to arcane units over and over again keeps giving them free promotions.

An adventurer promotion that does what you said, plus gives them extra xp from combat and allows heroic strength/defense (an or requirement for these promos) seems like it might fit them better. It would also stop Nietz from being an Archmage/luonnatar/beastmaster.

I do like the idea of the "Multiclass Adventurers" (which is basically what that spell does). Were you keeping the experience from the old unit or resetting that too? If you reset the experience count, then it does seem a bit powerful, otherwise it's probably ok.

The free promotion issue would definitely be an exploit though. Not sure how you'd go about fixing that tidily though.
 
Maybe even special results for Adventurers.

That should be easy enough too - just create a set of results that require more than 100 in total, so the random roll alone is never enough to achieve them - it would need the Adventurer promotion to have any chance.

I really like the feel of this modmod :D It's bringing the adventuring back to D&D :)
 
Could be cool to have a rand 0-100, with results in the 0-120 range. Thus making only Adventurers with really good roles get the top tier junk (which IMO ought to be randomly selected Equipment. You can easily make 15 of them just be various items with Affinity to the Mana types other than Air/Death)
 
Could be cool to have a rand 0-100, with results in the 0-120 range. Thus making only Adventurers with really good roles get the top tier junk (which IMO ought to be randomly selected Equipment. You can easily make 15 of them just be various items with Affinity to the Mana types other than Air/Death)

I've been thinking about the equipment side of things too. The main thing I've realised though is that if we're going to add a lot of different weapon types, we're going to need to limit the number of weapons that a single unit can carry. Chalid with 57 swords would be an amusing sight, but possibly a little broken.

==

Basic method to do it (though a little intensive) - add a "hasWeapon" check to the "pickupEquipment" check. "hasWeapon" is simply a function that contains a list of all weapon promotions (which we add to as we add new weapons). If the unit has any of those weapon promotions already, it returns true.

The downside is, that the more weapons we add, the slower that check is going to get - just depends if it becomes problematic.
 
Well you wouldn't have to add to the list each time, you could have the list automatically generate itself based off the <bEquipment> tag. Though that does mean cycling through every promotion in the game each time I suppose. But if the call is only made during the "Take Equipment" spell, then it shouldn't cause too large of a slowdown (instead of calling it on the "Req Take Equipment" section. Have it do a pop-up announcing you already have equipment or something).

Alternatively, you could just re-write the take-Equipment spells to cause the unit to drop any <bEquipment> promotions which already have upon casting it. Then you don't have to do a check at all, the player just has to learn not to grab items if they don't want to drop their current ones :)
 
I do like the idea of the "Multiclass Adventurers" (which is basically what that spell does). Were you keeping the experience from the old unit or resetting that too? If you reset the experience count, then it does seem a bit powerful, otherwise it's probably ok.

The free promotion issue would definitely be an exploit though. Not sure how you'd go about fixing that tidily though.

I was keeping both xp and Level (since I was using the <ConvertUnitType> tag; this spell is xml only). Resetting the xp and level would definitely be overpowered (although not so overpowered as resetting the level but not xp :p ), while resetting the xp but not level would be a major nerf.


I think that most of the free promotions that units start with are fine, but some are too much. I simply had to remove channeling 1-3 (and Divine) from the Grigori Medics and Luonnatar. I made Cure Disease and Heal require Medic 2 and 3 instead, and gave these to the Medics (although perhaps it would be better to just give them medic 2, since units with medic 2 can get medic 3 now). I'm thinking that Dragion Slaying is fine, although I'm also considering removing the UU and making this a promotions available only to units with the hero (or adventurer) promotion. It would make sense for Adventurers to start with courage too. I'll let them keep Magic Immune and the command promotions from Luonnatars, but might try to make these effects unit specific instead. I'll probably be reworking how inquisition works, probably sticking with my Enlighten spell (basically inquisition that works regardless of the state religion of units city. I might also add an effect that can remove religions from nearby units too) as a unit specific spell for Luonnatar. I might also give them an Evangelist promotion. This is a new promotion I'm letting disciple units (requiring some religion, if I can figure out how to expose bool CvUnit::canPromote(PromotionTypes ePromotion, int iLeaderUnitId) const to python) get. Through a PyPerTurn effect it has a chance to randomly spread the units religion both to cities and units on the stack; in the case of units irreligious units, it would instead have a chance to remove them. I think it makes sense for Adventurer-Luonnatar to keep this (although it could be odd since you could go Luonnatar -> Adventurer -> Shadow, and then start spreading Esus). I was thinking of letting the Grigori build normal Druids again (actually, I already changed Luonnatar to a Paladin UU and let them have Druids, but I'll probably undo this), but I'm thinking that that could be too powerful, since a Druid turned adept would get all the promotions an Archmage would, with no level requirements.


I'm thinking I may just remove the free promotions from the arcane units. They don't seem to need it as much, now that they get spell sphere promotions based on the mana you have whenever they upgrade. Besides, that many free promotions would probably be too much when I add cross-sphere spells. I was thinking I'd make more mana be required for free promotions, but elimiating the promtions on upgrading may be enough.
 
I've done a little fiddling with the results table ready for the adventurer promotion (as mentioned above) and I've also implemented the possibility for the adventure to "not go well" - the result of which being that you don't manage to destroy the lair, and will have to try again once you've dealt with whatever it is down there that chased you off in the first place. Probably need to adjust the TXT_KEYs for those results to highlight the fact that you didn't manage to destroy the lair. Again, the chance of failure makes the Adventurer promotion more valuable - they basically have only 1/3 the chance of having a botched adventure compared to a non-adventurer.

Code:
def spellMarnokDungeoneer(caster):
	iPlayer = caster.getOwner()
	pPlot = caster.plot()
	pPlayer = gc.getPlayer(caster.getOwner())
	iRnd = CyGame().getSorenRandNum(100, "Rob Grave")
	bSuccessful = True
		
	iAdventurer = gc.getInfoTypeForString('PROMOTION_ADVENTURER')
	if caster.isHasPromotion(iAdventurer):
		iRnd = iRnd + 20
				
	
	if iRnd < 5:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_HILLGIANT'), caster)
		bSuccessful = False
	if iRnd >= 5 and iRnd < 15:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_LIZARDMEN_STRONG'), caster)
		bSuccessful = False
	if iRnd >= 15 and iRnd < 25:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_SKELETONS'), caster)
		bSuccessful = False
	if iRnd >= 25 and iRnd < 30:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_NOTHING'), caster)
		bSuccessful = False		
	if iRnd >= 30 and iRnd < 40:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_BARBARIANS_STRONG'), caster)	
	if iRnd >= 40 and iRnd < 45:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_SPIDER'), caster)
	if iRnd >= 45 and iRnd < 50:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_SPECTRE'), caster)
	if iRnd >= 50 and iRnd < 65:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_BARBARIANS_WEAK'), caster)
	if iRnd >= 65 and iRnd < 75:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_EXPERIENCE'), caster)
		caster.setHasPromotion(iAdventurer, True)
	if iRnd >= 75 and iRnd < 80:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_LOW_GOLD'), caster)
	if iRnd >= 80 and iRnd < 90:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_HIGH_GOLD'), caster)
	if iRnd >= 90 and iRnd < 95:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_MAP'), caster)	
	if iRnd >= 95 and iRnd < 99:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_TECH'), caster)
	if iRnd >= 99 and iRnd < 103:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_BONUS_GEMS') , caster)
		pPlot.setBonusType(gc.getInfoTypeForString('BONUS_GEMS'))
	if iRnd >= 103 and iRnd < 110:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_TREASURE_VAULT') , caster)
	if iRnd >= 110 and iRnd < 115:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_FAMOUS_ADVENTURE') , caster)
		caster.setHasPromotion(iCourage, True)
		caster.setHasPromotion(iValor, True)		
	if iRnd >= 115:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_MARNOK_MAGIC_ITEM') , caster)
		iItem = receiveDungeonMagicItem(caster)

	if (bSuccessful == True):
		pPlot.setImprovementType(-1)


def receiveDungeonMagicItem(caster)
	iEquipment = gc.getInfoTypeForString('EQUIPMENT_JADE_TORC')
	
	iPromotion = gc.getUnitInfo(iEquipment).getEquipmentPromotion()
	if caster.isHasPromotion(iPromotion == False):
		caster.setHasPromotion(iPromotion, True)
	else
		newUnit = pPlayer.initUnit(iEquipment, caster.getX(), caster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)

EDIT: Added in Marnok's results for "Experience" and "Nothing" (with nothing being along the lines of "Your unit fights hard, but is driven away by the monsters within"). Also moved "GOODY_MARNOK_MAP" to be a higher result as it represents a Treasure Map (reveals area and grants gold) - I assumed it was just a normal map result initially.

EDITEDIT: Added the "Adventurer" only results.

  • Treasure Vault - much gold ("Deep in the dungeon your unit finds a room filled with treasure!")
  • Famous Adventure - much gold, some experience and gains Courage and Valor promotions ("The battle is truly epic and so are the spoils. Your unit has emerged victorious and the bards are telling the story in taverns across the land.")
  • Magic Item - gain a magic item ("Your unit slays the leader of the monsters in single combat and claims a magic item from its corpse").

At the moment, only the JADE_TORC can be found. Once a few more items are available, they can easily be included. If the unit already has the item in question, it creates it on the floor instead.
 
Well you wouldn't have to add to the list each time, you could have the list automatically generate itself based off the <bEquipment> tag. Though that does mean cycling through every promotion in the game each time I suppose. But if the call is only made during the "Take Equipment" spell, then it shouldn't cause too large of a slowdown (instead of calling it on the "Req Take Equipment" section. Have it do a pop-up announcing you already have equipment or something).

Alternatively, you could just re-write the take-Equipment spells to cause the unit to drop any <bEquipment> promotions which already have upon casting it. Then you don't have to do a check at all, the player just has to learn not to grab items if they don't want to drop their current ones :)

I'm not sure that is a good idea; there is no reason you cannot carry a sword while wearing a crown, or to carry both a sword and shield.

The equipment that should be mutually exclusive should also really be mutually exclusive with the weapons promotions. I'll probably make it like that in my modmod (where weapons promos will probably be handled basically like equipment


I'm also thinking that it would be good if you could load equipment into other units, having it carry the equipment instead of actually using it. It wouldn't be hard to create a SPECIALUNIT_EQUIPMENT category and let units carry some amount of these. However, units that can carry birds (or, in my modmod, the RoK UUs that can carry siege units) or can carry normal cargo couldn't carry equipment that way, unless changes were made in the SDK related to cargo. I would personally really like if it were changed, so that you could let different units carry different amounts of different domain and specialunit cargo, and so that cargo could carry cargo (for example, a ranger with a hawk could use a caravel to get to a different continent, like before BtS). I such changes were made, I think it would also be a good idea to add a tag that represents the "size" or "weight of the cargo, so for instance it would take more to carry more scouts than war elepnants, or a unit could carry a small piece of equipment like a magic ring, but the whole dragon's horde.
 
I've done a little fiddling with the results table ready for the adventurer promotion (as mentioned above) and I've also implemented the possibility for the adventure to "not go well" - the result of which being that you don't manage to destroy the lair, and will have to try again once you've dealt with whatever it is down there that chased you off.

Great minds... I was just scribbling some notes and I'd put a % chance of destroying lair next to each result, with a roll at the end to see if it gets collapsed. I had noted that good results should destroy, because you have "found the treasure" or whatever. Perhaps extremely BAD results could do so too. (because you already have enough trouble)

Will probably need to adjust the TXT_KEYs for those results to highlight the fact that you didn't manage to destroy the lair. Again, the chance of failure makes the Adventurer promotion more valuable - they basically have only 1/3 the chance of having a botched adventure compared to a non-adventurer.

The problem now is that without the "adventurer-results", they also have a 21% chance of finding gems instead of 1%...

My plan is to have more "top" results. So although adventurers will still score the top result category, there will only be a smallish chance of that category returning Gems. Here's the rough thoughts I had notepadded for categories.
Spoiler :
SeriouslyBadRandomStuff
You opened a portal to hell, tried to shut it, and hurt your thumb​
BigBadMonsters
Hill Giant
Spiders
Azer
Elementals
Big Barbarian spawn
... type based on terrain/type of lair?​
WierdRandomBadStuff
Suffer Damage, maybe even Die
Get driven beserk (chance to turn Barbarian each turn)
Turn Barbarian on the spot
Lost in the caverns - can't move for X turns​
RegularMonsters
Regular sized spawns
...type based on terrain?​
WierdRandomNeutralStuff
Get Mutated
Teleported, or emerge from lair a few tiles away​
SmallGoodies
Gold
Experience
Minor magic like Healing potions or gaining Enchanted Weapon ability​
WierdRandomGoodStuff

BigGoodies
Rescue a prisoner (free great person of random type)
Find a mineral resource : gems, mithril, etc
Magic Items
Huge amounts of Gold​
Is that a useful direction to take?
Another idea would just be to let Adventurers make 2 rolls and keep the highest. But then they don't get their own category I suppose...

Completely seperate thought, penalty for cavalry exploring lairs? :lol:
 
Top Bottom