• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Ability Request, Will Rep

Status
Not open for further replies.
Level 4
Joined
Dec 3, 2007
Messages
117
Well i need a few abilities for my map : http://www.hiveworkshop.com/forums/showthread.php?p=483748#post483748

It's kinda old and ive stopped working on it for around 1 week but i started again
and im almost done so i just want a these abilities to complete my map :

Burst :
So the unit will randomly charge and attack any unit in his sight kinda like omnislash but the unit could have slashed one target twice and then just charge to another one and slash him once and so on...the unit is invulnerable as long as hes using the ability and could you make it so that theres some kinda cool effects when he changes targets? Also, slahes are based on heros attack damage...
5 Lvls :

Lvl 1 : 5 slashes
Lvl 2 : 10 slashes
Lvl 3 : 15 Slashes
Lvl 4 : 20 Slashes
Lvl 5 : 25 slashes

Bombard :

Basically, this skill will generate catapults and they will bombard the area, also
theres like something that keeps the people inside the circle of AoE from running like they cant move...
5 Lvls :

Lvl 1 : 10 catapults randomly generated, each inflict 1000 damage
Lvl 2 : 20 catapults randomly generated, each inflict 1500 damage
Lvl 3 : 30 catapults randomly generated, each inflict 1800 damage
Lvl 4 : 35 catapults randomly generated, each inflict 2000 damage
Lvl 5 : 40 catapults randomly generated, each inflict 2050 damage

Dismembering Wrath :

Basically, the circle of AoE will be filled with the impale model, damaging everything inside it, however, the hero will have lowered defense by 50% but it cant be stacked...
5 Lvls

Damage is Str x 250 + 100, the + 100 is for each level for exemple, level 2 is Str x 250 + 200 and level 5 is Str x 250 + 500

and yes im serious thats the damage

Melting Fire Armor :

Its like the immolation skill except that it doesnt burn enemies, it just lowers enemies armor as long as the armor is on and its an ability :) :
15 Lvls

Lvl 1 : -2%
other levels are basically -2% - 1%

if you dont want to do all the 15 levls, then tell me how to do it and just do like the 3 first levels and ill finish the rest...

Thanks and ill plus rep those who help and add credits in my map :)
 
Level 8
Joined
Mar 23, 2007
Messages
302
I will do those spells for you.
I just need some more information about the 1 spell.

...but the unit could have slashed one target twice and then just charge to another one and slash him once and so on...

this is what i dont get.
1 target gets 2 slashes, the second gets 1?
What do the heros does with the other slashes, cuz 2 are left?
or does he hits 1 target 2 times , then another target 2 times, and a last one 1 time.
Can he hit a single Target more then 2 times?

all the other things shouldnt be that hard.

And i will use JASS and keep it clean for you to change it easy,
but i am not a friend of JESP.
 
Level 8
Joined
Mar 23, 2007
Messages
302
Ok here we go,

I only did the first spell now, the others will follow.

Slash:

This is the Code

I did the whole thing from begin so be patient, if some one finds a leak
or somthing to be fixed, just let me know and i change it to the better.

JASS:
function Trig_Slash_Conditions takes nothing returns boolean           //---
return GetSpellAbilityId() == 'A000'                                  // This is the spell ID that triggers this spell*
endfunction                                                            //---

function CheckTarget takes unit t, unit c returns boolean                      // This are the CONDITIONS for the targets. Now it only attacks:Visible Enemy AliveUnits that are not Buldings and do not have "Invurnalable"
return (IsUnitType(t, UNIT_TYPE_STRUCTURE) == false ) and(GetUnitState(t, UNIT_STATE_LIFE) > 0) and(GetUnitAbilityLevel(t, 'Bvul') < 1) and(GetUnitAbilityLevel(t, 'Avul') < 1) and( GetOwningPlayer(t) != GetOwningPlayer(c)) and ( IsUnitVisible(t, GetOwningPlayer(c)) == true )
endfunction    

function PolarPosition takes unit t, real dis, real x, real y returns nothing    //This function Places the unit around a target.     
local location L                                                                      
local real R = GetRandomReal(0,360)                                                   
    local real newx = x + dis * Cos(R * bj_DEGTORAD)                                  
    local real newy = y + dis * Sin(R * bj_DEGTORAD)                                  
set L = Location(x,y)                                                                 
call SetUnitPosition(t,newx,newy)                                                     
call SetUnitFacingToFaceLocTimed(t,L,0)
call RemoveLocation(L)
set L = null
set t = null
endfunction


function DamageDetection takes unit u returns real
local real x = GetUnitX(u) + 5 * Cos(GetUnitFacing(u) * bj_DEGTORAD)                  //---    This damage System is not 100% perfect.
local real y = GetUnitY(u) + 5 * Sin(GetUnitFacing(u) * bj_DEGTORAD)                  //---
local unit d = CreateUnit(Player(15),'e000',x,y,270)                                  //---    I just dont know a better way to get the deald damage
local real DAMAGE                                                                     //---
call PolledWait(0.01)                                                                 //---    This system gives the damage fine but in some cases.  
call IssueTargetOrder(u,"attack",d)                                                   //---
call PolledWait(1.54)                                                                 //---    change this to the units attack cd or better would be a little more.
set DAMAGE = (GetUnitState(d,UNIT_STATE_MAX_LIFE) - GetUnitState(d,UNIT_STATE_LIFE) ) //---
call RemoveUnit(d)                                                                    //---
set d = null                                                                          //---
return DAMAGE                                                                         //---
endfunction
 
