Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Grease ignitable #106

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions cdtweaks/languages/english/weidu.tra
Original file line number Diff line number Diff line change
Expand Up @@ -457,33 +457,7 @@ The uninstall messages above are normal and expected.

@264000 = "PnP Potions [Luke]"

@265000 = "Spontaneous Casting for Clerics [Luke]"

@266000 = "Weapon Finesse feat for Thieves [Luke]"

@267000 = "Dual-Wield feat for Rangers [Luke]"

@268000 = ~"Force" the Archer kit to use bows [Luke]~

@269000 = "NWN-ish Armor vs. Dexterity [Luke]"

@270000 = "Defensive Roll feat for Thieves [Luke]"

@271000 = "Divine Grace / Dark Blessing feat for Paladins / Blackguards [Luke]"

@272000 = "Good Aim racial feat for Halflings [Luke]"

@273000 = "Cleave Feat for Fighters [Luke]"

@274000 = "Sneak Attack class feat for Blackguards [Luke]"

@275000 = "Fearless racial feat for Halflings [Luke]"

@276000 = "Poison Save class feat for Assassins [Luke]"

@277000 = "Planar Turning class feat for Clerics / Paladins [Luke]"

@278000 = "Circle Kick class feat for Monks [Luke]"
@265000 = "Make Grease ignitable [Luke (EEex)]"

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
Expand Down
26 changes: 1 addition & 25 deletions cdtweaks/languages/italian/weidu.tra
Original file line number Diff line number Diff line change
Expand Up @@ -410,31 +410,7 @@ o rimpiazzata da - un'altra facente parte di uno dei mods installati.~
// @257000 = ~BGT: Limite di esperienza aggiuntivo mentre sei in BG~
// @257100 = ~BGT: Limite di esperienza aggiuntivo in SoA~

@265000 = "Aggiungi talento di classe Lancio Spontaneo per i Chierici [Luke]"

@266000 = "Aggiungi talento Arma Preferita per i Ladri [Luke]"

@267000 = "Aggiungi talento Doppia-Presa per i Ranger [Luke]"

@269000 = "Armatura vs. Destrezza in stile NWN [Luke]"

@270000 = "Aggiungi talento Tiro Difensivo per i ladri [Luke]"

@271000 = "Grazia Divina / Benedizione Oscura per Paladini / Guardie Nere [Luke]"

@272000 = "Aggiungi talento razziale Buona Mira per gli Halfling [Luke]"

@273000 = "Aggiungi talento di classe Incalzare per i Guerrieri [Luke]"

@274000 = "Aggiungi talento di classe Attacco Furtivo per Guardie Nere [Luke]"

@275000 = "Aggiungi talento razziale Temerario per gli Halfling [Luke]"

@276000 = "Aggiungi talento di classe Resistenza ai Veleni per Assassini [Luke]"

@277000 = "Aggiungi talento di classe Scacciare Creature Extraplanari per Paladini e Chierici [Luke]"

@278000 = "Aggiungi talento di classe Calcio Rotante per i Monaci [Luke]"
@265000 = "Rendi Unto infiammabile [Luke (EEex)]"

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
Expand Down
22 changes: 11 additions & 11 deletions cdtweaks/lib/comp_2650.tpa
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
///// \\\\\
///// Spontaneous Casting for Clerics \\\\\
///// \\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
///// /////
///// Make Grease Ignitable \\\\\
///// \\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////

WITH_SCOPE BEGIN
INCLUDE "cdtweaks\luke\misc.tph"
INCLUDE "cdtweaks\lib\spontaneous_casting.tph"
WITH_TRA "cdtweaks\languages\english\spontaneous_casting.tra" "cdtweaks\languages\%LANGUAGE%\spontaneous_casting.tra" BEGIN
LAF "SPONTANEOUS_CASTING" END
END
//
INCLUDE "cdtweaks\lib\make_grease_ignitable.tph"
//
LAF "MAKE_GREASE_IGNITABLE" END
END
14 changes: 14 additions & 0 deletions cdtweaks/lib/make_grease_ignitable.tph
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
DEFINE_ACTION_FUNCTION "MAKE_GREASE_IGNITABLE"
BEGIN
ACTION_IF !(FILE_EXISTS_IN_GAME "SOFLAMC.BAM") BEGIN
COPY "cdtweaks\luke\bam\soflamc.bam" "override"
END
ACTION_IF !(FILE_EXISTS_IN_GAME "#SHROUD.VVC") BEGIN
COPY "cdtweaks\luke\vvc\#shroud.vvc" "override"
END
ACTION_IF !(FILE_EXISTS_IN_GAME "MISC_01C.WAV") BEGIN
COPY "cdtweaks\luke\wav\misc_01c.wav" "override"
END
//
LAF "APPEND_LUA_FUNCTION" STR_VAR "description" = "Misc Tweaks" "sourceFileSpec" = "cdtweaks\luke\lua\tweaks\make_grease_ignitable.lua" "destRes" = "m_gttwks" END
END
Binary file added cdtweaks/luke/bam/soflamc.bam
Binary file not shown.
151 changes: 151 additions & 0 deletions cdtweaks/luke/lua/tweaks/make_grease_ignitable.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
--[[
+-----------------------+
| Make Grease ignitable |
+-----------------------+
--]]

