Rune Knight's Shell Ability

A place to talk about general WC3 and EotA related stuff.
Post Reply
Message
Author
User avatar
Cokemonkey11
Addict
Addict
Posts: 306
Joined: January 26th, 2008, 12:04 am
Realm: Lordaeron (U.S. West)
Battle.net name: Cokemonkey11

Rune Knight's Shell Ability

#1 Post by Cokemonkey11 »

Just curious how this was done.

Is there a damage detection system built into EotA? How did you keep track of the shell's protection left, I assume it's just an initialized global instead of an MUI system, which makes sense since you can't have more than 1 of the same hero playing at a time.
Image
I miss EotA :(

User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

Re: Rune Knight's Shell Ability

#2 Post by Perhaps »

It could easily be made MUI with the usage of arrays.

Code: Select all

globals
    real array sheildz0r
endglobals

function TheSheild takes real thang, unit inpants, player fosho returns nothing
    set sheildz0r[GetPlayerId(fosho)] = sheildz0r[GetPlayerId(fosho)] - thang
    if sheildz0r <= 0 then
        call UnitRemoveBuffBJ( '????', inpants )
        call SetUnitLifeBJcall SetUnitLifeBJ( inpants, GetUnitState( inpants, UNIT_STATE_LIFE ) + sheildz0r[GetPlayerId(fosho)] )
        set sheildz0r[GetPlayerId(fosho)] = 0
    endif
endfunction
Image

Soulbourne
Addict
Addict
Posts: 462
Joined: September 20th, 2007, 3:53 pm
Battle.net name: Soulbourne-Destroy all imitators...

Re: Rune Knight's Shell Ability

#3 Post by Soulbourne »

I haven't learned much about coding...but most of that doesn't look like what I do know about it...I'll get back to working on learning code later...maybe over winter break...
Click here to help growth.

Sarcasm is conveyed often times by tone of voice. Since writing does not have definite tones because of different views, I suggest we from now on color sarcasm blue as in other forums.

Please come here and click each egg...

User avatar
Cokemonkey11
Addict
Addict
Posts: 306
Joined: January 26th, 2008, 12:04 am
Realm: Lordaeron (U.S. West)
Battle.net name: Cokemonkey11

Re: Rune Knight's Shell Ability

#4 Post by Cokemonkey11 »

Perhaps wrote:It could easily be made MUI with the usage of arrays.

Code: Select all

globals
    real array sheildz0r
endglobals

function TheSheild takes real thang, unit inpants, player fosho returns nothing
    set sheildz0r[GetPlayerId(fosho)] = sheildz0r[GetPlayerId(fosho)] - thang
    if sheildz0r <= 0 then
        call UnitRemoveBuffBJ( '????', inpants )
        call SetUnitLifeBJcall SetUnitLifeBJ( inpants, GetUnitState( inpants, UNIT_STATE_LIFE ) + sheildz0r[GetPlayerId(fosho)] )
        set sheildz0r[GetPlayerId(fosho)] = 0
    endif
endfunction
That wouldnt work at all

#1: the sheild spell doesn't give a buff
#2: playerId arrays would make it MPI, but definately not MUI
#3: What would you use as an event for this? (thats's the hard part, I'm assuming yak made his own damage detection system)
Image
I miss EotA :(

User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

Re: Rune Knight's Shell Ability

#5 Post by Perhaps »

It's just a throw out there example of MUI with globals. It's not completely tangent to Rune Knight's Sheild. Unless I'm looking at the wrong acronym, I would like to know the difference between Multi USER Interface and Multi PLAYER Interface. And if it's defined by than more than just players... Then use a 2D array, one index representing player, another index representing which hero.

Code: Select all

globals
    real array exSHEILD
    unit array exRK
endglobals

function EXAMPLE takes player p, unit u, integer b, real d returns nothing
    local integer i = 0
    local integer pnu = GetPlayerId(p) * 6
    loop
        exitwhen i == 1
        if u == exRK[i] then
            set i = 1
        else
            set pnu = pnu + 1
        endif
     endloop
     set exSHEILD[pnu] = exSHEILD - d
     if exSHEILD <= 0 then
         call UnitRemoveBuffBJ( b, u )
         call SetUnitLifeBJcall SetUnitLifeBJ( u, GetUnitState( u, UNIT_STATE_LIFE ) + exSHEILD[pnu] )
         set exSHEILD[pnu] = 0
     endif
endfunction
Image

User avatar
Cokemonkey11
Addict
Addict
Posts: 306
Joined: January 26th, 2008, 12:04 am
Realm: Lordaeron (U.S. West)
Battle.net name: Cokemonkey11

Re: Rune Knight's Shell Ability

#6 Post by Cokemonkey11 »

MUI = multi unit instancable, MPI = multi player instanceable

If you could make 8000 rune knights split randomly for random players and they all worked, it would be MUI.
Image
I miss EotA :(

User avatar
Dekar
Jelly Doughnut
Posts: 1433
Joined: May 27th, 2006, 8:13 am
Realm: Northrend (Europe)
Battle.net name: Dekar
Location: Germany

Re: Rune Knight's Shell Ability

#7 Post by Dekar »

Use some kind of CSCache ( Im not up to date what is recommended atm ), everytime a unit gets buffed create a table for it to save shield value and add the specific " unit x takes damage" event to a trigger if you dont have an attack detection system.

Quite easy, we had such a skill in RoW, too.

Just remember that the one trigger gets more and more events and may need to be cleared from time to time ( that should be doable, I havent triggered in a while especially with trigger effecting stuff. )
<EotA@Azeroth> YAKS GO MOOOOOOOOOOOOOOOOOOOOOOOO

Dekar: the ultimate ocean themed hero should buff and depend on spawn waves!
DarnYak: why is that
Dekar: WAVES
Dekar: :D
DarnYak: i was afraid that was the answer

User avatar
Cokemonkey11
Addict
Addict
Posts: 306
Joined: January 26th, 2008, 12:04 am
Realm: Lordaeron (U.S. West)
Battle.net name: Cokemonkey11

Re: Rune Knight's Shell Ability

#8 Post by Cokemonkey11 »

removing events from a trigger leaks, but thanks for telling me (if that is in fact how yak did it)
Image
I miss EotA :(

User avatar
Dekar
Jelly Doughnut
Posts: 1433
Joined: May 27th, 2006, 8:13 am
Realm: Northrend (Europe)
Battle.net name: Dekar
Location: Germany

Re: Rune Knight's Shell Ability

#9 Post by Dekar »

Well if theres a better way, Im sure someone of this nice forum members will tell us.
<EotA@Azeroth> YAKS GO MOOOOOOOOOOOOOOOOOOOOOOOO

Dekar: the ultimate ocean themed hero should buff and depend on spawn waves!
DarnYak: why is that
Dekar: WAVES
Dekar: :D
DarnYak: i was afraid that was the answer

WC3Player
Visitor
Visitor
Posts: 24
Joined: June 3rd, 2008, 3:06 am

Re: Rune Knight's Shell Ability

#10 Post by WC3Player »

Well, if you don't care too much about leaks(in general, there needs to be a lot of leaks for a map to lag, a few dozen or even hundreds is fine but depends on how much resource the map usually takes) you could make one easily without worrying about a "Damage Detection System".

When it affects only heroes, that's even better because then it'll only leak once everytime a hero is created or purchased through a tavern(for example).

Here's DarnYak's shield in EotA Exodus(it's not protected which is why I'm posting) - Click for link.
(Note - The trigger is not MUI, it's MPI, which means one unit per player can have the Shield on, otherwise it'll screw up a bit).
(If you don't have an account, I'll post it in code, though it's messy to read)

Code: Select all

[trigger]Watery Shell Stats
    Events
        Time - Elapsed game time is 10.00 seconds
    Conditions
    Actions
        Custom script:   call DestroyTrigger(GetTriggeringTrigger()) 
        Set WateryShellHealth[1] = 200.00
        Set WateryShellHealth[2] = 400.00
        Set WateryShellHealth[3] = 600.00
        Set WateryShellHealth[4] = 800.00
        Set WateryShellHealth[5] = 1000.00
        Set WateryShellHealth[6] = 1200.00
        Set WateryShellKeep[1] = 0.75
        Set WateryShellKeep[2] = 0.75
        Set WateryShellKeep[3] = 0.75
        Set WateryShellKeep[4] = 0.75
        Set WateryShellKeep[5] = 0.75
        Set WateryShellKeep[6] = 0.75
[/trigger]

[trigger]Watery Shell Cast
    Events
        Unit - Naga Sorceress 0079 <gen> Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Watery Shell 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Target unit of ability being cast) has buff Watery Shell ) Equal to False
            Then - Actions
                Unit - Add Watery Shell (Spell Book)  to (Target unit of ability being cast)
                Player - Disable Watery Shell (Spell Book)  for (Owner of (Target unit of ability being cast))
            Else - Actions
        Set WateryShellInstHealth[(Player number of (Owner of (Target unit of ability being cast)))] = (WateryShellHealth[(Level of (Ability being cast) for (Triggering unit))] + (WateryShellKeep[(Level of (Ability being cast) for (Triggering unit))] x WateryShellInstHealth[(Player number of (Owner of (Target unit of ability being cast)))]))
        Set Point[0] = (Position of (Target unit of ability being cast))
        Floating Text - Create floating text that reads (Water Shield:  + (String((Integer(WateryShellInstHealth[(Player number of (Owner of (Target unit of ability being cast)))]))))) at Point[0] with Z offset 0.00, using font size 10.00, color (40.00%, 40.00%, 100.00%), and 0.00% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
        Floating Text - Set the velocity of (Last created floating text) to 32.00 towards 90.00 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
        Custom script:   call RemoveLocation(udg_Point[0])
[/trigger]

[trigger]Watery Shell Effect
    Events
        Unit - High Cleric 0066 <gen> Takes damage
        Unit - Astral Mage 0094 <gen> Takes damage
        Unit - Forsaken Sentinel 0067 <gen> Takes damage
    Conditions
        ((Triggering unit) has buff Watery Shell ) Equal to True
        WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] Greater than 0.00
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] Greater than (Damage taken)
            Then - Actions
                Set WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] = (WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] - (Damage taken))
                Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
            Else - Actions
                Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))])
                Set WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] = 0.00
                Unit - Remove Watery Shell (Spell Book)  from (Triggering unit)
                Unit - Remove Watery Shell  buff from (Triggering unit)
