| 09-17-2014, 12:30 PM | #1 |
what i mean is transform one hero with weak stats into another with strong stats. how can i do that? |
| 09-17-2014, 04:13 PM | #2 |
you can play with abilities based on Belt of Giant Strength +6 (strength), Boots of Quel'Thalas +6 (agility) and Mantle of Intelligence +3 (intelligence). You can set the new abilities with multiple levels and trigger the ability level according to your needs. http://classic.battle.net/war3/basic...ermanent.shtml |
| 09-19-2014, 11:25 AM | #3 |
that isnt what i am after. those just add a static change. what i want is for the hero to gain increased stats on level up after being transformed. i already know that that requires 2 units and that i already have but the transformation is what i have trouble with. please help me out. |
| 09-19-2014, 04:19 PM | #4 |
Sounds like what you need is the Chaos transform ability. Simply add it to the Hero with a trigger when you want to morph him. Check out the campaign unit Grom to see how the ability is set up. |
| 09-20-2014, 12:15 PM | #5 |
chaos was the first thing i tried but the hero keeps its original hero stats when transformed that way. that is the problem. adding it with a trigger isnt as requirement though as the unit can just have it and then it activates when the correct requirement is present. i also tried the grom ability but as his hero stats doesnt change between forms i guess that blizzard just didnt add that possibility to the ability. i am willing to try other ideas if you have any however. |
| 09-20-2014, 02:02 PM | #6 |
Would it be feasible to have a dummy hero and level him up in tandem with the original hero, and then replace the original hero with the dummy hero when required? |
| 09-20-2014, 04:42 PM | #7 |
If the stats are the only problem of the chaos morph, you can just increase them separately with the "Hero - Modify Hero Attribute" action. |
| 09-20-2014, 08:10 PM | #8 |
i suppose it possible to use triggers to change stats so lets have that as a last resort. i still want a better solution that doesnt require triggering. |
| 09-20-2014, 10:45 PM | #9 |
Okay, under what conditions do you want the hero to transform in the first place? If it's a spell, you could just use Metamorphosis or Chemical Rage. |
| 09-21-2014, 03:36 AM | #10 |
His problem seems to be that when you do morph a hero to another hero, it keeps the first heroes base stat and stats per level values. As far as I know, you can't change those values so as Ani said, use "Hero - Modify Hero Attribute". |
| 09-21-2014, 08:29 AM | #11 |
Ah, I see, the "stats per level" are also copied over, not just the current stats of the hero. You could try replacing the hero instead of morphing it, the "replace unit" action carries over all items and experience, but not the skills so depending on your setup that might be more work than just updating the stats with triggers whenever the hero levels up. |
| 09-21-2014, 11:14 AM | #12 |
replace unit removes the items so then i would need to drop them first. |
| 09-21-2014, 01:40 PM | #13 |
You could probably add the items to the dummy hero as your 'real' hero gains them. Or is that impossible to do in Warcraft III? Essentially switching positions with a disabled\hidden unit. |
| 09-21-2014, 03:06 PM | #14 |
Replace unit does not remove items. JASS:function ReplaceUnitBJ takes unit whichUnit, integer newUnitId, integer unitStateMethod returns unit local unit oldUnit = whichUnit local unit newUnit local boolean wasHidden local integer index local item indexItem local real oldRatio // If we have bogus data, don't attempt the replace. if (oldUnit == null) then set bj_lastReplacedUnit = oldUnit return oldUnit endif // Hide the original unit. set wasHidden = IsUnitHidden(oldUnit) call ShowUnit(oldUnit, false) // Create the replacement unit. if (newUnitId == 'ugol') then set newUnit = CreateBlightedGoldmine(GetOwningPlayer(oldUnit), GetUnitX(oldUnit), GetUnitY(oldUnit), GetUnitFacing(oldUnit)) else set newUnit = CreateUnit(GetOwningPlayer(oldUnit), newUnitId, GetUnitX(oldUnit), GetUnitY(oldUnit), GetUnitFacing(oldUnit)) endif // Set the unit's life and mana according to the requested method. if (unitStateMethod == bj_UNIT_STATE_METHOD_RELATIVE) then // Set the replacement's current/max life ratio to that of the old unit. // If both units have mana, do the same for mana. if (GetUnitState(oldUnit, UNIT_STATE_MAX_LIFE) > 0) then set oldRatio = GetUnitState(oldUnit, UNIT_STATE_LIFE) / GetUnitState(oldUnit, UNIT_STATE_MAX_LIFE) call SetUnitState(newUnit, UNIT_STATE_LIFE, oldRatio * GetUnitState(newUnit, UNIT_STATE_MAX_LIFE)) endif if (GetUnitState(oldUnit, UNIT_STATE_MAX_MANA) > 0) and (GetUnitState(newUnit, UNIT_STATE_MAX_MANA) > 0) then set oldRatio = GetUnitState(oldUnit, UNIT_STATE_MANA) / GetUnitState(oldUnit, UNIT_STATE_MAX_MANA) call SetUnitState(newUnit, UNIT_STATE_MANA, oldRatio * GetUnitState(newUnit, UNIT_STATE_MAX_MANA)) endif elseif (unitStateMethod == bj_UNIT_STATE_METHOD_ABSOLUTE) then // Set the replacement's current life to that of the old unit. // If the new unit has mana, do the same for mana. call SetUnitState(newUnit, UNIT_STATE_LIFE, GetUnitState(oldUnit, UNIT_STATE_LIFE)) if (GetUnitState(newUnit, UNIT_STATE_MAX_MANA) > 0) then call SetUnitState(newUnit, UNIT_STATE_MANA, GetUnitState(oldUnit, UNIT_STATE_MANA)) endif elseif (unitStateMethod == bj_UNIT_STATE_METHOD_DEFAULTS) then // The newly created unit should already have default life and mana. elseif (unitStateMethod == bj_UNIT_STATE_METHOD_MAXIMUM) then // Use max life and mana. call SetUnitState(newUnit, UNIT_STATE_LIFE, GetUnitState(newUnit, UNIT_STATE_MAX_LIFE)) call SetUnitState(newUnit, UNIT_STATE_MANA, GetUnitState(newUnit, UNIT_STATE_MAX_MANA)) else // Unrecognized unit state method - ignore the request. endif // Mirror properties of the old unit onto the new unit. //call PauseUnit(newUnit, IsUnitPaused(oldUnit)) call SetResourceAmount(newUnit, GetResourceAmount(oldUnit)) // If both the old and new units are heroes, handle their hero info. if (IsUnitType(oldUnit, UNIT_TYPE_HERO) and IsUnitType(newUnit, UNIT_TYPE_HERO)) then call SetHeroXP(newUnit, GetHeroXP(oldUnit), false) set index = 0 loop set indexItem = UnitItemInSlot(oldUnit, index) if (indexItem != null) then call UnitRemoveItem(oldUnit, indexItem) call UnitAddItem(newUnit, indexItem) endif set index = index + 1 exitwhen index >= bj_MAX_INVENTORY endloop endif // Remove or kill the original unit. It is sometimes unsafe to remove // hidden units, so kill the original unit if it was previously hidden. if wasHidden then call KillUnit(oldUnit) call RemoveUnit(oldUnit) else call RemoveUnit(oldUnit) endif set bj_lastReplacedUnit = newUnit return newUnit endfunction |
| 09-21-2014, 08:12 PM | #15 |
it certainly do remove the items as the items dont transfer but, you should have remembered this as you helped me on another project where i had that issue. |
