wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 09-23-2008, 06:34 PM   #1
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 7,488

Submissions (19)

Anitarf has a brilliant future (808)Anitarf has a brilliant future (808)Anitarf has a brilliant future (808)Anitarf has a brilliant future (808)Anitarf has a brilliant future (808)Anitarf has a brilliant future (808)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default IsUnitSpellResistant

A simple function that should be very useful when making spells compatible with standard melee gameplay; I feel it's just long enough to warrant it's own library, which for the sake of completeness includes the function IsUnitSpellImmune.

Collapse JASS:
library IsUnitSpellResistant

//*****************************************************************
//*  IsUnitSpellResistant
//*
//*  written by: Anitarf
//*
//*  In WC3, most debuff and stun spells have a decreased duration
//*  against heroes, creeps with a high enough level and units with
//*  resistant skin, while other spells such as Polymorph don't
//*  even work against such units. This function checks if a unit
//*  matches any of these criteria that would make it resistant to
//*  such spells, so you can make triggered spells work that way.
//*****************************************************************

    globals
        private constant integer CREEP_RESISTANCE_LEVEL = 6 //the level at which creeps gain spell resistance
    endglobals

    function IsUnitSpellResistant takes unit u returns boolean
        return IsUnitType(u, UNIT_TYPE_HERO) or IsUnitType(u, UNIT_TYPE_RESISTANT) or (GetPlayerId(GetOwningPlayer(u))>11 and GetUnitLevel(u)>=CREEP_RESISTANCE_LEVEL)
    endfunction

    function IsUnitSpellImmune takes unit u returns boolean
        return IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE)
    endfunction

endlibrary
__________________
Anitarf is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 09-24-2008, 01:57 AM   #2
Here-b-Trollz
Corkscrew Chainsaw!!!
 
Join Date: Jun 2006
Posts: 686

Here-b-Trollz has a spectacular aura about (137)

Hero Contest #2 - 2nd Place

Default

Use of or would get it inlined, and be faster.
Expand JASS:
__________________
By reading this signature, you agree that I cannot be held accountable for anything that I might say or do.
Secret Project Spell Upload/Backups/Progress Tracking
Spell Struct Encapsulation
Here-b-Trollz is offline   Reply With Quote
Old 09-24-2008, 02:06 PM   #3
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 7,488

Submissions (19)

Anitarf has a brilliant future (808)Anitarf has a brilliant future (808)Anitarf has a brilliant future (808)Anitarf has a brilliant future (808)Anitarf has a brilliant future (808)Anitarf has a brilliant future (808)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Actually, it won't get inlined by the current JassHelper, but Vex said that in the future it might be so I updated it anyway.
__________________
Anitarf is offline   Reply With Quote
Old 09-24-2008, 11:07 PM   #4
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,502

Submissions (9)

Pyrogasm is a splendid one to behold (636)Pyrogasm is a splendid one to behold (636)Pyrogasm is a splendid one to behold (636)Pyrogasm is a splendid one to behold (636)Pyrogasm is a splendid one to behold (636)Pyrogasm is a splendid one to behold (636)Pyrogasm is a splendid one to behold (636)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

I don't know if I'm overstepping my authority, but I approve.

And we need to start cleaning up the submissions here, so moving this one on its merry way should be a good thing.
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request ThreadDone for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 02:55 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2010, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services