Spell Dragon Fist

0zaru

Learning vJASS ;)
Reaction score
60
Import Difficulty: Medium
MUI: Yes
JASS/GUI: JASS
--------------------------------------------------------------------------------------------------
Based in the one in Dragon Ball Z Tribute, but made by me it's a really cool spell. I even think that it looks better that the one in DBZ Tribute. Also it's based on the Dragon Fist attack In one of Dragon Ball Z movies.

screen1ad2.jpg

screen2kl9.jpg

screen3bi8.jpg


Code:
The caster charges his weapon. When it finish the charge, it attack, calling upon the power of the AllMighty Dragon to strike with all his strenght in the floor.

JASS:
scope DragonFist
//*******************************************************************************************
//********************************Basic Configuration****************************************
//*******************************************************************************************
//**********************Edit This in your map (Specially the Raw Codes)**********************
//*******************************************************************************************

globals
  private integer DragonId='A001' // The Main Ability Id
  private integer DummyIncinerate='h005' // The Incinerate Effect..
  private integer DummyDragonFist='h002' // The Resurrection eFfect
  private integer DummyDragon='h000' // The Dragon
  private integer DummyFlameStrike='h004' // The FlameStrike Giant effect
  private real AoE=300//The basic aoe of the spell damage
  private boolean IsUltimate=true//If it's true the spell will deal full damage to the target if not the   damage should be reduced.
  private boolean StaticDamage=false // If true it will damage all units by an static damage not the damage per str..
//**********************If The damage is static then modify this..***************************
  private real StaticBase=400 // Deals this multiplied by each level...
//**********************If The damage isn't a static damage then modify this*****************
  private integer Multiplier=5 // This multiplier is the base of the damage
  private integer SumDamage=3 //This is the SumDamage that multiplies by the level so 5+3*level is 5 8 11 * str <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" />
endglobals

//*******************************************************************************************
//*******************************End of Basic Configuration**********************************
//*******************************************************************************************
//*******************************Preload Unit Function***************************************
//*******************************************************************************************

function PreloadUnit takes integer unitid returns nothing
  local real x=GetRectCenterX(bj_mapInitialPlayableArea)
  local real y=GetRectCenterY(bj_mapInitialPlayableArea)
  call RemoveUnit(CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),unitid,x,y,270))
endfunction

//*******************************************************************************************
//*******************************Preload Unit Function End***********************************
//*******************************Main Spell Script*******************************************
//*******************************************************************************************

private function SpellId takes nothing returns boolean
  return GetSpellAbilityId()==DragonId
endfunction

private function ally takes nothing returns boolean
  return IsUnitAlly(GetFilterUnit(),GetOwningPlayer(GetSpellAbilityUnit()))==false and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false and IsUnitType(GetFilterUnit(),UNIT_TYPE_FLYING)==false
endfunction

private function Trig_Beast_Fist_Actions takes nothing returns nothing
  local group g=CreateGroup()
  local unit w
  local unit Caster=GetSpellAbilityUnit()
  local location l=GetSpellTargetLoc()
  local real x=GetLocationX(l)
  local real y=GetLocationY(l)
  local boolexpr maincondition=Condition(function ally)
  local integer level=GetUnitAbilityLevel(Caster,DragonId)
  local real damagemultiplier=Multiplier+SumDamage*level
  local real IfStaticDamage=StaticBase*level
  local terraindeformation t
  call GroupEnumUnitsInRange(g,x,y,AoE,maincondition)
  call DestroyBoolExpr(maincondition)
  set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(Caster),DummyIncinerate,x,y,GetUnitFacing(Caster))
  call SetUnitTimeScale(bj_lastCreatedUnit, 25.00 * 0.01)
  set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(Caster),DummyDragonFist,x,y,GetUnitFacing(Caster))
  set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(Caster),DummyDragon,x,y,GetUnitFacing(Caster))
  call SetUnitFlyHeight(bj_lastCreatedUnit,0.00,800.00)
  set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(Caster),DummyIncinerate,x,y,GetUnitFacing(Caster))
  call SetUnitTimeScale(bj_lastCreatedUnit, 25.00 * 0.01)
  set t=TerrainDeformCrater(x,y,300,150,R2I(5.50)*1000,false)
loop
   set w=FirstOfGroup(g)
   exitwhen w==null
   call GroupRemoveUnit(g,w)
  if StaticDamage==false then
       if IsUltimate==true then
       call UnitDamageTarget(Caster,w,GetHeroStr(Caster,true)*damagemultiplier,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)//Deals full damage to the units.
       else
       call UnitDamageTarget(Caster,w,GetHeroStr(Caster,true)*damagemultiplier,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) // This damage will be reduced i think,..
       endif
  endif
     if StaticDamage==true then
         if IsUltimate==true then
         call UnitDamageTarget(Caster,w,IfStaticDamage,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)//Deals full damage to the units.
else
         call UnitDamageTarget(Caster,w,IfStaticDamage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) // This damage will be reduced i think,..
         endif
     endif
endloop
  set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(Caster),DummyFlameStrike,x,y,GetUnitFacing(Caster))
  call SetUnitAnimation(bj_lastCreatedUnit,&quot;birth&quot;)
  call DestroyBoolExpr(maincondition)
  call DestroyGroup(g)
  call TerrainDeformStop(t,5*1000)
  call RemoveLocation(l)
  set Caster=null
  set t=null
