• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Can someone help me here

Status
Not open for further replies.
Level 4
Joined
Oct 20, 2004
Messages
68
Its a channel spell, what I'm trying to do is, It slowly sucks the health out of the enemy, but gives back mana to the user. So far I've been unseccesful(and a little bit lazy) so can anyone assist me with this?
 
Level 3
Joined
Aug 21, 2004
Messages
57
base your spell off either Siphn Mana or Life Drain, and set it so that it does zero (0) life or mana steal. Then use triggers to detect when your spell is active, and trigger periodic life loss for the targetted unit and periodic mana gain for the caster.
 
Level 4
Joined
Oct 20, 2004
Messages
68
I know that! but my problem is i dunno how, i get the event and condition but theres about 5 million different options for action and finding just 1 can be a real pain in the tookish. So can someone tell me where the right action is, or post a copied thing of it.
 
ok ok here it is..... i think

Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to H to M
Actions
Trigger - Run health <gen> (ignoring conditions)

then create another trigger

Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Set caster = (Casting unit)
Set target = (Target unit of ability being cast)
Wait 0.05 seconds
Unit - Set life of target to ((Life of target) - 1.00)
Trigger - Run mana <gen> (ignoring conditions)
and put this trigger on initially on to off

then create another trigger.....

Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Set caster = (Casting unit)
Wait 0.05 seconds
Unit - Set mana of caster to ((Mana of caster) + 100.00)
Wait 10.00 seconds
Trigger - Turn off (This trigger)

and set it too on off
 
Level 4
Joined
Sep 21, 2004
Messages
110
Wrong, have the first trigger say Set caster=Triggering unit, and Set target=target and ability being caster, not the second one.
 
Level 7
Joined
Mar 26, 2004
Messages
350
i would use loops instead of those "every x sec." events.

if i would do it, it would look sth. like:

Code:
Events 
Unit - A unit Starts the effect of an ability 
Conditions 
(Ability being cast) Equal to your ability
action: 
set caster = caster
set target = target
for each loop integer a from 1 to (e.g.) 30, do multiple actions:
loop actions:
Unit - Set life of target to ((Life of target) - 10.00)
Unit - Set mana of caster to ((Mana of caster) + 10.00)
wait (1.00 sec.)

btw, u can't wait 0.05 sec., the WE waits at least 0.33 sec.
 
Level 7
Joined
Mar 26, 2004
Messages
350
The_Raven said:
Yea, but (casting unit) can only apply to one unit at a time and (target of ability being cast) is reset after a wait. This is why I love local variables.

~The_Raven

of course could be local variables added to make it multiple unit compatible :wink:

@ daelin: the "spell stopped" would be implemented too (look at the "exitwhen"), if it would look like this:
JASS:
function condtition_check takes nothing returns boolean
       return  ( GetSpellAbilityId() == 'yourspellabilityID' )
endfunction

function spell_effects takes nothing returns nothing
     local unit caster = GetSpellAbilityUnit ()
     local unit target = GetSpellTargetUnit ()
     local integer a = 1
     loop
          exitwhen (a > 30) or ( UnitHasBuffBJ(caster, 'BPSE') == true ) //'BPSE' = e.g. Buff of stormbolt
          call SetUnitLifeBJ( target, ( GetUnitStateSwap(UNIT_STATE_LIFE, target) - 10 ) )
          call SetUnitLifeBJ( caster, ( GetUnitStateSwap(UNIT_STATE_MANA, caster) + 10 ) )
     call PolledWait (2)
     endloop

//==================================================
function Init_Trig_spell takes nothing returns nothing
    set gg_trg_spell = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_spell, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_spell, Condition( function condition_check ) )
    call TriggerAddAction( gg_trg_spell, function spell_effects)
endfunction
 
Level 4
Joined
Oct 20, 2004
Messages
68
The words copy and paste are looking very tasty to me now, Is there a way to do such a thing, involving me pressing Ctrl+C then Ctrl+V, cause untill i learn Jass or anything complicated, I just wanna finish this map. I've gotta deadline and its Halloween night, This, 1 more hero, a few more easy skills, and items is all i have to do, All of which I've prepared B4 hand. Only thing holding me up at this time is The spell.
 
Status
Not open for further replies.
Top