local burnVectorMin = Vector(-250, -250, -250) local burnVectorMax = Vector(250, 250, 250) function FlamethrowerHex(_, activator) if not activator then return end if activator.m_iClass ~= 7 then return end precache.PrecacheParticle("spell_fireball_tendril_parent_red") BurnEffectTimer = 0 if IsValid(BurnCooldown) then timer.Stop(BurnCooldown) end if BurnEffectTimer < 0 or 10 or -1 then BurnEffectTimer = 0 end SecondaryBonusTimer = 0 local isPrimaryActive = activator:GetPlayerItemBySlot(0) local getSecondary = activator:GetPlayerItemBySlot(1) local isBurnAbilityReady = true local particleVec = Vector(0, 80, 0) DefaultHudTextParams = { channel = 3, --Channel number 0 - 5, -- Channel 0 is used to display wave explanation, -- Channel 1 is used to display cash in reverse mvm, x = -0.2, -- X coordinate from 0 to 1, -- -1 for center positon, -- Text is wrapped so it does not overflow the screen y = 0.75, -- Y coordinate from 0 to 1, -- -1 for center positonText is wrapped so it does not overflow the screen effect = 0, -- 0,1 - fade in/fade out text, -- 2 - typeout text r1 = 101, -- 0 - 255 range, -- The text is rendered additively, black text will not display g2 = 71, -- 0 - 255 range, -- The text is rendered additively, black text will not display b1 = 64, -- 0 - 255 range, -- The text is rendered additively, black text will not display a1 = 0, -- 0 - 255 range, -- 0 - fully visible, 255 - invisible a2 = 0, -- 0 - 255 range, -- 0 - fully visible, 255 - invisible fadeinTime = 0, -- Time to fade in text fadeoutTime = 0, -- Time to fade out text holdTime = 9999, -- Time the text is fully displayed fxTime = 0, -- Time to type a single letter with typeout effect } DisplayTextHUD = timer.Create(0.015, function () if activator.m_iClass == 7 then if isBurnAbilityReady == true and BurnEffectTimer <= 0 then activator:ShowHudText(DefaultHudTextParams, "Alt-Fire Ready!") else activator:ShowHudText(DefaultHudTextParams, "Alt-Fire ready in: "..BurnEffectTimer) end else return end end, 0) BurnTimerFunction = timer.Create(1, function () if not IsValid(getSecondary) then return end --print(SecondaryBonusTimer) SecondaryBonusTimer = SecondaryBonusTimer - 1 if SecondaryBonusTimer <= 0 then getSecondary:SetAttributeValue("damage bonus vs burning", nil) getSecondary:SetAttributeValue("fire rate bonus HIDDEN", nil) getSecondary:SetAttributeValue("Reload time decreased", nil) getSecondary:SetAttributeValue("mult crit dmg", nil) getSecondary:SetAttributeValue("passive reload", nil) getSecondary:SetAttributeValue("mult projectile count", nil) getSecondary:SetAttributeValue("minicrit vs burning player", nil) -- reserve shooter getSecondary:SetAttributeValue("mult dmg vs giants", nil) -- manmelter getSecondary:SetAttributeValue("explode_on_ignite", nil) getSecondary:SetAttributeValue("dmg penalty vs players", nil) activator:SetAttributeValue("deploy time decreased", nil) end end, 0) function ApplyAbilities() SecondaryBonusTimer = 10 --local secondaryAmmo = getSecondary.m_iClip1 --increase damage of secondaries if weapon has burn damage local getCurBurnDamage = 1.25 if isPrimaryActive:GetAttributeValue("weapon burn dmg increased") == nil then getCurBurnDamage = 1.25 else getCurBurnDamage = 1.25 * isPrimaryActive:GetAttributeValue("weapon burn dmg increased") end activator:SetAttributeValue("deploy time decreased", 0.25) --shotgun if getSecondary:GetClassname() == "tf_weapon_shotgun_pyro" or getSecondary:GetClassname() == "upgradeable tf_weapon_shotgun_primary" and SecondaryBonusTimer >= 0 then --getSecondary.m_iClip1 = secondaryAmmo + 1 getSecondary:SetAttributeValue("damage bonus vs burning", getCurBurnDamage) getSecondary:SetAttributeValue("fire rate bonus HIDDEN", 0.5) getSecondary:SetAttributeValue("Reload time decreased", 0.5) getSecondary:SetAttributeValue("passive reload", 1) if getSecondary:GetItemName() == "The Reserve Shooter" then getSecondary:SetAttributeValue("minicrit vs burning player", 1) end end --flaregun if getSecondary:GetClassname() == "tf_weapon_flaregun" or getSecondary:GetClassname() == "tf_weapon_flaregun_revenge" and SecondaryBonusTimer >= 0 then getSecondary:SetAttributeValue("mult crit dmg", getCurBurnDamage) getSecondary:SetAttributeValue("Reload time decreased", 0.5) getSecondary:SetAttributeValue("mult projectile count", 2) if getSecondary:GetItemName() == "tf_weapon_flaregun_revenge" then getSecondary:SetAttributeValue("mult dmg vs giants", 2) end end --gas if getSecondary:GetItemName() == "The Gas Passer" and SecondaryBonusTimer >= 0 then getSecondary.m_flEffectBarRegenTime = 200 getSecondary:SetAttributeValue("explode_on_ignite", 1) getSecondary:SetAttributeValue("dmg penalty vs players", 0.429) -- --this inherits flare attribs, why -- getSecondary:SetAttributeValue("mult crit dmg", nil) -- getSecondary:SetAttributeValue("damage bonus vs burning", nil) -- getSecondary:SetAttributeValue("Reload time decreased", nil) -- getSecondary:SetAttributeValue("mult projectile count", nil) end if getSecondary:GetItemName() == "The Thermal Thruster" and SecondaryBonusTimer >= 0 then getSecondary:SetAttributeValue("explode_on_ignite", 1) getSecondary:SetAttributeValue("dmg penalty vs players", 0.429) -- --this inherits flare attribs, why -- getSecondary:SetAttributeValue("mult crit dmg", nil) -- getSecondary:SetAttributeValue("damage bonus vs burning", nil) -- getSecondary:SetAttributeValue("Reload time decreased", nil) -- getSecondary:SetAttributeValue("mult projectile count", nil) end end function PlayParticleEffect() local particleOrigin = activator:GetAbsOrigin() BurnParticle = timer.Create(0.01, function () BurnParticleTime = 1 local attackerOriginEnemy = activator:GetAbsOrigin() local entitiesBurnRangeEnemy = ents.FindInBox(attackerOriginEnemy+burnVectorMin, attackerOriginEnemy+burnVectorMax) util.ParticleEffect("heavy_ring_of_fire", particleOrigin, particleVec, isPrimaryActive) for _, entityWeFound in pairs(entitiesBurnRangeEnemy) do if entityWeFound:IsBot() == true then local enemyPosition = entityWeFound:GetAbsOrigin() util.ParticleEffect("spell_fireball_tendril_parent_red", enemyPosition, particleVec, entityWeFound) if entityWeFound:InCond(22) then local enemyCount = 0 enemyCount = enemyCount + 1 local enemyHealth = entityWeFound.m_iHealth BurnBonusTimerSeconds = 0 BurnBonusTimerSeconds = BurnBonusTimerSeconds + enemyCount * 2 if BurnBonusTimerSeconds >= 10 then BurnBonusTimerSeconds = 10 end if entityWeFound:GetAttributeValue("override footstep sound set") == nil then activator:AddHealth((enemyHealth / enemyCount) / 4, true) end end goto FindNextEntity end ::FindNextEntity:: end BurnParticleTime = BurnParticleTime - 1 if BurnParticleTime <= 0 then if not IsValid(BurnParticle) then return end --util.ParticleEffect("heavy_ring_of_fire", particleOrigin, particleVec, isPrimaryActive) timer.Stop(BurnParticle) else timer.Stop(BurnParticle) return end end, 1) end local HexCallback = activator:AddCallback(ON_KEY_RELEASED, function(user, key) if not IsValid(activator) or key ~= IN_ATTACK2 or not user:IsAlive() or not activator:IsAlive() or not IsValid(isPrimaryActive) then return end if activator.m_hActiveWeapon ~= isPrimaryActive then return end if key == IN_ATTACK2 and isBurnAbilityReady == true then --print("Attack is allowed") if BurnEffectTimer <= 0 then BurnEffectTimer = 10 end isPrimaryActive:SetAttributeValue("no_attack", 1) activator:SetAttributeValue("dmg taken increased", 0.1) activator:AddCond(28) local attackerOrigin = activator:GetAbsOrigin() local entitiesBurnRange = ents.FindInBox(attackerOrigin+burnVectorMin, attackerOrigin+burnVectorMax) local getCurDamageBonus = nil --increase damage if damage bonus is active if isPrimaryActive:GetAttributeValue("damage bonus") == nil then getCurDamageBonus = 35 else getCurDamageBonus = 35 * isPrimaryActive:GetAttributeValue("damage bonus") goto continue end ::continue:: HexDamageBurn = { Attacker = activator, Inflictor = nil, Weapon = isPrimaryActive, Damage = getCurDamageBonus, DamageType = DMG_BURN, CritType = 0, DamagePosition = attackerOrigin, ReportedPosition = attackerOrigin } HexDamageBurnCrit = { Attacker = activator, Inflictor = nil, Weapon = isPrimaryActive, Damage = 3 * getCurDamageBonus, DamageType = DMG_BURN, CritType = 2, DamagePosition = attackerOrigin, ReportedPosition = attackerOrigin } if isBurnAbilityReady == true then PlayParticleEffect() end for _, entityWeFound in pairs(entitiesBurnRange) do if entityWeFound:IsBot() == true and entityWeFound:IsAlive() == true then if entityWeFound:InCond(22) or entityWeFound.m_fFlags == 27 then --print("has the cond") local enemyPosition = entityWeFound:GetAbsOrigin() entityWeFound:TakeDamage(HexDamageBurnCrit) BurnEffectTimer = 1 util.ParticleEffect("projectile_fireball_crit_red", enemyPosition, particleVec, entityWeFound) ApplyAbilities() goto FindNextEntity end if not entityWeFound:InCond(22) and not entityWeFound.m_fFlags == 27 then entityWeFound:TakeDamage(HexDamageBurn) --print("not the cond") BurnEffectTimer = 10 end goto FindNextEntity end ::FindNextEntity:: end activator:PlaySound("Halloween.spell_fireball_cast") isBurnAbilityReady = false if BurnCooldown == nil then BurnCooldown = timer.Create(1, function () BurnEffectTimer = BurnEffectTimer - 1 if BurnEffectTimer <= 10 or BurnEffectTimer == 0 then local timedPrimaryActive = activator:GetPlayerItemBySlot(0) timedPrimaryActive:SetAttributeValue("no_attack", nil) activator:SetAttributeValue("dmg taken increased", nil) activator:RemoveCond(28) end if BurnEffectTimer <= 0 then isBurnAbilityReady = true timer.Stop(BurnCooldown) BurnCooldown = nil -- timer.Stop(BurnCooldown) -- BurnCooldown = nil end end, 0) end end -- if key == IN_ATTACK2 and isBurnAbilityReady == false then -- --print("Attack is not allowed") -- end end) end function OnWaveInit(wave) if not IsValid(BurnCooldown) then return end timer.Stop(BurnCooldown) end