[/trigger]

[trigger]
Watery Shell Effect Sound Effect
    Events
        Unit - High Cleric 0066 <gen> Takes damage
        Unit - Astral Mage 0094 <gen> Takes damage
        Unit - Forsaken Sentinel 0067 <gen> Takes damage
    Conditions
        And - All (Conditions) are true
            Conditions
                WateryShellInstHealth[(Player number of (Owner of (Triggering unit)))] Greater than 0.00
                ((Triggering unit) has buff Watery Shell ) Equal to True
                (Damage taken) Greater than or equal to 5.00
    Actions
        Custom script:   call RemoveLocation(udg_WaterShieldPoint[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
        Custom script:   call RemoveLocation(udg_WaterShieldPoint2[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
        Custom script:   call RemoveLocation(udg_WaterShieldPoint3[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
        Set WaterShieldPoint[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
        Set WaterShieldPoint2[(Player number of (Owner of (Triggering unit)))] = (Position of (Damage source))
        Set WaterShieldPoint3[(Player number of (Owner of (Triggering unit)))] = (WaterShieldPoint[(Player number of (Owner of (Triggering unit)))] offset by 30.00 towards (Angle from WaterShieldPoint[(Player number of (Owner of (Triggering unit)))] to WaterShieldPoint2[(Player number of (Owner of (Triggering unit)))]) degrees)
        Unit - Create 1 Water Shield Protection for (Owner of (Triggering unit)) at WaterShieldPoint3[(Player number of (Owner of (Triggering unit)))] facing WaterShieldPoint2[(Player number of (Owner of (Triggering unit)))]
        Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation(udg_WaterShieldPoint[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
        Custom script:   call RemoveLocation(udg_WaterShieldPoint2[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
        Custom script:   call RemoveLocation(udg_WaterShieldPoint3[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])[/trigger]
Note wrote: ___________________________________________
Note: It gives an ability(Devotional) inside a spellbook to the hero. I edited devotional so it doesn't give any armor bonus, and it has the "Mana Shield" model.

I edited it so that the ability is removed when the shield is no longer is active. This makes it so that there is a buff placed on a unit and also made so that the "Mana Shield" model is removed instantly. If you use special effects, it is removed after 3 seconds after the ability wears off.

Also I added one more trigger to make it similar to EotA's Rune Shell(where when you get hit, a shield pops up).

Make a dummy unit with the "SpellShieldtarget" model(forgot if it's spelled like that), give it the "Locust" and "Invulnerability" ability so that it can't be selected and it get hit by spells/attacks/etc.

Remove any shadows. Then refer to the "Watery Shell Effect Sound Effect", which is the last trigger that I posted.
___________________________________________

Now if you don't have "preset heroes", then simply make a trigger like this -

Code: Select all

Event - Some hero spawns -
Condition - That unit is a hero
Trigger - Add to Watery Shell Effect <gen> the event (Last Created Unit) Takes damage)
For example, when a hero is spawned, add the event "Last created unit takes damage" to the Watery Shell trigger, then it'll leak only once every time a hero is created(5 heroes, that'll be only 5 leaks for the whole game).

If you want to make it castable on either Units or Heroes, you have to make it leak once per cast OR use a damage detecting system in JASS. It's easier just to make it leak, if it doesn't cause the map to lag, then it's no problem if it leaks, otherwise, you'll have to use a damage detecting system.

Also kudos to DarnYak for not protecting EotA Exodus, I used it to learn a lot of stuff from his map.

User avatar
Cokemonkey11
Addict
Addict
Posts: 306
Joined: January 26th, 2008, 12:04 am
Realm: Lordaeron (U.S. West)
Battle.net name: Cokemonkey11

Re: Rune Knight's Shell Ability

#11 Post by Cokemonkey11 »

Interesting thank you, only 1 problem.

When you use the shell ability on a hero, it doesn't get any buff. So assume the hero is just added to a unit group and then removed later?
Image
I miss EotA :(

User avatar
Dekar
Jelly Doughnut
Posts: 1433
Joined: May 27th, 2006, 8:13 am
Realm: Northrend (Europe)
Battle.net name: Dekar
Location: Germany

Re: Rune Knight's Shell Ability

#12 Post by Dekar »

I want to add to my previous post that the leaking is basically removed if you recycle the units.
x seconds after they died, move them somewhere and ressurect them, instead of creating new units get them out of this pool.

So its quite easy to create a non leaking shield that can be cast as often as you want.
<EotA@Azeroth> YAKS GO MOOOOOOOOOOOOOOOOOOOOOOOO

Dekar: the ultimate ocean themed hero should buff and depend on spawn waves!
DarnYak: why is that
Dekar: WAVES
Dekar: :D
DarnYak: i was afraid that was the answer

WC3Player
Visitor
Visitor
Posts: 24
Joined: June 3rd, 2008, 3:06 am

Re: Rune Knight's Shell Ability

#13 Post by WC3Player »

Cokemonkey11 wrote:Interesting thank you, only 1 problem.

When you use the shell ability on a hero, it doesn't get any buff. So assume the hero is just added to a unit group and then removed later?
I base an ability off of "Devotion Aura". I create a new buff named "Watery Shell"(for example), then replace the existing buff on "Devotion Aura" with the new buff.

I remove any animation on the Watery Shell buff(the animation will be present on the Devotion Aura ability).

Then I change the art for "Devotion Aura"(with the modified buff) and give it the Mana Shield animation.

Remove armor bonus(if you want).

Then I create an ability based off of a "spell book"(it's spelled like that in the object editor I think, or maybe it doesn't have spaces, forgot).

The spellbook should have "1 max" spell and "1 min" spell. Make the spellbook have the modified "Devotion Aura" ability.


Then, when you cast Watery Shell, make it give the spellbook(not modified Devotion Aura), then disable the spellbook with "Player" trigger.

When you disable spellbook, the spellbook won't appear in the unit's interface but any passive abilities(such as Devotion Aura for example) still inside the spellbook will still take effect.

When the shield is destroyed, simply remove the spellbook(and also manually remove the buff with a trigger, so it is removed instantly).

Anyway, that's how I add a buff to the Watery Shell.

The reason I use Devotion Aura for a "buff dummy" is because if you just use a regular buff, it might be removed from a spell such as "Dispel" or something.

Post Reply