Help with a spell

For fulfilled maps that most likely don't work on the latest patch (1.24 or later).

Moderator: Cheaters

User avatar
lightwing
Newcomer
Posts: 15
Joined: December 2nd, 2007, 8:13 pm
Title: Clan I3c Chieftain

Help with a spell

Post by lightwing »

Hi,

I am trying to make a spell called "Contract of the dead".

1) When the unit dies, everything works fine.
2) When the unit does not die, it still executes the trigger

Trigger:

It should add 50 gold if the targeted unit dies, or is dead after 2 seconds when the spell gets casted.

DeadContract
Events
Unit - A unit Begins casting an ability
Conditions
Actions
Wait 2.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Target unit of ability being cast) is alive) Equal to False
((Target unit of ability being cast) is A Hero) Equal to False
(Ability being cast) Equal to Contract of the dead
Then - Actions
Game - Display to (All players) the text: ((|CFFFFFC00 + (Name of (Owner of (Casting unit)))) + |CFFFFFC00Got 50 gold because of Contract of the Dead.)
Player - Add 50 to (Owner of (Casting unit)) Current gold
Else - Actions
Do nothing

The real trigger has to be: ((Target unit of ability being cast) is A Hero) Equal to True -- I edited it into "Unit" cuz its hard to test in single player :lol:

Any suggestions? :?: :)

Thanks,

lightwing
lightwing
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Help with a spell

Post by Aero »

Code: Select all

DeadContract
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Contract of the dead
        ((Unit-type of (Target unit of ability being cast)) is A Hero) Equal to True
    Actions
        Wait 2.00 game-time seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Target unit of ability being cast) is dead) Equal to True
            Then - Actions
                Game - Display to (All players) the text: ((|CFFFFFC00 + (Name of (Owner of (Triggering unit)))) + |CFFFFFC00Got 50 gold because of Contract of the Dead.)
                Player - Add 50 to (Owner of (Triggering unit)) Current gold
            Else - Actions
User avatar
Bartimaeus
Tyrannical Drama Queen
Posts: 4430
Joined: November 19th, 2007, 5:05 am
Been thanked: 2 times

Re: Help with a spell

Post by Bartimaeus »

Aero wrote:

Code: Select all

DeadContract
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Contract of the dead
        ((Unit-type of (Target unit of ability being cast)) is A Hero) Equal to True
    Actions
        Wait 2.00 game-time seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Target unit of ability being cast) is dead) Equal to True
            Then - Actions
                Game - Display to (All players) the text: ((|CFFFFFC00 + (Name of (Owner of (Triggering unit)))) + |CFFFFFC00Got 50 gold because of Contract of the Dead.)
                Player - Add 50 to (Owner of (Triggering unit)) Current gold
            Else - Actions
Sorry for going off-topic, but...where did you get the idea of this spell? It sounds very plane scape: torment based for the following reasons.

1. In Torment, you sign a contract called Contract of the Dead from a dustman.
2. For doing the contract, you get 50 gold.
3. But for the 50 gold, when you die, everything that was on your body at the time goes to the dustm e/a n.

Sorry for going off-topic, but it sounded excruciatingly like Torment.
User avatar
lightwing
Newcomer
Posts: 15
Joined: December 2nd, 2007, 8:13 pm
Title: Clan I3c Chieftain

Re: Help with a spell

Post by lightwing »

Hi,

Never played that game, funny though..

I was kinda out of ideas for spells, so asked someone for a suggestion, maybe he played the game .. dont know..

Thx 4 the help, I will try :)
lightwing
User avatar
Bartimaeus
Tyrannical Drama Queen
Posts: 4430
Joined: November 19th, 2007, 5:05 am
Been thanked: 2 times

Re: Help with a spell

Post by Bartimaeus »

lightwing wrote:Hi,

Never played that game, funny though..

I was kinda out of ideas for spells, so asked someone for a suggestion, maybe he played the game .. dont know..

Thx 4 the help, I will try :)
Oh, okay, because it sounds *exactly* like Torment's Contract of the Dead - except it's an ability...of course...how odd, though. lol, well, yeah, sorry for going off-topic again 8)
User avatar
lightwing
Newcomer
Posts: 15
Joined: December 2nd, 2007, 8:13 pm
Title: Clan I3c Chieftain

Re: Help with a spell

Post by lightwing »

Hi,

For some reason your trigger did not work :(, it still came up with the 'old bug'... executing even if the unit is ALIVE

I created a variable, and set it to the targeted unit, this worked for me:

DeadContract
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Contract of the dead
((Unit-type of (Target unit of ability being cast)) is A Hero) Equal to False
Actions
Set DeadTG = (Target unit of ability being cast)
Wait 2.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(DeadTG is alive) Equal to False
Then - Actions
Game - Display to (All players) the text: ((|CFFFFFC00 + (Name of (Owner of (Casting unit)))) + |CFFFFFC00Got 50 gold because of Contract of the Dead.)
Player - Add 50 to (Owner of (Casting unit)) Current gold
Else - Actions


Anyway, thanks for the help :D
lightwing
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Help with a spell

Post by Aero »

Yeah, the unit responses expired because of the wait.

That's a GUI only problem since JASS uses locals.

Anyway, good job on debugging.
User avatar
lightwing
Newcomer
Posts: 15
Joined: December 2nd, 2007, 8:13 pm
Title: Clan I3c Chieftain

Re: Help with a spell

Post by lightwing »

I never really tried JASS, I do think GUI has a few lacks, but so be it..
lightwing