endfunction

//*******************************************************************************************
//**************************************End of Main Script***********************************
//**************************************Init Trig..******************************************
//*******************************************************************************************

function InitTrig_Dragon_Fist takes nothing returns nothing
	set gg_trg_Dragon_Fist=CreateTrigger()
	call TriggerRegisterAnyUnitEventBJ(gg_trg_Dragon_Fist,EVENT_PLAYER_UNIT_SPELL_EFFECT)
	call TriggerAddCondition(gg_trg_Dragon_Fist,Condition(function SpellId))
	call TriggerAddAction(gg_trg_Dragon_Fist,function Trig_Beast_Fist_Actions)
    call PreloadUnit(DummyIncinerate)
    call PreloadUnit(DummyDragonFist)
    call PreloadUnit(DummyDragon)
    call PreloadUnit(DummyFlameStrike)
endfunction 
  
//*******************************************************************************************
//***************************************End of Init Trig..**********************************
//*******************************************************************************************
endscope
 

Attachments

  • Dragon Fist.w3x
    29 KB · Views: 303

Naminator

Coming Back To Life
Reaction score
76
Great spell. Like it!. But sorry to say this..it looks very similiar to the one in DBZ Tribute. :p

PS: When you add and substract strengh you should lock the camera into the player so it won't move. Just a tip :D. Good spell by the way..
 

0zaru

Learning vJASS ;)
Reaction score
60
That's because i made it in base of DBZ Tribute spell :), but dbz tribute map is protected for the people so i just made it
 

0zaru

Learning vJASS ;)
Reaction score
60
*bump
Any comment about the code ? I really need to improve my skills so i need a little help :p

The code is fine ?
 

Sim

Forum Administrator
Staff member
Reaction score
534
> Any comment about the code ?

Posting it wouldn't hurt for those who want to look at it ;)

Identing your code would also be... optimal.

Loops inside loops of if/then/elses are a killer.
 

0zaru

Learning vJASS ;)
Reaction score
60
Well i posted the code... So by this:

>Identing your code would also be... optimal.
You mean... ?

and

>Loops inside loops of if/then/elses are a killer.
So you suggest to use another thing ? hm like...?

I didn't understand the last at all
 

Sim

Forum Administrator
Staff member
Reaction score
534
I'm sorry, I meant that you should indent your code because loops within if/then/else statements are hard to read :)

I must have had a distraction.
 

0zaru

Learning vJASS ;)
Reaction score
60
It's fine now ?

JASS:
loop
set w=FirstOfGroup(g)
exitwhen w==null
call GroupRemoveUnit(g,w)

if StaticDamage==false then

if IsUltimate==true then

call UnitDamageTarget(Caster,w,GetHeroStr(Caster,true)*damagemultiplier,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)//Deals full damage to the units.

else

call UnitDamageTarget(Caster,w,GetHeroStr(Caster,true)*damagemultiplier,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) // This damage will be reduced i think,..

endif

endif
if StaticDamage==true then

if IsUltimate==true then

call UnitDamageTarget(Caster,w,IfStaticDamage,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)//Deals full damage to the units.

else

call UnitDamageTarget(Caster,w,IfStaticDamage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) // This damage will be reduced i think,..

endif

endif

endloop


I have to modify this in the spell map too ? :p
 

Sim

Forum Administrator
Staff member
Reaction score
534
Did you ever try the [noparse]
[/noparse] tags?

What they do is add spaces.

Like this:

JASS:
local unit MeAreAUnit = GetTriggerUnit()
local boolean IAreABoolean = true
if IsUnitType(MeAreAUnit, UNIT_TYPE_MECHANICAL) == false then
    call KillUnit(MeAreAUnit)  // you no longer a unit kk
else
    call RemoveUnit(MeAreAUnit)   // cant kill a mech? kk... remove!
    loop
        exitwhen IAreABoolean == true
        if MeAreAUnit == null then
            return
        endif
    endloop
endif


That is indentation ;)
 

0zaru

Learning vJASS ;)
Reaction score
60
Ok... i don't get it whenever i put the tags inside a Tag it doesn't work :(
 

Sim

Forum Administrator
Staff member
Reaction score
534
No don't use Indent tags :p

It was only an example of what is Indentation.

When you want to indent a code just press "space" a few times.
 

0zaru

Learning vJASS ;)
Reaction score
60
and now it looks better ? :p
JASS:
loop
   set w=FirstOfGroup(g)
   exitwhen w==null
   call GroupRemoveUnit(g,w)
  if StaticDamage==false then
       if IsUltimate==true then
       call UnitDamageTarget(Caster,w,GetHeroStr(Caster,true)*damagemultiplier,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)//Deals full damage to the units.
       else
       call UnitDamageTarget(Caster,w,GetHeroStr(Caster,true)*damagemultiplier,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) // This damage will be reduced i think,..
endif
endif
     if StaticDamage==true then
         if IsUltimate==true then
         call UnitDamageTarget(Caster,w,IfStaticDamage,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)//Deals full damage to the units.
else
         call UnitDamageTarget(Caster,w,IfStaticDamage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) // This damage will be reduced i think,..
endif
endif
endloop
 

Sim

Forum Administrator
Staff member
Reaction score
534
Generally, the line in which you start the "if..." should also include the "endif" but whatever :p

Do this with all your trigger.
 
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

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top