Item: Spell Reflection Item

istar

New Member
Reaction score
31
Anyway, I think Curo is right. You will probably have to create an Ability varible and then put udg_yourabilityvarible inside the () of GetSpellAbilityId().
theres nothing to be inside the ()
JASS:
constant native GetSpellAbilityId           takes nothing returns integer

it takes nothing
and GetSpellAbilityId IS referring to the ability being casted
GetSpellAbilityId()=Id of AbilityBeingCast

as for
Well, I tried it, but unfortunately, things don't work like they should.
i pretty sure the problem, like i said earlier is GetIssuedOrderId() doesnt work for the event-starts effect of ability
and there is no way to relate abilityid to its order string, unless you made it manually, but thats ungainly
i suppose you can make another trigger with the event-issued order targetting object, so as to use GetIssuedOrderId, save it in a variable and transfer it to the starts effect trigger
 

tennycat13

New Member
Reaction score
4
I guess I got Getspellability and Getspellabilityid mixed up :p ? Or is it wrong either way. >_>
 

istar

New Member
Reaction score
31
guess I got Getspellability and Getspellabilityid mixed up ? Or is it wrong either way. >_>
both refers to the same spell, one just gave it as the 'A000' or whatever name, the other gave it as some integers, not a big mistake
you can check out this thread how i sloved smillar problem.
yea, get current order of triggering unit should work fine...i think
 

D.V.D

Make a wish
Reaction score
73
Is this supposed to be like a linkins sphere? If it is, make a trigger like this and a item with the ability spell shield. The unit cannot have this spell or a spell based off of Spell Shield.

Trigger:
Trigger:
  • A unit starts the effect of a ability
    • TargetUnitofAbilityBeingCasted has item Linkins Sphere equal to true
    • Set Target = TargetUnitOfAbilityBeingCasted
    • Order Target to Human Spell Shield


Make Spell Shield last very little so that it lasts enough for only one ability.
 

eXirrah

New Member
Reaction score
51
Ok so this is cool. At any rate you can't order the dummy unit to cast the ability cause you got no order .... Unit - Starts the effect of an ability will only work with ability being cast, triggering unit, target of ability being cast and maybe triggering player.
In order to be able to use issued order you will need event Unit is issued an order ....

So ... here is my suggestion.

