Spellpack Rotten Rots, Random Missiles, Electricity

Demi666

New Member
Reaction score
127
Ok so thanks to all on thehelper.net who helped me with some small problems in my jassing,

also credit is given to 4 persons who helped me the Most:)

so lets see.. what more.. well

MUI: Yes sir
GUI/Jass?: its jass:D
Leakless: Yes sire i think so <3


**Screenshots Are Comming**


NOTE: Level 1 on electricity is just like a regular storm bolt,
due to the AoE of the effect gets so small, its not a large chance the eyecandy will show



More info are on tooltips where i added

Description
Additonal Info
Comments


KK Well download map and have fun! :)


Map Includes

Electricity
Rooting Rots
Random Missiles

Go easy with commenting they are my first jass spells:)


Codes...


Note: i wanted to make these spells so editeble as possible:)

Rotten Rots
JASS:
function Trig_Rotten_Rots_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == &#039;A000&#039;
endfunction

constant function damagee takes nothing returns real
return 99999.00
//Edit &quot; 20.00 &quot; for the amount of damage the target will recieve per second!<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile    :)" loading="lazy" data-shortname=":)" />
endfunction

 function length takes unit cast returns real
return ( 1200 / GetUnitLifePercent(cast))
// Edit the &quot; 1200  &quot; for amount of time the unit will be entangled
endfunction

 function refill takes unit cast returns integer
