• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Mui Help!

Status
Not open for further replies.
Level 9
Joined
May 5, 2007
Messages
253
Is there anyway i can make the special effect in this trigger MUI? Please help me!

  • Unit - A unit Begins channeling an ability
  • (Ability being cast) Equal to Lightning
  • Special Effect - Create a special effect attached to the hand right of (Triggering unit) using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
  • Set L1 = (Last created special effect)
  • Special Effect - Create a special effect attached to the hand left of (Triggering unit) using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
  • Set L2 = (Last created special effect)
  • Wait 2.20 seconds
  • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing ((Real((Intelligence of (Casting unit) (Include bonuses)))) x 2.00) damage of attack type Normal and damage type Magic
  • Special Effect - Destroy L1
  • Special Effect - Destroy L2
 
Level 6
Joined
Jan 27, 2007
Messages
208
If you don`t use local, you can use countdown timer

so, replace wait with countdown timer with player number of triggering unit array that have 2.2 second before expires

and, create another trigger when timer expires, it will deals damage and remove special effect. however this method will needs 12 trigger, if your map have 12 player on it.
 
Level 3
Joined
Aug 20, 2008
Messages
54
For GUI you can use trigger execution count. Make an integer variable as the excuted number and an set your arrays to the integer, easy as that.
 
Oh for god's sake, all this talk of really complicated methods, use globals local for god's sake. To do it, create a global variable of type Special Effect, call it, say, temp1. In your trigger, add a line of custom script :local effect udg_temp1 (you need to put udg_ before the name of your global variable). Now you can use the global variable in the trigger and it will be completely MUI. The only problem is, you can'y have more than one local global variable in one trigger, so you'll have to create a second trigger which you'll run add the beginning of that trigger which will create/destroy your second special effect.
 
Ok then, this trigger creates and destroys a special effect at the target location, also runs a second trigger to create another special effect, since this one can't have more than one "local global variable".
  • Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Custom script: local effect udg_TempSFX
      • Set TempLoc = (Target point of ability being cast)
      • Special Effect - Create a special effect at TempLoc using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Trigger - Run Second Effect <gen> (ignoring conditions)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempSFX = (Last created special effect)
      • Wait 2.20 seconds
      • Special Effect - Destroy TempSFX
  • Second Effect
    • Events
    • Conditions
    • Actions
      • Custom script: local effect udg_TempSFX
      • Special Effect - Create a special effect at TempLoc using Abilities\Spells\Undead\ReplenishMana\ReplenishManaCasterOverhead.mdl
      • Set TempSFX = (Last created special effect)
      • Wait 2.20 seconds
      • Special Effect - Destroy TempSFX
You just need 2 global variables, TempLoc is a point, TempSFX is a special effect. This is completely MUI and leakfree.
 
Level 19
Joined
Nov 16, 2006
Messages
2,165
Actualy that's wrong.
Its so simple that I'll just fastly write it for you with easy editing so you can use it fastly.
Create a trigger and name it 'Lightning Spell'.
Convert it to custom text.
Paste this:
JASS:
function ChannelLightning takes nothing returns nothing
// locals
local effect ef // first effect
local effect ef2 // second effect
local unit caster // your caster
local unit target // your target
if GetSpellAbilityId() == 'ANab' then  // Do you see 'ANab' ? This is your spell id (control + D in the ability editor)
set caster = GetTriggerUnit() // Get your caster
set target = GetSpellTargetUnit() // Get your target
set ef = AddSpecialEffectTarget("Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl",caster,"hand,left") //effect left hand
set ef2 = AddSpecialEffectTarget("Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl",caster,"hand,right") // effect right hand
call TriggerSleepAction(2.20) // This is the wait function
call UnitDamageTarget( caster, target,2. *I2R(GetHeroInt(caster,true)),true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_MAGIC,null) // your damage ;)
call DestroyEffect(ef) // Destroys your effect 1 - left hand
call DestroyEffect(ef2) // Destroys your effect 2 - right hand
endif
// nullify
set ef = null
set ef2 = null
set caster = null
set target = null
endfunction
//==================================================================================================
function InitTrig_Lightning_Spell takes nothing returns nothing                                                
    set gg_trg_Lightning_Spell = CreateTrigger(  )                                                             
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Lightning_Spell, EVENT_PLAYER_UNIT_SPELL_CHANNEL )                
    call TriggerAddAction( gg_trg_Lightning_Spell, function ChannelLightning )                                  
endfunction
into it.

Do you see 'ANab' ? You'll need to edit this one to your ability's ID.
Go to your ability editor, go to the spell and press control D.
You will see its ID (press control + D again to revert).
Write that ID instead of 'ANab' and voila!

P.s. I didn't tested the script but it should work.
 
Status
Not open for further replies.
Top