HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Changing Stats

03-27-2005, 01:39 AM#1
yuripro84
I was wondering how to make it so that i can do the following when an upgrade is bought for a specific building
-Add Maximum Amount Of Targets
-Add Health
-Add Splash
-Add Attack Damage

Thanx Guys!!

EDIT:Since i know more about triggers than upgrades, i made the upgrade do nothing, so i could do it all in triggers
03-27-2005, 02:31 AM#2
johnfn
Well why dont you just use upgrades since most of this isnt doable with triggers. Ok none of it is. These are the upgrades you will have to use:

First one - That could be based off of "Upgrade Moon Glave" upgrade.
Second - Beserker Strength
Third - Not quite sure.
Fourth - Pick maybe melee weapons upgrade
03-27-2005, 04:18 AM#3
Raptor--
i'm not sure what u want, if u want it to be done with little green +X, u could use something like this custom script for adding damage (health would be the same with health abilities) (and i guess u could do the same with splash and number of targets, but those would have to be done as simple cases since u can't really stack them i dno't think)

Code:
//***************************************************************************
//DAMAGE
//***************************************************************************

//***************************************************************************
//Removes all damage ability bonuses applied to unit 'u'
//***************************************************************************
function clearDamageBonus takes unit u returns nothing
    local integer a

    set a = 0
    loop
        exitwhen a > 12
        call UnitRemoveAbilityBJ( udg_CONST_abilDamageArray_A[a], u )
        set a = a + 1
    endloop
endfunction

//***************************************************************************
//Sets damage ability bonuses for unit 'u' to an integer
//***************************************************************************
function setDamageBonus takes unit u, integer dam returns nothing
    local integer a
    local integer b

    call clearDamageBonus(u)
    call SetHandleInt( u, "var_nCurrentDamBonus", dam )
    set a = 1
    set b = 2048
    loop
        exitwhen a > 12
        //call DisplayTextToForce( GetPlayersAll(), "Check:  " + I2S(dam) + "%%" + I2S(b) )
        if ( ModuloInteger(dam, b) < dam ) then
            //call DisplayTextToForce( GetPlayersAll(), "Yes" )
            call UnitAddAbilityBJ( udg_CONST_abilDamageArray_A[a], u )
            set dam = dam - b
            if ( dam == 0 ) then
                set a = 12
            endif
        else
            //call DisplayTextToForce( GetPlayersAll(), "No" )
        endif
        set b = b / 2
        set a = a + 1
    endloop
endfunction

//***************************************************************************
//Adds an integer damage ability bonuses for unit 'u'
//***************************************************************************
function addDamageBonus takes unit u, integer dam returns nothing
    local integer a

    call clearDamageBonus(u)
    set a = GetHandleInt( u, "var_nCurrentDamBonus" ) + dam
    call setDamageBonus( u, a )
endfunction

where udg_CONST_abilDamageArray_A[X] from lowest X starting at 1 to highest X are the damage abilities +1, +2, +4, +8, +16, +32, etc...



if u just want 1 upgrade thats static in value, it'll probably be easier to forgoe the triggers and simply use a relevant upgrade, if they need to all be done at the same time u could trigger the dummy upgrade to auto-upgrade the 4 others, or a combination of triggers and upgrades
03-28-2005, 03:32 PM#4
Das Jank
Quote:
Originally Posted by yuripro84
I was wondering how to make it so that i can do the following when an upgrade is bought for a specific building
-Add Maximum Amount Of Targets
-Add Health
-Add Splash
-Add Attack Damage

Thanx Guys!!

EDIT:Since i know more about triggers than upgrades, i made the upgrade do nothing, so i could do it all in triggers


All 4 of these can be done with simple upgrades, just make these 4:

-DamageUpgrade: Set Effect 1 equal to "Attack Damage Bonus" or "Attack Dice Bonus"..... the Damage Bonus will be a set value each time while if you use Dice Bonus it will range depending on the units Str/Agi/Int if its a hero and the base damage.

-HealthUpgrade: Set Effect 1 equal to "Hit Point Bonus" or "Hit Point % Bonus".... the first one does a set amount while the second one goes by %.

-SplashUpgrade: Set Effect 1 equal to "Spill Radius Bonus" or "Spill Distance Bonus"..... im not sure what the difference between the two is so you will have to play around with these or just set Effect 1= Radius and Effect 2 = Distance.

-MaximumTargetsUpgrade: Set Effect 1 equal to "Attack Target Count bonus"... This is exactly what moon glaive uses and it will make your hero hit more targets.


After these 4 upgrades are made all thats left to do is set how many levels you want on each upgrade (Max of 100 levels), set the "Base" value which is how much it gets on the first upgrade and the "Increment" which is how much the unit gains for each time its upgrade after the first. Lastly give the upgrades to you unit under "Upgrades Used" slot.