Spellpack Phoenix Themed

0zaru

Learning vJASS ;)
Reaction score
60
Phoenix Hit!​
Code:
Hits a unit with all your force throwing it away from you.
screen2ne2.jpg


JASS:
scope PhoenixHit
//*******************************************************************************************
//********************************Spell Main Configuration***********************************
//********************************Edit? Very Suggested(Special the Rawcodes)*****************
//*******************************************************************************************
globals
  private integer PhHitId='A001' //Replace with the Ability Phoenix Hit raw code
  private integer DummyPhHitId='h000' //Replace with the dummy phoenix unit
  private real PhHitDistanceSum=50 //Distance per each hit on the grund
  private real DamageToWayUnits=50 //The damage that deals to all units in the way
  private real TimeToRelease=0.8 //The time to finish the spell
  private real AoEOfWayDamage=50//Returns the AoE of the Damage in way (May set to the same or more than PhHitDistanceSum)
  private real DestructableDestroyAoE=200
  private string PHStartAndReleaseEffect="Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl"
endglobals
//*******************************************************************************************
//***********************************Spell Main Condition************************************
//*******************************************************************************************
private function Trig_Phoenix_Hit_Conditions takes nothing returns boolean
return GetSpellAbilityId() == PhHitId
endfunction
//*******************************************************************************************
//************************************Main Script********************************************
//*******************************************************************************************

private function KillDestructables takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction

private function PhoenixHitMove takes nothing returns nothing
  local timer pht=GetExpiredTimer()
  local string PhHandle=GetAttachmentTable(pht)
  local group g=CreateGroup()
  local unit Caster=GetTableUnit(PhHandle,"Caster")
  local unit Target=GetTableUnit(PhHandle,"Target")
  local real Angle=GetTableReal(PhHandle,"Angle")
  local real distance=GetTableReal(PhHandle,"Distance")
  local real xTarg=GetUnitX(Target)
  local real yTarg=GetUnitY(Target)
  local effect fx
  local unit w
  local real newx=xTarg+distance*Cos(Angle*bj_DEGTORAD)
  local real newy=yTarg+distance*Sin(Angle*bj_DEGTORAD)
  local rect r=Rect(newx-DestructableDestroyAoE,newy-DestructableDestroyAoE,newx+DestructableDestroyAoE,newy+DestructableDestroyAoE)
  call EnumDestructablesInRect(r,null,function KillDestructables)
  call GroupEnumUnitsInRange(g,newx,newy,AoEOfWayDamage,null)
  loop
    set w=FirstOfGroup(g)
     exitwhen w==null
       call GroupRemoveUnit(g,w)
          if IsUnitAlly(w,GetOwningPlayer(Caster))==false then
             call UnitDamageTarget(Caster,w,DamageToWayUnits*I2R(GetUnitAbilityLevel(Caster,PhHitId)),true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
          endif
  endloop
  call SetUnitPosition(Target,newx,newy)
  set fx=AddSpecialEffect(PHStartAndReleaseEffect,newx,newy)
  set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(Caster),DummyPhHitId,newx,newy,Angle)
  call SetUnitFlyHeight(bj_lastCreatedUnit,0.00,400.00)
  set Target=null
  set Caster=null
  call DestroyEffect(fx)
  call DestroyGroup(g)
endfunction

private function Trig_Phoenix_Hit_Actions takes nothing returns nothing
  local timer pht=CreateTimer()
  local string PhHandle=GetAttachmentTable(pht)
  local unit Caster=GetSpellAbilityUnit()
  local unit Target=GetSpellTargetUnit()
  local real xCast=GetUnitX(Caster)
  local real yCast=GetUnitY(Caster)
  local real xTarg=GetUnitX(Target)
  local real yTarg=GetUnitY(Target)
  local real Angle=bj_RADTODEG*Atan2(yTarg-yCast,xTarg-xCast)
  local real distance=SquareRoot((xTarg-xCast)*(xTarg-xCast)+(yTarg-yCast)*(yTarg-yCast))
  call PauseUnit(Target,true)
  call SetTableObject(PhHandle,"caster",Caster)
  call SetTableReal(PhHandle,"Angle",Angle)
  call SetTableReal(PhHandle,"Distance",distance)
  call SetTableObject(PhHandle,"Target",Target)
  call TimerStart(pht,.1,true,function PhoenixHitMove)
  call TriggerSleepAction(TimeToRelease)
  call PauseUnit(Target,false)
  call ClearTable(PhHandle)
  set Caster=null
  set Target=null
  call DestroyTimer(pht)
  set pht=null
