Several Problems

Centreri

New Member
Reaction score
1
I didn't want to make ten threads, so I put everything in here:

1) How would I go about creating an ability, so that as you level it, you have a chance to cast chain lightning on attack? I want to do this via dummy units, but I have no idea how I would detect the attack.

2) What is wrong with this spell? It currently crashes WCIII for me. I use a death system for heroes which keeps their bodies in place, adds ancient classification for targeting purposes, gives them to neutral passive (stores player number in custom value), all that.
Code:
Resurrection
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Resurrection 
    Actions
        Set UnitGroups[1] = (Units within ((((Real((Level of Resurrection  for (Casting unit)))) - 1.00) + 400.00) + 1.00) of (Target point of ability being cast) matching ((HeroStatus[(Player number of (Owner of (Picked unit)))] Equal to Dead) or (HeroStatus[(Player number of (Owner of
        Unit Group - Pick every unit in UnitGroups[1] and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Player((Custom value of (Picked unit)))) is an ally of (Triggering player)) Equal to True
                    Then - Actions
                        Unit - Change ownership of (Picked unit) to (Player((Custom value of (Picked unit)))) and Retain color
                        Unit - Remove classification of An Ancient from (Picked unit)
                        Animation - Play (Picked unit)'s stand animation
                        Unit - Make (Picked unit) face (Casting unit) over 4.00 seconds
                        Unit - Set life of (Picked unit) to (20.00 + (((Real((Level of Resurrection  for (Casting unit)))) - 1.00) x 5.00))%
                        Unit - Make (Picked unit) Vulnerable
                        Set HeroStatus[(Player number of (Owner of (Picked unit)))] = Alive
                        Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                        Special Effect - Destroy (Last created special effect)
                        Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
                        Unit - Remove Ghost (Visible) from (Picked unit)
                    Else - Actions
        Custom script:   call DestroyGroup(udg_UnitGroups[1])

3) Is there any way to make a dynamic multishotesque ability? I want something that has a % chance to multishot for a random amount of shots.

4) Is there any simple way to have the damage caused by an ability base itself on the attack of the casting unit?

5) I created a set-damage multishot ability via barrage, which changes the missile model, but doesn't actually do multishot effect. I followed the tutorial, all that. Could the problem be in the unit using it? If no, what else? I edited Art, Sound, Hero Ability (T/F), levels, removed dependencies/requirements, name, text, damage, targets, maximum damage (99999), Area of Effect (Doesn't coincide with unit range - I want it to scale a bit as range upgrades), removed cooldown and both durations, and changed targets (ground, air, enemy, hero, non-hero.

6) I'm using an edited version of Baka's Custom Hero system, and I've found a problem in that my abilities can be leveled beyond the max. Specifically, my pre-ult slot abilities can be either 5-levels or 20-levels, but even the five-levels can be upgraded until 20. Any way to fix this, or should I just make them all the same?

[RESOLVED]
7) This is the biggy. I'll be very very grateful if someone can fix this one. I'm creating a necromancy spell that abuses the death system to create a copy of the dead hero for the caster, complete with the spells and their levels. This is the first spell I'd actually had to create levels for, so I had to edit my system a bit to accomodate it, but when I finished doing what Pyrogasm (from WC3C.net) suggested, it still didn't work. Here are the various triggers related to this spell:

This trigger is the simple death trigger for the players, rather then NPC heroes. It simply revives hero where they were and does a few things, but if the corpses disappear after death, it creates a 'ghost' standing version of the unit in question.
Code:
Death Heroes
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
        ((Triggering player) controller) Equal to User
    Actions
        Set HeroStatus[(Player number of (Triggering player))] = Dead
        Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Hide revival graphics
        Unit - Add classification of An Ancient to (Dying unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Unit-type of (Triggering unit)) Equal to Eredar Warrior) or ((Unit-type of (Triggering unit)) Equal to Eredar Warlock)
            Then - Actions
                Animation - Play (Dying unit)'s stand animation
                Animation - Change (Triggering unit)'s vertex coloring to (30.00%, 30.00%, 30.00%) with 20.00% transparency
            Else - Actions
                Animation - Play (Dying unit)'s death animation
        Unit - Add Ghost (Visible) to (Dying unit)
        Unit - Make (Dying unit) Invulnerable
        Unit - Change ownership of (Dying unit) to Neutral Passive and Retain color
        Unit - Set the custom value of (Dying unit) to (Player number of (Owner of (Dying unit)))