function FaderOUT takes nothing returns nothing                                       // a Out Fader System.
local timer FadeTimer = GetExpiredTimer()                                             // with Special effects at Hands.
local unit CASTER = GetHandleUnit(FadeTimer, "whichUnit")              
local real FADEMIN = GetHandleReal(FadeTimer, "FADEMIN")               
local real FADEDECREASE = GetHandleReal(FadeTimer,"FADEDECREASE")      
local real FADESTEPS = GetHandleReal(FadeTimer,"FADESTEPS")            
local real Isvaule = GetHandleReal(FadeTimer,"Isvaule")
if Isvaule > FADEMIN then                                              
set Isvaule = Isvaule-FADEDECREASE                                     
call SetUnitVertexColor(CASTER,255,255,255,PercentTo255(Isvaule))                    
set FADESTEPS = FADESTEPS-1                                                          
endif                                                                                
call SetHandleReal(FadeTimer,"Isvaule",Isvaule)                                      
call SetHandleReal(FadeTimer,"FADESTEPS",FADESTEPS)                                  
if FADESTEPS == 0 then                                                               
call FlushHandleLocals(FadeTimer)                                                    
call DestroyTimer(FadeTimer)
set FadeTimer = null                                                                 
set CASTER = null                                                                    
endif
endfunction

function Trig_Slash_Actions takes nothing returns nothing
local group G = CreateGroup()                                                        //---
local unit t                                                                         //---
local real Isvaule = 100                                                             //---
local timer FadeTimer = CreateTimer()                                                //---
local unit CASTER = GetSpellAbilityUnit()
local integer HPL = 7                                                               //Hits each level.
local integer HITS = GetUnitAbilityLevel(CASTER,'A000')*HPL                          //change the ID. (here 'A000' to the same ID as u did in the conditions*)
local real RANGE = 800                                                               //the START RANGE.
local real DETECTION = 600                                                           //the DETECTION RANGE after the START RANGE .
local real WAIT = 0.07                                                               //Waits between each attack.
local real FADESTEPS = 7                                                             //sets the number of steps it needs to reach Minimal Fade level.
local real FADETIME = 2.465                                                          //sets the time the Fade needs to reach the Minimal Fade level.
local real FADEMIN = 30                                                              //the Minimal Fade level (0-100) 0 is invisible(with shadow) and 100 is no fade at all.
local real FADEINTERVAL = FADETIME/FADESTEPS                                         //---
local real FADEDECREASE = (100-FADEMIN)/FADESTEPS                                    //---
local real DAMAGE = DamageDetection(CASTER)                                          //This demiters the DAMAGE. for a fix damage like 300 change this line to "local real DAMAGE = 300".
local real SPEED = 350.000                                                           //This changes the Speed of the animation for each Slash.
local real BACK = 0.5                                                                //How long the unit takes to get back to normal state (a minimum of 0.01 is needed).
local real SAVEBACK = 2.5                                                            //How long the unit takes to get back to normal state (if the BACK fails).
local string ANIMA = "attack"                                                        //This changes the ANimation of the unit doing each slash.
local effect left                                                                    //---
local effect right                                                                   //---
local string EFFECT = "Abilities\\Weapons\\AvengerMissile\\AvengerMissile.mdl"       //This changes the Model for the SPECIAL EFFECT
call SetHandleHandle(FadeTimer, "whichUnit", CASTER)                                 //---
call SetHandleReal(FadeTimer, "FADEDECREASE", FADEDECREASE)                          //---
call SetHandleReal(FadeTimer, "FADEMIN", FADEMIN)                                    //---
call SetHandleReal(FadeTimer,"Isvaule", Isvaule)                                     //---
call UnitAddAbility(CASTER,'Avul')                                                   //---
call PauseUnit(CASTER,true)                                                          //---
call TimerStart(FadeTimer,FADEINTERVAL,true, function FaderOUT)                      //---                                         //---
call GroupEnumUnitsInRange(G,GetUnitX(CASTER),GetUnitY(CASTER),RANGE,null)           //---
set left = AddSpecialEffectTarget( EFFECT , CASTER, "left hand" )                    //---
set right = AddSpecialEffectTarget( EFFECT , CASTER, "right hand" )                  //---
loop                                                                                 //---
    loop                                                                             //---
    set t = GroupPickRandomUnit(G)                                                   //---
    if CheckTarget(t,CASTER) == true then                                                   //---
    set HITS = HITS-1                                                                //---
    exitwhen true                                                                    //---
    endif                                                                            //---
    if CheckTarget(t,CASTER) == false then                                                  //---
    call GroupRemoveUnit(G,t)                                                        //---
    endif                                                                            //---
    if t == null then                                                                //---
    set HITS = 0                                                                     //---
    exitwhen true                                                                    //---
    endif                                                                            //---
    endloop                                                                          //---
