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: 302

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.

      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