Scaling Summons?

Sgt_Johnson

Active Member
Reaction score
1
I'm working on a new RPG and one of the classes (Necromancer) will be able to summon necro-like stuff such as skeletons, golems... you know what all that is lol.

But anyway is there any possible way to make the summons scale with how powerful the user is? Such as having life and damage and such based off the necromancer's stats.
 

jwallstone

New Member
Reaction score
33
Make a trigger with the Unit Enters Region event, with the region = playable map. Then, if the Summoned unit type matches, improve its stats with a system like Unit Properties.
 

RangerX

I am justice!
Reaction score
69
i have something like that on one of my "play with a friend" map :) if this what you searched for feel free to use it [and i know that are leeks and such in this map so be sure you get rid of does:) ]
Check the upgrade "Hp Points" and the Trigger "BladeMasterHpPoints"
 

TheCrystal

New Member
Reaction score
36
You need a special system for adding health, and for damage you need a system of an Integer Check for damage based off of doubles.
Damage +1
Damage +2
Damage +4
Damage +8
Damage +16
Damage +32
Damage +64
Damage +128

Etc. Each one of those add the damage of the plus, you need a system to check that.,
 

Sgt_Johnson

Active Member
Reaction score
1
Ok heres a better example of what I need.



Example

* Necromancer casts "Raise Dead"
* 3 Skeletons with a lets say, 100 base life and 10 base damage are raised.
* Each Skeleton then recieves bonus life equal to 50% of the Necromancer's Strength, and bonus damage equal to 50% of the Necromancer's Intelligence


Thats also just an example, in my map those numbers wouldn't be accurate.



CnP'd from one of my other posts on the hive for this same subject. Set integers for adding the damage just won't do as I need the summons to scale with the strength of the hero, not just become inferior as the hero becomes more powerful.
 

Yoshii

New Member
Reaction score
74
well you could make research such as animal war training( you can make it add Hp,dmg etc) but research cannot be unlearnt but since the hero doesnt get weaker it could still work

2nd option would be to the summoned skeleton as hero this way you could change their stats.
 

Sgt_Johnson

Active Member
Reaction score
1
well you could make research such as animal war training( you can make it add Hp,dmg etc) but research cannot be unlearnt but since the hero doesnt get weaker it could still work

2nd option would be to the summoned skeleton as hero this way you could change their stats.

Upgrades are completely out of the question, and yes the heroes stats can be changed (Removing equipment that improves stats?)

Hero could work, I did that in my last RPG map, though it could cause some issues possibly with other parts of the map. I'd prefer to just figure out a way to add life/damage to the summon as its summoned.
 

Yoshii

New Member
Reaction score
74
Upgrades are completely out of the question, and yes the heroes stats can be changed (Removing equipment that improves stats?)

Hero could work, I did that in my last RPG map, though it could cause some issues possibly with other parts of the map. I'd prefer to just figure out a way to add life/damage to the summon as its summoned.

hero is probably the best way to go about it because you can store the int,str and agi and set the unit to any % of it; i cant see cause issue with other part of your map; even in the case where you trigger is like "pick every unit matching unit is a hero" you could a 2nd condition to not pick the summoned type.
 

TheCrystal

New Member
Reaction score
36
As I said, for damage you need to do what I said and for life you need to find this hack some guy found that permanently adds hitpoints.
Here's part of my system for adding damage.

JASS:
if i >= 32768 then
    call UnitAddAbility(u,'A01D')
    set i = i-32768
endif
if i >= 16384 then
    call UnitAddAbility(u,'A01C')
    set i = i-16384
endif
if i >= 8192 then
    call UnitAddAbility(u,'A015')
    set i = i-8192
endif
if i >= 4096 then
    call UnitAddAbility(u,'A014')
    set i = i-4096
endif

i in this case is the number I want the damage to be, u is the unit I'm adding. Inside the ' ' is the ability's raw data. There's a more efficient method but that's more confusing.
 

Kahem

New Member
Reaction score
2
Use the item abilities like the hp increase and the damage increase
set their icons to nothing and make them unit abilities.

a unit is summoned
unit = to skelli
give summoned unit the abilitys
set level of ability to summong units stat / 2

if you want a more detailed way to do it or even a demo map ask k?
 

TheCrystal

New Member
Reaction score
36
If you do it that way, you'll have a shitload of levels, the icons will also default to green.
 

vypur85

Hibernate
Reaction score
803
> shitload of levels, the icons will also default to green

Not really.

For health/mana, see this.

For damage, see this.

Both require very few abilities (5 at most?) with not more than 10 levels each. They don't show icon at default. No green icons will appear.
 

TheCrystal

New Member
Reaction score
36
What of the one I have that requires TWO abilities for a no limit HP or Mana stat?