return ( 90 * GetUnitAbilityLevelSwapped(&#039;A000&#039;, cast) )
// Edit here for how much the caster will regain after every use of the spell
 endfunction

function Rot_Timer_End takes nothing returns nothing
    local timer t=GetExpiredTimer()
    call UnitDamageTarget(GetSpellAbilityUnit(),GetSpellTargetUnit(),damagee(),true, true , ATTACK_TYPE_MAGIC, DAMAGE_TYPE_PLANT,WEAPON_TYPE_WOOD_HEAVY_BASH)
 endfunction    

 function Trig_Rotten_Rots_Actions takes nothing returns nothing
 
local effect e1
local effect e2
local string sfxx = &quot;Abilities\\Spells\\NightElf\\Rejuvenation\\RejuvenationTarget.mdl&quot;
local string sfx = &quot;Abilities\\Spells\\NightElf\\EntanglingRoots\\EntanglingRootsTarget.mdl&quot;
local unit target = GetSpellTargetUnit()
local unit cast = GetSpellAbilityUnit()
local real x=GetUnitX(target)
local real y=GetUnitY(target)
local timer t = CreateTimer()
local real r = GetUnitStateSwap(UNIT_STATE_LIFE, GetSpellAbilityUnit())

 call TimerStart(t,1 ,true,function Rot_Timer_End)
 
     call SetUnitState(cast, UNIT_STATE_LIFE, GetUnitState(cast, UNIT_STATE_LIFE) + refill(cast)) 
     set e1 = AddSpecialEffectTarget ( sfxx,cast,&quot;chest&quot; )
     
   set e2 = AddSpecialEffect( sfx,x,y )
   call PauseUnit(target,true)
   call TriggerSleepAction(length(cast))
   call PauseUnit(target,false)
 call PauseTimer(t)
 call DestroyTimer(t)
   call SetUnitState(cast, UNIT_STATE_LIFE, GetUnitState(cast, UNIT_STATE_LIFE) + refill(cast)) 
    
    
    call DestroyEffect(e1)
    call DestroyEffect(e2)                               
    set sfx = null  
    set sfxx = null
    set t = null
    set cast = null
    set target = null
    set e1 = null
    set e2 = null
 

endfunction

//===========================================================================
function InitTrig_Rotten_Rots takes nothing returns nothing
    set gg_trg_Rotten_Rots = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Rotten_Rots, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Rotten_Rots, Condition( function Trig_Rotten_Rots_Conditions ) )
    call TriggerAddAction( gg_trg_Rotten_Rots, function Trig_Rotten_Rots_Actions )
endfunction


Random Missile
JASS:
function Trig_Random_Kaboom_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == &#039;A001&#039;
endfunction

constant function Ability_RC takes nothing returns integer
    return &#039;A001&#039;
    //Edit here for your new rawcode
endfunction

constant function Ability_Dummy_RC takes nothing returns integer
    return &#039;A002&#039;
    // Edit here for the rawcode of your dummy spell
endfunction

function Dummy_Unit takes nothing returns integer
    return &#039;h000&#039;
    // Edit here for the rawcode of your dummy unit
endfunction

constant function Time takes nothing returns integer
    return 20
    // every wave of missile has 3 missiles in it
    // also there is 0,5 seconds delay between every shot ( or as you select in -
    // - delay trigger )
    // so you can calculate yourself how long / many missiles
    // it will be
endfunction

constant function delay takes nothing returns real
    return 0.5
    // EDIT HERE FOR THE DELAY BETWEEN MISSILE WAVES
endfunction

function Trig_Random_Kaboom_Actions takes nothing returns nothing
    local integer i = 0
    local unit d
    local unit cast = GetSpellAbilityUnit()
    local location castl
    local location loc = PolarProjectionBJ( castl, GetRandomReal(0.00, 612.00) , GetRandomReal(0.00, 360.00))
    
    
    loop
        exitwhen(i==Time())
        set i= i + 1
        set castl = GetUnitLoc(cast)
        set d = CreateUnitAtLoc(GetOwningPlayer(cast), Dummy_Unit(), castl,360)
        call SetUnitPathing(d,false)
        call UnitAddAbility(d, Ability_Dummy_RC())
        call SetUnitAbilityLevel(d, Ability_Dummy_RC(),GetUnitAbilityLevel(cast, Ability_RC()))
        call UnitApplyTimedLife(d,&#039;BTLF&#039;,2)
        call IssuePointOrderLoc(d,&quot;clusterrockets&quot;,loc)
        call RemoveLocation(loc)
        set loc = PolarProjectionBJ( castl, GetRandomReal(0.00, 612.00) , GetRandomReal(0.00, 360.00))
        call TriggerSleepAction(delay())
        call RemoveLocation(castl)
        set d = null
    endloop
    
    call RemoveLocation(loc)
    set loc     =   null
    set d       =   null
    set castl   =   null
    set cast    =   null
    
endfunction

//===========================================================================
function InitTrig_Random_Kaboom takes nothing returns nothing
    set gg_trg_Random_Kaboom = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Random_Kaboom, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Random_Kaboom, Condition( function Trig_Random_Kaboom_Conditions ) )
    call TriggerAddAction( gg_trg_Random_Kaboom, function Trig_Random_Kaboom_Actions )
endfunction



Electricity

JASS:
scope Electric

globals
 private unit MyUnit
 // my first used global <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" /> (dont touch)
endglobals

function Trig_Electric_Conditions takes nothing returns boolean
	return GetSpellAbilityId() == &#039;A004&#039;
    //Edit here for orginal rawcode for orginal spell
endfunction

function Spell takes nothing returns integer
	return &#039;A004&#039;
	// You must edit this AND the one over this , It doesent
    // need to be the same if you want the the damage/range to be
    // * some other spell 
endfunction

function Dummy_Spell takes nothing returns integer
	return &#039;A005&#039;
	// edit here for your rawcode
endfunction

function Is_Dead_Or_Not takes nothing returns boolean
	return (IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD) == false)
    // Edit here for the spell to hit dead units or not
endfunction

function Is_Unit_Ally takes unit caster returns boolean
	return ( IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(caster)))
    // edit here for Allies to be hurt or not
endfunction

function groupFilter takes nothing returns boolean
	return Is_Unit_Ally(GetTriggerUnit()) and Is_Dead_Or_Not()
    // Dont edit this
endfunction

function Buff takes nothing returns integer
	return &#039;BPSE&#039;
	// Edit here for the Wait Until Condition buff
endfunction

function Unit_Has_Buff takes nothing returns boolean
	return UnitHasBuffBJ(GetSpellTargetUnit(),Buff()) == true
    // Dont edit this
endfunction

constant function Wait_For_ConD takes nothing returns real
	return 0.27
	// Edit here for the checking between intervals