This simple trigger creates the Gamecache, which will be used as an array.
Code:
GameCache
    Events
        Map initialization
    Conditions
    Actions
        Game Cache - Create a game cache from PlayerAbilities.w3v
        Set AbilityCache = (Last created game cache)
This simple trigger stores the ability level in GameCache.
Code:
Upgrading Abilities
    Events
        Unit - A unit Learns a skill
    Conditions
    Actions
        Custom script:   set udg_AbilityLevel = GetLearnedSkillLevel()
        Custom script:   set udg_AbilityIdString = I2S(GetLearnedSkill())
        Game Cache - Store AbilityLevel as AbilityIdString of (Player + ((String((Player number of (Owner of (Triggering unit))))) + AbilityLevels)) in AbilityCache
This is a sample of the ability-adding trigger. This stores the abilities themselves in the Gamecache. Ultimates and pre-ultimates do it a bit differently (no loop, simpler).
Code:
Heal Add
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Heal
    Actions
        Unit - Add Heal - Spellbook  to (Triggering unit)
        For each (Integer A) from 1 to 3, do (Actions)
            Loop - Actions
                Custom script:   if (udg_HeroAbilities[(GetPlayerId(GetTriggerPlayer())*5)+bj_forLoopAIndex] == 0) then
                Set HeroAbilities[((((Player number of (Triggering player)) - 1) x 5) + (Integer A))] = Heal 
                Custom script:   set udg_AbilityID = udg_HeroAbilities[(GetPlayerId(GetTriggerPlayer())*5)+bj_forLoopAIndex]
                Game Cache - Store AbilityID as (Ability + (String((Integer A)))) of (Player + ((String((Player number of (Owner of (Triggering unit))))) + Abilities)) in AbilityCache
                Unit - Set level of Heal - Custom System  for (Triggering unit) to (Integer A)
                Player - Disable Heal - Spellbook  for (Owner of (Triggering unit))
                Item - Remove (Item being manipulated)
                Custom script:   exitwhen true
                Custom script:   endif
And here is the final trigger for the spell itself. It creates the hero, adds the abilities, and saves the levels. I haven't implemented everything I need (duration, etc) because the basics don't work.