The other one has an additional damage that requires many abilities (Based off of multiplying from the previous, AKA 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 (can go further), but it isn't hard to use. I'm using both in my map.
 

vypur85

Hibernate
Reaction score
803
> What of the one I have that requires TWO abilities for a no limit HP or Mana stat?

That is the one I linked. I just make it easier for the guy to look at for explanation and demo map.


> that requires many abilities

The other link I posted only requires 5 abilities, with 10 levels each. Can go up to 99999 damage.


No worries :). I never doubt your system. Just stating the incorrect statement as per quoted in post above.
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
Heh I have something similar.... I think it's an easy way (probably not very efficient)and requires a bit of OE work but that's ok right? ^^
The following is run on map init (don't forget to check the 'Run on Map Initialization' checkbox)

JASS:
function SetSkeletons takes nothing returns nothing
    set udg_Skeletons[1] = 'e001' // this is the skeleton unit with ex: health 20, damage 4-4, Scale Size 1.0, defense 1, set the level to 1 and do something with GetUnitLevel() 
    set udg_Skeletons[2] = 'e002'// this is the skeleton unit with ex: health 40, damage 8-8, Scale Size 1.10, defense, set the level to 2 and do something with GetUnitLevel()
    set udg_Skeletons[3] = 'e003'//and so on...
    set udg_Skeletons[4] = 'e004'
    set udg_Skeletons[5] = 'e005'
    set udg_Skeletons[6] = 'e006'
    set udg_Skeletons[6] = 'e006'
    set udg_Skeletons[7] = 'e007'
    set udg_Skeletons[8] = 'e008'
    set udg_Skeletons[9] = 'e009'
    set udg_Skeletons[10] = 'e00A'
    set udg_Skeletons[11] = 'e00B'
    set udg_Skeletons[12] = 'e00C'
    set udg_Skeletons[13] = 'e00D'
    set udg_Skeletons[14] = 'e00E'
    set udg_Skeletons[15] = 'e00F'
    set udg_Skeletons[16] = 'e00G'
    set udg_Skeletons[17] = 'e00H'
    set udg_Skeletons[18] = 'e00I'
    set udg_Skeletons[19] = 'e00J'
    set udg_Skeletons[20] = 'e00K'
endfunction
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
function InitTrig_Set_Skeletons takes nothing returns nothing
    set gg_trg_Set_Skeletons = CreateTrigger()
    call TriggerAddAction(gg_trg_Set_Skeletons, function SetSkeletons)
endfunction


And for the spell itself:
JASS:
function Skeletons_Cond takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function Treezy_Main takes nothing returns nothing
    local integer s = GetHeroStr(GetTriggerUnit(), false)
    local integer a = GetHeroAgi(GetTriggerUnit(), false)
    local integer i = GetHeroInt(GetTriggerUnit(), false)
    local integer totalstats = s + a + i
    local unit u 
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), udg_Skeletons[totalstats / 50], GetSpellTargetX(), GetSpellTargetY(), 270)
    call UnitApplyTimedLife(u, 'BTLF', 180)
    //if GetUnitLevel(u) > 1 then
    //    call UnitAddAbility(u, 'A00J')
   // endif
endfunction
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
function InitTrig_Treezy takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition(function Treezy_Cond))
    call TriggerAddAction(t, function Treezy_Main)
endfunction

The logic is that if the Necromancer has 50 total stats he will spawn Skeleton unit with RAW code 'e001' aka level 1
If he has 100 total stats the spawned unit will be 'e002'
If he has 149 the spawned unit will still be 'e002'
becase integer division drops remainder (149 / 3 = 2.98 and when droped it becomes 2)

You can work out your own logic that still complies to this principal.
 

TheCrystal

New Member
Reaction score
36
The reason I doubted the first one was because the code wasn't JASS, since this is the code I have is:
JASS:
constant function MaxStateModifierId takes unitstate u returns integer
    if u == UNIT_STATE_MAX_LIFE then
        return 'A000' // Rawcode of the Max Life Modifier ability.
    elseif u == UNIT_STATE_MAX_MANA then
        return 'A001' // Rawcode of the Max Mana Modifier ability.
    endif
    return 0
endfunction
//call SetUnitMaxState(udg_TempUnit, UNIT_STATE_MAX_LIFE, udg_TempInteger)
function SetUnitMaxState takes unit whichUnit, unitstate whichUnitState, integer newVal returns boolean
    local integer c = newVal-R2I(GetUnitState(whichUnit, whichUnitState))
    local integer i = MaxStateModifierId(whichUnitState)
    if i == 0 then
        return false
    endif
    if c > 0 then
        loop
            exitwhen c == 0
            call UnitAddAbility(whichUnit, i)
            if c >= 100 then
                set c = c - 100
                call SetUnitAbilityLevel(whichUnit, i, 4)
            elseif c >= 10 then
                set c = c - 10
                call SetUnitAbilityLevel(whichUnit, i, 3)
            else
                set c = c - 1
                call SetUnitAbilityLevel(whichUnit, i, 2)
            endif
            call UnitRemoveAbility(whichUnit, i)
        endloop
    elseif c < 0 then
        set c = -c
        loop
            exitwhen c == 0
            call UnitAddAbility(whichUnit, i)
            if c >= 100 then
                set c = c - 100
                call SetUnitAbilityLevel(whichUnit, i, 7)
            elseif c >= 10 then
                set c = c - 10
                call SetUnitAbilityLevel(whichUnit, i, 6)
            else
                set c = c - 1
                call SetUnitAbilityLevel(whichUnit, i, 5)
            endif
            call UnitRemoveAbility(whichUnit, i)
        endloop
    endif
    set whichUnit = null
    return true
endfunction

As for the second one, I put my damage system down in case he has ridiculous amounts for some reason, both work nonetheless.
 

Immolation

Member
Reaction score
20
Try eGUI. It has functions to modify MaxHealth and Damage and whateverelseyouneedtodowithyoursummons.

~Immolation
 

Viikuna

No Marlo no game.
Reaction score
265
Probably yea.

Id just use UnitProperties, in case you dont wanna create dozens of different unit types...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top