Jump to content

Recommended Posts

Hi!
Currently trying to add the elding spear's spell to a custom weapon I made. So far reticule works, proper chargetime, most everything, but I need help with the following:

>Adjusting the length of aoeweapon_lunge's distance
>Making the character glow during lunge (much like wigfrid's actual elding spear effect). I could do owner.AnimState:SetAddColour and LightOverride to OnLunge but I don't know how to revert the character back to normal, except if I brute force it via dotaskintime. I'm sure there's a better method.

Been looking over spear_wathgrithr but can't seem to figure it out myself, and I was hoping one of the many amazing coders here could. Can anyone help out? Thanks!

Edited by sournvitriol2

Hello once again,

I figured out the above (some new math for distance and then use ListenForEvent:"animover" for doer), but now I'm looking towards understanding which prefab spawns during aoeweapon_lunge during the default OnLunged. Am trying to change the swipe effect for it. Can anyone point me to the right direction? Thanks!

Have you checked any type "onuse' or "onhit" methods within the spear prefab ?
Most likely, if any AOE prefab is being spawned in, that is where you should look

EDIT:

This code may be of help

local function LightningSpearCommonFn_Base(inst)
    -- aoeweapon_lunge (from aoeweapon_lunge component) added to pristine state for optimization.
    inst:AddTag("aoeweapon_lunge")

    -- rechargeable (from rechargeable component) added to pristine state for optimization.
    inst:AddTag("rechargeable")

    inst:AddComponent("aoetargeting")
    inst.components.aoetargeting:SetAllowRiding(false)
    inst.components.aoetargeting.reticule.reticuleprefab = "reticuleline"
    inst.components.aoetargeting.reticule.pingprefab = "reticulelineping"
    inst.components.aoetargeting.reticule.targetfn = Lightning_ReticuleTargetFn
    inst.components.aoetargeting.reticule.mousetargetfn = Lightning_ReticuleMouseTargetFn
    inst.components.aoetargeting.reticule.updatepositionfn = Lightning_ReticuleUpdatePositionFn
    inst.components.aoetargeting.reticule.validcolour = { 1, .75, 0, 1 }
    inst.components.aoetargeting.reticule.invalidcolour = { .5, 0, 0, 1 }
    inst.components.aoetargeting.reticule.ease = true
    inst.components.aoetargeting.reticule.mouseenabled = true
end

Same with:
 

local function Lightning_OnAttack(inst, attacker, target)
    if target ~= nil and target:IsValid() and inst:CanElectrocuteTarget(target) and attacker ~= nil and attacker:IsValid() then
        SpawnPrefab("electrichitsparks"):AlignToTarget(target, attacker, true)
    end
end



Both of these functions are found in spear_wathgrithr.lua

Edited by ant7735
Adding Code

Thanks for the snippets, I did check those out. But looks like the FX for the lunge itself is directly tied to the anim itself, and is animated along with the lunge, so I can't modify that without modifying the animation itself. (its called player_lunge in the anim files.)

I was able to change the range and distance of the lunge however. Thanks anyway!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...