| 03-20-2008, 04:24 PM | #1 |
EDIT: Problem 1 solved. 2. SmartWait:function SmartWait takes real duration returns nothing local timer t local real timeRemaining if (duration > 0.) then set t = NewTimer() call TimerStart(t, duration, false, null) loop set timeRemaining = TimerGetRemaining(t) exitwhen timeRemaining <= 0. if (timeRemaining > 2.) then call TriggerSleepAction(0.1 * timeRemaining) else call TriggerSleepAction(.1) endif endloop call ReleaseTimer(t) endif endfunction // Uses Vexorian's CSSafety (tyvm) 3. UnitAddStats:// This was specifically added for the Necromancer to make his skeletons more powerful based off of his intelligence stat // but I realized that this would be a neat idea to give my other summoning abilities as well globals constant integer armorstats = 'A046' constant integer damagestats = 'A047' constant integer regenstats = 'A049' constant integer attkspeedstats = 'A04A' constant integer movespeedstats = 'A04B' endglobals //-------------------------------------------------- function UnitAddStats takes unit u, integer stat returns nothing local integer i = stat / 5 local integer d = 1 local real hp call UnitAddAbility(u,armorstats) call UnitAddAbility(u,damagestats) call UnitAddAbility(u,regenstats) call UnitAddAbility(u,attkspeedstats) call UnitAddAbility(u,movespeedstats) loop exitwhen d > i call IncUnitAbilityLevel(u,armorstats) call IncUnitAbilityLevel(u,attkspeedstats) call IncUnitAbilityLevel(u,damagestats) set d = d + 1 endloop set i = stat / 20 set d = 1 loop exitwhen d > i call IncUnitAbilityLevel(u,regenstats) set d = d + 1 endloop set i = stat / 50 set d = 1 loop exitwhen d > i call IncUnitAbilityLevel(u,movespeedstats) set d = d + 1 endloop endfunction // It WAS a whole bunch of if statements but then I got a bit smarter about it :) Thanks in advance for any help. |
| 03-20-2008, 05:30 PM | #2 |
Why don't you just base your spell on the death Knight's ultimate, the use the "unit spawns a summoned unit" to detect when he casts it and replace the summoned units with your skeletons? |
| 03-21-2008, 02:16 AM | #3 |
This must be my tenth edit. Here is the final version of the summon portion of the spell, credits to Anitarf for the idea. JASS:scope RaiseDead globals private constant integer spellid = 'A04P' private constant integer buffid = 'B015' private constant integer thrlimbid = 'A044' private constant integer conflshid = 'A045' private constant integer brthrotid = 'A04Q' private constant string animid ="birth" endglobals private function cond takes nothing returns boolean return IsUnitType(GetTriggerUnit(),UNIT_TYPE_SUMMONED) == true and GetUnitAbilityLevel(GetTriggerUnit(),buffid) > 0 endfunction private function actions takes nothing returns nothing local unit u = GetSummoningUnit() local unit f = GetTriggerUnit() local real x = GetUnitX(u) local real y = GetUnitY(u) local real fx = GetUnitX(f) local real fy = GetUnitY(f) local integer lvl = GetUnitAbilityLevel(u,spellid) local integer int = GetHeroInt(u,true) local Summon i = SU_CreateSummon(GetOwningPlayer(u),u,'u008',fx,fy,GetUnitFacing(f),25.) local unit m = SU_GetSummon(i) call RemoveUnit(f) call SetUnitAnimation(m,animid) call UnitAddStats(m,int) if lvl >= 2 then call UnitAddAbility(m,thrlimbid) if lvl >= 3 then call UnitAddAbility(m,conflshid) if lvl == 4 then call UnitAddAbility(m,brthrotid) endif endif endif call SmartWait(25.) call SU_KillSummon(m) call i.destroy() set m = null set f = null set u = null endfunction function InitTrig_RaiseDead takes nothing returns nothing local trigger tr = CreateTrigger() call TriggerRegisterAnyUnitEventBJ(tr,EVENT_PLAYER_UNIT_SUMMON) call TriggerAddCondition(tr,Condition(function cond)) call TriggerAddAction(tr,function actions) set tr = null call PreloadAbility(armorstats) call PreloadAbility(regenstats) call PreloadAbility(damagestats) call PreloadAbility(attkspeedstats) call PreloadAbility(movespeedstats) call PreloadAbility(brthrotid) call PreloadAbility(thrlimbid) call PreloadAbility(conflshid) endfunction endscope Now, I still can't figure out how to add to the max health of a unit. Any ideas on that? |
| 03-21-2008, 07:58 AM | #4 | |
Quote:
Use 'All1'-based ability (or one of 'All1'-variations). |
| 03-21-2008, 02:49 PM | #5 |
Check out the Warcraft III ability guide by PitzerMike. You will find your answer if you scroll down to the following chapter: AId1, AItg, AIlf, AImb, AIsi, Aamk, AIsr, AIdd, AIas, AIms, Arel, AIrm, AIcs |
| 03-21-2008, 04:14 PM | #6 |
I think vex have a PolledWait2() somewhere in one of his system or spell... it uses a global ticking timer where no timer needs to be create/destroy during the polled wait period |
| 03-21-2008, 06:39 PM | #7 |
I can't give the health bonus values a negative value because they are integers and not reals. Surely he tested this? I think I'm doing something wrong... the box for negative values is checked in my preferences... @zen87: I'll look it up, thanks. :) EDIT: I know how to read for a reason, SHIFT+CLICK to the rescue. Thanks Anitarf (and PitzerMike ) |
| 03-22-2008, 08:13 AM | #8 |
If you're on a Mac, shift+click does not work, by-the-way. |
| 03-22-2008, 08:49 AM | #9 |
No, no, I use a Piece of Crap (PC)... but, just out of curiosity, how do you input negative values on a Mac? |
| 03-23-2008, 04:39 AM | #10 |
You don't. You can only do it for reals. |
| 03-23-2008, 09:09 AM | #11 |
so how do u make doodads go upside down? im so sad for u... |
| 03-24-2008, 02:37 AM | #12 |
You don't. Actually, you can do that with maximum pitch and roll (which is a real value). |