Code:
Undead Conversion
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Undead Conversion 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Custom value of (Target unit of ability being cast)) Greater than or equal to 1) and ((Custom value of (Target unit of ability being cast)) Less than or equal to 10)
            Then - Actions
                Unit - Create 1 (Unit-type of (Target unit of ability being cast)) for (Owner of (Triggering unit)) at (Position of (Target unit of ability being cast)) facing (Position of (Triggering unit))
                Hero - Set (Last created unit) Hero-level to (Level of (Target unit of ability being cast)), Hide level-up graphics
                -------- AbilitySection --------
                Set AbilityID = (Load Ability1 of (Player + ((String((Custom value of (Target unit of ability being cast)))) + Abilities)) from AbilityCache)
                Custom script:   set udg_AbilityIdAbility = udg_AbilityID
                Unit - Add AbilityIdAbility to (Last created unit)
                Unit - Set level of AbilityIdAbility for (Last created unit) to (Load (String(AbilityID)) of (Player + ((String((Custom value of (Target unit of ability being cast)))) + AbilityLevels)) from AbilityCache)
                Set AbilityID = (Load Ability2 of (Player + ((String((Custom value of (Target unit of ability being cast)))) + Abilities)) from AbilityCache)
                Custom script:   set udg_AbilityIdAbility = udg_AbilityID
                Unit - Add AbilityIdAbility to (Last created unit)
                Unit - Set level of AbilityIdAbility for (Last created unit) to (Load (String(AbilityID)) of (Player + ((String((Custom value of (Target unit of ability being cast)))) + AbilityLevels)) from AbilityCache)
                Set AbilityID = (Load Ability3 of (Player + ((String((Custom value of (Target unit of ability being cast)))) + Abilities)) from AbilityCache)
                Custom script:   set udg_AbilityIdAbility = udg_AbilityID
                Unit - Add AbilityIdAbility to (Last created unit)
                Unit - Set level of AbilityIdAbility for (Last created unit) to (Load (String(AbilityID)) of (Player + ((String((Custom value of (Target unit of ability being cast)))) + AbilityLevels)) from AbilityCache)
                Set AbilityID = (Load Ability4 of (Player + ((String((Custom value of (Target unit of ability being cast)))) + Abilities)) from AbilityCache)
                Custom script:   set udg_AbilityIdAbility = udg_AbilityID
                Unit - Add AbilityIdAbility to (Last created unit)
                Unit - Set level of AbilityIdAbility for (Last created unit) to (Load (String(AbilityID)) of (Player + ((String((Custom value of (Target unit of ability being cast)))) + AbilityLevels)) from AbilityCache)
                Set AbilityID = (Load Ability5 of (Player + ((String((Custom value of (Target unit of ability being cast)))) + Abilities)) from AbilityCache)
                Custom script:   set udg_AbilityIdAbility = udg_AbilityID
                Unit - Add AbilityIdAbility to (Last created unit)
                Unit - Set level of AbilityIdAbility for (Last created unit) to (Load (String(AbilityID)) of (Player + ((String((Custom value of (Target unit of ability being cast)))) + AbilityLevels)) from AbilityCache)
                -------- AbilitySectionEnd --------
                Animation - Change (Last created unit)'s vertex coloring to (70.00%, 100.00%, 70.00%) with 20.00% transparency
            Else - Actions
This is a big problem, and it would be fantastic if someone could tell me what's wrong. Putting it simply, the channel-based spell fires on the dead unit, but.. nothing happens. It looks like the trigger above doesn't fire, which is weird, because the conditions are pretty simple. If someone could tell me what the heck could be wrong with it, I'll love you forever. I really want to implement this spell.
 

Flare

Stops copies me!
Reaction score
662
3) ye, its possible but there would be a slight problem. unless ALL your heroes have the same base damage (or at least all heroes with same primary stat) and the same for st, the damage will never be exactly right. just make 3 custom heroes based on any hero (1 for each primary stat), set the base damage to real heroes base damage, stats and statgain to real heroes stat and statgain, and make sure that you check the Hide UI box (i think thats wat its called, itll hide the hero icon).

when your hero attacks, create a unit group around position of caster matching not enemy etc AND matching unit isnt attacked unit. then, make another group thats random # units from (first group). make some if-then-else conditions to check the heroes primary stat (well, which stat is highest) i.e.

Code:
Strength of hero > Agility of hero
Strength of hero > Intelligence of hero
do that for each stat, and create the relevant hero (with right primary stat) at position of hero, and order it to attack the picked unit.

bah, cant copy-paste. if you need a general trigger, search for this user: 13est with forum search, and look at post 4 of his multiple poisons thread.

5) does your hero have an orb effect ability?
 

Centreri

New Member
Reaction score
1
3) It's possible to set the damage of barrage to the attacking units damage by setting damage done to 0. I was thinking, instead of your method (I have ~25 heroes), to create different versions of the barrage multishot and to have them randomly alternate. I'd hope to make them change every attack, which is the problem, rather then on a timer.

5) No, no orb abilities. Two graphic abilities (attachments), inventory, and 4 other empty abilities (empty slots, based off channel).
 

hi_im_bob