exitwhen (t == null) or (HITS == 0)                                                  //---
call SetUnitTimeScalePercent( CASTER, SPEED )                                        //---
call SetUnitAnimation( CASTER, ANIMA )                                               //---
if CheckTarget(t,CASTER) == true then                                                       //---
call PolarPosition(CASTER,30,GetUnitX(t)+GetRandomReal(-5,5),GetUnitY(t)+GetRandomReal(-5,5))
call UnitDamageTarget( CASTER, t, DAMAGE, true, false, ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )  //This sets the DAMAGE TYPE, configure this to make the damage magical or whatever.
endif                                                                                //---
call PolledWait(WAIT)                                                                //---
call GroupEnumUnitsInRange(G,GetUnitX(CASTER),GetUnitY(CASTER),DETECTION,null)       //---
endloop                                                                              //---                                                
call SetHandleReal(FadeTimer, "FADEMIN", 100)                                    //---                                                                              //---                                                
call PolledWait(BACK)                                                                //---
call PauseUnit(CASTER,false)                                                         //--
call UnitRemoveAbility(CASTER,'Avul')                                                //---
call SetUnitVertexColor(CASTER,255,255,255,255)                                      //---
call SetUnitMoveSpeed(CASTER,GetUnitDefaultMoveSpeed(CASTER))                        //---
call SetUnitTimeScalePercent( CASTER, 100.00 )                                       //---
call PolledWait(SAVEBACK)                                                                //---                                    
call SetUnitVertexColor(CASTER,255,255,255,255)                                      //---

call DestroyGroup(G)                                                                 //cleaning up
set G = null                                                                         //---
set CASTER = null                                                                    //---
set t = null                                                                         //---
call DestroyEffect(left)                                                             //---
call DestroyEffect(right)                                                            //---
set left = null                                                                      //---
set right = null                                                                     //---
endfunction
//===========================================================================
function InitTrig_Slash takes nothing returns nothing
    set gg_trg_Slash = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Slash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Slash, Condition( function Trig_Slash_Conditions ) )
    call TriggerAddAction( gg_trg_Slash, function Trig_Slash_Actions )
endfunction

What u should Mind:

  • This Spells reqires Handle Vars system, made by Kattana
  • A spell ID
  • a Dummy unit
  • the Dummy unit should have min a realy higher HP then the most DAMAGE in your map

I checked this spell and everything seems to be Fine
Added a Simple Special effect, U can change it easly.
If u wannt some changes then just say it.

Dont forget , if u want it to be a Hero AND non-Hero ability you have
to make 2 triggers ad set the Correct ID for both(shown in the MAP).

Every unit can use this Ability (even towers or Halls, trees balblabla).

Now the spicey thing: the Damage detection works like:

Dummy unit will be createt
Caster hits it 1 time
Function checks how much life is lost
deals that lost hp to the following targets.​

this is not a perfect system.

problems could be with Extrem Fast attacking units.
the units stays for a short time to get the damage from 1 hit
but if the caster can attack 3 times in this little time, all other gets 3 times damage. Til i didnt fixed this, it up to u to prevent this on any way.

other problem is if the caster uses this in a Blizzard for example
the Dummy could get again some more damage, resulting in more damage
for eacht target.

The not BEST solution is:
u turn off the Damage detection system and use a Fix vaule like
200 damage. no mather what happens all target get only those 200 and not more.

k ^^ i hope i could help u a bit, the more time i get i will work on the other
spells too.
 

Attachments

  • Spell - Slash.w3x
    47.7 KB · Views: 78
Level 4
Joined
Dec 3, 2007
Messages
117
wow i tried it, 1 word, amazing :thumbs_up: if i could rep you infinitively, id do dat once a day lol
but what do you mean by the Handle Vars System? its like something thats already in the map or what?

having some difficulties importing too >< probably because of the system you were mentioning
 
Last edited:
Level 8
Joined
Mar 23, 2007
Messages
302
the Handle var system was made by Kattana,

It allows to attach information to other things like trees, units, timer etc etc

the important thing to know it that
u have to import it to the MAP HEADER.
simply copy the HEADER of the map i gave u
to your Map HEADER and the importation should work.

i give u some tutorials here:
http://www.wc3jass.com/viewtopic.php?t=224
this is the link to the script

this here is a using tutorial:
http://www.wc3jass.com/viewtopic.php?t=2006
-------------------------------------

I hope u know how to import it now??

again:

  1. Copy the HandleVars system to the HEADER
  2. Create a Dummy Unit
  3. Create a Spell
  4. Change the ID of the spells and the Dummy Unit to the ID of the things u createt in the map
  5. dont forget, Dummy Unit needs more HP than ever possible damage

^^ i hope this helps u abit. I will work on the 2 second skill tomorrow.

EDIT:

ok about the second spell the Catapults,
how long should they stay? for ever? 1 shot? timed life?
 
Last edited:
Level 4
Joined
Dec 3, 2007
Messages
117
for the catapults, as soon as they finish theyre shot, which is one each, then they will slowly fade away so i guess just put an expire time

EDIT : oh and could you help me becuz i asked in another forum and they said it might need newgen but it doesnt work on my pc, dunno why... so i dont know how you do it but could you use the newgen for my map so i can use the trigger?
 