Create a dummy that contains the spells that can be reflected(I'm not sure if a dummy can be ordered to cast spell from spell book)

Trigger:
  • Trigger
    • Events
      • Unit is issued an order targeting an object
    • Conditions
      • And
        • Target of issued order has Spell Mirror buff equals to true
        • Issued order not equal to Attack
        • Issued order not equal to Smart
        • Issued order not equal to Patrol
        • Issued order not equal to Move
    • Actions
      • --- In case the dummy can cast spells from spellbooks and it can contain all spells ---
      • Unit - Create 1 dummy unit at position of caster
      • Custom script: call IssueTargetOrder(bj_lastCreatedUnit,OrderId2String(GetIssuedOrderId()) ,GetTriggerUnit())
      • ------------------
      • --- In case the dummy can't cast spells from spellbooks ---
      • If
        • Conditions
          • Or
            • Issued order equals to spell1
            • Issued order equals to spell2
            • Issued order equals to spell3
            • Issued order equals to spell4
            • ...
        • Actions
          • Unit - Create 1 dummy unit at position of caster containing the spells in the if conditions
        • Else
      • IssueTargetOrder(bj_lastCreatedUnit,OrderId2String(GetIssuedOrderId()) ,GetTriggerUnit())


If the dummy can contain all the spells that can be mirrored then just create a dummy with all the spells and issue it Issued Order using JASS. This might do the trick

If the dummy can't contain all the spells that can be mirrored then you need to eather check which dummy you need to create and issue order to or create them all put them in group and order them all. Issuing an unit to activate some spell that it doesn't have will make the unit do nothing so this should not cause problems.

The only thing that I doubt will work is that JASS line. Idk if using JASS will allow you to issue the triggering order.
 

Ouguiya

New Member
Reaction score
11
Hello again all!

So, to solve a few questions which arose:

"How will you block the Spell?"

That's rather simple, the Spell Blocking Amulet does that job for me, the trigger just has to be able to create a dummy unit, give it the spell which was cast, and order it to cast it again.

These steps are surprisingly simple, except the last one: creating a dummy unit is easy, giving it the spell even is possible in GUI I discovered just recently. However, the only problem I have is how to order it the ability it was last given, since it takes an order ID, and I would need the Order ID of the spell which was cast.

Other than that there is not much to be said. In essence, it's very simple:
Let me give you a quick list of how this should work:


Item: Mirror Shield - Will just be an ordinary spell blocker amulet with a diffrent icon.
Event: A unit starts the effect of an ability.
Condition: Target of ability being cast has Mirror Shield
Actions: Create Dummy unit at position of target of ability being cast.
Give last created unit (Ability being cast).
Order last created unit to ...

And this is where things stand, other than that, I really see no problem and no need to create an endlessly long trigger.

If it's impossible to get the order ID of the spell, I suppose I shall have to find another way.

I still hope though that someone knows a way to deal with this problem.

Yours,

Ouguiya
 

Nerfpl

New Member
Reaction score
53
Hello again all!

So, to solve a few questions which arose:



...the only problem I have is how to order it the ability it was last given, since it takes an order ID, and I would need the Order ID of the spell which was cast....

...If it's impossible to get the order ID of the spell, I suppose I shall have to find another way....

I still hope though that someone knows a way to deal with this problem.

Yours,

Ouguiya

lol i just gave you answer few posts before...
you just have to rework it to work as reflect instead of multicast. if you dont have WEU i can make it custom text just say which action you need exactly
 

Dirac

22710180
Reaction score
147
Fount it!!!
Trigger:
  • Spell Reflect
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • ((Target unit of ability being cast) has Spell Reflection) equal to true
    • Actions
      • Set TempPoint = (Position of (Target unit of ability being cast))
      • Unit - Create 1 Dummy for (Owner of (Target unit of ability being cast)) at TempPoint facing Default building facing degrees
      • Unit - Add (Ability being cast) to (Last created unit)
      • Custom script: call IssueTargetOrderById( GetLastCreatedUnit(), GetUnitCurrentOrder(GetTriggerUnit()), GetTriggerUnit() )
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Spell Resistance to (Target unit of ability being cast)
      • Wait 1.00 seconds
      • Unit - Remove Spell Resistance from (Target unit of ability being cast)


If you use the Amulet of Spell Inmunity instead of Spell Resistance the cooldown for the caster wont trigger
 

Ouguiya

New Member
Reaction score
11
Hi again!

Sorry Nerfpl.

I have WEU, and I already tried that, but I overlooked that you had to add the level of the ability too :( my bad.

Anyway, that solved it! Thanks again very much.

I also gave a shot at Dirac's idea (did you get that name from the mathematician btw?), and tried it, which works too. I'm not too sure as of yet with which function I will work.

Thanks again to the both of you, and of course to Istar, which helped me along. + Rep for all of you.

Yours,

Ouguiya
 

Nerfpl

New Member
Reaction score
53
Actually, because of cultural way of your posts i thought your a bit more advanced in makeing triggers and will simply remake my multi cast to spell reflect where you simple switch target and owner of dummy. my bad ^^ but im glad it works

also important thing is to add Dummy unit (which cast spell) to exceptions of this trigger
(condition unit not equal to dummy = true)
so 2 guys with spell reflect wont trigger it all over. it will work like in Final Fantasy where reflected spell cannot be reflected back/again.

Also now each your spell have to be MUI
 

Dirac

22710180
Reaction score
147
Yeah no problem, i got curious about your idea and developed it. Sorry if is not MUI.

PD: yes, the famous physicist Paul Dirac :)
 

Ouguiya

New Member
Reaction score
11
Hello again!

Well Nerfpl, once again thanks for your help. I must admit I would have overlooked that bug if you hadn't told me about it, that the unit must not be a dummy unit.

I changed the trigger a bit, I am posting it here for your evaluation:

Trigger:
  • Mirror Shield
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Target unit of ability being cast) has an item of type Mirror Shield) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Not equal to Dummy
        • Then - Actions
          • Set Removable_Point = (Position of (Target unit of ability being cast))
          • Set Removable_Point2 = (Position of (Triggering unit))
          • Unit - Create 1 Dummy for (Owner of (Target unit of ability being cast)) at Removable_Point facing Removable_Point2
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Add (Ability being cast) to (Last created unit)
          • Unit - Set level of (Ability being cast) for (Last created unit) to (Level of (Ability being cast) for (Triggering unit))
          • Unit - Order (Last created unit) to (Current order of (Triggering unit)) (Triggering unit)
          • Custom script: call RemoveLocation (udg_Removable_Point)
          • Custom script: call RemoveLocation (udg_Removable_Point2)
        • Else - Actions
          • Do nothing