endfunction 

function Dummy takes nothing returns integer
	return &#039;h000&#039;
	//Edit here for your dummy unit
endfunction

constant function Dummy_Life_Time takes nothing returns real
	return 2.00
	// This is how long the dummies will live
endfunction

function Spell_Effect takes nothing returns string
	return &quot;slow&quot;
	//This is the order ID for the spell the dummy will cast upon the targets
endfunction




function Spell_Thingy takes nothing returns nothing
	local location temp_point = GetUnitLoc(GetEnumUnit())
	local location cast_loc = GetUnitLoc(MyUnit)
	local unit unit2
	
	//------------- This you can edit -------------------------
	local real Mana = GetUnitState(GetEnumUnit(),UNIT_STATE_MANA)
	local real Remove = 50*GetUnitAbilityLevel(MyUnit,Spell())
	local real ManaRemove = Mana - Remove
	//-----------------------------------------------------
	
	
	
	
	set unit2 = CreateUnitAtLoc(GetOwningPlayer(MyUnit),Dummy(),cast_loc,GetRandomReal(1,360))
	call RemoveLocation(temp_point)
	call UnitApplyTimedLife(unit2,&#039;BTLF&#039;,Dummy_Life_Time())
	call UnitAddAbility(unit2,Dummy_Spell())
	call SetUnitAbilityLevel(unit2,Dummy_Spell(),GetUnitAbilityLevel(GetTriggerUnit(),Spell()))
	call IssueTargetOrder(unit2,Spell_Effect(),GetEnumUnit())
	// Edit this for the damage (the 70) --------------------------------------------------------------------------------------------------------------------------------------------
	call UnitDamageTarget(GetTriggerUnit(),GetEnumUnit(),70*GetUnitAbilityLevel(GetTriggerUnit(),Spell()),true,true,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
    // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    call SetUnitState(GetEnumUnit(),UNIT_STATE_MANA,ManaRemove)

//------------- N U L L I N G ---------
	       set temp_point = null
	       set cast_loc = null
	       set unit2 = null
//---------------------------------------
endfunction



function Trig_Electric_Actions takes nothing returns nothing
	local unit caster = GetTriggerUnit()
	local unit target = GetSpellTargetUnit()
	local location loc = GetUnitLoc(target)
	local group Group = CreateGroup()
	
	
	loop
		exitwhen((GetUnitAbilityLevel(target, Buff()) &gt; 0))
		call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, Wait_For_ConD()))
	endloop
	
	set MyUnit = target
	set Group = GetUnitsInRangeOfLocMatching(150*(GetUnitAbilityLevel(caster,Spell())),loc,Condition(function groupFilter))
	call ForGroup(Group,function Spell_Thingy)

//------------- N U L L I N G ---------	
	set caster = null
	set target = null
	call RemoveLocation(loc)
	set loc = null
	call DestroyGroup(Group)
	set Group = null
//---------------------------------------
endfunction

//===========================================================================
function InitTrig_Electric takes nothing returns nothing
	set gg_trg_Electric = CreateTrigger(  )
	call TriggerRegisterAnyUnitEventBJ( gg_trg_Electric, EVENT_PLAYER_UNIT_SPELL_EFFECT )
	call TriggerAddCondition( gg_trg_Electric, Condition( function Trig_Electric_Conditions ) )
	call TriggerAddAction( gg_trg_Electric, function Trig_Electric_Actions )
endfunction

endscope
 

Attachments

  • JASS SPELLPACK.w3x
    50.6 KB · Views: 272

ReVolver

Mega Super Ultra Cool Member
Reaction score
609
Pretty decent spells, I like the Random Missiles and Electricity
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
609
double free of location in "Trig_Random_Kaboom_Actions"

Try looking at this

37367357ao4.png
 

Romek

Super Moderator
Reaction score
963
JASS:
constant function damagee takes nothing returns real
return 99999.00
//Edit &quot; 20.00 &quot; for the amount of damage the target will recieve per second!<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile    :)" loading="lazy" data-shortname=":)" />
endfunction


First thing i saw :)
Weres the "20.00"?
 

Demi666

