• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spell Problem in Map

Status
Not open for further replies.
Level 2
Joined
Apr 14, 2008
Messages
5
Hi Everyone,
I have a major problem with my spells on world editor. I am trying to get a hero to have the ability to 'fuse' with another non-hero unit to creat another unit. (if that makes sense) I used the hippogryph and archer abilites from the Night Elves Tech tree. I also made them have the ability to 'unfuse'. The problem is, when I fuse them, the hero dies and a new hero pops up. When I get the new hero to unfuse, it gives me a different level 1 hero. Thus giving me three heroes (1 alive, 2 dead) (hope this makes sense)
Thank you
Sproggos
 
Level 6
Joined
Dec 28, 2007
Messages
178
phew thats a bit hard, you need triggers:
when the hero casts fuse, move the 2 fused hero instantly to a place where players cannot see them and change their owner to neutral passive for example. Then create the fused hero to the owner of the caster at the pont of ability being castand set its lvl to the fuser lvl if its a hero. When unfused move the fused hero to the hidden place and give it to neutral passive and pick the 2 fused hero(now owned by neutral passive) and put them back to the field and change their owner to the palyer who casted the fuse ability.
you also need to change the spell not to be based on the 'mount' ability.
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
  • Events
    • Unit - A Unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to *your fuse ability*
  • Actions
    • Set tempunit1[(Player number of (Triggering player))] = (Triggering unit)
    • Set tempunit2[(Player number of (Triggering player))] = (Target unit of ability being cast)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • 'IF'-Conditions
        • (Unit-type of tempunit1[(Player number of (Triggering player))]) Equal to *your hero*
        • (Unit-type of tempunit2[(Player number of (Triggering player))]) Equal to *your unit*
      • 'THEN'-Actions
        • Set temppoint02[(Player number of (Triggering player))] = (Position of tempunit1[(Player number of (Triggering player))])
        • Set temppoint03[(Player number of (Triggering player))] = (Position of tempunit2[(Player number of (Triggering player))])
        • Special Effect - Create a special effect at temppunkt02[(Player number of (Triggering player))] using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        • Set fusion_eff[(Player number of (Triggering player))] = (Last created special effect)
        • Unit - Replace tempunit1[(Player number of (Triggering player))] with a *fused unit* using Old unit: Rel. life and mana
        • Special Effect - Create a special effect at temppunkt03[(Player number of (Triggering player))] using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        • Set fusion_eff2[(Player number of (Triggering player))] = (Last created special effect)
        • Unit - Remove tempunit2[(Player number of (Triggering player))] from the game
        • Special Effect - Destroy fusion_eff[(Player number of (Triggering player))]
        • Special Effect - Destroy fusion_eff2[(Player number of (Triggering player))]
        • Custom script: call RemoveLocation(udg_temppunkt02[GetConvertedPlayerId(GetTriggerPlayer())])
        • Custom script: call RemoveLocation(udg_temppunkt03[GetConvertedPlayerId(GetTriggerPlayer())])
      • 'ELSE'-Actions
        • Set TrigPlayerVar = (Player group((Triggering player)))
        • Game - Display to TrigPlayerVar for 5.00 seconds the text: |cffffff00(Notice)|r: Wrong unit
        • Custom script: call DestroyForce(udg_TrigPlayerVar)
This is the fuse-trigger from my map
It checks the unit-types and creates a new one at the position of the caster
Besides, you need the followings:
tempunit1[] - unit variable with arraysize 1
tempunit2[] - unit variable with arraysize 1
temppoint1[] - point variable with arraysize 1
temppoint2[] - point variable with arraysize 1
fusion_eff[] - special effect variable with arraysize 1
fusion_eff2[] - special effect variable with arraysize 1
TrigPlayerVar - Player group variable
 
Last edited:
Status
Not open for further replies.
Top