Last edited:
Level 4
Joined
Dec 3, 2007
Messages
117
well becuz when i try to save the map, and yes ive copied the dummy, the trigger and did the ID. Also, i copied the Handle Vars to the map header yet when i try to save it, the WE gives me a giant list of errors...
 
Level 8
Joined
Mar 23, 2007
Messages
302
However here is the next Spell:

Bombard:

ok this one is, more complicated.
this means u will need more dummy stuff and things like that.

ok first here is the
JASS:
function Trig_Bombard_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000'                           // Ability ID, change it to the one u use in your MAP.
endfunction

function E takes nothing returns nothing
    call ExecuteFunc("F")
endfunction

function FadeOUT takes unit u returns nothing                 //OutFader for the catapults
local real Isvaule = 100
loop 
exitwhen Isvaule == 0
set Isvaule = Isvaule-5
call PolledWait(0.05)                                  
call SetUnitVertexColor(u,255,255,255,PercentTo255(Isvaule))
endloop
call RemoveUnit(u)                    
endfunction

function F takes nothing returns nothing
local unit g = GetEnumUnit()
local player P = GetOwningPlayer(g)
local real face = GetHandleReal(g,"face")
local real tx = GetHandleReal(g,"tx")
local real ty = GetHandleReal(g,"ty")
local real cx = GetHandleReal(g,"cx")
local real cy = GetHandleReal(g,"cy")
local real AoE = (GetHandleReal(g,"AoE"))*0.5
local real MAXdist = GetHandleReal(g,"MAXdist")
local integer Bombs = GetHandleInt(g,"Bombs") 
local integer lvl = GetHandleInt(g,"lvl") 
local integer U
local unit ta
local location L = GetUnitLoc(g) 
local integer R = GetRandomInt(0,1)
if lvl == 1 then
set U = 'o000'                   //       This is important
elseif lvl == 2 then             //
set U = 'o003'                   //       Change here the ID of the 
elseif lvl == 3 then             //       5 different Catapults
set U = 'o004'                   //       
elseif lvl == 4 then             //       this ID are only for this
set U = 'o005'                   //       map and can cause some
elseif lvl == 5 then             //       weird results if u dont
set U = 'o006'                   //       change it to the ones u need.
endif
set g = CreateUnit(P,U,cx+GetRandomReal(0,MAXdist)* Cos(GetRandomReal(0,360)),cy+GetRandomReal(0,MAXdist)* Sin(GetRandomReal(0,360)),face) 
set ta = CreateUnit(P,'o002',tx+GetRandomReal(0,AoE)* Cos(GetRandomReal(0,360)),ty+GetRandomReal(0,AoE)* Sin(GetRandomReal(0,360)),270)
call PolledWait(GetRandomReal(0.01,4.0))  // change this to set the random times between each shoot.
call IssueTargetOrder( g, "attack", ta )
call PolledWait(0.01)
call RemoveUnit(ta)
call PolledWait(3)                        // how long the catapults stay after they shoot.
call FadeOUT(g)

endfunction

function Trig_Bombard_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local unit g
local unit A
local player P = GetOwningPlayer(u)
local group G = CreateGroup()
local group B = CreateGroup()
local group H = CreateGroup()
local location l = GetSpellTargetLoc()
local real face = GetUnitFacing(u)
local real tx = GetLocationX(l)
local real ty = GetLocationY(l)
local real cx = GetUnitX(u)
local real cy = GetUnitY(u)
local integer ABI = 'A000'                             // The ability ID
local integer Blocker = 'h008'                         // ID of the Blocker (Spears in my map)
local integer LEVEL = GetUnitAbilityLevel(u,ABI)
local integer Bombs
local integer x = 0
local real AoE = 100*LEVEL+500                         // Area of Effect, this demiters the area where Boulders can Hit.
local real MAXdist = (100*LEVEL+500)*0.40              // This limits the position of the Catapults from the Caster.


local real AoEBlocker = (100*LEVEL+500)*1.35           // This sets the Radius of the Blockers
local real blockC = 36.0
local real countblocks = AoEBlocker/blockC
local real step = 360/countblocks
local real interval = 0 
local integer xx = 0

call RemoveLocation(l)

if (LEVEL == 1)or(LEVEL == 2)or(LEVEL == 3) then       //Here u can change the number of catapults
set Bombs = LEVEL*10                                   // the spezific rise of 10,20,30,35,40 forced me
elseif (LEVEL == 4) then                               // to do it like that
set Bombs = 35
elseif (LEVEL == 5) then
set Bombs = 40
endif

loop
exitwhen x >= Bombs
set x = x+1
set g = CreateUnit(P,'o002',cx+GetRandomReal(0,MAXdist)* Cos(GetRandomReal(0,360)),cy+GetRandomReal(0,MAXdist)* Sin(GetRandomReal(0,360)),0)    // This is a dummy unit.
call GroupAddUnit(G,g)
call GroupAddUnit(H,g)
call SetHandleReal(g,"face",face)
call SetHandleReal(g,"tx",tx)
call SetHandleReal(g,"AoE",AoE)
call SetHandleReal(g,"ty",ty)
call SetHandleReal(g,"cy",cy)
call SetHandleReal(g,"cx",cx)
call SetHandleReal(g,"MAXdist",MAXdist)
call SetHandleInt(g,"Bombs",Bombs)
call SetHandleInt(g,"lvl",LEVEL)
call ForGroup(G, function E)
call GroupRemoveUnit(G,g)
endloop