......and you are?
Reaction score
44
1) Something along these lines, but they may need modification depending on what exactly you want to happenMelee Initialization
Code:
   Events
        Unit - A unit Gains a level
    Conditions
    Actions
        Set Hero[(Player number of (Owner of (Triggering unit)))] = (Hero level of (Triggering unit))
Code:
Untitled Trigger 001
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set random_number = (Random integer number between 1 and 10)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                random_number Equal to 1
            Then - Actions
                Unit - Create 1 DummyUnit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
                Unit - Set level of Chain Lightning for (Last created unit) to Hero[(Player number of (Owner of (Triggering unit)))]
                Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Attacked unit)
            Else - Actions
 

Sim

Forum Administrator
Staff member
Reaction score
534
4. You can check how much of its base stats the unit has if it is an hero.

If not well... not really, unless you simply know the unit's damage and enter it directly within the spell.

7. > This is a big problem, and it would be fantastic if someone could tell me what's wrong. Putting it simply, the channel-based spell fires on the dead unit, but.. nothing happens. It looks like the trigger above doesn't fire, which is weird, because the conditions are pretty simple.

Add some text displaying under the "Then - Actions". If it doesn't display, it means it doesn't fire, and that would be because your unit doesn't meet the custom value requirement.
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
7) In the first trigger
Code:
Unit - Change ownership of (Dying unit) to Neutral Passive and Retain color
Unit - Set the custom value of (Dying unit) to (Player number of (Owner of (Dying unit)))
Won't this always make the custom value Neutral Passive's number(not sure what number that is), since you change the ownership then try to get the player number of the owner? Could the custom value of the unit always being Neutral Passive be the problem?
 

Centreri

New Member
Reaction score
1
Won't this always make the custom value Neutral Passive's number(not sure what number that is), since you change the ownership then try to get the player number of the owner? Could the custom value of the unit always being Neutral Passive be the problem?
I didn't see that... thanks a lot! It works perfectly!

If not well... not really, unless you simply know the unit's damage and enter it directly within the spell.
Mmm.. well, that's a shame. Some things will have to be triggered.

1) Something along these lines, but they may need modification depending on what exactly you want to happenMelee Initialization
Code:
   Events
        Unit - A unit Gains a level
    Conditions
    Actions
        Set Hero[(Player number of (Owner of (Triggering unit)))] = (Hero level of (Triggering unit))
Code:
Untitled Trigger 001
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set random_number = (Random integer number between 1 and 10)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                random_number Equal to 1
            Then - Actions
                Unit - Create 1 DummyUnit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
                Unit - Set level of Chain Lightning for (Last created unit) to Hero[(Player number of (Owner of (Triggering unit)))]
                Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Attacked unit)
            Else - Actions
I can implement a system based on isattacked rather easily, but the problem is I want it to fire when the attack is launched, not when the missile (most units are ranged) hits the target.
 
Reaction score
107
1) use orb of lightning and a copy of chain lightning and edit as desired. Using this method requires you to manually target an enemy, attack-move or patrol before it will activate.

2) no idea why it would crash but in your matching condition when you set the unit group you need to change:
Code:
matching ((HeroStatus[(Player number of (Owner of ([b]Matching unit[/b])))] Equal to Dead)
btw the condition is cut off at the end...

5) what is the attack type of the unit with the ability? "multishot" only works with attack type missile as far as i know.

6) this is a tricky one... the levels of the replaced ability is dependent on the "slot" ability, hence if the "slot" ability has a max level of 20 and yet the replaced has 5 it will still be able to level past, but if the "slot" has a max of 5 it will only be able to level to 5 even if the replaced has a max of 20.
your best bet is to make them all the same, or assign specific slots to take the level 5 and level 20 abilities and make them choose abilities in an order...
which reminds me that i should update my engine...
 

Centreri

New Member
Reaction score
1
1) use orb of lightning and a copy of chain lightning and edit as desired. Using this method requires you to manually target an enemy, attack-move or patrol before it will activate.