endfunction
//*******************************************************************************************
//*********************************Init Triggers*********************************************
//*******************************************************************************************
function InitTrig_Phoenix_Hit takes nothing returns nothing
    set gg_trg_Phoenix_Hit = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Phoenix_Hit, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Phoenix_Hit, Condition( function Trig_Phoenix_Hit_Conditions ) )
    call TriggerAddAction( gg_trg_Phoenix_Hit, function Trig_Phoenix_Hit_Actions )
    call PreloadUnit(DummyPhHitId)
endfunction

endscope


Phoenix Mastery​
Code:
Creates a defensive barrier in a 400 AoE arround your hero. When any enemy units enters in this barrier it will get damage by a % of Its current HP. Same with Ally units exept that the effect is polarized.
screen1ef4.jpg

JASS:
scope PhoenixMastery
//*******************************************************************************************
//********************************Spell Main Configuration***********************************
//********************************Edit? Very Suggested(Special the Rawcodes)*****************
//*******************************************************************************************

globals
  private integer PhoenixId='A000' //Replace with the Phoenix Mastery Ability
  private integer DummyBarrierId='h001' //Replace with the dummy unit for the circle of light
  private real HDMGBase=1 //This deals the % damage per level 1*Level
  private string RemoveBarrierEffect="Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl"
  private string AppearBarrierEffect="Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl"
  private integer duration=50 //The basic duration of the spell
  private real PhoenixAoE=400 //The AoE of the spell
  private integer MaxUnits=36 // This creates a Perfect Circle so i suggest to leave it like this.
endglobals
//*******************************************************************************************
//***********************************Spell Main Condition************************************
//*******************************************************************************************
private function Trig_Phoenix_Mastery_Conditions takes nothing returns boolean
  return GetSpellAbilityId()==PhoenixId
endfunction
//*******************************************************************************************
//************************************Main Script********************************************
//*******************************************************************************************

private function Update takes nothing returns nothing
  local timer t=GetExpiredTimer()
  local timer t2=CreateTimer()
  local string Handle=GetAttachmentTable(t)
  local unit Caster=GetTableUnit(Handle,"Caster")
  local unit dummy
  local real x=GetUnitX(Caster)
  local real y=GetUnitY(Caster)
  local real newx
  local real newy
  local integer i=0
  local real angle
  set angle=0
loop
  exitwhen i>MaxUnits
   set newx=x+PhoenixAoE*Cos(angle*bj_DEGTORAD)
   set newy=y+PhoenixAoE*Sin(angle*bj_DEGTORAD)
   set dummy=GetTableUnit(Handle,"Unit"+I2S(i))
   call SetUnitPosition(dummy,newx,newy)
   set angle=angle+10
   set i=i+1
endloop
   set Caster=null
   set dummy=null
endfunction

private function Damage takes nothing returns nothing
   local timer t2=GetExpiredTimer()
   local string Handle=GetAttachmentTable(t2)
   local unit Caster=GetTableUnit(Handle,"Caster")
   local group Units=CreateGroup()
   local real x=GetUnitX(Caster)
   local real y=GetUnitY(Caster)
   local unit w
   local real divide=HDMGBase*GetUnitAbilityLevel(Caster,PhoenixId)
   call GroupEnumUnitsInRange(Units,x,y,PhoenixAoE,null)
loop
    set w=FirstOfGroup(Units)
