[Spell Request] - Confidence

jig7c

Stop reading me...-statement
Reaction score
123
Confidence

Levels: 3
MUI: Yes
Description:
Everytime the hero uses black arrows (auto casting ability), and the enemies dies, while the black arrow is on, it summons a skeleton to fight for the hero...
The black hero is a regular ability and thats fine. For each skeleton raised, the hero gets +4, +6, +8 damage increase, per skeleton. So lets say the hero has killed 3 units with black arrows, and the hero has summoned 3 skeletons, the hero's damage should go up by +12, +18, +24 damage; whichever level the ability is on.

When the skeleton dies, the damage needs to go back down by however much it went up when that skeleton was created. So if the hero is at level 10, and Confidence at level 3, but the hero has no skeleton raised, the damage increase should be +0.

Also, if black arrows are being used and skeletons are being created, but Confidence hasn't been picked, there should be no damage increase...

Level 1: +4 damage for each skeleton raised
Level 2: +6 damage for each skeleton raised
Level 3: +8 damage for each skeleton raised

Reward:
+rep, and the feeling of generosity and intelligence :)

Thank you for reading this post
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Hmm, you can try it urself by using PUI. And the damage, you should put damage bonus ability, make it many levels.
 

jig7c

Stop reading me...-statement
Reaction score
123
Pui?
also I tried making my own triggers, my for some reason it goes up to +28 damage, and then it stops..
and when the skeletons die, the damage doesn't decrease either...

I can't post any triggers because a) they are worth shit, and b) i don't have World editor on this computer...
 

jig7c

Stop reading me...-statement
Reaction score
123
Trigger:
  • HELP
    • event
      • a unit does nothing
    • condition
      • TH Forum member equal to busy and helpful
    • action
      • order threader to bump
      • set TH Forum members = all units registered with thehelper.net matching (matching unit is proficient in JASS)
      • for each integer from 1 to (TH Forum members)
        • order (random unit from TH Forum members) to post help
      • DestroyGroup (udg_TH Forum members)


edited*
 

Tom Jones

N/A
Reaction score
437
Creative, yet calling people lazy doesn't really give anybody incitement to do anything. Remeber we do this voluntarily.
 

Viikuna

No Marlo no game.
Reaction score
265
Hm, Is there any way to find out, which unit used black arrow to summon that black arrow skeleton?

I think you might have to trigger that black arrow too.

I know how to do it for my map, but you dont probably have same systems as I do:

Unit Fires black arrow, we add that unit to unit array BlackArrowGuys using targets ID as an index.

Custom Unit Death system tells me that unit is about to die, I check if it has the buff, find out that black arrow casting unit from unit array, using dying units ID as an array index, create skeleton, add damage to caster using Unit Properties. Damage is based on that Confidense ability level.

Then I would probably need to use some unit array and skeletons ID for getting the guy who summoned it, so I can decerease damage when skeleton dies.
 

Tom Jones

N/A
Reaction score
437
Hm, Is there any way to find out, which unit used black arrow to summon that black arrow skeleton?

I think you might have to trigger that black arrow too.

I know how to do it for my map, but you dont probably have same systems as I do:

Unit Fires black arrow, we add that unit to unit array BlackArrowGuys using targets ID as an index.

Custom Unit Death system tells me that unit is about to die, I check if it has the buff, find out that black arrow casting unit from unit array, using dying units ID as an array index, create skeleton, add damage to caster using Unit Properties. Damage is based on that Confidense ability level.

Then I would probably need to use some unit array and skeletons ID for getting the guy who summoned it, so I can decerease damage when skeleton dies.
JASS:
function Actions takes nothing returns nothing
    local unit caster = GetSummoningUnit()
    local unit summon = GetTriggerUnit() //GetSummonedUnit()

    ...
endfunction


function ... takes nothing returns nothing
    local trigger trig = CreateTrigger()
        
    call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_SUMMON)
    call TriggerAddAction(trig,function Actions)
endfunction
 

Viikuna

No Marlo no game.
Reaction score
265
Well, if that works, it shouldnt be too hard anyways.
 

jig7c

Stop reading me...-statement
Reaction score
123
Viikuna -> i just the regular abilities that is in World Editor for Black arrows, i don't have any system or special trigs setup for that...
 

jig7c

Stop reading me...-statement
Reaction score
123
that will increase all the unit's damage in a area... i just want the hero's damage to increase/decrease per skeleton created/destroyed..
 