New Member
Reaction score
127
JASS:
constant function damagee takes nothing returns real
return 99999.00
//Edit &quot; 20.00 &quot; for the amount of damage the target will recieve per second!<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile    :)" loading="lazy" data-shortname=":)" />
endfunction


First thing i saw :)
Weres the "20.00"?

i used that for the damage, but since the damage didnt work i did not bother to change it
 

Sim

Forum Administrator
Staff member
Reaction score
534
> constant function Time takes nothing returns integer

Rename your functions.

"Time", "length", "damage" is too general. Add a prefix linked with your spell or something, as they could overlapse any other function with that name in anyone's map.
 
Reaction score
456
As you know how to use scopes and private members, why don't you use that knowledge?

You can make all functions private except "InitTrig" functions.

Also, add some kind of Configuration Menu to separate the functions that users are supposed to edit from the other functions.

Never inline that much, no need for stupid comments when you submit your spells. Use comments only in constant functions/globals that are user needs to know what they do.
For an example in your random missiles spell:
JASS:
    call RemoveLocation(loc)
    set loc     =   null
    set d       =   null
    set castl   =   null
    set cast    =   null

Better:
JASS:
    call RemoveLocation(loc)
    set loc = null
    set d = null
    set castl = null
    set cast = null

Another example from electricity:
JASS:
//------------- N U L L I N G ---------
	set caster = null
	set target = null
	call RemoveLocation(loc)
	set loc = null
	call DestroyGroup(Group)
	set Group = null
//---------------------------------------
endfunction

Better:
JASS:
    set caster = null
    set target = null
    call RemoveLocation(loc)
    set loc = null
    call DestroyGroup(Group)
    set Group = null
endfunction


As you submit your spells here, make sure everything is finished.

Electricity trigger inlining is horrible:
JASS:
function Spell_Thingy takes nothing returns nothing
	local location temp_point = GetUnitLoc(GetEnumUnit())
	local location cast_loc = GetUnitLoc(MyUnit)
	local unit unit2
	
	//------------- This you can edit -------------------------
	local real Mana = GetUnitState(GetEnumUnit(),UNIT_STATE_MANA)
	local real Remove = 50*GetUnitAbilityLevel(MyUnit,Spell())
	local real ManaRemove = Mana - Remove
	//-----------------------------------------------------
	
	
	
	
	set unit2 = CreateUnitAtLoc(GetOwningPlayer(MyUnit),Dummy(),cast_loc,GetRandomReal(1,360))
	call RemoveLocation(temp_point)
	call UnitApplyTimedLife(unit2,&#039;BTLF&#039;,Dummy_Life_Time())
	call UnitAddAbility(unit2,Dummy_Spell())
	call SetUnitAbilityLevel(unit2,Dummy_Spell(),GetUnitAbilityLevel(GetTriggerUnit(),Spell()))
	call IssueTargetOrder(unit2,Spell_Effect(),GetEnumUnit())
	// Edit this for the damage (the 70) --------------------------------------------------------------------------------------------------------------------------------------------
	call UnitDamageTarget(GetTriggerUnit(),GetEnumUnit(),70*GetUnitAbilityLevel(GetTriggerUnit(),Spell()),true,true,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
    // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    call SetUnitState(GetEnumUnit(),UNIT_STATE_MANA,ManaRemove)

//------------- N U L L I N G ---------
	       set temp_point = null
	       set cast_loc = null
	       set unit2 = null
//---------------------------------------
endfunction

User won't look inside the trigger like that. Damage has to be constant function in some kind of configuration header. Do not bother to add those comment lines, they waste space.
 

Tinki3

Special Member
Reaction score
418
Spell tooltips aren't fully completed yet.
They need to have the "Tooltip - Learn - Extended" text written properly.
"If you learn this you can read its tooltip! im not gonna say what it does" is just a waste of space :p.

Also, the "Additonal Info" and "Comments" are not required.
If you have something else to say about the spell(s), put it in the spell's trigger.
Spell tooltips should only describe the spell.

You need to include implementation instructions inside the map as a disabled JASS trigger.

Rotten Rots

This spell's trigger doesn't need a timer, and I don't think the target unit
was damaged at all for the duration of the spell...

Simply use a loop with a 1 second wait - a timer is not required here.

All else seems fine.

Random Missiles

I liked this one :).

In the "Random Kaboom" trigger, remove the line: "set d = null" from the loop, as
it's in the wrong place anyway, and it is already nulled outside the loop.

Defining the "castl" variable is pointless, so don't do it. ie: the line "local location castl = GetUnitLoc(cast)" should just be "local location castl".

All else should be fine in that trigger.

Electric

In its trigger, the "cast_loc" location is not removed in the function "Spell_Thingy".

All else appears to be fine.


Overall, you need to work on tidying up your triggers in future spell submissions.

Good work for first time, anyway.
 

Demi666

New Member
Reaction score
127
> This is not MUI

No, it isn't, that's another reason why I explained to him to use a loop and not a timer.

Without an attachment system, it's pointless overall to use a timer.

in comments it says i need handlevars for the damage, and its mui since it does not deal damage and i tested to cast it multiple times, all worked no lag <3

JASS:

function Rot_Timer_End takes nothing returns nothing
    local timer t=GetExpiredTimer()
    call UnitDamageTarget(GetSpellAbilityUnit(),GetSpellTargetUnit(),damagee(),true, true , ATTACK_TYPE_MAGIC, DAMAGE_TYPE_PLANT,WEAPON_TYPE_WOOD_HEAVY_BASH)
 endfunction


This is not MUI.

read upper quote

Spell tooltips aren't fully completed yet.
They need to have the "Tooltip - Learn - Extended" text written properly.
"If you learn this you can read its tooltip! im not gonna say what it does" is just a waste of space :p.

Also, the "Additonal Info" and "Comments" are not required.
If you have something else to say about the spell(s), put it in the spell's trigger.
Spell tooltips should only describe the spell.

You need to include implementation instructions inside the map as a disabled JASS trigger.

Rotten Rots

This spell's trigger doesn't need a timer, and I don't think the target unit
was damaged at all for the duration of the spell...

Simply use a loop with a 1 second wait - a timer is not required here.

All else seems fine.

Random Missiles

I liked this one :).