2) no idea why it would crash but in your matching condition when you set the unit group you need to change:
Code:
matching ((HeroStatus[(Player number of (Owner of (Matching unit)))] Equal to Dead)

btw the condition is cut off at the end...

5) what is the attack type of the unit with the ability? "multishot" only works with attack type missile as far as i know.

6) this is a tricky one... the levels of the replaced ability is dependent on the "slot" ability, hence if the "slot" ability has a max level of 20 and yet the replaced has 5 it will still be able to level past, but if the "slot" has a max of 5 it will only be able to level to 5 even if the replaced has a max of 20.
your best bet is to make them all the same, or assign specific slots to take the level 5 and level 20 abilities and make them choose abilities in an order...
which reminds me that i should update my engine...
2) Still crashes.
5) Yep. That was the problem. I had it Missile (splash). Narrows down hero uniqueness.
6) I know this - I was kinda hoping for a way around it without editing abilities. Some abilities serve a constant purpose, so the only things that can really be upgraded are range, cooldown, and casting time, so I want those to have 5 levels rather then 20.
 

Centreri

New Member
Reaction score
1
Also, I tried to 'optimize' the spell trigger for the Undeath Conversion spell. Basically, converted to JASS and used local variables instead of all the GetCastingUnit and such. Here it is:
JASS:
function Trig_Undead_Conversion_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A011' 
endfunction

function Trig_Undead_Conversion_Func001Func046001 takes nothing returns boolean
    return ( GetUnitUserData(GetSpellTargetUnit()) >= 1 )
endfunction

function Trig_Undead_Conversion_Func001Func046002 takes nothing returns boolean
    return ( GetUnitUserData(GetSpellTargetUnit()) <= 10 )
endfunction

function Trig_Undead_Conversion_Func001C takes nothing returns boolean
    if ( not GetBooleanAnd( Trig_Undead_Conversion_Func001Func046001(), Trig_Undead_Conversion_Func001Func046002() ) ) then
        return false
    endif
    return true
endfunction

