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 > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 03-06-2013, 01:52 PM   #1
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,558

Submissions (5)

cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)

Default UHS - Item Request #3

Necrotic Rune:

Hero that picks up this rune gains temporarily:
Increased HP regen,
Increased Armor,
Spell immunity,
Double damage.
Hero avatar is also doubled in size.

Play some nasty necro sound on pickup.
__________________
<nosignature />
cohadar is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 03-07-2013, 05:27 PM   #2
HerrStanev
User
 
HerrStanev's Avatar
 
Join Date: Mar 2013
Posts: 49

HerrStanev has little to show at this moment (8)

Default

Are you gonna be using some system like Bonus? If not, how many levels should the dummy spells have (regen/armour)?
HerrStanev is offline   Reply With Quote
Old 03-07-2013, 07:12 PM   #3
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,558

Submissions (5)

cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)

Default

The dummy abilities for this item will have 1 level.
Try using the Dummy system in game, it is really easy, it just creates dummies for heroes. After creating the dummy you do the casting with standard functions like IssuePointOrder or IssueUnitOrder.
Also note there is an OID library in game with all wc3 order ids.

We will not use Bonus system, it is not needed.
The hero leveling will be "shallow".
That means that max level heroes will be only 2-3 times stronger than level 1 heroes.

The mechanics of combat will have focus on using spells and item abilities,
not on maxing the hero stats.

This is both simpler to make and easier to balance.
I have seen countless maps with "mega advanced systems" fail.

In game the only thing that counts is fun, if you don't provide it no one gives a shit about how many cool libraries you have.
__________________
<nosignature />

Last edited by cohadar : 03-07-2013 at 07:13 PM.
cohadar is offline   Reply With Quote
Old 03-07-2013, 07:21 PM   #4
HerrStanev
User
 
HerrStanev's Avatar
 
Join Date: Mar 2013
Posts: 49

HerrStanev has little to show at this moment (8)

Default

Pfft, I got carried away and thought this is a normal spell.
Then I'd like to know if picking another rune stacks or resets the timer.
HerrStanev is offline   Reply With Quote
Old 03-07-2013, 07:33 PM   #5
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,558

Submissions (5)

cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)

Default

Quote:
Originally Posted by Obi-Wan Kenobi
No no young Anakin, stacking buffer timers will lead you towards the wrong side of the force.

All effects of this spells should be based on one normal buff.
You will add bonuses when unit gets the buff, and you will remove bonuses when the buff expires.

You must apply magic immunity before the buff or it will be dispelled.
Make sure dummy buff spell has level req > 1 so it can target magic immune units.
(Any spell with level req > 1 is automatically treated as ultimate by wc3 engine)
__________________
<nosignature />
cohadar is offline   Reply With Quote
Old 03-10-2013, 08:14 PM   #6
HerrStanev
User
 
HerrStanev's Avatar
 
Join Date: Mar 2013
Posts: 49

HerrStanev has little to show at this moment (8)

Default

Your Dummy system conflicts with AutoIndex because you manually change UnitUserData.
Also, I can't seem to make the dummy unit cast spells on magic immune units when level requirement is > 1.
I changed the unit's Level in Object Editor to 6 and it still can't cast it.
Remind me of one spell that applies % damage bonus and is target cast (not instant like Roar).

Last edited by HerrStanev : 03-10-2013 at 08:14 PM.
HerrStanev is offline   Reply With Quote
Old 03-10-2013, 09:33 PM   #7
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,558

Submissions (5)

cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)

Default

Dummy system does not collide with Autoindex because it sets the user data right after dummy creation, and Autoindex ignores units that already have ID set.

from Autoindex:
Collapse JASS:
    private static method unitEntersMap takes unit u returns nothing
        local integer index
        local integer n = 0
            if getIndex(u) != 0 then
                return //Don't index a unit that already has an ID.
            endif

As for casting on magic immune, you also have to check both vulnerable and invulnerable in targets allowed.

The spell you are looking for is Inner Fire.
__________________
<nosignature />
cohadar is offline   Reply With Quote
Old 03-10-2013, 10:16 PM   #8
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 605

Submissions (1)

Fledermaus has a spectacular aura about (134)

Send a message via MSN to Fledermaus
Default

Quote:
Originally Posted by cohadar
The spell you are looking for is Inner Fire.
I feel like with everyone working on their own hero/spells, without a buff system, you're going to run into buff double up problems.
Fledermaus is offline   Reply With Quote
Old 03-10-2013, 10:49 PM   #9
HerrStanev
User
 
HerrStanev's Avatar
 
Join Date: Mar 2013
Posts: 49

HerrStanev has little to show at this moment (8)

Default

Quote:
and Autoindex ignores units that already have ID set.
Right, but it still produces some error message...

This is what I came up with. Based in on the previous trick of pausing/resuming the timer when needed (cool concept btw). The thing is, it requires 2 buffs - one from Inner Fire and another from Bloodlust because Bloodlust can alter unit scales. Since there is no GetUnitScale() I thought this was the way to go about it, otherwise large units like the Skeleton King might end up very tiny...
Code can be found in "Items" folder:

EDIT: I forgot to add sound play, I'll mark this for after your review.
Collapse Zinc:
//! zinc