set A = CreateUnit(P,'o002',tx,ty,0)    // EYE UNIT : Here u can use WHATEVER unit u want to, this is like an eye.
 
loop
exitwhen xx >= 345                      // !!!! change this ONLY if a big blocking circle (spear circle) doesnt close completly. reduce this vaule to make some more spears, bt reduce only a bit.
set xx = R2I(interval)
set g = CreateUnit(P,Blocker,GetUnitX(A)+AoEBlocker/2* Cos(interval*bj_DEGTORAD),GetUnitY(A)+AoEBlocker/2* Sin(interval*bj_DEGTORAD),GetRandomReal(0,360)) 
call GroupAddUnit(B,g)
set interval = interval+step
endloop
call PolledWait(8)                      //How longe the Spears stay before disapear.

loop                                    
set g = FirstOfGroup(B)
exitwhen g == null
call GroupRemoveUnit(B,g)
call RemoveUnit(g)
endloop

loop
set g = FirstOfGroup(H)
exitwhen g == null
call GroupRemoveUnit(H,g)
call RemoveUnit(g)
endloop

call PolledWait(4)                      // additional time the EYE unit stay.
call RemoveUnit(A)
set g = null
endfunction
//===========================================================================
function InitTrig_Bombard takes nothing returns nothing
    set gg_trg_Bombard = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Bombard, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Bombard, Condition( function Trig_Bombard_Conditions ) )
    call TriggerAddAction( gg_trg_Bombard, function Trig_Bombard_Actions )
endfunction

What do u Need for this spell?

  • a usual Dummy (for targeting and the EYE unit, u can use 1 unit for both)
  • the 2nd Dummy is the Blocker, in this map shown as a spear with a collision size of 32 what is important
  • Handle Vars ofc...
  • 5 different catapult units, for each level 1. For more information check out the units i did in the map
  • and ofc a Spell with the proper ID

Ok what the spell does?
the Unit creates an amout of catapults, shooting the target area down to ash. the target area will be surounded with SPEARBLOCKERS. so units cant move in nor out.

Some important additional notes:
U can use a 3rd Dummy for the EYE unit, to make it look whatever u want, a Flag for example or an flying orb, balbla.
the usual Dummy should be as a normal dummy is(0 collision, no moving , etc etc...) AND it needs invisibility, that helps in some cases to prevent enemy units to attack the dummy.

The circle should always close himself, if this shouldnt happen, u can give me the AoE u want to have it and i change it for u, or u change it yourself, its at the end of the code.

u NEED 5 different units to change the DAMAGE, Flying Speed of the Rocks etc etc. I used as much information as i can to make ready units.

Ok i go sleep now, and u can test the map...

ABOUT your NewGen Problem:

here is a link to Wc3c, i hope this helps u a bit
http://hilton.gw.oiccam.com/showthread.php?p=994247#post994247
and
http://hilton.gw.oiccam.com/showthread.php?t=90999

-------EDIT---------------------------------------------------------

ok your 3rd spell. ehm...
this is way to less information.

I need to know:
Kind of spell? (TargetArea or simply Area around the Hero)
does the spell STUN?
how big should be the AoE?


and as i get it, this spell reduces the Armor of the CASTER or TARGET?

Damage is Str x 250 + 100, the + 100 is for each level for exemple, level 2 is Str x 250 + 200 and level 5 is Str x 250 + 500

do u mean exactly:
a. level 2 : (Str x 250) + 200
or
b. level 2 : Str x (250 + 200)

greets =
 

Attachments

  • Spell - CatapultsBombard.w3x
    75.7 KB · Views: 57
Last edited:
Level 8
Joined
Mar 23, 2007
Messages
302
I know i should avoid double posts, but i hope this is ok for here
u simply answer to slow,aznsteph ;). And it helps to keep this big thinks abit more
organized.

Now here is your next spell...

Spikes

JASS:
function Trig_Spikes_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000'                           // spell id thet triggers this spell
endfunction

function Exe takes nothing returns nothing
call ExecuteFunc("Doit")
endfunction

function Doit takes nothing returns nothing
local unit u = GetEnumUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real t = 1.05                      // *
local location l = Location(x,y)
call SetUnitPosition(u,x+100*Cos(GetRandomReal(0,360)*bj_DEGTORAD),y+100*Sin(GetRandomReal(0,360)*bj_DEGTORAD))
call SetUnitFacingToFaceLocTimed(u,l,0)
call RemoveLocation(l)
call IssuePointOrder(u,"impale",x,y)
call PolledWait(t)
call RemoveUnit(u)
set l = null
set u = null
endfunction


function Trig_Spikes_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local unit g
local group G = CreateGroup() 
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local player p = GetOwningPlayer(u)
local integer level = GetUnitAbilityLevel(u,'A000')
local integer str = GetHeroStr(u, true)                         //gets the str
local integer DMG = 100*level      //str * 250 + level*100      //calculation for Damage. the Green calculation is the one u want.
local integer DummyID = 'h001'                                  //ID of the Dummy unit
local integer ArmorID = 'A003'                                  //ID of the -Armor ability
local real AoE = 150+level*50                                   //Area of Effect calculation
local real circles = 2*level                                    // how much circles u need 
local real rows = 16                                            // how much rows 
local real degre = 0
local real range = 0
local real step = 360/rows
local real distance = AoE/circles