function Trig_Undead_Conversion_Actions takes nothing returns nothing
        local player UCP = GetOwningPlayer(GetTriggerUnit())
        local unit UT = GetSpellTargetUnit()
    if ( Trig_Undead_Conversion_Func001C() ) then
        //call CreateNUnitsAtLocFacingLocBJ(1, GetUnitTypeId(UT), GetOwningPlayer(GetTriggerUnit()), GetUnitLoc( GetSpellTargetUnit()), UT) 
        local unit UC = CreateUnit(GetOwningPlayer(GetTriggerUnit()), GetUnitTypeId(UT), GetUnitX(GetSpellTargetUnit()), GetUnitY(GetSpellTargetUnit()), 270) 
        call SetHeroLevelBJ(UC, GetUnitLevel(UT), false)
        // AbilitySection
        set udg_AbilityID = GetStoredIntegerBJ("Ability1", ( "Player" + ( I2S(GetUnitUserData(UT)) + "Abilities" ) ), udg_AbilityCache)
        set udg_AbilityIdAbility = udg_AbilityID
        call UnitAddAbilityBJ( udg_AbilityIdAbility, UC )
        call SetUnitAbilityLevelSwapped( udg_AbilityIdAbility, UC, GetStoredIntegerBJ(I2S(udg_AbilityID), ( "Player" + ( I2S(GetUnitUserData(UT)) + "AbilityLevels" ) ), udg_AbilityCache) )
        set udg_AbilityID = GetStoredIntegerBJ("Ability2", ( "Player" + ( I2S(GetUnitUserData(UT)) + "Abilities" ) ), udg_AbilityCache)
        set udg_AbilityIdAbility = udg_AbilityID
        call UnitAddAbilityBJ( udg_AbilityIdAbility, GetLastCreatedUnit() )
        call SetUnitAbilityLevelSwapped( udg_AbilityIdAbility, UC, GetStoredIntegerBJ(I2S(udg_AbilityID), ( "Player" + ( I2S(GetUnitUserData(UT)) + "AbilityLevels" ) ), udg_AbilityCache) )
        set udg_AbilityID = GetStoredIntegerBJ("Ability3", ( "Player" + ( I2S(GetUnitUserData(UT)) + "Abilities" ) ), udg_AbilityCache)
        set udg_AbilityIdAbility = udg_AbilityID
        call UnitAddAbilityBJ( udg_AbilityIdAbility, GetLastCreatedUnit() )
        call SetUnitAbilityLevelSwapped( udg_AbilityIdAbility, UC, GetStoredIntegerBJ(I2S(udg_AbilityID), ( "Player" + ( I2S(GetUnitUserData(UT)) + "AbilityLevels" ) ), udg_AbilityCache) )
        set udg_AbilityID = GetStoredIntegerBJ("Ability4", ( "Player" + ( I2S(GetUnitUserData(UT)) + "Abilities" ) ), udg_AbilityCache)
        set udg_AbilityIdAbility = udg_AbilityID
        call UnitAddAbilityBJ( udg_AbilityIdAbility, GetLastCreatedUnit() )
        call SetUnitAbilityLevelSwapped( udg_AbilityIdAbility, UC, GetStoredIntegerBJ(I2S(udg_AbilityID), ( "Player" + ( I2S(GetUnitUserData(UT)) + "AbilityLevels" ) ), udg_AbilityCache) )
        set udg_AbilityID = GetStoredIntegerBJ("Ability5", ( "Player" + ( I2S(GetUnitUserData(UT)) + "Abilities" ) ), udg_AbilityCache)
        set udg_AbilityIdAbility = udg_AbilityID
        call UnitAddAbilityBJ( udg_AbilityIdAbility, GetLastCreatedUnit() )
        call SetUnitAbilityLevelSwapped( udg_AbilityIdAbility, UC, GetStoredIntegerBJ(I2S(udg_AbilityID), ( "Player" + ( I2S(GetUnitUserData(UT)) + "AbilityLevels" ) ), udg_AbilityCache) )
        // AbilitySectionEnd
        call SetUnitVertexColorBJ( UC, 70.00, 100, 70.00, 20.00 )
        call SetUnitUserData( UC, 20 )
        call UnitRemoveTypeBJ( UNIT_TYPE_ANCIENT, UT )
        call UnitAddTypeBJ( UNIT_TYPE_FLYING, UT )
        call StartTimerBJ( udg_UCTimer[GetConvertedPlayerId(UCP)], false, ( 30.00 + ( ( I2R(GetUnitAbilityLevelSwapped('A011', GetSpellAbilityUnit())) - 1 ) * 15.00 ) ) )
        call CreateTimerDialogBJ( GetLastCreatedTimerBJ(), "TRIGSTR_822" )
        set udg_UCTimerWindow[GetConvertedPlayerId(UCP)] = GetLastCreatedTimerDialogBJ()
        call TriggerSleepAction( ( 30.00 + ( ( I2R(GetUnitAbilityLevelSwapped('A011', GetSpellAbilityUnit())) - 1 ) * 15.00 ) ) )
        call DestroyTimerDialogBJ( udg_UCTimerWindow[GetConvertedPlayerId(UCP)] )
        call RemoveUnit( UC )
    else
        call RemoveUnit( UT )
        call CreateNUnitsAtLocFacingLocBJ(1, GetUnitTypeId(UT), UCP, GetUnitLoc( GetSpellTargetUnit()), UT)
        call SetUnitVertexColorBJ( UC, 70.00, 100, 70.00, 20.00 )
        call SetHeroLevelBJ( UC, GetUnitLevel(GetSpellTargetUnit()), false )
        call SetUnitUserData( UC, 20 )
        call StartTimerBJ( udg_UCTimer[GetConvertedPlayerId(UCP)], false, ( 30.00 + ( ( I2R(GetUnitAbilityLevelSwapped('A011', GetSpellAbilityUnit())) - 1 ) * 15.00 ) ) )
        call CreateTimerDialogBJ( GetLastCreatedTimerBJ(), "TRIGSTR_822" )
        set udg_UCTimerWindow[GetConvertedPlayerId(UCP)] = GetLastCreatedTimerDialogBJ()
        call TriggerSleepAction( ( 30.00 + ( ( I2R(GetUnitAbilityLevelSwapped('A011', GetSpellAbilityUnit())) - 1 ) * 15.00 ) ) )
        call DestroyTimerDialogBJ( udg_UCTimerWindow[GetConvertedPlayerId(UCP)] )
        call RemoveUnit( UC )
    endif