-- greased targets suffer 3d6 additional fire damage per 1d3 rounds (save vs. breath for half) --

function GTGRSFLM(op403CGameEffect, CGameEffect, CGameSprite)
local dmgtype = GT_Resource_SymbolToIDS["dmgtype"]
--
local roll = Infinity_RandomNumber(1, 3)
--
local spriteActiveStats = EEex_Sprite_GetActiveStats(CGameSprite)
--
local spriteMagicResistRoll = CGameSprite.m_magicResistRoll
--
local savingThrowTable = {
[0x0] = {CGameSprite.m_saveVSSpellRoll, spriteActiveStats.m_nSaveVSSpell},
[0x1] = {CGameSprite.m_saveVSBreathRoll, spriteActiveStats.m_nSaveVSBreath},
[0x2] = {CGameSprite.m_saveVSDeathRoll, spriteActiveStats.m_nSaveVSDeath},
[0x3] = {CGameSprite.m_saveVSWandsRoll, spriteActiveStats.m_nSaveVSWands},
[0x4] = {CGameSprite.m_saveVSPolyRoll, spriteActiveStats.m_nSaveVSPoly}
}
--
local immunityToDamage = EEex_Trigger_ParseConditionalString("EEex_IsImmuneToOpcode(Myself,12)")
--
if CGameEffect.m_effectId == 0xC and EEex_IsMaskSet(CGameEffect.m_dWFlags, dmgtype["FIRE"]) and CGameEffect.m_sourceRes:get() ~= "CDFLMGRS" then
if spriteActiveStats.m_nResistFire < 100 then
if not immunityToDamage:evalConditionalAsAIBase(CGameSprite) then
-- op403 "sees" effects after they have passed their probability roll, but before any saving throws have been made against said effect / other immunity mechanisms have taken place
if spriteMagicResistRoll >= spriteActiveStats.m_nResistMagic then
local success = false
--
for k, v in pairs(savingThrowTable) do
if EEex_IsBitSet(CGameEffect.m_savingThrow, k) then
local adjustedRoll = v[1] + CGameEffect.m_saveMod -- the greater ``CGameEffect.m_saveMod``, the easier is to succeed
local spriteSaveVS = v[2]
--
if adjustedRoll >= spriteSaveVS then
success = true
end
break
end
end
--
if success == false or EEex_IsBitSet(CGameEffect.m_special, 0x8) then -- ignore save check if the Save for Half flag is set
local minLvlCheck = EEex_Trigger_ParseConditionalString(string.format("LevelGT(Myself,%d)", CGameEffect.m_minLevel - 1))
if CGameEffect.m_minLevel <= 0 or minLvlCheck:evalConditionalAsAIBase(CGameSprite) then
local maxLvlCheck = EEex_Trigger_ParseConditionalString(string.format("LevelLT(Myself,%d)", CGameEffect.m_maxLevel + 1))
if CGameEffect.m_maxLevel <= 0 or maxLvlCheck:evalConditionalAsAIBase(CGameSprite) then
--
local effectCodes = {}
--
if roll == 1 then
effectCodes = {
{["op"] = 12, ["p2"] = dmgtype["FIRE"], ["dnum"] = 3, ["dsize"] = 6, ["stype"] = 0x2, ["spec"] = 0x100}, -- 3d6 (save vs. breath for half)
}
else
effectCodes = {
{["op"] = 215, ["res"] = "#SHROUD", ["p2"] = 1, ["dur"] = (6 * roll) - 6}, -- play visual effect (Over target (attached))
{["op"] = 12, ["p2"] = dmgtype["FIRE"], ["dnum"] = 3, ["dsize"] = 6, ["stype"] = 0x2, ["spec"] = 0x100}, -- 3d6 (save vs. breath for half)
}
for i = 2, roll do
table.insert(effectCodes, {["op"] = 12, ["p2"] = dmgtype["FIRE"], ["dnum"] = 3, ["dsize"] = 6, ["stype"] = 0x2, ["spec"] = 0x100, ["tmg"] = 4, ["dur"] = (6 * i) - 6}) -- 3d6 (save vs. breath for half)
end
end
--
for _, attributes in ipairs(effectCodes) do
CGameSprite:applyEffect({
["effectID"] = attributes["op"] or EEex_Error("opcode number not specified"),
["dwFlags"] = attributes["p2"] or 0,
["savingThrow"] = attributes["stype"] or 0,
["special"] = attributes["spec"] or 0,
["numDice"] = attributes["dnum"] or 0,
["diceSize"] = attributes["dsize"] or 0,
["res"] = attributes["res"] or "",
["duration"] = attributes["dur"] or 0,
["durationType"] = attributes["tmg"] or 0,
["m_sourceRes"] = "CDFLMGRS",
["sourceID"] = CGameEffect.m_sourceId,
["sourceTarget"] = CGameEffect.m_sourceTarget,
})
end
end
--
maxLvlCheck:free()
end
--
minLvlCheck:free()
end
end
end
end
end
--
immunityToDamage:free()
end