Tom Jones

N/A
Reaction score
437
Confidence.​

Description:
  • N/A

Requirements:

Code:
  • vJass.
  • MUI.
  • Leakfree.
    JASS:
    scope Confidence initializer Init
    //####################################################################################################
    //#Confidence - By Tom Jones.
    //####################################################################################################
    //#Requirements:
    //#1) Latest NewGen editor.
    //#2) These object datas:
    //#   a) Confidence (Main Ability) - Must be a hero ability.
    //#   b) A summon ability.
    //#   c) The autogenerated abilities.
    //#
    //#Implementation:
    //#1) Copy/paste this trigger from this map to your map. Save, close, and then open your map again. 
    //#   Disable the below textmacro by setting it to "false".
          //! runtextmacro AutoGenerate("")
    //#2) Modify the options section below. Values that expect rawdata must match the rawdata from your
    //#   your map. To view your map's rawdata, go to the object editor and press ctrl+d.
    //#
    //#Notes:
    //#1) If debug mode is enabled, the maximum appliable damage will be displayed upon learn.
    //#2) To increase maximum appliable damage, find the Auto Generate Macro at the buttom of the script,
    //#   and increase the desired number of abilities to be generated. Enable the above textmacro
    //#   by setting it to "", save, close, and then open your map again. Remember to disable the
    //#   textmacro again.
    //####################################################################################################
    
    //####################################################################################################
    //#Options:
    //####################################################################################################
    globals
        private constant integer SPELL_ID           = 'A000' //Rawcode of the Main ability.
        private constant integer BONUS_DAMAGE       = 4      //Self-explanatory.
        private constant integer BONUS_DAMAGE_CAP   = 28     //Self-explanatory, set to 0 to disable.
        private integer array SUMMON_ID                      //Set values below.   
    endglobals
    
    private function Init takes nothing returns nothing
        //Rawcode of unit ids which should trigger the ability upon summon: 
        set SUMMON_ID[0] = 'ndr1'
        set SUMMON_ID[1] = 'ndr2'
        set SUMMON_ID[2] = 'ndr3'
    endfunction
    
    //###################
    //#Level controllers:
    //####################################################################################################
    private function Bonus_Damage takes integer level returns integer
        return BONUS_DAMAGE+(2*level)
    endfunction
    
    private function Bonus_Damage_Cap takes integer level returns integer
        return BONUS_DAMAGE_CAP+(10*level)
    endfunction
    
    //####################################################################################################
    //#Hashing - Do not modify below here unless you know what you're doing.
    //####################################################################################################
    private function H2I takes handle h returns integer
        return h
        return 0
    endfunction
    
    //####################################################################################################
    //#Custom types.
    //####################################################################################################
    private type power extends integer array [10]
    
    private struct main extends array
        static power Pow = 0
        static integer MaxValue = 0
        static integer MaxAbilities
        static integer BaseId
        trigger trig
        unit u
        integer Bonus
        integer link
        
        static method operator [] takes unit u returns main
            local integer key = H2I(u)-0x100000
            return key-(key/8192)*8192
        endmethod
        
        method operator bonus= takes integer value returns nothing
            local integer i = .MaxAbilities-1
            local integer cap = Bonus_Damage_Cap(GetUnitAbilityLevel(.u,SPELL_ID)-1)
            
            if value > cap and cap > 0 then
                set .Bonus = value
                set value = cap
            elseif value > .MaxValue then
                set .Bonus = .MaxValue
                set value = .MaxValue
            else
                set .Bonus = value
            endif
            loop
                exitwhen i < 0
                if value &gt;= .Pow<i> then
                    set value = value-.Pow<i>
                    call UnitAddAbility(.u,.BaseId+i)
                else
                    call UnitRemoveAbility(.u,.BaseId+i)
                endif
                set i = i-1
            endloop
        endmethod
        
        method operator bonus takes nothing returns integer
            return .Bonus
        endmethod
        
        static method AddBonus takes nothing returns boolean
            local main this = main[GetTriggerUnit()]
            local integer i = 0
            local integer id
            
            if GetTriggerEventId() == EVENT_UNIT_SUMMON then
                set id = GetUnitTypeId(GetSummonedUnit())
            else
                set id = GetUnitTypeId(GetTriggerUnit())
            endif
            loop
                exitwhen SUMMON_ID<i> == null or SUMMON_ID<i> == id
                set i = i+1
            endloop
            if SUMMON_ID<i> != null then
                if GetTriggerEventId() == EVENT_UNIT_SUMMON then
                    set .bonus = .bonus+Bonus_Damage(GetUnitAbilityLevel(.u,SPELL_ID)-1)
                    set main[GetSummonedUnit()].link = this
                else
                    set this = this.link
                    set .bonus = .bonus-Bonus_Damage(GetUnitAbilityLevel(.u,SPELL_ID)-1)
                endif
            endif
            return false
        endmethod
        
        static method onLearn_Conditions takes nothing returns boolean
            return GetLearnedSkill() == SPELL_ID and GetLearnedSkillLevel() == 1
        endmethod
        
        static method onLearn takes nothing returns nothing
            local main this = main[GetTriggerUnit()]
            
            set .u = GetTriggerUnit()
            set .trig = CreateTrigger()
            call TriggerRegisterUnitEvent(.trig,.u,EVENT_UNIT_SUMMON)
            call TriggerRegisterPlayerUnitEvent(.trig,GetTriggerPlayer(),EVENT_PLAYER_UNIT_DEATH,null)
            call TriggerAddCondition(.trig,Condition(function main.AddBonus))
            debug call BJDebugMsg(&quot;|cffffd700&quot;+GetObjectName(SPELL_ID)+&quot;:|r&quot;+&quot; Max appliable damage is &quot;+I2S(.MaxValue)+&quot;.&quot;)
        endmethod
        
        static method onInit takes nothing returns nothing
            local trigger trig = CreateTrigger()
            local main this = main(0)
            local integer i = 0
    
            call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_HERO_SKILL)
            call TriggerAddCondition(trig,Condition(function main.onLearn_Conditions))
            call TriggerAddAction(trig,function main.onLearn)
            set .u = CreateUnit(Player(15),&#039;hfoo&#039;,0,0,0)
            call UnitAddAbility(.u,SPELL_ID)
            set .BaseId = &#039;DaM0&#039;
            set .Pow[0] = 2
            loop
                exitwhen UnitAddAbility(.u,.BaseId+i) == false
                set i = i+1
                set .Pow<i> = .Pow[i-1]*2
                set .MaxValue = .MaxValue+.Pow<i>
            endloop
            set .MaxAbilities = i
            call RemoveUnit(.u)
        endmethod
    endstruct
    
    //####################################################################################################
    //#Auto Generate macro.
    //####################################################################################################
    //! textmacro AutoGenerate takes process
    //$process$! external ObjectMerger w3a AItg DaM0 anam &quot;Damage Modifier&quot; Iatt 1 2 ansf &quot;(+2)&quot;
    //$process$! external ObjectMerger w3a AItg DaM1 anam &quot;Damage Modifier&quot; Iatt 1 4 ansf &quot;(+4)&quot;
    //$process$! external ObjectMerger w3a AItg DaM2 anam &quot;Damage Modifier&quot; Iatt 1 8 ansf &quot;(+8)&quot;
    //$process$! external ObjectMerger w3a AItg DaM3 anam &quot;Damage Modifier&quot; Iatt 1 16 ansf &quot;(+16)&quot;
    //$process$! external ObjectMerger w3a AItg DaM4 anam &quot;Damage Modifier&quot; Iatt 1 32 ansf &quot;(+32)&quot;
    //$process$! external ObjectMerger w3a AItg DaM5 anam &quot;Damage Modifier&quot; Iatt 1 64 ansf &quot;(+64)&quot;
    //! endtextmacro
    endscope
    </i></i></i></i></i></i></i>

 

Attachments

  • Confidence.w3x
    29 KB · Views: 314

jig7c

Stop reading me...-statement
Reaction score
123
i don't understand a word of the code, but THANKS A LOT TOM JONES... +REP DEF. FOR YOU...

i had a feeling you would make this spell for me... you help a lot around here TJ...
I'll take a look at ur map once I get home...
 

jig7c

Stop reading me...-statement
Reaction score
123
ok, the spell is working like its suppose to Tom Jones, but it maxs is at 48 damage, and your message states max can be up to 252 damage....
the max I want it to go up is 80 in damage... so up to 10 skeletons at level 3 black arrows...

sorry for the double post and thanks again Tom Jones
 
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