Help with spell

rafaxik

New Member
Reaction score
2
Hi there... I was trying to create a spell that summons a Wisp to drain life and mana from enemies around him whenever his enemies stays in his range. Then it give all life and mana obtained and give it to the hero that summoned it in life and mana, respectively.

It's just like a wisp to cast multiple siphon mana (and life) in creatures. If a creature get into the range, it also gets caught by wisp's spells...

Level 1 - Drains 10 life and 12 mana per second each unit, transfers 50 % of total drained;

Level 2 - Drains 15 life and 18 mana per second each unit, transfers 60 % of total drained;

Level 2 - Drains 20 life and 26 mana per second each unit, transfers 70 % of total drained.

I tried it with a bunch of stuff and it didn't work...

I doubt it can be useful, but I tried some triggers (ps: I don't understand well ahshtables, but I tried =/):
Trigger 1
Trigger:
  • HashTable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set H = (Last created hashtable)
Trigger 2
Trigger:
  • Spirit Wisp Variables
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • ((Summoned unit) has buff Spirit Wisp ) Equal to (==) True
    • Actions
      • Trigger - Turn off (This trigger)
      • Set SW_Unit_Summoned = (Summoned unit)
      • Set SW_Unit_Caster = (Summoning unit)
      • Set SW_Level_of_Ability = (Level of Spirit Wisp for SW_Unit_Caster)
      • Set SW_Point_Target = (Position of SW_Unit_Summoned)
      • Set SW_Player_Owner_of_Caster = (Owner of (Summoning unit))
      • Unit Group - Pick every unit in (Units within (135.00 x (Real(SW_Level_of_Ability))) of SW_Point_Target matching (((((Matching unit) is Magic Immune) Equal to (==) False) and ((((Matching unit) belongs to an enemy of SW_Player_Owner_of_Caster) Equal to (==) True) and (((Matching unit) is al and do (Actions)
        • Loop - Actions
          • Set SW_Units_Around_the_Wisp = (Last created unit group)
          • Set SW_Unit_Picked_in_Group = (Picked unit)
          • Unit - Create (Number of units in SW_Units_Around_the_Wisp) dummy02 for SW_Player_Owner_of_Caster at SW_Point_Target facing Default building facing (270.0) degrees
          • Set SW_Unit_Last_Created = (Last created unit)
          • Unit - Add Siphon Mana (For the dummy) to SW_Unit_Last_Created
          • Unit - Set level of Siphon Mana (For the dummy) for SW_Unit_Last_Created to SW_Level_of_Ability
          • Unit - Add Divine Shield Effect to SW_Unit_Last_Created
          • Unit - Set level of Divine Shield Effect for SW_Unit_Last_Created to SW_Level_of_Ability
          • Set SW_Initial_Mana_Dummy = (Mana of SW_Unit_Last_Created)
          • Hashtable - Save SW_Initial_Mana_Dummy as 0 of (Integer((Max mana of SW_Unit_Picked_in_Group))) in H
          • Hashtable - Save SW_Inital_Mana_Caster as (Integer((Mana of SW_Unit_Caster))) of (Integer((Max life of SW_Unit_Caster))) in H
          • Unit - Order SW_Unit_Last_Created to Human Paladin - Activate Divine Shield
          • Unit - Order SW_Unit_Last_Created to Human Blood Mage - Siphon Mana SW_Unit_Picked_in_Group
          • Trigger - Turn on Spirit Wisp Loop <gen>
      • Custom script: call DestroyGroup (udg_SW_Units_Around_the_Wisp)
      • Custom script: call RemoveLocation(udg_SW_Point_Target)
      • Trigger - Run Spirit Wisp Loop <gen> (checking conditions)
      • Trigger - Turn on (This trigger)
Trigger 3
Trigger:
  • Spirit Wisp Loop
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to (==) Siphon Mana (For the dummy)
    • Actions
      • Set SW_Unit_Finishing_Channelling = (Casting unit)
      • Set SW_Final_Mana_Dummy = (Mana of SW_Unit_Last_Created)
      • Unit - Set mana of SW_Unit_Caster to ((Load (Integer(SW_Inital_Mana_Caster)) of (Integer((Max mana of SW_Unit_Picked_in_Group))) from H) + (Mana of SW_Unit_Finishing_Channelling))
      • Unit - Add a 0.01 second Generic expiration timer to SW_Unit_Last_Created
I've tried, with this trigger, to suck only mana, just to see if it works... And Divine shield it's just to create a visual effect, but I know that it could also be triggered by
Trigger:
  • Special Effect - Create special effect on target unit using my model
.


If someone can help me, I appreciate that.


Thx

EDIT 01: I Forgot to say that, the created wisp dummy is called dummy02 with wisp model and dummy01 is just another dummy with no model
EDIT 02: Map too big =/
 

NeuroToxin

New Member
Reaction score
46
if you want, I could probably do this without hashtables, i dont understand hashtables well either

if not, what doesnt work? if it doesnt work period, then its the condition

Heres what you can do, do this, A unit starts the effect of an ability, ability being cast == to (ability) and then do last summoned unit, I think theres an option for that, if not that then last created unit
if you want me to do it without hashtables, attach the map
 

rafaxik

New Member
Reaction score
2
Just gonna post here quick, read my above post, edited it

Map Size is too big for the forum =/
it exceeds 3 mb...

For your question, there are leaks I can't see where, maybe I put in the wrong position, Idk.
I cast the spell, and it channels a few siphon mana, doesn't work for all enemies around the wisp. And it works, at most, twice...
It removes all mana points from my caster and don't give any of mana/hp drained from the targets to him.
 

NeuroToxin

New Member
Reaction score
46
alright, give me till tomorrow at 4 pm (Eastern Time) and ill have it done, no worries, sorry for the wait, but I have school, and sleep now :p, ill get right to it tomorrow
 

rafaxik

New Member
Reaction score
2
haha I've got to sleep too =/
See(read) you tomorrow :D

Thx

Edit: So... any ideas? anyone?
 

NeuroToxin

New Member
Reaction score
46
Ok, Its working, BUT the unit isnt moving yet, and IDK why, I posted for help, but i dont really see a problem with it
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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