exitwhen w==null
    call GroupRemoveUnit(Units,w)
      if IsUnitEnemy(w,GetOwningPlayer(Caster))==true then
        call UnitDamageTarget(Caster,w,(GetUnitState(w,UNIT_STATE_LIFE)/100.00)*divide,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
      else
        call SetUnitState(w,UNIT_STATE_LIFE,GetUnitState(w,UNIT_STATE_LIFE)+(GetUnitState(w,UNIT_STATE_LIFE)/100.00)*divide)
      endif
endloop
   set Caster=null
   call DestroyGroup(Units)
endfunction


private function Trig_Phoenix_Mastery_Actions takes nothing returns nothing
   local unit Caster=GetSpellAbilityUnit()
   local unit dummy
   local effect fx
   local timer t=CreateTimer()
   local timer t2=CreateTimer()
   local integer i=0
   local real x=GetUnitX(Caster)
   local real y=GetUnitY(Caster)
   local string HandleDamage=GetAttachmentTable(t2)
   local real angle
   local real newx
   local real newy
   local string Handle=GetAttachmentTable(t)
   local real level=I2R(GetUnitAbilityLevel(Caster,PhoenixId))
   set angle=0
loop
exitwhen i>MaxUnits
   set newx=x+PhoenixAoE*Cos(angle*bj_DEGTORAD)
   set newy=y+PhoenixAoE*Sin(angle*bj_DEGTORAD)
   set dummy=CreateUnit(GetOwningPlayer(Caster),DummyBarrierId,newx,newy,270)
   call SetUnitScale(dummy,(100*level)*0.01,(100*level)*0.01,(100*level)*0.01)
   set fx=AddSpecialEffect(AppearBarrierEffect,newx,newy)
   call SetTableObject(Handle,"Unit"+I2S(i),dummy)
   set i=i+1
   set angle=angle+10
   call DestroyEffect(fx)
endloop
   call SetTableObject(HandleDamage,"Caster",Caster)
   call SetTableObject(Handle,"Caster",Caster)
   call TimerStart(t,.1,true,function Update)
   call TimerStart(t2,1,true,function Damage)
   call TriggerSleepAction(duration)
   set i=0
loop
exitwhen i>MaxUnits
   set dummy=GetTableUnit(Handle,"Unit"+I2S(i))
   set fx=AddSpecialEffect(RemoveBarrierEffect,GetUnitX(dummy),GetUnitY(dummy))
   call RemoveUnit(dummy)
   call DestroyEffect(fx)
   set i=i+1
endloop
   call ClearTable(Handle)
   call ClearTable(HandleDamage)
   call DestroyTimer(t)
   call DestroyTimer(t2)
   set t2=null
   set t=null
   set Caster=null
   set dummy=null
endfunction

//*******************************************************************************************
//*********************************Init Triggers*********************************************
//*******************************************************************************************
function InitTrig_Phoenix_Mastery takes nothing returns nothing
    set gg_trg_Phoenix_Mastery = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Phoenix_Mastery, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Phoenix_Mastery, Condition( function Trig_Phoenix_Mastery_Conditions ) )
    call TriggerAddAction( gg_trg_Phoenix_Mastery, function Trig_Phoenix_Mastery_Actions )
    call PreloadUnit(DummyBarrierId)
endfunction

endscope


Flame of Life​
Code:
When your hero dies, it has a % chances to summon the Legendary Phoenix. This mistical phoenix will resurrect all allied units and yourselft. If not a less powered phoenix will be summon.
Note:This is the best screen that i can take from it =/
screen3er3.jpg

JASS:
scope FlameOfLife
//*******************************************************************************************
//********************************Spell Main Configuration***********************************
//********************************Edit? Very Suggested(Special the Rawcodes)*****************
//*******************************************************************************************
globals
  private integer FlameOfLifeId='A002' //The ability ID
  private integer DummyLegendaryPhoenix='h002' //The dummy unit of the Phoenix (Note: revive AoE is changed in object editor) also the ability must be added in the object editor to the Phoenix.
  private real StartHealAmount=100 //It's 100*level
  private real SumAmount=50 // To 100*level +50
  private string HealEffect="Abilities\\Spells\\Items\\AIre\\AIreTarget.mdl"
  private real AoEForTheLesserPhoenixHeal=400.00
  private integer DummyFlameOfLifeAppear='h004' // The dummy flame of strike that fires up when the ability starts.
  private integer ChancesForLevel=5 //It's 5 per level =.=, for test change to 25 and level up to level 4
  private boolean AppearWithHalfLife=true //If true the resurrected hero will have 1/2 of his max hit points
endglobals
//*******************************************************************************************
//***********************************Spell Main Condition************************************
//*******************************************************************************************
function Trig_Flame_of_Life_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetDyingUnit(),FlameOfLifeId)>0
endfunction
//*******************************************************************************************
//************************************Main Script********************************************
//*******************************************************************************************
function Trig_Flame_of_Life_Actions takes nothing returns nothing
  local unit Hero=GetDyingUnit()
  local unit Phoenix
  local real x=GetUnitX(Hero)
  local group g=CreateGroup()
  local unit w
  local real y=GetUnitY(Hero)
  local real AmountHeal=(StartHealAmount*I2R(GetUnitAbilityLevel(Hero,FlameOfLifeId)))+SumAmount
