#Consumable moonshard

1 messages · Page 1 of 1 (latest)

gleaming iris
#

Hi, I want to implement stackable and consumable moonshard. Let's say I have moonshard with a stack of 5, and each stack, when consumed, will add 100 Attack Speed (AS). so in then my AS should be 500. Is there any reference?

LIke in dota imba

sweet bridge
#

That should actually be really easy to do.

Stackable moonshard as an item can be done by adjusting the KV to allow stacks. You can look at the KV of any item that can be stacked like Clarity or Healing Salve.

You will set up a moonshard speed modifier, which returns a value of attack speed per stack * self:GetStackCount(), so it will accumulate attack speed based on stacks.

In OnSpellStart() of the item, you check if the moonshard speed modifier exists. If it does, then you increment its stack count by 1; if not, you create it and set its stack count as 1.

sweet bridge
gleaming iris
#

@sweet bridge
Hi, thank you for reaching out. I just read about the modifier in Valve Software, then looked at the source code for the Moon Shard item in Dota Imba, and also took a quick look at the Clarity item.

In Dota Imba, why create two modifiers? The first one for stackable, and the second for the active modifier?

sweet bridge
#

According to Dota rules at the time it was written (I cannot remember if it changed), you can either:

  • Hold onto the item, keeping it equipped, but not use (cast) it - this gives you a passive attack speed bonus and a night vision bonus
  • Use the item, sacrificing it and getting a small attack speed bonus as a tradeoff for the item slot which is now free.

For instance, you could hold 3 Moon Shards or use some/all of them

#

So the first modifier is for the item itself (bonuses gained by holding the item), the second modifier is for when the item is sacrificed and becomes a permanent bonus

gleaming iris
#

i see, okay, got it

#

i have another question, its out of topic. how to add sound like in dota imba when hero cast his specific spell like darude sand storm, i will survive "dazzle". Do i need to implement all lua logic? i just need to place this code

if USE_MEME_SOUNDS and RollPercentage(MEME_SOUNDS_CHANCE) then
        EmitSoundOn(sound_darude, caster)
    else
        EmitSoundOn(sound_loop, caster)
    end

all i must implement all the logic, like dmg etc

sweet bridge
#

Just to make sure I understand the question. You're asking whether you can use the original Dota's Sandstorm ability, but use a different sound instead of the one it actually uses?

#

The answer is yes, you can, but it's a little bit of hacking around. You have to listen to ability casts, make sure it's Sandstorm, then decide whether to stop the Sandstorm sound being emitted and instead play your own sound instead. Depending on how Valve did it (which we cannot know), it might not work as well as you'd want.

Additionally, you'll have to know when to stop it, since Sandstorm can be stopped prematurely or essentially last for a long time

gleaming iris
#

hmm ok thank you for that help, i have anoher question

#

How to, when the round starts, a skill appears at a certain point on the map, and this skill is Jakiro's ultimate with Scepter, forming a cross shape.

#

✝️