endfunction

//===========================================================================
function InitTrig_Undead_Conversion takes nothing returns nothing
    set gg_trg_Undead_Conversion = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Undead_Conversion, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Undead_Conversion, Condition( function Trig_Undead_Conversion_Conditions ) )
    call TriggerAddAction( gg_trg_Undead_Conversion, function Trig_Undead_Conversion_Actions )
endfunction

The local unit UC returns 'expected endif' at the local unit UC line and doesn't recognize UC as a variable in other parts. What exactly is the problem? I tried two different functions for creating the unit (as you can see), nothing was fixed.
 
Reaction score
107
I believe the problem lies here:
Code:
Death Heroes
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
        ((Triggering player) controller) Equal to User
    Actions
        Set HeroStatus[(Player number of (Triggering player))] = Dead
        Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Hide revival graphics
        Unit - Add classification of An Ancient to (Dying unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Unit-type of (Triggering unit)) Equal to Eredar Warrior) or ((Unit-type of (Triggering unit)) Equal to Eredar Warlock)
            Then - Actions
                Animation - Play (Dying unit)'s stand animation
                Animation - Change (Triggering unit)'s vertex coloring to (30.00%, 30.00%, 30.00%) with 20.00% transparency
            Else - Actions
                Animation - Play (Dying unit)'s death animation
        Unit - Add Ghost (Visible) to (Dying unit)
        Unit - Make (Dying unit) Invulnerable
[b]        Unit - Change ownership of (Dying unit) to Neutral Passive and Retain color
        Unit - Set the custom value of (Dying unit) to (Player number of (Owner of (Dying unit)))[/b]

You set the custom value AFTER changing ownership, so the custom value will be something higher than 12, not sure what it is for netural passive.

Then later your condition:
Code:
Undead Conversion
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Undead Conversion 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                [b]((Custom value of (Target unit of ability being cast)) Greater than or equal to 1) and ((Custom value of (Target unit of ability being cast)) Less than or equal to 10)[/b]
            Then - Actions
                Unit - Create 1 (Unit-type of (Target unit of ability being cast)) for (Owner of (Triggering unit)) at (Position of (Target unit of ability being cast)) facing (Position of (Triggering unit))

Checks to see if the custom value is between 1 and 10 which i assume is player numbers...

So basically just move the "set custom value" line above the "change ownership" one.
 

Centreri

New Member
Reaction score
1
Yeah, I had fixed that already. It was pointed out by trb92. There's a problem with the JASS there, since I got the basics working before converting.
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
JASS:

function Trig_Undead_Conversion_Actions takes nothing returns nothing
        local player UCP = GetOwningPlayer(GetTriggerUnit())
        local unit UT = GetSpellTargetUnit()
    if ( Trig_Undead_Conversion_Func001C() ) then
        //call CreateNUnitsAtLocFacingLocBJ(1, GetUnitTypeId(UT), GetOwningPlayer(GetTriggerUnit()), GetUnitLoc( GetSpellTargetUnit()), UT) 
        local unit UC = CreateUnit(GetOwningPlayer(GetTriggerUnit()), GetUnitTypeId(UT), GetUnitX(GetSpellTargetUnit()), GetUnitY(GetSpellTargetUnit()), 270)
Your problem is here. You can't create a local after a line of code, such as the if. To fix this, simple change it to this.

