Damage skill that gives gold on death

bane25

New Member
Reaction score
1
I'm trying to make a skill that works like storm bolt (i.e. does damage and stuns), and if the target dies while it has that specific stun buff, you get bonus money for it.

Anyone have any ideas?
Thanks ahead of time.

(This is kind of similar to the Dota skill track.)
 

fgw

New Member
Reaction score
1
I'm trying to make a skill that works like storm bolt (i.e. does damage and stuns), and if the target dies while it has that specific stun buff, you get bonus money for it.

Anyone have any ideas?
Thanks ahead of time.

(This is kind of similar to the Dota skill track.)

Something like this might work

Trigger:
  • Untitled Trigger 034
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Ability being cast) Equal to (Ability being cast)
    • Actions
      • Player - Add 1000 to (Triggering player) Current gold


Still new though, so don't take my word for it. =P
 

jomik

New Member
Reaction score
17
Something like this might work

Trigger:
  • Untitled Trigger 034
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Ability being cast) Equal to (Ability being cast)
    • Actions
      • Player - Add 1000 to (Triggering player) Current gold


Still new though, so don't take my word for it. =P

Well, that might mess up because there's no ability being cast? :p

Probably this is more secure:
Trigger:
  • Give gold when storm bolt kills
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) has buff Stunned (Pause)) Equal to True
    • Actions
      • Player - Add 1000 to (Owner of (Killing unit)) Current gold


In conditions change the has buff to your buff (Stunned (Pause) is the one used for storm bolt I think :p) and actions you set how much gold you want to add.
This is free hand, I haven't tested it. And if you cast storm bolt, and kills it while it's stunned you'll also get gold...
 

Moridin

Snow Leopard
Reaction score
144
Edit: Jomik's triggers will work so long as there is a specific stun buff on the targeted units that is present no where else. If you DON'T have that buff, then:

This probably will work though:

Trigger:
  • Trigger 1
    • Events
      • Unit - A unit starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <Your ability>
    • Actions
      • Unit Group - Pick all units in Range <the range of your ability> of (Target point of ability being cast) and Unit Group - Add (Picked unit) to Selected --->Unit group variable
      • Timer - Start timer_variable as a one shot <duration of the stun> second one-shot timer


Trigger:
  • Trigger 2
    • Events
      • Unit - A unit dies
    • Conditions
      • (Triggering unit) belongs to Selected
    • Actions
      • Player - Add <gold> to (Owner of (Killing unit) Current gold


Trigger:
  • Trigger 3
    • Events
      • Timer - timer_variable expires
    • Conditions
    • Actions
      • Unit Group - Remove all units from Selected


Note: freehand, not MUI.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, you'll have to trigger the whole thing...

And detect when the stormbolt hits the unit and then check if it is dead...

@ fgw: Sorry but that won't work, since the event "Unit - A unit Dies" doesn't provide the event response "(Ability being cast)"...
 

jomik

New Member
Reaction score
17
I don't see why mine wont work? And he said as long as the unit has the specific buff, it didn't have to die from the spell. But can you please explain why the buff cannot be present anywhere else?
 

Slapshot136

Divide et impera
Reaction score
471
well if it was present on another spell, that other spell would also end up having this added bonus
 

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
jomik's example is the only one that works best for this, only you guys need to understand that this "buff" needs to be created specifically for this spell, not as a all around buff for each and every spell.
I have this idea that he is an experienced mapper, don't judge someone at his post count.

Also, helping people differs from requesting a spell. So an example doesn't have to be exact.
 

jomik

New Member
Reaction score
17
@Moridin, Thanks :O I'm trying my best to act like one, seeing for how long I've mapped :p

- I've been mapping with GUI triggers for like 2-3 years, with some breaks though :O -dunno if that makes me a good mapper though :p I pretty much enjoy the scripting, and always get stuck when I have to make the terrain :p Now I'm trying JASS lol :p

And I failed to say that you shouldn't use the buff for anything else. But thought that were pretty much a given :O
But if you decide to use Moridins trigger you should make sure to remove the group and point leak it has :O
 

jomik

New Member
Reaction score
17
Woops, thanks Moridin :p I forgot to add the link :O I looked for the link, edited my thread to put it there, but apparently I forgot why I had opened the search :D
 

jomik

New Member
Reaction score
17
Yeah, I think I'm gonna actually :p I'd still need to remove those shitty leaks in JASS -.-
 

bane25

New Member
Reaction score
1
This post is getting off topic... whatever.

Thanks for all your help (although I do prefer JASS)...

And no, I am not an experienced mapper (unless 1/2 year including breaks counts).




Also: I want it so the caster of the ability gets the money, not the person who actually killed the target (what are allies, anyway?).
 

jomik

New Member
Reaction score
17
Well, I think this would be the JASS one:
JASS:
function True takes nothing returns boolean
    return true
endfunction

function Cond takes nothing returns boolean
    return GetUnitAbilityLevel(GetTriggerUnit(), 'BPSE') > 0                                    //Change BPSE to your Buff ID (This is for Stunned(Paused))
endfunction

function Act takes nothing returns nothing
    call SetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD, 1000)    //Here you can change the gold given (1000 is set now)
endfunction

function InitTrig_Storm_bolt_Addon takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer i = 0
    loop
        exitwhen i > 15
            call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_DEATH, Filter(function True))
        set i = i + 1
    endloop
    call TriggerAddCondition(t, Filter(function Cond))
    call TriggerAddAction(t, function Act)
endfunction


But bear with me. This is the first actual trigger I made in JASS by myself :p lol So please answer if it works and such :p

EDIT: Just ran a Syntax Check, found a misplaced ; from my other scripting language :p and the first function should return boolean :p Fixed now lol
 

jomik

New Member
Reaction score
17
Freehand :p Probably wont work that well then :D
I just updated the code, there were 2 more errors lol :p Use that one :) I'm tired :D:p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top