if GetRandomInt(1,100)<=ChancesForLevel*GetUnitAbilityLevel(GetDyingUnit(),FlameOfLifeId) then
  set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(Hero),DummyFlameOfLifeAppear,x,y,270.00)
  call SetUnitAnimation(bj_lastCreatedUnit,"birth")
  set Phoenix=CreateUnit(GetOwningPlayer(Hero),DummyLegendaryPhoenix,x,y,270.00)
  call SetUnitAnimation(Phoenix,"birth")
  call TriggerSleepAction(0.54)
  call SetUnitAnimation(Phoenix,"stand")
  call IssueImmediateOrder(Phoenix,"resurrection")
  call TriggerSleepAction(2.54)
  call SetUnitAnimation(Phoenix,"death")
  call TriggerSleepAction(0.54)
  call RemoveUnit(Phoenix)
  call ReviveHero(Hero,x,y,true)
  call SetUnitFacing(Hero,270.00)
  call SetUnitAnimation(Hero,"victory")
if AppearWithHalfLife==true then
   call SetUnitState(Hero,UNIT_STATE_LIFE,GetUnitState(Hero,UNIT_STATE_MAX_LIFE)/2)
endif
else
  call GroupEnumUnitsInRange(g,x,y,AoEForTheLesserPhoenixHeal,null)
  set Phoenix=CreateUnit(GetOwningPlayer(Hero),DummyLegendaryPhoenix,x,y,270.00)
  call SetUnitScale(Phoenix,100*0.01,100*0.01,100*0.01)
  call SetUnitAnimation(Phoenix,"stand")
  call TriggerSleepAction(1.54)
  call SetUnitAnimation(Phoenix,"stand")
    loop
     set w=FirstOfGroup(g)
    exitwhen w==null
     call GroupRemoveUnit(g,w)
        if IsUnitAlly(w,GetOwningPlayer(Hero))==true and GetWidgetLife(w)>0.465 then
            call SetUnitState(w,UNIT_STATE_LIFE,GetUnitState(w,UNIT_STATE_LIFE)+AmountHeal)
            call DestroyEffect(AddSpecialEffectTarget(HealEffect,w,"chest"))
        endif
    endloop  
  call SetUnitAnimation(Phoenix,"death")
  call TriggerSleepAction(1.2)
  call RemoveUnit(Phoenix)
  endif
  set Phoenix=null
  set w=null
  call DestroyGroup(g)
  set Hero=null
endfunction
//*******************************************************************************************
//*********************************Init Triggers*********************************************
//*******************************************************************************************
function InitTrig_Flame_of_Life takes nothing returns nothing
    set gg_trg_Flame_of_Life = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_of_Life, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition(gg_trg_Flame_of_Life,Condition(function Trig_Flame_of_Life_Conditions))
    call TriggerAddAction( gg_trg_Flame_of_Life, function Trig_Flame_of_Life_Actions )
    call PreloadUnit(DummyLegendaryPhoenix)
    call PreloadUnit(DummyFlameOfLifeAppear)
endfunction

endscope


Map attached. Spells made for Testing my Non BJ Things :p . Please comment and post bugs =)

Please Read Requirements :p (In the map)
 

Attachments

  • [Spellpack]Phoenix Themed.w3x
    72.1 KB · Views: 221

Sim

Forum Administrator
Staff member
Reaction score
534
Nice spellpack!

The ultimate is pretty weird though. At maximum level, it does nothing 80% of the times.

At least make it somewhat useful even if your hero doesn't die, or if you're unlucky.

The Phoenix hit shouldn't throw the unit that far.
 

0zaru

Learning vJASS ;)
Reaction score
60
*updated* Added a few things in Flame of Life if you don't have luck :p It will summon a lesser phoenix that will only heal.

reduced distance in phoenix hit :p
 

Sim

Forum Administrator
Staff member
Reaction score
534
Hmm. Big Phoenix :p

Phoenix Hit's knockback should be more "smooth", if you see what I mean.

As in, not every 0.10 seconds. It should happen, say, every 0.03 seconds.

Doing that will also decrease again the overall distance, which is still too long in my opinion :p

Other than that, pretty cool!

keep it up ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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