JASS:

function Trig_Undead_Conversion_Actions takes nothing returns nothing
        local player UCP = GetOwningPlayer(GetTriggerUnit())
        local unit UT = GetSpellTargetUnit()
        local unit UC
    if ( Trig_Undead_Conversion_Func001C() ) then
        //call CreateNUnitsAtLocFacingLocBJ(1, GetUnitTypeId(UT), GetOwningPlayer(GetTriggerUnit()), GetUnitLoc( GetSpellTargetUnit()), UT) 
        set UC = CreateUnit(GetOwningPlayer(GetTriggerUnit()), GetUnitTypeId(UT), GetUnitX(GetSpellTargetUnit()), GetUnitY(GetSpellTargetUnit()), 270)
 

foodflare

You can change this now in User CP.
Reaction score
32
1)
Code:
Untitled Trigger 003
    Events
        Unit - A unit Is issued an order targeting an object
    Conditions
        (String((Issued order))) Equal to attack
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of (yourabil) for (Ordered unit)) Equal to 1
            Then - Actions
                Set Randomint = (Random integer number between 1 and 10)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of (yourabil) for (Ordered unit)) Equal to 2
            Then - Actions
                Set Randomint = (Random integer number between 1 and 8)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Randomint Equal to 1
            Then - Actions
                Unit - Create 1 Dummy for (Owner of (Ordered unit)) at ((Position of (Ordered unit)) offset by 100.00 towards (Facing of (Ordered unit)) degrees) facing (Facing of (Ordered unit)) degrees
                Set Dummy - (last created unit)
                Unit - Add a 1.00 second Generic expiration timer to (Dummy)
                Unit - Add Chain Lightning to (Dummy)
                Unit - Set level of Chain Lightning for (Dummy) to (Level of (yourabil) for (Ordered unit))
            Else - Actions
        Unit - Order (Dummy) to Orc Far Seer - Chain Lightning (Target unit of issued order)

and you can create more if thens for each level of abil and change the ratio the 10/8 doesnt have to be that to start out as just an example
 

Centreri

New Member
Reaction score
1
TRB - Thanks again, works perfectly now. I think I must have skipped over some part of Vex's tutorial :p.

Flood, I want it to fire on attack, not on attack order or on impact. Hmm.. Brainstorm! What if I use Searing Arrows as a base, set everything to zero, and when the unit casts searing arrows the trigger is run through? Will that work?
 

vypur85

Hibernate
Reaction score
803
>Hmm.. Brainstorm! What if I use Searing Arrows as a base, set everything to zero, and when the unit casts searing arrows the trigger is run through? Will that work?

1) use orb of lightning and a copy of chain lightning and edit as desired. Using this method requires you to manually target an enemy, attack-move or patrol before it will activate.

I thought you were going to use Baka's method? It should work :).
 

emootootoo

Top Banana
Reaction score
51
3) It's possible to set the damage of barrage to the attacking units damage by setting damage done to 0. I was thinking, instead of your method (I have ~25 heroes), to create different versions of the barrage multishot and to have them randomly alternate. I'd hope to make them change every attack, which is the problem, rather then on a timer.

Make the different versions of multi-shot (diff amounts of arrows), and spell books for them, disable the spellbooks for all players so you can't see them.

Then the trigger should go like this:
When the hero attacks, remove all the multishot spell books from the hero.

Then do a GetRandomInt(1,100)< whatever % to see if their next attack will be a multishot and if it is, randomly add one of the multishot spellbooks.

So every time the unit attacks it will have all of the multishot spellbooks removed, and will have a % chance to gain a random spellbook with a multishot in it.

This also bypasses stop abuse, because the ability added only affects the attack after it has gone off.
 

Ashcat

Hellooo
Reaction score
68
# 2.)

You have it trying to destroy a special effect before it creates one, which may be the only problem there. Flip those 2 actions around so that the create special effect one is before the destroy special effect one.
 
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