loop
exitwhen (degre >= 360) and(range >=AoE)
if degre >= 360 then
set degre = 0
set range = range+distance
endif
set g = CreateUnit(p,DummyID,x+range*Cos(degre*bj_DEGTORAD),y+range*Sin(degre*bj_DEGTORAD),degre)
call GroupAddUnit(G,g)
set degre = step+degre
endloop

call ForGroup(G, function Exe)
call PolledWait(1.26)          // keep this higher than the AIR time + the cast delay i marked with a star!!!

call GroupEnumUnitsInRange(G,x,y,AoE*1.295,null)
loop
set g = FirstOfGroup(G)
exitwhen g == null             //below are the conditions for the target units that get damage.
if (IsUnitEnemy(g,p) == true)and(GetUnitAbilityLevel(g, 'Bvul') < 1) and(GetUnitAbilityLevel(g, 'Avul') < 1)and(IsUnitType(g, UNIT_TYPE_STRUCTURE) == false ) then
call UnitDamageTarget(u,g,DMG,true,false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
endif
call GroupRemoveUnit(G,g)
endloop

call UnitAddAbility(u,ArmorID)
call SetUnitAbilityLevel(u,ArmorID,1)
call PolledWait(10)                                    // how long the -Armor buff stays
call UnitRemoveAbility(u,ArmorID)

call DestroyGroup(G)
set G = null
set g = null
set u = null
set p = null
endfunction

Ok, so...

what u should do? (i think u know already but ^^ some thing are new)
u Need:

  • Create a Dummy Unit
  • Create a Dummy Spell (for the Unit that uses the spell)
  • Create a Implane Spell (for the Dummy unit , this spell must do 0 dmg)
  • a SpellBock ability
  • Disable this spell bock ability
  • do a -x Armor aura into this spellbock ability

what i couldnt do was the -50% of the armor....
if u give me some more informations about the AGI and AGI growth , then
i could mb do a calculation system , that gets the Armor u get from
all the AGI and create that much Spells (for each -1 armor 1 spell).

another solution would be to just let it be a FIX vaule, like i did (-4 armor
for 10 seconds).

the 2nd problem was, due to your wish to have it depending on your
STR*blabalbla DAMAGE i needed to split the whole spell.

Part A shows the beautifull effect of implane (the FAKEspell) but does no damage.

Part B waits for the units to come back to ground, checking the targets
for being legal targets and then deal the Damage.​

the problem?
a little distance calculation problem.
This means that in seldom situations Units that are near the
SpellAreaEffectBorder will recive damage without being implaned, or vice
versa.

When em finishd the last spell, i will have a preciouse look
on the LEAK and CLEANness of all the spells,
additionaly u can think about NICE special effects,
like a blue BLAST after the implane for example...

have a Time ,
Equal

--------------------EDIT

ok i attached the Demo Map.
 

Attachments

  • Spell - Spikes.w3x
    75.4 KB · Views: 73
Last edited:
Level 4
Joined
Dec 3, 2007
Messages
117
wow that was fast :) thanks alot, lol i forgot to check the thread dats y i didnt post >< sorry

EDIT : cant rep you again becuz i already did, so gonna hav to rep another person bfore
 
Level 4
Joined
Dec 3, 2007
Messages
117
i know i shouldnt be double posting too but this is getting on my nerves :
new gen editor doesnt work on my pc >< it bugs... so will you help me with it on my map...?
 
Level 8
Joined
Mar 23, 2007
Messages
302
If u mean that u give me the map and i
import all those spell, this is ok for me.

but on the other hand this is risky ...
who grants u that i will not keep a open save
on mu harddisk and spam the Bnet with
fake maps.

no, i em joking but i cant say if after i imported the spells
u can open the map.

AND btw, do u need NewGen?
i dont think so, it could be done without i would guess.
so mb u a lazy bum... or u just have no idea how to import spells?
if i didnt explained somthing, just let me know :) <== no offence em just bit drunken cuz returnd from party .

However, i will HELP u.
 
Level 8
Joined
Mar 23, 2007
Messages
302
Looks more like 4 abilities to me :\

this is correct.

but, what u want to say with that ?

in some time i will have the last spell done , too

-------------------------------------Edit

A flexible calculation System for the % is not possible to me.
If u are Happy with Fix non-% vaules like -3 or -21 and stuff like that, then
i CAN make it.
 
Level 4
Joined
Dec 3, 2007
Messages
117
lol im not lazy XD, i tried to save my map with your first spell like 3 times and still didnt work ==' and if you cant make the non % then its ok with me :thumbs_up:

Like i copied your spell( the first), i copied the dummy unit, i copied the abilities and i putted the id tags and all, then i copied Kattana's Handle Vars System but when i try to save it, it always says ~7000 errors found O_O

EDIT : Hey Equal, ive fixed most of the errors by just recopying all your stuff but now it gives me one more error >< :

call PolarPosition(CASTER,30,GetUnitX(t)+GetRandomReal(-5,5),GetUnitY(t)+GetRandomReal(-5,5))