-- greased targets suffer 3d6 additional fire damage per 1d3 rounds (save vs. breath for half) --

EEex_Opcode_AddListsResolvedListener(function(sprite)
-- Sanity check
if not EEex_GameObject_IsSprite(sprite) then
return
end
-- internal function that applies the actual condition
local apply = function()
-- Mark the creature as 'condition applied'
sprite:setLocalInt("cdtweaksMakeGreaseIgnitable", 1)
--
sprite:applyEffect({
["effectID"] = 321, -- Remove effects by resource
["res"] = "CDGRSFLM",
["sourceID"] = sprite.m_id,
["sourceTarget"] = sprite.m_id,
})
sprite:applyEffect({
["effectID"] = 403, -- Screen effects
["durationType"] = 9,
["res"] = "GTGRSFLM", -- Lua func
["m_sourceRes"] = "CDGRSFLM",
["sourceID"] = sprite.m_id,
["sourceTarget"] = sprite.m_id,
})
end
-- since ``EEex_Opcode_AddListsResolvedListener`` is running after the effect lists have been evaluated, ``m_bonusStats`` has already been added to ``m_derivedStats`` by the engine
local spriteGrease = sprite.m_derivedStats.m_bGrease
--
local applyCondition = spriteGrease > 0
--
if sprite:getLocalInt("cdtweaksMakeGreaseIgnitable") == 0 then
if applyCondition then
apply()
end
else
if applyCondition then
-- do nothing
else
-- Mark the creature as 'condition removed'
sprite:setLocalInt("cdtweaksMakeGreaseIgnitable", 0)
--
sprite:applyEffect({
["effectID"] = 321, -- Remove effects by resource
["res"] = "CDGRSFLM",
["sourceID"] = sprite.m_id,
["sourceTarget"] = sprite.m_id,
})
end
end
end)
Binary file added cdtweaks/luke/vvc/#shroud.vvc
Binary file not shown.
Binary file added cdtweaks/luke/wav/misc_01c.wav
Binary file not shown.
7 changes: 7 additions & 0 deletions cdtweaks/readme-cdtweaks.html
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,13 @@ <h3> <a id="contents_rules" name="contents_rules"></a>Rule Changes </h3>
<ul>
<li>Use: automatic, but only available to Monks.</li>
</ul>

<p> <strong>Make Grease Ignitable [Luke]</strong><br />
<em><abbr title="Enhanced Edition">EEex</abbr></em></p>
<p>
"Greased" characters suffer 3d6 (save vs. breath for half) addition fire damage for 1d3 rounds when hit by fire.
</p>

</div>
<div class="ribbon_rectangle_h3">
<h3> <a id="contents_convenience" name="contents_convenience"></a>Convenience Tweaks and/or Cheats </h3>
Expand Down
14 changes: 14 additions & 0 deletions cdtweaks/setup-cdtweaks.tp2
Original file line number Diff line number Diff line change
Expand Up @@ -2990,6 +2990,20 @@ REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ 0 @29
REQUIRE_PREDICATE FILE_EXISTS ~cdtweaks/languages/%LANGUAGE%/circle_kick.tra~ @7
LABEL ~cd_tweaks_circle_kick~

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
///// \\\\\/////
///// Make Grease ignitable \\\\\
///// \\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////

BEGIN @265000 DESIGNATED 2650
GROUP @9
REQUIRE_PREDICATE GAME_IS ~bgee bg2ee eet iwdee~ @25
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ 0 @29
LABEL ~cd_tweaks_make_grease_ignitable~

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
///// \\\\\
Expand Down