In the "Random Kaboom" trigger, remove the line: "set d = null" from the loop, as
it's in the wrong place anyway, and it is already nulled outside the loop.

Defining the "castl" variable is pointless, so don't do it. ie: the line "local location castl = GetUnitLoc(cast)" should just be "local location castl".

All else should be fine in that trigger.

Electric

In its trigger, the "cast_loc" location is not removed in the function "Spell_Thingy".

All else appears to be fine.


Overall, you need to work on tidying up your triggers in future spell submissions.

Good work for first time, anyway.

>Spell tooltips aren't fully completed yet.
They need to have the "Tooltip - Learn - Extended" text written properly.
"If you learn this you can read its tooltip! im not gonna say what it does" is just a waste of space :p.

that was so ppl could see what i based the spell off

>This spell's trigger doesn't need a timer, and I don't think the target unit
was damaged at all for the duration of the spell...

Simply use a loop with a 1 second wait - a timer is not required here.

just wanted to try somthing new, and rheias though it would be a good idea :(


>Random Missiles

I liked this one :). etc..

thanks :D!

Also

why does not this work?

JASS:
//------------- This you can edit -------------------------
	local real Mana = GetUnitState(GetEnumUnit(),UNIT_STATE_MANA)
	local real Remove = 50*GetUnitAbilityLevel(MyUnit,Spell())
	local real ManaRemove = Mana - Remove
	//-----------------------------------------------------


:(
 

Hatebreeder

So many apples
Reaction score
381
*Coughs and points to the bjs*
*Coughs again and points at the global triggers*
Man, I got a serious cold these days :rolleyes:

Some things can be optimized.
oh, and use an attachment system like ABC, it's not hard to use :p

*Cough* MUI * Cough*
*sniff*
 

Sim

Forum Administrator
Staff member
Reaction score
534
On a side note...

> **Screenshots Are Comming**

It's been exactly 1 month now. I don't consider this as being "coming". :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top