It says "Expected a function name"

So anyways to fix this mistake..?


Oh and ive tried your two other spells, they were truly great. Except for 2 things :
1- in the bombard, the catapults have a little bit too much of range and it doesnt look really fair for all the other heros in my map, also the damage of bombard is the one of the catapults right?

2-in the spikes, i saw in the tooltip when i learned the skill that it would do 100/200 and everything of damage...is it true because i wanted it to be based on (str x 250) + 200 or something like that lol, if you cant do it then just tell me how to edit the damage
 
Last edited:
Level 8
Joined
Mar 23, 2007
Messages
302
ok lets go again.

so first of all here is the last spell.

This one is easy, all things can be changed in the Objekt Editor.

and the code is realy short
additional u dont need Handle Vars ,too.

You should mention in your MAP that it u lvl up the Melting armor u have to turn it off then on to have the better shild be present.

simply +1 lvl in shild = turn it off (if its on), then turn it on again
or u will have the old one.

what u need it:

  • a Preloader Spellbock Ability (for the -Armorhiden aura)
  • a Fake Ability for to be shown.
  • a buff for it (mainly for the graphics and unstackablity)
  • a - Armor aura , based on the Holy armor aura

JASS:
function ARMOR_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'A000')>0
endfunction

function ARMOR_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer level = GetUnitAbilityLevel(u,'A000')
 	if(GetIssuedOrderId()==OrderId("immolation"))then
		call UnitAddAbility(u,'A002')
        call SetUnitAbilityLevel(u,'A001',level)
	endif
	if(GetIssuedOrderId()==OrderId("unimmolation"))then
    		call UnitRemoveAbility(u,'A002')
	endif    
set u = null
endfunction

//===========================================================================

function InitTrig_ARMOR takes nothing returns nothing
set gg_trg_ARMOR = CreateTrigger(  )
 	call TriggerRegisterAnyUnitEventBJ(gg_trg_ARMOR,EVENT_PLAYER_UNIT_ISSUED_ORDER)
	call TriggerAddCondition(gg_trg_ARMOR,Condition(function ARMOR_Conditions))
	call TriggerAddAction(gg_trg_ARMOR,function ARMOR_Actions)
endfunction

this is the Full trigger. you should pay attention to the
JASS:
 	call TriggerRegisterAnyUnitEventBJ(gg_trg_ARMOR,EVENT_PLAYER_UNIT_ISSUED_ORDER)
keep the event the same.

Em sorry, didnt had that much time to make a better Demo map, but on the other Hand, this isnt SO OUTSTaNDING to reduce armor, anyway hope is ok :p.

----------------------------------------------------------------------------------


----------------------------------------------------------------------------------

About your problems with the Spells:

The Jass thingy:

here is the code of the small system for the polarposition.
keep in mind that ths system is self made and changed to fit to your
spell. in otherwords it has to be before u call it.
JASS:
function PolarPosition takes unit t, real dis, real x, real y returns nothing    //This function Places the unit around a target.     
local location L                                                                      
local real R = GetRandomReal(0,360)                                                   
    local real newx = x + dis * Cos(R * bj_DEGTORAD)                                  
    local real newy = y + dis * Sin(R * bj_DEGTORAD)                                  
set L = Location(x,y)                                                                 
call SetUnitPosition(t,newx,newy)                                                     
call SetUnitFacingToFaceLocTimed(t,L,0)
call RemoveLocation(L)
set L = null
set t = null
endfunction

but the
It says "Expected a function name"
doesn't seem to be a problem with system, more it looks like a problem
that u did a line before or so. Just check it again, if this didsnt helped,
give me the code u created and i will have a look at it.

ABOUT 1:
Balancing is not part of programming ;) . See i can make the Spell be
able to deal 3590347509234 dmg, they are just numbers for me. its up to u to
set the balance right. so How to reduce the Range? :

go to the Object editor, search for the ability BOMBARD and reduce the casting Range. DO NOT CHANGE THE RANGE OF THE CATAPULTS!

thats it, whenever the unit want to cats it, it has to be at least in X range.

The Damage calculation is all via the catapult units, changing their damage results in changing the damage of the spell.

ABOUT 2:

OK , hahaha now i GOT U!!!

i put comment in the Script, most of them say what u can change and
say what u MUST NOT change.
SOOOO i did a comment how to CHANGE it to be the (str x 250) + 200.
U simply dont read the scripts :thumbs_down:
however here is exactly explained what to change:

JASS:
function Trig_Spikes_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local unit g
local group G = CreateGroup() 
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local player p = GetOwningPlayer(u)
local integer level = GetUnitAbilityLevel(u,'A000')
local integer str = GetHeroStr(u, true)                         //gets the str
local integer DMG = 100*level      //str * 250 + level*100      //calculation for Damage. the Green calculation is the one u want.
local integer DummyID = 'h001'                                  //ID of the Dummy unit
local integer ArmorID = 'A003'                                  //ID of the -Armor ability
local real AoE = 150+level*50                                   //Area of Effect calculation
local real circles = 2*level                                    // how much circles u need 
local real rows = 16                                            // how much rows 
local real degre = 0
local real range = 0
local real step = 360/rows
local real distance = AoE/circles