library NecroticRune requires Dummy, OID
{
    // Raw code of the Bloodlust-based ability that changes unit scale:
    constant integer AID_SCALE_BUFF_SPELL = 'A001';
    // Buff provided by the Bloodlust-based ability:
    constant integer BID_SCALE_BUFF_SPELL = 'B000';
    // Order ID of the spell:
    constant integer OID_SCALE_BUFF_SPELL = OID_bloodlust;
    
    // The Inner Fire-based ability that provides damage,
    // armour and life regeneration:
    constant integer AID_DAMAGE_BUFF_SPELL = 'A006';
    // Buff provided by the spell:
    constant integer BID_DAMAGE_BUFF_SPELL = 'B001';
    // Order ID of the spell:
    constant integer OID_DAMAGE_BUFF_SPELL = OID_innerfire;
    
    // Raw code of a Runed Bracers-based ability that provides spell immunity:
    public constant integer AID_RUNE_BONUS_IMMUNITY = 'A002';
    // Raw code of the Necrotic Rune:
    public constant integer IID_NECROTIC_RUNE = 'I001';

    public
    {
        constant real NecroticRune_TIMER_PERIOD = 1.;
        // The timer periodically checks buffed units so it can
        // remove Spell Immunity once unbuffed.
        timer NecroticRune_TIMER = CreateTimer();
        // Counter of buffed units; used to determine when to pause/start the timer.
        integer NecroticRune_BUFFED_UNITS = 0;
        // The group tracks buffed units.
        group NecroticRune_GROUP = CreateGroup();
    }
    
    
    // Buffs a unit with the Bloodlust & Inner Fire spells.
    public function NecroticRune_BuffUnit(unit whichUnit)
    {
        IssueTargetOrderById(Dummy_Create(whichUnit, AID_SCALE_BUFF_SPELL, 1), /*
        */ OID_SCALE_BUFF_SPELL, whichUnit);
        IssueTargetOrderById(Dummy_Create(whichUnit, AID_DAMAGE_BUFF_SPELL, 1), /*
        */ OID_DAMAGE_BUFF_SPELL, whichUnit);
    }
    
    public function NecroticRune_TimerCallback()
    {
        ForGroup(NecroticRune_GROUP, function()
        {
            unit enum = GetEnumUnit();
            
            // Check both buffs, not either, if the map uses 
            // Spell Steal in the future...
            if ( GetUnitAbilityLevel(enum, BID_SCALE_BUFF_SPELL) == 0 || /*
            */ GetUnitAbilityLevel(enum, BID_DAMAGE_BUFF_SPELL) == 0 )
            {
                GroupRemoveUnit(NecroticRune_GROUP, enum);
                UnitRemoveAbility(enum, AID_RUNE_BONUS_IMMUNITY);
                
                // Pause the timer if no units currently have Necrotic Rune's buffs.
                NecroticRune_BUFFED_UNITS -= 1;
                if ( NecroticRune_BUFFED_UNITS == 0 )
                    PauseTimer(NecroticRune_TIMER);
            }
            
            enum = null;
        }); // End of ForGroup anonymous function
    } // End of TimerCallback function
}

//! endzinc
Collapse Zinc:
//! zinc

library NecroticRunePick requires NecroticRune, Trig
{
    
    function Conditions() -> boolean
    {
        return ( GetItemTypeId(GetManipulatedItem()) == IID_NECROTIC_RUNE );
    }
    
    function Actions()
    {
        unit picker = GetTriggerUnit();
        
        // Resets the buffs' durations
        NecroticRune_BuffUnit(picker);
        // Did the unit already have these buffs? 
        if ( !IsUnitInGroup(picker, NecroticRune_GROUP) )
        {
            GroupAddUnit(NecroticRune_GROUP, picker);
            UnitAddAbility(picker, AID_RUNE_BONUS_IMMUNITY);
            
            // Start the timer if it were previously paused:
            NecroticRune_BUFFED_UNITS += 1;
            if ( NecroticRune_BUFFED_UNITS == 1 )
                TimerStart(NecroticRune_TIMER, NecroticRune_TIMER_PERIOD, /*
                */ true, function NecroticRune_TimerCallback);
        }
        
        picker = null;
    }
    
    function onInit()
    {
        Trig_DropItem(function Conditions, function Actions);
    }
}

//! endzinc
Attached Files
File Type: w3x UHS ItemRequest03 v1.w3x (228.6 KB, 1 views)

Last edited by HerrStanev : 03-10-2013 at 11:11 PM.
HerrStanev is offline   Reply With Quote
Old 03-10-2013, 11:03 PM   #10
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,087

Submissions (19)

Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)

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

Default

Quote:
Originally Posted by cohadar
Dummy system does not collide with Autoindex because it sets the user data right after dummy creation, and Autoindex ignores units that already have ID set.
Yes, but AutoIndex will index the unit as it is created, before your "right after creation" code runs.

Not that that's an issue since you can always make AutoIndex ignore dummy units.

Quote:
Originally Posted by HerrStanev
Since there is no GetUnitScale()
I've run into that problem before, that's why I wrote this library. Of course, using bloodlust is fine, it's certainly less work than specifying the scaling value of each unit type, but the obvious limit of this approach is that you can't have more than one spell that changes the size of units. Just keep this library in mind in case you ever need more than one such spell.
__________________

Last edited by Anitarf : 03-10-2013 at 11:12 PM.
Anitarf is offline   Reply With Quote
Old 03-11-2013, 04:29 PM   #11
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,558

Submissions (5)

cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)cohadar is a jewel in the rough (247)

Default

Use channel ability for item spell.
Use dummy casted bloodlust for buff.
Add other stat modifications with triggers.
__________________
<nosignature />
cohadar 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 06:35 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 - 2013, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services