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.
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.
This simple trigger creates the Gamecache, which will be used as an array.
This simple trigger stores the ability level in GameCache.
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).
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.
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.
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)))
Code:
GameCache
Events
Map initialization
Conditions
Actions
Game Cache - Create a game cache from PlayerAbilities.w3v
Set AbilityCache = (Last created game cache)
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
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
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