now u pick the
JASS:
local integer DMG = 100*level      //str * 250 + level*100      //calculation for Damage. the Green calculation is the one u want.
and change it to
JASS:
local integer DMG =str * 250 + level*100      //calculation for Damage. NOW I KNOW U DONT READ MY TEXTES.

ok i hope i could help u.
As always said, the more information u give me , the more i can help u out.
greets Equal
 

Attachments

  • Spell - Melting Armor.w3x
    50.8 KB · Views: 57
Level 4
Joined
Dec 3, 2007
Messages
117
dang sorry didnt took time to open the editor and check the two maps out ><

and again, thanks for all the spells :grin:
 
Level 8
Joined
Mar 23, 2007
Messages
302
ok i checked all the Leak and cleaned up only some small things:
in fact , to my suprise, all spells but the Bombard were leakfree oO...

so here is the Bombard map again without any leaks
hf
 

Attachments

  • Spell - CatapultsBombard.w3x
    75.3 KB · Views: 52
Level 4
Joined
Dec 3, 2007
Messages
117
ok weird... i putted the slash ability for my unit... everything works fine now, no errors or whatever but now when i use the ability, the units dont get damage

like the dummy unit had 500 000 hp while my unit had 1000 attack yet i couldnt kill the 500hp footman in one shot, in fact, it didnt do anything at all...

if you dont have an idea about this, you could always set the damage for each slash :D
 
Level 8
Joined
Mar 23, 2007
Messages
302
arg -.-*

the problem is the damage detection system...
it doesnt work 100% meaning
when u cast your spell u HAVE to do nothing with this unit... when u move
attack or cast a spell, the unit does no damage to the dummy checker...
and if the dummy doesnt take damage , then nobody does.

i tried to solve this but adding "Locust" or removeing "Move" ability didnt helped.
because after the effect i couldnt add MOVE or remove locust.

However, i changed the system like this,
JASS:
function DamageDetection takes unit u returns real
local real x = GetUnitX(u) + 5 * Cos(GetUnitFacing(u) * bj_DEGTORAD)                  //---    This damage System is not 100% perfect.
local real y = GetUnitY(u) + 5 * Sin(GetUnitFacing(u) * bj_DEGTORAD)                  //---
local unit d = CreateUnit(Player(15),'e000',x,y,270)                                  //---    I just dont know a better way to get the deald damage
local real DAMAGE                                                                     //---
call PolledWait(0.01)                                                                 //---    This system gives the damage fine but in some cases.  
call IssueTargetOrder(u,"attack",d)                                                   //---
call PolledWait(1.54)                                                                 //---    change this to the units attack cd or better would be a little more.
set DAMAGE = (GetUnitState(d,UNIT_STATE_MAX_LIFE) - GetUnitState(d,UNIT_STATE_LIFE) ) //---
if DAMAGE == 0 then                                                                   //--- this checks if somthing preventer the attack
set DAMAGE = GetRandomReal(150,450)                                                                     //--- here u can set a FIX vaule, that will be deat, if the unit couldnt attack the Dummy
endif                                                                                 //---
call RemoveUnit(d)                                                                    //---
set d = null                                                                          //---
return DAMAGE                                                                         //---
endfunction

so now, when the unit wasnt interruptet by nothing, it does the normal attack
damage, but if it couldnt attack the dummy a FIXed vaule(RandomReal) will deal damage

changing it to damage depending on lvl is easy, just say what faules u want, or somthing.. let me know
 
Level 4
Joined
Dec 3, 2007
Messages
117
well if you can change it to damage per lvl then here goes :
lvl 1 : 1000 damage per slash
lvl 2 : 1500
lvl 3 : 2000
lvl 4 : 2500
lvl 5 : 3000
 
Level 8
Joined
Mar 23, 2007
Messages
302
ok, this is done quickly, just do this steps:

1. remove the Damagedetection system

JASS:
function DamageDetection takes unit u returns real
local real x = GetUnitX(u) + 5 * Cos(GetUnitFacing(u) * bj_DEGTORAD) //--- This damage System is not 100% perfect.
local real y = GetUnitY(u) + 5 * Sin(GetUnitFacing(u) * bj_DEGTORAD) //---
local unit d = CreateUnit(Player(15),'e000',x,y,270) //--- I just dont know a better way to get the deald damage
local real DAMAGE //---
call PolledWait(0.01) //--- This system gives the damage fine but in some cases.
call IssueTargetOrder(u,"attack",d) //---
call PolledWait(1.54) //--- change this to the units attack cd or better would be a little more.
set DAMAGE = (GetUnitState(d,UNIT_STATE_MAX_LIFE) - GetUnitState(d,UNIT_STATE_LIFE) ) //---
if DAMAGE == 0 then //--- this checks if somthing preventer the attack
set DAMAGE = GetRandomReal(150,450) //--- here u can set a FIX vaule, that will be deat, if the unit couldnt attack the Dummy
endif //---
call RemoveUnit(d) //---
set d = null //---
return DAMAGE //---
endfunction
just delete it.

2.
search for the DAMAGE line in the locals
and change it to this:
JASS:
local real DAMAGE = GetUnitAbilityLevel(CASTER,'A000')*500+500                                          //Fix Damage
DONE!

haw fon widis.
 
Status
Not open for further replies.
Top