No Damage on level 2 Skill

Expelliarmus

Where to change the sig?
Reaction score
48
Solved

Ok, I read Cohadar's PUI tutorial and the spells that uses it, and decided to make a spell in a similiar way to Cohadar's spells.

Flesh Heap!
Pudge is made of innumerable rotting corpses, giving him extra protection against spells as well as the chance to add more to his bulk.

|cffffcc00Level 1|r - 4% magic reduction, 0.03 Str bonus per unit kill, 0.3 for hero kill.
|cffffcc00Level 2|r - 8% magic reduction, 0.06 Str bonus per unit kill, 0.6 per hero kill.
|cffffcc00Level 3|r - 12% magic reduction, 0.09 Str bonus per unit kill, 0.9 per hero kill.
|cffffcc00Level 4|r - 16% magic reduction, 0.12 Str bonus per unit kill, 1.2 per hero kill.Pudge can gain strength by killing allied units.

|cffffcc00Mana Cost|r: N/A
|cffffcc00Cooldown|r: N/A

JASS:
scope FleshHeap initializer InitTrig

globals
    private constant integer AbilityID = 'A000' 
    private constant integer Hero = 30 
    private constant integer Unit = 3 
endglobals

private struct data
    integer level
    unit pudge
    real str
    static data array PUI
    
    private static method create takes unit whichUnit returns data
        local data c = data.allocate()
        set c.pudge = whichUnit
        set c.level = GetUnitAbilityLevel(whichUnit, AbilityID )
        set data.PUI[GetUnitIndex(c.pudge)] = c
        return c
    endmethod
    
    static method Get takes unit whichUnit returns data
        local integer index = GetUnitIndex(whichUnit)
        if data.PUI[index] == 0 then
            debug call BJDebugMsg("|c00FFCC00"+"Flesh Heap struct created on first use for hero: " + GetHeroProperName(whichUnit))
            return data.create(whichUnit)
        endif
        set data.PUI[index].level = GetUnitAbilityLevel(whichUnit, AbilityID )
        return data.PUI[index] 
    endmethod
    
    method heap takes nothing returns nothing
        local unit dy = GetTriggerUnit()
        if IsUnitType( dy, UNIT_TYPE_HERO) == true then
            set .str = .str + 0.01 * Hero * .level
        else
            set .str = .str + 0.01 * Unit * .level
        endif
        if .str >= 1 then
            call SetHeroStr( .pudge, GetHeroStr( .pudge, false ) +1 , true)
            set.str = .str - 1
        endif
        
        set dy = null
    endmethod
endstruct

private function Actions takes nothing returns nothing
    call data.Get(GetKillingUnit()).heap()
endfunction

private function Act takes nothing returns nothing
    local data d = data.Get(GetTriggerUnit())
endfunction

private function Conditions takes nothing returns boolean
    return GetLearnedSkill() == AbilityID
endfunction

private function Cond takes nothing returns boolean
   return GetUnitAbilityLevel(GetKillingUnit(), AbilityID ) > 0 
endfunction

//===========================================================================
private function InitTrig takes nothing returns nothing
    local trigger trig = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_HERO_SKILL )
    call TriggerAddCondition( trig, Condition( function Conditions ) )
    call TriggerAddAction( trig, function Act )

    set trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( trig, Condition( function Cond ) )
    call TriggerAddAction( trig, function Actions )

endfunction
endscope

I know this isn't the most efficient way, but this is just to practise PUI or whatever.

The spell works normal, except only when the spell is level one.
At level two onwards, I deal no damage at all.
I take no damage at all from the creep at Hero Level 1

Normal?
- Increase Str
- Flesh Heap struct created.. calls on first use
- set data.PUI[index].level = GetUnitAbilityLevel(whichUnit, AbilityID ) debug msg comes (showing I2S .level) and increases as the skill does

The map has imported 80% of the triggers from Pyramidal Sandbox (disabled the ORBEngine, removed Demos)

I'll attach the map, if the problem isn't in the code

Thanks!
 

Sooda

Diversity enchants
Reaction score
318
Why it needs to work in Sandbox map? If you can't do damage nor receive it something adds to unit abilities which prevent it (Item abilities like Spell Reduction and Resistant Skin).
Create new map and only ability for your Flesh Heap ability, if it works in blank map it's fine and problem is somewhere else.
 

Artificial

Without Intelligence
Reaction score
326
Have you ever visited the object editor btw?
In your skill there's a field "Level x - Data - Damage Dealt (%)" (Where x is the level). On level 1 it's set to 1 (= 100%), and on others it's 0. Could that be the problem? :p
Btw, to see if some code is actually the source of the problem, disable the trigger and see if the problem still exists.
 

Expelliarmus

Where to change the sig?
Reaction score
48
Why it needs to work in Sandbox map? If you can't do damage nor receive it something adds to unit abilities which prevent it (Item abilities like Spell Reduction and Resistant Skin).
Create new map and only ability for your Flesh Heap ability, if it works in blank map it's fine and problem is somewhere else.
Sandbox > I only have the triggers from the sandbox, it has most of Cohadar's systems together. The map is The Spell Map Template by Tinki3
>Create new map and only ability for your Flesh Heap ability, if it works in blank map it's fine and problem is somewhere else.
Still the same problem

Have you ever visited the object editor btw?
In your skill there's a field "Level x - Data - Damage Dealt (%)" (Where x is the level). On level 1 it's set to 1 (= 100%), and on others it's 0. Could that be the problem?
Btw, to see if some code is actually the source of the problem, disable the trigger and see if the problem still exists.
Once... to edit elune's grace ^_^

> Could that be the problem?
It was. Wasn't thinking in the object editor (who does any? it's reserved for the trigger editor) Thanks!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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