I hope that this trigger is leakless, MUI, and efficient.

The only problem which remains (I am sure you have already seen it), is that with this the item has no cooldown.

I have tried to look around, but haven't been able to create a trigger which only activates if the item is cooled down. Would it maybe be possible for you to point me in the right direction?

Thanks again,

Yours,

Ouguiya

PS: @ Dirac ah cool. Did you solve his equations actually, or did you just like the name? Thanks also for your help.
 

Nerfpl

New Member
Reaction score
53
first come idea i have is to turn off this trigger after it runs, starting timer equal to cooldown of item, then with another trigger (timer expires) turn this trigger back. just make timer like ~0.5 faster to prevent bug where spell is blocked and reflect not trigger.

also about MUI i sux totaly so you need some expert here. and about other MUI thing that i mentioned before i meant spells that will be casted.
lets say guy cast firebolt witch is 100% triggered spell. because it will be reflected it have to be able to exist basicly 2 times at once therfore need to be MUI

for sure you will aproach some problems depends on spells you use. also i would think aobut triggers wich cause direct damage. i would set them to damage=spell type, and give the unit with reflection 100% spell resist for time when reflect is not in cooldown.

edit: actually i realised small possible bug with aoe abilities. 100% resist will block damage and reflect (if modified) will reflect this but spell shield wont trigger therfore it will cause mess when shileld is not on cooldown but reflect is >.>... need some brain here
 

Dirac

22710180
Reaction score
147
>I hope that this trigger is leakless, MUI, and efficient.

yes, yes and yes

how ever, the caster can be affected by the ability being cast, i suggest spell resistance to improve this.
 

Ouguiya

New Member
Reaction score
11
Hi there!

I thought about some things you said.

First of all: The idea with the countdown would be good, but that would destroy the MUI of the spell, since then no two units can have it, since the cooldown would be for both of them.

As for the direct damage spells: I won't get into much of a fuss here. Spells like Blizzard and Flamestrike and similar will not be reflected (this would be a bit strange too. A mirror shield would work in the kind of: An enemy shoots something, it get's reflected, but AOE spells like that do not have anything to be reflected at). This way, it will work like a conventional spell blocker, blocking only what is directed straight at the target.

As for other spells which are triggered: All triggered spells in my map are mass-carnage spells, so there is no real need or possibility to block them, but I will check it out. Likewise, all spells HAVE to be MUI anyway, since the map can hold a (theoretically) infinite amount of heroes, and thus cannot be non-MUI or only MPI.

Edit: Dirac, what do you mean by the last statement? All spells which are blocked by a spell blocker shouldn't affect the caster anyway or do they?

Thanks again.

Yours,

Ouguiya
 

Dirac

22710180
Reaction score
147
I think they shouldn't, however, buffs created by this spells cant be removed without removing all negative buffs.
 

Ouguiya

New Member
Reaction score
11
Hmhm... Well I think far-out testing will show if this works. The only problem now is the cooldown...

Thanks again for all your help guys!

Yours,

Ouguiya
 
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